2aff3a7aeb81041b241161b700bdfa1ababa20ad
[librecmc/librecmc.git] / target / linux / generic-2.6 / patches-2.6.24 / 700-powerpc_git.patch
1 diff -x .git -x .gitignore -Nur linux-2.6.24/Documentation/kernel-parameters.txt powerpc.git/Documentation/kernel-parameters.txt
2 --- linux-2.6.24/Documentation/kernel-parameters.txt    2008-01-24 23:58:37.000000000 +0100
3 +++ powerpc.git/Documentation/kernel-parameters.txt     2008-01-28 20:25:33.000000000 +0100
4 @@ -686,6 +686,7 @@
5                         See Documentation/isdn/README.HiSax.
6  
7         hugepages=      [HW,X86-32,IA-64] Maximal number of HugeTLB pages.
8 +       hugepagesz=     [HW,IA-64,PPC] The size of the HugeTLB pages.
9  
10         i8042.direct    [HW] Put keyboard port into non-translated mode
11         i8042.dumbkbd   [HW] Pretend that controller can only read data from
12 diff -x .git -x .gitignore -Nur linux-2.6.24/Documentation/powerpc/00-INDEX powerpc.git/Documentation/powerpc/00-INDEX
13 --- linux-2.6.24/Documentation/powerpc/00-INDEX 2008-01-24 23:58:37.000000000 +0100
14 +++ powerpc.git/Documentation/powerpc/00-INDEX  2008-01-28 20:25:33.000000000 +0100
15 @@ -28,3 +28,6 @@
16         - info on sound support under Linux/PPC
17  zImage_layout.txt
18         - info on the kernel images for Linux/PPC
19 +qe_firmware.txt
20 +       - describes the layout of firmware binaries for the Freescale QUICC
21 +         Engine and the code that parses and uploads the microcode therein.
22 diff -x .git -x .gitignore -Nur linux-2.6.24/Documentation/powerpc/booting-without-of.txt powerpc.git/Documentation/powerpc/booting-without-of.txt
23 --- linux-2.6.24/Documentation/powerpc/booting-without-of.txt   2008-01-24 23:58:37.000000000 +0100
24 +++ powerpc.git/Documentation/powerpc/booting-without-of.txt    2008-01-28 20:25:33.000000000 +0100
25 @@ -52,7 +52,11 @@
26        i) Freescale QUICC Engine module (QE)
27        j) CFI or JEDEC memory-mapped NOR flash
28        k) Global Utilities Block
29 -      l) Xilinx IP cores
30 +      l) Freescale Communications Processor Module
31 +      m) Chipselect/Local Bus
32 +      n) 4xx/Axon EMAC ethernet nodes
33 +      o) Xilinx IP cores
34 +      p) Freescale Synchronous Serial Interface
35  
36    VII - Specifying interrupt information for devices
37      1) interrupts property
38 @@ -671,10 +675,10 @@
39  
40  In general, the format of an address for a device is defined by the
41  parent bus type, based on the #address-cells and #size-cells
42 -property. In the absence of such a property, the parent's parent
43 -values are used, etc... The kernel requires the root node to have
44 -those properties defining addresses format for devices directly mapped
45 -on the processor bus.
46 +properties.  Note that the parent's parent definitions of #address-cells
47 +and #size-cells are not inhereted so every node with children must specify
48 +them.  The kernel requires the root node to have those properties defining
49 +addresses format for devices directly mapped on the processor bus.
50  
51  Those 2 properties define 'cells' for representing an address and a
52  size. A "cell" is a 32-bit number. For example, if both contain 2
53 @@ -711,13 +715,14 @@
54  like address space bits, you'll have to add a bus translator to the
55  prom_parse.c file of the recent kernels for your bus type.
56  
57 -The "reg" property only defines addresses and sizes (if #size-cells
58 -is non-0) within a given bus. In order to translate addresses upward
59 +The "reg" property only defines addresses and sizes (if #size-cells is
60 +non-0) within a given bus. In order to translate addresses upward
61  (that is into parent bus addresses, and possibly into CPU physical
62  addresses), all busses must contain a "ranges" property. If the
63  "ranges" property is missing at a given level, it's assumed that
64 -translation isn't possible. The format of the "ranges" property for a
65 -bus is a list of:
66 +translation isn't possible, i.e., the registers are not visible on the
67 +parent bus.  The format of the "ranges" property for a bus is a list
68 +of:
69  
70         bus address, parent bus address, size
71  
72 @@ -735,6 +740,10 @@
73  1/1 format, unless the processor supports physical addresses greater
74  than 32-bits, in which case a 2/1 format is recommended.
75  
76 +Alternatively, the "ranges" property may be empty, indicating that the
77 +registers are visible on the parent bus using an identity mapping
78 +translation.  In other words, the parent bus address space is the same
79 +as the child bus address space.
80  
81  2) Note about "compatible" properties
82  -------------------------------------
83 @@ -1218,16 +1227,14 @@
84  
85    Required properties:
86      - reg : Offset and length of the register set for the device
87 -    - device_type : Should be "mdio"
88      - compatible : Should define the compatible device type for the
89 -      mdio.  Currently, this is most likely to be "gianfar"
90 +      mdio.  Currently, this is most likely to be "fsl,gianfar-mdio"
91  
92    Example:
93  
94         mdio@24520 {
95                 reg = <24520 20>;
96 -               device_type = "mdio"; 
97 -               compatible = "gianfar";
98 +               compatible = "fsl,gianfar-mdio";
99  
100                 ethernet-phy@0 {
101                         ......
102 @@ -1254,6 +1261,10 @@
103        services interrupts for this device.
104      - phy-handle : The phandle for the PHY connected to this ethernet
105        controller.
106 +    - fixed-link : <a b c d e> where a is emulated phy id - choose any,
107 +      but unique to the all specified fixed-links, b is duplex - 0 half,
108 +      1 full, c is link speed - d#10/d#100/d#1000, d is pause - 0 no
109 +      pause, 1 pause, e is asym_pause - 0 no asym_pause, 1 asym_pause.
110  
111    Recommended properties:
112  
113 @@ -1408,7 +1419,6 @@
114  
115     Example multi port host USB controller device node :
116         usb@22000 {
117 -               device_type = "usb";
118                 compatible = "fsl-usb2-mph";
119                 reg = <22000 1000>;
120                 #address-cells = <1>;
121 @@ -1422,7 +1432,6 @@
122  
123     Example dual role USB controller device node :
124         usb@23000 {
125 -               device_type = "usb";
126                 compatible = "fsl-usb2-dr";
127                 reg = <23000 1000>;
128                 #address-cells = <1>;
129 @@ -1586,7 +1595,6 @@
130     iii) USB (Universal Serial Bus Controller)
131  
132     Required properties:
133 -   - device_type : should be "usb".
134     - compatible : could be "qe_udc" or "fhci-hcd".
135     - mode : the could be "host" or "slave".
136     - reg : Offset and length of the register set for the device
137 @@ -1600,7 +1608,6 @@
138  
139     Example(slave):
140         usb@6c0 {
141 -               device_type = "usb";
142                 compatible = "qe_udc";
143                 reg = <6c0 40>;
144                 interrupts = <8b 0>;
145 @@ -1613,7 +1620,7 @@
146  
147     Required properties:
148     - device_type : should be "network", "hldc", "uart", "transparent"
149 -    "bisync" or "atm".
150 +     "bisync", "atm", or "serial".
151     - compatible : could be "ucc_geth" or "fsl_atm" and so on.
152     - model : should be "UCC".
153     - device-id : the ucc number(1-8), corresponding to UCCx in UM.
154 @@ -1626,6 +1633,26 @@
155     - interrupt-parent : the phandle for the interrupt controller that
156       services interrupts for this device.
157     - pio-handle : The phandle for the Parallel I/O port configuration.
158 +   - port-number : for UART drivers, the port number to use, between 0 and 3.
159 +     This usually corresponds to the /dev/ttyQE device, e.g. <0> = /dev/ttyQE0.
160 +     The port number is added to the minor number of the device.  Unlike the
161 +     CPM UART driver, the port-number is required for the QE UART driver.
162 +   - soft-uart : for UART drivers, if specified this means the QE UART device
163 +     driver should use "Soft-UART" mode, which is needed on some SOCs that have
164 +     broken UART hardware.  Soft-UART is provided via a microcode upload.
165 +   - rx-clock-name: the UCC receive clock source
166 +     "none": clock source is disabled
167 +     "brg1" through "brg16": clock source is BRG1-BRG16, respectively
168 +     "clk1" through "clk24": clock source is CLK1-CLK24, respectively
169 +   - tx-clock-name: the UCC transmit clock source
170 +     "none": clock source is disabled
171 +     "brg1" through "brg16": clock source is BRG1-BRG16, respectively
172 +     "clk1" through "clk24": clock source is CLK1-CLK24, respectively
173 +   The following two properties are deprecated.  rx-clock has been replaced
174 +   with rx-clock-name, and tx-clock has been replaced with tx-clock-name.
175 +   Drivers that currently use the deprecated properties should continue to
176 +   do so, in order to support older device trees, but they should be updated
177 +   to check for the new properties first.
178     - rx-clock : represents the UCC receive clock source.
179       0x00 : clock source is disabled;
180       0x1~0x10 : clock source is BRG1~BRG16 respectively;
181 @@ -1772,6 +1799,32 @@
182                 };
183         };
184  
185 +   viii) Uploaded QE firmware
186 +
187 +        If a new firwmare has been uploaded to the QE (usually by the
188 +        boot loader), then a 'firmware' child node should be added to the QE
189 +        node.  This node provides information on the uploaded firmware that
190 +        device drivers may need.
191 +
192 +        Required properties:
193 +        - id: The string name of the firmware.  This is taken from the 'id'
194 +              member of the qe_firmware structure of the uploaded firmware.
195 +              Device drivers can search this string to determine if the
196 +              firmware they want is already present.
197 +        - extended-modes: The Extended Modes bitfield, taken from the
198 +                          firmware binary.  It is a 64-bit number represented
199 +                          as an array of two 32-bit numbers.
200 +        - virtual-traps: The virtual traps, taken from the firmware binary.
201 +                         It is an array of 8 32-bit numbers.
202 +
203 +        Example:
204 +
205 +               firmware {
206 +                       id = "Soft-UART";
207 +                       extended-modes = <0 0>;
208 +                       virtual-traps = <0 0 0 0 0 0 0 0>;
209 +               }
210 +
211     j) CFI or JEDEC memory-mapped NOR flash
212  
213      Flash chips (Memory Technology Devices) are often used for solid state
214 @@ -2075,8 +2128,7 @@
215  
216     Example:
217         localbus@f0010100 {
218 -               compatible = "fsl,mpc8272ads-localbus",
219 -                            "fsl,mpc8272-localbus",
220 +               compatible = "fsl,mpc8272-localbus",
221                              "fsl,pq2-localbus";
222                 #address-cells = <2>;
223                 #size-cells = <1>;
224 @@ -2254,7 +2306,7 @@
225                            available.
226                            For Axon: 0x0000012a
227  
228 -   l) Xilinx IP cores
229 +   o) Xilinx IP cores
230  
231     The Xilinx EDK toolchain ships with a set of IP cores (devices) for use
232     in Xilinx Spartan and Virtex FPGAs.  The devices cover the whole range
233 @@ -2276,7 +2328,7 @@
234     properties of the device node.  In general, device nodes for IP-cores
235     will take the following form:
236  
237 -       (name)@(base-address) {
238 +       (name): (generic-name)@(base-address) {
239                 compatible = "xlnx,(ip-core-name)-(HW_VER)"
240                              [, (list of compatible devices), ...];
241                 reg = <(baseaddr) (size)>;
242 @@ -2286,6 +2338,9 @@
243                 xlnx,(parameter2) = <(int-value)>;
244         };
245  
246 +       (generic-name):   an open firmware-style name that describes the
247 +                       generic class of device.  Preferably, this is one word, such
248 +                       as 'serial' or 'ethernet'.
249         (ip-core-name): the name of the ip block (given after the BEGIN
250                         directive in system.mhs).  Should be in lowercase
251                         and all underscores '_' converted to dashes '-'.
252 @@ -2294,9 +2349,9 @@
253                         dropped from the parameter name, the name is converted
254                         to lowercase and all underscore '_' characters are
255                         converted to dashes '-'.
256 -       (baseaddr):     the C_BASEADDR parameter.
257 +       (baseaddr):     the baseaddr parameter value (often named C_BASEADDR).
258         (HW_VER):       from the HW_VER parameter.
259 -       (size):         equals C_HIGHADDR - C_BASEADDR + 1
260 +       (size):         the address range size (often C_HIGHADDR - C_BASEADDR + 1).
261  
262     Typically, the compatible list will include the exact IP core version
263     followed by an older IP core version which implements the same
264 @@ -2326,11 +2381,11 @@
265  
266     becomes the following device tree node:
267  
268 -       opb-uartlite-0@ec100000 {
269 +       opb_uartlite_0: serial@ec100000 {
270                 device_type = "serial";
271                 compatible = "xlnx,opb-uartlite-1.00.b";
272                 reg = <ec100000 10000>;
273 -               interrupt-parent = <&opb-intc>;
274 +               interrupt-parent = <&opb_intc_0>;
275                 interrupts = <1 0>; // got this from the opb_intc parameters
276                 current-speed = <d#115200>;     // standard serial device prop
277                 clock-frequency = <d#50000000>; // standard serial device prop
278 @@ -2339,16 +2394,19 @@
279                 xlnx,use-parity = <0>;
280         };
281  
282 -   Some IP cores actually implement 2 or more logical devices.  In this case,
283 -   the device should still describe the whole IP core with a single node
284 -   and add a child node for each logical device.  The ranges property can
285 -   be used to translate from parent IP-core to the registers of each device.
286 -   (Note: this makes the assumption that both logical devices have the same
287 -   bus binding.  If this is not true, then separate nodes should be used for
288 -   each logical device).  The 'cell-index' property can be used to enumerate
289 -   logical devices within an IP core.  For example, the following is the
290 -   system.mhs entry for the dual ps2 controller found on the ml403 reference
291 -   design.
292 +   Some IP cores actually implement 2 or more logical devices.  In
293 +   this case, the device should still describe the whole IP core with
294 +   a single node and add a child node for each logical device.  The
295 +   ranges property can be used to translate from parent IP-core to the
296 +   registers of each device.  In addition, the parent node should be
297 +   compatible with the bus type 'xlnx,compound', and should contain
298 +   #address-cells and #size-cells, as with any other bus.  (Note: this
299 +   makes the assumption that both logical devices have the same bus
300 +   binding.  If this is not true, then separate nodes should be used
301 +   for each logical device).  The 'cell-index' property can be used to
302 +   enumerate logical devices within an IP core.  For example, the
303 +   following is the system.mhs entry for the dual ps2 controller found
304 +   on the ml403 reference design.
305  
306         BEGIN opb_ps2_dual_ref
307                 PARAMETER INSTANCE = opb_ps2_dual_ref_0
308 @@ -2370,21 +2428,24 @@
309  
310     It would result in the following device tree nodes:
311  
312 -       opb_ps2_dual_ref_0@a9000000 {
313 +       opb_ps2_dual_ref_0: opb-ps2-dual-ref@a9000000 {
314 +               #address-cells = <1>;
315 +               #size-cells = <1>;
316 +               compatible = "xlnx,compound";
317                 ranges = <0 a9000000 2000>;
318                 // If this device had extra parameters, then they would
319                 // go here.
320                 ps2@0 {
321                         compatible = "xlnx,opb-ps2-dual-ref-1.00.a";
322                         reg = <0 40>;
323 -                       interrupt-parent = <&opb-intc>;
324 +                       interrupt-parent = <&opb_intc_0>;
325                         interrupts = <3 0>;
326                         cell-index = <0>;
327                 };
328                 ps2@1000 {
329                         compatible = "xlnx,opb-ps2-dual-ref-1.00.a";
330                         reg = <1000 40>;
331 -                       interrupt-parent = <&opb-intc>;
332 +                       interrupt-parent = <&opb_intc_0>;
333                         interrupts = <3 0>;
334                         cell-index = <0>;
335                 };
336 @@ -2447,17 +2508,18 @@
337  
338     Gives this device tree (some properties removed for clarity):
339  
340 -       plb-v34-0 {
341 +       plb@0 {
342                 #address-cells = <1>;
343                 #size-cells = <1>;
344 +               compatible = "xlnx,plb-v34-1.02.a";
345                 device_type = "ibm,plb";
346                 ranges; // 1:1 translation
347  
348 -               plb-bram-if-cntrl-0@ffff0000 {
349 +               plb_bram_if_cntrl_0: bram@ffff0000 {
350                         reg = <ffff0000 10000>;
351                 }
352  
353 -               opb-v20-0 {
354 +               opb@20000000 {
355                         #address-cells = <1>;
356                         #size-cells = <1>;
357                         ranges = <20000000 20000000 20000000
358 @@ -2465,11 +2527,11 @@
359                                   80000000 80000000 40000000
360                                   c0000000 c0000000 20000000>;
361  
362 -                       opb-uart16550-0@a0000000 {
363 +                       opb_uart16550_0: serial@a0000000 {
364                                 reg = <a00000000 2000>;
365                         };
366  
367 -                       opb-intc-0@d1000fc0 {
368 +                       opb_intc_0: interrupt-controller@d1000fc0 {
369                                 reg = <d1000fc0 20>;
370                         };
371                 };
372 @@ -2514,6 +2576,46 @@
373        Requred properties:
374         - current-speed : Baud rate of uartlite
375  
376 +    p) Freescale Synchronous Serial Interface
377 +
378 +       The SSI is a serial device that communicates with audio codecs.  It can
379 +       be programmed in AC97, I2S, left-justified, or right-justified modes.
380 +
381 +       Required properties:
382 +       - compatible      : compatible list, containing "fsl,ssi"
383 +       - cell-index      : the SSI, <0> = SSI1, <1> = SSI2, and so on
384 +       - reg             : offset and length of the register set for the device
385 +       - interrupts      : <a b> where a is the interrupt number and b is a
386 +                            field that represents an encoding of the sense and
387 +                           level information for the interrupt.  This should be
388 +                           encoded based on the information in section 2)
389 +                           depending on the type of interrupt controller you
390 +                           have.
391 +       - interrupt-parent : the phandle for the interrupt controller that
392 +                            services interrupts for this device.
393 +       - fsl,mode        : the operating mode for the SSI interface
394 +                           "i2s-slave" - I2S mode, SSI is clock slave
395 +                           "i2s-master" - I2S mode, SSI is clock master
396 +                           "lj-slave" - left-justified mode, SSI is clock slave
397 +                           "lj-master" - l.j. mode, SSI is clock master
398 +                           "rj-slave" - right-justified mode, SSI is clock slave
399 +                           "rj-master" - r.j., SSI is clock master
400 +                           "ac97-slave" - AC97 mode, SSI is clock slave
401 +                           "ac97-master" - AC97 mode, SSI is clock master
402 +
403 +       Optional properties:
404 +       - codec-handle    : phandle to a 'codec' node that defines an audio
405 +                           codec connected to this SSI.  This node is typically
406 +                           a child of an I2C or other control node.
407 +
408 +       Child 'codec' node required properties:
409 +       - compatible      : compatible list, contains the name of the codec
410 +
411 +       Child 'codec' node optional properties:
412 +       - clock-frequency  : The frequency of the input clock, which typically
413 +                            comes from an on-board dedicated oscillator.
414 +
415 +
416     More devices will be defined as this spec matures.
417  
418  VII - Specifying interrupt information for devices
419 diff -x .git -x .gitignore -Nur linux-2.6.24/Documentation/powerpc/qe_firmware.txt powerpc.git/Documentation/powerpc/qe_firmware.txt
420 --- linux-2.6.24/Documentation/powerpc/qe_firmware.txt  1970-01-01 01:00:00.000000000 +0100
421 +++ powerpc.git/Documentation/powerpc/qe_firmware.txt   2008-01-28 20:25:33.000000000 +0100
422 @@ -0,0 +1,295 @@
423 +          Freescale QUICC Engine Firmware Uploading
424 +          -----------------------------------------
425 +
426 +(c) 2007 Timur Tabi <timur at freescale.com>,
427 +    Freescale Semiconductor
428 +
429 +Table of Contents
430 +=================
431 +
432 +  I - Software License for Firmware
433 +
434 +  II - Microcode Availability
435 +
436 +  III - Description and Terminology
437 +
438 +  IV - Microcode Programming Details
439 +
440 +  V - Firmware Structure Layout
441 +
442 +  VI - Sample Code for Creating Firmware Files
443 +
444 +Revision Information
445 +====================
446 +
447 +November 30, 2007: Rev 1.0 - Initial version
448 +
449 +I - Software License for Firmware
450 +=================================
451 +
452 +Each firmware file comes with its own software license.  For information on
453 +the particular license, please see the license text that is distributed with
454 +the firmware.
455 +
456 +II - Microcode Availability
457 +===========================
458 +
459 +Firmware files are distributed through various channels.  Some are available on
460 +http://opensource.freescale.com.  For other firmware files, please contact
461 +your Freescale representative or your operating system vendor.
462 +
463 +III - Description and Terminology
464 +================================
465 +
466 +In this document, the term 'microcode' refers to the sequence of 32-bit
467 +integers that compose the actual QE microcode.
468 +
469 +The term 'firmware' refers to a binary blob that contains the microcode as
470 +well as other data that
471 +
472 +       1) describes the microcode's purpose
473 +       2) describes how and where to upload the microcode
474 +       3) specifies the values of various registers
475 +       4) includes additional data for use by specific device drivers
476 +
477 +Firmware files are binary files that contain only a firmware.
478 +
479 +IV - Microcode Programming Details
480 +===================================
481 +
482 +The QE architecture allows for only one microcode present in I-RAM for each
483 +RISC processor.  To replace any current microcode, a full QE reset (which
484 +disables the microcode) must be performed first.
485 +
486 +QE microcode is uploaded using the following procedure:
487 +
488 +1) The microcode is placed into I-RAM at a specific location, using the
489 +   IRAM.IADD and IRAM.IDATA registers.
490 +
491 +2) The CERCR.CIR bit is set to 0 or 1, depending on whether the firmware
492 +   needs split I-RAM.  Split I-RAM is only meaningful for SOCs that have
493 +   QEs with multiple RISC processors, such as the 8360.  Splitting the I-RAM
494 +   allows each processor to run a different microcode, effectively creating an
495 +   asymmetric multiprocessing (AMP) system.
496 +
497 +3) The TIBCR trap registers are loaded with the addresses of the trap handlers
498 +   in the microcode.
499 +
500 +4) The RSP.ECCR register is programmed with the value provided.
501 +
502 +5) If necessary, device drivers that need the virtual traps and extended mode
503 +   data will use them.
504 +
505 +Virtual Microcode Traps
506 +
507 +These virtual traps are conditional branches in the microcode.  These are
508 +"soft" provisional introduced in the ROMcode in order to enable higher
509 +flexibility and save h/w traps If new features are activated or an issue is
510 +being fixed in the RAM package utilizing they should be activated.  This data
511 +structure signals the microcode which of these virtual traps is active.
512 +
513 +This structure contains 6 words that the application should copy to some
514 +specific been defined.  This table describes the structure.
515 +
516 +       ---------------------------------------------------------------
517 +       | Offset in |                  | Destination Offset | Size of |
518 +       |   array   |     Protocol     |   within PRAM      | Operand |
519 +       --------------------------------------------------------------|
520 +       |     0     | Ethernet         |      0xF8          | 4 bytes |
521 +       |           | interworking     |                    |         |
522 +       ---------------------------------------------------------------
523 +       |     4     | ATM              |      0xF8          | 4 bytes |
524 +       |           | interworking     |                    |         |
525 +       ---------------------------------------------------------------
526 +       |     8     | PPP              |      0xF8          | 4 bytes |
527 +       |           | interworking     |                    |         |
528 +       ---------------------------------------------------------------
529 +       |     12    | Ethernet RX      |      0x22          | 1 byte  |
530 +       |           | Distributor Page |                    |         |
531 +       ---------------------------------------------------------------
532 +       |     16    | ATM Globtal      |      0x28          | 1 byte  |
533 +       |           | Params Table     |                    |         |
534 +       ---------------------------------------------------------------
535 +       |     20    | Insert Frame     |      0xF8          | 4 bytes |
536 +       ---------------------------------------------------------------
537 +
538 +
539 +Extended Modes
540 +
541 +This is a double word bit array (64 bits) that defines special functionality
542 +which has an impact on the softwarew drivers.  Each bit has its own impact
543 +and has special instructions for the s/w associated with it.  This structure is
544 +described in this table:
545 +
546 +       -----------------------------------------------------------------------
547 +       | Bit #  |     Name     |   Description                               |
548 +       -----------------------------------------------------------------------
549 +       |   0    | General      | Indicates that prior to each host command   |
550 +       |        | push command | given by the application, the software must |
551 +       |        |              | assert a special host command (push command)|
552 +       |        |              | CECDR = 0x00800000.                         |
553 +       |        |              | CECR = 0x01c1000f.                          |
554 +       -----------------------------------------------------------------------
555 +       |   1    | UCC ATM      | Indicates that after issuing ATM RX INIT    |
556 +       |        | RX INIT      | command, the host must issue another special|
557 +       |        | push command | command (push command) and immediately      |
558 +       |        |              | following that re-issue the ATM RX INIT     |
559 +       |        |              | command. (This makes the sequence of        |
560 +       |        |              | initializing the ATM receiver a sequence of |
561 +       |        |              | three host commands)                        |
562 +       |        |              | CECDR = 0x00800000.                         |
563 +       |        |              | CECR = 0x01c1000f.                          |
564 +       -----------------------------------------------------------------------
565 +       |   2    | Add/remove   | Indicates that following the specific host  |
566 +       |        | command      | command: "Add/Remove entry in Hash Lookup   |
567 +       |        | validation   | Table" used in Interworking setup, the user |
568 +       |        |              | must issue another command.                 |
569 +       |        |              | CECDR = 0xce000003.                         |
570 +       |        |              | CECR = 0x01c10f58.                          |
571 +       -----------------------------------------------------------------------
572 +       |   3    | General push | Indicates that the s/w has to initialize    |
573 +       |        | command      | some pointers in the Ethernet thread pages  |
574 +       |        |              | which are used when Header Compression is   |
575 +       |        |              | activated.  The full details of these       |
576 +       |        |              | pointers is located in the software drivers.|
577 +       -----------------------------------------------------------------------
578 +       |   4    | General push | Indicates that after issuing Ethernet TX    |
579 +       |        | command      | INIT command, user must issue this command  |
580 +       |        |              | for each SNUM of Ethernet TX thread.        |
581 +       |        |              | CECDR = 0x00800003.                         |
582 +       |        |              | CECR = 0x7'b{0}, 8'b{Enet TX thread SNUM},  |
583 +       |        |              |        1'b{1}, 12'b{0}, 4'b{1}              |
584 +       -----------------------------------------------------------------------
585 +       | 5 - 31 |     N/A      | Reserved, set to zero.                      |
586 +       -----------------------------------------------------------------------
587 +
588 +V - Firmware Structure Layout
589 +==============================
590 +
591 +QE microcode from Freescale is typically provided as a header file.  This
592 +header file contains macros that define the microcode binary itself as well as
593 +some other data used in uploading that microcode.  The format of these files
594 +do not lend themselves to simple inclusion into other code.  Hence,
595 +the need for a more portable format.  This section defines that format.
596 +
597 +Instead of distributing a header file, the microcode and related data are
598 +embedded into a binary blob.  This blob is passed to the qe_upload_firmware()
599 +function, which parses the blob and performs everything necessary to upload
600 +the microcode.
601 +
602 +All integers are big-endian.  See the comments for function
603 +qe_upload_firmware() for up-to-date implementation information.
604 +
605 +This structure supports versioning, where the version of the structure is
606 +embedded into the structure itself.  To ensure forward and backwards
607 +compatibility, all versions of the structure must use the same 'qe_header'
608 +structure at the beginning.
609 +
610 +'header' (type: struct qe_header):
611 +       The 'length' field is the size, in bytes, of the entire structure,
612 +       including all the microcode embedded in it, as well as the CRC (if
613 +       present).
614 +
615 +       The 'magic' field is an array of three bytes that contains the letters
616 +       'Q', 'E', and 'F'.  This is an identifier that indicates that this
617 +       structure is a QE Firmware structure.
618 +
619 +       The 'version' field is a single byte that indicates the version of this
620 +       structure.  If the layout of the structure should ever need to be
621 +       changed to add support for additional types of microcode, then the
622 +       version number should also be changed.
623 +
624 +The 'id' field is a null-terminated string(suitable for printing) that
625 +identifies the firmware.
626 +
627 +The 'count' field indicates the number of 'microcode' structures.  There
628 +must be one and only one 'microcode' structure for each RISC processor.
629 +Therefore, this field also represents the number of RISC processors for this
630 +SOC.
631 +
632 +The 'soc' structure contains the SOC numbers and revisions used to match
633 +the microcode to the SOC itself.  Normally, the microcode loader should
634 +check the data in this structure with the SOC number and revisions, and
635 +only upload the microcode if there's a match.  However, this check is not
636 +made on all platforms.
637 +
638 +Although it is not recommended, you can specify '0' in the soc.model
639 +field to skip matching SOCs altogether.
640 +
641 +The 'model' field is a 16-bit number that matches the actual SOC. The
642 +'major' and 'minor' fields are the major and minor revision numbrs,
643 +respectively, of the SOC.
644 +
645 +For example, to match the 8323, revision 1.0:
646 +     soc.model = 8323
647 +     soc.major = 1
648 +     soc.minor = 0
649 +
650 +'padding' is neccessary for structure alignment.  This field ensures that the
651 +'extended_modes' field is aligned on a 64-bit boundary.
652 +
653 +'extended_modes' is a bitfield that defines special functionality which has an
654 +impact on the device drivers.  Each bit has its own impact and has special
655 +instructions for the driver associated with it.  This field is stored in
656 +the QE library and available to any driver that calles qe_get_firmware_info().
657 +
658 +'vtraps' is an array of 8 words that contain virtual trap values for each
659 +virtual traps.  As with 'extended_modes', this field is stored in the QE
660 +library and available to any driver that calles qe_get_firmware_info().
661 +
662 +'microcode' (type: struct qe_microcode):
663 +       For each RISC processor there is one 'microcode' structure.  The first
664 +       'microcode' structure is for the first RISC, and so on.
665 +
666 +       The 'id' field is a null-terminated string suitable for printing that
667 +       identifies this particular microcode.
668 +
669 +       'traps' is an array of 16 words that contain hardware trap values
670 +       for each of the 16 traps.  If trap[i] is 0, then this particular
671 +       trap is to be ignored (i.e. not written to TIBCR[i]).  The entire value
672 +       is written as-is to the TIBCR[i] register, so be sure to set the EN
673 +       and T_IBP bits if necessary.
674 +
675 +       'eccr' is the value to program into the ECCR register.
676 +
677 +       'iram_offset' is the offset into IRAM to start writing the
678 +       microcode.
679 +
680 +       'count' is the number of 32-bit words in the microcode.
681 +
682 +       'code_offset' is the offset, in bytes, from the beginning of this
683 +       structure where the microcode itself can be found.  The first
684 +       microcode binary should be located immediately after the 'microcode'
685 +       array.
686 +
687 +       'major', 'minor', and 'revision' are the major, minor, and revision
688 +       version numbers, respectively, of the microcode.  If all values are 0,
689 +       then these fields are ignored.
690 +
691 +       'reserved' is necessary for structure alignment.  Since 'microcode'
692 +       is an array, the 64-bit 'extended_modes' field needs to be aligned
693 +       on a 64-bit boundary, and this can only happen if the size of
694 +       'microcode' is a multiple of 8 bytes.  To ensure that, we add
695 +       'reserved'.
696 +
697 +After the last microcode is a 32-bit CRC.  It can be calculated using
698 +this algorithm:
699 +
700 +u32 crc32(const u8 *p, unsigned int len)
701 +{
702 +       unsigned int i;
703 +       u32 crc = 0;
704 +
705 +       while (len--) {
706 +          crc ^= *p++;
707 +          for (i = 0; i < 8; i++)
708 +                  crc = (crc >> 1) ^ ((crc & 1) ? 0xedb88320 : 0);
709 +       }
710 +       return crc;
711 +}
712 +
713 +VI - Sample Code for Creating Firmware Files
714 +============================================
715 +
716 +A Python program that creates firmware binaries from the header files normally
717 +distributed by Freescale can be found on http://opensource.freescale.com.
718 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/Kconfig powerpc.git/arch/powerpc/Kconfig
719 --- linux-2.6.24/arch/powerpc/Kconfig   2008-01-24 23:58:37.000000000 +0100
720 +++ powerpc.git/arch/powerpc/Kconfig    2008-01-28 21:37:04.000000000 +0100
721 @@ -140,6 +140,9 @@
722           Used to allow a board to specify it wants a uImage built by default
723         default n
724  
725 +config REDBOOT
726 +       bool
727 +
728  config PPC64_SWSUSP
729         bool
730         depends on PPC64 && (BROKEN || (PPC_PMAC64 && EXPERIMENTAL))
731 @@ -160,11 +163,13 @@
732  
733  config PPC_OF_PLATFORM_PCI
734         bool
735 +       depends on PCI
736         depends on PPC64 # not supported on 32 bits yet
737         default n
738  
739  source "init/Kconfig"
740  
741 +source "arch/powerpc/sysdev/Kconfig"
742  source "arch/powerpc/platforms/Kconfig"
743  
744  menu "Kernel options"
745 @@ -417,7 +422,7 @@
746  
747  config ISA_DMA_API
748         bool
749 -       default y
750 +       default !PPC_ISERIES || PCI
751  
752  menu "Bus options"
753  
754 @@ -467,7 +472,7 @@
755  config PCI
756         bool "PCI support" if 40x || CPM2 || PPC_83xx || PPC_85xx || PPC_86xx \
757                 || PPC_MPC52xx || (EMBEDDED && (PPC_PSERIES || PPC_ISERIES)) \
758 -               || PPC_PS3
759 +               || PPC_PS3 || 44x
760         default y if !40x && !CPM2 && !8xx && !PPC_83xx \
761                 && !PPC_85xx && !PPC_86xx
762         default PCI_PERMEDIA if !4xx && !CPM2 && !8xx
763 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/Kconfig.debug powerpc.git/arch/powerpc/Kconfig.debug
764 --- linux-2.6.24/arch/powerpc/Kconfig.debug     2008-01-24 23:58:37.000000000 +0100
765 +++ powerpc.git/arch/powerpc/Kconfig.debug      2008-01-28 20:25:49.000000000 +0100
766 @@ -151,6 +151,13 @@
767  
768  config PPC_EARLY_DEBUG
769         bool "Early debugging (dangerous)"
770 +       help
771 +         Say Y to enable some early debugging facilities that may be available
772 +         for your processor/board combination. Those facilities are hacks
773 +         intended to debug problems early during boot, this should not be
774 +         enabled in a production kernel.
775 +         Note that enabling this will also cause the kernel default log level
776 +         to be pushed to max automatically very early during boot
777  
778  choice
779         prompt "Early debugging console"
780 @@ -218,7 +225,16 @@
781         depends on 44x
782         help
783           Select this to enable early debugging for IBM 44x chips via the
784 -         inbuilt serial port.
785 +         inbuilt serial port.  If you enable this, ensure you set
786 +          PPC_EARLY_DEBUG_44x_PHYSLOW below to suit your target board.
787 +
788 +config PPC_EARLY_DEBUG_40x
789 +       bool "Early serial debugging for IBM/AMCC 40x CPUs"
790 +       depends on 40x
791 +       help
792 +         Select this to enable early debugging for IBM 40x chips via the
793 +         inbuilt serial port. This works on chips with a 16550 compatible
794 +         UART. Xilinx chips with uartlite cannot use this option.
795  
796  config PPC_EARLY_DEBUG_CPM
797         bool "Early serial debugging for Freescale CPM-based serial ports"
798 @@ -235,12 +251,20 @@
799         hex "Low 32 bits of early debug UART physical address"
800         depends on PPC_EARLY_DEBUG_44x
801         default "0x40000200"
802 +       help
803 +         You probably want 0x40000200 for ebony boards and
804 +          0x40000300 for taishan
805  
806  config PPC_EARLY_DEBUG_44x_PHYSHIGH
807         hex "EPRN of early debug UART physical address"
808         depends on PPC_EARLY_DEBUG_44x
809         default "0x1"
810  
811 +config PPC_EARLY_DEBUG_40x_PHYSADDR
812 +       hex "Early debug UART physical address"
813 +       depends on PPC_EARLY_DEBUG_40x
814 +       default "0xef600300"
815 +
816  config PPC_EARLY_DEBUG_CPM_ADDR
817         hex "CPM UART early debug transmit descriptor address"
818         depends on PPC_EARLY_DEBUG_CPM
819 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/Makefile powerpc.git/arch/powerpc/Makefile
820 --- linux-2.6.24/arch/powerpc/Makefile  2008-01-24 23:58:37.000000000 +0100
821 +++ powerpc.git/arch/powerpc/Makefile   2008-01-28 20:25:49.000000000 +0100
822 @@ -167,6 +167,9 @@
823  $(BOOT_TARGETS): vmlinux
824         $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
825  
826 +bootwrapper_install:
827 +       $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
828 +
829  define archhelp
830    @echo '* zImage          - Compressed kernel image (arch/$(ARCH)/boot/zImage.*)'
831    @echo '  install         - Install kernel using'
832 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/4xx.c powerpc.git/arch/powerpc/boot/4xx.c
833 --- linux-2.6.24/arch/powerpc/boot/4xx.c        2008-01-24 23:58:37.000000000 +0100
834 +++ powerpc.git/arch/powerpc/boot/4xx.c 2008-01-28 20:25:49.000000000 +0100
835 @@ -22,16 +22,14 @@
836  #include "dcr.h"
837  
838  /* Read the 4xx SDRAM controller to get size of system memory. */
839 -void ibm4xx_fixup_memsize(void)
840 +void ibm4xx_sdram_fixup_memsize(void)
841  {
842         int i;
843         unsigned long memsize, bank_config;
844  
845         memsize = 0;
846         for (i = 0; i < ARRAY_SIZE(sdram_bxcr); i++) {
847 -               mtdcr(DCRN_SDRAM0_CFGADDR, sdram_bxcr[i]);
848 -               bank_config = mfdcr(DCRN_SDRAM0_CFGDATA);
849 -
850 +               bank_config = SDRAM0_READ(sdram_bxcr[i]);
851                 if (bank_config & SDRAM_CONFIG_BANK_ENABLE)
852                         memsize += SDRAM_CONFIG_BANK_SIZE(bank_config);
853         }
854 @@ -39,6 +37,69 @@
855         dt_fixup_memory(0, memsize);
856  }
857  
858 +/* Read the 440SPe MQ controller to get size of system memory. */
859 +#define DCRN_MQ0_B0BAS         0x40
860 +#define DCRN_MQ0_B1BAS         0x41
861 +#define DCRN_MQ0_B2BAS         0x42
862 +#define DCRN_MQ0_B3BAS         0x43
863 +
864 +static u64 ibm440spe_decode_bas(u32 bas)
865 +{
866 +       u64 base = ((u64)(bas & 0xFFE00000u)) << 2;
867 +
868 +       /* open coded because I'm paranoid about invalid values */
869 +       switch ((bas >> 4) & 0xFFF) {
870 +       case 0:
871 +               return 0;
872 +       case 0xffc:
873 +               return base + 0x000800000ull;
874 +       case 0xff8:
875 +               return base + 0x001000000ull;
876 +       case 0xff0:
877 +               return base + 0x002000000ull;
878 +       case 0xfe0:
879 +               return base + 0x004000000ull;
880 +       case 0xfc0:
881 +               return base + 0x008000000ull;
882 +       case 0xf80:
883 +               return base + 0x010000000ull;
884 +       case 0xf00:
885 +               return base + 0x020000000ull;
886 +       case 0xe00:
887 +               return base + 0x040000000ull;
888 +       case 0xc00:
889 +               return base + 0x080000000ull;
890 +       case 0x800:
891 +               return base + 0x100000000ull;
892 +       }
893 +       printf("Memory BAS value 0x%08x unsupported !\n", bas);
894 +       return 0;
895 +}
896 +
897 +void ibm440spe_fixup_memsize(void)
898 +{
899 +       u64 banktop, memsize = 0;
900 +
901 +       /* Ultimately, we should directly construct the memory node
902 +        * so we are able to handle holes in the memory address space
903 +        */
904 +       banktop = ibm440spe_decode_bas(mfdcr(DCRN_MQ0_B0BAS));
905 +       if (banktop > memsize)
906 +               memsize = banktop;
907 +       banktop = ibm440spe_decode_bas(mfdcr(DCRN_MQ0_B1BAS));
908 +       if (banktop > memsize)
909 +               memsize = banktop;
910 +       banktop = ibm440spe_decode_bas(mfdcr(DCRN_MQ0_B2BAS));
911 +       if (banktop > memsize)
912 +               memsize = banktop;
913 +       banktop = ibm440spe_decode_bas(mfdcr(DCRN_MQ0_B3BAS));
914 +       if (banktop > memsize)
915 +               memsize = banktop;
916 +
917 +       dt_fixup_memory(0, memsize);
918 +}
919 +
920 +
921  /* 4xx DDR1/2 Denali memory controller support */
922  /* DDR0 registers */
923  #define DDR0_02                        2
924 @@ -77,19 +138,13 @@
925  
926  #define DDR_GET_VAL(val, mask, shift)  (((val) >> (shift)) & (mask))
927  
928 -static inline u32 mfdcr_sdram0(u32 reg)
929 -{
930 -        mtdcr(DCRN_SDRAM0_CFGADDR, reg);
931 -        return mfdcr(DCRN_SDRAM0_CFGDATA);
932 -}
933 -
934  void ibm4xx_denali_fixup_memsize(void)
935  {
936         u32 val, max_cs, max_col, max_row;
937         u32 cs, col, row, bank, dpath;
938         unsigned long memsize;
939  
940 -       val = mfdcr_sdram0(DDR0_02);
941 +       val = SDRAM0_READ(DDR0_02);
942         if (!DDR_GET_VAL(val, DDR_START, DDR_START_SHIFT))
943                 fatal("DDR controller is not initialized\n");
944  
945 @@ -99,12 +154,12 @@
946         max_row = DDR_GET_VAL(val, DDR_MAX_ROW_REG, DDR_MAX_ROW_REG_SHIFT);
947  
948         /* get CS value */
949 -       val = mfdcr_sdram0(DDR0_10);
950 +       val = SDRAM0_READ(DDR0_10);
951  
952         val = DDR_GET_VAL(val, DDR_CS_MAP, DDR_CS_MAP_SHIFT);
953         cs = 0;
954         while (val) {
955 -               if (val && 0x1)
956 +               if (val & 0x1)
957                         cs++;
958                 val = val >> 1;
959         }
960 @@ -115,15 +170,15 @@
961                 fatal("DDR wrong CS configuration\n");
962  
963         /* get data path bytes */
964 -       val = mfdcr_sdram0(DDR0_14);
965 +       val = SDRAM0_READ(DDR0_14);
966  
967         if (DDR_GET_VAL(val, DDR_REDUC, DDR_REDUC_SHIFT))
968                 dpath = 8; /* 64 bits */
969         else
970                 dpath = 4; /* 32 bits */
971  
972 -       /* get adress pins (rows) */
973 -       val = mfdcr_sdram0(DDR0_42);
974 +       /* get address pins (rows) */
975 +       val = SDRAM0_READ(DDR0_42);
976  
977         row = DDR_GET_VAL(val, DDR_APIN, DDR_APIN_SHIFT);
978         if (row > max_row)
979 @@ -131,7 +186,7 @@
980         row = max_row - row;
981  
982         /* get collomn size and banks */
983 -       val = mfdcr_sdram0(DDR0_43);
984 +       val = SDRAM0_READ(DDR0_43);
985  
986         col = DDR_GET_VAL(val, DDR_COL_SZ, DDR_COL_SZ_SHIFT);
987         if (col > max_col)
988 @@ -179,13 +234,17 @@
989  #define EMAC_RESET 0x20000000
990  void ibm4xx_quiesce_eth(u32 *emac0, u32 *emac1)
991  {
992 -       /* Quiesce the MAL and EMAC(s) since PIBS/OpenBIOS don't do this for us */
993 +       /* Quiesce the MAL and EMAC(s) since PIBS/OpenBIOS don't
994 +        * do this for us
995 +        */
996         if (emac0)
997                 *emac0 = EMAC_RESET;
998         if (emac1)
999                 *emac1 = EMAC_RESET;
1000  
1001         mtdcr(DCRN_MAL0_CFG, MAL_RESET);
1002 +       while (mfdcr(DCRN_MAL0_CFG) & MAL_RESET)
1003 +               ; /* loop until reset takes effect */
1004  }
1005  
1006  /* Read 4xx EBC bus bridge registers to get mappings of the peripheral
1007 @@ -217,84 +276,335 @@
1008         setprop(devp, "ranges", ranges, (p - ranges) * sizeof(u32));
1009  }
1010  
1011 -#define SPRN_CCR1 0x378
1012 -void ibm440ep_fixup_clocks(unsigned int sysclk, unsigned int ser_clk)
1013 +/* Calculate 440GP clocks */
1014 +void ibm440gp_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk)
1015  {
1016 -       u32 cpu, plb, opb, ebc, tb, uart0, m, vco;
1017 -       u32 reg;
1018 -       u32 fwdva, fwdvb, fbdv, lfbdv, opbdv0, perdv0, spcid0, prbdv0, tmp;
1019 -
1020 -       mtdcr(DCRN_CPR0_ADDR, CPR0_PLLD0);
1021 -       reg = mfdcr(DCRN_CPR0_DATA);
1022 -       tmp = (reg & 0x000F0000) >> 16;
1023 -       fwdva = tmp ? tmp : 16;
1024 -       tmp = (reg & 0x00000700) >> 8;
1025 -       fwdvb = tmp ? tmp : 8;
1026 -       tmp = (reg & 0x1F000000) >> 24;
1027 -       fbdv = tmp ? tmp : 32;
1028 -       lfbdv = (reg & 0x0000007F);
1029 -
1030 -       mtdcr(DCRN_CPR0_ADDR, CPR0_OPBD0);
1031 -       reg = mfdcr(DCRN_CPR0_DATA);
1032 -       tmp = (reg & 0x03000000) >> 24;
1033 -       opbdv0 = tmp ? tmp : 4;
1034 -
1035 -       mtdcr(DCRN_CPR0_ADDR, CPR0_PERD0);
1036 -       reg = mfdcr(DCRN_CPR0_DATA);
1037 -       tmp = (reg & 0x07000000) >> 24;
1038 -       perdv0 = tmp ? tmp : 8;
1039 -
1040 -       mtdcr(DCRN_CPR0_ADDR, CPR0_PRIMBD0);
1041 -       reg = mfdcr(DCRN_CPR0_DATA);
1042 -       tmp = (reg & 0x07000000) >> 24;
1043 -       prbdv0 = tmp ? tmp : 8;
1044 -
1045 -       mtdcr(DCRN_CPR0_ADDR, CPR0_SCPID);
1046 -       reg = mfdcr(DCRN_CPR0_DATA);
1047 -       tmp = (reg & 0x03000000) >> 24;
1048 -       spcid0 = tmp ? tmp : 4;
1049 -
1050 -       /* Calculate M */
1051 -       mtdcr(DCRN_CPR0_ADDR, CPR0_PLLC0);
1052 -       reg = mfdcr(DCRN_CPR0_DATA);
1053 -       tmp = (reg & 0x03000000) >> 24;
1054 -       if (tmp == 0) { /* PLL output */
1055 -               tmp = (reg & 0x20000000) >> 29;
1056 -               if (!tmp) /* PLLOUTA */
1057 -                       m = fbdv * lfbdv * fwdva;
1058 +       u32 sys0 = mfdcr(DCRN_CPC0_SYS0);
1059 +       u32 cr0 = mfdcr(DCRN_CPC0_CR0);
1060 +       u32 cpu, plb, opb, ebc, tb, uart0, uart1, m;
1061 +       u32 opdv = CPC0_SYS0_OPDV(sys0);
1062 +       u32 epdv = CPC0_SYS0_EPDV(sys0);
1063 +
1064 +       if (sys0 & CPC0_SYS0_BYPASS) {
1065 +               /* Bypass system PLL */
1066 +               cpu = plb = sys_clk;
1067 +       } else {
1068 +               if (sys0 & CPC0_SYS0_EXTSL)
1069 +                       /* PerClk */
1070 +                       m = CPC0_SYS0_FWDVB(sys0) * opdv * epdv;
1071                 else
1072 -                       m = fbdv * lfbdv * fwdvb;
1073 +                       /* CPU clock */
1074 +                       m = CPC0_SYS0_FBDV(sys0) * CPC0_SYS0_FWDVA(sys0);
1075 +               cpu = sys_clk * m / CPC0_SYS0_FWDVA(sys0);
1076 +               plb = sys_clk * m / CPC0_SYS0_FWDVB(sys0);
1077         }
1078 -       else if (tmp == 1) /* CPU output */
1079 -               m = fbdv * fwdva;
1080 +
1081 +       opb = plb / opdv;
1082 +       ebc = opb / epdv;
1083 +
1084 +       /* FIXME: Check if this is for all 440GP, or just Ebony */
1085 +       if ((mfpvr() & 0xf0000fff) == 0x40000440)
1086 +               /* Rev. B 440GP, use external system clock */
1087 +               tb = sys_clk;
1088         else
1089 -               m = perdv0 * opbdv0 * fwdvb;
1090 +               /* Rev. C 440GP, errata force us to use internal clock */
1091 +               tb = cpu;
1092  
1093 -       vco = (m * sysclk) + (m >> 1);
1094 -       cpu = vco / fwdva;
1095 -       plb = vco / fwdvb / prbdv0;
1096 -       opb = plb / opbdv0;
1097 -       ebc = plb / perdv0;
1098 +       if (cr0 & CPC0_CR0_U0EC)
1099 +               /* External UART clock */
1100 +               uart0 = ser_clk;
1101 +       else
1102 +               /* Internal UART clock */
1103 +               uart0 = plb / CPC0_CR0_UDIV(cr0);
1104  
1105 -       /* FIXME */
1106 -       uart0 = ser_clk;
1107 +       if (cr0 & CPC0_CR0_U1EC)
1108 +               /* External UART clock */
1109 +               uart1 = ser_clk;
1110 +       else
1111 +               /* Internal UART clock */
1112 +               uart1 = plb / CPC0_CR0_UDIV(cr0);
1113 +
1114 +       printf("PPC440GP: SysClk = %dMHz (%x)\n\r",
1115 +              (sys_clk + 500000) / 1000000, sys_clk);
1116 +
1117 +       dt_fixup_cpu_clocks(cpu, tb, 0);
1118 +
1119 +       dt_fixup_clock("/plb", plb);
1120 +       dt_fixup_clock("/plb/opb", opb);
1121 +       dt_fixup_clock("/plb/opb/ebc", ebc);
1122 +       dt_fixup_clock("/plb/opb/serial@40000200", uart0);
1123 +       dt_fixup_clock("/plb/opb/serial@40000300", uart1);
1124 +}
1125 +
1126 +#define SPRN_CCR1 0x378
1127 +
1128 +static inline u32 __fix_zero(u32 v, u32 def)
1129 +{
1130 +       return v ? v : def;
1131 +}
1132 +
1133 +static unsigned int __ibm440eplike_fixup_clocks(unsigned int sys_clk,
1134 +                                               unsigned int tmr_clk,
1135 +                                               int per_clk_from_opb)
1136 +{
1137 +       /* PLL config */
1138 +       u32 pllc  = CPR0_READ(DCRN_CPR0_PLLC);
1139 +       u32 plld  = CPR0_READ(DCRN_CPR0_PLLD);
1140 +
1141 +       /* Dividers */
1142 +       u32 fbdv   = __fix_zero((plld >> 24) & 0x1f, 32);
1143 +       u32 fwdva  = __fix_zero((plld >> 16) & 0xf, 16);
1144 +       u32 fwdvb  = __fix_zero((plld >> 8) & 7, 8);
1145 +       u32 lfbdv  = __fix_zero(plld & 0x3f, 64);
1146 +       u32 pradv0 = __fix_zero((CPR0_READ(DCRN_CPR0_PRIMAD) >> 24) & 7, 8);
1147 +       u32 prbdv0 = __fix_zero((CPR0_READ(DCRN_CPR0_PRIMBD) >> 24) & 7, 8);
1148 +       u32 opbdv0 = __fix_zero((CPR0_READ(DCRN_CPR0_OPBD) >> 24) & 3, 4);
1149 +       u32 perdv0 = __fix_zero((CPR0_READ(DCRN_CPR0_PERD) >> 24) & 3, 4);
1150 +
1151 +       /* Input clocks for primary dividers */
1152 +       u32 clk_a, clk_b;
1153 +
1154 +       /* Resulting clocks */
1155 +       u32 cpu, plb, opb, ebc, vco;
1156 +
1157 +       /* Timebase */
1158 +       u32 ccr1, tb = tmr_clk;
1159 +
1160 +       if (pllc & 0x40000000) {
1161 +               u32 m;
1162 +
1163 +               /* Feedback path */
1164 +               switch ((pllc >> 24) & 7) {
1165 +               case 0:
1166 +                       /* PLLOUTx */
1167 +                       m = ((pllc & 0x20000000) ? fwdvb : fwdva) * lfbdv;
1168 +                       break;
1169 +               case 1:
1170 +                       /* CPU */
1171 +                       m = fwdva * pradv0;
1172 +                       break;
1173 +               case 5:
1174 +                       /* PERClk */
1175 +                       m = fwdvb * prbdv0 * opbdv0 * perdv0;
1176 +                       break;
1177 +               default:
1178 +                       printf("WARNING ! Invalid PLL feedback source !\n");
1179 +                       goto bypass;
1180 +               }
1181 +               m *= fbdv;
1182 +               vco = sys_clk * m;
1183 +               clk_a = vco / fwdva;
1184 +               clk_b = vco / fwdvb;
1185 +       } else {
1186 +bypass:
1187 +               /* Bypass system PLL */
1188 +               vco = 0;
1189 +               clk_a = clk_b = sys_clk;
1190 +       }
1191 +
1192 +       cpu = clk_a / pradv0;
1193 +       plb = clk_b / prbdv0;
1194 +       opb = plb / opbdv0;
1195 +       ebc = (per_clk_from_opb ? opb : plb) / perdv0;
1196  
1197         /* Figure out timebase.  Either CPU or default TmrClk */
1198 -       asm volatile (
1199 -                       "mfspr  %0,%1\n"
1200 -                       :
1201 -                       "=&r"(reg) : "i"(SPRN_CCR1));
1202 -       if (reg & 0x0080)
1203 -               tb = 25000000; /* TmrClk is 25MHz */
1204 -       else
1205 +       ccr1 = mfspr(SPRN_CCR1);
1206 +
1207 +       /* If passed a 0 tmr_clk, force CPU clock */
1208 +       if (tb == 0) {
1209 +               ccr1 &= ~0x80u;
1210 +               mtspr(SPRN_CCR1, ccr1);
1211 +       }
1212 +       if ((ccr1 & 0x0080) == 0)
1213                 tb = cpu;
1214  
1215         dt_fixup_cpu_clocks(cpu, tb, 0);
1216         dt_fixup_clock("/plb", plb);
1217         dt_fixup_clock("/plb/opb", opb);
1218         dt_fixup_clock("/plb/opb/ebc", ebc);
1219 +
1220 +       return plb;
1221 +}
1222 +
1223 +static void eplike_fixup_uart_clk(int index, const char *path,
1224 +                                 unsigned int ser_clk,
1225 +                                 unsigned int plb_clk)
1226 +{
1227 +       unsigned int sdr;
1228 +       unsigned int clock;
1229 +
1230 +       switch (index) {
1231 +       case 0:
1232 +               sdr = SDR0_READ(DCRN_SDR0_UART0);
1233 +               break;
1234 +       case 1:
1235 +               sdr = SDR0_READ(DCRN_SDR0_UART1);
1236 +               break;
1237 +       case 2:
1238 +               sdr = SDR0_READ(DCRN_SDR0_UART2);
1239 +               break;
1240 +       case 3:
1241 +               sdr = SDR0_READ(DCRN_SDR0_UART3);
1242 +               break;
1243 +       default:
1244 +               return;
1245 +       }
1246 +
1247 +       if (sdr & 0x00800000u)
1248 +               clock = ser_clk;
1249 +       else
1250 +               clock = plb_clk / __fix_zero(sdr & 0xff, 256);
1251 +
1252 +       dt_fixup_clock(path, clock);
1253 +}
1254 +
1255 +void ibm440ep_fixup_clocks(unsigned int sys_clk,
1256 +                          unsigned int ser_clk,
1257 +                          unsigned int tmr_clk)
1258 +{
1259 +       unsigned int plb_clk = __ibm440eplike_fixup_clocks(sys_clk, tmr_clk, 0);
1260 +
1261 +       /* serial clocks beed fixup based on int/ext */
1262 +       eplike_fixup_uart_clk(0, "/plb/opb/serial@ef600300", ser_clk, plb_clk);
1263 +       eplike_fixup_uart_clk(1, "/plb/opb/serial@ef600400", ser_clk, plb_clk);
1264 +       eplike_fixup_uart_clk(2, "/plb/opb/serial@ef600500", ser_clk, plb_clk);
1265 +       eplike_fixup_uart_clk(3, "/plb/opb/serial@ef600600", ser_clk, plb_clk);
1266 +}
1267 +
1268 +void ibm440gx_fixup_clocks(unsigned int sys_clk,
1269 +                          unsigned int ser_clk,
1270 +                          unsigned int tmr_clk)
1271 +{
1272 +       unsigned int plb_clk = __ibm440eplike_fixup_clocks(sys_clk, tmr_clk, 1);
1273 +
1274 +       /* serial clocks beed fixup based on int/ext */
1275 +       eplike_fixup_uart_clk(0, "/plb/opb/serial@40000200", ser_clk, plb_clk);
1276 +       eplike_fixup_uart_clk(1, "/plb/opb/serial@40000300", ser_clk, plb_clk);
1277 +}
1278 +
1279 +void ibm440spe_fixup_clocks(unsigned int sys_clk,
1280 +                           unsigned int ser_clk,
1281 +                           unsigned int tmr_clk)
1282 +{
1283 +       unsigned int plb_clk = __ibm440eplike_fixup_clocks(sys_clk, tmr_clk, 1);
1284 +
1285 +       /* serial clocks beed fixup based on int/ext */
1286 +       eplike_fixup_uart_clk(0, "/plb/opb/serial@10000200", ser_clk, plb_clk);
1287 +       eplike_fixup_uart_clk(1, "/plb/opb/serial@10000300", ser_clk, plb_clk);
1288 +       eplike_fixup_uart_clk(2, "/plb/opb/serial@10000600", ser_clk, plb_clk);
1289 +}
1290 +
1291 +void ibm405gp_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk)
1292 +{
1293 +       u32 pllmr = mfdcr(DCRN_CPC0_PLLMR);
1294 +       u32 cpc0_cr0 = mfdcr(DCRN_405_CPC0_CR0);
1295 +       u32 cpc0_cr1 = mfdcr(DCRN_405_CPC0_CR1);
1296 +       u32 psr = mfdcr(DCRN_405_CPC0_PSR);
1297 +       u32 cpu, plb, opb, ebc, tb, uart0, uart1, m;
1298 +       u32 fwdv, fwdvb, fbdv, cbdv, opdv, epdv, ppdv, udiv;
1299 +
1300 +       fwdv = (8 - ((pllmr & 0xe0000000) >> 29));
1301 +       fbdv = (pllmr & 0x1e000000) >> 25;
1302 +       if (fbdv == 0)
1303 +               fbdv = 16;
1304 +       cbdv = ((pllmr & 0x00060000) >> 17) + 1; /* CPU:PLB */
1305 +       opdv = ((pllmr & 0x00018000) >> 15) + 1; /* PLB:OPB */
1306 +       ppdv = ((pllmr & 0x00001800) >> 13) + 1; /* PLB:PCI */
1307 +       epdv = ((pllmr & 0x00001800) >> 11) + 2; /* PLB:EBC */
1308 +       udiv = ((cpc0_cr0 & 0x3e) >> 1) + 1;
1309 +
1310 +       /* check for 405GPr */
1311 +       if ((mfpvr() & 0xfffffff0) == (0x50910951 & 0xfffffff0)) {
1312 +               fwdvb = 8 - (pllmr & 0x00000007);
1313 +               if (!(psr & 0x00001000)) /* PCI async mode enable == 0 */
1314 +                       if (psr & 0x00000020) /* New mode enable */
1315 +                               m = fwdvb * 2 * ppdv;
1316 +                       else
1317 +                               m = fwdvb * cbdv * ppdv;
1318 +               else if (psr & 0x00000020) /* New mode enable */
1319 +                       if (psr & 0x00000800) /* PerClk synch mode */
1320 +                               m = fwdvb * 2 * epdv;
1321 +                       else
1322 +                               m = fbdv * fwdv;
1323 +               else if (epdv == fbdv)
1324 +                       m = fbdv * cbdv * epdv;
1325 +               else
1326 +                       m = fbdv * fwdvb * cbdv;
1327 +
1328 +               cpu = sys_clk * m / fwdv;
1329 +               plb = sys_clk * m / (fwdvb * cbdv);
1330 +       } else {
1331 +               m = fwdv * fbdv * cbdv;
1332 +               cpu = sys_clk * m / fwdv;
1333 +               plb = cpu / cbdv;
1334 +       }
1335 +       opb = plb / opdv;
1336 +       ebc = plb / epdv;
1337 +
1338 +       if (cpc0_cr0 & 0x80)
1339 +               /* uart0 uses the external clock */
1340 +               uart0 = ser_clk;
1341 +       else
1342 +               uart0 = cpu / udiv;
1343 +
1344 +       if (cpc0_cr0 & 0x40)
1345 +               /* uart1 uses the external clock */
1346 +               uart1 = ser_clk;
1347 +       else
1348 +               uart1 = cpu / udiv;
1349 +
1350 +       /* setup the timebase clock to tick at the cpu frequency */
1351 +       cpc0_cr1 = cpc0_cr1 & ~0x00800000;
1352 +       mtdcr(DCRN_405_CPC0_CR1, cpc0_cr1);
1353 +       tb = cpu;
1354 +
1355 +       dt_fixup_cpu_clocks(cpu, tb, 0);
1356 +       dt_fixup_clock("/plb", plb);
1357 +       dt_fixup_clock("/plb/opb", opb);
1358 +       dt_fixup_clock("/plb/ebc", ebc);
1359 +       dt_fixup_clock("/plb/opb/serial@ef600300", uart0);
1360 +       dt_fixup_clock("/plb/opb/serial@ef600400", uart1);
1361 +}
1362 +
1363 +
1364 +void ibm405ep_fixup_clocks(unsigned int sys_clk)
1365 +{
1366 +       u32 pllmr0 = mfdcr(DCRN_CPC0_PLLMR0);
1367 +       u32 pllmr1 = mfdcr(DCRN_CPC0_PLLMR1);
1368 +       u32 cpc0_ucr = mfdcr(DCRN_CPC0_UCR);
1369 +       u32 cpu, plb, opb, ebc, uart0, uart1;
1370 +       u32 fwdva, fwdvb, fbdv, cbdv, opdv, epdv;
1371 +       u32 pllmr0_ccdv, tb, m;
1372 +
1373 +       fwdva = 8 - ((pllmr1 & 0x00070000) >> 16);
1374 +       fwdvb = 8 - ((pllmr1 & 0x00007000) >> 12);
1375 +       fbdv = (pllmr1 & 0x00f00000) >> 20;
1376 +       if (fbdv == 0)
1377 +               fbdv = 16;
1378 +
1379 +       cbdv = ((pllmr0 & 0x00030000) >> 16) + 1; /* CPU:PLB */
1380 +       epdv = ((pllmr0 & 0x00000300) >> 8) + 2;  /* PLB:EBC */
1381 +       opdv = ((pllmr0 & 0x00003000) >> 12) + 1; /* PLB:OPB */
1382 +
1383 +       m = fbdv * fwdvb;
1384 +
1385 +       pllmr0_ccdv = ((pllmr0 & 0x00300000) >> 20) + 1;
1386 +       if (pllmr1 & 0x80000000)
1387 +               cpu = sys_clk * m / (fwdva * pllmr0_ccdv);
1388 +       else
1389 +               cpu = sys_clk / pllmr0_ccdv;
1390 +
1391 +       plb = cpu / cbdv;
1392 +       opb = plb / opdv;
1393 +       ebc = plb / epdv;
1394 +       tb = cpu;
1395 +       uart0 = cpu / (cpc0_ucr & 0x0000007f);
1396 +       uart1 = cpu / ((cpc0_ucr & 0x00007f00) >> 8);
1397 +
1398 +       dt_fixup_cpu_clocks(cpu, tb, 0);
1399 +       dt_fixup_clock("/plb", plb);
1400 +       dt_fixup_clock("/plb/opb", opb);
1401 +       dt_fixup_clock("/plb/ebc", ebc);
1402         dt_fixup_clock("/plb/opb/serial@ef600300", uart0);
1403 -       dt_fixup_clock("/plb/opb/serial@ef600400", uart0);
1404 -       dt_fixup_clock("/plb/opb/serial@ef600500", uart0);
1405 -       dt_fixup_clock("/plb/opb/serial@ef600600", uart0);
1406 +       dt_fixup_clock("/plb/opb/serial@ef600400", uart1);
1407  }
1408 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/4xx.h powerpc.git/arch/powerpc/boot/4xx.h
1409 --- linux-2.6.24/arch/powerpc/boot/4xx.h        2008-01-24 23:58:37.000000000 +0100
1410 +++ powerpc.git/arch/powerpc/boot/4xx.h 2008-01-28 20:25:49.000000000 +0100
1411 @@ -11,12 +11,22 @@
1412  #ifndef _POWERPC_BOOT_4XX_H_
1413  #define _POWERPC_BOOT_4XX_H_
1414  
1415 -void ibm4xx_fixup_memsize(void);
1416 +void ibm4xx_sdram_fixup_memsize(void);
1417 +void ibm440spe_fixup_memsize(void);
1418  void ibm4xx_denali_fixup_memsize(void);
1419  void ibm44x_dbcr_reset(void);
1420  void ibm40x_dbcr_reset(void);
1421  void ibm4xx_quiesce_eth(u32 *emac0, u32 *emac1);
1422  void ibm4xx_fixup_ebc_ranges(const char *ebc);
1423 -void ibm440ep_fixup_clocks(unsigned int sysclk, unsigned int ser_clk);
1424 +
1425 +void ibm405gp_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk);
1426 +void ibm405ep_fixup_clocks(unsigned int sys_clk);
1427 +void ibm440gp_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk);
1428 +void ibm440ep_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk,
1429 +                          unsigned int tmr_clk);
1430 +void ibm440gx_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk,
1431 +                          unsigned int tmr_clk);
1432 +void ibm440spe_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk,
1433 +                           unsigned int tmr_clk);
1434  
1435  #endif /* _POWERPC_BOOT_4XX_H_ */
1436 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/Makefile powerpc.git/arch/powerpc/boot/Makefile
1437 --- linux-2.6.24/arch/powerpc/boot/Makefile     2008-01-24 23:58:37.000000000 +0100
1438 +++ powerpc.git/arch/powerpc/boot/Makefile      2008-01-28 20:25:49.000000000 +0100
1439 @@ -33,12 +33,15 @@
1440  BOOTCFLAGS     += -fno-stack-protector
1441  endif
1442  
1443 -BOOTCFLAGS     += -I$(obj) -I$(srctree)/$(obj)
1444 +BOOTCFLAGS     += -I$(obj) -I$(srctree)/$(obj) -I$(srctree)/$(src)/libfdt
1445  
1446  $(obj)/4xx.o: BOOTCFLAGS += -mcpu=440
1447  $(obj)/ebony.o: BOOTCFLAGS += -mcpu=440
1448 +$(obj)/cuboot-taishan.o: BOOTCFLAGS += -mcpu=440
1449 +$(obj)/cuboot-katmai.o: BOOTCFLAGS += -mcpu=440
1450  $(obj)/treeboot-walnut.o: BOOTCFLAGS += -mcpu=405
1451  
1452 +
1453  zlib       := inffast.c inflate.c inftrees.c
1454  zlibheader := inffast.h inffixed.h inflate.h inftrees.h infutil.h
1455  zliblinuxheader := zlib.h zconf.h zutil.h
1456 @@ -46,17 +49,21 @@
1457  $(addprefix $(obj)/,$(zlib) gunzip_util.o main.o): \
1458         $(addprefix $(obj)/,$(zliblinuxheader)) $(addprefix $(obj)/,$(zlibheader))
1459  
1460 -src-wlib := string.S crt0.S stdio.c main.c flatdevtree.c flatdevtree_misc.c \
1461 +src-libfdt := fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c
1462 +src-wlib := string.S crt0.S stdio.c main.c \
1463 +               $(addprefix libfdt/,$(src-libfdt)) libfdt-wrapper.c \
1464                 ns16550.c serial.c simple_alloc.c div64.S util.S \
1465                 gunzip_util.c elf_util.c $(zlib) devtree.c oflib.c ofconsole.c \
1466                 4xx.c ebony.c mv64x60.c mpsc.c mv64x60_i2c.c cuboot.c bamboo.c \
1467                 cpm-serial.c stdlib.c mpc52xx-psc.c planetcore.c uartlite.c \
1468                 fsl-soc.c mpc8xx.c pq2.c
1469 -src-plat := of.c cuboot-52xx.c cuboot-83xx.c cuboot-85xx.c holly.c \
1470 +src-plat := of.c cuboot-52xx.c cuboot-824x.c cuboot-83xx.c cuboot-85xx.c holly.c \
1471                 cuboot-ebony.c treeboot-ebony.c prpmc2800.c \
1472                 ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \
1473                 cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c cuboot-bamboo.c \
1474 -               fixed-head.S ep88xc.c cuboot-hpc2.c
1475 +               fixed-head.S ep88xc.c cuboot-hpc2.c ep405.c cuboot-taishan.c \
1476 +               cuboot-katmai.c cuboot-rainier.c redboot-8xx.c ep8248e.c \
1477 +               cuboot-warp.c
1478  src-boot := $(src-wlib) $(src-plat) empty.c
1479  
1480  src-boot := $(addprefix $(obj)/, $(src-boot))
1481 @@ -101,24 +108,61 @@
1482        cmd_bootar = $(CROSS32AR) -cr $@.$$$$ $(filter-out FORCE,$^); mv $@.$$$$ $@
1483  
1484  $(patsubst %.c,%.o, $(filter %.c, $(src-boot))): %.o: %.c FORCE
1485 +       $(Q)mkdir -p $(dir $@)
1486         $(call if_changed_dep,bootcc)
1487  $(patsubst %.S,%.o, $(filter %.S, $(src-boot))): %.o: %.S FORCE
1488 +       $(Q)mkdir -p $(dir $@)
1489         $(call if_changed_dep,bootas)
1490  
1491  $(obj)/wrapper.a: $(obj-wlib) FORCE
1492         $(call if_changed,bootar)
1493  
1494 -hostprogs-y    := addnote addRamDisk hack-coff mktree
1495 +hostprogs-y    := addnote addRamDisk hack-coff mktree dtc
1496  
1497  targets                += $(patsubst $(obj)/%,%,$(obj-boot) wrapper.a)
1498  extra-y                := $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \
1499                    $(obj)/zImage.lds $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds
1500  
1501  wrapper                :=$(srctree)/$(src)/wrapper
1502 -wrapperbits    := $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree) \
1503 +wrapperbits    := $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree dtc) \
1504                         $(wrapper) FORCE
1505  
1506  #############
1507 +# Bits for building dtc
1508 +# DTC_GENPARSER      := 1    # Uncomment to rebuild flex/bison output
1509 +
1510 +dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o srcpos.o checks.o
1511 +dtc-objs += dtc-lexer.lex.o dtc-parser.tab.o
1512 +dtc-objs := $(addprefix dtc-src/, $(dtc-objs))
1513 +
1514 +# prerequisites on generated files needs to be explicit
1515 +$(obj)/dtc-src/dtc-parser.tab.o: $(obj)/dtc-src/dtc-parser.tab.c $(obj)/dtc-src/dtc-parser.tab.h
1516 +$(obj)/dtc-src/dtc-lexer.lex.o:  $(obj)/dtc-src/dtc-lexer.lex.c $(obj)/dtc-src/dtc-parser.tab.h
1517 +
1518 +HOSTCFLAGS += -I$(src)/dtc-src/ -I$(src)/libfdt/
1519 +
1520 +targets += dtc-src/dtc-parser.tab.c
1521 +targets += dtc-src/dtc-lexer.lex.c
1522 +
1523 +ifdef DTC_GENPARSER
1524 +BISON = bison
1525 +FLEX = flex
1526 +
1527 +quiet_cmd_bison = BISON   $@
1528 +      cmd_bison = $(BISON) -o$@ -d $<; cp $@ $@_shipped
1529 +quiet_cmd_flex = FLEX    $@
1530 +      cmd_flex = $(FLEX) -o$@ $<; cp $@ $@_shipped
1531 +
1532 +$(obj)/dtc-src/dtc-parser.tab.c: $(src)/dtc-src/dtc-parser.y FORCE
1533 +     $(call if_changed,bison)
1534 +
1535 +$(obj)/dtc-src/dtc-parser.tab.h: $(obj)/dtc-src/dtc-parser.tab.c
1536 +
1537 +$(obj)/dtc-src/dtc-lexer.lex.c: $(src)/dtc-src/dtc-lexer.l FORCE
1538 +     $(call if_changed,flex)
1539 +endif
1540 +
1541 +#############
1542  # Bits for building various flavours of zImage
1543  
1544  ifneq ($(CROSS32_COMPILE),)
1545 @@ -150,15 +194,26 @@
1546  ifneq ($(CONFIG_DEVICE_TREE),"")
1547  image-$(CONFIG_PPC_8xx)                        += cuImage.8xx
1548  image-$(CONFIG_PPC_EP88XC)             += zImage.ep88xc
1549 +image-$(CONFIG_EP405)                  += zImage.ep405
1550  image-$(CONFIG_8260)                   += cuImage.pq2
1551 +image-$(CONFIG_EP8248E)                        += zImage.ep8248e
1552  image-$(CONFIG_PPC_MPC52xx)            += cuImage.52xx
1553 +image-$(CONFIG_STORCENTER)             += cuImage.824x
1554  image-$(CONFIG_PPC_83xx)               += cuImage.83xx
1555  image-$(CONFIG_PPC_85xx)               += cuImage.85xx
1556  image-$(CONFIG_MPC7448HPC2)            += cuImage.hpc2
1557  image-$(CONFIG_EBONY)                  += treeImage.ebony cuImage.ebony
1558  image-$(CONFIG_BAMBOO)                 += treeImage.bamboo cuImage.bamboo
1559  image-$(CONFIG_SEQUOIA)                        += cuImage.sequoia
1560 +image-$(CONFIG_RAINIER)                        += cuImage.rainier
1561  image-$(CONFIG_WALNUT)                 += treeImage.walnut
1562 +image-$(CONFIG_TAISHAN)                        += cuImage.taishan
1563 +image-$(CONFIG_KATMAI)                 += cuImage.katmai
1564 +image-$(CONFIG_WARP)                   += cuImage.warp
1565 +endif
1566 +
1567 +ifneq ($(CONFIG_REDBOOT),"")
1568 +image-$(CONFIG_PPC_8xx)                        += zImage.redboot-8xx
1569  endif
1570  
1571  # For 32-bit powermacs, build the COFF and miboot images
1572 @@ -243,3 +298,51 @@
1573  clean-kernel += $(addsuffix .gz,$(clean-kernel))
1574  # If not absolute clean-files are relative to $(obj).
1575  clean-files += $(addprefix $(objtree)/, $(clean-kernel))
1576 +
1577 +WRAPPER_OBJDIR := /usr/lib/kernel-wrapper
1578 +WRAPPER_DTSDIR := /usr/lib/kernel-wrapper/dts
1579 +WRAPPER_BINDIR := /usr/sbin
1580 +INSTALL := install
1581 +
1582 +extra-installed                := $(patsubst $(obj)/%, $(DESTDIR)$(WRAPPER_OBJDIR)/%, $(extra-y))
1583 +hostprogs-installed    := $(patsubst %, $(DESTDIR)$(WRAPPER_BINDIR)/%, $(hostprogs-y))
1584 +wrapper-installed      := $(DESTDIR)$(WRAPPER_BINDIR)/wrapper
1585 +dts-installed          := $(patsubst $(obj)/dts/%, $(DESTDIR)$(WRAPPER_DTSDIR)/%, $(wildcard $(obj)/dts/*.dts))
1586 +
1587 +all-installed          := $(extra-installed) $(hostprogs-installed) $(wrapper-installed) $(dts-installed)
1588 +
1589 +quiet_cmd_mkdir           = MKDIR   $(patsubst $(INSTALL_HDR_PATH)/%,%,$@)
1590 +      cmd_mkdir           = mkdir -p $@
1591 +
1592 +quiet_cmd_install        = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_OBJDIR)/%,%,$@)
1593 +      cmd_install        = $(INSTALL)  -m0644 $(patsubst $(DESTDIR)$(WRAPPER_OBJDIR)/%,$(obj)/%,$@) $@
1594 +
1595 +quiet_cmd_install_dts    = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_DTSDIR)/%,dts/%,$@)
1596 +      cmd_install_dts    = $(INSTALL)  -m0644 $(patsubst $(DESTDIR)$(WRAPPER_DTSDIR)/%,$(srctree)/$(obj)/dts/%,$@) $@
1597 +
1598 +quiet_cmd_install_exe    = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,%,$@)
1599 +      cmd_install_exe    = $(INSTALL)  -m0755 $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,$(obj)/%,$@) $@
1600 +
1601 +quiet_cmd_install_wrapper = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,%,$@)
1602 +      cmd_install_wrapper = $(INSTALL)  -m0755 $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,$(srctree)/$(obj)/%,$@) $@ ;\
1603 +                               sed -i $@ -e 's%^object=.*%object=$(WRAPPER_OBJDIR)%' \
1604 +                                         -e 's%^objbin=.*%objbin=$(WRAPPER_BINDIR)%' \
1605 +
1606 +
1607 +$(DESTDIR)$(WRAPPER_OBJDIR) $(DESTDIR)$(WRAPPER_DTSDIR) $(DESTDIR)$(WRAPPER_BINDIR):
1608 +       $(call cmd,mkdir)
1609 +
1610 +$(extra-installed)     : $(DESTDIR)$(WRAPPER_OBJDIR)/% : $(obj)/% | $(DESTDIR)$(WRAPPER_OBJDIR)
1611 +       $(call cmd,install)
1612 +
1613 +$(hostprogs-installed)  : $(DESTDIR)$(WRAPPER_BINDIR)/% : $(obj)/% | $(DESTDIR)$(WRAPPER_BINDIR)
1614 +       $(call cmd,install_exe)
1615 +
1616 +$(dts-installed)       : $(DESTDIR)$(WRAPPER_DTSDIR)/% : $(srctree)/$(obj)/dts/% | $(DESTDIR)$(WRAPPER_DTSDIR)
1617 +       $(call cmd,install_dts)
1618 +
1619 +$(wrapper-installed): $(DESTDIR)$(WRAPPER_BINDIR) $(srctree)/$(obj)/wrapper | $(DESTDIR)$(WRAPPER_BINDIR)
1620 +       $(call cmd,install_wrapper)
1621 +
1622 +$(obj)/bootwrapper_install: $(all-installed)
1623 +
1624 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/bamboo.c powerpc.git/arch/powerpc/boot/bamboo.c
1625 --- linux-2.6.24/arch/powerpc/boot/bamboo.c     2008-01-24 23:58:37.000000000 +0100
1626 +++ powerpc.git/arch/powerpc/boot/bamboo.c      2008-01-28 20:25:49.000000000 +0100
1627 @@ -30,8 +30,8 @@
1628  {
1629         unsigned long sysclk = 33333333;
1630  
1631 -       ibm440ep_fixup_clocks(sysclk, 11059200);
1632 -       ibm4xx_fixup_memsize();
1633 +       ibm440ep_fixup_clocks(sysclk, 11059200, 25000000);
1634 +       ibm4xx_sdram_fixup_memsize();
1635         ibm4xx_quiesce_eth((u32 *)0xef600e00, (u32 *)0xef600f00);
1636         dt_fixup_mac_addresses(bamboo_mac0, bamboo_mac1);
1637  }
1638 @@ -42,6 +42,6 @@
1639         platform_ops.exit = ibm44x_dbcr_reset;
1640         bamboo_mac0 = mac0;
1641         bamboo_mac1 = mac1;
1642 -       ft_init(_dtb_start, 0, 32);
1643 +       fdt_init(_dtb_start);
1644         serial_console_init();
1645  }
1646 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/cuboot-52xx.c powerpc.git/arch/powerpc/boot/cuboot-52xx.c
1647 --- linux-2.6.24/arch/powerpc/boot/cuboot-52xx.c        2008-01-24 23:58:37.000000000 +0100
1648 +++ powerpc.git/arch/powerpc/boot/cuboot-52xx.c 2008-01-28 20:25:49.000000000 +0100
1649 @@ -53,7 +53,7 @@
1650                     unsigned long r6, unsigned long r7)
1651  {
1652         CUBOOT_INIT();
1653 -       ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
1654 +       fdt_init(_dtb_start);
1655         serial_console_init();
1656         platform_ops.fixups = platform_fixups;
1657  }
1658 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/cuboot-824x.c powerpc.git/arch/powerpc/boot/cuboot-824x.c
1659 --- linux-2.6.24/arch/powerpc/boot/cuboot-824x.c        1970-01-01 01:00:00.000000000 +0100
1660 +++ powerpc.git/arch/powerpc/boot/cuboot-824x.c 2008-01-28 20:25:49.000000000 +0100
1661 @@ -0,0 +1,53 @@
1662 +/*
1663 + * Old U-boot compatibility for 824x
1664 + *
1665 + * Copyright (c) 2007 Freescale Semiconductor, Inc.
1666 + *
1667 + * This program is free software; you can redistribute it and/or modify it
1668 + * under the terms of the GNU General Public License version 2 as published
1669 + * by the Free Software Foundation.
1670 + */
1671 +
1672 +#include "ops.h"
1673 +#include "stdio.h"
1674 +#include "cuboot.h"
1675 +
1676 +#define TARGET_824x
1677 +#include "ppcboot.h"
1678 +
1679 +static bd_t bd;
1680 +
1681 +
1682 +static void platform_fixups(void)
1683 +{
1684 +       void *soc;
1685 +
1686 +       dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
1687 +       dt_fixup_mac_addresses(bd.bi_enetaddr);
1688 +       dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 4, bd.bi_busfreq);
1689 +
1690 +       soc = find_node_by_devtype(NULL, "soc");
1691 +       if (soc) {
1692 +               void *serial = NULL;
1693 +
1694 +               setprop(soc, "bus-frequency", &bd.bi_busfreq,
1695 +                       sizeof(bd.bi_busfreq));
1696 +
1697 +               while ((serial = find_node_by_devtype(serial, "serial"))) {
1698 +                       if (get_parent(serial) != soc)
1699 +                               continue;
1700 +
1701 +                       setprop(serial, "clock-frequency", &bd.bi_busfreq,
1702 +                               sizeof(bd.bi_busfreq));
1703 +               }
1704 +       }
1705 +}
1706 +
1707 +void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
1708 +                   unsigned long r6, unsigned long r7)
1709 +{
1710 +       CUBOOT_INIT();
1711 +       fdt_init(_dtb_start);
1712 +       serial_console_init();
1713 +       platform_ops.fixups = platform_fixups;
1714 +}
1715 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/cuboot-83xx.c powerpc.git/arch/powerpc/boot/cuboot-83xx.c
1716 --- linux-2.6.24/arch/powerpc/boot/cuboot-83xx.c        2008-01-24 23:58:37.000000000 +0100
1717 +++ powerpc.git/arch/powerpc/boot/cuboot-83xx.c 2008-01-28 20:25:49.000000000 +0100
1718 @@ -24,7 +24,8 @@
1719         void *soc;
1720  
1721         dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
1722 -       dt_fixup_mac_addresses(bd.bi_enetaddr, bd.bi_enet1addr);
1723 +       dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr);
1724 +       dt_fixup_mac_address_by_alias("ethernet1", bd.bi_enet1addr);
1725         dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 4, bd.bi_busfreq);
1726  
1727         /* Unfortunately, the specific model number is encoded in the
1728 @@ -52,7 +53,7 @@
1729                     unsigned long r6, unsigned long r7)
1730  {
1731         CUBOOT_INIT();
1732 -       ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
1733 +       fdt_init(_dtb_start);
1734         serial_console_init();
1735         platform_ops.fixups = platform_fixups;
1736  }
1737 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/cuboot-85xx.c powerpc.git/arch/powerpc/boot/cuboot-85xx.c
1738 --- linux-2.6.24/arch/powerpc/boot/cuboot-85xx.c        2008-01-24 23:58:37.000000000 +0100
1739 +++ powerpc.git/arch/powerpc/boot/cuboot-85xx.c 2008-01-28 20:25:49.000000000 +0100
1740 @@ -24,8 +24,9 @@
1741         void *soc;
1742  
1743         dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
1744 -       dt_fixup_mac_addresses(bd.bi_enetaddr, bd.bi_enet1addr,
1745 -                              bd.bi_enet2addr);
1746 +       dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr);
1747 +       dt_fixup_mac_address_by_alias("ethernet1", bd.bi_enet1addr);
1748 +       dt_fixup_mac_address_by_alias("ethernet2", bd.bi_enet2addr);
1749         dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 8, bd.bi_busfreq);
1750  
1751         /* Unfortunately, the specific model number is encoded in the
1752 @@ -53,7 +54,7 @@
1753                     unsigned long r6, unsigned long r7)
1754  {
1755         CUBOOT_INIT();
1756 -       ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
1757 +       fdt_init(_dtb_start);
1758         serial_console_init();
1759         platform_ops.fixups = platform_fixups;
1760  }
1761 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/cuboot-8xx.c powerpc.git/arch/powerpc/boot/cuboot-8xx.c
1762 --- linux-2.6.24/arch/powerpc/boot/cuboot-8xx.c 2008-01-24 23:58:37.000000000 +0100
1763 +++ powerpc.git/arch/powerpc/boot/cuboot-8xx.c  2008-01-28 20:25:49.000000000 +0100
1764 @@ -41,7 +41,7 @@
1765                     unsigned long r6, unsigned long r7)
1766  {
1767         CUBOOT_INIT();
1768 -       ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
1769 +       fdt_init(_dtb_start);
1770         serial_console_init();
1771         platform_ops.fixups = platform_fixups;
1772  }
1773 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/cuboot-hpc2.c powerpc.git/arch/powerpc/boot/cuboot-hpc2.c
1774 --- linux-2.6.24/arch/powerpc/boot/cuboot-hpc2.c        2008-01-24 23:58:37.000000000 +0100
1775 +++ powerpc.git/arch/powerpc/boot/cuboot-hpc2.c 2008-01-28 20:25:49.000000000 +0100
1776 @@ -42,7 +42,7 @@
1777                 unsigned long r6, unsigned long r7)
1778  {
1779         CUBOOT_INIT();
1780 -       ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
1781 +       fdt_init(_dtb_start);
1782         serial_console_init();
1783         platform_ops.fixups = platform_fixups;
1784  }
1785 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/cuboot-katmai.c powerpc.git/arch/powerpc/boot/cuboot-katmai.c
1786 --- linux-2.6.24/arch/powerpc/boot/cuboot-katmai.c      1970-01-01 01:00:00.000000000 +0100
1787 +++ powerpc.git/arch/powerpc/boot/cuboot-katmai.c       2008-01-28 20:25:49.000000000 +0100
1788 @@ -0,0 +1,56 @@
1789 +/*
1790 + * Old U-boot compatibility for Katmai
1791 + *
1792 + * Author: Hugh Blemings <hugh@au.ibm.com>
1793 + *
1794 + * Copyright 2007 Hugh Blemings, IBM Corporation.
1795 + *   Based on cuboot-ebony.c which is:
1796 + * Copyright 2007 David Gibson, IBM Corporation.
1797 + *   Based on cuboot-83xx.c, which is:
1798 + * Copyright (c) 2007 Freescale Semiconductor, Inc.
1799 + *
1800 + * This program is free software; you can redistribute it and/or modify it
1801 + * under the terms of the GNU General Public License version 2 as published
1802 + * by the Free Software Foundation.
1803 + */
1804 +
1805 +#include "ops.h"
1806 +#include "stdio.h"
1807 +#include "reg.h"
1808 +#include "dcr.h"
1809 +#include "4xx.h"
1810 +#include "44x.h"
1811 +#include "cuboot.h"
1812 +
1813 +#define TARGET_44x
1814 +#include "ppcboot.h"
1815 +
1816 +static bd_t bd;
1817 +
1818 +BSS_STACK(4096);
1819 +
1820 +static void katmai_fixups(void)
1821 +{
1822 +       unsigned long sysclk = 33333000;
1823 +
1824 +       /* 440SP Clock logic is all but identical to 440GX
1825 +        * so we just use that code for now at least
1826 +        */
1827 +       ibm440spe_fixup_clocks(sysclk, 6 * 1843200, 0);
1828 +
1829 +       ibm440spe_fixup_memsize();
1830 +
1831 +       dt_fixup_mac_address(0, bd.bi_enetaddr);
1832 +
1833 +       ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
1834 +}
1835 +
1836 +void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
1837 +                  unsigned long r6, unsigned long r7)
1838 +{
1839 +       CUBOOT_INIT();
1840 +
1841 +       platform_ops.fixups = katmai_fixups;
1842 +       fdt_init(_dtb_start);
1843 +       serial_console_init();
1844 +}
1845 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/cuboot-pq2.c powerpc.git/arch/powerpc/boot/cuboot-pq2.c
1846 --- linux-2.6.24/arch/powerpc/boot/cuboot-pq2.c 2008-01-24 23:58:37.000000000 +0100
1847 +++ powerpc.git/arch/powerpc/boot/cuboot-pq2.c  2008-01-28 20:25:49.000000000 +0100
1848 @@ -255,7 +255,7 @@
1849                     unsigned long r6, unsigned long r7)
1850  {
1851         CUBOOT_INIT();
1852 -       ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
1853 +       fdt_init(_dtb_start);
1854         serial_console_init();
1855         platform_ops.fixups = pq2_platform_fixups;
1856  }
1857 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/cuboot-rainier.c powerpc.git/arch/powerpc/boot/cuboot-rainier.c
1858 --- linux-2.6.24/arch/powerpc/boot/cuboot-rainier.c     1970-01-01 01:00:00.000000000 +0100
1859 +++ powerpc.git/arch/powerpc/boot/cuboot-rainier.c      2008-01-28 20:25:49.000000000 +0100
1860 @@ -0,0 +1,56 @@
1861 +/*
1862 + * Old U-boot compatibility for Rainier
1863 + *
1864 + * Valentine Barshak <vbarshak@ru.mvista.com>
1865 + * Copyright 2007 MontaVista Software, Inc
1866 + *
1867 + * Based on Ebony code by David Gibson <david@gibson.dropbear.id.au>
1868 + * Copyright IBM Corporation, 2007
1869 + *
1870 + * Based on Bamboo code by Josh Boyer <jwboyer@linux.vnet.ibm.com>
1871 + * Copyright IBM Corporation, 2007
1872 + *
1873 + * This program is free software; you can redistribute it and/or
1874 + * modify it under the terms of the GNU General Public License
1875 + * as published by the Free Software Foundation; version 2 of the License
1876 + */
1877 +
1878 +#include <stdarg.h>
1879 +#include <stddef.h>
1880 +#include "types.h"
1881 +#include "elf.h"
1882 +#include "string.h"
1883 +#include "stdio.h"
1884 +#include "page.h"
1885 +#include "ops.h"
1886 +#include "dcr.h"
1887 +#include "4xx.h"
1888 +#include "44x.h"
1889 +#include "cuboot.h"
1890 +
1891 +#define TARGET_4xx
1892 +#define TARGET_44x
1893 +#include "ppcboot.h"
1894 +
1895 +static bd_t bd;
1896 +
1897 +
1898 +static void rainier_fixups(void)
1899 +{
1900 +       unsigned long sysclk = 33333333;
1901 +
1902 +       ibm440ep_fixup_clocks(sysclk, 11059200, 50000000);
1903 +       ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
1904 +       ibm4xx_denali_fixup_memsize();
1905 +       dt_fixup_mac_addresses(&bd.bi_enetaddr, &bd.bi_enet1addr);
1906 +}
1907 +
1908 +void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
1909 +                   unsigned long r6, unsigned long r7)
1910 +{
1911 +       CUBOOT_INIT();
1912 +       platform_ops.fixups = rainier_fixups;
1913 +       platform_ops.exit = ibm44x_dbcr_reset;
1914 +       fdt_init(_dtb_start);
1915 +       serial_console_init();
1916 +}
1917 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/cuboot-sequoia.c powerpc.git/arch/powerpc/boot/cuboot-sequoia.c
1918 --- linux-2.6.24/arch/powerpc/boot/cuboot-sequoia.c     2008-01-24 23:58:37.000000000 +0100
1919 +++ powerpc.git/arch/powerpc/boot/cuboot-sequoia.c      2008-01-28 20:25:49.000000000 +0100
1920 @@ -39,7 +39,7 @@
1921  {
1922         unsigned long sysclk = 33333333;
1923  
1924 -       ibm440ep_fixup_clocks(sysclk, 11059200);
1925 +       ibm440ep_fixup_clocks(sysclk, 11059200, 50000000);
1926         ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
1927         ibm4xx_denali_fixup_memsize();
1928         dt_fixup_mac_addresses(&bd.bi_enetaddr, &bd.bi_enet1addr);
1929 @@ -51,6 +51,6 @@
1930         CUBOOT_INIT();
1931         platform_ops.fixups = sequoia_fixups;
1932         platform_ops.exit = ibm44x_dbcr_reset;
1933 -       ft_init(_dtb_start, 0, 32);
1934 +       fdt_init(_dtb_start);
1935         serial_console_init();
1936  }
1937 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/cuboot-taishan.c powerpc.git/arch/powerpc/boot/cuboot-taishan.c
1938 --- linux-2.6.24/arch/powerpc/boot/cuboot-taishan.c     1970-01-01 01:00:00.000000000 +0100
1939 +++ powerpc.git/arch/powerpc/boot/cuboot-taishan.c      2008-01-28 20:25:49.000000000 +0100
1940 @@ -0,0 +1,54 @@
1941 +/*
1942 + * Old U-boot compatibility for Taishan
1943 + *
1944 + * Author: Hugh Blemings <hugh@au.ibm.com>
1945 + *
1946 + * Copyright 2007 Hugh Blemings, IBM Corporation.
1947 + *   Based on cuboot-ebony.c which is:
1948 + * Copyright 2007 David Gibson, IBM Corporation.
1949 + *   Based on cuboot-83xx.c, which is:
1950 + * Copyright (c) 2007 Freescale Semiconductor, Inc.
1951 + *
1952 + * This program is free software; you can redistribute it and/or modify it
1953 + * under the terms of the GNU General Public License version 2 as published
1954 + * by the Free Software Foundation.
1955 + */
1956 +
1957 +#include "ops.h"
1958 +#include "stdio.h"
1959 +#include "cuboot.h"
1960 +#include "reg.h"
1961 +#include "dcr.h"
1962 +#include "4xx.h"
1963 +
1964 +#define TARGET_44x
1965 +#include "ppcboot.h"
1966 +
1967 +static bd_t bd;
1968 +
1969 +BSS_STACK(4096);
1970 +
1971 +static void taishan_fixups(void)
1972 +{
1973 +       /* FIXME: sysclk should be derived by reading the FPGA
1974 +          registers */
1975 +       unsigned long sysclk = 33000000;
1976 +
1977 +       ibm440gx_fixup_clocks(sysclk, 6 * 1843200, 25000000);
1978 +
1979 +       ibm4xx_sdram_fixup_memsize();
1980 +
1981 +       dt_fixup_mac_addresses(bd.bi_enetaddr, bd.bi_enet1addr);
1982 +
1983 +       ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
1984 +}
1985 +
1986 +void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
1987 +                  unsigned long r6, unsigned long r7)
1988 +{
1989 +       CUBOOT_INIT();
1990 +
1991 +       platform_ops.fixups = taishan_fixups;
1992 +       fdt_init(_dtb_start);
1993 +       serial_console_init();
1994 +}
1995 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/cuboot-warp.c powerpc.git/arch/powerpc/boot/cuboot-warp.c
1996 --- linux-2.6.24/arch/powerpc/boot/cuboot-warp.c        1970-01-01 01:00:00.000000000 +0100
1997 +++ powerpc.git/arch/powerpc/boot/cuboot-warp.c 2008-01-28 20:25:49.000000000 +0100
1998 @@ -0,0 +1,39 @@
1999 +/*
2000 + * Copyright (c) 2008 PIKA Technologies
2001 + *   Sean MacLennan <smaclennan@pikatech.com>
2002 + *
2003 + * This program is free software; you can redistribute it and/or modify it
2004 + * under the terms of the GNU General Public License version 2 as published
2005 + * by the Free Software Foundation.
2006 + */
2007 +
2008 +#include "ops.h"
2009 +#include "4xx.h"
2010 +#include "cuboot.h"
2011 +
2012 +#define TARGET_44x
2013 +#include "ppcboot.h"
2014 +
2015 +static bd_t bd;
2016 +
2017 +static void warp_fixups(void)
2018 +{
2019 +       unsigned long sysclk = 66000000;
2020 +
2021 +       ibm440ep_fixup_clocks(sysclk, 11059200, 50000000);
2022 +       ibm4xx_sdram_fixup_memsize();
2023 +       ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
2024 +       dt_fixup_mac_addresses(&bd.bi_enetaddr);
2025 +}
2026 +
2027 +
2028 +void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
2029 +                  unsigned long r6, unsigned long r7)
2030 +{
2031 +       CUBOOT_INIT();
2032 +
2033 +       platform_ops.fixups = warp_fixups;
2034 +       platform_ops.exit = ibm44x_dbcr_reset;
2035 +       fdt_init(_dtb_start);
2036 +       serial_console_init();
2037 +}
2038 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dcr.h powerpc.git/arch/powerpc/boot/dcr.h
2039 --- linux-2.6.24/arch/powerpc/boot/dcr.h        2008-01-24 23:58:37.000000000 +0100
2040 +++ powerpc.git/arch/powerpc/boot/dcr.h 2008-01-28 20:25:49.000000000 +0100
2041 @@ -14,12 +14,20 @@
2042  #define DCRN_SDRAM0_CFGADDR                            0x010
2043  #define DCRN_SDRAM0_CFGDATA                            0x011
2044  
2045 +#define SDRAM0_READ(offset) ({\
2046 +       mtdcr(DCRN_SDRAM0_CFGADDR, offset); \
2047 +       mfdcr(DCRN_SDRAM0_CFGDATA); })
2048 +#define SDRAM0_WRITE(offset, data) ({\
2049 +       mtdcr(DCRN_SDRAM0_CFGADDR, offset); \
2050 +       mtdcr(DCRN_SDRAM0_CFGDATA, data); })
2051 +
2052  #define        SDRAM0_B0CR                             0x40
2053  #define        SDRAM0_B1CR                             0x44
2054  #define        SDRAM0_B2CR                             0x48
2055  #define        SDRAM0_B3CR                             0x4c
2056  
2057 -static const unsigned long sdram_bxcr[] = { SDRAM0_B0CR, SDRAM0_B1CR, SDRAM0_B2CR, SDRAM0_B3CR };
2058 +static const unsigned long sdram_bxcr[] = { SDRAM0_B0CR, SDRAM0_B1CR,
2059 +                                           SDRAM0_B2CR, SDRAM0_B3CR };
2060  
2061  #define                        SDRAM_CONFIG_BANK_ENABLE        0x00000001
2062  #define                        SDRAM_CONFIG_SIZE_MASK          0x000e0000
2063 @@ -138,5 +146,54 @@
2064  #define DCRN_CPC0_PLLMR 0xb0
2065  #define DCRN_405_CPC0_CR0 0xb1
2066  #define DCRN_405_CPC0_CR1 0xb2
2067 +#define DCRN_405_CPC0_PSR 0xb4
2068 +
2069 +/* 405EP Clocking/Power Management/Chip Control regs */
2070 +#define DCRN_CPC0_PLLMR0  0xf0
2071 +#define DCRN_CPC0_PLLMR1  0xf4
2072 +#define DCRN_CPC0_UCR     0xf5
2073 +
2074 +/* 440GX Clock control etc */
2075 +
2076 +
2077 +#define DCRN_CPR0_CLKUPD                               0x020
2078 +#define DCRN_CPR0_PLLC                                 0x040
2079 +#define DCRN_CPR0_PLLD                                 0x060
2080 +#define DCRN_CPR0_PRIMAD                               0x080
2081 +#define DCRN_CPR0_PRIMBD                               0x0a0
2082 +#define DCRN_CPR0_OPBD                                 0x0c0
2083 +#define DCRN_CPR0_PERD                                 0x0e0
2084 +#define DCRN_CPR0_MALD                                 0x100
2085 +
2086 +#define DCRN_SDR0_CONFIG_ADDR  0xe
2087 +#define DCRN_SDR0_CONFIG_DATA  0xf
2088 +
2089 +/* SDR read/write helper macros */
2090 +#define SDR0_READ(offset) ({\
2091 +       mtdcr(DCRN_SDR0_CONFIG_ADDR, offset); \
2092 +       mfdcr(DCRN_SDR0_CONFIG_DATA); })
2093 +#define SDR0_WRITE(offset, data) ({\
2094 +       mtdcr(DCRN_SDR0_CONFIG_ADDR, offset); \
2095 +       mtdcr(DCRN_SDR0_CONFIG_DATA, data); })
2096 +
2097 +#define DCRN_SDR0_UART0                0x0120
2098 +#define DCRN_SDR0_UART1                0x0121
2099 +#define DCRN_SDR0_UART2                0x0122
2100 +#define DCRN_SDR0_UART3                0x0123
2101 +
2102 +
2103 +/* CPRs read/write helper macros - based off include/asm-ppc/ibm44x.h */
2104 +
2105 +#define DCRN_CPR0_CFGADDR                              0xc
2106 +#define DCRN_CPR0_CFGDATA                              0xd
2107 +
2108 +#define CPR0_READ(offset) ({\
2109 +       mtdcr(DCRN_CPR0_CFGADDR, offset); \
2110 +       mfdcr(DCRN_CPR0_CFGDATA); })
2111 +#define CPR0_WRITE(offset, data) ({\
2112 +       mtdcr(DCRN_CPR0_CFGADDR, offset); \
2113 +       mtdcr(DCRN_CPR0_CFGDATA, data); })
2114 +
2115 +
2116  
2117  #endif /* _PPC_BOOT_DCR_H_ */
2118 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/devtree.c powerpc.git/arch/powerpc/boot/devtree.c
2119 --- linux-2.6.24/arch/powerpc/boot/devtree.c    2008-01-24 23:58:37.000000000 +0100
2120 +++ powerpc.git/arch/powerpc/boot/devtree.c     2008-01-28 20:25:49.000000000 +0100
2121 @@ -88,6 +88,20 @@
2122         }
2123  }
2124  
2125 +void dt_fixup_mac_address_by_alias(const char *alias, const u8 *addr)
2126 +{
2127 +       void *devp = find_node_by_alias(alias);
2128 +
2129 +       if (devp) {
2130 +               printf("%s: local-mac-address <-"
2131 +                      " %02x:%02x:%02x:%02x:%02x:%02x\n\r", alias,
2132 +                      addr[0], addr[1], addr[2],
2133 +                      addr[3], addr[4], addr[5]);
2134 +
2135 +               setprop(devp, "local-mac-address", addr, 6);
2136 +       }
2137 +}
2138 +
2139  void dt_fixup_mac_address(u32 index, const u8 *addr)
2140  {
2141         void *devp = find_node_by_prop_value(NULL, "linux,network-index",
2142 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dtc-src/Makefile.dtc powerpc.git/arch/powerpc/boot/dtc-src/Makefile.dtc
2143 --- linux-2.6.24/arch/powerpc/boot/dtc-src/Makefile.dtc 1970-01-01 01:00:00.000000000 +0100
2144 +++ powerpc.git/arch/powerpc/boot/dtc-src/Makefile.dtc  2008-01-28 20:25:49.000000000 +0100
2145 @@ -0,0 +1,25 @@
2146 +# Makefile.dtc
2147 +#
2148 +# This is not a complete Makefile of itself.  Instead, it is designed to
2149 +# be easily embeddable into other systems of Makefiles.
2150 +#
2151 +DTC_SRCS = dtc.c flattree.c fstree.c data.c livetree.c treesource.c srcpos.c \
2152 +       checks.c
2153 +DTC_EXTRA = dtc.h srcpos.h
2154 +DTC_LEXFILES = dtc-lexer.l
2155 +DTC_BISONFILES = dtc-parser.y
2156 +
2157 +DTC_LEX_SRCS = $(DTC_LEXFILES:%.l=%.lex.c)
2158 +DTC_BISON_SRCS = $(DTC_BISONFILES:%.y=%.tab.c)
2159 +DTC_BISON_INCLUDES = $(DTC_BISONFILES:%.y=%.tab.h)
2160 +
2161 +DTC_GEN_SRCS = $(DTC_LEX_SRCS) $(DTC_BISON_SRCS)
2162 +DTC_GEN_ALL = $(DTC_GEN_SRCS) $(DTC_BISON_INCLUDES)
2163 +DTC_OBJS = $(DTC_SRCS:%.c=%.o) $(DTC_GEN_SRCS:%.c=%.o)
2164 +
2165 +DTC_CLEANFILES = $(DTC_GEN_ALL)
2166 +
2167 +# We assume the containing Makefile system can do auto-dependencies for most
2168 +# things, but we supply the dependencies on generated header files explicitly
2169 +
2170 +$(addprefix $(DTC_objdir)/,$(DTC_GEN_SRCS:%.c=%.o)): $(addprefix $(DTC_objdir)/,$(DTC_BISON_INCLUDES))
2171 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dtc-src/checks.c powerpc.git/arch/powerpc/boot/dtc-src/checks.c
2172 --- linux-2.6.24/arch/powerpc/boot/dtc-src/checks.c     1970-01-01 01:00:00.000000000 +0100
2173 +++ powerpc.git/arch/powerpc/boot/dtc-src/checks.c      2008-01-28 20:25:49.000000000 +0100
2174 @@ -0,0 +1,750 @@
2175 +/*
2176 + * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2007.
2177 + *
2178 + *
2179 + * This program is free software; you can redistribute it and/or
2180 + * modify it under the terms of the GNU General Public License as
2181 + * published by the Free Software Foundation; either version 2 of the
2182 + * License, or (at your option) any later version.
2183 + *
2184 + *  This program is distributed in the hope that it will be useful,
2185 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
2186 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2187 + *  General Public License for more details.
2188 + *
2189 + *  You should have received a copy of the GNU General Public License
2190 + *  along with this program; if not, write to the Free Software
2191 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
2192 + *                                                                   USA
2193 + */
2194 +
2195 +#include "dtc.h"
2196 +
2197 +#ifdef TRACE_CHECKS
2198 +#define TRACE(c, ...) \
2199 +       do { \
2200 +               fprintf(stderr, "=== %s: ", (c)->name); \
2201 +               fprintf(stderr, __VA_ARGS__); \
2202 +               fprintf(stderr, "\n"); \
2203 +       } while (0)
2204 +#else
2205 +#define TRACE(c, fmt, ...)     do { } while (0)
2206 +#endif
2207 +
2208 +enum checklevel {
2209 +       IGNORE = 0,
2210 +       WARN = 1,
2211 +       ERROR = 2,
2212 +};
2213 +
2214 +enum checkstatus {
2215 +       UNCHECKED = 0,
2216 +       PREREQ,
2217 +       PASSED,
2218 +       FAILED,
2219 +};
2220 +
2221 +struct check;
2222 +
2223 +typedef void (*tree_check_fn)(struct check *c, struct node *dt);
2224 +typedef void (*node_check_fn)(struct check *c, struct node *dt, struct node *node);
2225 +typedef void (*prop_check_fn)(struct check *c, struct node *dt,
2226 +                             struct node *node, struct property *prop);
2227 +
2228 +struct check {
2229 +       const char *name;
2230 +       tree_check_fn tree_fn;
2231 +       node_check_fn node_fn;
2232 +       prop_check_fn prop_fn;
2233 +       void *data;
2234 +       enum checklevel level;
2235 +       enum checkstatus status;
2236 +       int inprogress;
2237 +       int num_prereqs;
2238 +       struct check **prereq;
2239 +};
2240 +
2241 +#define CHECK(nm, tfn, nfn, pfn, d, lvl, ...) \
2242 +       static struct check *nm##_prereqs[] = { __VA_ARGS__ }; \
2243 +       static struct check nm = { \
2244 +               .name = #nm, \
2245 +               .tree_fn = (tfn), \
2246 +               .node_fn = (nfn), \
2247 +               .prop_fn = (pfn), \
2248 +               .data = (d), \
2249 +               .level = (lvl), \
2250 +               .status = UNCHECKED, \
2251 +               .num_prereqs = ARRAY_SIZE(nm##_prereqs), \
2252 +               .prereq = nm##_prereqs, \
2253 +       };
2254 +
2255 +#define TREE_CHECK(nm, d, lvl, ...) \
2256 +       CHECK(nm, check_##nm, NULL, NULL, d, lvl, __VA_ARGS__)
2257 +#define NODE_CHECK(nm, d, lvl, ...) \
2258 +       CHECK(nm, NULL, check_##nm, NULL, d, lvl, __VA_ARGS__)
2259 +#define PROP_CHECK(nm, d, lvl, ...) \
2260 +       CHECK(nm, NULL, NULL, check_##nm, d, lvl, __VA_ARGS__)
2261 +#define BATCH_CHECK(nm, lvl, ...) \
2262 +       CHECK(nm, NULL, NULL, NULL, NULL, lvl, __VA_ARGS__)
2263 +
2264 +#ifdef __GNUC__
2265 +static inline void check_msg(struct check *c, const char *fmt, ...) __attribute__((format (printf, 2, 3)));
2266 +#endif
2267 +static inline void check_msg(struct check *c, const char *fmt, ...)
2268 +{
2269 +       va_list ap;
2270 +       va_start(ap, fmt);
2271 +
2272 +       if ((c->level < WARN) || (c->level <= quiet))
2273 +               return; /* Suppress message */
2274 +
2275 +       fprintf(stderr, "%s (%s): ",
2276 +               (c->level == ERROR) ? "ERROR" : "Warning", c->name);
2277 +       vfprintf(stderr, fmt, ap);
2278 +       fprintf(stderr, "\n");
2279 +}
2280 +
2281 +#define FAIL(c, ...) \
2282 +       do { \
2283 +               TRACE((c), "\t\tFAILED at %s:%d", __FILE__, __LINE__); \
2284 +               (c)->status = FAILED; \
2285 +               check_msg((c), __VA_ARGS__); \
2286 +       } while (0)
2287 +
2288 +static void check_nodes_props(struct check *c, struct node *dt, struct node *node)
2289 +{
2290 +       struct node *child;
2291 +       struct property *prop;
2292 +
2293 +       TRACE(c, "%s", node->fullpath);
2294 +       if (c->node_fn)
2295 +               c->node_fn(c, dt, node);
2296 +
2297 +       if (c->prop_fn)
2298 +               for_each_property(node, prop) {
2299 +                       TRACE(c, "%s\t'%s'", node->fullpath, prop->name);
2300 +                       c->prop_fn(c, dt, node, prop);
2301 +               }
2302 +
2303 +       for_each_child(node, child)
2304 +               check_nodes_props(c, dt, child);
2305 +}
2306 +
2307 +static int run_check(struct check *c, struct node *dt)
2308 +{
2309 +       int error = 0;
2310 +       int i;
2311 +
2312 +       assert(!c->inprogress);
2313 +
2314 +       if (c->status != UNCHECKED)
2315 +               goto out;
2316 +
2317 +       c->inprogress = 1;
2318 +
2319 +       for (i = 0; i < c->num_prereqs; i++) {
2320 +               struct check *prq = c->prereq[i];
2321 +               error |= run_check(prq, dt);
2322 +               if (prq->status != PASSED) {
2323 +                       c->status = PREREQ;
2324 +                       check_msg(c, "Failed prerequisite '%s'",
2325 +                                 c->prereq[i]->name);
2326 +               }
2327 +       }
2328 +
2329 +       if (c->status != UNCHECKED)
2330 +               goto out;
2331 +
2332 +       if (c->node_fn || c->prop_fn)
2333 +               check_nodes_props(c, dt, dt);
2334 +
2335 +       if (c->tree_fn)
2336 +               c->tree_fn(c, dt);
2337 +       if (c->status == UNCHECKED)
2338 +               c->status = PASSED;
2339 +
2340 +       TRACE(c, "\tCompleted, status %d", c->status);
2341 +
2342 +out:
2343 +       c->inprogress = 0;
2344 +       if ((c->status != PASSED) && (c->level == ERROR))
2345 +               error = 1;
2346 +       return error;
2347 +}
2348 +
2349 +/*
2350 + * Utility check functions
2351 + */
2352 +
2353 +static void check_is_string(struct check *c, struct node *root,
2354 +                           struct node *node)
2355 +{
2356 +       struct property *prop;
2357 +       char *propname = c->data;
2358 +
2359 +       prop = get_property(node, propname);
2360 +       if (!prop)
2361 +               return; /* Not present, assumed ok */
2362 +
2363 +       if (!data_is_one_string(prop->val))
2364 +               FAIL(c, "\"%s\" property in %s is not a string",
2365 +                    propname, node->fullpath);
2366 +}
2367 +#define CHECK_IS_STRING(nm, propname, lvl) \
2368 +       CHECK(nm, NULL, check_is_string, NULL, (propname), (lvl))
2369 +
2370 +static void check_is_cell(struct check *c, struct node *root,
2371 +                         struct node *node)
2372 +{
2373 +       struct property *prop;
2374 +       char *propname = c->data;
2375 +
2376 +       prop = get_property(node, propname);
2377 +       if (!prop)
2378 +               return; /* Not present, assumed ok */
2379 +
2380 +       if (prop->val.len != sizeof(cell_t))
2381 +               FAIL(c, "\"%s\" property in %s is not a single cell",
2382 +                    propname, node->fullpath);
2383 +}
2384 +#define CHECK_IS_CELL(nm, propname, lvl) \
2385 +       CHECK(nm, NULL, check_is_cell, NULL, (propname), (lvl))
2386 +
2387 +/*
2388 + * Structural check functions
2389 + */
2390 +
2391 +static void check_duplicate_node_names(struct check *c, struct node *dt,
2392 +                                      struct node *node)
2393 +{
2394 +       struct node *child, *child2;
2395 +
2396 +       for_each_child(node, child)
2397 +               for (child2 = child->next_sibling;
2398 +                    child2;
2399 +                    child2 = child2->next_sibling)
2400 +                       if (streq(child->name, child2->name))
2401 +                               FAIL(c, "Duplicate node name %s",
2402 +                                    child->fullpath);
2403 +}
2404 +NODE_CHECK(duplicate_node_names, NULL, ERROR);
2405 +
2406 +static void check_duplicate_property_names(struct check *c, struct node *dt,
2407 +                                          struct node *node)
2408 +{
2409 +       struct property *prop, *prop2;
2410 +
2411 +       for_each_property(node, prop)
2412 +               for (prop2 = prop->next; prop2; prop2 = prop2->next)
2413 +                       if (streq(prop->name, prop2->name))
2414 +                               FAIL(c, "Duplicate property name %s in %s",
2415 +                                    prop->name, node->fullpath);
2416 +}
2417 +NODE_CHECK(duplicate_property_names, NULL, ERROR);
2418 +
2419 +static void check_explicit_phandles(struct check *c, struct node *root,
2420 +                                         struct node *node)
2421 +{
2422 +       struct property *prop;
2423 +       struct node *other;
2424 +       cell_t phandle;
2425 +
2426 +       prop = get_property(node, "linux,phandle");
2427 +       if (! prop)
2428 +               return; /* No phandle, that's fine */
2429 +
2430 +       if (prop->val.len != sizeof(cell_t)) {
2431 +               FAIL(c, "%s has bad length (%d) linux,phandle property",
2432 +                    node->fullpath, prop->val.len);
2433 +               return;
2434 +       }
2435 +
2436 +       phandle = propval_cell(prop);
2437 +       if ((phandle == 0) || (phandle == -1)) {
2438 +               FAIL(c, "%s has invalid linux,phandle value 0x%x",
2439 +                    node->fullpath, phandle);
2440 +               return;
2441 +       }
2442 +
2443 +       other = get_node_by_phandle(root, phandle);
2444 +       if (other) {
2445 +               FAIL(c, "%s has duplicated phandle 0x%x (seen before at %s)",
2446 +                    node->fullpath, phandle, other->fullpath);
2447 +               return;
2448 +       }
2449 +
2450 +       node->phandle = phandle;
2451 +}
2452 +NODE_CHECK(explicit_phandles, NULL, ERROR);
2453 +
2454 +static void check_name_properties(struct check *c, struct node *root,
2455 +                                 struct node *node)
2456 +{
2457 +       struct property *prop;
2458 +
2459 +       prop = get_property(node, "name");
2460 +       if (!prop)
2461 +               return; /* No name property, that's fine */
2462 +
2463 +       if ((prop->val.len != node->basenamelen+1)
2464 +           || (memcmp(prop->val.val, node->name, node->basenamelen) != 0))
2465 +               FAIL(c, "\"name\" property in %s is incorrect (\"%s\" instead"
2466 +                    " of base node name)", node->fullpath, prop->val.val);
2467 +}
2468 +CHECK_IS_STRING(name_is_string, "name", ERROR);
2469 +NODE_CHECK(name_properties, NULL, ERROR, &name_is_string);
2470 +
2471 +/*
2472 + * Reference fixup functions
2473 + */
2474 +
2475 +static void fixup_phandle_references(struct check *c, struct node *dt,
2476 +                                    struct node *node, struct property *prop)
2477 +{
2478 +      struct marker *m = prop->val.markers;
2479 +      struct node *refnode;
2480 +      cell_t phandle;
2481 +
2482 +      for_each_marker_of_type(m, REF_PHANDLE) {
2483 +             assert(m->offset + sizeof(cell_t) <= prop->val.len);
2484 +
2485 +             refnode = get_node_by_ref(dt, m->ref);
2486 +             if (! refnode) {
2487 +                     FAIL(c, "Reference to non-existent node or label \"%s\"\n",
2488 +                          m->ref);
2489 +                     continue;
2490 +             }
2491 +
2492 +             phandle = get_node_phandle(dt, refnode);
2493 +             *((cell_t *)(prop->val.val + m->offset)) = cpu_to_be32(phandle);
2494 +      }
2495 +}
2496 +CHECK(phandle_references, NULL, NULL, fixup_phandle_references, NULL, ERROR,
2497 +      &duplicate_node_names, &explicit_phandles);
2498 +
2499 +static void fixup_path_references(struct check *c, struct node *dt,
2500 +                                 struct node *node, struct property *prop)
2501 +{
2502 +       struct marker *m = prop->val.markers;
2503 +       struct node *refnode;
2504 +       char *path;
2505 +
2506 +       for_each_marker_of_type(m, REF_PATH) {
2507 +               assert(m->offset <= prop->val.len);
2508 +
2509 +               refnode = get_node_by_ref(dt, m->ref);
2510 +               if (!refnode) {
2511 +                       FAIL(c, "Reference to non-existent node or label \"%s\"\n",
2512 +                            m->ref);
2513 +                       continue;
2514 +               }
2515 +
2516 +               path = refnode->fullpath;
2517 +               prop->val = data_insert_at_marker(prop->val, m, path,
2518 +                                                 strlen(path) + 1);
2519 +       }
2520 +}
2521 +CHECK(path_references, NULL, NULL, fixup_path_references, NULL, ERROR,
2522 +      &duplicate_node_names);
2523 +
2524 +/*
2525 + * Semantic checks
2526 + */
2527 +CHECK_IS_CELL(address_cells_is_cell, "#address-cells", WARN);
2528 +CHECK_IS_CELL(size_cells_is_cell, "#size-cells", WARN);
2529 +CHECK_IS_CELL(interrupt_cells_is_cell, "#interrupt-cells", WARN);
2530 +
2531 +CHECK_IS_STRING(device_type_is_string, "device_type", WARN);
2532 +CHECK_IS_STRING(model_is_string, "model", WARN);
2533 +CHECK_IS_STRING(status_is_string, "status", WARN);
2534 +
2535 +static void fixup_addr_size_cells(struct check *c, struct node *dt,
2536 +                                 struct node *node)
2537 +{
2538 +       struct property *prop;
2539 +
2540 +       node->addr_cells = -1;
2541 +       node->size_cells = -1;
2542 +
2543 +       prop = get_property(node, "#address-cells");
2544 +       if (prop)
2545 +               node->addr_cells = propval_cell(prop);
2546 +
2547 +       prop = get_property(node, "#size-cells");
2548 +       if (prop)
2549 +               node->size_cells = propval_cell(prop);
2550 +}
2551 +CHECK(addr_size_cells, NULL, fixup_addr_size_cells, NULL, NULL, WARN,
2552 +      &address_cells_is_cell, &size_cells_is_cell);
2553 +
2554 +#define node_addr_cells(n) \
2555 +       (((n)->addr_cells == -1) ? 2 : (n)->addr_cells)
2556 +#define node_size_cells(n) \
2557 +       (((n)->size_cells == -1) ? 1 : (n)->size_cells)
2558 +
2559 +static void check_reg_format(struct check *c, struct node *dt,
2560 +                            struct node *node)
2561 +{
2562 +       struct property *prop;
2563 +       int addr_cells, size_cells, entrylen;
2564 +
2565 +       prop = get_property(node, "reg");
2566 +       if (!prop)
2567 +               return; /* No "reg", that's fine */
2568 +
2569 +       if (!node->parent) {
2570 +               FAIL(c, "Root node has a \"reg\" property");
2571 +               return;
2572 +       }
2573 +
2574 +       if (prop->val.len == 0)
2575 +               FAIL(c, "\"reg\" property in %s is empty", node->fullpath);
2576 +
2577 +       addr_cells = node_addr_cells(node->parent);
2578 +       size_cells = node_size_cells(node->parent);
2579 +       entrylen = (addr_cells + size_cells) * sizeof(cell_t);
2580 +
2581 +       if ((prop->val.len % entrylen) != 0)
2582 +               FAIL(c, "\"reg\" property in %s has invalid length (%d bytes) "
2583 +                    "(#address-cells == %d, #size-cells == %d)",
2584 +                    node->fullpath, prop->val.len, addr_cells, size_cells);
2585 +}
2586 +NODE_CHECK(reg_format, NULL, WARN, &addr_size_cells);
2587 +
2588 +static void check_ranges_format(struct check *c, struct node *dt,
2589 +                               struct node *node)
2590 +{
2591 +       struct property *prop;
2592 +       int c_addr_cells, p_addr_cells, c_size_cells, p_size_cells, entrylen;
2593 +
2594 +       prop = get_property(node, "ranges");
2595 +       if (!prop)
2596 +               return;
2597 +
2598 +       if (!node->parent) {
2599 +               FAIL(c, "Root node has a \"ranges\" property");
2600 +               return;
2601 +       }
2602 +
2603 +       p_addr_cells = node_addr_cells(node->parent);
2604 +       p_size_cells = node_size_cells(node->parent);
2605 +       c_addr_cells = node_addr_cells(node);
2606 +       c_size_cells = node_size_cells(node);
2607 +       entrylen = (p_addr_cells + c_addr_cells + c_size_cells) * sizeof(cell_t);
2608 +
2609 +       if (prop->val.len == 0) {
2610 +               if (p_addr_cells != c_addr_cells)
2611 +                       FAIL(c, "%s has empty \"ranges\" property but its "
2612 +                            "#address-cells (%d) differs from %s (%d)",
2613 +                            node->fullpath, c_addr_cells, node->parent->fullpath,
2614 +                            p_addr_cells);
2615 +               if (p_size_cells != c_size_cells)
2616 +                       FAIL(c, "%s has empty \"ranges\" property but its "
2617 +                            "#size-cells (%d) differs from %s (%d)",
2618 +                            node->fullpath, c_size_cells, node->parent->fullpath,
2619 +                            p_size_cells);
2620 +       } else if ((prop->val.len % entrylen) != 0) {
2621 +               FAIL(c, "\"ranges\" property in %s has invalid length (%d bytes) "
2622 +                    "(parent #address-cells == %d, child #address-cells == %d, "
2623 +                    "#size-cells == %d)", node->fullpath, prop->val.len,
2624 +                    p_addr_cells, c_addr_cells, c_size_cells);
2625 +       }
2626 +}
2627 +NODE_CHECK(ranges_format, NULL, WARN, &addr_size_cells);
2628 +
2629 +/*
2630 + * Style checks
2631 + */
2632 +static void check_avoid_default_addr_size(struct check *c, struct node *dt,
2633 +                                         struct node *node)
2634 +{
2635 +       struct property *reg, *ranges;
2636 +
2637 +       if (!node->parent)
2638 +               return; /* Ignore root node */
2639 +
2640 +       reg = get_property(node, "reg");
2641 +       ranges = get_property(node, "ranges");
2642 +
2643 +       if (!reg && !ranges)
2644 +               return;
2645 +
2646 +       if ((node->parent->addr_cells == -1))
2647 +               FAIL(c, "Relying on default #address-cells value for %s",
2648 +                    node->fullpath);
2649 +
2650 +       if ((node->parent->size_cells == -1))
2651 +               FAIL(c, "Relying on default #size-cells value for %s",
2652 +                    node->fullpath);
2653 +}
2654 +NODE_CHECK(avoid_default_addr_size, NULL, WARN, &addr_size_cells);
2655 +
2656 +static void check_obsolete_chosen_interrupt_controller(struct check *c,
2657 +                                                      struct node *dt)
2658 +{
2659 +       struct node *chosen;
2660 +       struct property *prop;
2661 +
2662 +       chosen = get_node_by_path(dt, "/chosen");
2663 +       if (!chosen)
2664 +               return;
2665 +
2666 +       prop = get_property(chosen, "interrupt-controller");
2667 +       if (prop)
2668 +               FAIL(c, "/chosen has obsolete \"interrupt-controller\" "
2669 +                    "property");
2670 +}
2671 +TREE_CHECK(obsolete_chosen_interrupt_controller, NULL, WARN);
2672 +
2673 +static struct check *check_table[] = {
2674 +       &duplicate_node_names, &duplicate_property_names,
2675 +       &name_is_string, &name_properties,
2676 +       &explicit_phandles,
2677 +       &phandle_references, &path_references,
2678 +
2679 +       &address_cells_is_cell, &size_cells_is_cell, &interrupt_cells_is_cell,
2680 +       &device_type_is_string, &model_is_string, &status_is_string,
2681 +
2682 +       &addr_size_cells, &reg_format, &ranges_format,
2683 +
2684 +       &avoid_default_addr_size,
2685 +       &obsolete_chosen_interrupt_controller,
2686 +};
2687 +
2688 +int check_semantics(struct node *dt, int outversion, int boot_cpuid_phys);
2689 +
2690 +void process_checks(int force, struct boot_info *bi,
2691 +                   int checkflag, int outversion, int boot_cpuid_phys)
2692 +{
2693 +       struct node *dt = bi->dt;
2694 +       int i;
2695 +       int error = 0;
2696 +
2697 +       for (i = 0; i < ARRAY_SIZE(check_table); i++) {
2698 +               struct check *c = check_table[i];
2699 +
2700 +               if (c->level != IGNORE)
2701 +                       error = error || run_check(c, dt);
2702 +       }
2703 +
2704 +       if (error) {
2705 +               if (!force) {
2706 +                       fprintf(stderr, "ERROR: Input tree has errors, aborting "
2707 +                               "(use -f to force output)\n");
2708 +                       exit(2);
2709 +               } else if (quiet < 3) {
2710 +                       fprintf(stderr, "Warning: Input tree has errors, "
2711 +                               "output forced\n");
2712 +               }
2713 +       }
2714 +
2715 +       if (checkflag) {
2716 +               if (error) {
2717 +                       fprintf(stderr, "Warning: Skipping semantic checks due to structural errors\n");
2718 +               } else {
2719 +                       if (!check_semantics(bi->dt, outversion,
2720 +                                            boot_cpuid_phys))
2721 +                               fprintf(stderr, "Warning: Input tree has semantic errors\n");
2722 +               }
2723 +       }
2724 +}
2725 +
2726 +/*
2727 + * Semantic check functions
2728 + */
2729 +
2730 +#define ERRMSG(...) if (quiet < 2) fprintf(stderr, "ERROR: " __VA_ARGS__)
2731 +#define WARNMSG(...) if (quiet < 1) fprintf(stderr, "Warning: " __VA_ARGS__)
2732 +
2733 +#define DO_ERR(...) do {ERRMSG(__VA_ARGS__); ok = 0; } while (0)
2734 +
2735 +#define CHECK_HAVE(node, propname) \
2736 +       do { \
2737 +               if (! (prop = get_property((node), (propname)))) \
2738 +                       DO_ERR("Missing \"%s\" property in %s\n", (propname), \
2739 +                               (node)->fullpath); \
2740 +       } while (0);
2741 +
2742 +#define CHECK_HAVE_WARN(node, propname) \
2743 +       do { \
2744 +               if (! (prop  = get_property((node), (propname)))) \
2745 +                       WARNMSG("%s has no \"%s\" property\n", \
2746 +                               (node)->fullpath, (propname)); \
2747 +       } while (0)
2748 +
2749 +#define CHECK_HAVE_STRING(node, propname) \
2750 +       do { \
2751 +               CHECK_HAVE((node), (propname)); \
2752 +               if (prop && !data_is_one_string(prop->val)) \
2753 +                       DO_ERR("\"%s\" property in %s is not a string\n", \
2754 +                               (propname), (node)->fullpath); \
2755 +       } while (0)
2756 +
2757 +#define CHECK_HAVE_STREQ(node, propname, value) \
2758 +       do { \
2759 +               CHECK_HAVE_STRING((node), (propname)); \
2760 +               if (prop && !streq(prop->val.val, (value))) \
2761 +                       DO_ERR("%s has wrong %s, %s (should be %s\n", \
2762 +                               (node)->fullpath, (propname), \
2763 +                               prop->val.val, (value)); \
2764 +       } while (0)
2765 +
2766 +#define CHECK_HAVE_ONECELL(node, propname) \
2767 +       do { \
2768 +               CHECK_HAVE((node), (propname)); \
2769 +               if (prop && (prop->val.len != sizeof(cell_t))) \
2770 +                       DO_ERR("\"%s\" property in %s has wrong size %d (should be 1 cell)\n", (propname), (node)->fullpath, prop->val.len); \
2771 +       } while (0)
2772 +
2773 +#define CHECK_HAVE_WARN_ONECELL(node, propname) \
2774 +       do { \
2775 +               CHECK_HAVE_WARN((node), (propname)); \
2776 +               if (prop && (prop->val.len != sizeof(cell_t))) \
2777 +                       DO_ERR("\"%s\" property in %s has wrong size %d (should be 1 cell)\n", (propname), (node)->fullpath, prop->val.len); \
2778 +       } while (0)
2779 +
2780 +#define CHECK_HAVE_WARN_PHANDLE(xnode, propname, root) \
2781 +       do { \
2782 +               struct node *ref; \
2783 +               CHECK_HAVE_WARN_ONECELL((xnode), (propname)); \
2784 +               if (prop) {\
2785 +                       cell_t phandle = propval_cell(prop); \
2786 +                       if ((phandle == 0) || (phandle == -1)) { \
2787 +                               DO_ERR("\"%s\" property in %s contains an invalid phandle %x\n", (propname), (xnode)->fullpath, phandle); \
2788 +                       } else { \
2789 +                               ref = get_node_by_phandle((root), propval_cell(prop)); \
2790 +                               if (! ref) \
2791 +                                       DO_ERR("\"%s\" property in %s refers to non-existant phandle %x\n", (propname), (xnode)->fullpath, propval_cell(prop)); \
2792 +                       } \
2793 +               } \
2794 +       } while (0)
2795 +
2796 +#define CHECK_HAVE_WARN_STRING(node, propname) \
2797 +       do { \
2798 +               CHECK_HAVE_WARN((node), (propname)); \
2799 +               if (prop && !data_is_one_string(prop->val)) \
2800 +                       DO_ERR("\"%s\" property in %s is not a string\n", \
2801 +                               (propname), (node)->fullpath); \
2802 +       } while (0)
2803 +
2804 +static int check_root(struct node *root)
2805 +{
2806 +       struct property *prop;
2807 +       int ok = 1;
2808 +
2809 +       CHECK_HAVE_STRING(root, "model");
2810 +       CHECK_HAVE_WARN(root, "compatible");
2811 +
2812 +       return ok;
2813 +}
2814 +
2815 +static int check_cpus(struct node *root, int outversion, int boot_cpuid_phys)
2816 +{
2817 +       struct node *cpus, *cpu;
2818 +       struct property *prop;
2819 +       struct node *bootcpu = NULL;
2820 +       int ok = 1;
2821 +
2822 +       cpus = get_subnode(root, "cpus");
2823 +       if (! cpus) {
2824 +               ERRMSG("Missing /cpus node\n");
2825 +               return 0;
2826 +       }
2827 +
2828 +       if (cpus->addr_cells != 1)
2829 +               DO_ERR("%s has bad #address-cells value %d (should be 1)\n",
2830 +                      cpus->fullpath, cpus->addr_cells);
2831 +       if (cpus->size_cells != 0)
2832 +               DO_ERR("%s has bad #size-cells value %d (should be 0)\n",
2833 +                      cpus->fullpath, cpus->size_cells);
2834 +
2835 +       for_each_child(cpus, cpu) {
2836 +               CHECK_HAVE_STREQ(cpu, "device_type", "cpu");
2837 +
2838 +               CHECK_HAVE_ONECELL(cpu, "reg");
2839 +               if (prop) {
2840 +                       cell_t unitnum;
2841 +                       char *eptr;
2842 +
2843 +                       unitnum = strtol(get_unitname(cpu), &eptr, 16);
2844 +                       if (*eptr) {
2845 +                               WARNMSG("%s has bad format unit name %s (should be CPU number\n",
2846 +                                       cpu->fullpath, get_unitname(cpu));
2847 +                       } else if (unitnum != propval_cell(prop)) {
2848 +                               WARNMSG("%s unit name \"%s\" does not match \"reg\" property <%x>\n",
2849 +                                      cpu->fullpath, get_unitname(cpu),
2850 +                                      propval_cell(prop));
2851 +                       }
2852 +               }
2853 +
2854 +/*             CHECK_HAVE_ONECELL(cpu, "d-cache-line-size"); */
2855 +/*             CHECK_HAVE_ONECELL(cpu, "i-cache-line-size"); */
2856 +               CHECK_HAVE_ONECELL(cpu, "d-cache-size");
2857 +               CHECK_HAVE_ONECELL(cpu, "i-cache-size");
2858 +
2859 +               CHECK_HAVE_WARN_ONECELL(cpu, "clock-frequency");
2860 +               CHECK_HAVE_WARN_ONECELL(cpu, "timebase-frequency");
2861 +
2862 +               prop = get_property(cpu, "linux,boot-cpu");
2863 +               if (prop) {
2864 +                       if (prop->val.len)
2865 +                               WARNMSG("\"linux,boot-cpu\" property in %s is non-empty\n",
2866 +                                       cpu->fullpath);
2867 +                       if (bootcpu)
2868 +                               DO_ERR("Multiple boot cpus (%s and %s)\n",
2869 +                                      bootcpu->fullpath, cpu->fullpath);
2870 +                       else
2871 +                               bootcpu = cpu;
2872 +               }
2873 +       }
2874 +
2875 +       if (outversion < 2) {
2876 +               if (! bootcpu)
2877 +                       WARNMSG("No cpu has \"linux,boot-cpu\" property\n");
2878 +       } else {
2879 +               if (bootcpu)
2880 +                       WARNMSG("\"linux,boot-cpu\" property is deprecated in blob version 2 or higher\n");
2881 +               if (boot_cpuid_phys == 0xfeedbeef)
2882 +                       WARNMSG("physical boot CPU not set.  Use -b option to set\n");
2883 +       }
2884 +
2885 +       return ok;
2886 +}
2887 +
2888 +static int check_memory(struct node *root)
2889 +{
2890 +       struct node *mem;
2891 +       struct property *prop;
2892 +       int nnodes = 0;
2893 +       int ok = 1;
2894 +
2895 +       for_each_child(root, mem) {
2896 +               if (! strneq(mem->name, "memory", mem->basenamelen))
2897 +                       continue;
2898 +
2899 +               nnodes++;
2900 +
2901 +               CHECK_HAVE_STREQ(mem, "device_type", "memory");
2902 +               CHECK_HAVE(mem, "reg");
2903 +       }
2904 +
2905 +       if (nnodes == 0) {
2906 +               ERRMSG("No memory nodes\n");
2907 +               return 0;
2908 +       }
2909 +
2910 +       return ok;
2911 +}
2912 +
2913 +int check_semantics(struct node *dt, int outversion, int boot_cpuid_phys)
2914 +{
2915 +       int ok = 1;
2916 +
2917 +       ok = ok && check_root(dt);
2918 +       ok = ok && check_cpus(dt, outversion, boot_cpuid_phys);
2919 +       ok = ok && check_memory(dt);
2920 +       if (! ok)
2921 +               return 0;
2922 +
2923 +       return 1;
2924 +}
2925 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dtc-src/data.c powerpc.git/arch/powerpc/boot/dtc-src/data.c
2926 --- linux-2.6.24/arch/powerpc/boot/dtc-src/data.c       1970-01-01 01:00:00.000000000 +0100
2927 +++ powerpc.git/arch/powerpc/boot/dtc-src/data.c        2008-01-28 20:25:49.000000000 +0100
2928 @@ -0,0 +1,321 @@
2929 +/*
2930 + * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
2931 + *
2932 + *
2933 + * This program is free software; you can redistribute it and/or
2934 + * modify it under the terms of the GNU General Public License as
2935 + * published by the Free Software Foundation; either version 2 of the
2936 + * License, or (at your option) any later version.
2937 + *
2938 + *  This program is distributed in the hope that it will be useful,
2939 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
2940 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2941 + *  General Public License for more details.
2942 + *
2943 + *  You should have received a copy of the GNU General Public License
2944 + *  along with this program; if not, write to the Free Software
2945 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
2946 + *                                                                   USA
2947 + */
2948 +
2949 +#include "dtc.h"
2950 +
2951 +void data_free(struct data d)
2952 +{
2953 +       struct marker *m, *nm;
2954 +
2955 +       m = d.markers;
2956 +       while (m) {
2957 +               nm = m->next;
2958 +               free(m->ref);
2959 +               free(m);
2960 +               m = nm;
2961 +       }
2962 +
2963 +       assert(!d.val || d.asize);
2964 +
2965 +       if (d.val)
2966 +               free(d.val);
2967 +}
2968 +
2969 +struct data data_grow_for(struct data d, int xlen)
2970 +{
2971 +       struct data nd;
2972 +       int newsize;
2973 +
2974 +       /* we must start with an allocated datum */
2975 +       assert(!d.val || d.asize);
2976 +
2977 +       if (xlen == 0)
2978 +               return d;
2979 +
2980 +       nd = d;
2981 +
2982 +       newsize = xlen;
2983 +
2984 +       while ((d.len + xlen) > newsize)
2985 +               newsize *= 2;
2986 +
2987 +       nd.asize = newsize;
2988 +       nd.val = xrealloc(d.val, newsize);
2989 +
2990 +       assert(nd.asize >= (d.len + xlen));
2991 +
2992 +       return nd;
2993 +}
2994 +
2995 +struct data data_copy_mem(const char *mem, int len)
2996 +{
2997 +       struct data d;
2998 +
2999 +       d = data_grow_for(empty_data, len);
3000 +
3001 +       d.len = len;
3002 +       memcpy(d.val, mem, len);
3003 +
3004 +       return d;
3005 +}
3006 +
3007 +static char get_oct_char(const char *s, int *i)
3008 +{
3009 +       char x[4];
3010 +       char *endx;
3011 +       long val;
3012 +
3013 +       x[3] = '\0';
3014 +       x[0] = s[(*i)];
3015 +       if (x[0]) {
3016 +               x[1] = s[(*i)+1];
3017 +               if (x[1])
3018 +                       x[2] = s[(*i)+2];
3019 +       }
3020 +
3021 +       val = strtol(x, &endx, 8);
3022 +       if ((endx - x) == 0)
3023 +               fprintf(stderr, "Empty \\nnn escape\n");
3024 +
3025 +       (*i) += endx - x;
3026 +       return val;
3027 +}
3028 +
3029 +static char get_hex_char(const char *s, int *i)
3030 +{
3031 +       char x[3];
3032 +       char *endx;
3033 +       long val;
3034 +
3035 +       x[2] = '\0';
3036 +       x[0] = s[(*i)];
3037 +       if (x[0])
3038 +               x[1] = s[(*i)+1];
3039 +
3040 +       val = strtol(x, &endx, 16);
3041 +       if ((endx - x) == 0)
3042 +               fprintf(stderr, "Empty \\x escape\n");
3043 +
3044 +       (*i) += endx - x;
3045 +       return val;
3046 +}
3047 +
3048 +struct data data_copy_escape_string(const char *s, int len)
3049 +{
3050 +       int i = 0;
3051 +       struct data d;
3052 +       char *q;
3053 +
3054 +       d = data_grow_for(empty_data, strlen(s)+1);
3055 +
3056 +       q = d.val;
3057 +       while (i < len) {
3058 +               char c = s[i++];
3059 +
3060 +               if (c != '\\') {
3061 +                       q[d.len++] = c;
3062 +                       continue;
3063 +               }
3064 +
3065 +               c = s[i++];
3066 +               assert(c);
3067 +               switch (c) {
3068 +               case 'a':
3069 +                       q[d.len++] = '\a';
3070 +                       break;
3071 +               case 'b':
3072 +                       q[d.len++] = '\b';
3073 +                       break;
3074 +               case 't':
3075 +                       q[d.len++] = '\t';
3076 +                       break;
3077 +               case 'n':
3078 +                       q[d.len++] = '\n';
3079 +                       break;
3080 +               case 'v':
3081 +                       q[d.len++] = '\v';
3082 +                       break;
3083 +               case 'f':
3084 +                       q[d.len++] = '\f';
3085 +                       break;
3086 +               case 'r':
3087 +                       q[d.len++] = '\r';
3088 +                       break;
3089 +               case '0':
3090 +               case '1':
3091 +               case '2':
3092 +               case '3':
3093 +               case '4':
3094 +               case '5':
3095 +               case '6':
3096 +               case '7':
3097 +                       i--; /* need to re-read the first digit as
3098 +                             * part of the octal value */
3099 +                       q[d.len++] = get_oct_char(s, &i);
3100 +                       break;
3101 +               case 'x':
3102 +                       q[d.len++] = get_hex_char(s, &i);
3103 +                       break;
3104 +               default:
3105 +                       q[d.len++] = c;
3106 +               }
3107 +       }
3108 +
3109 +       q[d.len++] = '\0';
3110 +       return d;
3111 +}
3112 +
3113 +struct data data_copy_file(FILE *f, size_t len)
3114 +{
3115 +       struct data d;
3116 +
3117 +       d = data_grow_for(empty_data, len);
3118 +
3119 +       d.len = len;
3120 +       fread(d.val, len, 1, f);
3121 +
3122 +       return d;
3123 +}
3124 +
3125 +struct data data_append_data(struct data d, const void *p, int len)
3126 +{
3127 +       d = data_grow_for(d, len);
3128 +       memcpy(d.val + d.len, p, len);
3129 +       d.len += len;
3130 +       return d;
3131 +}
3132 +
3133 +struct data data_insert_at_marker(struct data d, struct marker *m,
3134 +                                 const void *p, int len)
3135 +{
3136 +       d = data_grow_for(d, len);
3137 +       memmove(d.val + m->offset + len, d.val + m->offset, d.len - m->offset);
3138 +       memcpy(d.val + m->offset, p, len);
3139 +       d.len += len;
3140 +
3141 +       /* Adjust all markers after the one we're inserting at */
3142 +       m = m->next;
3143 +       for_each_marker(m)
3144 +               m->offset += len;
3145 +       return d;
3146 +}
3147 +
3148 +struct data data_append_markers(struct data d, struct marker *m)
3149 +{
3150 +       struct marker **mp = &d.markers;
3151 +
3152 +       /* Find the end of the markerlist */
3153 +       while (*mp)
3154 +               mp = &((*mp)->next);
3155 +       *mp = m;
3156 +       return d;
3157 +}
3158 +
3159 +struct data data_merge(struct data d1, struct data d2)
3160 +{
3161 +       struct data d;
3162 +       struct marker *m2 = d2.markers;
3163 +
3164 +       d = data_append_markers(data_append_data(d1, d2.val, d2.len), m2);
3165 +
3166 +       /* Adjust for the length of d1 */
3167 +       for_each_marker(m2)
3168 +               m2->offset += d1.len;
3169 +
3170 +       d2.markers = NULL; /* So data_free() doesn't clobber them */
3171 +       data_free(d2);
3172 +
3173 +       return d;
3174 +}
3175 +
3176 +struct data data_append_cell(struct data d, cell_t word)
3177 +{
3178 +       cell_t beword = cpu_to_be32(word);
3179 +
3180 +       return data_append_data(d, &beword, sizeof(beword));
3181 +}
3182 +
3183 +struct data data_append_re(struct data d, const struct fdt_reserve_entry *re)
3184 +{
3185 +       struct fdt_reserve_entry bere;
3186 +
3187 +       bere.address = cpu_to_be64(re->address);
3188 +       bere.size = cpu_to_be64(re->size);
3189 +
3190 +       return data_append_data(d, &bere, sizeof(bere));
3191 +}
3192 +
3193 +struct data data_append_addr(struct data d, u64 addr)
3194 +{
3195 +       u64 beaddr = cpu_to_be64(addr);
3196 +
3197 +       return data_append_data(d, &beaddr, sizeof(beaddr));
3198 +}
3199 +
3200 +struct data data_append_byte(struct data d, uint8_t byte)
3201 +{
3202 +       return data_append_data(d, &byte, 1);
3203 +}
3204 +
3205 +struct data data_append_zeroes(struct data d, int len)
3206 +{
3207 +       d = data_grow_for(d, len);
3208 +
3209 +       memset(d.val + d.len, 0, len);
3210 +       d.len += len;
3211 +       return d;
3212 +}
3213 +
3214 +struct data data_append_align(struct data d, int align)
3215 +{
3216 +       int newlen = ALIGN(d.len, align);
3217 +       return data_append_zeroes(d, newlen - d.len);
3218 +}
3219 +
3220 +struct data data_add_marker(struct data d, enum markertype type, char *ref)
3221 +{
3222 +       struct marker *m;
3223 +
3224 +       m = xmalloc(sizeof(*m));
3225 +       m->offset = d.len;
3226 +       m->type = type;
3227 +       m->ref = ref;
3228 +       m->next = NULL;
3229 +
3230 +       return data_append_markers(d, m);
3231 +}
3232 +
3233 +int data_is_one_string(struct data d)
3234 +{
3235 +       int i;
3236 +       int len = d.len;
3237 +
3238 +       if (len == 0)
3239 +               return 0;
3240 +
3241 +       for (i = 0; i < len-1; i++)
3242 +               if (d.val[i] == '\0')
3243 +                       return 0;
3244 +
3245 +       if (d.val[len-1] != '\0')
3246 +               return 0;
3247 +
3248 +       return 1;
3249 +}
3250 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dtc-src/dtc-lexer.l powerpc.git/arch/powerpc/boot/dtc-src/dtc-lexer.l
3251 --- linux-2.6.24/arch/powerpc/boot/dtc-src/dtc-lexer.l  1970-01-01 01:00:00.000000000 +0100
3252 +++ powerpc.git/arch/powerpc/boot/dtc-src/dtc-lexer.l   2008-01-28 20:25:49.000000000 +0100
3253 @@ -0,0 +1,328 @@
3254 +/*
3255 + * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
3256 + *
3257 + *
3258 + * This program is free software; you can redistribute it and/or
3259 + * modify it under the terms of the GNU General Public License as
3260 + * published by the Free Software Foundation; either version 2 of the
3261 + * License, or (at your option) any later version.
3262 + *
3263 + *  This program is distributed in the hope that it will be useful,
3264 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
3265 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
3266 + *  General Public License for more details.
3267 + *
3268 + *  You should have received a copy of the GNU General Public License
3269 + *  along with this program; if not, write to the Free Software
3270 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
3271 + *                                                                   USA
3272 + */
3273 +
3274 +%option noyywrap nounput yylineno
3275 +
3276 +%x INCLUDE
3277 +%x BYTESTRING
3278 +%x PROPNODENAME
3279 +%s V1
3280 +
3281 +PROPNODECHAR   [a-zA-Z0-9,._+*#?@-]
3282 +PATHCHAR       ({PROPNODECHAR}|[/])
3283 +LABEL          [a-zA-Z_][a-zA-Z0-9_]*
3284 +
3285 +%{
3286 +#include "dtc.h"
3287 +#include "srcpos.h"
3288 +#include "dtc-parser.tab.h"
3289 +
3290 +
3291 +/*#define LEXDEBUG     1*/
3292 +
3293 +#ifdef LEXDEBUG
3294 +#define DPRINT(fmt, ...)       fprintf(stderr, fmt, ##__VA_ARGS__)
3295 +#else
3296 +#define DPRINT(fmt, ...)       do { } while (0)
3297 +#endif
3298 +
3299 +static int dts_version; /* = 0 */
3300 +
3301 +#define BEGIN_DEFAULT()        if (dts_version == 0) { \
3302 +                               DPRINT("<INITIAL>\n"); \
3303 +                               BEGIN(INITIAL); \
3304 +                       } else { \
3305 +                               DPRINT("<V1>\n"); \
3306 +                               BEGIN(V1); \
3307 +                       }
3308 +%}
3309 +
3310 +%%
3311 +<*>"/include/"         BEGIN(INCLUDE);
3312 +
3313 +<INCLUDE>\"[^"\n]*\"   {
3314 +                       yytext[strlen(yytext) - 1] = 0;
3315 +                       if (!push_input_file(yytext + 1)) {
3316 +                               /* Some unrecoverable error.*/
3317 +                               exit(1);
3318 +                       }
3319 +                       BEGIN_DEFAULT();
3320 +               }
3321 +
3322 +
3323 +<*><<EOF>>             {
3324 +                       if (!pop_input_file()) {
3325 +                               yyterminate();
3326 +                       }
3327 +               }
3328 +
3329 +<*>\"([^\\"]|\\.)*\"   {
3330 +                       yylloc.filenum = srcpos_filenum;
3331 +                       yylloc.first_line = yylineno;
3332 +                       DPRINT("String: %s\n", yytext);
3333 +                       yylval.data = data_copy_escape_string(yytext+1,
3334 +                                       yyleng-2);
3335 +                       yylloc.first_line = yylineno;
3336 +                       return DT_STRING;
3337 +               }
3338 +
3339 +<*>"/dts-v1/"  {
3340 +                       yylloc.filenum = srcpos_filenum;
3341 +                       yylloc.first_line = yylineno;
3342 +                       DPRINT("Keyword: /dts-v1/\n");
3343 +                       dts_version = 1;
3344 +                       BEGIN_DEFAULT();
3345 +                       return DT_V1;
3346 +               }
3347 +
3348 +<*>"/memreserve/"      {
3349 +                       yylloc.filenum = srcpos_filenum;
3350 +                       yylloc.first_line = yylineno;
3351 +                       DPRINT("Keyword: /memreserve/\n");
3352 +                       BEGIN_DEFAULT();
3353 +                       return DT_MEMRESERVE;
3354 +               }
3355 +
3356 +<*>{LABEL}:    {
3357 +                       yylloc.filenum = srcpos_filenum;
3358 +                       yylloc.first_line = yylineno;
3359 +                       DPRINT("Label: %s\n", yytext);
3360 +                       yylval.labelref = strdup(yytext);
3361 +                       yylval.labelref[yyleng-1] = '\0';
3362 +                       return DT_LABEL;
3363 +               }
3364 +
3365 +<INITIAL>[bodh]# {
3366 +                       yylloc.filenum = srcpos_filenum;
3367 +                       yylloc.first_line = yylineno;
3368 +                       if (*yytext == 'b')
3369 +                               yylval.cbase = 2;
3370 +                       else if (*yytext == 'o')
3371 +                               yylval.cbase = 8;
3372 +                       else if (*yytext == 'd')
3373 +                               yylval.cbase = 10;
3374 +                       else
3375 +                               yylval.cbase = 16;
3376 +                       DPRINT("Base: %d\n", yylval.cbase);
3377 +                       return DT_BASE;
3378 +               }
3379 +
3380 +<INITIAL>[0-9a-fA-F]+  {
3381 +                       yylloc.filenum = srcpos_filenum;
3382 +                       yylloc.first_line = yylineno;
3383 +                       yylval.literal = strdup(yytext);
3384 +                       DPRINT("Literal: '%s'\n", yylval.literal);
3385 +                       return DT_LEGACYLITERAL;
3386 +               }
3387 +
3388 +<V1>[0-9]+|0[xX][0-9a-fA-F]+      {
3389 +                       yylloc.filenum = srcpos_filenum;
3390 +                       yylloc.first_line = yylineno;
3391 +                       yylval.literal = strdup(yytext);
3392 +                       DPRINT("Literal: '%s'\n", yylval.literal);
3393 +                       return DT_LITERAL;
3394 +               }
3395 +
3396 +\&{LABEL}      {       /* label reference */
3397 +                       yylloc.filenum = srcpos_filenum;
3398 +                       yylloc.first_line = yylineno;
3399 +                       DPRINT("Ref: %s\n", yytext+1);
3400 +                       yylval.labelref = strdup(yytext+1);
3401 +                       return DT_REF;
3402 +               }
3403 +
3404 +"&{/"{PATHCHAR}+\}     {       /* new-style path reference */
3405 +                       yylloc.filenum = srcpos_filenum;
3406 +                       yylloc.first_line = yylineno;
3407 +                       yytext[yyleng-1] = '\0';
3408 +                       DPRINT("Ref: %s\n", yytext+2);
3409 +                       yylval.labelref = strdup(yytext+2);
3410 +                       return DT_REF;
3411 +               }
3412 +
3413 +<INITIAL>"&/"{PATHCHAR}+ {     /* old-style path reference */
3414 +                       yylloc.filenum = srcpos_filenum;
3415 +                       yylloc.first_line = yylineno;
3416 +                       DPRINT("Ref: %s\n", yytext+1);
3417 +                       yylval.labelref = strdup(yytext+1);
3418 +                       return DT_REF;
3419 +               }
3420 +
3421 +<BYTESTRING>[0-9a-fA-F]{2} {
3422 +                       yylloc.filenum = srcpos_filenum;
3423 +                       yylloc.first_line = yylineno;
3424 +                       yylval.byte = strtol(yytext, NULL, 16);
3425 +                       DPRINT("Byte: %02x\n", (int)yylval.byte);
3426 +                       return DT_BYTE;
3427 +               }
3428 +
3429 +<BYTESTRING>"]"        {
3430 +                       yylloc.filenum = srcpos_filenum;
3431 +                       yylloc.first_line = yylineno;
3432 +                       DPRINT("/BYTESTRING\n");
3433 +                       BEGIN_DEFAULT();
3434 +                       return ']';
3435 +               }
3436 +
3437 +<PROPNODENAME>{PROPNODECHAR}+ {
3438 +                       yylloc.filenum = srcpos_filenum;
3439 +                       yylloc.first_line = yylineno;
3440 +                       DPRINT("PropNodeName: %s\n", yytext);
3441 +                       yylval.propnodename = strdup(yytext);
3442 +                       BEGIN_DEFAULT();
3443 +                       return DT_PROPNODENAME;
3444 +               }
3445 +
3446 +
3447 +<*>[[:space:]]+        /* eat whitespace */
3448 +
3449 +<*>"/*"([^*]|\*+[^*/])*\*+"/"  {
3450 +                       yylloc.filenum = srcpos_filenum;
3451 +                       yylloc.first_line = yylineno;
3452 +                       DPRINT("Comment: %s\n", yytext);
3453 +                       /* eat comments */
3454 +               }
3455 +
3456 +<*>"//".*\n    /* eat line comments */
3457 +
3458 +<*>.           {
3459 +                       yylloc.filenum = srcpos_filenum;
3460 +                       yylloc.first_line = yylineno;
3461 +                       DPRINT("Char: %c (\\x%02x)\n", yytext[0],
3462 +                               (unsigned)yytext[0]);
3463 +                       if (yytext[0] == '[') {
3464 +                               DPRINT("<BYTESTRING>\n");
3465 +                               BEGIN(BYTESTRING);
3466 +                       }
3467 +                       if ((yytext[0] == '{')
3468 +                           || (yytext[0] == ';')) {
3469 +                               DPRINT("<PROPNODENAME>\n");
3470 +                               BEGIN(PROPNODENAME);
3471 +                       }
3472 +                       return yytext[0];
3473 +               }
3474 +
3475 +%%
3476 +
3477 +
3478 +/*
3479 + * Stack of nested include file contexts.
3480 + */
3481 +
3482 +struct incl_file {
3483 +       int filenum;
3484 +       FILE *file;
3485 +       YY_BUFFER_STATE yy_prev_buf;
3486 +       int yy_prev_lineno;
3487 +       struct incl_file *prev;
3488 +};
3489 +
3490 +struct incl_file *incl_file_stack;
3491 +
3492 +
3493 +/*
3494 + * Detect infinite include recursion.
3495 + */
3496 +#define MAX_INCLUDE_DEPTH      (100)
3497 +
3498 +static int incl_depth = 0;
3499 +
3500 +
3501 +int push_input_file(const char *filename)
3502 +{
3503 +       FILE *f;
3504 +       struct incl_file *incl_file;
3505 +
3506 +       if (!filename) {
3507 +               yyerror("No include file name given.");
3508 +               return 0;
3509 +       }
3510 +
3511 +       if (incl_depth++ >= MAX_INCLUDE_DEPTH) {
3512 +               yyerror("Includes nested too deeply");
3513 +               return 0;
3514 +       }
3515 +
3516 +       f = dtc_open_file(filename);
3517 +
3518 +       incl_file = malloc(sizeof(struct incl_file));
3519 +       if (!incl_file) {
3520 +               yyerror("Can not allocate include file space.");
3521 +               return 0;
3522 +       }
3523 +
3524 +       /*
3525 +        * Save current context.
3526 +        */
3527 +       incl_file->yy_prev_buf = YY_CURRENT_BUFFER;
3528 +       incl_file->yy_prev_lineno = yylineno;
3529 +       incl_file->filenum = srcpos_filenum;
3530 +       incl_file->file = yyin;
3531 +       incl_file->prev = incl_file_stack;
3532 +
3533 +       incl_file_stack = incl_file;
3534 +
3535 +       /*
3536 +        * Establish new context.
3537 +        */
3538 +       srcpos_filenum = lookup_file_name(filename, 0);
3539 +       yylineno = 1;
3540 +       yyin = f;
3541 +       yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));
3542 +
3543 +       return 1;
3544 +}
3545 +
3546 +
3547 +int pop_input_file(void)
3548 +{
3549 +       struct incl_file *incl_file;
3550 +
3551 +       if (incl_file_stack == 0)
3552 +               return 0;
3553 +
3554 +       fclose(yyin);
3555 +
3556 +       /*
3557 +        * Pop.
3558 +        */
3559 +       --incl_depth;
3560 +       incl_file = incl_file_stack;
3561 +       incl_file_stack = incl_file->prev;
3562 +
3563 +       /*
3564 +        * Recover old context.
3565 +        */
3566 +       yy_delete_buffer(YY_CURRENT_BUFFER);
3567 +       yy_switch_to_buffer(incl_file->yy_prev_buf);
3568 +       yylineno = incl_file->yy_prev_lineno;
3569 +       srcpos_filenum = incl_file->filenum;
3570 +       yyin = incl_file->file;
3571 +
3572 +       /*
3573 +        * Free old state.
3574 +        */
3575 +       free(incl_file);
3576 +
3577 +       if (YY_CURRENT_BUFFER == 0)
3578 +               return 0;
3579 +
3580 +       return 1;
3581 +}
3582 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dtc-src/dtc-lexer.lex.c_shipped powerpc.git/arch/powerpc/boot/dtc-src/dtc-lexer.lex.c_shipped
3583 --- linux-2.6.24/arch/powerpc/boot/dtc-src/dtc-lexer.lex.c_shipped      1970-01-01 01:00:00.000000000 +0100
3584 +++ powerpc.git/arch/powerpc/boot/dtc-src/dtc-lexer.lex.c_shipped       2008-01-28 20:25:49.000000000 +0100
3585 @@ -0,0 +1,2174 @@
3586 +#line 2 "dtc-lexer.lex.c"
3587 +
3588 +#line 4 "dtc-lexer.lex.c"
3589 +
3590 +#define  YY_INT_ALIGNED short int
3591 +
3592 +/* A lexical scanner generated by flex */
3593 +
3594 +#define FLEX_SCANNER
3595 +#define YY_FLEX_MAJOR_VERSION 2
3596 +#define YY_FLEX_MINOR_VERSION 5
3597 +#define YY_FLEX_SUBMINOR_VERSION 33
3598 +#if YY_FLEX_SUBMINOR_VERSION > 0
3599 +#define FLEX_BETA
3600 +#endif
3601 +
3602 +/* First, we deal with  platform-specific or compiler-specific issues. */
3603 +
3604 +/* begin standard C headers. */
3605 +#include <stdio.h>
3606 +#include <string.h>
3607 +#include <errno.h>
3608 +#include <stdlib.h>
3609 +
3610 +/* end standard C headers. */
3611 +
3612 +/* flex integer type definitions */
3613 +
3614 +#ifndef FLEXINT_H
3615 +#define FLEXINT_H
3616 +
3617 +/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
3618 +
3619 +#if __STDC_VERSION__ >= 199901L
3620 +
3621 +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
3622 + * if you want the limit (max/min) macros for int types. 
3623 + */
3624 +#ifndef __STDC_LIMIT_MACROS
3625 +#define __STDC_LIMIT_MACROS 1
3626 +#endif
3627 +
3628 +#include <inttypes.h>
3629 +typedef int8_t flex_int8_t;
3630 +typedef uint8_t flex_uint8_t;
3631 +typedef int16_t flex_int16_t;
3632 +typedef uint16_t flex_uint16_t;
3633 +typedef int32_t flex_int32_t;
3634 +typedef uint32_t flex_uint32_t;
3635 +#else
3636 +typedef signed char flex_int8_t;
3637 +typedef short int flex_int16_t;
3638 +typedef int flex_int32_t;
3639 +typedef unsigned char flex_uint8_t; 
3640 +typedef unsigned short int flex_uint16_t;
3641 +typedef unsigned int flex_uint32_t;
3642 +#endif /* ! C99 */
3643 +
3644 +/* Limits of integral types. */
3645 +#ifndef INT8_MIN
3646 +#define INT8_MIN               (-128)
3647 +#endif
3648 +#ifndef INT16_MIN
3649 +#define INT16_MIN              (-32767-1)
3650 +#endif
3651 +#ifndef INT32_MIN
3652 +#define INT32_MIN              (-2147483647-1)
3653 +#endif
3654 +#ifndef INT8_MAX
3655 +#define INT8_MAX               (127)
3656 +#endif
3657 +#ifndef INT16_MAX
3658 +#define INT16_MAX              (32767)
3659 +#endif
3660 +#ifndef INT32_MAX
3661 +#define INT32_MAX              (2147483647)
3662 +#endif
3663 +#ifndef UINT8_MAX
3664 +#define UINT8_MAX              (255U)
3665 +#endif
3666 +#ifndef UINT16_MAX
3667 +#define UINT16_MAX             (65535U)
3668 +#endif
3669 +#ifndef UINT32_MAX
3670 +#define UINT32_MAX             (4294967295U)
3671 +#endif
3672 +
3673 +#endif /* ! FLEXINT_H */
3674 +
3675 +#ifdef __cplusplus
3676 +
3677 +/* The "const" storage-class-modifier is valid. */
3678 +#define YY_USE_CONST
3679 +
3680 +#else  /* ! __cplusplus */
3681 +
3682 +#if __STDC__
3683 +
3684 +#define YY_USE_CONST
3685 +
3686 +#endif /* __STDC__ */
3687 +#endif /* ! __cplusplus */
3688 +
3689 +#ifdef YY_USE_CONST
3690 +#define yyconst const
3691 +#else
3692 +#define yyconst
3693 +#endif
3694 +
3695 +/* Returned upon end-of-file. */
3696 +#define YY_NULL 0
3697 +
3698 +/* Promotes a possibly negative, possibly signed char to an unsigned
3699 + * integer for use as an array index.  If the signed char is negative,
3700 + * we want to instead treat it as an 8-bit unsigned char, hence the
3701 + * double cast.
3702 + */
3703 +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
3704 +
3705 +/* Enter a start condition.  This macro really ought to take a parameter,
3706 + * but we do it the disgusting crufty way forced on us by the ()-less
3707 + * definition of BEGIN.
3708 + */
3709 +#define BEGIN (yy_start) = 1 + 2 *
3710 +
3711 +/* Translate the current start state into a value that can be later handed
3712 + * to BEGIN to return to the state.  The YYSTATE alias is for lex
3713 + * compatibility.
3714 + */
3715 +#define YY_START (((yy_start) - 1) / 2)
3716 +#define YYSTATE YY_START
3717 +
3718 +/* Action number for EOF rule of a given start state. */
3719 +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
3720 +
3721 +/* Special action meaning "start processing a new file". */
3722 +#define YY_NEW_FILE yyrestart(yyin  )
3723 +
3724 +#define YY_END_OF_BUFFER_CHAR 0
3725 +
3726 +/* Size of default input buffer. */
3727 +#ifndef YY_BUF_SIZE
3728 +#define YY_BUF_SIZE 16384
3729 +#endif
3730 +
3731 +/* The state buf must be large enough to hold one state per character in the main buffer.
3732 + */
3733 +#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
3734 +
3735 +#ifndef YY_TYPEDEF_YY_BUFFER_STATE
3736 +#define YY_TYPEDEF_YY_BUFFER_STATE
3737 +typedef struct yy_buffer_state *YY_BUFFER_STATE;
3738 +#endif
3739 +
3740 +extern int yyleng;
3741 +
3742 +extern FILE *yyin, *yyout;
3743 +
3744 +#define EOB_ACT_CONTINUE_SCAN 0
3745 +#define EOB_ACT_END_OF_FILE 1
3746 +#define EOB_ACT_LAST_MATCH 2
3747 +
3748 +    /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
3749 +     *       access to the local variable yy_act. Since yyless() is a macro, it would break
3750 +     *       existing scanners that call yyless() from OUTSIDE yylex. 
3751 +     *       One obvious solution it to make yy_act a global. I tried that, and saw
3752 +     *       a 5% performance hit in a non-yylineno scanner, because yy_act is
3753 +     *       normally declared as a register variable-- so it is not worth it.
3754 +     */
3755 +    #define  YY_LESS_LINENO(n) \
3756 +            do { \
3757 +                int yyl;\
3758 +                for ( yyl = n; yyl < yyleng; ++yyl )\
3759 +                    if ( yytext[yyl] == '\n' )\
3760 +                        --yylineno;\
3761 +            }while(0)
3762 +    
3763 +/* Return all but the first "n" matched characters back to the input stream. */
3764 +#define yyless(n) \
3765 +       do \
3766 +               { \
3767 +               /* Undo effects of setting up yytext. */ \
3768 +        int yyless_macro_arg = (n); \
3769 +        YY_LESS_LINENO(yyless_macro_arg);\
3770 +               *yy_cp = (yy_hold_char); \
3771 +               YY_RESTORE_YY_MORE_OFFSET \
3772 +               (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
3773 +               YY_DO_BEFORE_ACTION; /* set up yytext again */ \
3774 +               } \
3775 +       while ( 0 )
3776 +
3777 +#define unput(c) yyunput( c, (yytext_ptr)  )
3778 +
3779 +/* The following is because we cannot portably get our hands on size_t
3780 + * (without autoconf's help, which isn't available because we want
3781 + * flex-generated scanners to compile on their own).
3782 + */
3783 +
3784 +#ifndef YY_TYPEDEF_YY_SIZE_T
3785 +#define YY_TYPEDEF_YY_SIZE_T
3786 +typedef unsigned int yy_size_t;
3787 +#endif
3788 +
3789 +#ifndef YY_STRUCT_YY_BUFFER_STATE
3790 +#define YY_STRUCT_YY_BUFFER_STATE
3791 +struct yy_buffer_state
3792 +       {
3793 +       FILE *yy_input_file;
3794 +
3795 +       char *yy_ch_buf;                /* input buffer */
3796 +       char *yy_buf_pos;               /* current position in input buffer */
3797 +
3798 +       /* Size of input buffer in bytes, not including room for EOB
3799 +        * characters.
3800 +        */
3801 +       yy_size_t yy_buf_size;
3802 +
3803 +       /* Number of characters read into yy_ch_buf, not including EOB
3804 +        * characters.
3805 +        */
3806 +       int yy_n_chars;
3807 +
3808 +       /* Whether we "own" the buffer - i.e., we know we created it,
3809 +        * and can realloc() it to grow it, and should free() it to
3810 +        * delete it.
3811 +        */
3812 +       int yy_is_our_buffer;
3813 +
3814 +       /* Whether this is an "interactive" input source; if so, and
3815 +        * if we're using stdio for input, then we want to use getc()
3816 +        * instead of fread(), to make sure we stop fetching input after
3817 +        * each newline.
3818 +        */
3819 +       int yy_is_interactive;
3820 +
3821 +       /* Whether we're considered to be at the beginning of a line.
3822 +        * If so, '^' rules will be active on the next match, otherwise
3823 +        * not.
3824 +        */
3825 +       int yy_at_bol;
3826 +
3827 +    int yy_bs_lineno; /**< The line count. */
3828 +    int yy_bs_column; /**< The column count. */
3829 +    
3830 +       /* Whether to try to fill the input buffer when we reach the
3831 +        * end of it.
3832 +        */
3833 +       int yy_fill_buffer;
3834 +
3835 +       int yy_buffer_status;
3836 +
3837 +#define YY_BUFFER_NEW 0
3838 +#define YY_BUFFER_NORMAL 1
3839 +       /* When an EOF's been seen but there's still some text to process
3840 +        * then we mark the buffer as YY_EOF_PENDING, to indicate that we
3841 +        * shouldn't try reading from the input source any more.  We might
3842 +        * still have a bunch of tokens to match, though, because of
3843 +        * possible backing-up.
3844 +        *
3845 +        * When we actually see the EOF, we change the status to "new"
3846 +        * (via yyrestart()), so that the user can continue scanning by
3847 +        * just pointing yyin at a new input file.
3848 +        */
3849 +#define YY_BUFFER_EOF_PENDING 2
3850 +
3851 +       };
3852 +#endif /* !YY_STRUCT_YY_BUFFER_STATE */
3853 +
3854 +/* Stack of input buffers. */
3855 +static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
3856 +static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
3857 +static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
3858 +
3859 +/* We provide macros for accessing buffer states in case in the
3860 + * future we want to put the buffer states in a more general
3861 + * "scanner state".
3862 + *
3863 + * Returns the top of the stack, or NULL.
3864 + */
3865 +#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
3866 +                          ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
3867 +                          : NULL)
3868 +
3869 +/* Same as previous macro, but useful when we know that the buffer stack is not
3870 + * NULL or when we need an lvalue. For internal use only.
3871 + */
3872 +#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
3873 +
3874 +/* yy_hold_char holds the character lost when yytext is formed. */
3875 +static char yy_hold_char;
3876 +static int yy_n_chars;         /* number of characters read into yy_ch_buf */
3877 +int yyleng;
3878 +
3879 +/* Points to current character in buffer. */
3880 +static char *yy_c_buf_p = (char *) 0;
3881 +static int yy_init = 0;                /* whether we need to initialize */
3882 +static int yy_start = 0;       /* start state number */
3883 +
3884 +/* Flag which is used to allow yywrap()'s to do buffer switches
3885 + * instead of setting up a fresh yyin.  A bit of a hack ...
3886 + */
3887 +static int yy_did_buffer_switch_on_eof;
3888 +
3889 +void yyrestart (FILE *input_file  );
3890 +void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
3891 +YY_BUFFER_STATE yy_create_buffer (FILE *file,int size  );
3892 +void yy_delete_buffer (YY_BUFFER_STATE b  );
3893 +void yy_flush_buffer (YY_BUFFER_STATE b  );
3894 +void yypush_buffer_state (YY_BUFFER_STATE new_buffer  );
3895 +void yypop_buffer_state (void );
3896 +
3897 +static void yyensure_buffer_stack (void );
3898 +static void yy_load_buffer_state (void );
3899 +static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file  );
3900 +
3901 +#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
3902 +
3903 +YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size  );
3904 +YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str  );
3905 +YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len  );
3906 +
3907 +void *yyalloc (yy_size_t  );
3908 +void *yyrealloc (void *,yy_size_t  );
3909 +void yyfree (void *  );
3910 +
3911 +#define yy_new_buffer yy_create_buffer
3912 +
3913 +#define yy_set_interactive(is_interactive) \
3914 +       { \
3915 +       if ( ! YY_CURRENT_BUFFER ){ \
3916 +        yyensure_buffer_stack (); \
3917 +               YY_CURRENT_BUFFER_LVALUE =    \
3918 +            yy_create_buffer(yyin,YY_BUF_SIZE ); \
3919 +       } \
3920 +       YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
3921 +       }
3922 +
3923 +#define yy_set_bol(at_bol) \
3924 +       { \
3925 +       if ( ! YY_CURRENT_BUFFER ){\
3926 +        yyensure_buffer_stack (); \
3927 +               YY_CURRENT_BUFFER_LVALUE =    \
3928 +            yy_create_buffer(yyin,YY_BUF_SIZE ); \
3929 +       } \
3930 +       YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
3931 +       }
3932 +
3933 +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
3934 +
3935 +/* Begin user sect3 */
3936 +
3937 +#define yywrap() 1
3938 +#define YY_SKIP_YYWRAP
3939 +
3940 +typedef unsigned char YY_CHAR;
3941 +
3942 +FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
3943 +
3944 +typedef int yy_state_type;
3945 +
3946 +extern int yylineno;
3947 +
3948 +int yylineno = 1;
3949 +
3950 +extern char *yytext;
3951 +#define yytext_ptr yytext
3952 +
3953 +static yy_state_type yy_get_previous_state (void );
3954 +static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
3955 +static int yy_get_next_buffer (void );
3956 +static void yy_fatal_error (yyconst char msg[]  );
3957 +
3958 +/* Done after the current pattern has been matched and before the
3959 + * corresponding action - sets up yytext.
3960 + */
3961 +#define YY_DO_BEFORE_ACTION \
3962 +       (yytext_ptr) = yy_bp; \
3963 +       yyleng = (size_t) (yy_cp - yy_bp); \
3964 +       (yy_hold_char) = *yy_cp; \
3965 +       *yy_cp = '\0'; \
3966 +       (yy_c_buf_p) = yy_cp;
3967 +
3968 +#define YY_NUM_RULES 20
3969 +#define YY_END_OF_BUFFER 21
3970 +/* This struct is not used in this scanner,
3971 +   but its presence is necessary. */
3972 +struct yy_trans_info
3973 +       {
3974 +       flex_int32_t yy_verify;
3975 +       flex_int32_t yy_nxt;
3976 +       };
3977 +static yyconst flex_int16_t yy_accept[94] =
3978 +    {   0,
3979 +        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
3980 +       21,   19,   16,   16,   19,   19,   19,    8,    8,   19,
3981 +        8,   19,   19,   19,   19,   14,   15,   15,   19,    9,
3982 +        9,   16,    0,    3,    0,    0,   10,    0,    0,    0,
3983 +        0,    0,    0,    8,    8,    6,    0,    7,    0,    2,
3984 +        0,   13,   13,   15,   15,    9,    0,   12,   10,    0,
3985 +        0,    0,    0,   18,    0,    0,    0,    2,    9,    0,
3986 +       17,    0,    0,    0,   11,    0,    0,    0,    0,    0,
3987 +        0,    0,    0,    0,    4,    0,    0,    1,    0,    0,
3988 +        0,    5,    0
3989 +
3990 +    } ;
3991 +
3992 +static yyconst flex_int32_t yy_ec[256] =
3993 +    {   0,
3994 +        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
3995 +        2,    2,    2,    1,    1,    1,    1,    1,    1,    1,
3996 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
3997 +        1,    2,    1,    4,    5,    1,    1,    6,    1,    1,
3998 +        1,    7,    8,    8,    9,    8,   10,   11,   12,   13,
3999 +       13,   13,   13,   13,   13,   13,   13,   14,    1,    1,
4000 +        1,    1,    8,    8,   15,   15,   15,   15,   15,   15,
4001 +       16,   16,   16,   16,   16,   16,   16,   16,   16,   16,
4002 +       16,   16,   16,   16,   16,   16,   16,   17,   16,   16,
4003 +        1,   18,   19,    1,   16,    1,   15,   20,   21,   22,
4004 +
4005 +       23,   15,   16,   24,   25,   16,   16,   26,   27,   28,
4006 +       24,   16,   16,   29,   30,   31,   32,   33,   16,   17,
4007 +       16,   16,   34,    1,   35,    1,    1,    1,    1,    1,
4008 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
4009 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
4010 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
4011 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
4012 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
4013 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
4014 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
4015 +
4016 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
4017 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
4018 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
4019 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
4020 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
4021 +        1,    1,    1,    1,    1
4022 +    } ;
4023 +
4024 +static yyconst flex_int32_t yy_meta[36] =
4025 +    {   0,
4026 +        1,    1,    1,    1,    2,    1,    2,    2,    2,    3,
4027 +        4,    4,    4,    5,    6,    7,    7,    1,    1,    6,
4028 +        6,    6,    6,    7,    7,    7,    7,    7,    7,    7,
4029 +        7,    7,    7,    8,    1
4030 +    } ;
4031 +
4032 +static yyconst flex_int16_t yy_base[107] =
4033 +    {   0,
4034 +        0,    0,   32,    0,   53,    0,   76,    0,  108,  111,
4035 +      280,  288,   37,   39,   33,   36,  106,    0,  123,  146,
4036 +      255,  251,   45,    0,  159,  288,    0,   53,  108,  172,
4037 +      114,  127,  158,  288,  245,    0,    0,  234,  235,  236,
4038 +      197,  195,  199,    0,    0,  288,    0,  288,  160,  288,
4039 +      183,  288,    0,    0,  183,  182,    0,    0,    0,    0,
4040 +      204,  189,  207,  288,  179,  187,  180,  194,    0,  171,
4041 +      288,  196,  178,  174,  288,  169,  169,  177,  165,  153,
4042 +      143,  155,  137,  118,  288,  122,   42,  288,   36,   36,
4043 +       40,  288,  288,  212,  218,  223,  229,  234,  239,  245,
4044 +
4045 +      251,  255,  262,  270,  275,  280
4046 +    } ;
4047 +
4048 +static yyconst flex_int16_t yy_def[107] =
4049 +    {   0,
4050 +       93,    1,    1,    3,    3,    5,   93,    7,    3,    3,
4051 +       93,   93,   93,   93,   94,   95,   93,   96,   93,   19,
4052 +       19,   20,   97,   98,   20,   93,   99,  100,   95,   93,
4053 +       93,   93,   94,   93,   94,  101,  102,   93,  103,  104,
4054 +       93,   93,   93,   96,   19,   93,   20,   93,   97,   93,
4055 +       97,   93,   20,   99,  100,   93,  105,  101,  102,  106,
4056 +      103,  103,  104,   93,   93,   93,   93,   94,  105,  106,
4057 +       93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
4058 +       93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
4059 +       93,   93,    0,   93,   93,   93,   93,   93,   93,   93,
4060 +
4061 +       93,   93,   93,   93,   93,   93
4062 +    } ;
4063 +
4064 +static yyconst flex_int16_t yy_nxt[324] =
4065 +    {   0,
4066 +       12,   13,   14,   15,   12,   16,   12,   12,   12,   17,
4067 +       18,   18,   18,   12,   19,   20,   20,   12,   12,   21,
4068 +       19,   21,   19,   22,   20,   20,   20,   20,   20,   20,
4069 +       20,   20,   20,   12,   12,   23,   34,   12,   32,   32,
4070 +       32,   32,   12,   12,   12,   36,   20,   33,   50,   92,
4071 +       35,   20,   20,   20,   20,   20,   15,   54,   91,   54,
4072 +       54,   54,   51,   24,   24,   24,   46,   25,   90,   38,
4073 +       89,   26,   25,   25,   25,   25,   12,   13,   14,   15,
4074 +       27,   12,   27,   27,   27,   17,   27,   27,   27,   12,
4075 +       28,   28,   28,   12,   12,   28,   28,   28,   28,   28,
4076 +
4077 +       28,   28,   28,   28,   28,   28,   28,   28,   28,   12,
4078 +       12,   15,   39,   29,   15,   40,   29,   93,   30,   31,
4079 +       31,   30,   31,   31,   56,   56,   56,   41,   32,   32,
4080 +       42,   88,   43,   45,   45,   45,   46,   45,   47,   47,
4081 +       87,   38,   45,   45,   45,   45,   47,   47,   47,   47,
4082 +       47,   47,   47,   47,   47,   47,   47,   47,   47,   86,
4083 +       47,   34,   33,   50,   85,   47,   47,   47,   47,   53,
4084 +       53,   53,   84,   53,   83,   35,   82,   51,   53,   53,
4085 +       53,   53,   56,   56,   56,   93,   68,   54,   57,   54,
4086 +       54,   54,   56,   56,   56,   62,   46,   34,   71,   81,
4087 +
4088 +       80,   79,   78,   77,   76,   75,   74,   73,   72,   64,
4089 +       62,   35,   33,   33,   33,   33,   33,   33,   33,   33,
4090 +       37,   67,   66,   37,   37,   37,   44,   65,   44,   49,
4091 +       49,   49,   49,   49,   49,   49,   49,   52,   64,   52,
4092 +       54,   62,   54,   60,   54,   54,   55,   93,   55,   55,
4093 +       55,   55,   58,   58,   58,   48,   58,   58,   59,   48,
4094 +       59,   59,   61,   61,   61,   61,   61,   61,   61,   61,
4095 +       63,   63,   63,   63,   63,   63,   63,   63,   69,   93,
4096 +       69,   70,   70,   70,   93,   70,   70,   11,   93,   93,
4097 +       93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
4098 +
4099 +       93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
4100 +       93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
4101 +       93,   93,   93
4102 +    } ;
4103 +
4104 +static yyconst flex_int16_t yy_chk[324] =
4105 +    {   0,
4106 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
4107 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
4108 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
4109 +        1,    1,    1,    1,    1,    3,   15,    3,   13,   13,
4110 +       14,   14,    3,    3,    3,   16,    3,   23,   23,   91,
4111 +       15,    3,    3,    3,    3,    3,    5,   28,   90,   28,
4112 +       28,   28,   23,    5,    5,    5,   28,    5,   89,   16,
4113 +       87,    5,    5,    5,    5,    5,    7,    7,    7,    7,
4114 +        7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
4115 +        7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
4116 +
4117 +        7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
4118 +        7,    9,   17,    9,   10,   17,   10,   29,    9,    9,
4119 +        9,   10,   10,   10,   31,   31,   31,   17,   32,   32,
4120 +       17,   86,   17,   19,   19,   19,   19,   19,   19,   19,
4121 +       84,   29,   19,   19,   19,   19,   19,   19,   19,   19,
4122 +       19,   19,   19,   19,   19,   19,   20,   20,   20,   83,
4123 +       20,   33,   49,   49,   82,   20,   20,   20,   20,   25,
4124 +       25,   25,   81,   25,   80,   33,   79,   49,   25,   25,
4125 +       25,   25,   30,   30,   30,   51,   51,   55,   30,   55,
4126 +       55,   55,   56,   56,   56,   62,   55,   68,   62,   78,
4127 +
4128 +       77,   76,   74,   73,   72,   70,   67,   66,   65,   63,
4129 +       61,   68,   94,   94,   94,   94,   94,   94,   94,   94,
4130 +       95,   43,   42,   95,   95,   95,   96,   41,   96,   97,
4131 +       97,   97,   97,   97,   97,   97,   97,   98,   40,   98,
4132 +       99,   39,   99,   38,   99,   99,  100,   35,  100,  100,
4133 +      100,  100,  101,  101,  101,   22,  101,  101,  102,   21,
4134 +      102,  102,  103,  103,  103,  103,  103,  103,  103,  103,
4135 +      104,  104,  104,  104,  104,  104,  104,  104,  105,   11,
4136 +      105,  106,  106,  106,    0,  106,  106,   93,   93,   93,
4137 +       93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
4138 +
4139 +       93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
4140 +       93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
4141 +       93,   93,   93
4142 +    } ;
4143 +
4144 +/* Table of booleans, true if rule could match eol. */
4145 +static yyconst flex_int32_t yy_rule_can_match_eol[21] =
4146 +    {   0,
4147 +0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 
4148 +    0,     };
4149 +
4150 +static yy_state_type yy_last_accepting_state;
4151 +static char *yy_last_accepting_cpos;
4152 +
4153 +extern int yy_flex_debug;
4154 +int yy_flex_debug = 0;
4155 +
4156 +/* The intent behind this definition is that it'll catch
4157 + * any uses of REJECT which flex missed.
4158 + */
4159 +#define REJECT reject_used_but_not_detected
4160 +#define yymore() yymore_used_but_not_detected
4161 +#define YY_MORE_ADJ 0
4162 +#define YY_RESTORE_YY_MORE_OFFSET
4163 +char *yytext;
4164 +#line 1 "dtc-lexer.l"
4165 +/*
4166 + * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
4167 + *
4168 + *
4169 + * This program is free software; you can redistribute it and/or
4170 + * modify it under the terms of the GNU General Public License as
4171 + * published by the Free Software Foundation; either version 2 of the
4172 + * License, or (at your option) any later version.
4173 + *
4174 + *  This program is distributed in the hope that it will be useful,
4175 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
4176 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4177 + *  General Public License for more details.
4178 + *
4179 + *  You should have received a copy of the GNU General Public License
4180 + *  along with this program; if not, write to the Free Software
4181 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
4182 + *                                                                   USA
4183 + */
4184 +
4185 +
4186 +
4187 +
4188 +#line 33 "dtc-lexer.l"
4189 +#include "dtc.h"
4190 +#include "srcpos.h"
4191 +#include "dtc-parser.tab.h"
4192 +
4193 +
4194 +/*#define LEXDEBUG     1*/
4195 +
4196 +#ifdef LEXDEBUG
4197 +#define DPRINT(fmt, ...)       fprintf(stderr, fmt, ##__VA_ARGS__)
4198 +#else
4199 +#define DPRINT(fmt, ...)       do { } while (0)
4200 +#endif
4201 +
4202 +static int dts_version; /* = 0 */
4203 +
4204 +#define BEGIN_DEFAULT()        if (dts_version == 0) { \
4205 +                               DPRINT("<INITIAL>\n"); \
4206 +                               BEGIN(INITIAL); \
4207 +                       } else { \
4208 +                               DPRINT("<V1>\n"); \
4209 +                               BEGIN(V1); \
4210 +                       }
4211 +#line 627 "dtc-lexer.lex.c"
4212 +
4213 +#define INITIAL 0
4214 +#define INCLUDE 1
4215 +#define BYTESTRING 2
4216 +#define PROPNODENAME 3
4217 +#define V1 4
4218 +
4219 +#ifndef YY_NO_UNISTD_H
4220 +/* Special case for "unistd.h", since it is non-ANSI. We include it way
4221 + * down here because we want the user's section 1 to have been scanned first.
4222 + * The user has a chance to override it with an option.
4223 + */
4224 +#include <unistd.h>
4225 +#endif
4226 +
4227 +#ifndef YY_EXTRA_TYPE
4228 +#define YY_EXTRA_TYPE void *
4229 +#endif
4230 +
4231 +static int yy_init_globals (void );
4232 +
4233 +/* Macros after this point can all be overridden by user definitions in
4234 + * section 1.
4235 + */
4236 +
4237 +#ifndef YY_SKIP_YYWRAP
4238 +#ifdef __cplusplus
4239 +extern "C" int yywrap (void );
4240 +#else
4241 +extern int yywrap (void );
4242 +#endif
4243 +#endif
4244 +
4245 +#ifndef yytext_ptr
4246 +static void yy_flex_strncpy (char *,yyconst char *,int );
4247 +#endif
4248 +
4249 +#ifdef YY_NEED_STRLEN
4250 +static int yy_flex_strlen (yyconst char * );
4251 +#endif
4252 +
4253 +#ifndef YY_NO_INPUT
4254 +
4255 +#ifdef __cplusplus
4256 +static int yyinput (void );
4257 +#else
4258 +static int input (void );
4259 +#endif
4260 +
4261 +#endif
4262 +
4263 +/* Amount of stuff to slurp up with each read. */
4264 +#ifndef YY_READ_BUF_SIZE
4265 +#define YY_READ_BUF_SIZE 8192
4266 +#endif
4267 +
4268 +/* Copy whatever the last rule matched to the standard output. */
4269 +#ifndef ECHO
4270 +/* This used to be an fputs(), but since the string might contain NUL's,
4271 + * we now use fwrite().
4272 + */
4273 +#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
4274 +#endif
4275 +
4276 +/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
4277 + * is returned in "result".
4278 + */
4279 +#ifndef YY_INPUT
4280 +#define YY_INPUT(buf,result,max_size) \
4281 +       if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
4282 +               { \
4283 +               int c = '*'; \
4284 +               size_t n; \
4285 +               for ( n = 0; n < max_size && \
4286 +                            (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
4287 +                       buf[n] = (char) c; \
4288 +               if ( c == '\n' ) \
4289 +                       buf[n++] = (char) c; \
4290 +               if ( c == EOF && ferror( yyin ) ) \
4291 +                       YY_FATAL_ERROR( "input in flex scanner failed" ); \
4292 +               result = n; \
4293 +               } \
4294 +       else \
4295 +               { \
4296 +               errno=0; \
4297 +               while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
4298 +                       { \
4299 +                       if( errno != EINTR) \
4300 +                               { \
4301 +                               YY_FATAL_ERROR( "input in flex scanner failed" ); \
4302 +                               break; \
4303 +                               } \
4304 +                       errno=0; \
4305 +                       clearerr(yyin); \
4306 +                       } \
4307 +               }\
4308 +\
4309 +
4310 +#endif
4311 +
4312 +/* No semi-colon after return; correct usage is to write "yyterminate();" -
4313 + * we don't want an extra ';' after the "return" because that will cause
4314 + * some compilers to complain about unreachable statements.
4315 + */
4316 +#ifndef yyterminate
4317 +#define yyterminate() return YY_NULL
4318 +#endif
4319 +
4320 +/* Number of entries by which start-condition stack grows. */
4321 +#ifndef YY_START_STACK_INCR
4322 +#define YY_START_STACK_INCR 25
4323 +#endif
4324 +
4325 +/* Report a fatal error. */
4326 +#ifndef YY_FATAL_ERROR
4327 +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
4328 +#endif
4329 +
4330 +/* end tables serialization structures and prototypes */
4331 +
4332 +/* Default declaration of generated scanner - a define so the user can
4333 + * easily add parameters.
4334 + */
4335 +#ifndef YY_DECL
4336 +#define YY_DECL_IS_OURS 1
4337 +
4338 +extern int yylex (void);
4339 +
4340 +#define YY_DECL int yylex (void)
4341 +#endif /* !YY_DECL */
4342 +
4343 +/* Code executed at the beginning of each rule, after yytext and yyleng
4344 + * have been set up.
4345 + */
4346 +#ifndef YY_USER_ACTION
4347 +#define YY_USER_ACTION
4348 +#endif
4349 +
4350 +/* Code executed at the end of each rule. */
4351 +#ifndef YY_BREAK
4352 +#define YY_BREAK break;
4353 +#endif
4354 +
4355 +#define YY_RULE_SETUP \
4356 +       YY_USER_ACTION
4357 +
4358 +/** The main scanner function which does all the work.
4359 + */
4360 +YY_DECL
4361 +{
4362 +       register yy_state_type yy_current_state;
4363 +       register char *yy_cp, *yy_bp;
4364 +       register int yy_act;
4365 +    
4366 +#line 57 "dtc-lexer.l"
4367 +
4368 +#line 784 "dtc-lexer.lex.c"
4369 +
4370 +       if ( !(yy_init) )
4371 +               {
4372 +               (yy_init) = 1;
4373 +
4374 +#ifdef YY_USER_INIT
4375 +               YY_USER_INIT;
4376 +#endif
4377 +
4378 +               if ( ! (yy_start) )
4379 +                       (yy_start) = 1; /* first start state */
4380 +
4381 +               if ( ! yyin )
4382 +                       yyin = stdin;
4383 +
4384 +               if ( ! yyout )
4385 +                       yyout = stdout;
4386 +
4387 +               if ( ! YY_CURRENT_BUFFER ) {
4388 +                       yyensure_buffer_stack ();
4389 +                       YY_CURRENT_BUFFER_LVALUE =
4390 +                               yy_create_buffer(yyin,YY_BUF_SIZE );
4391 +               }
4392 +
4393 +               yy_load_buffer_state( );
4394 +               }
4395 +
4396 +       while ( 1 )             /* loops until end-of-file is reached */
4397 +               {
4398 +               yy_cp = (yy_c_buf_p);
4399 +
4400 +               /* Support of yytext. */
4401 +               *yy_cp = (yy_hold_char);
4402 +
4403 +               /* yy_bp points to the position in yy_ch_buf of the start of
4404 +                * the current run.
4405 +                */
4406 +               yy_bp = yy_cp;
4407 +
4408 +               yy_current_state = (yy_start);
4409 +yy_match:
4410 +               do
4411 +                       {
4412 +                       register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
4413 +                       if ( yy_accept[yy_current_state] )
4414 +                               {
4415 +                               (yy_last_accepting_state) = yy_current_state;
4416 +                               (yy_last_accepting_cpos) = yy_cp;
4417 +                               }
4418 +                       while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
4419 +                               {
4420 +                               yy_current_state = (int) yy_def[yy_current_state];
4421 +                               if ( yy_current_state >= 94 )
4422 +                                       yy_c = yy_meta[(unsigned int) yy_c];
4423 +                               }
4424 +                       yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
4425 +                       ++yy_cp;
4426 +                       }
4427 +               while ( yy_base[yy_current_state] != 288 );
4428 +
4429 +yy_find_action:
4430 +               yy_act = yy_accept[yy_current_state];
4431 +               if ( yy_act == 0 )
4432 +                       { /* have to back up */
4433 +                       yy_cp = (yy_last_accepting_cpos);
4434 +                       yy_current_state = (yy_last_accepting_state);
4435 +                       yy_act = yy_accept[yy_current_state];
4436 +                       }
4437 +
4438 +               YY_DO_BEFORE_ACTION;
4439 +
4440 +               if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
4441 +                       {
4442 +                       int yyl;
4443 +                       for ( yyl = 0; yyl < yyleng; ++yyl )
4444 +                               if ( yytext[yyl] == '\n' )
4445 +                                          
4446 +    yylineno++;
4447 +;
4448 +                       }
4449 +
4450 +do_action:     /* This label is used only to access EOF actions. */
4451 +
4452 +               switch ( yy_act )
4453 +       { /* beginning of action switch */
4454 +                       case 0: /* must back up */
4455 +                       /* undo the effects of YY_DO_BEFORE_ACTION */
4456 +                       *yy_cp = (yy_hold_char);
4457 +                       yy_cp = (yy_last_accepting_cpos);
4458 +                       yy_current_state = (yy_last_accepting_state);
4459 +                       goto yy_find_action;
4460 +
4461 +case 1:
4462 +YY_RULE_SETUP
4463 +#line 58 "dtc-lexer.l"
4464 +BEGIN(INCLUDE);
4465 +       YY_BREAK
4466 +case 2:
4467 +YY_RULE_SETUP
4468 +#line 60 "dtc-lexer.l"
4469 +{
4470 +                       yytext[strlen(yytext) - 1] = 0;
4471 +                       if (!push_input_file(yytext + 1)) {
4472 +                               /* Some unrecoverable error.*/
4473 +                               exit(1);
4474 +                       }
4475 +                       BEGIN_DEFAULT();
4476 +               }
4477 +       YY_BREAK
4478 +case YY_STATE_EOF(INITIAL):
4479 +case YY_STATE_EOF(INCLUDE):
4480 +case YY_STATE_EOF(BYTESTRING):
4481 +case YY_STATE_EOF(PROPNODENAME):
4482 +case YY_STATE_EOF(V1):
4483 +#line 70 "dtc-lexer.l"
4484 +{
4485 +                       if (!pop_input_file()) {
4486 +                               yyterminate();
4487 +                       }
4488 +               }
4489 +       YY_BREAK
4490 +case 3:
4491 +/* rule 3 can match eol */
4492 +YY_RULE_SETUP
4493 +#line 76 "dtc-lexer.l"
4494 +{
4495 +                       yylloc.filenum = srcpos_filenum;
4496 +                       yylloc.first_line = yylineno;
4497 +                       DPRINT("String: %s\n", yytext);
4498 +                       yylval.data = data_copy_escape_string(yytext+1,
4499 +                                       yyleng-2);
4500 +                       yylloc.first_line = yylineno;
4501 +                       return DT_STRING;
4502 +               }
4503 +       YY_BREAK
4504 +case 4:
4505 +YY_RULE_SETUP
4506 +#line 86 "dtc-lexer.l"
4507 +{
4508 +                       yylloc.filenum = srcpos_filenum;
4509 +                       yylloc.first_line = yylineno;
4510 +                       DPRINT("Keyword: /dts-v1/\n");
4511 +                       dts_version = 1;
4512 +                       BEGIN_DEFAULT();
4513 +                       return DT_V1;
4514 +               }
4515 +       YY_BREAK
4516 +case 5:
4517 +YY_RULE_SETUP
4518 +#line 95 "dtc-lexer.l"
4519 +{
4520 +                       yylloc.filenum = srcpos_filenum;
4521 +                       yylloc.first_line = yylineno;
4522 +                       DPRINT("Keyword: /memreserve/\n");
4523 +                       BEGIN_DEFAULT();
4524 +                       return DT_MEMRESERVE;
4525 +               }
4526 +       YY_BREAK
4527 +case 6:
4528 +YY_RULE_SETUP
4529 +#line 103 "dtc-lexer.l"
4530 +{
4531 +                       yylloc.filenum = srcpos_filenum;
4532 +                       yylloc.first_line = yylineno;
4533 +                       DPRINT("Label: %s\n", yytext);
4534 +                       yylval.labelref = strdup(yytext);
4535 +                       yylval.labelref[yyleng-1] = '\0';
4536 +                       return DT_LABEL;
4537 +               }
4538 +       YY_BREAK
4539 +case 7:
4540 +YY_RULE_SETUP
4541 +#line 112 "dtc-lexer.l"
4542 +{
4543 +                       yylloc.filenum = srcpos_filenum;
4544 +                       yylloc.first_line = yylineno;
4545 +                       if (*yytext == 'b')
4546 +                               yylval.cbase = 2;
4547 +                       else if (*yytext == 'o')
4548 +                               yylval.cbase = 8;
4549 +                       else if (*yytext == 'd')
4550 +                               yylval.cbase = 10;
4551 +                       else
4552 +                               yylval.cbase = 16;
4553 +                       DPRINT("Base: %d\n", yylval.cbase);
4554 +                       return DT_BASE;
4555 +               }
4556 +       YY_BREAK
4557 +case 8:
4558 +YY_RULE_SETUP
4559 +#line 127 "dtc-lexer.l"
4560 +{
4561 +                       yylloc.filenum = srcpos_filenum;
4562 +                       yylloc.first_line = yylineno;
4563 +                       yylval.literal = strdup(yytext);
4564 +                       DPRINT("Literal: '%s'\n", yylval.literal);
4565 +                       return DT_LEGACYLITERAL;
4566 +               }
4567 +       YY_BREAK
4568 +case 9:
4569 +YY_RULE_SETUP
4570 +#line 135 "dtc-lexer.l"
4571 +{
4572 +                       yylloc.filenum = srcpos_filenum;
4573 +                       yylloc.first_line = yylineno;
4574 +                       yylval.literal = strdup(yytext);
4575 +                       DPRINT("Literal: '%s'\n", yylval.literal);
4576 +                       return DT_LITERAL;
4577 +               }
4578 +       YY_BREAK
4579 +case 10:
4580 +YY_RULE_SETUP
4581 +#line 143 "dtc-lexer.l"
4582 +{      /* label reference */
4583 +                       yylloc.filenum = srcpos_filenum;
4584 +                       yylloc.first_line = yylineno;
4585 +                       DPRINT("Ref: %s\n", yytext+1);
4586 +                       yylval.labelref = strdup(yytext+1);
4587 +                       return DT_REF;
4588 +               }
4589 +       YY_BREAK
4590 +case 11:
4591 +YY_RULE_SETUP
4592 +#line 151 "dtc-lexer.l"
4593 +{      /* new-style path reference */
4594 +                       yylloc.filenum = srcpos_filenum;
4595 +                       yylloc.first_line = yylineno;
4596 +                       yytext[yyleng-1] = '\0';
4597 +                       DPRINT("Ref: %s\n", yytext+2);
4598 +                       yylval.labelref = strdup(yytext+2);
4599 +                       return DT_REF;
4600 +               }
4601 +       YY_BREAK
4602 +case 12:
4603 +YY_RULE_SETUP
4604 +#line 160 "dtc-lexer.l"
4605 +{      /* old-style path reference */
4606 +                       yylloc.filenum = srcpos_filenum;
4607 +                       yylloc.first_line = yylineno;
4608 +                       DPRINT("Ref: %s\n", yytext+1);
4609 +                       yylval.labelref = strdup(yytext+1);
4610 +                       return DT_REF;
4611 +               }
4612 +       YY_BREAK
4613 +case 13:
4614 +YY_RULE_SETUP
4615 +#line 168 "dtc-lexer.l"
4616 +{
4617 +                       yylloc.filenum = srcpos_filenum;
4618 +                       yylloc.first_line = yylineno;
4619 +                       yylval.byte = strtol(yytext, NULL, 16);
4620 +                       DPRINT("Byte: %02x\n", (int)yylval.byte);
4621 +                       return DT_BYTE;
4622 +               }
4623 +       YY_BREAK
4624 +case 14:
4625 +YY_RULE_SETUP
4626 +#line 176 "dtc-lexer.l"
4627 +{
4628 +                       yylloc.filenum = srcpos_filenum;
4629 +                       yylloc.first_line = yylineno;
4630 +                       DPRINT("/BYTESTRING\n");
4631 +                       BEGIN_DEFAULT();
4632 +                       return ']';
4633 +               }
4634 +       YY_BREAK
4635 +case 15:
4636 +YY_RULE_SETUP
4637 +#line 184 "dtc-lexer.l"
4638 +{
4639 +                       yylloc.filenum = srcpos_filenum;
4640 +                       yylloc.first_line = yylineno;
4641 +                       DPRINT("PropNodeName: %s\n", yytext);
4642 +                       yylval.propnodename = strdup(yytext);
4643 +                       BEGIN_DEFAULT();
4644 +                       return DT_PROPNODENAME;
4645 +               }
4646 +       YY_BREAK
4647 +case 16:
4648 +/* rule 16 can match eol */
4649 +YY_RULE_SETUP
4650 +#line 194 "dtc-lexer.l"
4651 +/* eat whitespace */
4652 +       YY_BREAK
4653 +case 17:
4654 +/* rule 17 can match eol */
4655 +YY_RULE_SETUP
4656 +#line 196 "dtc-lexer.l"
4657 +{
4658 +                       yylloc.filenum = srcpos_filenum;
4659 +                       yylloc.first_line = yylineno;
4660 +                       DPRINT("Comment: %s\n", yytext);
4661 +                       /* eat comments */
4662 +               }
4663 +       YY_BREAK
4664 +case 18:
4665 +/* rule 18 can match eol */
4666 +YY_RULE_SETUP
4667 +#line 203 "dtc-lexer.l"
4668 +/* eat line comments */
4669 +       YY_BREAK
4670 +case 19:
4671 +YY_RULE_SETUP
4672 +#line 205 "dtc-lexer.l"
4673 +{
4674 +                       yylloc.filenum = srcpos_filenum;
4675 +                       yylloc.first_line = yylineno;
4676 +                       DPRINT("Char: %c (\\x%02x)\n", yytext[0],
4677 +                               (unsigned)yytext[0]);
4678 +                       if (yytext[0] == '[') {
4679 +                               DPRINT("<BYTESTRING>\n");
4680 +                               BEGIN(BYTESTRING);
4681 +                       }
4682 +                       if ((yytext[0] == '{')
4683 +                           || (yytext[0] == ';')) {
4684 +                               DPRINT("<PROPNODENAME>\n");
4685 +                               BEGIN(PROPNODENAME);
4686 +                       }
4687 +                       return yytext[0];
4688 +               }
4689 +       YY_BREAK
4690 +case 20:
4691 +YY_RULE_SETUP
4692 +#line 222 "dtc-lexer.l"
4693 +ECHO;
4694 +       YY_BREAK
4695 +#line 1111 "dtc-lexer.lex.c"
4696 +
4697 +       case YY_END_OF_BUFFER:
4698 +               {
4699 +               /* Amount of text matched not including the EOB char. */
4700 +               int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
4701 +
4702 +               /* Undo the effects of YY_DO_BEFORE_ACTION. */
4703 +               *yy_cp = (yy_hold_char);
4704 +               YY_RESTORE_YY_MORE_OFFSET
4705 +
4706 +               if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
4707 +                       {
4708 +                       /* We're scanning a new file or input source.  It's
4709 +                        * possible that this happened because the user
4710 +                        * just pointed yyin at a new source and called
4711 +                        * yylex().  If so, then we have to assure
4712 +                        * consistency between YY_CURRENT_BUFFER and our
4713 +                        * globals.  Here is the right place to do so, because
4714 +                        * this is the first action (other than possibly a
4715 +                        * back-up) that will match for the new input source.
4716 +                        */
4717 +                       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
4718 +                       YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
4719 +                       YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
4720 +                       }
4721 +
4722 +               /* Note that here we test for yy_c_buf_p "<=" to the position
4723 +                * of the first EOB in the buffer, since yy_c_buf_p will
4724 +                * already have been incremented past the NUL character
4725 +                * (since all states make transitions on EOB to the
4726 +                * end-of-buffer state).  Contrast this with the test
4727 +                * in input().
4728 +                */
4729 +               if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
4730 +                       { /* This was really a NUL. */
4731 +                       yy_state_type yy_next_state;
4732 +
4733 +                       (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
4734 +
4735 +                       yy_current_state = yy_get_previous_state(  );
4736 +
4737 +                       /* Okay, we're now positioned to make the NUL
4738 +                        * transition.  We couldn't have
4739 +                        * yy_get_previous_state() go ahead and do it
4740 +                        * for us because it doesn't know how to deal
4741 +                        * with the possibility of jamming (and we don't
4742 +                        * want to build jamming into it because then it
4743 +                        * will run more slowly).
4744 +                        */
4745 +
4746 +                       yy_next_state = yy_try_NUL_trans( yy_current_state );
4747 +
4748 +                       yy_bp = (yytext_ptr) + YY_MORE_ADJ;
4749 +
4750 +                       if ( yy_next_state )
4751 +                               {
4752 +                               /* Consume the NUL. */
4753 +                               yy_cp = ++(yy_c_buf_p);
4754 +                               yy_current_state = yy_next_state;
4755 +                               goto yy_match;
4756 +                               }
4757 +
4758 +                       else
4759 +                               {
4760 +                               yy_cp = (yy_c_buf_p);
4761 +                               goto yy_find_action;
4762 +                               }
4763 +                       }
4764 +
4765 +               else switch ( yy_get_next_buffer(  ) )
4766 +                       {
4767 +                       case EOB_ACT_END_OF_FILE:
4768 +                               {
4769 +                               (yy_did_buffer_switch_on_eof) = 0;
4770 +
4771 +                               if ( yywrap( ) )
4772 +                                       {
4773 +                                       /* Note: because we've taken care in
4774 +                                        * yy_get_next_buffer() to have set up
4775 +                                        * yytext, we can now set up
4776 +                                        * yy_c_buf_p so that if some total
4777 +                                        * hoser (like flex itself) wants to
4778 +                                        * call the scanner after we return the
4779 +                                        * YY_NULL, it'll still work - another
4780 +                                        * YY_NULL will get returned.
4781 +                                        */
4782 +                                       (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
4783 +
4784 +                                       yy_act = YY_STATE_EOF(YY_START);
4785 +                                       goto do_action;
4786 +                                       }
4787 +
4788 +                               else
4789 +                                       {
4790 +                                       if ( ! (yy_did_buffer_switch_on_eof) )
4791 +                                               YY_NEW_FILE;
4792 +                                       }
4793 +                               break;
4794 +                               }
4795 +
4796 +                       case EOB_ACT_CONTINUE_SCAN:
4797 +                               (yy_c_buf_p) =
4798 +                                       (yytext_ptr) + yy_amount_of_matched_text;
4799 +
4800 +                               yy_current_state = yy_get_previous_state(  );
4801 +
4802 +                               yy_cp = (yy_c_buf_p);
4803 +                               yy_bp = (yytext_ptr) + YY_MORE_ADJ;
4804 +                               goto yy_match;
4805 +
4806 +                       case EOB_ACT_LAST_MATCH:
4807 +                               (yy_c_buf_p) =
4808 +                               &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
4809 +
4810 +                               yy_current_state = yy_get_previous_state(  );
4811 +
4812 +                               yy_cp = (yy_c_buf_p);
4813 +                               yy_bp = (yytext_ptr) + YY_MORE_ADJ;
4814 +                               goto yy_find_action;
4815 +                       }
4816 +               break;
4817 +               }
4818 +
4819 +       default:
4820 +               YY_FATAL_ERROR(
4821 +                       "fatal flex scanner internal error--no action found" );
4822 +       } /* end of action switch */
4823 +               } /* end of scanning one token */
4824 +} /* end of yylex */
4825 +
4826 +/* yy_get_next_buffer - try to read in a new buffer
4827 + *
4828 + * Returns a code representing an action:
4829 + *     EOB_ACT_LAST_MATCH -
4830 + *     EOB_ACT_CONTINUE_SCAN - continue scanning from current position
4831 + *     EOB_ACT_END_OF_FILE - end of file
4832 + */
4833 +static int yy_get_next_buffer (void)
4834 +{
4835 +       register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
4836 +       register char *source = (yytext_ptr);
4837 +       register int number_to_move, i;
4838 +       int ret_val;
4839 +
4840 +       if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
4841 +               YY_FATAL_ERROR(
4842 +               "fatal flex scanner internal error--end of buffer missed" );
4843 +
4844 +       if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
4845 +               { /* Don't try to fill the buffer, so this is an EOF. */
4846 +               if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
4847 +                       {
4848 +                       /* We matched a single character, the EOB, so
4849 +                        * treat this as a final EOF.
4850 +                        */
4851 +                       return EOB_ACT_END_OF_FILE;
4852 +                       }
4853 +
4854 +               else
4855 +                       {
4856 +                       /* We matched some text prior to the EOB, first
4857 +                        * process it.
4858 +                        */
4859 +                       return EOB_ACT_LAST_MATCH;
4860 +                       }
4861 +               }
4862 +
4863 +       /* Try to read more data. */
4864 +
4865 +       /* First move last chars to start of buffer. */
4866 +       number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
4867 +
4868 +       for ( i = 0; i < number_to_move; ++i )
4869 +               *(dest++) = *(source++);
4870 +
4871 +       if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
4872 +               /* don't do the read, it's not guaranteed to return an EOF,
4873 +                * just force an EOF
4874 +                */
4875 +               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
4876 +
4877 +       else
4878 +               {
4879 +                       int num_to_read =
4880 +                       YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
4881 +
4882 +               while ( num_to_read <= 0 )
4883 +                       { /* Not enough room in the buffer - grow it. */
4884 +
4885 +                       /* just a shorter name for the current buffer */
4886 +                       YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
4887 +
4888 +                       int yy_c_buf_p_offset =
4889 +                               (int) ((yy_c_buf_p) - b->yy_ch_buf);
4890 +
4891 +                       if ( b->yy_is_our_buffer )
4892 +                               {
4893 +                               int new_size = b->yy_buf_size * 2;
4894 +
4895 +                               if ( new_size <= 0 )
4896 +                                       b->yy_buf_size += b->yy_buf_size / 8;
4897 +                               else
4898 +                                       b->yy_buf_size *= 2;
4899 +
4900 +                               b->yy_ch_buf = (char *)
4901 +                                       /* Include room in for 2 EOB chars. */
4902 +                                       yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
4903 +                               }
4904 +                       else
4905 +                               /* Can't grow it, we don't own it. */
4906 +                               b->yy_ch_buf = 0;
4907 +
4908 +                       if ( ! b->yy_ch_buf )
4909 +                               YY_FATAL_ERROR(
4910 +                               "fatal error - scanner input buffer overflow" );
4911 +
4912 +                       (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
4913 +
4914 +                       num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
4915 +                                               number_to_move - 1;
4916 +
4917 +                       }
4918 +
4919 +               if ( num_to_read > YY_READ_BUF_SIZE )
4920 +                       num_to_read = YY_READ_BUF_SIZE;
4921 +
4922 +               /* Read in more data. */
4923 +               YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
4924 +                       (yy_n_chars), (size_t) num_to_read );
4925 +
4926 +               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
4927 +               }
4928 +
4929 +       if ( (yy_n_chars) == 0 )
4930 +               {
4931 +               if ( number_to_move == YY_MORE_ADJ )
4932 +                       {
4933 +                       ret_val = EOB_ACT_END_OF_FILE;
4934 +                       yyrestart(yyin  );
4935 +                       }
4936 +
4937 +               else
4938 +                       {
4939 +                       ret_val = EOB_ACT_LAST_MATCH;
4940 +                       YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
4941 +                               YY_BUFFER_EOF_PENDING;
4942 +                       }
4943 +               }
4944 +
4945 +       else
4946 +               ret_val = EOB_ACT_CONTINUE_SCAN;
4947 +
4948 +       (yy_n_chars) += number_to_move;
4949 +       YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
4950 +       YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
4951 +
4952 +       (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
4953 +
4954 +       return ret_val;
4955 +}
4956 +
4957 +/* yy_get_previous_state - get the state just before the EOB char was reached */
4958 +
4959 +    static yy_state_type yy_get_previous_state (void)
4960 +{
4961 +       register yy_state_type yy_current_state;
4962 +       register char *yy_cp;
4963 +    
4964 +       yy_current_state = (yy_start);
4965 +
4966 +       for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
4967 +               {
4968 +               register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
4969 +               if ( yy_accept[yy_current_state] )
4970 +                       {
4971 +                       (yy_last_accepting_state) = yy_current_state;
4972 +                       (yy_last_accepting_cpos) = yy_cp;
4973 +                       }
4974 +               while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
4975 +                       {
4976 +                       yy_current_state = (int) yy_def[yy_current_state];
4977 +                       if ( yy_current_state >= 94 )
4978 +                               yy_c = yy_meta[(unsigned int) yy_c];
4979 +                       }
4980 +               yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
4981 +               }
4982 +
4983 +       return yy_current_state;
4984 +}
4985 +
4986 +/* yy_try_NUL_trans - try to make a transition on the NUL character
4987 + *
4988 + * synopsis
4989 + *     next_state = yy_try_NUL_trans( current_state );
4990 + */
4991 +    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
4992 +{
4993 +       register int yy_is_jam;
4994 +       register char *yy_cp = (yy_c_buf_p);
4995 +
4996 +       register YY_CHAR yy_c = 1;
4997 +       if ( yy_accept[yy_current_state] )
4998 +               {
4999 +               (yy_last_accepting_state) = yy_current_state;
5000 +               (yy_last_accepting_cpos) = yy_cp;
5001 +               }
5002 +       while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
5003 +               {
5004 +               yy_current_state = (int) yy_def[yy_current_state];
5005 +               if ( yy_current_state >= 94 )
5006 +                       yy_c = yy_meta[(unsigned int) yy_c];
5007 +               }
5008 +       yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
5009 +       yy_is_jam = (yy_current_state == 93);
5010 +
5011 +       return yy_is_jam ? 0 : yy_current_state;
5012 +}
5013 +
5014 +#ifndef YY_NO_INPUT
5015 +#ifdef __cplusplus
5016 +    static int yyinput (void)
5017 +#else
5018 +    static int input  (void)
5019 +#endif
5020 +
5021 +{
5022 +       int c;
5023 +    
5024 +       *(yy_c_buf_p) = (yy_hold_char);
5025 +
5026 +       if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
5027 +               {
5028 +               /* yy_c_buf_p now points to the character we want to return.
5029 +                * If this occurs *before* the EOB characters, then it's a
5030 +                * valid NUL; if not, then we've hit the end of the buffer.
5031 +                */
5032 +               if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
5033 +                       /* This was really a NUL. */
5034 +                       *(yy_c_buf_p) = '\0';
5035 +
5036 +               else
5037 +                       { /* need more input */
5038 +                       int offset = (yy_c_buf_p) - (yytext_ptr);
5039 +                       ++(yy_c_buf_p);
5040 +
5041 +                       switch ( yy_get_next_buffer(  ) )
5042 +                               {
5043 +                               case EOB_ACT_LAST_MATCH:
5044 +                                       /* This happens because yy_g_n_b()
5045 +                                        * sees that we've accumulated a
5046 +                                        * token and flags that we need to
5047 +                                        * try matching the token before
5048 +                                        * proceeding.  But for input(),
5049 +                                        * there's no matching to consider.
5050 +                                        * So convert the EOB_ACT_LAST_MATCH
5051 +                                        * to EOB_ACT_END_OF_FILE.
5052 +                                        */
5053 +
5054 +                                       /* Reset buffer status. */
5055 +                                       yyrestart(yyin );
5056 +
5057 +                                       /*FALLTHROUGH*/
5058 +
5059 +                               case EOB_ACT_END_OF_FILE:
5060 +                                       {
5061 +                                       if ( yywrap( ) )
5062 +                                               return EOF;
5063 +
5064 +                                       if ( ! (yy_did_buffer_switch_on_eof) )
5065 +                                               YY_NEW_FILE;
5066 +#ifdef __cplusplus
5067 +                                       return yyinput();
5068 +#else
5069 +                                       return input();
5070 +#endif
5071 +                                       }
5072 +
5073 +                               case EOB_ACT_CONTINUE_SCAN:
5074 +                                       (yy_c_buf_p) = (yytext_ptr) + offset;
5075 +                                       break;
5076 +                               }
5077 +                       }
5078 +               }
5079 +
5080 +       c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
5081 +       *(yy_c_buf_p) = '\0';   /* preserve yytext */
5082 +       (yy_hold_char) = *++(yy_c_buf_p);
5083 +
5084 +       if ( c == '\n' )
5085 +                  
5086 +    yylineno++;
5087 +;
5088 +
5089 +       return c;
5090 +}
5091 +#endif /* ifndef YY_NO_INPUT */
5092 +
5093 +/** Immediately switch to a different input stream.
5094 + * @param input_file A readable stream.
5095 + * 
5096 + * @note This function does not reset the start condition to @c INITIAL .
5097 + */
5098 +    void yyrestart  (FILE * input_file )
5099 +{
5100 +    
5101 +       if ( ! YY_CURRENT_BUFFER ){
5102 +        yyensure_buffer_stack ();
5103 +               YY_CURRENT_BUFFER_LVALUE =
5104 +            yy_create_buffer(yyin,YY_BUF_SIZE );
5105 +       }
5106 +
5107 +       yy_init_buffer(YY_CURRENT_BUFFER,input_file );
5108 +       yy_load_buffer_state( );
5109 +}
5110 +
5111 +/** Switch to a different input buffer.
5112 + * @param new_buffer The new input buffer.
5113 + * 
5114 + */
5115 +    void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
5116 +{
5117 +    
5118 +       /* TODO. We should be able to replace this entire function body
5119 +        * with
5120 +        *              yypop_buffer_state();
5121 +        *              yypush_buffer_state(new_buffer);
5122 +     */
5123 +       yyensure_buffer_stack ();
5124 +       if ( YY_CURRENT_BUFFER == new_buffer )
5125 +               return;
5126 +
5127 +       if ( YY_CURRENT_BUFFER )
5128 +               {
5129 +               /* Flush out information for old buffer. */
5130 +               *(yy_c_buf_p) = (yy_hold_char);
5131 +               YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
5132 +               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
5133 +               }
5134 +
5135 +       YY_CURRENT_BUFFER_LVALUE = new_buffer;
5136 +       yy_load_buffer_state( );
5137 +
5138 +       /* We don't actually know whether we did this switch during
5139 +        * EOF (yywrap()) processing, but the only time this flag
5140 +        * is looked at is after yywrap() is called, so it's safe
5141 +        * to go ahead and always set it.
5142 +        */
5143 +       (yy_did_buffer_switch_on_eof) = 1;
5144 +}
5145 +
5146 +static void yy_load_buffer_state  (void)
5147 +{
5148 +       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
5149 +       (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
5150 +       yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
5151 +       (yy_hold_char) = *(yy_c_buf_p);
5152 +}
5153 +
5154 +/** Allocate and initialize an input buffer state.
5155 + * @param file A readable stream.
5156 + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
5157 + * 
5158 + * @return the allocated buffer state.
5159 + */
5160 +    YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )
5161 +{
5162 +       YY_BUFFER_STATE b;
5163 +    
5164 +       b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
5165 +       if ( ! b )
5166 +               YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
5167 +
5168 +       b->yy_buf_size = size;
5169 +
5170 +       /* yy_ch_buf has to be 2 characters longer than the size given because
5171 +        * we need to put in 2 end-of-buffer characters.
5172 +        */
5173 +       b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2  );
5174 +       if ( ! b->yy_ch_buf )
5175 +               YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
5176 +
5177 +       b->yy_is_our_buffer = 1;
5178 +
5179 +       yy_init_buffer(b,file );
5180 +
5181 +       return b;
5182 +}
5183 +
5184 +/** Destroy the buffer.
5185 + * @param b a buffer created with yy_create_buffer()
5186 + * 
5187 + */
5188 +    void yy_delete_buffer (YY_BUFFER_STATE  b )
5189 +{
5190 +    
5191 +       if ( ! b )
5192 +               return;
5193 +
5194 +       if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
5195 +               YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
5196 +
5197 +       if ( b->yy_is_our_buffer )
5198 +               yyfree((void *) b->yy_ch_buf  );
5199 +
5200 +       yyfree((void *) b  );
5201 +}
5202 +
5203 +#ifndef __cplusplus
5204 +extern int isatty (int );
5205 +#endif /* __cplusplus */
5206 +    
5207 +/* Initializes or reinitializes a buffer.
5208 + * This function is sometimes called more than once on the same buffer,
5209 + * such as during a yyrestart() or at EOF.
5210 + */
5211 +    static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
5212 +
5213 +{
5214 +       int oerrno = errno;
5215 +    
5216 +       yy_flush_buffer(b );
5217 +
5218 +       b->yy_input_file = file;
5219 +       b->yy_fill_buffer = 1;
5220 +
5221 +    /* If b is the current buffer, then yy_init_buffer was _probably_
5222 +     * called from yyrestart() or through yy_get_next_buffer.
5223 +     * In that case, we don't want to reset the lineno or column.
5224 +     */
5225 +    if (b != YY_CURRENT_BUFFER){
5226 +        b->yy_bs_lineno = 1;
5227 +        b->yy_bs_column = 0;
5228 +    }
5229 +
5230 +        b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
5231 +    
5232 +       errno = oerrno;
5233 +}
5234 +
5235 +/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
5236 + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
5237 + * 
5238 + */
5239 +    void yy_flush_buffer (YY_BUFFER_STATE  b )
5240 +{
5241 +       if ( ! b )
5242 +               return;
5243 +
5244 +       b->yy_n_chars = 0;
5245 +
5246 +       /* We always need two end-of-buffer characters.  The first causes
5247 +        * a transition to the end-of-buffer state.  The second causes
5248 +        * a jam in that state.
5249 +        */
5250 +       b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
5251 +       b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
5252 +
5253 +       b->yy_buf_pos = &b->yy_ch_buf[0];
5254 +
5255 +       b->yy_at_bol = 1;
5256 +       b->yy_buffer_status = YY_BUFFER_NEW;
5257 +
5258 +       if ( b == YY_CURRENT_BUFFER )
5259 +               yy_load_buffer_state( );
5260 +}
5261 +
5262 +/** Pushes the new state onto the stack. The new state becomes
5263 + *  the current state. This function will allocate the stack
5264 + *  if necessary.
5265 + *  @param new_buffer The new state.
5266 + *  
5267 + */
5268 +void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
5269 +{
5270 +       if (new_buffer == NULL)
5271 +               return;
5272 +
5273 +       yyensure_buffer_stack();
5274 +
5275 +       /* This block is copied from yy_switch_to_buffer. */
5276 +       if ( YY_CURRENT_BUFFER )
5277 +               {
5278 +               /* Flush out information for old buffer. */
5279 +               *(yy_c_buf_p) = (yy_hold_char);
5280 +               YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
5281 +               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
5282 +               }
5283 +
5284 +       /* Only push if top exists. Otherwise, replace top. */
5285 +       if (YY_CURRENT_BUFFER)
5286 +               (yy_buffer_stack_top)++;
5287 +       YY_CURRENT_BUFFER_LVALUE = new_buffer;
5288 +
5289 +       /* copied from yy_switch_to_buffer. */
5290 +       yy_load_buffer_state( );
5291 +       (yy_did_buffer_switch_on_eof) = 1;
5292 +}
5293 +
5294 +/** Removes and deletes the top of the stack, if present.
5295 + *  The next element becomes the new top.
5296 + *  
5297 + */
5298 +void yypop_buffer_state (void)
5299 +{
5300 +       if (!YY_CURRENT_BUFFER)
5301 +               return;
5302 +
5303 +       yy_delete_buffer(YY_CURRENT_BUFFER );
5304 +       YY_CURRENT_BUFFER_LVALUE = NULL;
5305 +       if ((yy_buffer_stack_top) > 0)
5306 +               --(yy_buffer_stack_top);
5307 +
5308 +       if (YY_CURRENT_BUFFER) {
5309 +               yy_load_buffer_state( );
5310 +               (yy_did_buffer_switch_on_eof) = 1;
5311 +       }
5312 +}
5313 +
5314 +/* Allocates the stack if it does not exist.
5315 + *  Guarantees space for at least one push.
5316 + */
5317 +static void yyensure_buffer_stack (void)
5318 +{
5319 +       int num_to_alloc;
5320 +    
5321 +       if (!(yy_buffer_stack)) {
5322 +
5323 +               /* First allocation is just for 2 elements, since we don't know if this
5324 +                * scanner will even need a stack. We use 2 instead of 1 to avoid an
5325 +                * immediate realloc on the next call.
5326 +         */
5327 +               num_to_alloc = 1;
5328 +               (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
5329 +                                                               (num_to_alloc * sizeof(struct yy_buffer_state*)
5330 +                                                               );
5331 +               
5332 +               memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
5333 +                               
5334 +               (yy_buffer_stack_max) = num_to_alloc;
5335 +               (yy_buffer_stack_top) = 0;
5336 +               return;
5337 +       }
5338 +
5339 +       if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
5340 +
5341 +               /* Increase the buffer to prepare for a possible push. */
5342 +               int grow_size = 8 /* arbitrary grow size */;
5343 +
5344 +               num_to_alloc = (yy_buffer_stack_max) + grow_size;
5345 +               (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
5346 +                                                               ((yy_buffer_stack),
5347 +                                                               num_to_alloc * sizeof(struct yy_buffer_state*)
5348 +                                                               );
5349 +
5350 +               /* zero only the new slots.*/
5351 +               memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
5352 +               (yy_buffer_stack_max) = num_to_alloc;
5353 +       }
5354 +}
5355 +
5356 +/** Setup the input buffer state to scan directly from a user-specified character buffer.
5357 + * @param base the character buffer
5358 + * @param size the size in bytes of the character buffer
5359 + * 
5360 + * @return the newly allocated buffer state object. 
5361 + */
5362 +YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
5363 +{
5364 +       YY_BUFFER_STATE b;
5365 +    
5366 +       if ( size < 2 ||
5367 +            base[size-2] != YY_END_OF_BUFFER_CHAR ||
5368 +            base[size-1] != YY_END_OF_BUFFER_CHAR )
5369 +               /* They forgot to leave room for the EOB's. */
5370 +               return 0;
5371 +
5372 +       b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
5373 +       if ( ! b )
5374 +               YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
5375 +
5376 +       b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
5377 +       b->yy_buf_pos = b->yy_ch_buf = base;
5378 +       b->yy_is_our_buffer = 0;
5379 +       b->yy_input_file = 0;
5380 +       b->yy_n_chars = b->yy_buf_size;
5381 +       b->yy_is_interactive = 0;
5382 +       b->yy_at_bol = 1;
5383 +       b->yy_fill_buffer = 0;
5384 +       b->yy_buffer_status = YY_BUFFER_NEW;
5385 +
5386 +       yy_switch_to_buffer(b  );
5387 +
5388 +       return b;
5389 +}
5390 +
5391 +/** Setup the input buffer state to scan a string. The next call to yylex() will
5392 + * scan from a @e copy of @a str.
5393 + * @param yystr a NUL-terminated string to scan
5394 + * 
5395 + * @return the newly allocated buffer state object.
5396 + * @note If you want to scan bytes that may contain NUL values, then use
5397 + *       yy_scan_bytes() instead.
5398 + */
5399 +YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
5400 +{
5401 +    
5402 +       return yy_scan_bytes(yystr,strlen(yystr) );
5403 +}
5404 +
5405 +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
5406 + * scan from a @e copy of @a bytes.
5407 + * @param bytes the byte buffer to scan
5408 + * @param len the number of bytes in the buffer pointed to by @a bytes.
5409 + * 
5410 + * @return the newly allocated buffer state object.
5411 + */
5412 +YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
5413 +{
5414 +       YY_BUFFER_STATE b;
5415 +       char *buf;
5416 +       yy_size_t n;
5417 +       int i;
5418 +    
5419 +       /* Get memory for full buffer, including space for trailing EOB's. */
5420 +       n = _yybytes_len + 2;
5421 +       buf = (char *) yyalloc(n  );
5422 +       if ( ! buf )
5423 +               YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
5424 +
5425 +       for ( i = 0; i < _yybytes_len; ++i )
5426 +               buf[i] = yybytes[i];
5427 +
5428 +       buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
5429 +
5430 +       b = yy_scan_buffer(buf,n );
5431 +       if ( ! b )
5432 +               YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
5433 +
5434 +       /* It's okay to grow etc. this buffer, and we should throw it
5435 +        * away when we're done.
5436 +        */
5437 +       b->yy_is_our_buffer = 1;
5438 +
5439 +       return b;
5440 +}
5441 +
5442 +#ifndef YY_EXIT_FAILURE
5443 +#define YY_EXIT_FAILURE 2
5444 +#endif
5445 +
5446 +static void yy_fatal_error (yyconst char* msg )
5447 +{
5448 +       (void) fprintf( stderr, "%s\n", msg );
5449 +       exit( YY_EXIT_FAILURE );
5450 +}
5451 +
5452 +/* Redefine yyless() so it works in section 3 code. */
5453 +
5454 +#undef yyless
5455 +#define yyless(n) \
5456 +       do \
5457 +               { \
5458 +               /* Undo effects of setting up yytext. */ \
5459 +        int yyless_macro_arg = (n); \
5460 +        YY_LESS_LINENO(yyless_macro_arg);\
5461 +               yytext[yyleng] = (yy_hold_char); \
5462 +               (yy_c_buf_p) = yytext + yyless_macro_arg; \
5463 +               (yy_hold_char) = *(yy_c_buf_p); \
5464 +               *(yy_c_buf_p) = '\0'; \
5465 +               yyleng = yyless_macro_arg; \
5466 +               } \
5467 +       while ( 0 )
5468 +
5469 +/* Accessor  methods (get/set functions) to struct members. */
5470 +
5471 +/** Get the current line number.
5472 + * 
5473 + */
5474 +int yyget_lineno  (void)
5475 +{
5476 +        
5477 +    return yylineno;
5478 +}
5479 +
5480 +/** Get the input stream.
5481 + * 
5482 + */
5483 +FILE *yyget_in  (void)
5484 +{
5485 +        return yyin;
5486 +}
5487 +
5488 +/** Get the output stream.
5489 + * 
5490 + */
5491 +FILE *yyget_out  (void)
5492 +{
5493 +        return yyout;
5494 +}
5495 +
5496 +/** Get the length of the current token.
5497 + * 
5498 + */
5499 +int yyget_leng  (void)
5500 +{
5501 +        return yyleng;
5502 +}
5503 +
5504 +/** Get the current token.
5505 + * 
5506 + */
5507 +
5508 +char *yyget_text  (void)
5509 +{
5510 +        return yytext;
5511 +}
5512 +
5513 +/** Set the current line number.
5514 + * @param line_number
5515 + * 
5516 + */
5517 +void yyset_lineno (int  line_number )
5518 +{
5519 +    
5520 +    yylineno = line_number;
5521 +}
5522 +
5523 +/** Set the input stream. This does not discard the current
5524 + * input buffer.
5525 + * @param in_str A readable stream.
5526 + * 
5527 + * @see yy_switch_to_buffer
5528 + */
5529 +void yyset_in (FILE *  in_str )
5530 +{
5531 +        yyin = in_str ;
5532 +}
5533 +
5534 +void yyset_out (FILE *  out_str )
5535 +{
5536 +        yyout = out_str ;
5537 +}
5538 +
5539 +int yyget_debug  (void)
5540 +{
5541 +        return yy_flex_debug;
5542 +}
5543 +
5544 +void yyset_debug (int  bdebug )
5545 +{
5546 +        yy_flex_debug = bdebug ;
5547 +}
5548 +
5549 +static int yy_init_globals (void)
5550 +{
5551 +        /* Initialization is the same as for the non-reentrant scanner.
5552 +     * This function is called from yylex_destroy(), so don't allocate here.
5553 +     */
5554 +
5555 +    /* We do not touch yylineno unless the option is enabled. */
5556 +    yylineno =  1;
5557 +    
5558 +    (yy_buffer_stack) = 0;
5559 +    (yy_buffer_stack_top) = 0;
5560 +    (yy_buffer_stack_max) = 0;
5561 +    (yy_c_buf_p) = (char *) 0;
5562 +    (yy_init) = 0;
5563 +    (yy_start) = 0;
5564 +
5565 +/* Defined in main.c */
5566 +#ifdef YY_STDINIT
5567 +    yyin = stdin;
5568 +    yyout = stdout;
5569 +#else
5570 +    yyin = (FILE *) 0;
5571 +    yyout = (FILE *) 0;
5572 +#endif
5573 +
5574 +    /* For future reference: Set errno on error, since we are called by
5575 +     * yylex_init()
5576 +     */
5577 +    return 0;
5578 +}
5579 +
5580 +/* yylex_destroy is for both reentrant and non-reentrant scanners. */
5581 +int yylex_destroy  (void)
5582 +{
5583 +    
5584 +    /* Pop the buffer stack, destroying each element. */
5585 +       while(YY_CURRENT_BUFFER){
5586 +               yy_delete_buffer(YY_CURRENT_BUFFER  );
5587 +               YY_CURRENT_BUFFER_LVALUE = NULL;
5588 +               yypop_buffer_state();
5589 +       }
5590 +
5591 +       /* Destroy the stack itself. */
5592 +       yyfree((yy_buffer_stack) );
5593 +       (yy_buffer_stack) = NULL;
5594 +
5595 +    /* Reset the globals. This is important in a non-reentrant scanner so the next time
5596 +     * yylex() is called, initialization will occur. */
5597 +    yy_init_globals( );
5598 +
5599 +    return 0;
5600 +}
5601 +
5602 +/*
5603 + * Internal utility routines.
5604 + */
5605 +
5606 +#ifndef yytext_ptr
5607 +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
5608 +{
5609 +       register int i;
5610 +       for ( i = 0; i < n; ++i )
5611 +               s1[i] = s2[i];
5612 +}
5613 +#endif
5614 +
5615 +#ifdef YY_NEED_STRLEN
5616 +static int yy_flex_strlen (yyconst char * s )
5617 +{
5618 +       register int n;
5619 +       for ( n = 0; s[n]; ++n )
5620 +               ;
5621 +
5622 +       return n;
5623 +}
5624 +#endif
5625 +
5626 +void *yyalloc (yy_size_t  size )
5627 +{
5628 +       return (void *) malloc( size );
5629 +}
5630 +
5631 +void *yyrealloc  (void * ptr, yy_size_t  size )
5632 +{
5633 +       /* The cast to (char *) in the following accommodates both
5634 +        * implementations that use char* generic pointers, and those
5635 +        * that use void* generic pointers.  It works with the latter
5636 +        * because both ANSI C and C++ allow castless assignment from
5637 +        * any pointer type to void*, and deal with argument conversions
5638 +        * as though doing an assignment.
5639 +        */
5640 +       return (void *) realloc( (char *) ptr, size );
5641 +}
5642 +
5643 +void yyfree (void * ptr )
5644 +{
5645 +       free( (char *) ptr );   /* see yyrealloc() for (char *) cast */
5646 +}
5647 +
5648 +#define YYTABLES_NAME "yytables"
5649 +
5650 +#line 222 "dtc-lexer.l"
5651 +
5652 +
5653 +
5654 +
5655 +/*
5656 + * Stack of nested include file contexts.
5657 + */
5658 +
5659 +struct incl_file {
5660 +       int filenum;
5661 +       FILE *file;
5662 +       YY_BUFFER_STATE yy_prev_buf;
5663 +       int yy_prev_lineno;
5664 +       struct incl_file *prev;
5665 +};
5666 +
5667 +struct incl_file *incl_file_stack;
5668 +
5669 +
5670 +/*
5671 + * Detect infinite include recursion.
5672 + */
5673 +#define MAX_INCLUDE_DEPTH      (100)
5674 +
5675 +static int incl_depth = 0;
5676 +
5677 +
5678 +int push_input_file(const char *filename)
5679 +{
5680 +       FILE *f;
5681 +       struct incl_file *incl_file;
5682 +
5683 +       if (!filename) {
5684 +               yyerror("No include file name given.");
5685 +               return 0;
5686 +       }
5687 +
5688 +       if (incl_depth++ >= MAX_INCLUDE_DEPTH) {
5689 +               yyerror("Includes nested too deeply");
5690 +               return 0;
5691 +       }
5692 +
5693 +       f = dtc_open_file(filename);
5694 +
5695 +       incl_file = malloc(sizeof(struct incl_file));
5696 +       if (!incl_file) {
5697 +               yyerror("Can not allocate include file space.");
5698 +               return 0;
5699 +       }
5700 +
5701 +       /*
5702 +        * Save current context.
5703 +        */
5704 +       incl_file->yy_prev_buf = YY_CURRENT_BUFFER;
5705 +       incl_file->yy_prev_lineno = yylineno;
5706 +       incl_file->filenum = srcpos_filenum;
5707 +       incl_file->file = yyin;
5708 +       incl_file->prev = incl_file_stack;
5709 +
5710 +       incl_file_stack = incl_file;
5711 +
5712 +       /*
5713 +        * Establish new context.
5714 +        */
5715 +       srcpos_filenum = lookup_file_name(filename, 0);
5716 +       yylineno = 1;
5717 +       yyin = f;
5718 +       yy_switch_to_buffer(yy_create_buffer(yyin,YY_BUF_SIZE));
5719 +
5720 +       return 1;
5721 +}
5722 +
5723 +
5724 +int pop_input_file(void)
5725 +{
5726 +       struct incl_file *incl_file;
5727 +
5728 +       if (incl_file_stack == 0)
5729 +               return 0;
5730 +
5731 +       fclose(yyin);
5732 +
5733 +       /*
5734 +        * Pop.
5735 +        */
5736 +       --incl_depth;
5737 +       incl_file = incl_file_stack;
5738 +       incl_file_stack = incl_file->prev;
5739 +
5740 +       /*
5741 +        * Recover old context.
5742 +        */
5743 +       yy_delete_buffer(YY_CURRENT_BUFFER);
5744 +       yy_switch_to_buffer(incl_file->yy_prev_buf);
5745 +       yylineno = incl_file->yy_prev_lineno;
5746 +       srcpos_filenum = incl_file->filenum;
5747 +       yyin = incl_file->file;
5748 +
5749 +       /*
5750 +        * Free old state.
5751 +        */
5752 +       free(incl_file);
5753 +
5754 +       if (YY_CURRENT_BUFFER == 0)
5755 +               return 0;
5756 +
5757 +       return 1;
5758 +}
5759 +
5760 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dtc-src/dtc-parser.tab.c_shipped powerpc.git/arch/powerpc/boot/dtc-src/dtc-parser.tab.c_shipped
5761 --- linux-2.6.24/arch/powerpc/boot/dtc-src/dtc-parser.tab.c_shipped     1970-01-01 01:00:00.000000000 +0100
5762 +++ powerpc.git/arch/powerpc/boot/dtc-src/dtc-parser.tab.c_shipped      2008-01-28 20:25:49.000000000 +0100
5763 @@ -0,0 +1,1983 @@
5764 +/* A Bison parser, made by GNU Bison 2.3.  */
5765 +
5766 +/* Skeleton implementation for Bison's Yacc-like parsers in C
5767 +
5768 +   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
5769 +   Free Software Foundation, Inc.
5770 +
5771 +   This program is free software; you can redistribute it and/or modify
5772 +   it under the terms of the GNU General Public License as published by
5773 +   the Free Software Foundation; either version 2, or (at your option)
5774 +   any later version.
5775 +
5776 +   This program is distributed in the hope that it will be useful,
5777 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
5778 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
5779 +   GNU General Public License for more details.
5780 +
5781 +   You should have received a copy of the GNU General Public License
5782 +   along with this program; if not, write to the Free Software
5783 +   Foundation, Inc., 51 Franklin Street, Fifth Floor,
5784 +   Boston, MA 02110-1301, USA.  */
5785 +
5786 +/* As a special exception, you may create a larger work that contains
5787 +   part or all of the Bison parser skeleton and distribute that work
5788 +   under terms of your choice, so long as that work isn't itself a
5789 +   parser generator using the skeleton or a modified version thereof
5790 +   as a parser skeleton.  Alternatively, if you modify or redistribute
5791 +   the parser skeleton itself, you may (at your option) remove this
5792 +   special exception, which will cause the skeleton and the resulting
5793 +   Bison output files to be licensed under the GNU General Public
5794 +   License without this special exception.
5795 +
5796 +   This special exception was added by the Free Software Foundation in
5797 +   version 2.2 of Bison.  */
5798 +
5799 +/* C LALR(1) parser skeleton written by Richard Stallman, by
5800 +   simplifying the original so-called "semantic" parser.  */
5801 +
5802 +/* All symbols defined below should begin with yy or YY, to avoid
5803 +   infringing on user name space.  This should be done even for local
5804 +   variables, as they might otherwise be expanded by user macros.
5805 +   There are some unavoidable exceptions within include files to
5806 +   define necessary library symbols; they are noted "INFRINGES ON
5807 +   USER NAME SPACE" below.  */
5808 +
5809 +/* Identify Bison output.  */
5810 +#define YYBISON 1
5811 +
5812 +/* Bison version.  */
5813 +#define YYBISON_VERSION "2.3"
5814 +
5815 +/* Skeleton name.  */
5816 +#define YYSKELETON_NAME "yacc.c"
5817 +
5818 +/* Pure parsers.  */
5819 +#define YYPURE 0
5820 +
5821 +/* Using locations.  */
5822 +#define YYLSP_NEEDED 1
5823 +
5824 +
5825 +
5826 +/* Tokens.  */
5827 +#ifndef YYTOKENTYPE
5828 +# define YYTOKENTYPE
5829 +   /* Put the tokens into the symbol table, so that GDB and other debuggers
5830 +      know about them.  */
5831 +   enum yytokentype {
5832 +     DT_V1 = 258,
5833 +     DT_MEMRESERVE = 259,
5834 +     DT_PROPNODENAME = 260,
5835 +     DT_LITERAL = 261,
5836 +     DT_LEGACYLITERAL = 262,
5837 +     DT_BASE = 263,
5838 +     DT_BYTE = 264,
5839 +     DT_STRING = 265,
5840 +     DT_LABEL = 266,
5841 +     DT_REF = 267
5842 +   };
5843 +#endif
5844 +/* Tokens.  */
5845 +#define DT_V1 258
5846 +#define DT_MEMRESERVE 259
5847 +#define DT_PROPNODENAME 260
5848 +#define DT_LITERAL 261
5849 +#define DT_LEGACYLITERAL 262
5850 +#define DT_BASE 263
5851 +#define DT_BYTE 264
5852 +#define DT_STRING 265
5853 +#define DT_LABEL 266
5854 +#define DT_REF 267
5855 +
5856 +
5857 +
5858 +
5859 +/* Copy the first part of user declarations.  */
5860 +#line 23 "dtc-parser.y"
5861 +
5862 +#include "dtc.h"
5863 +#include "srcpos.h"
5864 +
5865 +int yylex(void);
5866 +unsigned long long eval_literal(const char *s, int base, int bits);
5867 +
5868 +extern struct boot_info *the_boot_info;
5869 +
5870 +
5871 +
5872 +/* Enabling traces.  */
5873 +#ifndef YYDEBUG
5874 +# define YYDEBUG 0
5875 +#endif
5876 +
5877 +/* Enabling verbose error messages.  */
5878 +#ifdef YYERROR_VERBOSE
5879 +# undef YYERROR_VERBOSE
5880 +# define YYERROR_VERBOSE 1
5881 +#else
5882 +# define YYERROR_VERBOSE 0
5883 +#endif
5884 +
5885 +/* Enabling the token table.  */
5886 +#ifndef YYTOKEN_TABLE
5887 +# define YYTOKEN_TABLE 0
5888 +#endif
5889 +
5890 +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
5891 +typedef union YYSTYPE
5892 +#line 34 "dtc-parser.y"
5893 +{
5894 +       char *propnodename;
5895 +       char *literal;
5896 +       char *labelref;
5897 +       unsigned int cbase;
5898 +       u8 byte;
5899 +       struct data data;
5900 +
5901 +       u64 addr;
5902 +       cell_t cell;
5903 +       struct property *prop;
5904 +       struct property *proplist;
5905 +       struct node *node;
5906 +       struct node *nodelist;
5907 +       struct reserve_info *re;
5908 +}
5909 +/* Line 187 of yacc.c.  */
5910 +#line 148 "dtc-parser.tab.c"
5911 +       YYSTYPE;
5912 +# define yystype YYSTYPE /* obsolescent; will be withdrawn */
5913 +# define YYSTYPE_IS_DECLARED 1
5914 +# define YYSTYPE_IS_TRIVIAL 1
5915 +#endif
5916 +
5917 +#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
5918 +typedef struct YYLTYPE
5919 +{
5920 +  int first_line;
5921 +  int first_column;
5922 +  int last_line;
5923 +  int last_column;
5924 +} YYLTYPE;
5925 +# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
5926 +# define YYLTYPE_IS_DECLARED 1
5927 +# define YYLTYPE_IS_TRIVIAL 1
5928 +#endif
5929 +
5930 +
5931 +/* Copy the second part of user declarations.  */
5932 +
5933 +
5934 +/* Line 216 of yacc.c.  */
5935 +#line 173 "dtc-parser.tab.c"
5936 +
5937 +#ifdef short
5938 +# undef short
5939 +#endif
5940 +
5941 +#ifdef YYTYPE_UINT8
5942 +typedef YYTYPE_UINT8 yytype_uint8;
5943 +#else
5944 +typedef unsigned char yytype_uint8;
5945 +#endif
5946 +
5947 +#ifdef YYTYPE_INT8
5948 +typedef YYTYPE_INT8 yytype_int8;
5949 +#elif (defined __STDC__ || defined __C99__FUNC__ \
5950 +     || defined __cplusplus || defined _MSC_VER)
5951 +typedef signed char yytype_int8;
5952 +#else
5953 +typedef short int yytype_int8;
5954 +#endif
5955 +
5956 +#ifdef YYTYPE_UINT16
5957 +typedef YYTYPE_UINT16 yytype_uint16;
5958 +#else
5959 +typedef unsigned short int yytype_uint16;
5960 +#endif
5961 +
5962 +#ifdef YYTYPE_INT16
5963 +typedef YYTYPE_INT16 yytype_int16;
5964 +#else
5965 +typedef short int yytype_int16;
5966 +#endif
5967 +
5968 +#ifndef YYSIZE_T
5969 +# ifdef __SIZE_TYPE__
5970 +#  define YYSIZE_T __SIZE_TYPE__
5971 +# elif defined size_t
5972 +#  define YYSIZE_T size_t
5973 +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
5974 +     || defined __cplusplus || defined _MSC_VER)
5975 +#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
5976 +#  define YYSIZE_T size_t
5977 +# else
5978 +#  define YYSIZE_T unsigned int
5979 +# endif
5980 +#endif
5981 +
5982 +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
5983 +
5984 +#ifndef YY_
5985 +# if YYENABLE_NLS
5986 +#  if ENABLE_NLS
5987 +#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
5988 +#   define YY_(msgid) dgettext ("bison-runtime", msgid)
5989 +#  endif
5990 +# endif
5991 +# ifndef YY_
5992 +#  define YY_(msgid) msgid
5993 +# endif
5994 +#endif
5995 +
5996 +/* Suppress unused-variable warnings by "using" E.  */
5997 +#if ! defined lint || defined __GNUC__
5998 +# define YYUSE(e) ((void) (e))
5999 +#else
6000 +# define YYUSE(e) /* empty */
6001 +#endif
6002 +
6003 +/* Identity function, used to suppress warnings about constant conditions.  */
6004 +#ifndef lint
6005 +# define YYID(n) (n)
6006 +#else
6007 +#if (defined __STDC__ || defined __C99__FUNC__ \
6008 +     || defined __cplusplus || defined _MSC_VER)
6009 +static int
6010 +YYID (int i)
6011 +#else
6012 +static int
6013 +YYID (i)
6014 +    int i;
6015 +#endif
6016 +{
6017 +  return i;
6018 +}
6019 +#endif
6020 +
6021 +#if ! defined yyoverflow || YYERROR_VERBOSE
6022 +
6023 +/* The parser invokes alloca or malloc; define the necessary symbols.  */
6024 +
6025 +# ifdef YYSTACK_USE_ALLOCA
6026 +#  if YYSTACK_USE_ALLOCA
6027 +#   ifdef __GNUC__
6028 +#    define YYSTACK_ALLOC __builtin_alloca
6029 +#   elif defined __BUILTIN_VA_ARG_INCR
6030 +#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
6031 +#   elif defined _AIX
6032 +#    define YYSTACK_ALLOC __alloca
6033 +#   elif defined _MSC_VER
6034 +#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
6035 +#    define alloca _alloca
6036 +#   else
6037 +#    define YYSTACK_ALLOC alloca
6038 +#    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
6039 +     || defined __cplusplus || defined _MSC_VER)
6040 +#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
6041 +#     ifndef _STDLIB_H
6042 +#      define _STDLIB_H 1
6043 +#     endif
6044 +#    endif
6045 +#   endif
6046 +#  endif
6047 +# endif
6048 +
6049 +# ifdef YYSTACK_ALLOC
6050 +   /* Pacify GCC's `empty if-body' warning.  */
6051 +#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
6052 +#  ifndef YYSTACK_ALLOC_MAXIMUM
6053 +    /* The OS might guarantee only one guard page at the bottom of the stack,
6054 +       and a page size can be as small as 4096 bytes.  So we cannot safely
6055 +       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
6056 +       to allow for a few compiler-allocated temporary stack slots.  */
6057 +#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
6058 +#  endif
6059 +# else
6060 +#  define YYSTACK_ALLOC YYMALLOC
6061 +#  define YYSTACK_FREE YYFREE
6062 +#  ifndef YYSTACK_ALLOC_MAXIMUM
6063 +#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
6064 +#  endif
6065 +#  if (defined __cplusplus && ! defined _STDLIB_H \
6066 +       && ! ((defined YYMALLOC || defined malloc) \
6067 +            && (defined YYFREE || defined free)))
6068 +#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
6069 +#   ifndef _STDLIB_H
6070 +#    define _STDLIB_H 1
6071 +#   endif
6072 +#  endif
6073 +#  ifndef YYMALLOC
6074 +#   define YYMALLOC malloc
6075 +#   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
6076 +     || defined __cplusplus || defined _MSC_VER)
6077 +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
6078 +#   endif
6079 +#  endif
6080 +#  ifndef YYFREE
6081 +#   define YYFREE free
6082 +#   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
6083 +     || defined __cplusplus || defined _MSC_VER)
6084 +void free (void *); /* INFRINGES ON USER NAME SPACE */
6085 +#   endif
6086 +#  endif
6087 +# endif
6088 +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
6089 +
6090 +
6091 +#if (! defined yyoverflow \
6092 +     && (! defined __cplusplus \
6093 +        || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
6094 +            && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
6095 +
6096 +/* A type that is properly aligned for any stack member.  */
6097 +union yyalloc
6098 +{
6099 +  yytype_int16 yyss;
6100 +  YYSTYPE yyvs;
6101 +    YYLTYPE yyls;
6102 +};
6103 +
6104 +/* The size of the maximum gap between one aligned stack and the next.  */
6105 +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
6106 +
6107 +/* The size of an array large to enough to hold all stacks, each with
6108 +   N elements.  */
6109 +# define YYSTACK_BYTES(N) \
6110 +     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
6111 +      + 2 * YYSTACK_GAP_MAXIMUM)
6112 +
6113 +/* Copy COUNT objects from FROM to TO.  The source and destination do
6114 +   not overlap.  */
6115 +# ifndef YYCOPY
6116 +#  if defined __GNUC__ && 1 < __GNUC__
6117 +#   define YYCOPY(To, From, Count) \
6118 +      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
6119 +#  else
6120 +#   define YYCOPY(To, From, Count)             \
6121 +      do                                       \
6122 +       {                                       \
6123 +         YYSIZE_T yyi;                         \
6124 +         for (yyi = 0; yyi < (Count); yyi++)   \
6125 +           (To)[yyi] = (From)[yyi];            \
6126 +       }                                       \
6127 +      while (YYID (0))
6128 +#  endif
6129 +# endif
6130 +
6131 +/* Relocate STACK from its old location to the new one.  The
6132 +   local variables YYSIZE and YYSTACKSIZE give the old and new number of
6133 +   elements in the stack, and YYPTR gives the new location of the
6134 +   stack.  Advance YYPTR to a properly aligned location for the next
6135 +   stack.  */
6136 +# define YYSTACK_RELOCATE(Stack)                                       \
6137 +    do                                                                 \
6138 +      {                                                                        \
6139 +       YYSIZE_T yynewbytes;                                            \
6140 +       YYCOPY (&yyptr->Stack, Stack, yysize);                          \
6141 +       Stack = &yyptr->Stack;                                          \
6142 +       yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
6143 +       yyptr += yynewbytes / sizeof (*yyptr);                          \
6144 +      }                                                                        \
6145 +    while (YYID (0))
6146 +
6147 +#endif
6148 +
6149 +/* YYFINAL -- State number of the termination state.  */
6150 +#define YYFINAL  9
6151 +/* YYLAST -- Last index in YYTABLE.  */
6152 +#define YYLAST   60
6153 +
6154 +/* YYNTOKENS -- Number of terminals.  */
6155 +#define YYNTOKENS  24
6156 +/* YYNNTS -- Number of nonterminals.  */
6157 +#define YYNNTS  20
6158 +/* YYNRULES -- Number of rules.  */
6159 +#define YYNRULES  43
6160 +/* YYNRULES -- Number of states.  */
6161 +#define YYNSTATES  67
6162 +
6163 +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
6164 +#define YYUNDEFTOK  2
6165 +#define YYMAXUTOK   267
6166 +
6167 +#define YYTRANSLATE(YYX)                                               \
6168 +  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
6169 +
6170 +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
6171 +static const yytype_uint8 yytranslate[] =
6172 +{
6173 +       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6174 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6175 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6176 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6177 +       2,     2,     2,     2,    23,    14,     2,    15,     2,     2,
6178 +       2,     2,     2,     2,     2,     2,     2,     2,     2,    13,
6179 +      19,    18,    20,     2,     2,     2,     2,     2,     2,     2,
6180 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6181 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6182 +       2,    21,     2,    22,     2,     2,     2,     2,     2,     2,
6183 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6184 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6185 +       2,     2,     2,    16,     2,    17,     2,     2,     2,     2,
6186 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6187 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6188 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6189 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6190 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6191 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6192 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6193 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6194 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6195 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6196 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6197 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6198 +       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
6199 +       5,     6,     7,     8,     9,    10,    11,    12
6200 +};
6201 +
6202 +#if YYDEBUG
6203 +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
6204 +   YYRHS.  */
6205 +static const yytype_uint8 yyprhs[] =
6206 +{
6207 +       0,     0,     3,     8,    11,    12,    15,    21,    22,    25,
6208 +      27,    34,    36,    38,    41,    47,    48,    51,    57,    61,
6209 +      64,    69,    74,    77,    80,    81,    84,    87,    88,    91,
6210 +      94,    97,    98,   100,   102,   105,   106,   109,   112,   113,
6211 +     116,   119,   123,   124
6212 +};
6213 +
6214 +/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
6215 +static const yytype_int8 yyrhs[] =
6216 +{
6217 +      25,     0,    -1,     3,    13,    26,    31,    -1,    28,    31,
6218 +      -1,    -1,    27,    26,    -1,    43,     4,    30,    30,    13,
6219 +      -1,    -1,    29,    28,    -1,    27,    -1,    43,     4,    30,
6220 +      14,    30,    13,    -1,     6,    -1,     7,    -1,    15,    32,
6221 +      -1,    16,    33,    41,    17,    13,    -1,    -1,    33,    34,
6222 +      -1,    43,     5,    18,    35,    13,    -1,    43,     5,    13,
6223 +      -1,    36,    10,    -1,    36,    19,    37,    20,    -1,    36,
6224 +      21,    40,    22,    -1,    36,    12,    -1,    35,    11,    -1,
6225 +      -1,    35,    23,    -1,    36,    11,    -1,    -1,    37,    39,
6226 +      -1,    37,    12,    -1,    37,    11,    -1,    -1,     8,    -1,
6227 +       6,    -1,    38,     7,    -1,    -1,    40,     9,    -1,    40,
6228 +      11,    -1,    -1,    42,    41,    -1,    42,    34,    -1,    43,
6229 +       5,    32,    -1,    -1,    11,    -1
6230 +};
6231 +
6232 +/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
6233 +static const yytype_uint16 yyrline[] =
6234 +{
6235 +       0,    85,    85,    89,    97,   100,   107,   115,   118,   125,
6236 +     129,   136,   140,   147,   154,   162,   165,   172,   176,   183,
6237 +     187,   191,   195,   199,   207,   210,   214,   222,   225,   229,
6238 +     234,   242,   245,   249,   253,   261,   264,   268,   276,   279,
6239 +     283,   291,   299,   302
6240 +};
6241 +#endif
6242 +
6243 +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
6244 +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
6245 +   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
6246 +static const char *const yytname[] =
6247 +{
6248 +  "$end", "error", "$undefined", "DT_V1", "DT_MEMRESERVE",
6249 +  "DT_PROPNODENAME", "DT_LITERAL", "DT_LEGACYLITERAL", "DT_BASE",
6250 +  "DT_BYTE", "DT_STRING", "DT_LABEL", "DT_REF", "';'", "'-'", "'/'", "'{'",
6251 +  "'}'", "'='", "'<'", "'>'", "'['", "']'", "','", "$accept", "sourcefile",
6252 +  "memreserves", "memreserve", "v0_memreserves", "v0_memreserve", "addr",
6253 +  "devicetree", "nodedef", "proplist", "propdef", "propdata",
6254 +  "propdataprefix", "celllist", "cellbase", "cellval", "bytestring",
6255 +  "subnodes", "subnode", "label", 0
6256 +};
6257 +#endif
6258 +
6259 +# ifdef YYPRINT
6260 +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
6261 +   token YYLEX-NUM.  */
6262 +static const yytype_uint16 yytoknum[] =
6263 +{
6264 +       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
6265 +     265,   266,   267,    59,    45,    47,   123,   125,    61,    60,
6266 +      62,    91,    93,    44
6267 +};
6268 +# endif
6269 +
6270 +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
6271 +static const yytype_uint8 yyr1[] =
6272 +{
6273 +       0,    24,    25,    25,    26,    26,    27,    28,    28,    29,
6274 +      29,    30,    30,    31,    32,    33,    33,    34,    34,    35,
6275 +      35,    35,    35,    35,    36,    36,    36,    37,    37,    37,
6276 +      37,    38,    38,    39,    39,    40,    40,    40,    41,    41,
6277 +      41,    42,    43,    43
6278 +};
6279 +
6280 +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
6281 +static const yytype_uint8 yyr2[] =
6282 +{
6283 +       0,     2,     4,     2,     0,     2,     5,     0,     2,     1,
6284 +       6,     1,     1,     2,     5,     0,     2,     5,     3,     2,
6285 +       4,     4,     2,     2,     0,     2,     2,     0,     2,     2,
6286 +       2,     0,     1,     1,     2,     0,     2,     2,     0,     2,
6287 +       2,     3,     0,     1
6288 +};
6289 +
6290 +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
6291 +   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
6292 +   means the default is an error.  */
6293 +static const yytype_uint8 yydefact[] =
6294 +{
6295 +       7,     0,    43,     0,     9,     0,     7,     0,     4,     1,
6296 +       0,     3,     8,     0,     0,     4,     0,    15,    13,    11,
6297 +      12,     0,     2,     5,     0,    38,     0,     0,     0,    16,
6298 +       0,    38,     0,     0,     6,     0,    40,    39,     0,    10,
6299 +      14,    18,    24,    41,     0,     0,    23,    17,    25,    19,
6300 +      26,    22,    27,    35,    31,     0,    33,    32,    30,    29,
6301 +      20,     0,    28,    36,    37,    21,    34
6302 +};
6303 +
6304 +/* YYDEFGOTO[NTERM-NUM].  */
6305 +static const yytype_int8 yydefgoto[] =
6306 +{
6307 +      -1,     3,    14,     4,     5,     6,    27,    11,    18,    25,
6308 +      29,    44,    45,    54,    61,    62,    55,    30,    31,     7
6309 +};
6310 +
6311 +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
6312 +   STATE-NUM.  */
6313 +#define YYPACT_NINF -13
6314 +static const yytype_int8 yypact[] =
6315 +{
6316 +      23,    11,   -13,    37,   -13,    -4,    18,    39,    18,   -13,
6317 +      28,   -13,   -13,    34,    -4,    18,    41,   -13,   -13,   -13,
6318 +     -13,    25,   -13,   -13,    34,    -3,    34,    33,    34,   -13,
6319 +      30,    -3,    43,    36,   -13,    38,   -13,   -13,    20,   -13,
6320 +     -13,   -13,   -13,   -13,     2,     9,   -13,   -13,   -13,   -13,
6321 +     -13,   -13,   -13,   -13,    -2,    -6,   -13,   -13,   -13,   -13,
6322 +     -13,    45,   -13,   -13,   -13,   -13,   -13
6323 +};
6324 +
6325 +/* YYPGOTO[NTERM-NUM].  */
6326 +static const yytype_int8 yypgoto[] =
6327 +{
6328 +     -13,   -13,    35,    27,    47,   -13,   -12,    40,    17,   -13,
6329 +      26,   -13,   -13,   -13,   -13,   -13,   -13,    29,   -13,    -8
6330 +};
6331 +
6332 +/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
6333 +   positive, shift that token.  If negative, reduce the rule which
6334 +   number is the opposite.  If zero, do what YYDEFACT says.
6335 +   If YYTABLE_NINF, syntax error.  */
6336 +#define YYTABLE_NINF -43
6337 +static const yytype_int8 yytable[] =
6338 +{
6339 +      16,    21,   -42,    63,    56,    64,    57,    16,     2,    58,
6340 +      59,    10,    28,    46,    33,    47,    65,    32,    60,    49,
6341 +      50,    51,   -42,    32,     8,    48,     1,   -42,    52,     2,
6342 +      53,    19,    20,    41,     2,    15,    17,     9,    42,    26,
6343 +      19,    20,    15,    13,    17,    24,    34,    35,    38,    39,
6344 +      23,    40,    66,    12,    22,    43,     0,    36,     0,     0,
6345 +      37
6346 +};
6347 +
6348 +static const yytype_int8 yycheck[] =
6349 +{
6350 +       8,    13,     5,     9,     6,    11,     8,    15,    11,    11,
6351 +      12,    15,    24,    11,    26,    13,    22,    25,    20,    10,
6352 +      11,    12,     4,    31,    13,    23,     3,     4,    19,    11,
6353 +      21,     6,     7,    13,    11,     8,    16,     0,    18,    14,
6354 +       6,     7,    15,     4,    16,     4,    13,    17,     5,    13,
6355 +      15,    13,     7,     6,    14,    38,    -1,    31,    -1,    -1,
6356 +      31
6357 +};
6358 +
6359 +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
6360 +   symbol of state STATE-NUM.  */
6361 +static const yytype_uint8 yystos[] =
6362 +{
6363 +       0,     3,    11,    25,    27,    28,    29,    43,    13,     0,
6364 +      15,    31,    28,     4,    26,    27,    43,    16,    32,     6,
6365 +       7,    30,    31,    26,     4,    33,    14,    30,    30,    34,
6366 +      41,    42,    43,    30,    13,    17,    34,    41,     5,    13,
6367 +      13,    13,    18,    32,    35,    36,    11,    13,    23,    10,
6368 +      11,    12,    19,    21,    37,    40,     6,     8,    11,    12,
6369 +      20,    38,    39,     9,    11,    22,     7
6370 +};
6371 +
6372 +#define yyerrok                (yyerrstatus = 0)
6373 +#define yyclearin      (yychar = YYEMPTY)
6374 +#define YYEMPTY                (-2)
6375 +#define YYEOF          0
6376 +
6377 +#define YYACCEPT       goto yyacceptlab
6378 +#define YYABORT                goto yyabortlab
6379 +#define YYERROR                goto yyerrorlab
6380 +
6381 +
6382 +/* Like YYERROR except do call yyerror.  This remains here temporarily
6383 +   to ease the transition to the new meaning of YYERROR, for GCC.
6384 +   Once GCC version 2 has supplanted version 1, this can go.  */
6385 +
6386 +#define YYFAIL         goto yyerrlab
6387 +
6388 +#define YYRECOVERING()  (!!yyerrstatus)
6389 +
6390 +#define YYBACKUP(Token, Value)                                 \
6391 +do                                                             \
6392 +  if (yychar == YYEMPTY && yylen == 1)                         \
6393 +    {                                                          \
6394 +      yychar = (Token);                                                \
6395 +      yylval = (Value);                                                \
6396 +      yytoken = YYTRANSLATE (yychar);                          \
6397 +      YYPOPSTACK (1);                                          \
6398 +      goto yybackup;                                           \
6399 +    }                                                          \
6400 +  else                                                         \
6401 +    {                                                          \
6402 +      yyerror (YY_("syntax error: cannot back up")); \
6403 +      YYERROR;                                                 \
6404 +    }                                                          \
6405 +while (YYID (0))
6406 +
6407 +
6408 +#define YYTERROR       1
6409 +#define YYERRCODE      256
6410 +
6411 +
6412 +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
6413 +   If N is 0, then set CURRENT to the empty location which ends
6414 +   the previous symbol: RHS[0] (always defined).  */
6415 +
6416 +#define YYRHSLOC(Rhs, K) ((Rhs)[K])
6417 +#ifndef YYLLOC_DEFAULT
6418 +# define YYLLOC_DEFAULT(Current, Rhs, N)                               \
6419 +    do                                                                 \
6420 +      if (YYID (N))                                                    \
6421 +       {                                                               \
6422 +         (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
6423 +         (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
6424 +         (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
6425 +         (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
6426 +       }                                                               \
6427 +      else                                                             \
6428 +       {                                                               \
6429 +         (Current).first_line   = (Current).last_line   =              \
6430 +           YYRHSLOC (Rhs, 0).last_line;                                \
6431 +         (Current).first_column = (Current).last_column =              \
6432 +           YYRHSLOC (Rhs, 0).last_column;                              \
6433 +       }                                                               \
6434 +    while (YYID (0))
6435 +#endif
6436 +
6437 +
6438 +/* YY_LOCATION_PRINT -- Print the location on the stream.
6439 +   This macro was not mandated originally: define only if we know
6440 +   we won't break user code: when these are the locations we know.  */
6441 +
6442 +#ifndef YY_LOCATION_PRINT
6443 +# if YYLTYPE_IS_TRIVIAL
6444 +#  define YY_LOCATION_PRINT(File, Loc)                 \
6445 +     fprintf (File, "%d.%d-%d.%d",                     \
6446 +             (Loc).first_line, (Loc).first_column,     \
6447 +             (Loc).last_line,  (Loc).last_column)
6448 +# else
6449 +#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
6450 +# endif
6451 +#endif
6452 +
6453 +
6454 +/* YYLEX -- calling `yylex' with the right arguments.  */
6455 +
6456 +#ifdef YYLEX_PARAM
6457 +# define YYLEX yylex (YYLEX_PARAM)
6458 +#else
6459 +# define YYLEX yylex ()
6460 +#endif
6461 +
6462 +/* Enable debugging if requested.  */
6463 +#if YYDEBUG
6464 +
6465 +# ifndef YYFPRINTF
6466 +#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
6467 +#  define YYFPRINTF fprintf
6468 +# endif
6469 +
6470 +# define YYDPRINTF(Args)                       \
6471 +do {                                           \
6472 +  if (yydebug)                                 \
6473 +    YYFPRINTF Args;                            \
6474 +} while (YYID (0))
6475 +
6476 +# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                   \
6477 +do {                                                                     \
6478 +  if (yydebug)                                                           \
6479 +    {                                                                    \
6480 +      YYFPRINTF (stderr, "%s ", Title);                                          \
6481 +      yy_symbol_print (stderr,                                           \
6482 +                 Type, Value, Location); \
6483 +      YYFPRINTF (stderr, "\n");                                                  \
6484 +    }                                                                    \
6485 +} while (YYID (0))
6486 +
6487 +
6488 +/*--------------------------------.
6489 +| Print this symbol on YYOUTPUT.  |
6490 +`--------------------------------*/
6491 +
6492 +/*ARGSUSED*/
6493 +#if (defined __STDC__ || defined __C99__FUNC__ \
6494 +     || defined __cplusplus || defined _MSC_VER)
6495 +static void
6496 +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
6497 +#else
6498 +static void
6499 +yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp)
6500 +    FILE *yyoutput;
6501 +    int yytype;
6502 +    YYSTYPE const * const yyvaluep;
6503 +    YYLTYPE const * const yylocationp;
6504 +#endif
6505 +{
6506 +  if (!yyvaluep)
6507 +    return;
6508 +  YYUSE (yylocationp);
6509 +# ifdef YYPRINT
6510 +  if (yytype < YYNTOKENS)
6511 +    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
6512 +# else
6513 +  YYUSE (yyoutput);
6514 +# endif
6515 +  switch (yytype)
6516 +    {
6517 +      default:
6518 +       break;
6519 +    }
6520 +}
6521 +
6522 +
6523 +/*--------------------------------.
6524 +| Print this symbol on YYOUTPUT.  |
6525 +`--------------------------------*/
6526 +
6527 +#if (defined __STDC__ || defined __C99__FUNC__ \
6528 +     || defined __cplusplus || defined _MSC_VER)
6529 +static void
6530 +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
6531 +#else
6532 +static void
6533 +yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp)
6534 +    FILE *yyoutput;
6535 +    int yytype;
6536 +    YYSTYPE const * const yyvaluep;
6537 +    YYLTYPE const * const yylocationp;
6538 +#endif
6539 +{
6540 +  if (yytype < YYNTOKENS)
6541 +    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
6542 +  else
6543 +    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
6544 +
6545 +  YY_LOCATION_PRINT (yyoutput, *yylocationp);
6546 +  YYFPRINTF (yyoutput, ": ");
6547 +  yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp);
6548 +  YYFPRINTF (yyoutput, ")");
6549 +}
6550 +
6551 +/*------------------------------------------------------------------.
6552 +| yy_stack_print -- Print the state stack from its BOTTOM up to its |
6553 +| TOP (included).                                                   |
6554 +`------------------------------------------------------------------*/
6555 +
6556 +#if (defined __STDC__ || defined __C99__FUNC__ \
6557 +     || defined __cplusplus || defined _MSC_VER)
6558 +static void
6559 +yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
6560 +#else
6561 +static void
6562 +yy_stack_print (bottom, top)
6563 +    yytype_int16 *bottom;
6564 +    yytype_int16 *top;
6565 +#endif
6566 +{
6567 +  YYFPRINTF (stderr, "Stack now");
6568 +  for (; bottom <= top; ++bottom)
6569 +    YYFPRINTF (stderr, " %d", *bottom);
6570 +  YYFPRINTF (stderr, "\n");
6571 +}
6572 +
6573 +# define YY_STACK_PRINT(Bottom, Top)                           \
6574 +do {                                                           \
6575 +  if (yydebug)                                                 \
6576 +    yy_stack_print ((Bottom), (Top));                          \
6577 +} while (YYID (0))
6578 +
6579 +
6580 +/*------------------------------------------------.
6581 +| Report that the YYRULE is going to be reduced.  |
6582 +`------------------------------------------------*/
6583 +
6584 +#if (defined __STDC__ || defined __C99__FUNC__ \
6585 +     || defined __cplusplus || defined _MSC_VER)
6586 +static void
6587 +yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule)
6588 +#else
6589 +static void
6590 +yy_reduce_print (yyvsp, yylsp, yyrule)
6591 +    YYSTYPE *yyvsp;
6592 +    YYLTYPE *yylsp;
6593 +    int yyrule;
6594 +#endif
6595 +{
6596 +  int yynrhs = yyr2[yyrule];
6597 +  int yyi;
6598 +  unsigned long int yylno = yyrline[yyrule];
6599 +  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
6600 +            yyrule - 1, yylno);
6601 +  /* The symbols being reduced.  */
6602 +  for (yyi = 0; yyi < yynrhs; yyi++)
6603 +    {
6604 +      fprintf (stderr, "   $%d = ", yyi + 1);
6605 +      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
6606 +                      &(yyvsp[(yyi + 1) - (yynrhs)])
6607 +                      , &(yylsp[(yyi + 1) - (yynrhs)])                );
6608 +      fprintf (stderr, "\n");
6609 +    }
6610 +}
6611 +
6612 +# define YY_REDUCE_PRINT(Rule)         \
6613 +do {                                   \
6614 +  if (yydebug)                         \
6615 +    yy_reduce_print (yyvsp, yylsp, Rule); \
6616 +} while (YYID (0))
6617 +
6618 +/* Nonzero means print parse trace.  It is left uninitialized so that
6619 +   multiple parsers can coexist.  */
6620 +int yydebug;
6621 +#else /* !YYDEBUG */
6622 +# define YYDPRINTF(Args)
6623 +# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
6624 +# define YY_STACK_PRINT(Bottom, Top)
6625 +# define YY_REDUCE_PRINT(Rule)
6626 +#endif /* !YYDEBUG */
6627 +
6628 +
6629 +/* YYINITDEPTH -- initial size of the parser's stacks.  */
6630 +#ifndef        YYINITDEPTH
6631 +# define YYINITDEPTH 200
6632 +#endif
6633 +
6634 +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
6635 +   if the built-in stack extension method is used).
6636 +
6637 +   Do not make this value too large; the results are undefined if
6638 +   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
6639 +   evaluated with infinite-precision integer arithmetic.  */
6640 +
6641 +#ifndef YYMAXDEPTH
6642 +# define YYMAXDEPTH 10000
6643 +#endif
6644 +
6645 +\f
6646 +
6647 +#if YYERROR_VERBOSE
6648 +
6649 +# ifndef yystrlen
6650 +#  if defined __GLIBC__ && defined _STRING_H
6651 +#   define yystrlen strlen
6652 +#  else
6653 +/* Return the length of YYSTR.  */
6654 +#if (defined __STDC__ || defined __C99__FUNC__ \
6655 +     || defined __cplusplus || defined _MSC_VER)
6656 +static YYSIZE_T
6657 +yystrlen (const char *yystr)
6658 +#else
6659 +static YYSIZE_T
6660 +yystrlen (yystr)
6661 +    const char *yystr;
6662 +#endif
6663 +{
6664 +  YYSIZE_T yylen;
6665 +  for (yylen = 0; yystr[yylen]; yylen++)
6666 +    continue;
6667 +  return yylen;
6668 +}
6669 +#  endif
6670 +# endif
6671 +
6672 +# ifndef yystpcpy
6673 +#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
6674 +#   define yystpcpy stpcpy
6675 +#  else
6676 +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
6677 +   YYDEST.  */
6678 +#if (defined __STDC__ || defined __C99__FUNC__ \
6679 +     || defined __cplusplus || defined _MSC_VER)
6680 +static char *
6681 +yystpcpy (char *yydest, const char *yysrc)
6682 +#else
6683 +static char *
6684 +yystpcpy (yydest, yysrc)
6685 +    char *yydest;
6686 +    const char *yysrc;
6687 +#endif
6688 +{
6689 +  char *yyd = yydest;
6690 +  const char *yys = yysrc;
6691 +
6692 +  while ((*yyd++ = *yys++) != '\0')
6693 +    continue;
6694 +
6695 +  return yyd - 1;
6696 +}
6697 +#  endif
6698 +# endif
6699 +
6700 +# ifndef yytnamerr
6701 +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
6702 +   quotes and backslashes, so that it's suitable for yyerror.  The
6703 +   heuristic is that double-quoting is unnecessary unless the string
6704 +   contains an apostrophe, a comma, or backslash (other than
6705 +   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
6706 +   null, do not copy; instead, return the length of what the result
6707 +   would have been.  */
6708 +static YYSIZE_T
6709 +yytnamerr (char *yyres, const char *yystr)
6710 +{
6711 +  if (*yystr == '"')
6712 +    {
6713 +      YYSIZE_T yyn = 0;
6714 +      char const *yyp = yystr;
6715 +
6716 +      for (;;)
6717 +       switch (*++yyp)
6718 +         {
6719 +         case '\'':
6720 +         case ',':
6721 +           goto do_not_strip_quotes;
6722 +
6723 +         case '\\':
6724 +           if (*++yyp != '\\')
6725 +             goto do_not_strip_quotes;
6726 +           /* Fall through.  */
6727 +         default:
6728 +           if (yyres)
6729 +             yyres[yyn] = *yyp;
6730 +           yyn++;
6731 +           break;
6732 +
6733 +         case '"':
6734 +           if (yyres)
6735 +             yyres[yyn] = '\0';
6736 +           return yyn;
6737 +         }
6738 +    do_not_strip_quotes: ;
6739 +    }
6740 +
6741 +  if (! yyres)
6742 +    return yystrlen (yystr);
6743 +
6744 +  return yystpcpy (yyres, yystr) - yyres;
6745 +}
6746 +# endif
6747 +
6748 +/* Copy into YYRESULT an error message about the unexpected token
6749 +   YYCHAR while in state YYSTATE.  Return the number of bytes copied,
6750 +   including the terminating null byte.  If YYRESULT is null, do not
6751 +   copy anything; just return the number of bytes that would be
6752 +   copied.  As a special case, return 0 if an ordinary "syntax error"
6753 +   message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
6754 +   size calculation.  */
6755 +static YYSIZE_T
6756 +yysyntax_error (char *yyresult, int yystate, int yychar)
6757 +{
6758 +  int yyn = yypact[yystate];
6759 +
6760 +  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
6761 +    return 0;
6762 +  else
6763 +    {
6764 +      int yytype = YYTRANSLATE (yychar);
6765 +      YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
6766 +      YYSIZE_T yysize = yysize0;
6767 +      YYSIZE_T yysize1;
6768 +      int yysize_overflow = 0;
6769 +      enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
6770 +      char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
6771 +      int yyx;
6772 +
6773 +# if 0
6774 +      /* This is so xgettext sees the translatable formats that are
6775 +        constructed on the fly.  */
6776 +      YY_("syntax error, unexpected %s");
6777 +      YY_("syntax error, unexpected %s, expecting %s");
6778 +      YY_("syntax error, unexpected %s, expecting %s or %s");
6779 +      YY_("syntax error, unexpected %s, expecting %s or %s or %s");
6780 +      YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
6781 +# endif
6782 +      char *yyfmt;
6783 +      char const *yyf;
6784 +      static char const yyunexpected[] = "syntax error, unexpected %s";
6785 +      static char const yyexpecting[] = ", expecting %s";
6786 +      static char const yyor[] = " or %s";
6787 +      char yyformat[sizeof yyunexpected
6788 +                   + sizeof yyexpecting - 1
6789 +                   + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
6790 +                      * (sizeof yyor - 1))];
6791 +      char const *yyprefix = yyexpecting;
6792 +
6793 +      /* Start YYX at -YYN if negative to avoid negative indexes in
6794 +        YYCHECK.  */
6795 +      int yyxbegin = yyn < 0 ? -yyn : 0;
6796 +
6797 +      /* Stay within bounds of both yycheck and yytname.  */
6798 +      int yychecklim = YYLAST - yyn + 1;
6799 +      int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
6800 +      int yycount = 1;
6801 +
6802 +      yyarg[0] = yytname[yytype];
6803 +      yyfmt = yystpcpy (yyformat, yyunexpected);
6804 +
6805 +      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
6806 +       if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
6807 +         {
6808 +           if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
6809 +             {
6810 +               yycount = 1;
6811 +               yysize = yysize0;
6812 +               yyformat[sizeof yyunexpected - 1] = '\0';
6813 +               break;
6814 +             }
6815 +           yyarg[yycount++] = yytname[yyx];
6816 +           yysize1 = yysize + yytnamerr (0, yytname[yyx]);
6817 +           yysize_overflow |= (yysize1 < yysize);
6818 +           yysize = yysize1;
6819 +           yyfmt = yystpcpy (yyfmt, yyprefix);
6820 +           yyprefix = yyor;
6821 +         }
6822 +
6823 +      yyf = YY_(yyformat);
6824 +      yysize1 = yysize + yystrlen (yyf);
6825 +      yysize_overflow |= (yysize1 < yysize);
6826 +      yysize = yysize1;
6827 +
6828 +      if (yysize_overflow)
6829 +       return YYSIZE_MAXIMUM;
6830 +
6831 +      if (yyresult)
6832 +       {
6833 +         /* Avoid sprintf, as that infringes on the user's name space.
6834 +            Don't have undefined behavior even if the translation
6835 +            produced a string with the wrong number of "%s"s.  */
6836 +         char *yyp = yyresult;
6837 +         int yyi = 0;
6838 +         while ((*yyp = *yyf) != '\0')
6839 +           {
6840 +             if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
6841 +               {
6842 +                 yyp += yytnamerr (yyp, yyarg[yyi++]);
6843 +                 yyf += 2;
6844 +               }
6845 +             else
6846 +               {
6847 +                 yyp++;
6848 +                 yyf++;
6849 +               }
6850 +           }
6851 +       }
6852 +      return yysize;
6853 +    }
6854 +}
6855 +#endif /* YYERROR_VERBOSE */
6856 +\f
6857 +
6858 +/*-----------------------------------------------.
6859 +| Release the memory associated to this symbol.  |
6860 +`-----------------------------------------------*/
6861 +
6862 +/*ARGSUSED*/
6863 +#if (defined __STDC__ || defined __C99__FUNC__ \
6864 +     || defined __cplusplus || defined _MSC_VER)
6865 +static void
6866 +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
6867 +#else
6868 +static void
6869 +yydestruct (yymsg, yytype, yyvaluep, yylocationp)
6870 +    const char *yymsg;
6871 +    int yytype;
6872 +    YYSTYPE *yyvaluep;
6873 +    YYLTYPE *yylocationp;
6874 +#endif
6875 +{
6876 +  YYUSE (yyvaluep);
6877 +  YYUSE (yylocationp);
6878 +
6879 +  if (!yymsg)
6880 +    yymsg = "Deleting";
6881 +  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
6882 +
6883 +  switch (yytype)
6884 +    {
6885 +
6886 +      default:
6887 +       break;
6888 +    }
6889 +}
6890 +\f
6891 +
6892 +/* Prevent warnings from -Wmissing-prototypes.  */
6893 +
6894 +#ifdef YYPARSE_PARAM
6895 +#if defined __STDC__ || defined __cplusplus
6896 +int yyparse (void *YYPARSE_PARAM);
6897 +#else
6898 +int yyparse ();
6899 +#endif
6900 +#else /* ! YYPARSE_PARAM */
6901 +#if defined __STDC__ || defined __cplusplus
6902 +int yyparse (void);
6903 +#else
6904 +int yyparse ();
6905 +#endif
6906 +#endif /* ! YYPARSE_PARAM */
6907 +
6908 +
6909 +
6910 +/* The look-ahead symbol.  */
6911 +int yychar;
6912 +
6913 +/* The semantic value of the look-ahead symbol.  */
6914 +YYSTYPE yylval;
6915 +
6916 +/* Number of syntax errors so far.  */
6917 +int yynerrs;
6918 +/* Location data for the look-ahead symbol.  */
6919 +YYLTYPE yylloc;
6920 +
6921 +
6922 +
6923 +/*----------.
6924 +| yyparse.  |
6925 +`----------*/
6926 +
6927 +#ifdef YYPARSE_PARAM
6928 +#if (defined __STDC__ || defined __C99__FUNC__ \
6929 +     || defined __cplusplus || defined _MSC_VER)
6930 +int
6931 +yyparse (void *YYPARSE_PARAM)
6932 +#else
6933 +int
6934 +yyparse (YYPARSE_PARAM)
6935 +    void *YYPARSE_PARAM;
6936 +#endif
6937 +#else /* ! YYPARSE_PARAM */
6938 +#if (defined __STDC__ || defined __C99__FUNC__ \
6939 +     || defined __cplusplus || defined _MSC_VER)
6940 +int
6941 +yyparse (void)
6942 +#else
6943 +int
6944 +yyparse ()
6945 +
6946 +#endif
6947 +#endif
6948 +{
6949 +  
6950 +  int yystate;
6951 +  int yyn;
6952 +  int yyresult;
6953 +  /* Number of tokens to shift before error messages enabled.  */
6954 +  int yyerrstatus;
6955 +  /* Look-ahead token as an internal (translated) token number.  */
6956 +  int yytoken = 0;
6957 +#if YYERROR_VERBOSE
6958 +  /* Buffer for error messages, and its allocated size.  */
6959 +  char yymsgbuf[128];
6960 +  char *yymsg = yymsgbuf;
6961 +  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
6962 +#endif
6963 +
6964 +  /* Three stacks and their tools:
6965 +     `yyss': related to states,
6966 +     `yyvs': related to semantic values,
6967 +     `yyls': related to locations.
6968 +
6969 +     Refer to the stacks thru separate pointers, to allow yyoverflow
6970 +     to reallocate them elsewhere.  */
6971 +
6972 +  /* The state stack.  */
6973 +  yytype_int16 yyssa[YYINITDEPTH];
6974 +  yytype_int16 *yyss = yyssa;
6975 +  yytype_int16 *yyssp;
6976 +
6977 +  /* The semantic value stack.  */
6978 +  YYSTYPE yyvsa[YYINITDEPTH];
6979 +  YYSTYPE *yyvs = yyvsa;
6980 +  YYSTYPE *yyvsp;
6981 +
6982 +  /* The location stack.  */
6983 +  YYLTYPE yylsa[YYINITDEPTH];
6984 +  YYLTYPE *yyls = yylsa;
6985 +  YYLTYPE *yylsp;
6986 +  /* The locations where the error started and ended.  */
6987 +  YYLTYPE yyerror_range[2];
6988 +
6989 +#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
6990 +
6991 +  YYSIZE_T yystacksize = YYINITDEPTH;
6992 +
6993 +  /* The variables used to return semantic value and location from the
6994 +     action routines.  */
6995 +  YYSTYPE yyval;
6996 +  YYLTYPE yyloc;
6997 +
6998 +  /* The number of symbols on the RHS of the reduced rule.
6999 +     Keep to zero when no symbol should be popped.  */
7000 +  int yylen = 0;
7001 +
7002 +  YYDPRINTF ((stderr, "Starting parse\n"));
7003 +
7004 +  yystate = 0;
7005 +  yyerrstatus = 0;
7006 +  yynerrs = 0;
7007 +  yychar = YYEMPTY;            /* Cause a token to be read.  */
7008 +
7009 +  /* Initialize stack pointers.
7010 +     Waste one element of value and location stack
7011 +     so that they stay on the same level as the state stack.
7012 +     The wasted elements are never initialized.  */
7013 +
7014 +  yyssp = yyss;
7015 +  yyvsp = yyvs;
7016 +  yylsp = yyls;
7017 +#if YYLTYPE_IS_TRIVIAL
7018 +  /* Initialize the default location before parsing starts.  */
7019 +  yylloc.first_line   = yylloc.last_line   = 1;
7020 +  yylloc.first_column = yylloc.last_column = 0;
7021 +#endif
7022 +
7023 +  goto yysetstate;
7024 +
7025 +/*------------------------------------------------------------.
7026 +| yynewstate -- Push a new state, which is found in yystate.  |
7027 +`------------------------------------------------------------*/
7028 + yynewstate:
7029 +  /* In all cases, when you get here, the value and location stacks
7030 +     have just been pushed.  So pushing a state here evens the stacks.  */
7031 +  yyssp++;
7032 +
7033 + yysetstate:
7034 +  *yyssp = yystate;
7035 +
7036 +  if (yyss + yystacksize - 1 <= yyssp)
7037 +    {
7038 +      /* Get the current used size of the three stacks, in elements.  */
7039 +      YYSIZE_T yysize = yyssp - yyss + 1;
7040 +
7041 +#ifdef yyoverflow
7042 +      {
7043 +       /* Give user a chance to reallocate the stack.  Use copies of
7044 +          these so that the &'s don't force the real ones into
7045 +          memory.  */
7046 +       YYSTYPE *yyvs1 = yyvs;
7047 +       yytype_int16 *yyss1 = yyss;
7048 +       YYLTYPE *yyls1 = yyls;
7049 +
7050 +       /* Each stack pointer address is followed by the size of the
7051 +          data in use in that stack, in bytes.  This used to be a
7052 +          conditional around just the two extra args, but that might
7053 +          be undefined if yyoverflow is a macro.  */
7054 +       yyoverflow (YY_("memory exhausted"),
7055 +                   &yyss1, yysize * sizeof (*yyssp),
7056 +                   &yyvs1, yysize * sizeof (*yyvsp),
7057 +                   &yyls1, yysize * sizeof (*yylsp),
7058 +                   &yystacksize);
7059 +       yyls = yyls1;
7060 +       yyss = yyss1;
7061 +       yyvs = yyvs1;
7062 +      }
7063 +#else /* no yyoverflow */
7064 +# ifndef YYSTACK_RELOCATE
7065 +      goto yyexhaustedlab;
7066 +# else
7067 +      /* Extend the stack our own way.  */
7068 +      if (YYMAXDEPTH <= yystacksize)
7069 +       goto yyexhaustedlab;
7070 +      yystacksize *= 2;
7071 +      if (YYMAXDEPTH < yystacksize)
7072 +       yystacksize = YYMAXDEPTH;
7073 +
7074 +      {
7075 +       yytype_int16 *yyss1 = yyss;
7076 +       union yyalloc *yyptr =
7077 +         (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
7078 +       if (! yyptr)
7079 +         goto yyexhaustedlab;
7080 +       YYSTACK_RELOCATE (yyss);
7081 +       YYSTACK_RELOCATE (yyvs);
7082 +       YYSTACK_RELOCATE (yyls);
7083 +#  undef YYSTACK_RELOCATE
7084 +       if (yyss1 != yyssa)
7085 +         YYSTACK_FREE (yyss1);
7086 +      }
7087 +# endif
7088 +#endif /* no yyoverflow */
7089 +
7090 +      yyssp = yyss + yysize - 1;
7091 +      yyvsp = yyvs + yysize - 1;
7092 +      yylsp = yyls + yysize - 1;
7093 +
7094 +      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
7095 +                 (unsigned long int) yystacksize));
7096 +
7097 +      if (yyss + yystacksize - 1 <= yyssp)
7098 +       YYABORT;
7099 +    }
7100 +
7101 +  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
7102 +
7103 +  goto yybackup;
7104 +
7105 +/*-----------.
7106 +| yybackup.  |
7107 +`-----------*/
7108 +yybackup:
7109 +
7110 +  /* Do appropriate processing given the current state.  Read a
7111 +     look-ahead token if we need one and don't already have one.  */
7112 +
7113 +  /* First try to decide what to do without reference to look-ahead token.  */
7114 +  yyn = yypact[yystate];
7115 +  if (yyn == YYPACT_NINF)
7116 +    goto yydefault;
7117 +
7118 +  /* Not known => get a look-ahead token if don't already have one.  */
7119 +
7120 +  /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
7121 +  if (yychar == YYEMPTY)
7122 +    {
7123 +      YYDPRINTF ((stderr, "Reading a token: "));
7124 +      yychar = YYLEX;
7125 +    }
7126 +
7127 +  if (yychar <= YYEOF)
7128 +    {
7129 +      yychar = yytoken = YYEOF;
7130 +      YYDPRINTF ((stderr, "Now at end of input.\n"));
7131 +    }
7132 +  else
7133 +    {
7134 +      yytoken = YYTRANSLATE (yychar);
7135 +      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
7136 +    }
7137 +
7138 +  /* If the proper action on seeing token YYTOKEN is to reduce or to
7139 +     detect an error, take that action.  */
7140 +  yyn += yytoken;
7141 +  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
7142 +    goto yydefault;
7143 +  yyn = yytable[yyn];
7144 +  if (yyn <= 0)
7145 +    {
7146 +      if (yyn == 0 || yyn == YYTABLE_NINF)
7147 +       goto yyerrlab;
7148 +      yyn = -yyn;
7149 +      goto yyreduce;
7150 +    }
7151 +
7152 +  if (yyn == YYFINAL)
7153 +    YYACCEPT;
7154 +
7155 +  /* Count tokens shifted since error; after three, turn off error
7156 +     status.  */
7157 +  if (yyerrstatus)
7158 +    yyerrstatus--;
7159 +
7160 +  /* Shift the look-ahead token.  */
7161 +  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
7162 +
7163 +  /* Discard the shifted token unless it is eof.  */
7164 +  if (yychar != YYEOF)
7165 +    yychar = YYEMPTY;
7166 +
7167 +  yystate = yyn;
7168 +  *++yyvsp = yylval;
7169 +  *++yylsp = yylloc;
7170 +  goto yynewstate;
7171 +
7172 +
7173 +/*-----------------------------------------------------------.
7174 +| yydefault -- do the default action for the current state.  |
7175 +`-----------------------------------------------------------*/
7176 +yydefault:
7177 +  yyn = yydefact[yystate];
7178 +  if (yyn == 0)
7179 +    goto yyerrlab;
7180 +  goto yyreduce;
7181 +
7182 +
7183 +/*-----------------------------.
7184 +| yyreduce -- Do a reduction.  |
7185 +`-----------------------------*/
7186 +yyreduce:
7187 +  /* yyn is the number of a rule to reduce with.  */
7188 +  yylen = yyr2[yyn];
7189 +
7190 +  /* If YYLEN is nonzero, implement the default value of the action:
7191 +     `$$ = $1'.
7192 +
7193 +     Otherwise, the following line sets YYVAL to garbage.
7194 +     This behavior is undocumented and Bison
7195 +     users should not rely upon it.  Assigning to YYVAL
7196 +     unconditionally makes the parser a bit smaller, and it avoids a
7197 +     GCC warning that YYVAL may be used uninitialized.  */
7198 +  yyval = yyvsp[1-yylen];
7199 +
7200 +  /* Default location.  */
7201 +  YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
7202 +  YY_REDUCE_PRINT (yyn);
7203 +  switch (yyn)
7204 +    {
7205 +        case 2:
7206 +#line 86 "dtc-parser.y"
7207 +    {
7208 +                       the_boot_info = build_boot_info((yyvsp[(3) - (4)].re), (yyvsp[(4) - (4)].node));
7209 +               ;}
7210 +    break;
7211 +
7212 +  case 3:
7213 +#line 90 "dtc-parser.y"
7214 +    {
7215 +                       the_boot_info = build_boot_info((yyvsp[(1) - (2)].re), (yyvsp[(2) - (2)].node));
7216 +               ;}
7217 +    break;
7218 +
7219 +  case 4:
7220 +#line 97 "dtc-parser.y"
7221 +    {
7222 +                       (yyval.re) = NULL;
7223 +               ;}
7224 +    break;
7225 +
7226 +  case 5:
7227 +#line 101 "dtc-parser.y"
7228 +    {
7229 +                       (yyval.re) = chain_reserve_entry((yyvsp[(1) - (2)].re), (yyvsp[(2) - (2)].re));
7230 +               ;}
7231 +    break;
7232 +
7233 +  case 6:
7234 +#line 108 "dtc-parser.y"
7235 +    {
7236 +                       (yyval.re) = build_reserve_entry((yyvsp[(3) - (5)].addr), (yyvsp[(4) - (5)].addr), (yyvsp[(1) - (5)].labelref));
7237 +               ;}
7238 +    break;
7239 +
7240 +  case 7:
7241 +#line 115 "dtc-parser.y"
7242 +    {
7243 +                       (yyval.re) = NULL;
7244 +               ;}
7245 +    break;
7246 +
7247 +  case 8:
7248 +#line 119 "dtc-parser.y"
7249 +    {
7250 +                       (yyval.re) = chain_reserve_entry((yyvsp[(1) - (2)].re), (yyvsp[(2) - (2)].re));
7251 +               ;}
7252 +    break;
7253 +
7254 +  case 9:
7255 +#line 126 "dtc-parser.y"
7256 +    {
7257 +                       (yyval.re) = (yyvsp[(1) - (1)].re);
7258 +               ;}
7259 +    break;
7260 +
7261 +  case 10:
7262 +#line 130 "dtc-parser.y"
7263 +    {
7264 +                       (yyval.re) = build_reserve_entry((yyvsp[(3) - (6)].addr), (yyvsp[(5) - (6)].addr) - (yyvsp[(3) - (6)].addr) + 1, (yyvsp[(1) - (6)].labelref));
7265 +               ;}
7266 +    break;
7267 +
7268 +  case 11:
7269 +#line 137 "dtc-parser.y"
7270 +    {
7271 +                       (yyval.addr) = eval_literal((yyvsp[(1) - (1)].literal), 0, 64);
7272 +               ;}
7273 +    break;
7274 +
7275 +  case 12:
7276 +#line 141 "dtc-parser.y"
7277 +    {
7278 +                       (yyval.addr) = eval_literal((yyvsp[(1) - (1)].literal), 16, 64);
7279 +               ;}
7280 +    break;
7281 +
7282 +  case 13:
7283 +#line 148 "dtc-parser.y"
7284 +    {
7285 +                       (yyval.node) = name_node((yyvsp[(2) - (2)].node), "", NULL);
7286 +               ;}
7287 +    break;
7288 +
7289 +  case 14:
7290 +#line 155 "dtc-parser.y"
7291 +    {
7292 +                       (yyval.node) = build_node((yyvsp[(2) - (5)].proplist), (yyvsp[(3) - (5)].nodelist));
7293 +               ;}
7294 +    break;
7295 +
7296 +  case 15:
7297 +#line 162 "dtc-parser.y"
7298 +    {
7299 +                       (yyval.proplist) = NULL;
7300 +               ;}
7301 +    break;
7302 +
7303 +  case 16:
7304 +#line 166 "dtc-parser.y"
7305 +    {
7306 +                       (yyval.proplist) = chain_property((yyvsp[(2) - (2)].prop), (yyvsp[(1) - (2)].proplist));
7307 +               ;}
7308 +    break;
7309 +
7310 +  case 17:
7311 +#line 173 "dtc-parser.y"
7312 +    {
7313 +                       (yyval.prop) = build_property((yyvsp[(2) - (5)].propnodename), (yyvsp[(4) - (5)].data), (yyvsp[(1) - (5)].labelref));
7314 +               ;}
7315 +    break;
7316 +
7317 +  case 18:
7318 +#line 177 "dtc-parser.y"
7319 +    {
7320 +                       (yyval.prop) = build_property((yyvsp[(2) - (3)].propnodename), empty_data, (yyvsp[(1) - (3)].labelref));
7321 +               ;}
7322 +    break;
7323 +
7324 +  case 19:
7325 +#line 184 "dtc-parser.y"
7326 +    {
7327 +                       (yyval.data) = data_merge((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].data));
7328 +               ;}
7329 +    break;
7330 +
7331 +  case 20:
7332 +#line 188 "dtc-parser.y"
7333 +    {
7334 +                       (yyval.data) = data_merge((yyvsp[(1) - (4)].data), (yyvsp[(3) - (4)].data));
7335 +               ;}
7336 +    break;
7337 +
7338 +  case 21:
7339 +#line 192 "dtc-parser.y"
7340 +    {
7341 +                       (yyval.data) = data_merge((yyvsp[(1) - (4)].data), (yyvsp[(3) - (4)].data));
7342 +               ;}
7343 +    break;
7344 +
7345 +  case 22:
7346 +#line 196 "dtc-parser.y"
7347 +    {
7348 +                       (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), REF_PATH, (yyvsp[(2) - (2)].labelref));
7349 +               ;}
7350 +    break;
7351 +
7352 +  case 23:
7353 +#line 200 "dtc-parser.y"
7354 +    {
7355 +                       (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
7356 +               ;}
7357 +    break;
7358 +
7359 +  case 24:
7360 +#line 207 "dtc-parser.y"
7361 +    {
7362 +                       (yyval.data) = empty_data;
7363 +               ;}
7364 +    break;
7365 +
7366 +  case 25:
7367 +#line 211 "dtc-parser.y"
7368 +    {
7369 +                       (yyval.data) = (yyvsp[(1) - (2)].data);
7370 +               ;}
7371 +    break;
7372 +
7373 +  case 26:
7374 +#line 215 "dtc-parser.y"
7375 +    {
7376 +                       (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
7377 +               ;}
7378 +    break;
7379 +
7380 +  case 27:
7381 +#line 222 "dtc-parser.y"
7382 +    {
7383 +                       (yyval.data) = empty_data;
7384 +               ;}
7385 +    break;
7386 +
7387 +  case 28:
7388 +#line 226 "dtc-parser.y"
7389 +    {
7390 +                       (yyval.data) = data_append_cell((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].cell));
7391 +               ;}
7392 +    break;
7393 +
7394 +  case 29:
7395 +#line 230 "dtc-parser.y"
7396 +    {
7397 +                       (yyval.data) = data_append_cell(data_add_marker((yyvsp[(1) - (2)].data), REF_PHANDLE,
7398 +                                                             (yyvsp[(2) - (2)].labelref)), -1);
7399 +               ;}
7400 +    break;
7401 +
7402 +  case 30:
7403 +#line 235 "dtc-parser.y"
7404 +    {
7405 +                       (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
7406 +               ;}
7407 +    break;
7408 +
7409 +  case 31:
7410 +#line 242 "dtc-parser.y"
7411 +    {
7412 +                       (yyval.cbase) = 16;
7413 +               ;}
7414 +    break;
7415 +
7416 +  case 33:
7417 +#line 250 "dtc-parser.y"
7418 +    {
7419 +                       (yyval.cell) = eval_literal((yyvsp[(1) - (1)].literal), 0, 32);
7420 +               ;}
7421 +    break;
7422 +
7423 +  case 34:
7424 +#line 254 "dtc-parser.y"
7425 +    {
7426 +                       (yyval.cell) = eval_literal((yyvsp[(2) - (2)].literal), (yyvsp[(1) - (2)].cbase), 32);
7427 +               ;}
7428 +    break;
7429 +
7430 +  case 35:
7431 +#line 261 "dtc-parser.y"
7432 +    {
7433 +                       (yyval.data) = empty_data;
7434 +               ;}
7435 +    break;
7436 +
7437 +  case 36:
7438 +#line 265 "dtc-parser.y"
7439 +    {
7440 +                       (yyval.data) = data_append_byte((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].byte));
7441 +               ;}
7442 +    break;
7443 +
7444 +  case 37:
7445 +#line 269 "dtc-parser.y"
7446 +    {
7447 +                       (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
7448 +               ;}
7449 +    break;
7450 +
7451 +  case 38:
7452 +#line 276 "dtc-parser.y"
7453 +    {
7454 +                       (yyval.nodelist) = NULL;
7455 +               ;}
7456 +    break;
7457 +
7458 +  case 39:
7459 +#line 280 "dtc-parser.y"
7460 +    {
7461 +                       (yyval.nodelist) = chain_node((yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].nodelist));
7462 +               ;}
7463 +    break;
7464 +
7465 +  case 40:
7466 +#line 284 "dtc-parser.y"
7467 +    {
7468 +                       yyerror("syntax error: properties must precede subnodes\n");
7469 +                       YYERROR;
7470 +               ;}
7471 +    break;
7472 +
7473 +  case 41:
7474 +#line 292 "dtc-parser.y"
7475 +    {
7476 +                       (yyval.node) = name_node((yyvsp[(3) - (3)].node), (yyvsp[(2) - (3)].propnodename), (yyvsp[(1) - (3)].labelref));
7477 +               ;}
7478 +    break;
7479 +
7480 +  case 42:
7481 +#line 299 "dtc-parser.y"
7482 +    {
7483 +                       (yyval.labelref) = NULL;
7484 +               ;}
7485 +    break;
7486 +
7487 +  case 43:
7488 +#line 303 "dtc-parser.y"
7489 +    {
7490 +                       (yyval.labelref) = (yyvsp[(1) - (1)].labelref);
7491 +               ;}
7492 +    break;
7493 +
7494 +
7495 +/* Line 1267 of yacc.c.  */
7496 +#line 1734 "dtc-parser.tab.c"
7497 +      default: break;
7498 +    }
7499 +  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
7500 +
7501 +  YYPOPSTACK (yylen);
7502 +  yylen = 0;
7503 +  YY_STACK_PRINT (yyss, yyssp);
7504 +
7505 +  *++yyvsp = yyval;
7506 +  *++yylsp = yyloc;
7507 +
7508 +  /* Now `shift' the result of the reduction.  Determine what state
7509 +     that goes to, based on the state we popped back to and the rule
7510 +     number reduced by.  */
7511 +
7512 +  yyn = yyr1[yyn];
7513 +
7514 +  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
7515 +  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
7516 +    yystate = yytable[yystate];
7517 +  else
7518 +    yystate = yydefgoto[yyn - YYNTOKENS];
7519 +
7520 +  goto yynewstate;
7521 +
7522 +
7523 +/*------------------------------------.
7524 +| yyerrlab -- here on detecting error |
7525 +`------------------------------------*/
7526 +yyerrlab:
7527 +  /* If not already recovering from an error, report this error.  */
7528 +  if (!yyerrstatus)
7529 +    {
7530 +      ++yynerrs;
7531 +#if ! YYERROR_VERBOSE
7532 +      yyerror (YY_("syntax error"));
7533 +#else
7534 +      {
7535 +       YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
7536 +       if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
7537 +         {
7538 +           YYSIZE_T yyalloc = 2 * yysize;
7539 +           if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
7540 +             yyalloc = YYSTACK_ALLOC_MAXIMUM;
7541 +           if (yymsg != yymsgbuf)
7542 +             YYSTACK_FREE (yymsg);
7543 +           yymsg = (char *) YYSTACK_ALLOC (yyalloc);
7544 +           if (yymsg)
7545 +             yymsg_alloc = yyalloc;
7546 +           else
7547 +             {
7548 +               yymsg = yymsgbuf;
7549 +               yymsg_alloc = sizeof yymsgbuf;
7550 +             }
7551 +         }
7552 +
7553 +       if (0 < yysize && yysize <= yymsg_alloc)
7554 +         {
7555 +           (void) yysyntax_error (yymsg, yystate, yychar);
7556 +           yyerror (yymsg);
7557 +         }
7558 +       else
7559 +         {
7560 +           yyerror (YY_("syntax error"));
7561 +           if (yysize != 0)
7562 +             goto yyexhaustedlab;
7563 +         }
7564 +      }
7565 +#endif
7566 +    }
7567 +
7568 +  yyerror_range[0] = yylloc;
7569 +
7570 +  if (yyerrstatus == 3)
7571 +    {
7572 +      /* If just tried and failed to reuse look-ahead token after an
7573 +        error, discard it.  */
7574 +
7575 +      if (yychar <= YYEOF)
7576 +       {
7577 +         /* Return failure if at end of input.  */
7578 +         if (yychar == YYEOF)
7579 +           YYABORT;
7580 +       }
7581 +      else
7582 +       {
7583 +         yydestruct ("Error: discarding",
7584 +                     yytoken, &yylval, &yylloc);
7585 +         yychar = YYEMPTY;
7586 +       }
7587 +    }
7588 +
7589 +  /* Else will try to reuse look-ahead token after shifting the error
7590 +     token.  */
7591 +  goto yyerrlab1;
7592 +
7593 +
7594 +/*---------------------------------------------------.
7595 +| yyerrorlab -- error raised explicitly by YYERROR.  |
7596 +`---------------------------------------------------*/
7597 +yyerrorlab:
7598 +
7599 +  /* Pacify compilers like GCC when the user code never invokes
7600 +     YYERROR and the label yyerrorlab therefore never appears in user
7601 +     code.  */
7602 +  if (/*CONSTCOND*/ 0)
7603 +     goto yyerrorlab;
7604 +
7605 +  yyerror_range[0] = yylsp[1-yylen];
7606 +  /* Do not reclaim the symbols of the rule which action triggered
7607 +     this YYERROR.  */
7608 +  YYPOPSTACK (yylen);
7609 +  yylen = 0;
7610 +  YY_STACK_PRINT (yyss, yyssp);
7611 +  yystate = *yyssp;
7612 +  goto yyerrlab1;
7613 +
7614 +
7615 +/*-------------------------------------------------------------.
7616 +| yyerrlab1 -- common code for both syntax error and YYERROR.  |
7617 +`-------------------------------------------------------------*/
7618 +yyerrlab1:
7619 +  yyerrstatus = 3;     /* Each real token shifted decrements this.  */
7620 +
7621 +  for (;;)
7622 +    {
7623 +      yyn = yypact[yystate];
7624 +      if (yyn != YYPACT_NINF)
7625 +       {
7626 +         yyn += YYTERROR;
7627 +         if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
7628 +           {
7629 +             yyn = yytable[yyn];
7630 +             if (0 < yyn)
7631 +               break;
7632 +           }
7633 +       }
7634 +
7635 +      /* Pop the current state because it cannot handle the error token.  */
7636 +      if (yyssp == yyss)
7637 +       YYABORT;
7638 +
7639 +      yyerror_range[0] = *yylsp;
7640 +      yydestruct ("Error: popping",
7641 +                 yystos[yystate], yyvsp, yylsp);
7642 +      YYPOPSTACK (1);
7643 +      yystate = *yyssp;
7644 +      YY_STACK_PRINT (yyss, yyssp);
7645 +    }
7646 +
7647 +  if (yyn == YYFINAL)
7648 +    YYACCEPT;
7649 +
7650 +  *++yyvsp = yylval;
7651 +
7652 +  yyerror_range[1] = yylloc;
7653 +  /* Using YYLLOC is tempting, but would change the location of
7654 +     the look-ahead.  YYLOC is available though.  */
7655 +  YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
7656 +  *++yylsp = yyloc;
7657 +
7658 +  /* Shift the error token.  */
7659 +  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
7660 +
7661 +  yystate = yyn;
7662 +  goto yynewstate;
7663 +
7664 +
7665 +/*-------------------------------------.
7666 +| yyacceptlab -- YYACCEPT comes here.  |
7667 +`-------------------------------------*/
7668 +yyacceptlab:
7669 +  yyresult = 0;
7670 +  goto yyreturn;
7671 +
7672 +/*-----------------------------------.
7673 +| yyabortlab -- YYABORT comes here.  |
7674 +`-----------------------------------*/
7675 +yyabortlab:
7676 +  yyresult = 1;
7677 +  goto yyreturn;
7678 +
7679 +#ifndef yyoverflow
7680 +/*-------------------------------------------------.
7681 +| yyexhaustedlab -- memory exhaustion comes here.  |
7682 +`-------------------------------------------------*/
7683 +yyexhaustedlab:
7684 +  yyerror (YY_("memory exhausted"));
7685 +  yyresult = 2;
7686 +  /* Fall through.  */
7687 +#endif
7688 +
7689 +yyreturn:
7690 +  if (yychar != YYEOF && yychar != YYEMPTY)
7691 +     yydestruct ("Cleanup: discarding lookahead",
7692 +                yytoken, &yylval, &yylloc);
7693 +  /* Do not reclaim the symbols of the rule which action triggered
7694 +     this YYABORT or YYACCEPT.  */
7695 +  YYPOPSTACK (yylen);
7696 +  YY_STACK_PRINT (yyss, yyssp);
7697 +  while (yyssp != yyss)
7698 +    {
7699 +      yydestruct ("Cleanup: popping",
7700 +                 yystos[*yyssp], yyvsp, yylsp);
7701 +      YYPOPSTACK (1);
7702 +    }
7703 +#ifndef yyoverflow
7704 +  if (yyss != yyssa)
7705 +    YYSTACK_FREE (yyss);
7706 +#endif
7707 +#if YYERROR_VERBOSE
7708 +  if (yymsg != yymsgbuf)
7709 +    YYSTACK_FREE (yymsg);
7710 +#endif
7711 +  /* Make sure YYID is used.  */
7712 +  return YYID (yyresult);
7713 +}
7714 +
7715 +
7716 +#line 308 "dtc-parser.y"
7717 +
7718 +
7719 +void yyerror (char const *s)
7720 +{
7721 +       const char *fname = srcpos_filename_for_num(yylloc.filenum);
7722 +
7723 +       if (strcmp(fname, "-") == 0)
7724 +               fname = "stdin";
7725 +
7726 +       fprintf(stderr, "%s:%d %s\n",
7727 +               fname, yylloc.first_line, s);
7728 +}
7729 +
7730 +unsigned long long eval_literal(const char *s, int base, int bits)
7731 +{
7732 +       unsigned long long val;
7733 +       char *e;
7734 +
7735 +       errno = 0;
7736 +       val = strtoull(s, &e, base);
7737 +       if (*e)
7738 +               yyerror("bad characters in literal");
7739 +       else if ((errno == ERANGE)
7740 +                || ((bits < 64) && (val >= (1ULL << bits))))
7741 +               yyerror("literal out of range");
7742 +       else if (errno != 0)
7743 +               yyerror("bad literal");
7744 +       return val;
7745 +}
7746 +
7747 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dtc-src/dtc-parser.tab.h_shipped powerpc.git/arch/powerpc/boot/dtc-src/dtc-parser.tab.h_shipped
7748 --- linux-2.6.24/arch/powerpc/boot/dtc-src/dtc-parser.tab.h_shipped     1970-01-01 01:00:00.000000000 +0100
7749 +++ powerpc.git/arch/powerpc/boot/dtc-src/dtc-parser.tab.h_shipped      2008-01-28 20:25:49.000000000 +0100
7750 @@ -0,0 +1,111 @@
7751 +/* A Bison parser, made by GNU Bison 2.3.  */
7752 +
7753 +/* Skeleton interface for Bison's Yacc-like parsers in C
7754 +
7755 +   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7756 +   Free Software Foundation, Inc.
7757 +
7758 +   This program is free software; you can redistribute it and/or modify
7759 +   it under the terms of the GNU General Public License as published by
7760 +   the Free Software Foundation; either version 2, or (at your option)
7761 +   any later version.
7762 +
7763 +   This program is distributed in the hope that it will be useful,
7764 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
7765 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
7766 +   GNU General Public License for more details.
7767 +
7768 +   You should have received a copy of the GNU General Public License
7769 +   along with this program; if not, write to the Free Software
7770 +   Foundation, Inc., 51 Franklin Street, Fifth Floor,
7771 +   Boston, MA 02110-1301, USA.  */
7772 +
7773 +/* As a special exception, you may create a larger work that contains
7774 +   part or all of the Bison parser skeleton and distribute that work
7775 +   under terms of your choice, so long as that work isn't itself a
7776 +   parser generator using the skeleton or a modified version thereof
7777 +   as a parser skeleton.  Alternatively, if you modify or redistribute
7778 +   the parser skeleton itself, you may (at your option) remove this
7779 +   special exception, which will cause the skeleton and the resulting
7780 +   Bison output files to be licensed under the GNU General Public
7781 +   License without this special exception.
7782 +
7783 +   This special exception was added by the Free Software Foundation in
7784 +   version 2.2 of Bison.  */
7785 +
7786 +/* Tokens.  */
7787 +#ifndef YYTOKENTYPE
7788 +# define YYTOKENTYPE
7789 +   /* Put the tokens into the symbol table, so that GDB and other debuggers
7790 +      know about them.  */
7791 +   enum yytokentype {
7792 +     DT_V1 = 258,
7793 +     DT_MEMRESERVE = 259,
7794 +     DT_PROPNODENAME = 260,
7795 +     DT_LITERAL = 261,
7796 +     DT_LEGACYLITERAL = 262,
7797 +     DT_BASE = 263,
7798 +     DT_BYTE = 264,
7799 +     DT_STRING = 265,
7800 +     DT_LABEL = 266,
7801 +     DT_REF = 267
7802 +   };
7803 +#endif
7804 +/* Tokens.  */
7805 +#define DT_V1 258
7806 +#define DT_MEMRESERVE 259
7807 +#define DT_PROPNODENAME 260
7808 +#define DT_LITERAL 261
7809 +#define DT_LEGACYLITERAL 262
7810 +#define DT_BASE 263
7811 +#define DT_BYTE 264
7812 +#define DT_STRING 265
7813 +#define DT_LABEL 266
7814 +#define DT_REF 267
7815 +
7816 +
7817 +
7818 +
7819 +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
7820 +typedef union YYSTYPE
7821 +#line 34 "dtc-parser.y"
7822 +{
7823 +       char *propnodename;
7824 +       char *literal;
7825 +       char *labelref;
7826 +       unsigned int cbase;
7827 +       u8 byte;
7828 +       struct data data;
7829 +
7830 +       u64 addr;
7831 +       cell_t cell;
7832 +       struct property *prop;
7833 +       struct property *proplist;
7834 +       struct node *node;
7835 +       struct node *nodelist;
7836 +       struct reserve_info *re;
7837 +}
7838 +/* Line 1489 of yacc.c.  */
7839 +#line 90 "dtc-parser.tab.h"
7840 +       YYSTYPE;
7841 +# define yystype YYSTYPE /* obsolescent; will be withdrawn */
7842 +# define YYSTYPE_IS_DECLARED 1
7843 +# define YYSTYPE_IS_TRIVIAL 1
7844 +#endif
7845 +
7846 +extern YYSTYPE yylval;
7847 +
7848 +#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
7849 +typedef struct YYLTYPE
7850 +{
7851 +  int first_line;
7852 +  int first_column;
7853 +  int last_line;
7854 +  int last_column;
7855 +} YYLTYPE;
7856 +# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
7857 +# define YYLTYPE_IS_DECLARED 1
7858 +# define YYLTYPE_IS_TRIVIAL 1
7859 +#endif
7860 +
7861 +extern YYLTYPE yylloc;
7862 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dtc-src/dtc-parser.y powerpc.git/arch/powerpc/boot/dtc-src/dtc-parser.y
7863 --- linux-2.6.24/arch/powerpc/boot/dtc-src/dtc-parser.y 1970-01-01 01:00:00.000000000 +0100
7864 +++ powerpc.git/arch/powerpc/boot/dtc-src/dtc-parser.y  2008-01-28 20:25:49.000000000 +0100
7865 @@ -0,0 +1,336 @@
7866 +/*
7867 + * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
7868 + *
7869 + *
7870 + * This program is free software; you can redistribute it and/or
7871 + * modify it under the terms of the GNU General Public License as
7872 + * published by the Free Software Foundation; either version 2 of the
7873 + * License, or (at your option) any later version.
7874 + *
7875 + *  This program is distributed in the hope that it will be useful,
7876 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
7877 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
7878 + *  General Public License for more details.
7879 + *
7880 + *  You should have received a copy of the GNU General Public License
7881 + *  along with this program; if not, write to the Free Software
7882 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
7883 + *                                                                   USA
7884 + */
7885 +
7886 +%locations
7887 +
7888 +%{
7889 +#include "dtc.h"
7890 +#include "srcpos.h"
7891 +
7892 +int yylex(void);
7893 +unsigned long long eval_literal(const char *s, int base, int bits);
7894 +
7895 +extern struct boot_info *the_boot_info;
7896 +
7897 +%}
7898 +
7899 +%union {
7900 +       char *propnodename;
7901 +       char *literal;
7902 +       char *labelref;
7903 +       unsigned int cbase;
7904 +       u8 byte;
7905 +       struct data data;
7906 +
7907 +       u64 addr;
7908 +       cell_t cell;
7909 +       struct property *prop;
7910 +       struct property *proplist;
7911 +       struct node *node;
7912 +       struct node *nodelist;
7913 +       struct reserve_info *re;
7914 +}
7915 +
7916 +%token DT_V1
7917 +%token DT_MEMRESERVE
7918 +%token <propnodename> DT_PROPNODENAME
7919 +%token <literal> DT_LITERAL
7920 +%token <literal> DT_LEGACYLITERAL
7921 +%token <cbase> DT_BASE
7922 +%token <byte> DT_BYTE
7923 +%token <data> DT_STRING
7924 +%token <labelref> DT_LABEL
7925 +%token <labelref> DT_REF
7926 +
7927 +%type <data> propdata
7928 +%type <data> propdataprefix
7929 +%type <re> memreserve
7930 +%type <re> memreserves
7931 +%type <re> v0_memreserve
7932 +%type <re> v0_memreserves
7933 +%type <addr> addr
7934 +%type <data> celllist
7935 +%type <cbase> cellbase
7936 +%type <cell> cellval
7937 +%type <data> bytestring
7938 +%type <prop> propdef
7939 +%type <proplist> proplist
7940 +
7941 +%type <node> devicetree
7942 +%type <node> nodedef
7943 +%type <node> subnode
7944 +%type <nodelist> subnodes
7945 +%type <labelref> label
7946 +
7947 +%%
7948 +
7949 +sourcefile:
7950 +         DT_V1 ';' memreserves devicetree
7951 +               {
7952 +                       the_boot_info = build_boot_info($3, $4);
7953 +               }
7954 +       | v0_memreserves devicetree
7955 +               {
7956 +                       the_boot_info = build_boot_info($1, $2);
7957 +               }
7958 +       ;
7959 +
7960 +memreserves:
7961 +         /* empty */
7962 +               {
7963 +                       $$ = NULL;
7964 +               }
7965 +       | memreserve memreserves
7966 +               {
7967 +                       $$ = chain_reserve_entry($1, $2);
7968 +               }
7969 +       ;
7970 +
7971 +memreserve:
7972 +         label DT_MEMRESERVE addr addr ';'
7973 +               {
7974 +                       $$ = build_reserve_entry($3, $4, $1);
7975 +               }
7976 +       ;
7977 +
7978 +v0_memreserves:
7979 +         /* empty */
7980 +               {
7981 +                       $$ = NULL;
7982 +               }
7983 +       | v0_memreserve v0_memreserves
7984 +               {
7985 +                       $$ = chain_reserve_entry($1, $2);
7986 +               };
7987 +       ;
7988 +
7989 +v0_memreserve:
7990 +         memreserve
7991 +               {
7992 +                       $$ = $1;
7993 +               }
7994 +       | label DT_MEMRESERVE addr '-' addr ';'
7995 +               {
7996 +                       $$ = build_reserve_entry($3, $5 - $3 + 1, $1);
7997 +               }
7998 +       ;
7999 +
8000 +addr:
8001 +         DT_LITERAL
8002 +               {
8003 +                       $$ = eval_literal($1, 0, 64);
8004 +               }
8005 +       | DT_LEGACYLITERAL
8006 +               {
8007 +                       $$ = eval_literal($1, 16, 64);
8008 +               }
8009 +         ;
8010 +
8011 +devicetree:
8012 +         '/' nodedef
8013 +               {
8014 +                       $$ = name_node($2, "", NULL);
8015 +               }
8016 +       ;
8017 +
8018 +nodedef:
8019 +         '{' proplist subnodes '}' ';'
8020 +               {
8021 +                       $$ = build_node($2, $3);
8022 +               }
8023 +       ;
8024 +
8025 +proplist:
8026 +         /* empty */
8027 +               {
8028 +                       $$ = NULL;
8029 +               }
8030 +       | proplist propdef
8031 +               {
8032 +                       $$ = chain_property($2, $1);
8033 +               }
8034 +       ;
8035 +
8036 +propdef:
8037 +         label DT_PROPNODENAME '=' propdata ';'
8038 +               {
8039 +                       $$ = build_property($2, $4, $1);
8040 +               }
8041 +       | label DT_PROPNODENAME ';'
8042 +               {
8043 +                       $$ = build_property($2, empty_data, $1);
8044 +               }
8045 +       ;
8046 +
8047 +propdata:
8048 +         propdataprefix DT_STRING
8049 +               {
8050 +                       $$ = data_merge($1, $2);
8051 +               }
8052 +       | propdataprefix '<' celllist '>'
8053 +               {
8054 +                       $$ = data_merge($1, $3);
8055 +               }
8056 +       | propdataprefix '[' bytestring ']'
8057 +               {
8058 +                       $$ = data_merge($1, $3);
8059 +               }
8060 +       | propdataprefix DT_REF
8061 +               {
8062 +                       $$ = data_add_marker($1, REF_PATH, $2);
8063 +               }
8064 +       | propdata DT_LABEL
8065 +               {
8066 +                       $$ = data_add_marker($1, LABEL, $2);
8067 +               }
8068 +       ;
8069 +
8070 +propdataprefix:
8071 +         /* empty */
8072 +               {
8073 +                       $$ = empty_data;
8074 +               }
8075 +       | propdata ','
8076 +               {
8077 +                       $$ = $1;
8078 +               }
8079 +       | propdataprefix DT_LABEL
8080 +               {
8081 +                       $$ = data_add_marker($1, LABEL, $2);
8082 +               }
8083 +       ;
8084 +
8085 +celllist:
8086 +         /* empty */
8087 +               {
8088 +                       $$ = empty_data;
8089 +               }
8090 +       | celllist cellval
8091 +               {
8092 +                       $$ = data_append_cell($1, $2);
8093 +               }
8094 +       | celllist DT_REF
8095 +               {
8096 +                       $$ = data_append_cell(data_add_marker($1, REF_PHANDLE,
8097 +                                                             $2), -1);
8098 +               }
8099 +       | celllist DT_LABEL
8100 +               {
8101 +                       $$ = data_add_marker($1, LABEL, $2);
8102 +               }
8103 +       ;
8104 +
8105 +cellbase:
8106 +         /* empty */
8107 +               {
8108 +                       $$ = 16;
8109 +               }
8110 +       | DT_BASE
8111 +       ;
8112 +
8113 +cellval:
8114 +         DT_LITERAL
8115 +               {
8116 +                       $$ = eval_literal($1, 0, 32);
8117 +               }
8118 +       | cellbase DT_LEGACYLITERAL
8119 +               {
8120 +                       $$ = eval_literal($2, $1, 32);
8121 +               }
8122 +       ;
8123 +
8124 +bytestring:
8125 +         /* empty */
8126 +               {
8127 +                       $$ = empty_data;
8128 +               }
8129 +       | bytestring DT_BYTE
8130 +               {
8131 +                       $$ = data_append_byte($1, $2);
8132 +               }
8133 +       | bytestring DT_LABEL
8134 +               {
8135 +                       $$ = data_add_marker($1, LABEL, $2);
8136 +               }
8137 +       ;
8138 +
8139 +subnodes:
8140 +         /* empty */
8141 +               {
8142 +                       $$ = NULL;
8143 +               }
8144 +       |  subnode subnodes
8145 +               {
8146 +                       $$ = chain_node($1, $2);
8147 +               }
8148 +       | subnode propdef
8149 +               {
8150 +                       yyerror("syntax error: properties must precede subnodes\n");
8151 +                       YYERROR;
8152 +               }
8153 +       ;
8154 +
8155 +subnode:
8156 +         label DT_PROPNODENAME nodedef
8157 +               {
8158 +                       $$ = name_node($3, $2, $1);
8159 +               }
8160 +       ;
8161 +
8162 +label:
8163 +         /* empty */
8164 +               {
8165 +                       $$ = NULL;
8166 +               }
8167 +       | DT_LABEL
8168 +               {
8169 +                       $$ = $1;
8170 +               }
8171 +       ;
8172 +
8173 +%%
8174 +
8175 +void yyerror (char const *s)
8176 +{
8177 +       const char *fname = srcpos_filename_for_num(yylloc.filenum);
8178 +
8179 +       if (strcmp(fname, "-") == 0)
8180 +               fname = "stdin";
8181 +
8182 +       fprintf(stderr, "%s:%d %s\n",
8183 +               fname, yylloc.first_line, s);
8184 +}
8185 +
8186 +unsigned long long eval_literal(const char *s, int base, int bits)
8187 +{
8188 +       unsigned long long val;
8189 +       char *e;
8190 +
8191 +       errno = 0;
8192 +       val = strtoull(s, &e, base);
8193 +       if (*e)
8194 +               yyerror("bad characters in literal");
8195 +       else if ((errno == ERANGE)
8196 +                || ((bits < 64) && (val >= (1ULL << bits))))
8197 +               yyerror("literal out of range");
8198 +       else if (errno != 0)
8199 +               yyerror("bad literal");
8200 +       return val;
8201 +}
8202 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dtc-src/dtc.c powerpc.git/arch/powerpc/boot/dtc-src/dtc.c
8203 --- linux-2.6.24/arch/powerpc/boot/dtc-src/dtc.c        1970-01-01 01:00:00.000000000 +0100
8204 +++ powerpc.git/arch/powerpc/boot/dtc-src/dtc.c 2008-01-28 20:25:49.000000000 +0100
8205 @@ -0,0 +1,231 @@
8206 +/*
8207 + * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
8208 + *
8209 + *
8210 + * This program is free software; you can redistribute it and/or
8211 + * modify it under the terms of the GNU General Public License as
8212 + * published by the Free Software Foundation; either version 2 of the
8213 + * License, or (at your option) any later version.
8214 + *
8215 + *  This program is distributed in the hope that it will be useful,
8216 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
8217 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
8218 + *  General Public License for more details.
8219 + *
8220 + *  You should have received a copy of the GNU General Public License
8221 + *  along with this program; if not, write to the Free Software
8222 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
8223 + *                                                                   USA
8224 + */
8225 +
8226 +#include "dtc.h"
8227 +#include "srcpos.h"
8228 +
8229 +#include "version_gen.h"
8230 +
8231 +/*
8232 + * Command line options
8233 + */
8234 +int quiet;             /* Level of quietness */
8235 +int reservenum;                /* Number of memory reservation slots */
8236 +int minsize;           /* Minimum blob size */
8237 +int padsize;           /* Additional padding to blob */
8238 +
8239 +char *join_path(const char *path, const char *name)
8240 +{
8241 +       int lenp = strlen(path);
8242 +       int lenn = strlen(name);
8243 +       int len;
8244 +       int needslash = 1;
8245 +       char *str;
8246 +
8247 +       len = lenp + lenn + 2;
8248 +       if ((lenp > 0) && (path[lenp-1] == '/')) {
8249 +               needslash = 0;
8250 +               len--;
8251 +       }
8252 +
8253 +       str = xmalloc(len);
8254 +       memcpy(str, path, lenp);
8255 +       if (needslash) {
8256 +               str[lenp] = '/';
8257 +               lenp++;
8258 +       }
8259 +       memcpy(str+lenp, name, lenn+1);
8260 +       return str;
8261 +}
8262 +
8263 +void fill_fullpaths(struct node *tree, const char *prefix)
8264 +{
8265 +       struct node *child;
8266 +       const char *unit;
8267 +
8268 +       tree->fullpath = join_path(prefix, tree->name);
8269 +
8270 +       unit = strchr(tree->name, '@');
8271 +       if (unit)
8272 +               tree->basenamelen = unit - tree->name;
8273 +       else
8274 +               tree->basenamelen = strlen(tree->name);
8275 +
8276 +       for_each_child(tree, child)
8277 +               fill_fullpaths(child, tree->fullpath);
8278 +}
8279 +
8280 +static void  __attribute__ ((noreturn)) usage(void)
8281 +{
8282 +       fprintf(stderr, "Usage:\n");
8283 +       fprintf(stderr, "\tdtc [options] <input file>\n");
8284 +       fprintf(stderr, "\nOptions:\n");
8285 +       fprintf(stderr, "\t-h\n");
8286 +       fprintf(stderr, "\t\tThis help text\n");
8287 +       fprintf(stderr, "\t-q\n");
8288 +       fprintf(stderr, "\t\tQuiet: -q suppress warnings, -qq errors, -qqq all\n");
8289 +       fprintf(stderr, "\t-I <input format>\n");
8290 +       fprintf(stderr, "\t\tInput formats are:\n");
8291 +       fprintf(stderr, "\t\t\tdts - device tree source text\n");
8292 +       fprintf(stderr, "\t\t\tdtb - device tree blob\n");
8293 +       fprintf(stderr, "\t\t\tfs - /proc/device-tree style directory\n");
8294 +       fprintf(stderr, "\t-o <output file>\n");
8295 +       fprintf(stderr, "\t-O <output format>\n");
8296 +       fprintf(stderr, "\t\tOutput formats are:\n");
8297 +       fprintf(stderr, "\t\t\tdts - device tree source text\n");
8298 +       fprintf(stderr, "\t\t\tdtb - device tree blob\n");
8299 +       fprintf(stderr, "\t\t\tasm - assembler source\n");
8300 +       fprintf(stderr, "\t-V <output version>\n");
8301 +       fprintf(stderr, "\t\tBlob version to produce, defaults to %d (relevant for dtb\n\t\tand asm output only)\n", DEFAULT_FDT_VERSION);
8302 +       fprintf(stderr, "\t-R <number>\n");
8303 +       fprintf(stderr, "\t\tMake space for <number> reserve map entries (relevant for \n\t\tdtb and asm output only)\n");
8304 +       fprintf(stderr, "\t-S <bytes>\n");
8305 +       fprintf(stderr, "\t\tMake the blob at least <bytes> long (extra space)\n");
8306 +       fprintf(stderr, "\t-p <bytes>\n");
8307 +       fprintf(stderr, "\t\tAdd padding to the blob of <bytes> long (extra space)\n");
8308 +       fprintf(stderr, "\t-b <number>\n");
8309 +       fprintf(stderr, "\t\tSet the physical boot cpu\n");
8310 +       fprintf(stderr, "\t-f\n");
8311 +       fprintf(stderr, "\t\tForce - try to produce output even if the input tree has errors\n");
8312 +       fprintf(stderr, "\t-v\n");
8313 +       fprintf(stderr, "\t\tPrint DTC version and exit\n");
8314 +       exit(2);
8315 +}
8316 +
8317 +int main(int argc, char *argv[])
8318 +{
8319 +       struct boot_info *bi;
8320 +       const char *inform = "dts";
8321 +       const char *outform = "dts";
8322 +       const char *outname = "-";
8323 +       int force = 0, check = 0;
8324 +       const char *arg;
8325 +       int opt;
8326 +       FILE *inf = NULL;
8327 +       FILE *outf = NULL;
8328 +       int outversion = DEFAULT_FDT_VERSION;
8329 +       int boot_cpuid_phys = 0xfeedbeef;
8330 +
8331 +       quiet      = 0;
8332 +       reservenum = 0;
8333 +       minsize    = 0;
8334 +       padsize    = 0;
8335 +
8336 +       while ((opt = getopt(argc, argv, "hI:O:o:V:R:S:p:fcqb:v")) != EOF) {
8337 +               switch (opt) {
8338 +               case 'I':
8339 +                       inform = optarg;
8340 +                       break;
8341 +               case 'O':
8342 +                       outform = optarg;
8343 +                       break;
8344 +               case 'o':
8345 +                       outname = optarg;
8346 +                       break;
8347 +               case 'V':
8348 +                       outversion = strtol(optarg, NULL, 0);
8349 +                       break;
8350 +               case 'R':
8351 +                       reservenum = strtol(optarg, NULL, 0);
8352 +                       break;
8353 +               case 'S':
8354 +                       minsize = strtol(optarg, NULL, 0);
8355 +                       break;
8356 +               case 'p':
8357 +                       padsize = strtol(optarg, NULL, 0);
8358 +                       break;
8359 +               case 'f':
8360 +                       force = 1;
8361 +                       break;
8362 +               case 'c':
8363 +                       check = 1;
8364 +                       break;
8365 +               case 'q':
8366 +                       quiet++;
8367 +                       break;
8368 +               case 'b':
8369 +                       boot_cpuid_phys = strtol(optarg, NULL, 0);
8370 +                       break;
8371 +               case 'v':
8372 +                   printf("Version: %s\n", DTC_VERSION);
8373 +                   exit(0);
8374 +               case 'h':
8375 +               default:
8376 +                       usage();
8377 +               }
8378 +       }
8379 +
8380 +       if (argc > (optind+1))
8381 +               usage();
8382 +       else if (argc < (optind+1))
8383 +               arg = "-";
8384 +       else
8385 +               arg = argv[optind];
8386 +
8387 +       /* minsize and padsize are mutually exclusive */
8388 +       if ((minsize) && (padsize)) {
8389 +               die("Can't set both -p and -S\n");
8390 +       }
8391 +
8392 +       fprintf(stderr, "DTC: %s->%s  on file \"%s\"\n",
8393 +               inform, outform, arg);
8394 +
8395 +       if (streq(inform, "dts")) {
8396 +               bi = dt_from_source(arg);
8397 +       } else if (streq(inform, "fs")) {
8398 +               bi = dt_from_fs(arg);
8399 +       } else if(streq(inform, "dtb")) {
8400 +               inf = dtc_open_file(arg);
8401 +               bi = dt_from_blob(inf);
8402 +       } else {
8403 +               die("Unknown input format \"%s\"\n", inform);
8404 +       }
8405 +
8406 +       if (inf && (inf != stdin))
8407 +               fclose(inf);
8408 +
8409 +       if (! bi || ! bi->dt)
8410 +               die("Couldn't read input tree\n");
8411 +
8412 +       process_checks(force, bi, check, outversion, boot_cpuid_phys);
8413 +
8414 +       if (streq(outname, "-")) {
8415 +               outf = stdout;
8416 +       } else {
8417 +               outf = fopen(outname, "w");
8418 +               if (! outf)
8419 +                       die("Couldn't open output file %s: %s\n",
8420 +                           outname, strerror(errno));
8421 +       }
8422 +
8423 +       if (streq(outform, "dts")) {
8424 +               dt_to_source(outf, bi);
8425 +       } else if (streq(outform, "dtb")) {
8426 +               dt_to_blob(outf, bi, outversion, boot_cpuid_phys);
8427 +       } else if (streq(outform, "asm")) {
8428 +               dt_to_asm(outf, bi, outversion, boot_cpuid_phys);
8429 +       } else if (streq(outform, "null")) {
8430 +               /* do nothing */
8431 +       } else {
8432 +               die("Unknown output format \"%s\"\n", outform);
8433 +       }
8434 +
8435 +       exit(0);
8436 +}
8437 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dtc-src/dtc.h powerpc.git/arch/powerpc/boot/dtc-src/dtc.h
8438 --- linux-2.6.24/arch/powerpc/boot/dtc-src/dtc.h        1970-01-01 01:00:00.000000000 +0100
8439 +++ powerpc.git/arch/powerpc/boot/dtc-src/dtc.h 2008-01-28 20:25:49.000000000 +0100
8440 @@ -0,0 +1,269 @@
8441 +#ifndef _DTC_H
8442 +#define _DTC_H
8443 +
8444 +/*
8445 + * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
8446 + *
8447 + *
8448 + * This program is free software; you can redistribute it and/or
8449 + * modify it under the terms of the GNU General Public License as
8450 + * published by the Free Software Foundation; either version 2 of the
8451 + * License, or (at your option) any later version.
8452 + *
8453 + *  This program is distributed in the hope that it will be useful,
8454 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
8455 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
8456 + *  General Public License for more details.
8457 + *
8458 + *  You should have received a copy of the GNU General Public License
8459 + *  along with this program; if not, write to the Free Software
8460 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
8461 + *                                                                   USA
8462 + */
8463 +
8464 +#include <stdio.h>
8465 +#include <string.h>
8466 +#include <stdlib.h>
8467 +#include <stdint.h>
8468 +#include <stdarg.h>
8469 +#include <assert.h>
8470 +#include <ctype.h>
8471 +#include <errno.h>
8472 +#include <unistd.h>
8473 +#include <netinet/in.h>
8474 +#include <endian.h>
8475 +#include <byteswap.h>
8476 +
8477 +#include <fdt.h>
8478 +
8479 +#define DEFAULT_FDT_VERSION    17
8480 +/*
8481 + * Command line options
8482 + */
8483 +extern int quiet;              /* Level of quietness */
8484 +extern int reservenum;         /* Number of memory reservation slots */
8485 +extern int minsize;            /* Minimum blob size */
8486 +extern int padsize;            /* Additional padding to blob */
8487 +
8488 +static inline void __attribute__((noreturn)) die(char * str, ...)
8489 +{
8490 +       va_list ap;
8491 +
8492 +       va_start(ap, str);
8493 +       fprintf(stderr, "FATAL ERROR: ");
8494 +       vfprintf(stderr, str, ap);
8495 +       exit(1);
8496 +}
8497 +
8498 +static inline void *xmalloc(size_t len)
8499 +{
8500 +       void *new = malloc(len);
8501 +
8502 +       if (! new)
8503 +               die("malloc() failed\n");
8504 +
8505 +       return new;
8506 +}
8507 +
8508 +static inline void *xrealloc(void *p, size_t len)
8509 +{
8510 +       void *new = realloc(p, len);
8511 +
8512 +       if (! new)
8513 +               die("realloc() failed (len=%d)\n", len);
8514 +
8515 +       return new;
8516 +}
8517 +
8518 +typedef uint8_t u8;
8519 +typedef uint16_t u16;
8520 +typedef uint32_t u32;
8521 +typedef uint64_t u64;
8522 +typedef u32 cell_t;
8523 +
8524 +#define cpu_to_be16(x) htons(x)
8525 +#define be16_to_cpu(x) ntohs(x)
8526 +
8527 +#define cpu_to_be32(x) htonl(x)
8528 +#define be32_to_cpu(x) ntohl(x)
8529 +
8530 +#if __BYTE_ORDER == __BIG_ENDIAN
8531 +#define cpu_to_be64(x) (x)
8532 +#define be64_to_cpu(x) (x)
8533 +#else
8534 +#define cpu_to_be64(x) bswap_64(x)
8535 +#define be64_to_cpu(x) bswap_64(x)
8536 +#endif
8537 +
8538 +#define streq(a, b)    (strcmp((a), (b)) == 0)
8539 +#define strneq(a, b, n)        (strncmp((a), (b), (n)) == 0)
8540 +
8541 +#define ALIGN(x, a)    (((x) + (a) - 1) & ~((a) - 1))
8542 +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
8543 +
8544 +/* Data blobs */
8545 +enum markertype {
8546 +       REF_PHANDLE,
8547 +       REF_PATH,
8548 +       LABEL,
8549 +};
8550 +
8551 +struct  marker {
8552 +       enum markertype type;
8553 +       int offset;
8554 +       char *ref;
8555 +       struct marker *next;
8556 +};
8557 +
8558 +struct data {
8559 +       int len;
8560 +       char *val;
8561 +       int asize;
8562 +       struct marker *markers;
8563 +};
8564 +
8565 +
8566 +#define empty_data ((struct data){ /* all .members = 0 or NULL */ })
8567 +
8568 +#define for_each_marker(m) \
8569 +       for (; (m); (m) = (m)->next)
8570 +#define for_each_marker_of_type(m, t) \
8571 +       for_each_marker(m) \
8572 +               if ((m)->type == (t))
8573 +
8574 +void data_free(struct data d);
8575 +
8576 +struct data data_grow_for(struct data d, int xlen);
8577 +
8578 +struct data data_copy_mem(const char *mem, int len);
8579 +struct data data_copy_escape_string(const char *s, int len);
8580 +struct data data_copy_file(FILE *f, size_t len);
8581 +
8582 +struct data data_append_data(struct data d, const void *p, int len);
8583 +struct data data_insert_at_marker(struct data d, struct marker *m,
8584 +                                 const void *p, int len);
8585 +struct data data_merge(struct data d1, struct data d2);
8586 +struct data data_append_cell(struct data d, cell_t word);
8587 +struct data data_append_re(struct data d, const struct fdt_reserve_entry *re);
8588 +struct data data_append_addr(struct data d, u64 addr);
8589 +struct data data_append_byte(struct data d, uint8_t byte);
8590 +struct data data_append_zeroes(struct data d, int len);
8591 +struct data data_append_align(struct data d, int align);
8592 +
8593 +struct data data_add_marker(struct data d, enum markertype type, char *ref);
8594 +
8595 +int data_is_one_string(struct data d);
8596 +
8597 +/* DT constraints */
8598 +
8599 +#define MAX_PROPNAME_LEN       31
8600 +#define MAX_NODENAME_LEN       31
8601 +
8602 +/* Live trees */
8603 +struct property {
8604 +       char *name;
8605 +       struct data val;
8606 +
8607 +       struct property *next;
8608 +
8609 +       char *label;
8610 +};
8611 +
8612 +struct node {
8613 +       char *name;
8614 +       struct property *proplist;
8615 +       struct node *children;
8616 +
8617 +       struct node *parent;
8618 +       struct node *next_sibling;
8619 +
8620 +       char *fullpath;
8621 +       int basenamelen;
8622 +
8623 +       cell_t phandle;
8624 +       int addr_cells, size_cells;
8625 +
8626 +       char *label;
8627 +};
8628 +
8629 +#define for_each_property(n, p) \
8630 +       for ((p) = (n)->proplist; (p); (p) = (p)->next)
8631 +
8632 +#define for_each_child(n, c)   \
8633 +       for ((c) = (n)->children; (c); (c) = (c)->next_sibling)
8634 +
8635 +struct property *build_property(char *name, struct data val, char *label);
8636 +struct property *chain_property(struct property *first, struct property *list);
8637 +struct property *reverse_properties(struct property *first);
8638 +
8639 +struct node *build_node(struct property *proplist, struct node *children);
8640 +struct node *name_node(struct node *node, char *name, char *label);
8641 +struct node *chain_node(struct node *first, struct node *list);
8642 +
8643 +void add_property(struct node *node, struct property *prop);
8644 +void add_child(struct node *parent, struct node *child);
8645 +
8646 +const char *get_unitname(struct node *node);
8647 +struct property *get_property(struct node *node, const char *propname);
8648 +cell_t propval_cell(struct property *prop);
8649 +struct node *get_subnode(struct node *node, const char *nodename);
8650 +struct node *get_node_by_path(struct node *tree, const char *path);
8651 +struct node *get_node_by_label(struct node *tree, const char *label);
8652 +struct node *get_node_by_phandle(struct node *tree, cell_t phandle);
8653 +struct node *get_node_by_ref(struct node *tree, const char *ref);
8654 +cell_t get_node_phandle(struct node *root, struct node *node);
8655 +
8656 +/* Boot info (tree plus memreserve information */
8657 +
8658 +struct reserve_info {
8659 +       struct fdt_reserve_entry re;
8660 +
8661 +       struct reserve_info *next;
8662 +
8663 +       char *label;
8664 +};
8665 +
8666 +struct reserve_info *build_reserve_entry(u64 start, u64 len, char *label);
8667 +struct reserve_info *chain_reserve_entry(struct reserve_info *first,
8668 +                                        struct reserve_info *list);
8669 +struct reserve_info *add_reserve_entry(struct reserve_info *list,
8670 +                                      struct reserve_info *new);
8671 +
8672 +
8673 +struct boot_info {
8674 +       struct reserve_info *reservelist;
8675 +       struct node *dt;                /* the device tree */
8676 +};
8677 +
8678 +struct boot_info *build_boot_info(struct reserve_info *reservelist,
8679 +                                 struct node *tree);
8680 +
8681 +/* Checks */
8682 +
8683 +void process_checks(int force, struct boot_info *bi,
8684 +                   int checkflag, int outversion, int boot_cpuid_phys);
8685 +
8686 +/* Flattened trees */
8687 +
8688 +void dt_to_blob(FILE *f, struct boot_info *bi, int version,
8689 +               int boot_cpuid_phys);
8690 +void dt_to_asm(FILE *f, struct boot_info *bi, int version,
8691 +              int boot_cpuid_phys);
8692 +
8693 +struct boot_info *dt_from_blob(FILE *f);
8694 +
8695 +/* Tree source */
8696 +
8697 +void dt_to_source(FILE *f, struct boot_info *bi);
8698 +struct boot_info *dt_from_source(const char *f);
8699 +
8700 +/* FS trees */
8701 +
8702 +struct boot_info *dt_from_fs(const char *dirname);
8703 +
8704 +/* misc */
8705 +
8706 +char *join_path(const char *path, const char *name);
8707 +void fill_fullpaths(struct node *tree, const char *prefix);
8708 +
8709 +#endif /* _DTC_H */
8710 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dtc-src/flattree.c powerpc.git/arch/powerpc/boot/dtc-src/flattree.c
8711 --- linux-2.6.24/arch/powerpc/boot/dtc-src/flattree.c   1970-01-01 01:00:00.000000000 +0100
8712 +++ powerpc.git/arch/powerpc/boot/dtc-src/flattree.c    2008-01-28 20:25:49.000000000 +0100
8713 @@ -0,0 +1,968 @@
8714 +/*
8715 + * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
8716 + *
8717 + *
8718 + * This program is free software; you can redistribute it and/or
8719 + * modify it under the terms of the GNU General Public License as
8720 + * published by the Free Software Foundation; either version 2 of the
8721 + * License, or (at your option) any later version.
8722 + *
8723 + *  This program is distributed in the hope that it will be useful,
8724 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
8725 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
8726 + *  General Public License for more details.
8727 + *
8728 + *  You should have received a copy of the GNU General Public License
8729 + *  along with this program; if not, write to the Free Software
8730 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
8731 + *                                                                   USA
8732 + */
8733 +
8734 +#include "dtc.h"
8735 +
8736 +#define FTF_FULLPATH   0x1
8737 +#define FTF_VARALIGN   0x2
8738 +#define FTF_NAMEPROPS  0x4
8739 +#define FTF_BOOTCPUID  0x8
8740 +#define FTF_STRTABSIZE 0x10
8741 +#define FTF_STRUCTSIZE 0x20
8742 +#define FTF_NOPS       0x40
8743 +
8744 +static struct version_info {
8745 +       int version;
8746 +       int last_comp_version;
8747 +       int hdr_size;
8748 +       int flags;
8749 +} version_table[] = {
8750 +       {1, 1, FDT_V1_SIZE,
8751 +        FTF_FULLPATH|FTF_VARALIGN|FTF_NAMEPROPS},
8752 +       {2, 1, FDT_V2_SIZE,
8753 +        FTF_FULLPATH|FTF_VARALIGN|FTF_NAMEPROPS|FTF_BOOTCPUID},
8754 +       {3, 1, FDT_V3_SIZE,
8755 +        FTF_FULLPATH|FTF_VARALIGN|FTF_NAMEPROPS|FTF_BOOTCPUID|FTF_STRTABSIZE},
8756 +       {16, 16, FDT_V3_SIZE,
8757 +        FTF_BOOTCPUID|FTF_STRTABSIZE|FTF_NOPS},
8758 +       {17, 16, FDT_V17_SIZE,
8759 +        FTF_BOOTCPUID|FTF_STRTABSIZE|FTF_STRUCTSIZE|FTF_NOPS},
8760 +};
8761 +
8762 +struct emitter {
8763 +       void (*cell)(void *, cell_t);
8764 +       void (*string)(void *, char *, int);
8765 +       void (*align)(void *, int);
8766 +       void (*data)(void *, struct data);
8767 +       void (*beginnode)(void *, const char *);
8768 +       void (*endnode)(void *, const char *);
8769 +       void (*property)(void *, const char *);
8770 +};
8771 +
8772 +static void bin_emit_cell(void *e, cell_t val)
8773 +{
8774 +       struct data *dtbuf = e;
8775 +
8776 +       *dtbuf = data_append_cell(*dtbuf, val);
8777 +}
8778 +
8779 +static void bin_emit_string(void *e, char *str, int len)
8780 +{
8781 +       struct data *dtbuf = e;
8782 +
8783 +       if (len == 0)
8784 +               len = strlen(str);
8785 +
8786 +       *dtbuf = data_append_data(*dtbuf, str, len);
8787 +       *dtbuf = data_append_byte(*dtbuf, '\0');
8788 +}
8789 +
8790 +static void bin_emit_align(void *e, int a)
8791 +{
8792 +       struct data *dtbuf = e;
8793 +
8794 +       *dtbuf = data_append_align(*dtbuf, a);
8795 +}
8796 +
8797 +static void bin_emit_data(void *e, struct data d)
8798 +{
8799 +       struct data *dtbuf = e;
8800 +
8801 +       *dtbuf = data_append_data(*dtbuf, d.val, d.len);
8802 +}
8803 +
8804 +static void bin_emit_beginnode(void *e, const char *label)
8805 +{
8806 +       bin_emit_cell(e, FDT_BEGIN_NODE);
8807 +}
8808 +
8809 +static void bin_emit_endnode(void *e, const char *label)
8810 +{
8811 +       bin_emit_cell(e, FDT_END_NODE);
8812 +}
8813 +
8814 +static void bin_emit_property(void *e, const char *label)
8815 +{
8816 +       bin_emit_cell(e, FDT_PROP);
8817 +}
8818 +
8819 +static struct emitter bin_emitter = {
8820 +       .cell = bin_emit_cell,
8821 +       .string = bin_emit_string,
8822 +       .align = bin_emit_align,
8823 +       .data = bin_emit_data,
8824 +       .beginnode = bin_emit_beginnode,
8825 +       .endnode = bin_emit_endnode,
8826 +       .property = bin_emit_property,
8827 +};
8828 +
8829 +static void emit_label(FILE *f, const char *prefix, const char *label)
8830 +{
8831 +       fprintf(f, "\t.globl\t%s_%s\n", prefix, label);
8832 +       fprintf(f, "%s_%s:\n", prefix, label);
8833 +       fprintf(f, "_%s_%s:\n", prefix, label);
8834 +}
8835 +
8836 +static void emit_offset_label(FILE *f, const char *label, int offset)
8837 +{
8838 +       fprintf(f, "\t.globl\t%s\n", label);
8839 +       fprintf(f, "%s\t= . + %d\n", label, offset);
8840 +}
8841 +
8842 +static void asm_emit_cell(void *e, cell_t val)
8843 +{
8844 +       FILE *f = e;
8845 +
8846 +       fprintf(f, "\t.long\t0x%x\n", val);
8847 +}
8848 +
8849 +static void asm_emit_string(void *e, char *str, int len)
8850 +{
8851 +       FILE *f = e;
8852 +       char c = 0;
8853 +
8854 +       if (len != 0) {
8855 +               /* XXX: ewww */
8856 +               c = str[len];
8857 +               str[len] = '\0';
8858 +       }
8859 +
8860 +       fprintf(f, "\t.string\t\"%s\"\n", str);
8861 +
8862 +       if (len != 0) {
8863 +               str[len] = c;
8864 +       }
8865 +}
8866 +
8867 +static void asm_emit_align(void *e, int a)
8868 +{
8869 +       FILE *f = e;
8870 +
8871 +       fprintf(f, "\t.balign\t%d\n", a);
8872 +}
8873 +
8874 +static void asm_emit_data(void *e, struct data d)
8875 +{
8876 +       FILE *f = e;
8877 +       int off = 0;
8878 +       struct marker *m;
8879 +
8880 +       m = d.markers;
8881 +       while (m) {
8882 +               if (m->type == LABEL)
8883 +                       emit_offset_label(f, m->ref, m->offset);
8884 +               m = m->next;
8885 +       }
8886 +
8887 +       while ((d.len - off) >= sizeof(u32)) {
8888 +               fprintf(f, "\t.long\t0x%x\n",
8889 +                       be32_to_cpu(*((u32 *)(d.val+off))));
8890 +               off += sizeof(u32);
8891 +       }
8892 +
8893 +       if ((d.len - off) >= sizeof(u16)) {
8894 +               fprintf(f, "\t.short\t0x%hx\n",
8895 +                       be16_to_cpu(*((u16 *)(d.val+off))));
8896 +               off += sizeof(u16);
8897 +       }
8898 +
8899 +       if ((d.len - off) >= 1) {
8900 +               fprintf(f, "\t.byte\t0x%hhx\n", d.val[off]);
8901 +               off += 1;
8902 +       }
8903 +
8904 +       assert(off == d.len);
8905 +}
8906 +
8907 +static void asm_emit_beginnode(void *e, const char *label)
8908 +{
8909 +       FILE *f = e;
8910 +
8911 +       if (label) {
8912 +               fprintf(f, "\t.globl\t%s\n", label);
8913 +               fprintf(f, "%s:\n", label);
8914 +       }
8915 +       fprintf(f, "\t.long\tFDT_BEGIN_NODE\n");
8916 +}
8917 +
8918 +static void asm_emit_endnode(void *e, const char *label)
8919 +{
8920 +       FILE *f = e;
8921 +
8922 +       fprintf(f, "\t.long\tFDT_END_NODE\n");
8923 +       if (label) {
8924 +               fprintf(f, "\t.globl\t%s_end\n", label);
8925 +               fprintf(f, "%s_end:\n", label);
8926 +       }
8927 +}
8928 +
8929 +static void asm_emit_property(void *e, const char *label)
8930 +{
8931 +       FILE *f = e;
8932 +
8933 +       if (label) {
8934 +               fprintf(f, "\t.globl\t%s\n", label);
8935 +               fprintf(f, "%s:\n", label);
8936 +       }
8937 +       fprintf(f, "\t.long\tFDT_PROP\n");
8938 +}
8939 +
8940 +static struct emitter asm_emitter = {
8941 +       .cell = asm_emit_cell,
8942 +       .string = asm_emit_string,
8943 +       .align = asm_emit_align,
8944 +       .data = asm_emit_data,
8945 +       .beginnode = asm_emit_beginnode,
8946 +       .endnode = asm_emit_endnode,
8947 +       .property = asm_emit_property,
8948 +};
8949 +
8950 +static int stringtable_insert(struct data *d, const char *str)
8951 +{
8952 +       int i;
8953 +
8954 +       /* FIXME: do this more efficiently? */
8955 +
8956 +       for (i = 0; i < d->len; i++) {
8957 +               if (streq(str, d->val + i))
8958 +                       return i;
8959 +       }
8960 +
8961 +       *d = data_append_data(*d, str, strlen(str)+1);
8962 +       return i;
8963 +}
8964 +
8965 +static void flatten_tree(struct node *tree, struct emitter *emit,
8966 +                        void *etarget, struct data *strbuf,
8967 +                        struct version_info *vi)
8968 +{
8969 +       struct property *prop;
8970 +       struct node *child;
8971 +       int seen_name_prop = 0;
8972 +
8973 +       emit->beginnode(etarget, tree->label);
8974 +
8975 +       if (vi->flags & FTF_FULLPATH)
8976 +               emit->string(etarget, tree->fullpath, 0);
8977 +       else
8978 +               emit->string(etarget, tree->name, 0);
8979 +
8980 +       emit->align(etarget, sizeof(cell_t));
8981 +
8982 +       for_each_property(tree, prop) {
8983 +               int nameoff;
8984 +
8985 +               if (streq(prop->name, "name"))
8986 +                       seen_name_prop = 1;
8987 +
8988 +               nameoff = stringtable_insert(strbuf, prop->name);
8989 +
8990 +               emit->property(etarget, prop->label);
8991 +               emit->cell(etarget, prop->val.len);
8992 +               emit->cell(etarget, nameoff);
8993 +
8994 +               if ((vi->flags & FTF_VARALIGN) && (prop->val.len >= 8))
8995 +                       emit->align(etarget, 8);
8996 +
8997 +               emit->data(etarget, prop->val);
8998 +               emit->align(etarget, sizeof(cell_t));
8999 +       }
9000 +
9001 +       if ((vi->flags & FTF_NAMEPROPS) && !seen_name_prop) {
9002 +               emit->property(etarget, NULL);
9003 +               emit->cell(etarget, tree->basenamelen+1);
9004 +               emit->cell(etarget, stringtable_insert(strbuf, "name"));
9005 +
9006 +               if ((vi->flags & FTF_VARALIGN) && ((tree->basenamelen+1) >= 8))
9007 +                       emit->align(etarget, 8);
9008 +
9009 +               emit->string(etarget, tree->name, tree->basenamelen);
9010 +               emit->align(etarget, sizeof(cell_t));
9011 +       }
9012 +
9013 +       for_each_child(tree, child) {
9014 +               flatten_tree(child, emit, etarget, strbuf, vi);
9015 +       }
9016 +
9017 +       emit->endnode(etarget, tree->label);
9018 +}
9019 +
9020 +static struct data flatten_reserve_list(struct reserve_info *reservelist,
9021 +                                struct version_info *vi)
9022 +{
9023 +       struct reserve_info *re;
9024 +       struct data d = empty_data;
9025 +       static struct fdt_reserve_entry null_re = {0,0};
9026 +       int    j;
9027 +
9028 +       for (re = reservelist; re; re = re->next) {
9029 +               d = data_append_re(d, &re->re);
9030 +       }
9031 +       /*
9032 +        * Add additional reserved slots if the user asked for them.
9033 +        */
9034 +       for (j = 0; j < reservenum; j++) {
9035 +               d = data_append_re(d, &null_re);
9036 +       }
9037 +
9038 +       return d;
9039 +}
9040 +
9041 +static void make_fdt_header(struct fdt_header *fdt,
9042 +                           struct version_info *vi,
9043 +                           int reservesize, int dtsize, int strsize,
9044 +                           int boot_cpuid_phys)
9045 +{
9046 +       int reserve_off;
9047 +
9048 +       reservesize += sizeof(struct fdt_reserve_entry);
9049 +
9050 +       memset(fdt, 0xff, sizeof(*fdt));
9051 +
9052 +       fdt->magic = cpu_to_be32(FDT_MAGIC);
9053 +       fdt->version = cpu_to_be32(vi->version);
9054 +       fdt->last_comp_version = cpu_to_be32(vi->last_comp_version);
9055 +
9056 +       /* Reserve map should be doubleword aligned */
9057 +       reserve_off = ALIGN(vi->hdr_size, 8);
9058 +
9059 +       fdt->off_mem_rsvmap = cpu_to_be32(reserve_off);
9060 +       fdt->off_dt_struct = cpu_to_be32(reserve_off + reservesize);
9061 +       fdt->off_dt_strings = cpu_to_be32(reserve_off + reservesize
9062 +                                         + dtsize);
9063 +       fdt->totalsize = cpu_to_be32(reserve_off + reservesize + dtsize + strsize);
9064 +
9065 +       if (vi->flags & FTF_BOOTCPUID)
9066 +               fdt->boot_cpuid_phys = cpu_to_be32(boot_cpuid_phys);
9067 +       if (vi->flags & FTF_STRTABSIZE)
9068 +               fdt->size_dt_strings = cpu_to_be32(strsize);
9069 +       if (vi->flags & FTF_STRUCTSIZE)
9070 +               fdt->size_dt_struct = cpu_to_be32(dtsize);
9071 +}
9072 +
9073 +void dt_to_blob(FILE *f, struct boot_info *bi, int version,
9074 +               int boot_cpuid_phys)
9075 +{
9076 +       struct version_info *vi = NULL;
9077 +       int i;
9078 +       struct data blob       = empty_data;
9079 +       struct data reservebuf = empty_data;
9080 +       struct data dtbuf      = empty_data;
9081 +       struct data strbuf     = empty_data;
9082 +       struct fdt_header fdt;
9083 +       int padlen = 0;
9084 +
9085 +       for (i = 0; i < ARRAY_SIZE(version_table); i++) {
9086 +               if (version_table[i].version == version)
9087 +                       vi = &version_table[i];
9088 +       }
9089 +       if (!vi)
9090 +               die("Unknown device tree blob version %d\n", version);
9091 +
9092 +       flatten_tree(bi->dt, &bin_emitter, &dtbuf, &strbuf, vi);
9093 +       bin_emit_cell(&dtbuf, FDT_END);
9094 +
9095 +       reservebuf = flatten_reserve_list(bi->reservelist, vi);
9096 +
9097 +       /* Make header */
9098 +       make_fdt_header(&fdt, vi, reservebuf.len, dtbuf.len, strbuf.len,
9099 +                       boot_cpuid_phys);
9100 +
9101 +       /*
9102 +        * If the user asked for more space than is used, adjust the totalsize.
9103 +        */
9104 +       if (minsize > 0) {
9105 +               padlen = minsize - be32_to_cpu(fdt.totalsize);
9106 +               if ((padlen < 0) && (quiet < 1))
9107 +                       fprintf(stderr,
9108 +                               "Warning: blob size %d >= minimum size %d\n",
9109 +                               be32_to_cpu(fdt.totalsize), minsize);
9110 +       }
9111 +
9112 +       if (padsize > 0)
9113 +               padlen = padsize;
9114 +
9115 +       if (padlen > 0) {
9116 +               int tsize = be32_to_cpu(fdt.totalsize);
9117 +               tsize += padlen;
9118 +               fdt.totalsize = cpu_to_be32(tsize);
9119 +       }
9120 +
9121 +       /*
9122 +        * Assemble the blob: start with the header, add with alignment
9123 +        * the reserve buffer, add the reserve map terminating zeroes,
9124 +        * the device tree itself, and finally the strings.
9125 +        */
9126 +       blob = data_append_data(blob, &fdt, sizeof(fdt));
9127 +       blob = data_append_align(blob, 8);
9128 +       blob = data_merge(blob, reservebuf);
9129 +       blob = data_append_zeroes(blob, sizeof(struct fdt_reserve_entry));
9130 +       blob = data_merge(blob, dtbuf);
9131 +       blob = data_merge(blob, strbuf);
9132 +
9133 +       /*
9134 +        * If the user asked for more space than is used, pad out the blob.
9135 +        */
9136 +       if (padlen > 0)
9137 +               blob = data_append_zeroes(blob, padlen);
9138 +
9139 +       fwrite(blob.val, blob.len, 1, f);
9140 +
9141 +       if (ferror(f))
9142 +               die("Error writing device tree blob: %s\n", strerror(errno));
9143 +
9144 +       /*
9145 +        * data_merge() frees the right-hand element so only the blob
9146 +        * remains to be freed.
9147 +        */
9148 +       data_free(blob);
9149 +}
9150 +
9151 +static void dump_stringtable_asm(FILE *f, struct data strbuf)
9152 +{
9153 +       const char *p;
9154 +       int len;
9155 +
9156 +       p = strbuf.val;
9157 +
9158 +       while (p < (strbuf.val + strbuf.len)) {
9159 +               len = strlen(p);
9160 +               fprintf(f, "\t.string \"%s\"\n", p);
9161 +               p += len+1;
9162 +       }
9163 +}
9164 +
9165 +void dt_to_asm(FILE *f, struct boot_info *bi, int version, int boot_cpuid_phys)
9166 +{
9167 +       struct version_info *vi = NULL;
9168 +       int i;
9169 +       struct data strbuf = empty_data;
9170 +       struct reserve_info *re;
9171 +       const char *symprefix = "dt";
9172 +
9173 +       for (i = 0; i < ARRAY_SIZE(version_table); i++) {
9174 +               if (version_table[i].version == version)
9175 +                       vi = &version_table[i];
9176 +       }
9177 +       if (!vi)
9178 +               die("Unknown device tree blob version %d\n", version);
9179 +
9180 +       fprintf(f, "/* autogenerated by dtc, do not edit */\n\n");
9181 +       fprintf(f, "#define FDT_MAGIC 0x%x\n", FDT_MAGIC);
9182 +       fprintf(f, "#define FDT_BEGIN_NODE 0x%x\n", FDT_BEGIN_NODE);
9183 +       fprintf(f, "#define FDT_END_NODE 0x%x\n", FDT_END_NODE);
9184 +       fprintf(f, "#define FDT_PROP 0x%x\n", FDT_PROP);
9185 +       fprintf(f, "#define FDT_END 0x%x\n", FDT_END);
9186 +       fprintf(f, "\n");
9187 +
9188 +       emit_label(f, symprefix, "blob_start");
9189 +       emit_label(f, symprefix, "header");
9190 +       fprintf(f, "\t.long\tFDT_MAGIC\t\t\t\t/* magic */\n");
9191 +       fprintf(f, "\t.long\t_%s_blob_abs_end - _%s_blob_start\t/* totalsize */\n",
9192 +               symprefix, symprefix);
9193 +       fprintf(f, "\t.long\t_%s_struct_start - _%s_blob_start\t/* off_dt_struct */\n",
9194 +               symprefix, symprefix);
9195 +       fprintf(f, "\t.long\t_%s_strings_start - _%s_blob_start\t/* off_dt_strings */\n",
9196 +               symprefix, symprefix);
9197 +       fprintf(f, "\t.long\t_%s_reserve_map - _%s_blob_start\t/* off_dt_strings */\n",
9198 +               symprefix, symprefix);
9199 +       fprintf(f, "\t.long\t%d\t\t\t\t\t/* version */\n", vi->version);
9200 +       fprintf(f, "\t.long\t%d\t\t\t\t\t/* last_comp_version */\n",
9201 +               vi->last_comp_version);
9202 +
9203 +       if (vi->flags & FTF_BOOTCPUID)
9204 +               fprintf(f, "\t.long\t%i\t\t\t\t\t/* boot_cpuid_phys */\n",
9205 +                       boot_cpuid_phys);
9206 +
9207 +       if (vi->flags & FTF_STRTABSIZE)
9208 +               fprintf(f, "\t.long\t_%s_strings_end - _%s_strings_start\t/* size_dt_strings */\n",
9209 +                       symprefix, symprefix);
9210 +
9211 +       if (vi->flags & FTF_STRUCTSIZE)
9212 +               fprintf(f, "\t.long\t_%s_struct_end - _%s_struct_start\t/* size_dt_struct */\n",
9213 +                       symprefix, symprefix);
9214 +
9215 +       /*
9216 +        * Reserve map entries.
9217 +        * Align the reserve map to a doubleword boundary.
9218 +        * Each entry is an (address, size) pair of u64 values.
9219 +        * Always supply a zero-sized temination entry.
9220 +        */
9221 +       asm_emit_align(f, 8);
9222 +       emit_label(f, symprefix, "reserve_map");
9223 +
9224 +       fprintf(f, "/* Memory reserve map from source file */\n");
9225 +
9226 +       /*
9227 +        * Use .long on high and low halfs of u64s to avoid .quad
9228 +        * as it appears .quad isn't available in some assemblers.
9229 +        */
9230 +       for (re = bi->reservelist; re; re = re->next) {
9231 +               if (re->label) {
9232 +                       fprintf(f, "\t.globl\t%s\n", re->label);
9233 +                       fprintf(f, "%s:\n", re->label);
9234 +               }
9235 +               fprintf(f, "\t.long\t0x%08x, 0x%08x\n",
9236 +                       (unsigned int)(re->re.address >> 32),
9237 +                       (unsigned int)(re->re.address & 0xffffffff));
9238 +               fprintf(f, "\t.long\t0x%08x, 0x%08x\n",
9239 +                       (unsigned int)(re->re.size >> 32),
9240 +                       (unsigned int)(re->re.size & 0xffffffff));
9241 +       }
9242 +       for (i = 0; i < reservenum; i++) {
9243 +               fprintf(f, "\t.long\t0, 0\n\t.long\t0, 0\n");
9244 +       }
9245 +
9246 +       fprintf(f, "\t.long\t0, 0\n\t.long\t0, 0\n");
9247 +
9248 +       emit_label(f, symprefix, "struct_start");
9249 +       flatten_tree(bi->dt, &asm_emitter, f, &strbuf, vi);
9250 +       fprintf(f, "\t.long\tFDT_END\n");
9251 +       emit_label(f, symprefix, "struct_end");
9252 +
9253 +       emit_label(f, symprefix, "strings_start");
9254 +       dump_stringtable_asm(f, strbuf);
9255 +       emit_label(f, symprefix, "strings_end");
9256 +
9257 +       emit_label(f, symprefix, "blob_end");
9258 +
9259 +       /*
9260 +        * If the user asked for more space than is used, pad it out.
9261 +        */
9262 +       if (minsize > 0) {
9263 +               fprintf(f, "\t.space\t%d - (_%s_blob_end - _%s_blob_start), 0\n",
9264 +                       minsize, symprefix, symprefix);
9265 +       }
9266 +       if (padsize > 0) {
9267 +               fprintf(f, "\t.space\t%d, 0\n", padsize);
9268 +       }
9269 +       emit_label(f, symprefix, "blob_abs_end");
9270 +
9271 +       data_free(strbuf);
9272 +}
9273 +
9274 +struct inbuf {
9275 +       char *base, *limit, *ptr;
9276 +};
9277 +
9278 +static void inbuf_init(struct inbuf *inb, void *base, void *limit)
9279 +{
9280 +       inb->base = base;
9281 +       inb->limit = limit;
9282 +       inb->ptr = inb->base;
9283 +}
9284 +
9285 +static void flat_read_chunk(struct inbuf *inb, void *p, int len)
9286 +{
9287 +       if ((inb->ptr + len) > inb->limit)
9288 +               die("Premature end of data parsing flat device tree\n");
9289 +
9290 +       memcpy(p, inb->ptr, len);
9291 +
9292 +       inb->ptr += len;
9293 +}
9294 +
9295 +static u32 flat_read_word(struct inbuf *inb)
9296 +{
9297 +       u32 val;
9298 +
9299 +       assert(((inb->ptr - inb->base) % sizeof(val)) == 0);
9300 +
9301 +       flat_read_chunk(inb, &val, sizeof(val));
9302 +
9303 +       return be32_to_cpu(val);
9304 +}
9305 +
9306 +static void flat_realign(struct inbuf *inb, int align)
9307 +{
9308 +       int off = inb->ptr - inb->base;
9309 +
9310 +       inb->ptr = inb->base + ALIGN(off, align);
9311 +       if (inb->ptr > inb->limit)
9312 +               die("Premature end of data parsing flat device tree\n");
9313 +}
9314 +
9315 +static char *flat_read_string(struct inbuf *inb)
9316 +{
9317 +       int len = 0;
9318 +       const char *p = inb->ptr;
9319 +       char *str;
9320 +
9321 +       do {
9322 +               if (p >= inb->limit)
9323 +                       die("Premature end of data parsing flat device tree\n");
9324 +               len++;
9325 +       } while ((*p++) != '\0');
9326 +
9327 +       str = strdup(inb->ptr);
9328 +
9329 +       inb->ptr += len;
9330 +
9331 +       flat_realign(inb, sizeof(u32));
9332 +
9333 +       return str;
9334 +}
9335 +
9336 +static struct data flat_read_data(struct inbuf *inb, int len)
9337 +{
9338 +       struct data d = empty_data;
9339 +
9340 +       if (len == 0)
9341 +               return empty_data;
9342 +
9343 +       d = data_grow_for(d, len);
9344 +       d.len = len;
9345 +
9346 +       flat_read_chunk(inb, d.val, len);
9347 +
9348 +       flat_realign(inb, sizeof(u32));
9349 +
9350 +       return d;
9351 +}
9352 +
9353 +static char *flat_read_stringtable(struct inbuf *inb, int offset)
9354 +{
9355 +       const char *p;
9356 +
9357 +       p = inb->base + offset;
9358 +       while (1) {
9359 +               if (p >= inb->limit || p < inb->base)
9360 +                       die("String offset %d overruns string table\n",
9361 +                           offset);
9362 +
9363 +               if (*p == '\0')
9364 +                       break;
9365 +
9366 +               p++;
9367 +       }
9368 +
9369 +       return strdup(inb->base + offset);
9370 +}
9371 +
9372 +static struct property *flat_read_property(struct inbuf *dtbuf,
9373 +                                          struct inbuf *strbuf, int flags)
9374 +{
9375 +       u32 proplen, stroff;
9376 +       char *name;
9377 +       struct data val;
9378 +
9379 +       proplen = flat_read_word(dtbuf);
9380 +       stroff = flat_read_word(dtbuf);
9381 +
9382 +       name = flat_read_stringtable(strbuf, stroff);
9383 +
9384 +       if ((flags & FTF_VARALIGN) && (proplen >= 8))
9385 +               flat_realign(dtbuf, 8);
9386 +
9387 +       val = flat_read_data(dtbuf, proplen);
9388 +
9389 +       return build_property(name, val, NULL);
9390 +}
9391 +
9392 +
9393 +static struct reserve_info *flat_read_mem_reserve(struct inbuf *inb)
9394 +{
9395 +       struct reserve_info *reservelist = NULL;
9396 +       struct reserve_info *new;
9397 +       const char *p;
9398 +       struct fdt_reserve_entry re;
9399 +
9400 +       /*
9401 +        * Each entry is a pair of u64 (addr, size) values for 4 cell_t's.
9402 +        * List terminates at an entry with size equal to zero.
9403 +        *
9404 +        * First pass, count entries.
9405 +        */
9406 +       p = inb->ptr;
9407 +       while (1) {
9408 +               flat_read_chunk(inb, &re, sizeof(re));
9409 +               re.address  = be64_to_cpu(re.address);
9410 +               re.size = be64_to_cpu(re.size);
9411 +               if (re.size == 0)
9412 +                       break;
9413 +
9414 +               new = build_reserve_entry(re.address, re.size, NULL);
9415 +               reservelist = add_reserve_entry(reservelist, new);
9416 +       }
9417 +
9418 +       return reservelist;
9419 +}
9420 +
9421 +
9422 +static char *nodename_from_path(const char *ppath, const char *cpath)
9423 +{
9424 +       const char *lslash;
9425 +       int plen;
9426 +
9427 +       lslash = strrchr(cpath, '/');
9428 +       if (! lslash)
9429 +               return NULL;
9430 +
9431 +       plen = lslash - cpath;
9432 +
9433 +       if (streq(cpath, "/") && streq(ppath, ""))
9434 +               return "";
9435 +
9436 +       if ((plen == 0) && streq(ppath, "/"))
9437 +               return strdup(lslash+1);
9438 +
9439 +       if (! strneq(ppath, cpath, plen))
9440 +               return NULL;
9441 +
9442 +       return strdup(lslash+1);
9443 +}
9444 +
9445 +static const char PROPCHAR[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,._+*#?-";
9446 +static const char UNITCHAR[] = "0123456789abcdef,";
9447 +
9448 +static int check_node_name(const char *name)
9449 +{
9450 +       const char *atpos;
9451 +       int basenamelen;
9452 +
9453 +       atpos = strrchr(name, '@');
9454 +
9455 +       if (atpos)
9456 +               basenamelen = atpos - name;
9457 +       else
9458 +               basenamelen = strlen(name);
9459 +
9460 +       if (strspn(name, PROPCHAR) < basenamelen)
9461 +               return -1;
9462 +
9463 +       if (atpos
9464 +           && ((basenamelen + 1 + strspn(atpos+1, UNITCHAR)) < strlen(name)))
9465 +               return -1;
9466 +
9467 +       return basenamelen;
9468 +}
9469 +
9470 +static struct node *unflatten_tree(struct inbuf *dtbuf,
9471 +                                  struct inbuf *strbuf,
9472 +                                  const char *parent_path, int flags)
9473 +{
9474 +       struct node *node;
9475 +       u32 val;
9476 +
9477 +       node = build_node(NULL, NULL);
9478 +
9479 +       if (flags & FTF_FULLPATH) {
9480 +               node->fullpath = flat_read_string(dtbuf);
9481 +               node->name = nodename_from_path(parent_path, node->fullpath);
9482 +
9483 +               if (! node->name)
9484 +                       die("Path \"%s\" is not valid as a child of \"%s\"\n",
9485 +                           node->fullpath, parent_path);
9486 +       } else {
9487 +               node->name = flat_read_string(dtbuf);
9488 +               node->fullpath = join_path(parent_path, node->name);
9489 +       }
9490 +
9491 +       node->basenamelen = check_node_name(node->name);
9492 +       if (node->basenamelen < 0) {
9493 +               fprintf(stderr, "Warning \"%s\" has incorrect format\n", node->name);
9494 +       }
9495 +
9496 +       do {
9497 +               struct property *prop;
9498 +               struct node *child;
9499 +
9500 +               val = flat_read_word(dtbuf);
9501 +               switch (val) {
9502 +               case FDT_PROP:
9503 +                       if (node->children)
9504 +                               fprintf(stderr, "Warning: Flat tree input has "
9505 +                                       "subnodes preceding a property.\n");
9506 +                       prop = flat_read_property(dtbuf, strbuf, flags);
9507 +                       add_property(node, prop);
9508 +                       break;
9509 +
9510 +               case FDT_BEGIN_NODE:
9511 +                       child = unflatten_tree(dtbuf,strbuf, node->fullpath,
9512 +                                              flags);
9513 +                       add_child(node, child);
9514 +                       break;
9515 +
9516 +               case FDT_END_NODE:
9517 +                       break;
9518 +
9519 +               case FDT_END:
9520 +                       die("Premature FDT_END in device tree blob\n");
9521 +                       break;
9522 +
9523 +               case FDT_NOP:
9524 +                       if (!(flags & FTF_NOPS))
9525 +                               fprintf(stderr, "Warning: NOP tag found in flat tree"
9526 +                                       " version <16\n");
9527 +
9528 +                       /* Ignore */
9529 +                       break;
9530 +
9531 +               default:
9532 +                       die("Invalid opcode word %08x in device tree blob\n",
9533 +                           val);
9534 +               }
9535 +       } while (val != FDT_END_NODE);
9536 +
9537 +       return node;
9538 +}
9539 +
9540 +
9541 +struct boot_info *dt_from_blob(FILE *f)
9542 +{
9543 +       u32 magic, totalsize, version, size_str, size_dt;
9544 +       u32 off_dt, off_str, off_mem_rsvmap;
9545 +       int rc;
9546 +       char *blob;
9547 +       struct fdt_header *fdt;
9548 +       char *p;
9549 +       struct inbuf dtbuf, strbuf;
9550 +       struct inbuf memresvbuf;
9551 +       int sizeleft;
9552 +       struct reserve_info *reservelist;
9553 +       struct node *tree;
9554 +       u32 val;
9555 +       int flags = 0;
9556 +
9557 +       rc = fread(&magic, sizeof(magic), 1, f);
9558 +       if (ferror(f))
9559 +               die("Error reading DT blob magic number: %s\n",
9560 +                   strerror(errno));
9561 +       if (rc < 1) {
9562 +               if (feof(f))
9563 +                       die("EOF reading DT blob magic number\n");
9564 +               else
9565 +                       die("Mysterious short read reading magic number\n");
9566 +       }
9567 +
9568 +       magic = be32_to_cpu(magic);
9569 +       if (magic != FDT_MAGIC)
9570 +               die("Blob has incorrect magic number\n");
9571 +
9572 +       rc = fread(&totalsize, sizeof(totalsize), 1, f);
9573 +       if (ferror(f))
9574 +               die("Error reading DT blob size: %s\n", strerror(errno));
9575 +       if (rc < 1) {
9576 +               if (feof(f))
9577 +                       die("EOF reading DT blob size\n");
9578 +               else
9579 +                       die("Mysterious short read reading blob size\n");
9580 +       }
9581 +
9582 +       totalsize = be32_to_cpu(totalsize);
9583 +       if (totalsize < FDT_V1_SIZE)
9584 +               die("DT blob size (%d) is too small\n", totalsize);
9585 +
9586 +       blob = xmalloc(totalsize);
9587 +
9588 +       fdt = (struct fdt_header *)blob;
9589 +       fdt->magic = cpu_to_be32(magic);
9590 +       fdt->totalsize = cpu_to_be32(totalsize);
9591 +
9592 +       sizeleft = totalsize - sizeof(magic) - sizeof(totalsize);
9593 +       p = blob + sizeof(magic)  + sizeof(totalsize);
9594 +
9595 +       while (sizeleft) {
9596 +               if (feof(f))
9597 +                       die("EOF before reading %d bytes of DT blob\n",
9598 +                           totalsize);
9599 +
9600 +               rc = fread(p, 1, sizeleft, f);
9601 +               if (ferror(f))
9602 +                       die("Error reading DT blob: %s\n",
9603 +                           strerror(errno));
9604 +
9605 +               sizeleft -= rc;
9606 +               p += rc;
9607 +       }
9608 +
9609 +       off_dt = be32_to_cpu(fdt->off_dt_struct);
9610 +       off_str = be32_to_cpu(fdt->off_dt_strings);
9611 +       off_mem_rsvmap = be32_to_cpu(fdt->off_mem_rsvmap);
9612 +       version = be32_to_cpu(fdt->version);
9613 +
9614 +       fprintf(stderr, "\tmagic:\t\t\t0x%x\n", magic);
9615 +       fprintf(stderr, "\ttotalsize:\t\t%d\n", totalsize);
9616 +       fprintf(stderr, "\toff_dt_struct:\t\t0x%x\n", off_dt);
9617 +       fprintf(stderr, "\toff_dt_strings:\t\t0x%x\n", off_str);
9618 +       fprintf(stderr, "\toff_mem_rsvmap:\t\t0x%x\n", off_mem_rsvmap);
9619 +       fprintf(stderr, "\tversion:\t\t0x%x\n", version );
9620 +       fprintf(stderr, "\tlast_comp_version:\t0x%x\n",
9621 +               be32_to_cpu(fdt->last_comp_version));
9622 +
9623 +       if (off_mem_rsvmap >= totalsize)
9624 +               die("Mem Reserve structure offset exceeds total size\n");
9625 +
9626 +       if (off_dt >= totalsize)
9627 +               die("DT structure offset exceeds total size\n");
9628 +
9629 +       if (off_str > totalsize)
9630 +               die("String table offset exceeds total size\n");
9631 +
9632 +       if (version >= 2)
9633 +               fprintf(stderr, "\tboot_cpuid_phys:\t0x%x\n",
9634 +                       be32_to_cpu(fdt->boot_cpuid_phys));
9635 +
9636 +       size_str = -1;
9637 +       if (version >= 3) {
9638 +               size_str = be32_to_cpu(fdt->size_dt_strings);
9639 +               fprintf(stderr, "\tsize_dt_strings:\t%d\n", size_str);
9640 +               if (off_str+size_str > totalsize)
9641 +                       die("String table extends past total size\n");
9642 +       }
9643 +
9644 +       if (version >= 17) {
9645 +               size_dt = be32_to_cpu(fdt->size_dt_struct);
9646 +               fprintf(stderr, "\tsize_dt_struct:\t\t%d\n", size_dt);
9647 +               if (off_dt+size_dt > totalsize)
9648 +                       die("Structure block extends past total size\n");
9649 +       }
9650 +
9651 +       if (version < 16) {
9652 +               flags |= FTF_FULLPATH | FTF_NAMEPROPS | FTF_VARALIGN;
9653 +       } else {
9654 +               flags |= FTF_NOPS;
9655 +       }
9656 +
9657 +       inbuf_init(&memresvbuf,
9658 +                  blob + off_mem_rsvmap, blob + totalsize);
9659 +       inbuf_init(&dtbuf, blob + off_dt, blob + totalsize);
9660 +       if (size_str >= 0)
9661 +               inbuf_init(&strbuf, blob + off_str, blob + off_str + size_str);
9662 +       else
9663 +               inbuf_init(&strbuf, blob + off_str, blob + totalsize);
9664 +
9665 +       reservelist = flat_read_mem_reserve(&memresvbuf);
9666 +
9667 +       val = flat_read_word(&dtbuf);
9668 +
9669 +       if (val != FDT_BEGIN_NODE)
9670 +               die("Device tree blob doesn't begin with FDT_BEGIN_NODE (begins with 0x%08x)\n", val);
9671 +
9672 +       tree = unflatten_tree(&dtbuf, &strbuf, "", flags);
9673 +
9674 +       val = flat_read_word(&dtbuf);
9675 +       if (val != FDT_END)
9676 +               die("Device tree blob doesn't end with FDT_END\n");
9677 +
9678 +       free(blob);
9679 +
9680 +       return build_boot_info(reservelist, tree);
9681 +}
9682 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dtc-src/fstree.c powerpc.git/arch/powerpc/boot/dtc-src/fstree.c
9683 --- linux-2.6.24/arch/powerpc/boot/dtc-src/fstree.c     1970-01-01 01:00:00.000000000 +0100
9684 +++ powerpc.git/arch/powerpc/boot/dtc-src/fstree.c      2008-01-28 20:25:49.000000000 +0100
9685 @@ -0,0 +1,94 @@
9686 +/*
9687 + * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
9688 + *
9689 + *
9690 + * This program is free software; you can redistribute it and/or
9691 + * modify it under the terms of the GNU General Public License as
9692 + * published by the Free Software Foundation; either version 2 of the
9693 + * License, or (at your option) any later version.
9694 + *
9695 + *  This program is distributed in the hope that it will be useful,
9696 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
9697 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
9698 + *  General Public License for more details.
9699 + *
9700 + *  You should have received a copy of the GNU General Public License
9701 + *  along with this program; if not, write to the Free Software
9702 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
9703 + *                                                                   USA
9704 + */
9705 +
9706 +#include "dtc.h"
9707 +
9708 +#include <dirent.h>
9709 +#include <sys/stat.h>
9710 +
9711 +static struct node *read_fstree(const char *dirname)
9712 +{
9713 +       DIR *d;
9714 +       struct dirent *de;
9715 +       struct stat st;
9716 +       struct node *tree;
9717 +
9718 +       d = opendir(dirname);
9719 +       if (! d)
9720 +               die("opendir(): %s\n", strerror(errno));
9721 +
9722 +       tree = build_node(NULL, NULL);
9723 +
9724 +       while ((de = readdir(d)) != NULL) {
9725 +               char *tmpnam;
9726 +
9727 +               if (streq(de->d_name, ".")
9728 +                   || streq(de->d_name, ".."))
9729 +                       continue;
9730 +
9731 +               tmpnam = join_path(dirname, de->d_name);
9732 +
9733 +               if (lstat(tmpnam, &st) < 0)
9734 +                       die("stat(%s): %s\n", tmpnam, strerror(errno));
9735 +
9736 +               if (S_ISREG(st.st_mode)) {
9737 +                       struct property *prop;
9738 +                       FILE *pfile;
9739 +
9740 +                       pfile = fopen(tmpnam, "r");
9741 +                       if (! pfile) {
9742 +                               fprintf(stderr,
9743 +                                       "WARNING: Cannot open %s: %s\n",
9744 +                                       tmpnam, strerror(errno));
9745 +                       } else {
9746 +                               prop = build_property(strdup(de->d_name),
9747 +                                                     data_copy_file(pfile,
9748 +                                                                    st.st_size),
9749 +                                                     NULL);
9750 +                               add_property(tree, prop);
9751 +                               fclose(pfile);
9752 +                       }
9753 +               } else if (S_ISDIR(st.st_mode)) {
9754 +                       struct node *newchild;
9755 +
9756 +                       newchild = read_fstree(tmpnam);
9757 +                       newchild = name_node(newchild, strdup(de->d_name),
9758 +                                            NULL);
9759 +                       add_child(tree, newchild);
9760 +               }
9761 +
9762 +               free(tmpnam);
9763 +       }
9764 +
9765 +       return tree;
9766 +}
9767 +
9768 +struct boot_info *dt_from_fs(const char *dirname)
9769 +{
9770 +       struct node *tree;
9771 +
9772 +       tree = read_fstree(dirname);
9773 +       tree = name_node(tree, "", NULL);
9774 +
9775 +       fill_fullpaths(tree, "");
9776 +
9777 +       return build_boot_info(NULL, tree);
9778 +}
9779 +
9780 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dtc-src/livetree.c powerpc.git/arch/powerpc/boot/dtc-src/livetree.c
9781 --- linux-2.6.24/arch/powerpc/boot/dtc-src/livetree.c   1970-01-01 01:00:00.000000000 +0100
9782 +++ powerpc.git/arch/powerpc/boot/dtc-src/livetree.c    2008-01-28 20:25:49.000000000 +0100
9783 @@ -0,0 +1,305 @@
9784 +/*
9785 + * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
9786 + *
9787 + *
9788 + * This program is free software; you can redistribute it and/or
9789 + * modify it under the terms of the GNU General Public License as
9790 + * published by the Free Software Foundation; either version 2 of the
9791 + * License, or (at your option) any later version.
9792 + *
9793 + *  This program is distributed in the hope that it will be useful,
9794 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
9795 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
9796 + *  General Public License for more details.
9797 + *
9798 + *  You should have received a copy of the GNU General Public License
9799 + *  along with this program; if not, write to the Free Software
9800 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
9801 + *                                                                   USA
9802 + */
9803 +
9804 +#include "dtc.h"
9805 +
9806 +/*
9807 + * Tree building functions
9808 + */
9809 +
9810 +struct property *build_property(char *name, struct data val, char *label)
9811 +{
9812 +       struct property *new = xmalloc(sizeof(*new));
9813 +
9814 +       new->name = name;
9815 +       new->val = val;
9816 +
9817 +       new->next = NULL;
9818 +
9819 +       new->label = label;
9820 +
9821 +       return new;
9822 +}
9823 +
9824 +struct property *chain_property(struct property *first, struct property *list)
9825 +{
9826 +       assert(first->next == NULL);
9827 +
9828 +       first->next = list;
9829 +       return first;
9830 +}
9831 +
9832 +struct property *reverse_properties(struct property *first)
9833 +{
9834 +       struct property *p = first;
9835 +       struct property *head = NULL;
9836 +       struct property *next;
9837 +
9838 +       while (p) {
9839 +               next = p->next;
9840 +               p->next = head;
9841 +               head = p;
9842 +               p = next;
9843 +       }
9844 +       return head;
9845 +}
9846 +
9847 +struct node *build_node(struct property *proplist, struct node *children)
9848 +{
9849 +       struct node *new = xmalloc(sizeof(*new));
9850 +       struct node *child;
9851 +
9852 +       memset(new, 0, sizeof(*new));
9853 +
9854 +       new->proplist = reverse_properties(proplist);
9855 +       new->children = children;
9856 +
9857 +       for_each_child(new, child) {
9858 +               child->parent = new;
9859 +       }
9860 +
9861 +       return new;
9862 +}
9863 +
9864 +struct node *name_node(struct node *node, char *name, char * label)
9865 +{
9866 +       assert(node->name == NULL);
9867 +
9868 +       node->name = name;
9869 +
9870 +       node->label = label;
9871 +
9872 +       return node;
9873 +}
9874 +
9875 +struct node *chain_node(struct node *first, struct node *list)
9876 +{
9877 +       assert(first->next_sibling == NULL);
9878 +
9879 +       first->next_sibling = list;
9880 +       return first;
9881 +}
9882 +
9883 +void add_property(struct node *node, struct property *prop)
9884 +{
9885 +       struct property **p;
9886 +
9887 +       prop->next = NULL;
9888 +
9889 +       p = &node->proplist;
9890 +       while (*p)
9891 +               p = &((*p)->next);
9892 +
9893 +       *p = prop;
9894 +}
9895 +
9896 +void add_child(struct node *parent, struct node *child)
9897 +{
9898 +       struct node **p;
9899 +
9900 +       child->next_sibling = NULL;
9901 +
9902 +       p = &parent->children;
9903 +       while (*p)
9904 +               p = &((*p)->next_sibling);
9905 +
9906 +       *p = child;
9907 +}
9908 +
9909 +struct reserve_info *build_reserve_entry(u64 address, u64 size, char *label)
9910 +{
9911 +       struct reserve_info *new = xmalloc(sizeof(*new));
9912 +
9913 +       new->re.address = address;
9914 +       new->re.size = size;
9915 +
9916 +       new->next = NULL;
9917 +
9918 +       new->label = label;
9919 +
9920 +       return new;
9921 +}
9922 +
9923 +struct reserve_info *chain_reserve_entry(struct reserve_info *first,
9924 +                                       struct reserve_info *list)
9925 +{
9926 +       assert(first->next == NULL);
9927 +
9928 +       first->next = list;
9929 +       return first;
9930 +}
9931 +
9932 +struct reserve_info *add_reserve_entry(struct reserve_info *list,
9933 +                                     struct reserve_info *new)
9934 +{
9935 +       struct reserve_info *last;
9936 +
9937 +       new->next = NULL;
9938 +
9939 +       if (! list)
9940 +               return new;
9941 +
9942 +       for (last = list; last->next; last = last->next)
9943 +               ;
9944 +
9945 +       last->next = new;
9946 +
9947 +       return list;
9948 +}
9949 +
9950 +struct boot_info *build_boot_info(struct reserve_info *reservelist,
9951 +                                 struct node *tree)
9952 +{
9953 +       struct boot_info *bi;
9954 +
9955 +       bi = xmalloc(sizeof(*bi));
9956 +       bi->reservelist = reservelist;
9957 +       bi->dt = tree;
9958 +
9959 +       return bi;
9960 +}
9961 +
9962 +/*
9963 + * Tree accessor functions
9964 + */
9965 +
9966 +const char *get_unitname(struct node *node)
9967 +{
9968 +       if (node->name[node->basenamelen] == '\0')
9969 +               return "";
9970 +       else
9971 +               return node->name + node->basenamelen + 1;
9972 +}
9973 +
9974 +struct property *get_property(struct node *node, const char *propname)
9975 +{
9976 +       struct property *prop;
9977 +
9978 +       for_each_property(node, prop)
9979 +               if (streq(prop->name, propname))
9980 +                       return prop;
9981 +
9982 +       return NULL;
9983 +}
9984 +
9985 +cell_t propval_cell(struct property *prop)
9986 +{
9987 +       assert(prop->val.len == sizeof(cell_t));
9988 +       return be32_to_cpu(*((cell_t *)prop->val.val));
9989 +}
9990 +
9991 +struct node *get_subnode(struct node *node, const char *nodename)
9992 +{
9993 +       struct node *child;
9994 +
9995 +       for_each_child(node, child)
9996 +               if (streq(child->name, nodename))
9997 +                       return child;
9998 +
9999 +       return NULL;
10000 +}
10001 +
10002 +struct node *get_node_by_path(struct node *tree, const char *path)
10003 +{
10004 +       const char *p;
10005 +       struct node *child;
10006 +
10007 +       if (!path || ! (*path))
10008 +               return tree;
10009 +
10010 +       while (path[0] == '/')
10011 +               path++;
10012 +
10013 +       p = strchr(path, '/');
10014 +
10015 +       for_each_child(tree, child) {
10016 +               if (p && strneq(path, child->name, p-path))
10017 +                       return get_node_by_path(child, p+1);
10018 +               else if (!p && streq(path, child->name))
10019 +                       return child;
10020 +       }
10021 +
10022 +       return NULL;
10023 +}
10024 +
10025 +struct node *get_node_by_label(struct node *tree, const char *label)
10026 +{
10027 +       struct node *child, *node;
10028 +
10029 +       assert(label && (strlen(label) > 0));
10030 +
10031 +       if (tree->label && streq(tree->label, label))
10032 +               return tree;
10033 +
10034 +       for_each_child(tree, child) {
10035 +               node = get_node_by_label(child, label);
10036 +               if (node)
10037 +                       return node;
10038 +       }
10039 +
10040 +       return NULL;
10041 +}
10042 +
10043 +struct node *get_node_by_phandle(struct node *tree, cell_t phandle)
10044 +{
10045 +       struct node *child, *node;
10046 +
10047 +       assert((phandle != 0) && (phandle != -1));
10048 +
10049 +       if (tree->phandle == phandle)
10050 +               return tree;
10051 +
10052 +       for_each_child(tree, child) {
10053 +               node = get_node_by_phandle(child, phandle);
10054 +               if (node)
10055 +                       return node;
10056 +       }
10057 +
10058 +       return NULL;
10059 +}
10060 +
10061 +struct node *get_node_by_ref(struct node *tree, const char *ref)
10062 +{
10063 +       if (ref[0] == '/')
10064 +               return get_node_by_path(tree, ref);
10065 +       else
10066 +               return get_node_by_label(tree, ref);
10067 +}
10068 +
10069 +cell_t get_node_phandle(struct node *root, struct node *node)
10070 +{
10071 +       static cell_t phandle = 1; /* FIXME: ick, static local */
10072 +
10073 +       if ((node->phandle != 0) && (node->phandle != -1))
10074 +               return node->phandle;
10075 +
10076 +       assert(! get_property(node, "linux,phandle"));
10077 +
10078 +       while (get_node_by_phandle(root, phandle))
10079 +               phandle++;
10080 +
10081 +       node->phandle = phandle;
10082 +       add_property(node,
10083 +                    build_property("linux,phandle",
10084 +                                   data_append_cell(empty_data, phandle),
10085 +                                   NULL));
10086 +
10087 +       return node->phandle;
10088 +}
10089 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dtc-src/srcpos.c powerpc.git/arch/powerpc/boot/dtc-src/srcpos.c
10090 --- linux-2.6.24/arch/powerpc/boot/dtc-src/srcpos.c     1970-01-01 01:00:00.000000000 +0100
10091 +++ powerpc.git/arch/powerpc/boot/dtc-src/srcpos.c      2008-01-28 20:25:49.000000000 +0100
10092 @@ -0,0 +1,105 @@
10093 +/*
10094 + * Copyright 2007 Jon Loeliger, Freescale Semiconductor, Inc.
10095 + *
10096 + * This program is free software; you can redistribute it and/or
10097 + * modify it under the terms of the GNU General Public License as
10098 + * published by the Free Software Foundation; either version 2 of the
10099 + * License, or (at your option) any later version.
10100 + *
10101 + *  This program is distributed in the hope that it will be useful,
10102 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
10103 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
10104 + *  General Public License for more details.
10105 + *
10106 + *  You should have received a copy of the GNU General Public License
10107 + *  along with this program; if not, write to the Free Software
10108 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
10109 + *                                                                   USA
10110 + */
10111 +
10112 +#include "dtc.h"
10113 +#include "srcpos.h"
10114 +
10115 +
10116 +/*
10117 + * Record the complete unique set of opened file names.
10118 + * Primarily used to cache source position file names.
10119 + */
10120 +#define MAX_N_FILE_NAMES       (100)
10121 +
10122 +const char *file_names[MAX_N_FILE_NAMES];
10123 +static int n_file_names = 0;
10124 +
10125 +/*
10126 + * Like yylineno, this is the current open file pos.
10127 + */
10128 +
10129 +int srcpos_filenum = -1;
10130 +
10131 +
10132 +
10133 +FILE *dtc_open_file(const char *fname)
10134 +{
10135 +       FILE *f;
10136 +
10137 +       if (lookup_file_name(fname, 1) < 0)
10138 +               die("Too many files opened\n");
10139 +
10140 +       if (streq(fname, "-"))
10141 +               f = stdin;
10142 +       else
10143 +               f = fopen(fname, "r");
10144 +
10145 +       if (! f)
10146 +               die("Couldn't open \"%s\": %s\n", fname, strerror(errno));
10147 +
10148 +       return f;
10149 +}
10150 +
10151 +
10152 +
10153 +/*
10154 + * Locate and optionally add filename fname in the file_names[] array.
10155 + *
10156 + * If the filename is currently not in the array and the boolean
10157 + * add_it is non-zero, an attempt to add the filename will be made.
10158 + *
10159 + * Returns;
10160 + *    Index [0..MAX_N_FILE_NAMES) where the filename is kept
10161 + *    -1 if the name can not be recorded
10162 + */
10163 +
10164 +int lookup_file_name(const char *fname, int add_it)
10165 +{
10166 +       int i;
10167 +
10168 +       for (i = 0; i < n_file_names; i++) {
10169 +               if (strcmp(file_names[i], fname) == 0)
10170 +                       return i;
10171 +       }
10172 +
10173 +       if (add_it) {
10174 +               if (n_file_names < MAX_N_FILE_NAMES) {
10175 +                       file_names[n_file_names] = strdup(fname);
10176 +                       return n_file_names++;
10177 +               }
10178 +       }
10179 +
10180 +       return -1;
10181 +}
10182 +
10183 +
10184 +const char *srcpos_filename_for_num(int filenum)
10185 +{
10186 +       if (0 <= filenum && filenum < n_file_names) {
10187 +               return file_names[filenum];
10188 +       }
10189 +
10190 +       return 0;
10191 +}
10192 +
10193 +
10194 +const char *srcpos_get_filename(void)
10195 +{
10196 +       return srcpos_filename_for_num(srcpos_filenum);
10197 +}
10198 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dtc-src/srcpos.h powerpc.git/arch/powerpc/boot/dtc-src/srcpos.h
10199 --- linux-2.6.24/arch/powerpc/boot/dtc-src/srcpos.h     1970-01-01 01:00:00.000000000 +0100
10200 +++ powerpc.git/arch/powerpc/boot/dtc-src/srcpos.h      2008-01-28 20:25:49.000000000 +0100
10201 @@ -0,0 +1,75 @@
10202 +/*
10203 + * Copyright 2007 Jon Loeliger, Freescale Semiconductor, Inc.
10204 + *
10205 + * This program is free software; you can redistribute it and/or
10206 + * modify it under the terms of the GNU General Public License as
10207 + * published by the Free Software Foundation; either version 2 of the
10208 + * License, or (at your option) any later version.
10209 + *
10210 + *  This program is distributed in the hope that it will be useful,
10211 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
10212 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
10213 + *  General Public License for more details.
10214 + *
10215 + *  You should have received a copy of the GNU General Public License
10216 + *  along with this program; if not, write to the Free Software
10217 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
10218 + *                                                                   USA
10219 + */
10220 +
10221 +/*
10222 + * Augment the standard YYLTYPE with a filenum index into an
10223 + * array of all opened filenames.
10224 + */
10225 +
10226 +#if ! defined(YYLTYPE) && ! defined(YYLTYPE_IS_DECLARED)
10227 +typedef struct YYLTYPE {
10228 +    int first_line;
10229 +    int first_column;
10230 +    int last_line;
10231 +    int last_column;
10232 +    int filenum;
10233 +} YYLTYPE;
10234 +
10235 +#define YYLTYPE_IS_DECLARED    1
10236 +#define YYLTYPE_IS_TRIVIAL     1
10237 +#endif
10238 +
10239 +/* Cater to old parser templates. */
10240 +#ifndef YYID
10241 +#define YYID(n)        (n)
10242 +#endif
10243 +
10244 +#define YYLLOC_DEFAULT(Current, Rhs, N)                                        \
10245 +    do                                                                 \
10246 +      if (YYID (N))                                                    \
10247 +       {                                                               \
10248 +         (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
10249 +         (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
10250 +         (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
10251 +         (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
10252 +         (Current).filenum      = YYRHSLOC (Rhs, N).filenum;           \
10253 +       }                                                               \
10254 +      else                                                             \
10255 +       {                                                               \
10256 +         (Current).first_line   = (Current).last_line   =              \
10257 +           YYRHSLOC (Rhs, 0).last_line;                                \
10258 +         (Current).first_column = (Current).last_column =              \
10259 +           YYRHSLOC (Rhs, 0).last_column;                              \
10260 +         (Current).filenum      = YYRHSLOC (Rhs, 0).filenum;           \
10261 +       }                                                               \
10262 +    while (YYID (0))
10263 +
10264 +
10265 +
10266 +extern void yyerror(char const *);
10267 +
10268 +extern int srcpos_filenum;
10269 +
10270 +extern int push_input_file(const char *filename);
10271 +extern int pop_input_file(void);
10272 +
10273 +extern FILE *dtc_open_file(const char *fname);
10274 +extern int lookup_file_name(const char *fname, int add_it);
10275 +extern const char *srcpos_filename_for_num(int filenum);
10276 +const char *srcpos_get_filename(void);
10277 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dtc-src/treesource.c powerpc.git/arch/powerpc/boot/dtc-src/treesource.c
10278 --- linux-2.6.24/arch/powerpc/boot/dtc-src/treesource.c 1970-01-01 01:00:00.000000000 +0100
10279 +++ powerpc.git/arch/powerpc/boot/dtc-src/treesource.c  2008-01-28 20:25:49.000000000 +0100
10280 @@ -0,0 +1,275 @@
10281 +/*
10282 + * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
10283 + *
10284 + *
10285 + * This program is free software; you can redistribute it and/or
10286 + * modify it under the terms of the GNU General Public License as
10287 + * published by the Free Software Foundation; either version 2 of the
10288 + * License, or (at your option) any later version.
10289 + *
10290 + *  This program is distributed in the hope that it will be useful,
10291 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
10292 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
10293 + *  General Public License for more details.
10294 + *
10295 + *  You should have received a copy of the GNU General Public License
10296 + *  along with this program; if not, write to the Free Software
10297 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
10298 + *                                                                   USA
10299 + */
10300 +
10301 +#include "dtc.h"
10302 +#include "srcpos.h"
10303 +
10304 +extern FILE *yyin;
10305 +extern int yyparse(void);
10306 +extern void yyerror(char const *);
10307 +
10308 +struct boot_info *the_boot_info;
10309 +
10310 +struct boot_info *dt_from_source(const char *fname)
10311 +{
10312 +       the_boot_info = NULL;
10313 +
10314 +       push_input_file(fname);
10315 +
10316 +       if (yyparse() != 0)
10317 +               return NULL;
10318 +
10319 +       fill_fullpaths(the_boot_info->dt, "");
10320 +
10321 +       return the_boot_info;
10322 +}
10323 +
10324 +static void write_prefix(FILE *f, int level)
10325 +{
10326 +       int i;
10327 +
10328 +       for (i = 0; i < level; i++)
10329 +               fputc('\t', f);
10330 +}
10331 +
10332 +int isstring(char c)
10333 +{
10334 +       return (isprint(c)
10335 +               || (c == '\0')
10336 +               || strchr("\a\b\t\n\v\f\r", c));
10337 +}
10338 +
10339 +static void write_propval_string(FILE *f, struct data val)
10340 +{
10341 +       const char *str = val.val;
10342 +       int i;
10343 +       int newchunk = 1;
10344 +       struct marker *m = val.markers;
10345 +
10346 +       assert(str[val.len-1] == '\0');
10347 +
10348 +       for (i = 0; i < (val.len-1); i++) {
10349 +               char c = str[i];
10350 +
10351 +               if (newchunk) {
10352 +                       while (m && (m->offset <= i)) {
10353 +                               if (m->type == LABEL) {
10354 +                                       assert(m->offset == i);
10355 +                                       fprintf(f, "%s: ", m->ref);
10356 +                               }
10357 +                               m = m->next;
10358 +                       }
10359 +                       fprintf(f, "\"");
10360 +                       newchunk = 0;
10361 +               }
10362 +
10363 +               switch (c) {
10364 +               case '\a':
10365 +                       fprintf(f, "\\a");
10366 +                       break;
10367 +               case '\b':
10368 +                       fprintf(f, "\\b");
10369 +                       break;
10370 +               case '\t':
10371 +                       fprintf(f, "\\t");
10372 +                       break;
10373 +               case '\n':
10374 +                       fprintf(f, "\\n");
10375 +                       break;
10376 +               case '\v':
10377 +                       fprintf(f, "\\v");
10378 +                       break;
10379 +               case '\f':
10380 +                       fprintf(f, "\\f");
10381 +                       break;
10382 +               case '\r':
10383 +                       fprintf(f, "\\r");
10384 +                       break;
10385 +               case '\\':
10386 +                       fprintf(f, "\\\\");
10387 +                       break;
10388 +               case '\"':
10389 +                       fprintf(f, "\\\"");
10390 +                       break;
10391 +               case '\0':
10392 +                       fprintf(f, "\", ");
10393 +                       newchunk = 1;
10394 +                       break;
10395 +               default:
10396 +                       if (isprint(c))
10397 +                               fprintf(f, "%c", c);
10398 +                       else
10399 +                               fprintf(f, "\\x%02hhx", c);
10400 +               }
10401 +       }
10402 +       fprintf(f, "\"");
10403 +
10404 +       /* Wrap up any labels at the end of the value */
10405 +       for_each_marker_of_type(m, LABEL) {
10406 +               assert (m->offset == val.len);
10407 +               fprintf(f, " %s:", m->ref);
10408 +       }
10409 +}
10410 +
10411 +static void write_propval_cells(FILE *f, struct data val)
10412 +{
10413 +       void *propend = val.val + val.len;
10414 +       cell_t *cp = (cell_t *)val.val;
10415 +       struct marker *m = val.markers;
10416 +
10417 +       fprintf(f, "<");
10418 +       for (;;) {
10419 +               while (m && (m->offset <= ((char *)cp - val.val))) {
10420 +                       if (m->type == LABEL) {
10421 +                               assert(m->offset == ((char *)cp - val.val));
10422 +                               fprintf(f, "%s: ", m->ref);
10423 +                       }
10424 +                       m = m->next;
10425 +               }
10426 +
10427 +               fprintf(f, "0x%x", be32_to_cpu(*cp++));
10428 +               if ((void *)cp >= propend)
10429 +                       break;
10430 +               fprintf(f, " ");
10431 +       }
10432 +
10433 +       /* Wrap up any labels at the end of the value */
10434 +       for_each_marker_of_type(m, LABEL) {
10435 +               assert (m->offset == val.len);
10436 +               fprintf(f, " %s:", m->ref);
10437 +       }
10438 +       fprintf(f, ">");
10439 +}
10440 +
10441 +static void write_propval_bytes(FILE *f, struct data val)
10442 +{
10443 +       void *propend = val.val + val.len;
10444 +       const char *bp = val.val;
10445 +       struct marker *m = val.markers;
10446 +
10447 +       fprintf(f, "[");
10448 +       for (;;) {
10449 +               while (m && (m->offset == (bp-val.val))) {
10450 +                       if (m->type == LABEL)
10451 +                               fprintf(f, "%s: ", m->ref);
10452 +                       m = m->next;
10453 +               }
10454 +
10455 +               fprintf(f, "%02hhx", *bp++);
10456 +               if ((void *)bp >= propend)
10457 +                       break;
10458 +               fprintf(f, " ");
10459 +       }
10460 +
10461 +       /* Wrap up any labels at the end of the value */
10462 +       for_each_marker_of_type(m, LABEL) {
10463 +               assert (m->offset == val.len);
10464 +               fprintf(f, " %s:", m->ref);
10465 +       }
10466 +       fprintf(f, "]");
10467 +}
10468 +
10469 +static void write_propval(FILE *f, struct property *prop)
10470 +{
10471 +       int len = prop->val.len;
10472 +       const char *p = prop->val.val;
10473 +       struct marker *m = prop->val.markers;
10474 +       int nnotstring = 0, nnul = 0;
10475 +       int nnotstringlbl = 0, nnotcelllbl = 0;
10476 +       int i;
10477 +
10478 +       if (len == 0) {
10479 +               fprintf(f, ";\n");
10480 +               return;
10481 +       }
10482 +
10483 +       for (i = 0; i < len; i++) {
10484 +               if (! isstring(p[i]))
10485 +                       nnotstring++;
10486 +               if (p[i] == '\0')
10487 +                       nnul++;
10488 +       }
10489 +
10490 +       for_each_marker_of_type(m, LABEL) {
10491 +               if ((m->offset > 0) && (prop->val.val[m->offset - 1] != '\0'))
10492 +                       nnotstringlbl++;
10493 +               if ((m->offset % sizeof(cell_t)) != 0)
10494 +                       nnotcelllbl++;
10495 +       }
10496 +
10497 +       fprintf(f, " = ");
10498 +       if ((p[len-1] == '\0') && (nnotstring == 0) && (nnul < (len-nnul))
10499 +           && (nnotstringlbl == 0)) {
10500 +               write_propval_string(f, prop->val);
10501 +       } else if (((len % sizeof(cell_t)) == 0) && (nnotcelllbl == 0)) {
10502 +               write_propval_cells(f, prop->val);
10503 +       } else {
10504 +               write_propval_bytes(f, prop->val);
10505 +       }
10506 +
10507 +       fprintf(f, ";\n");
10508 +}
10509 +
10510 +static void write_tree_source_node(FILE *f, struct node *tree, int level)
10511 +{
10512 +       struct property *prop;
10513 +       struct node *child;
10514 +
10515 +       write_prefix(f, level);
10516 +       if (tree->label)
10517 +               fprintf(f, "%s: ", tree->label);
10518 +       if (tree->name && (*tree->name))
10519 +               fprintf(f, "%s {\n", tree->name);
10520 +       else
10521 +               fprintf(f, "/ {\n");
10522 +
10523 +       for_each_property(tree, prop) {
10524 +               write_prefix(f, level+1);
10525 +               if (prop->label)
10526 +                       fprintf(f, "%s: ", prop->label);
10527 +               fprintf(f, "%s", prop->name);
10528 +               write_propval(f, prop);
10529 +       }
10530 +       for_each_child(tree, child) {
10531 +               fprintf(f, "\n");
10532 +               write_tree_source_node(f, child, level+1);
10533 +       }
10534 +       write_prefix(f, level);
10535 +       fprintf(f, "};\n");
10536 +}
10537 +
10538 +
10539 +void dt_to_source(FILE *f, struct boot_info *bi)
10540 +{
10541 +       struct reserve_info *re;
10542 +
10543 +       fprintf(f, "/dts-v1/;\n\n");
10544 +
10545 +       for (re = bi->reservelist; re; re = re->next) {
10546 +               if (re->label)
10547 +                       fprintf(f, "%s: ", re->label);
10548 +               fprintf(f, "/memreserve/\t0x%016llx 0x%016llx;\n",
10549 +                       (unsigned long long)re->re.address,
10550 +                       (unsigned long long)re->re.size);
10551 +       }
10552 +
10553 +       write_tree_source_node(f, bi->dt, 0);
10554 +}
10555 +
10556 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dtc-src/version_gen.h powerpc.git/arch/powerpc/boot/dtc-src/version_gen.h
10557 --- linux-2.6.24/arch/powerpc/boot/dtc-src/version_gen.h        1970-01-01 01:00:00.000000000 +0100
10558 +++ powerpc.git/arch/powerpc/boot/dtc-src/version_gen.h 2008-01-28 20:25:49.000000000 +0100
10559 @@ -0,0 +1 @@
10560 +#define DTC_VERSION "DTC 1.0.0-gd6f9b62f"
10561 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/adder875-redboot.dts powerpc.git/arch/powerpc/boot/dts/adder875-redboot.dts
10562 --- linux-2.6.24/arch/powerpc/boot/dts/adder875-redboot.dts     1970-01-01 01:00:00.000000000 +0100
10563 +++ powerpc.git/arch/powerpc/boot/dts/adder875-redboot.dts      2008-01-28 20:25:49.000000000 +0100
10564 @@ -0,0 +1,184 @@
10565 +/*
10566 + * Device Tree Source for MPC885 ADS running RedBoot
10567 + *
10568 + * Copyright 2006 MontaVista Software, Inc.
10569 + * Copyright 2007 Freescale Semiconductor, Inc.
10570 + *
10571 + * This program is free software; you can redistribute  it and/or modify it
10572 + * under  the terms of  the GNU General  Public License as published by the
10573 + * Free Software Foundation;  either version 2 of the  License, or (at your
10574 + * option) any later version.
10575 + */
10576 +
10577 +/dts-v1/;
10578 +/ {
10579 +       model = "Analogue & Micro Adder MPC875";
10580 +       compatible = "analogue-and-micro,adder875";
10581 +       #address-cells = <1>;
10582 +       #size-cells = <1>;
10583 +
10584 +       aliases {
10585 +               console = &console;
10586 +               ethernet0 = &eth0;
10587 +               ethernet1 = &eth1;
10588 +       };
10589 +
10590 +       cpus {
10591 +               #address-cells = <1>;
10592 +               #size-cells = <0>;
10593 +
10594 +               PowerPC,875@0 {
10595 +                       device_type = "cpu";
10596 +                       reg = <0>;
10597 +                       d-cache-line-size = <16>;
10598 +                       i-cache-line-size = <16>;
10599 +                       d-cache-size = <8192>;
10600 +                       i-cache-size = <8192>;
10601 +                       timebase-frequency = <0>;
10602 +                       bus-frequency = <0>;
10603 +                       clock-frequency = <0>;
10604 +                       interrupts = <15 2>;    // decrementer interrupt
10605 +                       interrupt-parent = <&PIC>;
10606 +               };
10607 +       };
10608 +
10609 +       memory {
10610 +               device_type = "memory";
10611 +               reg = <0 0x01000000>;
10612 +       };
10613 +
10614 +       localbus@fa200100 {
10615 +               compatible = "fsl,mpc885-localbus", "fsl,pq1-localbus",
10616 +                            "simple-bus";
10617 +               #address-cells = <2>;
10618 +               #size-cells = <1>;
10619 +               reg = <0xfa200100 0x40>;
10620 +
10621 +               ranges = <
10622 +                       0 0 0xfe000000 0x00800000
10623 +                       2 0 0xfa100000 0x00008000
10624 +               >;
10625 +
10626 +               flash@0,0 {
10627 +                       compatible = "cfi-flash";
10628 +                       reg = <0 0 0x800000>;
10629 +                       bank-width = <2>;
10630 +                       device-width = <2>;
10631 +               };
10632 +       };
10633 +
10634 +       soc@fa200000 {
10635 +               compatible = "fsl,mpc875-immr", "fsl,pq1-soc", "simple-bus";
10636 +               #address-cells = <1>;
10637 +               #size-cells = <1>;
10638 +               ranges = <0 0xfa200000 0x00004000>;
10639 +
10640 +               // Temporary until code stops depending on it.
10641 +               device_type = "soc";
10642 +
10643 +               // Temporary until get_immrbase() is fixed.
10644 +               reg = <0xfa200000 0x4000>;
10645 +
10646 +               mdio@e00 {
10647 +                       compatible = "fsl,mpc875-fec-mdio", "fsl,pq1-fec-mdio";
10648 +                       reg = <0xe00 0x188>;
10649 +                       #address-cells = <1>;
10650 +                       #size-cells = <0>;
10651 +
10652 +                       PHY0: ethernet-phy@0 {
10653 +                               reg = <0>;
10654 +                               device_type = "ethernet-phy";
10655 +                       };
10656 +
10657 +                       PHY1: ethernet-phy@1 {
10658 +                               reg = <1>;
10659 +                               device_type = "ethernet-phy";
10660 +                       };
10661 +               };
10662 +
10663 +               eth0: ethernet@e00 {
10664 +                       device_type = "network";
10665 +                       compatible = "fsl,mpc875-fec-enet",
10666 +                                    "fsl,pq1-fec-enet";
10667 +                       reg = <0xe00 0x188>;
10668 +                       local-mac-address = [ 00 00 00 00 00 00 ];
10669 +                       interrupts = <3 1>;
10670 +                       interrupt-parent = <&PIC>;
10671 +                       phy-handle = <&PHY0>;
10672 +                       linux,network-index = <0>;
10673 +               };
10674 +
10675 +               eth1: ethernet@1e00 {
10676 +                       device_type = "network";
10677 +                       compatible = "fsl,mpc875-fec-enet",
10678 +                                    "fsl,pq1-fec-enet";
10679 +                       reg = <0x1e00 0x188>;
10680 +                       local-mac-address = [ 00 00 00 00 00 00 ];
10681 +                       interrupts = <7 1>;
10682 +                       interrupt-parent = <&PIC>;
10683 +                       phy-handle = <&PHY1>;
10684 +                       linux,network-index = <1>;
10685 +               };
10686 +
10687 +               PIC: interrupt-controller@0 {
10688 +                       interrupt-controller;
10689 +                       #interrupt-cells = <2>;
10690 +                       reg = <0 0x24>;
10691 +                       compatible = "fsl,mpc875-pic", "fsl,pq1-pic";
10692 +               };
10693 +
10694 +               cpm@9c0 {
10695 +                       #address-cells = <1>;
10696 +                       #size-cells = <1>;
10697 +                       compatible = "fsl,mpc875-cpm", "fsl,cpm1", "simple-bus";
10698 +                       interrupts = <0>;       // cpm error interrupt
10699 +                       interrupt-parent = <&CPM_PIC>;
10700 +                       reg = <0x9c0 0x40>;
10701 +                       ranges;
10702 +
10703 +                       muram {
10704 +                               #address-cells = <1>;
10705 +                               #size-cells = <1>;
10706 +                               ranges = <0 0x2000 0x2000>;
10707 +
10708 +                               data@0 {
10709 +                                       compatible = "fsl,cpm-muram-data";
10710 +                                       reg = <0 0x1c00>;
10711 +                               };
10712 +                       };
10713 +
10714 +                       brg@9f0 {
10715 +                               compatible = "fsl,mpc875-brg",
10716 +                                            "fsl,cpm1-brg",
10717 +                                            "fsl,cpm-brg";
10718 +                               reg = <0x9f0 0x10>;
10719 +                       };
10720 +
10721 +                       CPM_PIC: interrupt-controller@930 {
10722 +                               interrupt-controller;
10723 +                               #interrupt-cells = <1>;
10724 +                               interrupts = <5 2 0 2>;
10725 +                               interrupt-parent = <&PIC>;
10726 +                               reg = <0x930 0x20>;
10727 +                               compatible = "fsl,mpc875-cpm-pic",
10728 +                                            "fsl,cpm1-pic";
10729 +                       };
10730 +
10731 +                       console: serial@a80 {
10732 +                               device_type = "serial";
10733 +                               compatible = "fsl,mpc875-smc-uart",
10734 +                                            "fsl,cpm1-smc-uart";
10735 +                               reg = <0xa80 0x10 0x3e80 0x40>;
10736 +                               interrupts = <4>;
10737 +                               interrupt-parent = <&CPM_PIC>;
10738 +                               fsl,cpm-brg = <1>;
10739 +                               fsl,cpm-command = <0x0090>;
10740 +                               current-speed = <115200>;
10741 +                       };
10742 +               };
10743 +       };
10744 +
10745 +       chosen {
10746 +               linux,stdout-path = &console;
10747 +       };
10748 +};
10749 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/adder875-uboot.dts powerpc.git/arch/powerpc/boot/dts/adder875-uboot.dts
10750 --- linux-2.6.24/arch/powerpc/boot/dts/adder875-uboot.dts       1970-01-01 01:00:00.000000000 +0100
10751 +++ powerpc.git/arch/powerpc/boot/dts/adder875-uboot.dts        2008-01-28 20:25:49.000000000 +0100
10752 @@ -0,0 +1,183 @@
10753 +/*
10754 + * Device Tree Source for MPC885 ADS running U-Boot
10755 + *
10756 + * Copyright 2006 MontaVista Software, Inc.
10757 + * Copyright 2007 Freescale Semiconductor, Inc.
10758 + *
10759 + * This program is free software; you can redistribute  it and/or modify it
10760 + * under  the terms of  the GNU General  Public License as published by the
10761 + * Free Software Foundation;  either version 2 of the  License, or (at your
10762 + * option) any later version.
10763 + */
10764 +
10765 +/dts-v1/;
10766 +/ {
10767 +       model = "Analogue & Micro Adder MPC875";
10768 +       compatible = "analogue-and-micro,adder875";
10769 +       #address-cells = <1>;
10770 +       #size-cells = <1>;
10771 +
10772 +       aliases {
10773 +               console = &console;
10774 +               ethernet0 = &eth0;
10775 +               ethernet1 = &eth1;
10776 +       };
10777 +
10778 +       cpus {
10779 +               #address-cells = <1>;
10780 +               #size-cells = <0>;
10781 +
10782 +               PowerPC,875@0 {
10783 +                       device_type = "cpu";
10784 +                       reg = <0>;
10785 +                       d-cache-line-size = <16>;
10786 +                       i-cache-line-size = <16>;
10787 +                       d-cache-size = <8192>;
10788 +                       i-cache-size = <8192>;
10789 +                       timebase-frequency = <0>;
10790 +                       bus-frequency = <0>;
10791 +                       clock-frequency = <0>;
10792 +                       interrupts = <15 2>;    // decrementer interrupt
10793 +                       interrupt-parent = <&PIC>;
10794 +               };
10795 +       };
10796 +
10797 +       memory {
10798 +               device_type = "memory";
10799 +               reg = <0 0x01000000>;
10800 +       };
10801 +
10802 +       localbus@ff000100 {
10803 +               compatible = "fsl,mpc885-localbus", "fsl,pq1-localbus",
10804 +                            "simple-bus";
10805 +               #address-cells = <2>;
10806 +               #size-cells = <1>;
10807 +               reg = <0xff000100 0x40>;
10808 +
10809 +               ranges = <
10810 +                       0 0 0xfe000000 0x01000000
10811 +               >;
10812 +
10813 +               flash@0,0 {
10814 +                       compatible = "cfi-flash";
10815 +                       reg = <0 0 0x800000>;
10816 +                       bank-width = <2>;
10817 +                       device-width = <2>;
10818 +               };
10819 +       };
10820 +
10821 +       soc@ff000000 {
10822 +               compatible = "fsl,mpc875-immr", "fsl,pq1-soc", "simple-bus";
10823 +               #address-cells = <1>;
10824 +               #size-cells = <1>;
10825 +               ranges = <0 0xff000000 0x00004000>;
10826 +
10827 +               // Temporary until code stops depending on it.
10828 +               device_type = "soc";
10829 +
10830 +               // Temporary until get_immrbase() is fixed.
10831 +               reg = <0xff000000 0x4000>;
10832 +
10833 +               mdio@e00 {
10834 +                       compatible = "fsl,mpc875-fec-mdio", "fsl,pq1-fec-mdio";
10835 +                       reg = <0xe00 0x188>;
10836 +                       #address-cells = <1>;
10837 +                       #size-cells = <0>;
10838 +
10839 +                       PHY0: ethernet-phy@0 {
10840 +                               reg = <0>;
10841 +                               device_type = "ethernet-phy";
10842 +                       };
10843 +
10844 +                       PHY1: ethernet-phy@1 {
10845 +                               reg = <1>;
10846 +                               device_type = "ethernet-phy";
10847 +                       };
10848 +               };
10849 +
10850 +               eth0: ethernet@e00 {
10851 +                       device_type = "network";
10852 +                       compatible = "fsl,mpc875-fec-enet",
10853 +                                    "fsl,pq1-fec-enet";
10854 +                       reg = <0xe00 0x188>;
10855 +                       local-mac-address = [ 00 00 00 00 00 00 ];
10856 +                       interrupts = <3 1>;
10857 +                       interrupt-parent = <&PIC>;
10858 +                       phy-handle = <&PHY0>;
10859 +                       linux,network-index = <0>;
10860 +               };
10861 +
10862 +               eth1: ethernet@1e00 {
10863 +                       device_type = "network";
10864 +                       compatible = "fsl,mpc875-fec-enet",
10865 +                                    "fsl,pq1-fec-enet";
10866 +                       reg = <0x1e00 0x188>;
10867 +                       local-mac-address = [ 00 00 00 00 00 00 ];
10868 +                       interrupts = <7 1>;
10869 +                       interrupt-parent = <&PIC>;
10870 +                       phy-handle = <&PHY1>;
10871 +                       linux,network-index = <1>;
10872 +               };
10873 +
10874 +               PIC: interrupt-controller@0 {
10875 +                       interrupt-controller;
10876 +                       #interrupt-cells = <2>;
10877 +                       reg = <0 0x24>;
10878 +                       compatible = "fsl,mpc875-pic", "fsl,pq1-pic";
10879 +               };
10880 +
10881 +               cpm@9c0 {
10882 +                       #address-cells = <1>;
10883 +                       #size-cells = <1>;
10884 +                       compatible = "fsl,mpc875-cpm", "fsl,cpm1", "simple-bus";
10885 +                       interrupts = <0>;       // cpm error interrupt
10886 +                       interrupt-parent = <&CPM_PIC>;
10887 +                       reg = <0x9c0 0x40>;
10888 +                       ranges;
10889 +
10890 +                       muram {
10891 +                               #address-cells = <1>;
10892 +                               #size-cells = <1>;
10893 +                               ranges = <0 0x2000 0x2000>;
10894 +
10895 +                               data@0 {
10896 +                                       compatible = "fsl,cpm-muram-data";
10897 +                                       reg = <0 0x1c00>;
10898 +                               };
10899 +                       };
10900 +
10901 +                       brg@9f0 {
10902 +                               compatible = "fsl,mpc875-brg",
10903 +                                            "fsl,cpm1-brg",
10904 +                                            "fsl,cpm-brg";
10905 +                               reg = <0x9f0 0x10>;
10906 +                       };
10907 +
10908 +                       CPM_PIC: interrupt-controller@930 {
10909 +                               interrupt-controller;
10910 +                               #interrupt-cells = <1>;
10911 +                               interrupts = <5 2 0 2>;
10912 +                               interrupt-parent = <&PIC>;
10913 +                               reg = <0x930 0x20>;
10914 +                               compatible = "fsl,mpc875-cpm-pic",
10915 +                                            "fsl,cpm1-pic";
10916 +                       };
10917 +
10918 +                       console: serial@a80 {
10919 +                               device_type = "serial";
10920 +                               compatible = "fsl,mpc875-smc-uart",
10921 +                                            "fsl,cpm1-smc-uart";
10922 +                               reg = <0xa80 0x10 0x3e80 0x40>;
10923 +                               interrupts = <4>;
10924 +                               interrupt-parent = <&CPM_PIC>;
10925 +                               fsl,cpm-brg = <1>;
10926 +                               fsl,cpm-command = <0x0090>;
10927 +                               current-speed = <115200>;
10928 +                       };
10929 +               };
10930 +       };
10931 +
10932 +       chosen {
10933 +               linux,stdout-path = &console;
10934 +       };
10935 +};
10936 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/bamboo.dts powerpc.git/arch/powerpc/boot/dts/bamboo.dts
10937 --- linux-2.6.24/arch/powerpc/boot/dts/bamboo.dts       2008-01-24 23:58:37.000000000 +0100
10938 +++ powerpc.git/arch/powerpc/boot/dts/bamboo.dts        2008-01-28 20:25:49.000000000 +0100
10939 @@ -16,14 +16,24 @@
10940         #size-cells = <1>;
10941         model = "amcc,bamboo";
10942         compatible = "amcc,bamboo";
10943 -       dcr-parent = <&/cpus/PowerPC,440EP@0>;
10944 +       dcr-parent = <&/cpus/cpu@0>;
10945 +
10946 +       aliases {
10947 +               ethernet0 = &EMAC0;
10948 +               ethernet1 = &EMAC1;
10949 +               serial0 = &UART0;
10950 +               serial1 = &UART1;
10951 +               serial2 = &UART2;
10952 +               serial3 = &UART3;
10953 +       };
10954  
10955         cpus {
10956                 #address-cells = <1>;
10957                 #size-cells = <0>;
10958  
10959 -               PowerPC,440EP@0 {
10960 +               cpu@0 {
10961                         device_type = "cpu";
10962 +                       model = "PowerPC,440EP";
10963                         reg = <0>;
10964                         clock-frequency = <0>; /* Filled in by zImage */
10965                         timebase-frequency = <0>; /* Filled in by zImage */
10966 @@ -126,7 +136,6 @@
10967                                 #address-cells = <2>;
10968                                 #size-cells = <1>;
10969                                 clock-frequency = <0>; /* Filled in by zImage */
10970 -                               ranges;
10971                                 interrupts = <5 1>;
10972                                 interrupt-parent = <&UIC1>;
10973                         };
10974 @@ -238,11 +247,56 @@
10975                                 zmii-device = <&ZMII0>;
10976                                 zmii-channel = <1>;
10977                         };
10978 +
10979 +                       usb@ef601000 {
10980 +                               compatible = "ohci-be";
10981 +                               reg = <ef601000 80>;
10982 +                               interrupts = <8 1 9 1>;
10983 +                               interrupt-parent = < &UIC1 >;
10984 +                       };
10985 +               };
10986 +
10987 +               PCI0: pci@ec000000 {
10988 +                       device_type = "pci";
10989 +                       #interrupt-cells = <1>;
10990 +                       #size-cells = <2>;
10991 +                       #address-cells = <3>;
10992 +                       compatible = "ibm,plb440ep-pci", "ibm,plb-pci";
10993 +                       primary;
10994 +                       reg = <0 eec00000 8     /* Config space access */
10995 +                              0 eed00000 4     /* IACK */
10996 +                              0 eed00000 4     /* Special cycle */
10997 +                              0 ef400000 40>;  /* Internal registers */
10998 +
10999 +                       /* Outbound ranges, one memory and one IO,
11000 +                        * later cannot be changed. Chip supports a second
11001 +                        * IO range but we don't use it for now
11002 +                        */
11003 +                       ranges = <02000000 0 a0000000 0 a0000000 0 20000000
11004 +                                 01000000 0 00000000 0 e8000000 0 00010000>;
11005 +
11006 +                       /* Inbound 2GB range starting at 0 */
11007 +                       dma-ranges = <42000000 0 0 0 0 0 80000000>;
11008 +
11009 +                       /* Bamboo has all 4 IRQ pins tied together per slot */
11010 +                       interrupt-map-mask = <f800 0 0 0>;
11011 +                       interrupt-map = <
11012 +                               /* IDSEL 1 */
11013 +                               0800 0 0 0 &UIC0 1c 8
11014 +
11015 +                               /* IDSEL 2 */
11016 +                               1000 0 0 0 &UIC0 1b 8
11017 +
11018 +                               /* IDSEL 3 */
11019 +                               1800 0 0 0 &UIC0 1a 8
11020 +
11021 +                               /* IDSEL 4 */
11022 +                               2000 0 0 0 &UIC0 19 8
11023 +                       >;
11024                 };
11025         };
11026  
11027         chosen {
11028                 linux,stdout-path = "/plb/opb/serial@ef600300";
11029 -               bootargs = "console=ttyS0,115200";
11030         };
11031  };
11032 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/cm5200.dts powerpc.git/arch/powerpc/boot/dts/cm5200.dts
11033 --- linux-2.6.24/arch/powerpc/boot/dts/cm5200.dts       1970-01-01 01:00:00.000000000 +0100
11034 +++ powerpc.git/arch/powerpc/boot/dts/cm5200.dts        2008-01-28 20:25:49.000000000 +0100
11035 @@ -0,0 +1,236 @@
11036 +/*
11037 + * CM5200 board Device Tree Source
11038 + *
11039 + * Copyright (C) 2007 Semihalf
11040 + * Marian Balakowicz <m8@semihalf.com>
11041 + *
11042 + * This program is free software; you can redistribute  it and/or modify it
11043 + * under  the terms of  the GNU General  Public License as published by the
11044 + * Free Software Foundation;  either version 2 of the  License, or (at your
11045 + * option) any later version.
11046 + */
11047 +
11048 +/*
11049 + * WARNING: Do not depend on this tree layout remaining static just yet.
11050 + * The MPC5200 device tree conventions are still in flux
11051 + * Keep an eye on the linuxppc-dev mailing list for more details
11052 + */
11053 +
11054 +/ {
11055 +       model = "schindler,cm5200";
11056 +       compatible = "schindler,cm5200";
11057 +       #address-cells = <1>;
11058 +       #size-cells = <1>;
11059 +
11060 +       cpus {
11061 +               #address-cells = <1>;
11062 +               #size-cells = <0>;
11063 +
11064 +               PowerPC,5200@0 {
11065 +                       device_type = "cpu";
11066 +                       reg = <0>;
11067 +                       d-cache-line-size = <20>;
11068 +                       i-cache-line-size = <20>;
11069 +                       d-cache-size = <4000>;          // L1, 16K
11070 +                       i-cache-size = <4000>;          // L1, 16K
11071 +                       timebase-frequency = <0>;       // from bootloader
11072 +                       bus-frequency = <0>;            // from bootloader
11073 +                       clock-frequency = <0>;          // from bootloader
11074 +               };
11075 +       };
11076 +
11077 +       memory {
11078 +               device_type = "memory";
11079 +               reg = <00000000 04000000>;      // 64MB
11080 +       };
11081 +
11082 +       soc5200@f0000000 {
11083 +               model = "fsl,mpc5200b";
11084 +               compatible = "fsl,mpc5200b";
11085 +               revision = "";                  // from bootloader
11086 +               device_type = "soc";
11087 +               ranges = <0 f0000000 0000c000>;
11088 +               reg = <f0000000 00000100>;
11089 +               bus-frequency = <0>;            // from bootloader
11090 +               system-frequency = <0>;         // from bootloader
11091 +
11092 +               cdm@200 {
11093 +                       compatible = "mpc5200b-cdm","mpc5200-cdm";
11094 +                       reg = <200 38>;
11095 +               };
11096 +
11097 +               mpc5200_pic: pic@500 {
11098 +                       // 5200 interrupts are encoded into two levels;
11099 +                       interrupt-controller;
11100 +                       #interrupt-cells = <3>;
11101 +                       compatible = "mpc5200b-pic","mpc5200-pic";
11102 +                       reg = <500 80>;
11103 +               };
11104 +
11105 +               gpt@600 {       // General Purpose Timer
11106 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
11107 +                       reg = <600 10>;
11108 +                       interrupts = <1 9 0>;
11109 +                       interrupt-parent = <&mpc5200_pic>;
11110 +                       fsl,has-wdt;
11111 +               };
11112 +
11113 +               gpt@610 {       // General Purpose Timer
11114 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
11115 +                       reg = <610 10>;
11116 +                       interrupts = <1 a 0>;
11117 +                       interrupt-parent = <&mpc5200_pic>;
11118 +               };
11119 +
11120 +               gpt@620 {       // General Purpose Timer
11121 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
11122 +                       reg = <620 10>;
11123 +                       interrupts = <1 b 0>;
11124 +                       interrupt-parent = <&mpc5200_pic>;
11125 +               };
11126 +
11127 +               gpt@630 {       // General Purpose Timer
11128 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
11129 +                       reg = <630 10>;
11130 +                       interrupts = <1 c 0>;
11131 +                       interrupt-parent = <&mpc5200_pic>;
11132 +               };
11133 +
11134 +               gpt@640 {       // General Purpose Timer
11135 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
11136 +                       reg = <640 10>;
11137 +                       interrupts = <1 d 0>;
11138 +                       interrupt-parent = <&mpc5200_pic>;
11139 +               };
11140 +
11141 +               gpt@650 {       // General Purpose Timer
11142 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
11143 +                       reg = <650 10>;
11144 +                       interrupts = <1 e 0>;
11145 +                       interrupt-parent = <&mpc5200_pic>;
11146 +               };
11147 +
11148 +               gpt@660 {       // General Purpose Timer
11149 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
11150 +                       reg = <660 10>;
11151 +                       interrupts = <1 f 0>;
11152 +                       interrupt-parent = <&mpc5200_pic>;
11153 +               };
11154 +
11155 +               gpt@670 {       // General Purpose Timer
11156 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
11157 +                       reg = <670 10>;
11158 +                       interrupts = <1 10 0>;
11159 +                       interrupt-parent = <&mpc5200_pic>;
11160 +               };
11161 +
11162 +               rtc@800 {       // Real time clock
11163 +                       compatible = "mpc5200b-rtc","mpc5200-rtc";
11164 +                       reg = <800 100>;
11165 +                       interrupts = <1 5 0 1 6 0>;
11166 +                       interrupt-parent = <&mpc5200_pic>;
11167 +               };
11168 +
11169 +               gpio@b00 {
11170 +                       compatible = "mpc5200b-gpio","mpc5200-gpio";
11171 +                       reg = <b00 40>;
11172 +                       interrupts = <1 7 0>;
11173 +                       interrupt-parent = <&mpc5200_pic>;
11174 +               };
11175 +
11176 +               gpio-wkup@c00 {
11177 +                       compatible = "mpc5200b-gpio-wkup","mpc5200-gpio-wkup";
11178 +                       reg = <c00 40>;
11179 +                       interrupts = <1 8 0 0 3 0>;
11180 +                       interrupt-parent = <&mpc5200_pic>;
11181 +               };
11182 +
11183 +               spi@f00 {
11184 +                       compatible = "mpc5200b-spi","mpc5200-spi";
11185 +                       reg = <f00 20>;
11186 +                       interrupts = <2 d 0 2 e 0>;
11187 +                       interrupt-parent = <&mpc5200_pic>;
11188 +               };
11189 +
11190 +               usb@1000 {
11191 +                       device_type = "usb-ohci-be";
11192 +                       compatible = "mpc5200b-ohci","mpc5200-ohci","ohci-be";
11193 +                       reg = <1000 ff>;
11194 +                       interrupts = <2 6 0>;
11195 +                       interrupt-parent = <&mpc5200_pic>;
11196 +               };
11197 +
11198 +               dma-controller@1200 {
11199 +                       compatible = "mpc5200b-bestcomm","mpc5200-bestcomm";
11200 +                       reg = <1200 80>;
11201 +                       interrupts = <3 0 0  3 1 0  3 2 0  3 3 0
11202 +                                     3 4 0  3 5 0  3 6 0  3 7 0
11203 +                                     3 8 0  3 9 0  3 a 0  3 b 0
11204 +                                     3 c 0  3 d 0  3 e 0  3 f 0>;
11205 +                       interrupt-parent = <&mpc5200_pic>;
11206 +               };
11207 +
11208 +               xlb@1f00 {
11209 +                       compatible = "mpc5200b-xlb","mpc5200-xlb";
11210 +                       reg = <1f00 100>;
11211 +               };
11212 +
11213 +               serial@2000 {           // PSC1
11214 +                       device_type = "serial";
11215 +                       compatible = "mpc5200b-psc-uart","mpc5200-psc-uart";
11216 +                       port-number = <0>;  // Logical port assignment
11217 +                       reg = <2000 100>;
11218 +                       interrupts = <2 1 0>;
11219 +                       interrupt-parent = <&mpc5200_pic>;
11220 +               };
11221 +
11222 +               serial@2200 {           // PSC2
11223 +                       device_type = "serial";
11224 +                       compatible = "mpc5200-psc-uart";
11225 +                       port-number = <1>;  // Logical port assignment
11226 +                       reg = <2200 100>;
11227 +                       interrupts = <2 2 0>;
11228 +                       interrupt-parent = <&mpc5200_pic>;
11229 +               };
11230 +
11231 +               serial@2400 {           // PSC3
11232 +                       device_type = "serial";
11233 +                       compatible = "mpc5200-psc-uart";
11234 +                       port-number = <2>;  // Logical port assignment
11235 +                       reg = <2400 100>;
11236 +                       interrupts = <2 3 0>;
11237 +                       interrupt-parent = <&mpc5200_pic>;
11238 +               };
11239 +
11240 +               serial@2c00 {           // PSC6
11241 +                       device_type = "serial";
11242 +                       compatible = "mpc5200b-psc-uart","mpc5200-psc-uart";
11243 +                       port-number = <5>;  // Logical port assignment
11244 +                       reg = <2c00 100>;
11245 +                       interrupts = <2 4 0>;
11246 +                       interrupt-parent = <&mpc5200_pic>;
11247 +               };
11248 +
11249 +               ethernet@3000 {
11250 +                       device_type = "network";
11251 +                       compatible = "mpc5200b-fec","mpc5200-fec";
11252 +                       reg = <3000 800>;
11253 +                       local-mac-address = [ 00 00 00 00 00 00 ]; /* Filled in by U-Boot */
11254 +                       interrupts = <2 5 0>;
11255 +                       interrupt-parent = <&mpc5200_pic>;
11256 +               };
11257 +
11258 +               i2c@3d40 {
11259 +                       compatible = "mpc5200b-i2c","mpc5200-i2c","fsl-i2c";
11260 +                       reg = <3d40 40>;
11261 +                       interrupts = <2 10 0>;
11262 +                       interrupt-parent = <&mpc5200_pic>;
11263 +                       fsl5200-clocking;
11264 +               };
11265 +
11266 +               sram@8000 {
11267 +                       compatible = "mpc5200b-sram","mpc5200-sram";
11268 +                       reg = <8000 4000>;
11269 +               };
11270 +       };
11271 +};
11272 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/ebony.dts powerpc.git/arch/powerpc/boot/dts/ebony.dts
11273 --- linux-2.6.24/arch/powerpc/boot/dts/ebony.dts        2008-01-24 23:58:37.000000000 +0100
11274 +++ powerpc.git/arch/powerpc/boot/dts/ebony.dts 2008-01-28 20:25:49.000000000 +0100
11275 @@ -16,14 +16,22 @@
11276         #size-cells = <1>;
11277         model = "ibm,ebony";
11278         compatible = "ibm,ebony";
11279 -       dcr-parent = <&/cpus/PowerPC,440GP@0>;
11280 +       dcr-parent = <&/cpus/cpu@0>;
11281 +
11282 +       aliases {
11283 +               ethernet0 = &EMAC0;
11284 +               ethernet1 = &EMAC1;
11285 +               serial0 = &UART0;
11286 +               serial1 = &UART1;
11287 +       };
11288  
11289         cpus {
11290                 #address-cells = <1>;
11291                 #size-cells = <0>;
11292  
11293 -               PowerPC,440GP@0 {
11294 +               cpu@0 {
11295                         device_type = "cpu";
11296 +                       model = "PowerPC,440GP";
11297                         reg = <0>;
11298                         clock-frequency = <0>; // Filled in by zImage
11299                         timebase-frequency = <0>; // Filled in by zImage
11300 @@ -150,9 +158,10 @@
11301                                         };
11302                                 };
11303  
11304 -                               ds1743@1,0 {
11305 +                               nvram@1,0 {
11306                                         /* NVRAM & RTC */
11307 -                                       compatible = "ds1743";
11308 +                                       compatible = "ds1743-nvram";
11309 +                                       #bytes = <2000>;
11310                                         reg = <1 0 2000>;
11311                                 };
11312  
11313 @@ -284,12 +293,43 @@
11314  
11315                 };
11316  
11317 -               PCIX0: pci@1234 {
11318 +               PCIX0: pci@20ec00000 {
11319                         device_type = "pci";
11320 -                       /* FIXME */
11321 -                       reg = <2 0ec00000 8
11322 -                              2 0ec80000 f0
11323 -                              2 0ec80100 fc>;
11324 +                       #interrupt-cells = <1>;
11325 +                       #size-cells = <2>;
11326 +                       #address-cells = <3>;
11327 +                       compatible = "ibm,plb440gp-pcix", "ibm,plb-pcix";
11328 +                       primary;
11329 +                       reg = <2 0ec00000 8     /* Config space access */
11330 +                              0 0 0            /* no IACK cycles */
11331 +                              2 0ed00000 4     /* Special cycles */
11332 +                              2 0ec80000 f0    /* Internal registers */
11333 +                              2 0ec80100 fc>;  /* Internal messaging registers */
11334 +
11335 +                       /* Outbound ranges, one memory and one IO,
11336 +                        * later cannot be changed
11337 +                        */
11338 +                       ranges = <02000000 0 80000000 00000003 80000000 0 80000000
11339 +                                 01000000 0 00000000 00000002 08000000 0 00010000>;
11340 +
11341 +                       /* Inbound 2GB range starting at 0 */
11342 +                       dma-ranges = <42000000 0 0 0 0 0 80000000>;
11343 +
11344 +                       /* Ebony has all 4 IRQ pins tied together per slot */
11345 +                       interrupt-map-mask = <f800 0 0 0>;
11346 +                       interrupt-map = <
11347 +                               /* IDSEL 1 */
11348 +                               0800 0 0 0 &UIC0 17 8
11349 +
11350 +                               /* IDSEL 2 */
11351 +                               1000 0 0 0 &UIC0 18 8
11352 +
11353 +                               /* IDSEL 3 */
11354 +                               1800 0 0 0 &UIC0 19 8
11355 +
11356 +                               /* IDSEL 4 */
11357 +                               2000 0 0 0 &UIC0 1a 8
11358 +                       >;
11359                 };
11360         };
11361  
11362 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/ep405.dts powerpc.git/arch/powerpc/boot/dts/ep405.dts
11363 --- linux-2.6.24/arch/powerpc/boot/dts/ep405.dts        1970-01-01 01:00:00.000000000 +0100
11364 +++ powerpc.git/arch/powerpc/boot/dts/ep405.dts 2008-01-28 20:25:49.000000000 +0100
11365 @@ -0,0 +1,228 @@
11366 +/*
11367 + * Device Tree Source for EP405
11368 + *
11369 + * Copyright 2007 IBM Corp.
11370 + * Benjamin Herrenschmidt <benh@kernel.crashing.org>
11371 + *
11372 + * This file is licensed under the terms of the GNU General Public
11373 + * License version 2.  This program is licensed "as is" without
11374 + * any warranty of any kind, whether express or implied.
11375 + */
11376 +
11377 +/ {
11378 +       #address-cells = <1>;
11379 +       #size-cells = <1>;
11380 +       model = "ep405";
11381 +       compatible = "ep405";
11382 +       dcr-parent = <&/cpus/cpu@0>;
11383 +
11384 +       aliases {
11385 +               ethernet0 = &EMAC;
11386 +               serial0 = &UART0;
11387 +               serial1 = &UART1;
11388 +       };
11389 +
11390 +       cpus {
11391 +               #address-cells = <1>;
11392 +               #size-cells = <0>;
11393 +
11394 +               cpu@0 {
11395 +                       device_type = "cpu";
11396 +                       model = "PowerPC,405GP";
11397 +                       reg = <0>;
11398 +                       clock-frequency = <bebc200>; /* Filled in by zImage */
11399 +                       timebase-frequency = <0>; /* Filled in by zImage */
11400 +                       i-cache-line-size = <20>;
11401 +                       d-cache-line-size = <20>;
11402 +                       i-cache-size = <4000>;
11403 +                       d-cache-size = <4000>;
11404 +                       dcr-controller;
11405 +                       dcr-access-method = "native";
11406 +               };
11407 +       };
11408 +
11409 +       memory {
11410 +               device_type = "memory";
11411 +               reg = <0 0>; /* Filled in by zImage */
11412 +       };
11413 +
11414 +       UIC0: interrupt-controller {
11415 +               compatible = "ibm,uic";
11416 +               interrupt-controller;
11417 +               cell-index = <0>;
11418 +               dcr-reg = <0c0 9>;
11419 +               #address-cells = <0>;
11420 +               #size-cells = <0>;
11421 +               #interrupt-cells = <2>;
11422 +       };
11423 +
11424 +       plb {
11425 +               compatible = "ibm,plb3";
11426 +               #address-cells = <1>;
11427 +               #size-cells = <1>;
11428 +               ranges;
11429 +               clock-frequency = <0>; /* Filled in by zImage */
11430 +
11431 +               SDRAM0: memory-controller {
11432 +                       compatible = "ibm,sdram-405gp";
11433 +                       dcr-reg = <010 2>;
11434 +               };
11435 +
11436 +               MAL: mcmal {
11437 +                       compatible = "ibm,mcmal-405gp", "ibm,mcmal";
11438 +                       dcr-reg = <180 62>;
11439 +                       num-tx-chans = <1>;
11440 +                       num-rx-chans = <1>;
11441 +                       interrupt-parent = <&UIC0>;
11442 +                       interrupts = <
11443 +                               b 4 /* TXEOB */
11444 +                               c 4 /* RXEOB */
11445 +                               a 4 /* SERR */
11446 +                               d 4 /* TXDE */
11447 +                               e 4 /* RXDE */>;
11448 +               };
11449 +
11450 +               POB0: opb {
11451 +                       compatible = "ibm,opb-405gp", "ibm,opb";
11452 +                       #address-cells = <1>;
11453 +                       #size-cells = <1>;
11454 +                       ranges = <ef600000 ef600000 a00000>;
11455 +                       dcr-reg = <0a0 5>;
11456 +                       clock-frequency = <0>; /* Filled in by zImage */
11457 +
11458 +                       UART0: serial@ef600300 {
11459 +                               device_type = "serial";
11460 +                               compatible = "ns16550";
11461 +                               reg = <ef600300 8>;
11462 +                               virtual-reg = <ef600300>;
11463 +                               clock-frequency = <0>; /* Filled in by zImage */
11464 +                               current-speed = <2580>;
11465 +                               interrupt-parent = <&UIC0>;
11466 +                               interrupts = <0 4>;
11467 +                       };
11468 +
11469 +                       UART1: serial@ef600400 {
11470 +                               device_type = "serial";
11471 +                               compatible = "ns16550";
11472 +                               reg = <ef600400 8>;
11473 +                               virtual-reg = <ef600400>;
11474 +                               clock-frequency = <0>; /* Filled in by zImage */
11475 +                               current-speed = <2580>;
11476 +                               interrupt-parent = <&UIC0>;
11477 +                               interrupts = <1 4>;
11478 +                       };
11479 +
11480 +                       IIC: i2c@ef600500 {
11481 +                               compatible = "ibm,iic-405gp", "ibm,iic";
11482 +                               reg = <ef600500 11>;
11483 +                               interrupt-parent = <&UIC0>;
11484 +                               interrupts = <2 4>;
11485 +                       };
11486 +
11487 +                       GPIO: gpio@ef600700 {
11488 +                               compatible = "ibm,gpio-405gp";
11489 +                               reg = <ef600700 20>;
11490 +                       };
11491 +
11492 +                       EMAC: ethernet@ef600800 {
11493 +                               linux,network-index = <0>;
11494 +                               device_type = "network";
11495 +                               compatible = "ibm,emac-405gp", "ibm,emac";
11496 +                               interrupt-parent = <&UIC0>;
11497 +                               interrupts = <
11498 +                                       f 4 /* Ethernet */
11499 +                                       9 4 /* Ethernet Wake Up */>;
11500 +                               local-mac-address = [000000000000]; /* Filled in by zImage */
11501 +                               reg = <ef600800 70>;
11502 +                               mal-device = <&MAL>;
11503 +                               mal-tx-channel = <0>;
11504 +                               mal-rx-channel = <0>;
11505 +                               cell-index = <0>;
11506 +                               max-frame-size = <5dc>;
11507 +                               rx-fifo-size = <1000>;
11508 +                               tx-fifo-size = <800>;
11509 +                               phy-mode = "rmii";
11510 +                               phy-map = <00000000>;
11511 +                       };
11512 +
11513 +               };
11514 +
11515 +               EBC0: ebc {
11516 +                       compatible = "ibm,ebc-405gp", "ibm,ebc";
11517 +                       dcr-reg = <012 2>;
11518 +                       #address-cells = <2>;
11519 +                       #size-cells = <1>;
11520 +
11521 +
11522 +                       /* The ranges property is supplied by the bootwrapper
11523 +                        * and is based on the firmware's configuration of the
11524 +                        * EBC bridge
11525 +                        */
11526 +                       clock-frequency = <0>; /* Filled in by zImage */
11527 +
11528 +                       /* NVRAM and RTC */
11529 +                       nvrtc@4,200000 {
11530 +                               compatible = "ds1742";
11531 +                               reg = <4 200000 0>; /* size fixed up by zImage */
11532 +                       };
11533 +
11534 +                       /* "BCSR" CPLD contains a PCI irq controller */
11535 +                       bcsr@4,0 {
11536 +                               compatible = "ep405-bcsr";
11537 +                               reg = <4 0 10>;
11538 +                               interrupt-controller;
11539 +                               /* Routing table */
11540 +                               irq-routing = [ 00      /* SYSERR */
11541 +                                               01      /* STTM */
11542 +                                               01      /* RTC */
11543 +                                               01      /* FENET */
11544 +                                               02      /* NB PCIIRQ mux ? */
11545 +                                               03      /* SB Winbond 8259 ? */
11546 +                                               04      /* Serial Ring */
11547 +                                               05      /* USB (ep405pc) */
11548 +                                               06      /* XIRQ 0 */
11549 +                                               06      /* XIRQ 1 */
11550 +                                               06      /* XIRQ 2 */
11551 +                                               06      /* XIRQ 3 */
11552 +                                               06      /* XIRQ 4 */
11553 +                                               06      /* XIRQ 5 */
11554 +                                               06      /* XIRQ 6 */
11555 +                                               07];    /* Reserved */
11556 +                       };
11557 +               };
11558 +
11559 +               PCI0: pci@ec000000 {
11560 +                       device_type = "pci";
11561 +                       #interrupt-cells = <1>;
11562 +                       #size-cells = <2>;
11563 +                       #address-cells = <3>;
11564 +                       compatible = "ibm,plb405gp-pci", "ibm,plb-pci";
11565 +                       primary;
11566 +                       reg = <eec00000 8       /* Config space access */
11567 +                              eed80000 4       /* IACK */
11568 +                              eed80000 4       /* Special cycle */
11569 +                              ef480000 40>;    /* Internal registers */
11570 +
11571 +                       /* Outbound ranges, one memory and one IO,
11572 +                        * later cannot be changed. Chip supports a second
11573 +                        * IO range but we don't use it for now
11574 +                        */
11575 +                       ranges = <02000000 0 80000000 80000000 0 20000000
11576 +                                 01000000 0 00000000 e8000000 0 00010000>;
11577 +
11578 +                       /* Inbound 2GB range starting at 0 */
11579 +                       dma-ranges = <42000000 0 0 0 0 80000000>;
11580 +
11581 +                       /* That's all I know about IRQs on that thing ... */
11582 +                       interrupt-map-mask = <f800 0 0 0>;
11583 +                       interrupt-map = <
11584 +                               /* USB */
11585 +                               7000 0 0 0 &UIC0 1e 8 /* IRQ5 */
11586 +                       >;
11587 +               };
11588 +       };
11589 +
11590 +       chosen {
11591 +               linux,stdout-path = "/plb/opb/serial@ef600300";
11592 +       };
11593 +};
11594 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/ep8248e.dts powerpc.git/arch/powerpc/boot/dts/ep8248e.dts
11595 --- linux-2.6.24/arch/powerpc/boot/dts/ep8248e.dts      1970-01-01 01:00:00.000000000 +0100
11596 +++ powerpc.git/arch/powerpc/boot/dts/ep8248e.dts       2008-01-28 20:25:49.000000000 +0100
11597 @@ -0,0 +1,207 @@
11598 +/*
11599 + * Device Tree for the Embedded Planet EP8248E board running PlanetCore.
11600 + *
11601 + * Copyright 2007 Freescale Semiconductor Inc.
11602 + *
11603 + * This program is free software; you can redistribute  it and/or modify it
11604 + * under  the terms of  the GNU General  Public License as published by the
11605 + * Free Software Foundation;  either version 2 of the  License, or (at your
11606 + * option) any later version.
11607 + */
11608 +
11609 +/dts-v1/;
11610 +/ {
11611 +       model = "EP8248E";
11612 +       compatible = "fsl,ep8248e";
11613 +       #address-cells = <1>;
11614 +       #size-cells = <1>;
11615 +
11616 +       aliases {
11617 +               planetcore-SMC1 = &smc1;
11618 +               planetcore-SCC1 = &scc1;
11619 +               ethernet0 = &eth0;
11620 +               ethernet1 = &eth1;
11621 +               serial0 = &smc1;
11622 +               serial1 = &scc1;
11623 +       };
11624 +
11625 +       cpus {
11626 +               #address-cells = <1>;
11627 +               #size-cells = <0>;
11628 +
11629 +               PowerPC,8248@0 {
11630 +                       device_type = "cpu";
11631 +                       reg = <0>;
11632 +                       d-cache-line-size = <32>;
11633 +                       i-cache-line-size = <32>;
11634 +                       d-cache-size = <16384>;
11635 +                       i-cache-size = <16384>;
11636 +                       timebase-frequency = <0>;
11637 +                       clock-frequency = <0>;
11638 +               };
11639 +       };
11640 +
11641 +       localbus@f0010100 {
11642 +               compatible = "fsl,mpc8248-localbus",
11643 +                            "fsl,pq2-localbus",
11644 +                            "simple-bus";
11645 +               #address-cells = <2>;
11646 +               #size-cells = <1>;
11647 +               reg = <0xf0010100 0x40>;
11648 +
11649 +               ranges = <0 0 0xfc000000 0x04000000
11650 +                         1 0 0xfa000000 0x00008000>;
11651 +
11652 +               flash@0,3800000 {
11653 +                       compatible = "cfi-flash";
11654 +                       reg = <0 0x3800000 0x800000>;
11655 +                       bank-width = <4>;
11656 +                       device-width = <2>;
11657 +               };
11658 +
11659 +               bcsr@1,0 {
11660 +                       #address-cells = <2>;
11661 +                       #size-cells = <1>;
11662 +                       reg = <1 0 0x10>;
11663 +                       compatible = "fsl,ep8248e-bcsr";
11664 +                       ranges;
11665 +
11666 +                       mdio {
11667 +                               device_type = "mdio";
11668 +                               compatible = "fsl,ep8248e-mdio-bitbang";
11669 +                               #address-cells = <1>;
11670 +                               #size-cells = <0>;
11671 +                               reg = <1 8 1>;
11672 +
11673 +                               PHY0: ethernet-phy@0 {
11674 +                                       interrupt-parent = <&PIC>;
11675 +                                       reg = <0>;
11676 +                                       device_type = "ethernet-phy";
11677 +                               };
11678 +
11679 +                               PHY1: ethernet-phy@1 {
11680 +                                       interrupt-parent = <&PIC>;
11681 +                                       reg = <1>;
11682 +                                       device_type = "ethernet-phy";
11683 +                               };
11684 +                       };
11685 +               };
11686 +       };
11687 +
11688 +       memory {
11689 +               device_type = "memory";
11690 +               reg = <0 0>;
11691 +       };
11692 +
11693 +       soc@f0000000 {
11694 +               #address-cells = <1>;
11695 +               #size-cells = <1>;
11696 +               compatible = "fsl,mpc8248-immr", "fsl,pq2-soc", "simple-bus";
11697 +               ranges = <0x00000000 0xf0000000 0x00053000>;
11698 +
11699 +               // Temporary until code stops depending on it.
11700 +               device_type = "soc";
11701 +
11702 +               // Temporary -- will go away once kernel uses ranges for get_immrbase().
11703 +               reg = <0xf0000000 0x00053000>;
11704 +
11705 +               cpm@119c0 {
11706 +                       #address-cells = <1>;
11707 +                       #size-cells = <1>;
11708 +                       #interrupt-cells = <2>;
11709 +                       compatible = "fsl,mpc8248-cpm", "fsl,cpm2",
11710 +                                    "simple-bus";
11711 +                       reg = <0x119c0 0x30>;
11712 +                       ranges;
11713 +
11714 +                       muram {
11715 +                               #address-cells = <1>;
11716 +                               #size-cells = <1>;
11717 +                               ranges = <0 0 0x10000>;
11718 +
11719 +                               data@0 {
11720 +                                       compatible = "fsl,cpm-muram-data";
11721 +                                       reg = <0 0x1100 0x1140
11722 +                                              0xec0 0x9800 0x800>;
11723 +                               };
11724 +                       };
11725 +
11726 +                       brg@119f0 {
11727 +                               compatible = "fsl,mpc8248-brg",
11728 +                                            "fsl,cpm2-brg",
11729 +                                            "fsl,cpm-brg";
11730 +                               reg = <0x119f0 0x10 0x115f0 0x10>;
11731 +                       };
11732 +
11733 +                       /* Monitor port/SMC1 */
11734 +                       smc1: serial@11a80 {
11735 +                               device_type = "serial";
11736 +                               compatible = "fsl,mpc8248-smc-uart",
11737 +                                            "fsl,cpm2-smc-uart";
11738 +                               reg = <0x11a80 0x20 0x1100 0x40>;
11739 +                               interrupts = <4 8>;
11740 +                               interrupt-parent = <&PIC>;
11741 +                               fsl,cpm-brg = <7>;
11742 +                               fsl,cpm-command = <0x1d000000>;
11743 +                               linux,planetcore-label = "SMC1";
11744 +                       };
11745 +
11746 +                       /* "Serial" port/SCC1 */
11747 +                       scc1: serial@11a00 {
11748 +                               device_type = "serial";
11749 +                               compatible = "fsl,mpc8248-scc-uart",
11750 +                                            "fsl,cpm2-scc-uart";
11751 +                               reg = <0x11a00 0x20 0x8000 0x100>;
11752 +                               interrupts = <40 8>;
11753 +                               interrupt-parent = <&PIC>;
11754 +                               fsl,cpm-brg = <1>;
11755 +                               fsl,cpm-command = <0x00800000>;
11756 +                               linux,planetcore-label = "SCC1";
11757 +                       };
11758 +
11759 +                       eth0: ethernet@11300 {
11760 +                               device_type = "network";
11761 +                               compatible = "fsl,mpc8248-fcc-enet",
11762 +                                            "fsl,cpm2-fcc-enet";
11763 +                               reg = <0x11300 0x20 0x8400 0x100 0x11390 1>;
11764 +                               local-mac-address = [ 00 00 00 00 00 00 ];
11765 +                               interrupts = <32 8>;
11766 +                               interrupt-parent = <&PIC>;
11767 +                               phy-handle = <&PHY0>;
11768 +                               linux,network-index = <0>;
11769 +                               fsl,cpm-command = <0x12000300>;
11770 +                       };
11771 +
11772 +                       eth1: ethernet@11320 {
11773 +                               device_type = "network";
11774 +                               compatible = "fsl,mpc8248-fcc-enet",
11775 +                                            "fsl,cpm2-fcc-enet";
11776 +                               reg = <0x11320 0x20 0x8500 0x100 0x113b0 1>;
11777 +                               local-mac-address = [ 00 00 00 00 00 00 ];
11778 +                               interrupts = <33 8>;
11779 +                               interrupt-parent = <&PIC>;
11780 +                               phy-handle = <&PHY1>;
11781 +                               linux,network-index = <1>;
11782 +                               fsl,cpm-command = <0x16200300>;
11783 +                       };
11784 +
11785 +                       usb@11b60 {
11786 +                               #address-cells = <1>;
11787 +                               #size-cells = <0>;
11788 +                               compatible = "fsl,mpc8248-usb",
11789 +                                            "fsl,cpm2-usb";
11790 +                               reg = <0x11b60 0x18 0x8b00 0x100>;
11791 +                               interrupt-parent = <&PIC>;
11792 +                               interrupts = <11 8>;
11793 +                               fsl,cpm-command = <0x2e600000>;
11794 +                       };
11795 +               };
11796 +
11797 +               PIC: interrupt-controller@10c00 {
11798 +                       #interrupt-cells = <2>;
11799 +                       interrupt-controller;
11800 +                       reg = <0x10c00 0x80>;
11801 +                       compatible = "fsl,mpc8248-pic", "fsl,pq2-pic";
11802 +               };
11803 +       };
11804 +};
11805 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/haleakala.dts powerpc.git/arch/powerpc/boot/dts/haleakala.dts
11806 --- linux-2.6.24/arch/powerpc/boot/dts/haleakala.dts    1970-01-01 01:00:00.000000000 +0100
11807 +++ powerpc.git/arch/powerpc/boot/dts/haleakala.dts     2008-01-28 20:25:49.000000000 +0100
11808 @@ -0,0 +1,274 @@
11809 +/*
11810 + * Device Tree Source for AMCC Haleakala (405EXr)
11811 + *
11812 + * Copyright 2008 DENX Software Engineering, Stefan Roese <sr@denx.de>
11813 + *
11814 + * This file is licensed under the terms of the GNU General Public
11815 + * License version 2.  This program is licensed "as is" without
11816 + * any warranty of any kind, whether express or implied.
11817 + */
11818 +
11819 +/ {
11820 +       #address-cells = <1>;
11821 +       #size-cells = <1>;
11822 +       model = "amcc,haleakala";
11823 +       compatible = "amcc,kilauea";
11824 +       dcr-parent = <&/cpus/cpu@0>;
11825 +
11826 +       aliases {
11827 +               ethernet0 = &EMAC0;
11828 +               serial0 = &UART0;
11829 +               serial1 = &UART1;
11830 +       };
11831 +
11832 +       cpus {
11833 +               #address-cells = <1>;
11834 +               #size-cells = <0>;
11835 +
11836 +               cpu@0 {
11837 +                       device_type = "cpu";
11838 +                       model = "PowerPC,405EXr";
11839 +                       reg = <0>;
11840 +                       clock-frequency = <0>; /* Filled in by U-Boot */
11841 +                       timebase-frequency = <0>; /* Filled in by U-Boot */
11842 +                       i-cache-line-size = <20>;
11843 +                       d-cache-line-size = <20>;
11844 +                       i-cache-size = <4000>; /* 16 kB */
11845 +                       d-cache-size = <4000>; /* 16 kB */
11846 +                       dcr-controller;
11847 +                       dcr-access-method = "native";
11848 +               };
11849 +       };
11850 +
11851 +       memory {
11852 +               device_type = "memory";
11853 +               reg = <0 0>; /* Filled in by U-Boot */
11854 +       };
11855 +
11856 +       UIC0: interrupt-controller {
11857 +               compatible = "ibm,uic-405exr", "ibm,uic";
11858 +               interrupt-controller;
11859 +               cell-index = <0>;
11860 +               dcr-reg = <0c0 009>;
11861 +               #address-cells = <0>;
11862 +               #size-cells = <0>;
11863 +               #interrupt-cells = <2>;
11864 +       };
11865 +
11866 +       UIC1: interrupt-controller1 {
11867 +               compatible = "ibm,uic-405exr","ibm,uic";
11868 +               interrupt-controller;
11869 +               cell-index = <1>;
11870 +               dcr-reg = <0d0 009>;
11871 +               #address-cells = <0>;
11872 +               #size-cells = <0>;
11873 +               #interrupt-cells = <2>;
11874 +               interrupts = <1e 4 1f 4>; /* cascade */
11875 +               interrupt-parent = <&UIC0>;
11876 +       };
11877 +
11878 +       UIC2: interrupt-controller2 {
11879 +               compatible = "ibm,uic-405exr","ibm,uic";
11880 +               interrupt-controller;
11881 +               cell-index = <2>;
11882 +               dcr-reg = <0e0 009>;
11883 +               #address-cells = <0>;
11884 +               #size-cells = <0>;
11885 +               #interrupt-cells = <2>;
11886 +               interrupts = <1c 4 1d 4>; /* cascade */
11887 +               interrupt-parent = <&UIC0>;
11888 +       };
11889 +
11890 +       plb {
11891 +               compatible = "ibm,plb-405exr", "ibm,plb4";
11892 +               #address-cells = <1>;
11893 +               #size-cells = <1>;
11894 +               ranges;
11895 +               clock-frequency = <0>; /* Filled in by U-Boot */
11896 +
11897 +               SDRAM0: memory-controller {
11898 +                       compatible = "ibm,sdram-405exr";
11899 +                       dcr-reg = <010 2>;
11900 +               };
11901 +
11902 +               MAL0: mcmal {
11903 +                       compatible = "ibm,mcmal-405exr", "ibm,mcmal2";
11904 +                       dcr-reg = <180 62>;
11905 +                       num-tx-chans = <2>;
11906 +                       num-rx-chans = <2>;
11907 +                       interrupt-parent = <&MAL0>;
11908 +                       interrupts = <0 1 2 3 4>;
11909 +                       #interrupt-cells = <1>;
11910 +                       #address-cells = <0>;
11911 +                       #size-cells = <0>;
11912 +                       interrupt-map = </*TXEOB*/ 0 &UIC0 a 4
11913 +                                       /*RXEOB*/ 1 &UIC0 b 4
11914 +                                       /*SERR*/  2 &UIC1 0 4
11915 +                                       /*TXDE*/  3 &UIC1 1 4
11916 +                                       /*RXDE*/  4 &UIC1 2 4>;
11917 +                       interrupt-map-mask = <ffffffff>;
11918 +               };
11919 +
11920 +               POB0: opb {
11921 +                       compatible = "ibm,opb-405exr", "ibm,opb";
11922 +                       #address-cells = <1>;
11923 +                       #size-cells = <1>;
11924 +                       ranges = <80000000 80000000 10000000
11925 +                                 ef600000 ef600000 a00000
11926 +                                 f0000000 f0000000 10000000>;
11927 +                       dcr-reg = <0a0 5>;
11928 +                       clock-frequency = <0>; /* Filled in by U-Boot */
11929 +
11930 +                       EBC0: ebc {
11931 +                               compatible = "ibm,ebc-405exr", "ibm,ebc";
11932 +                               dcr-reg = <012 2>;
11933 +                               #address-cells = <2>;
11934 +                               #size-cells = <1>;
11935 +                               clock-frequency = <0>; /* Filled in by U-Boot */
11936 +                               /* ranges property is supplied by U-Boot */
11937 +                               interrupts = <5 1>;
11938 +                               interrupt-parent = <&UIC1>;
11939 +
11940 +                               nor_flash@0,0 {
11941 +                                       compatible = "amd,s29gl512n", "cfi-flash";
11942 +                                       bank-width = <2>;
11943 +                                       reg = <0 000000 4000000>;
11944 +                                       #address-cells = <1>;
11945 +                                       #size-cells = <1>;
11946 +                                       partition@0 {
11947 +                                               label = "kernel";
11948 +                                               reg = <0 200000>;
11949 +                                       };
11950 +                                       partition@200000 {
11951 +                                               label = "root";
11952 +                                               reg = <200000 200000>;
11953 +                                       };
11954 +                                       partition@400000 {
11955 +                                               label = "user";
11956 +                                               reg = <400000 3b60000>;
11957 +                                       };
11958 +                                       partition@3f60000 {
11959 +                                               label = "env";
11960 +                                               reg = <3f60000 40000>;
11961 +                                       };
11962 +                                       partition@3fa0000 {
11963 +                                               label = "u-boot";
11964 +                                               reg = <3fa0000 60000>;
11965 +                                       };
11966 +                               };
11967 +                       };
11968 +
11969 +                       UART0: serial@ef600200 {
11970 +                               device_type = "serial";
11971 +                               compatible = "ns16550";
11972 +                               reg = <ef600200 8>;
11973 +                               virtual-reg = <ef600200>;
11974 +                               clock-frequency = <0>; /* Filled in by U-Boot */
11975 +                               current-speed = <0>;
11976 +                               interrupt-parent = <&UIC0>;
11977 +                               interrupts = <1a 4>;
11978 +                       };
11979 +
11980 +                       UART1: serial@ef600300 {
11981 +                               device_type = "serial";
11982 +                               compatible = "ns16550";
11983 +                               reg = <ef600300 8>;
11984 +                               virtual-reg = <ef600300>;
11985 +                               clock-frequency = <0>; /* Filled in by U-Boot */
11986 +                               current-speed = <0>;
11987 +                               interrupt-parent = <&UIC0>;
11988 +                               interrupts = <1 4>;
11989 +                       };
11990 +
11991 +                       IIC0: i2c@ef600400 {
11992 +                               compatible = "ibm,iic-405exr", "ibm,iic";
11993 +                               reg = <ef600400 14>;
11994 +                               interrupt-parent = <&UIC0>;
11995 +                               interrupts = <2 4>;
11996 +                       };
11997 +
11998 +                       IIC1: i2c@ef600500 {
11999 +                               compatible = "ibm,iic-405exr", "ibm,iic";
12000 +                               reg = <ef600500 14>;
12001 +                               interrupt-parent = <&UIC0>;
12002 +                               interrupts = <7 4>;
12003 +                       };
12004 +
12005 +
12006 +                       RGMII0: emac-rgmii@ef600b00 {
12007 +                               compatible = "ibm,rgmii-405exr", "ibm,rgmii";
12008 +                               reg = <ef600b00 104>;
12009 +                               has-mdio;
12010 +                       };
12011 +
12012 +                       EMAC0: ethernet@ef600900 {
12013 +                               linux,network-index = <0>;
12014 +                               device_type = "network";
12015 +                               compatible = "ibm,emac-405exr", "ibm,emac4";
12016 +                               interrupt-parent = <&EMAC0>;
12017 +                               interrupts = <0 1>;
12018 +                               #interrupt-cells = <1>;
12019 +                               #address-cells = <0>;
12020 +                               #size-cells = <0>;
12021 +                               interrupt-map = </*Status*/ 0 &UIC0 18 4
12022 +                                               /*Wake*/  1 &UIC1 1d 4>;
12023 +                               reg = <ef600900 70>;
12024 +                               local-mac-address = [000000000000]; /* Filled in by U-Boot */
12025 +                               mal-device = <&MAL0>;
12026 +                               mal-tx-channel = <0>;
12027 +                               mal-rx-channel = <0>;
12028 +                               cell-index = <0>;
12029 +                               max-frame-size = <5dc>;
12030 +                               rx-fifo-size = <1000>;
12031 +                               tx-fifo-size = <800>;
12032 +                               phy-mode = "rgmii";
12033 +                               phy-map = <00000000>;
12034 +                               rgmii-device = <&RGMII0>;
12035 +                               rgmii-channel = <0>;
12036 +                               has-inverted-stacr-oc;
12037 +                               has-new-stacr-staopc;
12038 +                       };
12039 +               };
12040 +
12041 +               PCIE0: pciex@0a0000000 {
12042 +                       device_type = "pci";
12043 +                       #interrupt-cells = <1>;
12044 +                       #size-cells = <2>;
12045 +                       #address-cells = <3>;
12046 +                       compatible = "ibm,plb-pciex-405exr", "ibm,plb-pciex";
12047 +                       primary;
12048 +                       port = <0>; /* port number */
12049 +                       reg = <a0000000 20000000        /* Config space access */
12050 +                              ef000000 00001000>;      /* Registers */
12051 +                       dcr-reg = <040 020>;
12052 +                       sdr-base = <400>;
12053 +
12054 +                       /* Outbound ranges, one memory and one IO,
12055 +                        * later cannot be changed
12056 +                        */
12057 +                       ranges = <02000000 0 80000000 90000000 0 08000000
12058 +                                 01000000 0 00000000 e0000000 0 00010000>;
12059 +
12060 +                       /* Inbound 2GB range starting at 0 */
12061 +                       dma-ranges = <42000000 0 0 0 0 80000000>;
12062 +
12063 +                       /* This drives busses 0x00 to 0x3f */
12064 +                       bus-range = <00 3f>;
12065 +
12066 +                       /* Legacy interrupts (note the weird polarity, the bridge seems
12067 +                        * to invert PCIe legacy interrupts).
12068 +                        * We are de-swizzling here because the numbers are actually for
12069 +                        * port of the root complex virtual P2P bridge. But I want
12070 +                        * to avoid putting a node for it in the tree, so the numbers
12071 +                        * below are basically de-swizzled numbers.
12072 +                        * The real slot is on idsel 0, so the swizzling is 1:1
12073 +                        */
12074 +                       interrupt-map-mask = <0000 0 0 7>;
12075 +                       interrupt-map = <
12076 +                               0000 0 0 1 &UIC2 0 4 /* swizzled int A */
12077 +                               0000 0 0 2 &UIC2 1 4 /* swizzled int B */
12078 +                               0000 0 0 3 &UIC2 2 4 /* swizzled int C */
12079 +                               0000 0 0 4 &UIC2 3 4 /* swizzled int D */>;
12080 +               };
12081 +       };
12082 +};
12083 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/katmai.dts powerpc.git/arch/powerpc/boot/dts/katmai.dts
12084 --- linux-2.6.24/arch/powerpc/boot/dts/katmai.dts       1970-01-01 01:00:00.000000000 +0100
12085 +++ powerpc.git/arch/powerpc/boot/dts/katmai.dts        2008-01-28 20:25:49.000000000 +0100
12086 @@ -0,0 +1,400 @@
12087 +/*
12088 + * Device Tree Source for AMCC Katmai eval board
12089 + *
12090 + * Copyright (c) 2006, 2007 IBM Corp.
12091 + * Benjamin Herrenschmidt <benh@kernel.crashing.org>
12092 + *
12093 + * Copyright (c) 2006, 2007 IBM Corp.
12094 + * Josh Boyer <jwboyer@linux.vnet.ibm.com>
12095 + *
12096 + * This file is licensed under the terms of the GNU General Public
12097 + * License version 2.  This program is licensed "as is" without
12098 + * any warranty of any kind, whether express or implied.
12099 + */
12100 +
12101 +/ {
12102 +       #address-cells = <2>;
12103 +       #size-cells = <1>;
12104 +       model = "amcc,katmai";
12105 +       compatible = "amcc,katmai";
12106 +       dcr-parent = <&/cpus/cpu@0>;
12107 +
12108 +       aliases {
12109 +               ethernet0 = &EMAC0;
12110 +               serial0 = &UART0;
12111 +               serial1 = &UART1;
12112 +               serial2 = &UART2;
12113 +       };
12114 +
12115 +       cpus {
12116 +               #address-cells = <1>;
12117 +               #size-cells = <0>;
12118 +
12119 +               cpu@0 {
12120 +                       device_type = "cpu";
12121 +                       model = "PowerPC,440SPe";
12122 +                       reg = <0>;
12123 +                       clock-frequency = <0>; /* Filled in by zImage */
12124 +                       timebase-frequency = <0>; /* Filled in by zImage */
12125 +                       i-cache-line-size = <20>;
12126 +                       d-cache-line-size = <20>;
12127 +                       i-cache-size = <20000>;
12128 +                       d-cache-size = <20000>;
12129 +                       dcr-controller;
12130 +                       dcr-access-method = "native";
12131 +               };
12132 +       };
12133 +
12134 +       memory {
12135 +               device_type = "memory";
12136 +               reg = <0 0 0>; /* Filled in by zImage */
12137 +       };
12138 +
12139 +       UIC0: interrupt-controller0 {
12140 +               compatible = "ibm,uic-440spe","ibm,uic";
12141 +               interrupt-controller;
12142 +               cell-index = <0>;
12143 +               dcr-reg = <0c0 009>;
12144 +               #address-cells = <0>;
12145 +               #size-cells = <0>;
12146 +               #interrupt-cells = <2>;
12147 +       };
12148 +
12149 +       UIC1: interrupt-controller1 {
12150 +               compatible = "ibm,uic-440spe","ibm,uic";
12151 +               interrupt-controller;
12152 +               cell-index = <1>;
12153 +               dcr-reg = <0d0 009>;
12154 +               #address-cells = <0>;
12155 +               #size-cells = <0>;
12156 +               #interrupt-cells = <2>;
12157 +               interrupts = <1e 4 1f 4>; /* cascade */
12158 +               interrupt-parent = <&UIC0>;
12159 +       };
12160 +
12161 +       UIC2: interrupt-controller2 {
12162 +               compatible = "ibm,uic-440spe","ibm,uic";
12163 +               interrupt-controller;
12164 +               cell-index = <2>;
12165 +               dcr-reg = <0e0 009>;
12166 +               #address-cells = <0>;
12167 +               #size-cells = <0>;
12168 +               #interrupt-cells = <2>;
12169 +               interrupts = <a 4 b 4>; /* cascade */
12170 +               interrupt-parent = <&UIC0>;
12171 +       };
12172 +
12173 +       UIC3: interrupt-controller3 {
12174 +               compatible = "ibm,uic-440spe","ibm,uic";
12175 +               interrupt-controller;
12176 +               cell-index = <3>;
12177 +               dcr-reg = <0f0 009>;
12178 +               #address-cells = <0>;
12179 +               #size-cells = <0>;
12180 +               #interrupt-cells = <2>;
12181 +               interrupts = <10 4 11 4>; /* cascade */
12182 +               interrupt-parent = <&UIC0>;
12183 +       };
12184 +
12185 +       SDR0: sdr {
12186 +               compatible = "ibm,sdr-440spe";
12187 +               dcr-reg = <00e 002>;
12188 +       };
12189 +
12190 +       CPR0: cpr {
12191 +               compatible = "ibm,cpr-440spe";
12192 +               dcr-reg = <00c 002>;
12193 +       };
12194 +
12195 +       plb {
12196 +               compatible = "ibm,plb-440spe", "ibm,plb-440gp", "ibm,plb4";
12197 +               #address-cells = <2>;
12198 +               #size-cells = <1>;
12199 +               ranges;
12200 +               clock-frequency = <0>; /* Filled in by zImage */
12201 +
12202 +               SDRAM0: sdram {
12203 +                       compatible = "ibm,sdram-440spe", "ibm,sdram-405gp";
12204 +                       dcr-reg = <010 2>;
12205 +               };
12206 +
12207 +               MAL0: mcmal {
12208 +                       compatible = "ibm,mcmal-440spe", "ibm,mcmal2";
12209 +                       dcr-reg = <180 62>;
12210 +                       num-tx-chans = <2>;
12211 +                       num-rx-chans = <1>;
12212 +                       interrupt-parent = <&MAL0>;
12213 +                       interrupts = <0 1 2 3 4>;
12214 +                       #interrupt-cells = <1>;
12215 +                       #address-cells = <0>;
12216 +                       #size-cells = <0>;
12217 +                       interrupt-map = </*TXEOB*/ 0 &UIC1 6 4
12218 +                                        /*RXEOB*/ 1 &UIC1 7 4
12219 +                                        /*SERR*/  2 &UIC1 1 4
12220 +                                        /*TXDE*/  3 &UIC1 2 4
12221 +                                        /*RXDE*/  4 &UIC1 3 4>;
12222 +               };
12223 +
12224 +               POB0: opb {
12225 +                       compatible = "ibm,opb-440spe", "ibm,opb-440gp", "ibm,opb";
12226 +                       #address-cells = <1>;
12227 +                       #size-cells = <1>;
12228 +                       ranges = <00000000 4 e0000000 20000000>;
12229 +                       clock-frequency = <0>; /* Filled in by zImage */
12230 +
12231 +                       EBC0: ebc {
12232 +                               compatible = "ibm,ebc-440spe", "ibm,ebc-440gp", "ibm,ebc";
12233 +                               dcr-reg = <012 2>;
12234 +                               #address-cells = <2>;
12235 +                               #size-cells = <1>;
12236 +                               clock-frequency = <0>; /* Filled in by zImage */
12237 +                               interrupts = <5 1>;
12238 +                               interrupt-parent = <&UIC1>;
12239 +                       };
12240 +
12241 +                       UART0: serial@10000200 {
12242 +                               device_type = "serial";
12243 +                               compatible = "ns16550";
12244 +                               reg = <10000200 8>;
12245 +                               virtual-reg = <a0000200>;
12246 +                               clock-frequency = <0>; /* Filled in by zImage */
12247 +                               current-speed = <1c200>;
12248 +                               interrupt-parent = <&UIC0>;
12249 +                               interrupts = <0 4>;
12250 +                       };
12251 +
12252 +                       UART1: serial@10000300 {
12253 +                               device_type = "serial";
12254 +                               compatible = "ns16550";
12255 +                               reg = <10000300 8>;
12256 +                               virtual-reg = <a0000300>;
12257 +                               clock-frequency = <0>;
12258 +                               current-speed = <0>;
12259 +                               interrupt-parent = <&UIC0>;
12260 +                               interrupts = <1 4>;
12261 +                       };
12262 +
12263 +
12264 +                       UART2: serial@10000600 {
12265 +                               device_type = "serial";
12266 +                               compatible = "ns16550";
12267 +                               reg = <10000600 8>;
12268 +                               virtual-reg = <a0000600>;
12269 +                               clock-frequency = <0>;
12270 +                               current-speed = <0>;
12271 +                               interrupt-parent = <&UIC1>;
12272 +                               interrupts = <5 4>;
12273 +                       };
12274 +
12275 +                       IIC0: i2c@10000400 {
12276 +                               device_type = "i2c";
12277 +                               compatible = "ibm,iic-440spe", "ibm,iic-440gp", "ibm,iic";
12278 +                               reg = <10000400 14>;
12279 +                               interrupt-parent = <&UIC0>;
12280 +                               interrupts = <2 4>;
12281 +                       };
12282 +
12283 +                       IIC1: i2c@10000500 {
12284 +                               device_type = "i2c";
12285 +                               compatible = "ibm,iic-440spe", "ibm,iic-440gp", "ibm,iic";
12286 +                               reg = <10000500 14>;
12287 +                               interrupt-parent = <&UIC0>;
12288 +                               interrupts = <3 4>;
12289 +                       };
12290 +
12291 +                       EMAC0: ethernet@10000800 {
12292 +                               linux,network-index = <0>;
12293 +                               device_type = "network";
12294 +                               compatible = "ibm,emac-440spe", "ibm,emac4";
12295 +                               interrupt-parent = <&UIC1>;
12296 +                               interrupts = <1c 4 1d 4>;
12297 +                               reg = <10000800 70>;
12298 +                               local-mac-address = [000000000000];
12299 +                               mal-device = <&MAL0>;
12300 +                               mal-tx-channel = <0>;
12301 +                               mal-rx-channel = <0>;
12302 +                               cell-index = <0>;
12303 +                               max-frame-size = <5dc>;
12304 +                               rx-fifo-size = <1000>;
12305 +                               tx-fifo-size = <800>;
12306 +                               phy-mode = "gmii";
12307 +                               phy-map = <00000000>;
12308 +                               has-inverted-stacr-oc;
12309 +                               has-new-stacr-staopc;
12310 +                       };
12311 +               };
12312 +
12313 +               PCIX0: pci@c0ec00000 {
12314 +                       device_type = "pci";
12315 +                       #interrupt-cells = <1>;
12316 +                       #size-cells = <2>;
12317 +                       #address-cells = <3>;
12318 +                       compatible = "ibm,plb-pcix-440spe", "ibm,plb-pcix";
12319 +                       primary;
12320 +                       large-inbound-windows;
12321 +                       enable-msi-hole;
12322 +                       reg = <c 0ec00000   8   /* Config space access */
12323 +                              0 0 0            /* no IACK cycles */
12324 +                              c 0ed00000   4   /* Special cycles */
12325 +                              c 0ec80000 100   /* Internal registers */
12326 +                              c 0ec80100  fc>; /* Internal messaging registers */
12327 +
12328 +                       /* Outbound ranges, one memory and one IO,
12329 +                        * later cannot be changed
12330 +                        */
12331 +                       ranges = <02000000 0 80000000 0000000d 80000000 0 80000000
12332 +                                 01000000 0 00000000 0000000c 08000000 0 00010000>;
12333 +
12334 +                       /* Inbound 2GB range starting at 0 */
12335 +                       dma-ranges = <42000000 0 0 0 0 0 80000000>;
12336 +
12337 +                       /* This drives busses 0 to 0xf */
12338 +                       bus-range = <0 f>;
12339 +
12340 +                       /*
12341 +                        * On Katmai, the following PCI-X interrupts signals
12342 +                        * have to be enabled via jumpers (only INTA is
12343 +                        * enabled per default):
12344 +                        *
12345 +                        * INTB: J3: 1-2
12346 +                        * INTC: J2: 1-2
12347 +                        * INTD: J1: 1-2
12348 +                        */
12349 +                       interrupt-map-mask = <f800 0 0 7>;
12350 +                       interrupt-map = <
12351 +                               /* IDSEL 1 */
12352 +                               0800 0 0 1 &UIC1 14 8
12353 +                               0800 0 0 2 &UIC1 13 8
12354 +                               0800 0 0 3 &UIC1 12 8
12355 +                               0800 0 0 4 &UIC1 11 8
12356 +                       >;
12357 +               };
12358 +
12359 +               PCIE0: pciex@d00000000 {
12360 +                       device_type = "pci";
12361 +                       #interrupt-cells = <1>;
12362 +                       #size-cells = <2>;
12363 +                       #address-cells = <3>;
12364 +                       compatible = "ibm,plb-pciex-440spe", "ibm,plb-pciex";
12365 +                       primary;
12366 +                       port = <0>; /* port number */
12367 +                       reg = <d 00000000 20000000      /* Config space access */
12368 +                              c 10000000 00001000>;    /* Registers */
12369 +                       dcr-reg = <100 020>;
12370 +                       sdr-base = <300>;
12371 +
12372 +                       /* Outbound ranges, one memory and one IO,
12373 +                        * later cannot be changed
12374 +                        */
12375 +                       ranges = <02000000 0 80000000 0000000e 00000000 0 80000000
12376 +                                 01000000 0 00000000 0000000f 80000000 0 00010000>;
12377 +
12378 +                       /* Inbound 2GB range starting at 0 */
12379 +                       dma-ranges = <42000000 0 0 0 0 0 80000000>;
12380 +
12381 +                       /* This drives busses 10 to 0x1f */
12382 +                       bus-range = <10 1f>;
12383 +
12384 +                       /* Legacy interrupts (note the weird polarity, the bridge seems
12385 +                        * to invert PCIe legacy interrupts).
12386 +                        * We are de-swizzling here because the numbers are actually for
12387 +                        * port of the root complex virtual P2P bridge. But I want
12388 +                        * to avoid putting a node for it in the tree, so the numbers
12389 +                        * below are basically de-swizzled numbers.
12390 +                        * The real slot is on idsel 0, so the swizzling is 1:1
12391 +                        */
12392 +                       interrupt-map-mask = <0000 0 0 7>;
12393 +                       interrupt-map = <
12394 +                               0000 0 0 1 &UIC3 0 4 /* swizzled int A */
12395 +                               0000 0 0 2 &UIC3 1 4 /* swizzled int B */
12396 +                               0000 0 0 3 &UIC3 2 4 /* swizzled int C */
12397 +                               0000 0 0 4 &UIC3 3 4 /* swizzled int D */>;
12398 +               };
12399 +
12400 +               PCIE1: pciex@d20000000 {
12401 +                       device_type = "pci";
12402 +                       #interrupt-cells = <1>;
12403 +                       #size-cells = <2>;
12404 +                       #address-cells = <3>;
12405 +                       compatible = "ibm,plb-pciex-440spe", "ibm,plb-pciex";
12406 +                       primary;
12407 +                       port = <1>; /* port number */
12408 +                       reg = <d 20000000 20000000      /* Config space access */
12409 +                              c 10001000 00001000>;    /* Registers */
12410 +                       dcr-reg = <120 020>;
12411 +                       sdr-base = <340>;
12412 +
12413 +                       /* Outbound ranges, one memory and one IO,
12414 +                        * later cannot be changed
12415 +                        */
12416 +                       ranges = <02000000 0 80000000 0000000e 80000000 0 80000000
12417 +                                 01000000 0 00000000 0000000f 80010000 0 00010000>;
12418 +
12419 +                       /* Inbound 2GB range starting at 0 */
12420 +                       dma-ranges = <42000000 0 0 0 0 0 80000000>;
12421 +
12422 +                       /* This drives busses 10 to 0x1f */
12423 +                       bus-range = <20 2f>;
12424 +
12425 +                       /* Legacy interrupts (note the weird polarity, the bridge seems
12426 +                        * to invert PCIe legacy interrupts).
12427 +                        * We are de-swizzling here because the numbers are actually for
12428 +                        * port of the root complex virtual P2P bridge. But I want
12429 +                        * to avoid putting a node for it in the tree, so the numbers
12430 +                        * below are basically de-swizzled numbers.
12431 +                        * The real slot is on idsel 0, so the swizzling is 1:1
12432 +                        */
12433 +                       interrupt-map-mask = <0000 0 0 7>;
12434 +                       interrupt-map = <
12435 +                               0000 0 0 1 &UIC3 4 4 /* swizzled int A */
12436 +                               0000 0 0 2 &UIC3 5 4 /* swizzled int B */
12437 +                               0000 0 0 3 &UIC3 6 4 /* swizzled int C */
12438 +                               0000 0 0 4 &UIC3 7 4 /* swizzled int D */>;
12439 +               };
12440 +
12441 +               PCIE2: pciex@d40000000 {
12442 +                       device_type = "pci";
12443 +                       #interrupt-cells = <1>;
12444 +                       #size-cells = <2>;
12445 +                       #address-cells = <3>;
12446 +                       compatible = "ibm,plb-pciex-440spe", "ibm,plb-pciex";
12447 +                       primary;
12448 +                       port = <2>; /* port number */
12449 +                       reg = <d 40000000 20000000      /* Config space access */
12450 +                              c 10002000 00001000>;    /* Registers */
12451 +                       dcr-reg = <140 020>;
12452 +                       sdr-base = <370>;
12453 +
12454 +                       /* Outbound ranges, one memory and one IO,
12455 +                        * later cannot be changed
12456 +                        */
12457 +                       ranges = <02000000 0 80000000 0000000f 00000000 0 80000000
12458 +                                 01000000 0 00000000 0000000f 80020000 0 00010000>;
12459 +
12460 +                       /* Inbound 2GB range starting at 0 */
12461 +                       dma-ranges = <42000000 0 0 0 0 0 80000000>;
12462 +
12463 +                       /* This drives busses 10 to 0x1f */
12464 +                       bus-range = <30 3f>;
12465 +
12466 +                       /* Legacy interrupts (note the weird polarity, the bridge seems
12467 +                        * to invert PCIe legacy interrupts).
12468 +                        * We are de-swizzling here because the numbers are actually for
12469 +                        * port of the root complex virtual P2P bridge. But I want
12470 +                        * to avoid putting a node for it in the tree, so the numbers
12471 +                        * below are basically de-swizzled numbers.
12472 +                        * The real slot is on idsel 0, so the swizzling is 1:1
12473 +                        */
12474 +                       interrupt-map-mask = <0000 0 0 7>;
12475 +                       interrupt-map = <
12476 +                               0000 0 0 1 &UIC3 8 4 /* swizzled int A */
12477 +                               0000 0 0 2 &UIC3 9 4 /* swizzled int B */
12478 +                               0000 0 0 3 &UIC3 a 4 /* swizzled int C */
12479 +                               0000 0 0 4 &UIC3 b 4 /* swizzled int D */>;
12480 +               };
12481 +       };
12482 +
12483 +       chosen {
12484 +               linux,stdout-path = "/plb/opb/serial@10000200";
12485 +       };
12486 +};
12487 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/kilauea.dts powerpc.git/arch/powerpc/boot/dts/kilauea.dts
12488 --- linux-2.6.24/arch/powerpc/boot/dts/kilauea.dts      2008-01-24 23:58:37.000000000 +0100
12489 +++ powerpc.git/arch/powerpc/boot/dts/kilauea.dts       2008-01-28 20:25:49.000000000 +0100
12490 @@ -13,14 +13,22 @@
12491         #size-cells = <1>;
12492         model = "amcc,kilauea";
12493         compatible = "amcc,kilauea";
12494 -       dcr-parent = <&/cpus/PowerPC,405EX@0>;
12495 +       dcr-parent = <&/cpus/cpu@0>;
12496 +
12497 +       aliases {
12498 +               ethernet0 = &EMAC0;
12499 +               ethernet1 = &EMAC1;
12500 +               serial0 = &UART0;
12501 +               serial1 = &UART1;
12502 +       };
12503  
12504         cpus {
12505                 #address-cells = <1>;
12506                 #size-cells = <0>;
12507  
12508 -               PowerPC,405EX@0 {
12509 +               cpu@0 {
12510                         device_type = "cpu";
12511 +                       model = "PowerPC,405EX";
12512                         reg = <0>;
12513                         clock-frequency = <0>; /* Filled in by U-Boot */
12514                         timebase-frequency = <0>; /* Filled in by U-Boot */
12515 @@ -194,6 +202,7 @@
12516                                 device_type = "rgmii-interface";
12517                                 compatible = "ibm,rgmii-405ex", "ibm,rgmii";
12518                                 reg = <ef600b00 104>;
12519 +                               has-mdio;
12520                         };
12521  
12522                         EMAC0: ethernet@ef600900 {
12523 @@ -220,6 +229,8 @@
12524                                 phy-map = <00000000>;
12525                                 rgmii-device = <&RGMII0>;
12526                                 rgmii-channel = <0>;
12527 +                               has-inverted-stacr-oc;
12528 +                               has-new-stacr-staopc;
12529                         };
12530  
12531                         EMAC1: ethernet@ef600a00 {
12532 @@ -246,7 +257,91 @@
12533                                 phy-map = <00000000>;
12534                                 rgmii-device = <&RGMII0>;
12535                                 rgmii-channel = <1>;
12536 +                               has-inverted-stacr-oc;
12537 +                               has-new-stacr-staopc;
12538                         };
12539                 };
12540 +
12541 +               PCIE0: pciex@0a0000000 {
12542 +                       device_type = "pci";
12543 +                       #interrupt-cells = <1>;
12544 +                       #size-cells = <2>;
12545 +                       #address-cells = <3>;
12546 +                       compatible = "ibm,plb-pciex-405ex", "ibm,plb-pciex";
12547 +                       primary;
12548 +                       port = <0>; /* port number */
12549 +                       reg = <a0000000 20000000        /* Config space access */
12550 +                              ef000000 00001000>;      /* Registers */
12551 +                       dcr-reg = <040 020>;
12552 +                       sdr-base = <400>;
12553 +
12554 +                       /* Outbound ranges, one memory and one IO,
12555 +                        * later cannot be changed
12556 +                        */
12557 +                       ranges = <02000000 0 80000000 90000000 0 08000000
12558 +                                 01000000 0 00000000 e0000000 0 00010000>;
12559 +
12560 +                       /* Inbound 2GB range starting at 0 */
12561 +                       dma-ranges = <42000000 0 0 0 0 80000000>;
12562 +
12563 +                       /* This drives busses 0x00 to 0x3f */
12564 +                       bus-range = <00 3f>;
12565 +
12566 +                       /* Legacy interrupts (note the weird polarity, the bridge seems
12567 +                        * to invert PCIe legacy interrupts).
12568 +                        * We are de-swizzling here because the numbers are actually for
12569 +                        * port of the root complex virtual P2P bridge. But I want
12570 +                        * to avoid putting a node for it in the tree, so the numbers
12571 +                        * below are basically de-swizzled numbers.
12572 +                        * The real slot is on idsel 0, so the swizzling is 1:1
12573 +                        */
12574 +                       interrupt-map-mask = <0000 0 0 7>;
12575 +                       interrupt-map = <
12576 +                               0000 0 0 1 &UIC2 0 4 /* swizzled int A */
12577 +                               0000 0 0 2 &UIC2 1 4 /* swizzled int B */
12578 +                               0000 0 0 3 &UIC2 2 4 /* swizzled int C */
12579 +                               0000 0 0 4 &UIC2 3 4 /* swizzled int D */>;
12580 +               };
12581 +
12582 +               PCIE1: pciex@0c0000000 {
12583 +                       device_type = "pci";
12584 +                       #interrupt-cells = <1>;
12585 +                       #size-cells = <2>;
12586 +                       #address-cells = <3>;
12587 +                       compatible = "ibm,plb-pciex-405ex", "ibm,plb-pciex";
12588 +                       primary;
12589 +                       port = <1>; /* port number */
12590 +                       reg = <c0000000 20000000        /* Config space access */
12591 +                              ef001000 00001000>;      /* Registers */
12592 +                       dcr-reg = <060 020>;
12593 +                       sdr-base = <440>;
12594 +
12595 +                       /* Outbound ranges, one memory and one IO,
12596 +                        * later cannot be changed
12597 +                        */
12598 +                       ranges = <02000000 0 80000000 98000000 0 08000000
12599 +                                 01000000 0 00000000 e0010000 0 00010000>;
12600 +
12601 +                       /* Inbound 2GB range starting at 0 */
12602 +                       dma-ranges = <42000000 0 0 0 0 80000000>;
12603 +
12604 +                       /* This drives busses 0x40 to 0x7f */
12605 +                       bus-range = <40 7f>;
12606 +
12607 +                       /* Legacy interrupts (note the weird polarity, the bridge seems
12608 +                        * to invert PCIe legacy interrupts).
12609 +                        * We are de-swizzling here because the numbers are actually for
12610 +                        * port of the root complex virtual P2P bridge. But I want
12611 +                        * to avoid putting a node for it in the tree, so the numbers
12612 +                        * below are basically de-swizzled numbers.
12613 +                        * The real slot is on idsel 0, so the swizzling is 1:1
12614 +                        */
12615 +                       interrupt-map-mask = <0000 0 0 7>;
12616 +                       interrupt-map = <
12617 +                               0000 0 0 1 &UIC2 b 4 /* swizzled int A */
12618 +                               0000 0 0 2 &UIC2 c 4 /* swizzled int B */
12619 +                               0000 0 0 3 &UIC2 d 4 /* swizzled int C */
12620 +                               0000 0 0 4 &UIC2 e 4 /* swizzled int D */>;
12621 +               };
12622         };
12623  };
12624 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/kuroboxHD.dts powerpc.git/arch/powerpc/boot/dts/kuroboxHD.dts
12625 --- linux-2.6.24/arch/powerpc/boot/dts/kuroboxHD.dts    2008-01-24 23:58:37.000000000 +0100
12626 +++ powerpc.git/arch/powerpc/boot/dts/kuroboxHD.dts     2008-01-28 20:25:49.000000000 +0100
12627 @@ -23,6 +23,12 @@
12628         #address-cells = <1>;
12629         #size-cells = <1>;
12630  
12631 +       aliases {
12632 +               serial0 = &serial0;
12633 +               serial1 = &serial1;
12634 +               pci0 = &pci0;
12635 +       };
12636 +
12637         cpus {
12638                 #address-cells = <1>;
12639                 #size-cells = <0>;
12640 @@ -60,7 +66,7 @@
12641                 i2c@80003000 {
12642                         #address-cells = <1>;
12643                         #size-cells = <0>;
12644 -                       device_type = "i2c";
12645 +                       cell-index = <0>;
12646                         compatible = "fsl-i2c";
12647                         reg = <80003000 1000>;
12648                         interrupts = <5 2>;
12649 @@ -73,7 +79,8 @@
12650                         };
12651                 };
12652  
12653 -               serial@80004500 {
12654 +               serial0: serial@80004500 {
12655 +                       cell-index = <0>;
12656                         device_type = "serial";
12657                         compatible = "ns16550";
12658                         reg = <80004500 8>;
12659 @@ -83,7 +90,8 @@
12660                         interrupt-parent = <&mpic>;
12661                 };
12662  
12663 -               serial@80004600 {
12664 +               serial1: serial@80004600 {
12665 +                       cell-index = <1>;
12666                         device_type = "serial";
12667                         compatible = "ns16550";
12668                         reg = <80004600 8>;
12669 @@ -102,7 +110,7 @@
12670                         reg = <80040000 40000>;
12671                 };
12672  
12673 -               pci@fec00000 {
12674 +               pci0: pci@fec00000 {
12675                         #address-cells = <3>;
12676                         #size-cells = <2>;
12677                         #interrupt-cells = <1>;
12678 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/kuroboxHG.dts powerpc.git/arch/powerpc/boot/dts/kuroboxHG.dts
12679 --- linux-2.6.24/arch/powerpc/boot/dts/kuroboxHG.dts    2008-01-24 23:58:37.000000000 +0100
12680 +++ powerpc.git/arch/powerpc/boot/dts/kuroboxHG.dts     2008-01-28 20:25:49.000000000 +0100
12681 @@ -23,6 +23,12 @@
12682         #address-cells = <1>;
12683         #size-cells = <1>;
12684  
12685 +       aliases {
12686 +               serial0 = &serial0;
12687 +               serial1 = &serial1;
12688 +               pci0 = &pci0;
12689 +       };
12690 +
12691         cpus {
12692                 #address-cells = <1>;
12693                 #size-cells = <0>;
12694 @@ -60,7 +66,7 @@
12695                 i2c@80003000 {
12696                         #address-cells = <1>;
12697                         #size-cells = <0>;
12698 -                       device_type = "i2c";
12699 +                       cell-index = <0>;
12700                         compatible = "fsl-i2c";
12701                         reg = <80003000 1000>;
12702                         interrupts = <5 2>;
12703 @@ -73,7 +79,8 @@
12704                         };
12705                 };
12706  
12707 -               serial@80004500 {
12708 +               serial0: serial@80004500 {
12709 +                       cell-index = <0>;
12710                         device_type = "serial";
12711                         compatible = "ns16550";
12712                         reg = <80004500 8>;
12713 @@ -83,7 +90,8 @@
12714                         interrupt-parent = <&mpic>;
12715                 };
12716  
12717 -               serial@80004600 {
12718 +               serial1: serial@80004600 {
12719 +                       cell-index = <1>;
12720                         device_type = "serial";
12721                         compatible = "ns16550";
12722                         reg = <80004600 8>;
12723 @@ -102,7 +110,7 @@
12724                         reg = <80040000 40000>;
12725                 };
12726  
12727 -               pci@fec00000 {
12728 +               pci0: pci@fec00000 {
12729                         #address-cells = <3>;
12730                         #size-cells = <2>;
12731                         #interrupt-cells = <1>;
12732 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/lite5200.dts powerpc.git/arch/powerpc/boot/dts/lite5200.dts
12733 --- linux-2.6.24/arch/powerpc/boot/dts/lite5200.dts     2008-01-24 23:58:37.000000000 +0100
12734 +++ powerpc.git/arch/powerpc/boot/dts/lite5200.dts      2008-01-28 20:25:49.000000000 +0100
12735 @@ -19,7 +19,7 @@
12736  / {
12737         model = "fsl,lite5200";
12738         // revision = "1.0";
12739 -       compatible = "fsl,lite5200","generic-mpc5200";
12740 +       compatible = "fsl,lite5200";
12741         #address-cells = <1>;
12742         #size-cells = <1>;
12743  
12744 @@ -284,7 +284,8 @@
12745                 };
12746  
12747                 i2c@3d00 {
12748 -                       device_type = "i2c";
12749 +                       #address-cells = <1>;
12750 +                       #size-cells = <0>;
12751                         compatible = "mpc5200-i2c","fsl-i2c";
12752                         cell-index = <0>;
12753                         reg = <3d00 40>;
12754 @@ -294,7 +295,8 @@
12755                 };
12756  
12757                 i2c@3d40 {
12758 -                       device_type = "i2c";
12759 +                       #address-cells = <1>;
12760 +                       #size-cells = <0>;
12761                         compatible = "mpc5200-i2c","fsl-i2c";
12762                         cell-index = <1>;
12763                         reg = <3d40 40>;
12764 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/lite5200b.dts powerpc.git/arch/powerpc/boot/dts/lite5200b.dts
12765 --- linux-2.6.24/arch/powerpc/boot/dts/lite5200b.dts    2008-01-24 23:58:37.000000000 +0100
12766 +++ powerpc.git/arch/powerpc/boot/dts/lite5200b.dts     2008-01-28 20:25:49.000000000 +0100
12767 @@ -19,7 +19,7 @@
12768  / {
12769         model = "fsl,lite5200b";
12770         // revision = "1.0";
12771 -       compatible = "fsl,lite5200b","generic-mpc5200";
12772 +       compatible = "fsl,lite5200b";
12773         #address-cells = <1>;
12774         #size-cells = <1>;
12775  
12776 @@ -300,7 +300,8 @@
12777                 };
12778  
12779                 i2c@3d00 {
12780 -                       device_type = "i2c";
12781 +                       #address-cells = <1>;
12782 +                       #size-cells = <0>;
12783                         compatible = "mpc5200b-i2c","mpc5200-i2c","fsl-i2c";
12784                         cell-index = <0>;
12785                         reg = <3d00 40>;
12786 @@ -310,7 +311,8 @@
12787                 };
12788  
12789                 i2c@3d40 {
12790 -                       device_type = "i2c";
12791 +                       #address-cells = <1>;
12792 +                       #size-cells = <0>;
12793                         compatible = "mpc5200b-i2c","mpc5200-i2c","fsl-i2c";
12794                         cell-index = <1>;
12795                         reg = <3d40 40>;
12796 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/makalu.dts powerpc.git/arch/powerpc/boot/dts/makalu.dts
12797 --- linux-2.6.24/arch/powerpc/boot/dts/makalu.dts       1970-01-01 01:00:00.000000000 +0100
12798 +++ powerpc.git/arch/powerpc/boot/dts/makalu.dts        2008-01-28 20:25:49.000000000 +0100
12799 @@ -0,0 +1,347 @@
12800 +/*
12801 + * Device Tree Source for AMCC Makalu (405EX)
12802 + *
12803 + * Copyright 2007 DENX Software Engineering, Stefan Roese <sr@denx.de>
12804 + *
12805 + * This file is licensed under the terms of the GNU General Public
12806 + * License version 2.  This program is licensed "as is" without
12807 + * any warranty of any kind, whether express or implied.
12808 + */
12809 +
12810 +/ {
12811 +       #address-cells = <1>;
12812 +       #size-cells = <1>;
12813 +       model = "amcc,makalu";
12814 +       compatible = "amcc,makalu";
12815 +       dcr-parent = <&/cpus/cpu@0>;
12816 +
12817 +       aliases {
12818 +               ethernet0 = &EMAC0;
12819 +               ethernet1 = &EMAC1;
12820 +               serial0 = &UART0;
12821 +               serial1 = &UART1;
12822 +       };
12823 +
12824 +       cpus {
12825 +               #address-cells = <1>;
12826 +               #size-cells = <0>;
12827 +
12828 +               cpu@0 {
12829 +                       device_type = "cpu";
12830 +                       model = "PowerPC,405EX";
12831 +                       reg = <0>;
12832 +                       clock-frequency = <0>; /* Filled in by U-Boot */
12833 +                       timebase-frequency = <0>; /* Filled in by U-Boot */
12834 +                       i-cache-line-size = <20>;
12835 +                       d-cache-line-size = <20>;
12836 +                       i-cache-size = <4000>; /* 16 kB */
12837 +                       d-cache-size = <4000>; /* 16 kB */
12838 +                       dcr-controller;
12839 +                       dcr-access-method = "native";
12840 +               };
12841 +       };
12842 +
12843 +       memory {
12844 +               device_type = "memory";
12845 +               reg = <0 0>; /* Filled in by U-Boot */
12846 +       };
12847 +
12848 +       UIC0: interrupt-controller {
12849 +               compatible = "ibm,uic-405ex", "ibm,uic";
12850 +               interrupt-controller;
12851 +               cell-index = <0>;
12852 +               dcr-reg = <0c0 009>;
12853 +               #address-cells = <0>;
12854 +               #size-cells = <0>;
12855 +               #interrupt-cells = <2>;
12856 +       };
12857 +
12858 +       UIC1: interrupt-controller1 {
12859 +               compatible = "ibm,uic-405ex","ibm,uic";
12860 +               interrupt-controller;
12861 +               cell-index = <1>;
12862 +               dcr-reg = <0d0 009>;
12863 +               #address-cells = <0>;
12864 +               #size-cells = <0>;
12865 +               #interrupt-cells = <2>;
12866 +               interrupts = <1e 4 1f 4>; /* cascade */
12867 +               interrupt-parent = <&UIC0>;
12868 +       };
12869 +
12870 +       UIC2: interrupt-controller2 {
12871 +               compatible = "ibm,uic-405ex","ibm,uic";
12872 +               interrupt-controller;
12873 +               cell-index = <2>;
12874 +               dcr-reg = <0e0 009>;
12875 +               #address-cells = <0>;
12876 +               #size-cells = <0>;
12877 +               #interrupt-cells = <2>;
12878 +               interrupts = <1c 4 1d 4>; /* cascade */
12879 +               interrupt-parent = <&UIC0>;
12880 +       };
12881 +
12882 +       plb {
12883 +               compatible = "ibm,plb-405ex", "ibm,plb4";
12884 +               #address-cells = <1>;
12885 +               #size-cells = <1>;
12886 +               ranges;
12887 +               clock-frequency = <0>; /* Filled in by U-Boot */
12888 +
12889 +               SDRAM0: memory-controller {
12890 +                       compatible = "ibm,sdram-405ex";
12891 +                       dcr-reg = <010 2>;
12892 +               };
12893 +
12894 +               MAL0: mcmal {
12895 +                       compatible = "ibm,mcmal-405ex", "ibm,mcmal2";
12896 +                       dcr-reg = <180 62>;
12897 +                       num-tx-chans = <2>;
12898 +                       num-rx-chans = <2>;
12899 +                       interrupt-parent = <&MAL0>;
12900 +                       interrupts = <0 1 2 3 4>;
12901 +                       #interrupt-cells = <1>;
12902 +                       #address-cells = <0>;
12903 +                       #size-cells = <0>;
12904 +                       interrupt-map = </*TXEOB*/ 0 &UIC0 a 4
12905 +                                       /*RXEOB*/ 1 &UIC0 b 4
12906 +                                       /*SERR*/  2 &UIC1 0 4
12907 +                                       /*TXDE*/  3 &UIC1 1 4
12908 +                                       /*RXDE*/  4 &UIC1 2 4>;
12909 +                       interrupt-map-mask = <ffffffff>;
12910 +               };
12911 +
12912 +               POB0: opb {
12913 +                       compatible = "ibm,opb-405ex", "ibm,opb";
12914 +                       #address-cells = <1>;
12915 +                       #size-cells = <1>;
12916 +                       ranges = <80000000 80000000 10000000
12917 +                                 ef600000 ef600000 a00000
12918 +                                 f0000000 f0000000 10000000>;
12919 +                       dcr-reg = <0a0 5>;
12920 +                       clock-frequency = <0>; /* Filled in by U-Boot */
12921 +
12922 +                       EBC0: ebc {
12923 +                               compatible = "ibm,ebc-405ex", "ibm,ebc";
12924 +                               dcr-reg = <012 2>;
12925 +                               #address-cells = <2>;
12926 +                               #size-cells = <1>;
12927 +                               clock-frequency = <0>; /* Filled in by U-Boot */
12928 +                               /* ranges property is supplied by U-Boot */
12929 +                               interrupts = <5 1>;
12930 +                               interrupt-parent = <&UIC1>;
12931 +
12932 +                               nor_flash@0,0 {
12933 +                                       compatible = "amd,s29gl512n", "cfi-flash";
12934 +                                       bank-width = <2>;
12935 +                                       reg = <0 000000 4000000>;
12936 +                                       #address-cells = <1>;
12937 +                                       #size-cells = <1>;
12938 +                                       partition@0 {
12939 +                                               label = "kernel";
12940 +                                               reg = <0 200000>;
12941 +                                       };
12942 +                                       partition@200000 {
12943 +                                               label = "root";
12944 +                                               reg = <200000 200000>;
12945 +                                       };
12946 +                                       partition@400000 {
12947 +                                               label = "user";
12948 +                                               reg = <400000 3b60000>;
12949 +                                       };
12950 +                                       partition@3f60000 {
12951 +                                               label = "env";
12952 +                                               reg = <3f60000 40000>;
12953 +                                       };
12954 +                                       partition@3fa0000 {
12955 +                                               label = "u-boot";
12956 +                                               reg = <3fa0000 60000>;
12957 +                                       };
12958 +                               };
12959 +                       };
12960 +
12961 +                       UART0: serial@ef600200 {
12962 +                               device_type = "serial";
12963 +                               compatible = "ns16550";
12964 +                               reg = <ef600200 8>;
12965 +                               virtual-reg = <ef600200>;
12966 +                               clock-frequency = <0>; /* Filled in by U-Boot */
12967 +                               current-speed = <0>;
12968 +                               interrupt-parent = <&UIC0>;
12969 +                               interrupts = <1a 4>;
12970 +                       };
12971 +
12972 +                       UART1: serial@ef600300 {
12973 +                               device_type = "serial";
12974 +                               compatible = "ns16550";
12975 +                               reg = <ef600300 8>;
12976 +                               virtual-reg = <ef600300>;
12977 +                               clock-frequency = <0>; /* Filled in by U-Boot */
12978 +                               current-speed = <0>;
12979 +                               interrupt-parent = <&UIC0>;
12980 +                               interrupts = <1 4>;
12981 +                       };
12982 +
12983 +                       IIC0: i2c@ef600400 {
12984 +                               device_type = "i2c";
12985 +                               compatible = "ibm,iic-405ex", "ibm,iic";
12986 +                               reg = <ef600400 14>;
12987 +                               interrupt-parent = <&UIC0>;
12988 +                               interrupts = <2 4>;
12989 +                       };
12990 +
12991 +                       IIC1: i2c@ef600500 {
12992 +                               device_type = "i2c";
12993 +                               compatible = "ibm,iic-405ex", "ibm,iic";
12994 +                               reg = <ef600500 14>;
12995 +                               interrupt-parent = <&UIC0>;
12996 +                               interrupts = <7 4>;
12997 +                       };
12998 +
12999 +
13000 +                       RGMII0: emac-rgmii@ef600b00 {
13001 +                               device_type = "rgmii-interface";
13002 +                               compatible = "ibm,rgmii-405ex", "ibm,rgmii";
13003 +                               reg = <ef600b00 104>;
13004 +                               has-mdio;
13005 +                       };
13006 +
13007 +                       EMAC0: ethernet@ef600900 {
13008 +                               linux,network-index = <0>;
13009 +                               device_type = "network";
13010 +                               compatible = "ibm,emac-405ex", "ibm,emac4";
13011 +                               interrupt-parent = <&EMAC0>;
13012 +                               interrupts = <0 1>;
13013 +                               #interrupt-cells = <1>;
13014 +                               #address-cells = <0>;
13015 +                               #size-cells = <0>;
13016 +                               interrupt-map = </*Status*/ 0 &UIC0 18 4
13017 +                                               /*Wake*/  1 &UIC1 1d 4>;
13018 +                               reg = <ef600900 70>;
13019 +                               local-mac-address = [000000000000]; /* Filled in by U-Boot */
13020 +                               mal-device = <&MAL0>;
13021 +                               mal-tx-channel = <0>;
13022 +                               mal-rx-channel = <0>;
13023 +                               cell-index = <0>;
13024 +                               max-frame-size = <5dc>;
13025 +                               rx-fifo-size = <1000>;
13026 +                               tx-fifo-size = <800>;
13027 +                               phy-mode = "rgmii";
13028 +                               phy-map = <0000003f>;   /* Start at 6 */
13029 +                               rgmii-device = <&RGMII0>;
13030 +                               rgmii-channel = <0>;
13031 +                               has-inverted-stacr-oc;
13032 +                               has-new-stacr-staopc;
13033 +                       };
13034 +
13035 +                       EMAC1: ethernet@ef600a00 {
13036 +                               linux,network-index = <1>;
13037 +                               device_type = "network";
13038 +                               compatible = "ibm,emac-405ex", "ibm,emac4";
13039 +                               interrupt-parent = <&EMAC1>;
13040 +                               interrupts = <0 1>;
13041 +                               #interrupt-cells = <1>;
13042 +                               #address-cells = <0>;
13043 +                               #size-cells = <0>;
13044 +                               interrupt-map = </*Status*/ 0 &UIC0 19 4
13045 +                                               /*Wake*/  1 &UIC1 1f 4>;
13046 +                               reg = <ef600a00 70>;
13047 +                               local-mac-address = [000000000000]; /* Filled in by U-Boot */
13048 +                               mal-device = <&MAL0>;
13049 +                               mal-tx-channel = <1>;
13050 +                               mal-rx-channel = <1>;
13051 +                               cell-index = <1>;
13052 +                               max-frame-size = <5dc>;
13053 +                               rx-fifo-size = <1000>;
13054 +                               tx-fifo-size = <800>;
13055 +                               phy-mode = "rgmii";
13056 +                               phy-map = <00000000>;
13057 +                               rgmii-device = <&RGMII0>;
13058 +                               rgmii-channel = <1>;
13059 +                               has-inverted-stacr-oc;
13060 +                               has-new-stacr-staopc;
13061 +                       };
13062 +               };
13063 +
13064 +               PCIE0: pciex@0a0000000 {
13065 +                       device_type = "pci";
13066 +                       #interrupt-cells = <1>;
13067 +                       #size-cells = <2>;
13068 +                       #address-cells = <3>;
13069 +                       compatible = "ibm,plb-pciex-405ex", "ibm,plb-pciex";
13070 +                       primary;
13071 +                       port = <0>; /* port number */
13072 +                       reg = <a0000000 20000000        /* Config space access */
13073 +                              ef000000 00001000>;      /* Registers */
13074 +                       dcr-reg = <040 020>;
13075 +                       sdr-base = <400>;
13076 +
13077 +                       /* Outbound ranges, one memory and one IO,
13078 +                        * later cannot be changed
13079 +                        */
13080 +                       ranges = <02000000 0 80000000 90000000 0 08000000
13081 +                                 01000000 0 00000000 e0000000 0 00010000>;
13082 +
13083 +                       /* Inbound 2GB range starting at 0 */
13084 +                       dma-ranges = <42000000 0 0 0 0 80000000>;
13085 +
13086 +                       /* This drives busses 0x00 to 0x3f */
13087 +                       bus-range = <00 3f>;
13088 +
13089 +                       /* Legacy interrupts (note the weird polarity, the bridge seems
13090 +                        * to invert PCIe legacy interrupts).
13091 +                        * We are de-swizzling here because the numbers are actually for
13092 +                        * port of the root complex virtual P2P bridge. But I want
13093 +                        * to avoid putting a node for it in the tree, so the numbers
13094 +                        * below are basically de-swizzled numbers.
13095 +                        * The real slot is on idsel 0, so the swizzling is 1:1
13096 +                        */
13097 +                       interrupt-map-mask = <0000 0 0 7>;
13098 +                       interrupt-map = <
13099 +                               0000 0 0 1 &UIC2 0 4 /* swizzled int A */
13100 +                               0000 0 0 2 &UIC2 1 4 /* swizzled int B */
13101 +                               0000 0 0 3 &UIC2 2 4 /* swizzled int C */
13102 +                               0000 0 0 4 &UIC2 3 4 /* swizzled int D */>;
13103 +               };
13104 +
13105 +               PCIE1: pciex@0c0000000 {
13106 +                       device_type = "pci";
13107 +                       #interrupt-cells = <1>;
13108 +                       #size-cells = <2>;
13109 +                       #address-cells = <3>;
13110 +                       compatible = "ibm,plb-pciex-405ex", "ibm,plb-pciex";
13111 +                       primary;
13112 +                       port = <1>; /* port number */
13113 +                       reg = <c0000000 20000000        /* Config space access */
13114 +                              ef001000 00001000>;      /* Registers */
13115 +                       dcr-reg = <060 020>;
13116 +                       sdr-base = <440>;
13117 +
13118 +                       /* Outbound ranges, one memory and one IO,
13119 +                        * later cannot be changed
13120 +                        */
13121 +                       ranges = <02000000 0 80000000 98000000 0 08000000
13122 +                                 01000000 0 00000000 e0010000 0 00010000>;
13123 +
13124 +                       /* Inbound 2GB range starting at 0 */
13125 +                       dma-ranges = <42000000 0 0 0 0 80000000>;
13126 +
13127 +                       /* This drives busses 0x40 to 0x7f */
13128 +                       bus-range = <40 7f>;
13129 +
13130 +                       /* Legacy interrupts (note the weird polarity, the bridge seems
13131 +                        * to invert PCIe legacy interrupts).
13132 +                        * We are de-swizzling here because the numbers are actually for
13133 +                        * port of the root complex virtual P2P bridge. But I want
13134 +                        * to avoid putting a node for it in the tree, so the numbers
13135 +                        * below are basically de-swizzled numbers.
13136 +                        * The real slot is on idsel 0, so the swizzling is 1:1
13137 +                        */
13138 +                       interrupt-map-mask = <0000 0 0 7>;
13139 +                       interrupt-map = <
13140 +                               0000 0 0 1 &UIC2 b 4 /* swizzled int A */
13141 +                               0000 0 0 2 &UIC2 c 4 /* swizzled int B */
13142 +                               0000 0 0 3 &UIC2 d 4 /* swizzled int C */
13143 +                               0000 0 0 4 &UIC2 e 4 /* swizzled int D */>;
13144 +               };
13145 +       };
13146 +};
13147 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/motionpro.dts powerpc.git/arch/powerpc/boot/dts/motionpro.dts
13148 --- linux-2.6.24/arch/powerpc/boot/dts/motionpro.dts    1970-01-01 01:00:00.000000000 +0100
13149 +++ powerpc.git/arch/powerpc/boot/dts/motionpro.dts     2008-01-28 20:25:49.000000000 +0100
13150 @@ -0,0 +1,309 @@
13151 +/*
13152 + * Motion-PRO board Device Tree Source
13153 + *
13154 + * Copyright (C) 2007 Semihalf
13155 + * Marian Balakowicz <m8@semihalf.com>
13156 + *
13157 + * This program is free software; you can redistribute  it and/or modify it
13158 + * under  the terms of  the GNU General  Public License as published by the
13159 + * Free Software Foundation;  either version 2 of the  License, or (at your
13160 + * option) any later version.
13161 + */
13162 +
13163 +/*
13164 + * WARNING: Do not depend on this tree layout remaining static just yet.
13165 + * The MPC5200 device tree conventions are still in flux
13166 + * Keep an eye on the linuxppc-dev mailing list for more details
13167 + */
13168 +
13169 +/ {
13170 +       model = "promess,motionpro";
13171 +       compatible = "promess,motionpro";
13172 +       #address-cells = <1>;
13173 +       #size-cells = <1>;
13174 +
13175 +       cpus {
13176 +               #address-cells = <1>;
13177 +               #size-cells = <0>;
13178 +
13179 +               PowerPC,5200@0 {
13180 +                       device_type = "cpu";
13181 +                       reg = <0>;
13182 +                       d-cache-line-size = <20>;
13183 +                       i-cache-line-size = <20>;
13184 +                       d-cache-size = <4000>;          // L1, 16K
13185 +                       i-cache-size = <4000>;          // L1, 16K
13186 +                       timebase-frequency = <0>;       // from bootloader
13187 +                       bus-frequency = <0>;            // from bootloader
13188 +                       clock-frequency = <0>;          // from bootloader
13189 +               };
13190 +       };
13191 +
13192 +       memory {
13193 +               device_type = "memory";
13194 +               reg = <00000000 04000000>;      // 64MB
13195 +       };
13196 +
13197 +       soc5200@f0000000 {
13198 +               model = "fsl,mpc5200b";
13199 +               compatible = "fsl,mpc5200b";
13200 +               revision = "";                  // from bootloader
13201 +               device_type = "soc";
13202 +               ranges = <0 f0000000 0000c000>;
13203 +               reg = <f0000000 00000100>;
13204 +               bus-frequency = <0>;            // from bootloader
13205 +               system-frequency = <0>;         // from bootloader
13206 +
13207 +               cdm@200 {
13208 +                       compatible = "mpc5200b-cdm","mpc5200-cdm";
13209 +                       reg = <200 38>;
13210 +               };
13211 +
13212 +               mpc5200_pic: pic@500 {
13213 +                       // 5200 interrupts are encoded into two levels;
13214 +                       interrupt-controller;
13215 +                       #interrupt-cells = <3>;
13216 +                       compatible = "mpc5200b-pic","mpc5200-pic";
13217 +                       reg = <500 80>;
13218 +               };
13219 +
13220 +               gpt@600 {       // General Purpose Timer
13221 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
13222 +                       reg = <600 10>;
13223 +                       interrupts = <1 9 0>;
13224 +                       interrupt-parent = <&mpc5200_pic>;
13225 +                       fsl,has-wdt;
13226 +               };
13227 +
13228 +               gpt@610 {       // General Purpose Timer
13229 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
13230 +                       reg = <610 10>;
13231 +                       interrupts = <1 a 0>;
13232 +                       interrupt-parent = <&mpc5200_pic>;
13233 +               };
13234 +
13235 +               gpt@620 {       // General Purpose Timer
13236 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
13237 +                       reg = <620 10>;
13238 +                       interrupts = <1 b 0>;
13239 +                       interrupt-parent = <&mpc5200_pic>;
13240 +               };
13241 +
13242 +               gpt@630 {       // General Purpose Timer
13243 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
13244 +                       reg = <630 10>;
13245 +                       interrupts = <1 c 0>;
13246 +                       interrupt-parent = <&mpc5200_pic>;
13247 +               };
13248 +
13249 +               gpt@640 {       // General Purpose Timer
13250 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
13251 +                       reg = <640 10>;
13252 +                       interrupts = <1 d 0>;
13253 +                       interrupt-parent = <&mpc5200_pic>;
13254 +               };
13255 +
13256 +               gpt@650 {       // General Purpose Timer
13257 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
13258 +                       reg = <650 10>;
13259 +                       interrupts = <1 e 0>;
13260 +                       interrupt-parent = <&mpc5200_pic>;
13261 +               };
13262 +
13263 +               motionpro-led@660 {     // Motion-PRO status LED
13264 +                       compatible = "promess,motionpro-led";
13265 +                       label = "motionpro-statusled";
13266 +                       reg = <660 10>;
13267 +                       interrupts = <1 f 0>;
13268 +                       interrupt-parent = <&mpc5200_pic>;
13269 +                       blink-delay = <64>; // 100 msec
13270 +               };
13271 +
13272 +               motionpro-led@670 {     // Motion-PRO ready LED
13273 +                       compatible = "promess,motionpro-led";
13274 +                       label = "motionpro-readyled";
13275 +                       reg = <670 10>;
13276 +                       interrupts = <1 10 0>;
13277 +                       interrupt-parent = <&mpc5200_pic>;
13278 +               };
13279 +
13280 +               rtc@800 {       // Real time clock
13281 +                       compatible = "mpc5200b-rtc","mpc5200-rtc";
13282 +                       reg = <800 100>;
13283 +                       interrupts = <1 5 0 1 6 0>;
13284 +                       interrupt-parent = <&mpc5200_pic>;
13285 +               };
13286 +
13287 +               mscan@980 {
13288 +                       compatible = "mpc5200b-mscan","mpc5200-mscan";
13289 +                       interrupts = <2 12 0>;
13290 +                       interrupt-parent = <&mpc5200_pic>;
13291 +                       reg = <980 80>;
13292 +               };
13293 +
13294 +               gpio@b00 {
13295 +                       compatible = "mpc5200b-gpio","mpc5200-gpio";
13296 +                       reg = <b00 40>;
13297 +                       interrupts = <1 7 0>;
13298 +                       interrupt-parent = <&mpc5200_pic>;
13299 +               };
13300 +
13301 +               gpio-wkup@c00 {
13302 +                       compatible = "mpc5200b-gpio-wkup","mpc5200-gpio-wkup";
13303 +                       reg = <c00 40>;
13304 +                       interrupts = <1 8 0 0 3 0>;
13305 +                       interrupt-parent = <&mpc5200_pic>;
13306 +               };
13307 +
13308 +
13309 +               spi@f00 {
13310 +                       compatible = "mpc5200b-spi","mpc5200-spi";
13311 +                       reg = <f00 20>;
13312 +                       interrupts = <2 d 0 2 e 0>;
13313 +                       interrupt-parent = <&mpc5200_pic>;
13314 +               };
13315 +
13316 +               usb@1000 {
13317 +                       compatible = "mpc5200b-ohci","mpc5200-ohci","ohci-be";
13318 +                       reg = <1000 ff>;
13319 +                       interrupts = <2 6 0>;
13320 +                       interrupt-parent = <&mpc5200_pic>;
13321 +               };
13322 +
13323 +               dma-controller@1200 {
13324 +                       compatible = "mpc5200b-bestcomm","mpc5200-bestcomm";
13325 +                       reg = <1200 80>;
13326 +                       interrupts = <3 0 0  3 1 0  3 2 0  3 3 0
13327 +                                     3 4 0  3 5 0  3 6 0  3 7 0
13328 +                                     3 8 0  3 9 0  3 a 0  3 b 0
13329 +                                     3 c 0  3 d 0  3 e 0  3 f 0>;
13330 +                       interrupt-parent = <&mpc5200_pic>;
13331 +               };
13332 +
13333 +               xlb@1f00 {
13334 +                       compatible = "mpc5200b-xlb","mpc5200-xlb";
13335 +                       reg = <1f00 100>;
13336 +               };
13337 +
13338 +               serial@2000 {           // PSC1
13339 +                       device_type = "serial";
13340 +                       compatible = "mpc5200b-psc-uart","mpc5200-psc-uart";
13341 +                       port-number = <0>;  // Logical port assignment
13342 +                       reg = <2000 100>;
13343 +                       interrupts = <2 1 0>;
13344 +                       interrupt-parent = <&mpc5200_pic>;
13345 +               };
13346 +
13347 +               // PSC2 in spi master mode 
13348 +               spi@2200 {              // PSC2
13349 +                       compatible = "mpc5200b-psc-spi","mpc5200-psc-spi";
13350 +                       cell-index = <1>;
13351 +                       reg = <2200 100>;
13352 +                       interrupts = <2 2 0>;
13353 +                       interrupt-parent = <&mpc5200_pic>;
13354 +               };
13355 +
13356 +               // PSC5 in uart mode
13357 +               serial@2800 {           // PSC5
13358 +                       device_type = "serial";
13359 +                       compatible = "mpc5200b-psc-uart","mpc5200-psc-uart";
13360 +                       port-number = <4>;  // Logical port assignment
13361 +                       reg = <2800 100>;
13362 +                       interrupts = <2 c 0>;
13363 +                       interrupt-parent = <&mpc5200_pic>;
13364 +               };
13365 +
13366 +               ethernet@3000 {
13367 +                       device_type = "network";
13368 +                       compatible = "mpc5200b-fec","mpc5200-fec";
13369 +                       reg = <3000 800>;
13370 +                       local-mac-address = [ 00 00 00 00 00 00 ]; /* Filled in by U-Boot */
13371 +                       interrupts = <2 5 0>;
13372 +                       interrupt-parent = <&mpc5200_pic>;
13373 +               };
13374 +
13375 +               ata@3a00 {
13376 +                       compatible = "mpc5200b-ata","mpc5200-ata";
13377 +                       reg = <3a00 100>;
13378 +                       interrupts = <2 7 0>;
13379 +                       interrupt-parent = <&mpc5200_pic>;
13380 +               };
13381 +
13382 +               i2c@3d40 {
13383 +                       compatible = "mpc5200b-i2c","mpc5200-i2c","fsl-i2c";
13384 +                       reg = <3d40 40>;
13385 +                       interrupts = <2 10 0>;
13386 +                       interrupt-parent = <&mpc5200_pic>;
13387 +                       fsl5200-clocking;
13388 +               };
13389 +
13390 +               sram@8000 {
13391 +                       compatible = "mpc5200b-sram","mpc5200-sram";
13392 +                       reg = <8000 4000>;
13393 +               };
13394 +       };
13395 +
13396 +       lpb {
13397 +               model = "fsl,lpb";
13398 +               compatible = "fsl,lpb";
13399 +               #address-cells = <2>;
13400 +               #size-cells = <1>;
13401 +               ranges = <1 0 50000000 00010000
13402 +                         2 0 50010000 00010000
13403 +                         3 0 50020000 00010000>;
13404 +
13405 +               // 8-bit DualPort SRAM on LocalPlus Bus CS1
13406 +               kollmorgen@1,0 {
13407 +                       compatible = "promess,motionpro-kollmorgen";
13408 +                       reg = <1 0 10000>;
13409 +                       interrupts = <1 1 0>;
13410 +                       interrupt-parent = <&mpc5200_pic>;
13411 +               };
13412 +
13413 +               // 8-bit board CPLD on LocalPlus Bus CS2
13414 +               cpld@2,0 {
13415 +                       compatible = "promess,motionpro-cpld";
13416 +                       reg = <2 0 10000>;
13417 +               };
13418 +
13419 +               // 8-bit custom Anybus Module on LocalPlus Bus CS3
13420 +               anybus@3,0 {
13421 +                       compatible = "promess,motionpro-anybus";
13422 +                       reg = <3 0 10000>;
13423 +               };
13424 +               pro_module_general@3,0 {
13425 +                       compatible = "promess,pro_module_general";
13426 +                       reg = <3 0 3>;
13427 +               };
13428 +               pro_module_dio@3,800 {
13429 +                       compatible = "promess,pro_module_dio";
13430 +                       reg = <3 800 2>;
13431 +               };
13432 +       };
13433 +
13434 +       pci@f0000d00 {
13435 +               #interrupt-cells = <1>;
13436 +               #size-cells = <2>;
13437 +               #address-cells = <3>;
13438 +               device_type = "pci";
13439 +               compatible = "mpc5200b-pci","mpc5200-pci";
13440 +               reg = <f0000d00 100>;
13441 +               interrupt-map-mask = <f800 0 0 7>;
13442 +               interrupt-map = <c000 0 0 1 &mpc5200_pic 0 0 3 // 1st slot
13443 +                                c000 0 0 2 &mpc5200_pic 1 1 3
13444 +                                c000 0 0 3 &mpc5200_pic 1 2 3
13445 +                                c000 0 0 4 &mpc5200_pic 1 3 3
13446 +
13447 +                                c800 0 0 1 &mpc5200_pic 1 1 3 // 2nd slot
13448 +                                c800 0 0 2 &mpc5200_pic 1 2 3
13449 +                                c800 0 0 3 &mpc5200_pic 1 3 3
13450 +                                c800 0 0 4 &mpc5200_pic 0 0 3>;
13451 +               clock-frequency = <0>; // From boot loader
13452 +               interrupts = <2 8 0 2 9 0 2 a 0>;
13453 +               interrupt-parent = <&mpc5200_pic>;
13454 +               bus-range = <0 0>;
13455 +               ranges = <42000000 0 80000000 80000000 0 20000000
13456 +                         02000000 0 a0000000 a0000000 0 10000000
13457 +                         01000000 0 00000000 b0000000 0 01000000>;
13458 +       };
13459 +};
13460 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/mpc8313erdb.dts powerpc.git/arch/powerpc/boot/dts/mpc8313erdb.dts
13461 --- linux-2.6.24/arch/powerpc/boot/dts/mpc8313erdb.dts  2008-01-24 23:58:37.000000000 +0100
13462 +++ powerpc.git/arch/powerpc/boot/dts/mpc8313erdb.dts   2008-01-28 20:25:49.000000000 +0100
13463 @@ -15,6 +15,14 @@
13464         #address-cells = <1>;
13465         #size-cells = <1>;
13466  
13467 +       aliases {
13468 +               ethernet0 = &enet0;
13469 +               ethernet1 = &enet1;
13470 +               serial0 = &serial0;
13471 +               serial1 = &serial1;
13472 +               pci0 = &pci0;
13473 +       };
13474 +
13475         cpus {
13476                 #address-cells = <1>;
13477                 #size-cells = <0>;
13478 @@ -37,10 +45,58 @@
13479                 reg = <00000000 08000000>;      // 128MB at 0
13480         };
13481  
13482 +       localbus@e0005000 {
13483 +               #address-cells = <2>;
13484 +               #size-cells = <1>;
13485 +               compatible = "fsl,mpc8313-elbc", "fsl,elbc", "simple-bus";
13486 +               reg = <e0005000 1000>;
13487 +               interrupts = <d#77 8>;
13488 +               interrupt-parent = <&ipic>;
13489 +
13490 +               // CS0 and CS1 are swapped when
13491 +               // booting from nand, but the
13492 +               // addresses are the same.
13493 +               ranges = <0 0 fe000000 00800000
13494 +                         1 0 e2800000 00008000
13495 +                         2 0 f0000000 00020000
13496 +                         3 0 fa000000 00008000>;
13497 +
13498 +               flash@0,0 {
13499 +                       #address-cells = <1>;
13500 +                       #size-cells = <1>;
13501 +                       compatible = "cfi-flash";
13502 +                       reg = <0 0 800000>;
13503 +                       bank-width = <2>;
13504 +                       device-width = <1>;
13505 +               };
13506 +
13507 +               nand@1,0 {
13508 +                       #address-cells = <1>;
13509 +                       #size-cells = <1>;
13510 +                       compatible = "fsl,mpc8313-fcm-nand",
13511 +                                    "fsl,elbc-fcm-nand";
13512 +                       reg = <1 0 2000>;
13513 +
13514 +                       u-boot@0 {
13515 +                               reg = <0 100000>;
13516 +                               read-only;
13517 +                       };
13518 +
13519 +                       kernel@100000 {
13520 +                               reg = <100000 300000>;
13521 +                       };
13522 +
13523 +                       fs@400000 {
13524 +                               reg = <400000 1c00000>;
13525 +                       };
13526 +               };
13527 +       };
13528 +
13529         soc8313@e0000000 {
13530                 #address-cells = <1>;
13531                 #size-cells = <1>;
13532                 device_type = "soc";
13533 +               compatible = "simple-bus";
13534                 ranges = <0 e0000000 00100000>;
13535                 reg = <e0000000 00000200>;
13536                 bus-frequency = <0>;
13537 @@ -52,7 +108,9 @@
13538                 };
13539  
13540                 i2c@3000 {
13541 -                       device_type = "i2c";
13542 +                       #address-cells = <1>;
13543 +                       #size-cells = <0>;
13544 +                       cell-index = <0>;
13545                         compatible = "fsl-i2c";
13546                         reg = <3000 100>;
13547                         interrupts = <e 8>;
13548 @@ -61,7 +119,9 @@
13549                 };
13550  
13551                 i2c@3100 {
13552 -                       device_type = "i2c";
13553 +                       #address-cells = <1>;
13554 +                       #size-cells = <0>;
13555 +                       cell-index = <1>;
13556                         compatible = "fsl-i2c";
13557                         reg = <3100 100>;
13558                         interrupts = <f 8>;
13559 @@ -80,7 +140,6 @@
13560  
13561                 /* phy type (ULPI, UTMI, UTMI_WIDE, SERIAL) */
13562                 usb@23000 {
13563 -                       device_type = "usb";
13564                         compatible = "fsl-usb2-dr";
13565                         reg = <23000 1000>;
13566                         #address-cells = <1>;
13567 @@ -91,11 +150,10 @@
13568                 };
13569  
13570                 mdio@24520 {
13571 -                       device_type = "mdio";
13572 -                       compatible = "gianfar";
13573 -                       reg = <24520 20>;
13574                         #address-cells = <1>;
13575                         #size-cells = <0>;
13576 +                       compatible = "fsl,gianfar-mdio";
13577 +                       reg = <24520 20>;
13578                         phy1: ethernet-phy@1 {
13579                                 interrupt-parent = < &ipic >;
13580                                 interrupts = <13 8>;
13581 @@ -110,7 +168,8 @@
13582                         };
13583                 };
13584  
13585 -               ethernet@24000 {
13586 +               enet0: ethernet@24000 {
13587 +                       cell-index = <0>;
13588                         device_type = "network";
13589                         model = "eTSEC";
13590                         compatible = "gianfar";
13591 @@ -121,7 +180,8 @@
13592                         phy-handle = < &phy1 >;
13593                 };
13594  
13595 -               ethernet@25000 {
13596 +               enet1: ethernet@25000 {
13597 +                       cell-index = <1>;
13598                         device_type = "network";
13599                         model = "eTSEC";
13600                         compatible = "gianfar";
13601 @@ -132,7 +192,8 @@
13602                         phy-handle = < &phy4 >;
13603                 };
13604  
13605 -               serial@4500 {
13606 +               serial0: serial@4500 {
13607 +                       cell-index = <0>;
13608                         device_type = "serial";
13609                         compatible = "ns16550";
13610                         reg = <4500 100>;
13611 @@ -141,7 +202,8 @@
13612                         interrupt-parent = < &ipic >;
13613                 };
13614  
13615 -               serial@4600 {
13616 +               serial1: serial@4600 {
13617 +                       cell-index = <1>;
13618                         device_type = "serial";
13619                         compatible = "ns16550";
13620                         reg = <4600 100>;
13621 @@ -179,7 +241,8 @@
13622                 };
13623         };
13624  
13625 -       pci@e0008500 {
13626 +       pci0: pci@e0008500 {
13627 +               cell-index = <1>;
13628                 interrupt-map-mask = <f800 0 0 7>;
13629                 interrupt-map = <
13630  
13631 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/mpc832x_mds.dts powerpc.git/arch/powerpc/boot/dts/mpc832x_mds.dts
13632 --- linux-2.6.24/arch/powerpc/boot/dts/mpc832x_mds.dts  2008-01-24 23:58:37.000000000 +0100
13633 +++ powerpc.git/arch/powerpc/boot/dts/mpc832x_mds.dts   2008-01-28 20:25:49.000000000 +0100
13634 @@ -7,6 +7,18 @@
13635   * under  the terms of  the GNU General  Public License as published by the
13636   * Free Software Foundation;  either version 2 of the  License, or (at your
13637   * option) any later version.
13638 +
13639 + * To enable external serial I/O on a Freescale MPC 8323 SYS/MDS board, do
13640 + * this:
13641 + *
13642 + * 1) On chip U61, lift (disconnect) pins 21 (TXD) and 22 (RXD) from the board.
13643 + * 2) Solder a wire from U61-21 to P19A-23.  P19 is a grid of pins on the board
13644 + *    next to the serial ports.
13645 + * 3) Solder a wire from U61-22 to P19K-22.
13646 + *
13647 + * Note that there's a typo in the schematic.  The board labels the last column
13648 + * of pins "P19K", but in the schematic, that column is called "P19J".  So if
13649 + * you're going by the schematic, the pin is called "P19J-K22".
13650   */
13651  
13652  / {
13653 @@ -15,6 +27,14 @@
13654         #address-cells = <1>;
13655         #size-cells = <1>;
13656  
13657 +       aliases {
13658 +               ethernet0 = &enet0;
13659 +               ethernet1 = &enet1;
13660 +               serial0 = &serial0;
13661 +               serial1 = &serial1;
13662 +               pci0 = &pci0;
13663 +       };
13664 +
13665         cpus {
13666                 #address-cells = <1>;
13667                 #size-cells = <0>;
13668 @@ -59,7 +79,7 @@
13669                 i2c@3000 {
13670                         #address-cells = <1>;
13671                         #size-cells = <0>;
13672 -                       device_type = "i2c";
13673 +                       cell-index = <0>;
13674                         compatible = "fsl-i2c";
13675                         reg = <3000 100>;
13676                         interrupts = <e 8>;
13677 @@ -72,7 +92,8 @@
13678                         };
13679                 };
13680  
13681 -               serial@4500 {
13682 +               serial0: serial@4500 {
13683 +                       cell-index = <0>;
13684                         device_type = "serial";
13685                         compatible = "ns16550";
13686                         reg = <4500 100>;
13687 @@ -81,7 +102,8 @@
13688                         interrupt-parent = < &ipic >;
13689                 };
13690  
13691 -               serial@4600 {
13692 +               serial1: serial@4600 {
13693 +                       cell-index = <1>;
13694                         device_type = "serial";
13695                         compatible = "ns16550";
13696                         reg = <4600 100>;
13697 @@ -159,6 +181,23 @@
13698                                         1 1e  1  0  1  0        /* TX_EN */
13699                                         1 1f  2  0  1  0>;/* CRS */
13700                         };
13701 +                       pio5: ucc_pin@05 {
13702 +                               pio-map = <
13703 +                               /*
13704 +                                *                    open       has
13705 +                                *   port  pin  dir  drain  sel  irq
13706 +                                */
13707 +                                       2    0    1      0    2    0  /* TxD5 */
13708 +                                       2    8    2      0    2    0  /* RxD5 */
13709 +
13710 +                                       2   1d    2      0    0    0  /* CTS5 */
13711 +                                       2   1f    1      0    2    0  /* RTS5 */
13712 +
13713 +                                       2   18    2      0    0    0  /* CD */
13714 +
13715 +                               >;
13716 +                       };
13717 +
13718                 };
13719         };
13720  
13721 @@ -166,6 +205,7 @@
13722                 #address-cells = <1>;
13723                 #size-cells = <1>;
13724                 device_type = "qe";
13725 +               compatible = "fsl,qe";
13726                 model = "QE";
13727                 ranges = <0 e0100000 00100000>;
13728                 reg = <e0100000 480>;
13729 @@ -200,7 +240,6 @@
13730                 };
13731  
13732                 usb@6c0 {
13733 -                       device_type = "usb";
13734                         compatible = "qe_udc";
13735                         reg = <6c0 40 8B00 100>;
13736                         interrupts = <b>;
13737 @@ -208,48 +247,58 @@
13738                         mode = "slave";
13739                 };
13740  
13741 -               ucc@2200 {
13742 +               enet0: ucc@2200 {
13743                         device_type = "network";
13744                         compatible = "ucc_geth";
13745                         model = "UCC";
13746 +                       cell-index = <3>;
13747                         device-id = <3>;
13748                         reg = <2200 200>;
13749                         interrupts = <22>;
13750                         interrupt-parent = < &qeic >;
13751 -                       /*
13752 -                        * mac-address is deprecated and will be removed
13753 -                        * in 2.6.25.  Only recent versions of
13754 -                        * U-Boot support local-mac-address, however.
13755 -                        */
13756 -                       mac-address = [ 00 00 00 00 00 00 ];
13757                         local-mac-address = [ 00 00 00 00 00 00 ];
13758 -                       rx-clock = <19>;
13759 -                       tx-clock = <1a>;
13760 +                       rx-clock-name = "clk9";
13761 +                       tx-clock-name = "clk10";
13762                         phy-handle = < &phy3 >;
13763                         pio-handle = < &pio3 >;
13764                 };
13765  
13766 -               ucc@3200 {
13767 +               enet1: ucc@3200 {
13768                         device_type = "network";
13769                         compatible = "ucc_geth";
13770                         model = "UCC";
13771 +                       cell-index = <4>;
13772                         device-id = <4>;
13773                         reg = <3200 200>;
13774                         interrupts = <23>;
13775                         interrupt-parent = < &qeic >;
13776 -                       /*
13777 -                        * mac-address is deprecated and will be removed
13778 -                        * in 2.6.25.  Only recent versions of
13779 -                        * U-Boot support local-mac-address, however.
13780 -                        */
13781 -                       mac-address = [ 00 00 00 00 00 00 ];
13782                         local-mac-address = [ 00 00 00 00 00 00 ];
13783 -                       rx-clock = <17>;
13784 -                       tx-clock = <18>;
13785 +                       rx-clock-name = "clk7";
13786 +                       tx-clock-name = "clk8";
13787                         phy-handle = < &phy4 >;
13788                         pio-handle = < &pio4 >;
13789                 };
13790  
13791 +               ucc@2400 {
13792 +                       device_type = "serial";
13793 +                       compatible = "ucc_uart";
13794 +                       model = "UCC";
13795 +                       device-id = <5>;        /* The UCC number, 1-7*/
13796 +                       port-number = <0>;      /* Which ttyQEx device */
13797 +                       soft-uart;              /* We need Soft-UART */
13798 +                       reg = <2400 200>;
13799 +                       interrupts = <28>;      /* From Table 18-12 */
13800 +                       interrupt-parent = < &qeic >;
13801 +                       /*
13802 +                        * For Soft-UART, we need to set TX to 1X, which
13803 +                        * means specifying separate clock sources.
13804 +                        */
13805 +                       rx-clock-name = "brg5";
13806 +                       tx-clock-name = "brg6";
13807 +                       pio-handle = < &pio5 >;
13808 +               };
13809 +
13810 +
13811                 mdio@2320 {
13812                         #address-cells = <1>;
13813                         #size-cells = <0>;
13814 @@ -283,7 +332,8 @@
13815                 };
13816         };
13817  
13818 -       pci@e0008500 {
13819 +       pci0: pci@e0008500 {
13820 +               cell-index = <1>;
13821                 interrupt-map-mask = <f800 0 0 7>;
13822                 interrupt-map = <
13823                                 /* IDSEL 0x11 AD17 */
13824 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/mpc832x_rdb.dts powerpc.git/arch/powerpc/boot/dts/mpc832x_rdb.dts
13825 --- linux-2.6.24/arch/powerpc/boot/dts/mpc832x_rdb.dts  2008-01-24 23:58:37.000000000 +0100
13826 +++ powerpc.git/arch/powerpc/boot/dts/mpc832x_rdb.dts   2008-01-28 20:25:49.000000000 +0100
13827 @@ -15,6 +15,14 @@
13828         #address-cells = <1>;
13829         #size-cells = <1>;
13830  
13831 +       aliases {
13832 +               ethernet0 = &enet0;
13833 +               ethernet1 = &enet1;
13834 +               serial0 = &serial0;
13835 +               serial1 = &serial1;
13836 +               pci0 = &pci0;
13837 +       };
13838 +
13839         cpus {
13840                 #address-cells = <1>;
13841                 #size-cells = <0>;
13842 @@ -52,7 +60,9 @@
13843                 };
13844  
13845                 i2c@3000 {
13846 -                       device_type = "i2c";
13847 +                       #address-cells = <1>;
13848 +                       #size-cells = <0>;
13849 +                       cell-index = <0>;
13850                         compatible = "fsl-i2c";
13851                         reg = <3000 100>;
13852                         interrupts = <e 8>;
13853 @@ -60,7 +70,8 @@
13854                         dfsrr;
13855                 };
13856  
13857 -               serial@4500 {
13858 +               serial0: serial@4500 {
13859 +                       cell-index = <0>;
13860                         device_type = "serial";
13861                         compatible = "ns16550";
13862                         reg = <4500 100>;
13863 @@ -69,7 +80,8 @@
13864                         interrupt-parent = <&pic>;
13865                 };
13866  
13867 -               serial@4600 {
13868 +               serial1: serial@4600 {
13869 +                       cell-index = <1>;
13870                         device_type = "serial";
13871                         compatible = "ns16550";
13872                         reg = <4600 100>;
13873 @@ -187,44 +199,34 @@
13874                         mode = "cpu";
13875                 };
13876  
13877 -               ucc@3000 {
13878 +               enet0: ucc@3000 {
13879                         device_type = "network";
13880                         compatible = "ucc_geth";
13881                         model = "UCC";
13882 +                       cell-index = <2>;
13883                         device-id = <2>;
13884                         reg = <3000 200>;
13885                         interrupts = <21>;
13886                         interrupt-parent = <&qeic>;
13887 -                       /*
13888 -                        * mac-address is deprecated and will be removed
13889 -                        * in 2.6.25.  Only recent versions of
13890 -                        * U-Boot support local-mac-address, however.
13891 -                        */
13892 -                       mac-address = [ 00 00 00 00 00 00 ];
13893                         local-mac-address = [ 00 00 00 00 00 00 ];
13894 -                       rx-clock = <20>;
13895 -                       tx-clock = <13>;
13896 +                       rx-clock-name = "clk16";
13897 +                       tx-clock-name = "clk3";
13898                         phy-handle = <&phy00>;
13899                         pio-handle = <&ucc2pio>;
13900                 };
13901  
13902 -               ucc@2200 {
13903 +               enet1: ucc@2200 {
13904                         device_type = "network";
13905                         compatible = "ucc_geth";
13906                         model = "UCC";
13907 +                       cell-index = <3>;
13908                         device-id = <3>;
13909                         reg = <2200 200>;
13910                         interrupts = <22>;
13911                         interrupt-parent = <&qeic>;
13912 -                       /*
13913 -                        * mac-address is deprecated and will be removed
13914 -                        * in 2.6.25.  Only recent versions of
13915 -                        * U-Boot support local-mac-address, however.
13916 -                        */
13917 -                       mac-address = [ 00 00 00 00 00 00 ];
13918                         local-mac-address = [ 00 00 00 00 00 00 ];
13919 -                       rx-clock = <19>;
13920 -                       tx-clock = <1a>;
13921 +                       rx-clock-name = "clk9";
13922 +                       tx-clock-name = "clk10";
13923                         phy-handle = <&phy04>;
13924                         pio-handle = <&ucc3pio>;
13925                 };
13926 @@ -262,7 +264,8 @@
13927                 };
13928         };
13929  
13930 -       pci@e0008500 {
13931 +       pci0: pci@e0008500 {
13932 +               cell-index = <1>;
13933                 interrupt-map-mask = <f800 0 0 7>;
13934                 interrupt-map = <
13935                                 /* IDSEL 0x10 AD16 (USB) */
13936 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/mpc8349emitx.dts powerpc.git/arch/powerpc/boot/dts/mpc8349emitx.dts
13937 --- linux-2.6.24/arch/powerpc/boot/dts/mpc8349emitx.dts 2008-01-24 23:58:37.000000000 +0100
13938 +++ powerpc.git/arch/powerpc/boot/dts/mpc8349emitx.dts  2008-01-28 20:25:49.000000000 +0100
13939 @@ -14,6 +14,15 @@
13940         #address-cells = <1>;
13941         #size-cells = <1>;
13942  
13943 +       aliases {
13944 +               ethernet0 = &enet0;
13945 +               ethernet1 = &enet1;
13946 +               serial0 = &serial0;
13947 +               serial1 = &serial1;
13948 +               pci0 = &pci0;
13949 +               pci1 = &pci1;
13950 +       };
13951 +
13952         cpus {
13953                 #address-cells = <1>;
13954                 #size-cells = <0>;
13955 @@ -51,7 +60,9 @@
13956                 };
13957  
13958                 i2c@3000 {
13959 -                       device_type = "i2c";
13960 +                       #address-cells = <1>;
13961 +                       #size-cells = <0>;
13962 +                       cell-index = <0>;
13963                         compatible = "fsl-i2c";
13964                         reg = <3000 100>;
13965                         interrupts = <e 8>;
13966 @@ -60,7 +71,9 @@
13967                 };
13968  
13969                 i2c@3100 {
13970 -                       device_type = "i2c";
13971 +                       #address-cells = <1>;
13972 +                       #size-cells = <0>;
13973 +                       cell-index = <1>;
13974                         compatible = "fsl-i2c";
13975                         reg = <3100 100>;
13976                         interrupts = <f 8>;
13977 @@ -78,7 +91,6 @@
13978                 };
13979  
13980                 usb@22000 {
13981 -                       device_type = "usb";
13982                         compatible = "fsl-usb2-mph";
13983                         reg = <22000 1000>;
13984                         #address-cells = <1>;
13985 @@ -90,7 +102,6 @@
13986                 };
13987  
13988                 usb@23000 {
13989 -                       device_type = "usb";
13990                         compatible = "fsl-usb2-dr";
13991                         reg = <23000 1000>;
13992                         #address-cells = <1>;
13993 @@ -102,11 +113,10 @@
13994                 };
13995  
13996                 mdio@24520 {
13997 -                       device_type = "mdio";
13998 -                       compatible = "gianfar";
13999 -                       reg = <24520 20>;
14000                         #address-cells = <1>;
14001                         #size-cells = <0>;
14002 +                       compatible = "fsl,gianfar-mdio";
14003 +                       reg = <24520 20>;
14004  
14005                         /* Vitesse 8201 */
14006                         phy1c: ethernet-phy@1c {
14007 @@ -115,27 +125,14 @@
14008                                 reg = <1c>;
14009                                 device_type = "ethernet-phy";
14010                         };
14011 -
14012 -                       /* Vitesse 7385 */
14013 -                       phy1f: ethernet-phy@1f {
14014 -                               interrupt-parent = < &ipic >;
14015 -                               interrupts = <12 8>;
14016 -                               reg = <1f>;
14017 -                               device_type = "ethernet-phy";
14018 -                       };
14019                 };
14020  
14021 -               ethernet@24000 {
14022 +               enet0: ethernet@24000 {
14023 +                       cell-index = <0>;
14024                         device_type = "network";
14025                         model = "TSEC";
14026                         compatible = "gianfar";
14027                         reg = <24000 1000>;
14028 -                       /*
14029 -                        * address is deprecated and will be removed
14030 -                        * in 2.6.25.  Only recent versions of
14031 -                        * U-Boot support local-mac-address, however.
14032 -                        */
14033 -                       address = [ 00 00 00 00 00 00 ];
14034                         local-mac-address = [ 00 00 00 00 00 00 ];
14035                         interrupts = <20 8 21 8 22 8>;
14036                         interrupt-parent = < &ipic >;
14037 @@ -143,27 +140,22 @@
14038                         linux,network-index = <0>;
14039                 };
14040  
14041 -               ethernet@25000 {
14042 -                       #address-cells = <1>;
14043 -                       #size-cells = <0>;
14044 +               enet1: ethernet@25000 {
14045 +                       cell-index = <1>;
14046                         device_type = "network";
14047                         model = "TSEC";
14048                         compatible = "gianfar";
14049                         reg = <25000 1000>;
14050 -                       /*
14051 -                        * address is deprecated and will be removed
14052 -                        * in 2.6.25.  Only recent versions of
14053 -                        * U-Boot support local-mac-address, however.
14054 -                        */
14055 -                       address = [ 00 00 00 00 00 00 ];
14056                         local-mac-address = [ 00 00 00 00 00 00 ];
14057                         interrupts = <23 8 24 8 25 8>;
14058                         interrupt-parent = < &ipic >;
14059 -                       phy-handle = < &phy1f >;
14060 +                       /* Vitesse 7385 isn't on the MDIO bus */
14061 +                       fixed-link = <1 1 d#1000 0 0>;
14062                         linux,network-index = <1>;
14063                 };
14064  
14065 -               serial@4500 {
14066 +               serial0: serial@4500 {
14067 +                       cell-index = <0>;
14068                         device_type = "serial";
14069                         compatible = "ns16550";
14070                         reg = <4500 100>;
14071 @@ -172,7 +164,8 @@
14072                         interrupt-parent = < &ipic >;
14073                 };
14074  
14075 -               serial@4600 {
14076 +               serial1: serial@4600 {
14077 +                       cell-index = <1>;
14078                         device_type = "serial";
14079                         compatible = "ns16550";
14080                         reg = <4600 100>;
14081 @@ -203,7 +196,8 @@
14082                 };
14083         };
14084  
14085 -       pci@e0008500 {
14086 +       pci0: pci@e0008500 {
14087 +               cell-index = <1>;
14088                 interrupt-map-mask = <f800 0 0 7>;
14089                 interrupt-map = <
14090                                 /* IDSEL 0x10 - SATA */
14091 @@ -224,7 +218,8 @@
14092                 device_type = "pci";
14093         };
14094  
14095 -       pci@e0008600 {
14096 +       pci1: pci@e0008600 {
14097 +               cell-index = <2>;
14098                 interrupt-map-mask = <f800 0 0 7>;
14099                 interrupt-map = <
14100                                 /* IDSEL 0x0E - MiniPCI Slot */
14101 @@ -249,6 +244,21 @@
14102                 device_type = "pci";
14103         };
14104  
14105 -
14106 -
14107 +       localbus@e0005000 {
14108 +               #address-cells = <2>;
14109 +               #size-cells = <1>;
14110 +               compatible = "fsl,mpc8349e-localbus",
14111 +                            "fsl,pq2pro-localbus";
14112 +               reg = <e0005000 d8>;
14113 +               ranges = <3 0 f0000000 210>;
14114 +
14115 +               pata@3,0 {
14116 +                       compatible = "fsl,mpc8349emitx-pata", "ata-generic";
14117 +                       reg = <3 0 10 3 20c 4>;
14118 +                       reg-shift = <1>;
14119 +                       pio-mode = <6>;
14120 +                       interrupts = <17 8>;
14121 +                       interrupt-parent = <&ipic>;
14122 +               };
14123 +       };
14124  };
14125 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/mpc8349emitxgp.dts powerpc.git/arch/powerpc/boot/dts/mpc8349emitxgp.dts
14126 --- linux-2.6.24/arch/powerpc/boot/dts/mpc8349emitxgp.dts       2008-01-24 23:58:37.000000000 +0100
14127 +++ powerpc.git/arch/powerpc/boot/dts/mpc8349emitxgp.dts        2008-01-28 20:25:49.000000000 +0100
14128 @@ -14,6 +14,13 @@
14129         #address-cells = <1>;
14130         #size-cells = <1>;
14131  
14132 +       aliases {
14133 +               ethernet0 = &enet0;
14134 +               serial0 = &serial0;
14135 +               serial1 = &serial1;
14136 +               pci0 = &pci0;
14137 +       };
14138 +
14139         cpus {
14140                 #address-cells = <1>;
14141                 #size-cells = <0>;
14142 @@ -51,7 +58,9 @@
14143                 };
14144  
14145                 i2c@3000 {
14146 -                       device_type = "i2c";
14147 +                       #address-cells = <1>;
14148 +                       #size-cells = <0>;
14149 +                       cell-index = <0>;
14150                         compatible = "fsl-i2c";
14151                         reg = <3000 100>;
14152                         interrupts = <e 8>;
14153 @@ -60,7 +69,9 @@
14154                 };
14155  
14156                 i2c@3100 {
14157 -                       device_type = "i2c";
14158 +                       #address-cells = <1>;
14159 +                       #size-cells = <0>;
14160 +                       cell-index = <1>;
14161                         compatible = "fsl-i2c";
14162                         reg = <3100 100>;
14163                         interrupts = <f 8>;
14164 @@ -78,7 +89,6 @@
14165                 };
14166  
14167                 usb@23000 {
14168 -                       device_type = "usb";
14169                         compatible = "fsl-usb2-dr";
14170                         reg = <23000 1000>;
14171                         #address-cells = <1>;
14172 @@ -90,11 +100,10 @@
14173                 };
14174  
14175                 mdio@24520 {
14176 -                       device_type = "mdio";
14177 -                       compatible = "gianfar";
14178 -                       reg = <24520 20>;
14179                         #address-cells = <1>;
14180                         #size-cells = <0>;
14181 +                       compatible = "fsl,gianfar-mdio";
14182 +                       reg = <24520 20>;
14183  
14184                         /* Vitesse 8201 */
14185                         phy1c: ethernet-phy@1c {
14186 @@ -105,7 +114,8 @@
14187                         };
14188                 };
14189  
14190 -               ethernet@24000 {
14191 +               enet0: ethernet@24000 {
14192 +                       cell-index = <0>;
14193                         device_type = "network";
14194                         model = "TSEC";
14195                         compatible = "gianfar";
14196 @@ -117,7 +127,8 @@
14197                         linux,network-index = <0>;
14198                 };
14199  
14200 -               serial@4500 {
14201 +               serial0: serial@4500 {
14202 +                       cell-index = <0>;
14203                         device_type = "serial";
14204                         compatible = "ns16550";
14205                         reg = <4500 100>;
14206 @@ -126,7 +137,8 @@
14207                         interrupt-parent = < &ipic >;
14208                 };
14209  
14210 -               serial@4600 {
14211 +               serial1: serial@4600 {
14212 +                       cell-index = <1>;
14213                         device_type = "serial";
14214                         compatible = "ns16550";
14215                         reg = <4600 100>;
14216 @@ -157,7 +169,8 @@
14217                 };
14218         };
14219  
14220 -       pci@e0008600 {
14221 +       pci0: pci@e0008600 {
14222 +               cell-index = <2>;
14223                 interrupt-map-mask = <f800 0 0 7>;
14224                 interrupt-map = <
14225                                 /* IDSEL 0x0F - PCI Slot */
14226 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/mpc834x_mds.dts powerpc.git/arch/powerpc/boot/dts/mpc834x_mds.dts
14227 --- linux-2.6.24/arch/powerpc/boot/dts/mpc834x_mds.dts  2008-01-24 23:58:37.000000000 +0100
14228 +++ powerpc.git/arch/powerpc/boot/dts/mpc834x_mds.dts   2008-01-28 20:25:49.000000000 +0100
14229 @@ -15,6 +15,15 @@
14230         #address-cells = <1>;
14231         #size-cells = <1>;
14232  
14233 +       aliases {
14234 +               ethernet0 = &enet0;
14235 +               ethernet1 = &enet1;
14236 +               serial0 = &serial0;
14237 +               serial1 = &serial1;
14238 +               pci0 = &pci0;
14239 +               pci1 = &pci1;
14240 +       };
14241 +
14242         cpus {
14243                 #address-cells = <1>;
14244                 #size-cells = <0>;
14245 @@ -59,7 +68,7 @@
14246                 i2c@3000 {
14247                         #address-cells = <1>;
14248                         #size-cells = <0>;
14249 -                       device_type = "i2c";
14250 +                       cell-index = <0>;
14251                         compatible = "fsl-i2c";
14252                         reg = <3000 100>;
14253                         interrupts = <e 8>;
14254 @@ -75,7 +84,7 @@
14255                 i2c@3100 {
14256                         #address-cells = <1>;
14257                         #size-cells = <0>;
14258 -                       device_type = "i2c";
14259 +                       cell-index = <1>;
14260                         compatible = "fsl-i2c";
14261                         reg = <3100 100>;
14262                         interrupts = <f 8>;
14263 @@ -95,7 +104,6 @@
14264                 /* phy type (ULPI or SERIAL) are only types supportted for MPH */
14265                 /* port = 0 or 1 */
14266                 usb@22000 {
14267 -                       device_type = "usb";
14268                         compatible = "fsl-usb2-mph";
14269                         reg = <22000 1000>;
14270                         #address-cells = <1>;
14271 @@ -107,7 +115,6 @@
14272                 };
14273                 /* phy type (ULPI, UTMI, UTMI_WIDE, SERIAL) */
14274                 usb@23000 {
14275 -                       device_type = "usb";
14276                         compatible = "fsl-usb2-dr";
14277                         reg = <23000 1000>;
14278                         #address-cells = <1>;
14279 @@ -119,11 +126,11 @@
14280                 };
14281  
14282                 mdio@24520 {
14283 -                       device_type = "mdio";
14284 -                       compatible = "gianfar";
14285 -                       reg = <24520 20>;
14286                         #address-cells = <1>;
14287                         #size-cells = <0>;
14288 +                       compatible = "fsl,gianfar-mdio";
14289 +                       reg = <24520 20>;
14290 +
14291                         phy0: ethernet-phy@0 {
14292                                 interrupt-parent = < &ipic >;
14293                                 interrupts = <11 8>;
14294 @@ -138,17 +145,12 @@
14295                         };
14296                 };
14297  
14298 -               ethernet@24000 {
14299 +               enet0: ethernet@24000 {
14300 +                       cell-index = <0>;
14301                         device_type = "network";
14302                         model = "TSEC";
14303                         compatible = "gianfar";
14304                         reg = <24000 1000>;
14305 -                       /*
14306 -                        * address is deprecated and will be removed
14307 -                        * in 2.6.25.  Only recent versions of
14308 -                        * U-Boot support local-mac-address, however.
14309 -                        */
14310 -                       address = [ 00 00 00 00 00 00 ];
14311                         local-mac-address = [ 00 00 00 00 00 00 ];
14312                         interrupts = <20 8 21 8 22 8>;
14313                         interrupt-parent = < &ipic >;
14314 @@ -156,19 +158,12 @@
14315                         linux,network-index = <0>;
14316                 };
14317  
14318 -               ethernet@25000 {
14319 -                       #address-cells = <1>;
14320 -                       #size-cells = <0>;
14321 +               enet1: ethernet@25000 {
14322 +                       cell-index = <1>;
14323                         device_type = "network";
14324                         model = "TSEC";
14325                         compatible = "gianfar";
14326                         reg = <25000 1000>;
14327 -                       /*
14328 -                        * address is deprecated and will be removed
14329 -                        * in 2.6.25.  Only recent versions of
14330 -                        * U-Boot support local-mac-address, however.
14331 -                        */
14332 -                       address = [ 00 00 00 00 00 00 ];
14333                         local-mac-address = [ 00 00 00 00 00 00 ];
14334                         interrupts = <23 8 24 8 25 8>;
14335                         interrupt-parent = < &ipic >;
14336 @@ -176,7 +171,8 @@
14337                         linux,network-index = <1>;
14338                 };
14339  
14340 -               serial@4500 {
14341 +               serial0: serial@4500 {
14342 +                       cell-index = <0>;
14343                         device_type = "serial";
14344                         compatible = "ns16550";
14345                         reg = <4500 100>;
14346 @@ -185,7 +181,8 @@
14347                         interrupt-parent = < &ipic >;
14348                 };
14349  
14350 -               serial@4600 {
14351 +               serial1: serial@4600 {
14352 +                       cell-index = <1>;
14353                         device_type = "serial";
14354                         compatible = "ns16550";
14355                         reg = <4600 100>;
14356 @@ -225,7 +222,8 @@
14357                 };
14358         };
14359  
14360 -       pci@e0008500 {
14361 +       pci0: pci@e0008500 {
14362 +               cell-index = <1>;
14363                 interrupt-map-mask = <f800 0 0 7>;
14364                 interrupt-map = <
14365  
14366 @@ -285,7 +283,8 @@
14367                 device_type = "pci";
14368         };
14369  
14370 -       pci@e0008600 {
14371 +       pci1: pci@e0008600 {
14372 +               cell-index = <2>;
14373                 interrupt-map-mask = <f800 0 0 7>;
14374                 interrupt-map = <
14375  
14376 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/mpc836x_mds.dts powerpc.git/arch/powerpc/boot/dts/mpc836x_mds.dts
14377 --- linux-2.6.24/arch/powerpc/boot/dts/mpc836x_mds.dts  2008-01-24 23:58:37.000000000 +0100
14378 +++ powerpc.git/arch/powerpc/boot/dts/mpc836x_mds.dts   2008-01-28 20:25:49.000000000 +0100
14379 @@ -20,6 +20,14 @@
14380         #address-cells = <1>;
14381         #size-cells = <1>;
14382  
14383 +       aliases {
14384 +               ethernet0 = &enet0;
14385 +               ethernet1 = &enet1;
14386 +               serial0 = &serial0;
14387 +               serial1 = &serial1;
14388 +               pci0 = &pci0;
14389 +       };
14390 +
14391         cpus {
14392                 #address-cells = <1>;
14393                 #size-cells = <0>;
14394 @@ -64,7 +72,7 @@
14395                 i2c@3000 {
14396                         #address-cells = <1>;
14397                         #size-cells = <0>;
14398 -                       device_type = "i2c";
14399 +                       cell-index = <0>;
14400                         compatible = "fsl-i2c";
14401                         reg = <3000 100>;
14402                         interrupts = <e 8>;
14403 @@ -80,7 +88,7 @@
14404                 i2c@3100 {
14405                         #address-cells = <1>;
14406                         #size-cells = <0>;
14407 -                       device_type = "i2c";
14408 +                       cell-index = <1>;
14409                         compatible = "fsl-i2c";
14410                         reg = <3100 100>;
14411                         interrupts = <f 8>;
14412 @@ -88,7 +96,8 @@
14413                         dfsrr;
14414                 };
14415  
14416 -               serial@4500 {
14417 +               serial0: serial@4500 {
14418 +                       cell-index = <0>;
14419                         device_type = "serial";
14420                         compatible = "ns16550";
14421                         reg = <4500 100>;
14422 @@ -97,7 +106,8 @@
14423                         interrupt-parent = < &ipic >;
14424                 };
14425  
14426 -               serial@4600 {
14427 +               serial1: serial@4600 {
14428 +                       cell-index = <1>;
14429                         device_type = "serial";
14430                         compatible = "ns16550";
14431                         reg = <4600 100>;
14432 @@ -231,7 +241,6 @@
14433                 };
14434  
14435                 usb@6c0 {
14436 -                       device_type = "usb";
14437                         compatible = "qe_udc";
14438                         reg = <6c0 40 8B00 100>;
14439                         interrupts = <b>;
14440 @@ -239,45 +248,35 @@
14441                         mode = "slave";
14442                 };
14443  
14444 -               ucc@2000 {
14445 +               enet0: ucc@2000 {
14446                         device_type = "network";
14447                         compatible = "ucc_geth";
14448                         model = "UCC";
14449 +                       cell-index = <1>;
14450                         device-id = <1>;
14451                         reg = <2000 200>;
14452                         interrupts = <20>;
14453                         interrupt-parent = < &qeic >;
14454 -                       /*
14455 -                        * mac-address is deprecated and will be removed
14456 -                        * in 2.6.25.  Only recent versions of
14457 -                        * U-Boot support local-mac-address, however.
14458 -                        */
14459 -                       mac-address = [ 00 00 00 00 00 00 ];
14460                         local-mac-address = [ 00 00 00 00 00 00 ];
14461 -                       rx-clock = <0>;
14462 -                       tx-clock = <19>;
14463 +                       rx-clock-name = "none";
14464 +                       tx-clock-name = "clk9";
14465                         phy-handle = < &phy0 >;
14466                         phy-connection-type = "rgmii-id";
14467                         pio-handle = < &pio1 >;
14468                 };
14469  
14470 -               ucc@3000 {
14471 +               enet1: ucc@3000 {
14472                         device_type = "network";
14473                         compatible = "ucc_geth";
14474                         model = "UCC";
14475 +                       cell-index = <2>;
14476                         device-id = <2>;
14477                         reg = <3000 200>;
14478                         interrupts = <21>;
14479                         interrupt-parent = < &qeic >;
14480 -                       /*
14481 -                        * mac-address is deprecated and will be removed
14482 -                        * in 2.6.25.  Only recent versions of
14483 -                        * U-Boot support local-mac-address, however.
14484 -                        */
14485 -                       mac-address = [ 00 00 00 00 00 00 ];
14486                         local-mac-address = [ 00 00 00 00 00 00 ];
14487 -                       rx-clock = <0>;
14488 -                       tx-clock = <14>;
14489 +                       rx-clock-name = "none";
14490 +                       tx-clock-name = "clk4";
14491                         phy-handle = < &phy1 >;
14492                         phy-connection-type = "rgmii-id";
14493                         pio-handle = < &pio2 >;
14494 @@ -316,7 +315,8 @@
14495                 };
14496         };
14497  
14498 -       pci@e0008500 {
14499 +       pci0: pci@e0008500 {
14500 +               cell-index = <1>;
14501                 interrupt-map-mask = <f800 0 0 7>;
14502                 interrupt-map = <
14503  
14504 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/mpc8377_mds.dts powerpc.git/arch/powerpc/boot/dts/mpc8377_mds.dts
14505 --- linux-2.6.24/arch/powerpc/boot/dts/mpc8377_mds.dts  1970-01-01 01:00:00.000000000 +0100
14506 +++ powerpc.git/arch/powerpc/boot/dts/mpc8377_mds.dts   2008-01-28 20:25:49.000000000 +0100
14507 @@ -0,0 +1,279 @@
14508 +/*
14509 + * MPC8377E MDS Device Tree Source
14510 + *
14511 + * Copyright 2007 Freescale Semiconductor Inc.
14512 + *
14513 + * This program is free software; you can redistribute  it and/or modify it
14514 + * under  the terms of  the GNU General  Public License as published by the
14515 + * Free Software Foundation;  either version 2 of the  License, or (at your
14516 + * option) any later version.
14517 + */
14518 +
14519 +/dts-v1/;
14520 +
14521 +/ {
14522 +       model = "fsl,mpc8377emds";
14523 +       compatible = "fsl,mpc8377emds","fsl,mpc837xmds";
14524 +       #address-cells = <1>;
14525 +       #size-cells = <1>;
14526 +
14527 +       aliases {
14528 +               ethernet0 = &enet0;
14529 +               ethernet1 = &enet1;
14530 +               serial0 = &serial0;
14531 +               serial1 = &serial1;
14532 +               pci0 = &pci0;
14533 +       };
14534 +
14535 +       cpus {
14536 +               #address-cells = <1>;
14537 +               #size-cells = <0>;
14538 +
14539 +               PowerPC,8377@0 {
14540 +                       device_type = "cpu";
14541 +                       reg = <0>;
14542 +                       d-cache-line-size = <0x20>;
14543 +                       i-cache-line-size = <0x20>;
14544 +                       d-cache-size = <0x8000>;                // L1, 32K
14545 +                       i-cache-size = <0x8000>;                // L1, 32K
14546 +                       timebase-frequency = <0>;
14547 +                       bus-frequency = <0>;
14548 +                       clock-frequency = <0>;
14549 +               };
14550 +       };
14551 +
14552 +       memory {
14553 +               device_type = "memory";
14554 +               reg = <0x00000000 0x20000000>;  // 512MB at 0
14555 +       };
14556 +
14557 +       soc@e0000000 {
14558 +               #address-cells = <1>;
14559 +               #size-cells = <1>;
14560 +               device_type = "soc";
14561 +               ranges = <0x0 0xe0000000 0x00100000>;
14562 +               reg = <0xe0000000 0x00000200>;
14563 +               bus-frequency = <0>;
14564 +
14565 +               wdt@200 {
14566 +                       compatible = "mpc83xx_wdt";
14567 +                       reg = <0x200 0x100>;
14568 +               };
14569 +
14570 +               i2c@3000 {
14571 +                       #address-cells = <1>;
14572 +                       #size-cells = <0>;
14573 +                       cell-index = <0>;
14574 +                       compatible = "fsl-i2c";
14575 +                       reg = <0x3000 0x100>;
14576 +                       interrupts = <0xe 0x8>;
14577 +                       interrupt-parent = < &ipic >;
14578 +                       dfsrr;
14579 +               };
14580 +
14581 +               i2c@3100 {
14582 +                       #address-cells = <1>;
14583 +                       #size-cells = <0>;
14584 +                       cell-index = <1>;
14585 +                       compatible = "fsl-i2c";
14586 +                       reg = <0x3100 0x100>;
14587 +                       interrupts = <0xf 0x8>;
14588 +                       interrupt-parent = < &ipic >;
14589 +                       dfsrr;
14590 +               };
14591 +
14592 +               spi@7000 {
14593 +                       compatible = "fsl_spi";
14594 +                       reg = <0x7000 0x1000>;
14595 +                       interrupts = <0x10 0x8>;
14596 +                       interrupt-parent = < &ipic >;
14597 +                       mode = "cpu";
14598 +               };
14599 +
14600 +               /* phy type (ULPI, UTMI, UTMI_WIDE, SERIAL) */
14601 +               usb@23000 {
14602 +                       compatible = "fsl-usb2-dr";
14603 +                       reg = <0x23000 0x1000>;
14604 +                       #address-cells = <1>;
14605 +                       #size-cells = <0>;
14606 +                       interrupt-parent = < &ipic >;
14607 +                       interrupts = <0x26 0x8>;
14608 +                       phy_type = "utmi_wide";
14609 +               };
14610 +
14611 +               mdio@24520 {
14612 +                       #address-cells = <1>;
14613 +                       #size-cells = <0>;
14614 +                       compatible = "fsl,gianfar-mdio";
14615 +                       reg = <0x24520 0x20>;
14616 +                       phy2: ethernet-phy@2 {
14617 +                               interrupt-parent = < &ipic >;
14618 +                               interrupts = <0x11 0x8>;
14619 +                               reg = <2>;
14620 +                               device_type = "ethernet-phy";
14621 +                       };
14622 +                       phy3: ethernet-phy@3 {
14623 +                               interrupt-parent = < &ipic >;
14624 +                               interrupts = <0x12 0x8>;
14625 +                               reg = <3>;
14626 +                               device_type = "ethernet-phy";
14627 +                       };
14628 +               };
14629 +
14630 +               enet0: ethernet@24000 {
14631 +                       cell-index = <0>;
14632 +                       device_type = "network";
14633 +                       model = "eTSEC";
14634 +                       compatible = "gianfar";
14635 +                       reg = <0x24000 0x1000>;
14636 +                       local-mac-address = [ 00 00 00 00 00 00 ];
14637 +                       interrupts = <0x20 0x8 0x21 0x8 0x22 0x8>;
14638 +                       phy-connection-type = "mii";
14639 +                       interrupt-parent = < &ipic >;
14640 +                       phy-handle = < &phy2 >;
14641 +               };
14642 +
14643 +               enet1: ethernet@25000 {
14644 +                       cell-index = <1>;
14645 +                       device_type = "network";
14646 +                       model = "eTSEC";
14647 +                       compatible = "gianfar";
14648 +                       reg = <0x25000 0x1000>;
14649 +                       local-mac-address = [ 00 00 00 00 00 00 ];
14650 +                       interrupts = <0x23 0x8 0x24 0x8 0x25 0x8>;
14651 +                       phy-connection-type = "mii";
14652 +                       interrupt-parent = < &ipic >;
14653 +                       phy-handle = < &phy3 >;
14654 +               };
14655 +
14656 +               serial0: serial@4500 {
14657 +                       cell-index = <0>;
14658 +                       device_type = "serial";
14659 +                       compatible = "ns16550";
14660 +                       reg = <0x4500 0x100>;
14661 +                       clock-frequency = <0>;
14662 +                       interrupts = <0x9 0x8>;
14663 +                       interrupt-parent = < &ipic >;
14664 +               };
14665 +
14666 +               serial1: serial@4600 {
14667 +                       cell-index = <1>;
14668 +                       device_type = "serial";
14669 +                       compatible = "ns16550";
14670 +                       reg = <0x4600 0x100>;
14671 +                       clock-frequency = <0>;
14672 +                       interrupts = <0xa 0x8>;
14673 +                       interrupt-parent = < &ipic >;
14674 +               };
14675 +
14676 +               crypto@30000 {
14677 +                       model = "SEC3";
14678 +                       compatible = "talitos";
14679 +                       reg = <0x30000 0x10000>;
14680 +                       interrupts = <0xb 0x8>;
14681 +                       interrupt-parent = < &ipic >;
14682 +                       /* Rev. 3.0 geometry */
14683 +                       num-channels = <4>;
14684 +                       channel-fifo-len = <0x18>;
14685 +                       exec-units-mask = <0x000001fe>;
14686 +                       descriptor-types-mask = <0x03ab0ebf>;
14687 +               };
14688 +
14689 +               sdhc@2e000 {
14690 +                       model = "eSDHC";
14691 +                       compatible = "fsl,esdhc";
14692 +                       reg = <0x2e000 0x1000>;
14693 +                       interrupts = <0x2a 0x8>;
14694 +                       interrupt-parent = < &ipic >;
14695 +               };
14696 +
14697 +               sata@18000 {
14698 +                       compatible = "fsl,mpc8379-sata";
14699 +                       reg = <0x18000 0x1000>;
14700 +                       interrupts = <0x2c 0x8>;
14701 +                       interrupt-parent = < &ipic >;
14702 +               };
14703 +
14704 +               sata@19000 {
14705 +                       compatible = "fsl,mpc8379-sata";
14706 +                       reg = <0x19000 0x1000>;
14707 +                       interrupts = <0x2d 0x8>;
14708 +                       interrupt-parent = < &ipic >;
14709 +               };
14710 +
14711 +               /* IPIC
14712 +                * interrupts cell = <intr #, sense>
14713 +                * sense values match linux IORESOURCE_IRQ_* defines:
14714 +                * sense == 8: Level, low assertion
14715 +                * sense == 2: Edge, high-to-low change
14716 +                */
14717 +               ipic: pic@700 {
14718 +                       compatible = "fsl,ipic";
14719 +                       interrupt-controller;
14720 +                       #address-cells = <0>;
14721 +                       #interrupt-cells = <2>;
14722 +                       reg = <0x700 0x100>;
14723 +               };
14724 +       };
14725 +
14726 +       pci0: pci@e0008500 {
14727 +               cell-index = <0>;
14728 +               interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
14729 +               interrupt-map = <
14730 +
14731 +                               /* IDSEL 0x11 */
14732 +                                0x8800 0x0 0x0 0x1 &ipic 0x14 0x8
14733 +                                0x8800 0x0 0x0 0x2 &ipic 0x15 0x8
14734 +                                0x8800 0x0 0x0 0x3 &ipic 0x16 0x8
14735 +                                0x8800 0x0 0x0 0x4 &ipic 0x17 0x8
14736 +
14737 +                               /* IDSEL 0x12 */
14738 +                                0x9000 0x0 0x0 0x1 &ipic 0x16 0x8
14739 +                                0x9000 0x0 0x0 0x2 &ipic 0x17 0x8
14740 +                                0x9000 0x0 0x0 0x3 &ipic 0x14 0x8
14741 +                                0x9000 0x0 0x0 0x4 &ipic 0x15 0x8
14742 +
14743 +                               /* IDSEL 0x13 */
14744 +                                0x9800 0x0 0x0 0x1 &ipic 0x17 0x8
14745 +                                0x9800 0x0 0x0 0x2 &ipic 0x14 0x8
14746 +                                0x9800 0x0 0x0 0x3 &ipic 0x15 0x8
14747 +                                0x9800 0x0 0x0 0x4 &ipic 0x16 0x8
14748 +
14749 +                               /* IDSEL 0x15 */
14750 +                                0xa800 0x0 0x0 0x1 &ipic 0x14 0x8
14751 +                                0xa800 0x0 0x0 0x2 &ipic 0x15 0x8
14752 +                                0xa800 0x0 0x0 0x3 &ipic 0x16 0x8
14753 +                                0xa800 0x0 0x0 0x4 &ipic 0x17 0x8
14754 +
14755 +                               /* IDSEL 0x16 */
14756 +                                0xb000 0x0 0x0 0x1 &ipic 0x17 0x8
14757 +                                0xb000 0x0 0x0 0x2 &ipic 0x14 0x8
14758 +                                0xb000 0x0 0x0 0x3 &ipic 0x15 0x8
14759 +                                0xb000 0x0 0x0 0x4 &ipic 0x16 0x8
14760 +
14761 +                               /* IDSEL 0x17 */
14762 +                                0xb800 0x0 0x0 0x1 &ipic 0x16 0x8
14763 +                                0xb800 0x0 0x0 0x2 &ipic 0x17 0x8
14764 +                                0xb800 0x0 0x0 0x3 &ipic 0x14 0x8
14765 +                                0xb800 0x0 0x0 0x4 &ipic 0x15 0x8
14766 +
14767 +                               /* IDSEL 0x18 */
14768 +                                0xc000 0x0 0x0 0x1 &ipic 0x15 0x8
14769 +                                0xc000 0x0 0x0 0x2 &ipic 0x16 0x8
14770 +                                0xc000 0x0 0x0 0x3 &ipic 0x17 0x8
14771 +                                0xc000 0x0 0x0 0x4 &ipic 0x14 0x8>;
14772 +               interrupt-parent = < &ipic >;
14773 +               interrupts = <0x42 0x8>;
14774 +               bus-range = <0 0>;
14775 +               ranges = <0x02000000 0x0 0x90000000 0x90000000 0x0 0x10000000
14776 +                         0x42000000 0x0 0x80000000 0x80000000 0x0 0x10000000
14777 +                         0x01000000 0x0 0x00000000 0xe0300000 0x0 0x00100000>;
14778 +               clock-frequency = <0>;
14779 +               #interrupt-cells = <1>;
14780 +               #size-cells = <2>;
14781 +               #address-cells = <3>;
14782 +               reg = <0xe0008500 0x100>;
14783 +               compatible = "fsl,mpc8349-pci";
14784 +               device_type = "pci";
14785 +       };
14786 +};
14787 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/mpc8378_mds.dts powerpc.git/arch/powerpc/boot/dts/mpc8378_mds.dts
14788 --- linux-2.6.24/arch/powerpc/boot/dts/mpc8378_mds.dts  1970-01-01 01:00:00.000000000 +0100
14789 +++ powerpc.git/arch/powerpc/boot/dts/mpc8378_mds.dts   2008-01-28 20:25:49.000000000 +0100
14790 @@ -0,0 +1,265 @@
14791 +/*
14792 + * MPC8378E MDS Device Tree Source
14793 + *
14794 + * Copyright 2007 Freescale Semiconductor Inc.
14795 + *
14796 + * This program is free software; you can redistribute  it and/or modify it
14797 + * under  the terms of  the GNU General  Public License as published by the
14798 + * Free Software Foundation;  either version 2 of the  License, or (at your
14799 + * option) any later version.
14800 + */
14801 +
14802 +/dts-v1/;
14803 +
14804 +/ {
14805 +       model = "fsl,mpc8378emds";
14806 +       compatible = "fsl,mpc8378emds","fsl,mpc837xmds";
14807 +       #address-cells = <1>;
14808 +       #size-cells = <1>;
14809 +
14810 +       aliases {
14811 +               ethernet0 = &enet0;
14812 +               ethernet1 = &enet1;
14813 +               serial0 = &serial0;
14814 +               serial1 = &serial1;
14815 +               pci0 = &pci0;
14816 +       };
14817 +
14818 +       cpus {
14819 +               #address-cells = <1>;
14820 +               #size-cells = <0>;
14821 +
14822 +               PowerPC,8378@0 {
14823 +                       device_type = "cpu";
14824 +                       reg = <0>;
14825 +                       d-cache-line-size = <0x20>;
14826 +                       i-cache-line-size = <0x20>;
14827 +                       d-cache-size = <0x8000>;                // L1, 32K
14828 +                       i-cache-size = <0x8000>;                // L1, 32K
14829 +                       timebase-frequency = <0>;
14830 +                       bus-frequency = <0>;
14831 +                       clock-frequency = <0>;
14832 +               };
14833 +       };
14834 +
14835 +       memory {
14836 +               device_type = "memory";
14837 +               reg = <0x00000000 0x20000000>;  // 512MB at 0
14838 +       };
14839 +
14840 +       soc@e0000000 {
14841 +               #address-cells = <1>;
14842 +               #size-cells = <1>;
14843 +               device_type = "soc";
14844 +               ranges = <0x0 0xe0000000 0x00100000>;
14845 +               reg = <0xe0000000 0x00000200>;
14846 +               bus-frequency = <0>;
14847 +
14848 +               wdt@200 {
14849 +                       compatible = "mpc83xx_wdt";
14850 +                       reg = <0x200 0x100>;
14851 +               };
14852 +
14853 +               i2c@3000 {
14854 +                       #address-cells = <1>;
14855 +                       #size-cells = <0>;
14856 +                       cell-index = <0>;
14857 +                       compatible = "fsl-i2c";
14858 +                       reg = <0x3000 0x100>;
14859 +                       interrupts = <0xe 0x8>;
14860 +                       interrupt-parent = < &ipic >;
14861 +                       dfsrr;
14862 +               };
14863 +
14864 +               i2c@3100 {
14865 +                       #address-cells = <1>;
14866 +                       #size-cells = <0>;
14867 +                       cell-index = <1>;
14868 +                       compatible = "fsl-i2c";
14869 +                       reg = <0x3100 0x100>;
14870 +                       interrupts = <0xf 0x8>;
14871 +                       interrupt-parent = < &ipic >;
14872 +                       dfsrr;
14873 +               };
14874 +
14875 +               spi@7000 {
14876 +                       compatible = "fsl_spi";
14877 +                       reg = <0x7000 0x1000>;
14878 +                       interrupts = <0x10 0x8>;
14879 +                       interrupt-parent = < &ipic >;
14880 +                       mode = "cpu";
14881 +               };
14882 +
14883 +               /* phy type (ULPI, UTMI, UTMI_WIDE, SERIAL) */
14884 +               usb@23000 {
14885 +                       compatible = "fsl-usb2-dr";
14886 +                       reg = <0x23000 0x1000>;
14887 +                       #address-cells = <1>;
14888 +                       #size-cells = <0>;
14889 +                       interrupt-parent = < &ipic >;
14890 +                       interrupts = <0x26 0x8>;
14891 +                       phy_type = "utmi_wide";
14892 +               };
14893 +
14894 +               mdio@24520 {
14895 +                       #address-cells = <1>;
14896 +                       #size-cells = <0>;
14897 +                       compatible = "fsl,gianfar-mdio";
14898 +                       reg = <0x24520 0x20>;
14899 +                       phy2: ethernet-phy@2 {
14900 +                               interrupt-parent = < &ipic >;
14901 +                               interrupts = <0x11 0x8>;
14902 +                               reg = <2>;
14903 +                               device_type = "ethernet-phy";
14904 +                       };
14905 +                       phy3: ethernet-phy@3 {
14906 +                               interrupt-parent = < &ipic >;
14907 +                               interrupts = <0x12 0x8>;
14908 +                               reg = <3>;
14909 +                               device_type = "ethernet-phy";
14910 +                       };
14911 +               };
14912 +
14913 +               enet0: ethernet@24000 {
14914 +                       cell-index = <0>;
14915 +                       device_type = "network";
14916 +                       model = "eTSEC";
14917 +                       compatible = "gianfar";
14918 +                       reg = <0x24000 0x1000>;
14919 +                       local-mac-address = [ 00 00 00 00 00 00 ];
14920 +                       interrupts = <0x20 0x8 0x21 0x8 0x22 0x8>;
14921 +                       phy-connection-type = "mii";
14922 +                       interrupt-parent = < &ipic >;
14923 +                       phy-handle = < &phy2 >;
14924 +               };
14925 +
14926 +               enet1: ethernet@25000 {
14927 +                       cell-index = <1>;
14928 +                       device_type = "network";
14929 +                       model = "eTSEC";
14930 +                       compatible = "gianfar";
14931 +                       reg = <0x25000 0x1000>;
14932 +                       local-mac-address = [ 00 00 00 00 00 00 ];
14933 +                       interrupts = <0x23 0x8 0x24 0x8 0x25 0x8>;
14934 +                       phy-connection-type = "mii";
14935 +                       interrupt-parent = < &ipic >;
14936 +                       phy-handle = < &phy3 >;
14937 +               };
14938 +
14939 +               serial0: serial@4500 {
14940 +                       cell-index = <0>;
14941 +                       device_type = "serial";
14942 +                       compatible = "ns16550";
14943 +                       reg = <0x4500 0x100>;
14944 +                       clock-frequency = <0>;
14945 +                       interrupts = <0x9 0x8>;
14946 +                       interrupt-parent = < &ipic >;
14947 +               };
14948 +
14949 +               serial1: serial@4600 {
14950 +                       cell-index = <1>;
14951 +                       device_type = "serial";
14952 +                       compatible = "ns16550";
14953 +                       reg = <0x4600 0x100>;
14954 +                       clock-frequency = <0>;
14955 +                       interrupts = <0xa 0x8>;
14956 +                       interrupt-parent = < &ipic >;
14957 +               };
14958 +
14959 +               crypto@30000 {
14960 +                       model = "SEC3";
14961 +                       compatible = "talitos";
14962 +                       reg = <0x30000 0x10000>;
14963 +                       interrupts = <0xb 0x8>;
14964 +                       interrupt-parent = < &ipic >;
14965 +                       /* Rev. 3.0 geometry */
14966 +                       num-channels = <4>;
14967 +                       channel-fifo-len = <0x18>;
14968 +                       exec-units-mask = <0x000001fe>;
14969 +                       descriptor-types-mask = <0x03ab0ebf>;
14970 +               };
14971 +
14972 +               sdhc@2e000 {
14973 +                       model = "eSDHC";
14974 +                       compatible = "fsl,esdhc";
14975 +                       reg = <0x2e000 0x1000>;
14976 +                       interrupts = <0x2a 0x8>;
14977 +                       interrupt-parent = < &ipic >;
14978 +               };
14979 +
14980 +               /* IPIC
14981 +                * interrupts cell = <intr #, sense>
14982 +                * sense values match linux IORESOURCE_IRQ_* defines:
14983 +                * sense == 8: Level, low assertion
14984 +                * sense == 2: Edge, high-to-low change
14985 +                */
14986 +               ipic: pic@700 {
14987 +                       compatible = "fsl,ipic";
14988 +                       interrupt-controller;
14989 +                       #address-cells = <0>;
14990 +                       #interrupt-cells = <2>;
14991 +                       reg = <0x700 0x100>;
14992 +               };
14993 +       };
14994 +
14995 +       pci0: pci@e0008500 {
14996 +               cell-index = <0>;
14997 +               interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
14998 +               interrupt-map = <
14999 +
15000 +                               /* IDSEL 0x11 */
15001 +                                0x8800 0x0 0x0 0x1 &ipic 0x14 0x8
15002 +                                0x8800 0x0 0x0 0x2 &ipic 0x15 0x8
15003 +                                0x8800 0x0 0x0 0x3 &ipic 0x16 0x8
15004 +                                0x8800 0x0 0x0 0x4 &ipic 0x17 0x8
15005 +
15006 +                               /* IDSEL 0x12 */
15007 +                                0x9000 0x0 0x0 0x1 &ipic 0x16 0x8
15008 +                                0x9000 0x0 0x0 0x2 &ipic 0x17 0x8
15009 +                                0x9000 0x0 0x0 0x3 &ipic 0x14 0x8
15010 +                                0x9000 0x0 0x0 0x4 &ipic 0x15 0x8
15011 +
15012 +                               /* IDSEL 0x13 */
15013 +                                0x9800 0x0 0x0 0x1 &ipic 0x17 0x8
15014 +                                0x9800 0x0 0x0 0x2 &ipic 0x14 0x8
15015 +                                0x9800 0x0 0x0 0x3 &ipic 0x15 0x8
15016 +                                0x9800 0x0 0x0 0x4 &ipic 0x16 0x8
15017 +
15018 +                               /* IDSEL 0x15 */
15019 +                                0xa800 0x0 0x0 0x1 &ipic 0x14 0x8
15020 +                                0xa800 0x0 0x0 0x2 &ipic 0x15 0x8
15021 +                                0xa800 0x0 0x0 0x3 &ipic 0x16 0x8
15022 +                                0xa800 0x0 0x0 0x4 &ipic 0x17 0x8
15023 +
15024 +                               /* IDSEL 0x16 */
15025 +                                0xb000 0x0 0x0 0x1 &ipic 0x17 0x8
15026 +                                0xb000 0x0 0x0 0x2 &ipic 0x14 0x8
15027 +                                0xb000 0x0 0x0 0x3 &ipic 0x15 0x8
15028 +                                0xb000 0x0 0x0 0x4 &ipic 0x16 0x8
15029 +
15030 +                               /* IDSEL 0x17 */
15031 +                                0xb800 0x0 0x0 0x1 &ipic 0x16 0x8
15032 +                                0xb800 0x0 0x0 0x2 &ipic 0x17 0x8
15033 +                                0xb800 0x0 0x0 0x3 &ipic 0x14 0x8
15034 +                                0xb800 0x0 0x0 0x4 &ipic 0x15 0x8
15035 +
15036 +                               /* IDSEL 0x18 */
15037 +                                0xc000 0x0 0x0 0x1 &ipic 0x15 0x8
15038 +                                0xc000 0x0 0x0 0x2 &ipic 0x16 0x8
15039 +                                0xc000 0x0 0x0 0x3 &ipic 0x17 0x8
15040 +                                0xc000 0x0 0x0 0x4 &ipic 0x14 0x8>;
15041 +               interrupt-parent = < &ipic >;
15042 +               interrupts = <0x42 0x8>;
15043 +               bus-range = <0 0>;
15044 +               ranges = <0x02000000 0x0 0x90000000 0x90000000 0x0 0x10000000
15045 +                         0x42000000 0x0 0x80000000 0x80000000 0x0 0x10000000
15046 +                         0x01000000 0x0 0x00000000 0xe0300000 0x0 0x00100000>;
15047 +               clock-frequency = <0>;
15048 +               #interrupt-cells = <1>;
15049 +               #size-cells = <2>;
15050 +               #address-cells = <3>;
15051 +               reg = <0xe0008500 0x100>;
15052 +               compatible = "fsl,mpc8349-pci";
15053 +               device_type = "pci";
15054 +       };
15055 +};
15056 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/mpc8379_mds.dts powerpc.git/arch/powerpc/boot/dts/mpc8379_mds.dts
15057 --- linux-2.6.24/arch/powerpc/boot/dts/mpc8379_mds.dts  1970-01-01 01:00:00.000000000 +0100
15058 +++ powerpc.git/arch/powerpc/boot/dts/mpc8379_mds.dts   2008-01-28 20:25:49.000000000 +0100
15059 @@ -0,0 +1,293 @@
15060 +/*
15061 + * MPC8379E MDS Device Tree Source
15062 + *
15063 + * Copyright 2007 Freescale Semiconductor Inc.
15064 + *
15065 + * This program is free software; you can redistribute  it and/or modify it
15066 + * under  the terms of  the GNU General  Public License as published by the
15067 + * Free Software Foundation;  either version 2 of the  License, or (at your
15068 + * option) any later version.
15069 + */
15070 +
15071 +/dts-v1/;
15072 +
15073 +/ {
15074 +       model = "fsl,mpc8379emds";
15075 +       compatible = "fsl,mpc8379emds","fsl,mpc837xmds";
15076 +       #address-cells = <1>;
15077 +       #size-cells = <1>;
15078 +
15079 +       aliases {
15080 +               ethernet0 = &enet0;
15081 +               ethernet1 = &enet1;
15082 +               serial0 = &serial0;
15083 +               serial1 = &serial1;
15084 +               pci0 = &pci0;
15085 +       };
15086 +
15087 +       cpus {
15088 +               #address-cells = <1>;
15089 +               #size-cells = <0>;
15090 +
15091 +               PowerPC,8379@0 {
15092 +                       device_type = "cpu";
15093 +                       reg = <0>;
15094 +                       d-cache-line-size = <0x20>;
15095 +                       i-cache-line-size = <0x20>;
15096 +                       d-cache-size = <0x8000>;                // L1, 32K
15097 +                       i-cache-size = <0x8000>;                // L1, 32K
15098 +                       timebase-frequency = <0>;
15099 +                       bus-frequency = <0>;
15100 +                       clock-frequency = <0>;
15101 +               };
15102 +       };
15103 +
15104 +       memory {
15105 +               device_type = "memory";
15106 +               reg = <0x00000000 0x20000000>;  // 512MB at 0
15107 +       };
15108 +
15109 +       soc@e0000000 {
15110 +               #address-cells = <1>;
15111 +               #size-cells = <1>;
15112 +               device_type = "soc";
15113 +               ranges = <0x0 0xe0000000 0x00100000>;
15114 +               reg = <0xe0000000 0x00000200>;
15115 +               bus-frequency = <0>;
15116 +
15117 +               wdt@200 {
15118 +                       compatible = "mpc83xx_wdt";
15119 +                       reg = <0x200 0x100>;
15120 +               };
15121 +
15122 +               i2c@3000 {
15123 +                       #address-cells = <1>;
15124 +                       #size-cells = <0>;
15125 +                       cell-index = <0>;
15126 +                       compatible = "fsl-i2c";
15127 +                       reg = <0x3000 0x100>;
15128 +                       interrupts = <0xe 0x8>;
15129 +                       interrupt-parent = < &ipic >;
15130 +                       dfsrr;
15131 +               };
15132 +
15133 +               i2c@3100 {
15134 +                       #address-cells = <1>;
15135 +                       #size-cells = <0>;
15136 +                       cell-index = <1>;
15137 +                       compatible = "fsl-i2c";
15138 +                       reg = <0x3100 0x100>;
15139 +                       interrupts = <0xf 0x8>;
15140 +                       interrupt-parent = < &ipic >;
15141 +                       dfsrr;
15142 +               };
15143 +
15144 +               spi@7000 {
15145 +                       compatible = "fsl_spi";
15146 +                       reg = <0x7000 0x1000>;
15147 +                       interrupts = <0x10 0x8>;
15148 +                       interrupt-parent = < &ipic >;
15149 +                       mode = "cpu";
15150 +               };
15151 +
15152 +               /* phy type (ULPI, UTMI, UTMI_WIDE, SERIAL) */
15153 +               usb@23000 {
15154 +                       compatible = "fsl-usb2-dr";
15155 +                       reg = <0x23000 0x1000>;
15156 +                       #address-cells = <1>;
15157 +                       #size-cells = <0>;
15158 +                       interrupt-parent = < &ipic >;
15159 +                       interrupts = <0x26 0x8>;
15160 +                       phy_type = "utmi_wide";
15161 +               };
15162 +
15163 +               mdio@24520 {
15164 +                       #address-cells = <1>;
15165 +                       #size-cells = <0>;
15166 +                       compatible = "fsl,gianfar-mdio";
15167 +                       reg = <0x24520 0x20>;
15168 +                       phy2: ethernet-phy@2 {
15169 +                               interrupt-parent = < &ipic >;
15170 +                               interrupts = <0x11 0x8>;
15171 +                               reg = <2>;
15172 +                               device_type = "ethernet-phy";
15173 +                       };
15174 +                       phy3: ethernet-phy@3 {
15175 +                               interrupt-parent = < &ipic >;
15176 +                               interrupts = <0x12 0x8>;
15177 +                               reg = <3>;
15178 +                               device_type = "ethernet-phy";
15179 +                       };
15180 +               };
15181 +
15182 +               enet0: ethernet@24000 {
15183 +                       cell-index = <0>;
15184 +                       device_type = "network";
15185 +                       model = "eTSEC";
15186 +                       compatible = "gianfar";
15187 +                       reg = <0x24000 0x1000>;
15188 +                       local-mac-address = [ 00 00 00 00 00 00 ];
15189 +                       interrupts = <0x20 0x8 0x21 0x8 0x22 0x8>;
15190 +                       phy-connection-type = "mii";
15191 +                       interrupt-parent = < &ipic >;
15192 +                       phy-handle = < &phy2 >;
15193 +               };
15194 +
15195 +               enet1: ethernet@25000 {
15196 +                       cell-index = <1>;
15197 +                       device_type = "network";
15198 +                       model = "eTSEC";
15199 +                       compatible = "gianfar";
15200 +                       reg = <0x25000 0x1000>;
15201 +                       local-mac-address = [ 00 00 00 00 00 00 ];
15202 +                       interrupts = <0x23 0x8 0x24 0x8 0x25 0x8>;
15203 +                       phy-connection-type = "mii";
15204 +                       interrupt-parent = < &ipic >;
15205 +                       phy-handle = < &phy3 >;
15206 +               };
15207 +
15208 +               serial0: serial@4500 {
15209 +                       cell-index = <0>;
15210 +                       device_type = "serial";
15211 +                       compatible = "ns16550";
15212 +                       reg = <0x4500 0x100>;
15213 +                       clock-frequency = <0>;
15214 +                       interrupts = <0x9 0x8>;
15215 +                       interrupt-parent = < &ipic >;
15216 +               };
15217 +
15218 +               serial1: serial@4600 {
15219 +                       cell-index = <1>;
15220 +                       device_type = "serial";
15221 +                       compatible = "ns16550";
15222 +                       reg = <0x4600 0x100>;
15223 +                       clock-frequency = <0>;
15224 +                       interrupts = <0xa 0x8>;
15225 +                       interrupt-parent = < &ipic >;
15226 +               };
15227 +
15228 +               crypto@30000 {
15229 +                       model = "SEC3";
15230 +                       compatible = "talitos";
15231 +                       reg = <0x30000 0x10000>;
15232 +                       interrupts = <0xb 0x8>;
15233 +                       interrupt-parent = < &ipic >;
15234 +                       /* Rev. 3.0 geometry */
15235 +                       num-channels = <4>;
15236 +                       channel-fifo-len = <0x18>;
15237 +                       exec-units-mask = <0x000001fe>;
15238 +                       descriptor-types-mask = <0x03ab0ebf>;
15239 +               };
15240 +
15241 +               sdhc@2e000 {
15242 +                       model = "eSDHC";
15243 +                       compatible = "fsl,esdhc";
15244 +                       reg = <0x2e000 0x1000>;
15245 +                       interrupts = <0x2a 0x8>;
15246 +                       interrupt-parent = < &ipic >;
15247 +               };
15248 +
15249 +               sata@18000 {
15250 +                       compatible = "fsl,mpc8379-sata";
15251 +                       reg = <0x18000 0x1000>;
15252 +                       interrupts = <0x2c 0x8>;
15253 +                       interrupt-parent = < &ipic >;
15254 +               };
15255 +
15256 +               sata@19000 {
15257 +                       compatible = "fsl,mpc8379-sata";
15258 +                       reg = <0x19000 0x1000>;
15259 +                       interrupts = <0x2d 0x8>;
15260 +                       interrupt-parent = < &ipic >;
15261 +               };
15262 +
15263 +               sata@1a000 {
15264 +                       compatible = "fsl,mpc8379-sata";
15265 +                       reg = <0x1a000 0x1000>;
15266 +                       interrupts = <0x2e 0x8>;
15267 +                       interrupt-parent = < &ipic >;
15268 +               };
15269 +
15270 +               sata@1b000 {
15271 +                       compatible = "fsl,mpc8379-sata";
15272 +                       reg = <0x1b000 0x1000>;
15273 +                       interrupts = <0x2f 0x8>;
15274 +                       interrupt-parent = < &ipic >;
15275 +               };
15276 +
15277 +               /* IPIC
15278 +                * interrupts cell = <intr #, sense>
15279 +                * sense values match linux IORESOURCE_IRQ_* defines:
15280 +                * sense == 8: Level, low assertion
15281 +                * sense == 2: Edge, high-to-low change
15282 +                */
15283 +               ipic: pic@700 {
15284 +                       compatible = "fsl,ipic";
15285 +                       interrupt-controller;
15286 +                       #address-cells = <0>;
15287 +                       #interrupt-cells = <2>;
15288 +                       reg = <0x700 0x100>;
15289 +               };
15290 +       };
15291 +
15292 +       pci0: pci@e0008500 {
15293 +               cell-index = <0>;
15294 +               interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
15295 +               interrupt-map = <
15296 +
15297 +                               /* IDSEL 0x11 */
15298 +                                0x8800 0x0 0x0 0x1 &ipic 0x14 0x8
15299 +                                0x8800 0x0 0x0 0x2 &ipic 0x15 0x8
15300 +                                0x8800 0x0 0x0 0x3 &ipic 0x16 0x8
15301 +                                0x8800 0x0 0x0 0x4 &ipic 0x17 0x8
15302 +
15303 +                               /* IDSEL 0x12 */
15304 +                                0x9000 0x0 0x0 0x1 &ipic 0x16 0x8
15305 +                                0x9000 0x0 0x0 0x2 &ipic 0x17 0x8
15306 +                                0x9000 0x0 0x0 0x3 &ipic 0x14 0x8
15307 +                                0x9000 0x0 0x0 0x4 &ipic 0x15 0x8
15308 +
15309 +                               /* IDSEL 0x13 */
15310 +                                0x9800 0x0 0x0 0x1 &ipic 0x17 0x8
15311 +                                0x9800 0x0 0x0 0x2 &ipic 0x14 0x8
15312 +                                0x9800 0x0 0x0 0x3 &ipic 0x15 0x8
15313 +                                0x9800 0x0 0x0 0x4 &ipic 0x16 0x8
15314 +
15315 +                               /* IDSEL 0x15 */
15316 +                                0xa800 0x0 0x0 0x1 &ipic 0x14 0x8
15317 +                                0xa800 0x0 0x0 0x2 &ipic 0x15 0x8
15318 +                                0xa800 0x0 0x0 0x3 &ipic 0x16 0x8
15319 +                                0xa800 0x0 0x0 0x4 &ipic 0x17 0x8
15320 +
15321 +                               /* IDSEL 0x16 */
15322 +                                0xb000 0x0 0x0 0x1 &ipic 0x17 0x8
15323 +                                0xb000 0x0 0x0 0x2 &ipic 0x14 0x8
15324 +                                0xb000 0x0 0x0 0x3 &ipic 0x15 0x8
15325 +                                0xb000 0x0 0x0 0x4 &ipic 0x16 0x8
15326 +
15327 +                               /* IDSEL 0x17 */
15328 +                                0xb800 0x0 0x0 0x1 &ipic 0x16 0x8
15329 +                                0xb800 0x0 0x0 0x2 &ipic 0x17 0x8
15330 +                                0xb800 0x0 0x0 0x3 &ipic 0x14 0x8
15331 +                                0xb800 0x0 0x0 0x4 &ipic 0x15 0x8
15332 +
15333 +                               /* IDSEL 0x18 */
15334 +                                0xc000 0x0 0x0 0x1 &ipic 0x15 0x8
15335 +                                0xc000 0x0 0x0 0x2 &ipic 0x16 0x8
15336 +                                0xc000 0x0 0x0 0x3 &ipic 0x17 0x8
15337 +                                0xc000 0x0 0x0 0x4 &ipic 0x14 0x8>;
15338 +               interrupt-parent = < &ipic >;
15339 +               interrupts = <0x42 0x8>;
15340 +               bus-range = <0 0>;
15341 +               ranges = <0x02000000 0x0 0x90000000 0x90000000 0x0 0x10000000
15342 +                         0x42000000 0x0 0x80000000 0x80000000 0x0 0x10000000
15343 +                         0x01000000 0x0 0x00000000 0xe0300000 0x0 0x00100000>;
15344 +               clock-frequency = <0>;
15345 +               #interrupt-cells = <1>;
15346 +               #size-cells = <2>;
15347 +               #address-cells = <3>;
15348 +               reg = <0xe0008500 0x100>;
15349 +               compatible = "fsl,mpc8349-pci";
15350 +               device_type = "pci";
15351 +       };
15352 +};
15353 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/mpc8540ads.dts powerpc.git/arch/powerpc/boot/dts/mpc8540ads.dts
15354 --- linux-2.6.24/arch/powerpc/boot/dts/mpc8540ads.dts   2008-01-24 23:58:37.000000000 +0100
15355 +++ powerpc.git/arch/powerpc/boot/dts/mpc8540ads.dts    2008-01-28 20:25:49.000000000 +0100
15356 @@ -16,6 +16,15 @@
15357         #address-cells = <1>;
15358         #size-cells = <1>;
15359  
15360 +       aliases {
15361 +               ethernet0 = &enet0;
15362 +               ethernet1 = &enet1;
15363 +               ethernet2 = &enet2;
15364 +               serial0 = &serial0;
15365 +               serial1 = &serial1;
15366 +               pci0 = &pci0;
15367 +       };
15368 +
15369         cpus {
15370                 #address-cells = <1>;
15371                 #size-cells = <0>;
15372 @@ -63,7 +72,9 @@
15373                 };
15374  
15375                 i2c@3000 {
15376 -                       device_type = "i2c";
15377 +                       #address-cells = <1>;
15378 +                       #size-cells = <0>;
15379 +                       cell-index = <0>;
15380                         compatible = "fsl-i2c";
15381                         reg = <3000 100>;
15382                         interrupts = <2b 2>;
15383 @@ -74,9 +85,9 @@
15384                 mdio@24520 {
15385                         #address-cells = <1>;
15386                         #size-cells = <0>;
15387 -                       device_type = "mdio";
15388 -                       compatible = "gianfar";
15389 +                       compatible = "fsl,gianfar-mdio";
15390                         reg = <24520 20>;
15391 +
15392                         phy0: ethernet-phy@0 {
15393                                 interrupt-parent = <&mpic>;
15394                                 interrupts = <5 1>;
15395 @@ -97,64 +108,44 @@
15396                         };
15397                 };
15398  
15399 -               ethernet@24000 {
15400 -                       #address-cells = <1>;
15401 -                       #size-cells = <0>;
15402 +               enet0: ethernet@24000 {
15403 +                       cell-index = <0>;
15404                         device_type = "network";
15405                         model = "TSEC";
15406                         compatible = "gianfar";
15407                         reg = <24000 1000>;
15408 -                       /*
15409 -                        * address is deprecated and will be removed
15410 -                        * in 2.6.25.  Only recent versions of
15411 -                        * U-Boot support local-mac-address, however.
15412 -                        */
15413 -                       address = [ 00 00 00 00 00 00 ];
15414                         local-mac-address = [ 00 00 00 00 00 00 ];
15415                         interrupts = <1d 2 1e 2 22 2>;
15416                         interrupt-parent = <&mpic>;
15417                         phy-handle = <&phy0>;
15418                 };
15419  
15420 -               ethernet@25000 {
15421 -                       #address-cells = <1>;
15422 -                       #size-cells = <0>;
15423 +               enet1: ethernet@25000 {
15424 +                       cell-index = <1>;
15425                         device_type = "network";
15426                         model = "TSEC";
15427                         compatible = "gianfar";
15428                         reg = <25000 1000>;
15429 -                       /*
15430 -                        * address is deprecated and will be removed
15431 -                        * in 2.6.25.  Only recent versions of
15432 -                        * U-Boot support local-mac-address, however.
15433 -                        */
15434 -                       address = [ 00 00 00 00 00 00 ];
15435                         local-mac-address = [ 00 00 00 00 00 00 ];
15436                         interrupts = <23 2 24 2 28 2>;
15437                         interrupt-parent = <&mpic>;
15438                         phy-handle = <&phy1>;
15439                 };
15440  
15441 -               ethernet@26000 {
15442 -                       #address-cells = <1>;
15443 -                       #size-cells = <0>;
15444 +               enet2: ethernet@26000 {
15445 +                       cell-index = <2>;
15446                         device_type = "network";
15447                         model = "FEC";
15448                         compatible = "gianfar";
15449                         reg = <26000 1000>;
15450 -                       /*
15451 -                        * address is deprecated and will be removed
15452 -                        * in 2.6.25.  Only recent versions of
15453 -                        * U-Boot support local-mac-address, however.
15454 -                        */
15455 -                       address = [ 00 00 00 00 00 00 ];
15456                         local-mac-address = [ 00 00 00 00 00 00 ];
15457                         interrupts = <29 2>;
15458                         interrupt-parent = <&mpic>;
15459                         phy-handle = <&phy3>;
15460                 };
15461  
15462 -               serial@4500 {
15463 +               serial0: serial@4500 {
15464 +                       cell-index = <0>;
15465                         device_type = "serial";
15466                         compatible = "ns16550";
15467                         reg = <4500 100>;       // reg base, size
15468 @@ -163,7 +154,8 @@
15469                         interrupt-parent = <&mpic>;
15470                 };
15471  
15472 -               serial@4600 {
15473 +               serial1: serial@4600 {
15474 +                       cell-index = <1>;
15475                         device_type = "serial";
15476                         compatible = "ns16550";
15477                         reg = <4600 100>;       // reg base, size
15478 @@ -183,7 +175,8 @@
15479                 };
15480         };
15481  
15482 -       pci@e0008000 {
15483 +       pci0: pci@e0008000 {
15484 +               cell-index = <0>;
15485                 interrupt-map-mask = <f800 0 0 7>;
15486                 interrupt-map = <
15487  
15488 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/mpc8541cds.dts powerpc.git/arch/powerpc/boot/dts/mpc8541cds.dts
15489 --- linux-2.6.24/arch/powerpc/boot/dts/mpc8541cds.dts   2008-01-24 23:58:37.000000000 +0100
15490 +++ powerpc.git/arch/powerpc/boot/dts/mpc8541cds.dts    2008-01-28 20:25:49.000000000 +0100
15491 @@ -16,6 +16,15 @@
15492         #address-cells = <1>;
15493         #size-cells = <1>;
15494  
15495 +       aliases {
15496 +               ethernet0 = &enet0;
15497 +               ethernet1 = &enet1;
15498 +               serial0 = &serial0;
15499 +               serial1 = &serial1;
15500 +               pci0 = &pci0;
15501 +               pci1 = &pci1;
15502 +       };
15503 +
15504         cpus {
15505                 #address-cells = <1>;
15506                 #size-cells = <0>;
15507 @@ -63,7 +72,9 @@
15508                 };
15509  
15510                 i2c@3000 {
15511 -                       device_type = "i2c";
15512 +                       #address-cells = <1>;
15513 +                       #size-cells = <0>;
15514 +                       cell-index = <0>;
15515                         compatible = "fsl-i2c";
15516                         reg = <3000 100>;
15517                         interrupts = <2b 2>;
15518 @@ -74,9 +85,9 @@
15519                 mdio@24520 {
15520                         #address-cells = <1>;
15521                         #size-cells = <0>;
15522 -                       device_type = "mdio";
15523 -                       compatible = "gianfar";
15524 +                       compatible = "fsl,gianfar-mdio";
15525                         reg = <24520 20>;
15526 +
15527                         phy0: ethernet-phy@0 {
15528                                 interrupt-parent = <&mpic>;
15529                                 interrupts = <5 1>;
15530 @@ -91,9 +102,8 @@
15531                         };
15532                 };
15533  
15534 -               ethernet@24000 {
15535 -                       #address-cells = <1>;
15536 -                       #size-cells = <0>;
15537 +               enet0: ethernet@24000 {
15538 +                       cell-index = <0>;
15539                         device_type = "network";
15540                         model = "TSEC";
15541                         compatible = "gianfar";
15542 @@ -104,9 +114,8 @@
15543                         phy-handle = <&phy0>;
15544                 };
15545  
15546 -               ethernet@25000 {
15547 -                       #address-cells = <1>;
15548 -                       #size-cells = <0>;
15549 +               enet1: ethernet@25000 {
15550 +                       cell-index = <1>;
15551                         device_type = "network";
15552                         model = "TSEC";
15553                         compatible = "gianfar";
15554 @@ -117,7 +126,8 @@
15555                         phy-handle = <&phy1>;
15556                 };
15557  
15558 -               serial@4500 {
15559 +               serial0: serial@4500 {
15560 +                       cell-index = <0>;
15561                         device_type = "serial";
15562                         compatible = "ns16550";
15563                         reg = <4500 100>;       // reg base, size
15564 @@ -126,7 +136,8 @@
15565                         interrupt-parent = <&mpic>;
15566                 };
15567  
15568 -               serial@4600 {
15569 +               serial1: serial@4600 {
15570 +                       cell-index = <1>;
15571                         device_type = "serial";
15572                         compatible = "ns16550";
15573                         reg = <4600 100>;       // reg base, size
15574 @@ -183,7 +194,8 @@
15575                 };
15576         };
15577  
15578 -       pci1: pci@e0008000 {
15579 +       pci0: pci@e0008000 {
15580 +               cell-index = <0>;
15581                 interrupt-map-mask = <1f800 0 0 7>;
15582                 interrupt-map = <
15583  
15584 @@ -250,11 +262,12 @@
15585                         #interrupt-cells = <2>;
15586                         compatible = "chrp,iic";
15587                         interrupts = <1>;
15588 -                       interrupt-parent = <&pci1>;
15589 +                       interrupt-parent = <&pci0>;
15590                 };
15591         };
15592  
15593 -       pci@e0009000 {
15594 +       pci1: pci@e0009000 {
15595 +               cell-index = <1>;
15596                 interrupt-map-mask = <f800 0 0 7>;
15597                 interrupt-map = <
15598  
15599 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/mpc8544ds.dts powerpc.git/arch/powerpc/boot/dts/mpc8544ds.dts
15600 --- linux-2.6.24/arch/powerpc/boot/dts/mpc8544ds.dts    2008-01-24 23:58:37.000000000 +0100
15601 +++ powerpc.git/arch/powerpc/boot/dts/mpc8544ds.dts     2008-01-28 20:25:49.000000000 +0100
15602 @@ -15,6 +15,17 @@
15603         #address-cells = <1>;
15604         #size-cells = <1>;
15605  
15606 +       aliases {
15607 +               ethernet0 = &enet0;
15608 +               ethernet1 = &enet1;
15609 +               serial0 = &serial0;
15610 +               serial1 = &serial1;
15611 +               pci0 = &pci0;
15612 +               pci1 = &pci1;
15613 +               pci2 = &pci2;
15614 +               pci3 = &pci3;
15615 +       };
15616 +
15617         cpus {
15618                 #cpus = <1>;
15619                 #address-cells = <1>;
15620 @@ -64,7 +75,9 @@
15621                 };
15622  
15623                 i2c@3000 {
15624 -                       device_type = "i2c";
15625 +                       #address-cells = <1>;
15626 +                       #size-cells = <0>;
15627 +                       cell-index = <0>;
15628                         compatible = "fsl-i2c";
15629                         reg = <3000 100>;
15630                         interrupts = <2b 2>;
15631 @@ -72,12 +85,23 @@
15632                         dfsrr;
15633                 };
15634  
15635 +               i2c@3100 {
15636 +                       #address-cells = <1>;
15637 +                       #size-cells = <0>;
15638 +                       cell-index = <1>;
15639 +                       compatible = "fsl-i2c";
15640 +                       reg = <3100 100>;
15641 +                       interrupts = <2b 2>;
15642 +                       interrupt-parent = <&mpic>;
15643 +                       dfsrr;
15644 +               };
15645 +
15646                 mdio@24520 {
15647                         #address-cells = <1>;
15648                         #size-cells = <0>;
15649 -                       device_type = "mdio";
15650 -                       compatible = "gianfar";
15651 +                       compatible = "fsl,gianfar-mdio";
15652                         reg = <24520 20>;
15653 +
15654                         phy0: ethernet-phy@0 {
15655                                 interrupt-parent = <&mpic>;
15656                                 interrupts = <a 1>;
15657 @@ -92,9 +116,8 @@
15658                         };
15659                 };
15660  
15661 -               ethernet@24000 {
15662 -                       #address-cells = <1>;
15663 -                       #size-cells = <0>;
15664 +               enet0: ethernet@24000 {
15665 +                       cell-index = <0>;
15666                         device_type = "network";
15667                         model = "TSEC";
15668                         compatible = "gianfar";
15669 @@ -106,9 +129,8 @@
15670                         phy-connection-type = "rgmii-id";
15671                 };
15672  
15673 -               ethernet@26000 {
15674 -                       #address-cells = <1>;
15675 -                       #size-cells = <0>;
15676 +               enet1: ethernet@26000 {
15677 +                       cell-index = <1>;
15678                         device_type = "network";
15679                         model = "TSEC";
15680                         compatible = "gianfar";
15681 @@ -120,7 +142,8 @@
15682                         phy-connection-type = "rgmii-id";
15683                 };
15684  
15685 -               serial@4500 {
15686 +               serial0: serial@4500 {
15687 +                       cell-index = <0>;
15688                         device_type = "serial";
15689                         compatible = "ns16550";
15690                         reg = <4500 100>;
15691 @@ -129,7 +152,8 @@
15692                         interrupt-parent = <&mpic>;
15693                 };
15694  
15695 -               serial@4600 {
15696 +               serial1: serial@4600 {
15697 +                       cell-index = <1>;
15698                         device_type = "serial";
15699                         compatible = "ns16550";
15700                         reg = <4600 100>;
15701 @@ -156,7 +180,8 @@
15702                 };
15703         };
15704  
15705 -       pci@e0008000 {
15706 +       pci0: pci@e0008000 {
15707 +               cell-index = <0>;
15708                 compatible = "fsl,mpc8540-pci";
15709                 device_type = "pci";
15710                 interrupt-map-mask = <f800 0 0 7>;
15711 @@ -187,7 +212,8 @@
15712                 reg = <e0008000 1000>;
15713         };
15714  
15715 -       pcie@e0009000 {
15716 +       pci1: pcie@e0009000 {
15717 +               cell-index = <1>;
15718                 compatible = "fsl,mpc8548-pcie";
15719                 device_type = "pci";
15720                 #interrupt-cells = <1>;
15721 @@ -223,7 +249,8 @@
15722                 };
15723         };
15724  
15725 -       pcie@e000a000 {
15726 +       pci2: pcie@e000a000 {
15727 +               cell-index = <2>;
15728                 compatible = "fsl,mpc8548-pcie";
15729                 device_type = "pci";
15730                 #interrupt-cells = <1>;
15731 @@ -259,7 +286,8 @@
15732                 };
15733         };
15734  
15735 -       pcie@e000b000 {
15736 +       pci3: pcie@e000b000 {
15737 +               cell-index = <3>;
15738                 compatible = "fsl,mpc8548-pcie";
15739                 device_type = "pci";
15740                 #interrupt-cells = <1>;
15741 @@ -276,9 +304,9 @@
15742                 interrupt-map = <
15743                         // IDSEL 0x1c  USB
15744                         e000 0 0 1 &i8259 c 2
15745 -                       e100 0 0 1 &i8259 9 2
15746 -                       e200 0 0 1 &i8259 a 2
15747 -                       e300 0 0 1 &i8259 b 2
15748 +                       e100 0 0 2 &i8259 9 2
15749 +                       e200 0 0 3 &i8259 a 2
15750 +                       e300 0 0 4 &i8259 b 2
15751  
15752                         // IDSEL 0x1d  Audio
15753                         e800 0 0 1 &i8259 6 2
15754 @@ -369,6 +397,5 @@
15755                                 };
15756                         };
15757                 };
15758 -
15759         };
15760  };
15761 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/mpc8548cds.dts powerpc.git/arch/powerpc/boot/dts/mpc8548cds.dts
15762 --- linux-2.6.24/arch/powerpc/boot/dts/mpc8548cds.dts   2008-01-24 23:58:37.000000000 +0100
15763 +++ powerpc.git/arch/powerpc/boot/dts/mpc8548cds.dts    2008-01-28 20:25:49.000000000 +0100
15764 @@ -16,6 +16,20 @@
15765         #address-cells = <1>;
15766         #size-cells = <1>;
15767  
15768 +       aliases {
15769 +               ethernet0 = &enet0;
15770 +               ethernet1 = &enet1;
15771 +/*
15772 +               ethernet2 = &enet2;
15773 +               ethernet3 = &enet3;
15774 +*/
15775 +               serial0 = &serial0;
15776 +               serial1 = &serial1;
15777 +               pci0 = &pci0;
15778 +               pci1 = &pci1;
15779 +               pci2 = &pci2;
15780 +       };
15781 +
15782         cpus {
15783                 #address-cells = <1>;
15784                 #size-cells = <0>;
15785 @@ -63,7 +77,9 @@
15786                 };
15787  
15788                 i2c@3000 {
15789 -                       device_type = "i2c";
15790 +                       #address-cells = <1>;
15791 +                       #size-cells = <0>;
15792 +                       cell-index = <0>;
15793                         compatible = "fsl-i2c";
15794                         reg = <3000 100>;
15795                         interrupts = <2b 2>;
15796 @@ -71,12 +87,23 @@
15797                         dfsrr;
15798                 };
15799  
15800 +               i2c@3100 {
15801 +                       #address-cells = <1>;
15802 +                       #size-cells = <0>;
15803 +                       cell-index = <1>;
15804 +                       compatible = "fsl-i2c";
15805 +                       reg = <3100 100>;
15806 +                       interrupts = <2b 2>;
15807 +                       interrupt-parent = <&mpic>;
15808 +                       dfsrr;
15809 +               };
15810 +
15811                 mdio@24520 {
15812                         #address-cells = <1>;
15813                         #size-cells = <0>;
15814 -                       device_type = "mdio";
15815 -                       compatible = "gianfar";
15816 +                       compatible = "fsl,gianfar-mdio";
15817                         reg = <24520 20>;
15818 +
15819                         phy0: ethernet-phy@0 {
15820                                 interrupt-parent = <&mpic>;
15821                                 interrupts = <5 1>;
15822 @@ -103,9 +130,8 @@
15823                         };
15824                 };
15825  
15826 -               ethernet@24000 {
15827 -                       #address-cells = <1>;
15828 -                       #size-cells = <0>;
15829 +               enet0: ethernet@24000 {
15830 +                       cell-index = <0>;
15831                         device_type = "network";
15832                         model = "eTSEC";
15833                         compatible = "gianfar";
15834 @@ -116,9 +142,8 @@
15835                         phy-handle = <&phy0>;
15836                 };
15837  
15838 -               ethernet@25000 {
15839 -                       #address-cells = <1>;
15840 -                       #size-cells = <0>;
15841 +               enet1: ethernet@25000 {
15842 +                       cell-index = <1>;
15843                         device_type = "network";
15844                         model = "eTSEC";
15845                         compatible = "gianfar";
15846 @@ -130,9 +155,8 @@
15847                 };
15848  
15849  /* eTSEC 3/4 are currently broken
15850 -               ethernet@26000 {
15851 -                       #address-cells = <1>;
15852 -                       #size-cells = <0>;
15853 +               enet2: ethernet@26000 {
15854 +                       cell-index = <2>;
15855                         device_type = "network";
15856                         model = "eTSEC";
15857                         compatible = "gianfar";
15858 @@ -143,9 +167,8 @@
15859                         phy-handle = <&phy2>;
15860                 };
15861  
15862 -               ethernet@27000 {
15863 -                       #address-cells = <1>;
15864 -                       #size-cells = <0>;
15865 +               enet3: ethernet@27000 {
15866 +                       cell-index = <3>;
15867                         device_type = "network";
15868                         model = "eTSEC";
15869                         compatible = "gianfar";
15870 @@ -157,7 +180,8 @@
15871                 };
15872   */
15873  
15874 -               serial@4500 {
15875 +               serial0: serial@4500 {
15876 +                       cell-index = <0>;
15877                         device_type = "serial";
15878                         compatible = "ns16550";
15879                         reg = <4500 100>;       // reg base, size
15880 @@ -166,7 +190,8 @@
15881                         interrupt-parent = <&mpic>;
15882                 };
15883  
15884 -               serial@4600 {
15885 +               serial1: serial@4600 {
15886 +                       cell-index = <1>;
15887                         device_type = "serial";
15888                         compatible = "ns16550";
15889                         reg = <4600 100>;       // reg base, size
15890 @@ -193,7 +218,8 @@
15891                 };
15892         };
15893  
15894 -       pci@e0008000 {
15895 +       pci0: pci@e0008000 {
15896 +               cell-index = <0>;
15897                 interrupt-map-mask = <f800 0 0 7>;
15898                 interrupt-map = <
15899                         /* IDSEL 0x4 (PCIX Slot 2) */
15900 @@ -342,7 +368,8 @@
15901                 };
15902         };
15903  
15904 -       pci@e0009000 {
15905 +       pci1: pci@e0009000 {
15906 +               cell-index = <1>;
15907                 interrupt-map-mask = <f800 0 0 7>;
15908                 interrupt-map = <
15909  
15910 @@ -366,7 +393,8 @@
15911                 device_type = "pci";
15912         };
15913  
15914 -       pcie@e000a000 {
15915 +       pci2: pcie@e000a000 {
15916 +               cell-index = <2>;
15917                 interrupt-map-mask = <f800 0 0 7>;
15918                 interrupt-map = <
15919  
15920 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/mpc8555cds.dts powerpc.git/arch/powerpc/boot/dts/mpc8555cds.dts
15921 --- linux-2.6.24/arch/powerpc/boot/dts/mpc8555cds.dts   2008-01-24 23:58:37.000000000 +0100
15922 +++ powerpc.git/arch/powerpc/boot/dts/mpc8555cds.dts    2008-01-28 20:25:49.000000000 +0100
15923 @@ -16,6 +16,15 @@
15924         #address-cells = <1>;
15925         #size-cells = <1>;
15926  
15927 +       aliases {
15928 +               ethernet0 = &enet0;
15929 +               ethernet1 = &enet1;
15930 +               serial0 = &serial0;
15931 +               serial1 = &serial1;
15932 +               pci0 = &pci0;
15933 +               pci1 = &pci1;
15934 +       };
15935 +
15936         cpus {
15937                 #address-cells = <1>;
15938                 #size-cells = <0>;
15939 @@ -63,7 +72,9 @@
15940                 };
15941  
15942                 i2c@3000 {
15943 -                       device_type = "i2c";
15944 +                       #address-cells = <1>;
15945 +                       #size-cells = <0>;
15946 +                       cell-index = <0>;
15947                         compatible = "fsl-i2c";
15948                         reg = <3000 100>;
15949                         interrupts = <2b 2>;
15950 @@ -74,9 +85,9 @@
15951                 mdio@24520 {
15952                         #address-cells = <1>;
15953                         #size-cells = <0>;
15954 -                       device_type = "mdio";
15955 -                       compatible = "gianfar";
15956 +                       compatible = "fsl,gianfar-mdio";
15957                         reg = <24520 20>;
15958 +
15959                         phy0: ethernet-phy@0 {
15960                                 interrupt-parent = <&mpic>;
15961                                 interrupts = <5 1>;
15962 @@ -91,9 +102,8 @@
15963                         };
15964                 };
15965  
15966 -               ethernet@24000 {
15967 -                       #address-cells = <1>;
15968 -                       #size-cells = <0>;
15969 +               enet0: ethernet@24000 {
15970 +                       cell-index = <0>;
15971                         device_type = "network";
15972                         model = "TSEC";
15973                         compatible = "gianfar";
15974 @@ -104,9 +114,8 @@
15975                         phy-handle = <&phy0>;
15976                 };
15977  
15978 -               ethernet@25000 {
15979 -                       #address-cells = <1>;
15980 -                       #size-cells = <0>;
15981 +               enet1: ethernet@25000 {
15982 +                       cell-index = <1>;
15983                         device_type = "network";
15984                         model = "TSEC";
15985                         compatible = "gianfar";
15986 @@ -117,7 +126,8 @@
15987                         phy-handle = <&phy1>;
15988                 };
15989  
15990 -               serial@4500 {
15991 +               serial0: serial@4500 {
15992 +                       cell-index = <0>;
15993                         device_type = "serial";
15994                         compatible = "ns16550";
15995                         reg = <4500 100>;       // reg base, size
15996 @@ -126,7 +136,8 @@
15997                         interrupt-parent = <&mpic>;
15998                 };
15999  
16000 -               serial@4600 {
16001 +               serial1: serial@4600 {
16002 +                       cell-index = <1>;
16003                         device_type = "serial";
16004                         compatible = "ns16550";
16005                         reg = <4600 100>;       // reg base, size
16006 @@ -183,7 +194,8 @@
16007                 };
16008         };
16009  
16010 -       pci1: pci@e0008000 {
16011 +       pci0: pci@e0008000 {
16012 +               cell-index = <0>;
16013                 interrupt-map-mask = <1f800 0 0 7>;
16014                 interrupt-map = <
16015  
16016 @@ -250,11 +262,12 @@
16017                         #interrupt-cells = <2>;
16018                         compatible = "chrp,iic";
16019                         interrupts = <1>;
16020 -                       interrupt-parent = <&pci1>;
16021 +                       interrupt-parent = <&pci0>;
16022                 };
16023         };
16024  
16025 -       pci@e0009000 {
16026 +       pci1: pci@e0009000 {
16027 +               cell-index = <1>;
16028                 interrupt-map-mask = <f800 0 0 7>;
16029                 interrupt-map = <
16030  
16031 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/mpc8560ads.dts powerpc.git/arch/powerpc/boot/dts/mpc8560ads.dts
16032 --- linux-2.6.24/arch/powerpc/boot/dts/mpc8560ads.dts   2008-01-24 23:58:37.000000000 +0100
16033 +++ powerpc.git/arch/powerpc/boot/dts/mpc8560ads.dts    2008-01-28 20:25:49.000000000 +0100
16034 @@ -16,6 +16,16 @@
16035         #address-cells = <1>;
16036         #size-cells = <1>;
16037  
16038 +       aliases {
16039 +               ethernet0 = &enet0;
16040 +               ethernet1 = &enet1;
16041 +               ethernet2 = &enet2;
16042 +               ethernet3 = &enet3;
16043 +               serial0 = &serial0;
16044 +               serial1 = &serial1;
16045 +               pci0 = &pci0;
16046 +       };
16047 +
16048         cpus {
16049                 #address-cells = <1>;
16050                 #size-cells = <0>;
16051 @@ -63,11 +73,11 @@
16052                 };
16053  
16054                 mdio@24520 {
16055 -                       device_type = "mdio";
16056 -                       compatible = "gianfar";
16057 -                       reg = <24520 20>;
16058                         #address-cells = <1>;
16059                         #size-cells = <0>;
16060 +                       compatible = "fsl,gianfar-mdio";
16061 +                       reg = <24520 20>;
16062 +
16063                         phy0: ethernet-phy@0 {
16064                                 interrupt-parent = <&mpic>;
16065                                 interrupts = <5 1>;
16066 @@ -94,36 +104,24 @@
16067                         };
16068                 };
16069  
16070 -               ethernet@24000 {
16071 +               enet0: ethernet@24000 {
16072 +                       cell-index = <0>;
16073                         device_type = "network";
16074                         model = "TSEC";
16075                         compatible = "gianfar";
16076                         reg = <24000 1000>;
16077 -                       /*
16078 -                        * address is deprecated and will be removed
16079 -                        * in 2.6.25.  Only recent versions of
16080 -                        * U-Boot support local-mac-address, however.
16081 -                        */
16082 -                       address = [ 00 00 00 00 00 00 ];
16083                         local-mac-address = [ 00 00 00 00 00 00 ];
16084                         interrupts = <1d 2 1e 2 22 2>;
16085                         interrupt-parent = <&mpic>;
16086                         phy-handle = <&phy0>;
16087                 };
16088  
16089 -               ethernet@25000 {
16090 -                       #address-cells = <1>;
16091 -                       #size-cells = <0>;
16092 +               enet1: ethernet@25000 {
16093 +                       cell-index = <1>;
16094                         device_type = "network";
16095                         model = "TSEC";
16096                         compatible = "gianfar";
16097                         reg = <25000 1000>;
16098 -                       /*
16099 -                        * address is deprecated and will be removed
16100 -                        * in 2.6.25.  Only recent versions of
16101 -                        * U-Boot support local-mac-address, however.
16102 -                        */
16103 -                       address = [ 00 00 00 00 00 00 ];
16104                         local-mac-address = [ 00 00 00 00 00 00 ];
16105                         interrupts = <23 2 24 2 28 2>;
16106                         interrupt-parent = <&mpic>;
16107 @@ -174,7 +172,7 @@
16108                                 compatible = "fsl,mpc8560-cpm-pic", "fsl,cpm2-pic";
16109                         };
16110  
16111 -                       serial@91a00 {
16112 +                       serial0: serial@91a00 {
16113                                 device_type = "serial";
16114                                 compatible = "fsl,mpc8560-scc-uart",
16115                                              "fsl,cpm2-scc-uart";
16116 @@ -186,7 +184,7 @@
16117                                 interrupt-parent = <&cpmpic>;
16118                         };
16119  
16120 -                       serial@91a20 {
16121 +                       serial1: serial@91a20 {
16122                                 device_type = "serial";
16123                                 compatible = "fsl,mpc8560-scc-uart",
16124                                              "fsl,cpm2-scc-uart";
16125 @@ -198,17 +196,11 @@
16126                                 interrupt-parent = <&cpmpic>;
16127                         };
16128  
16129 -                       ethernet@91320 {
16130 +                       enet2: ethernet@91320 {
16131                                 device_type = "network";
16132                                 compatible = "fsl,mpc8560-fcc-enet",
16133                                              "fsl,cpm2-fcc-enet";
16134                                 reg = <91320 20 88500 100 913b0 1>;
16135 -                               /*
16136 -                                * mac-address is deprecated and will be removed
16137 -                                * in 2.6.25.  Only recent versions of
16138 -                                * U-Boot support local-mac-address, however.
16139 -                                */
16140 -                               mac-address = [ 00 00 00 00 00 00 ];
16141                                 local-mac-address = [ 00 00 00 00 00 00 ];
16142                                 fsl,cpm-command = <16200300>;
16143                                 interrupts = <21 8>;
16144 @@ -216,17 +208,11 @@
16145                                 phy-handle = <&phy2>;
16146                         };
16147  
16148 -                       ethernet@91340 {
16149 +                       enet3: ethernet@91340 {
16150                                 device_type = "network";
16151                                 compatible = "fsl,mpc8560-fcc-enet",
16152                                              "fsl,cpm2-fcc-enet";
16153                                 reg = <91340 20 88600 100 913d0 1>;
16154 -                               /*
16155 -                                * mac-address is deprecated and will be removed
16156 -                                * in 2.6.25.  Only recent versions of
16157 -                                * U-Boot support local-mac-address, however.
16158 -                                */
16159 -                               mac-address = [ 00 00 00 00 00 00 ];
16160                                 local-mac-address = [ 00 00 00 00 00 00 ];
16161                                 fsl,cpm-command = <1a400300>;
16162                                 interrupts = <22 8>;
16163 @@ -236,7 +222,8 @@
16164                 };
16165         };
16166  
16167 -       pci@e0008000 {
16168 +       pci0: pci@e0008000 {
16169 +               cell-index = <0>;
16170                 #interrupt-cells = <1>;
16171                 #size-cells = <2>;
16172                 #address-cells = <3>;
16173 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/mpc8568mds.dts powerpc.git/arch/powerpc/boot/dts/mpc8568mds.dts
16174 --- linux-2.6.24/arch/powerpc/boot/dts/mpc8568mds.dts   2008-01-24 23:58:37.000000000 +0100
16175 +++ powerpc.git/arch/powerpc/boot/dts/mpc8568mds.dts    2008-01-28 20:25:49.000000000 +0100
16176 @@ -20,6 +20,17 @@
16177         #address-cells = <1>;
16178         #size-cells = <1>;
16179  
16180 +       aliases {
16181 +               ethernet0 = &enet0;
16182 +               ethernet1 = &enet1;
16183 +               ethernet2 = &enet2;
16184 +               ethernet3 = &enet3;
16185 +               serial0 = &serial0;
16186 +               serial1 = &serial1;
16187 +               pci0 = &pci0;
16188 +               pci1 = &pci1;
16189 +       };
16190 +
16191         cpus {
16192                 #address-cells = <1>;
16193                 #size-cells = <0>;
16194 @@ -74,7 +85,7 @@
16195                 i2c@3000 {
16196                         #address-cells = <1>;
16197                         #size-cells = <0>;
16198 -                       device_type = "i2c";
16199 +                       cell-index = <0>;
16200                         compatible = "fsl-i2c";
16201                         reg = <3000 100>;
16202                         interrupts = <2b 2>;
16203 @@ -90,7 +101,7 @@
16204                 i2c@3100 {
16205                         #address-cells = <1>;
16206                         #size-cells = <0>;
16207 -                       device_type = "i2c";
16208 +                       cell-index = <1>;
16209                         compatible = "fsl-i2c";
16210                         reg = <3100 100>;
16211                         interrupts = <2b 2>;
16212 @@ -101,9 +112,9 @@
16213                 mdio@24520 {
16214                         #address-cells = <1>;
16215                         #size-cells = <0>;
16216 -                       device_type = "mdio";
16217 -                       compatible = "gianfar";
16218 +                       compatible = "fsl,gianfar-mdio";
16219                         reg = <24520 20>;
16220 +
16221                         phy0: ethernet-phy@7 {
16222                                 interrupt-parent = <&mpic>;
16223                                 interrupts = <1 1>;
16224 @@ -130,45 +141,32 @@
16225                         };
16226                 };
16227  
16228 -               ethernet@24000 {
16229 -                       #address-cells = <1>;
16230 -                       #size-cells = <0>;
16231 +               enet0: ethernet@24000 {
16232 +                       cell-index = <0>;
16233                         device_type = "network";
16234                         model = "eTSEC";
16235                         compatible = "gianfar";
16236                         reg = <24000 1000>;
16237 -                       /*
16238 -                        * mac-address is deprecated and will be removed
16239 -                        * in 2.6.25.  Only recent versions of
16240 -                        * U-Boot support local-mac-address, however.
16241 -                        */
16242 -                       mac-address = [ 00 00 00 00 00 00 ];
16243                         local-mac-address = [ 00 00 00 00 00 00 ];
16244                         interrupts = <1d 2 1e 2 22 2>;
16245                         interrupt-parent = <&mpic>;
16246                         phy-handle = <&phy2>;
16247                 };
16248  
16249 -               ethernet@25000 {
16250 -                       #address-cells = <1>;
16251 -                       #size-cells = <0>;
16252 +               enet1: ethernet@25000 {
16253 +                       cell-index = <1>;
16254                         device_type = "network";
16255                         model = "eTSEC";
16256                         compatible = "gianfar";
16257                         reg = <25000 1000>;
16258 -                       /*
16259 -                        * mac-address is deprecated and will be removed
16260 -                        * in 2.6.25.  Only recent versions of
16261 -                        * U-Boot support local-mac-address, however.
16262 -                        */
16263 -                       mac-address = [ 00 00 00 00 00 00 ];
16264                         local-mac-address = [ 00 00 00 00 00 00 ];
16265                         interrupts = <23 2 24 2 28 2>;
16266                         interrupt-parent = <&mpic>;
16267                         phy-handle = <&phy3>;
16268                 };
16269  
16270 -               serial@4500 {
16271 +               serial0: serial@4500 {
16272 +                       cell-index = <0>;
16273                         device_type = "serial";
16274                         compatible = "ns16550";
16275                         reg = <4500 100>;
16276 @@ -183,7 +181,8 @@
16277                         fsl,has-rstcr;
16278                 };
16279  
16280 -               serial@4600 {
16281 +               serial1: serial@4600 {
16282 +                       cell-index = <1>;
16283                         device_type = "serial";
16284                         compatible = "ns16550";
16285                         reg = <4600 100>;
16286 @@ -318,45 +317,35 @@
16287                         mode = "cpu";
16288                 };
16289  
16290 -               ucc@2000 {
16291 +               enet2: ucc@2000 {
16292                         device_type = "network";
16293                         compatible = "ucc_geth";
16294                         model = "UCC";
16295 +                       cell-index = <1>;
16296                         device-id = <1>;
16297                         reg = <2000 200>;
16298                         interrupts = <20>;
16299                         interrupt-parent = <&qeic>;
16300 -                       /*
16301 -                        * mac-address is deprecated and will be removed
16302 -                        * in 2.6.25.  Only recent versions of
16303 -                        * U-Boot support local-mac-address, however.
16304 -                        */
16305 -                       mac-address = [ 00 00 00 00 00 00 ];
16306                         local-mac-address = [ 00 00 00 00 00 00 ];
16307 -                       rx-clock = <0>;
16308 -                       tx-clock = <20>;
16309 +                       rx-clock-name = "none";
16310 +                       tx-clock-name = "clk16";
16311                         pio-handle = <&pio1>;
16312                         phy-handle = <&phy0>;
16313                         phy-connection-type = "rgmii-id";
16314                 };
16315  
16316 -               ucc@3000 {
16317 +               enet3: ucc@3000 {
16318                         device_type = "network";
16319                         compatible = "ucc_geth";
16320                         model = "UCC";
16321 +                       cell-index = <2>;
16322                         device-id = <2>;
16323                         reg = <3000 200>;
16324                         interrupts = <21>;
16325                         interrupt-parent = <&qeic>;
16326 -                       /*
16327 -                        * mac-address is deprecated and will be removed
16328 -                        * in 2.6.25.  Only recent versions of
16329 -                        * U-Boot support local-mac-address, however.
16330 -                        */
16331 -                       mac-address = [ 00 00 00 00 00 00 ];
16332                         local-mac-address = [ 00 00 00 00 00 00 ];
16333 -                       rx-clock = <0>;
16334 -                       tx-clock = <20>;
16335 +                       rx-clock-name = "none";
16336 +                       tx-clock-name = "clk16";
16337                         pio-handle = <&pio2>;
16338                         phy-handle = <&phy1>;
16339                         phy-connection-type = "rgmii-id";
16340 @@ -366,7 +355,6 @@
16341                         #address-cells = <1>;
16342                         #size-cells = <0>;
16343                         reg = <2120 18>;
16344 -                       device_type = "mdio";
16345                         compatible = "ucc_geth_phy";
16346  
16347                         /* These are the same PHYs as on
16348 @@ -410,7 +398,8 @@
16349  
16350         };
16351  
16352 -       pci@e0008000 {
16353 +       pci0: pci@e0008000 {
16354 +               cell-index = <0>;
16355                 interrupt-map-mask = <f800 0 0 7>;
16356                 interrupt-map = <
16357                         /* IDSEL 0x12 AD18 */
16358 @@ -440,7 +429,8 @@
16359         };
16360  
16361         /* PCI Express */
16362 -       pcie@e000a000 {
16363 +       pci1: pcie@e000a000 {
16364 +               cell-index = <2>;
16365                 interrupt-map-mask = <f800 0 0 7>;
16366                 interrupt-map = <
16367  
16368 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/mpc8572ds.dts powerpc.git/arch/powerpc/boot/dts/mpc8572ds.dts
16369 --- linux-2.6.24/arch/powerpc/boot/dts/mpc8572ds.dts    2008-01-24 23:58:37.000000000 +0100
16370 +++ powerpc.git/arch/powerpc/boot/dts/mpc8572ds.dts     2008-01-28 20:25:49.000000000 +0100
16371 @@ -15,6 +15,18 @@
16372         #address-cells = <1>;
16373         #size-cells = <1>;
16374  
16375 +       aliases {
16376 +               ethernet0 = &enet0;
16377 +               ethernet1 = &enet1;
16378 +               ethernet2 = &enet2;
16379 +               ethernet3 = &enet3;
16380 +               serial0 = &serial0;
16381 +               serial1 = &serial1;
16382 +               pci0 = &pci0;
16383 +               pci1 = &pci1;
16384 +               pci2 = &pci2;
16385 +       };
16386 +
16387         cpus {
16388                 #address-cells = <1>;
16389                 #size-cells = <0>;
16390 @@ -69,7 +81,9 @@
16391                 };
16392  
16393                 i2c@3000 {
16394 -                       device_type = "i2c";
16395 +                       #address-cells = <1>;
16396 +                       #size-cells = <0>;
16397 +                       cell-index = <0>;
16398                         compatible = "fsl-i2c";
16399                         reg = <3000 100>;
16400                         interrupts = <2b 2>;
16401 @@ -78,7 +92,9 @@
16402                 };
16403  
16404                 i2c@3100 {
16405 -                       device_type = "i2c";
16406 +                       #address-cells = <1>;
16407 +                       #size-cells = <0>;
16408 +                       cell-index = <1>;
16409                         compatible = "fsl-i2c";
16410                         reg = <3100 100>;
16411                         interrupts = <2b 2>;
16412 @@ -89,9 +105,9 @@
16413                 mdio@24520 {
16414                         #address-cells = <1>;
16415                         #size-cells = <0>;
16416 -                       device_type = "mdio";
16417 -                       compatible = "gianfar";
16418 +                       compatible = "fsl,gianfar-mdio";
16419                         reg = <24520 20>;
16420 +
16421                         phy0: ethernet-phy@0 {
16422                                 interrupt-parent = <&mpic>;
16423                                 interrupts = <a 1>;
16424 @@ -114,9 +130,8 @@
16425                         };
16426                 };
16427  
16428 -               ethernet@24000 {
16429 -                       #address-cells = <1>;
16430 -                       #size-cells = <0>;
16431 +               enet0: ethernet@24000 {
16432 +                       cell-index = <0>;
16433                         device_type = "network";
16434                         model = "eTSEC";
16435                         compatible = "gianfar";
16436 @@ -128,9 +143,8 @@
16437                         phy-connection-type = "rgmii-id";
16438                 };
16439  
16440 -               ethernet@25000 {
16441 -                       #address-cells = <1>;
16442 -                       #size-cells = <0>;
16443 +               enet1: ethernet@25000 {
16444 +                       cell-index = <1>;
16445                         device_type = "network";
16446                         model = "eTSEC";
16447                         compatible = "gianfar";
16448 @@ -142,9 +156,8 @@
16449                         phy-connection-type = "rgmii-id";
16450                 };
16451  
16452 -               ethernet@26000 {
16453 -                       #address-cells = <1>;
16454 -                       #size-cells = <0>;
16455 +               enet2: ethernet@26000 {
16456 +                       cell-index = <2>;
16457                         device_type = "network";
16458                         model = "eTSEC";
16459                         compatible = "gianfar";
16460 @@ -156,9 +169,8 @@
16461                         phy-connection-type = "rgmii-id";
16462                 };
16463  
16464 -               ethernet@27000 {
16465 -                       #address-cells = <1>;
16466 -                       #size-cells = <0>;
16467 +               enet3: ethernet@27000 {
16468 +                       cell-index = <3>;
16469                         device_type = "network";
16470                         model = "eTSEC";
16471                         compatible = "gianfar";
16472 @@ -170,7 +182,8 @@
16473                         phy-connection-type = "rgmii-id";
16474                 };
16475  
16476 -               serial@4500 {
16477 +               serial0: serial@4500 {
16478 +                       cell-index = <0>;
16479                         device_type = "serial";
16480                         compatible = "ns16550";
16481                         reg = <4500 100>;
16482 @@ -179,7 +192,8 @@
16483                         interrupt-parent = <&mpic>;
16484                 };
16485  
16486 -               serial@4600 {
16487 +               serial1: serial@4600 {
16488 +                       cell-index = <1>;
16489                         device_type = "serial";
16490                         compatible = "ns16550";
16491                         reg = <4600 100>;
16492 @@ -206,7 +220,8 @@
16493                 };
16494         };
16495  
16496 -       pcie@ffe08000 {
16497 +       pci0: pcie@ffe08000 {
16498 +               cell-index = <0>;
16499                 compatible = "fsl,mpc8548-pcie";
16500                 device_type = "pci";
16501                 #interrupt-cells = <1>;
16502 @@ -319,9 +334,9 @@
16503  
16504                         // IDSEL 0x1c  USB
16505                         e000 0 0 1 &i8259 c 2
16506 -                       e100 0 0 1 &i8259 9 2
16507 -                       e200 0 0 1 &i8259 a 2
16508 -                       e300 0 0 1 &i8259 b 2
16509 +                       e100 0 0 2 &i8259 9 2
16510 +                       e200 0 0 3 &i8259 a 2
16511 +                       e300 0 0 4 &i8259 b 2
16512  
16513                         // IDSEL 0x1d  Audio
16514                         e800 0 0 1 &i8259 6 2
16515 @@ -415,7 +430,8 @@
16516  
16517         };
16518  
16519 -       pcie@ffe09000 {
16520 +       pci1: pcie@ffe09000 {
16521 +               cell-index = <1>;
16522                 compatible = "fsl,mpc8548-pcie";
16523                 device_type = "pci";
16524                 #interrupt-cells = <1>;
16525 @@ -451,7 +467,8 @@
16526                 };
16527         };
16528  
16529 -       pcie@ffe0a000 {
16530 +       pci2: pcie@ffe0a000 {
16531 +               cell-index = <2>;
16532                 compatible = "fsl,mpc8548-pcie";
16533                 device_type = "pci";
16534                 #interrupt-cells = <1>;
16535 @@ -464,6 +481,7 @@
16536                 clock-frequency = <1fca055>;
16537                 interrupt-parent = <&mpic>;
16538                 interrupts = <1b 2>;
16539 +               interrupt-map-mask = <f800 0 0 7>;
16540                 interrupt-map = <
16541                         /* IDSEL 0x0 */
16542                         0000 0 0 1 &mpic 0 1
16543 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/mpc8610_hpcd.dts powerpc.git/arch/powerpc/boot/dts/mpc8610_hpcd.dts
16544 --- linux-2.6.24/arch/powerpc/boot/dts/mpc8610_hpcd.dts 2008-01-24 23:58:37.000000000 +0100
16545 +++ powerpc.git/arch/powerpc/boot/dts/mpc8610_hpcd.dts  2008-01-28 20:25:49.000000000 +0100
16546 @@ -1,7 +1,7 @@
16547  /*
16548   * MPC8610 HPCD Device Tree Source
16549   *
16550 - * Copyright 2007 Freescale Semiconductor Inc.
16551 + * Copyright 2007-2008 Freescale Semiconductor Inc.
16552   *
16553   * This program is free software; you can redistribute  it and/or modify it
16554   * under the terms of the GNU General Public License Version 2 as published
16555 @@ -15,6 +15,13 @@
16556         #address-cells = <1>;
16557         #size-cells = <1>;
16558  
16559 +       aliases {
16560 +               serial0 = &serial0;
16561 +               serial1 = &serial1;
16562 +               pci0 = &pci0;
16563 +               pci1 = &pci1;
16564 +       };
16565 +
16566         cpus {
16567                 #address-cells = <1>;
16568                 #size-cells = <0>;
16569 @@ -42,33 +49,42 @@
16570                 #size-cells = <1>;
16571                 #interrupt-cells = <2>;
16572                 device_type = "soc";
16573 +               compatible = "fsl,mpc8610-immr", "simple-bus";
16574                 ranges = <0 e0000000 00100000>;
16575                 reg = <e0000000 1000>;
16576                 bus-frequency = <0>;
16577  
16578                 i2c@3000 {
16579 -                       device_type = "i2c";
16580 -                       compatible = "fsl-i2c";
16581                         #address-cells = <1>;
16582                         #size-cells = <0>;
16583 +                       cell-index = <0>;
16584 +                       compatible = "fsl-i2c";
16585                         reg = <3000 100>;
16586                         interrupts = <2b 2>;
16587                         interrupt-parent = <&mpic>;
16588                         dfsrr;
16589 +
16590 +                        cs4270:codec@4f {
16591 +                               compatible = "cirrus,cs4270";
16592 +                                reg = <4f>;
16593 +                               /* MCLK source is a stand-alone oscillator */
16594 +                               clock-frequency = <bb8000>;
16595 +                        };
16596                 };
16597  
16598                 i2c@3100 {
16599 -                       device_type = "i2c";
16600 -                       compatible = "fsl-i2c";
16601                         #address-cells = <1>;
16602                         #size-cells = <0>;
16603 +                       cell-index = <1>;
16604 +                       compatible = "fsl-i2c";
16605                         reg = <3100 100>;
16606                         interrupts = <2b 2>;
16607                         interrupt-parent = <&mpic>;
16608                         dfsrr;
16609                 };
16610  
16611 -               serial@4500 {
16612 +               serial0: serial@4500 {
16613 +                       cell-index = <0>;
16614                         device_type = "serial";
16615                         compatible = "ns16550";
16616                         reg = <4500 100>;
16617 @@ -77,7 +93,8 @@
16618                         interrupt-parent = <&mpic>;
16619                 };
16620  
16621 -               serial@4600 {
16622 +               serial1: serial@4600 {
16623 +                       cell-index = <1>;
16624                         device_type = "serial";
16625                         compatible = "ns16550";
16626                         reg = <4600 100>;
16627 @@ -86,7 +103,6 @@
16628                         interrupt-parent = <&mpic>;
16629                 };
16630  
16631 -
16632                 mpic: interrupt-controller@40000 {
16633                         clock-frequency = <0>;
16634                         interrupt-controller;
16635 @@ -103,9 +119,113 @@
16636                         reg = <e0000 1000>;
16637                         fsl,has-rstcr;
16638                 };
16639 +
16640 +               i2s@16000 {
16641 +                       compatible = "fsl,mpc8610-ssi";
16642 +                       cell-index = <0>;
16643 +                       reg = <16000 100>;
16644 +                       interrupt-parent = <&mpic>;
16645 +                       interrupts = <3e 2>;
16646 +                       fsl,mode = "i2s-slave";
16647 +                       codec-handle = <&cs4270>;
16648 +               };
16649 +
16650 +               ssi@16100 {
16651 +                       compatible = "fsl,mpc8610-ssi";
16652 +                       cell-index = <1>;
16653 +                       reg = <16100 100>;
16654 +                       interrupt-parent = <&mpic>;
16655 +                       interrupts = <3f 2>;
16656 +               };
16657 +
16658 +                dma@21300 {
16659 +                        #address-cells = <1>;
16660 +                        #size-cells = <1>;
16661 +                        compatible = "fsl,mpc8610-dma", "fsl,eloplus-dma";
16662 +                        cell-index = <0>;
16663 +                        reg = <21300 4>; /* DMA general status register */
16664 +                        ranges = <0 21100 200>;
16665 +
16666 +                        dma-channel@0 {
16667 +                               compatible = "fsl,mpc8610-dma-channel",
16668 +                                       "fsl,eloplus-dma-channel";
16669 +                               cell-index = <0>;
16670 +                               reg = <0 80>;
16671 +                               interrupt-parent = <&mpic>;
16672 +                               interrupts = <14 2>;
16673 +                        };
16674 +                        dma-channel@1 {
16675 +                               compatible = "fsl,mpc8610-dma-channel",
16676 +                                       "fsl,eloplus-dma-channel";
16677 +                               cell-index = <1>;
16678 +                               reg = <80 80>;
16679 +                               interrupt-parent = <&mpic>;
16680 +                               interrupts = <15 2>;
16681 +                        };
16682 +                        dma-channel@2 {
16683 +                               compatible = "fsl,mpc8610-dma-channel",
16684 +                                       "fsl,eloplus-dma-channel";
16685 +                               cell-index = <2>;
16686 +                               reg = <100 80>;
16687 +                               interrupt-parent = <&mpic>;
16688 +                               interrupts = <16 2>;
16689 +                        };
16690 +                        dma-channel@3 {
16691 +                               compatible = "fsl,mpc8610-dma-channel",
16692 +                                       "fsl,eloplus-dma-channel";
16693 +                               cell-index = <3>;
16694 +                               reg = <180 80>;
16695 +                               interrupt-parent = <&mpic>;
16696 +                               interrupts = <17 2>;
16697 +                        };
16698 +                };
16699 +
16700 +                dma@c300 {
16701 +                        #address-cells = <1>;
16702 +                        #size-cells = <1>;
16703 +                        compatible = "fsl,mpc8610-dma", "fsl,mpc8540-dma";
16704 +                        cell-index = <1>;
16705 +                        reg = <c300 4>; /* DMA general status register */
16706 +                        ranges = <0 c100 200>;
16707 +
16708 +                        dma-channel@0 {
16709 +                               compatible = "fsl,mpc8610-dma-channel",
16710 +                                       "fsl,mpc8540-dma-channel";
16711 +                               cell-index = <0>;
16712 +                               reg = <0 80>;
16713 +                               interrupt-parent = <&mpic>;
16714 +                               interrupts = <3c 2>;
16715 +                        };
16716 +                        dma-channel@1 {
16717 +                               compatible = "fsl,mpc8610-dma-channel",
16718 +                                       "fsl,mpc8540-dma-channel";
16719 +                               cell-index = <1>;
16720 +                               reg = <80 80>;
16721 +                               interrupt-parent = <&mpic>;
16722 +                               interrupts = <3d 2>;
16723 +                        };
16724 +                        dma-channel@2 {
16725 +                               compatible = "fsl,mpc8610-dma-channel",
16726 +                                       "fsl,mpc8540-dma-channel";
16727 +                               cell-index = <2>;
16728 +                               reg = <100 80>;
16729 +                               interrupt-parent = <&mpic>;
16730 +                               interrupts = <3e 2>;
16731 +                        };
16732 +                        dma-channel@3 {
16733 +                               compatible = "fsl,mpc8610-dma-channel",
16734 +                                       "fsl,mpc8540-dma-channel";
16735 +                               cell-index = <3>;
16736 +                               reg = <180 80>;
16737 +                               interrupt-parent = <&mpic>;
16738 +                               interrupts = <3f 2>;
16739 +                        };
16740 +                };
16741 +
16742         };
16743  
16744 -       pci@e0008000 {
16745 +       pci0: pci@e0008000 {
16746 +               cell-index = <0>;
16747                 compatible = "fsl,mpc8610-pci";
16748                 device_type = "pci";
16749                 #interrupt-cells = <1>;
16750 @@ -134,7 +254,8 @@
16751                         >;
16752         };
16753  
16754 -       pcie@e000a000 {
16755 +       pci1: pcie@e000a000 {
16756 +               cell-index = <1>;
16757                 compatible = "fsl,mpc8641-pcie";
16758                 device_type = "pci";
16759                 #interrupt-cells = <1>;
16760 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/mpc8641_hpcn.dts powerpc.git/arch/powerpc/boot/dts/mpc8641_hpcn.dts
16761 --- linux-2.6.24/arch/powerpc/boot/dts/mpc8641_hpcn.dts 2008-01-24 23:58:37.000000000 +0100
16762 +++ powerpc.git/arch/powerpc/boot/dts/mpc8641_hpcn.dts  2008-01-28 20:25:49.000000000 +0100
16763 @@ -16,6 +16,17 @@
16764         #address-cells = <1>;
16765         #size-cells = <1>;
16766  
16767 +       aliases {
16768 +               ethernet0 = &enet0;
16769 +               ethernet1 = &enet1;
16770 +               ethernet2 = &enet2;
16771 +               ethernet3 = &enet3;
16772 +               serial0 = &serial0;
16773 +               serial1 = &serial1;
16774 +               pci0 = &pci0;
16775 +               pci1 = &pci1;
16776 +       };
16777 +
16778         cpus {
16779                 #address-cells = <1>;
16780                 #size-cells = <0>;
16781 @@ -49,16 +60,60 @@
16782                 reg = <00000000 40000000>;      // 1G at 0x0
16783         };
16784  
16785 +       localbus@f8005000 {
16786 +               #address-cells = <2>;
16787 +               #size-cells = <1>;
16788 +               compatible = "fsl,mpc8641-localbus", "simple-bus";
16789 +               reg = <f8005000 1000>;
16790 +               interrupts = <13 2>;
16791 +               interrupt-parent = <&mpic>;
16792 +
16793 +               ranges = <0 0 ff800000 00800000
16794 +                         1 0 fe000000 01000000
16795 +                         2 0 f8200000 00100000
16796 +                         3 0 f8100000 00100000>;
16797 +
16798 +               flash@0,0 {
16799 +                       compatible = "cfi-flash";
16800 +                       reg = <0 0 00800000>;
16801 +                       bank-width = <2>;
16802 +                       device-width = <2>;
16803 +                       #address-cells = <1>;
16804 +                       #size-cells = <1>;
16805 +                       partition@0 {
16806 +                               label = "kernel";
16807 +                               reg = <00000000 00300000>;
16808 +                       };
16809 +                       partition@300000 {
16810 +                               label = "firmware b";
16811 +                               reg = <00300000 00100000>;
16812 +                               read-only;
16813 +                       };
16814 +                       partition@400000 {
16815 +                               label = "fs";
16816 +                               reg = <00400000 00300000>;
16817 +                       };
16818 +                       partition@700000 {
16819 +                               label = "firmware a";
16820 +                               reg = <00700000 00100000>;
16821 +                               read-only;
16822 +                       };
16823 +               };
16824 +       };
16825 +
16826         soc8641@f8000000 {
16827                 #address-cells = <1>;
16828                 #size-cells = <1>;
16829                 device_type = "soc";
16830 +               compatible = "simple-bus";
16831                 ranges = <00000000 f8000000 00100000>;
16832                 reg = <f8000000 00001000>;      // CCSRBAR
16833                 bus-frequency = <0>;
16834  
16835                 i2c@3000 {
16836 -                       device_type = "i2c";
16837 +                       #address-cells = <1>;
16838 +                       #size-cells = <0>;
16839 +                       cell-index = <0>;
16840                         compatible = "fsl-i2c";
16841                         reg = <3000 100>;
16842                         interrupts = <2b 2>;
16843 @@ -67,7 +122,9 @@
16844                 };
16845  
16846                 i2c@3100 {
16847 -                       device_type = "i2c";
16848 +                       #address-cells = <1>;
16849 +                       #size-cells = <0>;
16850 +                       cell-index = <1>;
16851                         compatible = "fsl-i2c";
16852                         reg = <3100 100>;
16853                         interrupts = <2b 2>;
16854 @@ -78,9 +135,9 @@
16855                 mdio@24520 {
16856                         #address-cells = <1>;
16857                         #size-cells = <0>;
16858 -                       device_type = "mdio";
16859 -                       compatible = "gianfar";
16860 +                       compatible = "fsl,gianfar-mdio";
16861                         reg = <24520 20>;
16862 +
16863                         phy0: ethernet-phy@0 {
16864                                 interrupt-parent = <&mpic>;
16865                                 interrupts = <a 1>;
16866 @@ -107,19 +164,12 @@
16867                         };
16868                 };
16869  
16870 -               ethernet@24000 {
16871 -                       #address-cells = <1>;
16872 -                       #size-cells = <0>;
16873 +               enet0: ethernet@24000 {
16874 +                       cell-index = <0>;
16875                         device_type = "network";
16876                         model = "TSEC";
16877                         compatible = "gianfar";
16878                         reg = <24000 1000>;
16879 -                       /*
16880 -                        * mac-address is deprecated and will be removed
16881 -                        * in 2.6.25.  Only recent versions of
16882 -                        * U-Boot support local-mac-address, however.
16883 -                        */
16884 -                       mac-address = [ 00 00 00 00 00 00 ];
16885                         local-mac-address = [ 00 00 00 00 00 00 ];
16886                         interrupts = <1d 2 1e 2 22 2>;
16887                         interrupt-parent = <&mpic>;
16888 @@ -127,19 +177,12 @@
16889                         phy-connection-type = "rgmii-id";
16890                 };
16891  
16892 -               ethernet@25000 {
16893 -                       #address-cells = <1>;
16894 -                       #size-cells = <0>;
16895 +               enet1: ethernet@25000 {
16896 +                       cell-index = <1>;
16897                         device_type = "network";
16898                         model = "TSEC";
16899                         compatible = "gianfar";
16900                         reg = <25000 1000>;
16901 -                       /*
16902 -                        * mac-address is deprecated and will be removed
16903 -                        * in 2.6.25.  Only recent versions of
16904 -                        * U-Boot support local-mac-address, however.
16905 -                        */
16906 -                       mac-address = [ 00 00 00 00 00 00 ];
16907                         local-mac-address = [ 00 00 00 00 00 00 ];
16908                         interrupts = <23 2 24 2 28 2>;
16909                         interrupt-parent = <&mpic>;
16910 @@ -147,19 +190,12 @@
16911                         phy-connection-type = "rgmii-id";
16912                 };
16913                 
16914 -               ethernet@26000 {
16915 -                       #address-cells = <1>;
16916 -                       #size-cells = <0>;
16917 +               enet2: ethernet@26000 {
16918 +                       cell-index = <2>;
16919                         device_type = "network";
16920                         model = "TSEC";
16921                         compatible = "gianfar";
16922                         reg = <26000 1000>;
16923 -                       /*
16924 -                        * mac-address is deprecated and will be removed
16925 -                        * in 2.6.25.  Only recent versions of
16926 -                        * U-Boot support local-mac-address, however.
16927 -                        */
16928 -                       mac-address = [ 00 00 00 00 00 00 ];
16929                         local-mac-address = [ 00 00 00 00 00 00 ];
16930                         interrupts = <1F 2 20 2 21 2>;
16931                         interrupt-parent = <&mpic>;
16932 @@ -167,26 +203,21 @@
16933                         phy-connection-type = "rgmii-id";
16934                 };
16935  
16936 -               ethernet@27000 {
16937 -                       #address-cells = <1>;
16938 -                       #size-cells = <0>;
16939 +               enet3: ethernet@27000 {
16940 +                       cell-index = <3>;
16941                         device_type = "network";
16942                         model = "TSEC";
16943                         compatible = "gianfar";
16944                         reg = <27000 1000>;
16945 -                       /*
16946 -                        * mac-address is deprecated and will be removed
16947 -                        * in 2.6.25.  Only recent versions of
16948 -                        * U-Boot support local-mac-address, however.
16949 -                        */
16950 -                       mac-address = [ 00 00 00 00 00 00 ];
16951                         local-mac-address = [ 00 00 00 00 00 00 ];
16952                         interrupts = <25 2 26 2 27 2>;
16953                         interrupt-parent = <&mpic>;
16954                         phy-handle = <&phy3>;
16955                         phy-connection-type = "rgmii-id";
16956                 };
16957 -               serial@4500 {
16958 +
16959 +               serial0: serial@4500 {
16960 +                       cell-index = <0>;
16961                         device_type = "serial";
16962                         compatible = "ns16550";
16963                         reg = <4500 100>;
16964 @@ -195,7 +226,8 @@
16965                         interrupt-parent = <&mpic>;
16966                 };
16967  
16968 -               serial@4600 {
16969 +               serial1: serial@4600 {
16970 +                       cell-index = <1>;
16971                         device_type = "serial";
16972                         compatible = "ns16550";
16973                         reg = <4600 100>;
16974 @@ -222,7 +254,8 @@
16975                 };
16976         };
16977  
16978 -       pcie@f8008000 {
16979 +       pci0: pcie@f8008000 {
16980 +               cell-index = <0>;
16981                 compatible = "fsl,mpc8641-pcie";
16982                 device_type = "pci";
16983                 #interrupt-cells = <1>;
16984 @@ -335,9 +368,9 @@
16985  
16986                         // IDSEL 0x1c  USB
16987                         e000 0 0 1 &i8259 c 2
16988 -                       e100 0 0 1 &i8259 9 2
16989 -                       e200 0 0 1 &i8259 a 2
16990 -                       e300 0 0 1 &i8259 b 2
16991 +                       e100 0 0 2 &i8259 9 2
16992 +                       e200 0 0 3 &i8259 a 2
16993 +                       e300 0 0 4 &i8259 b 2
16994  
16995                         // IDSEL 0x1d  Audio
16996                         e800 0 0 1 &i8259 6 2
16997 @@ -430,7 +463,8 @@
16998  
16999         };
17000  
17001 -       pcie@f8009000 {
17002 +       pci1: pcie@f8009000 {
17003 +               cell-index = <1>;
17004                 compatible = "fsl,mpc8641-pcie";
17005                 device_type = "pci";
17006                 #interrupt-cells = <1>;
17007 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/mpc866ads.dts powerpc.git/arch/powerpc/boot/dts/mpc866ads.dts
17008 --- linux-2.6.24/arch/powerpc/boot/dts/mpc866ads.dts    2008-01-24 23:58:37.000000000 +0100
17009 +++ powerpc.git/arch/powerpc/boot/dts/mpc866ads.dts     2008-01-28 20:25:49.000000000 +0100
17010 @@ -12,7 +12,7 @@
17011  
17012  / {
17013         model = "MPC866ADS";
17014 -       compatible = "mpc8xx";
17015 +       compatible = "fsl,mpc866ads";
17016         #address-cells = <1>;
17017         #size-cells = <1>;
17018  
17019 @@ -23,15 +23,15 @@
17020                 PowerPC,866@0 {
17021                         device_type = "cpu";
17022                         reg = <0>;
17023 -                       d-cache-line-size = <20>;       // 32 bytes
17024 -                       i-cache-line-size = <20>;       // 32 bytes
17025 +                       d-cache-line-size = <10>;       // 16 bytes
17026 +                       i-cache-line-size = <10>;       // 16 bytes
17027                         d-cache-size = <2000>;          // L1, 8K
17028                         i-cache-size = <4000>;          // L1, 16K
17029                         timebase-frequency = <0>;
17030                         bus-frequency = <0>;
17031                         clock-frequency = <0>;
17032                         interrupts = <f 2>;     // decrementer interrupt
17033 -                       interrupt-parent = <&Mpc8xx_pic>;
17034 +                       interrupt-parent = <&PIC>;
17035                 };
17036         };
17037  
17038 @@ -40,107 +40,139 @@
17039                 reg = <00000000 800000>;
17040         };
17041  
17042 -       soc866@ff000000 {
17043 +       localbus@ff000100 {
17044 +               compatible = "fsl,mpc866-localbus", "fsl,pq1-localbus";
17045 +               #address-cells = <2>;
17046 +               #size-cells = <1>;
17047 +               reg = <ff000100 40>;
17048 +
17049 +               ranges = <
17050 +                       1 0 ff080000 00008000
17051 +                       5 0 ff0a0000 00008000
17052 +               >;
17053 +
17054 +               board-control@1,0 {
17055 +                       reg = <1 0 20 5 300 4>;
17056 +                       compatible = "fsl,mpc866ads-bcsr";
17057 +               };
17058 +       };
17059 +
17060 +       soc@ff000000 {
17061                 #address-cells = <1>;
17062                 #size-cells = <1>;
17063                 device_type = "soc";
17064                 ranges = <0 ff000000 00100000>;
17065                 reg = <ff000000 00000200>;
17066                 bus-frequency = <0>;
17067 -               mdio@e80 {
17068 -                       device_type = "mdio";
17069 -                       compatible = "fs_enet";
17070 -                       reg = <e80 8>;
17071 +
17072 +               mdio@e00 {
17073 +                       compatible = "fsl,mpc866-fec-mdio", "fsl,pq1-fec-mdio";
17074 +                       reg = <e00 188>;
17075                         #address-cells = <1>;
17076                         #size-cells = <0>;
17077 -                       phy: ethernet-phy@f {
17078 +                       PHY: ethernet-phy@f {
17079                                 reg = <f>;
17080                                 device_type = "ethernet-phy";
17081                         };
17082                 };
17083  
17084 -               fec@e00 {
17085 +               ethernet@e00 {
17086                         device_type = "network";
17087 -                       compatible = "fs_enet";
17088 -                       model = "FEC";
17089 -                       device-id = <1>;
17090 +                       compatible = "fsl,mpc866-fec-enet",
17091 +                                    "fsl,pq1-fec-enet";
17092                         reg = <e00 188>;
17093 -                       mac-address = [ 00 00 0C 00 01 FD ];
17094 +                       local-mac-address = [ 00 00 00 00 00 00 ];
17095                         interrupts = <3 1>;
17096 -                       interrupt-parent = <&Mpc8xx_pic>;
17097 -                       phy-handle = <&Phy>;
17098 +                       interrupt-parent = <&PIC>;
17099 +                       phy-handle = <&PHY>;
17100 +                       linux,network-index = <0>;
17101                 };
17102  
17103 -               mpc8xx_pic: pic@ff000000 {
17104 +               PIC: pic@0 {
17105                         interrupt-controller;
17106 -                       #address-cells = <0>;
17107                         #interrupt-cells = <2>;
17108                         reg = <0 24>;
17109 -                       device_type = "mpc8xx-pic";
17110 -                       compatible = "CPM";
17111 +                       compatible = "fsl,mpc866-pic", "fsl,pq1-pic";
17112                 };
17113  
17114 -               cpm@ff000000 {
17115 +               cpm@9c0 {
17116                         #address-cells = <1>;
17117                         #size-cells = <1>;
17118 -                       device_type = "cpm";
17119 -                       model = "CPM";
17120 -                       ranges = <0 0 4000>;
17121 -                       reg = <860 f0>;
17122 -                       command-proc = <9c0>;
17123 +                       compatible = "fsl,mpc866-cpm", "fsl,cpm1";
17124 +                       ranges;
17125 +                       reg = <9c0 40>;
17126                         brg-frequency = <0>;
17127                         interrupts = <0 2>;     // cpm error interrupt
17128 -                       interrupt-parent = <&Cpm_pic>;
17129 +                       interrupt-parent = <&CPM_PIC>;
17130  
17131 -                       cpm_pic: pic@930 {
17132 +                       muram@2000 {
17133 +                               #address-cells = <1>;
17134 +                               #size-cells = <1>;
17135 +                               ranges = <0 2000 2000>;
17136 +
17137 +                               data@0 {
17138 +                                       compatible = "fsl,cpm-muram-data";
17139 +                                       reg = <0 1c00>;
17140 +                               };
17141 +                       };
17142 +
17143 +                       brg@9f0 {
17144 +                               compatible = "fsl,mpc866-brg",
17145 +                                            "fsl,cpm1-brg",
17146 +                                            "fsl,cpm-brg";
17147 +                               reg = <9f0 10>;
17148 +                               clock-frequency = <0>;
17149 +                       };
17150 +
17151 +                       CPM_PIC: pic@930 {
17152                                 interrupt-controller;
17153                                 #address-cells = <0>;
17154 -                               #interrupt-cells = <2>;
17155 +                               #interrupt-cells = <1>;
17156                                 interrupts = <5 2 0 2>;
17157 -                               interrupt-parent = <&Mpc8xx_pic>;
17158 +                               interrupt-parent = <&PIC>;
17159                                 reg = <930 20>;
17160 -                               device_type = "cpm-pic";
17161 -                               compatible = "CPM";
17162 +                               compatible = "fsl,mpc866-cpm-pic",
17163 +                                            "fsl,cpm1-pic";
17164                         };
17165  
17166 -                       smc@a80 {
17167 +
17168 +                       serial@a80 {
17169                                 device_type = "serial";
17170 -                               compatible = "cpm_uart";
17171 -                               model = "SMC";
17172 -                               device-id = <1>;
17173 +                               compatible = "fsl,mpc866-smc-uart",
17174 +                                            "fsl,cpm1-smc-uart";
17175                                 reg = <a80 10 3e80 40>;
17176 -                               clock-setup = <00ffffff 0>;
17177 -                               rx-clock = <1>;
17178 -                               tx-clock = <1>;
17179 -                               current-speed = <0>;
17180 -                               interrupts = <4 3>;
17181 -                               interrupt-parent = <&Cpm_pic>;
17182 +                               interrupts = <4>;
17183 +                               interrupt-parent = <&CPM_PIC>;
17184 +                               fsl,cpm-brg = <1>;
17185 +                               fsl,cpm-command = <0090>;
17186                         };
17187  
17188 -                       smc@a90 {
17189 +                       serial@a90 {
17190                                 device_type = "serial";
17191 -                               compatible = "cpm_uart";
17192 -                               model = "SMC";
17193 -                               device-id = <2>;
17194 -                               reg = <a90 20 3f80 40>;
17195 -                               clock-setup = <ff00ffff 90000>;
17196 -                               rx-clock = <2>;
17197 -                               tx-clock = <2>;
17198 -                               current-speed = <0>;
17199 -                               interrupts = <3 3>;
17200 -                               interrupt-parent = <&Cpm_pic>;
17201 +                               compatible = "fsl,mpc866-smc-uart",
17202 +                                            "fsl,cpm1-smc-uart";
17203 +                               reg = <a90 10 3f80 40>;
17204 +                               interrupts = <3>;
17205 +                               interrupt-parent = <&CPM_PIC>;
17206 +                               fsl,cpm-brg = <2>;
17207 +                               fsl,cpm-command = <00d0>;
17208                         };
17209  
17210 -                       scc@a00 {
17211 +                       ethernet@a00 {
17212                                 device_type = "network";
17213 -                               compatible = "fs_enet";
17214 -                               model = "SCC";
17215 -                               device-id = <1>;
17216 -                               reg = <a00 18 3c00 80>;
17217 -                               mac-address = [ 00 00 0C 00 03 FD ];
17218 -                               interrupts = <1e 3>;
17219 -                               interrupt-parent = <&Cpm_pic>;
17220 +                               compatible = "fsl,mpc866-scc-enet",
17221 +                                            "fsl,cpm1-scc-enet";
17222 +                               reg = <a00 18 3c00 100>;
17223 +                               local-mac-address = [ 00 00 00 00 00 00 ];
17224 +                               interrupts = <1e>;
17225 +                               interrupt-parent = <&CPM_PIC>;
17226 +                               fsl,cpm-command = <0000>;
17227 +                               linux,network-index = <1>;
17228                         };
17229                 };
17230         };
17231 +
17232 +       chosen {
17233 +               linux,stdout-path = "/soc/cpm/serial@a80";
17234 +       };
17235  };
17236 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/rainier.dts powerpc.git/arch/powerpc/boot/dts/rainier.dts
17237 --- linux-2.6.24/arch/powerpc/boot/dts/rainier.dts      1970-01-01 01:00:00.000000000 +0100
17238 +++ powerpc.git/arch/powerpc/boot/dts/rainier.dts       2008-01-28 20:25:49.000000000 +0100
17239 @@ -0,0 +1,353 @@
17240 +/*
17241 + * Device Tree Source for AMCC Rainier
17242 + *
17243 + * Based on Sequoia code
17244 + * Copyright (c) 2007 MontaVista Software, Inc.
17245 + *
17246 + * FIXME: Draft only!
17247 + *
17248 + * This file is licensed under the terms of the GNU General Public
17249 + * License version 2.  This program is licensed "as is" without
17250 + * any warranty of any kind, whether express or implied.
17251 + *
17252 + */
17253 +
17254 +/ {
17255 +       #address-cells = <2>;
17256 +       #size-cells = <1>;
17257 +       model = "amcc,rainier";
17258 +       compatible = "amcc,rainier";
17259 +       dcr-parent = <&/cpus/cpu@0>;
17260 +
17261 +       aliases {
17262 +               ethernet0 = &EMAC0;
17263 +               ethernet1 = &EMAC1;
17264 +               serial0 = &UART0;
17265 +               serial1 = &UART1;
17266 +               serial2 = &UART2;
17267 +               serial3 = &UART3;
17268 +       };
17269 +
17270 +       cpus {
17271 +               #address-cells = <1>;
17272 +               #size-cells = <0>;
17273 +
17274 +               cpu@0 {
17275 +                       device_type = "cpu";
17276 +                       model = "PowerPC,440GRx";
17277 +                       reg = <0>;
17278 +                       clock-frequency = <0>; /* Filled in by zImage */
17279 +                       timebase-frequency = <0>; /* Filled in by zImage */
17280 +                       i-cache-line-size = <20>;
17281 +                       d-cache-line-size = <20>;
17282 +                       i-cache-size = <8000>;
17283 +                       d-cache-size = <8000>;
17284 +                       dcr-controller;
17285 +                       dcr-access-method = "native";
17286 +               };
17287 +       };
17288 +
17289 +       memory {
17290 +               device_type = "memory";
17291 +               reg = <0 0 0>; /* Filled in by zImage */
17292 +       };
17293 +
17294 +       UIC0: interrupt-controller0 {
17295 +               compatible = "ibm,uic-440grx","ibm,uic";
17296 +               interrupt-controller;
17297 +               cell-index = <0>;
17298 +               dcr-reg = <0c0 009>;
17299 +               #address-cells = <0>;
17300 +               #size-cells = <0>;
17301 +               #interrupt-cells = <2>;
17302 +       };
17303 +
17304 +       UIC1: interrupt-controller1 {
17305 +               compatible = "ibm,uic-440grx","ibm,uic";
17306 +               interrupt-controller;
17307 +               cell-index = <1>;
17308 +               dcr-reg = <0d0 009>;
17309 +               #address-cells = <0>;
17310 +               #size-cells = <0>;
17311 +               #interrupt-cells = <2>;
17312 +               interrupts = <1e 4 1f 4>; /* cascade */
17313 +               interrupt-parent = <&UIC0>;
17314 +       };
17315 +
17316 +       UIC2: interrupt-controller2 {
17317 +               compatible = "ibm,uic-440grx","ibm,uic";
17318 +               interrupt-controller;
17319 +               cell-index = <2>;
17320 +               dcr-reg = <0e0 009>;
17321 +               #address-cells = <0>;
17322 +               #size-cells = <0>;
17323 +               #interrupt-cells = <2>;
17324 +               interrupts = <1c 4 1d 4>; /* cascade */
17325 +               interrupt-parent = <&UIC0>;
17326 +       };
17327 +
17328 +       SDR0: sdr {
17329 +               compatible = "ibm,sdr-440grx", "ibm,sdr-440ep";
17330 +               dcr-reg = <00e 002>;
17331 +       };
17332 +
17333 +       CPR0: cpr {
17334 +               compatible = "ibm,cpr-440grx", "ibm,cpr-440ep";
17335 +               dcr-reg = <00c 002>;
17336 +       };
17337 +
17338 +       plb {
17339 +               compatible = "ibm,plb-440grx", "ibm,plb4";
17340 +               #address-cells = <2>;
17341 +               #size-cells = <1>;
17342 +               ranges;
17343 +               clock-frequency = <0>; /* Filled in by zImage */
17344 +
17345 +               SDRAM0: sdram {
17346 +                       compatible = "ibm,sdram-440grx", "ibm,sdram-44x-ddr2denali";
17347 +                       dcr-reg = <010 2>;
17348 +               };
17349 +
17350 +               DMA0: dma {
17351 +                       compatible = "ibm,dma-440grx", "ibm,dma-4xx";
17352 +                       dcr-reg = <100 027>;
17353 +               };
17354 +
17355 +               MAL0: mcmal {
17356 +                       compatible = "ibm,mcmal-440grx", "ibm,mcmal2";
17357 +                       dcr-reg = <180 62>;
17358 +                       num-tx-chans = <2>;
17359 +                       num-rx-chans = <2>;
17360 +                       interrupt-parent = <&MAL0>;
17361 +                       interrupts = <0 1 2 3 4>;
17362 +                       #interrupt-cells = <1>;
17363 +                       #address-cells = <0>;
17364 +                       #size-cells = <0>;
17365 +                       interrupt-map = </*TXEOB*/ 0 &UIC0 a 4
17366 +                                       /*RXEOB*/ 1 &UIC0 b 4
17367 +                                       /*SERR*/  2 &UIC1 0 4
17368 +                                       /*TXDE*/  3 &UIC1 1 4
17369 +                                       /*RXDE*/  4 &UIC1 2 4>;
17370 +                       interrupt-map-mask = <ffffffff>;
17371 +               };
17372 +
17373 +               POB0: opb {
17374 +                       compatible = "ibm,opb-440grx", "ibm,opb";
17375 +                       #address-cells = <1>;
17376 +                       #size-cells = <1>;
17377 +                       ranges = <00000000 1 00000000 80000000
17378 +                                 80000000 1 80000000 80000000>;
17379 +                       interrupt-parent = <&UIC1>;
17380 +                       interrupts = <7 4>;
17381 +                       clock-frequency = <0>; /* Filled in by zImage */
17382 +
17383 +                       EBC0: ebc {
17384 +                               compatible = "ibm,ebc-440grx", "ibm,ebc";
17385 +                               dcr-reg = <012 2>;
17386 +                               #address-cells = <2>;
17387 +                               #size-cells = <1>;
17388 +                               clock-frequency = <0>; /* Filled in by zImage */
17389 +                               interrupts = <5 1>;
17390 +                               interrupt-parent = <&UIC1>;
17391 +
17392 +                               nor_flash@0,0 {
17393 +                                       compatible = "amd,s29gl256n", "cfi-flash";
17394 +                                       bank-width = <2>;
17395 +                                       reg = <0 000000 4000000>;
17396 +                                       #address-cells = <1>;
17397 +                                       #size-cells = <1>;
17398 +                                       partition@0 {
17399 +                                               label = "Kernel";
17400 +                                               reg = <0 180000>;
17401 +                                       };
17402 +                                       partition@180000 {
17403 +                                               label = "ramdisk";
17404 +                                               reg = <180000 200000>;
17405 +                                       };
17406 +                                       partition@380000 {
17407 +                                               label = "file system";
17408 +                                               reg = <380000 3aa0000>;
17409 +                                       };
17410 +                                       partition@3e20000 {
17411 +                                               label = "kozio";
17412 +                                               reg = <3e20000 140000>;
17413 +                                       };
17414 +                                       partition@3f60000 {
17415 +                                               label = "env";
17416 +                                               reg = <3f60000 40000>;
17417 +                                       };
17418 +                                       partition@3fa0000 {
17419 +                                               label = "u-boot";
17420 +                                               reg = <3fa0000 60000>;
17421 +                                       };
17422 +                               };
17423 +
17424 +                       };
17425 +
17426 +                       UART0: serial@ef600300 {
17427 +                               device_type = "serial";
17428 +                               compatible = "ns16550";
17429 +                               reg = <ef600300 8>;
17430 +                               virtual-reg = <ef600300>;
17431 +                               clock-frequency = <0>; /* Filled in by zImage */
17432 +                               current-speed = <1c200>;
17433 +                               interrupt-parent = <&UIC0>;
17434 +                               interrupts = <0 4>;
17435 +                       };
17436 +
17437 +                       UART1: serial@ef600400 {
17438 +                               device_type = "serial";
17439 +                               compatible = "ns16550";
17440 +                               reg = <ef600400 8>;
17441 +                               virtual-reg = <ef600400>;
17442 +                               clock-frequency = <0>;
17443 +                               current-speed = <0>;
17444 +                               interrupt-parent = <&UIC0>;
17445 +                               interrupts = <1 4>;
17446 +                       };
17447 +
17448 +                       UART2: serial@ef600500 {
17449 +                               device_type = "serial";
17450 +                               compatible = "ns16550";
17451 +                               reg = <ef600500 8>;
17452 +                               virtual-reg = <ef600500>;
17453 +                               clock-frequency = <0>;
17454 +                               current-speed = <0>;
17455 +                               interrupt-parent = <&UIC1>;
17456 +                               interrupts = <3 4>;
17457 +                       };
17458 +
17459 +                       UART3: serial@ef600600 {
17460 +                               device_type = "serial";
17461 +                               compatible = "ns16550";
17462 +                               reg = <ef600600 8>;
17463 +                               virtual-reg = <ef600600>;
17464 +                               clock-frequency = <0>;
17465 +                               current-speed = <0>;
17466 +                               interrupt-parent = <&UIC1>;
17467 +                               interrupts = <4 4>;
17468 +                       };
17469 +
17470 +                       IIC0: i2c@ef600700 {
17471 +                               device_type = "i2c";
17472 +                               compatible = "ibm,iic-440grx", "ibm,iic";
17473 +                               reg = <ef600700 14>;
17474 +                               interrupt-parent = <&UIC0>;
17475 +                               interrupts = <2 4>;
17476 +                       };
17477 +
17478 +                       IIC1: i2c@ef600800 {
17479 +                               device_type = "i2c";
17480 +                               compatible = "ibm,iic-440grx", "ibm,iic";
17481 +                               reg = <ef600800 14>;
17482 +                               interrupt-parent = <&UIC0>;
17483 +                               interrupts = <7 4>;
17484 +                       };
17485 +
17486 +                       ZMII0: emac-zmii@ef600d00 {
17487 +                               device_type = "zmii-interface";
17488 +                               compatible = "ibm,zmii-440grx", "ibm,zmii";
17489 +                               reg = <ef600d00 c>;
17490 +                       };
17491 +
17492 +                       RGMII0: emac-rgmii@ef601000 {
17493 +                               device_type = "rgmii-interface";
17494 +                               compatible = "ibm,rgmii-440grx", "ibm,rgmii";
17495 +                               reg = <ef601000 8>;
17496 +                               has-mdio;
17497 +                       };
17498 +
17499 +                       EMAC0: ethernet@ef600e00 {
17500 +                               linux,network-index = <0>;
17501 +                               device_type = "network";
17502 +                               compatible = "ibm,emac-440grx", "ibm,emac-440epx", "ibm,emac4";
17503 +                               interrupt-parent = <&EMAC0>;
17504 +                               interrupts = <0 1>;
17505 +                               #interrupt-cells = <1>;
17506 +                               #address-cells = <0>;
17507 +                               #size-cells = <0>;
17508 +                               interrupt-map = </*Status*/ 0 &UIC0 18 4
17509 +                                               /*Wake*/  1 &UIC1 1d 4>;
17510 +                               reg = <ef600e00 70>;
17511 +                               local-mac-address = [000000000000];
17512 +                               mal-device = <&MAL0>;
17513 +                               mal-tx-channel = <0>;
17514 +                               mal-rx-channel = <0>;
17515 +                               cell-index = <0>;
17516 +                               max-frame-size = <5dc>;
17517 +                               rx-fifo-size = <1000>;
17518 +                               tx-fifo-size = <800>;
17519 +                               phy-mode = "rgmii";
17520 +                               phy-map = <00000000>;
17521 +                               zmii-device = <&ZMII0>;
17522 +                               zmii-channel = <0>;
17523 +                               rgmii-device = <&RGMII0>;
17524 +                               rgmii-channel = <0>;
17525 +                               has-inverted-stacr-oc;
17526 +                               has-new-stacr-staopc;
17527 +                       };
17528 +
17529 +                       EMAC1: ethernet@ef600f00 {
17530 +                               linux,network-index = <1>;
17531 +                               device_type = "network";
17532 +                               compatible = "ibm,emac-440grx", "ibm,emac-440epx", "ibm,emac4";
17533 +                               interrupt-parent = <&EMAC1>;
17534 +                               interrupts = <0 1>;
17535 +                               #interrupt-cells = <1>;
17536 +                               #address-cells = <0>;
17537 +                               #size-cells = <0>;
17538 +                               interrupt-map = </*Status*/ 0 &UIC0 19 4
17539 +                                               /*Wake*/  1 &UIC1 1f 4>;
17540 +                               reg = <ef600f00 70>;
17541 +                               local-mac-address = [000000000000];
17542 +                               mal-device = <&MAL0>;
17543 +                               mal-tx-channel = <1>;
17544 +                               mal-rx-channel = <1>;
17545 +                               cell-index = <1>;
17546 +                               max-frame-size = <5dc>;
17547 +                               rx-fifo-size = <1000>;
17548 +                               tx-fifo-size = <800>;
17549 +                               phy-mode = "rgmii";
17550 +                               phy-map = <00000000>;
17551 +                               zmii-device = <&ZMII0>;
17552 +                               zmii-channel = <1>;
17553 +                               rgmii-device = <&RGMII0>;
17554 +                               rgmii-channel = <1>;
17555 +                               has-inverted-stacr-oc;
17556 +                               has-new-stacr-staopc;
17557 +                       };
17558 +               };
17559 +
17560 +               PCI0: pci@1ec000000 {
17561 +                       device_type = "pci";
17562 +                       #interrupt-cells = <1>;
17563 +                       #size-cells = <2>;
17564 +                       #address-cells = <3>;
17565 +                       compatible = "ibm,plb440grx-pci", "ibm,plb-pci";
17566 +                       primary;
17567 +                       reg = <1 eec00000 8     /* Config space access */
17568 +                              1 eed00000 4     /* IACK */
17569 +                              1 eed00000 4     /* Special cycle */
17570 +                              1 ef400000 40>;  /* Internal registers */
17571 +
17572 +                       /* Outbound ranges, one memory and one IO,
17573 +                        * later cannot be changed. Chip supports a second
17574 +                        * IO range but we don't use it for now
17575 +                        */
17576 +                       ranges = <02000000 0 80000000 1 80000000 0 10000000
17577 +                               01000000 0 00000000 1 e8000000 0 00100000>;
17578 +
17579 +                       /* Inbound 2GB range starting at 0 */
17580 +                       dma-ranges = <42000000 0 0 0 0 0 80000000>;
17581 +
17582 +                       /* All PCI interrupts are routed to IRQ 67 */
17583 +                       interrupt-map-mask = <0000 0 0 0>;
17584 +                       interrupt-map = < 0000 0 0 0 &UIC2 3 8 >;
17585 +               };
17586 +       };
17587 +
17588 +       chosen {
17589 +               linux,stdout-path = "/plb/opb/serial@ef600300";
17590 +               bootargs = "console=ttyS0,115200";
17591 +       };
17592 +};
17593 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/sequoia.dts powerpc.git/arch/powerpc/boot/dts/sequoia.dts
17594 --- linux-2.6.24/arch/powerpc/boot/dts/sequoia.dts      2008-01-24 23:58:37.000000000 +0100
17595 +++ powerpc.git/arch/powerpc/boot/dts/sequoia.dts       2008-01-28 20:25:49.000000000 +0100
17596 @@ -17,14 +17,24 @@
17597         #size-cells = <1>;
17598         model = "amcc,sequoia";
17599         compatible = "amcc,sequoia";
17600 -       dcr-parent = <&/cpus/PowerPC,440EPx@0>;
17601 +       dcr-parent = <&/cpus/cpu@0>;
17602 +
17603 +       aliases {
17604 +               ethernet0 = &EMAC0;
17605 +               ethernet1 = &EMAC1;
17606 +               serial0 = &UART0;
17607 +               serial1 = &UART1;
17608 +               serial2 = &UART2;
17609 +               serial3 = &UART3;
17610 +       };
17611  
17612         cpus {
17613                 #address-cells = <1>;
17614                 #size-cells = <0>;
17615  
17616 -               PowerPC,440EPx@0 {
17617 +               cpu@0 {
17618                         device_type = "cpu";
17619 +                       model = "PowerPC,440EPx";
17620                         reg = <0>;
17621                         clock-frequency = <0>; /* Filled in by zImage */
17622                         timebase-frequency = <0>; /* Filled in by zImage */
17623 @@ -94,7 +104,6 @@
17624                 clock-frequency = <0>; /* Filled in by zImage */
17625  
17626                 SDRAM0: sdram {
17627 -                       device_type = "memory-controller";
17628                         compatible = "ibm,sdram-440epx", "ibm,sdram-44x-ddr2denali";
17629                         dcr-reg = <010 2>;
17630                 };
17631 @@ -122,6 +131,13 @@
17632                         interrupt-map-mask = <ffffffff>;
17633                 };
17634  
17635 +               USB1: usb@e0000400 {
17636 +                       compatible = "ohci-be";
17637 +                       reg = <0 e0000400 60>;
17638 +                       interrupt-parent = <&UIC0>;
17639 +                       interrupts = <15 8>;
17640 +               };
17641 +
17642                 POB0: opb {
17643                         compatible = "ibm,opb-440epx", "ibm,opb";
17644                         #address-cells = <1>;
17645 @@ -308,6 +324,33 @@
17646                                 has-new-stacr-staopc;
17647                         };
17648                 };
17649 +
17650 +               PCI0: pci@1ec000000 {
17651 +                       device_type = "pci";
17652 +                       #interrupt-cells = <1>;
17653 +                       #size-cells = <2>;
17654 +                       #address-cells = <3>;
17655 +                       compatible = "ibm,plb440epx-pci", "ibm,plb-pci";
17656 +                       primary;
17657 +                       reg = <1 eec00000 8     /* Config space access */
17658 +                              1 eed00000 4     /* IACK */
17659 +                              1 eed00000 4     /* Special cycle */
17660 +                              1 ef400000 40>;  /* Internal registers */
17661 +
17662 +                       /* Outbound ranges, one memory and one IO,
17663 +                        * later cannot be changed. Chip supports a second
17664 +                        * IO range but we don't use it for now
17665 +                        */
17666 +                       ranges = <02000000 0 80000000 1 80000000 0 10000000
17667 +                               01000000 0 00000000 1 e8000000 0 00100000>;
17668 +
17669 +                       /* Inbound 2GB range starting at 0 */
17670 +                       dma-ranges = <42000000 0 0 0 0 0 80000000>;
17671 +
17672 +                       /* All PCI interrupts are routed to IRQ 67 */
17673 +                       interrupt-map-mask = <0000 0 0 0>;
17674 +                       interrupt-map = < 0000 0 0 0 &UIC2 3 8 >;
17675 +               };
17676         };
17677  
17678         chosen {
17679 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/storcenter.dts powerpc.git/arch/powerpc/boot/dts/storcenter.dts
17680 --- linux-2.6.24/arch/powerpc/boot/dts/storcenter.dts   1970-01-01 01:00:00.000000000 +0100
17681 +++ powerpc.git/arch/powerpc/boot/dts/storcenter.dts    2008-01-28 20:25:49.000000000 +0100
17682 @@ -0,0 +1,138 @@
17683 +/*
17684 + * Device Tree Source for IOMEGA StorCenter
17685 + *
17686 + * Copyright 2007 Oyvind Repvik
17687 + * Copyright 2007 Jon Loeliger
17688 + *
17689 + * Based on the Kurobox DTS by G. Liakhovetski <g.liakhovetski@gmx.de>
17690 + *
17691 + * This file is licensed under the terms of the GNU General Public
17692 + * License version 2.  This program is licensed "as is" without any
17693 + * warranty of any kind, whether express or implied.
17694 + */
17695 +
17696 +/ {
17697 +       model = "StorCenter";
17698 +       compatible = "storcenter";
17699 +       #address-cells = <1>;
17700 +       #size-cells = <1>;
17701 +
17702 +       aliases {
17703 +               serial0 = &serial0;
17704 +               serial1 = &serial1;
17705 +               pci0 = &pci0;
17706 +       };
17707 +
17708 +       cpus {
17709 +               #address-cells = <1>;
17710 +               #size-cells = <0>;
17711 +
17712 +               PowerPC,8241@0 {
17713 +                       device_type = "cpu";
17714 +                       reg = <0>;
17715 +                       clock-frequency = <d# 200000000>;       /* Hz */
17716 +                       timebase-frequency = <d# 25000000>;     /* Hz */
17717 +                       bus-frequency = <0>;    /* from bootwrapper */
17718 +                       i-cache-line-size = <d# 32>;    /* bytes */
17719 +                       d-cache-line-size = <d# 32>;    /* bytes */
17720 +                       i-cache-size = <4000>;
17721 +                       d-cache-size = <4000>;
17722 +               };
17723 +       };
17724 +
17725 +       memory {
17726 +               device_type = "memory";
17727 +               reg = <00000000 04000000>;      /* 64MB @ 0x0 */
17728 +       };
17729 +
17730 +       soc@fc000000 {
17731 +               #address-cells = <1>;
17732 +               #size-cells = <1>;
17733 +               device_type = "soc";
17734 +               compatible = "fsl,mpc8241", "mpc10x";
17735 +               store-gathering = <0>; /* 0 == off, !0 == on */
17736 +               ranges = <0 fc000000 100000>;
17737 +               reg = <fc000000 100000>;        /* EUMB */
17738 +               bus-frequency = <0>;            /* fixed by loader */
17739 +
17740 +               i2c@3000 {
17741 +                       #address-cells = <1>;
17742 +                       #size-cells = <0>;
17743 +                       compatible = "fsl-i2c";
17744 +                       reg = <3000 100>;
17745 +                       interrupts = <5 2>;
17746 +                       interrupt-parent = <&mpic>;
17747 +
17748 +                       rtc@68 {
17749 +                               compatible = "dallas,ds1337";
17750 +                               reg = <68>;
17751 +                       };
17752 +               };
17753 +
17754 +               serial0: serial@4500 {
17755 +                       cell-index = <0>;
17756 +                       device_type = "serial";
17757 +                       compatible = "ns16550";
17758 +                       reg = <4500 20>;
17759 +                       clock-frequency = <d# 97553800>; /* Hz */
17760 +                       current-speed = <d# 115200>;
17761 +                       interrupts = <9 2>;
17762 +                       interrupt-parent = <&mpic>;
17763 +               };
17764 +
17765 +               serial1: serial@4600 {
17766 +                       cell-index = <1>;
17767 +                       device_type = "serial";
17768 +                       compatible = "ns16550";
17769 +                       reg = <4600 20>;
17770 +                       clock-frequency = <d# 97553800>; /* Hz */
17771 +                       current-speed = <d# 9600>;
17772 +                       interrupts = <a 2>;
17773 +                       interrupt-parent = <&mpic>;
17774 +               };
17775 +
17776 +               mpic: interrupt-controller@40000 {
17777 +                       #interrupt-cells = <2>;
17778 +                       device_type = "open-pic";
17779 +                       compatible = "chrp,open-pic";
17780 +                       interrupt-controller;
17781 +                       reg = <40000 40000>;
17782 +               };
17783 +
17784 +       };
17785 +
17786 +       pci0: pci@fe800000 {
17787 +               #address-cells = <3>;
17788 +               #size-cells = <2>;
17789 +               #interrupt-cells = <1>;
17790 +               device_type = "pci";
17791 +               compatible = "mpc10x-pci";
17792 +               reg = <fe800000 1000>;
17793 +               ranges = <01000000 0        0 fe000000 0 00c00000
17794 +                         02000000 0 80000000 80000000 0 70000000>;
17795 +               bus-range = <0 ff>;
17796 +               clock-frequency = <d# 97553800>; /* Hz */
17797 +               interrupt-parent = <&mpic>;
17798 +               interrupt-map-mask = <f800 0 0 7>;
17799 +               interrupt-map = <
17800 +                       /* IDSEL 13 - IDE */
17801 +                       6800 0 0 1 &mpic 0 1
17802 +                       6800 0 0 2 &mpic 0 1
17803 +                       6800 0 0 3 &mpic 0 1
17804 +                       /* IDSEL 14 - USB */
17805 +                       7000 0 0 1 &mpic 0 1
17806 +                       7000 0 0 2 &mpic 0 1
17807 +                       7000 0 0 3 &mpic 0 1
17808 +                       7000 0 0 4 &mpic 0 1
17809 +                       /* IDSEL 15 - ETH */
17810 +                       7800 0 0 1 &mpic 0 1
17811 +                       7800 0 0 2 &mpic 0 1
17812 +                       7800 0 0 3 &mpic 0 1
17813 +                       7800 0 0 4 &mpic 0 1
17814 +               >;
17815 +       };
17816 +
17817 +       chosen {
17818 +               linux,stdout-path = "/soc/serial@4500";
17819 +       };
17820 +};
17821 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/taishan.dts powerpc.git/arch/powerpc/boot/dts/taishan.dts
17822 --- linux-2.6.24/arch/powerpc/boot/dts/taishan.dts      1970-01-01 01:00:00.000000000 +0100
17823 +++ powerpc.git/arch/powerpc/boot/dts/taishan.dts       2008-01-28 20:25:49.000000000 +0100
17824 @@ -0,0 +1,383 @@
17825 +/*
17826 + * Device Tree Source for IBM/AMCC Taishan
17827 + *
17828 + * Copyright 2007 IBM Corp.
17829 + * Hugh Blemings <hugh@au.ibm.com> based off code by
17830 + * Josh Boyer <jwboyer@linux.vnet.ibm.com>, David Gibson <dwg@au1.ibm.com>
17831 + *
17832 + * This file is licensed under the terms of the GNU General Public
17833 + * License version 2.  This program is licensed "as is" without
17834 + * any warranty of any kind, whether express or implied.
17835 + */
17836 +
17837 +/ {
17838 +       #address-cells = <2>;
17839 +       #size-cells = <1>;
17840 +       model = "amcc,taishan";
17841 +       compatible = "amcc,taishan";
17842 +       dcr-parent = <&/cpus/cpu@0>;
17843 +
17844 +       aliases {
17845 +               ethernet0 = &EMAC2;
17846 +               ethernet1 = &EMAC3;
17847 +               serial0 = &UART0;
17848 +               serial1 = &UART1;
17849 +       };
17850 +
17851 +       cpus {
17852 +               #address-cells = <1>;
17853 +               #size-cells = <0>;
17854 +
17855 +               cpu@0 {
17856 +                       device_type = "cpu";
17857 +                       model = "PowerPC,440GX";
17858 +                       reg = <0>;
17859 +                       clock-frequency = <2FAF0800>; // 800MHz
17860 +                       timebase-frequency = <0>; // Filled in by zImage
17861 +                       i-cache-line-size = <32>;
17862 +                       d-cache-line-size = <32>;
17863 +                       i-cache-size = <8000>; /* 32 kB */
17864 +                       d-cache-size = <8000>; /* 32 kB */
17865 +                       dcr-controller;
17866 +                       dcr-access-method = "native";
17867 +               };
17868 +       };
17869 +
17870 +       memory {
17871 +               device_type = "memory";
17872 +               reg = <0 0 0>; // Filled in by zImage
17873 +       };
17874 +
17875 +
17876 +       UICB0: interrupt-controller-base {
17877 +               compatible = "ibm,uic-440gx", "ibm,uic";
17878 +               interrupt-controller;
17879 +               cell-index = <3>;
17880 +               dcr-reg = <200 009>;
17881 +               #address-cells = <0>;
17882 +               #size-cells = <0>;
17883 +               #interrupt-cells = <2>;
17884 +       };
17885 +
17886 +
17887 +       UIC0: interrupt-controller0 {
17888 +               compatible = "ibm,uic-440gx", "ibm,uic";
17889 +               interrupt-controller;
17890 +               cell-index = <0>;
17891 +               dcr-reg = <0c0 009>;
17892 +               #address-cells = <0>;
17893 +               #size-cells = <0>;
17894 +               #interrupt-cells = <2>;
17895 +               interrupts = <01 4 00 4>; /* cascade - first non-critical */
17896 +               interrupt-parent = <&UICB0>;
17897 +
17898 +       };
17899 +
17900 +       UIC1: interrupt-controller1 {
17901 +               compatible = "ibm,uic-440gx", "ibm,uic";
17902 +               interrupt-controller;
17903 +               cell-index = <1>;
17904 +               dcr-reg = <0d0 009>;
17905 +               #address-cells = <0>;
17906 +               #size-cells = <0>;
17907 +               #interrupt-cells = <2>;
17908 +               interrupts = <03 4 02 4>; /* cascade */
17909 +               interrupt-parent = <&UICB0>;
17910 +       };
17911 +
17912 +       UIC2: interrupt-controller2 {
17913 +               compatible = "ibm,uic-440gx", "ibm,uic";
17914 +               interrupt-controller;
17915 +               cell-index = <2>; /* was 1 */
17916 +               dcr-reg = <210 009>;
17917 +               #address-cells = <0>;
17918 +               #size-cells = <0>;
17919 +               #interrupt-cells = <2>;
17920 +               interrupts = <05 4 04 4>; /* cascade */
17921 +               interrupt-parent = <&UICB0>;
17922 +       };
17923 +
17924 +
17925 +       CPC0: cpc {
17926 +               compatible = "ibm,cpc-440gp";
17927 +               dcr-reg = <0b0 003 0e0 010>;
17928 +               // FIXME: anything else?
17929 +       };
17930 +
17931 +       plb {
17932 +               compatible = "ibm,plb-440gx", "ibm,plb4";
17933 +               #address-cells = <2>;
17934 +               #size-cells = <1>;
17935 +               ranges;
17936 +               clock-frequency = <9896800>; // 160MHz
17937 +
17938 +               SDRAM0: memory-controller {
17939 +                       compatible = "ibm,sdram-440gp";
17940 +                       dcr-reg = <010 2>;
17941 +                       // FIXME: anything else?
17942 +               };
17943 +
17944 +               SRAM0: sram {
17945 +                       compatible = "ibm,sram-440gp";
17946 +                       dcr-reg = <020 8 00a 1>;
17947 +               };
17948 +
17949 +               DMA0: dma {
17950 +                       // FIXME: ???
17951 +                       compatible = "ibm,dma-440gp";
17952 +                       dcr-reg = <100 027>;
17953 +               };
17954 +
17955 +               MAL0: mcmal {
17956 +                       compatible = "ibm,mcmal-440gx", "ibm,mcmal2";
17957 +                       dcr-reg = <180 62>;
17958 +                       num-tx-chans = <4>;
17959 +                       num-rx-chans = <4>;
17960 +                       interrupt-parent = <&MAL0>;
17961 +                       interrupts = <0 1 2 3 4>;
17962 +                       #interrupt-cells = <1>;
17963 +                       #address-cells = <0>;
17964 +                       #size-cells = <0>;
17965 +                       interrupt-map = </*TXEOB*/ 0 &UIC0 a 4
17966 +                                        /*RXEOB*/ 1 &UIC0 b 4
17967 +                                        /*SERR*/  2 &UIC1 0 4
17968 +                                        /*TXDE*/  3 &UIC1 1 4
17969 +                                        /*RXDE*/  4 &UIC1 2 4>;
17970 +                       interrupt-map-mask = <ffffffff>;
17971 +               };
17972 +
17973 +               POB0: opb {
17974 +                       compatible = "ibm,opb-440gx", "ibm,opb";
17975 +                       #address-cells = <1>;
17976 +                       #size-cells = <1>;
17977 +                       /* Wish there was a nicer way of specifying a full 32-bit
17978 +                          range */
17979 +                       ranges = <00000000 1 00000000 80000000
17980 +                                 80000000 1 80000000 80000000>;
17981 +                       dcr-reg = <090 00b>;
17982 +                       interrupt-parent = <&UIC1>;
17983 +                       interrupts = <7 4>;
17984 +                       clock-frequency = <4C4B400>; // 80MHz
17985 +
17986 +
17987 +                       EBC0: ebc {
17988 +                               compatible = "ibm,ebc-440gx", "ibm,ebc";
17989 +                               dcr-reg = <012 2>;
17990 +                               #address-cells = <2>;
17991 +                               #size-cells = <1>;
17992 +                               clock-frequency = <4C4B400>; // 80MHz
17993 +
17994 +                               /* ranges property is supplied by zImage
17995 +                                * based on firmware's configuration of the
17996 +                                * EBC bridge */
17997 +
17998 +                               interrupts = <5 4>;
17999 +                               interrupt-parent = <&UIC1>;
18000 +
18001 +                               /* TODO: Add other EBC devices */
18002 +                       };
18003 +
18004 +
18005 +
18006 +                       UART0: serial@40000200 {
18007 +                               device_type = "serial";
18008 +                               compatible = "ns16550";
18009 +                               reg = <40000200 8>;
18010 +                               virtual-reg = <e0000200>;
18011 +                               clock-frequency = <A8C000>;
18012 +                               current-speed = <1C200>; /* 115200 */
18013 +                               interrupt-parent = <&UIC0>;
18014 +                               interrupts = <0 4>;
18015 +                       };
18016 +
18017 +                       UART1: serial@40000300 {
18018 +                               device_type = "serial";
18019 +                               compatible = "ns16550";
18020 +                               reg = <40000300 8>;
18021 +                               virtual-reg = <e0000300>;
18022 +                               clock-frequency = <A8C000>;
18023 +                               current-speed = <1C200>; /* 115200 */
18024 +                               interrupt-parent = <&UIC0>;
18025 +                               interrupts = <1 4>;
18026 +                       };
18027 +
18028 +                       IIC0: i2c@40000400 {
18029 +                               /* FIXME */
18030 +                               device_type = "i2c";
18031 +                               compatible = "ibm,iic-440gp", "ibm,iic";
18032 +                               reg = <40000400 14>;
18033 +                               interrupt-parent = <&UIC0>;
18034 +                               interrupts = <2 4>;
18035 +                       };
18036 +                       IIC1: i2c@40000500 {
18037 +                               /* FIXME */
18038 +                               device_type = "i2c";
18039 +                               compatible = "ibm,iic-440gp", "ibm,iic";
18040 +                               reg = <40000500 14>;
18041 +                               interrupt-parent = <&UIC0>;
18042 +                               interrupts = <3 4>;
18043 +                       };
18044 +
18045 +                       GPIO0: gpio@40000700 {
18046 +                               /* FIXME */
18047 +                               compatible = "ibm,gpio-440gp";
18048 +                               reg = <40000700 20>;
18049 +                       };
18050 +
18051 +                       ZMII0: emac-zmii@40000780 {
18052 +                               device_type = "zgmii-interface";
18053 +                               compatible = "ibm,zmii-440gx", "ibm,zmii";
18054 +                               reg = <40000780 c>;
18055 +                       };
18056 +
18057 +                       RGMII0: emac-rgmii@40000790 {
18058 +                               device_type = "rgmii-interface";
18059 +                               compatible = "ibm,rgmii";
18060 +                               reg = <40000790 8>;
18061 +                       };
18062 +
18063 +
18064 +                       EMAC0: ethernet@40000800 {
18065 +                               unused = <1>;
18066 +                               linux,network-index = <2>;
18067 +                               device_type = "network";
18068 +                               compatible = "ibm,emac-440gx", "ibm,emac4";
18069 +                               interrupt-parent = <&UIC1>;
18070 +                               interrupts = <1c 4 1d 4>;
18071 +                               reg = <40000800 70>;
18072 +                               local-mac-address = [000000000000]; // Filled in by zImage
18073 +                               mal-device = <&MAL0>;
18074 +                               mal-tx-channel = <0>;
18075 +                               mal-rx-channel = <0>;
18076 +                               cell-index = <0>;
18077 +                               max-frame-size = <5dc>;
18078 +                               rx-fifo-size = <1000>;
18079 +                               tx-fifo-size = <800>;
18080 +                               phy-mode = "rmii";
18081 +                               phy-map = <00000001>;
18082 +                               zmii-device = <&ZMII0>;
18083 +                               zmii-channel = <0>;
18084 +                       };
18085 +                       EMAC1: ethernet@40000900 {
18086 +                               unused = <1>;
18087 +                               linux,network-index = <3>;
18088 +                               device_type = "network";
18089 +                               compatible = "ibm,emac-440gx", "ibm,emac4";
18090 +                               interrupt-parent = <&UIC1>;
18091 +                               interrupts = <1e 4 1f 4>;
18092 +                               reg = <40000900 70>;
18093 +                               local-mac-address = [000000000000]; // Filled in by zImage
18094 +                               mal-device = <&MAL0>;
18095 +                               mal-tx-channel = <1>;
18096 +                               mal-rx-channel = <1>;
18097 +                               cell-index = <1>;
18098 +                               max-frame-size = <5dc>;
18099 +                               rx-fifo-size = <1000>;
18100 +                               tx-fifo-size = <800>;
18101 +                               phy-mode = "rmii";
18102 +                               phy-map = <00000001>;
18103 +                               zmii-device = <&ZMII0>;
18104 +                               zmii-channel = <1>;
18105 +                       };
18106 +
18107 +                       EMAC2: ethernet@40000c00 {
18108 +                               linux,network-index = <0>;
18109 +                               device_type = "network";
18110 +                               compatible = "ibm,emac-440gx", "ibm,emac4";
18111 +                               interrupt-parent = <&UIC2>;
18112 +                               interrupts = <0 4 1 4>;
18113 +                               reg = <40000c00 70>;
18114 +                               local-mac-address = [000000000000]; // Filled in by zImage
18115 +                               mal-device = <&MAL0>;
18116 +                               mal-tx-channel = <2>;
18117 +                               mal-rx-channel = <2>;
18118 +                               cell-index = <2>;
18119 +                               max-frame-size = <5dc>;
18120 +                               rx-fifo-size = <1000>;
18121 +                               tx-fifo-size = <800>;
18122 +                               phy-mode = "rgmii";
18123 +                               phy-map = <00000001>;
18124 +                               rgmii-device = <&RGMII0>;
18125 +                               rgmii-channel = <0>;
18126 +                               zmii-device = <&ZMII0>;
18127 +                               zmii-channel = <2>;
18128 +                       };
18129 +
18130 +                       EMAC3: ethernet@40000e00 {
18131 +                               linux,network-index = <1>;
18132 +                               device_type = "network";
18133 +                               compatible = "ibm,emac-440gx", "ibm,emac4";
18134 +                               interrupt-parent = <&UIC2>;
18135 +                               interrupts = <2 4 3 4>;
18136 +                               reg = <40000e00 70>;
18137 +                               local-mac-address = [000000000000]; // Filled in by zImage
18138 +                               mal-device = <&MAL0>;
18139 +                               mal-tx-channel = <3>;
18140 +                               mal-rx-channel = <3>;
18141 +                               cell-index = <3>;
18142 +                               max-frame-size = <5dc>;
18143 +                               rx-fifo-size = <1000>;
18144 +                               tx-fifo-size = <800>;
18145 +                               phy-mode = "rgmii";
18146 +                               phy-map = <00000003>;
18147 +                               rgmii-device = <&RGMII0>;
18148 +                               rgmii-channel = <1>;
18149 +                               zmii-device = <&ZMII0>;
18150 +                               zmii-channel = <3>;
18151 +                       };
18152 +
18153 +
18154 +                       GPT0: gpt@40000a00 {
18155 +                               /* FIXME */
18156 +                               reg = <40000a00 d4>;
18157 +                               interrupt-parent = <&UIC0>;
18158 +                               interrupts = <12 4 13 4 14 4 15 4 16 4>;
18159 +                       };
18160 +
18161 +               };
18162 +
18163 +               PCIX0: pci@20ec00000 {
18164 +                       device_type = "pci";
18165 +                       #interrupt-cells = <1>;
18166 +                       #size-cells = <2>;
18167 +                       #address-cells = <3>;
18168 +                       compatible = "ibm,plb440gp-pcix", "ibm,plb-pcix";
18169 +                       primary;
18170 +                       large-inbound-windows;
18171 +                       enable-msi-hole;
18172 +                       reg = <2 0ec00000   8   /* Config space access */
18173 +                              0 0 0            /* no IACK cycles */
18174 +                              2 0ed00000   4   /* Special cycles */
18175 +                              2 0ec80000 100   /* Internal registers */
18176 +                              2 0ec80100  fc>; /* Internal messaging registers */
18177 +
18178 +                       /* Outbound ranges, one memory and one IO,
18179 +                        * later cannot be changed
18180 +                        */
18181 +                       ranges = <02000000 0 80000000 00000003 80000000 0 80000000
18182 +                                 01000000 0 00000000 00000002 08000000 0 00010000>;
18183 +
18184 +                       /* Inbound 2GB range starting at 0 */
18185 +                       dma-ranges = <42000000 0 0 0 0 0 80000000>;
18186 +
18187 +                       interrupt-map-mask = <f800 0 0 7>;
18188 +                       interrupt-map = <
18189 +                               /* IDSEL 1 */
18190 +                               0800 0 0 1 &UIC0 17 8
18191 +                               0800 0 0 2 &UIC0 18 8
18192 +                               0800 0 0 3 &UIC0 19 8
18193 +                               0800 0 0 4 &UIC0 1a 8
18194 +
18195 +                               /* IDSEL 2 */
18196 +                               1000 0 0 1 &UIC0 18 8
18197 +                               1000 0 0 2 &UIC0 19 8
18198 +                               1000 0 0 3 &UIC0 1a 8
18199 +                               1000 0 0 4 &UIC0 17 8
18200 +                       >;
18201 +               };
18202 +       };
18203 +
18204 +       chosen {
18205 +               linux,stdout-path = "/plb/opb/serial@40000300";
18206 +       };
18207 +};
18208 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/tqm5200.dts powerpc.git/arch/powerpc/boot/dts/tqm5200.dts
18209 --- linux-2.6.24/arch/powerpc/boot/dts/tqm5200.dts      1970-01-01 01:00:00.000000000 +0100
18210 +++ powerpc.git/arch/powerpc/boot/dts/tqm5200.dts       2008-01-28 20:25:49.000000000 +0100
18211 @@ -0,0 +1,184 @@
18212 +/*
18213 + * TQM5200 board Device Tree Source
18214 + *
18215 + * Copyright (C) 2007 Semihalf
18216 + * Marian Balakowicz <m8@semihalf.com>
18217 + *
18218 + * This program is free software; you can redistribute  it and/or modify it
18219 + * under  the terms of  the GNU General  Public License as published by the
18220 + * Free Software Foundation;  either version 2 of the  License, or (at your
18221 + * option) any later version.
18222 + */
18223 +
18224 +/*
18225 + * WARNING: Do not depend on this tree layout remaining static just yet.
18226 + * The MPC5200 device tree conventions are still in flux
18227 + * Keep an eye on the linuxppc-dev mailing list for more details
18228 + */
18229 +
18230 +/ {
18231 +       model = "tqc,tqm5200";
18232 +       compatible = "tqc,tqm5200";
18233 +       #address-cells = <1>;
18234 +       #size-cells = <1>;
18235 +
18236 +       cpus {
18237 +               #address-cells = <1>;
18238 +               #size-cells = <0>;
18239 +
18240 +               PowerPC,5200@0 {
18241 +                       device_type = "cpu";
18242 +                       reg = <0>;
18243 +                       d-cache-line-size = <20>;
18244 +                       i-cache-line-size = <20>;
18245 +                       d-cache-size = <4000>;          // L1, 16K
18246 +                       i-cache-size = <4000>;          // L1, 16K
18247 +                       timebase-frequency = <0>;       // from bootloader
18248 +                       bus-frequency = <0>;            // from bootloader
18249 +                       clock-frequency = <0>;          // from bootloader
18250 +               };
18251 +       };
18252 +
18253 +       memory {
18254 +               device_type = "memory";
18255 +               reg = <00000000 04000000>;      // 64MB
18256 +       };
18257 +
18258 +       soc5200@f0000000 {
18259 +               model = "fsl,mpc5200";
18260 +               compatible = "fsl,mpc5200";
18261 +               revision = "";                  // from bootloader
18262 +               device_type = "soc";
18263 +               ranges = <0 f0000000 0000c000>;
18264 +               reg = <f0000000 00000100>;
18265 +               bus-frequency = <0>;            // from bootloader
18266 +               system-frequency = <0>;         // from bootloader
18267 +
18268 +               cdm@200 {
18269 +                       compatible = "mpc5200-cdm";
18270 +                       reg = <200 38>;
18271 +               };
18272 +
18273 +               mpc5200_pic: pic@500 {
18274 +                       // 5200 interrupts are encoded into two levels;
18275 +                       interrupt-controller;
18276 +                       #interrupt-cells = <3>;
18277 +                       compatible = "mpc5200-pic";
18278 +                       reg = <500 80>;
18279 +               };
18280 +
18281 +               gpt@600 {       // General Purpose Timer
18282 +                       compatible = "fsl,mpc5200-gpt";
18283 +                       reg = <600 10>;
18284 +                       interrupts = <1 9 0>;
18285 +                       interrupt-parent = <&mpc5200_pic>;
18286 +                       fsl,has-wdt;
18287 +               };
18288 +
18289 +               gpio@b00 {
18290 +                       compatible = "mpc5200-gpio";
18291 +                       reg = <b00 40>;
18292 +                       interrupts = <1 7 0>;
18293 +                       interrupt-parent = <&mpc5200_pic>;
18294 +               };
18295 +
18296 +               usb@1000 {
18297 +                       compatible = "mpc5200-ohci","ohci-be";
18298 +                       reg = <1000 ff>;
18299 +                       interrupts = <2 6 0>;
18300 +                       interrupt-parent = <&mpc5200_pic>;
18301 +               };
18302 +
18303 +               dma-controller@1200 {
18304 +                       compatible = "mpc5200-bestcomm";
18305 +                       reg = <1200 80>;
18306 +                       interrupts = <3 0 0  3 1 0  3 2 0  3 3 0
18307 +                                     3 4 0  3 5 0  3 6 0  3 7 0
18308 +                                     3 8 0  3 9 0  3 a 0  3 b 0
18309 +                                     3 c 0  3 d 0  3 e 0  3 f 0>;
18310 +                       interrupt-parent = <&mpc5200_pic>;
18311 +               };
18312 +
18313 +               xlb@1f00 {
18314 +                       compatible = "mpc5200-xlb";
18315 +                       reg = <1f00 100>;
18316 +               };
18317 +
18318 +               serial@2000 {           // PSC1
18319 +                       device_type = "serial";
18320 +                       compatible = "mpc5200-psc-uart";
18321 +                       port-number = <0>;  // Logical port assignment
18322 +                       reg = <2000 100>;
18323 +                       interrupts = <2 1 0>;
18324 +                       interrupt-parent = <&mpc5200_pic>;
18325 +               };
18326 +
18327 +               serial@2200 {           // PSC2
18328 +                       device_type = "serial";
18329 +                       compatible = "mpc5200-psc-uart";
18330 +                       port-number = <1>;  // Logical port assignment
18331 +                       reg = <2200 100>;
18332 +                       interrupts = <2 2 0>;
18333 +                       interrupt-parent = <&mpc5200_pic>;
18334 +               };
18335 +
18336 +               serial@2400 {           // PSC3
18337 +                       device_type = "serial";
18338 +                       compatible = "mpc5200-psc-uart";
18339 +                       port-number = <2>;  // Logical port assignment
18340 +                       reg = <2400 100>;
18341 +                       interrupts = <2 3 0>;
18342 +                       interrupt-parent = <&mpc5200_pic>;
18343 +               };
18344 +
18345 +               ethernet@3000 {
18346 +                       device_type = "network";
18347 +                       compatible = "mpc5200-fec";
18348 +                       reg = <3000 800>;
18349 +                       local-mac-address = [ 00 00 00 00 00 00 ]; /* Filled in by U-Boot */
18350 +                       interrupts = <2 5 0>;
18351 +                       interrupt-parent = <&mpc5200_pic>;
18352 +               };
18353 +
18354 +               ata@3a00 {
18355 +                       compatible = "mpc5200-ata";
18356 +                       reg = <3a00 100>;
18357 +                       interrupts = <2 7 0>;
18358 +                       interrupt-parent = <&mpc5200_pic>;
18359 +               };
18360 +
18361 +               i2c@3d40 {
18362 +                       compatible = "mpc5200-i2c","fsl-i2c";
18363 +                       reg = <3d40 40>;
18364 +                       interrupts = <2 10 0>;
18365 +                       interrupt-parent = <&mpc5200_pic>;
18366 +                       fsl5200-clocking;
18367 +               };
18368 +
18369 +               sram@8000 {
18370 +                       compatible = "mpc5200-sram";
18371 +                       reg = <8000 4000>;
18372 +               };
18373 +       };
18374 +
18375 +       pci@f0000d00 {
18376 +               #interrupt-cells = <1>;
18377 +               #size-cells = <2>;
18378 +               #address-cells = <3>;
18379 +               device_type = "pci";
18380 +               compatible = "fsl,mpc5200-pci";
18381 +               reg = <f0000d00 100>;
18382 +               interrupt-map-mask = <f800 0 0 7>;
18383 +               interrupt-map = <c000 0 0 1 &mpc5200_pic 0 0 3
18384 +                                c000 0 0 2 &mpc5200_pic 0 0 3
18385 +                                c000 0 0 3 &mpc5200_pic 0 0 3
18386 +                                c000 0 0 4 &mpc5200_pic 0 0 3>;
18387 +               clock-frequency = <0>; // From boot loader
18388 +               interrupts = <2 8 0 2 9 0 2 a 0>;
18389 +               interrupt-parent = <&mpc5200_pic>;
18390 +               bus-range = <0 0>;
18391 +               ranges = <42000000 0 80000000 80000000 0 10000000
18392 +                         02000000 0 90000000 90000000 0 10000000
18393 +                         01000000 0 00000000 a0000000 0 01000000>;
18394 +       };
18395 +};
18396 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/walnut.dts powerpc.git/arch/powerpc/boot/dts/walnut.dts
18397 --- linux-2.6.24/arch/powerpc/boot/dts/walnut.dts       2008-01-24 23:58:37.000000000 +0100
18398 +++ powerpc.git/arch/powerpc/boot/dts/walnut.dts        2008-01-28 20:25:49.000000000 +0100
18399 @@ -14,14 +14,21 @@
18400         #size-cells = <1>;
18401         model = "ibm,walnut";
18402         compatible = "ibm,walnut";
18403 -       dcr-parent = <&/cpus/PowerPC,405GP@0>;
18404 +       dcr-parent = <&/cpus/cpu@0>;
18405 +
18406 +       aliases {
18407 +               ethernet0 = &EMAC;
18408 +               serial0 = &UART0;
18409 +               serial1 = &UART1;
18410 +       };
18411  
18412         cpus {
18413                 #address-cells = <1>;
18414                 #size-cells = <0>;
18415  
18416 -               PowerPC,405GP@0 {
18417 +               cpu@0 {
18418                         device_type = "cpu";
18419 +                       model = "PowerPC,405GP";
18420                         reg = <0>;
18421                         clock-frequency = <bebc200>; /* Filled in by zImage */
18422                         timebase-frequency = <0>; /* Filled in by zImage */
18423 @@ -168,9 +175,10 @@
18424                                 };
18425                         };
18426  
18427 -                       ds1743@1,0 {
18428 +                       nvram@1,0 {
18429                                 /* NVRAM and RTC */
18430 -                               compatible = "ds1743";
18431 +                               compatible = "ds1743-nvram";
18432 +                               #bytes = <2000>;
18433                                 reg = <1 0 2000>;
18434                         };
18435  
18436 @@ -190,6 +198,45 @@
18437                                 virtual-reg = <f0300005>;
18438                         };
18439                 };
18440 +
18441 +               PCI0: pci@ec000000 {
18442 +                       device_type = "pci";
18443 +                       #interrupt-cells = <1>;
18444 +                       #size-cells = <2>;
18445 +                       #address-cells = <3>;
18446 +                       compatible = "ibm,plb405gp-pci", "ibm,plb-pci";
18447 +                       primary;
18448 +                       reg = <eec00000 8       /* Config space access */
18449 +                              eed80000 4       /* IACK */
18450 +                              eed80000 4       /* Special cycle */
18451 +                              ef480000 40>;    /* Internal registers */
18452 +
18453 +                       /* Outbound ranges, one memory and one IO,
18454 +                        * later cannot be changed. Chip supports a second
18455 +                        * IO range but we don't use it for now
18456 +                        */
18457 +                       ranges = <02000000 0 80000000 80000000 0 20000000
18458 +                                 01000000 0 00000000 e8000000 0 00010000>;
18459 +
18460 +                       /* Inbound 2GB range starting at 0 */
18461 +                       dma-ranges = <42000000 0 0 0 0 80000000>;
18462 +
18463 +                       /* Walnut has all 4 IRQ pins tied together per slot */
18464 +                       interrupt-map-mask = <f800 0 0 0>;
18465 +                       interrupt-map = <
18466 +                               /* IDSEL 1 */
18467 +                               0800 0 0 0 &UIC0 1c 8
18468 +
18469 +                               /* IDSEL 2 */
18470 +                               1000 0 0 0 &UIC0 1d 8
18471 +
18472 +                               /* IDSEL 3 */
18473 +                               1800 0 0 0 &UIC0 1e 8
18474 +
18475 +                               /* IDSEL 4 */
18476 +                               2000 0 0 0 &UIC0 1f 8
18477 +                       >;
18478 +               };
18479         };
18480  
18481         chosen {
18482 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/dts/warp.dts powerpc.git/arch/powerpc/boot/dts/warp.dts
18483 --- linux-2.6.24/arch/powerpc/boot/dts/warp.dts 1970-01-01 01:00:00.000000000 +0100
18484 +++ powerpc.git/arch/powerpc/boot/dts/warp.dts  2008-01-28 20:25:49.000000000 +0100
18485 @@ -0,0 +1,239 @@
18486 +/*
18487 + * Device Tree Source for PIKA Warp
18488 + *
18489 + * Copyright (c) 2008 PIKA Technologies
18490 + *   Sean MacLennan <smaclennan@pikatech.com>
18491 + *
18492 + * This file is licensed under the terms of the GNU General Public
18493 + * License version 2.  This program is licensed "as is" without
18494 + * any warranty of any kind, whether express or implied.
18495 + */
18496 +
18497 +/ {
18498 +       #address-cells = <2>;
18499 +       #size-cells = <1>;
18500 +       model = "pika,warp";
18501 +       compatible = "pika,warp";
18502 +       dcr-parent = <&/cpus/cpu@0>;
18503 +
18504 +       aliases {
18505 +               ethernet0 = &EMAC0;
18506 +               serial0 = &UART0;
18507 +       };
18508 +
18509 +       cpus {
18510 +               #address-cells = <1>;
18511 +               #size-cells = <0>;
18512 +
18513 +               cpu@0 {
18514 +                       device_type = "cpu";
18515 +                       model = "PowerPC,440EP";
18516 +                       reg = <0>;
18517 +                       clock-frequency = <0>; /* Filled in by zImage */
18518 +                       timebase-frequency = <0>; /* Filled in by zImage */
18519 +                       i-cache-line-size = <20>;
18520 +                       d-cache-line-size = <20>;
18521 +                       i-cache-size = <8000>;
18522 +                       d-cache-size = <8000>;
18523 +                       dcr-controller;
18524 +                       dcr-access-method = "native";
18525 +               };
18526 +       };
18527 +
18528 +       memory {
18529 +               device_type = "memory";
18530 +               reg = <0 0 0>; /* Filled in by zImage */
18531 +       };
18532 +
18533 +       UIC0: interrupt-controller0 {
18534 +               compatible = "ibm,uic-440ep","ibm,uic";
18535 +               interrupt-controller;
18536 +               cell-index = <0>;
18537 +               dcr-reg = <0c0 009>;
18538 +               #address-cells = <0>;
18539 +               #size-cells = <0>;
18540 +               #interrupt-cells = <2>;
18541 +       };
18542 +
18543 +       UIC1: interrupt-controller1 {
18544 +               compatible = "ibm,uic-440ep","ibm,uic";
18545 +               interrupt-controller;
18546 +               cell-index = <1>;
18547 +               dcr-reg = <0d0 009>;
18548 +               #address-cells = <0>;
18549 +               #size-cells = <0>;
18550 +               #interrupt-cells = <2>;
18551 +               interrupts = <1e 4 1f 4>; /* cascade */
18552 +               interrupt-parent = <&UIC0>;
18553 +       };
18554 +
18555 +       SDR0: sdr {
18556 +               compatible = "ibm,sdr-440ep";
18557 +               dcr-reg = <00e 002>;
18558 +       };
18559 +
18560 +       CPR0: cpr {
18561 +               compatible = "ibm,cpr-440ep";
18562 +               dcr-reg = <00c 002>;
18563 +       };
18564 +
18565 +       plb {
18566 +               compatible = "ibm,plb-440ep", "ibm,plb-440gp", "ibm,plb4";
18567 +               #address-cells = <2>;
18568 +               #size-cells = <1>;
18569 +               ranges;
18570 +               clock-frequency = <0>; /* Filled in by zImage */
18571 +
18572 +               SDRAM0: sdram {
18573 +                       compatible = "ibm,sdram-440ep", "ibm,sdram-405gp";
18574 +                       dcr-reg = <010 2>;
18575 +               };
18576 +
18577 +               DMA0: dma {
18578 +                       compatible = "ibm,dma-440ep", "ibm,dma-440gp";
18579 +                       dcr-reg = <100 027>;
18580 +               };
18581 +
18582 +               MAL0: mcmal {
18583 +                       compatible = "ibm,mcmal-440ep", "ibm,mcmal-440gp", "ibm,mcmal";
18584 +                       dcr-reg = <180 62>;
18585 +                       num-tx-chans = <4>;
18586 +                       num-rx-chans = <2>;
18587 +                       interrupt-parent = <&MAL0>;
18588 +                       interrupts = <0 1 2 3 4>;
18589 +                       #interrupt-cells = <1>;
18590 +                       #address-cells = <0>;
18591 +                       #size-cells = <0>;
18592 +                       interrupt-map = </*TXEOB*/ 0 &UIC0 a 4
18593 +                                       /*RXEOB*/ 1 &UIC0 b 4
18594 +                                       /*SERR*/  2 &UIC1 0 4
18595 +                                       /*TXDE*/  3 &UIC1 1 4
18596 +                                       /*RXDE*/  4 &UIC1 2 4>;
18597 +               };
18598 +
18599 +               POB0: opb {
18600 +                       compatible = "ibm,opb-440ep", "ibm,opb-440gp", "ibm,opb";
18601 +                       #address-cells = <1>;
18602 +                       #size-cells = <1>;
18603 +                       ranges = <00000000 0 00000000 80000000
18604 +                                 80000000 0 80000000 80000000>;
18605 +                       interrupt-parent = <&UIC1>;
18606 +                       interrupts = <7 4>;
18607 +                       clock-frequency = <0>; /* Filled in by zImage */
18608 +
18609 +                       EBC0: ebc {
18610 +                               compatible = "ibm,ebc-440ep", "ibm,ebc-440gp", "ibm,ebc";
18611 +                               dcr-reg = <012 2>;
18612 +                               #address-cells = <2>;
18613 +                               #size-cells = <1>;
18614 +                               clock-frequency = <0>; /* Filled in by zImage */
18615 +                               interrupts = <5 1>;
18616 +                               interrupt-parent = <&UIC1>;
18617 +
18618 +                               fpga@2,0 {
18619 +                                       compatible = "pika,fpga";
18620 +                                       reg = <2 0 2200>;
18621 +                                       interrupts = <18 8>;
18622 +                                       interrupt-parent = <&UIC0>;
18623 +                               };
18624 +
18625 +                               nor_flash@0,0 {
18626 +                                       compatible = "amd,s29gl512n", "cfi-flash";
18627 +                                       bank-width = <2>;
18628 +                                       reg = <0 0 4000000>;
18629 +                                       #address-cells = <1>;
18630 +                                       #size-cells = <1>;
18631 +                                       partition@0 {
18632 +                                               label = "kernel";
18633 +                                               reg = <0 180000>;
18634 +                                       };
18635 +                                       partition@180000 {
18636 +                                               label = "root";
18637 +                                               reg = <180000 3480000>;
18638 +                                       };
18639 +                                       partition@3600000 {
18640 +                                               label = "user";
18641 +                                               reg = <3600000 900000>;
18642 +                                       };
18643 +                                       partition@3f00000 {
18644 +                                               label = "fpga";
18645 +                                               reg = <3f00000 40000>;
18646 +                                       };
18647 +                                       partition@3f40000 {
18648 +                                               label = "env";
18649 +                                               reg = <3f40000 40000>;
18650 +                                       };
18651 +                                       partition@3f80000 {
18652 +                                               label = "u-boot";
18653 +                                               reg = <3f80000 80000>;
18654 +                                       };
18655 +                               };
18656 +                       };
18657 +
18658 +                       UART0: serial@ef600300 {
18659 +                               device_type = "serial";
18660 +                               compatible = "ns16550";
18661 +                               reg = <ef600300 8>;
18662 +                               virtual-reg = <ef600300>;
18663 +                               clock-frequency = <0>; /* Filled in by zImage */
18664 +                               current-speed = <1c200>;
18665 +                               interrupt-parent = <&UIC0>;
18666 +                               interrupts = <0 4>;
18667 +                       };
18668 +
18669 +                       IIC0: i2c@ef600700 {
18670 +                               compatible = "ibm,iic-440ep", "ibm,iic-440gp", "ibm,iic";
18671 +                               reg = <ef600700 14>;
18672 +                               interrupt-parent = <&UIC0>;
18673 +                               interrupts = <2 4>;
18674 +                       };
18675 +
18676 +                       GPIO0: gpio@ef600b00 {
18677 +                               compatible = "ibm,gpio-440ep";
18678 +                               reg = <ef600b00 48>;
18679 +                       };
18680 +
18681 +                       GPIO1: gpio@ef600c00 {
18682 +                               compatible = "ibm,gpio-440ep";
18683 +                               reg = <ef600c00 48>;
18684 +                       };
18685 +
18686 +                       ZMII0: emac-zmii@ef600d00 {
18687 +                               compatible = "ibm,zmii-440ep", "ibm,zmii-440gp", "ibm,zmii";
18688 +                               reg = <ef600d00 c>;
18689 +                       };
18690 +
18691 +                       EMAC0: ethernet@ef600e00 {
18692 +                               linux,network-index = <0>;
18693 +                               device_type = "network";
18694 +                               compatible = "ibm,emac-440ep", "ibm,emac-440gp", "ibm,emac";
18695 +                               interrupt-parent = <&UIC1>;
18696 +                               interrupts = <1c 4 1d 4>;
18697 +                               reg = <ef600e00 70>;
18698 +                               local-mac-address = [000000000000];
18699 +                               mal-device = <&MAL0>;
18700 +                               mal-tx-channel = <0 1>;
18701 +                               mal-rx-channel = <0>;
18702 +                               cell-index = <0>;
18703 +                               max-frame-size = <5dc>;
18704 +                               rx-fifo-size = <1000>;
18705 +                               tx-fifo-size = <800>;
18706 +                               phy-mode = "rmii";
18707 +                               phy-map = <00000000>;
18708 +                               zmii-device = <&ZMII0>;
18709 +                               zmii-channel = <0>;
18710 +                       };
18711 +
18712 +                       usb@ef601000 {
18713 +                               compatible = "ohci-be";
18714 +                               reg = <ef601000 80>;
18715 +                               interrupts = <8 1 9 1>;
18716 +                               interrupt-parent = < &UIC1 >;
18717 +                       };
18718 +               };
18719 +       };
18720 +
18721 +       chosen {
18722 +               linux,stdout-path = "/plb/opb/serial@ef600300";
18723 +       };
18724 +};
18725 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/ebony.c powerpc.git/arch/powerpc/boot/ebony.c
18726 --- linux-2.6.24/arch/powerpc/boot/ebony.c      2008-01-24 23:58:37.000000000 +0100
18727 +++ powerpc.git/arch/powerpc/boot/ebony.c       2008-01-28 20:25:49.000000000 +0100
18728 @@ -31,66 +31,6 @@
18729  
18730  static u8 *ebony_mac0, *ebony_mac1;
18731  
18732 -/* Calculate 440GP clocks */
18733 -void ibm440gp_fixup_clocks(unsigned int sysclk, unsigned int ser_clk)
18734 -{
18735 -       u32 sys0 = mfdcr(DCRN_CPC0_SYS0);
18736 -       u32 cr0 = mfdcr(DCRN_CPC0_CR0);
18737 -       u32 cpu, plb, opb, ebc, tb, uart0, uart1, m;
18738 -       u32 opdv = CPC0_SYS0_OPDV(sys0);
18739 -       u32 epdv = CPC0_SYS0_EPDV(sys0);
18740 -
18741 -       if (sys0 & CPC0_SYS0_BYPASS) {
18742 -               /* Bypass system PLL */
18743 -               cpu = plb = sysclk;
18744 -       } else {
18745 -               if (sys0 & CPC0_SYS0_EXTSL)
18746 -                       /* PerClk */
18747 -                       m = CPC0_SYS0_FWDVB(sys0) * opdv * epdv;
18748 -               else
18749 -                       /* CPU clock */
18750 -                       m = CPC0_SYS0_FBDV(sys0) * CPC0_SYS0_FWDVA(sys0);
18751 -               cpu = sysclk * m / CPC0_SYS0_FWDVA(sys0);
18752 -               plb = sysclk * m / CPC0_SYS0_FWDVB(sys0);
18753 -       }
18754 -
18755 -       opb = plb / opdv;
18756 -       ebc = opb / epdv;
18757 -
18758 -       /* FIXME: Check if this is for all 440GP, or just Ebony */
18759 -       if ((mfpvr() & 0xf0000fff) == 0x40000440)
18760 -               /* Rev. B 440GP, use external system clock */
18761 -               tb = sysclk;
18762 -       else
18763 -               /* Rev. C 440GP, errata force us to use internal clock */
18764 -               tb = cpu;
18765 -
18766 -       if (cr0 & CPC0_CR0_U0EC)
18767 -               /* External UART clock */
18768 -               uart0 = ser_clk;
18769 -       else
18770 -               /* Internal UART clock */
18771 -               uart0 = plb / CPC0_CR0_UDIV(cr0);
18772 -
18773 -       if (cr0 & CPC0_CR0_U1EC)
18774 -               /* External UART clock */
18775 -               uart1 = ser_clk;
18776 -       else
18777 -               /* Internal UART clock */
18778 -               uart1 = plb / CPC0_CR0_UDIV(cr0);
18779 -
18780 -       printf("PPC440GP: SysClk = %dMHz (%x)\n\r",
18781 -              (sysclk + 500000) / 1000000, sysclk);
18782 -
18783 -       dt_fixup_cpu_clocks(cpu, tb, 0);
18784 -
18785 -       dt_fixup_clock("/plb", plb);
18786 -       dt_fixup_clock("/plb/opb", opb);
18787 -       dt_fixup_clock("/plb/opb/ebc", ebc);
18788 -       dt_fixup_clock("/plb/opb/serial@40000200", uart0);
18789 -       dt_fixup_clock("/plb/opb/serial@40000300", uart1);
18790 -}
18791 -
18792  #define EBONY_FPGA_PATH                "/plb/opb/ebc/fpga"
18793  #define        EBONY_FPGA_FLASH_SEL    0x01
18794  #define EBONY_SMALL_FLASH_PATH "/plb/opb/ebc/small-flash"
18795 @@ -134,7 +74,7 @@
18796         unsigned long sysclk = 33000000;
18797  
18798         ibm440gp_fixup_clocks(sysclk, 6 * 1843200);
18799 -       ibm4xx_fixup_memsize();
18800 +       ibm4xx_sdram_fixup_memsize();
18801         dt_fixup_mac_addresses(ebony_mac0, ebony_mac1);
18802         ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
18803         ebony_flashsel_fixup();
18804 @@ -146,6 +86,6 @@
18805         platform_ops.exit = ibm44x_dbcr_reset;
18806         ebony_mac0 = mac0;
18807         ebony_mac1 = mac1;
18808 -       ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
18809 +       fdt_init(_dtb_start);
18810         serial_console_init();
18811  }
18812 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/ep405.c powerpc.git/arch/powerpc/boot/ep405.c
18813 --- linux-2.6.24/arch/powerpc/boot/ep405.c      1970-01-01 01:00:00.000000000 +0100
18814 +++ powerpc.git/arch/powerpc/boot/ep405.c       2008-01-28 20:25:49.000000000 +0100
18815 @@ -0,0 +1,74 @@
18816 +/*
18817 + * Embedded Planet EP405 with PlanetCore firmware
18818 + *
18819 + * (c) Benjamin Herrenschmidt <benh@kernel.crashing.org>, IBM Corp,\
18820 + *
18821 + * Based on ep88xc.c by
18822 + *
18823 + * Scott Wood <scottwood@freescale.com>
18824 + *
18825 + * Copyright (c) 2007 Freescale Semiconductor, Inc.
18826 + *
18827 + * This program is free software; you can redistribute it and/or modify it
18828 + * under the terms of the GNU General Public License version 2 as published
18829 + * by the Free Software Foundation.
18830 + */
18831 +
18832 +#include "ops.h"
18833 +#include "stdio.h"
18834 +#include "planetcore.h"
18835 +#include "dcr.h"
18836 +#include "4xx.h"
18837 +#include "io.h"
18838 +
18839 +static char *table;
18840 +static u64 mem_size;
18841 +
18842 +static void platform_fixups(void)
18843 +{
18844 +       u64 val;
18845 +       void *nvrtc;
18846 +
18847 +       dt_fixup_memory(0, mem_size);
18848 +       planetcore_set_mac_addrs(table);
18849 +
18850 +       if (!planetcore_get_decimal(table, PLANETCORE_KEY_CRYSTAL_HZ, &val)) {
18851 +               printf("No PlanetCore crystal frequency key.\r\n");
18852 +               return;
18853 +       }
18854 +       ibm405gp_fixup_clocks(val, 0xa8c000);
18855 +       ibm4xx_quiesce_eth((u32 *)0xef600800, NULL);
18856 +       ibm4xx_fixup_ebc_ranges("/plb/ebc");
18857 +
18858 +       if (!planetcore_get_decimal(table, PLANETCORE_KEY_KB_NVRAM, &val)) {
18859 +               printf("No PlanetCore NVRAM size key.\r\n");
18860 +               return;
18861 +       }
18862 +       nvrtc = finddevice("/plb/ebc/nvrtc@4,200000");
18863 +       if (nvrtc != NULL) {
18864 +               u32 reg[3] = { 4, 0x200000, 0};
18865 +               getprop(nvrtc, "reg", reg, 3);
18866 +               reg[2] = (val << 10) & 0xffffffff;
18867 +               setprop(nvrtc, "reg", reg, 3);
18868 +       }
18869 +}
18870 +
18871 +void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
18872 +                  unsigned long r6, unsigned long r7)
18873 +{
18874 +       table = (char *)r3;
18875 +       planetcore_prepare_table(table);
18876 +
18877 +       if (!planetcore_get_decimal(table, PLANETCORE_KEY_MB_RAM, &mem_size))
18878 +               return;
18879 +
18880 +       mem_size *= 1024 * 1024;
18881 +       simple_alloc_init(_end, mem_size - (unsigned long)_end, 32, 64);
18882 +
18883 +       fdt_init(_dtb_start);
18884 +
18885 +       planetcore_set_stdout_path(table);
18886 +
18887 +       serial_console_init();
18888 +       platform_ops.fixups = platform_fixups;
18889 +}
18890 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/ep8248e.c powerpc.git/arch/powerpc/boot/ep8248e.c
18891 --- linux-2.6.24/arch/powerpc/boot/ep8248e.c    1970-01-01 01:00:00.000000000 +0100
18892 +++ powerpc.git/arch/powerpc/boot/ep8248e.c     2008-01-28 20:25:49.000000000 +0100
18893 @@ -0,0 +1,55 @@
18894 +/*
18895 + * Embedded Planet EP8248E with PlanetCore firmware
18896 + *
18897 + * Author: Scott Wood <scottwood@freescale.com>
18898 + *
18899 + * Copyright (c) 2007 Freescale Semiconductor, Inc.
18900 + *
18901 + * This program is free software; you can redistribute it and/or modify it
18902 + * under the terms of the GNU General Public License version 2 as published
18903 + * by the Free Software Foundation.
18904 + */
18905 +
18906 +#include "ops.h"
18907 +#include "stdio.h"
18908 +#include "planetcore.h"
18909 +#include "pq2.h"
18910 +
18911 +static char *table;
18912 +static u64 mem_size;
18913 +
18914 +#include <io.h>
18915 +
18916 +static void platform_fixups(void)
18917 +{
18918 +       u64 val;
18919 +
18920 +       dt_fixup_memory(0, mem_size);
18921 +       planetcore_set_mac_addrs(table);
18922 +
18923 +       if (!planetcore_get_decimal(table, PLANETCORE_KEY_CRYSTAL_HZ, &val)) {
18924 +               printf("No PlanetCore crystal frequency key.\r\n");
18925 +               return;
18926 +       }
18927 +
18928 +       pq2_fixup_clocks(val);
18929 +}
18930 +
18931 +void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
18932 +                   unsigned long r6, unsigned long r7)
18933 +{
18934 +       table = (char *)r3;
18935 +       planetcore_prepare_table(table);
18936 +
18937 +       if (!planetcore_get_decimal(table, PLANETCORE_KEY_MB_RAM, &mem_size))
18938 +               return;
18939 +
18940 +       mem_size *= 1024 * 1024;
18941 +       simple_alloc_init(_end, mem_size - (unsigned long)_end, 32, 64);
18942 +
18943 +       fdt_init(_dtb_start);
18944 +
18945 +       planetcore_set_stdout_path(table);
18946 +       serial_console_init();
18947 +       platform_ops.fixups = platform_fixups;
18948 +}
18949 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/ep88xc.c powerpc.git/arch/powerpc/boot/ep88xc.c
18950 --- linux-2.6.24/arch/powerpc/boot/ep88xc.c     2008-01-24 23:58:37.000000000 +0100
18951 +++ powerpc.git/arch/powerpc/boot/ep88xc.c      2008-01-28 20:25:49.000000000 +0100
18952 @@ -45,7 +45,7 @@
18953         mem_size *= 1024 * 1024;
18954         simple_alloc_init(_end, mem_size - (unsigned long)_end, 32, 64);
18955  
18956 -       ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
18957 +       fdt_init(_dtb_start);
18958  
18959         planetcore_set_stdout_path(table);
18960  
18961 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/flatdevtree.c powerpc.git/arch/powerpc/boot/flatdevtree.c
18962 --- linux-2.6.24/arch/powerpc/boot/flatdevtree.c        2008-01-24 23:58:37.000000000 +0100
18963 +++ powerpc.git/arch/powerpc/boot/flatdevtree.c 1970-01-01 01:00:00.000000000 +0100
18964 @@ -1,1036 +0,0 @@
18965 -/*
18966 - * This program is free software; you can redistribute it and/or modify
18967 - * it under the terms of the GNU General Public License as published by
18968 - * the Free Software Foundation; either version 2 of the License, or
18969 - * (at your option) any later version.
18970 - *
18971 - * This program is distributed in the hope that it will be useful,
18972 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
18973 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18974 - * GNU General Public License for more details.
18975 - *
18976 - * You should have received a copy of the GNU General Public License
18977 - * along with this program; if not, write to the Free Software
18978 - * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18979 - *
18980 - * Copyright Pantelis Antoniou 2006
18981 - * Copyright (C) IBM Corporation 2006
18982 - *
18983 - * Authors: Pantelis Antoniou <pantelis@embeddedalley.com>
18984 - *         Hollis Blanchard <hollisb@us.ibm.com>
18985 - *         Mark A. Greer <mgreer@mvista.com>
18986 - *         Paul Mackerras <paulus@samba.org>
18987 - */
18988 -
18989 -#include <string.h>
18990 -#include <stddef.h>
18991 -#include "flatdevtree.h"
18992 -#include "flatdevtree_env.h"
18993 -
18994 -#define _ALIGN(x, al)  (((x) + (al) - 1) & ~((al) - 1))
18995 -
18996 -static char *ft_root_node(struct ft_cxt *cxt)
18997 -{
18998 -       return cxt->rgn[FT_STRUCT].start;
18999 -}
19000 -
19001 -/* Routines for keeping node ptrs returned by ft_find_device current */
19002 -/* First entry not used b/c it would return 0 and be taken as NULL/error */
19003 -static void *ft_get_phandle(struct ft_cxt *cxt, char *node)
19004 -{
19005 -       unsigned int i;
19006 -
19007 -       if (!node)
19008 -               return NULL;
19009 -
19010 -       for (i = 1; i < cxt->nodes_used; i++)   /* already there? */
19011 -               if (cxt->node_tbl[i] == node)
19012 -                       return (void *)i;
19013 -
19014 -       if (cxt->nodes_used < cxt->node_max) {
19015 -               cxt->node_tbl[cxt->nodes_used] = node;
19016 -               return (void *)cxt->nodes_used++;
19017 -       }
19018 -
19019 -       return NULL;
19020 -}
19021 -
19022 -static char *ft_node_ph2node(struct ft_cxt *cxt, const void *phandle)
19023 -{
19024 -       unsigned int i = (unsigned int)phandle;
19025 -
19026 -       if (i < cxt->nodes_used)
19027 -               return cxt->node_tbl[i];
19028 -       return NULL;
19029 -}
19030 -
19031 -static void ft_node_update_before(struct ft_cxt *cxt, char *addr, int shift)
19032 -{
19033 -       unsigned int i;
19034 -
19035 -       if (shift == 0)
19036 -               return;
19037 -
19038 -       for (i = 1; i < cxt->nodes_used; i++)
19039 -               if (cxt->node_tbl[i] < addr)
19040 -                       cxt->node_tbl[i] += shift;
19041 -}
19042 -
19043 -static void ft_node_update_after(struct ft_cxt *cxt, char *addr, int shift)
19044 -{
19045 -       unsigned int i;
19046 -
19047 -       if (shift == 0)
19048 -               return;
19049 -
19050 -       for (i = 1; i < cxt->nodes_used; i++)
19051 -               if (cxt->node_tbl[i] >= addr)
19052 -                       cxt->node_tbl[i] += shift;
19053 -}
19054 -
19055 -/* Struct used to return info from ft_next() */
19056 -struct ft_atom {
19057 -       u32 tag;
19058 -       const char *name;
19059 -       void *data;
19060 -       u32 size;
19061 -};
19062 -
19063 -/* Set ptrs to current one's info; return addr of next one */
19064 -static char *ft_next(struct ft_cxt *cxt, char *p, struct ft_atom *ret)
19065 -{
19066 -       u32 sz;
19067 -
19068 -       if (p >= cxt->rgn[FT_STRUCT].start + cxt->rgn[FT_STRUCT].size)
19069 -               return NULL;
19070 -
19071 -       ret->tag = be32_to_cpu(*(u32 *) p);
19072 -       p += 4;
19073 -
19074 -       switch (ret->tag) {     /* Tag */
19075 -       case OF_DT_BEGIN_NODE:
19076 -               ret->name = p;
19077 -               ret->data = (void *)(p - 4);    /* start of node */
19078 -               p += _ALIGN(strlen(p) + 1, 4);
19079 -               break;
19080 -       case OF_DT_PROP:
19081 -               ret->size = sz = be32_to_cpu(*(u32 *) p);
19082 -               ret->name = cxt->str_anchor + be32_to_cpu(*(u32 *) (p + 4));
19083 -               ret->data = (void *)(p + 8);
19084 -               p += 8 + _ALIGN(sz, 4);
19085 -               break;
19086 -       case OF_DT_END_NODE:
19087 -       case OF_DT_NOP:
19088 -               break;
19089 -       case OF_DT_END:
19090 -       default:
19091 -               p = NULL;
19092 -               break;
19093 -       }
19094 -
19095 -       return p;
19096 -}
19097 -
19098 -#define HDR_SIZE       _ALIGN(sizeof(struct boot_param_header), 8)
19099 -#define EXPAND_INCR    1024    /* alloc this much extra when expanding */
19100 -
19101 -/* Copy the tree to a newly-allocated region and put things in order */
19102 -static int ft_reorder(struct ft_cxt *cxt, int nextra)
19103 -{
19104 -       unsigned long tot;
19105 -       enum ft_rgn_id r;
19106 -       char *p, *pend;
19107 -       int stroff;
19108 -
19109 -       tot = HDR_SIZE + EXPAND_INCR;
19110 -       for (r = FT_RSVMAP; r <= FT_STRINGS; ++r)
19111 -               tot += cxt->rgn[r].size;
19112 -       if (nextra > 0)
19113 -               tot += nextra;
19114 -       tot = _ALIGN(tot, 8);
19115 -
19116 -       if (!cxt->realloc)
19117 -               return 0;
19118 -       p = cxt->realloc(NULL, tot);
19119 -       if (!p)
19120 -               return 0;
19121 -
19122 -       memcpy(p, cxt->bph, sizeof(struct boot_param_header));
19123 -       /* offsets get fixed up later */
19124 -
19125 -       cxt->bph = (struct boot_param_header *)p;
19126 -       cxt->max_size = tot;
19127 -       pend = p + tot;
19128 -       p += HDR_SIZE;
19129 -
19130 -       memcpy(p, cxt->rgn[FT_RSVMAP].start, cxt->rgn[FT_RSVMAP].size);
19131 -       cxt->rgn[FT_RSVMAP].start = p;
19132 -       p += cxt->rgn[FT_RSVMAP].size;
19133 -
19134 -       memcpy(p, cxt->rgn[FT_STRUCT].start, cxt->rgn[FT_STRUCT].size);
19135 -       ft_node_update_after(cxt, cxt->rgn[FT_STRUCT].start,
19136 -                       p - cxt->rgn[FT_STRUCT].start);
19137 -       cxt->p += p - cxt->rgn[FT_STRUCT].start;
19138 -       cxt->rgn[FT_STRUCT].start = p;
19139 -
19140 -       p = pend - cxt->rgn[FT_STRINGS].size;
19141 -       memcpy(p, cxt->rgn[FT_STRINGS].start, cxt->rgn[FT_STRINGS].size);
19142 -       stroff = cxt->str_anchor - cxt->rgn[FT_STRINGS].start;
19143 -       cxt->rgn[FT_STRINGS].start = p;
19144 -       cxt->str_anchor = p + stroff;
19145 -
19146 -       cxt->isordered = 1;
19147 -       return 1;
19148 -}
19149 -
19150 -static inline char *prev_end(struct ft_cxt *cxt, enum ft_rgn_id r)
19151 -{
19152 -       if (r > FT_RSVMAP)
19153 -               return cxt->rgn[r - 1].start + cxt->rgn[r - 1].size;
19154 -       return (char *)cxt->bph + HDR_SIZE;
19155 -}
19156 -
19157 -static inline char *next_start(struct ft_cxt *cxt, enum ft_rgn_id r)
19158 -{
19159 -       if (r < FT_STRINGS)
19160 -               return cxt->rgn[r + 1].start;
19161 -       return (char *)cxt->bph + cxt->max_size;
19162 -}
19163 -
19164 -/*
19165 - * See if we can expand region rgn by nextra bytes by using up
19166 - * free space after or before the region.
19167 - */
19168 -static int ft_shuffle(struct ft_cxt *cxt, char **pp, enum ft_rgn_id rgn,
19169 -               int nextra)
19170 -{
19171 -       char *p = *pp;
19172 -       char *rgn_start, *rgn_end;
19173 -
19174 -       rgn_start = cxt->rgn[rgn].start;
19175 -       rgn_end = rgn_start + cxt->rgn[rgn].size;
19176 -       if (nextra <= 0 || rgn_end + nextra <= next_start(cxt, rgn)) {
19177 -               /* move following stuff */
19178 -               if (p < rgn_end) {
19179 -                       if (nextra < 0)
19180 -                               memmove(p, p - nextra, rgn_end - p + nextra);
19181 -                       else
19182 -                               memmove(p + nextra, p, rgn_end - p);
19183 -                       if (rgn == FT_STRUCT)
19184 -                               ft_node_update_after(cxt, p, nextra);
19185 -               }
19186 -               cxt->rgn[rgn].size += nextra;
19187 -               if (rgn == FT_STRINGS)
19188 -                       /* assumes strings only added at beginning */
19189 -                       cxt->str_anchor += nextra;
19190 -               return 1;
19191 -       }
19192 -       if (prev_end(cxt, rgn) <= rgn_start - nextra) {
19193 -               /* move preceding stuff */
19194 -               if (p > rgn_start) {
19195 -                       memmove(rgn_start - nextra, rgn_start, p - rgn_start);
19196 -                       if (rgn == FT_STRUCT)
19197 -                               ft_node_update_before(cxt, p, -nextra);
19198 -               }
19199 -               *pp -= nextra;
19200 -               cxt->rgn[rgn].start -= nextra;
19201 -               cxt->rgn[rgn].size += nextra;
19202 -               return 1;
19203 -       }
19204 -       return 0;
19205 -}
19206 -
19207 -static int ft_make_space(struct ft_cxt *cxt, char **pp, enum ft_rgn_id rgn,
19208 -                        int nextra)
19209 -{
19210 -       unsigned long size, ssize, tot;
19211 -       char *str, *next;
19212 -       enum ft_rgn_id r;
19213 -
19214 -       if (!cxt->isordered) {
19215 -               unsigned long rgn_off = *pp - cxt->rgn[rgn].start;
19216 -
19217 -               if (!ft_reorder(cxt, nextra))
19218 -                       return 0;
19219 -
19220 -               *pp = cxt->rgn[rgn].start + rgn_off;
19221 -       }
19222 -       if (ft_shuffle(cxt, pp, rgn, nextra))
19223 -               return 1;
19224 -
19225 -       /* See if there is space after the strings section */
19226 -       ssize = cxt->rgn[FT_STRINGS].size;
19227 -       if (cxt->rgn[FT_STRINGS].start + ssize
19228 -                       < (char *)cxt->bph + cxt->max_size) {
19229 -               /* move strings up as far as possible */
19230 -               str = (char *)cxt->bph + cxt->max_size - ssize;
19231 -               cxt->str_anchor += str - cxt->rgn[FT_STRINGS].start;
19232 -               memmove(str, cxt->rgn[FT_STRINGS].start, ssize);
19233 -               cxt->rgn[FT_STRINGS].start = str;
19234 -               /* enough space now? */
19235 -               if (rgn >= FT_STRUCT && ft_shuffle(cxt, pp, rgn, nextra))
19236 -                       return 1;
19237 -       }
19238 -
19239 -       /* how much total free space is there following this region? */
19240 -       tot = 0;
19241 -       for (r = rgn; r < FT_STRINGS; ++r) {
19242 -               char *r_end = cxt->rgn[r].start + cxt->rgn[r].size;
19243 -               tot += next_start(cxt, rgn) - r_end;
19244 -       }
19245 -
19246 -       /* cast is to shut gcc up; we know nextra >= 0 */
19247 -       if (tot < (unsigned int)nextra) {
19248 -               /* have to reallocate */
19249 -               char *newp, *new_start;
19250 -               int shift;
19251 -
19252 -               if (!cxt->realloc)
19253 -                       return 0;
19254 -               size = _ALIGN(cxt->max_size + (nextra - tot) + EXPAND_INCR, 8);
19255 -               newp = cxt->realloc(cxt->bph, size);
19256 -               if (!newp)
19257 -                       return 0;
19258 -               cxt->max_size = size;
19259 -               shift = newp - (char *)cxt->bph;
19260 -
19261 -               if (shift) { /* realloc can return same addr */
19262 -                       cxt->bph = (struct boot_param_header *)newp;
19263 -                       ft_node_update_after(cxt, cxt->rgn[FT_STRUCT].start,
19264 -                                       shift);
19265 -                       for (r = FT_RSVMAP; r <= FT_STRINGS; ++r) {
19266 -                               new_start = cxt->rgn[r].start + shift;
19267 -                               cxt->rgn[r].start = new_start;
19268 -                       }
19269 -                       *pp += shift;
19270 -                       cxt->str_anchor += shift;
19271 -               }
19272 -
19273 -               /* move strings up to the end */
19274 -               str = newp + size - ssize;
19275 -               cxt->str_anchor += str - cxt->rgn[FT_STRINGS].start;
19276 -               memmove(str, cxt->rgn[FT_STRINGS].start, ssize);
19277 -               cxt->rgn[FT_STRINGS].start = str;
19278 -
19279 -               if (ft_shuffle(cxt, pp, rgn, nextra))
19280 -                       return 1;
19281 -       }
19282 -
19283 -       /* must be FT_RSVMAP and we need to move FT_STRUCT up */
19284 -       if (rgn == FT_RSVMAP) {
19285 -               next = cxt->rgn[FT_RSVMAP].start + cxt->rgn[FT_RSVMAP].size
19286 -                       + nextra;
19287 -               ssize = cxt->rgn[FT_STRUCT].size;
19288 -               if (next + ssize >= cxt->rgn[FT_STRINGS].start)
19289 -                       return 0;       /* "can't happen" */
19290 -               memmove(next, cxt->rgn[FT_STRUCT].start, ssize);
19291 -               ft_node_update_after(cxt, cxt->rgn[FT_STRUCT].start, nextra);
19292 -               cxt->rgn[FT_STRUCT].start = next;
19293 -
19294 -               if (ft_shuffle(cxt, pp, rgn, nextra))
19295 -                       return 1;
19296 -       }
19297 -
19298 -       return 0;               /* "can't happen" */
19299 -}
19300 -
19301 -static void ft_put_word(struct ft_cxt *cxt, u32 v)
19302 -{
19303 -       *(u32 *) cxt->p = cpu_to_be32(v);
19304 -       cxt->p += 4;
19305 -}
19306 -
19307 -static void ft_put_bin(struct ft_cxt *cxt, const void *data, unsigned int sz)
19308 -{
19309 -       unsigned long sza = _ALIGN(sz, 4);
19310 -
19311 -       /* zero out the alignment gap if necessary */
19312 -       if (sz < sza)
19313 -               *(u32 *) (cxt->p + sza - 4) = 0;
19314 -
19315 -       /* copy in the data */
19316 -       memcpy(cxt->p, data, sz);
19317 -
19318 -       cxt->p += sza;
19319 -}
19320 -
19321 -char *ft_begin_node(struct ft_cxt *cxt, const char *name)
19322 -{
19323 -       unsigned long nlen = strlen(name) + 1;
19324 -       unsigned long len = 8 + _ALIGN(nlen, 4);
19325 -       char *ret;
19326 -
19327 -       if (!ft_make_space(cxt, &cxt->p, FT_STRUCT, len))
19328 -               return NULL;
19329 -
19330 -       ret = cxt->p;
19331 -
19332 -       ft_put_word(cxt, OF_DT_BEGIN_NODE);
19333 -       ft_put_bin(cxt, name, strlen(name) + 1);
19334 -
19335 -       return ret;
19336 -}
19337 -
19338 -void ft_end_node(struct ft_cxt *cxt)
19339 -{
19340 -       ft_put_word(cxt, OF_DT_END_NODE);
19341 -}
19342 -
19343 -void ft_nop(struct ft_cxt *cxt)
19344 -{
19345 -       if (ft_make_space(cxt, &cxt->p, FT_STRUCT, 4))
19346 -               ft_put_word(cxt, OF_DT_NOP);
19347 -}
19348 -
19349 -#define NO_STRING      0x7fffffff
19350 -
19351 -static int lookup_string(struct ft_cxt *cxt, const char *name)
19352 -{
19353 -       char *p, *end;
19354 -
19355 -       p = cxt->rgn[FT_STRINGS].start;
19356 -       end = p + cxt->rgn[FT_STRINGS].size;
19357 -       while (p < end) {
19358 -               if (strcmp(p, (char *)name) == 0)
19359 -                       return p - cxt->str_anchor;
19360 -               p += strlen(p) + 1;
19361 -       }
19362 -
19363 -       return NO_STRING;
19364 -}
19365 -
19366 -/* lookup string and insert if not found */
19367 -static int map_string(struct ft_cxt *cxt, const char *name)
19368 -{
19369 -       int off;
19370 -       char *p;
19371 -
19372 -       off = lookup_string(cxt, name);
19373 -       if (off != NO_STRING)
19374 -               return off;
19375 -       p = cxt->rgn[FT_STRINGS].start;
19376 -       if (!ft_make_space(cxt, &p, FT_STRINGS, strlen(name) + 1))
19377 -               return NO_STRING;
19378 -       strcpy(p, name);
19379 -       return p - cxt->str_anchor;
19380 -}
19381 -
19382 -int ft_prop(struct ft_cxt *cxt, const char *name, const void *data,
19383 -               unsigned int sz)
19384 -{
19385 -       int off, len;
19386 -
19387 -       off = map_string(cxt, name);
19388 -       if (off == NO_STRING)
19389 -               return -1;
19390 -
19391 -       len = 12 + _ALIGN(sz, 4);
19392 -       if (!ft_make_space(cxt, &cxt->p, FT_STRUCT, len))
19393 -               return -1;
19394 -
19395 -       ft_put_word(cxt, OF_DT_PROP);
19396 -       ft_put_word(cxt, sz);
19397 -       ft_put_word(cxt, off);
19398 -       ft_put_bin(cxt, data, sz);
19399 -       return 0;
19400 -}
19401 -
19402 -int ft_prop_str(struct ft_cxt *cxt, const char *name, const char *str)
19403 -{
19404 -       return ft_prop(cxt, name, str, strlen(str) + 1);
19405 -}
19406 -
19407 -int ft_prop_int(struct ft_cxt *cxt, const char *name, unsigned int val)
19408 -{
19409 -       u32 v = cpu_to_be32((u32) val);
19410 -
19411 -       return ft_prop(cxt, name, &v, 4);
19412 -}
19413 -
19414 -/* Calculate the size of the reserved map */
19415 -static unsigned long rsvmap_size(struct ft_cxt *cxt)
19416 -{
19417 -       struct ft_reserve *res;
19418 -
19419 -       res = (struct ft_reserve *)cxt->rgn[FT_RSVMAP].start;
19420 -       while (res->start || res->len)
19421 -               ++res;
19422 -       return (char *)(res + 1) - cxt->rgn[FT_RSVMAP].start;
19423 -}
19424 -
19425 -/* Calculate the size of the struct region by stepping through it */
19426 -static unsigned long struct_size(struct ft_cxt *cxt)
19427 -{
19428 -       char *p = cxt->rgn[FT_STRUCT].start;
19429 -       char *next;
19430 -       struct ft_atom atom;
19431 -
19432 -       /* make check in ft_next happy */
19433 -       if (cxt->rgn[FT_STRUCT].size == 0)
19434 -               cxt->rgn[FT_STRUCT].size = 0xfffffffful - (unsigned long)p;
19435 -
19436 -       while ((next = ft_next(cxt, p, &atom)) != NULL)
19437 -               p = next;
19438 -       return p + 4 - cxt->rgn[FT_STRUCT].start;
19439 -}
19440 -
19441 -/* add `adj' on to all string offset values in the struct area */
19442 -static void adjust_string_offsets(struct ft_cxt *cxt, int adj)
19443 -{
19444 -       char *p = cxt->rgn[FT_STRUCT].start;
19445 -       char *next;
19446 -       struct ft_atom atom;
19447 -       int off;
19448 -
19449 -       while ((next = ft_next(cxt, p, &atom)) != NULL) {
19450 -               if (atom.tag == OF_DT_PROP) {
19451 -                       off = be32_to_cpu(*(u32 *) (p + 8));
19452 -                       *(u32 *) (p + 8) = cpu_to_be32(off + adj);
19453 -               }
19454 -               p = next;
19455 -       }
19456 -}
19457 -
19458 -/* start construction of the flat OF tree from scratch */
19459 -void ft_begin(struct ft_cxt *cxt, void *blob, unsigned int max_size,
19460 -               void *(*realloc_fn) (void *, unsigned long))
19461 -{
19462 -       struct boot_param_header *bph = blob;
19463 -       char *p;
19464 -       struct ft_reserve *pres;
19465 -
19466 -       /* clear the cxt */
19467 -       memset(cxt, 0, sizeof(*cxt));
19468 -
19469 -       cxt->bph = bph;
19470 -       cxt->max_size = max_size;
19471 -       cxt->realloc = realloc_fn;
19472 -       cxt->isordered = 1;
19473 -
19474 -       /* zero everything in the header area */
19475 -       memset(bph, 0, sizeof(*bph));
19476 -
19477 -       bph->magic = cpu_to_be32(OF_DT_HEADER);
19478 -       bph->version = cpu_to_be32(0x10);
19479 -       bph->last_comp_version = cpu_to_be32(0x10);
19480 -
19481 -       /* start pointers */
19482 -       cxt->rgn[FT_RSVMAP].start = p = blob + HDR_SIZE;
19483 -       cxt->rgn[FT_RSVMAP].size = sizeof(struct ft_reserve);
19484 -       pres = (struct ft_reserve *)p;
19485 -       cxt->rgn[FT_STRUCT].start = p += sizeof(struct ft_reserve);
19486 -       cxt->rgn[FT_STRUCT].size = 4;
19487 -       cxt->rgn[FT_STRINGS].start = blob + max_size;
19488 -       cxt->rgn[FT_STRINGS].size = 0;
19489 -
19490 -       /* init rsvmap and struct */
19491 -       pres->start = 0;
19492 -       pres->len = 0;
19493 -       *(u32 *) p = cpu_to_be32(OF_DT_END);
19494 -
19495 -       cxt->str_anchor = blob;
19496 -}
19497 -
19498 -/* open up an existing blob to be examined or modified */
19499 -int ft_open(struct ft_cxt *cxt, void *blob, unsigned int max_size,
19500 -               unsigned int max_find_device,
19501 -               void *(*realloc_fn) (void *, unsigned long))
19502 -{
19503 -       struct boot_param_header *bph = blob;
19504 -
19505 -       /* can't cope with version < 16 */
19506 -       if (be32_to_cpu(bph->version) < 16)
19507 -               return -1;
19508 -
19509 -       /* clear the cxt */
19510 -       memset(cxt, 0, sizeof(*cxt));
19511 -
19512 -       /* alloc node_tbl to track node ptrs returned by ft_find_device */
19513 -       ++max_find_device;
19514 -       cxt->node_tbl = realloc_fn(NULL, max_find_device * sizeof(char *));
19515 -       if (!cxt->node_tbl)
19516 -               return -1;
19517 -       memset(cxt->node_tbl, 0, max_find_device * sizeof(char *));
19518 -       cxt->node_max = max_find_device;
19519 -       cxt->nodes_used = 1;    /* don't use idx 0 b/c looks like NULL */
19520 -
19521 -       cxt->bph = bph;
19522 -       cxt->max_size = max_size;
19523 -       cxt->realloc = realloc_fn;
19524 -
19525 -       cxt->rgn[FT_RSVMAP].start = blob + be32_to_cpu(bph->off_mem_rsvmap);
19526 -       cxt->rgn[FT_RSVMAP].size = rsvmap_size(cxt);
19527 -       cxt->rgn[FT_STRUCT].start = blob + be32_to_cpu(bph->off_dt_struct);
19528 -       cxt->rgn[FT_STRUCT].size = struct_size(cxt);
19529 -       cxt->rgn[FT_STRINGS].start = blob + be32_to_cpu(bph->off_dt_strings);
19530 -       cxt->rgn[FT_STRINGS].size = be32_to_cpu(bph->dt_strings_size);
19531 -
19532 -       cxt->p = cxt->rgn[FT_STRUCT].start;
19533 -       cxt->str_anchor = cxt->rgn[FT_STRINGS].start;
19534 -
19535 -       return 0;
19536 -}
19537 -
19538 -/* add a reserver physical area to the rsvmap */
19539 -int ft_add_rsvmap(struct ft_cxt *cxt, u64 physaddr, u64 size)
19540 -{
19541 -       char *p;
19542 -       struct ft_reserve *pres;
19543 -
19544 -       p = cxt->rgn[FT_RSVMAP].start + cxt->rgn[FT_RSVMAP].size
19545 -               - sizeof(struct ft_reserve);
19546 -       if (!ft_make_space(cxt, &p, FT_RSVMAP, sizeof(struct ft_reserve)))
19547 -               return -1;
19548 -
19549 -       pres = (struct ft_reserve *)p;
19550 -       pres->start = cpu_to_be64(physaddr);
19551 -       pres->len = cpu_to_be64(size);
19552 -
19553 -       return 0;
19554 -}
19555 -
19556 -void ft_begin_tree(struct ft_cxt *cxt)
19557 -{
19558 -       cxt->p = ft_root_node(cxt);
19559 -}
19560 -
19561 -void ft_end_tree(struct ft_cxt *cxt)
19562 -{
19563 -       struct boot_param_header *bph = cxt->bph;
19564 -       char *p, *oldstr, *str, *endp;
19565 -       unsigned long ssize;
19566 -       int adj;
19567 -
19568 -       if (!cxt->isordered)
19569 -               return;         /* we haven't touched anything */
19570 -
19571 -       /* adjust string offsets */
19572 -       oldstr = cxt->rgn[FT_STRINGS].start;
19573 -       adj = cxt->str_anchor - oldstr;
19574 -       if (adj)
19575 -               adjust_string_offsets(cxt, adj);
19576 -
19577 -       /* make strings end on 8-byte boundary */
19578 -       ssize = cxt->rgn[FT_STRINGS].size;
19579 -       endp = (char *)_ALIGN((unsigned long)cxt->rgn[FT_STRUCT].start
19580 -                       + cxt->rgn[FT_STRUCT].size + ssize, 8);
19581 -       str = endp - ssize;
19582 -
19583 -       /* move strings down to end of structs */
19584 -       memmove(str, oldstr, ssize);
19585 -       cxt->str_anchor = str;
19586 -       cxt->rgn[FT_STRINGS].start = str;
19587 -
19588 -       /* fill in header fields */
19589 -       p = (char *)bph;
19590 -       bph->totalsize = cpu_to_be32(endp - p);
19591 -       bph->off_mem_rsvmap = cpu_to_be32(cxt->rgn[FT_RSVMAP].start - p);
19592 -       bph->off_dt_struct = cpu_to_be32(cxt->rgn[FT_STRUCT].start - p);
19593 -       bph->off_dt_strings = cpu_to_be32(cxt->rgn[FT_STRINGS].start - p);
19594 -       bph->dt_strings_size = cpu_to_be32(ssize);
19595 -}
19596 -
19597 -void *ft_find_device(struct ft_cxt *cxt, const void *top, const char *srch_path)
19598 -{
19599 -       char *node;
19600 -
19601 -       if (top) {
19602 -               node = ft_node_ph2node(cxt, top);
19603 -               if (node == NULL)
19604 -                       return NULL;
19605 -       } else {
19606 -               node = ft_root_node(cxt);
19607 -       }
19608 -
19609 -       node = ft_find_descendent(cxt, node, srch_path);
19610 -       return ft_get_phandle(cxt, node);
19611 -}
19612 -
19613 -void *ft_find_descendent(struct ft_cxt *cxt, void *top, const char *srch_path)
19614 -{
19615 -       struct ft_atom atom;
19616 -       char *p;
19617 -       const char *cp, *q;
19618 -       int cl;
19619 -       int depth = -1;
19620 -       int dmatch = 0;
19621 -       const char *path_comp[FT_MAX_DEPTH];
19622 -
19623 -       cp = srch_path;
19624 -       cl = 0;
19625 -       p = top;
19626 -
19627 -       while ((p = ft_next(cxt, p, &atom)) != NULL) {
19628 -               switch (atom.tag) {
19629 -               case OF_DT_BEGIN_NODE:
19630 -                       ++depth;
19631 -                       if (depth != dmatch)
19632 -                               break;
19633 -                       cxt->genealogy[depth] = atom.data;
19634 -                       cxt->genealogy[depth + 1] = NULL;
19635 -                       if (depth && !(strncmp(atom.name, cp, cl) == 0
19636 -                                       && (atom.name[cl] == '/'
19637 -                                               || atom.name[cl] == '\0'
19638 -                                               || atom.name[cl] == '@')))
19639 -                               break;
19640 -                       path_comp[dmatch] = cp;
19641 -                       /* it matches so far, advance to next path component */
19642 -                       cp += cl;
19643 -                       /* skip slashes */
19644 -                       while (*cp == '/')
19645 -                               ++cp;
19646 -                       /* we're done if this is the end of the string */
19647 -                       if (*cp == 0)
19648 -                               return atom.data;
19649 -                       /* look for end of this component */
19650 -                       q = strchr(cp, '/');
19651 -                       if (q)
19652 -                               cl = q - cp;
19653 -                       else
19654 -                               cl = strlen(cp);
19655 -                       ++dmatch;
19656 -                       break;
19657 -               case OF_DT_END_NODE:
19658 -                       if (depth == 0)
19659 -                               return NULL;
19660 -                       if (dmatch > depth) {
19661 -                               --dmatch;
19662 -                               cl = cp - path_comp[dmatch] - 1;
19663 -                               cp = path_comp[dmatch];
19664 -                               while (cl > 0 && cp[cl - 1] == '/')
19665 -                                       --cl;
19666 -                       }
19667 -                       --depth;
19668 -                       break;
19669 -               }
19670 -       }
19671 -       return NULL;
19672 -}
19673 -
19674 -void *__ft_get_parent(struct ft_cxt *cxt, void *node)
19675 -{
19676 -       int d;
19677 -       struct ft_atom atom;
19678 -       char *p;
19679 -
19680 -       for (d = 0; cxt->genealogy[d] != NULL; ++d)
19681 -               if (cxt->genealogy[d] == node)
19682 -                       return d > 0 ? cxt->genealogy[d - 1] : NULL;
19683 -
19684 -       /* have to do it the hard way... */
19685 -       p = ft_root_node(cxt);
19686 -       d = 0;
19687 -       while ((p = ft_next(cxt, p, &atom)) != NULL) {
19688 -               switch (atom.tag) {
19689 -               case OF_DT_BEGIN_NODE:
19690 -                       cxt->genealogy[d] = atom.data;
19691 -                       if (node == atom.data) {
19692 -                               /* found it */
19693 -                               cxt->genealogy[d + 1] = NULL;
19694 -                               return d > 0 ? cxt->genealogy[d - 1] : NULL;
19695 -                       }
19696 -                       ++d;
19697 -                       break;
19698 -               case OF_DT_END_NODE:
19699 -                       --d;
19700 -                       break;
19701 -               }
19702 -       }
19703 -       return NULL;
19704 -}
19705 -
19706 -void *ft_get_parent(struct ft_cxt *cxt, const void *phandle)
19707 -{
19708 -       void *node = ft_node_ph2node(cxt, phandle);
19709 -       if (node == NULL)
19710 -               return NULL;
19711 -
19712 -       node = __ft_get_parent(cxt, node);
19713 -       return ft_get_phandle(cxt, node);
19714 -}
19715 -
19716 -static const void *__ft_get_prop(struct ft_cxt *cxt, void *node,
19717 -                                 const char *propname, unsigned int *len)
19718 -{
19719 -       struct ft_atom atom;
19720 -       int depth = 0;
19721 -
19722 -       while ((node = ft_next(cxt, node, &atom)) != NULL) {
19723 -               switch (atom.tag) {
19724 -               case OF_DT_BEGIN_NODE:
19725 -                       ++depth;
19726 -                       break;
19727 -
19728 -               case OF_DT_PROP:
19729 -                       if (depth != 1 || strcmp(atom.name, propname))
19730 -                               break;
19731 -
19732 -                       if (len)
19733 -                               *len = atom.size;
19734 -
19735 -                       return atom.data;
19736 -
19737 -               case OF_DT_END_NODE:
19738 -                       if (--depth <= 0)
19739 -                               return NULL;
19740 -               }
19741 -       }
19742 -
19743 -       return NULL;
19744 -}
19745 -
19746 -int ft_get_prop(struct ft_cxt *cxt, const void *phandle, const char *propname,
19747 -               void *buf, const unsigned int buflen)
19748 -{
19749 -       const void *data;
19750 -       unsigned int size;
19751 -
19752 -       void *node = ft_node_ph2node(cxt, phandle);
19753 -       if (!node)
19754 -               return -1;
19755 -
19756 -       data = __ft_get_prop(cxt, node, propname, &size);
19757 -       if (data) {
19758 -               unsigned int clipped_size = min(size, buflen);
19759 -               memcpy(buf, data, clipped_size);
19760 -               return size;
19761 -       }
19762 -
19763 -       return -1;
19764 -}
19765 -
19766 -void *__ft_find_node_by_prop_value(struct ft_cxt *cxt, void *prev,
19767 -                                   const char *propname, const char *propval,
19768 -                                   unsigned int proplen)
19769 -{
19770 -       struct ft_atom atom;
19771 -       char *p = ft_root_node(cxt);
19772 -       char *next;
19773 -       int past_prev = prev ? 0 : 1;
19774 -       int depth = -1;
19775 -
19776 -       while ((next = ft_next(cxt, p, &atom)) != NULL) {
19777 -               const void *data;
19778 -               unsigned int size;
19779 -
19780 -               switch (atom.tag) {
19781 -               case OF_DT_BEGIN_NODE:
19782 -                       depth++;
19783 -
19784 -                       if (prev == p) {
19785 -                               past_prev = 1;
19786 -                               break;
19787 -                       }
19788 -
19789 -                       if (!past_prev || depth < 1)
19790 -                               break;
19791 -
19792 -                       data = __ft_get_prop(cxt, p, propname, &size);
19793 -                       if (!data || size != proplen)
19794 -                               break;
19795 -                       if (memcmp(data, propval, size))
19796 -                               break;
19797 -
19798 -                       return p;
19799 -
19800 -               case OF_DT_END_NODE:
19801 -                       if (depth-- == 0)
19802 -                               return NULL;
19803 -
19804 -                       break;
19805 -               }
19806 -
19807 -               p = next;
19808 -       }
19809 -
19810 -       return NULL;
19811 -}
19812 -
19813 -void *ft_find_node_by_prop_value(struct ft_cxt *cxt, const void *prev,
19814 -                                 const char *propname, const char *propval,
19815 -                                 int proplen)
19816 -{
19817 -       void *node = NULL;
19818 -
19819 -       if (prev) {
19820 -               node = ft_node_ph2node(cxt, prev);
19821 -
19822 -               if (!node)
19823 -                       return NULL;
19824 -       }
19825 -
19826 -       node = __ft_find_node_by_prop_value(cxt, node, propname,
19827 -                                           propval, proplen);
19828 -       return ft_get_phandle(cxt, node);
19829 -}
19830 -
19831 -int ft_set_prop(struct ft_cxt *cxt, const void *phandle, const char *propname,
19832 -               const void *buf, const unsigned int buflen)
19833 -{
19834 -       struct ft_atom atom;
19835 -       void *node;
19836 -       char *p, *next;
19837 -       int nextra;
19838 -
19839 -       node = ft_node_ph2node(cxt, phandle);
19840 -       if (node == NULL)
19841 -               return -1;
19842 -
19843 -       next = ft_next(cxt, node, &atom);
19844 -       if (atom.tag != OF_DT_BEGIN_NODE)
19845 -               /* phandle didn't point to a node */
19846 -               return -1;
19847 -       p = next;
19848 -
19849 -       while ((next = ft_next(cxt, p, &atom)) != NULL) {
19850 -               switch (atom.tag) {
19851 -               case OF_DT_BEGIN_NODE: /* properties must go before subnodes */
19852 -               case OF_DT_END_NODE:
19853 -                       /* haven't found the property, insert here */
19854 -                       cxt->p = p;
19855 -                       return ft_prop(cxt, propname, buf, buflen);
19856 -               case OF_DT_PROP:
19857 -                       if (strcmp(atom.name, propname))
19858 -                               break;
19859 -                       /* found an existing property, overwrite it */
19860 -                       nextra = _ALIGN(buflen, 4) - _ALIGN(atom.size, 4);
19861 -                       cxt->p = atom.data;
19862 -                       if (nextra && !ft_make_space(cxt, &cxt->p, FT_STRUCT,
19863 -                                               nextra))
19864 -                               return -1;
19865 -                       *(u32 *) (cxt->p - 8) = cpu_to_be32(buflen);
19866 -                       ft_put_bin(cxt, buf, buflen);
19867 -                       return 0;
19868 -               }
19869 -               p = next;
19870 -       }
19871 -       return -1;
19872 -}
19873 -
19874 -int ft_del_prop(struct ft_cxt *cxt, const void *phandle, const char *propname)
19875 -{
19876 -       struct ft_atom atom;
19877 -       void *node;
19878 -       char *p, *next;
19879 -       int size;
19880 -
19881 -       node = ft_node_ph2node(cxt, phandle);
19882 -       if (node == NULL)
19883 -               return -1;
19884 -
19885 -       p = node;
19886 -       while ((next = ft_next(cxt, p, &atom)) != NULL) {
19887 -               switch (atom.tag) {
19888 -               case OF_DT_BEGIN_NODE:
19889 -               case OF_DT_END_NODE:
19890 -                       return -1;
19891 -               case OF_DT_PROP:
19892 -                       if (strcmp(atom.name, propname))
19893 -                               break;
19894 -                       /* found the property, remove it */
19895 -                       size = 12 + -_ALIGN(atom.size, 4);
19896 -                       cxt->p = p;
19897 -                       if (!ft_make_space(cxt, &cxt->p, FT_STRUCT, -size))
19898 -                               return -1;
19899 -                       return 0;
19900 -               }
19901 -               p = next;
19902 -       }
19903 -       return -1;
19904 -}
19905 -
19906 -void *ft_create_node(struct ft_cxt *cxt, const void *parent, const char *name)
19907 -{
19908 -       struct ft_atom atom;
19909 -       char *p, *next, *ret;
19910 -       int depth = 0;
19911 -
19912 -       if (parent) {
19913 -               p = ft_node_ph2node(cxt, parent);
19914 -               if (!p)
19915 -                       return NULL;
19916 -       } else {
19917 -               p = ft_root_node(cxt);
19918 -       }
19919 -
19920 -       while ((next = ft_next(cxt, p, &atom)) != NULL) {
19921 -               switch (atom.tag) {
19922 -               case OF_DT_BEGIN_NODE:
19923 -                       ++depth;
19924 -                       if (depth == 1 && strcmp(atom.name, name) == 0)
19925 -                               /* duplicate node name, return error */
19926 -                               return NULL;
19927 -                       break;
19928 -               case OF_DT_END_NODE:
19929 -                       --depth;
19930 -                       if (depth > 0)
19931 -                               break;
19932 -                       /* end of node, insert here */
19933 -                       cxt->p = p;
19934 -                       ret = ft_begin_node(cxt, name);
19935 -                       ft_end_node(cxt);
19936 -                       return ft_get_phandle(cxt, ret);
19937 -               }
19938 -               p = next;
19939 -       }
19940 -       return NULL;
19941 -}
19942 -
19943 -/* Returns the start of the path within the provided buffer, or NULL on
19944 - * error.
19945 - */
19946 -char *ft_get_path(struct ft_cxt *cxt, const void *phandle,
19947 -                  char *buf, int len)
19948 -{
19949 -       const char *path_comp[FT_MAX_DEPTH];
19950 -       struct ft_atom atom;
19951 -       char *p, *next, *pos;
19952 -       int depth = 0, i;
19953 -       void *node;
19954 -
19955 -       node = ft_node_ph2node(cxt, phandle);
19956 -       if (node == NULL)
19957 -               return NULL;
19958 -
19959 -       p = ft_root_node(cxt);
19960 -
19961 -       while ((next = ft_next(cxt, p, &atom)) != NULL) {
19962 -               switch (atom.tag) {
19963 -               case OF_DT_BEGIN_NODE:
19964 -                       path_comp[depth++] = atom.name;
19965 -                       if (p == node)
19966 -                               goto found;
19967 -
19968 -                       break;
19969 -
19970 -               case OF_DT_END_NODE:
19971 -                       if (--depth == 0)
19972 -                               return NULL;
19973 -               }
19974 -
19975 -               p = next;
19976 -       }
19977 -
19978 -found:
19979 -       pos = buf;
19980 -       for (i = 1; i < depth; i++) {
19981 -               int this_len;
19982 -
19983 -               if (len <= 1)
19984 -                       return NULL;
19985 -
19986 -               *pos++ = '/';
19987 -               len--;
19988 -
19989 -               strncpy(pos, path_comp[i], len);
19990 -
19991 -               if (pos[len - 1] != 0)
19992 -                       return NULL;
19993 -
19994 -               this_len = strlen(pos);
19995 -               len -= this_len;
19996 -               pos += this_len;
19997 -       }
19998 -
19999 -       return buf;
20000 -}
20001 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/flatdevtree.h powerpc.git/arch/powerpc/boot/flatdevtree.h
20002 --- linux-2.6.24/arch/powerpc/boot/flatdevtree.h        2008-01-24 23:58:37.000000000 +0100
20003 +++ powerpc.git/arch/powerpc/boot/flatdevtree.h 1970-01-01 01:00:00.000000000 +0100
20004 @@ -1,113 +0,0 @@
20005 -/*
20006 - * This program is free software; you can redistribute it and/or modify
20007 - * it under the terms of the GNU General Public License as published by
20008 - * the Free Software Foundation; either version 2 of the License, or
20009 - * (at your option) any later version.
20010 - *
20011 - * This program is distributed in the hope that it will be useful,
20012 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
20013 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20014 - * GNU General Public License for more details.
20015 - *
20016 - * You should have received a copy of the GNU General Public License
20017 - * along with this program; if not, write to the Free Software
20018 - * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20019 - */
20020 -
20021 -#ifndef FLATDEVTREE_H
20022 -#define FLATDEVTREE_H
20023 -
20024 -#include "flatdevtree_env.h"
20025 -
20026 -/* Definitions used by the flattened device tree */
20027 -#define OF_DT_HEADER            0xd00dfeed      /* marker */
20028 -#define OF_DT_BEGIN_NODE        0x1     /* Start of node, full name */
20029 -#define OF_DT_END_NODE          0x2     /* End node */
20030 -#define OF_DT_PROP              0x3     /* Property: name off, size, content */
20031 -#define OF_DT_NOP               0x4     /* nop */
20032 -#define OF_DT_END               0x9
20033 -
20034 -#define OF_DT_VERSION           0x10
20035 -
20036 -struct boot_param_header {
20037 -       u32 magic;              /* magic word OF_DT_HEADER */
20038 -       u32 totalsize;          /* total size of DT block */
20039 -       u32 off_dt_struct;      /* offset to structure */
20040 -       u32 off_dt_strings;     /* offset to strings */
20041 -       u32 off_mem_rsvmap;     /* offset to memory reserve map */
20042 -       u32 version;            /* format version */
20043 -       u32 last_comp_version;  /* last compatible version */
20044 -       /* version 2 fields below */
20045 -       u32 boot_cpuid_phys;    /* Physical CPU id we're booting on */
20046 -       /* version 3 fields below */
20047 -       u32 dt_strings_size;    /* size of the DT strings block */
20048 -};
20049 -
20050 -struct ft_reserve {
20051 -       u64 start;
20052 -       u64 len;
20053 -};
20054 -
20055 -struct ft_region {
20056 -       char *start;
20057 -       unsigned long size;
20058 -};
20059 -
20060 -enum ft_rgn_id {
20061 -       FT_RSVMAP,
20062 -       FT_STRUCT,
20063 -       FT_STRINGS,
20064 -       FT_N_REGION
20065 -};
20066 -
20067 -#define FT_MAX_DEPTH   50
20068 -
20069 -struct ft_cxt {
20070 -       struct boot_param_header *bph;
20071 -       int max_size;           /* maximum size of tree */
20072 -       int isordered;          /* everything in standard order */
20073 -       void *(*realloc)(void *, unsigned long);
20074 -       char *str_anchor;
20075 -       char *p;                /* current insertion point in structs */
20076 -       struct ft_region rgn[FT_N_REGION];
20077 -       void *genealogy[FT_MAX_DEPTH+1];
20078 -       char **node_tbl;
20079 -       unsigned int node_max;
20080 -       unsigned int nodes_used;
20081 -};
20082 -
20083 -char *ft_begin_node(struct ft_cxt *cxt, const char *name);
20084 -void ft_end_node(struct ft_cxt *cxt);
20085 -
20086 -void ft_begin_tree(struct ft_cxt *cxt);
20087 -void ft_end_tree(struct ft_cxt *cxt);
20088 -
20089 -void ft_nop(struct ft_cxt *cxt);
20090 -int ft_prop(struct ft_cxt *cxt, const char *name,
20091 -           const void *data, unsigned int sz);
20092 -int ft_prop_str(struct ft_cxt *cxt, const char *name, const char *str);
20093 -int ft_prop_int(struct ft_cxt *cxt, const char *name, unsigned int val);
20094 -void ft_begin(struct ft_cxt *cxt, void *blob, unsigned int max_size,
20095 -             void *(*realloc_fn)(void *, unsigned long));
20096 -int ft_open(struct ft_cxt *cxt, void *blob, unsigned int max_size,
20097 -               unsigned int max_find_device,
20098 -               void *(*realloc_fn)(void *, unsigned long));
20099 -int ft_add_rsvmap(struct ft_cxt *cxt, u64 physaddr, u64 size);
20100 -
20101 -void ft_dump_blob(const void *bphp);
20102 -void ft_merge_blob(struct ft_cxt *cxt, void *blob);
20103 -void *ft_find_device(struct ft_cxt *cxt, const void *top,
20104 -                     const char *srch_path);
20105 -void *ft_find_descendent(struct ft_cxt *cxt, void *top, const char *srch_path);
20106 -int ft_get_prop(struct ft_cxt *cxt, const void *phandle, const char *propname,
20107 -               void *buf, const unsigned int buflen);
20108 -int ft_set_prop(struct ft_cxt *cxt, const void *phandle, const char *propname,
20109 -               const void *buf, const unsigned int buflen);
20110 -void *ft_get_parent(struct ft_cxt *cxt, const void *phandle);
20111 -void *ft_find_node_by_prop_value(struct ft_cxt *cxt, const void *prev,
20112 -                                 const char *propname, const char *propval,
20113 -                                 int proplen);
20114 -void *ft_create_node(struct ft_cxt *cxt, const void *parent, const char *name);
20115 -char *ft_get_path(struct ft_cxt *cxt, const void *phandle, char *buf, int len);
20116 -
20117 -#endif /* FLATDEVTREE_H */
20118 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/flatdevtree_misc.c powerpc.git/arch/powerpc/boot/flatdevtree_misc.c
20119 --- linux-2.6.24/arch/powerpc/boot/flatdevtree_misc.c   2008-01-24 23:58:37.000000000 +0100
20120 +++ powerpc.git/arch/powerpc/boot/flatdevtree_misc.c    1970-01-01 01:00:00.000000000 +0100
20121 @@ -1,79 +0,0 @@
20122 -/*
20123 - * This file does the necessary interface mapping between the bootwrapper
20124 - * device tree operations and the interface provided by shared source
20125 - * files flatdevicetree.[ch].
20126 - *
20127 - * Author: Mark A. Greer <mgreer@mvista.com>
20128 - *
20129 - * 2006 (c) MontaVista Software, Inc.  This file is licensed under
20130 - * the terms of the GNU General Public License version 2.  This program
20131 - * is licensed "as is" without any warranty of any kind, whether express
20132 - * or implied.
20133 - */
20134 -#include <stddef.h>
20135 -#include "flatdevtree.h"
20136 -#include "ops.h"
20137 -
20138 -static struct ft_cxt cxt;
20139 -
20140 -static void *fdtm_finddevice(const char *name)
20141 -{
20142 -       return ft_find_device(&cxt, NULL, name);
20143 -}
20144 -
20145 -static int fdtm_getprop(const void *phandle, const char *propname,
20146 -                        void *buf, const int buflen)
20147 -{
20148 -       return ft_get_prop(&cxt, phandle, propname, buf, buflen);
20149 -}
20150 -
20151 -static int fdtm_setprop(const void *phandle, const char *propname,
20152 -                        const void *buf, const int buflen)
20153 -{
20154 -       return ft_set_prop(&cxt, phandle, propname, buf, buflen);
20155 -}
20156 -
20157 -static void *fdtm_get_parent(const void *phandle)
20158 -{
20159 -       return ft_get_parent(&cxt, phandle);
20160 -}
20161 -
20162 -static void *fdtm_create_node(const void *phandle, const char *name)
20163 -{
20164 -       return ft_create_node(&cxt, phandle, name);
20165 -}
20166 -
20167 -static void *fdtm_find_node_by_prop_value(const void *prev,
20168 -                                          const char *propname,
20169 -                                          const char *propval,
20170 -                                          int proplen)
20171 -{
20172 -       return ft_find_node_by_prop_value(&cxt, prev, propname,
20173 -                                         propval, proplen);
20174 -}
20175 -
20176 -static unsigned long fdtm_finalize(void)
20177 -{
20178 -       ft_end_tree(&cxt);
20179 -       return (unsigned long)cxt.bph;
20180 -}
20181 -
20182 -static char *fdtm_get_path(const void *phandle, char *buf, int len)
20183 -{
20184 -       return ft_get_path(&cxt, phandle, buf, len);
20185 -}
20186 -
20187 -int ft_init(void *dt_blob, unsigned int max_size, unsigned int max_find_device)
20188 -{
20189 -       dt_ops.finddevice = fdtm_finddevice;
20190 -       dt_ops.getprop = fdtm_getprop;
20191 -       dt_ops.setprop = fdtm_setprop;
20192 -       dt_ops.get_parent = fdtm_get_parent;
20193 -       dt_ops.create_node = fdtm_create_node;
20194 -       dt_ops.find_node_by_prop_value = fdtm_find_node_by_prop_value;
20195 -       dt_ops.finalize = fdtm_finalize;
20196 -       dt_ops.get_path = fdtm_get_path;
20197 -
20198 -       return ft_open(&cxt, dt_blob, max_size, max_find_device,
20199 -                       platform_ops.realloc);
20200 -}
20201 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/holly.c powerpc.git/arch/powerpc/boot/holly.c
20202 --- linux-2.6.24/arch/powerpc/boot/holly.c      2008-01-24 23:58:37.000000000 +0100
20203 +++ powerpc.git/arch/powerpc/boot/holly.c       2008-01-28 20:25:49.000000000 +0100
20204 @@ -28,6 +28,6 @@
20205         u32 heapsize = 0x8000000 - (u32)_end; /* 128M */
20206  
20207         simple_alloc_init(_end, heapsize, 32, 64);
20208 -       ft_init(_dtb_start, 0, 4);
20209 +       fdt_init(_dtb_start);
20210         serial_console_init();
20211  }
20212 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/libfdt/Makefile.libfdt powerpc.git/arch/powerpc/boot/libfdt/Makefile.libfdt
20213 --- linux-2.6.24/arch/powerpc/boot/libfdt/Makefile.libfdt       1970-01-01 01:00:00.000000000 +0100
20214 +++ powerpc.git/arch/powerpc/boot/libfdt/Makefile.libfdt        2008-01-28 20:25:49.000000000 +0100
20215 @@ -0,0 +1,14 @@
20216 +# Makefile.libfdt
20217 +#
20218 +# This is not a complete Makefile of itself.  Instead, it is designed to
20219 +# be easily embeddable into other systems of Makefiles.
20220 +#
20221 +LIBFDT_SRCS = fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c
20222 +LIBFDT_INCLUDES = fdt.h libfdt.h
20223 +LIBFDT_EXTRA = libfdt_internal.h
20224 +LIBFDT_LIB = libfdt/libfdt.a
20225 +
20226 +LIBFDT_OBJS = $(LIBFDT_SRCS:%.c=%.o)
20227 +
20228 +$(LIBFDT_objdir)/$(LIBFDT_LIB): $(addprefix $(LIBFDT_objdir)/,$(LIBFDT_OBJS))
20229 +
20230 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/libfdt/fdt.c powerpc.git/arch/powerpc/boot/libfdt/fdt.c
20231 --- linux-2.6.24/arch/powerpc/boot/libfdt/fdt.c 1970-01-01 01:00:00.000000000 +0100
20232 +++ powerpc.git/arch/powerpc/boot/libfdt/fdt.c  2008-01-28 20:25:49.000000000 +0100
20233 @@ -0,0 +1,156 @@
20234 +/*
20235 + * libfdt - Flat Device Tree manipulation
20236 + * Copyright (C) 2006 David Gibson, IBM Corporation.
20237 + *
20238 + * libfdt is dual licensed: you can use it either under the terms of
20239 + * the GPL, or the BSD license, at your option.
20240 + *
20241 + *  a) This library is free software; you can redistribute it and/or
20242 + *     modify it under the terms of the GNU General Public License as
20243 + *     published by the Free Software Foundation; either version 2 of the
20244 + *     License, or (at your option) any later version.
20245 + *
20246 + *     This library is distributed in the hope that it will be useful,
20247 + *     but WITHOUT ANY WARRANTY; without even the implied warranty of
20248 + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20249 + *     GNU General Public License for more details.
20250 + *
20251 + *     You should have received a copy of the GNU General Public
20252 + *     License along with this library; if not, write to the Free
20253 + *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
20254 + *     MA 02110-1301 USA
20255 + *
20256 + * Alternatively,
20257 + *
20258 + *  b) Redistribution and use in source and binary forms, with or
20259 + *     without modification, are permitted provided that the following
20260 + *     conditions are met:
20261 + *
20262 + *     1. Redistributions of source code must retain the above
20263 + *        copyright notice, this list of conditions and the following
20264 + *        disclaimer.
20265 + *     2. Redistributions in binary form must reproduce the above
20266 + *        copyright notice, this list of conditions and the following
20267 + *        disclaimer in the documentation and/or other materials
20268 + *        provided with the distribution.
20269 + *
20270 + *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
20271 + *     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
20272 + *     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
20273 + *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20274 + *     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20275 + *     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20276 + *     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20277 + *     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20278 + *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20279 + *     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
20280 + *     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
20281 + *     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
20282 + *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
20283 + */
20284 +#include "libfdt_env.h"
20285 +
20286 +#include <fdt.h>
20287 +#include <libfdt.h>
20288 +
20289 +#include "libfdt_internal.h"
20290 +
20291 +int fdt_check_header(const void *fdt)
20292 +{
20293 +       if (fdt_magic(fdt) == FDT_MAGIC) {
20294 +               /* Complete tree */
20295 +               if (fdt_version(fdt) < FDT_FIRST_SUPPORTED_VERSION)
20296 +                       return -FDT_ERR_BADVERSION;
20297 +               if (fdt_last_comp_version(fdt) > FDT_LAST_SUPPORTED_VERSION)
20298 +                       return -FDT_ERR_BADVERSION;
20299 +       } else if (fdt_magic(fdt) == SW_MAGIC) {
20300 +               /* Unfinished sequential-write blob */
20301 +               if (fdt_size_dt_struct(fdt) == 0)
20302 +                       return -FDT_ERR_BADSTATE;
20303 +       } else {
20304 +               return -FDT_ERR_BADMAGIC;
20305 +       }
20306 +
20307 +       return 0;
20308 +}
20309 +
20310 +const void *fdt_offset_ptr(const void *fdt, int offset, int len)
20311 +{
20312 +       const void *p;
20313 +
20314 +       if (fdt_version(fdt) >= 0x11)
20315 +               if (((offset + len) < offset)
20316 +                   || ((offset + len) > fdt_size_dt_struct(fdt)))
20317 +                       return NULL;
20318 +
20319 +       p = _fdt_offset_ptr(fdt, offset);
20320 +
20321 +       if (p + len < p)
20322 +               return NULL;
20323 +       return p;
20324 +}
20325 +
20326 +uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset)
20327 +{
20328 +       const uint32_t *tagp, *lenp;
20329 +       uint32_t tag;
20330 +       const char *p;
20331 +
20332 +       if (offset % FDT_TAGSIZE)
20333 +               return -1;
20334 +
20335 +       tagp = fdt_offset_ptr(fdt, offset, FDT_TAGSIZE);
20336 +       if (! tagp)
20337 +               return FDT_END; /* premature end */
20338 +       tag = fdt32_to_cpu(*tagp);
20339 +       offset += FDT_TAGSIZE;
20340 +
20341 +       switch (tag) {
20342 +       case FDT_BEGIN_NODE:
20343 +               /* skip name */
20344 +               do {
20345 +                       p = fdt_offset_ptr(fdt, offset++, 1);
20346 +               } while (p && (*p != '\0'));
20347 +               if (! p)
20348 +                       return FDT_END;
20349 +               break;
20350 +       case FDT_PROP:
20351 +               lenp = fdt_offset_ptr(fdt, offset, sizeof(*lenp));
20352 +               if (! lenp)
20353 +                       return FDT_END;
20354 +               /* skip name offset, length and value */
20355 +               offset += 2*FDT_TAGSIZE + fdt32_to_cpu(*lenp);
20356 +               break;
20357 +       }
20358 +
20359 +       if (nextoffset)
20360 +               *nextoffset = ALIGN(offset, FDT_TAGSIZE);
20361 +
20362 +       return tag;
20363 +}
20364 +
20365 +const char *_fdt_find_string(const char *strtab, int tabsize, const char *s)
20366 +{
20367 +       int len = strlen(s) + 1;
20368 +       const char *last = strtab + tabsize - len;
20369 +       const char *p;
20370 +
20371 +       for (p = strtab; p <= last; p++)
20372 +               if (memeq(p, s, len))
20373 +                       return p;
20374 +       return NULL;
20375 +}
20376 +
20377 +int fdt_move(const void *fdt, void *buf, int bufsize)
20378 +{
20379 +       int err = fdt_check_header(fdt);
20380 +
20381 +       if (err)
20382 +               return err;
20383 +
20384 +       if (fdt_totalsize(fdt) > bufsize)
20385 +               return -FDT_ERR_NOSPACE;
20386 +
20387 +       memmove(buf, fdt, fdt_totalsize(fdt));
20388 +       return 0;
20389 +}
20390 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/libfdt/fdt.h powerpc.git/arch/powerpc/boot/libfdt/fdt.h
20391 --- linux-2.6.24/arch/powerpc/boot/libfdt/fdt.h 1970-01-01 01:00:00.000000000 +0100
20392 +++ powerpc.git/arch/powerpc/boot/libfdt/fdt.h  2008-01-28 20:25:49.000000000 +0100
20393 @@ -0,0 +1,60 @@
20394 +#ifndef _FDT_H
20395 +#define _FDT_H
20396 +
20397 +#ifndef __ASSEMBLY__
20398 +
20399 +struct fdt_header {
20400 +       uint32_t magic;                  /* magic word FDT_MAGIC */
20401 +       uint32_t totalsize;              /* total size of DT block */
20402 +       uint32_t off_dt_struct;          /* offset to structure */
20403 +       uint32_t off_dt_strings;         /* offset to strings */
20404 +       uint32_t off_mem_rsvmap;         /* offset to memory reserve map */
20405 +       uint32_t version;                /* format version */
20406 +       uint32_t last_comp_version;      /* last compatible version */
20407 +
20408 +       /* version 2 fields below */
20409 +       uint32_t boot_cpuid_phys;        /* Which physical CPU id we're
20410 +                                           booting on */
20411 +       /* version 3 fields below */
20412 +       uint32_t size_dt_strings;        /* size of the strings block */
20413 +
20414 +       /* version 17 fields below */
20415 +       uint32_t size_dt_struct;         /* size of the structure block */
20416 +};
20417 +
20418 +struct fdt_reserve_entry {
20419 +       uint64_t address;
20420 +       uint64_t size;
20421 +};
20422 +
20423 +struct fdt_node_header {
20424 +       uint32_t tag;
20425 +       char name[0];
20426 +};
20427 +
20428 +struct fdt_property {
20429 +       uint32_t tag;
20430 +       uint32_t len;
20431 +       uint32_t nameoff;
20432 +       char data[0];
20433 +};
20434 +
20435 +#endif /* !__ASSEMBLY */
20436 +
20437 +#define FDT_MAGIC      0xd00dfeed      /* 4: version, 4: total size */
20438 +#define FDT_TAGSIZE    sizeof(uint32_t)
20439 +
20440 +#define FDT_BEGIN_NODE 0x1             /* Start node: full name */
20441 +#define FDT_END_NODE   0x2             /* End node */
20442 +#define FDT_PROP       0x3             /* Property: name off,
20443 +                                          size, content */
20444 +#define FDT_NOP                0x4             /* nop */
20445 +#define FDT_END                0x9
20446 +
20447 +#define FDT_V1_SIZE    (7*sizeof(uint32_t))
20448 +#define FDT_V2_SIZE    (FDT_V1_SIZE + sizeof(uint32_t))
20449 +#define FDT_V3_SIZE    (FDT_V2_SIZE + sizeof(uint32_t))
20450 +#define FDT_V16_SIZE   FDT_V3_SIZE
20451 +#define FDT_V17_SIZE   (FDT_V16_SIZE + sizeof(uint32_t))
20452 +
20453 +#endif /* _FDT_H */
20454 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/libfdt/fdt_ro.c powerpc.git/arch/powerpc/boot/libfdt/fdt_ro.c
20455 --- linux-2.6.24/arch/powerpc/boot/libfdt/fdt_ro.c      1970-01-01 01:00:00.000000000 +0100
20456 +++ powerpc.git/arch/powerpc/boot/libfdt/fdt_ro.c       2008-01-28 20:25:49.000000000 +0100
20457 @@ -0,0 +1,583 @@
20458 +/*
20459 + * libfdt - Flat Device Tree manipulation
20460 + * Copyright (C) 2006 David Gibson, IBM Corporation.
20461 + *
20462 + * libfdt is dual licensed: you can use it either under the terms of
20463 + * the GPL, or the BSD license, at your option.
20464 + *
20465 + *  a) This library is free software; you can redistribute it and/or
20466 + *     modify it under the terms of the GNU General Public License as
20467 + *     published by the Free Software Foundation; either version 2 of the
20468 + *     License, or (at your option) any later version.
20469 + *
20470 + *     This library is distributed in the hope that it will be useful,
20471 + *     but WITHOUT ANY WARRANTY; without even the implied warranty of
20472 + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20473 + *     GNU General Public License for more details.
20474 + *
20475 + *     You should have received a copy of the GNU General Public
20476 + *     License along with this library; if not, write to the Free
20477 + *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
20478 + *     MA 02110-1301 USA
20479 + *
20480 + * Alternatively,
20481 + *
20482 + *  b) Redistribution and use in source and binary forms, with or
20483 + *     without modification, are permitted provided that the following
20484 + *     conditions are met:
20485 + *
20486 + *     1. Redistributions of source code must retain the above
20487 + *        copyright notice, this list of conditions and the following
20488 + *        disclaimer.
20489 + *     2. Redistributions in binary form must reproduce the above
20490 + *        copyright notice, this list of conditions and the following
20491 + *        disclaimer in the documentation and/or other materials
20492 + *        provided with the distribution.
20493 + *
20494 + *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
20495 + *     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
20496 + *     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
20497 + *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20498 + *     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20499 + *     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20500 + *     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20501 + *     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20502 + *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20503 + *     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
20504 + *     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
20505 + *     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
20506 + *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
20507 + */
20508 +#include "libfdt_env.h"
20509 +
20510 +#include <fdt.h>
20511 +#include <libfdt.h>
20512 +
20513 +#include "libfdt_internal.h"
20514 +
20515 +#define CHECK_HEADER(fdt) \
20516 +       { \
20517 +               int err; \
20518 +               if ((err = fdt_check_header(fdt)) != 0) \
20519 +                       return err; \
20520 +       }
20521 +
20522 +static int nodename_eq(const void *fdt, int offset,
20523 +                      const char *s, int len)
20524 +{
20525 +       const char *p = fdt_offset_ptr(fdt, offset, len+1);
20526 +
20527 +       if (! p)
20528 +               /* short match */
20529 +               return 0;
20530 +
20531 +       if (memcmp(p, s, len) != 0)
20532 +               return 0;
20533 +
20534 +       if (p[len] == '\0')
20535 +               return 1;
20536 +       else if (!memchr(s, '@', len) && (p[len] == '@'))
20537 +               return 1;
20538 +       else
20539 +               return 0;
20540 +}
20541 +
20542 +const char *fdt_string(const void *fdt, int stroffset)
20543 +{
20544 +       return (char *)fdt + fdt_off_dt_strings(fdt) + stroffset;
20545 +}
20546 +
20547 +int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size)
20548 +{
20549 +       CHECK_HEADER(fdt);
20550 +       *address = fdt64_to_cpu(_fdt_mem_rsv(fdt, n)->address);
20551 +       *size = fdt64_to_cpu(_fdt_mem_rsv(fdt, n)->size);
20552 +       return 0;
20553 +}
20554 +
20555 +int fdt_num_mem_rsv(const void *fdt)
20556 +{
20557 +       int i = 0;
20558 +
20559 +       while (fdt64_to_cpu(_fdt_mem_rsv(fdt, i)->size) != 0)
20560 +               i++;
20561 +       return i;
20562 +}
20563 +
20564 +int fdt_subnode_offset_namelen(const void *fdt, int parentoffset,
20565 +                              const char *name, int namelen)
20566 +{
20567 +       int level = 0;
20568 +       uint32_t tag;
20569 +       int offset, nextoffset;
20570 +
20571 +       CHECK_HEADER(fdt);
20572 +
20573 +       tag = fdt_next_tag(fdt, parentoffset, &nextoffset);
20574 +       if (tag != FDT_BEGIN_NODE)
20575 +               return -FDT_ERR_BADOFFSET;
20576 +
20577 +       do {
20578 +               offset = nextoffset;
20579 +               tag = fdt_next_tag(fdt, offset, &nextoffset);
20580 +
20581 +               switch (tag) {
20582 +               case FDT_END:
20583 +                       return -FDT_ERR_TRUNCATED;
20584 +
20585 +               case FDT_BEGIN_NODE:
20586 +                       level++;
20587 +                       if (level != 1)
20588 +                               continue;
20589 +                       if (nodename_eq(fdt, offset+FDT_TAGSIZE, name, namelen))
20590 +                               /* Found it! */
20591 +                               return offset;
20592 +                       break;
20593 +
20594 +               case FDT_END_NODE:
20595 +                       level--;
20596 +                       break;
20597 +
20598 +               case FDT_PROP:
20599 +               case FDT_NOP:
20600 +                       break;
20601 +
20602 +               default:
20603 +                       return -FDT_ERR_BADSTRUCTURE;
20604 +               }
20605 +       } while (level >= 0);
20606 +
20607 +       return -FDT_ERR_NOTFOUND;
20608 +}
20609 +
20610 +int fdt_subnode_offset(const void *fdt, int parentoffset,
20611 +                      const char *name)
20612 +{
20613 +       return fdt_subnode_offset_namelen(fdt, parentoffset, name, strlen(name));
20614 +}
20615 +
20616 +int fdt_path_offset(const void *fdt, const char *path)
20617 +{
20618 +       const char *end = path + strlen(path);
20619 +       const char *p = path;
20620 +       int offset = 0;
20621 +
20622 +       CHECK_HEADER(fdt);
20623 +
20624 +       if (*path != '/')
20625 +               return -FDT_ERR_BADPATH;
20626 +
20627 +       while (*p) {
20628 +               const char *q;
20629 +
20630 +               while (*p == '/')
20631 +                       p++;
20632 +               if (! *p)
20633 +                       return offset;
20634 +               q = strchr(p, '/');
20635 +               if (! q)
20636 +                       q = end;
20637 +
20638 +               offset = fdt_subnode_offset_namelen(fdt, offset, p, q-p);
20639 +               if (offset < 0)
20640 +                       return offset;
20641 +
20642 +               p = q;
20643 +       }
20644 +
20645 +       return offset;
20646 +}
20647 +
20648 +const char *fdt_get_name(const void *fdt, int nodeoffset, int *len)
20649 +{
20650 +       const struct fdt_node_header *nh;
20651 +       int err;
20652 +
20653 +       if ((err = fdt_check_header(fdt)) != 0)
20654 +               goto fail;
20655 +
20656 +       err = -FDT_ERR_BADOFFSET;
20657 +       nh = fdt_offset_ptr(fdt, nodeoffset, sizeof(*nh));
20658 +       if (!nh || (fdt32_to_cpu(nh->tag) != FDT_BEGIN_NODE))
20659 +               goto fail;
20660 +
20661 +       if (len)
20662 +               *len = strlen(nh->name);
20663 +
20664 +       return nh->name;
20665 +
20666 + fail:
20667 +       if (len)
20668 +               *len = err;
20669 +       return NULL;
20670 +}
20671 +
20672 +const struct fdt_property *fdt_get_property(const void *fdt,
20673 +                                           int nodeoffset,
20674 +                                           const char *name, int *lenp)
20675 +{
20676 +       uint32_t tag;
20677 +       const struct fdt_property *prop;
20678 +       int namestroff;
20679 +       int offset, nextoffset;
20680 +       int err;
20681 +
20682 +       if ((err = fdt_check_header(fdt)) != 0)
20683 +               goto fail;
20684 +
20685 +       err = -FDT_ERR_BADOFFSET;
20686 +       if (nodeoffset % FDT_TAGSIZE)
20687 +               goto fail;
20688 +
20689 +       tag = fdt_next_tag(fdt, nodeoffset, &nextoffset);
20690 +       if (tag != FDT_BEGIN_NODE)
20691 +               goto fail;
20692 +
20693 +       do {
20694 +               offset = nextoffset;
20695 +
20696 +               tag = fdt_next_tag(fdt, offset, &nextoffset);
20697 +               switch (tag) {
20698 +               case FDT_END:
20699 +                       err = -FDT_ERR_TRUNCATED;
20700 +                       goto fail;
20701 +
20702 +               case FDT_BEGIN_NODE:
20703 +               case FDT_END_NODE:
20704 +               case FDT_NOP:
20705 +                       break;
20706 +
20707 +               case FDT_PROP:
20708 +                       err = -FDT_ERR_BADSTRUCTURE;
20709 +                       prop = fdt_offset_ptr(fdt, offset, sizeof(*prop));
20710 +                       if (! prop)
20711 +                               goto fail;
20712 +                       namestroff = fdt32_to_cpu(prop->nameoff);
20713 +                       if (streq(fdt_string(fdt, namestroff), name)) {
20714 +                               /* Found it! */
20715 +                               int len = fdt32_to_cpu(prop->len);
20716 +                               prop = fdt_offset_ptr(fdt, offset,
20717 +                                                     sizeof(*prop)+len);
20718 +                               if (! prop)
20719 +                                       goto fail;
20720 +
20721 +                               if (lenp)
20722 +                                       *lenp = len;
20723 +
20724 +                               return prop;
20725 +                       }
20726 +                       break;
20727 +
20728 +               default:
20729 +                       err = -FDT_ERR_BADSTRUCTURE;
20730 +                       goto fail;
20731 +               }
20732 +       } while ((tag != FDT_BEGIN_NODE) && (tag != FDT_END_NODE));
20733 +
20734 +       err = -FDT_ERR_NOTFOUND;
20735 + fail:
20736 +       if (lenp)
20737 +               *lenp = err;
20738 +       return NULL;
20739 +}
20740 +
20741 +const void *fdt_getprop(const void *fdt, int nodeoffset,
20742 +                 const char *name, int *lenp)
20743 +{
20744 +       const struct fdt_property *prop;
20745 +
20746 +       prop = fdt_get_property(fdt, nodeoffset, name, lenp);
20747 +       if (! prop)
20748 +               return NULL;
20749 +
20750 +       return prop->data;
20751 +}
20752 +
20753 +uint32_t fdt_get_phandle(const void *fdt, int nodeoffset)
20754 +{
20755 +       const uint32_t *php;
20756 +       int len;
20757 +
20758 +       php = fdt_getprop(fdt, nodeoffset, "linux,phandle", &len);
20759 +       if (!php || (len != sizeof(*php)))
20760 +               return 0;
20761 +
20762 +       return fdt32_to_cpu(*php);
20763 +}
20764 +
20765 +int fdt_get_path(const void *fdt, int nodeoffset, char *buf, int buflen)
20766 +{
20767 +       uint32_t tag;
20768 +       int p = 0, overflow = 0;
20769 +       int offset, nextoffset, namelen;
20770 +       const char *name;
20771 +
20772 +       CHECK_HEADER(fdt);
20773 +
20774 +       tag = fdt_next_tag(fdt, 0, &nextoffset);
20775 +       if (tag != FDT_BEGIN_NODE)
20776 +               return -FDT_ERR_BADSTRUCTURE;
20777 +
20778 +       if (buflen < 2)
20779 +               return -FDT_ERR_NOSPACE;
20780 +       buf[0] = '/';
20781 +       p = 1;
20782 +
20783 +       while (nextoffset <= nodeoffset) {
20784 +               offset = nextoffset;
20785 +               tag = fdt_next_tag(fdt, offset, &nextoffset);
20786 +               switch (tag) {
20787 +               case FDT_END:
20788 +                       return -FDT_ERR_BADOFFSET;
20789 +
20790 +               case FDT_BEGIN_NODE:
20791 +                       name = fdt_get_name(fdt, offset, &namelen);
20792 +                       if (!name)
20793 +                               return namelen;
20794 +                       if (overflow || ((p + namelen + 1) > buflen)) {
20795 +                               overflow++;
20796 +                               break;
20797 +                       }
20798 +                       memcpy(buf + p, name, namelen);
20799 +                       p += namelen;
20800 +                       buf[p++] = '/';
20801 +                       break;
20802 +
20803 +               case FDT_END_NODE:
20804 +                       if (overflow) {
20805 +                               overflow--;
20806 +                               break;
20807 +                       }
20808 +                       do {
20809 +                               p--;
20810 +                       } while  (buf[p-1] != '/');
20811 +                       break;
20812 +
20813 +               case FDT_PROP:
20814 +               case FDT_NOP:
20815 +                       break;
20816 +
20817 +               default:
20818 +                       return -FDT_ERR_BADSTRUCTURE;
20819 +               }
20820 +       }
20821 +
20822 +       if (overflow)
20823 +               return -FDT_ERR_NOSPACE;
20824 +
20825 +       if (p > 1) /* special case so that root path is "/", not "" */
20826 +               p--;
20827 +       buf[p] = '\0';
20828 +       return p;
20829 +}
20830 +
20831 +int fdt_supernode_atdepth_offset(const void *fdt, int nodeoffset,
20832 +                                int supernodedepth, int *nodedepth)
20833 +{
20834 +       int level = -1;
20835 +       uint32_t tag;
20836 +       int offset, nextoffset = 0;
20837 +       int supernodeoffset = -FDT_ERR_INTERNAL;
20838 +
20839 +       CHECK_HEADER(fdt);
20840 +
20841 +       if (supernodedepth < 0)
20842 +               return -FDT_ERR_NOTFOUND;
20843 +
20844 +       do {
20845 +               offset = nextoffset;
20846 +               tag = fdt_next_tag(fdt, offset, &nextoffset);
20847 +               switch (tag) {
20848 +               case FDT_END:
20849 +                       return -FDT_ERR_BADOFFSET;
20850 +
20851 +               case FDT_BEGIN_NODE:
20852 +                       level++;
20853 +                       if (level == supernodedepth)
20854 +                               supernodeoffset = offset;
20855 +                       break;
20856 +
20857 +               case FDT_END_NODE:
20858 +                       level--;
20859 +                       break;
20860 +
20861 +               case FDT_PROP:
20862 +               case FDT_NOP:
20863 +                       break;
20864 +
20865 +               default:
20866 +                       return -FDT_ERR_BADSTRUCTURE;
20867 +               }
20868 +       } while (offset < nodeoffset);
20869 +
20870 +       if (nodedepth)
20871 +               *nodedepth = level;
20872 +
20873 +       if (supernodedepth > level)
20874 +               return -FDT_ERR_NOTFOUND;
20875 +       return supernodeoffset;
20876 +}
20877 +
20878 +int fdt_node_depth(const void *fdt, int nodeoffset)
20879 +{
20880 +       int nodedepth;
20881 +       int err;
20882 +
20883 +       err = fdt_supernode_atdepth_offset(fdt, nodeoffset, 0, &nodedepth);
20884 +       if (err)
20885 +               return (err < 0) ? err : -FDT_ERR_INTERNAL;
20886 +       return nodedepth;
20887 +}
20888 +
20889 +int fdt_parent_offset(const void *fdt, int nodeoffset)
20890 +{
20891 +       int nodedepth = fdt_node_depth(fdt, nodeoffset);
20892 +
20893 +       if (nodedepth < 0)
20894 +               return nodedepth;
20895 +       return fdt_supernode_atdepth_offset(fdt, nodeoffset,
20896 +                                           nodedepth - 1, NULL);
20897 +}
20898 +
20899 +int fdt_node_offset_by_prop_value(const void *fdt, int startoffset,
20900 +                                 const char *propname,
20901 +                                 const void *propval, int proplen)
20902 +{
20903 +       uint32_t tag;
20904 +       int offset, nextoffset;
20905 +       const void *val;
20906 +       int len;
20907 +
20908 +       CHECK_HEADER(fdt);
20909 +
20910 +       if (startoffset >= 0) {
20911 +               tag = fdt_next_tag(fdt, startoffset, &nextoffset);
20912 +               if (tag != FDT_BEGIN_NODE)
20913 +                       return -FDT_ERR_BADOFFSET;
20914 +       } else {
20915 +               nextoffset = 0;
20916 +       }
20917 +
20918 +       /* FIXME: The algorithm here is pretty horrible: we scan each
20919 +        * property of a node in fdt_getprop(), then if that didn't
20920 +        * find what we want, we scan over them again making our way
20921 +        * to the next node.  Still it's the easiest to implement
20922 +        * approach; performance can come later. */
20923 +       do {
20924 +               offset = nextoffset;
20925 +               tag = fdt_next_tag(fdt, offset, &nextoffset);
20926 +
20927 +               switch (tag) {
20928 +               case FDT_BEGIN_NODE:
20929 +                       val = fdt_getprop(fdt, offset, propname, &len);
20930 +                       if (val
20931 +                           && (len == proplen)
20932 +                           && (memcmp(val, propval, len) == 0))
20933 +                               return offset;
20934 +                       break;
20935 +
20936 +               case FDT_PROP:
20937 +               case FDT_END:
20938 +               case FDT_END_NODE:
20939 +               case FDT_NOP:
20940 +                       break;
20941 +
20942 +               default:
20943 +                       return -FDT_ERR_BADSTRUCTURE;
20944 +               }
20945 +       } while (tag != FDT_END);
20946 +
20947 +       return -FDT_ERR_NOTFOUND;
20948 +}
20949 +
20950 +int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle)
20951 +{
20952 +       if ((phandle == 0) || (phandle == -1))
20953 +               return -FDT_ERR_BADPHANDLE;
20954 +       phandle = cpu_to_fdt32(phandle);
20955 +       return fdt_node_offset_by_prop_value(fdt, -1, "linux,phandle",
20956 +                                            &phandle, sizeof(phandle));
20957 +}
20958 +
20959 +int _stringlist_contains(const void *strlist, int listlen, const char *str)
20960 +{
20961 +       int len = strlen(str);
20962 +       const void *p;
20963 +
20964 +       while (listlen >= len) {
20965 +               if (memcmp(str, strlist, len+1) == 0)
20966 +                       return 1;
20967 +               p = memchr(strlist, '\0', listlen);
20968 +               if (!p)
20969 +                       return 0; /* malformed strlist.. */
20970 +               listlen -= (p-strlist) + 1;
20971 +               strlist = p + 1;
20972 +       }
20973 +       return 0;
20974 +}
20975 +
20976 +int fdt_node_check_compatible(const void *fdt, int nodeoffset,
20977 +                             const char *compatible)
20978 +{
20979 +       const void *prop;
20980 +       int len;
20981 +
20982 +       prop = fdt_getprop(fdt, nodeoffset, "compatible", &len);
20983 +       if (!prop)
20984 +               return len;
20985 +       if (_stringlist_contains(prop, len, compatible))
20986 +               return 0;
20987 +       else
20988 +               return 1;
20989 +}
20990 +
20991 +int fdt_node_offset_by_compatible(const void *fdt, int startoffset,
20992 +                                 const char *compatible)
20993 +{
20994 +       uint32_t tag;
20995 +       int offset, nextoffset;
20996 +       int err;
20997 +
20998 +       CHECK_HEADER(fdt);
20999 +
21000 +       if (startoffset >= 0) {
21001 +               tag = fdt_next_tag(fdt, startoffset, &nextoffset);
21002 +               if (tag != FDT_BEGIN_NODE)
21003 +                       return -FDT_ERR_BADOFFSET;
21004 +       } else {
21005 +               nextoffset = 0;
21006 +       }
21007 +
21008 +       /* FIXME: The algorithm here is pretty horrible: we scan each
21009 +        * property of a node in fdt_node_check_compatible(), then if
21010 +        * that didn't find what we want, we scan over them again
21011 +        * making our way to the next node.  Still it's the easiest to
21012 +        * implement approach; performance can come later. */
21013 +       do {
21014 +               offset = nextoffset;
21015 +               tag = fdt_next_tag(fdt, offset, &nextoffset);
21016 +
21017 +               switch (tag) {
21018 +               case FDT_BEGIN_NODE:
21019 +                       err = fdt_node_check_compatible(fdt, offset,
21020 +                                                       compatible);
21021 +                       if ((err < 0)
21022 +                           && (err != -FDT_ERR_NOTFOUND))
21023 +                               return err;
21024 +                       else if (err == 0)
21025 +                               return offset;
21026 +                       break;
21027 +
21028 +               case FDT_PROP:
21029 +               case FDT_END:
21030 +               case FDT_END_NODE:
21031 +               case FDT_NOP:
21032 +                       break;
21033 +
21034 +               default:
21035 +                       return -FDT_ERR_BADSTRUCTURE;
21036 +               }
21037 +       } while (tag != FDT_END);
21038 +
21039 +       return -FDT_ERR_NOTFOUND;
21040 +}
21041 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/libfdt/fdt_rw.c powerpc.git/arch/powerpc/boot/libfdt/fdt_rw.c
21042 --- linux-2.6.24/arch/powerpc/boot/libfdt/fdt_rw.c      1970-01-01 01:00:00.000000000 +0100
21043 +++ powerpc.git/arch/powerpc/boot/libfdt/fdt_rw.c       2008-01-28 20:25:49.000000000 +0100
21044 @@ -0,0 +1,447 @@
21045 +/*
21046 + * libfdt - Flat Device Tree manipulation
21047 + * Copyright (C) 2006 David Gibson, IBM Corporation.
21048 + *
21049 + * libfdt is dual licensed: you can use it either under the terms of
21050 + * the GPL, or the BSD license, at your option.
21051 + *
21052 + *  a) This library is free software; you can redistribute it and/or
21053 + *     modify it under the terms of the GNU General Public License as
21054 + *     published by the Free Software Foundation; either version 2 of the
21055 + *     License, or (at your option) any later version.
21056 + *
21057 + *     This library is distributed in the hope that it will be useful,
21058 + *     but WITHOUT ANY WARRANTY; without even the implied warranty of
21059 + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21060 + *     GNU General Public License for more details.
21061 + *
21062 + *     You should have received a copy of the GNU General Public
21063 + *     License along with this library; if not, write to the Free
21064 + *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
21065 + *     MA 02110-1301 USA
21066 + *
21067 + * Alternatively,
21068 + *
21069 + *  b) Redistribution and use in source and binary forms, with or
21070 + *     without modification, are permitted provided that the following
21071 + *     conditions are met:
21072 + *
21073 + *     1. Redistributions of source code must retain the above
21074 + *        copyright notice, this list of conditions and the following
21075 + *        disclaimer.
21076 + *     2. Redistributions in binary form must reproduce the above
21077 + *        copyright notice, this list of conditions and the following
21078 + *        disclaimer in the documentation and/or other materials
21079 + *        provided with the distribution.
21080 + *
21081 + *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
21082 + *     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
21083 + *     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21084 + *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21085 + *     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
21086 + *     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21087 + *     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21088 + *     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21089 + *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21090 + *     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21091 + *     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
21092 + *     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
21093 + *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21094 + */
21095 +#include "libfdt_env.h"
21096 +
21097 +#include <fdt.h>
21098 +#include <libfdt.h>
21099 +
21100 +#include "libfdt_internal.h"
21101 +
21102 +static int _blocks_misordered(const void *fdt,
21103 +                             int mem_rsv_size, int struct_size)
21104 +{
21105 +       return (fdt_off_mem_rsvmap(fdt) < ALIGN(sizeof(struct fdt_header), 8))
21106 +               || (fdt_off_dt_struct(fdt) <
21107 +                   (fdt_off_mem_rsvmap(fdt) + mem_rsv_size))
21108 +               || (fdt_off_dt_strings(fdt) <
21109 +                   (fdt_off_dt_struct(fdt) + struct_size))
21110 +               || (fdt_totalsize(fdt) <
21111 +                   (fdt_off_dt_strings(fdt) + fdt_size_dt_strings(fdt)));
21112 +}
21113 +
21114 +static int rw_check_header(void *fdt)
21115 +{
21116 +       int err;
21117 +
21118 +       if ((err = fdt_check_header(fdt)))
21119 +               return err;
21120 +       if (fdt_version(fdt) < 17)
21121 +               return -FDT_ERR_BADVERSION;
21122 +       if (_blocks_misordered(fdt, sizeof(struct fdt_reserve_entry),
21123 +                              fdt_size_dt_struct(fdt)))
21124 +               return -FDT_ERR_BADLAYOUT;
21125 +       if (fdt_version(fdt) > 17)
21126 +               fdt_set_version(fdt, 17);
21127 +
21128 +       return 0;
21129 +}
21130 +
21131 +#define RW_CHECK_HEADER(fdt) \
21132 +       { \
21133 +               int err; \
21134 +               if ((err = rw_check_header(fdt)) != 0) \
21135 +                       return err; \
21136 +       }
21137 +
21138 +static inline int _blob_data_size(void *fdt)
21139 +{
21140 +       return fdt_off_dt_strings(fdt) + fdt_size_dt_strings(fdt);
21141 +}
21142 +
21143 +static int _blob_splice(void *fdt, void *p, int oldlen, int newlen)
21144 +{
21145 +       void *end = fdt + _blob_data_size(fdt);
21146 +
21147 +       if (((p + oldlen) < p) || ((p + oldlen) > end))
21148 +               return -FDT_ERR_BADOFFSET;
21149 +       if ((end - oldlen + newlen) > (fdt + fdt_totalsize(fdt)))
21150 +               return -FDT_ERR_NOSPACE;
21151 +       memmove(p + newlen, p + oldlen, end - p - oldlen);
21152 +       return 0;
21153 +}
21154 +
21155 +static int _blob_splice_mem_rsv(void *fdt, struct fdt_reserve_entry *p,
21156 +                               int oldn, int newn)
21157 +{
21158 +       int delta = (newn - oldn) * sizeof(*p);
21159 +       int err;
21160 +       err = _blob_splice(fdt, p, oldn * sizeof(*p), newn * sizeof(*p));
21161 +       if (err)
21162 +               return err;
21163 +       fdt_set_off_dt_struct(fdt, fdt_off_dt_struct(fdt) + delta);
21164 +       fdt_set_off_dt_strings(fdt, fdt_off_dt_strings(fdt) + delta);
21165 +       return 0;
21166 +}
21167 +
21168 +static int _blob_splice_struct(void *fdt, void *p,
21169 +                              int oldlen, int newlen)
21170 +{
21171 +       int delta = newlen - oldlen;
21172 +       int err;
21173 +
21174 +       if ((err = _blob_splice(fdt, p, oldlen, newlen)))
21175 +               return err;
21176 +
21177 +       fdt_set_size_dt_struct(fdt, fdt_size_dt_struct(fdt) + delta);
21178 +       fdt_set_off_dt_strings(fdt, fdt_off_dt_strings(fdt) + delta);
21179 +       return 0;
21180 +}
21181 +
21182 +static int _blob_splice_string(void *fdt, int newlen)
21183 +{
21184 +       void *p = fdt + fdt_off_dt_strings(fdt) + fdt_size_dt_strings(fdt);
21185 +       int err;
21186 +
21187 +       if ((err = _blob_splice(fdt, p, 0, newlen)))
21188 +               return err;
21189 +
21190 +       fdt_set_size_dt_strings(fdt, fdt_size_dt_strings(fdt) + newlen);
21191 +       return 0;
21192 +}
21193 +
21194 +static int _find_add_string(void *fdt, const char *s)
21195 +{
21196 +       char *strtab = (char *)fdt + fdt_off_dt_strings(fdt);
21197 +       const char *p;
21198 +       char *new;
21199 +       int len = strlen(s) + 1;
21200 +       int err;
21201 +
21202 +       p = _fdt_find_string(strtab, fdt_size_dt_strings(fdt), s);
21203 +       if (p)
21204 +               /* found it */
21205 +               return (p - strtab);
21206 +
21207 +       new = strtab + fdt_size_dt_strings(fdt);
21208 +       err = _blob_splice_string(fdt, len);
21209 +       if (err)
21210 +               return err;
21211 +
21212 +       memcpy(new, s, len);
21213 +       return (new - strtab);
21214 +}
21215 +
21216 +int fdt_add_mem_rsv(void *fdt, uint64_t address, uint64_t size)
21217 +{
21218 +       struct fdt_reserve_entry *re;
21219 +       int err;
21220 +
21221 +       if ((err = rw_check_header(fdt)))
21222 +               return err;
21223 +
21224 +       re = _fdt_mem_rsv_w(fdt, fdt_num_mem_rsv(fdt));
21225 +       err = _blob_splice_mem_rsv(fdt, re, 0, 1);
21226 +       if (err)
21227 +               return err;
21228 +
21229 +       re->address = cpu_to_fdt64(address);
21230 +       re->size = cpu_to_fdt64(size);
21231 +       return 0;
21232 +}
21233 +
21234 +int fdt_del_mem_rsv(void *fdt, int n)
21235 +{
21236 +       struct fdt_reserve_entry *re = _fdt_mem_rsv_w(fdt, n);
21237 +       int err;
21238 +
21239 +       if ((err = rw_check_header(fdt)))
21240 +               return err;
21241 +       if (n >= fdt_num_mem_rsv(fdt))
21242 +               return -FDT_ERR_NOTFOUND;
21243 +
21244 +       err = _blob_splice_mem_rsv(fdt, re, 1, 0);
21245 +       if (err)
21246 +               return err;
21247 +       return 0;
21248 +}
21249 +
21250 +static int _resize_property(void *fdt, int nodeoffset, const char *name, int len,
21251 +                           struct fdt_property **prop)
21252 +{
21253 +       int oldlen;
21254 +       int err;
21255 +
21256 +       *prop = fdt_get_property_w(fdt, nodeoffset, name, &oldlen);
21257 +       if (! (*prop))
21258 +               return oldlen;
21259 +
21260 +       if ((err = _blob_splice_struct(fdt, (*prop)->data,
21261 +                                      ALIGN(oldlen, FDT_TAGSIZE),
21262 +                                      ALIGN(len, FDT_TAGSIZE))))
21263 +               return err;
21264 +
21265 +       (*prop)->len = cpu_to_fdt32(len);
21266 +       return 0;
21267 +}
21268 +
21269 +static int _add_property(void *fdt, int nodeoffset, const char *name, int len,
21270 +                        struct fdt_property **prop)
21271 +{
21272 +       uint32_t tag;
21273 +       int proplen;
21274 +       int nextoffset;
21275 +       int namestroff;
21276 +       int err;
21277 +
21278 +       tag = fdt_next_tag(fdt, nodeoffset, &nextoffset);
21279 +       if (tag != FDT_BEGIN_NODE)
21280 +               return -FDT_ERR_BADOFFSET;
21281 +
21282 +       namestroff = _find_add_string(fdt, name);
21283 +       if (namestroff < 0)
21284 +               return namestroff;
21285 +
21286 +       *prop = _fdt_offset_ptr_w(fdt, nextoffset);
21287 +       proplen = sizeof(**prop) + ALIGN(len, FDT_TAGSIZE);
21288 +
21289 +       err = _blob_splice_struct(fdt, *prop, 0, proplen);
21290 +       if (err)
21291 +               return err;
21292 +
21293 +       (*prop)->tag = cpu_to_fdt32(FDT_PROP);
21294 +       (*prop)->nameoff = cpu_to_fdt32(namestroff);
21295 +       (*prop)->len = cpu_to_fdt32(len);
21296 +       return 0;
21297 +}
21298 +
21299 +int fdt_setprop(void *fdt, int nodeoffset, const char *name,
21300 +               const void *val, int len)
21301 +{
21302 +       struct fdt_property *prop;
21303 +       int err;
21304 +
21305 +       if ((err = rw_check_header(fdt)))
21306 +               return err;
21307 +
21308 +       err = _resize_property(fdt, nodeoffset, name, len, &prop);
21309 +       if (err == -FDT_ERR_NOTFOUND)
21310 +               err = _add_property(fdt, nodeoffset, name, len, &prop);
21311 +       if (err)
21312 +               return err;
21313 +
21314 +       memcpy(prop->data, val, len);
21315 +       return 0;
21316 +}
21317 +
21318 +int fdt_delprop(void *fdt, int nodeoffset, const char *name)
21319 +{
21320 +       struct fdt_property *prop;
21321 +       int len, proplen;
21322 +
21323 +       RW_CHECK_HEADER(fdt);
21324 +
21325 +       prop = fdt_get_property_w(fdt, nodeoffset, name, &len);
21326 +       if (! prop)
21327 +               return len;
21328 +
21329 +       proplen = sizeof(*prop) + ALIGN(len, FDT_TAGSIZE);
21330 +       return _blob_splice_struct(fdt, prop, proplen, 0);
21331 +}
21332 +
21333 +int fdt_add_subnode_namelen(void *fdt, int parentoffset,
21334 +                           const char *name, int namelen)
21335 +{
21336 +       struct fdt_node_header *nh;
21337 +       int offset, nextoffset;
21338 +       int nodelen;
21339 +       int err;
21340 +       uint32_t tag;
21341 +       uint32_t *endtag;
21342 +
21343 +       RW_CHECK_HEADER(fdt);
21344 +
21345 +       offset = fdt_subnode_offset_namelen(fdt, parentoffset, name, namelen);
21346 +       if (offset >= 0)
21347 +               return -FDT_ERR_EXISTS;
21348 +       else if (offset != -FDT_ERR_NOTFOUND)
21349 +               return offset;
21350 +
21351 +       /* Try to place the new node after the parent's properties */
21352 +       fdt_next_tag(fdt, parentoffset, &nextoffset); /* skip the BEGIN_NODE */
21353 +       do {
21354 +               offset = nextoffset;
21355 +               tag = fdt_next_tag(fdt, offset, &nextoffset);
21356 +       } while (tag == FDT_PROP);
21357 +
21358 +       nh = _fdt_offset_ptr_w(fdt, offset);
21359 +       nodelen = sizeof(*nh) + ALIGN(namelen+1, FDT_TAGSIZE) + FDT_TAGSIZE;
21360 +
21361 +       err = _blob_splice_struct(fdt, nh, 0, nodelen);
21362 +       if (err)
21363 +               return err;
21364 +
21365 +       nh->tag = cpu_to_fdt32(FDT_BEGIN_NODE);
21366 +       memset(nh->name, 0, ALIGN(namelen+1, FDT_TAGSIZE));
21367 +       memcpy(nh->name, name, namelen);
21368 +       endtag = (uint32_t *)((void *)nh + nodelen - FDT_TAGSIZE);
21369 +       *endtag = cpu_to_fdt32(FDT_END_NODE);
21370 +
21371 +       return offset;
21372 +}
21373 +
21374 +int fdt_add_subnode(void *fdt, int parentoffset, const char *name)
21375 +{
21376 +       return fdt_add_subnode_namelen(fdt, parentoffset, name, strlen(name));
21377 +}
21378 +
21379 +int fdt_del_node(void *fdt, int nodeoffset)
21380 +{
21381 +       int endoffset;
21382 +
21383 +       RW_CHECK_HEADER(fdt);
21384 +
21385 +       endoffset = _fdt_node_end_offset(fdt, nodeoffset);
21386 +       if (endoffset < 0)
21387 +               return endoffset;
21388 +
21389 +       return _blob_splice_struct(fdt, _fdt_offset_ptr_w(fdt, nodeoffset),
21390 +                                  endoffset - nodeoffset, 0);
21391 +}
21392 +
21393 +static void _packblocks(const void *fdt, void *buf,
21394 +                      int mem_rsv_size, int struct_size)
21395 +{
21396 +       int mem_rsv_off, struct_off, strings_off;
21397 +
21398 +       mem_rsv_off = ALIGN(sizeof(struct fdt_header), 8);
21399 +       struct_off = mem_rsv_off + mem_rsv_size;
21400 +       strings_off = struct_off + struct_size;
21401 +
21402 +       memmove(buf + mem_rsv_off, fdt + fdt_off_mem_rsvmap(fdt), mem_rsv_size);
21403 +       fdt_set_off_mem_rsvmap(buf, mem_rsv_off);
21404 +
21405 +       memmove(buf + struct_off, fdt + fdt_off_dt_struct(fdt), struct_size);
21406 +       fdt_set_off_dt_struct(buf, struct_off);
21407 +       fdt_set_size_dt_struct(buf, struct_size);
21408 +
21409 +       memmove(buf + strings_off, fdt + fdt_off_dt_strings(fdt),
21410 +               fdt_size_dt_strings(fdt));
21411 +       fdt_set_off_dt_strings(buf, strings_off);
21412 +       fdt_set_size_dt_strings(buf, fdt_size_dt_strings(fdt));
21413 +}
21414 +
21415 +int fdt_open_into(const void *fdt, void *buf, int bufsize)
21416 +{
21417 +       int err;
21418 +       int mem_rsv_size, struct_size;
21419 +       int newsize;
21420 +       void *tmp;
21421 +
21422 +       err = fdt_check_header(fdt);
21423 +       if (err)
21424 +               return err;
21425 +
21426 +       mem_rsv_size = (fdt_num_mem_rsv(fdt)+1)
21427 +               * sizeof(struct fdt_reserve_entry);
21428 +
21429 +       if (fdt_version(fdt) >= 17) {
21430 +               struct_size = fdt_size_dt_struct(fdt);
21431 +       } else {
21432 +               struct_size = 0;
21433 +               while (fdt_next_tag(fdt, struct_size, &struct_size) != FDT_END)
21434 +                       ;
21435 +       }
21436 +
21437 +       if (!_blocks_misordered(fdt, mem_rsv_size, struct_size)) {
21438 +               /* no further work necessary */
21439 +               err = fdt_move(fdt, buf, bufsize);
21440 +               if (err)
21441 +                       return err;
21442 +               fdt_set_version(buf, 17);
21443 +               fdt_set_size_dt_struct(buf, struct_size);
21444 +               fdt_set_totalsize(buf, bufsize);
21445 +               return 0;
21446 +       }
21447 +
21448 +       /* Need to reorder */
21449 +       newsize = ALIGN(sizeof(struct fdt_header), 8) + mem_rsv_size
21450 +               + struct_size + fdt_size_dt_strings(fdt);
21451 +
21452 +       if (bufsize < newsize)
21453 +               return -FDT_ERR_NOSPACE;
21454 +
21455 +       if (((buf + newsize) <= fdt)
21456 +           || (buf >= (fdt + fdt_totalsize(fdt)))) {
21457 +               tmp = buf;
21458 +       } else {
21459 +               tmp = (void *)fdt + fdt_totalsize(fdt);
21460 +               if ((tmp + newsize) > (buf + bufsize))
21461 +                       return -FDT_ERR_NOSPACE;
21462 +       }
21463 +
21464 +       _packblocks(fdt, tmp, mem_rsv_size, struct_size);
21465 +       memmove(buf, tmp, newsize);
21466 +
21467 +       fdt_set_magic(buf, FDT_MAGIC);
21468 +       fdt_set_totalsize(buf, bufsize);
21469 +       fdt_set_version(buf, 17);
21470 +       fdt_set_last_comp_version(buf, 16);
21471 +       fdt_set_boot_cpuid_phys(buf, fdt_boot_cpuid_phys(fdt));
21472 +
21473 +       return 0;
21474 +}
21475 +
21476 +int fdt_pack(void *fdt)
21477 +{
21478 +       int mem_rsv_size;
21479 +       int err;
21480 +
21481 +       err = rw_check_header(fdt);
21482 +       if (err)
21483 +               return err;
21484 +
21485 +       mem_rsv_size = (fdt_num_mem_rsv(fdt)+1)
21486 +               * sizeof(struct fdt_reserve_entry);
21487 +       _packblocks(fdt, fdt, mem_rsv_size, fdt_size_dt_struct(fdt));
21488 +       fdt_set_totalsize(fdt, _blob_data_size(fdt));
21489 +
21490 +       return 0;
21491 +}
21492 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/libfdt/fdt_strerror.c powerpc.git/arch/powerpc/boot/libfdt/fdt_strerror.c
21493 --- linux-2.6.24/arch/powerpc/boot/libfdt/fdt_strerror.c        1970-01-01 01:00:00.000000000 +0100
21494 +++ powerpc.git/arch/powerpc/boot/libfdt/fdt_strerror.c 2008-01-28 20:25:49.000000000 +0100
21495 @@ -0,0 +1,96 @@
21496 +/*
21497 + * libfdt - Flat Device Tree manipulation
21498 + * Copyright (C) 2006 David Gibson, IBM Corporation.
21499 + *
21500 + * libfdt is dual licensed: you can use it either under the terms of
21501 + * the GPL, or the BSD license, at your option.
21502 + *
21503 + *  a) This library is free software; you can redistribute it and/or
21504 + *     modify it under the terms of the GNU General Public License as
21505 + *     published by the Free Software Foundation; either version 2 of the
21506 + *     License, or (at your option) any later version.
21507 + *
21508 + *     This library is distributed in the hope that it will be useful,
21509 + *     but WITHOUT ANY WARRANTY; without even the implied warranty of
21510 + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21511 + *     GNU General Public License for more details.
21512 + *
21513 + *     You should have received a copy of the GNU General Public
21514 + *     License along with this library; if not, write to the Free
21515 + *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
21516 + *     MA 02110-1301 USA
21517 + *
21518 + * Alternatively,
21519 + *
21520 + *  b) Redistribution and use in source and binary forms, with or
21521 + *     without modification, are permitted provided that the following
21522 + *     conditions are met:
21523 + *
21524 + *     1. Redistributions of source code must retain the above
21525 + *        copyright notice, this list of conditions and the following
21526 + *        disclaimer.
21527 + *     2. Redistributions in binary form must reproduce the above
21528 + *        copyright notice, this list of conditions and the following
21529 + *        disclaimer in the documentation and/or other materials
21530 + *        provided with the distribution.
21531 + *
21532 + *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
21533 + *     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
21534 + *     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21535 + *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21536 + *     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
21537 + *     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21538 + *     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21539 + *     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21540 + *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21541 + *     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21542 + *     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
21543 + *     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
21544 + *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21545 + */
21546 +#include "libfdt_env.h"
21547 +
21548 +#include <fdt.h>
21549 +#include <libfdt.h>
21550 +
21551 +#include "libfdt_internal.h"
21552 +
21553 +struct errtabent {
21554 +       const char *str;
21555 +};
21556 +
21557 +#define ERRTABENT(val) \
21558 +       [(val)] = { .str = #val, }
21559 +
21560 +static struct errtabent errtable[] = {
21561 +       ERRTABENT(FDT_ERR_NOTFOUND),
21562 +       ERRTABENT(FDT_ERR_EXISTS),
21563 +       ERRTABENT(FDT_ERR_NOSPACE),
21564 +
21565 +       ERRTABENT(FDT_ERR_BADOFFSET),
21566 +       ERRTABENT(FDT_ERR_BADPATH),
21567 +       ERRTABENT(FDT_ERR_BADSTATE),
21568 +
21569 +       ERRTABENT(FDT_ERR_TRUNCATED),
21570 +       ERRTABENT(FDT_ERR_BADMAGIC),
21571 +       ERRTABENT(FDT_ERR_BADVERSION),
21572 +       ERRTABENT(FDT_ERR_BADSTRUCTURE),
21573 +       ERRTABENT(FDT_ERR_BADLAYOUT),
21574 +};
21575 +#define ERRTABSIZE     (sizeof(errtable) / sizeof(errtable[0]))
21576 +
21577 +const char *fdt_strerror(int errval)
21578 +{
21579 +       if (errval > 0)
21580 +               return "<valid offset/length>";
21581 +       else if (errval == 0)
21582 +               return "<no error>";
21583 +       else if (errval > -ERRTABSIZE) {
21584 +               const char *s = errtable[-errval].str;
21585 +
21586 +               if (s)
21587 +                       return s;
21588 +       }
21589 +
21590 +       return "<unknown error>";
21591 +}
21592 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/libfdt/fdt_sw.c powerpc.git/arch/powerpc/boot/libfdt/fdt_sw.c
21593 --- linux-2.6.24/arch/powerpc/boot/libfdt/fdt_sw.c      1970-01-01 01:00:00.000000000 +0100
21594 +++ powerpc.git/arch/powerpc/boot/libfdt/fdt_sw.c       2008-01-28 20:25:49.000000000 +0100
21595 @@ -0,0 +1,258 @@
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 +static int check_header_sw(void *fdt)
21654 +{
21655 +       if (fdt_magic(fdt) != SW_MAGIC)
21656 +               return -FDT_ERR_BADMAGIC;
21657 +       return 0;
21658 +}
21659 +
21660 +static void *grab_space(void *fdt, int len)
21661 +{
21662 +       int offset = fdt_size_dt_struct(fdt);
21663 +       int spaceleft;
21664 +
21665 +       spaceleft = fdt_totalsize(fdt) - fdt_off_dt_struct(fdt)
21666 +               - fdt_size_dt_strings(fdt);
21667 +
21668 +       if ((offset + len < offset) || (offset + len > spaceleft))
21669 +               return NULL;
21670 +
21671 +       fdt_set_size_dt_struct(fdt, offset + len);
21672 +       return fdt_offset_ptr_w(fdt, offset, len);
21673 +}
21674 +
21675 +int fdt_create(void *buf, int bufsize)
21676 +{
21677 +       void *fdt = buf;
21678 +
21679 +       if (bufsize < sizeof(struct fdt_header))
21680 +               return -FDT_ERR_NOSPACE;
21681 +
21682 +       memset(buf, 0, bufsize);
21683 +
21684 +       fdt_set_magic(fdt, SW_MAGIC);
21685 +       fdt_set_version(fdt, FDT_LAST_SUPPORTED_VERSION);
21686 +       fdt_set_last_comp_version(fdt, FDT_FIRST_SUPPORTED_VERSION);
21687 +       fdt_set_totalsize(fdt,  bufsize);
21688 +
21689 +       fdt_set_off_mem_rsvmap(fdt, ALIGN(sizeof(struct fdt_header),
21690 +                                         sizeof(struct fdt_reserve_entry)));
21691 +       fdt_set_off_dt_struct(fdt, fdt_off_mem_rsvmap(fdt));
21692 +       fdt_set_off_dt_strings(fdt, bufsize);
21693 +
21694 +       return 0;
21695 +}
21696 +
21697 +int fdt_add_reservemap_entry(void *fdt, uint64_t addr, uint64_t size)
21698 +{
21699 +       struct fdt_reserve_entry *re;
21700 +       int err = check_header_sw(fdt);
21701 +       int offset;
21702 +
21703 +       if (err)
21704 +               return err;
21705 +       if (fdt_size_dt_struct(fdt))
21706 +               return -FDT_ERR_BADSTATE;
21707 +
21708 +       offset = fdt_off_dt_struct(fdt);
21709 +       if ((offset + sizeof(*re)) > fdt_totalsize(fdt))
21710 +               return -FDT_ERR_NOSPACE;
21711 +
21712 +       re = (struct fdt_reserve_entry *)(fdt + offset);
21713 +       re->address = cpu_to_fdt64(addr);
21714 +       re->size = cpu_to_fdt64(size);
21715 +
21716 +       fdt_set_off_dt_struct(fdt, offset + sizeof(*re));
21717 +
21718 +       return 0;
21719 +}
21720 +
21721 +int fdt_finish_reservemap(void *fdt)
21722 +{
21723 +       return fdt_add_reservemap_entry(fdt, 0, 0);
21724 +}
21725 +
21726 +int fdt_begin_node(void *fdt, const char *name)
21727 +{
21728 +       struct fdt_node_header *nh;
21729 +       int err = check_header_sw(fdt);
21730 +       int namelen = strlen(name) + 1;
21731 +
21732 +       if (err)
21733 +               return err;
21734 +
21735 +       nh = grab_space(fdt, sizeof(*nh) + ALIGN(namelen, FDT_TAGSIZE));
21736 +       if (! nh)
21737 +               return -FDT_ERR_NOSPACE;
21738 +
21739 +       nh->tag = cpu_to_fdt32(FDT_BEGIN_NODE);
21740 +       memcpy(nh->name, name, namelen);
21741 +       return 0;
21742 +}
21743 +
21744 +int fdt_end_node(void *fdt)
21745 +{
21746 +       uint32_t *en;
21747 +       int err = check_header_sw(fdt);
21748 +
21749 +       if (err)
21750 +               return err;
21751 +
21752 +       en = grab_space(fdt, FDT_TAGSIZE);
21753 +       if (! en)
21754 +               return -FDT_ERR_NOSPACE;
21755 +
21756 +       *en = cpu_to_fdt32(FDT_END_NODE);
21757 +       return 0;
21758 +}
21759 +
21760 +static int find_add_string(void *fdt, const char *s)
21761 +{
21762 +       char *strtab = (char *)fdt + fdt_totalsize(fdt);
21763 +       const char *p;
21764 +       int strtabsize = fdt_size_dt_strings(fdt);
21765 +       int len = strlen(s) + 1;
21766 +       int struct_top, offset;
21767 +
21768 +       p = _fdt_find_string(strtab - strtabsize, strtabsize, s);
21769 +       if (p)
21770 +               return p - strtab;
21771 +
21772 +       /* Add it */
21773 +       offset = -strtabsize - len;
21774 +       struct_top = fdt_off_dt_struct(fdt) + fdt_size_dt_struct(fdt);
21775 +       if (fdt_totalsize(fdt) + offset < struct_top)
21776 +               return 0; /* no more room :( */
21777 +
21778 +       memcpy(strtab + offset, s, len);
21779 +       fdt_set_size_dt_strings(fdt, strtabsize + len);
21780 +       return offset;
21781 +}
21782 +
21783 +int fdt_property(void *fdt, const char *name, const void *val, int len)
21784 +{
21785 +       struct fdt_property *prop;
21786 +       int err = check_header_sw(fdt);
21787 +       int nameoff;
21788 +
21789 +       if (err)
21790 +               return err;
21791 +
21792 +       nameoff = find_add_string(fdt, name);
21793 +       if (nameoff == 0)
21794 +               return -FDT_ERR_NOSPACE;
21795 +
21796 +       prop = grab_space(fdt, sizeof(*prop) + ALIGN(len, FDT_TAGSIZE));
21797 +       if (! prop)
21798 +               return -FDT_ERR_NOSPACE;
21799 +
21800 +       prop->tag = cpu_to_fdt32(FDT_PROP);
21801 +       prop->nameoff = cpu_to_fdt32(nameoff);
21802 +       prop->len = cpu_to_fdt32(len);
21803 +       memcpy(prop->data, val, len);
21804 +       return 0;
21805 +}
21806 +
21807 +int fdt_finish(void *fdt)
21808 +{
21809 +       int err = check_header_sw(fdt);
21810 +       char *p = (char *)fdt;
21811 +       uint32_t *end;
21812 +       int oldstroffset, newstroffset;
21813 +       uint32_t tag;
21814 +       int offset, nextoffset;
21815 +
21816 +       if (err)
21817 +               return err;
21818 +
21819 +       /* Add terminator */
21820 +       end = grab_space(fdt, sizeof(*end));
21821 +       if (! end)
21822 +               return -FDT_ERR_NOSPACE;
21823 +       *end = cpu_to_fdt32(FDT_END);
21824 +
21825 +       /* Relocate the string table */
21826 +       oldstroffset = fdt_totalsize(fdt) - fdt_size_dt_strings(fdt);
21827 +       newstroffset = fdt_off_dt_struct(fdt) + fdt_size_dt_struct(fdt);
21828 +       memmove(p + newstroffset, p + oldstroffset, fdt_size_dt_strings(fdt));
21829 +       fdt_set_off_dt_strings(fdt, newstroffset);
21830 +
21831 +       /* Walk the structure, correcting string offsets */
21832 +       offset = 0;
21833 +       while ((tag = fdt_next_tag(fdt, offset, &nextoffset)) != FDT_END) {
21834 +               if (tag == FDT_PROP) {
21835 +                       struct fdt_property *prop =
21836 +                               fdt_offset_ptr_w(fdt, offset, sizeof(*prop));
21837 +                       int nameoff;
21838 +
21839 +                       if (! prop)
21840 +                               return -FDT_ERR_BADSTRUCTURE;
21841 +
21842 +                       nameoff = fdt32_to_cpu(prop->nameoff);
21843 +                       nameoff += fdt_size_dt_strings(fdt);
21844 +                       prop->nameoff = cpu_to_fdt32(nameoff);
21845 +               }
21846 +               offset = nextoffset;
21847 +       }
21848 +
21849 +       /* Finally, adjust the header */
21850 +       fdt_set_totalsize(fdt, newstroffset + fdt_size_dt_strings(fdt));
21851 +       fdt_set_magic(fdt, FDT_MAGIC);
21852 +       return 0;
21853 +}
21854 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/libfdt/fdt_wip.c powerpc.git/arch/powerpc/boot/libfdt/fdt_wip.c
21855 --- linux-2.6.24/arch/powerpc/boot/libfdt/fdt_wip.c     1970-01-01 01:00:00.000000000 +0100
21856 +++ powerpc.git/arch/powerpc/boot/libfdt/fdt_wip.c      2008-01-28 20:25:49.000000000 +0100
21857 @@ -0,0 +1,144 @@
21858 +/*
21859 + * libfdt - Flat Device Tree manipulation
21860 + * Copyright (C) 2006 David Gibson, IBM Corporation.
21861 + *
21862 + * libfdt is dual licensed: you can use it either under the terms of
21863 + * the GPL, or the BSD license, at your option.
21864 + *
21865 + *  a) This library is free software; you can redistribute it and/or
21866 + *     modify it under the terms of the GNU General Public License as
21867 + *     published by the Free Software Foundation; either version 2 of the
21868 + *     License, or (at your option) any later version.
21869 + *
21870 + *     This library is distributed in the hope that it will be useful,
21871 + *     but WITHOUT ANY WARRANTY; without even the implied warranty of
21872 + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21873 + *     GNU General Public License for more details.
21874 + *
21875 + *     You should have received a copy of the GNU General Public
21876 + *     License along with this library; if not, write to the Free
21877 + *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
21878 + *     MA 02110-1301 USA
21879 + *
21880 + * Alternatively,
21881 + *
21882 + *  b) Redistribution and use in source and binary forms, with or
21883 + *     without modification, are permitted provided that the following
21884 + *     conditions are met:
21885 + *
21886 + *     1. Redistributions of source code must retain the above
21887 + *        copyright notice, this list of conditions and the following
21888 + *        disclaimer.
21889 + *     2. Redistributions in binary form must reproduce the above
21890 + *        copyright notice, this list of conditions and the following
21891 + *        disclaimer in the documentation and/or other materials
21892 + *        provided with the distribution.
21893 + *
21894 + *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
21895 + *     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
21896 + *     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21897 + *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21898 + *     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
21899 + *     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21900 + *     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21901 + *     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21902 + *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21903 + *     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21904 + *     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
21905 + *     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
21906 + *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21907 + */
21908 +#include "libfdt_env.h"
21909 +
21910 +#include <fdt.h>
21911 +#include <libfdt.h>
21912 +
21913 +#include "libfdt_internal.h"
21914 +
21915 +int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,
21916 +                       const void *val, int len)
21917 +{
21918 +       void *propval;
21919 +       int proplen;
21920 +
21921 +       propval = fdt_getprop_w(fdt, nodeoffset, name, &proplen);
21922 +       if (! propval)
21923 +               return proplen;
21924 +
21925 +       if (proplen != len)
21926 +               return -FDT_ERR_NOSPACE;
21927 +
21928 +       memcpy(propval, val, len);
21929 +       return 0;
21930 +}
21931 +
21932 +static void nop_region(void *start, int len)
21933 +{
21934 +       uint32_t *p;
21935 +
21936 +       for (p = start; (void *)p < (start + len); p++)
21937 +               *p = cpu_to_fdt32(FDT_NOP);
21938 +}
21939 +
21940 +int fdt_nop_property(void *fdt, int nodeoffset, const char *name)
21941 +{
21942 +       struct fdt_property *prop;
21943 +       int len;
21944 +
21945 +       prop = fdt_get_property_w(fdt, nodeoffset, name, &len);
21946 +       if (! prop)
21947 +               return len;
21948 +
21949 +       nop_region(prop, len + sizeof(*prop));
21950 +
21951 +       return 0;
21952 +}
21953 +
21954 +int _fdt_node_end_offset(void *fdt, int nodeoffset)
21955 +{
21956 +       int level = 0;
21957 +       uint32_t tag;
21958 +       int offset, nextoffset;
21959 +
21960 +       tag = fdt_next_tag(fdt, nodeoffset, &nextoffset);
21961 +       if (tag != FDT_BEGIN_NODE)
21962 +               return -FDT_ERR_BADOFFSET;
21963 +       do {
21964 +               offset = nextoffset;
21965 +               tag = fdt_next_tag(fdt, offset, &nextoffset);
21966 +
21967 +               switch (tag) {
21968 +               case FDT_END:
21969 +                       return offset;
21970 +
21971 +               case FDT_BEGIN_NODE:
21972 +                       level++;
21973 +                       break;
21974 +
21975 +               case FDT_END_NODE:
21976 +                       level--;
21977 +                       break;
21978 +
21979 +               case FDT_PROP:
21980 +               case FDT_NOP:
21981 +                       break;
21982 +
21983 +               default:
21984 +                       return -FDT_ERR_BADSTRUCTURE;
21985 +               }
21986 +       } while (level >= 0);
21987 +
21988 +       return nextoffset;
21989 +}
21990 +
21991 +int fdt_nop_node(void *fdt, int nodeoffset)
21992 +{
21993 +       int endoffset;
21994 +
21995 +       endoffset = _fdt_node_end_offset(fdt, nodeoffset);
21996 +       if (endoffset < 0)
21997 +               return endoffset;
21998 +
21999 +       nop_region(fdt_offset_ptr_w(fdt, nodeoffset, 0), endoffset - nodeoffset);
22000 +       return 0;
22001 +}
22002 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/libfdt/libfdt.h powerpc.git/arch/powerpc/boot/libfdt/libfdt.h
22003 --- linux-2.6.24/arch/powerpc/boot/libfdt/libfdt.h      1970-01-01 01:00:00.000000000 +0100
22004 +++ powerpc.git/arch/powerpc/boot/libfdt/libfdt.h       2008-01-28 20:25:49.000000000 +0100
22005 @@ -0,0 +1,721 @@
22006 +#ifndef _LIBFDT_H
22007 +#define _LIBFDT_H
22008 +/*
22009 + * libfdt - Flat Device Tree manipulation
22010 + * Copyright (C) 2006 David Gibson, IBM Corporation.
22011 + *
22012 + * libfdt is dual licensed: you can use it either under the terms of
22013 + * the GPL, or the BSD license, at your option.
22014 + *
22015 + *  a) This library is free software; you can redistribute it and/or
22016 + *     modify it under the terms of the GNU General Public License as
22017 + *     published by the Free Software Foundation; either version 2 of the
22018 + *     License, or (at your option) any later version.
22019 + *
22020 + *     This library is distributed in the hope that it will be useful,
22021 + *     but WITHOUT ANY WARRANTY; without even the implied warranty of
22022 + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22023 + *     GNU General Public License for more details.
22024 + *
22025 + *     You should have received a copy of the GNU General Public
22026 + *     License along with this library; if not, write to the Free
22027 + *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
22028 + *     MA 02110-1301 USA
22029 + *
22030 + * Alternatively,
22031 + *
22032 + *  b) Redistribution and use in source and binary forms, with or
22033 + *     without modification, are permitted provided that the following
22034 + *     conditions are met:
22035 + *
22036 + *     1. Redistributions of source code must retain the above
22037 + *        copyright notice, this list of conditions and the following
22038 + *        disclaimer.
22039 + *     2. Redistributions in binary form must reproduce the above
22040 + *        copyright notice, this list of conditions and the following
22041 + *        disclaimer in the documentation and/or other materials
22042 + *        provided with the distribution.
22043 + *
22044 + *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
22045 + *     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
22046 + *     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
22047 + *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22048 + *     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
22049 + *     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22050 + *     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22051 + *     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22052 + *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22053 + *     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22054 + *     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
22055 + *     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
22056 + *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22057 + */
22058 +
22059 +#include <libfdt_env.h>
22060 +#include <fdt.h>
22061 +
22062 +#define FDT_FIRST_SUPPORTED_VERSION    0x10
22063 +#define FDT_LAST_SUPPORTED_VERSION     0x11
22064 +
22065 +/* Error codes: informative error codes */
22066 +#define FDT_ERR_NOTFOUND       1
22067 +       /* FDT_ERR_NOTFOUND: The requested node or property does not exist */
22068 +#define FDT_ERR_EXISTS         2
22069 +       /* FDT_ERR_EXISTS: Attemped to create a node or property which
22070 +        * already exists */
22071 +#define FDT_ERR_NOSPACE                3
22072 +       /* FDT_ERR_NOSPACE: Operation needed to expand the device
22073 +        * tree, but its buffer did not have sufficient space to
22074 +        * contain the expanded tree. Use fdt_open_into() to move the
22075 +        * device tree to a buffer with more space. */
22076 +
22077 +/* Error codes: codes for bad parameters */
22078 +#define FDT_ERR_BADOFFSET      4
22079 +       /* FDT_ERR_BADOFFSET: Function was passed a structure block
22080 +        * offset which is out-of-bounds, or which points to an
22081 +        * unsuitable part of the structure for the operation. */
22082 +#define FDT_ERR_BADPATH                5
22083 +       /* FDT_ERR_BADPATH: Function was passed a badly formatted path
22084 +        * (e.g. missing a leading / for a function which requires an
22085 +        * absolute path) */
22086 +#define FDT_ERR_BADPHANDLE     6
22087 +       /* FDT_ERR_BADPHANDLE: Function was passed an invalid phandle
22088 +        * value.  phandle values of 0 and -1 are not permitted. */
22089 +#define FDT_ERR_BADSTATE       7
22090 +       /* FDT_ERR_BADSTATE: Function was passed an incomplete device
22091 +        * tree created by the sequential-write functions, which is
22092 +        * not sufficiently complete for the requested operation. */
22093 +
22094 +/* Error codes: codes for bad device tree blobs */
22095 +#define FDT_ERR_TRUNCATED      8
22096 +       /* FDT_ERR_TRUNCATED: Structure block of the given device tree
22097 +        * ends without an FDT_END tag. */
22098 +#define FDT_ERR_BADMAGIC       9
22099 +       /* FDT_ERR_BADMAGIC: Given "device tree" appears not to be a
22100 +        * device tree at all - it is missing the flattened device
22101 +        * tree magic number. */
22102 +#define FDT_ERR_BADVERSION     10
22103 +       /* FDT_ERR_BADVERSION: Given device tree has a version which
22104 +        * can't be handled by the requested operation.  For
22105 +        * read-write functions, this may mean that fdt_open_into() is
22106 +        * required to convert the tree to the expected version. */
22107 +#define FDT_ERR_BADSTRUCTURE   11
22108 +       /* FDT_ERR_BADSTRUCTURE: Given device tree has a corrupt
22109 +        * structure block or other serious error (e.g. misnested
22110 +        * nodes, or subnodes preceding properties). */
22111 +#define FDT_ERR_BADLAYOUT      12
22112 +       /* FDT_ERR_BADLAYOUT: For read-write functions, the given
22113 +        * device tree has it's sub-blocks in an order that the
22114 +        * function can't handle (memory reserve map, then structure,
22115 +        * then strings).  Use fdt_open_into() to reorganize the tree
22116 +        * into a form suitable for the read-write operations. */
22117 +
22118 +/* "Can't happen" error indicating a bug in libfdt */
22119 +#define FDT_ERR_INTERNAL       13
22120 +       /* FDT_ERR_INTERNAL: libfdt has failed an internal assertion.
22121 +        * Should never be returned, if it is, it indicates a bug in
22122 +        * libfdt itself. */
22123 +
22124 +#define FDT_ERR_MAX            13
22125 +
22126 +/**********************************************************************/
22127 +/* Low-level functions (you probably don't need these)                */
22128 +/**********************************************************************/
22129 +
22130 +const void *fdt_offset_ptr(const void *fdt, int offset, int checklen);
22131 +static inline void *fdt_offset_ptr_w(void *fdt, int offset, int checklen)
22132 +{
22133 +       return (void *)fdt_offset_ptr(fdt, offset, checklen);
22134 +}
22135 +
22136 +uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset);
22137 +
22138 +/**********************************************************************/
22139 +/* General functions                                                  */
22140 +/**********************************************************************/
22141 +
22142 +#define fdt_get_header(fdt, field) \
22143 +       (fdt32_to_cpu(((const struct fdt_header *)(fdt))->field))
22144 +#define fdt_magic(fdt)                         (fdt_get_header(fdt, magic))
22145 +#define fdt_totalsize(fdt)             (fdt_get_header(fdt, totalsize))
22146 +#define fdt_off_dt_struct(fdt)         (fdt_get_header(fdt, off_dt_struct))
22147 +#define fdt_off_dt_strings(fdt)                (fdt_get_header(fdt, off_dt_strings))
22148 +#define fdt_off_mem_rsvmap(fdt)                (fdt_get_header(fdt, off_mem_rsvmap))
22149 +#define fdt_version(fdt)               (fdt_get_header(fdt, version))
22150 +#define fdt_last_comp_version(fdt)     (fdt_get_header(fdt, last_comp_version))
22151 +#define fdt_boot_cpuid_phys(fdt)       (fdt_get_header(fdt, boot_cpuid_phys))
22152 +#define fdt_size_dt_strings(fdt)       (fdt_get_header(fdt, size_dt_strings))
22153 +#define fdt_size_dt_struct(fdt)                (fdt_get_header(fdt, size_dt_struct))
22154 +
22155 +#define __fdt_set_hdr(name) \
22156 +       static inline void fdt_set_##name(void *fdt, uint32_t val) \
22157 +       { \
22158 +               struct fdt_header *fdth = fdt; \
22159 +               fdth->name = cpu_to_fdt32(val); \
22160 +       }
22161 +__fdt_set_hdr(magic);
22162 +__fdt_set_hdr(totalsize);
22163 +__fdt_set_hdr(off_dt_struct);
22164 +__fdt_set_hdr(off_dt_strings);
22165 +__fdt_set_hdr(off_mem_rsvmap);
22166 +__fdt_set_hdr(version);
22167 +__fdt_set_hdr(last_comp_version);
22168 +__fdt_set_hdr(boot_cpuid_phys);
22169 +__fdt_set_hdr(size_dt_strings);
22170 +__fdt_set_hdr(size_dt_struct);
22171 +#undef __fdt_set_hdr
22172 +
22173 +/**
22174 + * fdt_check_header - sanity check a device tree or possible device tree
22175 + * @fdt: pointer to data which might be a flattened device tree
22176 + *
22177 + * fdt_check_header() checks that the given buffer contains what
22178 + * appears to be a flattened device tree with sane information in its
22179 + * header.
22180 + *
22181 + * returns:
22182 + *     0, if the buffer appears to contain a valid device tree
22183 + *     -FDT_ERR_BADMAGIC,
22184 + *     -FDT_ERR_BADVERSION,
22185 + *     -FDT_ERR_BADSTATE, standard meanings, as above
22186 + */
22187 +int fdt_check_header(const void *fdt);
22188 +
22189 +/**
22190 + * fdt_move - move a device tree around in memory
22191 + * @fdt: pointer to the device tree to move
22192 + * @buf: pointer to memory where the device is to be moved
22193 + * @bufsize: size of the memory space at buf
22194 + *
22195 + * fdt_move() relocates, if possible, the device tree blob located at
22196 + * fdt to the buffer at buf of size bufsize.  The buffer may overlap
22197 + * with the existing device tree blob at fdt.  Therefore,
22198 + *     fdt_move(fdt, fdt, fdt_totalsize(fdt))
22199 + * should always succeed.
22200 + *
22201 + * returns:
22202 + *     0, on success
22203 + *     -FDT_ERR_NOSPACE, bufsize is insufficient to contain the device tree
22204 + *     -FDT_ERR_BADMAGIC,
22205 + *     -FDT_ERR_BADVERSION,
22206 + *     -FDT_ERR_BADSTATE, standard meanings
22207 + */
22208 +int fdt_move(const void *fdt, void *buf, int bufsize);
22209 +
22210 +/**********************************************************************/
22211 +/* Read-only functions                                                */
22212 +/**********************************************************************/
22213 +
22214 +/**
22215 + * fdt_string - retreive a string from the strings block of a device tree
22216 + * @fdt: pointer to the device tree blob
22217 + * @stroffset: offset of the string within the strings block (native endian)
22218 + *
22219 + * fdt_string() retrieves a pointer to a single string from the
22220 + * strings block of the device tree blob at fdt.
22221 + *
22222 + * returns:
22223 + *     a pointer to the string, on success
22224 + *     NULL, if stroffset is out of bounds
22225 + */
22226 +const char *fdt_string(const void *fdt, int stroffset);
22227 +
22228 +/**
22229 + * fdt_num_mem_rsv - retreive the number of memory reserve map entries
22230 + * @fdt: pointer to the device tree blob
22231 + *
22232 + * Returns the number of entries in the device tree blob's memory
22233 + * reservation map.  This does not include the terminating 0,0 entry
22234 + * or any other (0,0) entries reserved for expansion.
22235 + *
22236 + * returns:
22237 + *     the number of entries
22238 + */
22239 +int fdt_num_mem_rsv(const void *fdt);
22240 +
22241 +/**
22242 + * fdt_get_mem_rsv - retreive one memory reserve map entry
22243 + * @fdt: pointer to the device tree blob
22244 + * @address, @size: pointers to 64-bit variables
22245 + *
22246 + * On success, *address and *size will contain the address and size of
22247 + * the n-th reserve map entry from the device tree blob, in
22248 + * native-endian format.
22249 + *
22250 + * returns:
22251 + *     0, on success
22252 + *     -FDT_ERR_BADMAGIC,
22253 + *     -FDT_ERR_BADVERSION,
22254 + *     -FDT_ERR_BADSTATE, standard meanings
22255 + */
22256 +int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size);
22257 +
22258 +/**
22259 + * fdt_subnode_offset_namelen - find a subnode based on substring
22260 + * @fdt: pointer to the device tree blob
22261 + * @parentoffset: structure block offset of a node
22262 + * @name: name of the subnode to locate
22263 + * @namelen: number of characters of name to consider
22264 + *
22265 + * Identical to fdt_subnode_offset(), but only examine the first
22266 + * namelen characters of name for matching the subnode name.  This is
22267 + * useful for finding subnodes based on a portion of a larger string,
22268 + * such as a full path.
22269 + */
22270 +int fdt_subnode_offset_namelen(const void *fdt, int parentoffset,
22271 +                              const char *name, int namelen);
22272 +/**
22273 + * fdt_subnode_offset - find a subnode of a given node
22274 + * @fdt: pointer to the device tree blob
22275 + * @parentoffset: structure block offset of a node
22276 + * @name: name of the subnode to locate
22277 + *
22278 + * fdt_subnode_offset() finds a subnode of the node at structure block
22279 + * offset parentoffset with the given name.  name may include a unit
22280 + * address, in which case fdt_subnode_offset() will find the subnode
22281 + * with that unit address, or the unit address may be omitted, in
22282 + * which case fdt_subnode_offset() will find an arbitrary subnode
22283 + * whose name excluding unit address matches the given name.
22284 + *
22285 + * returns:
22286 + *     structure block offset of the requested subnode (>=0), on success
22287 + *     -FDT_ERR_NOTFOUND, if the requested subnode does not exist
22288 + *     -FDT_ERR_BADOFFSET, if parentoffset did not point to an FDT_BEGIN_NODE tag
22289 + *      -FDT_ERR_BADMAGIC,
22290 + *     -FDT_ERR_BADVERSION,
22291 + *     -FDT_ERR_BADSTATE,
22292 + *     -FDT_ERR_BADSTRUCTURE,
22293 + *     -FDT_ERR_TRUNCATED, standard meanings.
22294 + */
22295 +int fdt_subnode_offset(const void *fdt, int parentoffset, const char *name);
22296 +
22297 +/**
22298 + * fdt_path_offset - find a tree node by its full path
22299 + * @fdt: pointer to the device tree blob
22300 + * @path: full path of the node to locate
22301 + *
22302 + * fdt_path_offset() finds a node of a given path in the device tree.
22303 + * Each path component may omit the unit address portion, but the
22304 + * results of this are undefined if any such path component is
22305 + * ambiguous (that is if there are multiple nodes at the relevant
22306 + * level matching the given component, differentiated only by unit
22307 + * address).
22308 + *
22309 + * returns:
22310 + *     structure block offset of the node with the requested path (>=0), on success
22311 + *     -FDT_ERR_BADPATH, given path does not begin with '/' or is invalid
22312 + *     -FDT_ERR_NOTFOUND, if the requested node does not exist
22313 + *      -FDT_ERR_BADMAGIC,
22314 + *     -FDT_ERR_BADVERSION,
22315 + *     -FDT_ERR_BADSTATE,
22316 + *     -FDT_ERR_BADSTRUCTURE,
22317 + *     -FDT_ERR_TRUNCATED, standard meanings.
22318 + */
22319 +int fdt_path_offset(const void *fdt, const char *path);
22320 +
22321 +/**
22322 + * fdt_get_name - retreive the name of a given node
22323 + * @fdt: pointer to the device tree blob
22324 + * @nodeoffset: structure block offset of the starting node
22325 + * @lenp: pointer to an integer variable (will be overwritten) or NULL
22326 + *
22327 + * fdt_get_name() retrieves the name (including unit address) of the
22328 + * device tree node at structure block offset nodeoffset.  If lenp is
22329 + * non-NULL, the length of this name is also returned, in the integer
22330 + * pointed to by lenp.
22331 + *
22332 + * returns:
22333 + *     pointer to the node's name, on success
22334 + *             If lenp is non-NULL, *lenp contains the length of that name (>=0)
22335 + *     NULL, on error
22336 + *             if lenp is non-NULL *lenp contains an error code (<0):
22337 + *             -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
22338 + *             -FDT_ERR_BADMAGIC,
22339 + *             -FDT_ERR_BADVERSION,
22340 + *             -FDT_ERR_BADSTATE, standard meanings
22341 + */
22342 +const char *fdt_get_name(const void *fdt, int nodeoffset, int *lenp);
22343 +
22344 +/**
22345 + * fdt_get_property - find a given property in a given node
22346 + * @fdt: pointer to the device tree blob
22347 + * @nodeoffset: offset of the node whose property to find
22348 + * @name: name of the property to find
22349 + * @lenp: pointer to an integer variable (will be overwritten) or NULL
22350 + *
22351 + * fdt_get_property() retrieves a pointer to the fdt_property
22352 + * structure within the device tree blob corresponding to the property
22353 + * named 'name' of the node at offset nodeoffset.  If lenp is
22354 + * non-NULL, the length of the property value also returned, in the
22355 + * integer pointed to by lenp.
22356 + *
22357 + * returns:
22358 + *     pointer to the structure representing the property
22359 + *             if lenp is non-NULL, *lenp contains the length of the property
22360 + *             value (>=0)
22361 + *     NULL, on error
22362 + *             if lenp is non-NULL, *lenp contains an error code (<0):
22363 + *             -FDT_ERR_NOTFOUND, node does not have named property
22364 + *             -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
22365 + *             -FDT_ERR_BADMAGIC,
22366 + *             -FDT_ERR_BADVERSION,
22367 + *             -FDT_ERR_BADSTATE,
22368 + *             -FDT_ERR_BADSTRUCTURE,
22369 + *             -FDT_ERR_TRUNCATED, standard meanings
22370 + */
22371 +const struct fdt_property *fdt_get_property(const void *fdt, int nodeoffset,
22372 +                                           const char *name, int *lenp);
22373 +static inline struct fdt_property *fdt_get_property_w(void *fdt, int nodeoffset,
22374 +                                                     const char *name,
22375 +                                                     int *lenp)
22376 +{
22377 +       return (struct fdt_property *)fdt_get_property(fdt, nodeoffset,
22378 +                                                      name, lenp);
22379 +}
22380 +
22381 +/**
22382 + * fdt_getprop - retrieve the value of a given property
22383 + * @fdt: pointer to the device tree blob
22384 + * @nodeoffset: offset of the node whose property to find
22385 + * @name: name of the property to find
22386 + * @lenp: pointer to an integer variable (will be overwritten) or NULL
22387 + *
22388 + * fdt_getprop() retrieves a pointer to the value of the property
22389 + * named 'name' of the node at offset nodeoffset (this will be a
22390 + * pointer to within the device blob itself, not a copy of the value).
22391 + * If lenp is non-NULL, the length of the property value also
22392 + * returned, in the integer pointed to by lenp.
22393 + *
22394 + * returns:
22395 + *     pointer to the property's value
22396 + *             if lenp is non-NULL, *lenp contains the length of the property
22397 + *             value (>=0)
22398 + *     NULL, on error
22399 + *             if lenp is non-NULL, *lenp contains an error code (<0):
22400 + *             -FDT_ERR_NOTFOUND, node does not have named property
22401 + *             -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
22402 + *             -FDT_ERR_BADMAGIC,
22403 + *             -FDT_ERR_BADVERSION,
22404 + *             -FDT_ERR_BADSTATE,
22405 + *             -FDT_ERR_BADSTRUCTURE,
22406 + *             -FDT_ERR_TRUNCATED, standard meanings
22407 + */
22408 +const void *fdt_getprop(const void *fdt, int nodeoffset,
22409 +                       const char *name, int *lenp);
22410 +static inline void *fdt_getprop_w(void *fdt, int nodeoffset,
22411 +                                 const char *name, int *lenp)
22412 +{
22413 +       return (void *)fdt_getprop(fdt, nodeoffset, name, lenp);
22414 +}
22415 +
22416 +/**
22417 + * fdt_get_phandle - retreive the phandle of a given node
22418 + * @fdt: pointer to the device tree blob
22419 + * @nodeoffset: structure block offset of the node
22420 + *
22421 + * fdt_get_phandle() retrieves the phandle of the device tree node at
22422 + * structure block offset nodeoffset.
22423 + *
22424 + * returns:
22425 + *     the phandle of the node at nodeoffset, on succes (!= 0, != -1)
22426 + *     0, if the node has no phandle, or another error occurs
22427 + */
22428 +uint32_t fdt_get_phandle(const void *fdt, int nodeoffset);
22429 +
22430 +/**
22431 + * fdt_get_path - determine the full path of a node
22432 + * @fdt: pointer to the device tree blob
22433 + * @nodeoffset: offset of the node whose path to find
22434 + * @buf: character buffer to contain the returned path (will be overwritten)
22435 + * @buflen: size of the character buffer at buf
22436 + *
22437 + * fdt_get_path() computes the full path of the node at offset
22438 + * nodeoffset, and records that path in the buffer at buf.
22439 + *
22440 + * NOTE: This function is expensive, as it must scan the device tree
22441 + * structure from the start to nodeoffset.
22442 + *
22443 + * returns:
22444 + *     0, on success
22445 + *             buf contains the absolute path of the node at
22446 + *             nodeoffset, as a NUL-terminated string.
22447 + *     -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
22448 + *     -FDT_ERR_NOSPACE, the path of the given node is longer than (bufsize-1)
22449 + *             characters and will not fit in the given buffer.
22450 + *     -FDT_ERR_BADMAGIC,
22451 + *     -FDT_ERR_BADVERSION,
22452 + *     -FDT_ERR_BADSTATE,
22453 + *     -FDT_ERR_BADSTRUCTURE, standard meanings
22454 + */
22455 +int fdt_get_path(const void *fdt, int nodeoffset, char *buf, int buflen);
22456 +
22457 +/**
22458 + * fdt_supernode_atdepth_offset - find a specific ancestor of a node
22459 + * @fdt: pointer to the device tree blob
22460 + * @nodeoffset: offset of the node whose parent to find
22461 + * @supernodedepth: depth of the ancestor to find
22462 + * @nodedepth: pointer to an integer variable (will be overwritten) or NULL
22463 + *
22464 + * fdt_supernode_atdepth_offset() finds an ancestor of the given node
22465 + * at a specific depth from the root (where the root itself has depth
22466 + * 0, its immediate subnodes depth 1 and so forth).  So
22467 + *     fdt_supernode_atdepth_offset(fdt, nodeoffset, 0, NULL);
22468 + * will always return 0, the offset of the root node.  If the node at
22469 + * nodeoffset has depth D, then:
22470 + *     fdt_supernode_atdepth_offset(fdt, nodeoffset, D, NULL);
22471 + * will return nodeoffset itself.
22472 + *
22473 + * NOTE: This function is expensive, as it must scan the device tree
22474 + * structure from the start to nodeoffset.
22475 + *
22476 + * returns:
22477 +
22478 + *     structure block offset of the node at node offset's ancestor
22479 + *             of depth supernodedepth (>=0), on success
22480 + *     -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
22481 +*      -FDT_ERR_NOTFOUND, supernodedepth was greater than the depth of nodeoffset
22482 + *     -FDT_ERR_BADMAGIC,
22483 + *     -FDT_ERR_BADVERSION,
22484 + *     -FDT_ERR_BADSTATE,
22485 + *     -FDT_ERR_BADSTRUCTURE, standard meanings
22486 + */
22487 +int fdt_supernode_atdepth_offset(const void *fdt, int nodeoffset,
22488 +                                int supernodedepth, int *nodedepth);
22489 +
22490 +/**
22491 + * fdt_node_depth - find the depth of a given node
22492 + * @fdt: pointer to the device tree blob
22493 + * @nodeoffset: offset of the node whose parent to find
22494 + *
22495 + * fdt_node_depth() finds the depth of a given node.  The root node
22496 + * has depth 0, its immediate subnodes depth 1 and so forth.
22497 + *
22498 + * NOTE: This function is expensive, as it must scan the device tree
22499 + * structure from the start to nodeoffset.
22500 + *
22501 + * returns:
22502 + *     depth of the node at nodeoffset (>=0), on success
22503 + *     -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
22504 + *     -FDT_ERR_BADMAGIC,
22505 + *     -FDT_ERR_BADVERSION,
22506 + *     -FDT_ERR_BADSTATE,
22507 + *     -FDT_ERR_BADSTRUCTURE, standard meanings
22508 + */
22509 +int fdt_node_depth(const void *fdt, int nodeoffset);
22510 +
22511 +/**
22512 + * fdt_parent_offset - find the parent of a given node
22513 + * @fdt: pointer to the device tree blob
22514 + * @nodeoffset: offset of the node whose parent to find
22515 + *
22516 + * fdt_parent_offset() locates the parent node of a given node (that
22517 + * is, it finds the offset of the node which contains the node at
22518 + * nodeoffset as a subnode).
22519 + *
22520 + * NOTE: This function is expensive, as it must scan the device tree
22521 + * structure from the start to nodeoffset, *twice*.
22522 + *
22523 + * returns:
22524 + *     stucture block offset of the parent of the node at nodeoffset
22525 + *             (>=0), on success
22526 + *     -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
22527 + *     -FDT_ERR_BADMAGIC,
22528 + *     -FDT_ERR_BADVERSION,
22529 + *     -FDT_ERR_BADSTATE,
22530 + *     -FDT_ERR_BADSTRUCTURE, standard meanings
22531 + */
22532 +int fdt_parent_offset(const void *fdt, int nodeoffset);
22533 +
22534 +/**
22535 + * fdt_node_offset_by_prop_value - find nodes with a given property value
22536 + * @fdt: pointer to the device tree blob
22537 + * @startoffset: only find nodes after this offset
22538 + * @propname: property name to check
22539 + * @propval: property value to search for
22540 + * @proplen: length of the value in propval
22541 + *
22542 + * fdt_node_offset_by_prop_value() returns the offset of the first
22543 + * node after startoffset, which has a property named propname whose
22544 + * value is of length proplen and has value equal to propval; or if
22545 + * startoffset is -1, the very first such node in the tree.
22546 + *
22547 + * To iterate through all nodes matching the criterion, the following
22548 + * idiom can be used:
22549 + *     offset = fdt_node_offset_by_prop_value(fdt, -1, propname,
22550 + *                                            propval, proplen);
22551 + *     while (offset != -FDT_ERR_NOTFOUND) {
22552 + *             // other code here
22553 + *             offset = fdt_node_offset_by_prop_value(fdt, offset, propname,
22554 + *                                                    propval, proplen);
22555 + *     }
22556 + *
22557 + * Note the -1 in the first call to the function, if 0 is used here
22558 + * instead, the function will never locate the root node, even if it
22559 + * matches the criterion.
22560 + *
22561 + * returns:
22562 + *     structure block offset of the located node (>= 0, >startoffset),
22563 + *              on success
22564 + *     -FDT_ERR_NOTFOUND, no node matching the criterion exists in the
22565 + *             tree after startoffset
22566 + *     -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
22567 + *     -FDT_ERR_BADMAGIC,
22568 + *     -FDT_ERR_BADVERSION,
22569 + *     -FDT_ERR_BADSTATE,
22570 + *     -FDT_ERR_BADSTRUCTURE, standard meanings
22571 + */
22572 +int fdt_node_offset_by_prop_value(const void *fdt, int startoffset,
22573 +                                 const char *propname,
22574 +                                 const void *propval, int proplen);
22575 +
22576 +/**
22577 + * fdt_node_offset_by_phandle - find the node with a given phandle
22578 + * @fdt: pointer to the device tree blob
22579 + * @phandle: phandle value
22580 + *
22581 + * fdt_node_offset_by_prop_value() returns the offset of the node
22582 + * which has the given phandle value.  If there is more than one node
22583 + * in the tree with the given phandle (an invalid tree), results are
22584 + * undefined.
22585 + *
22586 + * returns:
22587 + *     structure block offset of the located node (>= 0), on success
22588 + *     -FDT_ERR_NOTFOUND, no node with that phandle exists
22589 + *     -FDT_ERR_BADPHANDLE, given phandle value was invalid (0 or -1)
22590 + *     -FDT_ERR_BADMAGIC,
22591 + *     -FDT_ERR_BADVERSION,
22592 + *     -FDT_ERR_BADSTATE,
22593 + *     -FDT_ERR_BADSTRUCTURE, standard meanings
22594 + */
22595 +int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle);
22596 +
22597 +/**
22598 + * fdt_node_check_compatible: check a node's compatible property
22599 + * @fdt: pointer to the device tree blob
22600 + * @nodeoffset: offset of a tree node
22601 + * @compatible: string to match against
22602 + *
22603 + *
22604 + * fdt_node_check_compatible() returns 0 if the given node contains a
22605 + * 'compatible' property with the given string as one of its elements,
22606 + * it returns non-zero otherwise, or on error.
22607 + *
22608 + * returns:
22609 + *     0, if the node has a 'compatible' property listing the given string
22610 + *     1, if the node has a 'compatible' property, but it does not list
22611 + *             the given string
22612 + *     -FDT_ERR_NOTFOUND, if the given node has no 'compatible' property
22613 + *     -FDT_ERR_BADOFFSET, if nodeoffset does not refer to a BEGIN_NODE tag
22614 + *     -FDT_ERR_BADMAGIC,
22615 + *     -FDT_ERR_BADVERSION,
22616 + *     -FDT_ERR_BADSTATE,
22617 + *     -FDT_ERR_BADSTRUCTURE, standard meanings
22618 + */
22619 +int fdt_node_check_compatible(const void *fdt, int nodeoffset,
22620 +                             const char *compatible);
22621 +
22622 +/**
22623 + * fdt_node_offset_by_compatible - find nodes with a given 'compatible' value
22624 + * @fdt: pointer to the device tree blob
22625 + * @startoffset: only find nodes after this offset
22626 + * @compatible: 'compatible' string to match against
22627 + *
22628 + * fdt_node_offset_by_compatible() returns the offset of the first
22629 + * node after startoffset, which has a 'compatible' property which
22630 + * lists the given compatible string; or if startoffset is -1, the
22631 + * very first such node in the tree.
22632 + *
22633 + * To iterate through all nodes matching the criterion, the following
22634 + * idiom can be used:
22635 + *     offset = fdt_node_offset_by_compatible(fdt, -1, compatible);
22636 + *     while (offset != -FDT_ERR_NOTFOUND) {
22637 + *             // other code here
22638 + *             offset = fdt_node_offset_by_compatible(fdt, offset, compatible);
22639 + *     }
22640 + *
22641 + * Note the -1 in the first call to the function, if 0 is used here
22642 + * instead, the function will never locate the root node, even if it
22643 + * matches the criterion.
22644 + *
22645 + * returns:
22646 + *     structure block offset of the located node (>= 0, >startoffset),
22647 + *              on success
22648 + *     -FDT_ERR_NOTFOUND, no node matching the criterion exists in the
22649 + *             tree after startoffset
22650 + *     -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
22651 + *     -FDT_ERR_BADMAGIC,
22652 + *     -FDT_ERR_BADVERSION,
22653 + *     -FDT_ERR_BADSTATE,
22654 + *     -FDT_ERR_BADSTRUCTURE, standard meanings
22655 + */
22656 +int fdt_node_offset_by_compatible(const void *fdt, int startoffset,
22657 +                                 const char *compatible);
22658 +
22659 +/**********************************************************************/
22660 +/* Write-in-place functions                                           */
22661 +/**********************************************************************/
22662 +
22663 +int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,
22664 +                       const void *val, int len);
22665 +static inline int fdt_setprop_inplace_cell(void *fdt, int nodeoffset,
22666 +                                          const char *name, uint32_t val)
22667 +{
22668 +       val = cpu_to_fdt32(val);
22669 +       return fdt_setprop_inplace(fdt, nodeoffset, name, &val, sizeof(val));
22670 +}
22671 +
22672 +int fdt_nop_property(void *fdt, int nodeoffset, const char *name);
22673 +int fdt_nop_node(void *fdt, int nodeoffset);
22674 +
22675 +/**********************************************************************/
22676 +/* Sequential write functions                                         */
22677 +/**********************************************************************/
22678 +
22679 +int fdt_create(void *buf, int bufsize);
22680 +int fdt_add_reservemap_entry(void *fdt, uint64_t addr, uint64_t size);
22681 +int fdt_finish_reservemap(void *fdt);
22682 +int fdt_begin_node(void *fdt, const char *name);
22683 +int fdt_property(void *fdt, const char *name, const void *val, int len);
22684 +static inline int fdt_property_cell(void *fdt, const char *name, uint32_t val)
22685 +{
22686 +       val = cpu_to_fdt32(val);
22687 +       return fdt_property(fdt, name, &val, sizeof(val));
22688 +}
22689 +#define fdt_property_string(fdt, name, str) \
22690 +       fdt_property(fdt, name, str, strlen(str)+1)
22691 +int fdt_end_node(void *fdt);
22692 +int fdt_finish(void *fdt);
22693 +
22694 +/**********************************************************************/
22695 +/* Read-write functions                                               */
22696 +/**********************************************************************/
22697 +
22698 +int fdt_open_into(const void *fdt, void *buf, int bufsize);
22699 +int fdt_pack(void *fdt);
22700 +
22701 +int fdt_add_mem_rsv(void *fdt, uint64_t address, uint64_t size);
22702 +int fdt_del_mem_rsv(void *fdt, int n);
22703 +
22704 +int fdt_setprop(void *fdt, int nodeoffset, const char *name,
22705 +               const void *val, int len);
22706 +static inline int fdt_setprop_cell(void *fdt, int nodeoffset, const char *name,
22707 +                                  uint32_t val)
22708 +{
22709 +       val = cpu_to_fdt32(val);
22710 +       return fdt_setprop(fdt, nodeoffset, name, &val, sizeof(val));
22711 +}
22712 +#define fdt_setprop_string(fdt, nodeoffset, name, str) \
22713 +       fdt_setprop((fdt), (nodeoffset), (name), (str), strlen(str)+1)
22714 +int fdt_delprop(void *fdt, int nodeoffset, const char *name);
22715 +int fdt_add_subnode_namelen(void *fdt, int parentoffset,
22716 +                           const char *name, int namelen);
22717 +int fdt_add_subnode(void *fdt, int parentoffset, const char *name);
22718 +int fdt_del_node(void *fdt, int nodeoffset);
22719 +
22720 +/**********************************************************************/
22721 +/* Debugging / informational functions                                */
22722 +/**********************************************************************/
22723 +
22724 +const char *fdt_strerror(int errval);
22725 +
22726 +#endif /* _LIBFDT_H */
22727 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/libfdt/libfdt_internal.h powerpc.git/arch/powerpc/boot/libfdt/libfdt_internal.h
22728 --- linux-2.6.24/arch/powerpc/boot/libfdt/libfdt_internal.h     1970-01-01 01:00:00.000000000 +0100
22729 +++ powerpc.git/arch/powerpc/boot/libfdt/libfdt_internal.h      2008-01-28 20:25:49.000000000 +0100
22730 @@ -0,0 +1,89 @@
22731 +#ifndef _LIBFDT_INTERNAL_H
22732 +#define _LIBFDT_INTERNAL_H
22733 +/*
22734 + * libfdt - Flat Device Tree manipulation
22735 + * Copyright (C) 2006 David Gibson, IBM Corporation.
22736 + *
22737 + * libfdt is dual licensed: you can use it either under the terms of
22738 + * the GPL, or the BSD license, at your option.
22739 + *
22740 + *  a) This library is free software; you can redistribute it and/or
22741 + *     modify it under the terms of the GNU General Public License as
22742 + *     published by the Free Software Foundation; either version 2 of the
22743 + *     License, or (at your option) any later version.
22744 + *
22745 + *     This library is distributed in the hope that it will be useful,
22746 + *     but WITHOUT ANY WARRANTY; without even the implied warranty of
22747 + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22748 + *     GNU General Public License for more details.
22749 + *
22750 + *     You should have received a copy of the GNU General Public
22751 + *     License along with this library; if not, write to the Free
22752 + *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
22753 + *     MA 02110-1301 USA
22754 + *
22755 + * Alternatively,
22756 + *
22757 + *  b) Redistribution and use in source and binary forms, with or
22758 + *     without modification, are permitted provided that the following
22759 + *     conditions are met:
22760 + *
22761 + *     1. Redistributions of source code must retain the above
22762 + *        copyright notice, this list of conditions and the following
22763 + *        disclaimer.
22764 + *     2. Redistributions in binary form must reproduce the above
22765 + *        copyright notice, this list of conditions and the following
22766 + *        disclaimer in the documentation and/or other materials
22767 + *        provided with the distribution.
22768 + *
22769 + *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
22770 + *     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
22771 + *     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
22772 + *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22773 + *     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
22774 + *     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22775 + *     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22776 + *     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22777 + *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22778 + *     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22779 + *     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
22780 + *     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
22781 + *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22782 + */
22783 +#include <fdt.h>
22784 +
22785 +#define ALIGN(x, a)    (((x) + (a) - 1) & ~((a) - 1))
22786 +#define PALIGN(p, a)   ((void *)ALIGN((unsigned long)(p), (a)))
22787 +
22788 +#define memeq(p, q, n) (memcmp((p), (q), (n)) == 0)
22789 +#define streq(p, q)    (strcmp((p), (q)) == 0)
22790 +
22791 +uint32_t _fdt_next_tag(const void *fdt, int startoffset, int *nextoffset);
22792 +const char *_fdt_find_string(const char *strtab, int tabsize, const char *s);
22793 +int _fdt_node_end_offset(void *fdt, int nodeoffset);
22794 +
22795 +static inline const void *_fdt_offset_ptr(const void *fdt, int offset)
22796 +{
22797 +       return fdt + fdt_off_dt_struct(fdt) + offset;
22798 +}
22799 +
22800 +static inline void *_fdt_offset_ptr_w(void *fdt, int offset)
22801 +{
22802 +       return (void *)_fdt_offset_ptr(fdt, offset);
22803 +}
22804 +
22805 +static inline const struct fdt_reserve_entry *_fdt_mem_rsv(const void *fdt, int n)
22806 +{
22807 +       const struct fdt_reserve_entry *rsv_table =
22808 +               fdt + fdt_off_mem_rsvmap(fdt);
22809 +
22810 +       return rsv_table + n;
22811 +}
22812 +static inline struct fdt_reserve_entry *_fdt_mem_rsv_w(void *fdt, int n)
22813 +{
22814 +       return (void *)_fdt_mem_rsv(fdt, n);
22815 +}
22816 +
22817 +#define SW_MAGIC               (~FDT_MAGIC)
22818 +
22819 +#endif /* _LIBFDT_INTERNAL_H */
22820 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/libfdt-wrapper.c powerpc.git/arch/powerpc/boot/libfdt-wrapper.c
22821 --- linux-2.6.24/arch/powerpc/boot/libfdt-wrapper.c     1970-01-01 01:00:00.000000000 +0100
22822 +++ powerpc.git/arch/powerpc/boot/libfdt-wrapper.c      2008-01-28 20:25:49.000000000 +0100
22823 @@ -0,0 +1,184 @@
22824 +/*
22825 + * This file does the necessary interface mapping between the bootwrapper
22826 + * device tree operations and the interface provided by shared source
22827 + * files flatdevicetree.[ch].
22828 + *
22829 + * Copyright 2007 David Gibson, IBM Corporation.
22830 + *
22831 + * This library is free software; you can redistribute it and/or
22832 + * modify it under the terms of the GNU General Public License as
22833 + * published by the Free Software Foundation; either version 2 of the
22834 + * License, or (at your option) any later version.
22835 + *
22836 + * This library is distributed in the hope that it will be useful, but
22837 + * WITHOUT ANY WARRANTY; without even the implied warranty of
22838 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
22839 + * General Public License for more details.
22840 + *
22841 + * You should have received a copy of the GNU General Public License
22842 + * along with this library; if not, write to the Free Software
22843 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
22844 + * 02110-1301 USA
22845 + */
22846 +
22847 +#include <stddef.h>
22848 +#include <stdio.h>
22849 +#include <page.h>
22850 +#include <libfdt.h>
22851 +#include "ops.h"
22852 +
22853 +#define DEBUG  0
22854 +#define BAD_ERROR(err) (((err) < 0) \
22855 +                        && ((err) != -FDT_ERR_NOTFOUND) \
22856 +                        && ((err) != -FDT_ERR_EXISTS))
22857 +
22858 +#define check_err(err) \
22859 +       ({ \
22860 +               if (BAD_ERROR(err) || ((err < 0) && DEBUG)) \
22861 +                       printf("%s():%d  %s\n\r", __FUNCTION__, __LINE__, \
22862 +                              fdt_strerror(err)); \
22863 +               if (BAD_ERROR(err)) \
22864 +                       exit(); \
22865 +               (err < 0) ? -1 : 0; \
22866 +       })
22867 +
22868 +#define offset_devp(off)       \
22869 +       ({ \
22870 +               int _offset = (off); \
22871 +               check_err(_offset) ? NULL : (void *)(_offset+1); \
22872 +       })
22873 +
22874 +#define devp_offset_find(devp) (((int)(devp))-1)
22875 +#define devp_offset(devp)      (devp ? ((int)(devp))-1 : 0)
22876 +
22877 +static void *fdt;
22878 +static void *buf; /* = NULL */
22879 +
22880 +#define EXPAND_GRANULARITY     1024
22881 +
22882 +static void expand_buf(int minexpand)
22883 +{
22884 +       int size = fdt_totalsize(fdt);
22885 +       int rc;
22886 +
22887 +       size = _ALIGN(size + minexpand, EXPAND_GRANULARITY);
22888 +       buf = platform_ops.realloc(buf, size);
22889 +       if (!buf)
22890 +               fatal("Couldn't find %d bytes to expand device tree\n\r", size);
22891 +       rc = fdt_open_into(fdt, buf, size);
22892 +       if (rc != 0)
22893 +               fatal("Couldn't expand fdt into new buffer: %s\n\r",
22894 +                     fdt_strerror(rc));
22895 +
22896 +       fdt = buf;
22897 +}
22898 +
22899 +static void *fdt_wrapper_finddevice(const char *path)
22900 +{
22901 +       return offset_devp(fdt_path_offset(fdt, path));
22902 +}
22903 +
22904 +static int fdt_wrapper_getprop(const void *devp, const char *name,
22905 +                              void *buf, const int buflen)
22906 +{
22907 +       const void *p;
22908 +       int len;
22909 +
22910 +       p = fdt_getprop(fdt, devp_offset(devp), name, &len);
22911 +       if (!p)
22912 +               return check_err(len);
22913 +       memcpy(buf, p, min(len, buflen));
22914 +       return len;
22915 +}
22916 +
22917 +static int fdt_wrapper_setprop(const void *devp, const char *name,
22918 +                              const void *buf, const int len)
22919 +{
22920 +       int rc;
22921 +
22922 +       rc = fdt_setprop(fdt, devp_offset(devp), name, buf, len);
22923 +       if (rc == -FDT_ERR_NOSPACE) {
22924 +               expand_buf(len + 16);
22925 +               rc = fdt_setprop(fdt, devp_offset(devp), name, buf, len);
22926 +       }
22927 +
22928 +       return check_err(rc);
22929 +}
22930 +
22931 +static void *fdt_wrapper_get_parent(const void *devp)
22932 +{
22933 +       return offset_devp(fdt_parent_offset(fdt, devp_offset(devp)));
22934 +}
22935 +
22936 +static void *fdt_wrapper_create_node(const void *devp, const char *name)
22937 +{
22938 +       int offset;
22939 +
22940 +       offset = fdt_add_subnode(fdt, devp_offset(devp), name);
22941 +       if (offset == -FDT_ERR_NOSPACE) {
22942 +               expand_buf(strlen(name) + 16);
22943 +               offset = fdt_add_subnode(fdt, devp_offset(devp), name);
22944 +       }
22945 +
22946 +       return offset_devp(offset);
22947 +}
22948 +
22949 +static void *fdt_wrapper_find_node_by_prop_value(const void *prev,
22950 +                                                const char *name,
22951 +                                                const char *val,
22952 +                                                int len)
22953 +{
22954 +       int offset = fdt_node_offset_by_prop_value(fdt, devp_offset_find(prev),
22955 +                                                  name, val, len);
22956 +       return offset_devp(offset);
22957 +}
22958 +
22959 +static char *fdt_wrapper_get_path(const void *devp, char *buf, int len)
22960 +{
22961 +       int rc;
22962 +
22963 +       rc = fdt_get_path(fdt, devp_offset(devp), buf, len);
22964 +       if (check_err(rc))
22965 +               return NULL;
22966 +       return buf;
22967 +}
22968 +
22969 +static unsigned long fdt_wrapper_finalize(void)
22970 +{
22971 +       int rc;
22972 +
22973 +       rc = fdt_pack(fdt);
22974 +       if (rc != 0)
22975 +               fatal("Couldn't pack flat tree: %s\n\r",
22976 +                     fdt_strerror(rc));
22977 +       return (unsigned long)fdt;
22978 +}
22979 +
22980 +void fdt_init(void *blob)
22981 +{
22982 +       int err;
22983 +
22984 +       dt_ops.finddevice = fdt_wrapper_finddevice;
22985 +       dt_ops.getprop = fdt_wrapper_getprop;
22986 +       dt_ops.setprop = fdt_wrapper_setprop;
22987 +       dt_ops.get_parent = fdt_wrapper_get_parent;
22988 +       dt_ops.create_node = fdt_wrapper_create_node;
22989 +       dt_ops.find_node_by_prop_value = fdt_wrapper_find_node_by_prop_value;
22990 +       dt_ops.get_path = fdt_wrapper_get_path;
22991 +       dt_ops.finalize = fdt_wrapper_finalize;
22992 +
22993 +       /* Make sure the dt blob is the right version and so forth */
22994 +       fdt = blob;
22995 +       err = fdt_open_into(fdt, fdt, fdt_totalsize(blob));
22996 +       if (err == -FDT_ERR_NOSPACE) {
22997 +               int bufsize = fdt_totalsize(fdt) + 4;
22998 +               buf = malloc(bufsize);
22999 +               err = fdt_open_into(fdt, buf, bufsize);
23000 +       }
23001 +
23002 +       if (err != 0)
23003 +               fatal("fdt_init(): %s\n\r", fdt_strerror(err));
23004 +
23005 +       if (buf)
23006 +               fdt = buf;
23007 +}
23008 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/libfdt_env.h powerpc.git/arch/powerpc/boot/libfdt_env.h
23009 --- linux-2.6.24/arch/powerpc/boot/libfdt_env.h 1970-01-01 01:00:00.000000000 +0100
23010 +++ powerpc.git/arch/powerpc/boot/libfdt_env.h  2008-01-28 20:25:49.000000000 +0100
23011 @@ -0,0 +1,17 @@
23012 +#ifndef _ARCH_POWERPC_BOOT_LIBFDT_ENV_H
23013 +#define _ARCH_POWERPC_BOOT_LIBFDT_ENV_H
23014 +
23015 +#include <types.h>
23016 +#include <string.h>
23017 +
23018 +typedef u32 uint32_t;
23019 +typedef u64 uint64_t;
23020 +
23021 +#define fdt16_to_cpu(x)                (x)
23022 +#define cpu_to_fdt16(x)                (x)
23023 +#define fdt32_to_cpu(x)                (x)
23024 +#define cpu_to_fdt32(x)                (x)
23025 +#define fdt64_to_cpu(x)                (x)
23026 +#define cpu_to_fdt64(x)                (x)
23027 +
23028 +#endif /* _ARCH_POWERPC_BOOT_LIBFDT_ENV_H */
23029 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/main.c powerpc.git/arch/powerpc/boot/main.c
23030 --- linux-2.6.24/arch/powerpc/boot/main.c       2008-01-24 23:58:37.000000000 +0100
23031 +++ powerpc.git/arch/powerpc/boot/main.c        2008-01-28 20:25:49.000000000 +0100
23032 @@ -16,7 +16,6 @@
23033  #include "stdio.h"
23034  #include "ops.h"
23035  #include "gunzip_util.h"
23036 -#include "flatdevtree.h"
23037  #include "reg.h"
23038  
23039  static struct gunzip_state gzstate;
23040 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/ops.h powerpc.git/arch/powerpc/boot/ops.h
23041 --- linux-2.6.24/arch/powerpc/boot/ops.h        2008-01-24 23:58:37.000000000 +0100
23042 +++ powerpc.git/arch/powerpc/boot/ops.h 2008-01-28 20:25:49.000000000 +0100
23043 @@ -79,7 +79,7 @@
23044  extern struct loader_info loader_info;
23045  
23046  void start(void);
23047 -int ft_init(void *dt_blob, unsigned int max_size, unsigned int max_find_device);
23048 +void fdt_init(void *blob);
23049  int serial_console_init(void);
23050  int ns16550_console_init(void *devp, struct serial_console_data *scdp);
23051  int mpsc_console_init(void *devp, struct serial_console_data *scdp);
23052 @@ -159,9 +159,23 @@
23053         return find_node_by_prop_value_str(prev, "device_type", type);
23054  }
23055  
23056 +static inline void *find_node_by_alias(const char *alias)
23057 +{
23058 +       void *devp = finddevice("/aliases");
23059 +
23060 +       if (devp) {
23061 +               char path[MAX_PATH_LEN];
23062 +               if (getprop(devp, alias, path, MAX_PATH_LEN) > 0)
23063 +                       return finddevice(path);
23064 +       }
23065 +
23066 +       return NULL;
23067 +}
23068 +
23069  void dt_fixup_memory(u64 start, u64 size);
23070  void dt_fixup_cpu_clocks(u32 cpufreq, u32 tbfreq, u32 busfreq);
23071  void dt_fixup_clock(const char *path, u32 freq);
23072 +void dt_fixup_mac_address_by_alias(const char *alias, const u8 *addr);
23073  void dt_fixup_mac_address(u32 index, const u8 *addr);
23074  void __dt_fixup_mac_addresses(u32 startindex, ...);
23075  #define dt_fixup_mac_addresses(...) \
23076 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/prpmc2800.c powerpc.git/arch/powerpc/boot/prpmc2800.c
23077 --- linux-2.6.24/arch/powerpc/boot/prpmc2800.c  2008-01-24 23:58:37.000000000 +0100
23078 +++ powerpc.git/arch/powerpc/boot/prpmc2800.c   2008-01-28 20:25:49.000000000 +0100
23079 @@ -547,8 +547,7 @@
23080         if (!dtb)
23081                 exit();
23082         memmove(dtb, _dtb_start, dt_size);
23083 -       if (ft_init(dtb, dt_size, 16))
23084 -               exit();
23085 +       fdt_init(dtb);
23086  
23087         bridge_base = mv64x60_get_bridge_base();
23088  
23089 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/ps3.c powerpc.git/arch/powerpc/boot/ps3.c
23090 --- linux-2.6.24/arch/powerpc/boot/ps3.c        2008-01-24 23:58:37.000000000 +0100
23091 +++ powerpc.git/arch/powerpc/boot/ps3.c 2008-01-28 20:25:49.000000000 +0100
23092 @@ -131,7 +131,7 @@
23093         printf("\n-- PS3 bootwrapper --\n");
23094  
23095         simple_alloc_init(_end, heapsize, 32, 64);
23096 -       ft_init(_dtb_start, 0, 4);
23097 +       fdt_init(_dtb_start);
23098  
23099         chosen = finddevice("/chosen");
23100  
23101 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/redboot-8xx.c powerpc.git/arch/powerpc/boot/redboot-8xx.c
23102 --- linux-2.6.24/arch/powerpc/boot/redboot-8xx.c        1970-01-01 01:00:00.000000000 +0100
23103 +++ powerpc.git/arch/powerpc/boot/redboot-8xx.c 2008-01-28 20:25:49.000000000 +0100
23104 @@ -0,0 +1,58 @@
23105 +/*
23106 + * RedBoot firmware support
23107 + *
23108 + * Author: Scott Wood <scottwood@freescale.com>
23109 + *
23110 + * Copyright (c) 2007 Freescale Semiconductor, Inc.
23111 + *
23112 + * This program is free software; you can redistribute it and/or modify it
23113 + * under the terms of the GNU General Public License version 2 as published
23114 + * by the Free Software Foundation.
23115 + */
23116 +
23117 +#include "ops.h"
23118 +#include "stdio.h"
23119 +#include "redboot.h"
23120 +#include "fsl-soc.h"
23121 +#include "io.h"
23122 +
23123 +static bd_t bd;
23124 +BSS_STACK(4096);
23125 +
23126 +#define MHZ(x) ((x + 500000) / 1000000)
23127 +
23128 +static void platform_fixups(void)
23129 +{
23130 +       void *node;
23131 +
23132 +       dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
23133 +       dt_fixup_mac_addresses(bd.bi_enetaddr);
23134 +       dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 16, bd.bi_busfreq);
23135 +
23136 +       node = finddevice("/soc/cpm/brg");
23137 +       if (node) {
23138 +               printf("BRG clock-frequency <- 0x%x (%dMHz)\r\n",
23139 +                      bd.bi_busfreq, MHZ(bd.bi_busfreq));
23140 +               setprop(node, "clock-frequency",  &bd.bi_busfreq, 4);
23141 +       }
23142 +}
23143 +
23144 +void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
23145 +                   unsigned long r6, unsigned long r7)
23146 +{
23147 +       memcpy(&bd, (char *)r3, sizeof(bd));
23148 +
23149 +       if (bd.bi_tag != 0x42444944)
23150 +               return;
23151 +
23152 +       simple_alloc_init(_end,
23153 +                         bd.bi_memstart + bd.bi_memsize - (unsigned long)_end,
23154 +                         32, 64);
23155 +
23156 +       fdt_init(_dtb_start);
23157 +       serial_console_init();
23158 +       platform_ops.fixups = platform_fixups;
23159 +
23160 +       loader_info.cmdline = (char *)bd.bi_cmdline;
23161 +       loader_info.cmdline_len = strlen((char *)bd.bi_cmdline);
23162 +}
23163 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/redboot.h powerpc.git/arch/powerpc/boot/redboot.h
23164 --- linux-2.6.24/arch/powerpc/boot/redboot.h    1970-01-01 01:00:00.000000000 +0100
23165 +++ powerpc.git/arch/powerpc/boot/redboot.h     2008-01-28 20:25:49.000000000 +0100
23166 @@ -0,0 +1,56 @@
23167 +#ifndef _PPC_REDBOOT_H
23168 +#define _PPC_REDBOOT_H
23169 +
23170 +//=========================================================================
23171 +// include/asm-ppc/redboot.h
23172 +//   Copyright (c) 2002, 2003 Gary Thomas (<gary@mlbassoc.com>
23173 +//   Copyright (c) 1997 Dan Malek (dmalek@jlc.net)
23174 +
23175 +//
23176 +// Board specific details, as provided by RedBoot
23177 +//
23178 +
23179 +/* A Board Information structure that is given to a program when
23180 + * RedBoot starts it up.  Note: not all fields make sense for all
23181 + * architectures and it's up to the platform specific code to fill
23182 + * in the details.
23183 + */
23184 +typedef struct bd_info {
23185 +    unsigned int   bi_tag;        /* Should be 0x42444944 "BDID" */
23186 +    unsigned int   bi_size;       /* Size of this structure */
23187 +    unsigned int   bi_revision;   /* revision of this structure */
23188 +    unsigned int   bi_bdate;      /* bootstrap date, i.e. 0x19971106 */
23189 +    unsigned int   bi_memstart;   /* Memory start address */
23190 +    unsigned int   bi_memsize;    /* Memory (end) size in bytes */
23191 +    unsigned int   bi_intfreq;    /* Internal Freq, in Hz */
23192 +    unsigned int   bi_busfreq;    /* Bus Freq, in Hz */
23193 +    unsigned int   bi_cpmfreq;    /* CPM Freq, in Hz */
23194 +    unsigned int   bi_brgfreq;    /* BRG Freq, in Hz */
23195 +    unsigned int   bi_vco;        /* VCO Out from PLL */
23196 +    unsigned int   bi_pci_freq;   /* PCI Freq, in Hz */
23197 +    unsigned int   bi_baudrate;   /* Default console baud rate */
23198 +    unsigned int   bi_immr;       /* IMMR when called from boot rom */
23199 +    unsigned char  bi_enetaddr[6];
23200 +    unsigned int   bi_flashbase;  /* Physical address of FLASH memory */
23201 +    unsigned int   bi_flashsize;  /* Length of FLASH memory */
23202 +    int            bi_flashwidth; /* Width (8,16,32,64) */
23203 +    unsigned char *bi_cmdline;    /* Pointer to command line */
23204 +    unsigned char  bi_esa[3][6];  /* Ethernet station addresses */
23205 +    unsigned int   bi_ramdisk_begin, bi_ramdisk_end;
23206 +    struct {                      /* Information about [main] video screen */
23207 +        short x_res;              /*   Horizontal resolution in pixels */
23208 +        short y_res;              /*   Vertical resolution in pixels */
23209 +        short bpp;                /*   Bits/pixel */
23210 +        short mode;               /*   Type of pixels (packed, indexed) */
23211 +        unsigned long fb;         /*   Pointer to frame buffer (pixel) memory */
23212 +    } bi_video;
23213 +    void         (*bi_cputc)(char);   /* Write a character to the RedBoot console */
23214 +    char         (*bi_cgetc)(void);   /* Read a character from the RedBoot console */
23215 +    int          (*bi_ctstc)(void);   /* Test for input on the RedBoot console */
23216 +} bd_t;
23217 +
23218 +#define BI_REV 0x0102    /* Version 1.02 */
23219 +
23220 +#define bi_pci_busfreq bi_pci_freq
23221 +#define bi_immr_base   bi_immr
23222 +#endif
23223 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/reg.h powerpc.git/arch/powerpc/boot/reg.h
23224 --- linux-2.6.24/arch/powerpc/boot/reg.h        2008-01-24 23:58:37.000000000 +0100
23225 +++ powerpc.git/arch/powerpc/boot/reg.h 2008-01-28 20:25:49.000000000 +0100
23226 @@ -16,6 +16,14 @@
23227         return pvr;
23228  }
23229  
23230 +#define __stringify_1(x)       #x
23231 +#define __stringify(x)         __stringify_1(x)
23232 +
23233 +#define mfspr(rn)      ({unsigned long rval; \
23234 +                       asm volatile("mfspr %0," __stringify(rn) \
23235 +                               : "=r" (rval)); rval; })
23236 +#define mtspr(rn, v)   asm volatile("mtspr " __stringify(rn) ",%0" : : "r" (v))
23237 +
23238  register void *__stack_pointer asm("r1");
23239  #define get_sp()       (__stack_pointer)
23240  
23241 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/serial.c powerpc.git/arch/powerpc/boot/serial.c
23242 --- linux-2.6.24/arch/powerpc/boot/serial.c     2008-01-24 23:58:37.000000000 +0100
23243 +++ powerpc.git/arch/powerpc/boot/serial.c      2008-01-28 20:25:49.000000000 +0100
23244 @@ -128,7 +128,8 @@
23245                 rc = cpm_console_init(devp, &serial_cd);
23246         else if (dt_is_compatible(devp, "mpc5200-psc-uart"))
23247                 rc = mpc5200_psc_console_init(devp, &serial_cd);
23248 -       else if (dt_is_compatible(devp, "xilinx,uartlite"))
23249 +       else if (dt_is_compatible(devp, "xlnx,opb-uartlite-1.00.b") ||
23250 +                dt_is_compatible(devp, "xlnx,xps-uartlite-1.00.a"))
23251                 rc = uartlite_console_init(devp, &serial_cd);
23252  
23253         /* Add other serial console driver calls here */
23254 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/treeboot-walnut.c powerpc.git/arch/powerpc/boot/treeboot-walnut.c
23255 --- linux-2.6.24/arch/powerpc/boot/treeboot-walnut.c    2008-01-24 23:58:37.000000000 +0100
23256 +++ powerpc.git/arch/powerpc/boot/treeboot-walnut.c     2008-01-28 20:25:49.000000000 +0100
23257 @@ -20,55 +20,6 @@
23258  
23259  BSS_STACK(4096);
23260  
23261 -void ibm405gp_fixup_clocks(unsigned int sysclk, unsigned int ser_clk)
23262 -{
23263 -       u32 pllmr = mfdcr(DCRN_CPC0_PLLMR);
23264 -       u32 cpc0_cr0 = mfdcr(DCRN_405_CPC0_CR0);
23265 -       u32 cpc0_cr1 = mfdcr(DCRN_405_CPC0_CR1);
23266 -       u32 cpu, plb, opb, ebc, tb, uart0, uart1, m;
23267 -       u32 fwdv, fbdv, cbdv, opdv, epdv, udiv;
23268 -
23269 -       fwdv = (8 - ((pllmr & 0xe0000000) >> 29));
23270 -       fbdv = (pllmr & 0x1e000000) >> 25;
23271 -       cbdv = ((pllmr & 0x00060000) >> 17) + 1;
23272 -       opdv = ((pllmr & 0x00018000) >> 15) + 1;
23273 -       epdv = ((pllmr & 0x00001800) >> 13) + 2;
23274 -       udiv = ((cpc0_cr0 & 0x3e) >> 1) + 1;
23275 -
23276 -       m = fwdv * fbdv * cbdv;
23277 -
23278 -       cpu = sysclk * m / fwdv;
23279 -       plb = cpu / cbdv;
23280 -       opb = plb / opdv;
23281 -       ebc = plb / epdv;
23282 -
23283 -       if (cpc0_cr0 & 0x80) {
23284 -               /* uart0 uses the external clock */
23285 -               uart0 = ser_clk;
23286 -       } else {
23287 -               uart0 = cpu / udiv;
23288 -       }
23289 -
23290 -       if (cpc0_cr0 & 0x40) {
23291 -               /* uart1 uses the external clock */
23292 -               uart1 = ser_clk;
23293 -       } else {
23294 -               uart1 = cpu / udiv;
23295 -       }
23296 -
23297 -       /* setup the timebase clock to tick at the cpu frequency */
23298 -       cpc0_cr1 = cpc0_cr1 & ~0x00800000;
23299 -       mtdcr(DCRN_405_CPC0_CR1, cpc0_cr1);
23300 -       tb = cpu;
23301 -
23302 -       dt_fixup_cpu_clocks(cpu, tb, 0);
23303 -       dt_fixup_clock("/plb", plb);
23304 -       dt_fixup_clock("/plb/opb", opb);
23305 -       dt_fixup_clock("/plb/ebc", ebc);
23306 -       dt_fixup_clock("/plb/opb/serial@ef600300", uart0);
23307 -       dt_fixup_clock("/plb/opb/serial@ef600400", uart1);
23308 -}
23309 -
23310  static void walnut_flashsel_fixup(void)
23311  {
23312         void *devp, *sram;
23313 @@ -112,7 +63,7 @@
23314  #define WALNUT_OPENBIOS_MAC_OFF 0xfffffe0b
23315  static void walnut_fixups(void)
23316  {
23317 -       ibm4xx_fixup_memsize();
23318 +       ibm4xx_sdram_fixup_memsize();
23319         ibm405gp_fixup_clocks(33330000, 0xa8c000);
23320         ibm4xx_quiesce_eth((u32 *)0xef600800, NULL);
23321         ibm4xx_fixup_ebc_ranges("/plb/ebc");
23322 @@ -128,6 +79,6 @@
23323         simple_alloc_init(_end, avail_ram, 32, 32);
23324         platform_ops.fixups = walnut_fixups;
23325         platform_ops.exit = ibm40x_dbcr_reset;
23326 -       ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
23327 +       fdt_init(_dtb_start);
23328         serial_console_init();
23329  }
23330 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/boot/wrapper powerpc.git/arch/powerpc/boot/wrapper
23331 --- linux-2.6.24/arch/powerpc/boot/wrapper      2008-01-24 23:58:37.000000000 +0100
23332 +++ powerpc.git/arch/powerpc/boot/wrapper       2008-01-28 20:25:49.000000000 +0100
23333 @@ -45,6 +45,7 @@
23334  
23335  # directory for object and other files used by this script
23336  object=arch/powerpc/boot
23337 +objbin=$object
23338  
23339  # directory for working files
23340  tmpdir=.
23341 @@ -95,6 +96,7 @@
23342         shift
23343         [ "$#" -gt 0 ] || usage
23344         object="$1"
23345 +       objbin="$1"
23346         ;;
23347      -W)
23348         shift
23349 @@ -116,10 +118,13 @@
23350  done
23351  
23352  if [ -n "$dts" ]; then
23353 +    if [ ! -r "$dts" -a -r "$object/dts/$dts" ]; then
23354 +       dts="$object/dts/$dts"
23355 +    fi
23356      if [ -z "$dtb" ]; then
23357         dtb="$platform.dtb"
23358      fi
23359 -    dtc -O dtb -o "$dtb" -b 0 -V 16 "$dts"
23360 +    $object/dtc -O dtb -o "$dtb" -b 0 "$dts"
23361  fi
23362  
23363  if [ -z "$kernel" ]; then
23364 @@ -163,7 +168,7 @@
23365      ksection=.kernel:vmlinux.bin
23366      isection=.kernel:initrd
23367      ;;
23368 -ep88xc)
23369 +ep88xc|ep405|redboot*|ep8248e)
23370      platformo="$object/fixed-head.o $object/$platform.o"
23371      binary=y
23372      ;;
23373 @@ -246,11 +251,11 @@
23374  # post-processing needed for some platforms
23375  case "$platform" in
23376  pseries|chrp)
23377 -    $object/addnote "$ofile"
23378 +    $objbin/addnote "$ofile"
23379      ;;
23380  coff)
23381      ${CROSS}objcopy -O aixcoff-rs6000 --set-start "$entry" "$ofile"
23382 -    $object/hack-coff "$ofile"
23383 +    $objbin/hack-coff "$ofile"
23384      ;;
23385  cuboot*)
23386      gzip -f -9 "$ofile"
23387 @@ -259,7 +264,7 @@
23388      ;;
23389  treeboot*)
23390      mv "$ofile" "$ofile.elf"
23391 -    $object/mktree "$ofile.elf" "$ofile" "$base" "$entry"
23392 +    $objbin/mktree "$ofile.elf" "$ofile" "$base" "$entry"
23393      if [ -z "$cacheit" ]; then
23394         rm -f "$ofile.elf"
23395      fi
23396 @@ -287,8 +292,6 @@
23397      overlay_dest="256"
23398      overlay_size="256"
23399  
23400 -    rm -f "$object/otheros.bld"
23401 -
23402      ${CROSS}objcopy -O binary "$ofile" "$ofile.bin"
23403  
23404      dd if="$ofile.bin" of="$ofile.bin" conv=notrunc   \
23405 @@ -299,6 +302,8 @@
23406          skip=$system_reset_overlay seek=$overlay_dest \
23407          count=$overlay_size bs=1
23408  
23409 -    gzip --force -9 --stdout "$ofile.bin" > "$object/otheros.bld"
23410 +    odir="$(dirname "$ofile.bin")"
23411 +    rm -f "$odir/otheros.bld"
23412 +    gzip --force -9 --stdout "$ofile.bin" > "$odir/otheros.bld"
23413      ;;
23414  esac
23415 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/configs/adder875-redboot_defconfig powerpc.git/arch/powerpc/configs/adder875-redboot_defconfig
23416 --- linux-2.6.24/arch/powerpc/configs/adder875-redboot_defconfig        1970-01-01 01:00:00.000000000 +0100
23417 +++ powerpc.git/arch/powerpc/configs/adder875-redboot_defconfig 2008-01-28 20:25:49.000000000 +0100
23418 @@ -0,0 +1,798 @@
23419 +#
23420 +# Automatically generated make config: don't edit
23421 +# Linux kernel version: 2.6.24-rc6
23422 +# Thu Jan 17 16:17:38 2008
23423 +#
23424 +# CONFIG_PPC64 is not set
23425 +
23426 +#
23427 +# Processor support
23428 +#
23429 +# CONFIG_6xx is not set
23430 +# CONFIG_PPC_85xx is not set
23431 +CONFIG_PPC_8xx=y
23432 +# CONFIG_40x is not set
23433 +# CONFIG_44x is not set
23434 +# CONFIG_E200 is not set
23435 +CONFIG_8xx=y
23436 +# CONFIG_PPC_MM_SLICES is not set
23437 +CONFIG_NOT_COHERENT_CACHE=y
23438 +CONFIG_PPC32=y
23439 +CONFIG_WORD_SIZE=32
23440 +CONFIG_PPC_MERGE=y
23441 +CONFIG_MMU=y
23442 +CONFIG_GENERIC_CMOS_UPDATE=y
23443 +CONFIG_GENERIC_TIME=y
23444 +CONFIG_GENERIC_TIME_VSYSCALL=y
23445 +CONFIG_GENERIC_CLOCKEVENTS=y
23446 +CONFIG_GENERIC_HARDIRQS=y
23447 +CONFIG_IRQ_PER_CPU=y
23448 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
23449 +CONFIG_ARCH_HAS_ILOG2_U32=y
23450 +CONFIG_GENERIC_HWEIGHT=y
23451 +CONFIG_GENERIC_CALIBRATE_DELAY=y
23452 +CONFIG_GENERIC_FIND_NEXT_BIT=y
23453 +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
23454 +CONFIG_PPC=y
23455 +CONFIG_EARLY_PRINTK=y
23456 +CONFIG_GENERIC_NVRAM=y
23457 +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
23458 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
23459 +CONFIG_PPC_OF=y
23460 +CONFIG_OF=y
23461 +# CONFIG_PPC_UDBG_16550 is not set
23462 +# CONFIG_GENERIC_TBSYNC is not set
23463 +CONFIG_AUDIT_ARCH=y
23464 +CONFIG_GENERIC_BUG=y
23465 +# CONFIG_DEFAULT_UIMAGE is not set
23466 +CONFIG_REDBOOT=y
23467 +# CONFIG_PPC_DCR_NATIVE is not set
23468 +# CONFIG_PPC_DCR_MMIO is not set
23469 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
23470 +
23471 +#
23472 +# General setup
23473 +#
23474 +CONFIG_EXPERIMENTAL=y
23475 +CONFIG_BROKEN_ON_SMP=y
23476 +CONFIG_INIT_ENV_ARG_LIMIT=32
23477 +CONFIG_LOCALVERSION=""
23478 +CONFIG_LOCALVERSION_AUTO=y
23479 +# CONFIG_SWAP is not set
23480 +CONFIG_SYSVIPC=y
23481 +CONFIG_SYSVIPC_SYSCTL=y
23482 +# CONFIG_POSIX_MQUEUE is not set
23483 +# CONFIG_BSD_PROCESS_ACCT is not set
23484 +# CONFIG_TASKSTATS is not set
23485 +# CONFIG_USER_NS is not set
23486 +# CONFIG_PID_NS is not set
23487 +# CONFIG_AUDIT is not set
23488 +# CONFIG_IKCONFIG is not set
23489 +CONFIG_LOG_BUF_SHIFT=14
23490 +# CONFIG_CGROUPS is not set
23491 +CONFIG_FAIR_GROUP_SCHED=y
23492 +CONFIG_FAIR_USER_SCHED=y
23493 +# CONFIG_FAIR_CGROUP_SCHED is not set
23494 +CONFIG_SYSFS_DEPRECATED=y
23495 +# CONFIG_RELAY is not set
23496 +# CONFIG_BLK_DEV_INITRD is not set
23497 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
23498 +CONFIG_SYSCTL=y
23499 +CONFIG_EMBEDDED=y
23500 +# CONFIG_SYSCTL_SYSCALL is not set
23501 +CONFIG_KALLSYMS=y
23502 +# CONFIG_KALLSYMS_ALL is not set
23503 +# CONFIG_KALLSYMS_EXTRA_PASS is not set
23504 +CONFIG_HOTPLUG=y
23505 +CONFIG_PRINTK=y
23506 +CONFIG_BUG=y
23507 +# CONFIG_ELF_CORE is not set
23508 +# CONFIG_BASE_FULL is not set
23509 +# CONFIG_FUTEX is not set
23510 +CONFIG_ANON_INODES=y
23511 +CONFIG_EPOLL=y
23512 +CONFIG_SIGNALFD=y
23513 +CONFIG_EVENTFD=y
23514 +CONFIG_SHMEM=y
23515 +# CONFIG_VM_EVENT_COUNTERS is not set
23516 +CONFIG_SLUB_DEBUG=y
23517 +# CONFIG_SLAB is not set
23518 +CONFIG_SLUB=y
23519 +# CONFIG_SLOB is not set
23520 +# CONFIG_TINY_SHMEM is not set
23521 +CONFIG_BASE_SMALL=1
23522 +# CONFIG_MODULES is not set
23523 +CONFIG_BLOCK=y
23524 +# CONFIG_LBD is not set
23525 +# CONFIG_BLK_DEV_IO_TRACE is not set
23526 +# CONFIG_LSF is not set
23527 +# CONFIG_BLK_DEV_BSG is not set
23528 +
23529 +#
23530 +# IO Schedulers
23531 +#
23532 +CONFIG_IOSCHED_NOOP=y
23533 +# CONFIG_IOSCHED_AS is not set
23534 +CONFIG_IOSCHED_DEADLINE=y
23535 +# CONFIG_IOSCHED_CFQ is not set
23536 +# CONFIG_DEFAULT_AS is not set
23537 +CONFIG_DEFAULT_DEADLINE=y
23538 +# CONFIG_DEFAULT_CFQ is not set
23539 +# CONFIG_DEFAULT_NOOP is not set
23540 +CONFIG_DEFAULT_IOSCHED="deadline"
23541 +
23542 +#
23543 +# Platform support
23544 +#
23545 +# CONFIG_PPC_MPC52xx is not set
23546 +# CONFIG_PPC_MPC5200 is not set
23547 +# CONFIG_PPC_CELL is not set
23548 +# CONFIG_PPC_CELL_NATIVE is not set
23549 +CONFIG_CPM1=y
23550 +# CONFIG_MPC8XXFADS is not set
23551 +# CONFIG_MPC86XADS is not set
23552 +# CONFIG_MPC885ADS is not set
23553 +# CONFIG_PPC_EP88XC is not set
23554 +CONFIG_PPC_ADDER875=y
23555 +
23556 +#
23557 +# MPC8xx CPM Options
23558 +#
23559 +
23560 +#
23561 +# Generic MPC8xx Options
23562 +#
23563 +CONFIG_8xx_COPYBACK=y
23564 +# CONFIG_8xx_CPU6 is not set
23565 +CONFIG_8xx_CPU15=y
23566 +CONFIG_NO_UCODE_PATCH=y
23567 +# CONFIG_USB_SOF_UCODE_PATCH is not set
23568 +# CONFIG_I2C_SPI_UCODE_PATCH is not set
23569 +# CONFIG_I2C_SPI_SMC1_UCODE_PATCH is not set
23570 +# CONFIG_PQ2ADS is not set
23571 +# CONFIG_MPIC is not set
23572 +# CONFIG_MPIC_WEIRD is not set
23573 +# CONFIG_PPC_I8259 is not set
23574 +# CONFIG_PPC_RTAS is not set
23575 +# CONFIG_MMIO_NVRAM is not set
23576 +# CONFIG_PPC_MPC106 is not set
23577 +# CONFIG_PPC_970_NAP is not set
23578 +# CONFIG_PPC_INDIRECT_IO is not set
23579 +# CONFIG_GENERIC_IOMAP is not set
23580 +# CONFIG_CPU_FREQ is not set
23581 +# CONFIG_CPM2 is not set
23582 +CONFIG_PPC_CPM_NEW_BINDING=y
23583 +# CONFIG_FSL_ULI1575 is not set
23584 +CONFIG_CPM=y
23585 +
23586 +#
23587 +# Kernel options
23588 +#
23589 +# CONFIG_HIGHMEM is not set
23590 +# CONFIG_TICK_ONESHOT is not set
23591 +# CONFIG_NO_HZ is not set
23592 +# CONFIG_HIGH_RES_TIMERS is not set
23593 +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
23594 +# CONFIG_HZ_100 is not set
23595 +# CONFIG_HZ_250 is not set
23596 +# CONFIG_HZ_300 is not set
23597 +CONFIG_HZ_1000=y
23598 +CONFIG_HZ=1000
23599 +CONFIG_PREEMPT_NONE=y
23600 +# CONFIG_PREEMPT_VOLUNTARY is not set
23601 +# CONFIG_PREEMPT is not set
23602 +CONFIG_BINFMT_ELF=y
23603 +# CONFIG_BINFMT_MISC is not set
23604 +# CONFIG_MATH_EMULATION is not set
23605 +# CONFIG_8XX_MINIMAL_FPEMU is not set
23606 +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
23607 +CONFIG_ARCH_FLATMEM_ENABLE=y
23608 +CONFIG_ARCH_POPULATES_NODE_MAP=y
23609 +CONFIG_SELECT_MEMORY_MODEL=y
23610 +CONFIG_FLATMEM_MANUAL=y
23611 +# CONFIG_DISCONTIGMEM_MANUAL is not set
23612 +# CONFIG_SPARSEMEM_MANUAL is not set
23613 +CONFIG_FLATMEM=y
23614 +CONFIG_FLAT_NODE_MEM_MAP=y
23615 +# CONFIG_SPARSEMEM_STATIC is not set
23616 +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
23617 +CONFIG_SPLIT_PTLOCK_CPUS=4
23618 +# CONFIG_RESOURCES_64BIT is not set
23619 +CONFIG_ZONE_DMA_FLAG=1
23620 +CONFIG_BOUNCE=y
23621 +CONFIG_VIRT_TO_BUS=y
23622 +# CONFIG_PROC_DEVICETREE is not set
23623 +# CONFIG_CMDLINE_BOOL is not set
23624 +# CONFIG_PM is not set
23625 +CONFIG_SUSPEND_UP_POSSIBLE=y
23626 +CONFIG_HIBERNATION_UP_POSSIBLE=y
23627 +# CONFIG_SECCOMP is not set
23628 +CONFIG_WANT_DEVICE_TREE=y
23629 +CONFIG_DEVICE_TREE="adder875-redboot.dts"
23630 +CONFIG_ISA_DMA_API=y
23631 +
23632 +#
23633 +# Bus options
23634 +#
23635 +CONFIG_ZONE_DMA=y
23636 +CONFIG_FSL_SOC=y
23637 +# CONFIG_PCI is not set
23638 +# CONFIG_PCI_DOMAINS is not set
23639 +# CONFIG_PCI_SYSCALL is not set
23640 +# CONFIG_PCI_QSPAN is not set
23641 +# CONFIG_ARCH_SUPPORTS_MSI is not set
23642 +# CONFIG_PCCARD is not set
23643 +
23644 +#
23645 +# Advanced setup
23646 +#
23647 +# CONFIG_ADVANCED_OPTIONS is not set
23648 +
23649 +#
23650 +# Default settings for advanced configuration options are used
23651 +#
23652 +CONFIG_HIGHMEM_START=0xfe000000
23653 +CONFIG_LOWMEM_SIZE=0x30000000
23654 +CONFIG_KERNEL_START=0xc0000000
23655 +CONFIG_TASK_SIZE=0x80000000
23656 +CONFIG_CONSISTENT_START=0xfd000000
23657 +CONFIG_CONSISTENT_SIZE=0x00200000
23658 +CONFIG_BOOT_LOAD=0x00400000
23659 +
23660 +#
23661 +# Networking
23662 +#
23663 +CONFIG_NET=y
23664 +
23665 +#
23666 +# Networking options
23667 +#
23668 +CONFIG_PACKET=y
23669 +# CONFIG_PACKET_MMAP is not set
23670 +CONFIG_UNIX=y
23671 +# CONFIG_NET_KEY is not set
23672 +CONFIG_INET=y
23673 +CONFIG_IP_MULTICAST=y
23674 +# CONFIG_IP_ADVANCED_ROUTER is not set
23675 +CONFIG_IP_FIB_HASH=y
23676 +CONFIG_IP_PNP=y
23677 +# CONFIG_IP_PNP_DHCP is not set
23678 +# CONFIG_IP_PNP_BOOTP is not set
23679 +# CONFIG_IP_PNP_RARP is not set
23680 +# CONFIG_NET_IPIP is not set
23681 +# CONFIG_NET_IPGRE is not set
23682 +# CONFIG_IP_MROUTE is not set
23683 +# CONFIG_ARPD is not set
23684 +CONFIG_SYN_COOKIES=y
23685 +# CONFIG_INET_AH is not set
23686 +# CONFIG_INET_ESP is not set
23687 +# CONFIG_INET_IPCOMP is not set
23688 +# CONFIG_INET_XFRM_TUNNEL is not set
23689 +# CONFIG_INET_TUNNEL is not set
23690 +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
23691 +# CONFIG_INET_XFRM_MODE_TUNNEL is not set
23692 +# CONFIG_INET_XFRM_MODE_BEET is not set
23693 +# CONFIG_INET_LRO is not set
23694 +CONFIG_INET_DIAG=y
23695 +CONFIG_INET_TCP_DIAG=y
23696 +# CONFIG_TCP_CONG_ADVANCED is not set
23697 +CONFIG_TCP_CONG_CUBIC=y
23698 +CONFIG_DEFAULT_TCP_CONG="cubic"
23699 +# CONFIG_TCP_MD5SIG is not set
23700 +# CONFIG_IPV6 is not set
23701 +# CONFIG_INET6_XFRM_TUNNEL is not set
23702 +# CONFIG_INET6_TUNNEL is not set
23703 +# CONFIG_NETWORK_SECMARK is not set
23704 +# CONFIG_NETFILTER is not set
23705 +# CONFIG_IP_DCCP is not set
23706 +# CONFIG_IP_SCTP is not set
23707 +# CONFIG_TIPC is not set
23708 +# CONFIG_ATM is not set
23709 +# CONFIG_BRIDGE is not set
23710 +# CONFIG_VLAN_8021Q is not set
23711 +# CONFIG_DECNET is not set
23712 +# CONFIG_LLC2 is not set
23713 +# CONFIG_IPX is not set
23714 +# CONFIG_ATALK is not set
23715 +# CONFIG_X25 is not set
23716 +# CONFIG_LAPB is not set
23717 +# CONFIG_ECONET is not set
23718 +# CONFIG_WAN_ROUTER is not set
23719 +# CONFIG_NET_SCHED is not set
23720 +
23721 +#
23722 +# Network testing
23723 +#
23724 +# CONFIG_NET_PKTGEN is not set
23725 +# CONFIG_HAMRADIO is not set
23726 +# CONFIG_IRDA is not set
23727 +# CONFIG_BT is not set
23728 +# CONFIG_AF_RXRPC is not set
23729 +
23730 +#
23731 +# Wireless
23732 +#
23733 +# CONFIG_CFG80211 is not set
23734 +# CONFIG_WIRELESS_EXT is not set
23735 +# CONFIG_MAC80211 is not set
23736 +# CONFIG_IEEE80211 is not set
23737 +# CONFIG_RFKILL is not set
23738 +# CONFIG_NET_9P is not set
23739 +
23740 +#
23741 +# Device Drivers
23742 +#
23743 +
23744 +#
23745 +# Generic Driver Options
23746 +#
23747 +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
23748 +CONFIG_STANDALONE=y
23749 +CONFIG_PREVENT_FIRMWARE_BUILD=y
23750 +# CONFIG_FW_LOADER is not set
23751 +# CONFIG_DEBUG_DRIVER is not set
23752 +# CONFIG_DEBUG_DEVRES is not set
23753 +# CONFIG_SYS_HYPERVISOR is not set
23754 +# CONFIG_CONNECTOR is not set
23755 +CONFIG_MTD=y
23756 +# CONFIG_MTD_DEBUG is not set
23757 +# CONFIG_MTD_CONCAT is not set
23758 +# CONFIG_MTD_PARTITIONS is not set
23759 +
23760 +#
23761 +# User Modules And Translation Layers
23762 +#
23763 +CONFIG_MTD_CHAR=y
23764 +CONFIG_MTD_BLKDEVS=y
23765 +CONFIG_MTD_BLOCK=y
23766 +# CONFIG_FTL is not set
23767 +# CONFIG_NFTL is not set
23768 +# CONFIG_INFTL is not set
23769 +# CONFIG_RFD_FTL is not set
23770 +# CONFIG_SSFDC is not set
23771 +# CONFIG_MTD_OOPS is not set
23772 +
23773 +#
23774 +# RAM/ROM/Flash chip drivers
23775 +#
23776 +CONFIG_MTD_CFI=y
23777 +# CONFIG_MTD_JEDECPROBE is not set
23778 +CONFIG_MTD_GEN_PROBE=y
23779 +# CONFIG_MTD_CFI_ADV_OPTIONS is not set
23780 +CONFIG_MTD_MAP_BANK_WIDTH_1=y
23781 +CONFIG_MTD_MAP_BANK_WIDTH_2=y
23782 +CONFIG_MTD_MAP_BANK_WIDTH_4=y
23783 +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
23784 +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
23785 +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
23786 +CONFIG_MTD_CFI_I1=y
23787 +CONFIG_MTD_CFI_I2=y
23788 +# CONFIG_MTD_CFI_I4 is not set
23789 +# CONFIG_MTD_CFI_I8 is not set
23790 +# CONFIG_MTD_CFI_INTELEXT is not set
23791 +CONFIG_MTD_CFI_AMDSTD=y
23792 +# CONFIG_MTD_CFI_STAA is not set
23793 +CONFIG_MTD_CFI_UTIL=y
23794 +# CONFIG_MTD_RAM is not set
23795 +# CONFIG_MTD_ROM is not set
23796 +# CONFIG_MTD_ABSENT is not set
23797 +
23798 +#
23799 +# Mapping drivers for chip access
23800 +#
23801 +# CONFIG_MTD_COMPLEX_MAPPINGS is not set
23802 +# CONFIG_MTD_PHYSMAP is not set
23803 +CONFIG_MTD_PHYSMAP_OF=y
23804 +# CONFIG_MTD_CFI_FLAGADM is not set
23805 +# CONFIG_MTD_PLATRAM is not set
23806 +
23807 +#
23808 +# Self-contained MTD device drivers
23809 +#
23810 +# CONFIG_MTD_SLRAM is not set
23811 +# CONFIG_MTD_PHRAM is not set
23812 +# CONFIG_MTD_MTDRAM is not set
23813 +# CONFIG_MTD_BLOCK2MTD is not set
23814 +
23815 +#
23816 +# Disk-On-Chip Device Drivers
23817 +#
23818 +# CONFIG_MTD_DOC2000 is not set
23819 +# CONFIG_MTD_DOC2001 is not set
23820 +# CONFIG_MTD_DOC2001PLUS is not set
23821 +# CONFIG_MTD_NAND is not set
23822 +# CONFIG_MTD_ONENAND is not set
23823 +
23824 +#
23825 +# UBI - Unsorted block images
23826 +#
23827 +# CONFIG_MTD_UBI is not set
23828 +CONFIG_OF_DEVICE=y
23829 +# CONFIG_PARPORT is not set
23830 +# CONFIG_BLK_DEV is not set
23831 +# CONFIG_MISC_DEVICES is not set
23832 +# CONFIG_IDE is not set
23833 +
23834 +#
23835 +# SCSI device support
23836 +#
23837 +# CONFIG_RAID_ATTRS is not set
23838 +# CONFIG_SCSI is not set
23839 +# CONFIG_SCSI_DMA is not set
23840 +# CONFIG_SCSI_NETLINK is not set
23841 +# CONFIG_ATA is not set
23842 +# CONFIG_MD is not set
23843 +# CONFIG_MACINTOSH_DRIVERS is not set
23844 +CONFIG_NETDEVICES=y
23845 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
23846 +# CONFIG_DUMMY is not set
23847 +# CONFIG_BONDING is not set
23848 +# CONFIG_MACVLAN is not set
23849 +# CONFIG_EQUALIZER is not set
23850 +# CONFIG_TUN is not set
23851 +# CONFIG_VETH is not set
23852 +CONFIG_PHYLIB=y
23853 +
23854 +#
23855 +# MII PHY device drivers
23856 +#
23857 +# CONFIG_MARVELL_PHY is not set
23858 +CONFIG_DAVICOM_PHY=y
23859 +# CONFIG_QSEMI_PHY is not set
23860 +# CONFIG_LXT_PHY is not set
23861 +# CONFIG_CICADA_PHY is not set
23862 +# CONFIG_VITESSE_PHY is not set
23863 +# CONFIG_SMSC_PHY is not set
23864 +# CONFIG_BROADCOM_PHY is not set
23865 +# CONFIG_ICPLUS_PHY is not set
23866 +# CONFIG_FIXED_PHY is not set
23867 +# CONFIG_MDIO_BITBANG is not set
23868 +CONFIG_NET_ETHERNET=y
23869 +CONFIG_MII=y
23870 +# CONFIG_IBM_NEW_EMAC_ZMII is not set
23871 +# CONFIG_IBM_NEW_EMAC_RGMII is not set
23872 +# CONFIG_IBM_NEW_EMAC_TAH is not set
23873 +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
23874 +# CONFIG_B44 is not set
23875 +CONFIG_FS_ENET=y
23876 +# CONFIG_FS_ENET_HAS_SCC is not set
23877 +CONFIG_FS_ENET_HAS_FEC=y
23878 +CONFIG_FS_ENET_MDIO_FEC=y
23879 +# CONFIG_NETDEV_1000 is not set
23880 +# CONFIG_NETDEV_10000 is not set
23881 +
23882 +#
23883 +# Wireless LAN
23884 +#
23885 +# CONFIG_WLAN_PRE80211 is not set
23886 +# CONFIG_WLAN_80211 is not set
23887 +# CONFIG_WAN is not set
23888 +# CONFIG_PPP is not set
23889 +# CONFIG_SLIP is not set
23890 +# CONFIG_SHAPER is not set
23891 +# CONFIG_NETCONSOLE is not set
23892 +# CONFIG_NETPOLL is not set
23893 +# CONFIG_NET_POLL_CONTROLLER is not set
23894 +# CONFIG_ISDN is not set
23895 +# CONFIG_PHONE is not set
23896 +
23897 +#
23898 +# Input device support
23899 +#
23900 +CONFIG_INPUT=y
23901 +# CONFIG_INPUT_FF_MEMLESS is not set
23902 +# CONFIG_INPUT_POLLDEV is not set
23903 +
23904 +#
23905 +# Userland interfaces
23906 +#
23907 +CONFIG_INPUT_MOUSEDEV=y
23908 +CONFIG_INPUT_MOUSEDEV_PSAUX=y
23909 +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
23910 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
23911 +# CONFIG_INPUT_JOYDEV is not set
23912 +# CONFIG_INPUT_EVDEV is not set
23913 +# CONFIG_INPUT_EVBUG is not set
23914 +
23915 +#
23916 +# Input Device Drivers
23917 +#
23918 +CONFIG_INPUT_KEYBOARD=y
23919 +CONFIG_KEYBOARD_ATKBD=y
23920 +# CONFIG_KEYBOARD_SUNKBD is not set
23921 +# CONFIG_KEYBOARD_LKKBD is not set
23922 +# CONFIG_KEYBOARD_XTKBD is not set
23923 +# CONFIG_KEYBOARD_NEWTON is not set
23924 +# CONFIG_KEYBOARD_STOWAWAY is not set
23925 +CONFIG_INPUT_MOUSE=y
23926 +CONFIG_MOUSE_PS2=y
23927 +CONFIG_MOUSE_PS2_ALPS=y
23928 +CONFIG_MOUSE_PS2_LOGIPS2PP=y
23929 +CONFIG_MOUSE_PS2_SYNAPTICS=y
23930 +CONFIG_MOUSE_PS2_LIFEBOOK=y
23931 +CONFIG_MOUSE_PS2_TRACKPOINT=y
23932 +# CONFIG_MOUSE_PS2_TOUCHKIT is not set
23933 +# CONFIG_MOUSE_SERIAL is not set
23934 +# CONFIG_MOUSE_VSXXXAA is not set
23935 +# CONFIG_INPUT_JOYSTICK is not set
23936 +# CONFIG_INPUT_TABLET is not set
23937 +# CONFIG_INPUT_TOUCHSCREEN is not set
23938 +# CONFIG_INPUT_MISC is not set
23939 +
23940 +#
23941 +# Hardware I/O ports
23942 +#
23943 +CONFIG_SERIO=y
23944 +CONFIG_SERIO_I8042=y
23945 +CONFIG_SERIO_SERPORT=y
23946 +CONFIG_SERIO_LIBPS2=y
23947 +# CONFIG_SERIO_RAW is not set
23948 +# CONFIG_GAMEPORT is not set
23949 +
23950 +#
23951 +# Character devices
23952 +#
23953 +# CONFIG_VT is not set
23954 +# CONFIG_SERIAL_NONSTANDARD is not set
23955 +
23956 +#
23957 +# Serial drivers
23958 +#
23959 +# CONFIG_SERIAL_8250 is not set
23960 +
23961 +#
23962 +# Non-8250 serial port support
23963 +#
23964 +# CONFIG_SERIAL_UARTLITE is not set
23965 +CONFIG_SERIAL_CORE=y
23966 +CONFIG_SERIAL_CORE_CONSOLE=y
23967 +CONFIG_SERIAL_CPM=y
23968 +CONFIG_SERIAL_CPM_CONSOLE=y
23969 +# CONFIG_SERIAL_CPM_SCC1 is not set
23970 +# CONFIG_SERIAL_CPM_SCC2 is not set
23971 +# CONFIG_SERIAL_CPM_SCC3 is not set
23972 +# CONFIG_SERIAL_CPM_SCC4 is not set
23973 +CONFIG_SERIAL_CPM_SMC1=y
23974 +CONFIG_SERIAL_CPM_SMC2=y
23975 +CONFIG_UNIX98_PTYS=y
23976 +# CONFIG_LEGACY_PTYS is not set
23977 +# CONFIG_IPMI_HANDLER is not set
23978 +CONFIG_HW_RANDOM=y
23979 +# CONFIG_NVRAM is not set
23980 +CONFIG_GEN_RTC=y
23981 +# CONFIG_GEN_RTC_X is not set
23982 +# CONFIG_R3964 is not set
23983 +# CONFIG_RAW_DRIVER is not set
23984 +# CONFIG_TCG_TPM is not set
23985 +# CONFIG_I2C is not set
23986 +
23987 +#
23988 +# SPI support
23989 +#
23990 +# CONFIG_SPI is not set
23991 +# CONFIG_SPI_MASTER is not set
23992 +# CONFIG_W1 is not set
23993 +# CONFIG_POWER_SUPPLY is not set
23994 +# CONFIG_HWMON is not set
23995 +# CONFIG_WATCHDOG is not set
23996 +
23997 +#
23998 +# Sonics Silicon Backplane
23999 +#
24000 +CONFIG_SSB_POSSIBLE=y
24001 +# CONFIG_SSB is not set
24002 +
24003 +#
24004 +# Multifunction device drivers
24005 +#
24006 +# CONFIG_MFD_SM501 is not set
24007 +
24008 +#
24009 +# Multimedia devices
24010 +#
24011 +# CONFIG_VIDEO_DEV is not set
24012 +# CONFIG_DVB_CORE is not set
24013 +CONFIG_DAB=y
24014 +
24015 +#
24016 +# Graphics support
24017 +#
24018 +# CONFIG_VGASTATE is not set
24019 +CONFIG_VIDEO_OUTPUT_CONTROL=y
24020 +# CONFIG_FB is not set
24021 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
24022 +
24023 +#
24024 +# Display device support
24025 +#
24026 +# CONFIG_DISPLAY_SUPPORT is not set
24027 +
24028 +#
24029 +# Sound
24030 +#
24031 +# CONFIG_SOUND is not set
24032 +# CONFIG_HID_SUPPORT is not set
24033 +# CONFIG_USB_SUPPORT is not set
24034 +# CONFIG_MMC is not set
24035 +# CONFIG_NEW_LEDS is not set
24036 +# CONFIG_EDAC is not set
24037 +# CONFIG_RTC_CLASS is not set
24038 +
24039 +#
24040 +# Userspace I/O
24041 +#
24042 +# CONFIG_UIO is not set
24043 +
24044 +#
24045 +# File systems
24046 +#
24047 +# CONFIG_EXT2_FS is not set
24048 +# CONFIG_EXT3_FS is not set
24049 +# CONFIG_EXT4DEV_FS is not set
24050 +# CONFIG_REISERFS_FS is not set
24051 +# CONFIG_JFS_FS is not set
24052 +# CONFIG_FS_POSIX_ACL is not set
24053 +# CONFIG_XFS_FS is not set
24054 +# CONFIG_GFS2_FS is not set
24055 +# CONFIG_OCFS2_FS is not set
24056 +# CONFIG_MINIX_FS is not set
24057 +# CONFIG_ROMFS_FS is not set
24058 +# CONFIG_INOTIFY is not set
24059 +# CONFIG_QUOTA is not set
24060 +# CONFIG_DNOTIFY is not set
24061 +# CONFIG_AUTOFS_FS is not set
24062 +# CONFIG_AUTOFS4_FS is not set
24063 +# CONFIG_FUSE_FS is not set
24064 +
24065 +#
24066 +# CD-ROM/DVD Filesystems
24067 +#
24068 +# CONFIG_ISO9660_FS is not set
24069 +# CONFIG_UDF_FS is not set
24070 +
24071 +#
24072 +# DOS/FAT/NT Filesystems
24073 +#
24074 +# CONFIG_MSDOS_FS is not set
24075 +# CONFIG_VFAT_FS is not set
24076 +# CONFIG_NTFS_FS is not set
24077 +
24078 +#
24079 +# Pseudo filesystems
24080 +#
24081 +CONFIG_PROC_FS=y
24082 +# CONFIG_PROC_KCORE is not set
24083 +CONFIG_PROC_SYSCTL=y
24084 +CONFIG_SYSFS=y
24085 +CONFIG_TMPFS=y
24086 +# CONFIG_TMPFS_POSIX_ACL is not set
24087 +# CONFIG_HUGETLB_PAGE is not set
24088 +# CONFIG_CONFIGFS_FS is not set
24089 +
24090 +#
24091 +# Miscellaneous filesystems
24092 +#
24093 +# CONFIG_ADFS_FS is not set
24094 +# CONFIG_AFFS_FS is not set
24095 +# CONFIG_HFS_FS is not set
24096 +# CONFIG_HFSPLUS_FS is not set
24097 +# CONFIG_BEFS_FS is not set
24098 +# CONFIG_BFS_FS is not set
24099 +# CONFIG_EFS_FS is not set
24100 +# CONFIG_JFFS2_FS is not set
24101 +CONFIG_CRAMFS=y
24102 +# CONFIG_VXFS_FS is not set
24103 +# CONFIG_HPFS_FS is not set
24104 +# CONFIG_QNX4FS_FS is not set
24105 +# CONFIG_SYSV_FS is not set
24106 +# CONFIG_UFS_FS is not set
24107 +CONFIG_NETWORK_FILESYSTEMS=y
24108 +CONFIG_NFS_FS=y
24109 +CONFIG_NFS_V3=y
24110 +# CONFIG_NFS_V3_ACL is not set
24111 +# CONFIG_NFS_V4 is not set
24112 +# CONFIG_NFS_DIRECTIO is not set
24113 +# CONFIG_NFSD is not set
24114 +CONFIG_ROOT_NFS=y
24115 +CONFIG_LOCKD=y
24116 +CONFIG_LOCKD_V4=y
24117 +CONFIG_NFS_COMMON=y
24118 +CONFIG_SUNRPC=y
24119 +# CONFIG_SUNRPC_BIND34 is not set
24120 +# CONFIG_RPCSEC_GSS_KRB5 is not set
24121 +# CONFIG_RPCSEC_GSS_SPKM3 is not set
24122 +# CONFIG_SMB_FS is not set
24123 +# CONFIG_CIFS is not set
24124 +# CONFIG_NCP_FS is not set
24125 +# CONFIG_CODA_FS is not set
24126 +# CONFIG_AFS_FS is not set
24127 +
24128 +#
24129 +# Partition Types
24130 +#
24131 +CONFIG_PARTITION_ADVANCED=y
24132 +# CONFIG_ACORN_PARTITION is not set
24133 +# CONFIG_OSF_PARTITION is not set
24134 +# CONFIG_AMIGA_PARTITION is not set
24135 +# CONFIG_ATARI_PARTITION is not set
24136 +# CONFIG_MAC_PARTITION is not set
24137 +CONFIG_MSDOS_PARTITION=y
24138 +# CONFIG_BSD_DISKLABEL is not set
24139 +# CONFIG_MINIX_SUBPARTITION is not set
24140 +# CONFIG_SOLARIS_X86_PARTITION is not set
24141 +# CONFIG_UNIXWARE_DISKLABEL is not set
24142 +# CONFIG_LDM_PARTITION is not set
24143 +# CONFIG_SGI_PARTITION is not set
24144 +# CONFIG_ULTRIX_PARTITION is not set
24145 +# CONFIG_SUN_PARTITION is not set
24146 +# CONFIG_KARMA_PARTITION is not set
24147 +# CONFIG_EFI_PARTITION is not set
24148 +# CONFIG_SYSV68_PARTITION is not set
24149 +# CONFIG_NLS is not set
24150 +# CONFIG_DLM is not set
24151 +# CONFIG_UCC_SLOW is not set
24152 +
24153 +#
24154 +# Library routines
24155 +#
24156 +# CONFIG_CRC_CCITT is not set
24157 +# CONFIG_CRC16 is not set
24158 +# CONFIG_CRC_ITU_T is not set
24159 +# CONFIG_CRC32 is not set
24160 +# CONFIG_CRC7 is not set
24161 +# CONFIG_LIBCRC32C is not set
24162 +CONFIG_ZLIB_INFLATE=y
24163 +CONFIG_HAS_IOMEM=y
24164 +CONFIG_HAS_IOPORT=y
24165 +CONFIG_HAS_DMA=y
24166 +CONFIG_INSTRUMENTATION=y
24167 +# CONFIG_PROFILING is not set
24168 +# CONFIG_MARKERS is not set
24169 +
24170 +#
24171 +# Kernel hacking
24172 +#
24173 +# CONFIG_PRINTK_TIME is not set
24174 +CONFIG_ENABLE_WARN_DEPRECATED=y
24175 +CONFIG_ENABLE_MUST_CHECK=y
24176 +CONFIG_MAGIC_SYSRQ=y
24177 +# CONFIG_UNUSED_SYMBOLS is not set
24178 +# CONFIG_DEBUG_FS is not set
24179 +# CONFIG_HEADERS_CHECK is not set
24180 +CONFIG_DEBUG_KERNEL=y
24181 +# CONFIG_DEBUG_SHIRQ is not set
24182 +CONFIG_DETECT_SOFTLOCKUP=y
24183 +CONFIG_SCHED_DEBUG=y
24184 +# CONFIG_SCHEDSTATS is not set
24185 +# CONFIG_TIMER_STATS is not set
24186 +# CONFIG_SLUB_DEBUG_ON is not set
24187 +# CONFIG_DEBUG_SPINLOCK is not set
24188 +# CONFIG_DEBUG_MUTEXES is not set
24189 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
24190 +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
24191 +# CONFIG_DEBUG_KOBJECT is not set
24192 +CONFIG_DEBUG_BUGVERBOSE=y
24193 +CONFIG_DEBUG_INFO=y
24194 +# CONFIG_DEBUG_VM is not set
24195 +# CONFIG_DEBUG_LIST is not set
24196 +# CONFIG_DEBUG_SG is not set
24197 +CONFIG_FORCED_INLINING=y
24198 +# CONFIG_BOOT_PRINTK_DELAY is not set
24199 +# CONFIG_FAULT_INJECTION is not set
24200 +# CONFIG_SAMPLES is not set
24201 +# CONFIG_DEBUG_STACKOVERFLOW is not set
24202 +# CONFIG_DEBUG_STACK_USAGE is not set
24203 +# CONFIG_DEBUG_PAGEALLOC is not set
24204 +# CONFIG_DEBUGGER is not set
24205 +# CONFIG_BDI_SWITCH is not set
24206 +# CONFIG_PPC_EARLY_DEBUG is not set
24207 +
24208 +#
24209 +# Security options
24210 +#
24211 +# CONFIG_KEYS is not set
24212 +# CONFIG_SECURITY is not set
24213 +# CONFIG_SECURITY_FILE_CAPABILITIES is not set
24214 +# CONFIG_CRYPTO is not set
24215 +# CONFIG_PPC_CLOCK is not set
24216 +CONFIG_PPC_LIB_RHEAP=y
24217 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/configs/adder875-uboot_defconfig powerpc.git/arch/powerpc/configs/adder875-uboot_defconfig
24218 --- linux-2.6.24/arch/powerpc/configs/adder875-uboot_defconfig  1970-01-01 01:00:00.000000000 +0100
24219 +++ powerpc.git/arch/powerpc/configs/adder875-uboot_defconfig   2008-01-28 20:25:49.000000000 +0100
24220 @@ -0,0 +1,798 @@
24221 +#
24222 +# Automatically generated make config: don't edit
24223 +# Linux kernel version: 2.6.24-rc6
24224 +# Thu Jan 17 16:17:18 2008
24225 +#
24226 +# CONFIG_PPC64 is not set
24227 +
24228 +#
24229 +# Processor support
24230 +#
24231 +# CONFIG_6xx is not set
24232 +# CONFIG_PPC_85xx is not set
24233 +CONFIG_PPC_8xx=y
24234 +# CONFIG_40x is not set
24235 +# CONFIG_44x is not set
24236 +# CONFIG_E200 is not set
24237 +CONFIG_8xx=y
24238 +# CONFIG_PPC_MM_SLICES is not set
24239 +CONFIG_NOT_COHERENT_CACHE=y
24240 +CONFIG_PPC32=y
24241 +CONFIG_WORD_SIZE=32
24242 +CONFIG_PPC_MERGE=y
24243 +CONFIG_MMU=y
24244 +CONFIG_GENERIC_CMOS_UPDATE=y
24245 +CONFIG_GENERIC_TIME=y
24246 +CONFIG_GENERIC_TIME_VSYSCALL=y
24247 +CONFIG_GENERIC_CLOCKEVENTS=y
24248 +CONFIG_GENERIC_HARDIRQS=y
24249 +CONFIG_IRQ_PER_CPU=y
24250 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
24251 +CONFIG_ARCH_HAS_ILOG2_U32=y
24252 +CONFIG_GENERIC_HWEIGHT=y
24253 +CONFIG_GENERIC_CALIBRATE_DELAY=y
24254 +CONFIG_GENERIC_FIND_NEXT_BIT=y
24255 +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
24256 +CONFIG_PPC=y
24257 +CONFIG_EARLY_PRINTK=y
24258 +CONFIG_GENERIC_NVRAM=y
24259 +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
24260 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
24261 +CONFIG_PPC_OF=y
24262 +CONFIG_OF=y
24263 +# CONFIG_PPC_UDBG_16550 is not set
24264 +# CONFIG_GENERIC_TBSYNC is not set
24265 +CONFIG_AUDIT_ARCH=y
24266 +CONFIG_GENERIC_BUG=y
24267 +# CONFIG_DEFAULT_UIMAGE is not set
24268 +CONFIG_REDBOOT=y
24269 +# CONFIG_PPC_DCR_NATIVE is not set
24270 +# CONFIG_PPC_DCR_MMIO is not set
24271 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
24272 +
24273 +#
24274 +# General setup
24275 +#
24276 +CONFIG_EXPERIMENTAL=y
24277 +CONFIG_BROKEN_ON_SMP=y
24278 +CONFIG_INIT_ENV_ARG_LIMIT=32
24279 +CONFIG_LOCALVERSION=""
24280 +CONFIG_LOCALVERSION_AUTO=y
24281 +# CONFIG_SWAP is not set
24282 +CONFIG_SYSVIPC=y
24283 +CONFIG_SYSVIPC_SYSCTL=y
24284 +# CONFIG_POSIX_MQUEUE is not set
24285 +# CONFIG_BSD_PROCESS_ACCT is not set
24286 +# CONFIG_TASKSTATS is not set
24287 +# CONFIG_USER_NS is not set
24288 +# CONFIG_PID_NS is not set
24289 +# CONFIG_AUDIT is not set
24290 +# CONFIG_IKCONFIG is not set
24291 +CONFIG_LOG_BUF_SHIFT=14
24292 +# CONFIG_CGROUPS is not set
24293 +CONFIG_FAIR_GROUP_SCHED=y
24294 +CONFIG_FAIR_USER_SCHED=y
24295 +# CONFIG_FAIR_CGROUP_SCHED is not set
24296 +CONFIG_SYSFS_DEPRECATED=y
24297 +# CONFIG_RELAY is not set
24298 +# CONFIG_BLK_DEV_INITRD is not set
24299 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
24300 +CONFIG_SYSCTL=y
24301 +CONFIG_EMBEDDED=y
24302 +# CONFIG_SYSCTL_SYSCALL is not set
24303 +CONFIG_KALLSYMS=y
24304 +# CONFIG_KALLSYMS_ALL is not set
24305 +# CONFIG_KALLSYMS_EXTRA_PASS is not set
24306 +CONFIG_HOTPLUG=y
24307 +CONFIG_PRINTK=y
24308 +CONFIG_BUG=y
24309 +# CONFIG_ELF_CORE is not set
24310 +# CONFIG_BASE_FULL is not set
24311 +# CONFIG_FUTEX is not set
24312 +CONFIG_ANON_INODES=y
24313 +CONFIG_EPOLL=y
24314 +CONFIG_SIGNALFD=y
24315 +CONFIG_EVENTFD=y
24316 +CONFIG_SHMEM=y
24317 +# CONFIG_VM_EVENT_COUNTERS is not set
24318 +CONFIG_SLUB_DEBUG=y
24319 +# CONFIG_SLAB is not set
24320 +CONFIG_SLUB=y
24321 +# CONFIG_SLOB is not set
24322 +# CONFIG_TINY_SHMEM is not set
24323 +CONFIG_BASE_SMALL=1
24324 +# CONFIG_MODULES is not set
24325 +CONFIG_BLOCK=y
24326 +# CONFIG_LBD is not set
24327 +# CONFIG_BLK_DEV_IO_TRACE is not set
24328 +# CONFIG_LSF is not set
24329 +# CONFIG_BLK_DEV_BSG is not set
24330 +
24331 +#
24332 +# IO Schedulers
24333 +#
24334 +CONFIG_IOSCHED_NOOP=y
24335 +# CONFIG_IOSCHED_AS is not set
24336 +CONFIG_IOSCHED_DEADLINE=y
24337 +# CONFIG_IOSCHED_CFQ is not set
24338 +# CONFIG_DEFAULT_AS is not set
24339 +CONFIG_DEFAULT_DEADLINE=y
24340 +# CONFIG_DEFAULT_CFQ is not set
24341 +# CONFIG_DEFAULT_NOOP is not set
24342 +CONFIG_DEFAULT_IOSCHED="deadline"
24343 +
24344 +#
24345 +# Platform support
24346 +#
24347 +# CONFIG_PPC_MPC52xx is not set
24348 +# CONFIG_PPC_MPC5200 is not set
24349 +# CONFIG_PPC_CELL is not set
24350 +# CONFIG_PPC_CELL_NATIVE is not set
24351 +CONFIG_CPM1=y
24352 +# CONFIG_MPC8XXFADS is not set
24353 +# CONFIG_MPC86XADS is not set
24354 +# CONFIG_MPC885ADS is not set
24355 +# CONFIG_PPC_EP88XC is not set
24356 +CONFIG_PPC_ADDER875=y
24357 +
24358 +#
24359 +# MPC8xx CPM Options
24360 +#
24361 +
24362 +#
24363 +# Generic MPC8xx Options
24364 +#
24365 +CONFIG_8xx_COPYBACK=y
24366 +# CONFIG_8xx_CPU6 is not set
24367 +CONFIG_8xx_CPU15=y
24368 +CONFIG_NO_UCODE_PATCH=y
24369 +# CONFIG_USB_SOF_UCODE_PATCH is not set
24370 +# CONFIG_I2C_SPI_UCODE_PATCH is not set
24371 +# CONFIG_I2C_SPI_SMC1_UCODE_PATCH is not set
24372 +# CONFIG_PQ2ADS is not set
24373 +# CONFIG_MPIC is not set
24374 +# CONFIG_MPIC_WEIRD is not set
24375 +# CONFIG_PPC_I8259 is not set
24376 +# CONFIG_PPC_RTAS is not set
24377 +# CONFIG_MMIO_NVRAM is not set
24378 +# CONFIG_PPC_MPC106 is not set
24379 +# CONFIG_PPC_970_NAP is not set
24380 +# CONFIG_PPC_INDIRECT_IO is not set
24381 +# CONFIG_GENERIC_IOMAP is not set
24382 +# CONFIG_CPU_FREQ is not set
24383 +# CONFIG_CPM2 is not set
24384 +CONFIG_PPC_CPM_NEW_BINDING=y
24385 +# CONFIG_FSL_ULI1575 is not set
24386 +CONFIG_CPM=y
24387 +
24388 +#
24389 +# Kernel options
24390 +#
24391 +# CONFIG_HIGHMEM is not set
24392 +# CONFIG_TICK_ONESHOT is not set
24393 +# CONFIG_NO_HZ is not set
24394 +# CONFIG_HIGH_RES_TIMERS is not set
24395 +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
24396 +# CONFIG_HZ_100 is not set
24397 +# CONFIG_HZ_250 is not set
24398 +# CONFIG_HZ_300 is not set
24399 +CONFIG_HZ_1000=y
24400 +CONFIG_HZ=1000
24401 +CONFIG_PREEMPT_NONE=y
24402 +# CONFIG_PREEMPT_VOLUNTARY is not set
24403 +# CONFIG_PREEMPT is not set
24404 +CONFIG_BINFMT_ELF=y
24405 +# CONFIG_BINFMT_MISC is not set
24406 +# CONFIG_MATH_EMULATION is not set
24407 +# CONFIG_8XX_MINIMAL_FPEMU is not set
24408 +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
24409 +CONFIG_ARCH_FLATMEM_ENABLE=y
24410 +CONFIG_ARCH_POPULATES_NODE_MAP=y
24411 +CONFIG_SELECT_MEMORY_MODEL=y
24412 +CONFIG_FLATMEM_MANUAL=y
24413 +# CONFIG_DISCONTIGMEM_MANUAL is not set
24414 +# CONFIG_SPARSEMEM_MANUAL is not set
24415 +CONFIG_FLATMEM=y
24416 +CONFIG_FLAT_NODE_MEM_MAP=y
24417 +# CONFIG_SPARSEMEM_STATIC is not set
24418 +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
24419 +CONFIG_SPLIT_PTLOCK_CPUS=4
24420 +# CONFIG_RESOURCES_64BIT is not set
24421 +CONFIG_ZONE_DMA_FLAG=1
24422 +CONFIG_BOUNCE=y
24423 +CONFIG_VIRT_TO_BUS=y
24424 +# CONFIG_PROC_DEVICETREE is not set
24425 +# CONFIG_CMDLINE_BOOL is not set
24426 +# CONFIG_PM is not set
24427 +CONFIG_SUSPEND_UP_POSSIBLE=y
24428 +CONFIG_HIBERNATION_UP_POSSIBLE=y
24429 +# CONFIG_SECCOMP is not set
24430 +CONFIG_WANT_DEVICE_TREE=y
24431 +CONFIG_DEVICE_TREE="adder875-uboot.dts"
24432 +CONFIG_ISA_DMA_API=y
24433 +
24434 +#
24435 +# Bus options
24436 +#
24437 +CONFIG_ZONE_DMA=y
24438 +CONFIG_FSL_SOC=y
24439 +# CONFIG_PCI is not set
24440 +# CONFIG_PCI_DOMAINS is not set
24441 +# CONFIG_PCI_SYSCALL is not set
24442 +# CONFIG_PCI_QSPAN is not set
24443 +# CONFIG_ARCH_SUPPORTS_MSI is not set
24444 +# CONFIG_PCCARD is not set
24445 +
24446 +#
24447 +# Advanced setup
24448 +#
24449 +# CONFIG_ADVANCED_OPTIONS is not set
24450 +
24451 +#
24452 +# Default settings for advanced configuration options are used
24453 +#
24454 +CONFIG_HIGHMEM_START=0xfe000000
24455 +CONFIG_LOWMEM_SIZE=0x30000000
24456 +CONFIG_KERNEL_START=0xc0000000
24457 +CONFIG_TASK_SIZE=0x80000000
24458 +CONFIG_CONSISTENT_START=0xfd000000
24459 +CONFIG_CONSISTENT_SIZE=0x00200000
24460 +CONFIG_BOOT_LOAD=0x00400000
24461 +
24462 +#
24463 +# Networking
24464 +#
24465 +CONFIG_NET=y
24466 +
24467 +#
24468 +# Networking options
24469 +#
24470 +CONFIG_PACKET=y
24471 +# CONFIG_PACKET_MMAP is not set
24472 +CONFIG_UNIX=y
24473 +# CONFIG_NET_KEY is not set
24474 +CONFIG_INET=y
24475 +CONFIG_IP_MULTICAST=y
24476 +# CONFIG_IP_ADVANCED_ROUTER is not set
24477 +CONFIG_IP_FIB_HASH=y
24478 +CONFIG_IP_PNP=y
24479 +# CONFIG_IP_PNP_DHCP is not set
24480 +# CONFIG_IP_PNP_BOOTP is not set
24481 +# CONFIG_IP_PNP_RARP is not set
24482 +# CONFIG_NET_IPIP is not set
24483 +# CONFIG_NET_IPGRE is not set
24484 +# CONFIG_IP_MROUTE is not set
24485 +# CONFIG_ARPD is not set
24486 +CONFIG_SYN_COOKIES=y
24487 +# CONFIG_INET_AH is not set
24488 +# CONFIG_INET_ESP is not set
24489 +# CONFIG_INET_IPCOMP is not set
24490 +# CONFIG_INET_XFRM_TUNNEL is not set
24491 +# CONFIG_INET_TUNNEL is not set
24492 +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
24493 +# CONFIG_INET_XFRM_MODE_TUNNEL is not set
24494 +# CONFIG_INET_XFRM_MODE_BEET is not set
24495 +# CONFIG_INET_LRO is not set
24496 +CONFIG_INET_DIAG=y
24497 +CONFIG_INET_TCP_DIAG=y
24498 +# CONFIG_TCP_CONG_ADVANCED is not set
24499 +CONFIG_TCP_CONG_CUBIC=y
24500 +CONFIG_DEFAULT_TCP_CONG="cubic"
24501 +# CONFIG_TCP_MD5SIG is not set
24502 +# CONFIG_IPV6 is not set
24503 +# CONFIG_INET6_XFRM_TUNNEL is not set
24504 +# CONFIG_INET6_TUNNEL is not set
24505 +# CONFIG_NETWORK_SECMARK is not set
24506 +# CONFIG_NETFILTER is not set
24507 +# CONFIG_IP_DCCP is not set
24508 +# CONFIG_IP_SCTP is not set
24509 +# CONFIG_TIPC is not set
24510 +# CONFIG_ATM is not set
24511 +# CONFIG_BRIDGE is not set
24512 +# CONFIG_VLAN_8021Q is not set
24513 +# CONFIG_DECNET is not set
24514 +# CONFIG_LLC2 is not set
24515 +# CONFIG_IPX is not set
24516 +# CONFIG_ATALK is not set
24517 +# CONFIG_X25 is not set
24518 +# CONFIG_LAPB is not set
24519 +# CONFIG_ECONET is not set
24520 +# CONFIG_WAN_ROUTER is not set
24521 +# CONFIG_NET_SCHED is not set
24522 +
24523 +#
24524 +# Network testing
24525 +#
24526 +# CONFIG_NET_PKTGEN is not set
24527 +# CONFIG_HAMRADIO is not set
24528 +# CONFIG_IRDA is not set
24529 +# CONFIG_BT is not set
24530 +# CONFIG_AF_RXRPC is not set
24531 +
24532 +#
24533 +# Wireless
24534 +#
24535 +# CONFIG_CFG80211 is not set
24536 +# CONFIG_WIRELESS_EXT is not set
24537 +# CONFIG_MAC80211 is not set
24538 +# CONFIG_IEEE80211 is not set
24539 +# CONFIG_RFKILL is not set
24540 +# CONFIG_NET_9P is not set
24541 +
24542 +#
24543 +# Device Drivers
24544 +#
24545 +
24546 +#
24547 +# Generic Driver Options
24548 +#
24549 +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
24550 +CONFIG_STANDALONE=y
24551 +CONFIG_PREVENT_FIRMWARE_BUILD=y
24552 +# CONFIG_FW_LOADER is not set
24553 +# CONFIG_DEBUG_DRIVER is not set
24554 +# CONFIG_DEBUG_DEVRES is not set
24555 +# CONFIG_SYS_HYPERVISOR is not set
24556 +# CONFIG_CONNECTOR is not set
24557 +CONFIG_MTD=y
24558 +# CONFIG_MTD_DEBUG is not set
24559 +# CONFIG_MTD_CONCAT is not set
24560 +# CONFIG_MTD_PARTITIONS is not set
24561 +
24562 +#
24563 +# User Modules And Translation Layers
24564 +#
24565 +CONFIG_MTD_CHAR=y
24566 +CONFIG_MTD_BLKDEVS=y
24567 +CONFIG_MTD_BLOCK=y
24568 +# CONFIG_FTL is not set
24569 +# CONFIG_NFTL is not set
24570 +# CONFIG_INFTL is not set
24571 +# CONFIG_RFD_FTL is not set
24572 +# CONFIG_SSFDC is not set
24573 +# CONFIG_MTD_OOPS is not set
24574 +
24575 +#
24576 +# RAM/ROM/Flash chip drivers
24577 +#
24578 +CONFIG_MTD_CFI=y
24579 +# CONFIG_MTD_JEDECPROBE is not set
24580 +CONFIG_MTD_GEN_PROBE=y
24581 +# CONFIG_MTD_CFI_ADV_OPTIONS is not set
24582 +CONFIG_MTD_MAP_BANK_WIDTH_1=y
24583 +CONFIG_MTD_MAP_BANK_WIDTH_2=y
24584 +CONFIG_MTD_MAP_BANK_WIDTH_4=y
24585 +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
24586 +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
24587 +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
24588 +CONFIG_MTD_CFI_I1=y
24589 +CONFIG_MTD_CFI_I2=y
24590 +# CONFIG_MTD_CFI_I4 is not set
24591 +# CONFIG_MTD_CFI_I8 is not set
24592 +# CONFIG_MTD_CFI_INTELEXT is not set
24593 +CONFIG_MTD_CFI_AMDSTD=y
24594 +# CONFIG_MTD_CFI_STAA is not set
24595 +CONFIG_MTD_CFI_UTIL=y
24596 +# CONFIG_MTD_RAM is not set
24597 +# CONFIG_MTD_ROM is not set
24598 +# CONFIG_MTD_ABSENT is not set
24599 +
24600 +#
24601 +# Mapping drivers for chip access
24602 +#
24603 +# CONFIG_MTD_COMPLEX_MAPPINGS is not set
24604 +# CONFIG_MTD_PHYSMAP is not set
24605 +CONFIG_MTD_PHYSMAP_OF=y
24606 +# CONFIG_MTD_CFI_FLAGADM is not set
24607 +# CONFIG_MTD_PLATRAM is not set
24608 +
24609 +#
24610 +# Self-contained MTD device drivers
24611 +#
24612 +# CONFIG_MTD_SLRAM is not set
24613 +# CONFIG_MTD_PHRAM is not set
24614 +# CONFIG_MTD_MTDRAM is not set
24615 +# CONFIG_MTD_BLOCK2MTD is not set
24616 +
24617 +#
24618 +# Disk-On-Chip Device Drivers
24619 +#
24620 +# CONFIG_MTD_DOC2000 is not set
24621 +# CONFIG_MTD_DOC2001 is not set
24622 +# CONFIG_MTD_DOC2001PLUS is not set
24623 +# CONFIG_MTD_NAND is not set
24624 +# CONFIG_MTD_ONENAND is not set
24625 +
24626 +#
24627 +# UBI - Unsorted block images
24628 +#
24629 +# CONFIG_MTD_UBI is not set
24630 +CONFIG_OF_DEVICE=y
24631 +# CONFIG_PARPORT is not set
24632 +# CONFIG_BLK_DEV is not set
24633 +# CONFIG_MISC_DEVICES is not set
24634 +# CONFIG_IDE is not set
24635 +
24636 +#
24637 +# SCSI device support
24638 +#
24639 +# CONFIG_RAID_ATTRS is not set
24640 +# CONFIG_SCSI is not set
24641 +# CONFIG_SCSI_DMA is not set
24642 +# CONFIG_SCSI_NETLINK is not set
24643 +# CONFIG_ATA is not set
24644 +# CONFIG_MD is not set
24645 +# CONFIG_MACINTOSH_DRIVERS is not set
24646 +CONFIG_NETDEVICES=y
24647 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
24648 +# CONFIG_DUMMY is not set
24649 +# CONFIG_BONDING is not set
24650 +# CONFIG_MACVLAN is not set
24651 +# CONFIG_EQUALIZER is not set
24652 +# CONFIG_TUN is not set
24653 +# CONFIG_VETH is not set
24654 +CONFIG_PHYLIB=y
24655 +
24656 +#
24657 +# MII PHY device drivers
24658 +#
24659 +# CONFIG_MARVELL_PHY is not set
24660 +CONFIG_DAVICOM_PHY=y
24661 +# CONFIG_QSEMI_PHY is not set
24662 +# CONFIG_LXT_PHY is not set
24663 +# CONFIG_CICADA_PHY is not set
24664 +# CONFIG_VITESSE_PHY is not set
24665 +# CONFIG_SMSC_PHY is not set
24666 +# CONFIG_BROADCOM_PHY is not set
24667 +# CONFIG_ICPLUS_PHY is not set
24668 +# CONFIG_FIXED_PHY is not set
24669 +# CONFIG_MDIO_BITBANG is not set
24670 +CONFIG_NET_ETHERNET=y
24671 +CONFIG_MII=y
24672 +# CONFIG_IBM_NEW_EMAC_ZMII is not set
24673 +# CONFIG_IBM_NEW_EMAC_RGMII is not set
24674 +# CONFIG_IBM_NEW_EMAC_TAH is not set
24675 +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
24676 +# CONFIG_B44 is not set
24677 +CONFIG_FS_ENET=y
24678 +# CONFIG_FS_ENET_HAS_SCC is not set
24679 +CONFIG_FS_ENET_HAS_FEC=y
24680 +CONFIG_FS_ENET_MDIO_FEC=y
24681 +# CONFIG_NETDEV_1000 is not set
24682 +# CONFIG_NETDEV_10000 is not set
24683 +
24684 +#
24685 +# Wireless LAN
24686 +#
24687 +# CONFIG_WLAN_PRE80211 is not set
24688 +# CONFIG_WLAN_80211 is not set
24689 +# CONFIG_WAN is not set
24690 +# CONFIG_PPP is not set
24691 +# CONFIG_SLIP is not set
24692 +# CONFIG_SHAPER is not set
24693 +# CONFIG_NETCONSOLE is not set
24694 +# CONFIG_NETPOLL is not set
24695 +# CONFIG_NET_POLL_CONTROLLER is not set
24696 +# CONFIG_ISDN is not set
24697 +# CONFIG_PHONE is not set
24698 +
24699 +#
24700 +# Input device support
24701 +#
24702 +CONFIG_INPUT=y
24703 +# CONFIG_INPUT_FF_MEMLESS is not set
24704 +# CONFIG_INPUT_POLLDEV is not set
24705 +
24706 +#
24707 +# Userland interfaces
24708 +#
24709 +CONFIG_INPUT_MOUSEDEV=y
24710 +CONFIG_INPUT_MOUSEDEV_PSAUX=y
24711 +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
24712 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
24713 +# CONFIG_INPUT_JOYDEV is not set
24714 +# CONFIG_INPUT_EVDEV is not set
24715 +# CONFIG_INPUT_EVBUG is not set
24716 +
24717 +#
24718 +# Input Device Drivers
24719 +#
24720 +CONFIG_INPUT_KEYBOARD=y
24721 +CONFIG_KEYBOARD_ATKBD=y
24722 +# CONFIG_KEYBOARD_SUNKBD is not set
24723 +# CONFIG_KEYBOARD_LKKBD is not set
24724 +# CONFIG_KEYBOARD_XTKBD is not set
24725 +# CONFIG_KEYBOARD_NEWTON is not set
24726 +# CONFIG_KEYBOARD_STOWAWAY is not set
24727 +CONFIG_INPUT_MOUSE=y
24728 +CONFIG_MOUSE_PS2=y
24729 +CONFIG_MOUSE_PS2_ALPS=y
24730 +CONFIG_MOUSE_PS2_LOGIPS2PP=y
24731 +CONFIG_MOUSE_PS2_SYNAPTICS=y
24732 +CONFIG_MOUSE_PS2_LIFEBOOK=y
24733 +CONFIG_MOUSE_PS2_TRACKPOINT=y
24734 +# CONFIG_MOUSE_PS2_TOUCHKIT is not set
24735 +# CONFIG_MOUSE_SERIAL is not set
24736 +# CONFIG_MOUSE_VSXXXAA is not set
24737 +# CONFIG_INPUT_JOYSTICK is not set
24738 +# CONFIG_INPUT_TABLET is not set
24739 +# CONFIG_INPUT_TOUCHSCREEN is not set
24740 +# CONFIG_INPUT_MISC is not set
24741 +
24742 +#
24743 +# Hardware I/O ports
24744 +#
24745 +CONFIG_SERIO=y
24746 +CONFIG_SERIO_I8042=y
24747 +CONFIG_SERIO_SERPORT=y
24748 +CONFIG_SERIO_LIBPS2=y
24749 +# CONFIG_SERIO_RAW is not set
24750 +# CONFIG_GAMEPORT is not set
24751 +
24752 +#
24753 +# Character devices
24754 +#
24755 +# CONFIG_VT is not set
24756 +# CONFIG_SERIAL_NONSTANDARD is not set
24757 +
24758 +#
24759 +# Serial drivers
24760 +#
24761 +# CONFIG_SERIAL_8250 is not set
24762 +
24763 +#
24764 +# Non-8250 serial port support
24765 +#
24766 +# CONFIG_SERIAL_UARTLITE is not set
24767 +CONFIG_SERIAL_CORE=y
24768 +CONFIG_SERIAL_CORE_CONSOLE=y
24769 +CONFIG_SERIAL_CPM=y
24770 +CONFIG_SERIAL_CPM_CONSOLE=y
24771 +# CONFIG_SERIAL_CPM_SCC1 is not set
24772 +# CONFIG_SERIAL_CPM_SCC2 is not set
24773 +# CONFIG_SERIAL_CPM_SCC3 is not set
24774 +# CONFIG_SERIAL_CPM_SCC4 is not set
24775 +CONFIG_SERIAL_CPM_SMC1=y
24776 +CONFIG_SERIAL_CPM_SMC2=y
24777 +CONFIG_UNIX98_PTYS=y
24778 +# CONFIG_LEGACY_PTYS is not set
24779 +# CONFIG_IPMI_HANDLER is not set
24780 +CONFIG_HW_RANDOM=y
24781 +# CONFIG_NVRAM is not set
24782 +CONFIG_GEN_RTC=y
24783 +# CONFIG_GEN_RTC_X is not set
24784 +# CONFIG_R3964 is not set
24785 +# CONFIG_RAW_DRIVER is not set
24786 +# CONFIG_TCG_TPM is not set
24787 +# CONFIG_I2C is not set
24788 +
24789 +#
24790 +# SPI support
24791 +#
24792 +# CONFIG_SPI is not set
24793 +# CONFIG_SPI_MASTER is not set
24794 +# CONFIG_W1 is not set
24795 +# CONFIG_POWER_SUPPLY is not set
24796 +# CONFIG_HWMON is not set
24797 +# CONFIG_WATCHDOG is not set
24798 +
24799 +#
24800 +# Sonics Silicon Backplane
24801 +#
24802 +CONFIG_SSB_POSSIBLE=y
24803 +# CONFIG_SSB is not set
24804 +
24805 +#
24806 +# Multifunction device drivers
24807 +#
24808 +# CONFIG_MFD_SM501 is not set
24809 +
24810 +#
24811 +# Multimedia devices
24812 +#
24813 +# CONFIG_VIDEO_DEV is not set
24814 +# CONFIG_DVB_CORE is not set
24815 +CONFIG_DAB=y
24816 +
24817 +#
24818 +# Graphics support
24819 +#
24820 +# CONFIG_VGASTATE is not set
24821 +CONFIG_VIDEO_OUTPUT_CONTROL=y
24822 +# CONFIG_FB is not set
24823 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
24824 +
24825 +#
24826 +# Display device support
24827 +#
24828 +# CONFIG_DISPLAY_SUPPORT is not set
24829 +
24830 +#
24831 +# Sound
24832 +#
24833 +# CONFIG_SOUND is not set
24834 +# CONFIG_HID_SUPPORT is not set
24835 +# CONFIG_USB_SUPPORT is not set
24836 +# CONFIG_MMC is not set
24837 +# CONFIG_NEW_LEDS is not set
24838 +# CONFIG_EDAC is not set
24839 +# CONFIG_RTC_CLASS is not set
24840 +
24841 +#
24842 +# Userspace I/O
24843 +#
24844 +# CONFIG_UIO is not set
24845 +
24846 +#
24847 +# File systems
24848 +#
24849 +# CONFIG_EXT2_FS is not set
24850 +# CONFIG_EXT3_FS is not set
24851 +# CONFIG_EXT4DEV_FS is not set
24852 +# CONFIG_REISERFS_FS is not set
24853 +# CONFIG_JFS_FS is not set
24854 +# CONFIG_FS_POSIX_ACL is not set
24855 +# CONFIG_XFS_FS is not set
24856 +# CONFIG_GFS2_FS is not set
24857 +# CONFIG_OCFS2_FS is not set
24858 +# CONFIG_MINIX_FS is not set
24859 +# CONFIG_ROMFS_FS is not set
24860 +# CONFIG_INOTIFY is not set
24861 +# CONFIG_QUOTA is not set
24862 +# CONFIG_DNOTIFY is not set
24863 +# CONFIG_AUTOFS_FS is not set
24864 +# CONFIG_AUTOFS4_FS is not set
24865 +# CONFIG_FUSE_FS is not set
24866 +
24867 +#
24868 +# CD-ROM/DVD Filesystems
24869 +#
24870 +# CONFIG_ISO9660_FS is not set
24871 +# CONFIG_UDF_FS is not set
24872 +
24873 +#
24874 +# DOS/FAT/NT Filesystems
24875 +#
24876 +# CONFIG_MSDOS_FS is not set
24877 +# CONFIG_VFAT_FS is not set
24878 +# CONFIG_NTFS_FS is not set
24879 +
24880 +#
24881 +# Pseudo filesystems
24882 +#
24883 +CONFIG_PROC_FS=y
24884 +# CONFIG_PROC_KCORE is not set
24885 +CONFIG_PROC_SYSCTL=y
24886 +CONFIG_SYSFS=y
24887 +CONFIG_TMPFS=y
24888 +# CONFIG_TMPFS_POSIX_ACL is not set
24889 +# CONFIG_HUGETLB_PAGE is not set
24890 +# CONFIG_CONFIGFS_FS is not set
24891 +
24892 +#
24893 +# Miscellaneous filesystems
24894 +#
24895 +# CONFIG_ADFS_FS is not set
24896 +# CONFIG_AFFS_FS is not set
24897 +# CONFIG_HFS_FS is not set
24898 +# CONFIG_HFSPLUS_FS is not set
24899 +# CONFIG_BEFS_FS is not set
24900 +# CONFIG_BFS_FS is not set
24901 +# CONFIG_EFS_FS is not set
24902 +# CONFIG_JFFS2_FS is not set
24903 +CONFIG_CRAMFS=y
24904 +# CONFIG_VXFS_FS is not set
24905 +# CONFIG_HPFS_FS is not set
24906 +# CONFIG_QNX4FS_FS is not set
24907 +# CONFIG_SYSV_FS is not set
24908 +# CONFIG_UFS_FS is not set
24909 +CONFIG_NETWORK_FILESYSTEMS=y
24910 +CONFIG_NFS_FS=y
24911 +CONFIG_NFS_V3=y
24912 +# CONFIG_NFS_V3_ACL is not set
24913 +# CONFIG_NFS_V4 is not set
24914 +# CONFIG_NFS_DIRECTIO is not set
24915 +# CONFIG_NFSD is not set
24916 +CONFIG_ROOT_NFS=y
24917 +CONFIG_LOCKD=y
24918 +CONFIG_LOCKD_V4=y
24919 +CONFIG_NFS_COMMON=y
24920 +CONFIG_SUNRPC=y
24921 +# CONFIG_SUNRPC_BIND34 is not set
24922 +# CONFIG_RPCSEC_GSS_KRB5 is not set
24923 +# CONFIG_RPCSEC_GSS_SPKM3 is not set
24924 +# CONFIG_SMB_FS is not set
24925 +# CONFIG_CIFS is not set
24926 +# CONFIG_NCP_FS is not set
24927 +# CONFIG_CODA_FS is not set
24928 +# CONFIG_AFS_FS is not set
24929 +
24930 +#
24931 +# Partition Types
24932 +#
24933 +CONFIG_PARTITION_ADVANCED=y
24934 +# CONFIG_ACORN_PARTITION is not set
24935 +# CONFIG_OSF_PARTITION is not set
24936 +# CONFIG_AMIGA_PARTITION is not set
24937 +# CONFIG_ATARI_PARTITION is not set
24938 +# CONFIG_MAC_PARTITION is not set
24939 +CONFIG_MSDOS_PARTITION=y
24940 +# CONFIG_BSD_DISKLABEL is not set
24941 +# CONFIG_MINIX_SUBPARTITION is not set
24942 +# CONFIG_SOLARIS_X86_PARTITION is not set
24943 +# CONFIG_UNIXWARE_DISKLABEL is not set
24944 +# CONFIG_LDM_PARTITION is not set
24945 +# CONFIG_SGI_PARTITION is not set
24946 +# CONFIG_ULTRIX_PARTITION is not set
24947 +# CONFIG_SUN_PARTITION is not set
24948 +# CONFIG_KARMA_PARTITION is not set
24949 +# CONFIG_EFI_PARTITION is not set
24950 +# CONFIG_SYSV68_PARTITION is not set
24951 +# CONFIG_NLS is not set
24952 +# CONFIG_DLM is not set
24953 +# CONFIG_UCC_SLOW is not set
24954 +
24955 +#
24956 +# Library routines
24957 +#
24958 +# CONFIG_CRC_CCITT is not set
24959 +# CONFIG_CRC16 is not set
24960 +# CONFIG_CRC_ITU_T is not set
24961 +# CONFIG_CRC32 is not set
24962 +# CONFIG_CRC7 is not set
24963 +# CONFIG_LIBCRC32C is not set
24964 +CONFIG_ZLIB_INFLATE=y
24965 +CONFIG_HAS_IOMEM=y
24966 +CONFIG_HAS_IOPORT=y
24967 +CONFIG_HAS_DMA=y
24968 +CONFIG_INSTRUMENTATION=y
24969 +# CONFIG_PROFILING is not set
24970 +# CONFIG_MARKERS is not set
24971 +
24972 +#
24973 +# Kernel hacking
24974 +#
24975 +# CONFIG_PRINTK_TIME is not set
24976 +CONFIG_ENABLE_WARN_DEPRECATED=y
24977 +CONFIG_ENABLE_MUST_CHECK=y
24978 +CONFIG_MAGIC_SYSRQ=y
24979 +# CONFIG_UNUSED_SYMBOLS is not set
24980 +# CONFIG_DEBUG_FS is not set
24981 +# CONFIG_HEADERS_CHECK is not set
24982 +CONFIG_DEBUG_KERNEL=y
24983 +# CONFIG_DEBUG_SHIRQ is not set
24984 +CONFIG_DETECT_SOFTLOCKUP=y
24985 +CONFIG_SCHED_DEBUG=y
24986 +# CONFIG_SCHEDSTATS is not set
24987 +# CONFIG_TIMER_STATS is not set
24988 +# CONFIG_SLUB_DEBUG_ON is not set
24989 +# CONFIG_DEBUG_SPINLOCK is not set
24990 +# CONFIG_DEBUG_MUTEXES is not set
24991 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
24992 +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
24993 +# CONFIG_DEBUG_KOBJECT is not set
24994 +CONFIG_DEBUG_BUGVERBOSE=y
24995 +CONFIG_DEBUG_INFO=y
24996 +# CONFIG_DEBUG_VM is not set
24997 +# CONFIG_DEBUG_LIST is not set
24998 +# CONFIG_DEBUG_SG is not set
24999 +CONFIG_FORCED_INLINING=y
25000 +# CONFIG_BOOT_PRINTK_DELAY is not set
25001 +# CONFIG_FAULT_INJECTION is not set
25002 +# CONFIG_SAMPLES is not set
25003 +# CONFIG_DEBUG_STACKOVERFLOW is not set
25004 +# CONFIG_DEBUG_STACK_USAGE is not set
25005 +# CONFIG_DEBUG_PAGEALLOC is not set
25006 +# CONFIG_DEBUGGER is not set
25007 +# CONFIG_BDI_SWITCH is not set
25008 +# CONFIG_PPC_EARLY_DEBUG is not set
25009 +
25010 +#
25011 +# Security options
25012 +#
25013 +# CONFIG_KEYS is not set
25014 +# CONFIG_SECURITY is not set
25015 +# CONFIG_SECURITY_FILE_CAPABILITIES is not set
25016 +# CONFIG_CRYPTO is not set
25017 +# CONFIG_PPC_CLOCK is not set
25018 +CONFIG_PPC_LIB_RHEAP=y
25019 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/configs/bamboo_defconfig powerpc.git/arch/powerpc/configs/bamboo_defconfig
25020 --- linux-2.6.24/arch/powerpc/configs/bamboo_defconfig  2008-01-24 23:58:37.000000000 +0100
25021 +++ powerpc.git/arch/powerpc/configs/bamboo_defconfig   2008-01-28 20:25:49.000000000 +0100
25022 @@ -1,7 +1,7 @@
25023  #
25024  # Automatically generated make config: don't edit
25025 -# Linux kernel version: 2.6.24-rc4
25026 -# Thu Dec  6 16:48:04 2007
25027 +# Linux kernel version: 2.6.24-rc6
25028 +# Mon Dec 24 10:49:50 2007
25029  #
25030  # CONFIG_PPC64 is not set
25031  
25032 @@ -131,6 +131,7 @@
25033  # CONFIG_DEFAULT_CFQ is not set
25034  # CONFIG_DEFAULT_NOOP is not set
25035  CONFIG_DEFAULT_IOSCHED="anticipatory"
25036 +# CONFIG_PPC4xx_PCI_EXPRESS is not set
25037  
25038  #
25039  # Platform support
25040 @@ -143,6 +144,9 @@
25041  CONFIG_BAMBOO=y
25042  # CONFIG_EBONY is not set
25043  # CONFIG_SEQUOIA is not set
25044 +# CONFIG_TAISHAN is not set
25045 +# CONFIG_KATMAI is not set
25046 +# CONFIG_RAINIER is not set
25047  CONFIG_440EP=y
25048  CONFIG_IBM440EP_ERR42=y
25049  # CONFIG_MPIC is not set
25050 @@ -372,9 +376,7 @@
25051  # CONFIG_FIREWIRE is not set
25052  # CONFIG_IEEE1394 is not set
25053  # CONFIG_I2O is not set
25054 -CONFIG_MACINTOSH_DRIVERS=y
25055 -# CONFIG_MAC_EMUMOUSEBTN is not set
25056 -# CONFIG_WINDFARM is not set
25057 +# CONFIG_MACINTOSH_DRIVERS is not set
25058  CONFIG_NETDEVICES=y
25059  # CONFIG_NETDEVICES_MULTIQUEUE is not set
25060  # CONFIG_DUMMY is not set
25061 @@ -736,19 +738,7 @@
25062  # CONFIG_KGDB is not set
25063  # CONFIG_XMON is not set
25064  # CONFIG_BDI_SWITCH is not set
25065 -CONFIG_PPC_EARLY_DEBUG=y
25066 -# CONFIG_PPC_EARLY_DEBUG_LPAR is not set
25067 -# CONFIG_PPC_EARLY_DEBUG_G5 is not set
25068 -# CONFIG_PPC_EARLY_DEBUG_RTAS_PANEL is not set
25069 -# CONFIG_PPC_EARLY_DEBUG_RTAS_CONSOLE is not set
25070 -# CONFIG_PPC_EARLY_DEBUG_MAPLE is not set
25071 -# CONFIG_PPC_EARLY_DEBUG_ISERIES is not set
25072 -# CONFIG_PPC_EARLY_DEBUG_PAS_REALMODE is not set
25073 -# CONFIG_PPC_EARLY_DEBUG_BEAT is not set
25074 -CONFIG_PPC_EARLY_DEBUG_44x=y
25075 -# CONFIG_PPC_EARLY_DEBUG_CPM is not set
25076 -CONFIG_PPC_EARLY_DEBUG_44x_PHYSLOW=0xef600300
25077 -CONFIG_PPC_EARLY_DEBUG_44x_PHYSHIGH=0x0
25078 +# CONFIG_PPC_EARLY_DEBUG is not set
25079  
25080  #
25081  # Security options
25082 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/configs/celleb_defconfig powerpc.git/arch/powerpc/configs/celleb_defconfig
25083 --- linux-2.6.24/arch/powerpc/configs/celleb_defconfig  2008-01-24 23:58:37.000000000 +0100
25084 +++ powerpc.git/arch/powerpc/configs/celleb_defconfig   2008-01-28 20:25:49.000000000 +0100
25085 @@ -50,7 +50,8 @@
25086  CONFIG_GENERIC_BUG=y
25087  # CONFIG_DEFAULT_UIMAGE is not set
25088  # CONFIG_PPC_DCR_NATIVE is not set
25089 -# CONFIG_PPC_DCR_MMIO is not set
25090 +CONFIG_PPC_DCR_MMIO=y
25091 +CONFIG_PPC_DCR=y
25092  CONFIG_PPC_OF_PLATFORM_PCI=y
25093  CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
25094  
25095 @@ -148,7 +149,7 @@
25096  CONFIG_PPC_CELLEB=y
25097  # CONFIG_PPC_PS3 is not set
25098  CONFIG_PPC_CELL=y
25099 -# CONFIG_PPC_CELL_NATIVE is not set
25100 +CONFIG_PPC_CELL_NATIVE=y
25101  # CONFIG_PPC_IBM_CELL_BLADE is not set
25102  
25103  #
25104 @@ -157,13 +158,19 @@
25105  CONFIG_SPU_FS=y
25106  CONFIG_SPU_FS_64K_LS=y
25107  CONFIG_SPU_BASE=y
25108 +CONFIG_CBE_RAS=y
25109 +# CONFIG_CBE_THERM is not set
25110  # CONFIG_PQ2ADS is not set
25111 +CONFIG_PPC_NATIVE=y
25112 +CONFIG_UDBG_RTAS_CONSOLE=y
25113  CONFIG_PPC_UDBG_BEAT=y
25114 -# CONFIG_MPIC is not set
25115 +CONFIG_MPIC=y
25116  # CONFIG_MPIC_WEIRD is not set
25117  # CONFIG_PPC_I8259 is not set
25118  # CONFIG_U3_DART is not set
25119 -# CONFIG_PPC_RTAS is not set
25120 +CONFIG_PPC_RTAS=y
25121 +# CONFIG_RTAS_ERROR_LOGGING is not set
25122 +# CONFIG_RTAS_PROC is not set
25123  # CONFIG_MMIO_NVRAM is not set
25124  # CONFIG_PPC_MPC106 is not set
25125  # CONFIG_PPC_970_NAP is not set
25126 @@ -593,10 +600,11 @@
25127  # CONFIG_NET_VENDOR_3COM is not set
25128  # CONFIG_NET_TULIP is not set
25129  # CONFIG_HP100 is not set
25130 -# CONFIG_IBM_NEW_EMAC_ZMII is not set
25131 -# CONFIG_IBM_NEW_EMAC_RGMII is not set
25132 -# CONFIG_IBM_NEW_EMAC_TAH is not set
25133 -# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
25134 +# CONFIG_IBM_NEW_EMAC is not set
25135 +CONFIG_IBM_NEW_EMAC_ZMII=y
25136 +CONFIG_IBM_NEW_EMAC_RGMII=y
25137 +CONFIG_IBM_NEW_EMAC_TAH=y
25138 +CONFIG_IBM_NEW_EMAC_EMAC4=y
25139  # CONFIG_NET_PCI is not set
25140  # CONFIG_B44 is not set
25141  CONFIG_NETDEV_1000=y
25142 @@ -741,6 +749,7 @@
25143  CONFIG_UNIX98_PTYS=y
25144  # CONFIG_LEGACY_PTYS is not set
25145  CONFIG_HVC_DRIVER=y
25146 +CONFIG_HVC_RTAS=y
25147  CONFIG_HVC_BEAT=y
25148  # CONFIG_IPMI_HANDLER is not set
25149  # CONFIG_HW_RANDOM is not set
25150 @@ -822,6 +831,7 @@
25151  # Watchdog Device Drivers
25152  #
25153  # CONFIG_SOFT_WATCHDOG is not set
25154 +# CONFIG_WATCHDOG_RTAS is not set
25155  
25156  #
25157  # PCI-based Watchdog Cards
25158 @@ -1245,17 +1255,7 @@
25159  CONFIG_IRQSTACKS=y
25160  # CONFIG_VIRQ_DEBUG is not set
25161  # CONFIG_BOOTX_TEXT is not set
25162 -CONFIG_PPC_EARLY_DEBUG=y
25163 -# CONFIG_PPC_EARLY_DEBUG_LPAR is not set
25164 -# CONFIG_PPC_EARLY_DEBUG_G5 is not set
25165 -# CONFIG_PPC_EARLY_DEBUG_RTAS_PANEL is not set
25166 -# CONFIG_PPC_EARLY_DEBUG_RTAS_CONSOLE is not set
25167 -# CONFIG_PPC_EARLY_DEBUG_MAPLE is not set
25168 -# CONFIG_PPC_EARLY_DEBUG_ISERIES is not set
25169 -# CONFIG_PPC_EARLY_DEBUG_PAS_REALMODE is not set
25170 -CONFIG_PPC_EARLY_DEBUG_BEAT=y
25171 -# CONFIG_PPC_EARLY_DEBUG_44x is not set
25172 -# CONFIG_PPC_EARLY_DEBUG_CPM is not set
25173 +# CONFIG_PPC_EARLY_DEBUG is not set
25174  
25175  #
25176  # Security options
25177 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/configs/ebony_defconfig powerpc.git/arch/powerpc/configs/ebony_defconfig
25178 --- linux-2.6.24/arch/powerpc/configs/ebony_defconfig   2008-01-24 23:58:37.000000000 +0100
25179 +++ powerpc.git/arch/powerpc/configs/ebony_defconfig    2008-01-28 20:25:49.000000000 +0100
25180 @@ -1,7 +1,7 @@
25181  #
25182  # Automatically generated make config: don't edit
25183 -# Linux kernel version: 2.6.24-rc4
25184 -# Thu Dec  6 16:48:11 2007
25185 +# Linux kernel version: 2.6.24-rc6
25186 +# Mon Dec 24 11:16:26 2007
25187  #
25188  # CONFIG_PPC64 is not set
25189  
25190 @@ -130,6 +130,7 @@
25191  # CONFIG_DEFAULT_CFQ is not set
25192  # CONFIG_DEFAULT_NOOP is not set
25193  CONFIG_DEFAULT_IOSCHED="anticipatory"
25194 +# CONFIG_PPC4xx_PCI_EXPRESS is not set
25195  
25196  #
25197  # Platform support
25198 @@ -142,6 +143,9 @@
25199  # CONFIG_BAMBOO is not set
25200  CONFIG_EBONY=y
25201  # CONFIG_SEQUOIA is not set
25202 +# CONFIG_TAISHAN is not set
25203 +# CONFIG_KATMAI is not set
25204 +# CONFIG_RAINIER is not set
25205  CONFIG_440GP=y
25206  # CONFIG_MPIC is not set
25207  # CONFIG_MPIC_WEIRD is not set
25208 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/configs/ep405_defconfig powerpc.git/arch/powerpc/configs/ep405_defconfig
25209 --- linux-2.6.24/arch/powerpc/configs/ep405_defconfig   1970-01-01 01:00:00.000000000 +0100
25210 +++ powerpc.git/arch/powerpc/configs/ep405_defconfig    2008-01-28 20:25:49.000000000 +0100
25211 @@ -0,0 +1,952 @@
25212 +#
25213 +# Automatically generated make config: don't edit
25214 +# Linux kernel version: 2.6.24-rc6
25215 +# Mon Dec 24 11:17:13 2007
25216 +#
25217 +# CONFIG_PPC64 is not set
25218 +
25219 +#
25220 +# Processor support
25221 +#
25222 +# CONFIG_6xx is not set
25223 +# CONFIG_PPC_85xx is not set
25224 +# CONFIG_PPC_8xx is not set
25225 +CONFIG_40x=y
25226 +# CONFIG_44x is not set
25227 +# CONFIG_E200 is not set
25228 +CONFIG_4xx=y
25229 +# CONFIG_PPC_MM_SLICES is not set
25230 +CONFIG_NOT_COHERENT_CACHE=y
25231 +CONFIG_PPC32=y
25232 +CONFIG_WORD_SIZE=32
25233 +CONFIG_PPC_MERGE=y
25234 +CONFIG_MMU=y
25235 +CONFIG_GENERIC_CMOS_UPDATE=y
25236 +CONFIG_GENERIC_TIME=y
25237 +CONFIG_GENERIC_TIME_VSYSCALL=y
25238 +CONFIG_GENERIC_CLOCKEVENTS=y
25239 +CONFIG_GENERIC_HARDIRQS=y
25240 +CONFIG_IRQ_PER_CPU=y
25241 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
25242 +CONFIG_ARCH_HAS_ILOG2_U32=y
25243 +CONFIG_GENERIC_HWEIGHT=y
25244 +CONFIG_GENERIC_CALIBRATE_DELAY=y
25245 +CONFIG_GENERIC_FIND_NEXT_BIT=y
25246 +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
25247 +CONFIG_PPC=y
25248 +CONFIG_EARLY_PRINTK=y
25249 +CONFIG_GENERIC_NVRAM=y
25250 +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
25251 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
25252 +CONFIG_PPC_OF=y
25253 +CONFIG_OF=y
25254 +CONFIG_PPC_UDBG_16550=y
25255 +# CONFIG_GENERIC_TBSYNC is not set
25256 +CONFIG_AUDIT_ARCH=y
25257 +CONFIG_GENERIC_BUG=y
25258 +# CONFIG_DEFAULT_UIMAGE is not set
25259 +CONFIG_PPC_DCR_NATIVE=y
25260 +# CONFIG_PPC_DCR_MMIO is not set
25261 +CONFIG_PPC_DCR=y
25262 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
25263 +
25264 +#
25265 +# General setup
25266 +#
25267 +CONFIG_EXPERIMENTAL=y
25268 +CONFIG_BROKEN_ON_SMP=y
25269 +CONFIG_INIT_ENV_ARG_LIMIT=32
25270 +CONFIG_LOCALVERSION=""
25271 +CONFIG_LOCALVERSION_AUTO=y
25272 +CONFIG_SWAP=y
25273 +CONFIG_SYSVIPC=y
25274 +CONFIG_SYSVIPC_SYSCTL=y
25275 +CONFIG_POSIX_MQUEUE=y
25276 +# CONFIG_BSD_PROCESS_ACCT is not set
25277 +# CONFIG_TASKSTATS is not set
25278 +# CONFIG_USER_NS is not set
25279 +# CONFIG_PID_NS is not set
25280 +# CONFIG_AUDIT is not set
25281 +# CONFIG_IKCONFIG is not set
25282 +CONFIG_LOG_BUF_SHIFT=14
25283 +# CONFIG_CGROUPS is not set
25284 +CONFIG_FAIR_GROUP_SCHED=y
25285 +CONFIG_FAIR_USER_SCHED=y
25286 +# CONFIG_FAIR_CGROUP_SCHED is not set
25287 +CONFIG_SYSFS_DEPRECATED=y
25288 +# CONFIG_RELAY is not set
25289 +CONFIG_BLK_DEV_INITRD=y
25290 +CONFIG_INITRAMFS_SOURCE=""
25291 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
25292 +CONFIG_SYSCTL=y
25293 +CONFIG_EMBEDDED=y
25294 +CONFIG_SYSCTL_SYSCALL=y
25295 +CONFIG_KALLSYMS=y
25296 +CONFIG_KALLSYMS_ALL=y
25297 +CONFIG_KALLSYMS_EXTRA_PASS=y
25298 +CONFIG_HOTPLUG=y
25299 +CONFIG_PRINTK=y
25300 +CONFIG_BUG=y
25301 +CONFIG_ELF_CORE=y
25302 +CONFIG_BASE_FULL=y
25303 +CONFIG_FUTEX=y
25304 +CONFIG_ANON_INODES=y
25305 +CONFIG_EPOLL=y
25306 +CONFIG_SIGNALFD=y
25307 +CONFIG_EVENTFD=y
25308 +CONFIG_SHMEM=y
25309 +CONFIG_VM_EVENT_COUNTERS=y
25310 +CONFIG_SLUB_DEBUG=y
25311 +# CONFIG_SLAB is not set
25312 +CONFIG_SLUB=y
25313 +# CONFIG_SLOB is not set
25314 +CONFIG_RT_MUTEXES=y
25315 +# CONFIG_TINY_SHMEM is not set
25316 +CONFIG_BASE_SMALL=0
25317 +CONFIG_MODULES=y
25318 +CONFIG_MODULE_UNLOAD=y
25319 +# CONFIG_MODULE_FORCE_UNLOAD is not set
25320 +# CONFIG_MODVERSIONS is not set
25321 +# CONFIG_MODULE_SRCVERSION_ALL is not set
25322 +CONFIG_KMOD=y
25323 +CONFIG_BLOCK=y
25324 +CONFIG_LBD=y
25325 +# CONFIG_BLK_DEV_IO_TRACE is not set
25326 +# CONFIG_LSF is not set
25327 +# CONFIG_BLK_DEV_BSG is not set
25328 +
25329 +#
25330 +# IO Schedulers
25331 +#
25332 +CONFIG_IOSCHED_NOOP=y
25333 +CONFIG_IOSCHED_AS=y
25334 +CONFIG_IOSCHED_DEADLINE=y
25335 +CONFIG_IOSCHED_CFQ=y
25336 +CONFIG_DEFAULT_AS=y
25337 +# CONFIG_DEFAULT_DEADLINE is not set
25338 +# CONFIG_DEFAULT_CFQ is not set
25339 +# CONFIG_DEFAULT_NOOP is not set
25340 +CONFIG_DEFAULT_IOSCHED="anticipatory"
25341 +# CONFIG_PPC4xx_PCI_EXPRESS is not set
25342 +
25343 +#
25344 +# Platform support
25345 +#
25346 +# CONFIG_PPC_MPC52xx is not set
25347 +# CONFIG_PPC_MPC5200 is not set
25348 +# CONFIG_PPC_CELL is not set
25349 +# CONFIG_PPC_CELL_NATIVE is not set
25350 +# CONFIG_PQ2ADS is not set
25351 +CONFIG_EP405=y
25352 +# CONFIG_KILAUEA is not set
25353 +# CONFIG_MAKALU is not set
25354 +# CONFIG_WALNUT is not set
25355 +# CONFIG_XILINX_VIRTEX_GENERIC_BOARD is not set
25356 +CONFIG_405GP=y
25357 +CONFIG_IBM405_ERR77=y
25358 +CONFIG_IBM405_ERR51=y
25359 +# CONFIG_MPIC is not set
25360 +# CONFIG_MPIC_WEIRD is not set
25361 +# CONFIG_PPC_I8259 is not set
25362 +# CONFIG_PPC_RTAS is not set
25363 +# CONFIG_MMIO_NVRAM is not set
25364 +# CONFIG_PPC_MPC106 is not set
25365 +# CONFIG_PPC_970_NAP is not set
25366 +# CONFIG_PPC_INDIRECT_IO is not set
25367 +# CONFIG_GENERIC_IOMAP is not set
25368 +# CONFIG_CPU_FREQ is not set
25369 +# CONFIG_CPM2 is not set
25370 +# CONFIG_FSL_ULI1575 is not set
25371 +
25372 +#
25373 +# Kernel options
25374 +#
25375 +# CONFIG_HIGHMEM is not set
25376 +# CONFIG_TICK_ONESHOT is not set
25377 +# CONFIG_NO_HZ is not set
25378 +# CONFIG_HIGH_RES_TIMERS is not set
25379 +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
25380 +# CONFIG_HZ_100 is not set
25381 +CONFIG_HZ_250=y
25382 +# CONFIG_HZ_300 is not set
25383 +# CONFIG_HZ_1000 is not set
25384 +CONFIG_HZ=250
25385 +CONFIG_PREEMPT_NONE=y
25386 +# CONFIG_PREEMPT_VOLUNTARY is not set
25387 +# CONFIG_PREEMPT is not set
25388 +CONFIG_BINFMT_ELF=y
25389 +# CONFIG_BINFMT_MISC is not set
25390 +# CONFIG_MATH_EMULATION is not set
25391 +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
25392 +CONFIG_ARCH_FLATMEM_ENABLE=y
25393 +CONFIG_ARCH_POPULATES_NODE_MAP=y
25394 +CONFIG_SELECT_MEMORY_MODEL=y
25395 +CONFIG_FLATMEM_MANUAL=y
25396 +# CONFIG_DISCONTIGMEM_MANUAL is not set
25397 +# CONFIG_SPARSEMEM_MANUAL is not set
25398 +CONFIG_FLATMEM=y
25399 +CONFIG_FLAT_NODE_MEM_MAP=y
25400 +# CONFIG_SPARSEMEM_STATIC is not set
25401 +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
25402 +CONFIG_SPLIT_PTLOCK_CPUS=4
25403 +# CONFIG_RESOURCES_64BIT is not set
25404 +CONFIG_ZONE_DMA_FLAG=1
25405 +CONFIG_BOUNCE=y
25406 +CONFIG_VIRT_TO_BUS=y
25407 +CONFIG_PROC_DEVICETREE=y
25408 +# CONFIG_CMDLINE_BOOL is not set
25409 +# CONFIG_PM is not set
25410 +CONFIG_SUSPEND_UP_POSSIBLE=y
25411 +CONFIG_HIBERNATION_UP_POSSIBLE=y
25412 +CONFIG_SECCOMP=y
25413 +CONFIG_WANT_DEVICE_TREE=y
25414 +CONFIG_DEVICE_TREE="ep405.dts"
25415 +CONFIG_ISA_DMA_API=y
25416 +
25417 +#
25418 +# Bus options
25419 +#
25420 +CONFIG_ZONE_DMA=y
25421 +CONFIG_PPC_INDIRECT_PCI=y
25422 +CONFIG_PCI=y
25423 +CONFIG_PCI_DOMAINS=y
25424 +CONFIG_PCI_SYSCALL=y
25425 +# CONFIG_PCIEPORTBUS is not set
25426 +CONFIG_ARCH_SUPPORTS_MSI=y
25427 +# CONFIG_PCI_MSI is not set
25428 +CONFIG_PCI_LEGACY=y
25429 +# CONFIG_PCI_DEBUG is not set
25430 +# CONFIG_PCCARD is not set
25431 +# CONFIG_HOTPLUG_PCI is not set
25432 +
25433 +#
25434 +# Advanced setup
25435 +#
25436 +# CONFIG_ADVANCED_OPTIONS is not set
25437 +
25438 +#
25439 +# Default settings for advanced configuration options are used
25440 +#
25441 +CONFIG_HIGHMEM_START=0xfe000000
25442 +CONFIG_LOWMEM_SIZE=0x30000000
25443 +CONFIG_KERNEL_START=0xc0000000
25444 +CONFIG_TASK_SIZE=0xc0000000
25445 +CONFIG_CONSISTENT_START=0xff100000
25446 +CONFIG_CONSISTENT_SIZE=0x00200000
25447 +CONFIG_BOOT_LOAD=0x00400000
25448 +
25449 +#
25450 +# Networking
25451 +#
25452 +CONFIG_NET=y
25453 +
25454 +#
25455 +# Networking options
25456 +#
25457 +CONFIG_PACKET=y
25458 +# CONFIG_PACKET_MMAP is not set
25459 +CONFIG_UNIX=y
25460 +# CONFIG_NET_KEY is not set
25461 +CONFIG_INET=y
25462 +# CONFIG_IP_MULTICAST is not set
25463 +# CONFIG_IP_ADVANCED_ROUTER is not set
25464 +CONFIG_IP_FIB_HASH=y
25465 +CONFIG_IP_PNP=y
25466 +CONFIG_IP_PNP_DHCP=y
25467 +CONFIG_IP_PNP_BOOTP=y
25468 +# CONFIG_IP_PNP_RARP is not set
25469 +# CONFIG_NET_IPIP is not set
25470 +# CONFIG_NET_IPGRE is not set
25471 +# CONFIG_ARPD is not set
25472 +# CONFIG_SYN_COOKIES is not set
25473 +# CONFIG_INET_AH is not set
25474 +# CONFIG_INET_ESP is not set
25475 +# CONFIG_INET_IPCOMP is not set
25476 +# CONFIG_INET_XFRM_TUNNEL is not set
25477 +# CONFIG_INET_TUNNEL is not set
25478 +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
25479 +# CONFIG_INET_XFRM_MODE_TUNNEL is not set
25480 +# CONFIG_INET_XFRM_MODE_BEET is not set
25481 +# CONFIG_INET_LRO is not set
25482 +CONFIG_INET_DIAG=y
25483 +CONFIG_INET_TCP_DIAG=y
25484 +# CONFIG_TCP_CONG_ADVANCED is not set
25485 +CONFIG_TCP_CONG_CUBIC=y
25486 +CONFIG_DEFAULT_TCP_CONG="cubic"
25487 +# CONFIG_TCP_MD5SIG is not set
25488 +# CONFIG_IPV6 is not set
25489 +# CONFIG_INET6_XFRM_TUNNEL is not set
25490 +# CONFIG_INET6_TUNNEL is not set
25491 +# CONFIG_NETWORK_SECMARK is not set
25492 +# CONFIG_NETFILTER is not set
25493 +# CONFIG_IP_DCCP is not set
25494 +# CONFIG_IP_SCTP is not set
25495 +# CONFIG_TIPC is not set
25496 +# CONFIG_ATM is not set
25497 +# CONFIG_BRIDGE is not set
25498 +# CONFIG_VLAN_8021Q is not set
25499 +# CONFIG_DECNET is not set
25500 +# CONFIG_LLC2 is not set
25501 +# CONFIG_IPX is not set
25502 +# CONFIG_ATALK is not set
25503 +# CONFIG_X25 is not set
25504 +# CONFIG_LAPB is not set
25505 +# CONFIG_ECONET is not set
25506 +# CONFIG_WAN_ROUTER is not set
25507 +# CONFIG_NET_SCHED is not set
25508 +
25509 +#
25510 +# Network testing
25511 +#
25512 +# CONFIG_NET_PKTGEN is not set
25513 +# CONFIG_HAMRADIO is not set
25514 +# CONFIG_IRDA is not set
25515 +# CONFIG_BT is not set
25516 +# CONFIG_AF_RXRPC is not set
25517 +
25518 +#
25519 +# Wireless
25520 +#
25521 +# CONFIG_CFG80211 is not set
25522 +# CONFIG_WIRELESS_EXT is not set
25523 +# CONFIG_MAC80211 is not set
25524 +# CONFIG_IEEE80211 is not set
25525 +# CONFIG_RFKILL is not set
25526 +# CONFIG_NET_9P is not set
25527 +
25528 +#
25529 +# Device Drivers
25530 +#
25531 +
25532 +#
25533 +# Generic Driver Options
25534 +#
25535 +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
25536 +CONFIG_STANDALONE=y
25537 +CONFIG_PREVENT_FIRMWARE_BUILD=y
25538 +CONFIG_FW_LOADER=y
25539 +# CONFIG_DEBUG_DRIVER is not set
25540 +# CONFIG_DEBUG_DEVRES is not set
25541 +# CONFIG_SYS_HYPERVISOR is not set
25542 +CONFIG_CONNECTOR=y
25543 +CONFIG_PROC_EVENTS=y
25544 +CONFIG_MTD=y
25545 +# CONFIG_MTD_DEBUG is not set
25546 +# CONFIG_MTD_CONCAT is not set
25547 +CONFIG_MTD_PARTITIONS=y
25548 +# CONFIG_MTD_REDBOOT_PARTS is not set
25549 +CONFIG_MTD_CMDLINE_PARTS=y
25550 +
25551 +#
25552 +# User Modules And Translation Layers
25553 +#
25554 +CONFIG_MTD_CHAR=y
25555 +CONFIG_MTD_BLKDEVS=m
25556 +CONFIG_MTD_BLOCK=m
25557 +# CONFIG_MTD_BLOCK_RO is not set
25558 +# CONFIG_FTL is not set
25559 +# CONFIG_NFTL is not set
25560 +# CONFIG_INFTL is not set
25561 +# CONFIG_RFD_FTL is not set
25562 +# CONFIG_SSFDC is not set
25563 +# CONFIG_MTD_OOPS is not set
25564 +
25565 +#
25566 +# RAM/ROM/Flash chip drivers
25567 +#
25568 +CONFIG_MTD_CFI=y
25569 +CONFIG_MTD_JEDECPROBE=y
25570 +CONFIG_MTD_GEN_PROBE=y
25571 +# CONFIG_MTD_CFI_ADV_OPTIONS is not set
25572 +CONFIG_MTD_MAP_BANK_WIDTH_1=y
25573 +CONFIG_MTD_MAP_BANK_WIDTH_2=y
25574 +CONFIG_MTD_MAP_BANK_WIDTH_4=y
25575 +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
25576 +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
25577 +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
25578 +CONFIG_MTD_CFI_I1=y
25579 +CONFIG_MTD_CFI_I2=y
25580 +# CONFIG_MTD_CFI_I4 is not set
25581 +# CONFIG_MTD_CFI_I8 is not set
25582 +# CONFIG_MTD_CFI_INTELEXT is not set
25583 +CONFIG_MTD_CFI_AMDSTD=y
25584 +# CONFIG_MTD_CFI_STAA is not set
25585 +CONFIG_MTD_CFI_UTIL=y
25586 +# CONFIG_MTD_RAM is not set
25587 +# CONFIG_MTD_ROM is not set
25588 +# CONFIG_MTD_ABSENT is not set
25589 +
25590 +#
25591 +# Mapping drivers for chip access
25592 +#
25593 +# CONFIG_MTD_COMPLEX_MAPPINGS is not set
25594 +# CONFIG_MTD_PHYSMAP is not set
25595 +CONFIG_MTD_PHYSMAP_OF=y
25596 +# CONFIG_MTD_INTEL_VR_NOR is not set
25597 +# CONFIG_MTD_PLATRAM is not set
25598 +
25599 +#
25600 +# Self-contained MTD device drivers
25601 +#
25602 +# CONFIG_MTD_PMC551 is not set
25603 +# CONFIG_MTD_SLRAM is not set
25604 +# CONFIG_MTD_PHRAM is not set
25605 +# CONFIG_MTD_MTDRAM is not set
25606 +# CONFIG_MTD_BLOCK2MTD is not set
25607 +
25608 +#
25609 +# Disk-On-Chip Device Drivers
25610 +#
25611 +# CONFIG_MTD_DOC2000 is not set
25612 +# CONFIG_MTD_DOC2001 is not set
25613 +# CONFIG_MTD_DOC2001PLUS is not set
25614 +# CONFIG_MTD_NAND is not set
25615 +# CONFIG_MTD_ONENAND is not set
25616 +
25617 +#
25618 +# UBI - Unsorted block images
25619 +#
25620 +# CONFIG_MTD_UBI is not set
25621 +CONFIG_OF_DEVICE=y
25622 +# CONFIG_PARPORT is not set
25623 +CONFIG_BLK_DEV=y
25624 +# CONFIG_BLK_DEV_FD is not set
25625 +# CONFIG_BLK_CPQ_DA is not set
25626 +# CONFIG_BLK_CPQ_CISS_DA is not set
25627 +# CONFIG_BLK_DEV_DAC960 is not set
25628 +# CONFIG_BLK_DEV_UMEM is not set
25629 +# CONFIG_BLK_DEV_COW_COMMON is not set
25630 +# CONFIG_BLK_DEV_LOOP is not set
25631 +# CONFIG_BLK_DEV_NBD is not set
25632 +# CONFIG_BLK_DEV_SX8 is not set
25633 +# CONFIG_BLK_DEV_UB is not set
25634 +CONFIG_BLK_DEV_RAM=y
25635 +CONFIG_BLK_DEV_RAM_COUNT=16
25636 +CONFIG_BLK_DEV_RAM_SIZE=35000
25637 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
25638 +# CONFIG_CDROM_PKTCDVD is not set
25639 +# CONFIG_ATA_OVER_ETH is not set
25640 +# CONFIG_XILINX_SYSACE is not set
25641 +CONFIG_MISC_DEVICES=y
25642 +# CONFIG_PHANTOM is not set
25643 +# CONFIG_EEPROM_93CX6 is not set
25644 +# CONFIG_SGI_IOC4 is not set
25645 +# CONFIG_TIFM_CORE is not set
25646 +# CONFIG_IDE is not set
25647 +
25648 +#
25649 +# SCSI device support
25650 +#
25651 +# CONFIG_RAID_ATTRS is not set
25652 +# CONFIG_SCSI is not set
25653 +# CONFIG_SCSI_DMA is not set
25654 +# CONFIG_SCSI_NETLINK is not set
25655 +# CONFIG_ATA is not set
25656 +# CONFIG_MD is not set
25657 +# CONFIG_FUSION is not set
25658 +
25659 +#
25660 +# IEEE 1394 (FireWire) support
25661 +#
25662 +# CONFIG_FIREWIRE is not set
25663 +# CONFIG_IEEE1394 is not set
25664 +# CONFIG_I2O is not set
25665 +# CONFIG_MACINTOSH_DRIVERS is not set
25666 +CONFIG_NETDEVICES=y
25667 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
25668 +# CONFIG_DUMMY is not set
25669 +# CONFIG_BONDING is not set
25670 +# CONFIG_MACVLAN is not set
25671 +# CONFIG_EQUALIZER is not set
25672 +# CONFIG_TUN is not set
25673 +# CONFIG_VETH is not set
25674 +# CONFIG_IP1000 is not set
25675 +# CONFIG_ARCNET is not set
25676 +# CONFIG_PHYLIB is not set
25677 +CONFIG_NET_ETHERNET=y
25678 +# CONFIG_MII is not set
25679 +# CONFIG_HAPPYMEAL is not set
25680 +# CONFIG_SUNGEM is not set
25681 +# CONFIG_CASSINI is not set
25682 +# CONFIG_NET_VENDOR_3COM is not set
25683 +# CONFIG_NET_TULIP is not set
25684 +# CONFIG_HP100 is not set
25685 +CONFIG_IBM_NEW_EMAC=y
25686 +CONFIG_IBM_NEW_EMAC_RXB=128
25687 +CONFIG_IBM_NEW_EMAC_TXB=64
25688 +CONFIG_IBM_NEW_EMAC_POLL_WEIGHT=32
25689 +CONFIG_IBM_NEW_EMAC_RX_COPY_THRESHOLD=256
25690 +CONFIG_IBM_NEW_EMAC_RX_SKB_HEADROOM=0
25691 +# CONFIG_IBM_NEW_EMAC_DEBUG is not set
25692 +CONFIG_IBM_NEW_EMAC_ZMII=y
25693 +# CONFIG_IBM_NEW_EMAC_RGMII is not set
25694 +# CONFIG_IBM_NEW_EMAC_TAH is not set
25695 +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
25696 +# CONFIG_NET_PCI is not set
25697 +# CONFIG_B44 is not set
25698 +CONFIG_NETDEV_1000=y
25699 +# CONFIG_ACENIC is not set
25700 +# CONFIG_DL2K is not set
25701 +# CONFIG_E1000 is not set
25702 +# CONFIG_E1000E is not set
25703 +# CONFIG_NS83820 is not set
25704 +# CONFIG_HAMACHI is not set
25705 +# CONFIG_YELLOWFIN is not set
25706 +# CONFIG_R8169 is not set
25707 +# CONFIG_SIS190 is not set
25708 +# CONFIG_SKGE is not set
25709 +# CONFIG_SKY2 is not set
25710 +# CONFIG_SK98LIN is not set
25711 +# CONFIG_VIA_VELOCITY is not set
25712 +# CONFIG_TIGON3 is not set
25713 +# CONFIG_BNX2 is not set
25714 +# CONFIG_QLA3XXX is not set
25715 +# CONFIG_ATL1 is not set
25716 +CONFIG_NETDEV_10000=y
25717 +# CONFIG_CHELSIO_T1 is not set
25718 +# CONFIG_CHELSIO_T3 is not set
25719 +# CONFIG_IXGBE is not set
25720 +# CONFIG_IXGB is not set
25721 +# CONFIG_S2IO is not set
25722 +# CONFIG_MYRI10GE is not set
25723 +# CONFIG_NETXEN_NIC is not set
25724 +# CONFIG_NIU is not set
25725 +# CONFIG_MLX4_CORE is not set
25726 +# CONFIG_TEHUTI is not set
25727 +# CONFIG_TR is not set
25728 +
25729 +#
25730 +# Wireless LAN
25731 +#
25732 +# CONFIG_WLAN_PRE80211 is not set
25733 +# CONFIG_WLAN_80211 is not set
25734 +
25735 +#
25736 +# USB Network Adapters
25737 +#
25738 +# CONFIG_USB_CATC is not set
25739 +# CONFIG_USB_KAWETH is not set
25740 +# CONFIG_USB_PEGASUS is not set
25741 +# CONFIG_USB_RTL8150 is not set
25742 +# CONFIG_USB_USBNET is not set
25743 +# CONFIG_WAN is not set
25744 +# CONFIG_FDDI is not set
25745 +# CONFIG_HIPPI is not set
25746 +# CONFIG_PPP is not set
25747 +# CONFIG_SLIP is not set
25748 +# CONFIG_SHAPER is not set
25749 +# CONFIG_NETCONSOLE is not set
25750 +# CONFIG_NETPOLL is not set
25751 +# CONFIG_NET_POLL_CONTROLLER is not set
25752 +# CONFIG_ISDN is not set
25753 +# CONFIG_PHONE is not set
25754 +
25755 +#
25756 +# Input device support
25757 +#
25758 +# CONFIG_INPUT is not set
25759 +
25760 +#
25761 +# Hardware I/O ports
25762 +#
25763 +# CONFIG_SERIO is not set
25764 +# CONFIG_GAMEPORT is not set
25765 +
25766 +#
25767 +# Character devices
25768 +#
25769 +# CONFIG_VT is not set
25770 +# CONFIG_SERIAL_NONSTANDARD is not set
25771 +
25772 +#
25773 +# Serial drivers
25774 +#
25775 +CONFIG_SERIAL_8250=y
25776 +CONFIG_SERIAL_8250_CONSOLE=y
25777 +CONFIG_SERIAL_8250_PCI=y
25778 +CONFIG_SERIAL_8250_NR_UARTS=4
25779 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4
25780 +CONFIG_SERIAL_8250_EXTENDED=y
25781 +# CONFIG_SERIAL_8250_MANY_PORTS is not set
25782 +CONFIG_SERIAL_8250_SHARE_IRQ=y
25783 +# CONFIG_SERIAL_8250_DETECT_IRQ is not set
25784 +# CONFIG_SERIAL_8250_RSA is not set
25785 +
25786 +#
25787 +# Non-8250 serial port support
25788 +#
25789 +# CONFIG_SERIAL_UARTLITE is not set
25790 +CONFIG_SERIAL_CORE=y
25791 +CONFIG_SERIAL_CORE_CONSOLE=y
25792 +# CONFIG_SERIAL_JSM is not set
25793 +CONFIG_SERIAL_OF_PLATFORM=y
25794 +CONFIG_UNIX98_PTYS=y
25795 +CONFIG_LEGACY_PTYS=y
25796 +CONFIG_LEGACY_PTY_COUNT=256
25797 +# CONFIG_IPMI_HANDLER is not set
25798 +# CONFIG_HW_RANDOM is not set
25799 +# CONFIG_NVRAM is not set
25800 +# CONFIG_GEN_RTC is not set
25801 +# CONFIG_R3964 is not set
25802 +# CONFIG_APPLICOM is not set
25803 +# CONFIG_RAW_DRIVER is not set
25804 +# CONFIG_TCG_TPM is not set
25805 +CONFIG_DEVPORT=y
25806 +# CONFIG_I2C is not set
25807 +
25808 +#
25809 +# SPI support
25810 +#
25811 +# CONFIG_SPI is not set
25812 +# CONFIG_SPI_MASTER is not set
25813 +# CONFIG_W1 is not set
25814 +# CONFIG_POWER_SUPPLY is not set
25815 +# CONFIG_HWMON is not set
25816 +# CONFIG_WATCHDOG is not set
25817 +
25818 +#
25819 +# Sonics Silicon Backplane
25820 +#
25821 +CONFIG_SSB_POSSIBLE=y
25822 +# CONFIG_SSB is not set
25823 +
25824 +#
25825 +# Multifunction device drivers
25826 +#
25827 +# CONFIG_MFD_SM501 is not set
25828 +
25829 +#
25830 +# Multimedia devices
25831 +#
25832 +# CONFIG_VIDEO_DEV is not set
25833 +# CONFIG_DVB_CORE is not set
25834 +# CONFIG_DAB is not set
25835 +
25836 +#
25837 +# Graphics support
25838 +#
25839 +# CONFIG_AGP is not set
25840 +# CONFIG_DRM is not set
25841 +# CONFIG_VGASTATE is not set
25842 +CONFIG_VIDEO_OUTPUT_CONTROL=m
25843 +# CONFIG_FB is not set
25844 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
25845 +
25846 +#
25847 +# Display device support
25848 +#
25849 +# CONFIG_DISPLAY_SUPPORT is not set
25850 +
25851 +#
25852 +# Sound
25853 +#
25854 +# CONFIG_SOUND is not set
25855 +CONFIG_USB_SUPPORT=y
25856 +CONFIG_USB_ARCH_HAS_HCD=y
25857 +CONFIG_USB_ARCH_HAS_OHCI=y
25858 +CONFIG_USB_ARCH_HAS_EHCI=y
25859 +CONFIG_USB=y
25860 +# CONFIG_USB_DEBUG is not set
25861 +
25862 +#
25863 +# Miscellaneous USB options
25864 +#
25865 +CONFIG_USB_DEVICEFS=y
25866 +CONFIG_USB_DEVICE_CLASS=y
25867 +# CONFIG_USB_DYNAMIC_MINORS is not set
25868 +# CONFIG_USB_OTG is not set
25869 +
25870 +#
25871 +# USB Host Controller Drivers
25872 +#
25873 +# CONFIG_USB_EHCI_HCD is not set
25874 +# CONFIG_USB_ISP116X_HCD is not set
25875 +CONFIG_USB_OHCI_HCD=y
25876 +CONFIG_USB_OHCI_HCD_PPC_OF=y
25877 +CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
25878 +CONFIG_USB_OHCI_HCD_PPC_OF_LE=y
25879 +CONFIG_USB_OHCI_HCD_PCI=y
25880 +CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
25881 +CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
25882 +CONFIG_USB_OHCI_LITTLE_ENDIAN=y
25883 +# CONFIG_USB_UHCI_HCD is not set
25884 +# CONFIG_USB_SL811_HCD is not set
25885 +# CONFIG_USB_R8A66597_HCD is not set
25886 +
25887 +#
25888 +# USB Device Class drivers
25889 +#
25890 +# CONFIG_USB_ACM is not set
25891 +# CONFIG_USB_PRINTER is not set
25892 +
25893 +#
25894 +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
25895 +#
25896 +
25897 +#
25898 +# may also be needed; see USB_STORAGE Help for more information
25899 +#
25900 +# CONFIG_USB_LIBUSUAL is not set
25901 +
25902 +#
25903 +# USB Imaging devices
25904 +#
25905 +# CONFIG_USB_MDC800 is not set
25906 +CONFIG_USB_MON=y
25907 +
25908 +#
25909 +# USB port drivers
25910 +#
25911 +
25912 +#
25913 +# USB Serial Converter support
25914 +#
25915 +# CONFIG_USB_SERIAL is not set
25916 +
25917 +#
25918 +# USB Miscellaneous drivers
25919 +#
25920 +# CONFIG_USB_EMI62 is not set
25921 +# CONFIG_USB_EMI26 is not set
25922 +# CONFIG_USB_ADUTUX is not set
25923 +# CONFIG_USB_AUERSWALD is not set
25924 +# CONFIG_USB_RIO500 is not set
25925 +# CONFIG_USB_LEGOTOWER is not set
25926 +# CONFIG_USB_LCD is not set
25927 +# CONFIG_USB_BERRY_CHARGE is not set
25928 +# CONFIG_USB_LED is not set
25929 +# CONFIG_USB_CYPRESS_CY7C63 is not set
25930 +# CONFIG_USB_CYTHERM is not set
25931 +# CONFIG_USB_PHIDGET is not set
25932 +# CONFIG_USB_IDMOUSE is not set
25933 +# CONFIG_USB_FTDI_ELAN is not set
25934 +# CONFIG_USB_APPLEDISPLAY is not set
25935 +# CONFIG_USB_LD is not set
25936 +# CONFIG_USB_TRANCEVIBRATOR is not set
25937 +# CONFIG_USB_IOWARRIOR is not set
25938 +# CONFIG_USB_TEST is not set
25939 +
25940 +#
25941 +# USB DSL modem support
25942 +#
25943 +
25944 +#
25945 +# USB Gadget Support
25946 +#
25947 +# CONFIG_USB_GADGET is not set
25948 +# CONFIG_MMC is not set
25949 +# CONFIG_NEW_LEDS is not set
25950 +# CONFIG_INFINIBAND is not set
25951 +# CONFIG_EDAC is not set
25952 +# CONFIG_RTC_CLASS is not set
25953 +
25954 +#
25955 +# Userspace I/O
25956 +#
25957 +# CONFIG_UIO is not set
25958 +
25959 +#
25960 +# File systems
25961 +#
25962 +CONFIG_EXT2_FS=y
25963 +# CONFIG_EXT2_FS_XATTR is not set
25964 +# CONFIG_EXT2_FS_XIP is not set
25965 +# CONFIG_EXT3_FS is not set
25966 +# CONFIG_EXT4DEV_FS is not set
25967 +# CONFIG_REISERFS_FS is not set
25968 +# CONFIG_JFS_FS is not set
25969 +# CONFIG_FS_POSIX_ACL is not set
25970 +# CONFIG_XFS_FS is not set
25971 +# CONFIG_GFS2_FS is not set
25972 +# CONFIG_OCFS2_FS is not set
25973 +# CONFIG_MINIX_FS is not set
25974 +# CONFIG_ROMFS_FS is not set
25975 +CONFIG_INOTIFY=y
25976 +CONFIG_INOTIFY_USER=y
25977 +# CONFIG_QUOTA is not set
25978 +CONFIG_DNOTIFY=y
25979 +# CONFIG_AUTOFS_FS is not set
25980 +# CONFIG_AUTOFS4_FS is not set
25981 +# CONFIG_FUSE_FS is not set
25982 +
25983 +#
25984 +# CD-ROM/DVD Filesystems
25985 +#
25986 +# CONFIG_ISO9660_FS is not set
25987 +# CONFIG_UDF_FS is not set
25988 +
25989 +#
25990 +# DOS/FAT/NT Filesystems
25991 +#
25992 +# CONFIG_MSDOS_FS is not set
25993 +# CONFIG_VFAT_FS is not set
25994 +# CONFIG_NTFS_FS is not set
25995 +
25996 +#
25997 +# Pseudo filesystems
25998 +#
25999 +CONFIG_PROC_FS=y
26000 +CONFIG_PROC_KCORE=y
26001 +CONFIG_PROC_SYSCTL=y
26002 +CONFIG_SYSFS=y
26003 +CONFIG_TMPFS=y
26004 +# CONFIG_TMPFS_POSIX_ACL is not set
26005 +# CONFIG_HUGETLB_PAGE is not set
26006 +# CONFIG_CONFIGFS_FS is not set
26007 +
26008 +#
26009 +# Miscellaneous filesystems
26010 +#
26011 +# CONFIG_ADFS_FS is not set
26012 +# CONFIG_AFFS_FS is not set
26013 +# CONFIG_HFS_FS is not set
26014 +# CONFIG_HFSPLUS_FS is not set
26015 +# CONFIG_BEFS_FS is not set
26016 +# CONFIG_BFS_FS is not set
26017 +# CONFIG_EFS_FS is not set
26018 +# CONFIG_JFFS2_FS is not set
26019 +CONFIG_CRAMFS=y
26020 +# CONFIG_VXFS_FS is not set
26021 +# CONFIG_HPFS_FS is not set
26022 +# CONFIG_QNX4FS_FS is not set
26023 +# CONFIG_SYSV_FS is not set
26024 +# CONFIG_UFS_FS is not set
26025 +CONFIG_NETWORK_FILESYSTEMS=y
26026 +CONFIG_NFS_FS=y
26027 +CONFIG_NFS_V3=y
26028 +# CONFIG_NFS_V3_ACL is not set
26029 +# CONFIG_NFS_V4 is not set
26030 +# CONFIG_NFS_DIRECTIO is not set
26031 +# CONFIG_NFSD is not set
26032 +CONFIG_ROOT_NFS=y
26033 +CONFIG_LOCKD=y
26034 +CONFIG_LOCKD_V4=y
26035 +CONFIG_NFS_COMMON=y
26036 +CONFIG_SUNRPC=y
26037 +# CONFIG_SUNRPC_BIND34 is not set
26038 +# CONFIG_RPCSEC_GSS_KRB5 is not set
26039 +# CONFIG_RPCSEC_GSS_SPKM3 is not set
26040 +# CONFIG_SMB_FS is not set
26041 +# CONFIG_CIFS is not set
26042 +# CONFIG_NCP_FS is not set
26043 +# CONFIG_CODA_FS is not set
26044 +# CONFIG_AFS_FS is not set
26045 +
26046 +#
26047 +# Partition Types
26048 +#
26049 +# CONFIG_PARTITION_ADVANCED is not set
26050 +CONFIG_MSDOS_PARTITION=y
26051 +# CONFIG_NLS is not set
26052 +# CONFIG_DLM is not set
26053 +# CONFIG_UCC_SLOW is not set
26054 +
26055 +#
26056 +# Library routines
26057 +#
26058 +CONFIG_BITREVERSE=y
26059 +# CONFIG_CRC_CCITT is not set
26060 +# CONFIG_CRC16 is not set
26061 +# CONFIG_CRC_ITU_T is not set
26062 +CONFIG_CRC32=y
26063 +# CONFIG_CRC7 is not set
26064 +# CONFIG_LIBCRC32C is not set
26065 +CONFIG_ZLIB_INFLATE=y
26066 +CONFIG_PLIST=y
26067 +CONFIG_HAS_IOMEM=y
26068 +CONFIG_HAS_IOPORT=y
26069 +CONFIG_HAS_DMA=y
26070 +CONFIG_INSTRUMENTATION=y
26071 +# CONFIG_PROFILING is not set
26072 +# CONFIG_KPROBES is not set
26073 +# CONFIG_MARKERS is not set
26074 +
26075 +#
26076 +# Kernel hacking
26077 +#
26078 +# CONFIG_PRINTK_TIME is not set
26079 +CONFIG_ENABLE_WARN_DEPRECATED=y
26080 +CONFIG_ENABLE_MUST_CHECK=y
26081 +CONFIG_MAGIC_SYSRQ=y
26082 +# CONFIG_UNUSED_SYMBOLS is not set
26083 +# CONFIG_DEBUG_FS is not set
26084 +# CONFIG_HEADERS_CHECK is not set
26085 +CONFIG_DEBUG_KERNEL=y
26086 +# CONFIG_DEBUG_SHIRQ is not set
26087 +CONFIG_DETECT_SOFTLOCKUP=y
26088 +CONFIG_SCHED_DEBUG=y
26089 +# CONFIG_SCHEDSTATS is not set
26090 +# CONFIG_TIMER_STATS is not set
26091 +# CONFIG_SLUB_DEBUG_ON is not set
26092 +# CONFIG_DEBUG_RT_MUTEXES is not set
26093 +# CONFIG_RT_MUTEX_TESTER is not set
26094 +# CONFIG_DEBUG_SPINLOCK is not set
26095 +# CONFIG_DEBUG_MUTEXES is not set
26096 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
26097 +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
26098 +# CONFIG_DEBUG_KOBJECT is not set
26099 +CONFIG_DEBUG_BUGVERBOSE=y
26100 +# CONFIG_DEBUG_INFO is not set
26101 +# CONFIG_DEBUG_VM is not set
26102 +# CONFIG_DEBUG_LIST is not set
26103 +# CONFIG_DEBUG_SG is not set
26104 +CONFIG_FORCED_INLINING=y
26105 +# CONFIG_BOOT_PRINTK_DELAY is not set
26106 +# CONFIG_RCU_TORTURE_TEST is not set
26107 +# CONFIG_FAULT_INJECTION is not set
26108 +# CONFIG_SAMPLES is not set
26109 +# CONFIG_DEBUG_STACKOVERFLOW is not set
26110 +# CONFIG_DEBUG_STACK_USAGE is not set
26111 +# CONFIG_DEBUG_PAGEALLOC is not set
26112 +# CONFIG_DEBUGGER is not set
26113 +# CONFIG_BDI_SWITCH is not set
26114 +# CONFIG_PPC_EARLY_DEBUG is not set
26115 +
26116 +#
26117 +# Security options
26118 +#
26119 +# CONFIG_KEYS is not set
26120 +# CONFIG_SECURITY is not set
26121 +# CONFIG_SECURITY_FILE_CAPABILITIES is not set
26122 +CONFIG_CRYPTO=y
26123 +CONFIG_CRYPTO_ALGAPI=y
26124 +CONFIG_CRYPTO_BLKCIPHER=y
26125 +CONFIG_CRYPTO_MANAGER=y
26126 +# CONFIG_CRYPTO_HMAC is not set
26127 +# CONFIG_CRYPTO_XCBC is not set
26128 +# CONFIG_CRYPTO_NULL is not set
26129 +# CONFIG_CRYPTO_MD4 is not set
26130 +CONFIG_CRYPTO_MD5=y
26131 +# CONFIG_CRYPTO_SHA1 is not set
26132 +# CONFIG_CRYPTO_SHA256 is not set
26133 +# CONFIG_CRYPTO_SHA512 is not set
26134 +# CONFIG_CRYPTO_WP512 is not set
26135 +# CONFIG_CRYPTO_TGR192 is not set
26136 +# CONFIG_CRYPTO_GF128MUL is not set
26137 +CONFIG_CRYPTO_ECB=y
26138 +CONFIG_CRYPTO_CBC=y
26139 +CONFIG_CRYPTO_PCBC=y
26140 +# CONFIG_CRYPTO_LRW is not set
26141 +# CONFIG_CRYPTO_XTS is not set
26142 +# CONFIG_CRYPTO_CRYPTD is not set
26143 +CONFIG_CRYPTO_DES=y
26144 +# CONFIG_CRYPTO_FCRYPT is not set
26145 +# CONFIG_CRYPTO_BLOWFISH is not set
26146 +# CONFIG_CRYPTO_TWOFISH is not set
26147 +# CONFIG_CRYPTO_SERPENT is not set
26148 +# CONFIG_CRYPTO_AES is not set
26149 +# CONFIG_CRYPTO_CAST5 is not set
26150 +# CONFIG_CRYPTO_CAST6 is not set
26151 +# CONFIG_CRYPTO_TEA is not set
26152 +# CONFIG_CRYPTO_ARC4 is not set
26153 +# CONFIG_CRYPTO_KHAZAD is not set
26154 +# CONFIG_CRYPTO_ANUBIS is not set
26155 +# CONFIG_CRYPTO_SEED is not set
26156 +# CONFIG_CRYPTO_DEFLATE is not set
26157 +# CONFIG_CRYPTO_MICHAEL_MIC is not set
26158 +# CONFIG_CRYPTO_CRC32C is not set
26159 +# CONFIG_CRYPTO_CAMELLIA is not set
26160 +# CONFIG_CRYPTO_TEST is not set
26161 +# CONFIG_CRYPTO_AUTHENC is not set
26162 +CONFIG_CRYPTO_HW=y
26163 +# CONFIG_PPC_CLOCK is not set
26164 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/configs/ep8248e_defconfig powerpc.git/arch/powerpc/configs/ep8248e_defconfig
26165 --- linux-2.6.24/arch/powerpc/configs/ep8248e_defconfig 1970-01-01 01:00:00.000000000 +0100
26166 +++ powerpc.git/arch/powerpc/configs/ep8248e_defconfig  2008-01-28 20:25:49.000000000 +0100
26167 @@ -0,0 +1,821 @@
26168 +#
26169 +# Automatically generated make config: don't edit
26170 +# Linux kernel version: 2.6.24-rc6
26171 +# Fri Jan 11 14:02:06 2008
26172 +#
26173 +# CONFIG_PPC64 is not set
26174 +
26175 +#
26176 +# Processor support
26177 +#
26178 +CONFIG_6xx=y
26179 +# CONFIG_PPC_85xx is not set
26180 +# CONFIG_PPC_8xx is not set
26181 +# CONFIG_40x is not set
26182 +# CONFIG_44x is not set
26183 +# CONFIG_E200 is not set
26184 +CONFIG_PPC_FPU=y
26185 +CONFIG_PPC_STD_MMU=y
26186 +CONFIG_PPC_STD_MMU_32=y
26187 +# CONFIG_PPC_MM_SLICES is not set
26188 +# CONFIG_SMP is not set
26189 +CONFIG_PPC32=y
26190 +CONFIG_WORD_SIZE=32
26191 +CONFIG_PPC_MERGE=y
26192 +CONFIG_MMU=y
26193 +CONFIG_GENERIC_CMOS_UPDATE=y
26194 +CONFIG_GENERIC_TIME=y
26195 +CONFIG_GENERIC_TIME_VSYSCALL=y
26196 +CONFIG_GENERIC_CLOCKEVENTS=y
26197 +CONFIG_GENERIC_HARDIRQS=y
26198 +CONFIG_IRQ_PER_CPU=y
26199 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
26200 +CONFIG_ARCH_HAS_ILOG2_U32=y
26201 +CONFIG_GENERIC_HWEIGHT=y
26202 +CONFIG_GENERIC_CALIBRATE_DELAY=y
26203 +CONFIG_GENERIC_FIND_NEXT_BIT=y
26204 +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
26205 +CONFIG_PPC=y
26206 +CONFIG_EARLY_PRINTK=y
26207 +CONFIG_GENERIC_NVRAM=y
26208 +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
26209 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
26210 +CONFIG_PPC_OF=y
26211 +CONFIG_OF=y
26212 +# CONFIG_PPC_UDBG_16550 is not set
26213 +# CONFIG_GENERIC_TBSYNC is not set
26214 +CONFIG_AUDIT_ARCH=y
26215 +CONFIG_GENERIC_BUG=y
26216 +# CONFIG_DEFAULT_UIMAGE is not set
26217 +# CONFIG_PPC_DCR_NATIVE is not set
26218 +# CONFIG_PPC_DCR_MMIO is not set
26219 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
26220 +
26221 +#
26222 +# General setup
26223 +#
26224 +# CONFIG_EXPERIMENTAL is not set
26225 +CONFIG_BROKEN_ON_SMP=y
26226 +CONFIG_INIT_ENV_ARG_LIMIT=32
26227 +CONFIG_LOCALVERSION=""
26228 +CONFIG_LOCALVERSION_AUTO=y
26229 +CONFIG_SWAP=y
26230 +CONFIG_SYSVIPC=y
26231 +CONFIG_SYSVIPC_SYSCTL=y
26232 +# CONFIG_BSD_PROCESS_ACCT is not set
26233 +# CONFIG_TASKSTATS is not set
26234 +# CONFIG_AUDIT is not set
26235 +CONFIG_IKCONFIG=y
26236 +CONFIG_IKCONFIG_PROC=y
26237 +CONFIG_LOG_BUF_SHIFT=14
26238 +# CONFIG_CGROUPS is not set
26239 +CONFIG_FAIR_GROUP_SCHED=y
26240 +CONFIG_FAIR_USER_SCHED=y
26241 +# CONFIG_FAIR_CGROUP_SCHED is not set
26242 +CONFIG_SYSFS_DEPRECATED=y
26243 +# CONFIG_RELAY is not set
26244 +# CONFIG_BLK_DEV_INITRD is not set
26245 +CONFIG_SYSCTL=y
26246 +CONFIG_EMBEDDED=y
26247 +CONFIG_SYSCTL_SYSCALL=y
26248 +CONFIG_KALLSYMS=y
26249 +CONFIG_KALLSYMS_ALL=y
26250 +# CONFIG_KALLSYMS_EXTRA_PASS is not set
26251 +CONFIG_HOTPLUG=y
26252 +CONFIG_PRINTK=y
26253 +CONFIG_BUG=y
26254 +CONFIG_ELF_CORE=y
26255 +CONFIG_BASE_FULL=y
26256 +CONFIG_FUTEX=y
26257 +CONFIG_ANON_INODES=y
26258 +CONFIG_EPOLL=y
26259 +CONFIG_SIGNALFD=y
26260 +CONFIG_EVENTFD=y
26261 +CONFIG_SHMEM=y
26262 +CONFIG_VM_EVENT_COUNTERS=y
26263 +CONFIG_SLAB=y
26264 +# CONFIG_SLUB is not set
26265 +# CONFIG_SLOB is not set
26266 +CONFIG_RT_MUTEXES=y
26267 +# CONFIG_TINY_SHMEM is not set
26268 +CONFIG_BASE_SMALL=0
26269 +# CONFIG_MODULES is not set
26270 +CONFIG_BLOCK=y
26271 +# CONFIG_LBD is not set
26272 +# CONFIG_BLK_DEV_IO_TRACE is not set
26273 +# CONFIG_LSF is not set
26274 +
26275 +#
26276 +# IO Schedulers
26277 +#
26278 +CONFIG_IOSCHED_NOOP=y
26279 +# CONFIG_IOSCHED_AS is not set
26280 +CONFIG_IOSCHED_DEADLINE=y
26281 +# CONFIG_IOSCHED_CFQ is not set
26282 +# CONFIG_DEFAULT_AS is not set
26283 +CONFIG_DEFAULT_DEADLINE=y
26284 +# CONFIG_DEFAULT_CFQ is not set
26285 +# CONFIG_DEFAULT_NOOP is not set
26286 +CONFIG_DEFAULT_IOSCHED="deadline"
26287 +
26288 +#
26289 +# Platform support
26290 +#
26291 +# CONFIG_PPC_MULTIPLATFORM is not set
26292 +CONFIG_PPC_82xx=y
26293 +# CONFIG_PPC_83xx is not set
26294 +# CONFIG_PPC_86xx is not set
26295 +# CONFIG_PPC_MPC52xx is not set
26296 +# CONFIG_PPC_MPC5200 is not set
26297 +# CONFIG_PPC_CELL is not set
26298 +# CONFIG_PPC_CELL_NATIVE is not set
26299 +# CONFIG_MPC8272_ADS is not set
26300 +# CONFIG_PQ2FADS is not set
26301 +CONFIG_EP8248E=y
26302 +# CONFIG_PQ2ADS is not set
26303 +CONFIG_8260=y
26304 +CONFIG_8272=y
26305 +# CONFIG_MPIC is not set
26306 +# CONFIG_MPIC_WEIRD is not set
26307 +# CONFIG_PPC_I8259 is not set
26308 +# CONFIG_PPC_RTAS is not set
26309 +# CONFIG_MMIO_NVRAM is not set
26310 +# CONFIG_PPC_MPC106 is not set
26311 +# CONFIG_PPC_970_NAP is not set
26312 +# CONFIG_PPC_INDIRECT_IO is not set
26313 +# CONFIG_GENERIC_IOMAP is not set
26314 +# CONFIG_CPU_FREQ is not set
26315 +CONFIG_CPM2=y
26316 +CONFIG_PPC_CPM_NEW_BINDING=y
26317 +# CONFIG_FSL_ULI1575 is not set
26318 +CONFIG_CPM=y
26319 +
26320 +#
26321 +# Kernel options
26322 +#
26323 +# CONFIG_HIGHMEM is not set
26324 +# CONFIG_TICK_ONESHOT is not set
26325 +# CONFIG_NO_HZ is not set
26326 +# CONFIG_HIGH_RES_TIMERS is not set
26327 +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
26328 +# CONFIG_HZ_100 is not set
26329 +CONFIG_HZ_250=y
26330 +# CONFIG_HZ_300 is not set
26331 +# CONFIG_HZ_1000 is not set
26332 +CONFIG_HZ=250
26333 +CONFIG_PREEMPT_NONE=y
26334 +# CONFIG_PREEMPT_VOLUNTARY is not set
26335 +# CONFIG_PREEMPT is not set
26336 +CONFIG_BINFMT_ELF=y
26337 +CONFIG_BINFMT_MISC=y
26338 +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
26339 +CONFIG_ARCH_FLATMEM_ENABLE=y
26340 +CONFIG_ARCH_POPULATES_NODE_MAP=y
26341 +CONFIG_FLATMEM=y
26342 +CONFIG_FLAT_NODE_MEM_MAP=y
26343 +# CONFIG_SPARSEMEM_STATIC is not set
26344 +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
26345 +CONFIG_SPLIT_PTLOCK_CPUS=4
26346 +# CONFIG_RESOURCES_64BIT is not set
26347 +CONFIG_ZONE_DMA_FLAG=1
26348 +CONFIG_BOUNCE=y
26349 +CONFIG_VIRT_TO_BUS=y
26350 +CONFIG_PROC_DEVICETREE=y
26351 +# CONFIG_CMDLINE_BOOL is not set
26352 +# CONFIG_PM is not set
26353 +CONFIG_SUSPEND_UP_POSSIBLE=y
26354 +CONFIG_HIBERNATION_UP_POSSIBLE=y
26355 +# CONFIG_SECCOMP is not set
26356 +CONFIG_WANT_DEVICE_TREE=y
26357 +CONFIG_DEVICE_TREE="ep8248e.dts"
26358 +CONFIG_ISA_DMA_API=y
26359 +
26360 +#
26361 +# Bus options
26362 +#
26363 +CONFIG_ZONE_DMA=y
26364 +CONFIG_FSL_SOC=y
26365 +# CONFIG_PCI is not set
26366 +# CONFIG_PCI_DOMAINS is not set
26367 +# CONFIG_PCI_SYSCALL is not set
26368 +# CONFIG_ARCH_SUPPORTS_MSI is not set
26369 +# CONFIG_PCCARD is not set
26370 +
26371 +#
26372 +# Advanced setup
26373 +#
26374 +# CONFIG_ADVANCED_OPTIONS is not set
26375 +
26376 +#
26377 +# Default settings for advanced configuration options are used
26378 +#
26379 +CONFIG_HIGHMEM_START=0xfe000000
26380 +CONFIG_LOWMEM_SIZE=0x30000000
26381 +CONFIG_KERNEL_START=0xc0000000
26382 +CONFIG_TASK_SIZE=0xc0000000
26383 +CONFIG_BOOT_LOAD=0x00400000
26384 +
26385 +#
26386 +# Networking
26387 +#
26388 +CONFIG_NET=y
26389 +
26390 +#
26391 +# Networking options
26392 +#
26393 +CONFIG_PACKET=y
26394 +# CONFIG_PACKET_MMAP is not set
26395 +CONFIG_UNIX=y
26396 +CONFIG_XFRM=y
26397 +# CONFIG_XFRM_USER is not set
26398 +# CONFIG_NET_KEY is not set
26399 +CONFIG_INET=y
26400 +CONFIG_IP_MULTICAST=y
26401 +# CONFIG_IP_ADVANCED_ROUTER is not set
26402 +CONFIG_IP_FIB_HASH=y
26403 +CONFIG_IP_PNP=y
26404 +CONFIG_IP_PNP_DHCP=y
26405 +CONFIG_IP_PNP_BOOTP=y
26406 +# CONFIG_IP_PNP_RARP is not set
26407 +# CONFIG_NET_IPIP is not set
26408 +# CONFIG_NET_IPGRE is not set
26409 +# CONFIG_IP_MROUTE is not set
26410 +CONFIG_SYN_COOKIES=y
26411 +# CONFIG_INET_AH is not set
26412 +# CONFIG_INET_ESP is not set
26413 +# CONFIG_INET_IPCOMP is not set
26414 +# CONFIG_INET_XFRM_TUNNEL is not set
26415 +CONFIG_INET_TUNNEL=y
26416 +CONFIG_INET_XFRM_MODE_TRANSPORT=y
26417 +CONFIG_INET_XFRM_MODE_TUNNEL=y
26418 +CONFIG_INET_XFRM_MODE_BEET=y
26419 +# CONFIG_INET_LRO is not set
26420 +CONFIG_INET_DIAG=y
26421 +CONFIG_INET_TCP_DIAG=y
26422 +# CONFIG_TCP_CONG_ADVANCED is not set
26423 +CONFIG_TCP_CONG_CUBIC=y
26424 +CONFIG_DEFAULT_TCP_CONG="cubic"
26425 +# CONFIG_IP_VS is not set
26426 +CONFIG_IPV6=y
26427 +# CONFIG_IPV6_PRIVACY is not set
26428 +# CONFIG_IPV6_ROUTER_PREF is not set
26429 +# CONFIG_INET6_AH is not set
26430 +# CONFIG_INET6_ESP is not set
26431 +# CONFIG_INET6_IPCOMP is not set
26432 +# CONFIG_INET6_XFRM_TUNNEL is not set
26433 +# CONFIG_INET6_TUNNEL is not set
26434 +CONFIG_INET6_XFRM_MODE_TRANSPORT=y
26435 +CONFIG_INET6_XFRM_MODE_TUNNEL=y
26436 +CONFIG_INET6_XFRM_MODE_BEET=y
26437 +CONFIG_IPV6_SIT=y
26438 +# CONFIG_IPV6_TUNNEL is not set
26439 +# CONFIG_NETWORK_SECMARK is not set
26440 +CONFIG_NETFILTER=y
26441 +# CONFIG_NETFILTER_DEBUG is not set
26442 +
26443 +#
26444 +# Core Netfilter Configuration
26445 +#
26446 +# CONFIG_NETFILTER_NETLINK is not set
26447 +# CONFIG_NF_CONNTRACK_ENABLED is not set
26448 +# CONFIG_NF_CONNTRACK is not set
26449 +# CONFIG_NETFILTER_XTABLES is not set
26450 +
26451 +#
26452 +# IP: Netfilter Configuration
26453 +#
26454 +# CONFIG_IP_NF_QUEUE is not set
26455 +# CONFIG_IP_NF_IPTABLES is not set
26456 +# CONFIG_IP_NF_ARPTABLES is not set
26457 +# CONFIG_BRIDGE is not set
26458 +# CONFIG_VLAN_8021Q is not set
26459 +# CONFIG_DECNET is not set
26460 +# CONFIG_LLC2 is not set
26461 +# CONFIG_IPX is not set
26462 +# CONFIG_ATALK is not set
26463 +# CONFIG_NET_SCHED is not set
26464 +
26465 +#
26466 +# Network testing
26467 +#
26468 +# CONFIG_NET_PKTGEN is not set
26469 +# CONFIG_HAMRADIO is not set
26470 +# CONFIG_IRDA is not set
26471 +# CONFIG_BT is not set
26472 +
26473 +#
26474 +# Wireless
26475 +#
26476 +# CONFIG_CFG80211 is not set
26477 +# CONFIG_WIRELESS_EXT is not set
26478 +# CONFIG_IEEE80211 is not set
26479 +# CONFIG_RFKILL is not set
26480 +
26481 +#
26482 +# Device Drivers
26483 +#
26484 +
26485 +#
26486 +# Generic Driver Options
26487 +#
26488 +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
26489 +CONFIG_STANDALONE=y
26490 +CONFIG_PREVENT_FIRMWARE_BUILD=y
26491 +# CONFIG_FW_LOADER is not set
26492 +# CONFIG_DEBUG_DRIVER is not set
26493 +# CONFIG_DEBUG_DEVRES is not set
26494 +# CONFIG_SYS_HYPERVISOR is not set
26495 +# CONFIG_CONNECTOR is not set
26496 +CONFIG_MTD=y
26497 +# CONFIG_MTD_DEBUG is not set
26498 +# CONFIG_MTD_CONCAT is not set
26499 +# CONFIG_MTD_PARTITIONS is not set
26500 +
26501 +#
26502 +# User Modules And Translation Layers
26503 +#
26504 +CONFIG_MTD_CHAR=y
26505 +CONFIG_MTD_BLKDEVS=y
26506 +CONFIG_MTD_BLOCK=y
26507 +# CONFIG_FTL is not set
26508 +# CONFIG_NFTL is not set
26509 +# CONFIG_INFTL is not set
26510 +# CONFIG_RFD_FTL is not set
26511 +# CONFIG_SSFDC is not set
26512 +# CONFIG_MTD_OOPS is not set
26513 +
26514 +#
26515 +# RAM/ROM/Flash chip drivers
26516 +#
26517 +CONFIG_MTD_CFI=y
26518 +# CONFIG_MTD_JEDECPROBE is not set
26519 +CONFIG_MTD_GEN_PROBE=y
26520 +CONFIG_MTD_CFI_ADV_OPTIONS=y
26521 +CONFIG_MTD_CFI_NOSWAP=y
26522 +# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
26523 +# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
26524 +CONFIG_MTD_CFI_GEOMETRY=y
26525 +# CONFIG_MTD_MAP_BANK_WIDTH_1 is not set
26526 +# CONFIG_MTD_MAP_BANK_WIDTH_2 is not set
26527 +CONFIG_MTD_MAP_BANK_WIDTH_4=y
26528 +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
26529 +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
26530 +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
26531 +# CONFIG_MTD_CFI_I1 is not set
26532 +CONFIG_MTD_CFI_I2=y
26533 +# CONFIG_MTD_CFI_I4 is not set
26534 +# CONFIG_MTD_CFI_I8 is not set
26535 +# CONFIG_MTD_OTP is not set
26536 +# CONFIG_MTD_CFI_INTELEXT is not set
26537 +CONFIG_MTD_CFI_AMDSTD=y
26538 +# CONFIG_MTD_CFI_STAA is not set
26539 +CONFIG_MTD_CFI_UTIL=y
26540 +# CONFIG_MTD_RAM is not set
26541 +# CONFIG_MTD_ROM is not set
26542 +# CONFIG_MTD_ABSENT is not set
26543 +
26544 +#
26545 +# Mapping drivers for chip access
26546 +#
26547 +# CONFIG_MTD_COMPLEX_MAPPINGS is not set
26548 +# CONFIG_MTD_PHYSMAP is not set
26549 +CONFIG_MTD_PHYSMAP_OF=y
26550 +# CONFIG_MTD_PLATRAM is not set
26551 +
26552 +#
26553 +# Self-contained MTD device drivers
26554 +#
26555 +# CONFIG_MTD_SLRAM is not set
26556 +# CONFIG_MTD_PHRAM is not set
26557 +# CONFIG_MTD_MTDRAM is not set
26558 +# CONFIG_MTD_BLOCK2MTD is not set
26559 +
26560 +#
26561 +# Disk-On-Chip Device Drivers
26562 +#
26563 +# CONFIG_MTD_DOC2000 is not set
26564 +# CONFIG_MTD_DOC2001 is not set
26565 +# CONFIG_MTD_DOC2001PLUS is not set
26566 +# CONFIG_MTD_NAND is not set
26567 +# CONFIG_MTD_ONENAND is not set
26568 +
26569 +#
26570 +# UBI - Unsorted block images
26571 +#
26572 +# CONFIG_MTD_UBI is not set
26573 +CONFIG_OF_DEVICE=y
26574 +# CONFIG_PARPORT is not set
26575 +CONFIG_BLK_DEV=y
26576 +# CONFIG_BLK_DEV_FD is not set
26577 +# CONFIG_BLK_DEV_COW_COMMON is not set
26578 +CONFIG_BLK_DEV_LOOP=y
26579 +# CONFIG_BLK_DEV_CRYPTOLOOP is not set
26580 +# CONFIG_BLK_DEV_NBD is not set
26581 +# CONFIG_BLK_DEV_RAM is not set
26582 +# CONFIG_CDROM_PKTCDVD is not set
26583 +# CONFIG_ATA_OVER_ETH is not set
26584 +# CONFIG_MISC_DEVICES is not set
26585 +# CONFIG_IDE is not set
26586 +
26587 +#
26588 +# SCSI device support
26589 +#
26590 +# CONFIG_RAID_ATTRS is not set
26591 +# CONFIG_SCSI is not set
26592 +# CONFIG_SCSI_DMA is not set
26593 +# CONFIG_SCSI_NETLINK is not set
26594 +# CONFIG_ATA is not set
26595 +# CONFIG_MD is not set
26596 +# CONFIG_MACINTOSH_DRIVERS is not set
26597 +CONFIG_NETDEVICES=y
26598 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
26599 +# CONFIG_DUMMY is not set
26600 +# CONFIG_BONDING is not set
26601 +# CONFIG_EQUALIZER is not set
26602 +# CONFIG_TUN is not set
26603 +# CONFIG_VETH is not set
26604 +CONFIG_PHYLIB=y
26605 +
26606 +#
26607 +# MII PHY device drivers
26608 +#
26609 +# CONFIG_MARVELL_PHY is not set
26610 +CONFIG_DAVICOM_PHY=y
26611 +# CONFIG_QSEMI_PHY is not set
26612 +# CONFIG_LXT_PHY is not set
26613 +# CONFIG_CICADA_PHY is not set
26614 +# CONFIG_VITESSE_PHY is not set
26615 +# CONFIG_SMSC_PHY is not set
26616 +# CONFIG_BROADCOM_PHY is not set
26617 +# CONFIG_ICPLUS_PHY is not set
26618 +# CONFIG_FIXED_PHY is not set
26619 +CONFIG_MDIO_BITBANG=y
26620 +CONFIG_NET_ETHERNET=y
26621 +CONFIG_MII=y
26622 +# CONFIG_IBM_NEW_EMAC_ZMII is not set
26623 +# CONFIG_IBM_NEW_EMAC_RGMII is not set
26624 +# CONFIG_IBM_NEW_EMAC_TAH is not set
26625 +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
26626 +# CONFIG_B44 is not set
26627 +CONFIG_FS_ENET=y
26628 +# CONFIG_FS_ENET_HAS_SCC is not set
26629 +CONFIG_FS_ENET_HAS_FCC=y
26630 +# CONFIG_FS_ENET_MDIO_FCC is not set
26631 +CONFIG_NETDEV_1000=y
26632 +CONFIG_NETDEV_10000=y
26633 +
26634 +#
26635 +# Wireless LAN
26636 +#
26637 +# CONFIG_WLAN_PRE80211 is not set
26638 +# CONFIG_WLAN_80211 is not set
26639 +# CONFIG_WAN is not set
26640 +# CONFIG_PPP is not set
26641 +# CONFIG_SLIP is not set
26642 +# CONFIG_NETPOLL is not set
26643 +# CONFIG_NET_POLL_CONTROLLER is not set
26644 +# CONFIG_ISDN is not set
26645 +# CONFIG_PHONE is not set
26646 +
26647 +#
26648 +# Input device support
26649 +#
26650 +# CONFIG_INPUT is not set
26651 +
26652 +#
26653 +# Hardware I/O ports
26654 +#
26655 +# CONFIG_SERIO is not set
26656 +# CONFIG_GAMEPORT is not set
26657 +
26658 +#
26659 +# Character devices
26660 +#
26661 +# CONFIG_VT is not set
26662 +# CONFIG_SERIAL_NONSTANDARD is not set
26663 +
26664 +#
26665 +# Serial drivers
26666 +#
26667 +# CONFIG_SERIAL_8250 is not set
26668 +
26669 +#
26670 +# Non-8250 serial port support
26671 +#
26672 +# CONFIG_SERIAL_UARTLITE is not set
26673 +CONFIG_SERIAL_CORE=y
26674 +CONFIG_SERIAL_CORE_CONSOLE=y
26675 +CONFIG_SERIAL_CPM=y
26676 +CONFIG_SERIAL_CPM_CONSOLE=y
26677 +CONFIG_SERIAL_CPM_SCC1=y
26678 +# CONFIG_SERIAL_CPM_SCC2 is not set
26679 +# CONFIG_SERIAL_CPM_SCC3 is not set
26680 +CONFIG_SERIAL_CPM_SCC4=y
26681 +# CONFIG_SERIAL_CPM_SMC1 is not set
26682 +# CONFIG_SERIAL_CPM_SMC2 is not set
26683 +CONFIG_UNIX98_PTYS=y
26684 +CONFIG_LEGACY_PTYS=y
26685 +CONFIG_LEGACY_PTY_COUNT=256
26686 +# CONFIG_IPMI_HANDLER is not set
26687 +CONFIG_HW_RANDOM=y
26688 +# CONFIG_NVRAM is not set
26689 +# CONFIG_GEN_RTC is not set
26690 +# CONFIG_R3964 is not set
26691 +# CONFIG_RAW_DRIVER is not set
26692 +# CONFIG_I2C is not set
26693 +
26694 +#
26695 +# SPI support
26696 +#
26697 +# CONFIG_SPI is not set
26698 +# CONFIG_SPI_MASTER is not set
26699 +# CONFIG_W1 is not set
26700 +# CONFIG_POWER_SUPPLY is not set
26701 +# CONFIG_HWMON is not set
26702 +# CONFIG_WATCHDOG is not set
26703 +
26704 +#
26705 +# Sonics Silicon Backplane
26706 +#
26707 +CONFIG_SSB_POSSIBLE=y
26708 +# CONFIG_SSB is not set
26709 +
26710 +#
26711 +# Multifunction device drivers
26712 +#
26713 +# CONFIG_MFD_SM501 is not set
26714 +
26715 +#
26716 +# Multimedia devices
26717 +#
26718 +# CONFIG_VIDEO_DEV is not set
26719 +# CONFIG_DVB_CORE is not set
26720 +CONFIG_DAB=y
26721 +
26722 +#
26723 +# Graphics support
26724 +#
26725 +# CONFIG_VGASTATE is not set
26726 +# CONFIG_VIDEO_OUTPUT_CONTROL is not set
26727 +# CONFIG_FB is not set
26728 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
26729 +
26730 +#
26731 +# Display device support
26732 +#
26733 +# CONFIG_DISPLAY_SUPPORT is not set
26734 +
26735 +#
26736 +# Sound
26737 +#
26738 +# CONFIG_SOUND is not set
26739 +# CONFIG_USB_SUPPORT is not set
26740 +# CONFIG_MMC is not set
26741 +# CONFIG_NEW_LEDS is not set
26742 +# CONFIG_RTC_CLASS is not set
26743 +
26744 +#
26745 +# Userspace I/O
26746 +#
26747 +# CONFIG_UIO is not set
26748 +
26749 +#
26750 +# File systems
26751 +#
26752 +CONFIG_EXT2_FS=y
26753 +# CONFIG_EXT2_FS_XATTR is not set
26754 +# CONFIG_EXT2_FS_XIP is not set
26755 +CONFIG_EXT3_FS=y
26756 +# CONFIG_EXT3_FS_XATTR is not set
26757 +CONFIG_JBD=y
26758 +# CONFIG_REISERFS_FS is not set
26759 +# CONFIG_JFS_FS is not set
26760 +# CONFIG_FS_POSIX_ACL is not set
26761 +# CONFIG_XFS_FS is not set
26762 +# CONFIG_OCFS2_FS is not set
26763 +# CONFIG_MINIX_FS is not set
26764 +# CONFIG_ROMFS_FS is not set
26765 +CONFIG_INOTIFY=y
26766 +CONFIG_INOTIFY_USER=y
26767 +# CONFIG_QUOTA is not set
26768 +CONFIG_DNOTIFY=y
26769 +# CONFIG_AUTOFS_FS is not set
26770 +CONFIG_AUTOFS4_FS=y
26771 +# CONFIG_FUSE_FS is not set
26772 +
26773 +#
26774 +# CD-ROM/DVD Filesystems
26775 +#
26776 +# CONFIG_ISO9660_FS is not set
26777 +# CONFIG_UDF_FS is not set
26778 +
26779 +#
26780 +# DOS/FAT/NT Filesystems
26781 +#
26782 +# CONFIG_MSDOS_FS is not set
26783 +# CONFIG_VFAT_FS is not set
26784 +# CONFIG_NTFS_FS is not set
26785 +
26786 +#
26787 +# Pseudo filesystems
26788 +#
26789 +CONFIG_PROC_FS=y
26790 +CONFIG_PROC_KCORE=y
26791 +CONFIG_PROC_SYSCTL=y
26792 +CONFIG_SYSFS=y
26793 +CONFIG_TMPFS=y
26794 +# CONFIG_TMPFS_POSIX_ACL is not set
26795 +# CONFIG_HUGETLB_PAGE is not set
26796 +
26797 +#
26798 +# Miscellaneous filesystems
26799 +#
26800 +# CONFIG_HFSPLUS_FS is not set
26801 +# CONFIG_JFFS2_FS is not set
26802 +CONFIG_CRAMFS=y
26803 +# CONFIG_VXFS_FS is not set
26804 +# CONFIG_HPFS_FS is not set
26805 +# CONFIG_QNX4FS_FS is not set
26806 +# CONFIG_SYSV_FS is not set
26807 +# CONFIG_UFS_FS is not set
26808 +CONFIG_NETWORK_FILESYSTEMS=y
26809 +CONFIG_NFS_FS=y
26810 +CONFIG_NFS_V3=y
26811 +# CONFIG_NFS_V3_ACL is not set
26812 +# CONFIG_NFS_DIRECTIO is not set
26813 +# CONFIG_NFSD is not set
26814 +CONFIG_ROOT_NFS=y
26815 +CONFIG_LOCKD=y
26816 +CONFIG_LOCKD_V4=y
26817 +CONFIG_NFS_COMMON=y
26818 +CONFIG_SUNRPC=y
26819 +# CONFIG_SMB_FS is not set
26820 +# CONFIG_CIFS is not set
26821 +# CONFIG_NCP_FS is not set
26822 +# CONFIG_CODA_FS is not set
26823 +
26824 +#
26825 +# Partition Types
26826 +#
26827 +CONFIG_PARTITION_ADVANCED=y
26828 +# CONFIG_ACORN_PARTITION is not set
26829 +# CONFIG_OSF_PARTITION is not set
26830 +# CONFIG_AMIGA_PARTITION is not set
26831 +# CONFIG_ATARI_PARTITION is not set
26832 +# CONFIG_MAC_PARTITION is not set
26833 +CONFIG_MSDOS_PARTITION=y
26834 +# CONFIG_BSD_DISKLABEL is not set
26835 +# CONFIG_MINIX_SUBPARTITION is not set
26836 +# CONFIG_SOLARIS_X86_PARTITION is not set
26837 +# CONFIG_UNIXWARE_DISKLABEL is not set
26838 +# CONFIG_LDM_PARTITION is not set
26839 +# CONFIG_SGI_PARTITION is not set
26840 +# CONFIG_ULTRIX_PARTITION is not set
26841 +# CONFIG_SUN_PARTITION is not set
26842 +# CONFIG_KARMA_PARTITION is not set
26843 +# CONFIG_EFI_PARTITION is not set
26844 +# CONFIG_SYSV68_PARTITION is not set
26845 +CONFIG_NLS=y
26846 +CONFIG_NLS_DEFAULT="iso8859-1"
26847 +CONFIG_NLS_CODEPAGE_437=y
26848 +# CONFIG_NLS_CODEPAGE_737 is not set
26849 +# CONFIG_NLS_CODEPAGE_775 is not set
26850 +# CONFIG_NLS_CODEPAGE_850 is not set
26851 +# CONFIG_NLS_CODEPAGE_852 is not set
26852 +# CONFIG_NLS_CODEPAGE_855 is not set
26853 +# CONFIG_NLS_CODEPAGE_857 is not set
26854 +# CONFIG_NLS_CODEPAGE_860 is not set
26855 +# CONFIG_NLS_CODEPAGE_861 is not set
26856 +# CONFIG_NLS_CODEPAGE_862 is not set
26857 +# CONFIG_NLS_CODEPAGE_863 is not set
26858 +# CONFIG_NLS_CODEPAGE_864 is not set
26859 +# CONFIG_NLS_CODEPAGE_865 is not set
26860 +# CONFIG_NLS_CODEPAGE_866 is not set
26861 +# CONFIG_NLS_CODEPAGE_869 is not set
26862 +# CONFIG_NLS_CODEPAGE_936 is not set
26863 +# CONFIG_NLS_CODEPAGE_950 is not set
26864 +# CONFIG_NLS_CODEPAGE_932 is not set
26865 +# CONFIG_NLS_CODEPAGE_949 is not set
26866 +# CONFIG_NLS_CODEPAGE_874 is not set
26867 +# CONFIG_NLS_ISO8859_8 is not set
26868 +# CONFIG_NLS_CODEPAGE_1250 is not set
26869 +# CONFIG_NLS_CODEPAGE_1251 is not set
26870 +CONFIG_NLS_ASCII=y
26871 +CONFIG_NLS_ISO8859_1=y
26872 +# CONFIG_NLS_ISO8859_2 is not set
26873 +# CONFIG_NLS_ISO8859_3 is not set
26874 +# CONFIG_NLS_ISO8859_4 is not set
26875 +# CONFIG_NLS_ISO8859_5 is not set
26876 +# CONFIG_NLS_ISO8859_6 is not set
26877 +# CONFIG_NLS_ISO8859_7 is not set
26878 +# CONFIG_NLS_ISO8859_9 is not set
26879 +# CONFIG_NLS_ISO8859_13 is not set
26880 +# CONFIG_NLS_ISO8859_14 is not set
26881 +# CONFIG_NLS_ISO8859_15 is not set
26882 +# CONFIG_NLS_KOI8_R is not set
26883 +# CONFIG_NLS_KOI8_U is not set
26884 +CONFIG_NLS_UTF8=y
26885 +# CONFIG_UCC_SLOW is not set
26886 +
26887 +#
26888 +# Library routines
26889 +#
26890 +# CONFIG_CRC_CCITT is not set
26891 +# CONFIG_CRC16 is not set
26892 +# CONFIG_CRC_ITU_T is not set
26893 +# CONFIG_CRC32 is not set
26894 +# CONFIG_CRC7 is not set
26895 +# CONFIG_LIBCRC32C is not set
26896 +CONFIG_ZLIB_INFLATE=y
26897 +CONFIG_PLIST=y
26898 +CONFIG_HAS_IOMEM=y
26899 +CONFIG_HAS_IOPORT=y
26900 +CONFIG_HAS_DMA=y
26901 +CONFIG_INSTRUMENTATION=y
26902 +# CONFIG_PROFILING is not set
26903 +# CONFIG_MARKERS is not set
26904 +
26905 +#
26906 +# Kernel hacking
26907 +#
26908 +# CONFIG_PRINTK_TIME is not set
26909 +CONFIG_ENABLE_WARN_DEPRECATED=y
26910 +CONFIG_ENABLE_MUST_CHECK=y
26911 +CONFIG_MAGIC_SYSRQ=y
26912 +# CONFIG_UNUSED_SYMBOLS is not set
26913 +# CONFIG_DEBUG_FS is not set
26914 +# CONFIG_HEADERS_CHECK is not set
26915 +CONFIG_DEBUG_KERNEL=y
26916 +# CONFIG_DEBUG_SHIRQ is not set
26917 +# CONFIG_DETECT_SOFTLOCKUP is not set
26918 +# CONFIG_SCHED_DEBUG is not set
26919 +# CONFIG_SCHEDSTATS is not set
26920 +# CONFIG_TIMER_STATS is not set
26921 +# CONFIG_DEBUG_SLAB is not set
26922 +# CONFIG_DEBUG_RT_MUTEXES is not set
26923 +# CONFIG_RT_MUTEX_TESTER is not set
26924 +# CONFIG_DEBUG_SPINLOCK is not set
26925 +# CONFIG_DEBUG_MUTEXES is not set
26926 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
26927 +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
26928 +# CONFIG_DEBUG_KOBJECT is not set
26929 +CONFIG_DEBUG_BUGVERBOSE=y
26930 +CONFIG_DEBUG_INFO=y
26931 +# CONFIG_DEBUG_VM is not set
26932 +# CONFIG_DEBUG_LIST is not set
26933 +# CONFIG_DEBUG_SG is not set
26934 +CONFIG_FORCED_INLINING=y
26935 +# CONFIG_BOOT_PRINTK_DELAY is not set
26936 +# CONFIG_FAULT_INJECTION is not set
26937 +# CONFIG_SAMPLES is not set
26938 +# CONFIG_DEBUG_STACKOVERFLOW is not set
26939 +# CONFIG_DEBUG_STACK_USAGE is not set
26940 +# CONFIG_DEBUG_PAGEALLOC is not set
26941 +# CONFIG_DEBUGGER is not set
26942 +# CONFIG_KGDB_CONSOLE is not set
26943 +CONFIG_BDI_SWITCH=y
26944 +# CONFIG_PPC_EARLY_DEBUG is not set
26945 +
26946 +#
26947 +# Security options
26948 +#
26949 +# CONFIG_KEYS is not set
26950 +# CONFIG_SECURITY is not set
26951 +CONFIG_CRYPTO=y
26952 +CONFIG_CRYPTO_ALGAPI=y
26953 +CONFIG_CRYPTO_BLKCIPHER=y
26954 +CONFIG_CRYPTO_MANAGER=y
26955 +# CONFIG_CRYPTO_HMAC is not set
26956 +# CONFIG_CRYPTO_NULL is not set
26957 +# CONFIG_CRYPTO_MD4 is not set
26958 +CONFIG_CRYPTO_MD5=y
26959 +# CONFIG_CRYPTO_SHA1 is not set
26960 +# CONFIG_CRYPTO_SHA256 is not set
26961 +# CONFIG_CRYPTO_SHA512 is not set
26962 +# CONFIG_CRYPTO_WP512 is not set
26963 +# CONFIG_CRYPTO_TGR192 is not set
26964 +CONFIG_CRYPTO_ECB=y
26965 +CONFIG_CRYPTO_CBC=y
26966 +CONFIG_CRYPTO_PCBC=y
26967 +# CONFIG_CRYPTO_CRYPTD is not set
26968 +CONFIG_CRYPTO_DES=y
26969 +# CONFIG_CRYPTO_FCRYPT is not set
26970 +# CONFIG_CRYPTO_BLOWFISH is not set
26971 +# CONFIG_CRYPTO_TWOFISH is not set
26972 +# CONFIG_CRYPTO_SERPENT is not set
26973 +# CONFIG_CRYPTO_AES is not set
26974 +# CONFIG_CRYPTO_CAST5 is not set
26975 +# CONFIG_CRYPTO_CAST6 is not set
26976 +# CONFIG_CRYPTO_TEA is not set
26977 +# CONFIG_CRYPTO_ARC4 is not set
26978 +# CONFIG_CRYPTO_KHAZAD is not set
26979 +# CONFIG_CRYPTO_ANUBIS is not set
26980 +# CONFIG_CRYPTO_SEED is not set
26981 +# CONFIG_CRYPTO_DEFLATE is not set
26982 +# CONFIG_CRYPTO_MICHAEL_MIC is not set
26983 +# CONFIG_CRYPTO_CRC32C is not set
26984 +# CONFIG_CRYPTO_CAMELLIA is not set
26985 +# CONFIG_CRYPTO_AUTHENC is not set
26986 +# CONFIG_CRYPTO_HW is not set
26987 +# CONFIG_PPC_CLOCK is not set
26988 +CONFIG_PPC_LIB_RHEAP=y
26989 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/configs/katmai_defconfig powerpc.git/arch/powerpc/configs/katmai_defconfig
26990 --- linux-2.6.24/arch/powerpc/configs/katmai_defconfig  1970-01-01 01:00:00.000000000 +0100
26991 +++ powerpc.git/arch/powerpc/configs/katmai_defconfig   2008-01-28 20:25:49.000000000 +0100
26992 @@ -0,0 +1,790 @@
26993 +#
26994 +# Automatically generated make config: don't edit
26995 +# Linux kernel version: 2.6.24-rc6
26996 +# Mon Dec 24 11:17:43 2007
26997 +#
26998 +# CONFIG_PPC64 is not set
26999 +
27000 +#
27001 +# Processor support
27002 +#
27003 +# CONFIG_6xx is not set
27004 +# CONFIG_PPC_85xx is not set
27005 +# CONFIG_PPC_8xx is not set
27006 +# CONFIG_40x is not set
27007 +CONFIG_44x=y
27008 +# CONFIG_E200 is not set
27009 +CONFIG_4xx=y
27010 +CONFIG_BOOKE=y
27011 +CONFIG_PTE_64BIT=y
27012 +CONFIG_PHYS_64BIT=y
27013 +# CONFIG_PPC_MM_SLICES is not set
27014 +CONFIG_NOT_COHERENT_CACHE=y
27015 +CONFIG_PPC32=y
27016 +CONFIG_WORD_SIZE=32
27017 +CONFIG_PPC_MERGE=y
27018 +CONFIG_MMU=y
27019 +CONFIG_GENERIC_CMOS_UPDATE=y
27020 +CONFIG_GENERIC_TIME=y
27021 +CONFIG_GENERIC_TIME_VSYSCALL=y
27022 +CONFIG_GENERIC_CLOCKEVENTS=y
27023 +CONFIG_GENERIC_HARDIRQS=y
27024 +CONFIG_IRQ_PER_CPU=y
27025 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
27026 +CONFIG_ARCH_HAS_ILOG2_U32=y
27027 +CONFIG_GENERIC_HWEIGHT=y
27028 +CONFIG_GENERIC_CALIBRATE_DELAY=y
27029 +CONFIG_GENERIC_FIND_NEXT_BIT=y
27030 +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
27031 +CONFIG_PPC=y
27032 +CONFIG_EARLY_PRINTK=y
27033 +CONFIG_GENERIC_NVRAM=y
27034 +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
27035 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
27036 +CONFIG_PPC_OF=y
27037 +CONFIG_OF=y
27038 +CONFIG_PPC_UDBG_16550=y
27039 +# CONFIG_GENERIC_TBSYNC is not set
27040 +CONFIG_AUDIT_ARCH=y
27041 +CONFIG_GENERIC_BUG=y
27042 +# CONFIG_DEFAULT_UIMAGE is not set
27043 +CONFIG_PPC_DCR_NATIVE=y
27044 +# CONFIG_PPC_DCR_MMIO is not set
27045 +CONFIG_PPC_DCR=y
27046 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
27047 +
27048 +#
27049 +# General setup
27050 +#
27051 +CONFIG_EXPERIMENTAL=y
27052 +CONFIG_BROKEN_ON_SMP=y
27053 +CONFIG_INIT_ENV_ARG_LIMIT=32
27054 +CONFIG_LOCALVERSION=""
27055 +CONFIG_LOCALVERSION_AUTO=y
27056 +CONFIG_SWAP=y
27057 +CONFIG_SYSVIPC=y
27058 +CONFIG_SYSVIPC_SYSCTL=y
27059 +CONFIG_POSIX_MQUEUE=y
27060 +# CONFIG_BSD_PROCESS_ACCT is not set
27061 +# CONFIG_TASKSTATS is not set
27062 +# CONFIG_USER_NS is not set
27063 +# CONFIG_PID_NS is not set
27064 +# CONFIG_AUDIT is not set
27065 +# CONFIG_IKCONFIG is not set
27066 +CONFIG_LOG_BUF_SHIFT=14
27067 +# CONFIG_CGROUPS is not set
27068 +CONFIG_FAIR_GROUP_SCHED=y
27069 +CONFIG_FAIR_USER_SCHED=y
27070 +# CONFIG_FAIR_CGROUP_SCHED is not set
27071 +CONFIG_SYSFS_DEPRECATED=y
27072 +# CONFIG_RELAY is not set
27073 +CONFIG_BLK_DEV_INITRD=y
27074 +CONFIG_INITRAMFS_SOURCE=""
27075 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
27076 +CONFIG_SYSCTL=y
27077 +CONFIG_EMBEDDED=y
27078 +CONFIG_SYSCTL_SYSCALL=y
27079 +CONFIG_KALLSYMS=y
27080 +# CONFIG_KALLSYMS_ALL is not set
27081 +# CONFIG_KALLSYMS_EXTRA_PASS is not set
27082 +CONFIG_HOTPLUG=y
27083 +CONFIG_PRINTK=y
27084 +CONFIG_BUG=y
27085 +CONFIG_ELF_CORE=y
27086 +CONFIG_BASE_FULL=y
27087 +CONFIG_FUTEX=y
27088 +CONFIG_ANON_INODES=y
27089 +CONFIG_EPOLL=y
27090 +CONFIG_SIGNALFD=y
27091 +CONFIG_EVENTFD=y
27092 +CONFIG_SHMEM=y
27093 +CONFIG_VM_EVENT_COUNTERS=y
27094 +CONFIG_SLUB_DEBUG=y
27095 +# CONFIG_SLAB is not set
27096 +CONFIG_SLUB=y
27097 +# CONFIG_SLOB is not set
27098 +CONFIG_RT_MUTEXES=y
27099 +# CONFIG_TINY_SHMEM is not set
27100 +CONFIG_BASE_SMALL=0
27101 +CONFIG_MODULES=y
27102 +CONFIG_MODULE_UNLOAD=y
27103 +# CONFIG_MODULE_FORCE_UNLOAD is not set
27104 +# CONFIG_MODVERSIONS is not set
27105 +# CONFIG_MODULE_SRCVERSION_ALL is not set
27106 +CONFIG_KMOD=y
27107 +CONFIG_BLOCK=y
27108 +CONFIG_LBD=y
27109 +# CONFIG_BLK_DEV_IO_TRACE is not set
27110 +# CONFIG_LSF is not set
27111 +# CONFIG_BLK_DEV_BSG is not set
27112 +
27113 +#
27114 +# IO Schedulers
27115 +#
27116 +CONFIG_IOSCHED_NOOP=y
27117 +CONFIG_IOSCHED_AS=y
27118 +CONFIG_IOSCHED_DEADLINE=y
27119 +CONFIG_IOSCHED_CFQ=y
27120 +CONFIG_DEFAULT_AS=y
27121 +# CONFIG_DEFAULT_DEADLINE is not set
27122 +# CONFIG_DEFAULT_CFQ is not set
27123 +# CONFIG_DEFAULT_NOOP is not set
27124 +CONFIG_DEFAULT_IOSCHED="anticipatory"
27125 +CONFIG_PPC4xx_PCI_EXPRESS=y
27126 +
27127 +#
27128 +# Platform support
27129 +#
27130 +# CONFIG_PPC_MPC52xx is not set
27131 +# CONFIG_PPC_MPC5200 is not set
27132 +# CONFIG_PPC_CELL is not set
27133 +# CONFIG_PPC_CELL_NATIVE is not set
27134 +# CONFIG_PQ2ADS is not set
27135 +# CONFIG_BAMBOO is not set
27136 +# CONFIG_EBONY is not set
27137 +# CONFIG_SEQUOIA is not set
27138 +# CONFIG_TAISHAN is not set
27139 +CONFIG_KATMAI=y
27140 +# CONFIG_RAINIER is not set
27141 +CONFIG_440SPe=y
27142 +# CONFIG_MPIC is not set
27143 +# CONFIG_MPIC_WEIRD is not set
27144 +# CONFIG_PPC_I8259 is not set
27145 +# CONFIG_PPC_RTAS is not set
27146 +# CONFIG_MMIO_NVRAM is not set
27147 +# CONFIG_PPC_MPC106 is not set
27148 +# CONFIG_PPC_970_NAP is not set
27149 +# CONFIG_PPC_INDIRECT_IO is not set
27150 +# CONFIG_GENERIC_IOMAP is not set
27151 +# CONFIG_CPU_FREQ is not set
27152 +# CONFIG_CPM2 is not set
27153 +# CONFIG_FSL_ULI1575 is not set
27154 +
27155 +#
27156 +# Kernel options
27157 +#
27158 +# CONFIG_HIGHMEM is not set
27159 +# CONFIG_TICK_ONESHOT is not set
27160 +# CONFIG_NO_HZ is not set
27161 +# CONFIG_HIGH_RES_TIMERS is not set
27162 +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
27163 +# CONFIG_HZ_100 is not set
27164 +CONFIG_HZ_250=y
27165 +# CONFIG_HZ_300 is not set
27166 +# CONFIG_HZ_1000 is not set
27167 +CONFIG_HZ=250
27168 +CONFIG_PREEMPT_NONE=y
27169 +# CONFIG_PREEMPT_VOLUNTARY is not set
27170 +# CONFIG_PREEMPT is not set
27171 +CONFIG_BINFMT_ELF=y
27172 +# CONFIG_BINFMT_MISC is not set
27173 +# CONFIG_MATH_EMULATION is not set
27174 +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
27175 +CONFIG_ARCH_FLATMEM_ENABLE=y
27176 +CONFIG_ARCH_POPULATES_NODE_MAP=y
27177 +CONFIG_SELECT_MEMORY_MODEL=y
27178 +CONFIG_FLATMEM_MANUAL=y
27179 +# CONFIG_DISCONTIGMEM_MANUAL is not set
27180 +# CONFIG_SPARSEMEM_MANUAL is not set
27181 +CONFIG_FLATMEM=y
27182 +CONFIG_FLAT_NODE_MEM_MAP=y
27183 +# CONFIG_SPARSEMEM_STATIC is not set
27184 +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
27185 +CONFIG_SPLIT_PTLOCK_CPUS=4
27186 +CONFIG_RESOURCES_64BIT=y
27187 +CONFIG_ZONE_DMA_FLAG=1
27188 +CONFIG_BOUNCE=y
27189 +CONFIG_VIRT_TO_BUS=y
27190 +CONFIG_PROC_DEVICETREE=y
27191 +CONFIG_CMDLINE_BOOL=y
27192 +CONFIG_CMDLINE=""
27193 +CONFIG_SECCOMP=y
27194 +CONFIG_WANT_DEVICE_TREE=y
27195 +CONFIG_DEVICE_TREE="katmai.dts"
27196 +CONFIG_ISA_DMA_API=y
27197 +
27198 +#
27199 +# Bus options
27200 +#
27201 +CONFIG_ZONE_DMA=y
27202 +CONFIG_PPC_INDIRECT_PCI=y
27203 +CONFIG_PCI=y
27204 +CONFIG_PCI_DOMAINS=y
27205 +CONFIG_PCI_SYSCALL=y
27206 +# CONFIG_PCIEPORTBUS is not set
27207 +CONFIG_ARCH_SUPPORTS_MSI=y
27208 +# CONFIG_PCI_MSI is not set
27209 +CONFIG_PCI_LEGACY=y
27210 +# CONFIG_PCI_DEBUG is not set
27211 +# CONFIG_PCCARD is not set
27212 +# CONFIG_HOTPLUG_PCI is not set
27213 +
27214 +#
27215 +# Advanced setup
27216 +#
27217 +# CONFIG_ADVANCED_OPTIONS is not set
27218 +
27219 +#
27220 +# Default settings for advanced configuration options are used
27221 +#
27222 +CONFIG_HIGHMEM_START=0xfe000000
27223 +CONFIG_LOWMEM_SIZE=0x30000000
27224 +CONFIG_KERNEL_START=0xc0000000
27225 +CONFIG_TASK_SIZE=0xc0000000
27226 +CONFIG_CONSISTENT_START=0xff100000
27227 +CONFIG_CONSISTENT_SIZE=0x00200000
27228 +CONFIG_BOOT_LOAD=0x01000000
27229 +
27230 +#
27231 +# Networking
27232 +#
27233 +CONFIG_NET=y
27234 +
27235 +#
27236 +# Networking options
27237 +#
27238 +CONFIG_PACKET=y
27239 +# CONFIG_PACKET_MMAP is not set
27240 +CONFIG_UNIX=y
27241 +# CONFIG_NET_KEY is not set
27242 +CONFIG_INET=y
27243 +# CONFIG_IP_MULTICAST is not set
27244 +# CONFIG_IP_ADVANCED_ROUTER is not set
27245 +CONFIG_IP_FIB_HASH=y
27246 +CONFIG_IP_PNP=y
27247 +CONFIG_IP_PNP_DHCP=y
27248 +CONFIG_IP_PNP_BOOTP=y
27249 +# CONFIG_IP_PNP_RARP is not set
27250 +# CONFIG_NET_IPIP is not set
27251 +# CONFIG_NET_IPGRE is not set
27252 +# CONFIG_ARPD is not set
27253 +# CONFIG_SYN_COOKIES is not set
27254 +# CONFIG_INET_AH is not set
27255 +# CONFIG_INET_ESP is not set
27256 +# CONFIG_INET_IPCOMP is not set
27257 +# CONFIG_INET_XFRM_TUNNEL is not set
27258 +# CONFIG_INET_TUNNEL is not set
27259 +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
27260 +# CONFIG_INET_XFRM_MODE_TUNNEL is not set
27261 +# CONFIG_INET_XFRM_MODE_BEET is not set
27262 +# CONFIG_INET_LRO is not set
27263 +CONFIG_INET_DIAG=y
27264 +CONFIG_INET_TCP_DIAG=y
27265 +# CONFIG_TCP_CONG_ADVANCED is not set
27266 +CONFIG_TCP_CONG_CUBIC=y
27267 +CONFIG_DEFAULT_TCP_CONG="cubic"
27268 +# CONFIG_TCP_MD5SIG is not set
27269 +# CONFIG_IPV6 is not set
27270 +# CONFIG_INET6_XFRM_TUNNEL is not set
27271 +# CONFIG_INET6_TUNNEL is not set
27272 +# CONFIG_NETWORK_SECMARK is not set
27273 +# CONFIG_NETFILTER is not set
27274 +# CONFIG_IP_DCCP is not set
27275 +# CONFIG_IP_SCTP is not set
27276 +# CONFIG_TIPC is not set
27277 +# CONFIG_ATM is not set
27278 +# CONFIG_BRIDGE is not set
27279 +# CONFIG_VLAN_8021Q is not set
27280 +# CONFIG_DECNET is not set
27281 +# CONFIG_LLC2 is not set
27282 +# CONFIG_IPX is not set
27283 +# CONFIG_ATALK is not set
27284 +# CONFIG_X25 is not set
27285 +# CONFIG_LAPB is not set
27286 +# CONFIG_ECONET is not set
27287 +# CONFIG_WAN_ROUTER is not set
27288 +# CONFIG_NET_SCHED is not set
27289 +
27290 +#
27291 +# Network testing
27292 +#
27293 +# CONFIG_NET_PKTGEN is not set
27294 +# CONFIG_HAMRADIO is not set
27295 +# CONFIG_IRDA is not set
27296 +# CONFIG_BT is not set
27297 +# CONFIG_AF_RXRPC is not set
27298 +
27299 +#
27300 +# Wireless
27301 +#
27302 +# CONFIG_CFG80211 is not set
27303 +# CONFIG_WIRELESS_EXT is not set
27304 +# CONFIG_MAC80211 is not set
27305 +# CONFIG_IEEE80211 is not set
27306 +# CONFIG_RFKILL is not set
27307 +# CONFIG_NET_9P is not set
27308 +
27309 +#
27310 +# Device Drivers
27311 +#
27312 +
27313 +#
27314 +# Generic Driver Options
27315 +#
27316 +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
27317 +CONFIG_STANDALONE=y
27318 +CONFIG_PREVENT_FIRMWARE_BUILD=y
27319 +CONFIG_FW_LOADER=y
27320 +# CONFIG_DEBUG_DRIVER is not set
27321 +# CONFIG_DEBUG_DEVRES is not set
27322 +# CONFIG_SYS_HYPERVISOR is not set
27323 +CONFIG_CONNECTOR=y
27324 +CONFIG_PROC_EVENTS=y
27325 +# CONFIG_MTD is not set
27326 +CONFIG_OF_DEVICE=y
27327 +# CONFIG_PARPORT is not set
27328 +CONFIG_BLK_DEV=y
27329 +# CONFIG_BLK_DEV_FD is not set
27330 +# CONFIG_BLK_CPQ_DA is not set
27331 +# CONFIG_BLK_CPQ_CISS_DA is not set
27332 +# CONFIG_BLK_DEV_DAC960 is not set
27333 +# CONFIG_BLK_DEV_UMEM is not set
27334 +# CONFIG_BLK_DEV_COW_COMMON is not set
27335 +# CONFIG_BLK_DEV_LOOP is not set
27336 +# CONFIG_BLK_DEV_NBD is not set
27337 +# CONFIG_BLK_DEV_SX8 is not set
27338 +CONFIG_BLK_DEV_RAM=y
27339 +CONFIG_BLK_DEV_RAM_COUNT=16
27340 +CONFIG_BLK_DEV_RAM_SIZE=35000
27341 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
27342 +# CONFIG_CDROM_PKTCDVD is not set
27343 +# CONFIG_ATA_OVER_ETH is not set
27344 +# CONFIG_XILINX_SYSACE is not set
27345 +CONFIG_MISC_DEVICES=y
27346 +# CONFIG_PHANTOM is not set
27347 +# CONFIG_EEPROM_93CX6 is not set
27348 +# CONFIG_SGI_IOC4 is not set
27349 +# CONFIG_TIFM_CORE is not set
27350 +# CONFIG_IDE is not set
27351 +
27352 +#
27353 +# SCSI device support
27354 +#
27355 +# CONFIG_RAID_ATTRS is not set
27356 +# CONFIG_SCSI is not set
27357 +# CONFIG_SCSI_DMA is not set
27358 +# CONFIG_SCSI_NETLINK is not set
27359 +# CONFIG_ATA is not set
27360 +# CONFIG_MD is not set
27361 +# CONFIG_FUSION is not set
27362 +
27363 +#
27364 +# IEEE 1394 (FireWire) support
27365 +#
27366 +# CONFIG_FIREWIRE is not set
27367 +# CONFIG_IEEE1394 is not set
27368 +# CONFIG_I2O is not set
27369 +CONFIG_MACINTOSH_DRIVERS=y
27370 +# CONFIG_MAC_EMUMOUSEBTN is not set
27371 +# CONFIG_WINDFARM is not set
27372 +CONFIG_NETDEVICES=y
27373 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
27374 +# CONFIG_DUMMY is not set
27375 +# CONFIG_BONDING is not set
27376 +# CONFIG_MACVLAN is not set
27377 +# CONFIG_EQUALIZER is not set
27378 +# CONFIG_TUN is not set
27379 +# CONFIG_VETH is not set
27380 +# CONFIG_IP1000 is not set
27381 +# CONFIG_ARCNET is not set
27382 +# CONFIG_PHYLIB is not set
27383 +CONFIG_NET_ETHERNET=y
27384 +# CONFIG_MII is not set
27385 +# CONFIG_HAPPYMEAL is not set
27386 +# CONFIG_SUNGEM is not set
27387 +# CONFIG_CASSINI is not set
27388 +# CONFIG_NET_VENDOR_3COM is not set
27389 +# CONFIG_NET_TULIP is not set
27390 +# CONFIG_HP100 is not set
27391 +CONFIG_IBM_NEW_EMAC=y
27392 +CONFIG_IBM_NEW_EMAC_RXB=128
27393 +CONFIG_IBM_NEW_EMAC_TXB=64
27394 +CONFIG_IBM_NEW_EMAC_POLL_WEIGHT=32
27395 +CONFIG_IBM_NEW_EMAC_RX_COPY_THRESHOLD=256
27396 +CONFIG_IBM_NEW_EMAC_RX_SKB_HEADROOM=0
27397 +# CONFIG_IBM_NEW_EMAC_DEBUG is not set
27398 +# CONFIG_IBM_NEW_EMAC_ZMII is not set
27399 +# CONFIG_IBM_NEW_EMAC_RGMII is not set
27400 +# CONFIG_IBM_NEW_EMAC_TAH is not set
27401 +CONFIG_IBM_NEW_EMAC_EMAC4=y
27402 +# CONFIG_NET_PCI is not set
27403 +# CONFIG_B44 is not set
27404 +CONFIG_NETDEV_1000=y
27405 +# CONFIG_ACENIC is not set
27406 +# CONFIG_DL2K is not set
27407 +# CONFIG_E1000 is not set
27408 +# CONFIG_E1000E is not set
27409 +# CONFIG_NS83820 is not set
27410 +# CONFIG_HAMACHI is not set
27411 +# CONFIG_YELLOWFIN is not set
27412 +# CONFIG_R8169 is not set
27413 +# CONFIG_SIS190 is not set
27414 +# CONFIG_SKGE is not set
27415 +# CONFIG_SKY2 is not set
27416 +# CONFIG_SK98LIN is not set
27417 +# CONFIG_VIA_VELOCITY is not set
27418 +# CONFIG_TIGON3 is not set
27419 +# CONFIG_BNX2 is not set
27420 +# CONFIG_QLA3XXX is not set
27421 +# CONFIG_ATL1 is not set
27422 +CONFIG_NETDEV_10000=y
27423 +# CONFIG_CHELSIO_T1 is not set
27424 +# CONFIG_CHELSIO_T3 is not set
27425 +# CONFIG_IXGBE is not set
27426 +# CONFIG_IXGB is not set
27427 +# CONFIG_S2IO is not set
27428 +# CONFIG_MYRI10GE is not set
27429 +# CONFIG_NETXEN_NIC is not set
27430 +# CONFIG_NIU is not set
27431 +# CONFIG_MLX4_CORE is not set
27432 +# CONFIG_TEHUTI is not set
27433 +# CONFIG_TR is not set
27434 +
27435 +#
27436 +# Wireless LAN
27437 +#
27438 +# CONFIG_WLAN_PRE80211 is not set
27439 +# CONFIG_WLAN_80211 is not set
27440 +# CONFIG_WAN is not set
27441 +# CONFIG_FDDI is not set
27442 +# CONFIG_HIPPI is not set
27443 +# CONFIG_PPP is not set
27444 +# CONFIG_SLIP is not set
27445 +# CONFIG_SHAPER is not set
27446 +# CONFIG_NETCONSOLE is not set
27447 +# CONFIG_NETPOLL is not set
27448 +# CONFIG_NET_POLL_CONTROLLER is not set
27449 +# CONFIG_ISDN is not set
27450 +# CONFIG_PHONE is not set
27451 +
27452 +#
27453 +# Input device support
27454 +#
27455 +# CONFIG_INPUT is not set
27456 +
27457 +#
27458 +# Hardware I/O ports
27459 +#
27460 +# CONFIG_SERIO is not set
27461 +# CONFIG_GAMEPORT is not set
27462 +
27463 +#
27464 +# Character devices
27465 +#
27466 +# CONFIG_VT is not set
27467 +# CONFIG_SERIAL_NONSTANDARD is not set
27468 +
27469 +#
27470 +# Serial drivers
27471 +#
27472 +CONFIG_SERIAL_8250=y
27473 +CONFIG_SERIAL_8250_CONSOLE=y
27474 +# CONFIG_SERIAL_8250_PCI is not set
27475 +CONFIG_SERIAL_8250_NR_UARTS=4
27476 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4
27477 +CONFIG_SERIAL_8250_EXTENDED=y
27478 +# CONFIG_SERIAL_8250_MANY_PORTS is not set
27479 +CONFIG_SERIAL_8250_SHARE_IRQ=y
27480 +# CONFIG_SERIAL_8250_DETECT_IRQ is not set
27481 +# CONFIG_SERIAL_8250_RSA is not set
27482 +
27483 +#
27484 +# Non-8250 serial port support
27485 +#
27486 +# CONFIG_SERIAL_UARTLITE is not set
27487 +CONFIG_SERIAL_CORE=y
27488 +CONFIG_SERIAL_CORE_CONSOLE=y
27489 +# CONFIG_SERIAL_JSM is not set
27490 +CONFIG_SERIAL_OF_PLATFORM=y
27491 +CONFIG_UNIX98_PTYS=y
27492 +CONFIG_LEGACY_PTYS=y
27493 +CONFIG_LEGACY_PTY_COUNT=256
27494 +# CONFIG_IPMI_HANDLER is not set
27495 +# CONFIG_HW_RANDOM is not set
27496 +# CONFIG_NVRAM is not set
27497 +# CONFIG_GEN_RTC is not set
27498 +# CONFIG_R3964 is not set
27499 +# CONFIG_APPLICOM is not set
27500 +# CONFIG_RAW_DRIVER is not set
27501 +# CONFIG_TCG_TPM is not set
27502 +CONFIG_DEVPORT=y
27503 +# CONFIG_I2C is not set
27504 +
27505 +#
27506 +# SPI support
27507 +#
27508 +# CONFIG_SPI is not set
27509 +# CONFIG_SPI_MASTER is not set
27510 +# CONFIG_W1 is not set
27511 +# CONFIG_POWER_SUPPLY is not set
27512 +# CONFIG_HWMON is not set
27513 +# CONFIG_WATCHDOG is not set
27514 +
27515 +#
27516 +# Sonics Silicon Backplane
27517 +#
27518 +CONFIG_SSB_POSSIBLE=y
27519 +# CONFIG_SSB is not set
27520 +
27521 +#
27522 +# Multifunction device drivers
27523 +#
27524 +# CONFIG_MFD_SM501 is not set
27525 +
27526 +#
27527 +# Multimedia devices
27528 +#
27529 +# CONFIG_VIDEO_DEV is not set
27530 +# CONFIG_DVB_CORE is not set
27531 +CONFIG_DAB=y
27532 +
27533 +#
27534 +# Graphics support
27535 +#
27536 +# CONFIG_AGP is not set
27537 +# CONFIG_DRM is not set
27538 +# CONFIG_VGASTATE is not set
27539 +CONFIG_VIDEO_OUTPUT_CONTROL=m
27540 +# CONFIG_FB is not set
27541 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
27542 +
27543 +#
27544 +# Display device support
27545 +#
27546 +# CONFIG_DISPLAY_SUPPORT is not set
27547 +
27548 +#
27549 +# Sound
27550 +#
27551 +# CONFIG_SOUND is not set
27552 +CONFIG_USB_SUPPORT=y
27553 +CONFIG_USB_ARCH_HAS_HCD=y
27554 +CONFIG_USB_ARCH_HAS_OHCI=y
27555 +CONFIG_USB_ARCH_HAS_EHCI=y
27556 +# CONFIG_USB is not set
27557 +
27558 +#
27559 +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
27560 +#
27561 +
27562 +#
27563 +# USB Gadget Support
27564 +#
27565 +# CONFIG_USB_GADGET is not set
27566 +# CONFIG_MMC is not set
27567 +# CONFIG_NEW_LEDS is not set
27568 +# CONFIG_INFINIBAND is not set
27569 +# CONFIG_EDAC is not set
27570 +# CONFIG_RTC_CLASS is not set
27571 +
27572 +#
27573 +# Userspace I/O
27574 +#
27575 +# CONFIG_UIO is not set
27576 +
27577 +#
27578 +# File systems
27579 +#
27580 +CONFIG_EXT2_FS=y
27581 +# CONFIG_EXT2_FS_XATTR is not set
27582 +# CONFIG_EXT2_FS_XIP is not set
27583 +# CONFIG_EXT3_FS is not set
27584 +# CONFIG_EXT4DEV_FS is not set
27585 +# CONFIG_REISERFS_FS is not set
27586 +# CONFIG_JFS_FS is not set
27587 +# CONFIG_FS_POSIX_ACL is not set
27588 +# CONFIG_XFS_FS is not set
27589 +# CONFIG_GFS2_FS is not set
27590 +# CONFIG_OCFS2_FS is not set
27591 +# CONFIG_MINIX_FS is not set
27592 +# CONFIG_ROMFS_FS is not set
27593 +CONFIG_INOTIFY=y
27594 +CONFIG_INOTIFY_USER=y
27595 +# CONFIG_QUOTA is not set
27596 +CONFIG_DNOTIFY=y
27597 +# CONFIG_AUTOFS_FS is not set
27598 +# CONFIG_AUTOFS4_FS is not set
27599 +# CONFIG_FUSE_FS is not set
27600 +
27601 +#
27602 +# CD-ROM/DVD Filesystems
27603 +#
27604 +# CONFIG_ISO9660_FS is not set
27605 +# CONFIG_UDF_FS is not set
27606 +
27607 +#
27608 +# DOS/FAT/NT Filesystems
27609 +#
27610 +# CONFIG_MSDOS_FS is not set
27611 +# CONFIG_VFAT_FS is not set
27612 +# CONFIG_NTFS_FS is not set
27613 +
27614 +#
27615 +# Pseudo filesystems
27616 +#
27617 +CONFIG_PROC_FS=y
27618 +CONFIG_PROC_KCORE=y
27619 +CONFIG_PROC_SYSCTL=y
27620 +CONFIG_SYSFS=y
27621 +CONFIG_TMPFS=y
27622 +# CONFIG_TMPFS_POSIX_ACL is not set
27623 +# CONFIG_HUGETLB_PAGE is not set
27624 +# CONFIG_CONFIGFS_FS is not set
27625 +
27626 +#
27627 +# Miscellaneous filesystems
27628 +#
27629 +# CONFIG_ADFS_FS is not set
27630 +# CONFIG_AFFS_FS is not set
27631 +# CONFIG_HFS_FS is not set
27632 +# CONFIG_HFSPLUS_FS is not set
27633 +# CONFIG_BEFS_FS is not set
27634 +# CONFIG_BFS_FS is not set
27635 +# CONFIG_EFS_FS is not set
27636 +CONFIG_CRAMFS=y
27637 +# CONFIG_VXFS_FS is not set
27638 +# CONFIG_HPFS_FS is not set
27639 +# CONFIG_QNX4FS_FS is not set
27640 +# CONFIG_SYSV_FS is not set
27641 +# CONFIG_UFS_FS is not set
27642 +CONFIG_NETWORK_FILESYSTEMS=y
27643 +CONFIG_NFS_FS=y
27644 +CONFIG_NFS_V3=y
27645 +# CONFIG_NFS_V3_ACL is not set
27646 +# CONFIG_NFS_V4 is not set
27647 +# CONFIG_NFS_DIRECTIO is not set
27648 +# CONFIG_NFSD is not set
27649 +CONFIG_ROOT_NFS=y
27650 +CONFIG_LOCKD=y
27651 +CONFIG_LOCKD_V4=y
27652 +CONFIG_NFS_COMMON=y
27653 +CONFIG_SUNRPC=y
27654 +# CONFIG_SUNRPC_BIND34 is not set
27655 +# CONFIG_RPCSEC_GSS_KRB5 is not set
27656 +# CONFIG_RPCSEC_GSS_SPKM3 is not set
27657 +# CONFIG_SMB_FS is not set
27658 +# CONFIG_CIFS is not set
27659 +# CONFIG_NCP_FS is not set
27660 +# CONFIG_CODA_FS is not set
27661 +# CONFIG_AFS_FS is not set
27662 +
27663 +#
27664 +# Partition Types
27665 +#
27666 +# CONFIG_PARTITION_ADVANCED is not set
27667 +CONFIG_MSDOS_PARTITION=y
27668 +# CONFIG_NLS is not set
27669 +# CONFIG_DLM is not set
27670 +# CONFIG_UCC_SLOW is not set
27671 +
27672 +#
27673 +# Library routines
27674 +#
27675 +CONFIG_BITREVERSE=y
27676 +# CONFIG_CRC_CCITT is not set
27677 +# CONFIG_CRC16 is not set
27678 +# CONFIG_CRC_ITU_T is not set
27679 +CONFIG_CRC32=y
27680 +# CONFIG_CRC7 is not set
27681 +# CONFIG_LIBCRC32C is not set
27682 +CONFIG_ZLIB_INFLATE=y
27683 +CONFIG_PLIST=y
27684 +CONFIG_HAS_IOMEM=y
27685 +CONFIG_HAS_IOPORT=y
27686 +CONFIG_HAS_DMA=y
27687 +CONFIG_INSTRUMENTATION=y
27688 +# CONFIG_PROFILING is not set
27689 +# CONFIG_KPROBES is not set
27690 +# CONFIG_MARKERS is not set
27691 +
27692 +#
27693 +# Kernel hacking
27694 +#
27695 +# CONFIG_PRINTK_TIME is not set
27696 +CONFIG_ENABLE_WARN_DEPRECATED=y
27697 +CONFIG_ENABLE_MUST_CHECK=y
27698 +CONFIG_MAGIC_SYSRQ=y
27699 +# CONFIG_UNUSED_SYMBOLS is not set
27700 +# CONFIG_DEBUG_FS is not set
27701 +# CONFIG_HEADERS_CHECK is not set
27702 +CONFIG_DEBUG_KERNEL=y
27703 +# CONFIG_DEBUG_SHIRQ is not set
27704 +CONFIG_DETECT_SOFTLOCKUP=y
27705 +CONFIG_SCHED_DEBUG=y
27706 +# CONFIG_SCHEDSTATS is not set
27707 +# CONFIG_TIMER_STATS is not set
27708 +# CONFIG_SLUB_DEBUG_ON is not set
27709 +# CONFIG_DEBUG_RT_MUTEXES is not set
27710 +# CONFIG_RT_MUTEX_TESTER is not set
27711 +# CONFIG_DEBUG_SPINLOCK is not set
27712 +# CONFIG_DEBUG_MUTEXES is not set
27713 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
27714 +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
27715 +# CONFIG_DEBUG_KOBJECT is not set
27716 +# CONFIG_DEBUG_BUGVERBOSE is not set
27717 +# CONFIG_DEBUG_INFO is not set
27718 +# CONFIG_DEBUG_VM is not set
27719 +# CONFIG_DEBUG_LIST is not set
27720 +# CONFIG_DEBUG_SG is not set
27721 +CONFIG_FORCED_INLINING=y
27722 +# CONFIG_BOOT_PRINTK_DELAY is not set
27723 +# CONFIG_RCU_TORTURE_TEST is not set
27724 +# CONFIG_FAULT_INJECTION is not set
27725 +# CONFIG_SAMPLES is not set
27726 +# CONFIG_DEBUG_STACKOVERFLOW is not set
27727 +# CONFIG_DEBUG_STACK_USAGE is not set
27728 +# CONFIG_DEBUG_PAGEALLOC is not set
27729 +CONFIG_DEBUGGER=y
27730 +# CONFIG_KGDB is not set
27731 +# CONFIG_XMON is not set
27732 +# CONFIG_BDI_SWITCH is not set
27733 +# CONFIG_PPC_EARLY_DEBUG is not set
27734 +
27735 +#
27736 +# Security options
27737 +#
27738 +# CONFIG_KEYS is not set
27739 +# CONFIG_SECURITY is not set
27740 +# CONFIG_SECURITY_FILE_CAPABILITIES is not set
27741 +CONFIG_CRYPTO=y
27742 +CONFIG_CRYPTO_ALGAPI=y
27743 +CONFIG_CRYPTO_BLKCIPHER=y
27744 +CONFIG_CRYPTO_MANAGER=y
27745 +# CONFIG_CRYPTO_HMAC is not set
27746 +# CONFIG_CRYPTO_XCBC is not set
27747 +# CONFIG_CRYPTO_NULL is not set
27748 +# CONFIG_CRYPTO_MD4 is not set
27749 +CONFIG_CRYPTO_MD5=y
27750 +# CONFIG_CRYPTO_SHA1 is not set
27751 +# CONFIG_CRYPTO_SHA256 is not set
27752 +# CONFIG_CRYPTO_SHA512 is not set
27753 +# CONFIG_CRYPTO_WP512 is not set
27754 +# CONFIG_CRYPTO_TGR192 is not set
27755 +# CONFIG_CRYPTO_GF128MUL is not set
27756 +CONFIG_CRYPTO_ECB=y
27757 +CONFIG_CRYPTO_CBC=y
27758 +CONFIG_CRYPTO_PCBC=y
27759 +# CONFIG_CRYPTO_LRW is not set
27760 +# CONFIG_CRYPTO_XTS is not set
27761 +# CONFIG_CRYPTO_CRYPTD is not set
27762 +CONFIG_CRYPTO_DES=y
27763 +# CONFIG_CRYPTO_FCRYPT is not set
27764 +# CONFIG_CRYPTO_BLOWFISH is not set
27765 +# CONFIG_CRYPTO_TWOFISH is not set
27766 +# CONFIG_CRYPTO_SERPENT is not set
27767 +# CONFIG_CRYPTO_AES is not set
27768 +# CONFIG_CRYPTO_CAST5 is not set
27769 +# CONFIG_CRYPTO_CAST6 is not set
27770 +# CONFIG_CRYPTO_TEA is not set
27771 +# CONFIG_CRYPTO_ARC4 is not set
27772 +# CONFIG_CRYPTO_KHAZAD is not set
27773 +# CONFIG_CRYPTO_ANUBIS is not set
27774 +# CONFIG_CRYPTO_SEED is not set
27775 +# CONFIG_CRYPTO_DEFLATE is not set
27776 +# CONFIG_CRYPTO_MICHAEL_MIC is not set
27777 +# CONFIG_CRYPTO_CRC32C is not set
27778 +# CONFIG_CRYPTO_CAMELLIA is not set
27779 +# CONFIG_CRYPTO_TEST is not set
27780 +# CONFIG_CRYPTO_AUTHENC is not set
27781 +CONFIG_CRYPTO_HW=y
27782 +# CONFIG_PPC_CLOCK is not set
27783 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/configs/kilauea_defconfig powerpc.git/arch/powerpc/configs/kilauea_defconfig
27784 --- linux-2.6.24/arch/powerpc/configs/kilauea_defconfig 2008-01-24 23:58:37.000000000 +0100
27785 +++ powerpc.git/arch/powerpc/configs/kilauea_defconfig  2008-01-28 20:25:49.000000000 +0100
27786 @@ -1,7 +1,7 @@
27787  #
27788  # Automatically generated make config: don't edit
27789 -# Linux kernel version: 2.6.24-rc4
27790 -# Thu Dec  6 16:48:20 2007
27791 +# Linux kernel version: 2.6.24-rc6
27792 +# Thu Jan  3 14:21:31 2008
27793  #
27794  # CONFIG_PPC64 is not set
27795  
27796 @@ -40,7 +40,7 @@
27797  CONFIG_ARCH_MAY_HAVE_PC_FDC=y
27798  CONFIG_PPC_OF=y
27799  CONFIG_OF=y
27800 -# CONFIG_PPC_UDBG_16550 is not set
27801 +CONFIG_PPC_UDBG_16550=y
27802  # CONFIG_GENERIC_TBSYNC is not set
27803  CONFIG_AUDIT_ARCH=y
27804  CONFIG_GENERIC_BUG=y
27805 @@ -125,6 +125,7 @@
27806  # CONFIG_DEFAULT_CFQ is not set
27807  # CONFIG_DEFAULT_NOOP is not set
27808  CONFIG_DEFAULT_IOSCHED="anticipatory"
27809 +CONFIG_PPC4xx_PCI_EXPRESS=y
27810  
27811  #
27812  # Platform support
27813 @@ -134,9 +135,12 @@
27814  # CONFIG_PPC_CELL is not set
27815  # CONFIG_PPC_CELL_NATIVE is not set
27816  # CONFIG_PQ2ADS is not set
27817 +# CONFIG_EP405 is not set
27818  CONFIG_KILAUEA=y
27819 +# CONFIG_MAKALU is not set
27820  # CONFIG_WALNUT is not set
27821  # CONFIG_XILINX_VIRTEX_GENERIC_BOARD is not set
27822 +CONFIG_405EX=y
27823  # CONFIG_MPIC is not set
27824  # CONFIG_MPIC_WEIRD is not set
27825  # CONFIG_PPC_I8259 is not set
27826 @@ -199,11 +203,17 @@
27827  # Bus options
27828  #
27829  CONFIG_ZONE_DMA=y
27830 -# CONFIG_PCI is not set
27831 -# CONFIG_PCI_DOMAINS is not set
27832 -# CONFIG_PCI_SYSCALL is not set
27833 -# CONFIG_ARCH_SUPPORTS_MSI is not set
27834 +CONFIG_PPC_INDIRECT_PCI=y
27835 +CONFIG_PCI=y
27836 +CONFIG_PCI_DOMAINS=y
27837 +CONFIG_PCI_SYSCALL=y
27838 +# CONFIG_PCIEPORTBUS is not set
27839 +CONFIG_ARCH_SUPPORTS_MSI=y
27840 +# CONFIG_PCI_MSI is not set
27841 +CONFIG_PCI_LEGACY=y
27842 +# CONFIG_PCI_DEBUG is not set
27843  # CONFIG_PCCARD is not set
27844 +# CONFIG_HOTPLUG_PCI is not set
27845  
27846  #
27847  # Advanced setup
27848 @@ -368,11 +378,13 @@
27849  # CONFIG_MTD_COMPLEX_MAPPINGS is not set
27850  # CONFIG_MTD_PHYSMAP is not set
27851  CONFIG_MTD_PHYSMAP_OF=y
27852 +# CONFIG_MTD_INTEL_VR_NOR is not set
27853  # CONFIG_MTD_PLATRAM is not set
27854  
27855  #
27856  # Self-contained MTD device drivers
27857  #
27858 +# CONFIG_MTD_PMC551 is not set
27859  # CONFIG_MTD_SLRAM is not set
27860  # CONFIG_MTD_PHRAM is not set
27861  # CONFIG_MTD_MTDRAM is not set
27862 @@ -395,9 +407,14 @@
27863  # CONFIG_PARPORT is not set
27864  CONFIG_BLK_DEV=y
27865  # CONFIG_BLK_DEV_FD is not set
27866 +# CONFIG_BLK_CPQ_DA is not set
27867 +# CONFIG_BLK_CPQ_CISS_DA is not set
27868 +# CONFIG_BLK_DEV_DAC960 is not set
27869 +# CONFIG_BLK_DEV_UMEM is not set
27870  # CONFIG_BLK_DEV_COW_COMMON is not set
27871  # CONFIG_BLK_DEV_LOOP is not set
27872  # CONFIG_BLK_DEV_NBD is not set
27873 +# CONFIG_BLK_DEV_SX8 is not set
27874  CONFIG_BLK_DEV_RAM=y
27875  CONFIG_BLK_DEV_RAM_COUNT=16
27876  CONFIG_BLK_DEV_RAM_SIZE=35000
27877 @@ -417,6 +434,14 @@
27878  # CONFIG_SCSI_NETLINK is not set
27879  # CONFIG_ATA is not set
27880  # CONFIG_MD is not set
27881 +# CONFIG_FUSION is not set
27882 +
27883 +#
27884 +# IEEE 1394 (FireWire) support
27885 +#
27886 +# CONFIG_FIREWIRE is not set
27887 +# CONFIG_IEEE1394 is not set
27888 +# CONFIG_I2O is not set
27889  # CONFIG_MACINTOSH_DRIVERS is not set
27890  CONFIG_NETDEVICES=y
27891  # CONFIG_NETDEVICES_MULTIQUEUE is not set
27892 @@ -426,9 +451,33 @@
27893  # CONFIG_EQUALIZER is not set
27894  # CONFIG_TUN is not set
27895  # CONFIG_VETH is not set
27896 -# CONFIG_NET_ETHERNET is not set
27897 +# CONFIG_IP1000 is not set
27898 +# CONFIG_ARCNET is not set
27899 +# CONFIG_PHYLIB is not set
27900 +CONFIG_NET_ETHERNET=y
27901 +# CONFIG_MII is not set
27902 +# CONFIG_HAPPYMEAL is not set
27903 +# CONFIG_SUNGEM is not set
27904 +# CONFIG_CASSINI is not set
27905 +# CONFIG_NET_VENDOR_3COM is not set
27906 +# CONFIG_NET_TULIP is not set
27907 +# CONFIG_HP100 is not set
27908 +CONFIG_IBM_NEW_EMAC=y
27909 +CONFIG_IBM_NEW_EMAC_RXB=256
27910 +CONFIG_IBM_NEW_EMAC_TXB=256
27911 +CONFIG_IBM_NEW_EMAC_POLL_WEIGHT=32
27912 +CONFIG_IBM_NEW_EMAC_RX_COPY_THRESHOLD=256
27913 +CONFIG_IBM_NEW_EMAC_RX_SKB_HEADROOM=0
27914 +# CONFIG_IBM_NEW_EMAC_DEBUG is not set
27915 +# CONFIG_IBM_NEW_EMAC_ZMII is not set
27916 +CONFIG_IBM_NEW_EMAC_RGMII=y
27917 +# CONFIG_IBM_NEW_EMAC_TAH is not set
27918 +CONFIG_IBM_NEW_EMAC_EMAC4=y
27919 +# CONFIG_NET_PCI is not set
27920 +# CONFIG_B44 is not set
27921  # CONFIG_NETDEV_1000 is not set
27922  # CONFIG_NETDEV_10000 is not set
27923 +# CONFIG_TR is not set
27924  
27925  #
27926  # Wireless LAN
27927 @@ -436,6 +485,8 @@
27928  # CONFIG_WLAN_PRE80211 is not set
27929  # CONFIG_WLAN_80211 is not set
27930  # CONFIG_WAN is not set
27931 +# CONFIG_FDDI is not set
27932 +# CONFIG_HIPPI is not set
27933  # CONFIG_PPP is not set
27934  # CONFIG_SLIP is not set
27935  # CONFIG_SHAPER is not set
27936 @@ -467,6 +518,7 @@
27937  #
27938  CONFIG_SERIAL_8250=y
27939  CONFIG_SERIAL_8250_CONSOLE=y
27940 +CONFIG_SERIAL_8250_PCI=y
27941  CONFIG_SERIAL_8250_NR_UARTS=4
27942  CONFIG_SERIAL_8250_RUNTIME_UARTS=4
27943  CONFIG_SERIAL_8250_EXTENDED=y
27944 @@ -481,6 +533,7 @@
27945  # CONFIG_SERIAL_UARTLITE is not set
27946  CONFIG_SERIAL_CORE=y
27947  CONFIG_SERIAL_CORE_CONSOLE=y
27948 +# CONFIG_SERIAL_JSM is not set
27949  CONFIG_SERIAL_OF_PLATFORM=y
27950  CONFIG_UNIX98_PTYS=y
27951  CONFIG_LEGACY_PTYS=y
27952 @@ -490,8 +543,10 @@
27953  # CONFIG_NVRAM is not set
27954  # CONFIG_GEN_RTC is not set
27955  # CONFIG_R3964 is not set
27956 +# CONFIG_APPLICOM is not set
27957  # CONFIG_RAW_DRIVER is not set
27958  # CONFIG_TCG_TPM is not set
27959 +CONFIG_DEVPORT=y
27960  # CONFIG_I2C is not set
27961  
27962  #
27963 @@ -525,6 +580,8 @@
27964  #
27965  # Graphics support
27966  #
27967 +# CONFIG_AGP is not set
27968 +# CONFIG_DRM is not set
27969  # CONFIG_VGASTATE is not set
27970  # CONFIG_VIDEO_OUTPUT_CONTROL is not set
27971  # CONFIG_FB is not set
27972 @@ -542,6 +599,7 @@
27973  # CONFIG_USB_SUPPORT is not set
27974  # CONFIG_MMC is not set
27975  # CONFIG_NEW_LEDS is not set
27976 +# CONFIG_INFINIBAND is not set
27977  # CONFIG_EDAC is not set
27978  # CONFIG_RTC_CLASS is not set
27979  
27980 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/configs/lite5200_defconfig powerpc.git/arch/powerpc/configs/lite5200_defconfig
27981 --- linux-2.6.24/arch/powerpc/configs/lite5200_defconfig        2008-01-24 23:58:37.000000000 +0100
27982 +++ powerpc.git/arch/powerpc/configs/lite5200_defconfig 1970-01-01 01:00:00.000000000 +0100
27983 @@ -1,847 +0,0 @@
27984 -#
27985 -# Automatically generated make config: don't edit
27986 -# Linux kernel version: 2.6.24-rc4
27987 -# Thu Dec  6 16:48:24 2007
27988 -#
27989 -# CONFIG_PPC64 is not set
27990 -
27991 -#
27992 -# Processor support
27993 -#
27994 -CONFIG_6xx=y
27995 -# CONFIG_PPC_85xx is not set
27996 -# CONFIG_PPC_8xx is not set
27997 -# CONFIG_40x is not set
27998 -# CONFIG_44x is not set
27999 -# CONFIG_E200 is not set
28000 -CONFIG_PPC_FPU=y
28001 -# CONFIG_ALTIVEC is not set
28002 -CONFIG_PPC_STD_MMU=y
28003 -CONFIG_PPC_STD_MMU_32=y
28004 -# CONFIG_PPC_MM_SLICES is not set
28005 -# CONFIG_SMP is not set
28006 -CONFIG_PPC32=y
28007 -CONFIG_WORD_SIZE=32
28008 -CONFIG_PPC_MERGE=y
28009 -CONFIG_MMU=y
28010 -CONFIG_GENERIC_CMOS_UPDATE=y
28011 -CONFIG_GENERIC_TIME=y
28012 -CONFIG_GENERIC_TIME_VSYSCALL=y
28013 -CONFIG_GENERIC_CLOCKEVENTS=y
28014 -CONFIG_GENERIC_HARDIRQS=y
28015 -CONFIG_IRQ_PER_CPU=y
28016 -CONFIG_RWSEM_XCHGADD_ALGORITHM=y
28017 -CONFIG_ARCH_HAS_ILOG2_U32=y
28018 -CONFIG_GENERIC_HWEIGHT=y
28019 -CONFIG_GENERIC_CALIBRATE_DELAY=y
28020 -CONFIG_GENERIC_FIND_NEXT_BIT=y
28021 -# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
28022 -CONFIG_PPC=y
28023 -CONFIG_EARLY_PRINTK=y
28024 -CONFIG_GENERIC_NVRAM=y
28025 -CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
28026 -CONFIG_ARCH_MAY_HAVE_PC_FDC=y
28027 -CONFIG_PPC_OF=y
28028 -CONFIG_OF=y
28029 -# CONFIG_PPC_UDBG_16550 is not set
28030 -# CONFIG_GENERIC_TBSYNC is not set
28031 -CONFIG_AUDIT_ARCH=y
28032 -CONFIG_GENERIC_BUG=y
28033 -# CONFIG_DEFAULT_UIMAGE is not set
28034 -# CONFIG_PPC_DCR_NATIVE is not set
28035 -# CONFIG_PPC_DCR_MMIO is not set
28036 -CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
28037 -
28038 -#
28039 -# General setup
28040 -#
28041 -CONFIG_EXPERIMENTAL=y
28042 -CONFIG_BROKEN_ON_SMP=y
28043 -CONFIG_INIT_ENV_ARG_LIMIT=32
28044 -CONFIG_LOCALVERSION=""
28045 -CONFIG_LOCALVERSION_AUTO=y
28046 -CONFIG_SWAP=y
28047 -CONFIG_SYSVIPC=y
28048 -CONFIG_SYSVIPC_SYSCTL=y
28049 -# CONFIG_POSIX_MQUEUE is not set
28050 -# CONFIG_BSD_PROCESS_ACCT is not set
28051 -# CONFIG_TASKSTATS is not set
28052 -# CONFIG_USER_NS is not set
28053 -# CONFIG_PID_NS is not set
28054 -# CONFIG_AUDIT is not set
28055 -# CONFIG_IKCONFIG is not set
28056 -CONFIG_LOG_BUF_SHIFT=14
28057 -# CONFIG_CGROUPS is not set
28058 -# CONFIG_FAIR_GROUP_SCHED is not set
28059 -CONFIG_SYSFS_DEPRECATED=y
28060 -# CONFIG_RELAY is not set
28061 -CONFIG_BLK_DEV_INITRD=y
28062 -CONFIG_INITRAMFS_SOURCE=""
28063 -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
28064 -CONFIG_SYSCTL=y
28065 -CONFIG_EMBEDDED=y
28066 -# CONFIG_SYSCTL_SYSCALL is not set
28067 -# CONFIG_KALLSYMS is not set
28068 -CONFIG_HOTPLUG=y
28069 -CONFIG_PRINTK=y
28070 -CONFIG_BUG=y
28071 -CONFIG_ELF_CORE=y
28072 -CONFIG_BASE_FULL=y
28073 -CONFIG_FUTEX=y
28074 -CONFIG_ANON_INODES=y
28075 -# CONFIG_EPOLL is not set
28076 -CONFIG_SIGNALFD=y
28077 -CONFIG_EVENTFD=y
28078 -CONFIG_SHMEM=y
28079 -CONFIG_VM_EVENT_COUNTERS=y
28080 -CONFIG_SLUB_DEBUG=y
28081 -# CONFIG_SLAB is not set
28082 -CONFIG_SLUB=y
28083 -# CONFIG_SLOB is not set
28084 -CONFIG_RT_MUTEXES=y
28085 -# CONFIG_TINY_SHMEM is not set
28086 -CONFIG_BASE_SMALL=0
28087 -CONFIG_MODULES=y
28088 -CONFIG_MODULE_UNLOAD=y
28089 -# CONFIG_MODULE_FORCE_UNLOAD is not set
28090 -# CONFIG_MODVERSIONS is not set
28091 -# CONFIG_MODULE_SRCVERSION_ALL is not set
28092 -# CONFIG_KMOD is not set
28093 -CONFIG_BLOCK=y
28094 -# CONFIG_LBD is not set
28095 -# CONFIG_BLK_DEV_IO_TRACE is not set
28096 -# CONFIG_LSF is not set
28097 -# CONFIG_BLK_DEV_BSG is not set
28098 -
28099 -#
28100 -# IO Schedulers
28101 -#
28102 -CONFIG_IOSCHED_NOOP=y
28103 -CONFIG_IOSCHED_AS=y
28104 -CONFIG_IOSCHED_DEADLINE=y
28105 -CONFIG_IOSCHED_CFQ=y
28106 -CONFIG_DEFAULT_AS=y
28107 -# CONFIG_DEFAULT_DEADLINE is not set
28108 -# CONFIG_DEFAULT_CFQ is not set
28109 -# CONFIG_DEFAULT_NOOP is not set
28110 -CONFIG_DEFAULT_IOSCHED="anticipatory"
28111 -
28112 -#
28113 -# Platform support
28114 -#
28115 -CONFIG_PPC_MULTIPLATFORM=y
28116 -# CONFIG_PPC_82xx is not set
28117 -# CONFIG_PPC_83xx is not set
28118 -# CONFIG_PPC_86xx is not set
28119 -CONFIG_CLASSIC32=y
28120 -# CONFIG_PPC_CHRP is not set
28121 -CONFIG_PPC_MPC52xx=y
28122 -CONFIG_PPC_MPC5200=y
28123 -CONFIG_PPC_MPC5200_BUGFIX=y
28124 -# CONFIG_PPC_EFIKA is not set
28125 -CONFIG_PPC_LITE5200=y
28126 -# CONFIG_PPC_PMAC is not set
28127 -# CONFIG_PPC_CELL is not set
28128 -# CONFIG_PPC_CELL_NATIVE is not set
28129 -# CONFIG_PQ2ADS is not set
28130 -# CONFIG_EMBEDDED6xx is not set
28131 -# CONFIG_MPIC is not set
28132 -# CONFIG_MPIC_WEIRD is not set
28133 -# CONFIG_PPC_I8259 is not set
28134 -# CONFIG_PPC_RTAS is not set
28135 -# CONFIG_MMIO_NVRAM is not set
28136 -# CONFIG_PPC_MPC106 is not set
28137 -# CONFIG_PPC_970_NAP is not set
28138 -# CONFIG_PPC_INDIRECT_IO is not set
28139 -# CONFIG_GENERIC_IOMAP is not set
28140 -# CONFIG_CPU_FREQ is not set
28141 -# CONFIG_TAU is not set
28142 -# CONFIG_CPM2 is not set
28143 -# CONFIG_FSL_ULI1575 is not set
28144 -CONFIG_PPC_BESTCOMM=y
28145 -CONFIG_PPC_BESTCOMM_ATA=y
28146 -CONFIG_PPC_BESTCOMM_FEC=y
28147 -CONFIG_PPC_BESTCOMM_GEN_BD=y
28148 -
28149 -#
28150 -# Kernel options
28151 -#
28152 -# CONFIG_HIGHMEM is not set
28153 -CONFIG_TICK_ONESHOT=y
28154 -CONFIG_NO_HZ=y
28155 -CONFIG_HIGH_RES_TIMERS=y
28156 -CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
28157 -# CONFIG_HZ_100 is not set
28158 -CONFIG_HZ_250=y
28159 -# CONFIG_HZ_300 is not set
28160 -# CONFIG_HZ_1000 is not set
28161 -CONFIG_HZ=250
28162 -CONFIG_PREEMPT_NONE=y
28163 -# CONFIG_PREEMPT_VOLUNTARY is not set
28164 -# CONFIG_PREEMPT is not set
28165 -CONFIG_BINFMT_ELF=y
28166 -# CONFIG_BINFMT_MISC is not set
28167 -CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
28168 -# CONFIG_KEXEC is not set
28169 -CONFIG_ARCH_FLATMEM_ENABLE=y
28170 -CONFIG_ARCH_POPULATES_NODE_MAP=y
28171 -CONFIG_SELECT_MEMORY_MODEL=y
28172 -CONFIG_FLATMEM_MANUAL=y
28173 -# CONFIG_DISCONTIGMEM_MANUAL is not set
28174 -# CONFIG_SPARSEMEM_MANUAL is not set
28175 -CONFIG_FLATMEM=y
28176 -CONFIG_FLAT_NODE_MEM_MAP=y
28177 -# CONFIG_SPARSEMEM_STATIC is not set
28178 -# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
28179 -CONFIG_SPLIT_PTLOCK_CPUS=4
28180 -# CONFIG_RESOURCES_64BIT is not set
28181 -CONFIG_ZONE_DMA_FLAG=1
28182 -CONFIG_BOUNCE=y
28183 -CONFIG_VIRT_TO_BUS=y
28184 -CONFIG_PROC_DEVICETREE=y
28185 -# CONFIG_CMDLINE_BOOL is not set
28186 -CONFIG_PM=y
28187 -# CONFIG_PM_LEGACY is not set
28188 -# CONFIG_PM_DEBUG is not set
28189 -CONFIG_PM_SLEEP=y
28190 -CONFIG_SUSPEND_UP_POSSIBLE=y
28191 -CONFIG_SUSPEND=y
28192 -CONFIG_HIBERNATION_UP_POSSIBLE=y
28193 -# CONFIG_HIBERNATION is not set
28194 -CONFIG_SECCOMP=y
28195 -CONFIG_WANT_DEVICE_TREE=y
28196 -CONFIG_DEVICE_TREE=""
28197 -CONFIG_ISA_DMA_API=y
28198 -
28199 -#
28200 -# Bus options
28201 -#
28202 -CONFIG_ZONE_DMA=y
28203 -CONFIG_GENERIC_ISA_DMA=y
28204 -# CONFIG_PPC_INDIRECT_PCI is not set
28205 -CONFIG_FSL_SOC=y
28206 -CONFIG_PCI=y
28207 -CONFIG_PCI_DOMAINS=y
28208 -CONFIG_PCI_SYSCALL=y
28209 -# CONFIG_PCIEPORTBUS is not set
28210 -CONFIG_ARCH_SUPPORTS_MSI=y
28211 -# CONFIG_PCI_MSI is not set
28212 -CONFIG_PCI_LEGACY=y
28213 -# CONFIG_PCI_DEBUG is not set
28214 -# CONFIG_PCCARD is not set
28215 -# CONFIG_HOTPLUG_PCI is not set
28216 -
28217 -#
28218 -# Advanced setup
28219 -#
28220 -# CONFIG_ADVANCED_OPTIONS is not set
28221 -
28222 -#
28223 -# Default settings for advanced configuration options are used
28224 -#
28225 -CONFIG_HIGHMEM_START=0xfe000000
28226 -CONFIG_LOWMEM_SIZE=0x30000000
28227 -CONFIG_KERNEL_START=0xc0000000
28228 -CONFIG_TASK_SIZE=0xc0000000
28229 -CONFIG_BOOT_LOAD=0x00800000
28230 -
28231 -#
28232 -# Networking
28233 -#
28234 -CONFIG_NET=y
28235 -
28236 -#
28237 -# Networking options
28238 -#
28239 -CONFIG_PACKET=y
28240 -# CONFIG_PACKET_MMAP is not set
28241 -CONFIG_UNIX=y
28242 -CONFIG_XFRM=y
28243 -CONFIG_XFRM_USER=m
28244 -# CONFIG_XFRM_SUB_POLICY is not set
28245 -# CONFIG_XFRM_MIGRATE is not set
28246 -# CONFIG_NET_KEY is not set
28247 -CONFIG_INET=y
28248 -CONFIG_IP_MULTICAST=y
28249 -# CONFIG_IP_ADVANCED_ROUTER is not set
28250 -CONFIG_IP_FIB_HASH=y
28251 -CONFIG_IP_PNP=y
28252 -CONFIG_IP_PNP_DHCP=y
28253 -CONFIG_IP_PNP_BOOTP=y
28254 -# CONFIG_IP_PNP_RARP is not set
28255 -# CONFIG_NET_IPIP is not set
28256 -# CONFIG_NET_IPGRE is not set
28257 -# CONFIG_IP_MROUTE is not set
28258 -# CONFIG_ARPD is not set
28259 -CONFIG_SYN_COOKIES=y
28260 -# CONFIG_INET_AH is not set
28261 -# CONFIG_INET_ESP is not set
28262 -# CONFIG_INET_IPCOMP is not set
28263 -# CONFIG_INET_XFRM_TUNNEL is not set
28264 -# CONFIG_INET_TUNNEL is not set
28265 -CONFIG_INET_XFRM_MODE_TRANSPORT=y
28266 -CONFIG_INET_XFRM_MODE_TUNNEL=y
28267 -CONFIG_INET_XFRM_MODE_BEET=y
28268 -# CONFIG_INET_LRO is not set
28269 -CONFIG_INET_DIAG=y
28270 -CONFIG_INET_TCP_DIAG=y
28271 -# CONFIG_TCP_CONG_ADVANCED is not set
28272 -CONFIG_TCP_CONG_CUBIC=y
28273 -CONFIG_DEFAULT_TCP_CONG="cubic"
28274 -# CONFIG_TCP_MD5SIG is not set
28275 -# CONFIG_IPV6 is not set
28276 -# CONFIG_INET6_XFRM_TUNNEL is not set
28277 -# CONFIG_INET6_TUNNEL is not set
28278 -# CONFIG_NETWORK_SECMARK is not set
28279 -# CONFIG_NETFILTER is not set
28280 -# CONFIG_IP_DCCP is not set
28281 -# CONFIG_IP_SCTP is not set
28282 -# CONFIG_TIPC is not set
28283 -# CONFIG_ATM is not set
28284 -# CONFIG_BRIDGE is not set
28285 -# CONFIG_VLAN_8021Q is not set
28286 -# CONFIG_DECNET is not set
28287 -# CONFIG_LLC2 is not set
28288 -# CONFIG_IPX is not set
28289 -# CONFIG_ATALK is not set
28290 -# CONFIG_X25 is not set
28291 -# CONFIG_LAPB is not set
28292 -# CONFIG_ECONET is not set
28293 -# CONFIG_WAN_ROUTER is not set
28294 -# CONFIG_NET_SCHED is not set
28295 -
28296 -#
28297 -# Network testing
28298 -#
28299 -# CONFIG_NET_PKTGEN is not set
28300 -# CONFIG_HAMRADIO is not set
28301 -# CONFIG_IRDA is not set
28302 -# CONFIG_BT is not set
28303 -# CONFIG_AF_RXRPC is not set
28304 -
28305 -#
28306 -# Wireless
28307 -#
28308 -# CONFIG_CFG80211 is not set
28309 -# CONFIG_WIRELESS_EXT is not set
28310 -# CONFIG_MAC80211 is not set
28311 -# CONFIG_IEEE80211 is not set
28312 -# CONFIG_RFKILL is not set
28313 -# CONFIG_NET_9P is not set
28314 -
28315 -#
28316 -# Device Drivers
28317 -#
28318 -
28319 -#
28320 -# Generic Driver Options
28321 -#
28322 -CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
28323 -CONFIG_STANDALONE=y
28324 -CONFIG_PREVENT_FIRMWARE_BUILD=y
28325 -# CONFIG_FW_LOADER is not set
28326 -# CONFIG_DEBUG_DRIVER is not set
28327 -# CONFIG_DEBUG_DEVRES is not set
28328 -# CONFIG_SYS_HYPERVISOR is not set
28329 -# CONFIG_CONNECTOR is not set
28330 -# CONFIG_MTD is not set
28331 -CONFIG_OF_DEVICE=y
28332 -# CONFIG_PARPORT is not set
28333 -CONFIG_BLK_DEV=y
28334 -# CONFIG_BLK_DEV_FD is not set
28335 -# CONFIG_BLK_CPQ_DA is not set
28336 -# CONFIG_BLK_CPQ_CISS_DA is not set
28337 -# CONFIG_BLK_DEV_DAC960 is not set
28338 -# CONFIG_BLK_DEV_UMEM is not set
28339 -# CONFIG_BLK_DEV_COW_COMMON is not set
28340 -CONFIG_BLK_DEV_LOOP=y
28341 -# CONFIG_BLK_DEV_CRYPTOLOOP is not set
28342 -# CONFIG_BLK_DEV_NBD is not set
28343 -# CONFIG_BLK_DEV_SX8 is not set
28344 -CONFIG_BLK_DEV_RAM=y
28345 -CONFIG_BLK_DEV_RAM_COUNT=16
28346 -CONFIG_BLK_DEV_RAM_SIZE=32768
28347 -CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
28348 -# CONFIG_CDROM_PKTCDVD is not set
28349 -# CONFIG_ATA_OVER_ETH is not set
28350 -CONFIG_MISC_DEVICES=y
28351 -# CONFIG_PHANTOM is not set
28352 -# CONFIG_EEPROM_93CX6 is not set
28353 -# CONFIG_SGI_IOC4 is not set
28354 -# CONFIG_TIFM_CORE is not set
28355 -# CONFIG_IDE is not set
28356 -
28357 -#
28358 -# SCSI device support
28359 -#
28360 -# CONFIG_RAID_ATTRS is not set
28361 -CONFIG_SCSI=y
28362 -CONFIG_SCSI_DMA=y
28363 -# CONFIG_SCSI_TGT is not set
28364 -# CONFIG_SCSI_NETLINK is not set
28365 -# CONFIG_SCSI_PROC_FS is not set
28366 -
28367 -#
28368 -# SCSI support type (disk, tape, CD-ROM)
28369 -#
28370 -# CONFIG_BLK_DEV_SD is not set
28371 -# CONFIG_CHR_DEV_ST is not set
28372 -# CONFIG_CHR_DEV_OSST is not set
28373 -# CONFIG_BLK_DEV_SR is not set
28374 -# CONFIG_CHR_DEV_SG is not set
28375 -# CONFIG_CHR_DEV_SCH is not set
28376 -
28377 -#
28378 -# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
28379 -#
28380 -# CONFIG_SCSI_MULTI_LUN is not set
28381 -# CONFIG_SCSI_CONSTANTS is not set
28382 -# CONFIG_SCSI_LOGGING is not set
28383 -# CONFIG_SCSI_SCAN_ASYNC is not set
28384 -CONFIG_SCSI_WAIT_SCAN=m
28385 -
28386 -#
28387 -# SCSI Transports
28388 -#
28389 -# CONFIG_SCSI_SPI_ATTRS is not set
28390 -# CONFIG_SCSI_FC_ATTRS is not set
28391 -# CONFIG_SCSI_ISCSI_ATTRS is not set
28392 -# CONFIG_SCSI_SAS_LIBSAS is not set
28393 -# CONFIG_SCSI_SRP_ATTRS is not set
28394 -CONFIG_SCSI_LOWLEVEL=y
28395 -# CONFIG_ISCSI_TCP is not set
28396 -# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
28397 -# CONFIG_SCSI_3W_9XXX is not set
28398 -# CONFIG_SCSI_ACARD is not set
28399 -# CONFIG_SCSI_AACRAID is not set
28400 -# CONFIG_SCSI_AIC7XXX is not set
28401 -# CONFIG_SCSI_AIC7XXX_OLD is not set
28402 -# CONFIG_SCSI_AIC79XX is not set
28403 -# CONFIG_SCSI_AIC94XX is not set
28404 -# CONFIG_SCSI_DPT_I2O is not set
28405 -# CONFIG_SCSI_ADVANSYS is not set
28406 -# CONFIG_SCSI_ARCMSR is not set
28407 -# CONFIG_MEGARAID_NEWGEN is not set
28408 -# CONFIG_MEGARAID_LEGACY is not set
28409 -# CONFIG_MEGARAID_SAS is not set
28410 -# CONFIG_SCSI_HPTIOP is not set
28411 -# CONFIG_SCSI_BUSLOGIC is not set
28412 -# CONFIG_SCSI_DMX3191D is not set
28413 -# CONFIG_SCSI_EATA is not set
28414 -# CONFIG_SCSI_FUTURE_DOMAIN is not set
28415 -# CONFIG_SCSI_GDTH is not set
28416 -# CONFIG_SCSI_IPS is not set
28417 -# CONFIG_SCSI_INITIO is not set
28418 -# CONFIG_SCSI_INIA100 is not set
28419 -# CONFIG_SCSI_STEX is not set
28420 -# CONFIG_SCSI_SYM53C8XX_2 is not set
28421 -# CONFIG_SCSI_IPR is not set
28422 -# CONFIG_SCSI_QLOGIC_1280 is not set
28423 -# CONFIG_SCSI_QLA_FC is not set
28424 -# CONFIG_SCSI_QLA_ISCSI is not set
28425 -# CONFIG_SCSI_LPFC is not set
28426 -# CONFIG_SCSI_DC395x is not set
28427 -# CONFIG_SCSI_DC390T is not set
28428 -# CONFIG_SCSI_NSP32 is not set
28429 -# CONFIG_SCSI_DEBUG is not set
28430 -# CONFIG_SCSI_SRP is not set
28431 -CONFIG_ATA=y
28432 -# CONFIG_ATA_NONSTANDARD is not set
28433 -# CONFIG_SATA_AHCI is not set
28434 -# CONFIG_SATA_SVW is not set
28435 -# CONFIG_ATA_PIIX is not set
28436 -# CONFIG_SATA_MV is not set
28437 -# CONFIG_SATA_NV is not set
28438 -# CONFIG_PDC_ADMA is not set
28439 -# CONFIG_SATA_QSTOR is not set
28440 -# CONFIG_SATA_PROMISE is not set
28441 -# CONFIG_SATA_SX4 is not set
28442 -# CONFIG_SATA_SIL is not set
28443 -# CONFIG_SATA_SIL24 is not set
28444 -# CONFIG_SATA_SIS is not set
28445 -# CONFIG_SATA_ULI is not set
28446 -# CONFIG_SATA_VIA is not set
28447 -# CONFIG_SATA_VITESSE is not set
28448 -# CONFIG_SATA_INIC162X is not set
28449 -# CONFIG_PATA_ALI is not set
28450 -# CONFIG_PATA_AMD is not set
28451 -# CONFIG_PATA_ARTOP is not set
28452 -# CONFIG_PATA_ATIIXP is not set
28453 -# CONFIG_PATA_CMD640_PCI is not set
28454 -# CONFIG_PATA_CMD64X is not set
28455 -# CONFIG_PATA_CS5520 is not set
28456 -# CONFIG_PATA_CS5530 is not set
28457 -# CONFIG_PATA_CYPRESS is not set
28458 -# CONFIG_PATA_EFAR is not set
28459 -# CONFIG_ATA_GENERIC is not set
28460 -# CONFIG_PATA_HPT366 is not set
28461 -# CONFIG_PATA_HPT37X is not set
28462 -# CONFIG_PATA_HPT3X2N is not set
28463 -# CONFIG_PATA_HPT3X3 is not set
28464 -# CONFIG_PATA_IT821X is not set
28465 -# CONFIG_PATA_IT8213 is not set
28466 -# CONFIG_PATA_JMICRON is not set
28467 -# CONFIG_PATA_TRIFLEX is not set
28468 -# CONFIG_PATA_MARVELL is not set
28469 -CONFIG_PATA_MPC52xx=y
28470 -# CONFIG_PATA_MPIIX is not set
28471 -# CONFIG_PATA_OLDPIIX is not set
28472 -# CONFIG_PATA_NETCELL is not set
28473 -# CONFIG_PATA_NS87410 is not set
28474 -# CONFIG_PATA_NS87415 is not set
28475 -# CONFIG_PATA_OPTI is not set
28476 -# CONFIG_PATA_OPTIDMA is not set
28477 -# CONFIG_PATA_PDC_OLD is not set
28478 -# CONFIG_PATA_RADISYS is not set
28479 -# CONFIG_PATA_RZ1000 is not set
28480 -# CONFIG_PATA_SC1200 is not set
28481 -# CONFIG_PATA_SERVERWORKS is not set
28482 -# CONFIG_PATA_PDC2027X is not set
28483 -# CONFIG_PATA_SIL680 is not set
28484 -# CONFIG_PATA_SIS is not set
28485 -# CONFIG_PATA_VIA is not set
28486 -# CONFIG_PATA_WINBOND is not set
28487 -# CONFIG_PATA_PLATFORM is not set
28488 -# CONFIG_MD is not set
28489 -# CONFIG_FUSION is not set
28490 -
28491 -#
28492 -# IEEE 1394 (FireWire) support
28493 -#
28494 -# CONFIG_FIREWIRE is not set
28495 -# CONFIG_IEEE1394 is not set
28496 -# CONFIG_I2O is not set
28497 -# CONFIG_MACINTOSH_DRIVERS is not set
28498 -CONFIG_NETDEVICES=y
28499 -# CONFIG_NETDEVICES_MULTIQUEUE is not set
28500 -# CONFIG_DUMMY is not set
28501 -# CONFIG_BONDING is not set
28502 -# CONFIG_MACVLAN is not set
28503 -# CONFIG_EQUALIZER is not set
28504 -# CONFIG_TUN is not set
28505 -# CONFIG_VETH is not set
28506 -# CONFIG_IP1000 is not set
28507 -# CONFIG_ARCNET is not set
28508 -# CONFIG_NET_ETHERNET is not set
28509 -CONFIG_NETDEV_1000=y
28510 -# CONFIG_ACENIC is not set
28511 -# CONFIG_DL2K is not set
28512 -# CONFIG_E1000 is not set
28513 -# CONFIG_E1000E is not set
28514 -# CONFIG_NS83820 is not set
28515 -# CONFIG_HAMACHI is not set
28516 -# CONFIG_YELLOWFIN is not set
28517 -# CONFIG_R8169 is not set
28518 -# CONFIG_SIS190 is not set
28519 -# CONFIG_SKGE is not set
28520 -# CONFIG_SKY2 is not set
28521 -# CONFIG_SK98LIN is not set
28522 -# CONFIG_VIA_VELOCITY is not set
28523 -# CONFIG_TIGON3 is not set
28524 -# CONFIG_BNX2 is not set
28525 -# CONFIG_MV643XX_ETH is not set
28526 -# CONFIG_QLA3XXX is not set
28527 -# CONFIG_ATL1 is not set
28528 -CONFIG_NETDEV_10000=y
28529 -# CONFIG_CHELSIO_T1 is not set
28530 -# CONFIG_CHELSIO_T3 is not set
28531 -# CONFIG_IXGBE is not set
28532 -# CONFIG_IXGB is not set
28533 -# CONFIG_S2IO is not set
28534 -# CONFIG_MYRI10GE is not set
28535 -# CONFIG_NETXEN_NIC is not set
28536 -# CONFIG_NIU is not set
28537 -# CONFIG_MLX4_CORE is not set
28538 -# CONFIG_TEHUTI is not set
28539 -# CONFIG_TR is not set
28540 -
28541 -#
28542 -# Wireless LAN
28543 -#
28544 -# CONFIG_WLAN_PRE80211 is not set
28545 -# CONFIG_WLAN_80211 is not set
28546 -# CONFIG_WAN is not set
28547 -# CONFIG_FDDI is not set
28548 -# CONFIG_HIPPI is not set
28549 -# CONFIG_PPP is not set
28550 -# CONFIG_SLIP is not set
28551 -# CONFIG_NET_FC is not set
28552 -# CONFIG_SHAPER is not set
28553 -# CONFIG_NETCONSOLE is not set
28554 -# CONFIG_NETPOLL is not set
28555 -# CONFIG_NET_POLL_CONTROLLER is not set
28556 -# CONFIG_ISDN is not set
28557 -# CONFIG_PHONE is not set
28558 -
28559 -#
28560 -# Input device support
28561 -#
28562 -# CONFIG_INPUT is not set
28563 -
28564 -#
28565 -# Hardware I/O ports
28566 -#
28567 -# CONFIG_SERIO is not set
28568 -# CONFIG_GAMEPORT is not set
28569 -
28570 -#
28571 -# Character devices
28572 -#
28573 -# CONFIG_VT is not set
28574 -# CONFIG_SERIAL_NONSTANDARD is not set
28575 -
28576 -#
28577 -# Serial drivers
28578 -#
28579 -# CONFIG_SERIAL_8250 is not set
28580 -
28581 -#
28582 -# Non-8250 serial port support
28583 -#
28584 -# CONFIG_SERIAL_UARTLITE is not set
28585 -CONFIG_SERIAL_CORE=y
28586 -CONFIG_SERIAL_CORE_CONSOLE=y
28587 -CONFIG_SERIAL_MPC52xx=y
28588 -CONFIG_SERIAL_MPC52xx_CONSOLE=y
28589 -CONFIG_SERIAL_MPC52xx_CONSOLE_BAUD=9600
28590 -# CONFIG_SERIAL_JSM is not set
28591 -CONFIG_UNIX98_PTYS=y
28592 -CONFIG_LEGACY_PTYS=y
28593 -CONFIG_LEGACY_PTY_COUNT=256
28594 -# CONFIG_IPMI_HANDLER is not set
28595 -# CONFIG_HW_RANDOM is not set
28596 -# CONFIG_NVRAM is not set
28597 -# CONFIG_GEN_RTC is not set
28598 -# CONFIG_R3964 is not set
28599 -# CONFIG_APPLICOM is not set
28600 -# CONFIG_RAW_DRIVER is not set
28601 -# CONFIG_TCG_TPM is not set
28602 -CONFIG_DEVPORT=y
28603 -# CONFIG_I2C is not set
28604 -
28605 -#
28606 -# SPI support
28607 -#
28608 -# CONFIG_SPI is not set
28609 -# CONFIG_SPI_MASTER is not set
28610 -# CONFIG_W1 is not set
28611 -# CONFIG_POWER_SUPPLY is not set
28612 -# CONFIG_HWMON is not set
28613 -# CONFIG_WATCHDOG is not set
28614 -
28615 -#
28616 -# Sonics Silicon Backplane
28617 -#
28618 -CONFIG_SSB_POSSIBLE=y
28619 -# CONFIG_SSB is not set
28620 -
28621 -#
28622 -# Multifunction device drivers
28623 -#
28624 -# CONFIG_MFD_SM501 is not set
28625 -
28626 -#
28627 -# Multimedia devices
28628 -#
28629 -# CONFIG_VIDEO_DEV is not set
28630 -# CONFIG_DVB_CORE is not set
28631 -# CONFIG_DAB is not set
28632 -
28633 -#
28634 -# Graphics support
28635 -#
28636 -# CONFIG_AGP is not set
28637 -# CONFIG_DRM is not set
28638 -# CONFIG_VGASTATE is not set
28639 -CONFIG_VIDEO_OUTPUT_CONTROL=m
28640 -# CONFIG_FB is not set
28641 -# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
28642 -
28643 -#
28644 -# Display device support
28645 -#
28646 -# CONFIG_DISPLAY_SUPPORT is not set
28647 -
28648 -#
28649 -# Sound
28650 -#
28651 -# CONFIG_SOUND is not set
28652 -CONFIG_USB_SUPPORT=y
28653 -CONFIG_USB_ARCH_HAS_HCD=y
28654 -CONFIG_USB_ARCH_HAS_OHCI=y
28655 -CONFIG_USB_ARCH_HAS_EHCI=y
28656 -# CONFIG_USB is not set
28657 -
28658 -#
28659 -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
28660 -#
28661 -
28662 -#
28663 -# USB Gadget Support
28664 -#
28665 -# CONFIG_USB_GADGET is not set
28666 -# CONFIG_MMC is not set
28667 -# CONFIG_NEW_LEDS is not set
28668 -# CONFIG_INFINIBAND is not set
28669 -# CONFIG_EDAC is not set
28670 -# CONFIG_RTC_CLASS is not set
28671 -
28672 -#
28673 -# Userspace I/O
28674 -#
28675 -# CONFIG_UIO is not set
28676 -
28677 -#
28678 -# File systems
28679 -#
28680 -CONFIG_EXT2_FS=y
28681 -# CONFIG_EXT2_FS_XATTR is not set
28682 -# CONFIG_EXT2_FS_XIP is not set
28683 -CONFIG_EXT3_FS=y
28684 -CONFIG_EXT3_FS_XATTR=y
28685 -# CONFIG_EXT3_FS_POSIX_ACL is not set
28686 -# CONFIG_EXT3_FS_SECURITY is not set
28687 -# CONFIG_EXT4DEV_FS is not set
28688 -CONFIG_JBD=y
28689 -CONFIG_FS_MBCACHE=y
28690 -# CONFIG_REISERFS_FS is not set
28691 -# CONFIG_JFS_FS is not set
28692 -# CONFIG_FS_POSIX_ACL is not set
28693 -# CONFIG_XFS_FS is not set
28694 -# CONFIG_GFS2_FS is not set
28695 -# CONFIG_OCFS2_FS is not set
28696 -# CONFIG_MINIX_FS is not set
28697 -# CONFIG_ROMFS_FS is not set
28698 -CONFIG_INOTIFY=y
28699 -CONFIG_INOTIFY_USER=y
28700 -# CONFIG_QUOTA is not set
28701 -CONFIG_DNOTIFY=y
28702 -# CONFIG_AUTOFS_FS is not set
28703 -# CONFIG_AUTOFS4_FS is not set
28704 -# CONFIG_FUSE_FS is not set
28705 -
28706 -#
28707 -# CD-ROM/DVD Filesystems
28708 -#
28709 -# CONFIG_ISO9660_FS is not set
28710 -# CONFIG_UDF_FS is not set
28711 -
28712 -#
28713 -# DOS/FAT/NT Filesystems
28714 -#
28715 -# CONFIG_MSDOS_FS is not set
28716 -# CONFIG_VFAT_FS is not set
28717 -# CONFIG_NTFS_FS is not set
28718 -
28719 -#
28720 -# Pseudo filesystems
28721 -#
28722 -CONFIG_PROC_FS=y
28723 -CONFIG_PROC_KCORE=y
28724 -CONFIG_PROC_SYSCTL=y
28725 -CONFIG_SYSFS=y
28726 -CONFIG_TMPFS=y
28727 -# CONFIG_TMPFS_POSIX_ACL is not set
28728 -# CONFIG_HUGETLB_PAGE is not set
28729 -# CONFIG_CONFIGFS_FS is not set
28730 -
28731 -#
28732 -# Miscellaneous filesystems
28733 -#
28734 -# CONFIG_ADFS_FS is not set
28735 -# CONFIG_AFFS_FS is not set
28736 -# CONFIG_HFS_FS is not set
28737 -# CONFIG_HFSPLUS_FS is not set
28738 -# CONFIG_BEFS_FS is not set
28739 -# CONFIG_BFS_FS is not set
28740 -# CONFIG_EFS_FS is not set
28741 -# CONFIG_CRAMFS is not set
28742 -# CONFIG_VXFS_FS is not set
28743 -# CONFIG_HPFS_FS is not set
28744 -# CONFIG_QNX4FS_FS is not set
28745 -# CONFIG_SYSV_FS is not set
28746 -# CONFIG_UFS_FS is not set
28747 -CONFIG_NETWORK_FILESYSTEMS=y
28748 -# CONFIG_NFS_FS is not set
28749 -# CONFIG_NFSD is not set
28750 -# CONFIG_SMB_FS is not set
28751 -# CONFIG_CIFS is not set
28752 -# CONFIG_NCP_FS is not set
28753 -# CONFIG_CODA_FS is not set
28754 -# CONFIG_AFS_FS is not set
28755 -
28756 -#
28757 -# Partition Types
28758 -#
28759 -# CONFIG_PARTITION_ADVANCED is not set
28760 -CONFIG_MSDOS_PARTITION=y
28761 -# CONFIG_NLS is not set
28762 -# CONFIG_DLM is not set
28763 -# CONFIG_UCC_SLOW is not set
28764 -
28765 -#
28766 -# Library routines
28767 -#
28768 -# CONFIG_CRC_CCITT is not set
28769 -# CONFIG_CRC16 is not set
28770 -# CONFIG_CRC_ITU_T is not set
28771 -# CONFIG_CRC32 is not set
28772 -# CONFIG_CRC7 is not set
28773 -# CONFIG_LIBCRC32C is not set
28774 -CONFIG_PLIST=y
28775 -CONFIG_HAS_IOMEM=y
28776 -CONFIG_HAS_IOPORT=y
28777 -CONFIG_HAS_DMA=y
28778 -# CONFIG_INSTRUMENTATION is not set
28779 -
28780 -#
28781 -# Kernel hacking
28782 -#
28783 -CONFIG_PRINTK_TIME=y
28784 -CONFIG_ENABLE_WARN_DEPRECATED=y
28785 -CONFIG_ENABLE_MUST_CHECK=y
28786 -# CONFIG_MAGIC_SYSRQ is not set
28787 -# CONFIG_UNUSED_SYMBOLS is not set
28788 -# CONFIG_DEBUG_FS is not set
28789 -# CONFIG_HEADERS_CHECK is not set
28790 -CONFIG_DEBUG_KERNEL=y
28791 -# CONFIG_DEBUG_SHIRQ is not set
28792 -CONFIG_DETECT_SOFTLOCKUP=y
28793 -CONFIG_SCHED_DEBUG=y
28794 -# CONFIG_SCHEDSTATS is not set
28795 -# CONFIG_TIMER_STATS is not set
28796 -# CONFIG_SLUB_DEBUG_ON is not set
28797 -# CONFIG_DEBUG_RT_MUTEXES is not set
28798 -# CONFIG_RT_MUTEX_TESTER is not set
28799 -# CONFIG_DEBUG_SPINLOCK is not set
28800 -# CONFIG_DEBUG_MUTEXES is not set
28801 -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
28802 -# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
28803 -# CONFIG_DEBUG_KOBJECT is not set
28804 -# CONFIG_DEBUG_BUGVERBOSE is not set
28805 -CONFIG_DEBUG_INFO=y
28806 -# CONFIG_DEBUG_VM is not set
28807 -# CONFIG_DEBUG_LIST is not set
28808 -# CONFIG_DEBUG_SG is not set
28809 -CONFIG_FORCED_INLINING=y
28810 -# CONFIG_BOOT_PRINTK_DELAY is not set
28811 -# CONFIG_RCU_TORTURE_TEST is not set
28812 -# CONFIG_FAULT_INJECTION is not set
28813 -# CONFIG_SAMPLES is not set
28814 -# CONFIG_DEBUG_STACKOVERFLOW is not set
28815 -# CONFIG_DEBUG_STACK_USAGE is not set
28816 -# CONFIG_DEBUG_PAGEALLOC is not set
28817 -# CONFIG_DEBUGGER is not set
28818 -# CONFIG_BDI_SWITCH is not set
28819 -# CONFIG_BOOTX_TEXT is not set
28820 -# CONFIG_PPC_EARLY_DEBUG is not set
28821 -
28822 -#
28823 -# Security options
28824 -#
28825 -# CONFIG_KEYS is not set
28826 -# CONFIG_SECURITY is not set
28827 -# CONFIG_SECURITY_FILE_CAPABILITIES is not set
28828 -# CONFIG_CRYPTO is not set
28829 -CONFIG_PPC_CLOCK=y
28830 -CONFIG_PPC_LIB_RHEAP=y
28831 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/configs/makalu_defconfig powerpc.git/arch/powerpc/configs/makalu_defconfig
28832 --- linux-2.6.24/arch/powerpc/configs/makalu_defconfig  1970-01-01 01:00:00.000000000 +0100
28833 +++ powerpc.git/arch/powerpc/configs/makalu_defconfig   2008-01-28 20:25:49.000000000 +0100
28834 @@ -0,0 +1,812 @@
28835 +#
28836 +# Automatically generated make config: don't edit
28837 +# Linux kernel version: 2.6.24-rc6
28838 +# Mon Dec 24 11:18:32 2007
28839 +#
28840 +# CONFIG_PPC64 is not set
28841 +
28842 +#
28843 +# Processor support
28844 +#
28845 +# CONFIG_6xx is not set
28846 +# CONFIG_PPC_85xx is not set
28847 +# CONFIG_PPC_8xx is not set
28848 +CONFIG_40x=y
28849 +# CONFIG_44x is not set
28850 +# CONFIG_E200 is not set
28851 +CONFIG_4xx=y
28852 +# CONFIG_PPC_MM_SLICES is not set
28853 +CONFIG_NOT_COHERENT_CACHE=y
28854 +CONFIG_PPC32=y
28855 +CONFIG_WORD_SIZE=32
28856 +CONFIG_PPC_MERGE=y
28857 +CONFIG_MMU=y
28858 +CONFIG_GENERIC_CMOS_UPDATE=y
28859 +CONFIG_GENERIC_TIME=y
28860 +CONFIG_GENERIC_TIME_VSYSCALL=y
28861 +CONFIG_GENERIC_CLOCKEVENTS=y
28862 +CONFIG_GENERIC_HARDIRQS=y
28863 +CONFIG_IRQ_PER_CPU=y
28864 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
28865 +CONFIG_ARCH_HAS_ILOG2_U32=y
28866 +CONFIG_GENERIC_HWEIGHT=y
28867 +CONFIG_GENERIC_CALIBRATE_DELAY=y
28868 +CONFIG_GENERIC_FIND_NEXT_BIT=y
28869 +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
28870 +CONFIG_PPC=y
28871 +CONFIG_EARLY_PRINTK=y
28872 +CONFIG_GENERIC_NVRAM=y
28873 +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
28874 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
28875 +CONFIG_PPC_OF=y
28876 +CONFIG_OF=y
28877 +CONFIG_PPC_UDBG_16550=y
28878 +# CONFIG_GENERIC_TBSYNC is not set
28879 +CONFIG_AUDIT_ARCH=y
28880 +CONFIG_GENERIC_BUG=y
28881 +# CONFIG_DEFAULT_UIMAGE is not set
28882 +CONFIG_PPC_DCR_NATIVE=y
28883 +# CONFIG_PPC_DCR_MMIO is not set
28884 +CONFIG_PPC_DCR=y
28885 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
28886 +
28887 +#
28888 +# General setup
28889 +#
28890 +CONFIG_EXPERIMENTAL=y
28891 +CONFIG_BROKEN_ON_SMP=y
28892 +CONFIG_INIT_ENV_ARG_LIMIT=32
28893 +CONFIG_LOCALVERSION=""
28894 +CONFIG_LOCALVERSION_AUTO=y
28895 +CONFIG_SWAP=y
28896 +CONFIG_SYSVIPC=y
28897 +CONFIG_SYSVIPC_SYSCTL=y
28898 +CONFIG_POSIX_MQUEUE=y
28899 +# CONFIG_BSD_PROCESS_ACCT is not set
28900 +# CONFIG_TASKSTATS is not set
28901 +# CONFIG_USER_NS is not set
28902 +# CONFIG_PID_NS is not set
28903 +# CONFIG_AUDIT is not set
28904 +# CONFIG_IKCONFIG is not set
28905 +CONFIG_LOG_BUF_SHIFT=14
28906 +# CONFIG_CGROUPS is not set
28907 +# CONFIG_FAIR_GROUP_SCHED is not set
28908 +CONFIG_SYSFS_DEPRECATED=y
28909 +# CONFIG_RELAY is not set
28910 +CONFIG_BLK_DEV_INITRD=y
28911 +CONFIG_INITRAMFS_SOURCE=""
28912 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
28913 +CONFIG_SYSCTL=y
28914 +CONFIG_EMBEDDED=y
28915 +CONFIG_SYSCTL_SYSCALL=y
28916 +CONFIG_KALLSYMS=y
28917 +CONFIG_KALLSYMS_ALL=y
28918 +CONFIG_KALLSYMS_EXTRA_PASS=y
28919 +CONFIG_HOTPLUG=y
28920 +CONFIG_PRINTK=y
28921 +CONFIG_BUG=y
28922 +CONFIG_ELF_CORE=y
28923 +CONFIG_BASE_FULL=y
28924 +CONFIG_FUTEX=y
28925 +CONFIG_ANON_INODES=y
28926 +CONFIG_EPOLL=y
28927 +CONFIG_SIGNALFD=y
28928 +CONFIG_EVENTFD=y
28929 +CONFIG_SHMEM=y
28930 +CONFIG_VM_EVENT_COUNTERS=y
28931 +CONFIG_SLUB_DEBUG=y
28932 +# CONFIG_SLAB is not set
28933 +CONFIG_SLUB=y
28934 +# CONFIG_SLOB is not set
28935 +CONFIG_RT_MUTEXES=y
28936 +# CONFIG_TINY_SHMEM is not set
28937 +CONFIG_BASE_SMALL=0
28938 +CONFIG_MODULES=y
28939 +CONFIG_MODULE_UNLOAD=y
28940 +# CONFIG_MODULE_FORCE_UNLOAD is not set
28941 +# CONFIG_MODVERSIONS is not set
28942 +# CONFIG_MODULE_SRCVERSION_ALL is not set
28943 +CONFIG_KMOD=y
28944 +CONFIG_BLOCK=y
28945 +CONFIG_LBD=y
28946 +# CONFIG_BLK_DEV_IO_TRACE is not set
28947 +# CONFIG_LSF is not set
28948 +# CONFIG_BLK_DEV_BSG is not set
28949 +
28950 +#
28951 +# IO Schedulers
28952 +#
28953 +CONFIG_IOSCHED_NOOP=y
28954 +CONFIG_IOSCHED_AS=y
28955 +CONFIG_IOSCHED_DEADLINE=y
28956 +CONFIG_IOSCHED_CFQ=y
28957 +CONFIG_DEFAULT_AS=y
28958 +# CONFIG_DEFAULT_DEADLINE is not set
28959 +# CONFIG_DEFAULT_CFQ is not set
28960 +# CONFIG_DEFAULT_NOOP is not set
28961 +CONFIG_DEFAULT_IOSCHED="anticipatory"
28962 +CONFIG_PPC4xx_PCI_EXPRESS=y
28963 +
28964 +#
28965 +# Platform support
28966 +#
28967 +# CONFIG_PPC_MPC52xx is not set
28968 +# CONFIG_PPC_MPC5200 is not set
28969 +# CONFIG_PPC_CELL is not set
28970 +# CONFIG_PPC_CELL_NATIVE is not set
28971 +# CONFIG_PQ2ADS is not set
28972 +# CONFIG_EP405 is not set
28973 +# CONFIG_KILAUEA is not set
28974 +CONFIG_MAKALU=y
28975 +# CONFIG_WALNUT is not set
28976 +# CONFIG_XILINX_VIRTEX_GENERIC_BOARD is not set
28977 +CONFIG_405EX=y
28978 +# CONFIG_MPIC is not set
28979 +# CONFIG_MPIC_WEIRD is not set
28980 +# CONFIG_PPC_I8259 is not set
28981 +# CONFIG_PPC_RTAS is not set
28982 +# CONFIG_MMIO_NVRAM is not set
28983 +# CONFIG_PPC_MPC106 is not set
28984 +# CONFIG_PPC_970_NAP is not set
28985 +# CONFIG_PPC_INDIRECT_IO is not set
28986 +# CONFIG_GENERIC_IOMAP is not set
28987 +# CONFIG_CPU_FREQ is not set
28988 +# CONFIG_CPM2 is not set
28989 +# CONFIG_FSL_ULI1575 is not set
28990 +
28991 +#
28992 +# Kernel options
28993 +#
28994 +# CONFIG_HIGHMEM is not set
28995 +# CONFIG_TICK_ONESHOT is not set
28996 +# CONFIG_NO_HZ is not set
28997 +# CONFIG_HIGH_RES_TIMERS is not set
28998 +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
28999 +# CONFIG_HZ_100 is not set
29000 +CONFIG_HZ_250=y
29001 +# CONFIG_HZ_300 is not set
29002 +# CONFIG_HZ_1000 is not set
29003 +CONFIG_HZ=250
29004 +CONFIG_PREEMPT_NONE=y
29005 +# CONFIG_PREEMPT_VOLUNTARY is not set
29006 +# CONFIG_PREEMPT is not set
29007 +CONFIG_BINFMT_ELF=y
29008 +# CONFIG_BINFMT_MISC is not set
29009 +# CONFIG_MATH_EMULATION is not set
29010 +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
29011 +CONFIG_ARCH_FLATMEM_ENABLE=y
29012 +CONFIG_ARCH_POPULATES_NODE_MAP=y
29013 +CONFIG_SELECT_MEMORY_MODEL=y
29014 +CONFIG_FLATMEM_MANUAL=y
29015 +# CONFIG_DISCONTIGMEM_MANUAL is not set
29016 +# CONFIG_SPARSEMEM_MANUAL is not set
29017 +CONFIG_FLATMEM=y
29018 +CONFIG_FLAT_NODE_MEM_MAP=y
29019 +# CONFIG_SPARSEMEM_STATIC is not set
29020 +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
29021 +CONFIG_SPLIT_PTLOCK_CPUS=4
29022 +# CONFIG_RESOURCES_64BIT is not set
29023 +CONFIG_ZONE_DMA_FLAG=1
29024 +CONFIG_BOUNCE=y
29025 +CONFIG_VIRT_TO_BUS=y
29026 +CONFIG_PROC_DEVICETREE=y
29027 +# CONFIG_CMDLINE_BOOL is not set
29028 +# CONFIG_PM is not set
29029 +CONFIG_SUSPEND_UP_POSSIBLE=y
29030 +CONFIG_HIBERNATION_UP_POSSIBLE=y
29031 +CONFIG_SECCOMP=y
29032 +CONFIG_WANT_DEVICE_TREE=y
29033 +CONFIG_DEVICE_TREE="kilauea.dts"
29034 +CONFIG_ISA_DMA_API=y
29035 +
29036 +#
29037 +# Bus options
29038 +#
29039 +CONFIG_ZONE_DMA=y
29040 +CONFIG_PPC_INDIRECT_PCI=y
29041 +CONFIG_PCI=y
29042 +CONFIG_PCI_DOMAINS=y
29043 +CONFIG_PCI_SYSCALL=y
29044 +# CONFIG_PCIEPORTBUS is not set
29045 +CONFIG_ARCH_SUPPORTS_MSI=y
29046 +# CONFIG_PCI_MSI is not set
29047 +CONFIG_PCI_LEGACY=y
29048 +# CONFIG_PCI_DEBUG is not set
29049 +# CONFIG_PCCARD is not set
29050 +# CONFIG_HOTPLUG_PCI is not set
29051 +
29052 +#
29053 +# Advanced setup
29054 +#
29055 +# CONFIG_ADVANCED_OPTIONS is not set
29056 +
29057 +#
29058 +# Default settings for advanced configuration options are used
29059 +#
29060 +CONFIG_HIGHMEM_START=0xfe000000
29061 +CONFIG_LOWMEM_SIZE=0x30000000
29062 +CONFIG_KERNEL_START=0xc0000000
29063 +CONFIG_TASK_SIZE=0xc0000000
29064 +CONFIG_CONSISTENT_START=0xff100000
29065 +CONFIG_CONSISTENT_SIZE=0x00200000
29066 +CONFIG_BOOT_LOAD=0x00400000
29067 +
29068 +#
29069 +# Networking
29070 +#
29071 +CONFIG_NET=y
29072 +
29073 +#
29074 +# Networking options
29075 +#
29076 +CONFIG_PACKET=y
29077 +# CONFIG_PACKET_MMAP is not set
29078 +CONFIG_UNIX=y
29079 +# CONFIG_NET_KEY is not set
29080 +CONFIG_INET=y
29081 +# CONFIG_IP_MULTICAST is not set
29082 +# CONFIG_IP_ADVANCED_ROUTER is not set
29083 +CONFIG_IP_FIB_HASH=y
29084 +CONFIG_IP_PNP=y
29085 +CONFIG_IP_PNP_DHCP=y
29086 +CONFIG_IP_PNP_BOOTP=y
29087 +# CONFIG_IP_PNP_RARP is not set
29088 +# CONFIG_NET_IPIP is not set
29089 +# CONFIG_NET_IPGRE is not set
29090 +# CONFIG_ARPD is not set
29091 +# CONFIG_SYN_COOKIES is not set
29092 +# CONFIG_INET_AH is not set
29093 +# CONFIG_INET_ESP is not set
29094 +# CONFIG_INET_IPCOMP is not set
29095 +# CONFIG_INET_XFRM_TUNNEL is not set
29096 +# CONFIG_INET_TUNNEL is not set
29097 +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
29098 +# CONFIG_INET_XFRM_MODE_TUNNEL is not set
29099 +# CONFIG_INET_XFRM_MODE_BEET is not set
29100 +# CONFIG_INET_LRO is not set
29101 +CONFIG_INET_DIAG=y
29102 +CONFIG_INET_TCP_DIAG=y
29103 +# CONFIG_TCP_CONG_ADVANCED is not set
29104 +CONFIG_TCP_CONG_CUBIC=y
29105 +CONFIG_DEFAULT_TCP_CONG="cubic"
29106 +# CONFIG_TCP_MD5SIG is not set
29107 +# CONFIG_IPV6 is not set
29108 +# CONFIG_INET6_XFRM_TUNNEL is not set
29109 +# CONFIG_INET6_TUNNEL is not set
29110 +# CONFIG_NETWORK_SECMARK is not set
29111 +# CONFIG_NETFILTER is not set
29112 +# CONFIG_IP_DCCP is not set
29113 +# CONFIG_IP_SCTP is not set
29114 +# CONFIG_TIPC is not set
29115 +# CONFIG_ATM is not set
29116 +# CONFIG_BRIDGE is not set
29117 +# CONFIG_VLAN_8021Q is not set
29118 +# CONFIG_DECNET is not set
29119 +# CONFIG_LLC2 is not set
29120 +# CONFIG_IPX is not set
29121 +# CONFIG_ATALK is not set
29122 +# CONFIG_X25 is not set
29123 +# CONFIG_LAPB is not set
29124 +# CONFIG_ECONET is not set
29125 +# CONFIG_WAN_ROUTER is not set
29126 +# CONFIG_NET_SCHED is not set
29127 +
29128 +#
29129 +# Network testing
29130 +#
29131 +# CONFIG_NET_PKTGEN is not set
29132 +# CONFIG_HAMRADIO is not set
29133 +# CONFIG_IRDA is not set
29134 +# CONFIG_BT is not set
29135 +# CONFIG_AF_RXRPC is not set
29136 +
29137 +#
29138 +# Wireless
29139 +#
29140 +# CONFIG_CFG80211 is not set
29141 +# CONFIG_WIRELESS_EXT is not set
29142 +# CONFIG_MAC80211 is not set
29143 +# CONFIG_IEEE80211 is not set
29144 +# CONFIG_RFKILL is not set
29145 +# CONFIG_NET_9P is not set
29146 +
29147 +#
29148 +# Device Drivers
29149 +#
29150 +
29151 +#
29152 +# Generic Driver Options
29153 +#
29154 +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
29155 +CONFIG_STANDALONE=y
29156 +CONFIG_PREVENT_FIRMWARE_BUILD=y
29157 +CONFIG_FW_LOADER=y
29158 +# CONFIG_DEBUG_DRIVER is not set
29159 +# CONFIG_DEBUG_DEVRES is not set
29160 +# CONFIG_SYS_HYPERVISOR is not set
29161 +CONFIG_CONNECTOR=y
29162 +CONFIG_PROC_EVENTS=y
29163 +CONFIG_MTD=y
29164 +# CONFIG_MTD_DEBUG is not set
29165 +# CONFIG_MTD_CONCAT is not set
29166 +CONFIG_MTD_PARTITIONS=y
29167 +# CONFIG_MTD_REDBOOT_PARTS is not set
29168 +CONFIG_MTD_CMDLINE_PARTS=y
29169 +
29170 +#
29171 +# User Modules And Translation Layers
29172 +#
29173 +CONFIG_MTD_CHAR=y
29174 +CONFIG_MTD_BLKDEVS=m
29175 +CONFIG_MTD_BLOCK=m
29176 +# CONFIG_MTD_BLOCK_RO is not set
29177 +# CONFIG_FTL is not set
29178 +# CONFIG_NFTL is not set
29179 +# CONFIG_INFTL is not set
29180 +# CONFIG_RFD_FTL is not set
29181 +# CONFIG_SSFDC is not set
29182 +# CONFIG_MTD_OOPS is not set
29183 +
29184 +#
29185 +# RAM/ROM/Flash chip drivers
29186 +#
29187 +CONFIG_MTD_CFI=y
29188 +CONFIG_MTD_JEDECPROBE=y
29189 +CONFIG_MTD_GEN_PROBE=y
29190 +# CONFIG_MTD_CFI_ADV_OPTIONS is not set
29191 +CONFIG_MTD_MAP_BANK_WIDTH_1=y
29192 +CONFIG_MTD_MAP_BANK_WIDTH_2=y
29193 +CONFIG_MTD_MAP_BANK_WIDTH_4=y
29194 +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
29195 +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
29196 +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
29197 +CONFIG_MTD_CFI_I1=y
29198 +CONFIG_MTD_CFI_I2=y
29199 +# CONFIG_MTD_CFI_I4 is not set
29200 +# CONFIG_MTD_CFI_I8 is not set
29201 +# CONFIG_MTD_CFI_INTELEXT is not set
29202 +CONFIG_MTD_CFI_AMDSTD=y
29203 +# CONFIG_MTD_CFI_STAA is not set
29204 +CONFIG_MTD_CFI_UTIL=y
29205 +# CONFIG_MTD_RAM is not set
29206 +# CONFIG_MTD_ROM is not set
29207 +# CONFIG_MTD_ABSENT is not set
29208 +
29209 +#
29210 +# Mapping drivers for chip access
29211 +#
29212 +# CONFIG_MTD_COMPLEX_MAPPINGS is not set
29213 +# CONFIG_MTD_PHYSMAP is not set
29214 +CONFIG_MTD_PHYSMAP_OF=y
29215 +# CONFIG_MTD_INTEL_VR_NOR is not set
29216 +# CONFIG_MTD_PLATRAM is not set
29217 +
29218 +#
29219 +# Self-contained MTD device drivers
29220 +#
29221 +# CONFIG_MTD_PMC551 is not set
29222 +# CONFIG_MTD_SLRAM is not set
29223 +# CONFIG_MTD_PHRAM is not set
29224 +# CONFIG_MTD_MTDRAM is not set
29225 +# CONFIG_MTD_BLOCK2MTD is not set
29226 +
29227 +#
29228 +# Disk-On-Chip Device Drivers
29229 +#
29230 +# CONFIG_MTD_DOC2000 is not set
29231 +# CONFIG_MTD_DOC2001 is not set
29232 +# CONFIG_MTD_DOC2001PLUS is not set
29233 +# CONFIG_MTD_NAND is not set
29234 +# CONFIG_MTD_ONENAND is not set
29235 +
29236 +#
29237 +# UBI - Unsorted block images
29238 +#
29239 +# CONFIG_MTD_UBI is not set
29240 +CONFIG_OF_DEVICE=y
29241 +# CONFIG_PARPORT is not set
29242 +CONFIG_BLK_DEV=y
29243 +# CONFIG_BLK_DEV_FD is not set
29244 +# CONFIG_BLK_CPQ_DA is not set
29245 +# CONFIG_BLK_CPQ_CISS_DA is not set
29246 +# CONFIG_BLK_DEV_DAC960 is not set
29247 +# CONFIG_BLK_DEV_UMEM is not set
29248 +# CONFIG_BLK_DEV_COW_COMMON is not set
29249 +# CONFIG_BLK_DEV_LOOP is not set
29250 +# CONFIG_BLK_DEV_NBD is not set
29251 +# CONFIG_BLK_DEV_SX8 is not set
29252 +CONFIG_BLK_DEV_RAM=y
29253 +CONFIG_BLK_DEV_RAM_COUNT=16
29254 +CONFIG_BLK_DEV_RAM_SIZE=35000
29255 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
29256 +# CONFIG_CDROM_PKTCDVD is not set
29257 +# CONFIG_ATA_OVER_ETH is not set
29258 +# CONFIG_XILINX_SYSACE is not set
29259 +# CONFIG_MISC_DEVICES is not set
29260 +# CONFIG_IDE is not set
29261 +
29262 +#
29263 +# SCSI device support
29264 +#
29265 +# CONFIG_RAID_ATTRS is not set
29266 +# CONFIG_SCSI is not set
29267 +# CONFIG_SCSI_DMA is not set
29268 +# CONFIG_SCSI_NETLINK is not set
29269 +# CONFIG_ATA is not set
29270 +# CONFIG_MD is not set
29271 +# CONFIG_FUSION is not set
29272 +
29273 +#
29274 +# IEEE 1394 (FireWire) support
29275 +#
29276 +# CONFIG_FIREWIRE is not set
29277 +# CONFIG_IEEE1394 is not set
29278 +# CONFIG_I2O is not set
29279 +# CONFIG_MACINTOSH_DRIVERS is not set
29280 +CONFIG_NETDEVICES=y
29281 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
29282 +# CONFIG_DUMMY is not set
29283 +# CONFIG_BONDING is not set
29284 +# CONFIG_MACVLAN is not set
29285 +# CONFIG_EQUALIZER is not set
29286 +# CONFIG_TUN is not set
29287 +# CONFIG_VETH is not set
29288 +# CONFIG_IP1000 is not set
29289 +# CONFIG_ARCNET is not set
29290 +# CONFIG_PHYLIB is not set
29291 +CONFIG_NET_ETHERNET=y
29292 +# CONFIG_MII is not set
29293 +# CONFIG_HAPPYMEAL is not set
29294 +# CONFIG_SUNGEM is not set
29295 +# CONFIG_CASSINI is not set
29296 +# CONFIG_NET_VENDOR_3COM is not set
29297 +# CONFIG_NET_TULIP is not set
29298 +# CONFIG_HP100 is not set
29299 +CONFIG_IBM_NEW_EMAC=y
29300 +CONFIG_IBM_NEW_EMAC_RXB=256
29301 +CONFIG_IBM_NEW_EMAC_TXB=256
29302 +CONFIG_IBM_NEW_EMAC_POLL_WEIGHT=32
29303 +CONFIG_IBM_NEW_EMAC_RX_COPY_THRESHOLD=256
29304 +CONFIG_IBM_NEW_EMAC_RX_SKB_HEADROOM=0
29305 +# CONFIG_IBM_NEW_EMAC_DEBUG is not set
29306 +# CONFIG_IBM_NEW_EMAC_ZMII is not set
29307 +CONFIG_IBM_NEW_EMAC_RGMII=y
29308 +# CONFIG_IBM_NEW_EMAC_TAH is not set
29309 +CONFIG_IBM_NEW_EMAC_EMAC4=y
29310 +# CONFIG_NET_PCI is not set
29311 +# CONFIG_B44 is not set
29312 +# CONFIG_NETDEV_1000 is not set
29313 +# CONFIG_NETDEV_10000 is not set
29314 +# CONFIG_TR is not set
29315 +
29316 +#
29317 +# Wireless LAN
29318 +#
29319 +# CONFIG_WLAN_PRE80211 is not set
29320 +# CONFIG_WLAN_80211 is not set
29321 +# CONFIG_WAN is not set
29322 +# CONFIG_FDDI is not set
29323 +# CONFIG_HIPPI is not set
29324 +# CONFIG_PPP is not set
29325 +# CONFIG_SLIP is not set
29326 +# CONFIG_SHAPER is not set
29327 +# CONFIG_NETCONSOLE is not set
29328 +# CONFIG_NETPOLL is not set
29329 +# CONFIG_NET_POLL_CONTROLLER is not set
29330 +# CONFIG_ISDN is not set
29331 +# CONFIG_PHONE is not set
29332 +
29333 +#
29334 +# Input device support
29335 +#
29336 +# CONFIG_INPUT is not set
29337 +
29338 +#
29339 +# Hardware I/O ports
29340 +#
29341 +# CONFIG_SERIO is not set
29342 +# CONFIG_GAMEPORT is not set
29343 +
29344 +#
29345 +# Character devices
29346 +#
29347 +# CONFIG_VT is not set
29348 +# CONFIG_SERIAL_NONSTANDARD is not set
29349 +
29350 +#
29351 +# Serial drivers
29352 +#
29353 +CONFIG_SERIAL_8250=y
29354 +CONFIG_SERIAL_8250_CONSOLE=y
29355 +CONFIG_SERIAL_8250_PCI=y
29356 +CONFIG_SERIAL_8250_NR_UARTS=4
29357 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4
29358 +CONFIG_SERIAL_8250_EXTENDED=y
29359 +# CONFIG_SERIAL_8250_MANY_PORTS is not set
29360 +CONFIG_SERIAL_8250_SHARE_IRQ=y
29361 +# CONFIG_SERIAL_8250_DETECT_IRQ is not set
29362 +# CONFIG_SERIAL_8250_RSA is not set
29363 +
29364 +#
29365 +# Non-8250 serial port support
29366 +#
29367 +# CONFIG_SERIAL_UARTLITE is not set
29368 +CONFIG_SERIAL_CORE=y
29369 +CONFIG_SERIAL_CORE_CONSOLE=y
29370 +# CONFIG_SERIAL_JSM is not set
29371 +CONFIG_SERIAL_OF_PLATFORM=y
29372 +CONFIG_UNIX98_PTYS=y
29373 +CONFIG_LEGACY_PTYS=y
29374 +CONFIG_LEGACY_PTY_COUNT=256
29375 +# CONFIG_IPMI_HANDLER is not set
29376 +# CONFIG_HW_RANDOM is not set
29377 +# CONFIG_NVRAM is not set
29378 +# CONFIG_GEN_RTC is not set
29379 +# CONFIG_R3964 is not set
29380 +# CONFIG_APPLICOM is not set
29381 +# CONFIG_RAW_DRIVER is not set
29382 +# CONFIG_TCG_TPM is not set
29383 +CONFIG_DEVPORT=y
29384 +# CONFIG_I2C is not set
29385 +
29386 +#
29387 +# SPI support
29388 +#
29389 +# CONFIG_SPI is not set
29390 +# CONFIG_SPI_MASTER is not set
29391 +# CONFIG_W1 is not set
29392 +# CONFIG_POWER_SUPPLY is not set
29393 +# CONFIG_HWMON is not set
29394 +# CONFIG_WATCHDOG is not set
29395 +
29396 +#
29397 +# Sonics Silicon Backplane
29398 +#
29399 +CONFIG_SSB_POSSIBLE=y
29400 +# CONFIG_SSB is not set
29401 +
29402 +#
29403 +# Multifunction device drivers
29404 +#
29405 +# CONFIG_MFD_SM501 is not set
29406 +
29407 +#
29408 +# Multimedia devices
29409 +#
29410 +# CONFIG_VIDEO_DEV is not set
29411 +# CONFIG_DVB_CORE is not set
29412 +# CONFIG_DAB is not set
29413 +
29414 +#
29415 +# Graphics support
29416 +#
29417 +# CONFIG_AGP is not set
29418 +# CONFIG_DRM is not set
29419 +# CONFIG_VGASTATE is not set
29420 +# CONFIG_VIDEO_OUTPUT_CONTROL is not set
29421 +# CONFIG_FB is not set
29422 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
29423 +
29424 +#
29425 +# Display device support
29426 +#
29427 +# CONFIG_DISPLAY_SUPPORT is not set
29428 +
29429 +#
29430 +# Sound
29431 +#
29432 +# CONFIG_SOUND is not set
29433 +# CONFIG_USB_SUPPORT is not set
29434 +# CONFIG_MMC is not set
29435 +# CONFIG_NEW_LEDS is not set
29436 +# CONFIG_INFINIBAND is not set
29437 +# CONFIG_EDAC is not set
29438 +# CONFIG_RTC_CLASS is not set
29439 +
29440 +#
29441 +# Userspace I/O
29442 +#
29443 +# CONFIG_UIO is not set
29444 +
29445 +#
29446 +# File systems
29447 +#
29448 +CONFIG_EXT2_FS=y
29449 +# CONFIG_EXT2_FS_XATTR is not set
29450 +# CONFIG_EXT2_FS_XIP is not set
29451 +# CONFIG_EXT3_FS is not set
29452 +# CONFIG_EXT4DEV_FS is not set
29453 +# CONFIG_REISERFS_FS is not set
29454 +# CONFIG_JFS_FS is not set
29455 +# CONFIG_FS_POSIX_ACL is not set
29456 +# CONFIG_XFS_FS is not set
29457 +# CONFIG_GFS2_FS is not set
29458 +# CONFIG_OCFS2_FS is not set
29459 +# CONFIG_MINIX_FS is not set
29460 +# CONFIG_ROMFS_FS is not set
29461 +CONFIG_INOTIFY=y
29462 +CONFIG_INOTIFY_USER=y
29463 +# CONFIG_QUOTA is not set
29464 +CONFIG_DNOTIFY=y
29465 +# CONFIG_AUTOFS_FS is not set
29466 +# CONFIG_AUTOFS4_FS is not set
29467 +# CONFIG_FUSE_FS is not set
29468 +
29469 +#
29470 +# CD-ROM/DVD Filesystems
29471 +#
29472 +# CONFIG_ISO9660_FS is not set
29473 +# CONFIG_UDF_FS is not set
29474 +
29475 +#
29476 +# DOS/FAT/NT Filesystems
29477 +#
29478 +# CONFIG_MSDOS_FS is not set
29479 +# CONFIG_VFAT_FS is not set
29480 +# CONFIG_NTFS_FS is not set
29481 +
29482 +#
29483 +# Pseudo filesystems
29484 +#
29485 +CONFIG_PROC_FS=y
29486 +CONFIG_PROC_KCORE=y
29487 +CONFIG_PROC_SYSCTL=y
29488 +CONFIG_SYSFS=y
29489 +CONFIG_TMPFS=y
29490 +# CONFIG_TMPFS_POSIX_ACL is not set
29491 +# CONFIG_HUGETLB_PAGE is not set
29492 +# CONFIG_CONFIGFS_FS is not set
29493 +
29494 +#
29495 +# Miscellaneous filesystems
29496 +#
29497 +# CONFIG_ADFS_FS is not set
29498 +# CONFIG_AFFS_FS is not set
29499 +# CONFIG_HFS_FS is not set
29500 +# CONFIG_HFSPLUS_FS is not set
29501 +# CONFIG_BEFS_FS is not set
29502 +# CONFIG_BFS_FS is not set
29503 +# CONFIG_EFS_FS is not set
29504 +# CONFIG_JFFS2_FS is not set
29505 +CONFIG_CRAMFS=y
29506 +# CONFIG_VXFS_FS is not set
29507 +# CONFIG_HPFS_FS is not set
29508 +# CONFIG_QNX4FS_FS is not set
29509 +# CONFIG_SYSV_FS is not set
29510 +# CONFIG_UFS_FS is not set
29511 +CONFIG_NETWORK_FILESYSTEMS=y
29512 +CONFIG_NFS_FS=y
29513 +CONFIG_NFS_V3=y
29514 +# CONFIG_NFS_V3_ACL is not set
29515 +# CONFIG_NFS_V4 is not set
29516 +# CONFIG_NFS_DIRECTIO is not set
29517 +# CONFIG_NFSD is not set
29518 +CONFIG_ROOT_NFS=y
29519 +CONFIG_LOCKD=y
29520 +CONFIG_LOCKD_V4=y
29521 +CONFIG_NFS_COMMON=y
29522 +CONFIG_SUNRPC=y
29523 +# CONFIG_SUNRPC_BIND34 is not set
29524 +# CONFIG_RPCSEC_GSS_KRB5 is not set
29525 +# CONFIG_RPCSEC_GSS_SPKM3 is not set
29526 +# CONFIG_SMB_FS is not set
29527 +# CONFIG_CIFS is not set
29528 +# CONFIG_NCP_FS is not set
29529 +# CONFIG_CODA_FS is not set
29530 +# CONFIG_AFS_FS is not set
29531 +
29532 +#
29533 +# Partition Types
29534 +#
29535 +# CONFIG_PARTITION_ADVANCED is not set
29536 +CONFIG_MSDOS_PARTITION=y
29537 +# CONFIG_NLS is not set
29538 +# CONFIG_DLM is not set
29539 +# CONFIG_UCC_SLOW is not set
29540 +
29541 +#
29542 +# Library routines
29543 +#
29544 +CONFIG_BITREVERSE=y
29545 +# CONFIG_CRC_CCITT is not set
29546 +# CONFIG_CRC16 is not set
29547 +# CONFIG_CRC_ITU_T is not set
29548 +CONFIG_CRC32=y
29549 +# CONFIG_CRC7 is not set
29550 +# CONFIG_LIBCRC32C is not set
29551 +CONFIG_ZLIB_INFLATE=y
29552 +CONFIG_PLIST=y
29553 +CONFIG_HAS_IOMEM=y
29554 +CONFIG_HAS_IOPORT=y
29555 +CONFIG_HAS_DMA=y
29556 +# CONFIG_INSTRUMENTATION is not set
29557 +
29558 +#
29559 +# Kernel hacking
29560 +#
29561 +# CONFIG_PRINTK_TIME is not set
29562 +CONFIG_ENABLE_WARN_DEPRECATED=y
29563 +CONFIG_ENABLE_MUST_CHECK=y
29564 +CONFIG_MAGIC_SYSRQ=y
29565 +# CONFIG_UNUSED_SYMBOLS is not set
29566 +# CONFIG_DEBUG_FS is not set
29567 +# CONFIG_HEADERS_CHECK is not set
29568 +CONFIG_DEBUG_KERNEL=y
29569 +# CONFIG_DEBUG_SHIRQ is not set
29570 +CONFIG_DETECT_SOFTLOCKUP=y
29571 +CONFIG_SCHED_DEBUG=y
29572 +# CONFIG_SCHEDSTATS is not set
29573 +# CONFIG_TIMER_STATS is not set
29574 +# CONFIG_SLUB_DEBUG_ON is not set
29575 +# CONFIG_DEBUG_RT_MUTEXES is not set
29576 +# CONFIG_RT_MUTEX_TESTER is not set
29577 +# CONFIG_DEBUG_SPINLOCK is not set
29578 +# CONFIG_DEBUG_MUTEXES is not set
29579 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
29580 +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
29581 +# CONFIG_DEBUG_KOBJECT is not set
29582 +CONFIG_DEBUG_BUGVERBOSE=y
29583 +# CONFIG_DEBUG_INFO is not set
29584 +# CONFIG_DEBUG_VM is not set
29585 +# CONFIG_DEBUG_LIST is not set
29586 +# CONFIG_DEBUG_SG is not set
29587 +CONFIG_FORCED_INLINING=y
29588 +# CONFIG_BOOT_PRINTK_DELAY is not set
29589 +# CONFIG_RCU_TORTURE_TEST is not set
29590 +# CONFIG_FAULT_INJECTION is not set
29591 +# CONFIG_SAMPLES is not set
29592 +# CONFIG_DEBUG_STACKOVERFLOW is not set
29593 +# CONFIG_DEBUG_STACK_USAGE is not set
29594 +# CONFIG_DEBUG_PAGEALLOC is not set
29595 +# CONFIG_DEBUGGER is not set
29596 +# CONFIG_BDI_SWITCH is not set
29597 +# CONFIG_PPC_EARLY_DEBUG is not set
29598 +
29599 +#
29600 +# Security options
29601 +#
29602 +# CONFIG_KEYS is not set
29603 +# CONFIG_SECURITY is not set
29604 +# CONFIG_SECURITY_FILE_CAPABILITIES is not set
29605 +CONFIG_CRYPTO=y
29606 +CONFIG_CRYPTO_ALGAPI=y
29607 +CONFIG_CRYPTO_BLKCIPHER=y
29608 +CONFIG_CRYPTO_MANAGER=y
29609 +# CONFIG_CRYPTO_HMAC is not set
29610 +# CONFIG_CRYPTO_XCBC is not set
29611 +# CONFIG_CRYPTO_NULL is not set
29612 +# CONFIG_CRYPTO_MD4 is not set
29613 +CONFIG_CRYPTO_MD5=y
29614 +# CONFIG_CRYPTO_SHA1 is not set
29615 +# CONFIG_CRYPTO_SHA256 is not set
29616 +# CONFIG_CRYPTO_SHA512 is not set
29617 +# CONFIG_CRYPTO_WP512 is not set
29618 +# CONFIG_CRYPTO_TGR192 is not set
29619 +# CONFIG_CRYPTO_GF128MUL is not set
29620 +CONFIG_CRYPTO_ECB=y
29621 +CONFIG_CRYPTO_CBC=y
29622 +CONFIG_CRYPTO_PCBC=y
29623 +# CONFIG_CRYPTO_LRW is not set
29624 +# CONFIG_CRYPTO_XTS is not set
29625 +# CONFIG_CRYPTO_CRYPTD is not set
29626 +CONFIG_CRYPTO_DES=y
29627 +# CONFIG_CRYPTO_FCRYPT is not set
29628 +# CONFIG_CRYPTO_BLOWFISH is not set
29629 +# CONFIG_CRYPTO_TWOFISH is not set
29630 +# CONFIG_CRYPTO_SERPENT is not set
29631 +# CONFIG_CRYPTO_AES is not set
29632 +# CONFIG_CRYPTO_CAST5 is not set
29633 +# CONFIG_CRYPTO_CAST6 is not set
29634 +# CONFIG_CRYPTO_TEA is not set
29635 +# CONFIG_CRYPTO_ARC4 is not set
29636 +# CONFIG_CRYPTO_KHAZAD is not set
29637 +# CONFIG_CRYPTO_ANUBIS is not set
29638 +# CONFIG_CRYPTO_SEED is not set
29639 +# CONFIG_CRYPTO_DEFLATE is not set
29640 +# CONFIG_CRYPTO_MICHAEL_MIC is not set
29641 +# CONFIG_CRYPTO_CRC32C is not set
29642 +# CONFIG_CRYPTO_CAMELLIA is not set
29643 +# CONFIG_CRYPTO_TEST is not set
29644 +# CONFIG_CRYPTO_AUTHENC is not set
29645 +CONFIG_CRYPTO_HW=y
29646 +# CONFIG_PPC_CLOCK is not set
29647 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/configs/mpc5200_defconfig powerpc.git/arch/powerpc/configs/mpc5200_defconfig
29648 --- linux-2.6.24/arch/powerpc/configs/mpc5200_defconfig 1970-01-01 01:00:00.000000000 +0100
29649 +++ powerpc.git/arch/powerpc/configs/mpc5200_defconfig  2008-01-28 20:25:49.000000000 +0100
29650 @@ -0,0 +1,1286 @@
29651 +#
29652 +# Automatically generated make config: don't edit
29653 +# Linux kernel version: 2.6.24-rc6
29654 +# Fri Jan 18 14:19:54 2008
29655 +#
29656 +# CONFIG_PPC64 is not set
29657 +
29658 +#
29659 +# Processor support
29660 +#
29661 +CONFIG_6xx=y
29662 +# CONFIG_PPC_85xx is not set
29663 +# CONFIG_PPC_8xx is not set
29664 +# CONFIG_40x is not set
29665 +# CONFIG_44x is not set
29666 +# CONFIG_E200 is not set
29667 +CONFIG_PPC_FPU=y
29668 +# CONFIG_ALTIVEC is not set
29669 +CONFIG_PPC_STD_MMU=y
29670 +CONFIG_PPC_STD_MMU_32=y
29671 +# CONFIG_PPC_MM_SLICES is not set
29672 +# CONFIG_SMP is not set
29673 +CONFIG_PPC32=y
29674 +CONFIG_WORD_SIZE=32
29675 +CONFIG_PPC_MERGE=y
29676 +CONFIG_MMU=y
29677 +CONFIG_GENERIC_CMOS_UPDATE=y
29678 +CONFIG_GENERIC_TIME=y
29679 +CONFIG_GENERIC_TIME_VSYSCALL=y
29680 +CONFIG_GENERIC_CLOCKEVENTS=y
29681 +CONFIG_GENERIC_HARDIRQS=y
29682 +CONFIG_IRQ_PER_CPU=y
29683 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
29684 +CONFIG_ARCH_HAS_ILOG2_U32=y
29685 +CONFIG_GENERIC_HWEIGHT=y
29686 +CONFIG_GENERIC_CALIBRATE_DELAY=y
29687 +CONFIG_GENERIC_FIND_NEXT_BIT=y
29688 +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
29689 +CONFIG_PPC=y
29690 +CONFIG_EARLY_PRINTK=y
29691 +CONFIG_GENERIC_NVRAM=y
29692 +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
29693 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
29694 +CONFIG_PPC_OF=y
29695 +CONFIG_OF=y
29696 +# CONFIG_PPC_UDBG_16550 is not set
29697 +# CONFIG_GENERIC_TBSYNC is not set
29698 +CONFIG_AUDIT_ARCH=y
29699 +CONFIG_GENERIC_BUG=y
29700 +# CONFIG_DEFAULT_UIMAGE is not set
29701 +# CONFIG_PPC_DCR_NATIVE is not set
29702 +# CONFIG_PPC_DCR_MMIO is not set
29703 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
29704 +
29705 +#
29706 +# General setup
29707 +#
29708 +CONFIG_EXPERIMENTAL=y
29709 +CONFIG_BROKEN_ON_SMP=y
29710 +CONFIG_INIT_ENV_ARG_LIMIT=32
29711 +CONFIG_LOCALVERSION=""
29712 +CONFIG_LOCALVERSION_AUTO=y
29713 +CONFIG_SWAP=y
29714 +CONFIG_SYSVIPC=y
29715 +CONFIG_SYSVIPC_SYSCTL=y
29716 +# CONFIG_POSIX_MQUEUE is not set
29717 +# CONFIG_BSD_PROCESS_ACCT is not set
29718 +# CONFIG_TASKSTATS is not set
29719 +# CONFIG_USER_NS is not set
29720 +# CONFIG_PID_NS is not set
29721 +# CONFIG_AUDIT is not set
29722 +# CONFIG_IKCONFIG is not set
29723 +CONFIG_LOG_BUF_SHIFT=14
29724 +# CONFIG_CGROUPS is not set
29725 +CONFIG_FAIR_GROUP_SCHED=y
29726 +CONFIG_FAIR_USER_SCHED=y
29727 +# CONFIG_FAIR_CGROUP_SCHED is not set
29728 +CONFIG_SYSFS_DEPRECATED=y
29729 +# CONFIG_RELAY is not set
29730 +CONFIG_BLK_DEV_INITRD=y
29731 +CONFIG_INITRAMFS_SOURCE=""
29732 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
29733 +CONFIG_SYSCTL=y
29734 +CONFIG_EMBEDDED=y
29735 +# CONFIG_SYSCTL_SYSCALL is not set
29736 +# CONFIG_KALLSYMS is not set
29737 +CONFIG_HOTPLUG=y
29738 +CONFIG_PRINTK=y
29739 +CONFIG_BUG=y
29740 +CONFIG_ELF_CORE=y
29741 +CONFIG_BASE_FULL=y
29742 +CONFIG_FUTEX=y
29743 +CONFIG_ANON_INODES=y
29744 +# CONFIG_EPOLL is not set
29745 +CONFIG_SIGNALFD=y
29746 +CONFIG_EVENTFD=y
29747 +CONFIG_SHMEM=y
29748 +CONFIG_VM_EVENT_COUNTERS=y
29749 +CONFIG_SLUB_DEBUG=y
29750 +# CONFIG_SLAB is not set
29751 +CONFIG_SLUB=y
29752 +# CONFIG_SLOB is not set
29753 +CONFIG_RT_MUTEXES=y
29754 +# CONFIG_TINY_SHMEM is not set
29755 +CONFIG_BASE_SMALL=0
29756 +CONFIG_MODULES=y
29757 +CONFIG_MODULE_UNLOAD=y
29758 +# CONFIG_MODULE_FORCE_UNLOAD is not set
29759 +# CONFIG_MODVERSIONS is not set
29760 +# CONFIG_MODULE_SRCVERSION_ALL is not set
29761 +# CONFIG_KMOD is not set
29762 +CONFIG_BLOCK=y
29763 +# CONFIG_LBD is not set
29764 +# CONFIG_BLK_DEV_IO_TRACE is not set
29765 +# CONFIG_LSF is not set
29766 +# CONFIG_BLK_DEV_BSG is not set
29767 +
29768 +#
29769 +# IO Schedulers
29770 +#
29771 +CONFIG_IOSCHED_NOOP=y
29772 +CONFIG_IOSCHED_AS=y
29773 +CONFIG_IOSCHED_DEADLINE=y
29774 +CONFIG_IOSCHED_CFQ=y
29775 +CONFIG_DEFAULT_AS=y
29776 +# CONFIG_DEFAULT_DEADLINE is not set
29777 +# CONFIG_DEFAULT_CFQ is not set
29778 +# CONFIG_DEFAULT_NOOP is not set
29779 +CONFIG_DEFAULT_IOSCHED="anticipatory"
29780 +
29781 +#
29782 +# Platform support
29783 +#
29784 +CONFIG_PPC_MULTIPLATFORM=y
29785 +# CONFIG_PPC_82xx is not set
29786 +# CONFIG_PPC_83xx is not set
29787 +# CONFIG_PPC_86xx is not set
29788 +CONFIG_CLASSIC32=y
29789 +# CONFIG_PPC_CHRP is not set
29790 +CONFIG_PPC_MPC52xx=y
29791 +CONFIG_PPC_MPC5200=y
29792 +CONFIG_PPC_MPC5200_BUGFIX=y
29793 +CONFIG_PPC_MPC5200_SIMPLE=y
29794 +CONFIG_PPC_EFIKA=y
29795 +CONFIG_PPC_LITE5200=y
29796 +# CONFIG_PPC_PMAC is not set
29797 +# CONFIG_PPC_CELL is not set
29798 +# CONFIG_PPC_CELL_NATIVE is not set
29799 +# CONFIG_PQ2ADS is not set
29800 +# CONFIG_EMBEDDED6xx is not set
29801 +CONFIG_PPC_NATIVE=y
29802 +# CONFIG_UDBG_RTAS_CONSOLE is not set
29803 +# CONFIG_MPIC is not set
29804 +# CONFIG_MPIC_WEIRD is not set
29805 +# CONFIG_PPC_I8259 is not set
29806 +CONFIG_PPC_RTAS=y
29807 +# CONFIG_RTAS_ERROR_LOGGING is not set
29808 +CONFIG_RTAS_PROC=y
29809 +# CONFIG_MMIO_NVRAM is not set
29810 +# CONFIG_PPC_MPC106 is not set
29811 +# CONFIG_PPC_970_NAP is not set
29812 +# CONFIG_PPC_INDIRECT_IO is not set
29813 +# CONFIG_GENERIC_IOMAP is not set
29814 +# CONFIG_CPU_FREQ is not set
29815 +# CONFIG_TAU is not set
29816 +# CONFIG_CPM2 is not set
29817 +# CONFIG_FSL_ULI1575 is not set
29818 +CONFIG_PPC_BESTCOMM=y
29819 +CONFIG_PPC_BESTCOMM_ATA=y
29820 +CONFIG_PPC_BESTCOMM_FEC=y
29821 +CONFIG_PPC_BESTCOMM_GEN_BD=y
29822 +
29823 +#
29824 +# Kernel options
29825 +#
29826 +# CONFIG_HIGHMEM is not set
29827 +CONFIG_TICK_ONESHOT=y
29828 +CONFIG_NO_HZ=y
29829 +CONFIG_HIGH_RES_TIMERS=y
29830 +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
29831 +# CONFIG_HZ_100 is not set
29832 +CONFIG_HZ_250=y
29833 +# CONFIG_HZ_300 is not set
29834 +# CONFIG_HZ_1000 is not set
29835 +CONFIG_HZ=250
29836 +CONFIG_PREEMPT_NONE=y
29837 +# CONFIG_PREEMPT_VOLUNTARY is not set
29838 +# CONFIG_PREEMPT is not set
29839 +CONFIG_BINFMT_ELF=y
29840 +# CONFIG_BINFMT_MISC is not set
29841 +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
29842 +# CONFIG_KEXEC is not set
29843 +CONFIG_ARCH_FLATMEM_ENABLE=y
29844 +CONFIG_ARCH_POPULATES_NODE_MAP=y
29845 +CONFIG_SELECT_MEMORY_MODEL=y
29846 +CONFIG_FLATMEM_MANUAL=y
29847 +# CONFIG_DISCONTIGMEM_MANUAL is not set
29848 +# CONFIG_SPARSEMEM_MANUAL is not set
29849 +CONFIG_FLATMEM=y
29850 +CONFIG_FLAT_NODE_MEM_MAP=y
29851 +# CONFIG_SPARSEMEM_STATIC is not set
29852 +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
29853 +CONFIG_SPLIT_PTLOCK_CPUS=4
29854 +# CONFIG_RESOURCES_64BIT is not set
29855 +CONFIG_ZONE_DMA_FLAG=1
29856 +CONFIG_BOUNCE=y
29857 +CONFIG_VIRT_TO_BUS=y
29858 +CONFIG_PROC_DEVICETREE=y
29859 +# CONFIG_CMDLINE_BOOL is not set
29860 +CONFIG_PM=y
29861 +# CONFIG_PM_LEGACY is not set
29862 +# CONFIG_PM_DEBUG is not set
29863 +CONFIG_PM_SLEEP=y
29864 +CONFIG_SUSPEND_UP_POSSIBLE=y
29865 +CONFIG_SUSPEND=y
29866 +CONFIG_HIBERNATION_UP_POSSIBLE=y
29867 +# CONFIG_HIBERNATION is not set
29868 +CONFIG_SECCOMP=y
29869 +CONFIG_WANT_DEVICE_TREE=y
29870 +CONFIG_DEVICE_TREE=""
29871 +CONFIG_ISA_DMA_API=y
29872 +
29873 +#
29874 +# Bus options
29875 +#
29876 +CONFIG_ZONE_DMA=y
29877 +CONFIG_GENERIC_ISA_DMA=y
29878 +# CONFIG_PPC_INDIRECT_PCI is not set
29879 +CONFIG_FSL_SOC=y
29880 +CONFIG_PCI=y
29881 +CONFIG_PCI_DOMAINS=y
29882 +CONFIG_PCI_SYSCALL=y
29883 +# CONFIG_PCIEPORTBUS is not set
29884 +CONFIG_ARCH_SUPPORTS_MSI=y
29885 +# CONFIG_PCI_MSI is not set
29886 +CONFIG_PCI_LEGACY=y
29887 +# CONFIG_PCI_DEBUG is not set
29888 +# CONFIG_PCCARD is not set
29889 +# CONFIG_HOTPLUG_PCI is not set
29890 +
29891 +#
29892 +# Advanced setup
29893 +#
29894 +# CONFIG_ADVANCED_OPTIONS is not set
29895 +
29896 +#
29897 +# Default settings for advanced configuration options are used
29898 +#
29899 +CONFIG_HIGHMEM_START=0xfe000000
29900 +CONFIG_LOWMEM_SIZE=0x30000000
29901 +CONFIG_KERNEL_START=0xc0000000
29902 +CONFIG_TASK_SIZE=0xc0000000
29903 +CONFIG_BOOT_LOAD=0x00800000
29904 +
29905 +#
29906 +# Networking
29907 +#
29908 +CONFIG_NET=y
29909 +
29910 +#
29911 +# Networking options
29912 +#
29913 +CONFIG_PACKET=y
29914 +# CONFIG_PACKET_MMAP is not set
29915 +CONFIG_UNIX=y
29916 +CONFIG_XFRM=y
29917 +CONFIG_XFRM_USER=m
29918 +# CONFIG_XFRM_SUB_POLICY is not set
29919 +# CONFIG_XFRM_MIGRATE is not set
29920 +# CONFIG_NET_KEY is not set
29921 +CONFIG_INET=y
29922 +CONFIG_IP_MULTICAST=y
29923 +# CONFIG_IP_ADVANCED_ROUTER is not set
29924 +CONFIG_IP_FIB_HASH=y
29925 +CONFIG_IP_PNP=y
29926 +CONFIG_IP_PNP_DHCP=y
29927 +CONFIG_IP_PNP_BOOTP=y
29928 +# CONFIG_IP_PNP_RARP is not set
29929 +# CONFIG_NET_IPIP is not set
29930 +# CONFIG_NET_IPGRE is not set
29931 +# CONFIG_IP_MROUTE is not set
29932 +# CONFIG_ARPD is not set
29933 +CONFIG_SYN_COOKIES=y
29934 +# CONFIG_INET_AH is not set
29935 +# CONFIG_INET_ESP is not set
29936 +# CONFIG_INET_IPCOMP is not set
29937 +# CONFIG_INET_XFRM_TUNNEL is not set
29938 +# CONFIG_INET_TUNNEL is not set
29939 +CONFIG_INET_XFRM_MODE_TRANSPORT=y
29940 +CONFIG_INET_XFRM_MODE_TUNNEL=y
29941 +CONFIG_INET_XFRM_MODE_BEET=y
29942 +# CONFIG_INET_LRO is not set
29943 +CONFIG_INET_DIAG=y
29944 +CONFIG_INET_TCP_DIAG=y
29945 +# CONFIG_TCP_CONG_ADVANCED is not set
29946 +CONFIG_TCP_CONG_CUBIC=y
29947 +CONFIG_DEFAULT_TCP_CONG="cubic"
29948 +# CONFIG_TCP_MD5SIG is not set
29949 +# CONFIG_IPV6 is not set
29950 +# CONFIG_INET6_XFRM_TUNNEL is not set
29951 +# CONFIG_INET6_TUNNEL is not set
29952 +# CONFIG_NETWORK_SECMARK is not set
29953 +# CONFIG_NETFILTER is not set
29954 +# CONFIG_IP_DCCP is not set
29955 +# CONFIG_IP_SCTP is not set
29956 +# CONFIG_TIPC is not set
29957 +# CONFIG_ATM is not set
29958 +# CONFIG_BRIDGE is not set
29959 +# CONFIG_VLAN_8021Q is not set
29960 +# CONFIG_DECNET is not set
29961 +# CONFIG_LLC2 is not set
29962 +# CONFIG_IPX is not set
29963 +# CONFIG_ATALK is not set
29964 +# CONFIG_X25 is not set
29965 +# CONFIG_LAPB is not set
29966 +# CONFIG_ECONET is not set
29967 +# CONFIG_WAN_ROUTER is not set
29968 +# CONFIG_NET_SCHED is not set
29969 +
29970 +#
29971 +# Network testing
29972 +#
29973 +# CONFIG_NET_PKTGEN is not set
29974 +# CONFIG_HAMRADIO is not set
29975 +# CONFIG_IRDA is not set
29976 +# CONFIG_BT is not set
29977 +# CONFIG_AF_RXRPC is not set
29978 +
29979 +#
29980 +# Wireless
29981 +#
29982 +# CONFIG_CFG80211 is not set
29983 +# CONFIG_WIRELESS_EXT is not set
29984 +# CONFIG_MAC80211 is not set
29985 +# CONFIG_IEEE80211 is not set
29986 +# CONFIG_RFKILL is not set
29987 +# CONFIG_NET_9P is not set
29988 +
29989 +#
29990 +# Device Drivers
29991 +#
29992 +
29993 +#
29994 +# Generic Driver Options
29995 +#
29996 +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
29997 +CONFIG_STANDALONE=y
29998 +CONFIG_PREVENT_FIRMWARE_BUILD=y
29999 +# CONFIG_FW_LOADER is not set
30000 +# CONFIG_DEBUG_DRIVER is not set
30001 +# CONFIG_DEBUG_DEVRES is not set
30002 +# CONFIG_SYS_HYPERVISOR is not set
30003 +# CONFIG_CONNECTOR is not set
30004 +CONFIG_MTD=y
30005 +# CONFIG_MTD_DEBUG is not set
30006 +CONFIG_MTD_CONCAT=y
30007 +CONFIG_MTD_PARTITIONS=y
30008 +# CONFIG_MTD_REDBOOT_PARTS is not set
30009 +CONFIG_MTD_CMDLINE_PARTS=y
30010 +
30011 +#
30012 +# User Modules And Translation Layers
30013 +#
30014 +CONFIG_MTD_CHAR=y
30015 +CONFIG_MTD_BLKDEVS=y
30016 +CONFIG_MTD_BLOCK=y
30017 +# CONFIG_FTL is not set
30018 +# CONFIG_NFTL is not set
30019 +# CONFIG_INFTL is not set
30020 +# CONFIG_RFD_FTL is not set
30021 +# CONFIG_SSFDC is not set
30022 +# CONFIG_MTD_OOPS is not set
30023 +
30024 +#
30025 +# RAM/ROM/Flash chip drivers
30026 +#
30027 +CONFIG_MTD_CFI=y
30028 +# CONFIG_MTD_JEDECPROBE is not set
30029 +CONFIG_MTD_GEN_PROBE=y
30030 +# CONFIG_MTD_CFI_ADV_OPTIONS is not set
30031 +CONFIG_MTD_MAP_BANK_WIDTH_1=y
30032 +CONFIG_MTD_MAP_BANK_WIDTH_2=y
30033 +CONFIG_MTD_MAP_BANK_WIDTH_4=y
30034 +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
30035 +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
30036 +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
30037 +CONFIG_MTD_CFI_I1=y
30038 +CONFIG_MTD_CFI_I2=y
30039 +# CONFIG_MTD_CFI_I4 is not set
30040 +# CONFIG_MTD_CFI_I8 is not set
30041 +# CONFIG_MTD_CFI_INTELEXT is not set
30042 +CONFIG_MTD_CFI_AMDSTD=y
30043 +# CONFIG_MTD_CFI_STAA is not set
30044 +CONFIG_MTD_CFI_UTIL=y
30045 +CONFIG_MTD_RAM=y
30046 +CONFIG_MTD_ROM=y
30047 +# CONFIG_MTD_ABSENT is not set
30048 +
30049 +#
30050 +# Mapping drivers for chip access
30051 +#
30052 +# CONFIG_MTD_COMPLEX_MAPPINGS is not set
30053 +# CONFIG_MTD_PHYSMAP is not set
30054 +CONFIG_MTD_PHYSMAP_OF=y
30055 +# CONFIG_MTD_INTEL_VR_NOR is not set
30056 +# CONFIG_MTD_PLATRAM is not set
30057 +
30058 +#
30059 +# Self-contained MTD device drivers
30060 +#
30061 +# CONFIG_MTD_PMC551 is not set
30062 +# CONFIG_MTD_SLRAM is not set
30063 +# CONFIG_MTD_PHRAM is not set
30064 +# CONFIG_MTD_MTDRAM is not set
30065 +# CONFIG_MTD_BLOCK2MTD is not set
30066 +
30067 +#
30068 +# Disk-On-Chip Device Drivers
30069 +#
30070 +# CONFIG_MTD_DOC2000 is not set
30071 +# CONFIG_MTD_DOC2001 is not set
30072 +# CONFIG_MTD_DOC2001PLUS is not set
30073 +# CONFIG_MTD_NAND is not set
30074 +# CONFIG_MTD_ONENAND is not set
30075 +
30076 +#
30077 +# UBI - Unsorted block images
30078 +#
30079 +# CONFIG_MTD_UBI is not set
30080 +CONFIG_OF_DEVICE=y
30081 +# CONFIG_PARPORT is not set
30082 +CONFIG_BLK_DEV=y
30083 +# CONFIG_BLK_DEV_FD is not set
30084 +# CONFIG_BLK_CPQ_DA is not set
30085 +# CONFIG_BLK_CPQ_CISS_DA is not set
30086 +# CONFIG_BLK_DEV_DAC960 is not set
30087 +# CONFIG_BLK_DEV_UMEM is not set
30088 +# CONFIG_BLK_DEV_COW_COMMON is not set
30089 +CONFIG_BLK_DEV_LOOP=y
30090 +# CONFIG_BLK_DEV_CRYPTOLOOP is not set
30091 +# CONFIG_BLK_DEV_NBD is not set
30092 +# CONFIG_BLK_DEV_SX8 is not set
30093 +# CONFIG_BLK_DEV_UB is not set
30094 +CONFIG_BLK_DEV_RAM=y
30095 +CONFIG_BLK_DEV_RAM_COUNT=16
30096 +CONFIG_BLK_DEV_RAM_SIZE=32768
30097 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
30098 +# CONFIG_CDROM_PKTCDVD is not set
30099 +# CONFIG_ATA_OVER_ETH is not set
30100 +CONFIG_MISC_DEVICES=y
30101 +# CONFIG_PHANTOM is not set
30102 +# CONFIG_EEPROM_93CX6 is not set
30103 +# CONFIG_SGI_IOC4 is not set
30104 +# CONFIG_TIFM_CORE is not set
30105 +# CONFIG_IDE is not set
30106 +
30107 +#
30108 +# SCSI device support
30109 +#
30110 +# CONFIG_RAID_ATTRS is not set
30111 +CONFIG_SCSI=y
30112 +CONFIG_SCSI_DMA=y
30113 +CONFIG_SCSI_TGT=y
30114 +# CONFIG_SCSI_NETLINK is not set
30115 +CONFIG_SCSI_PROC_FS=y
30116 +
30117 +#
30118 +# SCSI support type (disk, tape, CD-ROM)
30119 +#
30120 +CONFIG_BLK_DEV_SD=y
30121 +# CONFIG_CHR_DEV_ST is not set
30122 +# CONFIG_CHR_DEV_OSST is not set
30123 +# CONFIG_BLK_DEV_SR is not set
30124 +CONFIG_CHR_DEV_SG=y
30125 +# CONFIG_CHR_DEV_SCH is not set
30126 +
30127 +#
30128 +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
30129 +#
30130 +# CONFIG_SCSI_MULTI_LUN is not set
30131 +# CONFIG_SCSI_CONSTANTS is not set
30132 +# CONFIG_SCSI_LOGGING is not set
30133 +# CONFIG_SCSI_SCAN_ASYNC is not set
30134 +CONFIG_SCSI_WAIT_SCAN=m
30135 +
30136 +#
30137 +# SCSI Transports
30138 +#
30139 +# CONFIG_SCSI_SPI_ATTRS is not set
30140 +# CONFIG_SCSI_FC_ATTRS is not set
30141 +# CONFIG_SCSI_ISCSI_ATTRS is not set
30142 +# CONFIG_SCSI_SAS_LIBSAS is not set
30143 +# CONFIG_SCSI_SRP_ATTRS is not set
30144 +CONFIG_SCSI_LOWLEVEL=y
30145 +# CONFIG_ISCSI_TCP is not set
30146 +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
30147 +# CONFIG_SCSI_3W_9XXX is not set
30148 +# CONFIG_SCSI_ACARD is not set
30149 +# CONFIG_SCSI_AACRAID is not set
30150 +# CONFIG_SCSI_AIC7XXX is not set
30151 +# CONFIG_SCSI_AIC7XXX_OLD is not set
30152 +# CONFIG_SCSI_AIC79XX is not set
30153 +# CONFIG_SCSI_AIC94XX is not set
30154 +# CONFIG_SCSI_DPT_I2O is not set
30155 +# CONFIG_SCSI_ADVANSYS is not set
30156 +# CONFIG_SCSI_ARCMSR is not set
30157 +# CONFIG_MEGARAID_NEWGEN is not set
30158 +# CONFIG_MEGARAID_LEGACY is not set
30159 +# CONFIG_MEGARAID_SAS is not set
30160 +# CONFIG_SCSI_HPTIOP is not set
30161 +# CONFIG_SCSI_BUSLOGIC is not set
30162 +# CONFIG_SCSI_DMX3191D is not set
30163 +# CONFIG_SCSI_EATA is not set
30164 +# CONFIG_SCSI_FUTURE_DOMAIN is not set
30165 +# CONFIG_SCSI_GDTH is not set
30166 +# CONFIG_SCSI_IPS is not set
30167 +# CONFIG_SCSI_INITIO is not set
30168 +# CONFIG_SCSI_INIA100 is not set
30169 +# CONFIG_SCSI_STEX is not set
30170 +# CONFIG_SCSI_SYM53C8XX_2 is not set
30171 +# CONFIG_SCSI_IPR is not set
30172 +# CONFIG_SCSI_QLOGIC_1280 is not set
30173 +# CONFIG_SCSI_QLA_FC is not set
30174 +# CONFIG_SCSI_QLA_ISCSI is not set
30175 +# CONFIG_SCSI_LPFC is not set
30176 +# CONFIG_SCSI_DC395x is not set
30177 +# CONFIG_SCSI_DC390T is not set
30178 +# CONFIG_SCSI_NSP32 is not set
30179 +# CONFIG_SCSI_DEBUG is not set
30180 +# CONFIG_SCSI_SRP is not set
30181 +CONFIG_ATA=y
30182 +# CONFIG_ATA_NONSTANDARD is not set
30183 +# CONFIG_SATA_AHCI is not set
30184 +# CONFIG_SATA_SVW is not set
30185 +# CONFIG_ATA_PIIX is not set
30186 +# CONFIG_SATA_MV is not set
30187 +# CONFIG_SATA_NV is not set
30188 +# CONFIG_PDC_ADMA is not set
30189 +# CONFIG_SATA_QSTOR is not set
30190 +# CONFIG_SATA_PROMISE is not set
30191 +# CONFIG_SATA_SX4 is not set
30192 +# CONFIG_SATA_SIL is not set
30193 +# CONFIG_SATA_SIL24 is not set
30194 +# CONFIG_SATA_SIS is not set
30195 +# CONFIG_SATA_ULI is not set
30196 +# CONFIG_SATA_VIA is not set
30197 +# CONFIG_SATA_VITESSE is not set
30198 +# CONFIG_SATA_INIC162X is not set
30199 +# CONFIG_PATA_ALI is not set
30200 +# CONFIG_PATA_AMD is not set
30201 +# CONFIG_PATA_ARTOP is not set
30202 +# CONFIG_PATA_ATIIXP is not set
30203 +# CONFIG_PATA_CMD640_PCI is not set
30204 +# CONFIG_PATA_CMD64X is not set
30205 +# CONFIG_PATA_CS5520 is not set
30206 +# CONFIG_PATA_CS5530 is not set
30207 +# CONFIG_PATA_CYPRESS is not set
30208 +# CONFIG_PATA_EFAR is not set
30209 +# CONFIG_ATA_GENERIC is not set
30210 +# CONFIG_PATA_HPT366 is not set
30211 +# CONFIG_PATA_HPT37X is not set
30212 +# CONFIG_PATA_HPT3X2N is not set
30213 +# CONFIG_PATA_HPT3X3 is not set
30214 +# CONFIG_PATA_IT821X is not set
30215 +# CONFIG_PATA_IT8213 is not set
30216 +# CONFIG_PATA_JMICRON is not set
30217 +# CONFIG_PATA_TRIFLEX is not set
30218 +# CONFIG_PATA_MARVELL is not set
30219 +CONFIG_PATA_MPC52xx=y
30220 +# CONFIG_PATA_MPIIX is not set
30221 +# CONFIG_PATA_OLDPIIX is not set
30222 +# CONFIG_PATA_NETCELL is not set
30223 +# CONFIG_PATA_NS87410 is not set
30224 +# CONFIG_PATA_NS87415 is not set
30225 +# CONFIG_PATA_OPTI is not set
30226 +# CONFIG_PATA_OPTIDMA is not set
30227 +# CONFIG_PATA_PDC_OLD is not set
30228 +# CONFIG_PATA_RADISYS is not set
30229 +# CONFIG_PATA_RZ1000 is not set
30230 +# CONFIG_PATA_SC1200 is not set
30231 +# CONFIG_PATA_SERVERWORKS is not set
30232 +# CONFIG_PATA_PDC2027X is not set
30233 +# CONFIG_PATA_SIL680 is not set
30234 +# CONFIG_PATA_SIS is not set
30235 +# CONFIG_PATA_VIA is not set
30236 +# CONFIG_PATA_WINBOND is not set
30237 +CONFIG_PATA_PLATFORM=y
30238 +# CONFIG_PATA_OF_PLATFORM is not set
30239 +# CONFIG_MD is not set
30240 +# CONFIG_FUSION is not set
30241 +
30242 +#
30243 +# IEEE 1394 (FireWire) support
30244 +#
30245 +# CONFIG_FIREWIRE is not set
30246 +# CONFIG_IEEE1394 is not set
30247 +# CONFIG_I2O is not set
30248 +# CONFIG_MACINTOSH_DRIVERS is not set
30249 +CONFIG_NETDEVICES=y
30250 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
30251 +# CONFIG_DUMMY is not set
30252 +# CONFIG_BONDING is not set
30253 +# CONFIG_MACVLAN is not set
30254 +# CONFIG_EQUALIZER is not set
30255 +# CONFIG_TUN is not set
30256 +# CONFIG_VETH is not set
30257 +# CONFIG_IP1000 is not set
30258 +# CONFIG_ARCNET is not set
30259 +CONFIG_PHYLIB=y
30260 +
30261 +#
30262 +# MII PHY device drivers
30263 +#
30264 +# CONFIG_MARVELL_PHY is not set
30265 +# CONFIG_DAVICOM_PHY is not set
30266 +# CONFIG_QSEMI_PHY is not set
30267 +# CONFIG_LXT_PHY is not set
30268 +# CONFIG_CICADA_PHY is not set
30269 +# CONFIG_VITESSE_PHY is not set
30270 +# CONFIG_SMSC_PHY is not set
30271 +# CONFIG_BROADCOM_PHY is not set
30272 +# CONFIG_ICPLUS_PHY is not set
30273 +# CONFIG_FIXED_PHY is not set
30274 +# CONFIG_MDIO_BITBANG is not set
30275 +CONFIG_NET_ETHERNET=y
30276 +# CONFIG_MII is not set
30277 +# CONFIG_HAPPYMEAL is not set
30278 +# CONFIG_SUNGEM is not set
30279 +# CONFIG_CASSINI is not set
30280 +# CONFIG_NET_VENDOR_3COM is not set
30281 +# CONFIG_NET_TULIP is not set
30282 +# CONFIG_HP100 is not set
30283 +# CONFIG_IBM_NEW_EMAC_ZMII is not set
30284 +# CONFIG_IBM_NEW_EMAC_RGMII is not set
30285 +# CONFIG_IBM_NEW_EMAC_TAH is not set
30286 +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
30287 +# CONFIG_NET_PCI is not set
30288 +# CONFIG_B44 is not set
30289 +CONFIG_FEC_MPC52xx=y
30290 +CONFIG_FEC_MPC52xx_MDIO=y
30291 +# CONFIG_NETDEV_1000 is not set
30292 +# CONFIG_NETDEV_10000 is not set
30293 +# CONFIG_TR is not set
30294 +
30295 +#
30296 +# Wireless LAN
30297 +#
30298 +# CONFIG_WLAN_PRE80211 is not set
30299 +# CONFIG_WLAN_80211 is not set
30300 +
30301 +#
30302 +# USB Network Adapters
30303 +#
30304 +# CONFIG_USB_CATC is not set
30305 +# CONFIG_USB_KAWETH is not set
30306 +# CONFIG_USB_PEGASUS is not set
30307 +# CONFIG_USB_RTL8150 is not set
30308 +# CONFIG_USB_USBNET is not set
30309 +# CONFIG_WAN is not set
30310 +# CONFIG_FDDI is not set
30311 +# CONFIG_HIPPI is not set
30312 +# CONFIG_PPP is not set
30313 +# CONFIG_SLIP is not set
30314 +# CONFIG_NET_FC is not set
30315 +# CONFIG_SHAPER is not set
30316 +# CONFIG_NETCONSOLE is not set
30317 +# CONFIG_NETPOLL is not set
30318 +# CONFIG_NET_POLL_CONTROLLER is not set
30319 +# CONFIG_ISDN is not set
30320 +# CONFIG_PHONE is not set
30321 +
30322 +#
30323 +# Input device support
30324 +#
30325 +# CONFIG_INPUT is not set
30326 +
30327 +#
30328 +# Hardware I/O ports
30329 +#
30330 +# CONFIG_SERIO is not set
30331 +# CONFIG_GAMEPORT is not set
30332 +
30333 +#
30334 +# Character devices
30335 +#
30336 +# CONFIG_VT is not set
30337 +# CONFIG_SERIAL_NONSTANDARD is not set
30338 +
30339 +#
30340 +# Serial drivers
30341 +#
30342 +# CONFIG_SERIAL_8250 is not set
30343 +
30344 +#
30345 +# Non-8250 serial port support
30346 +#
30347 +# CONFIG_SERIAL_UARTLITE is not set
30348 +CONFIG_SERIAL_CORE=y
30349 +CONFIG_SERIAL_CORE_CONSOLE=y
30350 +CONFIG_SERIAL_MPC52xx=y
30351 +CONFIG_SERIAL_MPC52xx_CONSOLE=y
30352 +CONFIG_SERIAL_MPC52xx_CONSOLE_BAUD=115200
30353 +# CONFIG_SERIAL_JSM is not set
30354 +CONFIG_UNIX98_PTYS=y
30355 +CONFIG_LEGACY_PTYS=y
30356 +CONFIG_LEGACY_PTY_COUNT=256
30357 +# CONFIG_HVC_RTAS is not set
30358 +# CONFIG_IPMI_HANDLER is not set
30359 +# CONFIG_HW_RANDOM is not set
30360 +# CONFIG_NVRAM is not set
30361 +CONFIG_GEN_RTC=y
30362 +# CONFIG_GEN_RTC_X is not set
30363 +# CONFIG_R3964 is not set
30364 +# CONFIG_APPLICOM is not set
30365 +# CONFIG_RAW_DRIVER is not set
30366 +# CONFIG_TCG_TPM is not set
30367 +CONFIG_DEVPORT=y
30368 +CONFIG_I2C=y
30369 +CONFIG_I2C_BOARDINFO=y
30370 +CONFIG_I2C_CHARDEV=y
30371 +
30372 +#
30373 +# I2C Algorithms
30374 +#
30375 +# CONFIG_I2C_ALGOBIT is not set
30376 +# CONFIG_I2C_ALGOPCF is not set
30377 +# CONFIG_I2C_ALGOPCA is not set
30378 +
30379 +#
30380 +# I2C Hardware Bus support
30381 +#
30382 +# CONFIG_I2C_ALI1535 is not set
30383 +# CONFIG_I2C_ALI1563 is not set
30384 +# CONFIG_I2C_ALI15X3 is not set
30385 +# CONFIG_I2C_AMD756 is not set
30386 +# CONFIG_I2C_AMD8111 is not set
30387 +# CONFIG_I2C_I801 is not set
30388 +# CONFIG_I2C_I810 is not set
30389 +# CONFIG_I2C_PIIX4 is not set
30390 +CONFIG_I2C_MPC=y
30391 +# CONFIG_I2C_NFORCE2 is not set
30392 +# CONFIG_I2C_OCORES is not set
30393 +# CONFIG_I2C_PARPORT_LIGHT is not set
30394 +# CONFIG_I2C_PROSAVAGE is not set
30395 +# CONFIG_I2C_SAVAGE4 is not set
30396 +# CONFIG_I2C_SIMTEC is not set
30397 +# CONFIG_I2C_SIS5595 is not set
30398 +# CONFIG_I2C_SIS630 is not set
30399 +# CONFIG_I2C_SIS96X is not set
30400 +# CONFIG_I2C_TAOS_EVM is not set
30401 +# CONFIG_I2C_STUB is not set
30402 +# CONFIG_I2C_TINY_USB is not set
30403 +# CONFIG_I2C_VIA is not set
30404 +# CONFIG_I2C_VIAPRO is not set
30405 +# CONFIG_I2C_VOODOO3 is not set
30406 +
30407 +#
30408 +# Miscellaneous I2C Chip support
30409 +#
30410 +# CONFIG_SENSORS_DS1337 is not set
30411 +# CONFIG_SENSORS_DS1374 is not set
30412 +# CONFIG_DS1682 is not set
30413 +# CONFIG_SENSORS_EEPROM is not set
30414 +# CONFIG_SENSORS_PCF8574 is not set
30415 +# CONFIG_SENSORS_PCA9539 is not set
30416 +# CONFIG_SENSORS_PCF8591 is not set
30417 +# CONFIG_SENSORS_M41T00 is not set
30418 +# CONFIG_SENSORS_MAX6875 is not set
30419 +# CONFIG_SENSORS_TSL2550 is not set
30420 +# CONFIG_I2C_DEBUG_CORE is not set
30421 +# CONFIG_I2C_DEBUG_ALGO is not set
30422 +# CONFIG_I2C_DEBUG_BUS is not set
30423 +# CONFIG_I2C_DEBUG_CHIP is not set
30424 +
30425 +#
30426 +# SPI support
30427 +#
30428 +# CONFIG_SPI is not set
30429 +# CONFIG_SPI_MASTER is not set
30430 +# CONFIG_W1 is not set
30431 +# CONFIG_POWER_SUPPLY is not set
30432 +CONFIG_HWMON=y
30433 +# CONFIG_HWMON_VID is not set
30434 +# CONFIG_SENSORS_AD7418 is not set
30435 +# CONFIG_SENSORS_ADM1021 is not set
30436 +# CONFIG_SENSORS_ADM1025 is not set
30437 +# CONFIG_SENSORS_ADM1026 is not set
30438 +# CONFIG_SENSORS_ADM1029 is not set
30439 +# CONFIG_SENSORS_ADM1031 is not set
30440 +# CONFIG_SENSORS_ADM9240 is not set
30441 +# CONFIG_SENSORS_ADT7470 is not set
30442 +# CONFIG_SENSORS_ATXP1 is not set
30443 +# CONFIG_SENSORS_DS1621 is not set
30444 +# CONFIG_SENSORS_I5K_AMB is not set
30445 +# CONFIG_SENSORS_F71805F is not set
30446 +# CONFIG_SENSORS_F71882FG is not set
30447 +# CONFIG_SENSORS_F75375S is not set
30448 +# CONFIG_SENSORS_GL518SM is not set
30449 +# CONFIG_SENSORS_GL520SM is not set
30450 +# CONFIG_SENSORS_IT87 is not set
30451 +# CONFIG_SENSORS_LM63 is not set
30452 +# CONFIG_SENSORS_LM75 is not set
30453 +# CONFIG_SENSORS_LM77 is not set
30454 +# CONFIG_SENSORS_LM78 is not set
30455 +# CONFIG_SENSORS_LM80 is not set
30456 +# CONFIG_SENSORS_LM83 is not set
30457 +# CONFIG_SENSORS_LM85 is not set
30458 +# CONFIG_SENSORS_LM87 is not set
30459 +# CONFIG_SENSORS_LM90 is not set
30460 +# CONFIG_SENSORS_LM92 is not set
30461 +# CONFIG_SENSORS_LM93 is not set
30462 +# CONFIG_SENSORS_MAX1619 is not set
30463 +# CONFIG_SENSORS_MAX6650 is not set
30464 +# CONFIG_SENSORS_PC87360 is not set
30465 +# CONFIG_SENSORS_PC87427 is not set
30466 +# CONFIG_SENSORS_SIS5595 is not set
30467 +# CONFIG_SENSORS_DME1737 is not set
30468 +# CONFIG_SENSORS_SMSC47M1 is not set
30469 +# CONFIG_SENSORS_SMSC47M192 is not set
30470 +# CONFIG_SENSORS_SMSC47B397 is not set
30471 +# CONFIG_SENSORS_THMC50 is not set
30472 +# CONFIG_SENSORS_VIA686A is not set
30473 +# CONFIG_SENSORS_VT1211 is not set
30474 +# CONFIG_SENSORS_VT8231 is not set
30475 +# CONFIG_SENSORS_W83781D is not set
30476 +# CONFIG_SENSORS_W83791D is not set
30477 +# CONFIG_SENSORS_W83792D is not set
30478 +# CONFIG_SENSORS_W83793 is not set
30479 +# CONFIG_SENSORS_W83L785TS is not set
30480 +# CONFIG_SENSORS_W83627HF is not set
30481 +# CONFIG_SENSORS_W83627EHF is not set
30482 +# CONFIG_HWMON_DEBUG_CHIP is not set
30483 +CONFIG_WATCHDOG=y
30484 +# CONFIG_WATCHDOG_NOWAYOUT is not set
30485 +
30486 +#
30487 +# Watchdog Device Drivers
30488 +#
30489 +# CONFIG_SOFT_WATCHDOG is not set
30490 +# CONFIG_MPC5200_WDT is not set
30491 +# CONFIG_WATCHDOG_RTAS is not set
30492 +
30493 +#
30494 +# PCI-based Watchdog Cards
30495 +#
30496 +# CONFIG_PCIPCWATCHDOG is not set
30497 +# CONFIG_WDTPCI is not set
30498 +
30499 +#
30500 +# USB-based Watchdog Cards
30501 +#
30502 +# CONFIG_USBPCWATCHDOG is not set
30503 +
30504 +#
30505 +# Sonics Silicon Backplane
30506 +#
30507 +CONFIG_SSB_POSSIBLE=y
30508 +# CONFIG_SSB is not set
30509 +
30510 +#
30511 +# Multifunction device drivers
30512 +#
30513 +# CONFIG_MFD_SM501 is not set
30514 +
30515 +#
30516 +# Multimedia devices
30517 +#
30518 +# CONFIG_VIDEO_DEV is not set
30519 +# CONFIG_DVB_CORE is not set
30520 +CONFIG_DAB=y
30521 +# CONFIG_USB_DABUSB is not set
30522 +
30523 +#
30524 +# Graphics support
30525 +#
30526 +# CONFIG_AGP is not set
30527 +# CONFIG_DRM is not set
30528 +# CONFIG_VGASTATE is not set
30529 +CONFIG_VIDEO_OUTPUT_CONTROL=m
30530 +# CONFIG_FB is not set
30531 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
30532 +
30533 +#
30534 +# Display device support
30535 +#
30536 +# CONFIG_DISPLAY_SUPPORT is not set
30537 +
30538 +#
30539 +# Sound
30540 +#
30541 +# CONFIG_SOUND is not set
30542 +CONFIG_USB_SUPPORT=y
30543 +CONFIG_USB_ARCH_HAS_HCD=y
30544 +CONFIG_USB_ARCH_HAS_OHCI=y
30545 +CONFIG_USB_ARCH_HAS_EHCI=y
30546 +CONFIG_USB=y
30547 +# CONFIG_USB_DEBUG is not set
30548 +
30549 +#
30550 +# Miscellaneous USB options
30551 +#
30552 +CONFIG_USB_DEVICEFS=y
30553 +# CONFIG_USB_DEVICE_CLASS is not set
30554 +# CONFIG_USB_DYNAMIC_MINORS is not set
30555 +# CONFIG_USB_SUSPEND is not set
30556 +# CONFIG_USB_PERSIST is not set
30557 +# CONFIG_USB_OTG is not set
30558 +
30559 +#
30560 +# USB Host Controller Drivers
30561 +#
30562 +# CONFIG_USB_EHCI_HCD is not set
30563 +# CONFIG_USB_ISP116X_HCD is not set
30564 +CONFIG_USB_OHCI_HCD=y
30565 +CONFIG_USB_OHCI_HCD_PPC_SOC=y
30566 +CONFIG_USB_OHCI_HCD_PPC_OF=y
30567 +CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
30568 +# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
30569 +CONFIG_USB_OHCI_HCD_PCI=y
30570 +CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
30571 +CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
30572 +CONFIG_USB_OHCI_LITTLE_ENDIAN=y
30573 +# CONFIG_USB_UHCI_HCD is not set
30574 +# CONFIG_USB_SL811_HCD is not set
30575 +# CONFIG_USB_R8A66597_HCD is not set
30576 +
30577 +#
30578 +# USB Device Class drivers
30579 +#
30580 +# CONFIG_USB_ACM is not set
30581 +# CONFIG_USB_PRINTER is not set
30582 +
30583 +#
30584 +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
30585 +#
30586 +
30587 +#
30588 +# may also be needed; see USB_STORAGE Help for more information
30589 +#
30590 +CONFIG_USB_STORAGE=y
30591 +# CONFIG_USB_STORAGE_DEBUG is not set
30592 +# CONFIG_USB_STORAGE_DATAFAB is not set
30593 +# CONFIG_USB_STORAGE_FREECOM is not set
30594 +# CONFIG_USB_STORAGE_ISD200 is not set
30595 +# CONFIG_USB_STORAGE_DPCM is not set
30596 +# CONFIG_USB_STORAGE_USBAT is not set
30597 +# CONFIG_USB_STORAGE_SDDR09 is not set
30598 +# CONFIG_USB_STORAGE_SDDR55 is not set
30599 +# CONFIG_USB_STORAGE_JUMPSHOT is not set
30600 +# CONFIG_USB_STORAGE_ALAUDA is not set
30601 +# CONFIG_USB_STORAGE_KARMA is not set
30602 +# CONFIG_USB_LIBUSUAL is not set
30603 +
30604 +#
30605 +# USB Imaging devices
30606 +#
30607 +# CONFIG_USB_MDC800 is not set
30608 +# CONFIG_USB_MICROTEK is not set
30609 +CONFIG_USB_MON=y
30610 +
30611 +#
30612 +# USB port drivers
30613 +#
30614 +
30615 +#
30616 +# USB Serial Converter support
30617 +#
30618 +# CONFIG_USB_SERIAL is not set
30619 +
30620 +#
30621 +# USB Miscellaneous drivers
30622 +#
30623 +# CONFIG_USB_EMI62 is not set
30624 +# CONFIG_USB_EMI26 is not set
30625 +# CONFIG_USB_ADUTUX is not set
30626 +# CONFIG_USB_AUERSWALD is not set
30627 +# CONFIG_USB_RIO500 is not set
30628 +# CONFIG_USB_LEGOTOWER is not set
30629 +# CONFIG_USB_LCD is not set
30630 +# CONFIG_USB_BERRY_CHARGE is not set
30631 +# CONFIG_USB_LED is not set
30632 +# CONFIG_USB_CYPRESS_CY7C63 is not set
30633 +# CONFIG_USB_CYTHERM is not set
30634 +# CONFIG_USB_PHIDGET is not set
30635 +# CONFIG_USB_IDMOUSE is not set
30636 +# CONFIG_USB_FTDI_ELAN is not set
30637 +# CONFIG_USB_APPLEDISPLAY is not set
30638 +# CONFIG_USB_LD is not set
30639 +# CONFIG_USB_TRANCEVIBRATOR is not set
30640 +# CONFIG_USB_IOWARRIOR is not set
30641 +# CONFIG_USB_TEST is not set
30642 +
30643 +#
30644 +# USB DSL modem support
30645 +#
30646 +
30647 +#
30648 +# USB Gadget Support
30649 +#
30650 +# CONFIG_USB_GADGET is not set
30651 +# CONFIG_MMC is not set
30652 +CONFIG_NEW_LEDS=y
30653 +CONFIG_LEDS_CLASS=y
30654 +
30655 +#
30656 +# LED drivers
30657 +#
30658 +
30659 +#
30660 +# LED Triggers
30661 +#
30662 +CONFIG_LEDS_TRIGGERS=y
30663 +CONFIG_LEDS_TRIGGER_TIMER=y
30664 +# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set
30665 +# CONFIG_INFINIBAND is not set
30666 +# CONFIG_EDAC is not set
30667 +# CONFIG_RTC_CLASS is not set
30668 +
30669 +#
30670 +# Userspace I/O
30671 +#
30672 +# CONFIG_UIO is not set
30673 +
30674 +#
30675 +# File systems
30676 +#
30677 +CONFIG_EXT2_FS=y
30678 +# CONFIG_EXT2_FS_XATTR is not set
30679 +# CONFIG_EXT2_FS_XIP is not set
30680 +CONFIG_EXT3_FS=y
30681 +CONFIG_EXT3_FS_XATTR=y
30682 +# CONFIG_EXT3_FS_POSIX_ACL is not set
30683 +# CONFIG_EXT3_FS_SECURITY is not set
30684 +# CONFIG_EXT4DEV_FS is not set
30685 +CONFIG_JBD=y
30686 +CONFIG_FS_MBCACHE=y
30687 +# CONFIG_REISERFS_FS is not set
30688 +# CONFIG_JFS_FS is not set
30689 +# CONFIG_FS_POSIX_ACL is not set
30690 +# CONFIG_XFS_FS is not set
30691 +# CONFIG_GFS2_FS is not set
30692 +# CONFIG_OCFS2_FS is not set
30693 +# CONFIG_MINIX_FS is not set
30694 +# CONFIG_ROMFS_FS is not set
30695 +CONFIG_INOTIFY=y
30696 +CONFIG_INOTIFY_USER=y
30697 +# CONFIG_QUOTA is not set
30698 +CONFIG_DNOTIFY=y
30699 +# CONFIG_AUTOFS_FS is not set
30700 +# CONFIG_AUTOFS4_FS is not set
30701 +# CONFIG_FUSE_FS is not set
30702 +
30703 +#
30704 +# CD-ROM/DVD Filesystems
30705 +#
30706 +# CONFIG_ISO9660_FS is not set
30707 +# CONFIG_UDF_FS is not set
30708 +
30709 +#
30710 +# DOS/FAT/NT Filesystems
30711 +#
30712 +CONFIG_FAT_FS=y
30713 +CONFIG_MSDOS_FS=y
30714 +CONFIG_VFAT_FS=y
30715 +CONFIG_FAT_DEFAULT_CODEPAGE=437
30716 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
30717 +# CONFIG_NTFS_FS is not set
30718 +
30719 +#
30720 +# Pseudo filesystems
30721 +#
30722 +CONFIG_PROC_FS=y
30723 +CONFIG_PROC_KCORE=y
30724 +CONFIG_PROC_SYSCTL=y
30725 +CONFIG_SYSFS=y
30726 +CONFIG_TMPFS=y
30727 +# CONFIG_TMPFS_POSIX_ACL is not set
30728 +# CONFIG_HUGETLB_PAGE is not set
30729 +# CONFIG_CONFIGFS_FS is not set
30730 +
30731 +#
30732 +# Miscellaneous filesystems
30733 +#
30734 +# CONFIG_ADFS_FS is not set
30735 +# CONFIG_AFFS_FS is not set
30736 +# CONFIG_HFS_FS is not set
30737 +# CONFIG_HFSPLUS_FS is not set
30738 +# CONFIG_BEFS_FS is not set
30739 +# CONFIG_BFS_FS is not set
30740 +# CONFIG_EFS_FS is not set
30741 +CONFIG_JFFS2_FS=y
30742 +CONFIG_JFFS2_FS_DEBUG=0
30743 +CONFIG_JFFS2_FS_WRITEBUFFER=y
30744 +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
30745 +# CONFIG_JFFS2_SUMMARY is not set
30746 +# CONFIG_JFFS2_FS_XATTR is not set
30747 +# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
30748 +CONFIG_JFFS2_ZLIB=y
30749 +# CONFIG_JFFS2_LZO is not set
30750 +CONFIG_JFFS2_RTIME=y
30751 +# CONFIG_JFFS2_RUBIN is not set
30752 +CONFIG_CRAMFS=y
30753 +# CONFIG_VXFS_FS is not set
30754 +# CONFIG_HPFS_FS is not set
30755 +# CONFIG_QNX4FS_FS is not set
30756 +# CONFIG_SYSV_FS is not set
30757 +# CONFIG_UFS_FS is not set
30758 +CONFIG_NETWORK_FILESYSTEMS=y
30759 +CONFIG_NFS_FS=y
30760 +CONFIG_NFS_V3=y
30761 +# CONFIG_NFS_V3_ACL is not set
30762 +CONFIG_NFS_V4=y
30763 +# CONFIG_NFS_DIRECTIO is not set
30764 +# CONFIG_NFSD is not set
30765 +CONFIG_ROOT_NFS=y
30766 +CONFIG_LOCKD=y
30767 +CONFIG_LOCKD_V4=y
30768 +CONFIG_NFS_COMMON=y
30769 +CONFIG_SUNRPC=y
30770 +CONFIG_SUNRPC_GSS=y
30771 +# CONFIG_SUNRPC_BIND34 is not set
30772 +CONFIG_RPCSEC_GSS_KRB5=y
30773 +# CONFIG_RPCSEC_GSS_SPKM3 is not set
30774 +# CONFIG_SMB_FS is not set
30775 +# CONFIG_CIFS is not set
30776 +# CONFIG_NCP_FS is not set
30777 +# CONFIG_CODA_FS is not set
30778 +# CONFIG_AFS_FS is not set
30779 +
30780 +#
30781 +# Partition Types
30782 +#
30783 +# CONFIG_PARTITION_ADVANCED is not set
30784 +CONFIG_MSDOS_PARTITION=y
30785 +CONFIG_NLS=y
30786 +CONFIG_NLS_DEFAULT="iso8859-1"
30787 +CONFIG_NLS_CODEPAGE_437=y
30788 +# CONFIG_NLS_CODEPAGE_737 is not set
30789 +# CONFIG_NLS_CODEPAGE_775 is not set
30790 +# CONFIG_NLS_CODEPAGE_850 is not set
30791 +# CONFIG_NLS_CODEPAGE_852 is not set
30792 +# CONFIG_NLS_CODEPAGE_855 is not set
30793 +# CONFIG_NLS_CODEPAGE_857 is not set
30794 +# CONFIG_NLS_CODEPAGE_860 is not set
30795 +# CONFIG_NLS_CODEPAGE_861 is not set
30796 +# CONFIG_NLS_CODEPAGE_862 is not set
30797 +# CONFIG_NLS_CODEPAGE_863 is not set
30798 +# CONFIG_NLS_CODEPAGE_864 is not set
30799 +# CONFIG_NLS_CODEPAGE_865 is not set
30800 +# CONFIG_NLS_CODEPAGE_866 is not set
30801 +# CONFIG_NLS_CODEPAGE_869 is not set
30802 +# CONFIG_NLS_CODEPAGE_936 is not set
30803 +# CONFIG_NLS_CODEPAGE_950 is not set
30804 +# CONFIG_NLS_CODEPAGE_932 is not set
30805 +# CONFIG_NLS_CODEPAGE_949 is not set
30806 +# CONFIG_NLS_CODEPAGE_874 is not set
30807 +# CONFIG_NLS_ISO8859_8 is not set
30808 +# CONFIG_NLS_CODEPAGE_1250 is not set
30809 +# CONFIG_NLS_CODEPAGE_1251 is not set
30810 +# CONFIG_NLS_ASCII is not set
30811 +CONFIG_NLS_ISO8859_1=y
30812 +# CONFIG_NLS_ISO8859_2 is not set
30813 +# CONFIG_NLS_ISO8859_3 is not set
30814 +# CONFIG_NLS_ISO8859_4 is not set
30815 +# CONFIG_NLS_ISO8859_5 is not set
30816 +# CONFIG_NLS_ISO8859_6 is not set
30817 +# CONFIG_NLS_ISO8859_7 is not set
30818 +# CONFIG_NLS_ISO8859_9 is not set
30819 +# CONFIG_NLS_ISO8859_13 is not set
30820 +# CONFIG_NLS_ISO8859_14 is not set
30821 +# CONFIG_NLS_ISO8859_15 is not set
30822 +# CONFIG_NLS_KOI8_R is not set
30823 +# CONFIG_NLS_KOI8_U is not set
30824 +# CONFIG_NLS_UTF8 is not set
30825 +# CONFIG_DLM is not set
30826 +# CONFIG_UCC_SLOW is not set
30827 +
30828 +#
30829 +# Library routines
30830 +#
30831 +CONFIG_BITREVERSE=y
30832 +# CONFIG_CRC_CCITT is not set
30833 +# CONFIG_CRC16 is not set
30834 +# CONFIG_CRC_ITU_T is not set
30835 +CONFIG_CRC32=y
30836 +# CONFIG_CRC7 is not set
30837 +# CONFIG_LIBCRC32C is not set
30838 +CONFIG_ZLIB_INFLATE=y
30839 +CONFIG_ZLIB_DEFLATE=y
30840 +CONFIG_PLIST=y
30841 +CONFIG_HAS_IOMEM=y
30842 +CONFIG_HAS_IOPORT=y
30843 +CONFIG_HAS_DMA=y
30844 +# CONFIG_INSTRUMENTATION is not set
30845 +
30846 +#
30847 +# Kernel hacking
30848 +#
30849 +CONFIG_PRINTK_TIME=y
30850 +CONFIG_ENABLE_WARN_DEPRECATED=y
30851 +CONFIG_ENABLE_MUST_CHECK=y
30852 +# CONFIG_MAGIC_SYSRQ is not set
30853 +# CONFIG_UNUSED_SYMBOLS is not set
30854 +# CONFIG_DEBUG_FS is not set
30855 +# CONFIG_HEADERS_CHECK is not set
30856 +CONFIG_DEBUG_KERNEL=y
30857 +# CONFIG_DEBUG_SHIRQ is not set
30858 +CONFIG_DETECT_SOFTLOCKUP=y
30859 +CONFIG_SCHED_DEBUG=y
30860 +# CONFIG_SCHEDSTATS is not set
30861 +# CONFIG_TIMER_STATS is not set
30862 +# CONFIG_SLUB_DEBUG_ON is not set
30863 +# CONFIG_DEBUG_RT_MUTEXES is not set
30864 +# CONFIG_RT_MUTEX_TESTER is not set
30865 +# CONFIG_DEBUG_SPINLOCK is not set
30866 +# CONFIG_DEBUG_MUTEXES is not set
30867 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
30868 +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
30869 +# CONFIG_DEBUG_KOBJECT is not set
30870 +# CONFIG_DEBUG_BUGVERBOSE is not set
30871 +CONFIG_DEBUG_INFO=y
30872 +# CONFIG_DEBUG_VM is not set
30873 +# CONFIG_DEBUG_LIST is not set
30874 +# CONFIG_DEBUG_SG is not set
30875 +CONFIG_FORCED_INLINING=y
30876 +# CONFIG_BOOT_PRINTK_DELAY is not set
30877 +# CONFIG_RCU_TORTURE_TEST is not set
30878 +# CONFIG_FAULT_INJECTION is not set
30879 +# CONFIG_SAMPLES is not set
30880 +# CONFIG_DEBUG_STACKOVERFLOW is not set
30881 +# CONFIG_DEBUG_STACK_USAGE is not set
30882 +# CONFIG_DEBUG_PAGEALLOC is not set
30883 +# CONFIG_DEBUGGER is not set
30884 +# CONFIG_BDI_SWITCH is not set
30885 +# CONFIG_BOOTX_TEXT is not set
30886 +# CONFIG_PPC_EARLY_DEBUG is not set
30887 +
30888 +#
30889 +# Security options
30890 +#
30891 +# CONFIG_KEYS is not set
30892 +# CONFIG_SECURITY is not set
30893 +# CONFIG_SECURITY_FILE_CAPABILITIES is not set
30894 +CONFIG_CRYPTO=y
30895 +CONFIG_CRYPTO_ALGAPI=y
30896 +CONFIG_CRYPTO_BLKCIPHER=y
30897 +CONFIG_CRYPTO_MANAGER=y
30898 +# CONFIG_CRYPTO_HMAC is not set
30899 +# CONFIG_CRYPTO_XCBC is not set
30900 +# CONFIG_CRYPTO_NULL is not set
30901 +# CONFIG_CRYPTO_MD4 is not set
30902 +CONFIG_CRYPTO_MD5=y
30903 +# CONFIG_CRYPTO_SHA1 is not set
30904 +# CONFIG_CRYPTO_SHA256 is not set
30905 +# CONFIG_CRYPTO_SHA512 is not set
30906 +# CONFIG_CRYPTO_WP512 is not set
30907 +# CONFIG_CRYPTO_TGR192 is not set
30908 +# CONFIG_CRYPTO_GF128MUL is not set
30909 +# CONFIG_CRYPTO_ECB is not set
30910 +CONFIG_CRYPTO_CBC=y
30911 +# CONFIG_CRYPTO_PCBC is not set
30912 +# CONFIG_CRYPTO_LRW is not set
30913 +# CONFIG_CRYPTO_XTS is not set
30914 +# CONFIG_CRYPTO_CRYPTD is not set
30915 +CONFIG_CRYPTO_DES=y
30916 +# CONFIG_CRYPTO_FCRYPT is not set
30917 +# CONFIG_CRYPTO_BLOWFISH is not set
30918 +# CONFIG_CRYPTO_TWOFISH is not set
30919 +# CONFIG_CRYPTO_SERPENT is not set
30920 +# CONFIG_CRYPTO_AES is not set
30921 +# CONFIG_CRYPTO_CAST5 is not set
30922 +# CONFIG_CRYPTO_CAST6 is not set
30923 +# CONFIG_CRYPTO_TEA is not set
30924 +# CONFIG_CRYPTO_ARC4 is not set
30925 +# CONFIG_CRYPTO_KHAZAD is not set
30926 +# CONFIG_CRYPTO_ANUBIS is not set
30927 +# CONFIG_CRYPTO_SEED is not set
30928 +# CONFIG_CRYPTO_DEFLATE is not set
30929 +# CONFIG_CRYPTO_MICHAEL_MIC is not set
30930 +# CONFIG_CRYPTO_CRC32C is not set
30931 +# CONFIG_CRYPTO_CAMELLIA is not set
30932 +# CONFIG_CRYPTO_TEST is not set
30933 +# CONFIG_CRYPTO_AUTHENC is not set
30934 +CONFIG_CRYPTO_HW=y
30935 +CONFIG_PPC_CLOCK=y
30936 +CONFIG_PPC_LIB_RHEAP=y
30937 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/configs/mpc8313_rdb_defconfig powerpc.git/arch/powerpc/configs/mpc8313_rdb_defconfig
30938 --- linux-2.6.24/arch/powerpc/configs/mpc8313_rdb_defconfig     2008-01-24 23:58:37.000000000 +0100
30939 +++ powerpc.git/arch/powerpc/configs/mpc8313_rdb_defconfig      2008-01-28 20:25:49.000000000 +0100
30940 @@ -1,7 +1,7 @@
30941  #
30942  # Automatically generated make config: don't edit
30943 -# Linux kernel version: 2.6.24-rc4
30944 -# Thu Dec  6 16:48:31 2007
30945 +# Linux kernel version: 2.6.24-rc6
30946 +# Thu Jan 17 16:35:55 2008
30947  #
30948  # CONFIG_PPC64 is not set
30949  
30950 @@ -144,6 +144,7 @@
30951  # CONFIG_MPC834x_MDS is not set
30952  # CONFIG_MPC834x_ITX is not set
30953  # CONFIG_MPC836x_MDS is not set
30954 +# CONFIG_MPC837x_MDS is not set
30955  CONFIG_PPC_MPC831x=y
30956  # CONFIG_MPIC is not set
30957  # CONFIG_MPIC_WEIRD is not set
30958 @@ -336,15 +337,16 @@
30959  CONFIG_MTD=y
30960  # CONFIG_MTD_DEBUG is not set
30961  # CONFIG_MTD_CONCAT is not set
30962 -# CONFIG_MTD_PARTITIONS is not set
30963 +CONFIG_MTD_PARTITIONS=y
30964 +# CONFIG_MTD_REDBOOT_PARTS is not set
30965 +# CONFIG_MTD_CMDLINE_PARTS is not set
30966  
30967  #
30968  # User Modules And Translation Layers
30969  #
30970  CONFIG_MTD_CHAR=y
30971 -# CONFIG_MTD_BLKDEVS is not set
30972 -# CONFIG_MTD_BLOCK is not set
30973 -# CONFIG_MTD_BLOCK_RO is not set
30974 +CONFIG_MTD_BLKDEVS=y
30975 +CONFIG_MTD_BLOCK=y
30976  # CONFIG_FTL is not set
30977  # CONFIG_NFTL is not set
30978  # CONFIG_INFTL is not set
30979 @@ -381,11 +383,8 @@
30980  # Mapping drivers for chip access
30981  #
30982  # CONFIG_MTD_COMPLEX_MAPPINGS is not set
30983 -CONFIG_MTD_PHYSMAP=y
30984 -CONFIG_MTD_PHYSMAP_START=0xfe000000
30985 -CONFIG_MTD_PHYSMAP_LEN=0x1000000
30986 -CONFIG_MTD_PHYSMAP_BANKWIDTH=2
30987 -# CONFIG_MTD_PHYSMAP_OF is not set
30988 +# CONFIG_MTD_PHYSMAP is not set
30989 +CONFIG_MTD_PHYSMAP_OF=y
30990  # CONFIG_MTD_INTEL_VR_NOR is not set
30991  # CONFIG_MTD_PLATRAM is not set
30992  
30993 @@ -406,7 +405,16 @@
30994  # CONFIG_MTD_DOC2000 is not set
30995  # CONFIG_MTD_DOC2001 is not set
30996  # CONFIG_MTD_DOC2001PLUS is not set
30997 -# CONFIG_MTD_NAND is not set
30998 +CONFIG_MTD_NAND=y
30999 +CONFIG_MTD_NAND_VERIFY_WRITE=y
31000 +# CONFIG_MTD_NAND_ECC_SMC is not set
31001 +# CONFIG_MTD_NAND_MUSEUM_IDS is not set
31002 +CONFIG_MTD_NAND_IDS=y
31003 +# CONFIG_MTD_NAND_DISKONCHIP is not set
31004 +# CONFIG_MTD_NAND_CAFE is not set
31005 +# CONFIG_MTD_NAND_NANDSIM is not set
31006 +# CONFIG_MTD_NAND_PLATFORM is not set
31007 +# CONFIG_MTD_ALAUDA is not set
31008  # CONFIG_MTD_ONENAND is not set
31009  
31010  #
31011 @@ -1178,7 +1186,17 @@
31012  # CONFIG_BEFS_FS is not set
31013  # CONFIG_BFS_FS is not set
31014  # CONFIG_EFS_FS is not set
31015 -# CONFIG_JFFS2_FS is not set
31016 +CONFIG_JFFS2_FS=y
31017 +CONFIG_JFFS2_FS_DEBUG=0
31018 +CONFIG_JFFS2_FS_WRITEBUFFER=y
31019 +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
31020 +# CONFIG_JFFS2_SUMMARY is not set
31021 +# CONFIG_JFFS2_FS_XATTR is not set
31022 +# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
31023 +CONFIG_JFFS2_ZLIB=y
31024 +# CONFIG_JFFS2_LZO is not set
31025 +CONFIG_JFFS2_RTIME=y
31026 +# CONFIG_JFFS2_RUBIN is not set
31027  # CONFIG_CRAMFS is not set
31028  # CONFIG_VXFS_FS is not set
31029  # CONFIG_HPFS_FS is not set
31030 @@ -1242,6 +1260,8 @@
31031  CONFIG_CRC32=y
31032  # CONFIG_CRC7 is not set
31033  # CONFIG_LIBCRC32C is not set
31034 +CONFIG_ZLIB_INFLATE=y
31035 +CONFIG_ZLIB_DEFLATE=y
31036  CONFIG_PLIST=y
31037  CONFIG_HAS_IOMEM=y
31038  CONFIG_HAS_IOPORT=y
31039 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/configs/mpc834x_itx_defconfig powerpc.git/arch/powerpc/configs/mpc834x_itx_defconfig
31040 --- linux-2.6.24/arch/powerpc/configs/mpc834x_itx_defconfig     2008-01-24 23:58:37.000000000 +0100
31041 +++ powerpc.git/arch/powerpc/configs/mpc834x_itx_defconfig      2008-01-28 20:25:49.000000000 +0100
31042 @@ -570,7 +570,8 @@
31043  # CONFIG_PATA_SIS is not set
31044  # CONFIG_PATA_VIA is not set
31045  # CONFIG_PATA_WINBOND is not set
31046 -# CONFIG_PATA_PLATFORM is not set
31047 +CONFIG_PATA_PLATFORM=y
31048 +CONFIG_PATA_OF_PLATFORM=y
31049  CONFIG_MD=y
31050  CONFIG_BLK_DEV_MD=y
31051  CONFIG_MD_LINEAR=y
31052 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/configs/mpc837x_mds_defconfig powerpc.git/arch/powerpc/configs/mpc837x_mds_defconfig
31053 --- linux-2.6.24/arch/powerpc/configs/mpc837x_mds_defconfig     1970-01-01 01:00:00.000000000 +0100
31054 +++ powerpc.git/arch/powerpc/configs/mpc837x_mds_defconfig      2008-01-28 20:25:49.000000000 +0100
31055 @@ -0,0 +1,878 @@
31056 +#
31057 +# Automatically generated make config: don't edit
31058 +# Linux kernel version: 2.6.23
31059 +# Wed Oct 10 16:31:39 2007
31060 +#
31061 +# CONFIG_PPC64 is not set
31062 +
31063 +#
31064 +# Processor support
31065 +#
31066 +CONFIG_6xx=y
31067 +# CONFIG_PPC_85xx is not set
31068 +# CONFIG_PPC_8xx is not set
31069 +# CONFIG_40x is not set
31070 +# CONFIG_44x is not set
31071 +# CONFIG_E200 is not set
31072 +CONFIG_83xx=y
31073 +CONFIG_PPC_FPU=y
31074 +CONFIG_PPC_STD_MMU=y
31075 +CONFIG_PPC_STD_MMU_32=y
31076 +# CONFIG_PPC_MM_SLICES is not set
31077 +# CONFIG_SMP is not set
31078 +CONFIG_PPC32=y
31079 +CONFIG_PPC_MERGE=y
31080 +CONFIG_MMU=y
31081 +CONFIG_GENERIC_HARDIRQS=y
31082 +CONFIG_IRQ_PER_CPU=y
31083 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
31084 +CONFIG_ARCH_HAS_ILOG2_U32=y
31085 +CONFIG_GENERIC_HWEIGHT=y
31086 +CONFIG_GENERIC_CALIBRATE_DELAY=y
31087 +CONFIG_GENERIC_FIND_NEXT_BIT=y
31088 +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
31089 +CONFIG_PPC=y
31090 +CONFIG_EARLY_PRINTK=y
31091 +CONFIG_GENERIC_NVRAM=y
31092 +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
31093 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
31094 +CONFIG_PPC_OF=y
31095 +CONFIG_OF=y
31096 +CONFIG_PPC_UDBG_16550=y
31097 +# CONFIG_GENERIC_TBSYNC is not set
31098 +CONFIG_AUDIT_ARCH=y
31099 +CONFIG_GENERIC_BUG=y
31100 +CONFIG_DEFAULT_UIMAGE=y
31101 +# CONFIG_PPC_DCR_NATIVE is not set
31102 +# CONFIG_PPC_DCR_MMIO is not set
31103 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
31104 +
31105 +#
31106 +# General setup
31107 +#
31108 +CONFIG_EXPERIMENTAL=y
31109 +CONFIG_BROKEN_ON_SMP=y
31110 +CONFIG_INIT_ENV_ARG_LIMIT=32
31111 +CONFIG_LOCALVERSION=""
31112 +CONFIG_LOCALVERSION_AUTO=y
31113 +CONFIG_SWAP=y
31114 +CONFIG_SYSVIPC=y
31115 +CONFIG_SYSVIPC_SYSCTL=y
31116 +# CONFIG_POSIX_MQUEUE is not set
31117 +# CONFIG_BSD_PROCESS_ACCT is not set
31118 +# CONFIG_TASKSTATS is not set
31119 +# CONFIG_USER_NS is not set
31120 +# CONFIG_AUDIT is not set
31121 +# CONFIG_IKCONFIG is not set
31122 +CONFIG_LOG_BUF_SHIFT=14
31123 +CONFIG_SYSFS_DEPRECATED=y
31124 +# CONFIG_RELAY is not set
31125 +CONFIG_BLK_DEV_INITRD=y
31126 +CONFIG_INITRAMFS_SOURCE=""
31127 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
31128 +CONFIG_SYSCTL=y
31129 +CONFIG_EMBEDDED=y
31130 +CONFIG_SYSCTL_SYSCALL=y
31131 +CONFIG_KALLSYMS=y
31132 +# CONFIG_KALLSYMS_EXTRA_PASS is not set
31133 +CONFIG_HOTPLUG=y
31134 +CONFIG_PRINTK=y
31135 +CONFIG_BUG=y
31136 +CONFIG_ELF_CORE=y
31137 +CONFIG_BASE_FULL=y
31138 +CONFIG_FUTEX=y
31139 +CONFIG_ANON_INODES=y
31140 +# CONFIG_EPOLL is not set
31141 +CONFIG_SIGNALFD=y
31142 +CONFIG_EVENTFD=y
31143 +CONFIG_SHMEM=y
31144 +CONFIG_VM_EVENT_COUNTERS=y
31145 +CONFIG_SLAB=y
31146 +# CONFIG_SLUB is not set
31147 +# CONFIG_SLOB is not set
31148 +CONFIG_RT_MUTEXES=y
31149 +# CONFIG_TINY_SHMEM is not set
31150 +CONFIG_BASE_SMALL=0
31151 +CONFIG_MODULES=y
31152 +CONFIG_MODULE_UNLOAD=y
31153 +# CONFIG_MODULE_FORCE_UNLOAD is not set
31154 +# CONFIG_MODVERSIONS is not set
31155 +# CONFIG_MODULE_SRCVERSION_ALL is not set
31156 +# CONFIG_KMOD is not set
31157 +CONFIG_BLOCK=y
31158 +# CONFIG_LBD is not set
31159 +# CONFIG_BLK_DEV_IO_TRACE is not set
31160 +# CONFIG_LSF is not set
31161 +# CONFIG_BLK_DEV_BSG is not set
31162 +
31163 +#
31164 +# IO Schedulers
31165 +#
31166 +CONFIG_IOSCHED_NOOP=y
31167 +CONFIG_IOSCHED_AS=y
31168 +CONFIG_IOSCHED_DEADLINE=y
31169 +CONFIG_IOSCHED_CFQ=y
31170 +CONFIG_DEFAULT_AS=y
31171 +# CONFIG_DEFAULT_DEADLINE is not set
31172 +# CONFIG_DEFAULT_CFQ is not set
31173 +# CONFIG_DEFAULT_NOOP is not set
31174 +CONFIG_DEFAULT_IOSCHED="anticipatory"
31175 +
31176 +#
31177 +# Platform support
31178 +#
31179 +# CONFIG_PPC_MULTIPLATFORM is not set
31180 +# CONFIG_EMBEDDED6xx is not set
31181 +# CONFIG_PPC_82xx is not set
31182 +CONFIG_PPC_83xx=y
31183 +# CONFIG_PPC_86xx is not set
31184 +# CONFIG_PPC_MPC52xx is not set
31185 +# CONFIG_PPC_MPC5200 is not set
31186 +# CONFIG_PPC_CELL is not set
31187 +# CONFIG_PPC_CELL_NATIVE is not set
31188 +# CONFIG_PQ2ADS is not set
31189 +# CONFIG_MPC8313_RDB is not set
31190 +# CONFIG_MPC832x_MDS is not set
31191 +# CONFIG_MPC832x_RDB is not set
31192 +# CONFIG_MPC834x_MDS is not set
31193 +# CONFIG_MPC834x_ITX is not set
31194 +# CONFIG_MPC836x_MDS is not set
31195 +CONFIG_MPC837x_MDS=y
31196 +CONFIG_PPC_MPC837x=y
31197 +# CONFIG_MPIC is not set
31198 +# CONFIG_MPIC_WEIRD is not set
31199 +# CONFIG_PPC_I8259 is not set
31200 +# CONFIG_PPC_RTAS is not set
31201 +# CONFIG_MMIO_NVRAM is not set
31202 +# CONFIG_PPC_MPC106 is not set
31203 +# CONFIG_PPC_970_NAP is not set
31204 +# CONFIG_PPC_INDIRECT_IO is not set
31205 +# CONFIG_GENERIC_IOMAP is not set
31206 +# CONFIG_CPU_FREQ is not set
31207 +# CONFIG_CPM2 is not set
31208 +# CONFIG_FSL_ULI1575 is not set
31209 +CONFIG_FSL_SERDES=y
31210 +
31211 +#
31212 +# Kernel options
31213 +#
31214 +# CONFIG_HIGHMEM is not set
31215 +# CONFIG_HZ_100 is not set
31216 +CONFIG_HZ_250=y
31217 +# CONFIG_HZ_300 is not set
31218 +# CONFIG_HZ_1000 is not set
31219 +CONFIG_HZ=250
31220 +CONFIG_PREEMPT_NONE=y
31221 +# CONFIG_PREEMPT_VOLUNTARY is not set
31222 +# CONFIG_PREEMPT is not set
31223 +CONFIG_BINFMT_ELF=y
31224 +# CONFIG_BINFMT_MISC is not set
31225 +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
31226 +CONFIG_ARCH_FLATMEM_ENABLE=y
31227 +CONFIG_ARCH_POPULATES_NODE_MAP=y
31228 +CONFIG_SELECT_MEMORY_MODEL=y
31229 +CONFIG_FLATMEM_MANUAL=y
31230 +# CONFIG_DISCONTIGMEM_MANUAL is not set
31231 +# CONFIG_SPARSEMEM_MANUAL is not set
31232 +CONFIG_FLATMEM=y
31233 +CONFIG_FLAT_NODE_MEM_MAP=y
31234 +# CONFIG_SPARSEMEM_STATIC is not set
31235 +CONFIG_SPLIT_PTLOCK_CPUS=4
31236 +# CONFIG_RESOURCES_64BIT is not set
31237 +CONFIG_ZONE_DMA_FLAG=1
31238 +CONFIG_BOUNCE=y
31239 +CONFIG_VIRT_TO_BUS=y
31240 +CONFIG_PROC_DEVICETREE=y
31241 +# CONFIG_CMDLINE_BOOL is not set
31242 +# CONFIG_PM is not set
31243 +CONFIG_SUSPEND_UP_POSSIBLE=y
31244 +CONFIG_HIBERNATION_UP_POSSIBLE=y
31245 +CONFIG_SECCOMP=y
31246 +CONFIG_WANT_DEVICE_TREE=y
31247 +CONFIG_DEVICE_TREE=""
31248 +CONFIG_ISA_DMA_API=y
31249 +
31250 +#
31251 +# Bus options
31252 +#
31253 +CONFIG_ZONE_DMA=y
31254 +CONFIG_GENERIC_ISA_DMA=y
31255 +CONFIG_PPC_INDIRECT_PCI=y
31256 +CONFIG_FSL_SOC=y
31257 +# CONFIG_PCI is not set
31258 +# CONFIG_PCI_DOMAINS is not set
31259 +# CONFIG_PCI_SYSCALL is not set
31260 +# CONFIG_ARCH_SUPPORTS_MSI is not set
31261 +
31262 +#
31263 +# PCCARD (PCMCIA/CardBus) support
31264 +#
31265 +# CONFIG_PCCARD is not set
31266 +
31267 +#
31268 +# Advanced setup
31269 +#
31270 +# CONFIG_ADVANCED_OPTIONS is not set
31271 +
31272 +#
31273 +# Default settings for advanced configuration options are used
31274 +#
31275 +CONFIG_HIGHMEM_START=0xfe000000
31276 +CONFIG_LOWMEM_SIZE=0x30000000
31277 +CONFIG_KERNEL_START=0xc0000000
31278 +CONFIG_TASK_SIZE=0x80000000
31279 +CONFIG_BOOT_LOAD=0x00800000
31280 +
31281 +#
31282 +# Networking
31283 +#
31284 +CONFIG_NET=y
31285 +
31286 +#
31287 +# Networking options
31288 +#
31289 +CONFIG_PACKET=y
31290 +# CONFIG_PACKET_MMAP is not set
31291 +CONFIG_UNIX=y
31292 +CONFIG_XFRM=y
31293 +CONFIG_XFRM_USER=m
31294 +# CONFIG_XFRM_SUB_POLICY is not set
31295 +# CONFIG_XFRM_MIGRATE is not set
31296 +# CONFIG_NET_KEY is not set
31297 +CONFIG_INET=y
31298 +CONFIG_IP_MULTICAST=y
31299 +# CONFIG_IP_ADVANCED_ROUTER is not set
31300 +CONFIG_IP_FIB_HASH=y
31301 +CONFIG_IP_PNP=y
31302 +CONFIG_IP_PNP_DHCP=y
31303 +CONFIG_IP_PNP_BOOTP=y
31304 +# CONFIG_IP_PNP_RARP is not set
31305 +# CONFIG_NET_IPIP is not set
31306 +# CONFIG_NET_IPGRE is not set
31307 +# CONFIG_IP_MROUTE is not set
31308 +# CONFIG_ARPD is not set
31309 +CONFIG_SYN_COOKIES=y
31310 +# CONFIG_INET_AH is not set
31311 +# CONFIG_INET_ESP is not set
31312 +# CONFIG_INET_IPCOMP is not set
31313 +# CONFIG_INET_XFRM_TUNNEL is not set
31314 +# CONFIG_INET_TUNNEL is not set
31315 +CONFIG_INET_XFRM_MODE_TRANSPORT=y
31316 +CONFIG_INET_XFRM_MODE_TUNNEL=y
31317 +CONFIG_INET_XFRM_MODE_BEET=y
31318 +CONFIG_INET_DIAG=y
31319 +CONFIG_INET_TCP_DIAG=y
31320 +# CONFIG_TCP_CONG_ADVANCED is not set
31321 +CONFIG_TCP_CONG_CUBIC=y
31322 +CONFIG_DEFAULT_TCP_CONG="cubic"
31323 +# CONFIG_TCP_MD5SIG is not set
31324 +# CONFIG_IPV6 is not set
31325 +# CONFIG_INET6_XFRM_TUNNEL is not set
31326 +# CONFIG_INET6_TUNNEL is not set
31327 +# CONFIG_NETWORK_SECMARK is not set
31328 +# CONFIG_NETFILTER is not set
31329 +# CONFIG_IP_DCCP is not set
31330 +# CONFIG_IP_SCTP is not set
31331 +# CONFIG_TIPC is not set
31332 +# CONFIG_ATM is not set
31333 +# CONFIG_BRIDGE is not set
31334 +# CONFIG_VLAN_8021Q is not set
31335 +# CONFIG_DECNET is not set
31336 +# CONFIG_LLC2 is not set
31337 +# CONFIG_IPX is not set
31338 +# CONFIG_ATALK is not set
31339 +# CONFIG_X25 is not set
31340 +# CONFIG_LAPB is not set
31341 +# CONFIG_ECONET is not set
31342 +# CONFIG_WAN_ROUTER is not set
31343 +
31344 +#
31345 +# QoS and/or fair queueing
31346 +#
31347 +# CONFIG_NET_SCHED is not set
31348 +
31349 +#
31350 +# Network testing
31351 +#
31352 +# CONFIG_NET_PKTGEN is not set
31353 +# CONFIG_HAMRADIO is not set
31354 +# CONFIG_IRDA is not set
31355 +# CONFIG_BT is not set
31356 +# CONFIG_AF_RXRPC is not set
31357 +
31358 +#
31359 +# Wireless
31360 +#
31361 +# CONFIG_CFG80211 is not set
31362 +# CONFIG_WIRELESS_EXT is not set
31363 +# CONFIG_MAC80211 is not set
31364 +# CONFIG_IEEE80211 is not set
31365 +# CONFIG_RFKILL is not set
31366 +# CONFIG_NET_9P is not set
31367 +
31368 +#
31369 +# Device Drivers
31370 +#
31371 +
31372 +#
31373 +# Generic Driver Options
31374 +#
31375 +CONFIG_STANDALONE=y
31376 +CONFIG_PREVENT_FIRMWARE_BUILD=y
31377 +# CONFIG_FW_LOADER is not set
31378 +# CONFIG_SYS_HYPERVISOR is not set
31379 +# CONFIG_CONNECTOR is not set
31380 +# CONFIG_MTD is not set
31381 +CONFIG_OF_DEVICE=y
31382 +# CONFIG_PARPORT is not set
31383 +CONFIG_BLK_DEV=y
31384 +# CONFIG_BLK_DEV_FD is not set
31385 +# CONFIG_BLK_DEV_COW_COMMON is not set
31386 +CONFIG_BLK_DEV_LOOP=y
31387 +# CONFIG_BLK_DEV_CRYPTOLOOP is not set
31388 +# CONFIG_BLK_DEV_NBD is not set
31389 +CONFIG_BLK_DEV_RAM=y
31390 +CONFIG_BLK_DEV_RAM_COUNT=16
31391 +CONFIG_BLK_DEV_RAM_SIZE=32768
31392 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
31393 +# CONFIG_CDROM_PKTCDVD is not set
31394 +# CONFIG_ATA_OVER_ETH is not set
31395 +CONFIG_MISC_DEVICES=y
31396 +# CONFIG_EEPROM_93CX6 is not set
31397 +# CONFIG_IDE is not set
31398 +
31399 +#
31400 +# SCSI device support
31401 +#
31402 +# CONFIG_RAID_ATTRS is not set
31403 +CONFIG_SCSI=y
31404 +CONFIG_SCSI_DMA=y
31405 +# CONFIG_SCSI_TGT is not set
31406 +# CONFIG_SCSI_NETLINK is not set
31407 +CONFIG_SCSI_PROC_FS=y
31408 +
31409 +#
31410 +# SCSI support type (disk, tape, CD-ROM)
31411 +#
31412 +CONFIG_BLK_DEV_SD=y
31413 +# CONFIG_CHR_DEV_ST is not set
31414 +# CONFIG_CHR_DEV_OSST is not set
31415 +# CONFIG_BLK_DEV_SR is not set
31416 +CONFIG_CHR_DEV_SG=y
31417 +# CONFIG_CHR_DEV_SCH is not set
31418 +
31419 +#
31420 +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
31421 +#
31422 +# CONFIG_SCSI_MULTI_LUN is not set
31423 +# CONFIG_SCSI_CONSTANTS is not set
31424 +# CONFIG_SCSI_LOGGING is not set
31425 +# CONFIG_SCSI_SCAN_ASYNC is not set
31426 +CONFIG_SCSI_WAIT_SCAN=m
31427 +
31428 +#
31429 +# SCSI Transports
31430 +#
31431 +# CONFIG_SCSI_SPI_ATTRS is not set
31432 +# CONFIG_SCSI_FC_ATTRS is not set
31433 +# CONFIG_SCSI_ISCSI_ATTRS is not set
31434 +# CONFIG_SCSI_SAS_LIBSAS is not set
31435 +CONFIG_SCSI_LOWLEVEL=y
31436 +# CONFIG_ISCSI_TCP is not set
31437 +# CONFIG_SCSI_DEBUG is not set
31438 +CONFIG_ATA=y
31439 +# CONFIG_ATA_NONSTANDARD is not set
31440 +CONFIG_SATA_FSL=y
31441 +# CONFIG_PATA_PLATFORM is not set
31442 +# CONFIG_MD is not set
31443 +# CONFIG_MACINTOSH_DRIVERS is not set
31444 +CONFIG_NETDEVICES=y
31445 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
31446 +# CONFIG_DUMMY is not set
31447 +# CONFIG_BONDING is not set
31448 +# CONFIG_MACVLAN is not set
31449 +# CONFIG_EQUALIZER is not set
31450 +# CONFIG_TUN is not set
31451 +CONFIG_PHYLIB=y
31452 +
31453 +#
31454 +# MII PHY device drivers
31455 +#
31456 +CONFIG_MARVELL_PHY=y
31457 +# CONFIG_DAVICOM_PHY is not set
31458 +# CONFIG_QSEMI_PHY is not set
31459 +# CONFIG_LXT_PHY is not set
31460 +# CONFIG_CICADA_PHY is not set
31461 +# CONFIG_VITESSE_PHY is not set
31462 +# CONFIG_SMSC_PHY is not set
31463 +# CONFIG_BROADCOM_PHY is not set
31464 +# CONFIG_ICPLUS_PHY is not set
31465 +# CONFIG_FIXED_PHY is not set
31466 +CONFIG_NET_ETHERNET=y
31467 +CONFIG_MII=y
31468 +CONFIG_NETDEV_1000=y
31469 +CONFIG_GIANFAR=y
31470 +# CONFIG_GFAR_NAPI is not set
31471 +CONFIG_NETDEV_10000=y
31472 +
31473 +#
31474 +# Wireless LAN
31475 +#
31476 +# CONFIG_WLAN_PRE80211 is not set
31477 +# CONFIG_WLAN_80211 is not set
31478 +# CONFIG_WAN is not set
31479 +# CONFIG_PPP is not set
31480 +# CONFIG_SLIP is not set
31481 +# CONFIG_SHAPER is not set
31482 +# CONFIG_NETCONSOLE is not set
31483 +# CONFIG_NETPOLL is not set
31484 +# CONFIG_NET_POLL_CONTROLLER is not set
31485 +# CONFIG_ISDN is not set
31486 +# CONFIG_PHONE is not set
31487 +
31488 +#
31489 +# Input device support
31490 +#
31491 +CONFIG_INPUT=y
31492 +# CONFIG_INPUT_FF_MEMLESS is not set
31493 +# CONFIG_INPUT_POLLDEV is not set
31494 +
31495 +#
31496 +# Userland interfaces
31497 +#
31498 +# CONFIG_INPUT_MOUSEDEV is not set
31499 +# CONFIG_INPUT_JOYDEV is not set
31500 +# CONFIG_INPUT_TSDEV is not set
31501 +# CONFIG_INPUT_EVDEV is not set
31502 +# CONFIG_INPUT_EVBUG is not set
31503 +
31504 +#
31505 +# Input Device Drivers
31506 +#
31507 +# CONFIG_INPUT_KEYBOARD is not set
31508 +# CONFIG_INPUT_MOUSE is not set
31509 +# CONFIG_INPUT_JOYSTICK is not set
31510 +# CONFIG_INPUT_TABLET is not set
31511 +# CONFIG_INPUT_TOUCHSCREEN is not set
31512 +# CONFIG_INPUT_MISC is not set
31513 +
31514 +#
31515 +# Hardware I/O ports
31516 +#
31517 +# CONFIG_SERIO is not set
31518 +# CONFIG_GAMEPORT is not set
31519 +
31520 +#
31521 +# Character devices
31522 +#
31523 +# CONFIG_VT is not set
31524 +# CONFIG_SERIAL_NONSTANDARD is not set
31525 +
31526 +#
31527 +# Serial drivers
31528 +#
31529 +CONFIG_SERIAL_8250=y
31530 +CONFIG_SERIAL_8250_CONSOLE=y
31531 +CONFIG_SERIAL_8250_NR_UARTS=4
31532 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4
31533 +# CONFIG_SERIAL_8250_EXTENDED is not set
31534 +
31535 +#
31536 +# Non-8250 serial port support
31537 +#
31538 +# CONFIG_SERIAL_UARTLITE is not set
31539 +CONFIG_SERIAL_CORE=y
31540 +CONFIG_SERIAL_CORE_CONSOLE=y
31541 +# CONFIG_SERIAL_OF_PLATFORM is not set
31542 +CONFIG_UNIX98_PTYS=y
31543 +CONFIG_LEGACY_PTYS=y
31544 +CONFIG_LEGACY_PTY_COUNT=256
31545 +# CONFIG_IPMI_HANDLER is not set
31546 +CONFIG_WATCHDOG=y
31547 +# CONFIG_WATCHDOG_NOWAYOUT is not set
31548 +
31549 +#
31550 +# Watchdog Device Drivers
31551 +#
31552 +# CONFIG_SOFT_WATCHDOG is not set
31553 +CONFIG_83xx_WDT=y
31554 +# CONFIG_HW_RANDOM is not set
31555 +# CONFIG_NVRAM is not set
31556 +CONFIG_GEN_RTC=y
31557 +# CONFIG_GEN_RTC_X is not set
31558 +# CONFIG_R3964 is not set
31559 +# CONFIG_RAW_DRIVER is not set
31560 +# CONFIG_TCG_TPM is not set
31561 +CONFIG_I2C=y
31562 +CONFIG_I2C_BOARDINFO=y
31563 +CONFIG_I2C_CHARDEV=y
31564 +
31565 +#
31566 +# I2C Algorithms
31567 +#
31568 +# CONFIG_I2C_ALGOBIT is not set
31569 +# CONFIG_I2C_ALGOPCF is not set
31570 +# CONFIG_I2C_ALGOPCA is not set
31571 +
31572 +#
31573 +# I2C Hardware Bus support
31574 +#
31575 +CONFIG_I2C_MPC=y
31576 +# CONFIG_I2C_OCORES is not set
31577 +# CONFIG_I2C_PARPORT_LIGHT is not set
31578 +# CONFIG_I2C_SIMTEC is not set
31579 +# CONFIG_I2C_TAOS_EVM is not set
31580 +# CONFIG_I2C_STUB is not set
31581 +
31582 +#
31583 +# Miscellaneous I2C Chip support
31584 +#
31585 +# CONFIG_SENSORS_DS1337 is not set
31586 +# CONFIG_SENSORS_DS1374 is not set
31587 +# CONFIG_DS1682 is not set
31588 +# CONFIG_SENSORS_EEPROM is not set
31589 +# CONFIG_SENSORS_PCF8574 is not set
31590 +# CONFIG_SENSORS_PCA9539 is not set
31591 +# CONFIG_SENSORS_PCF8591 is not set
31592 +# CONFIG_SENSORS_M41T00 is not set
31593 +# CONFIG_SENSORS_MAX6875 is not set
31594 +# CONFIG_SENSORS_TSL2550 is not set
31595 +# CONFIG_I2C_DEBUG_CORE is not set
31596 +# CONFIG_I2C_DEBUG_ALGO is not set
31597 +# CONFIG_I2C_DEBUG_BUS is not set
31598 +# CONFIG_I2C_DEBUG_CHIP is not set
31599 +
31600 +#
31601 +# SPI support
31602 +#
31603 +# CONFIG_SPI is not set
31604 +# CONFIG_SPI_MASTER is not set
31605 +# CONFIG_W1 is not set
31606 +# CONFIG_POWER_SUPPLY is not set
31607 +CONFIG_HWMON=y
31608 +# CONFIG_HWMON_VID is not set
31609 +# CONFIG_SENSORS_ABITUGURU is not set
31610 +# CONFIG_SENSORS_ABITUGURU3 is not set
31611 +# CONFIG_SENSORS_AD7418 is not set
31612 +# CONFIG_SENSORS_ADM1021 is not set
31613 +# CONFIG_SENSORS_ADM1025 is not set
31614 +# CONFIG_SENSORS_ADM1026 is not set
31615 +# CONFIG_SENSORS_ADM1029 is not set
31616 +# CONFIG_SENSORS_ADM1031 is not set
31617 +# CONFIG_SENSORS_ADM9240 is not set
31618 +# CONFIG_SENSORS_ASB100 is not set
31619 +# CONFIG_SENSORS_ATXP1 is not set
31620 +# CONFIG_SENSORS_DS1621 is not set
31621 +# CONFIG_SENSORS_F71805F is not set
31622 +# CONFIG_SENSORS_FSCHER is not set
31623 +# CONFIG_SENSORS_FSCPOS is not set
31624 +# CONFIG_SENSORS_GL518SM is not set
31625 +# CONFIG_SENSORS_GL520SM is not set
31626 +# CONFIG_SENSORS_IT87 is not set
31627 +# CONFIG_SENSORS_LM63 is not set
31628 +# CONFIG_SENSORS_LM75 is not set
31629 +# CONFIG_SENSORS_LM77 is not set
31630 +# CONFIG_SENSORS_LM78 is not set
31631 +# CONFIG_SENSORS_LM80 is not set
31632 +# CONFIG_SENSORS_LM83 is not set
31633 +# CONFIG_SENSORS_LM85 is not set
31634 +# CONFIG_SENSORS_LM87 is not set
31635 +# CONFIG_SENSORS_LM90 is not set
31636 +# CONFIG_SENSORS_LM92 is not set
31637 +# CONFIG_SENSORS_LM93 is not set
31638 +# CONFIG_SENSORS_MAX1619 is not set
31639 +# CONFIG_SENSORS_MAX6650 is not set
31640 +# CONFIG_SENSORS_PC87360 is not set
31641 +# CONFIG_SENSORS_PC87427 is not set
31642 +# CONFIG_SENSORS_DME1737 is not set
31643 +# CONFIG_SENSORS_SMSC47M1 is not set
31644 +# CONFIG_SENSORS_SMSC47M192 is not set
31645 +# CONFIG_SENSORS_SMSC47B397 is not set
31646 +# CONFIG_SENSORS_THMC50 is not set
31647 +# CONFIG_SENSORS_VT1211 is not set
31648 +# CONFIG_SENSORS_W83781D is not set
31649 +# CONFIG_SENSORS_W83791D is not set
31650 +# CONFIG_SENSORS_W83792D is not set
31651 +# CONFIG_SENSORS_W83793 is not set
31652 +# CONFIG_SENSORS_W83L785TS is not set
31653 +# CONFIG_SENSORS_W83627HF is not set
31654 +# CONFIG_SENSORS_W83627EHF is not set
31655 +# CONFIG_HWMON_DEBUG_CHIP is not set
31656 +
31657 +#
31658 +# Multifunction device drivers
31659 +#
31660 +# CONFIG_MFD_SM501 is not set
31661 +
31662 +#
31663 +# Multimedia devices
31664 +#
31665 +# CONFIG_VIDEO_DEV is not set
31666 +# CONFIG_DVB_CORE is not set
31667 +CONFIG_DAB=y
31668 +
31669 +#
31670 +# Graphics support
31671 +#
31672 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
31673 +
31674 +#
31675 +# Display device support
31676 +#
31677 +# CONFIG_DISPLAY_SUPPORT is not set
31678 +# CONFIG_VGASTATE is not set
31679 +CONFIG_VIDEO_OUTPUT_CONTROL=m
31680 +# CONFIG_FB is not set
31681 +# CONFIG_FB_IBM_GXT4500 is not set
31682 +
31683 +#
31684 +# Sound
31685 +#
31686 +# CONFIG_SOUND is not set
31687 +CONFIG_HID_SUPPORT=y
31688 +CONFIG_HID=y
31689 +# CONFIG_HID_DEBUG is not set
31690 +CONFIG_USB_SUPPORT=y
31691 +CONFIG_USB_ARCH_HAS_HCD=y
31692 +# CONFIG_USB_ARCH_HAS_OHCI is not set
31693 +CONFIG_USB_ARCH_HAS_EHCI=y
31694 +# CONFIG_USB is not set
31695 +
31696 +#
31697 +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
31698 +#
31699 +
31700 +#
31701 +# USB Gadget Support
31702 +#
31703 +# CONFIG_USB_GADGET is not set
31704 +# CONFIG_MMC is not set
31705 +# CONFIG_NEW_LEDS is not set
31706 +# CONFIG_EDAC is not set
31707 +# CONFIG_RTC_CLASS is not set
31708 +
31709 +#
31710 +# DMA Engine support
31711 +#
31712 +# CONFIG_DMA_ENGINE is not set
31713 +
31714 +#
31715 +# DMA Clients
31716 +#
31717 +
31718 +#
31719 +# DMA Devices
31720 +#
31721 +
31722 +#
31723 +# Userspace I/O
31724 +#
31725 +# CONFIG_UIO is not set
31726 +
31727 +#
31728 +# File systems
31729 +#
31730 +CONFIG_EXT2_FS=y
31731 +# CONFIG_EXT2_FS_XATTR is not set
31732 +# CONFIG_EXT2_FS_XIP is not set
31733 +CONFIG_EXT3_FS=y
31734 +CONFIG_EXT3_FS_XATTR=y
31735 +# CONFIG_EXT3_FS_POSIX_ACL is not set
31736 +# CONFIG_EXT3_FS_SECURITY is not set
31737 +# CONFIG_EXT4DEV_FS is not set
31738 +CONFIG_JBD=y
31739 +# CONFIG_JBD_DEBUG is not set
31740 +CONFIG_FS_MBCACHE=y
31741 +# CONFIG_REISERFS_FS is not set
31742 +# CONFIG_JFS_FS is not set
31743 +# CONFIG_FS_POSIX_ACL is not set
31744 +# CONFIG_XFS_FS is not set
31745 +# CONFIG_GFS2_FS is not set
31746 +# CONFIG_OCFS2_FS is not set
31747 +# CONFIG_MINIX_FS is not set
31748 +# CONFIG_ROMFS_FS is not set
31749 +CONFIG_INOTIFY=y
31750 +CONFIG_INOTIFY_USER=y
31751 +# CONFIG_QUOTA is not set
31752 +CONFIG_DNOTIFY=y
31753 +# CONFIG_AUTOFS_FS is not set
31754 +# CONFIG_AUTOFS4_FS is not set
31755 +# CONFIG_FUSE_FS is not set
31756 +
31757 +#
31758 +# CD-ROM/DVD Filesystems
31759 +#
31760 +# CONFIG_ISO9660_FS is not set
31761 +# CONFIG_UDF_FS is not set
31762 +
31763 +#
31764 +# DOS/FAT/NT Filesystems
31765 +#
31766 +# CONFIG_MSDOS_FS is not set
31767 +# CONFIG_VFAT_FS is not set
31768 +# CONFIG_NTFS_FS is not set
31769 +
31770 +#
31771 +# Pseudo filesystems
31772 +#
31773 +CONFIG_PROC_FS=y
31774 +CONFIG_PROC_KCORE=y
31775 +CONFIG_PROC_SYSCTL=y
31776 +CONFIG_SYSFS=y
31777 +CONFIG_TMPFS=y
31778 +# CONFIG_TMPFS_POSIX_ACL is not set
31779 +# CONFIG_HUGETLB_PAGE is not set
31780 +CONFIG_RAMFS=y
31781 +# CONFIG_CONFIGFS_FS is not set
31782 +
31783 +#
31784 +# Miscellaneous filesystems
31785 +#
31786 +# CONFIG_ADFS_FS is not set
31787 +# CONFIG_AFFS_FS is not set
31788 +# CONFIG_HFS_FS is not set
31789 +# CONFIG_HFSPLUS_FS is not set
31790 +# CONFIG_BEFS_FS is not set
31791 +# CONFIG_BFS_FS is not set
31792 +# CONFIG_EFS_FS is not set
31793 +# CONFIG_CRAMFS is not set
31794 +# CONFIG_VXFS_FS is not set
31795 +# CONFIG_HPFS_FS is not set
31796 +# CONFIG_QNX4FS_FS is not set
31797 +# CONFIG_SYSV_FS is not set
31798 +# CONFIG_UFS_FS is not set
31799 +
31800 +#
31801 +# Network File Systems
31802 +#
31803 +CONFIG_NFS_FS=y
31804 +CONFIG_NFS_V3=y
31805 +# CONFIG_NFS_V3_ACL is not set
31806 +CONFIG_NFS_V4=y
31807 +# CONFIG_NFS_DIRECTIO is not set
31808 +# CONFIG_NFSD is not set
31809 +CONFIG_ROOT_NFS=y
31810 +CONFIG_LOCKD=y
31811 +CONFIG_LOCKD_V4=y
31812 +CONFIG_NFS_COMMON=y
31813 +CONFIG_SUNRPC=y
31814 +CONFIG_SUNRPC_GSS=y
31815 +# CONFIG_SUNRPC_BIND34 is not set
31816 +CONFIG_RPCSEC_GSS_KRB5=y
31817 +# CONFIG_RPCSEC_GSS_SPKM3 is not set
31818 +# CONFIG_SMB_FS is not set
31819 +# CONFIG_CIFS is not set
31820 +# CONFIG_NCP_FS is not set
31821 +# CONFIG_CODA_FS is not set
31822 +# CONFIG_AFS_FS is not set
31823 +
31824 +#
31825 +# Partition Types
31826 +#
31827 +CONFIG_PARTITION_ADVANCED=y
31828 +# CONFIG_ACORN_PARTITION is not set
31829 +# CONFIG_OSF_PARTITION is not set
31830 +# CONFIG_AMIGA_PARTITION is not set
31831 +# CONFIG_ATARI_PARTITION is not set
31832 +# CONFIG_MAC_PARTITION is not set
31833 +CONFIG_MSDOS_PARTITION=y
31834 +# CONFIG_BSD_DISKLABEL is not set
31835 +# CONFIG_MINIX_SUBPARTITION is not set
31836 +# CONFIG_SOLARIS_X86_PARTITION is not set
31837 +# CONFIG_UNIXWARE_DISKLABEL is not set
31838 +# CONFIG_LDM_PARTITION is not set
31839 +# CONFIG_SGI_PARTITION is not set
31840 +# CONFIG_ULTRIX_PARTITION is not set
31841 +# CONFIG_SUN_PARTITION is not set
31842 +# CONFIG_KARMA_PARTITION is not set
31843 +# CONFIG_EFI_PARTITION is not set
31844 +# CONFIG_SYSV68_PARTITION is not set
31845 +
31846 +#
31847 +# Native Language Support
31848 +#
31849 +# CONFIG_NLS is not set
31850 +
31851 +#
31852 +# Distributed Lock Manager
31853 +#
31854 +# CONFIG_DLM is not set
31855 +# CONFIG_UCC_SLOW is not set
31856 +
31857 +#
31858 +# Library routines
31859 +#
31860 +CONFIG_BITREVERSE=y
31861 +# CONFIG_CRC_CCITT is not set
31862 +# CONFIG_CRC16 is not set
31863 +# CONFIG_CRC_ITU_T is not set
31864 +CONFIG_CRC32=y
31865 +# CONFIG_CRC7 is not set
31866 +# CONFIG_LIBCRC32C is not set
31867 +CONFIG_PLIST=y
31868 +CONFIG_HAS_IOMEM=y
31869 +CONFIG_HAS_IOPORT=y
31870 +CONFIG_HAS_DMA=y
31871 +
31872 +#
31873 +# Instrumentation Support
31874 +#
31875 +# CONFIG_PROFILING is not set
31876 +# CONFIG_KPROBES is not set
31877 +
31878 +#
31879 +# Kernel hacking
31880 +#
31881 +# CONFIG_PRINTK_TIME is not set
31882 +CONFIG_ENABLE_MUST_CHECK=y
31883 +# CONFIG_MAGIC_SYSRQ is not set
31884 +# CONFIG_UNUSED_SYMBOLS is not set
31885 +# CONFIG_DEBUG_FS is not set
31886 +# CONFIG_HEADERS_CHECK is not set
31887 +# CONFIG_DEBUG_KERNEL is not set
31888 +# CONFIG_DEBUG_BUGVERBOSE is not set
31889 +# CONFIG_PPC_EARLY_DEBUG is not set
31890 +
31891 +#
31892 +# Security options
31893 +#
31894 +# CONFIG_KEYS is not set
31895 +# CONFIG_SECURITY is not set
31896 +CONFIG_CRYPTO=y
31897 +CONFIG_CRYPTO_ALGAPI=y
31898 +CONFIG_CRYPTO_BLKCIPHER=y
31899 +CONFIG_CRYPTO_MANAGER=y
31900 +# CONFIG_CRYPTO_HMAC is not set
31901 +# CONFIG_CRYPTO_XCBC is not set
31902 +# CONFIG_CRYPTO_NULL is not set
31903 +# CONFIG_CRYPTO_MD4 is not set
31904 +CONFIG_CRYPTO_MD5=y
31905 +# CONFIG_CRYPTO_SHA1 is not set
31906 +# CONFIG_CRYPTO_SHA256 is not set
31907 +# CONFIG_CRYPTO_SHA512 is not set
31908 +# CONFIG_CRYPTO_WP512 is not set
31909 +# CONFIG_CRYPTO_TGR192 is not set
31910 +# CONFIG_CRYPTO_GF128MUL is not set
31911 +CONFIG_CRYPTO_ECB=m
31912 +CONFIG_CRYPTO_CBC=y
31913 +CONFIG_CRYPTO_PCBC=m
31914 +# CONFIG_CRYPTO_LRW is not set
31915 +# CONFIG_CRYPTO_CRYPTD is not set
31916 +CONFIG_CRYPTO_DES=y
31917 +# CONFIG_CRYPTO_FCRYPT is not set
31918 +# CONFIG_CRYPTO_BLOWFISH is not set
31919 +# CONFIG_CRYPTO_TWOFISH is not set
31920 +# CONFIG_CRYPTO_SERPENT is not set
31921 +# CONFIG_CRYPTO_AES is not set
31922 +# CONFIG_CRYPTO_CAST5 is not set
31923 +# CONFIG_CRYPTO_CAST6 is not set
31924 +# CONFIG_CRYPTO_TEA is not set
31925 +# CONFIG_CRYPTO_ARC4 is not set
31926 +# CONFIG_CRYPTO_KHAZAD is not set
31927 +# CONFIG_CRYPTO_ANUBIS is not set
31928 +# CONFIG_CRYPTO_DEFLATE is not set
31929 +# CONFIG_CRYPTO_MICHAEL_MIC is not set
31930 +# CONFIG_CRYPTO_CRC32C is not set
31931 +# CONFIG_CRYPTO_CAMELLIA is not set
31932 +# CONFIG_CRYPTO_TEST is not set
31933 +CONFIG_CRYPTO_HW=y
31934 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/configs/mpc8610_hpcd_defconfig powerpc.git/arch/powerpc/configs/mpc8610_hpcd_defconfig
31935 --- linux-2.6.24/arch/powerpc/configs/mpc8610_hpcd_defconfig    2008-01-24 23:58:37.000000000 +0100
31936 +++ powerpc.git/arch/powerpc/configs/mpc8610_hpcd_defconfig     2008-01-28 20:25:49.000000000 +0100
31937 @@ -696,7 +696,7 @@
31938  CONFIG_SERIAL_CORE=y
31939  CONFIG_SERIAL_CORE_CONSOLE=y
31940  # CONFIG_SERIAL_JSM is not set
31941 -CONFIG_SERIAL_OF_PLATFORM=y
31942 +# CONFIG_SERIAL_OF_PLATFORM is not set
31943  CONFIG_UNIX98_PTYS=y
31944  # CONFIG_LEGACY_PTYS is not set
31945  # CONFIG_IPMI_HANDLER is not set
31946 @@ -708,7 +708,60 @@
31947  # CONFIG_RAW_DRIVER is not set
31948  # CONFIG_TCG_TPM is not set
31949  CONFIG_DEVPORT=y
31950 -# CONFIG_I2C is not set
31951 +CONFIG_I2C=y
31952 +CONFIG_I2C_BOARDINFO=y
31953 +# CONFIG_I2C_CHARDEV is not set
31954 +
31955 +#
31956 +# I2C Algorithms
31957 +#
31958 +# CONFIG_I2C_ALGOBIT is not set
31959 +# CONFIG_I2C_ALGOPCF is not set
31960 +# CONFIG_I2C_ALGOPCA is not set
31961 +
31962 +#
31963 +# I2C Hardware Bus support
31964 +#
31965 +# CONFIG_I2C_ALI1535 is not set
31966 +# CONFIG_I2C_ALI1563 is not set
31967 +# CONFIG_I2C_ALI15X3 is not set
31968 +# CONFIG_I2C_AMD756 is not set
31969 +# CONFIG_I2C_AMD8111 is not set
31970 +# CONFIG_I2C_I801 is not set
31971 +# CONFIG_I2C_I810 is not set
31972 +# CONFIG_I2C_PIIX4 is not set
31973 +CONFIG_I2C_MPC=y
31974 +# CONFIG_I2C_NFORCE2 is not set
31975 +# CONFIG_I2C_OCORES is not set
31976 +# CONFIG_I2C_PARPORT_LIGHT is not set
31977 +# CONFIG_I2C_PROSAVAGE is not set
31978 +# CONFIG_I2C_SAVAGE4 is not set
31979 +# CONFIG_I2C_SIMTEC is not set
31980 +# CONFIG_I2C_SIS5595 is not set
31981 +# CONFIG_I2C_SIS630 is not set
31982 +# CONFIG_I2C_SIS96X is not set
31983 +# CONFIG_I2C_TAOS_EVM is not set
31984 +# CONFIG_I2C_VIA is not set
31985 +# CONFIG_I2C_VIAPRO is not set
31986 +# CONFIG_I2C_VOODOO3 is not set
31987 +
31988 +#
31989 +# Miscellaneous I2C Chip support
31990 +#
31991 +# CONFIG_SENSORS_DS1337 is not set
31992 +# CONFIG_SENSORS_DS1374 is not set
31993 +# CONFIG_DS1682 is not set
31994 +# CONFIG_SENSORS_EEPROM is not set
31995 +# CONFIG_SENSORS_PCF8574 is not set
31996 +# CONFIG_SENSORS_PCA9539 is not set
31997 +# CONFIG_SENSORS_PCF8591 is not set
31998 +# CONFIG_SENSORS_M41T00 is not set
31999 +# CONFIG_SENSORS_MAX6875 is not set
32000 +# CONFIG_SENSORS_TSL2550 is not set
32001 +# CONFIG_I2C_DEBUG_CORE is not set
32002 +# CONFIG_I2C_DEBUG_ALGO is not set
32003 +# CONFIG_I2C_DEBUG_BUS is not set
32004 +# CONFIG_I2C_DEBUG_CHIP is not set
32005  
32006  #
32007  # SPI support
32008 @@ -763,7 +816,119 @@
32009  #
32010  # Sound
32011  #
32012 -# CONFIG_SOUND is not set
32013 +CONFIG_SOUND=y
32014 +
32015 +#
32016 +# Advanced Linux Sound Architecture
32017 +#
32018 +CONFIG_SND=y
32019 +CONFIG_SND_TIMER=y
32020 +CONFIG_SND_PCM=y
32021 +# CONFIG_SND_SEQUENCER is not set
32022 +CONFIG_SND_OSSEMUL=y
32023 +CONFIG_SND_MIXER_OSS=y
32024 +CONFIG_SND_PCM_OSS=y
32025 +# CONFIG_SND_PCM_OSS_PLUGINS is not set
32026 +# CONFIG_SND_DYNAMIC_MINORS is not set
32027 +# CONFIG_SND_SUPPORT_OLD_API is not set
32028 +CONFIG_SND_VERBOSE_PROCFS=y
32029 +# CONFIG_SND_VERBOSE_PRINTK is not set
32030 +# CONFIG_SND_DEBUG is not set
32031 +
32032 +#
32033 +# Generic devices
32034 +#
32035 +# CONFIG_SND_DUMMY is not set
32036 +# CONFIG_SND_MTPAV is not set
32037 +# CONFIG_SND_SERIAL_U16550 is not set
32038 +# CONFIG_SND_MPU401 is not set
32039 +
32040 +#
32041 +# PCI devices
32042 +#
32043 +# CONFIG_SND_AD1889 is not set
32044 +# CONFIG_SND_ALS300 is not set
32045 +# CONFIG_SND_ALS4000 is not set
32046 +# CONFIG_SND_ALI5451 is not set
32047 +# CONFIG_SND_ATIIXP is not set
32048 +# CONFIG_SND_ATIIXP_MODEM is not set
32049 +# CONFIG_SND_AU8810 is not set
32050 +# CONFIG_SND_AU8820 is not set
32051 +# CONFIG_SND_AU8830 is not set
32052 +# CONFIG_SND_AZT3328 is not set
32053 +# CONFIG_SND_BT87X is not set
32054 +# CONFIG_SND_CA0106 is not set
32055 +# CONFIG_SND_CMIPCI is not set
32056 +# CONFIG_SND_CS4281 is not set
32057 +# CONFIG_SND_CS46XX is not set
32058 +# CONFIG_SND_CS5530 is not set
32059 +# CONFIG_SND_DARLA20 is not set
32060 +# CONFIG_SND_GINA20 is not set
32061 +# CONFIG_SND_LAYLA20 is not set
32062 +# CONFIG_SND_DARLA24 is not set
32063 +# CONFIG_SND_GINA24 is not set
32064 +# CONFIG_SND_LAYLA24 is not set
32065 +# CONFIG_SND_MONA is not set
32066 +# CONFIG_SND_MIA is not set
32067 +# CONFIG_SND_ECHO3G is not set
32068 +# CONFIG_SND_INDIGO is not set
32069 +# CONFIG_SND_INDIGOIO is not set
32070 +# CONFIG_SND_INDIGODJ is not set
32071 +# CONFIG_SND_EMU10K1 is not set
32072 +# CONFIG_SND_EMU10K1X is not set
32073 +# CONFIG_SND_ENS1370 is not set
32074 +# CONFIG_SND_ENS1371 is not set
32075 +# CONFIG_SND_ES1938 is not set
32076 +# CONFIG_SND_ES1968 is not set
32077 +# CONFIG_SND_FM801 is not set
32078 +# CONFIG_SND_HDA_INTEL is not set
32079 +# CONFIG_SND_HDSP is not set
32080 +# CONFIG_SND_HDSPM is not set
32081 +# CONFIG_SND_ICE1712 is not set
32082 +# CONFIG_SND_ICE1724 is not set
32083 +# CONFIG_SND_INTEL8X0 is not set
32084 +# CONFIG_SND_INTEL8X0M is not set
32085 +# CONFIG_SND_KORG1212 is not set
32086 +# CONFIG_SND_MAESTRO3 is not set
32087 +# CONFIG_SND_MIXART is not set
32088 +# CONFIG_SND_NM256 is not set
32089 +# CONFIG_SND_PCXHR is not set
32090 +# CONFIG_SND_RIPTIDE is not set
32091 +# CONFIG_SND_RME32 is not set
32092 +# CONFIG_SND_RME96 is not set
32093 +# CONFIG_SND_RME9652 is not set
32094 +# CONFIG_SND_SONICVIBES is not set
32095 +# CONFIG_SND_TRIDENT is not set
32096 +# CONFIG_SND_VIA82XX is not set
32097 +# CONFIG_SND_VIA82XX_MODEM is not set
32098 +# CONFIG_SND_VX222 is not set
32099 +# CONFIG_SND_YMFPCI is not set
32100 +
32101 +#
32102 +# ALSA PowerMac devices
32103 +#
32104 +
32105 +#
32106 +# ALSA PowerPC devices
32107 +#
32108 +
32109 +#
32110 +# System on Chip audio support
32111 +#
32112 +CONFIG_SND_SOC=y
32113 +
32114 +#
32115 +# SoC Audio support for SuperH
32116 +#
32117 +
32118 +#
32119 +# ALSA SoC audio for Freescale SOCs
32120 +#
32121 +CONFIG_SND_SOC_MPC8610=y
32122 +CONFIG_SND_SOC_MPC8610_HPCD=y
32123 +CONFIG_SND_SOC_CS4270=y
32124 +CONFIG_SND_SOC_CS4270_VD33_ERRATA=y
32125 +
32126  CONFIG_HID_SUPPORT=y
32127  CONFIG_HID=y
32128  # CONFIG_HID_DEBUG is not set
32129 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/configs/pasemi_defconfig powerpc.git/arch/powerpc/configs/pasemi_defconfig
32130 --- linux-2.6.24/arch/powerpc/configs/pasemi_defconfig  2008-01-24 23:58:37.000000000 +0100
32131 +++ powerpc.git/arch/powerpc/configs/pasemi_defconfig   2008-01-28 20:25:49.000000000 +0100
32132 @@ -1,7 +1,7 @@
32133  #
32134  # Automatically generated make config: don't edit
32135 -# Linux kernel version: 2.6.24-rc4
32136 -# Thu Dec  6 16:49:03 2007
32137 +# Linux kernel version: 2.6.24-rc6
32138 +# Tue Jan 15 10:26:10 2008
32139  #
32140  CONFIG_PPC64=y
32141  
32142 @@ -152,7 +152,6 @@
32143  CONFIG_PPC_PASEMI_IOMMU=y
32144  # CONFIG_PPC_PASEMI_IOMMU_DMA_FORCE is not set
32145  CONFIG_PPC_PASEMI_MDIO=y
32146 -CONFIG_ELECTRA_IDE=y
32147  # CONFIG_PPC_CELLEB is not set
32148  # CONFIG_PPC_PS3 is not set
32149  # CONFIG_PPC_CELL is not set
32150 @@ -256,7 +255,7 @@
32151  CONFIG_PCI_SYSCALL=y
32152  # CONFIG_PCIEPORTBUS is not set
32153  CONFIG_ARCH_SUPPORTS_MSI=y
32154 -# CONFIG_PCI_MSI is not set
32155 +CONFIG_PCI_MSI=y
32156  CONFIG_PCI_LEGACY=y
32157  # CONFIG_PCI_DEBUG is not set
32158  CONFIG_PCCARD=y
32159 @@ -663,7 +662,26 @@
32160  # CONFIG_PATA_VIA is not set
32161  # CONFIG_PATA_WINBOND is not set
32162  CONFIG_PATA_PLATFORM=y
32163 -# CONFIG_MD is not set
32164 +CONFIG_PATA_OF_PLATFORM=y
32165 +CONFIG_MD=y
32166 +CONFIG_BLK_DEV_MD=y
32167 +CONFIG_MD_LINEAR=y
32168 +CONFIG_MD_RAID0=y
32169 +CONFIG_MD_RAID1=y
32170 +CONFIG_MD_RAID10=y
32171 +CONFIG_MD_RAID456=y
32172 +CONFIG_MD_RAID5_RESHAPE=y
32173 +# CONFIG_MD_MULTIPATH is not set
32174 +# CONFIG_MD_FAULTY is not set
32175 +CONFIG_BLK_DEV_DM=y
32176 +# CONFIG_DM_DEBUG is not set
32177 +CONFIG_DM_CRYPT=y
32178 +# CONFIG_DM_SNAPSHOT is not set
32179 +# CONFIG_DM_MIRROR is not set
32180 +# CONFIG_DM_ZERO is not set
32181 +# CONFIG_DM_MULTIPATH is not set
32182 +# CONFIG_DM_DELAY is not set
32183 +# CONFIG_DM_UEVENT is not set
32184  # CONFIG_FUSION is not set
32185  
32186  #
32187 @@ -1686,6 +1704,10 @@
32188  # CONFIG_KEYS is not set
32189  # CONFIG_SECURITY is not set
32190  # CONFIG_SECURITY_FILE_CAPABILITIES is not set
32191 +CONFIG_XOR_BLOCKS=y
32192 +CONFIG_ASYNC_CORE=y
32193 +CONFIG_ASYNC_MEMCPY=y
32194 +CONFIG_ASYNC_XOR=y
32195  CONFIG_CRYPTO=y
32196  CONFIG_CRYPTO_ALGAPI=y
32197  CONFIG_CRYPTO_BLKCIPHER=y
32198 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/configs/ppc64_defconfig powerpc.git/arch/powerpc/configs/ppc64_defconfig
32199 --- linux-2.6.24/arch/powerpc/configs/ppc64_defconfig   2008-01-24 23:58:37.000000000 +0100
32200 +++ powerpc.git/arch/powerpc/configs/ppc64_defconfig    2008-01-28 20:25:49.000000000 +0100
32201 @@ -1,7 +1,7 @@
32202  #
32203  # Automatically generated make config: don't edit
32204  # Linux kernel version: 2.6.24-rc4
32205 -# Thu Dec  6 16:49:07 2007
32206 +# Fri Dec 21 14:47:29 2007
32207  #
32208  CONFIG_PPC64=y
32209  
32210 @@ -211,7 +211,7 @@
32211  CONFIG_MPIC_U3_HT_IRQS=y
32212  CONFIG_MPIC_BROKEN_REGREAD=y
32213  CONFIG_IBMVIO=y
32214 -# CONFIG_IBMEBUS is not set
32215 +CONFIG_IBMEBUS=y
32216  # CONFIG_PPC_MPC106 is not set
32217  CONFIG_PPC_970_NAP=y
32218  CONFIG_PPC_INDIRECT_IO=y
32219 @@ -375,7 +375,7 @@
32220  CONFIG_INET_XFRM_MODE_TRANSPORT=y
32221  CONFIG_INET_XFRM_MODE_TUNNEL=y
32222  CONFIG_INET_XFRM_MODE_BEET=y
32223 -# CONFIG_INET_LRO is not set
32224 +CONFIG_INET_LRO=m
32225  CONFIG_INET_DIAG=y
32226  CONFIG_INET_TCP_DIAG=y
32227  # CONFIG_TCP_CONG_ADVANCED is not set
32228 @@ -929,6 +929,7 @@
32229  CONFIG_NETDEV_10000=y
32230  # CONFIG_CHELSIO_T1 is not set
32231  # CONFIG_CHELSIO_T3 is not set
32232 +CONFIG_EHEA=m
32233  # CONFIG_IXGBE is not set
32234  CONFIG_IXGB=m
32235  # CONFIG_IXGB_NAPI is not set
32236 @@ -1558,6 +1559,7 @@
32237  CONFIG_INFINIBAND_MTHCA=m
32238  CONFIG_INFINIBAND_MTHCA_DEBUG=y
32239  # CONFIG_INFINIBAND_IPATH is not set
32240 +CONFIG_INFINIBAND_EHCA=m
32241  # CONFIG_INFINIBAND_AMSO1100 is not set
32242  # CONFIG_MLX4_INFINIBAND is not set
32243  CONFIG_INFINIBAND_IPOIB=m
32244 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/configs/ps3_defconfig powerpc.git/arch/powerpc/configs/ps3_defconfig
32245 --- linux-2.6.24/arch/powerpc/configs/ps3_defconfig     2008-01-24 23:58:37.000000000 +0100
32246 +++ powerpc.git/arch/powerpc/configs/ps3_defconfig      2008-01-28 20:25:49.000000000 +0100
32247 @@ -1,7 +1,7 @@
32248  #
32249  # Automatically generated make config: don't edit
32250 -# Linux kernel version: 2.6.24-rc4
32251 -# Tue Dec  4 22:49:57 2007
32252 +# Linux kernel version: 2.6.24-rc8
32253 +# Wed Jan 16 14:31:21 2008
32254  #
32255  CONFIG_PPC64=y
32256  
32257 @@ -103,6 +103,7 @@
32258  CONFIG_SLAB=y
32259  # CONFIG_SLUB is not set
32260  # CONFIG_SLOB is not set
32261 +CONFIG_SLABINFO=y
32262  CONFIG_RT_MUTEXES=y
32263  # CONFIG_TINY_SHMEM is not set
32264  CONFIG_BASE_SMALL=0
32265 @@ -154,7 +155,6 @@
32266  # CONFIG_PS3_ADVANCED is not set
32267  CONFIG_PS3_HTAB_SIZE=20
32268  # CONFIG_PS3_DYNAMIC_DMA is not set
32269 -CONFIG_PS3_USE_LPAR_ADDR=y
32270  CONFIG_PS3_VUART=y
32271  CONFIG_PS3_PS3AV=y
32272  CONFIG_PS3_SYS_MANAGER=y
32273 @@ -162,6 +162,7 @@
32274  CONFIG_PS3_DISK=y
32275  CONFIG_PS3_ROM=y
32276  CONFIG_PS3_FLASH=y
32277 +CONFIG_PS3_LPM=m
32278  CONFIG_PPC_CELL=y
32279  # CONFIG_PPC_CELL_NATIVE is not set
32280  # CONFIG_PPC_IBM_CELL_BLADE is not set
32281 @@ -225,7 +226,7 @@
32282  # CONFIG_SPARSEMEM_STATIC is not set
32283  CONFIG_SPARSEMEM_EXTREME=y
32284  CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
32285 -CONFIG_SPARSEMEM_VMEMMAP=y
32286 +# CONFIG_SPARSEMEM_VMEMMAP is not set
32287  CONFIG_MEMORY_HOTPLUG=y
32288  CONFIG_MEMORY_HOTPLUG_SPARSE=y
32289  CONFIG_SPLIT_PTLOCK_CPUS=4
32290 @@ -338,7 +339,26 @@
32291  # CONFIG_NET_PKTGEN is not set
32292  # CONFIG_HAMRADIO is not set
32293  # CONFIG_IRDA is not set
32294 -# CONFIG_BT is not set
32295 +CONFIG_BT=m
32296 +CONFIG_BT_L2CAP=m
32297 +CONFIG_BT_SCO=m
32298 +CONFIG_BT_RFCOMM=m
32299 +CONFIG_BT_RFCOMM_TTY=y
32300 +CONFIG_BT_BNEP=m
32301 +CONFIG_BT_BNEP_MC_FILTER=y
32302 +CONFIG_BT_BNEP_PROTO_FILTER=y
32303 +CONFIG_BT_HIDP=m
32304 +
32305 +#
32306 +# Bluetooth device drivers
32307 +#
32308 +CONFIG_BT_HCIUSB=m
32309 +CONFIG_BT_HCIUSB_SCO=y
32310 +# CONFIG_BT_HCIUART is not set
32311 +# CONFIG_BT_HCIBCM203X is not set
32312 +# CONFIG_BT_HCIBPA10X is not set
32313 +# CONFIG_BT_HCIBFUSB is not set
32314 +# CONFIG_BT_HCIVHCI is not set
32315  # CONFIG_AF_RXRPC is not set
32316  
32317  #
32318 @@ -666,14 +686,14 @@
32319  #
32320  # Sound
32321  #
32322 -CONFIG_SOUND=y
32323 +CONFIG_SOUND=m
32324  
32325  #
32326  # Advanced Linux Sound Architecture
32327  #
32328 -CONFIG_SND=y
32329 -CONFIG_SND_TIMER=y
32330 -CONFIG_SND_PCM=y
32331 +CONFIG_SND=m
32332 +CONFIG_SND_TIMER=m
32333 +CONFIG_SND_PCM=m
32334  # CONFIG_SND_SEQUENCER is not set
32335  # CONFIG_SND_MIXER_OSS is not set
32336  # CONFIG_SND_PCM_OSS is not set
32337 @@ -702,7 +722,7 @@
32338  #
32339  # ALSA PowerPC devices
32340  #
32341 -CONFIG_SND_PS3=y
32342 +CONFIG_SND_PS3=m
32343  CONFIG_SND_PS3_DEFAULT_START_DELAY=2000
32344  
32345  #
32346 @@ -747,7 +767,7 @@
32347  CONFIG_USB_ARCH_HAS_HCD=y
32348  CONFIG_USB_ARCH_HAS_OHCI=y
32349  CONFIG_USB_ARCH_HAS_EHCI=y
32350 -CONFIG_USB=y
32351 +CONFIG_USB=m
32352  # CONFIG_USB_DEBUG is not set
32353  
32354  #
32355 @@ -761,13 +781,13 @@
32356  #
32357  # USB Host Controller Drivers
32358  #
32359 -CONFIG_USB_EHCI_HCD=y
32360 +CONFIG_USB_EHCI_HCD=m
32361  # CONFIG_USB_EHCI_SPLIT_ISO is not set
32362  # CONFIG_USB_EHCI_ROOT_HUB_TT is not set
32363  # CONFIG_USB_EHCI_TT_NEWSCHED is not set
32364  CONFIG_USB_EHCI_BIG_ENDIAN_MMIO=y
32365  # CONFIG_USB_ISP116X_HCD is not set
32366 -CONFIG_USB_OHCI_HCD=y
32367 +CONFIG_USB_OHCI_HCD=m
32368  # CONFIG_USB_OHCI_HCD_PPC_OF is not set
32369  # CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
32370  CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
32371 @@ -1033,7 +1053,8 @@
32372  CONFIG_HAS_IOPORT=y
32373  CONFIG_HAS_DMA=y
32374  CONFIG_INSTRUMENTATION=y
32375 -# CONFIG_PROFILING is not set
32376 +CONFIG_PROFILING=y
32377 +CONFIG_OPROFILE=m
32378  # CONFIG_KPROBES is not set
32379  # CONFIG_MARKERS is not set
32380  
32381 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/configs/rainier_defconfig powerpc.git/arch/powerpc/configs/rainier_defconfig
32382 --- linux-2.6.24/arch/powerpc/configs/rainier_defconfig 1970-01-01 01:00:00.000000000 +0100
32383 +++ powerpc.git/arch/powerpc/configs/rainier_defconfig  2008-01-28 20:25:49.000000000 +0100
32384 @@ -0,0 +1,873 @@
32385 +#
32386 +# Automatically generated make config: don't edit
32387 +# Linux kernel version: 2.6.24-rc6
32388 +# Mon Dec 24 11:22:40 2007
32389 +#
32390 +# CONFIG_PPC64 is not set
32391 +
32392 +#
32393 +# Processor support
32394 +#
32395 +# CONFIG_6xx is not set
32396 +# CONFIG_PPC_85xx is not set
32397 +# CONFIG_PPC_8xx is not set
32398 +# CONFIG_40x is not set
32399 +CONFIG_44x=y
32400 +# CONFIG_E200 is not set
32401 +CONFIG_4xx=y
32402 +CONFIG_BOOKE=y
32403 +CONFIG_PTE_64BIT=y
32404 +CONFIG_PHYS_64BIT=y
32405 +# CONFIG_PPC_MM_SLICES is not set
32406 +CONFIG_NOT_COHERENT_CACHE=y
32407 +CONFIG_PPC32=y
32408 +CONFIG_WORD_SIZE=32
32409 +CONFIG_PPC_MERGE=y
32410 +CONFIG_MMU=y
32411 +CONFIG_GENERIC_CMOS_UPDATE=y
32412 +CONFIG_GENERIC_TIME=y
32413 +CONFIG_GENERIC_TIME_VSYSCALL=y
32414 +CONFIG_GENERIC_CLOCKEVENTS=y
32415 +CONFIG_GENERIC_HARDIRQS=y
32416 +CONFIG_IRQ_PER_CPU=y
32417 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
32418 +CONFIG_ARCH_HAS_ILOG2_U32=y
32419 +CONFIG_GENERIC_HWEIGHT=y
32420 +CONFIG_GENERIC_CALIBRATE_DELAY=y
32421 +CONFIG_GENERIC_FIND_NEXT_BIT=y
32422 +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
32423 +CONFIG_PPC=y
32424 +CONFIG_EARLY_PRINTK=y
32425 +CONFIG_GENERIC_NVRAM=y
32426 +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
32427 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
32428 +CONFIG_PPC_OF=y
32429 +CONFIG_OF=y
32430 +CONFIG_PPC_UDBG_16550=y
32431 +# CONFIG_GENERIC_TBSYNC is not set
32432 +CONFIG_AUDIT_ARCH=y
32433 +CONFIG_GENERIC_BUG=y
32434 +# CONFIG_DEFAULT_UIMAGE is not set
32435 +CONFIG_PPC_DCR_NATIVE=y
32436 +# CONFIG_PPC_DCR_MMIO is not set
32437 +CONFIG_PPC_DCR=y
32438 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
32439 +
32440 +#
32441 +# General setup
32442 +#
32443 +CONFIG_EXPERIMENTAL=y
32444 +CONFIG_BROKEN_ON_SMP=y
32445 +CONFIG_INIT_ENV_ARG_LIMIT=32
32446 +CONFIG_LOCALVERSION=""
32447 +CONFIG_LOCALVERSION_AUTO=y
32448 +CONFIG_SWAP=y
32449 +CONFIG_SYSVIPC=y
32450 +CONFIG_SYSVIPC_SYSCTL=y
32451 +CONFIG_POSIX_MQUEUE=y
32452 +# CONFIG_BSD_PROCESS_ACCT is not set
32453 +# CONFIG_TASKSTATS is not set
32454 +# CONFIG_USER_NS is not set
32455 +# CONFIG_PID_NS is not set
32456 +# CONFIG_AUDIT is not set
32457 +# CONFIG_IKCONFIG is not set
32458 +CONFIG_LOG_BUF_SHIFT=14
32459 +# CONFIG_CGROUPS is not set
32460 +CONFIG_FAIR_GROUP_SCHED=y
32461 +CONFIG_FAIR_USER_SCHED=y
32462 +# CONFIG_FAIR_CGROUP_SCHED is not set
32463 +CONFIG_SYSFS_DEPRECATED=y
32464 +# CONFIG_RELAY is not set
32465 +CONFIG_BLK_DEV_INITRD=y
32466 +CONFIG_INITRAMFS_SOURCE=""
32467 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
32468 +CONFIG_SYSCTL=y
32469 +CONFIG_EMBEDDED=y
32470 +CONFIG_SYSCTL_SYSCALL=y
32471 +CONFIG_KALLSYMS=y
32472 +# CONFIG_KALLSYMS_ALL is not set
32473 +# CONFIG_KALLSYMS_EXTRA_PASS is not set
32474 +CONFIG_HOTPLUG=y
32475 +CONFIG_PRINTK=y
32476 +CONFIG_BUG=y
32477 +CONFIG_ELF_CORE=y
32478 +CONFIG_BASE_FULL=y
32479 +CONFIG_FUTEX=y
32480 +CONFIG_ANON_INODES=y
32481 +CONFIG_EPOLL=y
32482 +CONFIG_SIGNALFD=y
32483 +CONFIG_EVENTFD=y
32484 +CONFIG_SHMEM=y
32485 +CONFIG_VM_EVENT_COUNTERS=y
32486 +CONFIG_SLUB_DEBUG=y
32487 +# CONFIG_SLAB is not set
32488 +CONFIG_SLUB=y
32489 +# CONFIG_SLOB is not set
32490 +CONFIG_RT_MUTEXES=y
32491 +# CONFIG_TINY_SHMEM is not set
32492 +CONFIG_BASE_SMALL=0
32493 +CONFIG_MODULES=y
32494 +CONFIG_MODULE_UNLOAD=y
32495 +# CONFIG_MODULE_FORCE_UNLOAD is not set
32496 +# CONFIG_MODVERSIONS is not set
32497 +# CONFIG_MODULE_SRCVERSION_ALL is not set
32498 +CONFIG_KMOD=y
32499 +CONFIG_BLOCK=y
32500 +CONFIG_LBD=y
32501 +# CONFIG_BLK_DEV_IO_TRACE is not set
32502 +# CONFIG_LSF is not set
32503 +# CONFIG_BLK_DEV_BSG is not set
32504 +
32505 +#
32506 +# IO Schedulers
32507 +#
32508 +CONFIG_IOSCHED_NOOP=y
32509 +CONFIG_IOSCHED_AS=y
32510 +CONFIG_IOSCHED_DEADLINE=y
32511 +CONFIG_IOSCHED_CFQ=y
32512 +CONFIG_DEFAULT_AS=y
32513 +# CONFIG_DEFAULT_DEADLINE is not set
32514 +# CONFIG_DEFAULT_CFQ is not set
32515 +# CONFIG_DEFAULT_NOOP is not set
32516 +CONFIG_DEFAULT_IOSCHED="anticipatory"
32517 +# CONFIG_PPC4xx_PCI_EXPRESS is not set
32518 +
32519 +#
32520 +# Platform support
32521 +#
32522 +# CONFIG_PPC_MPC52xx is not set
32523 +# CONFIG_PPC_MPC5200 is not set
32524 +# CONFIG_PPC_CELL is not set
32525 +# CONFIG_PPC_CELL_NATIVE is not set
32526 +# CONFIG_PQ2ADS is not set
32527 +# CONFIG_BAMBOO is not set
32528 +# CONFIG_EBONY is not set
32529 +# CONFIG_SEQUOIA is not set
32530 +# CONFIG_TAISHAN is not set
32531 +# CONFIG_KATMAI is not set
32532 +CONFIG_RAINIER=y
32533 +CONFIG_440GRX=y
32534 +# CONFIG_MPIC is not set
32535 +# CONFIG_MPIC_WEIRD is not set
32536 +# CONFIG_PPC_I8259 is not set
32537 +# CONFIG_PPC_RTAS is not set
32538 +# CONFIG_MMIO_NVRAM is not set
32539 +# CONFIG_PPC_MPC106 is not set
32540 +# CONFIG_PPC_970_NAP is not set
32541 +# CONFIG_PPC_INDIRECT_IO is not set
32542 +# CONFIG_GENERIC_IOMAP is not set
32543 +# CONFIG_CPU_FREQ is not set
32544 +# CONFIG_CPM2 is not set
32545 +# CONFIG_FSL_ULI1575 is not set
32546 +
32547 +#
32548 +# Kernel options
32549 +#
32550 +# CONFIG_HIGHMEM is not set
32551 +# CONFIG_TICK_ONESHOT is not set
32552 +# CONFIG_NO_HZ is not set
32553 +# CONFIG_HIGH_RES_TIMERS is not set
32554 +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
32555 +# CONFIG_HZ_100 is not set
32556 +CONFIG_HZ_250=y
32557 +# CONFIG_HZ_300 is not set
32558 +# CONFIG_HZ_1000 is not set
32559 +CONFIG_HZ=250
32560 +CONFIG_PREEMPT_NONE=y
32561 +# CONFIG_PREEMPT_VOLUNTARY is not set
32562 +# CONFIG_PREEMPT is not set
32563 +CONFIG_BINFMT_ELF=y
32564 +# CONFIG_BINFMT_MISC is not set
32565 +CONFIG_MATH_EMULATION=y
32566 +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
32567 +CONFIG_ARCH_FLATMEM_ENABLE=y
32568 +CONFIG_ARCH_POPULATES_NODE_MAP=y
32569 +CONFIG_SELECT_MEMORY_MODEL=y
32570 +CONFIG_FLATMEM_MANUAL=y
32571 +# CONFIG_DISCONTIGMEM_MANUAL is not set
32572 +# CONFIG_SPARSEMEM_MANUAL is not set
32573 +CONFIG_FLATMEM=y
32574 +CONFIG_FLAT_NODE_MEM_MAP=y
32575 +# CONFIG_SPARSEMEM_STATIC is not set
32576 +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
32577 +CONFIG_SPLIT_PTLOCK_CPUS=4
32578 +CONFIG_RESOURCES_64BIT=y
32579 +CONFIG_ZONE_DMA_FLAG=1
32580 +CONFIG_BOUNCE=y
32581 +CONFIG_VIRT_TO_BUS=y
32582 +CONFIG_PROC_DEVICETREE=y
32583 +CONFIG_CMDLINE_BOOL=y
32584 +CONFIG_CMDLINE=""
32585 +CONFIG_SECCOMP=y
32586 +CONFIG_WANT_DEVICE_TREE=y
32587 +CONFIG_DEVICE_TREE="rainier.dts"
32588 +CONFIG_ISA_DMA_API=y
32589 +
32590 +#
32591 +# Bus options
32592 +#
32593 +CONFIG_ZONE_DMA=y
32594 +CONFIG_PPC_INDIRECT_PCI=y
32595 +CONFIG_PCI=y
32596 +CONFIG_PCI_DOMAINS=y
32597 +CONFIG_PCI_SYSCALL=y
32598 +# CONFIG_PCIEPORTBUS is not set
32599 +CONFIG_ARCH_SUPPORTS_MSI=y
32600 +# CONFIG_PCI_MSI is not set
32601 +CONFIG_PCI_LEGACY=y
32602 +# CONFIG_PCI_DEBUG is not set
32603 +# CONFIG_PCCARD is not set
32604 +# CONFIG_HOTPLUG_PCI is not set
32605 +
32606 +#
32607 +# Advanced setup
32608 +#
32609 +# CONFIG_ADVANCED_OPTIONS is not set
32610 +
32611 +#
32612 +# Default settings for advanced configuration options are used
32613 +#
32614 +CONFIG_HIGHMEM_START=0xfe000000
32615 +CONFIG_LOWMEM_SIZE=0x30000000
32616 +CONFIG_KERNEL_START=0xc0000000
32617 +CONFIG_TASK_SIZE=0xc0000000
32618 +CONFIG_CONSISTENT_START=0xff100000
32619 +CONFIG_CONSISTENT_SIZE=0x00200000
32620 +CONFIG_BOOT_LOAD=0x01000000
32621 +
32622 +#
32623 +# Networking
32624 +#
32625 +CONFIG_NET=y
32626 +
32627 +#
32628 +# Networking options
32629 +#
32630 +CONFIG_PACKET=y
32631 +# CONFIG_PACKET_MMAP is not set
32632 +CONFIG_UNIX=y
32633 +# CONFIG_NET_KEY is not set
32634 +CONFIG_INET=y
32635 +# CONFIG_IP_MULTICAST is not set
32636 +# CONFIG_IP_ADVANCED_ROUTER is not set
32637 +CONFIG_IP_FIB_HASH=y
32638 +CONFIG_IP_PNP=y
32639 +CONFIG_IP_PNP_DHCP=y
32640 +CONFIG_IP_PNP_BOOTP=y
32641 +# CONFIG_IP_PNP_RARP is not set
32642 +# CONFIG_NET_IPIP is not set
32643 +# CONFIG_NET_IPGRE is not set
32644 +# CONFIG_ARPD is not set
32645 +# CONFIG_SYN_COOKIES is not set
32646 +# CONFIG_INET_AH is not set
32647 +# CONFIG_INET_ESP is not set
32648 +# CONFIG_INET_IPCOMP is not set
32649 +# CONFIG_INET_XFRM_TUNNEL is not set
32650 +# CONFIG_INET_TUNNEL is not set
32651 +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
32652 +# CONFIG_INET_XFRM_MODE_TUNNEL is not set
32653 +# CONFIG_INET_XFRM_MODE_BEET is not set
32654 +# CONFIG_INET_LRO is not set
32655 +CONFIG_INET_DIAG=y
32656 +CONFIG_INET_TCP_DIAG=y
32657 +# CONFIG_TCP_CONG_ADVANCED is not set
32658 +CONFIG_TCP_CONG_CUBIC=y
32659 +CONFIG_DEFAULT_TCP_CONG="cubic"
32660 +# CONFIG_TCP_MD5SIG is not set
32661 +# CONFIG_IPV6 is not set
32662 +# CONFIG_INET6_XFRM_TUNNEL is not set
32663 +# CONFIG_INET6_TUNNEL is not set
32664 +# CONFIG_NETWORK_SECMARK is not set
32665 +# CONFIG_NETFILTER is not set
32666 +# CONFIG_IP_DCCP is not set
32667 +# CONFIG_IP_SCTP is not set
32668 +# CONFIG_TIPC is not set
32669 +# CONFIG_ATM is not set
32670 +# CONFIG_BRIDGE is not set
32671 +# CONFIG_VLAN_8021Q is not set
32672 +# CONFIG_DECNET is not set
32673 +# CONFIG_LLC2 is not set
32674 +# CONFIG_IPX is not set
32675 +# CONFIG_ATALK is not set
32676 +# CONFIG_X25 is not set
32677 +# CONFIG_LAPB is not set
32678 +# CONFIG_ECONET is not set
32679 +# CONFIG_WAN_ROUTER is not set
32680 +# CONFIG_NET_SCHED is not set
32681 +
32682 +#
32683 +# Network testing
32684 +#
32685 +# CONFIG_NET_PKTGEN is not set
32686 +# CONFIG_HAMRADIO is not set
32687 +# CONFIG_IRDA is not set
32688 +# CONFIG_BT is not set
32689 +# CONFIG_AF_RXRPC is not set
32690 +
32691 +#
32692 +# Wireless
32693 +#
32694 +# CONFIG_CFG80211 is not set
32695 +# CONFIG_WIRELESS_EXT is not set
32696 +# CONFIG_MAC80211 is not set
32697 +# CONFIG_IEEE80211 is not set
32698 +# CONFIG_RFKILL is not set
32699 +# CONFIG_NET_9P is not set
32700 +
32701 +#
32702 +# Device Drivers
32703 +#
32704 +
32705 +#
32706 +# Generic Driver Options
32707 +#
32708 +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
32709 +CONFIG_STANDALONE=y
32710 +CONFIG_PREVENT_FIRMWARE_BUILD=y
32711 +CONFIG_FW_LOADER=y
32712 +# CONFIG_DEBUG_DRIVER is not set
32713 +# CONFIG_DEBUG_DEVRES is not set
32714 +# CONFIG_SYS_HYPERVISOR is not set
32715 +CONFIG_CONNECTOR=y
32716 +CONFIG_PROC_EVENTS=y
32717 +CONFIG_MTD=y
32718 +# CONFIG_MTD_DEBUG is not set
32719 +# CONFIG_MTD_CONCAT is not set
32720 +CONFIG_MTD_PARTITIONS=y
32721 +# CONFIG_MTD_REDBOOT_PARTS is not set
32722 +CONFIG_MTD_CMDLINE_PARTS=y
32723 +
32724 +#
32725 +# User Modules And Translation Layers
32726 +#
32727 +CONFIG_MTD_CHAR=y
32728 +# CONFIG_MTD_BLKDEVS is not set
32729 +# CONFIG_MTD_BLOCK is not set
32730 +# CONFIG_MTD_BLOCK_RO is not set
32731 +# CONFIG_FTL is not set
32732 +# CONFIG_NFTL is not set
32733 +# CONFIG_INFTL is not set
32734 +# CONFIG_RFD_FTL is not set
32735 +# CONFIG_SSFDC is not set
32736 +# CONFIG_MTD_OOPS is not set
32737 +
32738 +#
32739 +# RAM/ROM/Flash chip drivers
32740 +#
32741 +CONFIG_MTD_CFI=y
32742 +CONFIG_MTD_JEDECPROBE=y
32743 +CONFIG_MTD_GEN_PROBE=y
32744 +# CONFIG_MTD_CFI_ADV_OPTIONS is not set
32745 +CONFIG_MTD_MAP_BANK_WIDTH_1=y
32746 +CONFIG_MTD_MAP_BANK_WIDTH_2=y
32747 +CONFIG_MTD_MAP_BANK_WIDTH_4=y
32748 +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
32749 +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
32750 +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
32751 +CONFIG_MTD_CFI_I1=y
32752 +CONFIG_MTD_CFI_I2=y
32753 +# CONFIG_MTD_CFI_I4 is not set
32754 +# CONFIG_MTD_CFI_I8 is not set
32755 +CONFIG_MTD_CFI_INTELEXT=y
32756 +CONFIG_MTD_CFI_AMDSTD=y
32757 +# CONFIG_MTD_CFI_STAA is not set
32758 +CONFIG_MTD_CFI_UTIL=y
32759 +# CONFIG_MTD_RAM is not set
32760 +# CONFIG_MTD_ROM is not set
32761 +# CONFIG_MTD_ABSENT is not set
32762 +
32763 +#
32764 +# Mapping drivers for chip access
32765 +#
32766 +# CONFIG_MTD_COMPLEX_MAPPINGS is not set
32767 +# CONFIG_MTD_PHYSMAP is not set
32768 +CONFIG_MTD_PHYSMAP_OF=y
32769 +# CONFIG_MTD_INTEL_VR_NOR is not set
32770 +# CONFIG_MTD_PLATRAM is not set
32771 +
32772 +#
32773 +# Self-contained MTD device drivers
32774 +#
32775 +# CONFIG_MTD_PMC551 is not set
32776 +# CONFIG_MTD_SLRAM is not set
32777 +# CONFIG_MTD_PHRAM is not set
32778 +# CONFIG_MTD_MTDRAM is not set
32779 +# CONFIG_MTD_BLOCK2MTD is not set
32780 +
32781 +#
32782 +# Disk-On-Chip Device Drivers
32783 +#
32784 +# CONFIG_MTD_DOC2000 is not set
32785 +# CONFIG_MTD_DOC2001 is not set
32786 +# CONFIG_MTD_DOC2001PLUS is not set
32787 +# CONFIG_MTD_NAND is not set
32788 +# CONFIG_MTD_ONENAND is not set
32789 +
32790 +#
32791 +# UBI - Unsorted block images
32792 +#
32793 +# CONFIG_MTD_UBI is not set
32794 +CONFIG_OF_DEVICE=y
32795 +# CONFIG_PARPORT is not set
32796 +CONFIG_BLK_DEV=y
32797 +# CONFIG_BLK_DEV_FD is not set
32798 +# CONFIG_BLK_CPQ_DA is not set
32799 +# CONFIG_BLK_CPQ_CISS_DA is not set
32800 +# CONFIG_BLK_DEV_DAC960 is not set
32801 +# CONFIG_BLK_DEV_UMEM is not set
32802 +# CONFIG_BLK_DEV_COW_COMMON is not set
32803 +# CONFIG_BLK_DEV_LOOP is not set
32804 +# CONFIG_BLK_DEV_NBD is not set
32805 +# CONFIG_BLK_DEV_SX8 is not set
32806 +CONFIG_BLK_DEV_RAM=y
32807 +CONFIG_BLK_DEV_RAM_COUNT=16
32808 +CONFIG_BLK_DEV_RAM_SIZE=35000
32809 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
32810 +# CONFIG_CDROM_PKTCDVD is not set
32811 +# CONFIG_ATA_OVER_ETH is not set
32812 +# CONFIG_XILINX_SYSACE is not set
32813 +CONFIG_MISC_DEVICES=y
32814 +# CONFIG_PHANTOM is not set
32815 +# CONFIG_EEPROM_93CX6 is not set
32816 +# CONFIG_SGI_IOC4 is not set
32817 +# CONFIG_TIFM_CORE is not set
32818 +# CONFIG_IDE is not set
32819 +
32820 +#
32821 +# SCSI device support
32822 +#
32823 +# CONFIG_RAID_ATTRS is not set
32824 +# CONFIG_SCSI is not set
32825 +# CONFIG_SCSI_DMA is not set
32826 +# CONFIG_SCSI_NETLINK is not set
32827 +# CONFIG_ATA is not set
32828 +# CONFIG_MD is not set
32829 +# CONFIG_FUSION is not set
32830 +
32831 +#
32832 +# IEEE 1394 (FireWire) support
32833 +#
32834 +# CONFIG_FIREWIRE is not set
32835 +# CONFIG_IEEE1394 is not set
32836 +# CONFIG_I2O is not set
32837 +CONFIG_MACINTOSH_DRIVERS=y
32838 +# CONFIG_MAC_EMUMOUSEBTN is not set
32839 +# CONFIG_WINDFARM is not set
32840 +CONFIG_NETDEVICES=y
32841 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
32842 +# CONFIG_DUMMY is not set
32843 +# CONFIG_BONDING is not set
32844 +# CONFIG_MACVLAN is not set
32845 +# CONFIG_EQUALIZER is not set
32846 +# CONFIG_TUN is not set
32847 +# CONFIG_VETH is not set
32848 +# CONFIG_IP1000 is not set
32849 +# CONFIG_ARCNET is not set
32850 +# CONFIG_NET_ETHERNET is not set
32851 +CONFIG_IBM_NEW_EMAC_ZMII=y
32852 +CONFIG_IBM_NEW_EMAC_RGMII=y
32853 +CONFIG_IBM_NEW_EMAC_EMAC4=y
32854 +CONFIG_NETDEV_1000=y
32855 +# CONFIG_ACENIC is not set
32856 +# CONFIG_DL2K is not set
32857 +# CONFIG_E1000 is not set
32858 +# CONFIG_E1000E is not set
32859 +# CONFIG_NS83820 is not set
32860 +# CONFIG_HAMACHI is not set
32861 +# CONFIG_YELLOWFIN is not set
32862 +# CONFIG_R8169 is not set
32863 +# CONFIG_SIS190 is not set
32864 +# CONFIG_SKGE is not set
32865 +# CONFIG_SKY2 is not set
32866 +# CONFIG_SK98LIN is not set
32867 +# CONFIG_VIA_VELOCITY is not set
32868 +# CONFIG_TIGON3 is not set
32869 +# CONFIG_BNX2 is not set
32870 +# CONFIG_QLA3XXX is not set
32871 +# CONFIG_ATL1 is not set
32872 +CONFIG_NETDEV_10000=y
32873 +# CONFIG_CHELSIO_T1 is not set
32874 +# CONFIG_CHELSIO_T3 is not set
32875 +# CONFIG_IXGBE is not set
32876 +# CONFIG_IXGB is not set
32877 +# CONFIG_S2IO is not set
32878 +# CONFIG_MYRI10GE is not set
32879 +# CONFIG_NETXEN_NIC is not set
32880 +# CONFIG_NIU is not set
32881 +# CONFIG_MLX4_CORE is not set
32882 +# CONFIG_TEHUTI is not set
32883 +# CONFIG_TR is not set
32884 +
32885 +#
32886 +# Wireless LAN
32887 +#
32888 +# CONFIG_WLAN_PRE80211 is not set
32889 +# CONFIG_WLAN_80211 is not set
32890 +# CONFIG_WAN is not set
32891 +# CONFIG_FDDI is not set
32892 +# CONFIG_HIPPI is not set
32893 +# CONFIG_PPP is not set
32894 +# CONFIG_SLIP is not set
32895 +# CONFIG_SHAPER is not set
32896 +# CONFIG_NETCONSOLE is not set
32897 +# CONFIG_NETPOLL is not set
32898 +# CONFIG_NET_POLL_CONTROLLER is not set
32899 +# CONFIG_ISDN is not set
32900 +# CONFIG_PHONE is not set
32901 +
32902 +#
32903 +# Input device support
32904 +#
32905 +# CONFIG_INPUT is not set
32906 +
32907 +#
32908 +# Hardware I/O ports
32909 +#
32910 +# CONFIG_SERIO is not set
32911 +# CONFIG_GAMEPORT is not set
32912 +
32913 +#
32914 +# Character devices
32915 +#
32916 +# CONFIG_VT is not set
32917 +# CONFIG_SERIAL_NONSTANDARD is not set
32918 +
32919 +#
32920 +# Serial drivers
32921 +#
32922 +CONFIG_SERIAL_8250=y
32923 +CONFIG_SERIAL_8250_CONSOLE=y
32924 +# CONFIG_SERIAL_8250_PCI is not set
32925 +CONFIG_SERIAL_8250_NR_UARTS=4
32926 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4
32927 +CONFIG_SERIAL_8250_EXTENDED=y
32928 +# CONFIG_SERIAL_8250_MANY_PORTS is not set
32929 +CONFIG_SERIAL_8250_SHARE_IRQ=y
32930 +# CONFIG_SERIAL_8250_DETECT_IRQ is not set
32931 +# CONFIG_SERIAL_8250_RSA is not set
32932 +
32933 +#
32934 +# Non-8250 serial port support
32935 +#
32936 +# CONFIG_SERIAL_UARTLITE is not set
32937 +CONFIG_SERIAL_CORE=y
32938 +CONFIG_SERIAL_CORE_CONSOLE=y
32939 +# CONFIG_SERIAL_JSM is not set
32940 +CONFIG_SERIAL_OF_PLATFORM=y
32941 +CONFIG_UNIX98_PTYS=y
32942 +CONFIG_LEGACY_PTYS=y
32943 +CONFIG_LEGACY_PTY_COUNT=256
32944 +# CONFIG_IPMI_HANDLER is not set
32945 +# CONFIG_HW_RANDOM is not set
32946 +# CONFIG_NVRAM is not set
32947 +# CONFIG_GEN_RTC is not set
32948 +# CONFIG_R3964 is not set
32949 +# CONFIG_APPLICOM is not set
32950 +# CONFIG_RAW_DRIVER is not set
32951 +# CONFIG_TCG_TPM is not set
32952 +CONFIG_DEVPORT=y
32953 +# CONFIG_I2C is not set
32954 +
32955 +#
32956 +# SPI support
32957 +#
32958 +# CONFIG_SPI is not set
32959 +# CONFIG_SPI_MASTER is not set
32960 +# CONFIG_W1 is not set
32961 +# CONFIG_POWER_SUPPLY is not set
32962 +# CONFIG_HWMON is not set
32963 +# CONFIG_WATCHDOG is not set
32964 +
32965 +#
32966 +# Sonics Silicon Backplane
32967 +#
32968 +CONFIG_SSB_POSSIBLE=y
32969 +# CONFIG_SSB is not set
32970 +
32971 +#
32972 +# Multifunction device drivers
32973 +#
32974 +# CONFIG_MFD_SM501 is not set
32975 +
32976 +#
32977 +# Multimedia devices
32978 +#
32979 +# CONFIG_VIDEO_DEV is not set
32980 +# CONFIG_DVB_CORE is not set
32981 +CONFIG_DAB=y
32982 +
32983 +#
32984 +# Graphics support
32985 +#
32986 +# CONFIG_AGP is not set
32987 +# CONFIG_DRM is not set
32988 +# CONFIG_VGASTATE is not set
32989 +CONFIG_VIDEO_OUTPUT_CONTROL=m
32990 +# CONFIG_FB is not set
32991 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
32992 +
32993 +#
32994 +# Display device support
32995 +#
32996 +# CONFIG_DISPLAY_SUPPORT is not set
32997 +
32998 +#
32999 +# Sound
33000 +#
33001 +# CONFIG_SOUND is not set
33002 +CONFIG_USB_SUPPORT=y
33003 +CONFIG_USB_ARCH_HAS_HCD=y
33004 +CONFIG_USB_ARCH_HAS_OHCI=y
33005 +CONFIG_USB_ARCH_HAS_EHCI=y
33006 +# CONFIG_USB is not set
33007 +
33008 +#
33009 +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
33010 +#
33011 +
33012 +#
33013 +# USB Gadget Support
33014 +#
33015 +# CONFIG_USB_GADGET is not set
33016 +# CONFIG_MMC is not set
33017 +# CONFIG_NEW_LEDS is not set
33018 +# CONFIG_INFINIBAND is not set
33019 +# CONFIG_EDAC is not set
33020 +# CONFIG_RTC_CLASS is not set
33021 +
33022 +#
33023 +# Userspace I/O
33024 +#
33025 +# CONFIG_UIO is not set
33026 +
33027 +#
33028 +# File systems
33029 +#
33030 +CONFIG_EXT2_FS=y
33031 +# CONFIG_EXT2_FS_XATTR is not set
33032 +# CONFIG_EXT2_FS_XIP is not set
33033 +# CONFIG_EXT3_FS is not set
33034 +# CONFIG_EXT4DEV_FS is not set
33035 +# CONFIG_REISERFS_FS is not set
33036 +# CONFIG_JFS_FS is not set
33037 +# CONFIG_FS_POSIX_ACL is not set
33038 +# CONFIG_XFS_FS is not set
33039 +# CONFIG_GFS2_FS is not set
33040 +# CONFIG_OCFS2_FS is not set
33041 +# CONFIG_MINIX_FS is not set
33042 +# CONFIG_ROMFS_FS is not set
33043 +CONFIG_INOTIFY=y
33044 +CONFIG_INOTIFY_USER=y
33045 +# CONFIG_QUOTA is not set
33046 +CONFIG_DNOTIFY=y
33047 +# CONFIG_AUTOFS_FS is not set
33048 +# CONFIG_AUTOFS4_FS is not set
33049 +# CONFIG_FUSE_FS is not set
33050 +
33051 +#
33052 +# CD-ROM/DVD Filesystems
33053 +#
33054 +# CONFIG_ISO9660_FS is not set
33055 +# CONFIG_UDF_FS is not set
33056 +
33057 +#
33058 +# DOS/FAT/NT Filesystems
33059 +#
33060 +# CONFIG_MSDOS_FS is not set
33061 +# CONFIG_VFAT_FS is not set
33062 +# CONFIG_NTFS_FS is not set
33063 +
33064 +#
33065 +# Pseudo filesystems
33066 +#
33067 +CONFIG_PROC_FS=y
33068 +CONFIG_PROC_KCORE=y
33069 +CONFIG_PROC_SYSCTL=y
33070 +CONFIG_SYSFS=y
33071 +CONFIG_TMPFS=y
33072 +# CONFIG_TMPFS_POSIX_ACL is not set
33073 +# CONFIG_HUGETLB_PAGE is not set
33074 +# CONFIG_CONFIGFS_FS is not set
33075 +
33076 +#
33077 +# Miscellaneous filesystems
33078 +#
33079 +# CONFIG_ADFS_FS is not set
33080 +# CONFIG_AFFS_FS is not set
33081 +# CONFIG_HFS_FS is not set
33082 +# CONFIG_HFSPLUS_FS is not set
33083 +# CONFIG_BEFS_FS is not set
33084 +# CONFIG_BFS_FS is not set
33085 +# CONFIG_EFS_FS is not set
33086 +CONFIG_JFFS2_FS=y
33087 +CONFIG_JFFS2_FS_DEBUG=0
33088 +CONFIG_JFFS2_FS_WRITEBUFFER=y
33089 +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
33090 +# CONFIG_JFFS2_SUMMARY is not set
33091 +# CONFIG_JFFS2_FS_XATTR is not set
33092 +# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
33093 +CONFIG_JFFS2_ZLIB=y
33094 +# CONFIG_JFFS2_LZO is not set
33095 +CONFIG_JFFS2_RTIME=y
33096 +# CONFIG_JFFS2_RUBIN is not set
33097 +CONFIG_CRAMFS=y
33098 +# CONFIG_VXFS_FS is not set
33099 +# CONFIG_HPFS_FS is not set
33100 +# CONFIG_QNX4FS_FS is not set
33101 +# CONFIG_SYSV_FS is not set
33102 +# CONFIG_UFS_FS is not set
33103 +CONFIG_NETWORK_FILESYSTEMS=y
33104 +CONFIG_NFS_FS=y
33105 +CONFIG_NFS_V3=y
33106 +# CONFIG_NFS_V3_ACL is not set
33107 +# CONFIG_NFS_V4 is not set
33108 +# CONFIG_NFS_DIRECTIO is not set
33109 +# CONFIG_NFSD is not set
33110 +CONFIG_ROOT_NFS=y
33111 +CONFIG_LOCKD=y
33112 +CONFIG_LOCKD_V4=y
33113 +CONFIG_NFS_COMMON=y
33114 +CONFIG_SUNRPC=y
33115 +# CONFIG_SUNRPC_BIND34 is not set
33116 +# CONFIG_RPCSEC_GSS_KRB5 is not set
33117 +# CONFIG_RPCSEC_GSS_SPKM3 is not set
33118 +# CONFIG_SMB_FS is not set
33119 +# CONFIG_CIFS is not set
33120 +# CONFIG_NCP_FS is not set
33121 +# CONFIG_CODA_FS is not set
33122 +# CONFIG_AFS_FS is not set
33123 +
33124 +#
33125 +# Partition Types
33126 +#
33127 +# CONFIG_PARTITION_ADVANCED is not set
33128 +CONFIG_MSDOS_PARTITION=y
33129 +# CONFIG_NLS is not set
33130 +# CONFIG_DLM is not set
33131 +# CONFIG_UCC_SLOW is not set
33132 +
33133 +#
33134 +# Library routines
33135 +#
33136 +CONFIG_BITREVERSE=y
33137 +# CONFIG_CRC_CCITT is not set
33138 +# CONFIG_CRC16 is not set
33139 +# CONFIG_CRC_ITU_T is not set
33140 +CONFIG_CRC32=y
33141 +# CONFIG_CRC7 is not set
33142 +# CONFIG_LIBCRC32C is not set
33143 +CONFIG_ZLIB_INFLATE=y
33144 +CONFIG_ZLIB_DEFLATE=y
33145 +CONFIG_PLIST=y
33146 +CONFIG_HAS_IOMEM=y
33147 +CONFIG_HAS_IOPORT=y
33148 +CONFIG_HAS_DMA=y
33149 +CONFIG_INSTRUMENTATION=y
33150 +# CONFIG_PROFILING is not set
33151 +# CONFIG_KPROBES is not set
33152 +# CONFIG_MARKERS is not set
33153 +
33154 +#
33155 +# Kernel hacking
33156 +#
33157 +# CONFIG_PRINTK_TIME is not set
33158 +CONFIG_ENABLE_WARN_DEPRECATED=y
33159 +CONFIG_ENABLE_MUST_CHECK=y
33160 +CONFIG_MAGIC_SYSRQ=y
33161 +# CONFIG_UNUSED_SYMBOLS is not set
33162 +# CONFIG_DEBUG_FS is not set
33163 +# CONFIG_HEADERS_CHECK is not set
33164 +CONFIG_DEBUG_KERNEL=y
33165 +# CONFIG_DEBUG_SHIRQ is not set
33166 +CONFIG_DETECT_SOFTLOCKUP=y
33167 +CONFIG_SCHED_DEBUG=y
33168 +# CONFIG_SCHEDSTATS is not set
33169 +# CONFIG_TIMER_STATS is not set
33170 +# CONFIG_SLUB_DEBUG_ON is not set
33171 +# CONFIG_DEBUG_RT_MUTEXES is not set
33172 +# CONFIG_RT_MUTEX_TESTER is not set
33173 +# CONFIG_DEBUG_SPINLOCK is not set
33174 +# CONFIG_DEBUG_MUTEXES is not set
33175 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
33176 +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
33177 +# CONFIG_DEBUG_KOBJECT is not set
33178 +# CONFIG_DEBUG_BUGVERBOSE is not set
33179 +# CONFIG_DEBUG_INFO is not set
33180 +# CONFIG_DEBUG_VM is not set
33181 +# CONFIG_DEBUG_LIST is not set
33182 +# CONFIG_DEBUG_SG is not set
33183 +CONFIG_FORCED_INLINING=y
33184 +# CONFIG_BOOT_PRINTK_DELAY is not set
33185 +# CONFIG_RCU_TORTURE_TEST is not set
33186 +# CONFIG_FAULT_INJECTION is not set
33187 +# CONFIG_SAMPLES is not set
33188 +# CONFIG_DEBUG_STACKOVERFLOW is not set
33189 +# CONFIG_DEBUG_STACK_USAGE is not set
33190 +# CONFIG_DEBUG_PAGEALLOC is not set
33191 +CONFIG_DEBUGGER=y
33192 +# CONFIG_KGDB is not set
33193 +# CONFIG_XMON is not set
33194 +# CONFIG_BDI_SWITCH is not set
33195 +CONFIG_PPC_EARLY_DEBUG=y
33196 +# CONFIG_PPC_EARLY_DEBUG_LPAR is not set
33197 +# CONFIG_PPC_EARLY_DEBUG_G5 is not set
33198 +# CONFIG_PPC_EARLY_DEBUG_RTAS_PANEL is not set
33199 +# CONFIG_PPC_EARLY_DEBUG_RTAS_CONSOLE is not set
33200 +# CONFIG_PPC_EARLY_DEBUG_MAPLE is not set
33201 +# CONFIG_PPC_EARLY_DEBUG_ISERIES is not set
33202 +# CONFIG_PPC_EARLY_DEBUG_PAS_REALMODE is not set
33203 +# CONFIG_PPC_EARLY_DEBUG_BEAT is not set
33204 +CONFIG_PPC_EARLY_DEBUG_44x=y
33205 +# CONFIG_PPC_EARLY_DEBUG_40x is not set
33206 +# CONFIG_PPC_EARLY_DEBUG_CPM is not set
33207 +CONFIG_PPC_EARLY_DEBUG_44x_PHYSLOW=0xef600300
33208 +CONFIG_PPC_EARLY_DEBUG_44x_PHYSHIGH=0x1
33209 +
33210 +#
33211 +# Security options
33212 +#
33213 +# CONFIG_KEYS is not set
33214 +# CONFIG_SECURITY is not set
33215 +# CONFIG_SECURITY_FILE_CAPABILITIES is not set
33216 +CONFIG_CRYPTO=y
33217 +CONFIG_CRYPTO_ALGAPI=y
33218 +CONFIG_CRYPTO_BLKCIPHER=y
33219 +CONFIG_CRYPTO_MANAGER=y
33220 +# CONFIG_CRYPTO_HMAC is not set
33221 +# CONFIG_CRYPTO_XCBC is not set
33222 +# CONFIG_CRYPTO_NULL is not set
33223 +# CONFIG_CRYPTO_MD4 is not set
33224 +CONFIG_CRYPTO_MD5=y
33225 +# CONFIG_CRYPTO_SHA1 is not set
33226 +# CONFIG_CRYPTO_SHA256 is not set
33227 +# CONFIG_CRYPTO_SHA512 is not set
33228 +# CONFIG_CRYPTO_WP512 is not set
33229 +# CONFIG_CRYPTO_TGR192 is not set
33230 +# CONFIG_CRYPTO_GF128MUL is not set
33231 +CONFIG_CRYPTO_ECB=y
33232 +CONFIG_CRYPTO_CBC=y
33233 +CONFIG_CRYPTO_PCBC=y
33234 +# CONFIG_CRYPTO_LRW is not set
33235 +# CONFIG_CRYPTO_XTS is not set
33236 +# CONFIG_CRYPTO_CRYPTD is not set
33237 +CONFIG_CRYPTO_DES=y
33238 +# CONFIG_CRYPTO_FCRYPT is not set
33239 +# CONFIG_CRYPTO_BLOWFISH is not set
33240 +# CONFIG_CRYPTO_TWOFISH is not set
33241 +# CONFIG_CRYPTO_SERPENT is not set
33242 +# CONFIG_CRYPTO_AES is not set
33243 +# CONFIG_CRYPTO_CAST5 is not set
33244 +# CONFIG_CRYPTO_CAST6 is not set
33245 +# CONFIG_CRYPTO_TEA is not set
33246 +# CONFIG_CRYPTO_ARC4 is not set
33247 +# CONFIG_CRYPTO_KHAZAD is not set
33248 +# CONFIG_CRYPTO_ANUBIS is not set
33249 +# CONFIG_CRYPTO_SEED is not set
33250 +# CONFIG_CRYPTO_DEFLATE is not set
33251 +# CONFIG_CRYPTO_MICHAEL_MIC is not set
33252 +# CONFIG_CRYPTO_CRC32C is not set
33253 +# CONFIG_CRYPTO_CAMELLIA is not set
33254 +# CONFIG_CRYPTO_TEST is not set
33255 +# CONFIG_CRYPTO_AUTHENC is not set
33256 +CONFIG_CRYPTO_HW=y
33257 +# CONFIG_PPC_CLOCK is not set
33258 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/configs/sequoia_defconfig powerpc.git/arch/powerpc/configs/sequoia_defconfig
33259 --- linux-2.6.24/arch/powerpc/configs/sequoia_defconfig 2008-01-24 23:58:37.000000000 +0100
33260 +++ powerpc.git/arch/powerpc/configs/sequoia_defconfig  2008-01-28 20:25:49.000000000 +0100
33261 @@ -1,7 +1,7 @@
33262  #
33263  # Automatically generated make config: don't edit
33264 -# Linux kernel version: 2.6.24-rc4
33265 -# Thu Dec  6 16:49:17 2007
33266 +# Linux kernel version: 2.6.24-rc6
33267 +# Mon Dec 24 11:23:22 2007
33268  #
33269  # CONFIG_PPC64 is not set
33270  
33271 @@ -129,6 +129,7 @@
33272  # CONFIG_DEFAULT_CFQ is not set
33273  # CONFIG_DEFAULT_NOOP is not set
33274  CONFIG_DEFAULT_IOSCHED="anticipatory"
33275 +# CONFIG_PPC4xx_PCI_EXPRESS is not set
33276  
33277  #
33278  # Platform support
33279 @@ -141,8 +142,10 @@
33280  # CONFIG_BAMBOO is not set
33281  # CONFIG_EBONY is not set
33282  CONFIG_SEQUOIA=y
33283 +# CONFIG_TAISHAN is not set
33284 +# CONFIG_KATMAI is not set
33285 +# CONFIG_RAINIER is not set
33286  CONFIG_440EPX=y
33287 -CONFIG_440A=y
33288  # CONFIG_MPIC is not set
33289  # CONFIG_MPIC_WEIRD is not set
33290  # CONFIG_PPC_I8259 is not set
33291 @@ -446,9 +449,7 @@
33292  # CONFIG_FIREWIRE is not set
33293  # CONFIG_IEEE1394 is not set
33294  # CONFIG_I2O is not set
33295 -CONFIG_MACINTOSH_DRIVERS=y
33296 -# CONFIG_MAC_EMUMOUSEBTN is not set
33297 -# CONFIG_WINDFARM is not set
33298 +# CONFIG_MACINTOSH_DRIVERS is not set
33299  CONFIG_NETDEVICES=y
33300  # CONFIG_NETDEVICES_MULTIQUEUE is not set
33301  # CONFIG_DUMMY is not set
33302 @@ -459,10 +460,28 @@
33303  # CONFIG_VETH is not set
33304  # CONFIG_IP1000 is not set
33305  # CONFIG_ARCNET is not set
33306 -# CONFIG_NET_ETHERNET is not set
33307 +# CONFIG_PHYLIB is not set
33308 +CONFIG_NET_ETHERNET=y
33309 +# CONFIG_MII is not set
33310 +# CONFIG_HAPPYMEAL is not set
33311 +# CONFIG_SUNGEM is not set
33312 +# CONFIG_CASSINI is not set
33313 +# CONFIG_NET_VENDOR_3COM is not set
33314 +# CONFIG_NET_TULIP is not set
33315 +# CONFIG_HP100 is not set
33316 +CONFIG_IBM_NEW_EMAC=y
33317 +CONFIG_IBM_NEW_EMAC_RXB=128
33318 +CONFIG_IBM_NEW_EMAC_TXB=64
33319 +CONFIG_IBM_NEW_EMAC_POLL_WEIGHT=32
33320 +CONFIG_IBM_NEW_EMAC_RX_COPY_THRESHOLD=256
33321 +CONFIG_IBM_NEW_EMAC_RX_SKB_HEADROOM=0
33322 +# CONFIG_IBM_NEW_EMAC_DEBUG is not set
33323  CONFIG_IBM_NEW_EMAC_ZMII=y
33324  CONFIG_IBM_NEW_EMAC_RGMII=y
33325 +# CONFIG_IBM_NEW_EMAC_TAH is not set
33326  CONFIG_IBM_NEW_EMAC_EMAC4=y
33327 +# CONFIG_NET_PCI is not set
33328 +# CONFIG_B44 is not set
33329  CONFIG_NETDEV_1000=y
33330  # CONFIG_ACENIC is not set
33331  # CONFIG_DL2K is not set
33332 @@ -811,6 +830,7 @@
33333  # CONFIG_PPC_EARLY_DEBUG_PAS_REALMODE is not set
33334  # CONFIG_PPC_EARLY_DEBUG_BEAT is not set
33335  CONFIG_PPC_EARLY_DEBUG_44x=y
33336 +# CONFIG_PPC_EARLY_DEBUG_40x is not set
33337  # CONFIG_PPC_EARLY_DEBUG_CPM is not set
33338  CONFIG_PPC_EARLY_DEBUG_44x_PHYSLOW=0xef600300
33339  CONFIG_PPC_EARLY_DEBUG_44x_PHYSHIGH=0x1
33340 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/configs/storcenter_defconfig powerpc.git/arch/powerpc/configs/storcenter_defconfig
33341 --- linux-2.6.24/arch/powerpc/configs/storcenter_defconfig      1970-01-01 01:00:00.000000000 +0100
33342 +++ powerpc.git/arch/powerpc/configs/storcenter_defconfig       2008-01-28 20:25:49.000000000 +0100
33343 @@ -0,0 +1,1174 @@
33344 +#
33345 +# Automatically generated make config: don't edit
33346 +# Linux kernel version: 2.6.24-rc6
33347 +# Tue Jan  8 09:33:54 2008
33348 +#
33349 +# CONFIG_PPC64 is not set
33350 +
33351 +#
33352 +# Processor support
33353 +#
33354 +CONFIG_6xx=y
33355 +# CONFIG_PPC_85xx is not set
33356 +# CONFIG_PPC_8xx is not set
33357 +# CONFIG_40x is not set
33358 +# CONFIG_44x is not set
33359 +# CONFIG_E200 is not set
33360 +CONFIG_PPC_FPU=y
33361 +# CONFIG_ALTIVEC is not set
33362 +CONFIG_PPC_STD_MMU=y
33363 +CONFIG_PPC_STD_MMU_32=y
33364 +# CONFIG_PPC_MM_SLICES is not set
33365 +# CONFIG_SMP is not set
33366 +CONFIG_PPC32=y
33367 +CONFIG_WORD_SIZE=32
33368 +CONFIG_PPC_MERGE=y
33369 +CONFIG_MMU=y
33370 +CONFIG_GENERIC_CMOS_UPDATE=y
33371 +CONFIG_GENERIC_TIME=y
33372 +CONFIG_GENERIC_TIME_VSYSCALL=y
33373 +CONFIG_GENERIC_CLOCKEVENTS=y
33374 +CONFIG_GENERIC_HARDIRQS=y
33375 +CONFIG_IRQ_PER_CPU=y
33376 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
33377 +CONFIG_ARCH_HAS_ILOG2_U32=y
33378 +CONFIG_GENERIC_HWEIGHT=y
33379 +CONFIG_GENERIC_CALIBRATE_DELAY=y
33380 +CONFIG_GENERIC_FIND_NEXT_BIT=y
33381 +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
33382 +CONFIG_PPC=y
33383 +CONFIG_EARLY_PRINTK=y
33384 +CONFIG_GENERIC_NVRAM=y
33385 +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
33386 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
33387 +CONFIG_PPC_OF=y
33388 +CONFIG_OF=y
33389 +CONFIG_PPC_UDBG_16550=y
33390 +# CONFIG_GENERIC_TBSYNC is not set
33391 +CONFIG_AUDIT_ARCH=y
33392 +CONFIG_GENERIC_BUG=y
33393 +# CONFIG_DEFAULT_UIMAGE is not set
33394 +# CONFIG_PPC_DCR_NATIVE is not set
33395 +# CONFIG_PPC_DCR_MMIO is not set
33396 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
33397 +
33398 +#
33399 +# General setup
33400 +#
33401 +CONFIG_EXPERIMENTAL=y
33402 +CONFIG_BROKEN_ON_SMP=y
33403 +CONFIG_INIT_ENV_ARG_LIMIT=32
33404 +CONFIG_LOCALVERSION=""
33405 +CONFIG_LOCALVERSION_AUTO=y
33406 +CONFIG_SWAP=y
33407 +CONFIG_SYSVIPC=y
33408 +CONFIG_SYSVIPC_SYSCTL=y
33409 +# CONFIG_POSIX_MQUEUE is not set
33410 +# CONFIG_BSD_PROCESS_ACCT is not set
33411 +# CONFIG_TASKSTATS is not set
33412 +# CONFIG_USER_NS is not set
33413 +# CONFIG_PID_NS is not set
33414 +# CONFIG_AUDIT is not set
33415 +# CONFIG_IKCONFIG is not set
33416 +CONFIG_LOG_BUF_SHIFT=14
33417 +# CONFIG_CGROUPS is not set
33418 +CONFIG_FAIR_GROUP_SCHED=y
33419 +CONFIG_FAIR_USER_SCHED=y
33420 +# CONFIG_FAIR_CGROUP_SCHED is not set
33421 +CONFIG_SYSFS_DEPRECATED=y
33422 +# CONFIG_RELAY is not set
33423 +# CONFIG_BLK_DEV_INITRD is not set
33424 +CONFIG_CC_OPTIMIZE_FOR_SIZE=y
33425 +CONFIG_SYSCTL=y
33426 +CONFIG_EMBEDDED=y
33427 +CONFIG_SYSCTL_SYSCALL=y
33428 +# CONFIG_KALLSYMS is not set
33429 +CONFIG_HOTPLUG=y
33430 +CONFIG_PRINTK=y
33431 +CONFIG_BUG=y
33432 +CONFIG_ELF_CORE=y
33433 +CONFIG_BASE_FULL=y
33434 +CONFIG_FUTEX=y
33435 +CONFIG_ANON_INODES=y
33436 +CONFIG_EPOLL=y
33437 +CONFIG_SIGNALFD=y
33438 +CONFIG_EVENTFD=y
33439 +CONFIG_SHMEM=y
33440 +CONFIG_VM_EVENT_COUNTERS=y
33441 +CONFIG_SLUB_DEBUG=y
33442 +# CONFIG_SLAB is not set
33443 +CONFIG_SLUB=y
33444 +# CONFIG_SLOB is not set
33445 +CONFIG_RT_MUTEXES=y
33446 +# CONFIG_TINY_SHMEM is not set
33447 +CONFIG_BASE_SMALL=0
33448 +CONFIG_MODULES=y
33449 +CONFIG_MODULE_UNLOAD=y
33450 +# CONFIG_MODULE_FORCE_UNLOAD is not set
33451 +# CONFIG_MODVERSIONS is not set
33452 +# CONFIG_MODULE_SRCVERSION_ALL is not set
33453 +CONFIG_KMOD=y
33454 +CONFIG_BLOCK=y
33455 +CONFIG_LBD=y
33456 +# CONFIG_BLK_DEV_IO_TRACE is not set
33457 +# CONFIG_LSF is not set
33458 +# CONFIG_BLK_DEV_BSG is not set
33459 +
33460 +#
33461 +# IO Schedulers
33462 +#
33463 +CONFIG_IOSCHED_NOOP=y
33464 +CONFIG_IOSCHED_AS=y
33465 +CONFIG_IOSCHED_DEADLINE=y
33466 +CONFIG_IOSCHED_CFQ=y
33467 +# CONFIG_DEFAULT_AS is not set
33468 +# CONFIG_DEFAULT_DEADLINE is not set
33469 +CONFIG_DEFAULT_CFQ=y
33470 +# CONFIG_DEFAULT_NOOP is not set
33471 +CONFIG_DEFAULT_IOSCHED="cfq"
33472 +
33473 +#
33474 +# Platform support
33475 +#
33476 +CONFIG_PPC_MULTIPLATFORM=y
33477 +# CONFIG_PPC_82xx is not set
33478 +# CONFIG_PPC_83xx is not set
33479 +# CONFIG_PPC_86xx is not set
33480 +CONFIG_CLASSIC32=y
33481 +# CONFIG_PPC_CHRP is not set
33482 +# CONFIG_PPC_MPC52xx is not set
33483 +# CONFIG_PPC_MPC5200 is not set
33484 +# CONFIG_PPC_EFIKA is not set
33485 +# CONFIG_PPC_LITE5200 is not set
33486 +# CONFIG_PPC_PMAC is not set
33487 +# CONFIG_PPC_CELL is not set
33488 +# CONFIG_PPC_CELL_NATIVE is not set
33489 +# CONFIG_PQ2ADS is not set
33490 +CONFIG_EMBEDDED6xx=y
33491 +# CONFIG_LINKSTATION is not set
33492 +CONFIG_STORCENTER=y
33493 +# CONFIG_MPC7448HPC2 is not set
33494 +# CONFIG_PPC_HOLLY is not set
33495 +# CONFIG_PPC_PRPMC2800 is not set
33496 +CONFIG_MPC10X_BRIDGE=y
33497 +CONFIG_MPC10X_OPENPIC=y
33498 +# CONFIG_MPC10X_STORE_GATHERING is not set
33499 +CONFIG_MPIC=y
33500 +# CONFIG_MPIC_WEIRD is not set
33501 +# CONFIG_PPC_I8259 is not set
33502 +# CONFIG_PPC_RTAS is not set
33503 +# CONFIG_MMIO_NVRAM is not set
33504 +# CONFIG_PPC_MPC106 is not set
33505 +# CONFIG_PPC_970_NAP is not set
33506 +# CONFIG_PPC_INDIRECT_IO is not set
33507 +# CONFIG_GENERIC_IOMAP is not set
33508 +# CONFIG_CPU_FREQ is not set
33509 +# CONFIG_TAU is not set
33510 +# CONFIG_CPM2 is not set
33511 +# CONFIG_FSL_ULI1575 is not set
33512 +
33513 +#
33514 +# Kernel options
33515 +#
33516 +# CONFIG_HIGHMEM is not set
33517 +# CONFIG_TICK_ONESHOT is not set
33518 +# CONFIG_NO_HZ is not set
33519 +# CONFIG_HIGH_RES_TIMERS is not set
33520 +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
33521 +CONFIG_HZ_100=y
33522 +# CONFIG_HZ_250 is not set
33523 +# CONFIG_HZ_300 is not set
33524 +# CONFIG_HZ_1000 is not set
33525 +CONFIG_HZ=100
33526 +CONFIG_PREEMPT_NONE=y
33527 +# CONFIG_PREEMPT_VOLUNTARY is not set
33528 +# CONFIG_PREEMPT is not set
33529 +CONFIG_BINFMT_ELF=y
33530 +CONFIG_BINFMT_MISC=y
33531 +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
33532 +# CONFIG_KEXEC is not set
33533 +CONFIG_ARCH_FLATMEM_ENABLE=y
33534 +CONFIG_ARCH_POPULATES_NODE_MAP=y
33535 +CONFIG_SELECT_MEMORY_MODEL=y
33536 +CONFIG_FLATMEM_MANUAL=y
33537 +# CONFIG_DISCONTIGMEM_MANUAL is not set
33538 +# CONFIG_SPARSEMEM_MANUAL is not set
33539 +CONFIG_FLATMEM=y
33540 +CONFIG_FLAT_NODE_MEM_MAP=y
33541 +# CONFIG_SPARSEMEM_STATIC is not set
33542 +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
33543 +CONFIG_SPLIT_PTLOCK_CPUS=4
33544 +# CONFIG_RESOURCES_64BIT is not set
33545 +CONFIG_ZONE_DMA_FLAG=1
33546 +CONFIG_BOUNCE=y
33547 +CONFIG_VIRT_TO_BUS=y
33548 +CONFIG_PROC_DEVICETREE=y
33549 +CONFIG_CMDLINE_BOOL=y
33550 +CONFIG_CMDLINE="console=ttyS0,115200"
33551 +# CONFIG_PM is not set
33552 +CONFIG_SUSPEND_UP_POSSIBLE=y
33553 +CONFIG_HIBERNATION_UP_POSSIBLE=y
33554 +# CONFIG_SECCOMP is not set
33555 +CONFIG_WANT_DEVICE_TREE=y
33556 +CONFIG_DEVICE_TREE="storcenter.dts"
33557 +CONFIG_ISA_DMA_API=y
33558 +
33559 +#
33560 +# Bus options
33561 +#
33562 +CONFIG_ZONE_DMA=y
33563 +CONFIG_GENERIC_ISA_DMA=y
33564 +CONFIG_PPC_INDIRECT_PCI=y
33565 +CONFIG_FSL_SOC=y
33566 +CONFIG_PCI=y
33567 +CONFIG_PCI_DOMAINS=y
33568 +CONFIG_PCI_SYSCALL=y
33569 +# CONFIG_PCIEPORTBUS is not set
33570 +CONFIG_ARCH_SUPPORTS_MSI=y
33571 +# CONFIG_PCI_MSI is not set
33572 +CONFIG_PCI_LEGACY=y
33573 +# CONFIG_PCCARD is not set
33574 +# CONFIG_HOTPLUG_PCI is not set
33575 +
33576 +#
33577 +# Advanced setup
33578 +#
33579 +# CONFIG_ADVANCED_OPTIONS is not set
33580 +
33581 +#
33582 +# Default settings for advanced configuration options are used
33583 +#
33584 +CONFIG_HIGHMEM_START=0xfe000000
33585 +CONFIG_LOWMEM_SIZE=0x30000000
33586 +CONFIG_KERNEL_START=0xc0000000
33587 +CONFIG_TASK_SIZE=0xc0000000
33588 +CONFIG_BOOT_LOAD=0x00800000
33589 +
33590 +#
33591 +# Networking
33592 +#
33593 +CONFIG_NET=y
33594 +
33595 +#
33596 +# Networking options
33597 +#
33598 +CONFIG_PACKET=m
33599 +# CONFIG_PACKET_MMAP is not set
33600 +CONFIG_UNIX=y
33601 +# CONFIG_NET_KEY is not set
33602 +CONFIG_INET=y
33603 +CONFIG_IP_MULTICAST=y
33604 +# CONFIG_IP_ADVANCED_ROUTER is not set
33605 +CONFIG_IP_FIB_HASH=y
33606 +CONFIG_IP_PNP=y
33607 +CONFIG_IP_PNP_DHCP=y
33608 +# CONFIG_IP_PNP_BOOTP is not set
33609 +# CONFIG_IP_PNP_RARP is not set
33610 +# CONFIG_NET_IPIP is not set
33611 +# CONFIG_NET_IPGRE is not set
33612 +# CONFIG_IP_MROUTE is not set
33613 +# CONFIG_ARPD is not set
33614 +# CONFIG_SYN_COOKIES is not set
33615 +# CONFIG_INET_AH is not set
33616 +# CONFIG_INET_ESP is not set
33617 +# CONFIG_INET_IPCOMP is not set
33618 +# CONFIG_INET_XFRM_TUNNEL is not set
33619 +# CONFIG_INET_TUNNEL is not set
33620 +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
33621 +# CONFIG_INET_XFRM_MODE_TUNNEL is not set
33622 +# CONFIG_INET_XFRM_MODE_BEET is not set
33623 +# CONFIG_INET_LRO is not set
33624 +CONFIG_INET_DIAG=y
33625 +CONFIG_INET_TCP_DIAG=y
33626 +# CONFIG_TCP_CONG_ADVANCED is not set
33627 +CONFIG_TCP_CONG_CUBIC=y
33628 +CONFIG_DEFAULT_TCP_CONG="cubic"
33629 +# CONFIG_TCP_MD5SIG is not set
33630 +# CONFIG_IPV6 is not set
33631 +# CONFIG_INET6_XFRM_TUNNEL is not set
33632 +# CONFIG_INET6_TUNNEL is not set
33633 +# CONFIG_NETWORK_SECMARK is not set
33634 +# CONFIG_NETFILTER is not set
33635 +# CONFIG_IP_DCCP is not set
33636 +# CONFIG_IP_SCTP is not set
33637 +# CONFIG_TIPC is not set
33638 +# CONFIG_ATM is not set
33639 +# CONFIG_BRIDGE is not set
33640 +# CONFIG_VLAN_8021Q is not set
33641 +# CONFIG_DECNET is not set
33642 +# CONFIG_LLC2 is not set
33643 +# CONFIG_IPX is not set
33644 +# CONFIG_ATALK is not set
33645 +# CONFIG_X25 is not set
33646 +# CONFIG_LAPB is not set
33647 +# CONFIG_ECONET is not set
33648 +# CONFIG_WAN_ROUTER is not set
33649 +# CONFIG_NET_SCHED is not set
33650 +
33651 +#
33652 +# Network testing
33653 +#
33654 +# CONFIG_NET_PKTGEN is not set
33655 +# CONFIG_HAMRADIO is not set
33656 +# CONFIG_IRDA is not set
33657 +# CONFIG_BT is not set
33658 +# CONFIG_AF_RXRPC is not set
33659 +
33660 +#
33661 +# Wireless
33662 +#
33663 +# CONFIG_CFG80211 is not set
33664 +# CONFIG_WIRELESS_EXT is not set
33665 +# CONFIG_MAC80211 is not set
33666 +# CONFIG_IEEE80211 is not set
33667 +# CONFIG_RFKILL is not set
33668 +# CONFIG_NET_9P is not set
33669 +
33670 +#
33671 +# Device Drivers
33672 +#
33673 +
33674 +#
33675 +# Generic Driver Options
33676 +#
33677 +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
33678 +CONFIG_STANDALONE=y
33679 +CONFIG_PREVENT_FIRMWARE_BUILD=y
33680 +# CONFIG_FW_LOADER is not set
33681 +# CONFIG_SYS_HYPERVISOR is not set
33682 +# CONFIG_CONNECTOR is not set
33683 +CONFIG_MTD=y
33684 +# CONFIG_MTD_DEBUG is not set
33685 +# CONFIG_MTD_CONCAT is not set
33686 +CONFIG_MTD_PARTITIONS=y
33687 +# CONFIG_MTD_REDBOOT_PARTS is not set
33688 +# CONFIG_MTD_CMDLINE_PARTS is not set
33689 +
33690 +#
33691 +# User Modules And Translation Layers
33692 +#
33693 +CONFIG_MTD_CHAR=y
33694 +CONFIG_MTD_BLKDEVS=y
33695 +CONFIG_MTD_BLOCK=y
33696 +CONFIG_FTL=y
33697 +CONFIG_NFTL=y
33698 +CONFIG_NFTL_RW=y
33699 +# CONFIG_INFTL is not set
33700 +# CONFIG_RFD_FTL is not set
33701 +# CONFIG_SSFDC is not set
33702 +# CONFIG_MTD_OOPS is not set
33703 +
33704 +#
33705 +# RAM/ROM/Flash chip drivers
33706 +#
33707 +CONFIG_MTD_CFI=y
33708 +# CONFIG_MTD_JEDECPROBE is not set
33709 +CONFIG_MTD_GEN_PROBE=y
33710 +# CONFIG_MTD_CFI_ADV_OPTIONS is not set
33711 +CONFIG_MTD_MAP_BANK_WIDTH_1=y
33712 +CONFIG_MTD_MAP_BANK_WIDTH_2=y
33713 +CONFIG_MTD_MAP_BANK_WIDTH_4=y
33714 +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
33715 +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
33716 +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
33717 +CONFIG_MTD_CFI_I1=y
33718 +CONFIG_MTD_CFI_I2=y
33719 +# CONFIG_MTD_CFI_I4 is not set
33720 +# CONFIG_MTD_CFI_I8 is not set
33721 +# CONFIG_MTD_CFI_INTELEXT is not set
33722 +CONFIG_MTD_CFI_AMDSTD=y
33723 +# CONFIG_MTD_CFI_STAA is not set
33724 +CONFIG_MTD_CFI_UTIL=y
33725 +# CONFIG_MTD_RAM is not set
33726 +# CONFIG_MTD_ROM is not set
33727 +# CONFIG_MTD_ABSENT is not set
33728 +
33729 +#
33730 +# Mapping drivers for chip access
33731 +#
33732 +# CONFIG_MTD_COMPLEX_MAPPINGS is not set
33733 +CONFIG_MTD_PHYSMAP=y
33734 +CONFIG_MTD_PHYSMAP_START=0xFF800000
33735 +CONFIG_MTD_PHYSMAP_LEN=0x00800000
33736 +CONFIG_MTD_PHYSMAP_BANKWIDTH=1
33737 +# CONFIG_MTD_PHYSMAP_OF is not set
33738 +# CONFIG_MTD_INTEL_VR_NOR is not set
33739 +# CONFIG_MTD_PLATRAM is not set
33740 +
33741 +#
33742 +# Self-contained MTD device drivers
33743 +#
33744 +# CONFIG_MTD_PMC551 is not set
33745 +# CONFIG_MTD_SLRAM is not set
33746 +# CONFIG_MTD_PHRAM is not set
33747 +# CONFIG_MTD_MTDRAM is not set
33748 +# CONFIG_MTD_BLOCK2MTD is not set
33749 +
33750 +#
33751 +# Disk-On-Chip Device Drivers
33752 +#
33753 +# CONFIG_MTD_DOC2000 is not set
33754 +# CONFIG_MTD_DOC2001 is not set
33755 +# CONFIG_MTD_DOC2001PLUS is not set
33756 +# CONFIG_MTD_NAND is not set
33757 +# CONFIG_MTD_ONENAND is not set
33758 +
33759 +#
33760 +# UBI - Unsorted block images
33761 +#
33762 +# CONFIG_MTD_UBI is not set
33763 +CONFIG_OF_DEVICE=y
33764 +# CONFIG_PARPORT is not set
33765 +CONFIG_BLK_DEV=y
33766 +# CONFIG_BLK_DEV_FD is not set
33767 +# CONFIG_BLK_CPQ_DA is not set
33768 +# CONFIG_BLK_CPQ_CISS_DA is not set
33769 +# CONFIG_BLK_DEV_DAC960 is not set
33770 +# CONFIG_BLK_DEV_UMEM is not set
33771 +# CONFIG_BLK_DEV_COW_COMMON is not set
33772 +# CONFIG_BLK_DEV_LOOP is not set
33773 +# CONFIG_BLK_DEV_NBD is not set
33774 +# CONFIG_BLK_DEV_SX8 is not set
33775 +# CONFIG_BLK_DEV_UB is not set
33776 +# CONFIG_BLK_DEV_RAM is not set
33777 +# CONFIG_CDROM_PKTCDVD is not set
33778 +# CONFIG_ATA_OVER_ETH is not set
33779 +CONFIG_MISC_DEVICES=y
33780 +# CONFIG_PHANTOM is not set
33781 +# CONFIG_EEPROM_93CX6 is not set
33782 +# CONFIG_SGI_IOC4 is not set
33783 +# CONFIG_TIFM_CORE is not set
33784 +CONFIG_IDE=y
33785 +CONFIG_IDE_MAX_HWIFS=4
33786 +CONFIG_BLK_DEV_IDE=y
33787 +
33788 +#
33789 +# Please see Documentation/ide.txt for help/info on IDE drives
33790 +#
33791 +# CONFIG_BLK_DEV_IDE_SATA is not set
33792 +CONFIG_BLK_DEV_IDEDISK=y
33793 +CONFIG_IDEDISK_MULTI_MODE=y
33794 +# CONFIG_BLK_DEV_IDECD is not set
33795 +# CONFIG_BLK_DEV_IDETAPE is not set
33796 +# CONFIG_BLK_DEV_IDEFLOPPY is not set
33797 +# CONFIG_BLK_DEV_IDESCSI is not set
33798 +# CONFIG_IDE_TASK_IOCTL is not set
33799 +CONFIG_IDE_PROC_FS=y
33800 +
33801 +#
33802 +# IDE chipset support/bugfixes
33803 +#
33804 +CONFIG_IDE_GENERIC=y
33805 +# CONFIG_BLK_DEV_PLATFORM is not set
33806 +
33807 +#
33808 +# PCI IDE chipsets support
33809 +#
33810 +CONFIG_BLK_DEV_IDEPCI=y
33811 +# CONFIG_IDEPCI_SHARE_IRQ is not set
33812 +CONFIG_IDEPCI_PCIBUS_ORDER=y
33813 +# CONFIG_BLK_DEV_GENERIC is not set
33814 +# CONFIG_BLK_DEV_OPTI621 is not set
33815 +CONFIG_BLK_DEV_IDEDMA_PCI=y
33816 +# CONFIG_BLK_DEV_AEC62XX is not set
33817 +# CONFIG_BLK_DEV_ALI15X3 is not set
33818 +# CONFIG_BLK_DEV_AMD74XX is not set
33819 +# CONFIG_BLK_DEV_CMD64X is not set
33820 +# CONFIG_BLK_DEV_TRIFLEX is not set
33821 +# CONFIG_BLK_DEV_CY82C693 is not set
33822 +# CONFIG_BLK_DEV_CS5520 is not set
33823 +# CONFIG_BLK_DEV_CS5530 is not set
33824 +# CONFIG_BLK_DEV_HPT34X is not set
33825 +# CONFIG_BLK_DEV_HPT366 is not set
33826 +# CONFIG_BLK_DEV_JMICRON is not set
33827 +# CONFIG_BLK_DEV_SC1200 is not set
33828 +# CONFIG_BLK_DEV_PIIX is not set
33829 +# CONFIG_BLK_DEV_IT8213 is not set
33830 +# CONFIG_BLK_DEV_IT821X is not set
33831 +# CONFIG_BLK_DEV_NS87415 is not set
33832 +# CONFIG_BLK_DEV_PDC202XX_OLD is not set
33833 +# CONFIG_BLK_DEV_PDC202XX_NEW is not set
33834 +# CONFIG_BLK_DEV_SVWKS is not set
33835 +# CONFIG_BLK_DEV_SIIMAGE is not set
33836 +# CONFIG_BLK_DEV_SL82C105 is not set
33837 +# CONFIG_BLK_DEV_SLC90E66 is not set
33838 +# CONFIG_BLK_DEV_TRM290 is not set
33839 +CONFIG_BLK_DEV_VIA82CXXX=y
33840 +# CONFIG_BLK_DEV_TC86C001 is not set
33841 +# CONFIG_IDE_ARM is not set
33842 +CONFIG_BLK_DEV_IDEDMA=y
33843 +CONFIG_IDE_ARCH_OBSOLETE_INIT=y
33844 +# CONFIG_BLK_DEV_HD is not set
33845 +
33846 +#
33847 +# SCSI device support
33848 +#
33849 +# CONFIG_RAID_ATTRS is not set
33850 +CONFIG_SCSI=y
33851 +CONFIG_SCSI_DMA=y
33852 +# CONFIG_SCSI_TGT is not set
33853 +# CONFIG_SCSI_NETLINK is not set
33854 +CONFIG_SCSI_PROC_FS=y
33855 +
33856 +#
33857 +# SCSI support type (disk, tape, CD-ROM)
33858 +#
33859 +CONFIG_BLK_DEV_SD=y
33860 +# CONFIG_CHR_DEV_ST is not set
33861 +# CONFIG_CHR_DEV_OSST is not set
33862 +CONFIG_BLK_DEV_SR=y
33863 +# CONFIG_BLK_DEV_SR_VENDOR is not set
33864 +# CONFIG_CHR_DEV_SG is not set
33865 +# CONFIG_CHR_DEV_SCH is not set
33866 +
33867 +#
33868 +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
33869 +#
33870 +# CONFIG_SCSI_MULTI_LUN is not set
33871 +# CONFIG_SCSI_CONSTANTS is not set
33872 +# CONFIG_SCSI_LOGGING is not set
33873 +# CONFIG_SCSI_SCAN_ASYNC is not set
33874 +CONFIG_SCSI_WAIT_SCAN=m
33875 +
33876 +#
33877 +# SCSI Transports
33878 +#
33879 +CONFIG_SCSI_SPI_ATTRS=y
33880 +# CONFIG_SCSI_FC_ATTRS is not set
33881 +# CONFIG_SCSI_ISCSI_ATTRS is not set
33882 +# CONFIG_SCSI_SAS_LIBSAS is not set
33883 +# CONFIG_SCSI_SRP_ATTRS is not set
33884 +CONFIG_SCSI_LOWLEVEL=y
33885 +# CONFIG_ISCSI_TCP is not set
33886 +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
33887 +# CONFIG_SCSI_3W_9XXX is not set
33888 +# CONFIG_SCSI_ACARD is not set
33889 +# CONFIG_SCSI_AACRAID is not set
33890 +# CONFIG_SCSI_AIC7XXX is not set
33891 +# CONFIG_SCSI_AIC7XXX_OLD is not set
33892 +# CONFIG_SCSI_AIC79XX is not set
33893 +# CONFIG_SCSI_AIC94XX is not set
33894 +# CONFIG_SCSI_DPT_I2O is not set
33895 +# CONFIG_SCSI_ADVANSYS is not set
33896 +# CONFIG_SCSI_ARCMSR is not set
33897 +# CONFIG_MEGARAID_NEWGEN is not set
33898 +# CONFIG_MEGARAID_LEGACY is not set
33899 +# CONFIG_MEGARAID_SAS is not set
33900 +# CONFIG_SCSI_HPTIOP is not set
33901 +# CONFIG_SCSI_BUSLOGIC is not set
33902 +# CONFIG_SCSI_DMX3191D is not set
33903 +# CONFIG_SCSI_EATA is not set
33904 +# CONFIG_SCSI_FUTURE_DOMAIN is not set
33905 +# CONFIG_SCSI_GDTH is not set
33906 +# CONFIG_SCSI_IPS is not set
33907 +# CONFIG_SCSI_INITIO is not set
33908 +# CONFIG_SCSI_INIA100 is not set
33909 +# CONFIG_SCSI_STEX is not set
33910 +# CONFIG_SCSI_SYM53C8XX_2 is not set
33911 +# CONFIG_SCSI_QLOGIC_1280 is not set
33912 +# CONFIG_SCSI_QLA_FC is not set
33913 +# CONFIG_SCSI_QLA_ISCSI is not set
33914 +# CONFIG_SCSI_LPFC is not set
33915 +# CONFIG_SCSI_DC395x is not set
33916 +# CONFIG_SCSI_DC390T is not set
33917 +# CONFIG_SCSI_NSP32 is not set
33918 +# CONFIG_SCSI_DEBUG is not set
33919 +# CONFIG_SCSI_SRP is not set
33920 +# CONFIG_ATA is not set
33921 +CONFIG_MD=y
33922 +CONFIG_BLK_DEV_MD=y
33923 +CONFIG_MD_LINEAR=y
33924 +CONFIG_MD_RAID0=y
33925 +CONFIG_MD_RAID1=y
33926 +# CONFIG_MD_RAID10 is not set
33927 +CONFIG_MD_RAID456=y
33928 +CONFIG_MD_RAID5_RESHAPE=y
33929 +# CONFIG_MD_MULTIPATH is not set
33930 +# CONFIG_MD_FAULTY is not set
33931 +# CONFIG_BLK_DEV_DM is not set
33932 +# CONFIG_FUSION is not set
33933 +
33934 +#
33935 +# IEEE 1394 (FireWire) support
33936 +#
33937 +# CONFIG_FIREWIRE is not set
33938 +# CONFIG_IEEE1394 is not set
33939 +# CONFIG_I2O is not set
33940 +# CONFIG_MACINTOSH_DRIVERS is not set
33941 +CONFIG_NETDEVICES=y
33942 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
33943 +CONFIG_DUMMY=m
33944 +# CONFIG_BONDING is not set
33945 +# CONFIG_MACVLAN is not set
33946 +# CONFIG_EQUALIZER is not set
33947 +# CONFIG_TUN is not set
33948 +# CONFIG_VETH is not set
33949 +# CONFIG_IP1000 is not set
33950 +# CONFIG_ARCNET is not set
33951 +# CONFIG_NET_ETHERNET is not set
33952 +CONFIG_NETDEV_1000=y
33953 +# CONFIG_ACENIC is not set
33954 +# CONFIG_DL2K is not set
33955 +# CONFIG_E1000 is not set
33956 +# CONFIG_E1000E is not set
33957 +# CONFIG_NS83820 is not set
33958 +# CONFIG_HAMACHI is not set
33959 +# CONFIG_YELLOWFIN is not set
33960 +CONFIG_R8169=y
33961 +# CONFIG_R8169_NAPI is not set
33962 +# CONFIG_SIS190 is not set
33963 +# CONFIG_SKGE is not set
33964 +# CONFIG_SKY2 is not set
33965 +# CONFIG_SK98LIN is not set
33966 +# CONFIG_VIA_VELOCITY is not set
33967 +# CONFIG_TIGON3 is not set
33968 +# CONFIG_BNX2 is not set
33969 +# CONFIG_MV643XX_ETH is not set
33970 +# CONFIG_QLA3XXX is not set
33971 +# CONFIG_ATL1 is not set
33972 +# CONFIG_NETDEV_10000 is not set
33973 +# CONFIG_TR is not set
33974 +
33975 +#
33976 +# Wireless LAN
33977 +#
33978 +# CONFIG_WLAN_PRE80211 is not set
33979 +# CONFIG_WLAN_80211 is not set
33980 +
33981 +#
33982 +# USB Network Adapters
33983 +#
33984 +# CONFIG_USB_CATC is not set
33985 +# CONFIG_USB_KAWETH is not set
33986 +# CONFIG_USB_PEGASUS is not set
33987 +# CONFIG_USB_RTL8150 is not set
33988 +# CONFIG_USB_USBNET is not set
33989 +# CONFIG_WAN is not set
33990 +# CONFIG_FDDI is not set
33991 +# CONFIG_HIPPI is not set
33992 +# CONFIG_PPP is not set
33993 +# CONFIG_SLIP is not set
33994 +# CONFIG_NET_FC is not set
33995 +# CONFIG_SHAPER is not set
33996 +# CONFIG_NETCONSOLE is not set
33997 +# CONFIG_NETPOLL is not set
33998 +# CONFIG_NET_POLL_CONTROLLER is not set
33999 +# CONFIG_ISDN is not set
34000 +# CONFIG_PHONE is not set
34001 +
34002 +#
34003 +# Input device support
34004 +#
34005 +# CONFIG_INPUT is not set
34006 +
34007 +#
34008 +# Hardware I/O ports
34009 +#
34010 +# CONFIG_SERIO is not set
34011 +# CONFIG_GAMEPORT is not set
34012 +
34013 +#
34014 +# Character devices
34015 +#
34016 +# CONFIG_VT is not set
34017 +# CONFIG_SERIAL_NONSTANDARD is not set
34018 +
34019 +#
34020 +# Serial drivers
34021 +#
34022 +CONFIG_SERIAL_8250=y
34023 +CONFIG_SERIAL_8250_CONSOLE=y
34024 +# CONFIG_SERIAL_8250_PCI is not set
34025 +CONFIG_SERIAL_8250_NR_UARTS=2
34026 +CONFIG_SERIAL_8250_RUNTIME_UARTS=2
34027 +# CONFIG_SERIAL_8250_EXTENDED is not set
34028 +
34029 +#
34030 +# Non-8250 serial port support
34031 +#
34032 +# CONFIG_SERIAL_UARTLITE is not set
34033 +CONFIG_SERIAL_CORE=y
34034 +CONFIG_SERIAL_CORE_CONSOLE=y
34035 +# CONFIG_SERIAL_JSM is not set
34036 +# CONFIG_SERIAL_OF_PLATFORM is not set
34037 +CONFIG_UNIX98_PTYS=y
34038 +CONFIG_LEGACY_PTYS=y
34039 +CONFIG_LEGACY_PTY_COUNT=256
34040 +# CONFIG_IPMI_HANDLER is not set
34041 +CONFIG_HW_RANDOM=m
34042 +CONFIG_NVRAM=y
34043 +CONFIG_GEN_RTC=y
34044 +# CONFIG_GEN_RTC_X is not set
34045 +# CONFIG_R3964 is not set
34046 +# CONFIG_APPLICOM is not set
34047 +# CONFIG_RAW_DRIVER is not set
34048 +# CONFIG_TCG_TPM is not set
34049 +CONFIG_DEVPORT=y
34050 +CONFIG_I2C=y
34051 +CONFIG_I2C_BOARDINFO=y
34052 +CONFIG_I2C_CHARDEV=y
34053 +
34054 +#
34055 +# I2C Algorithms
34056 +#
34057 +# CONFIG_I2C_ALGOBIT is not set
34058 +# CONFIG_I2C_ALGOPCF is not set
34059 +# CONFIG_I2C_ALGOPCA is not set
34060 +
34061 +#
34062 +# I2C Hardware Bus support
34063 +#
34064 +# CONFIG_I2C_ALI1535 is not set
34065 +# CONFIG_I2C_ALI1563 is not set
34066 +# CONFIG_I2C_ALI15X3 is not set
34067 +# CONFIG_I2C_AMD756 is not set
34068 +# CONFIG_I2C_AMD8111 is not set
34069 +# CONFIG_I2C_I801 is not set
34070 +# CONFIG_I2C_I810 is not set
34071 +# CONFIG_I2C_PIIX4 is not set
34072 +CONFIG_I2C_MPC=y
34073 +# CONFIG_I2C_NFORCE2 is not set
34074 +# CONFIG_I2C_OCORES is not set
34075 +# CONFIG_I2C_PARPORT_LIGHT is not set
34076 +# CONFIG_I2C_PROSAVAGE is not set
34077 +# CONFIG_I2C_SAVAGE4 is not set
34078 +# CONFIG_I2C_SIMTEC is not set
34079 +# CONFIG_I2C_SIS5595 is not set
34080 +# CONFIG_I2C_SIS630 is not set
34081 +# CONFIG_I2C_SIS96X is not set
34082 +# CONFIG_I2C_TAOS_EVM is not set
34083 +# CONFIG_I2C_STUB is not set
34084 +# CONFIG_I2C_TINY_USB is not set
34085 +# CONFIG_I2C_VIA is not set
34086 +# CONFIG_I2C_VIAPRO is not set
34087 +# CONFIG_I2C_VOODOO3 is not set
34088 +
34089 +#
34090 +# Miscellaneous I2C Chip support
34091 +#
34092 +# CONFIG_SENSORS_DS1337 is not set
34093 +# CONFIG_SENSORS_DS1374 is not set
34094 +# CONFIG_DS1682 is not set
34095 +# CONFIG_SENSORS_EEPROM is not set
34096 +# CONFIG_SENSORS_PCF8574 is not set
34097 +# CONFIG_SENSORS_PCA9539 is not set
34098 +# CONFIG_SENSORS_PCF8591 is not set
34099 +# CONFIG_SENSORS_M41T00 is not set
34100 +# CONFIG_SENSORS_MAX6875 is not set
34101 +# CONFIG_SENSORS_TSL2550 is not set
34102 +# CONFIG_I2C_DEBUG_CORE is not set
34103 +# CONFIG_I2C_DEBUG_ALGO is not set
34104 +# CONFIG_I2C_DEBUG_BUS is not set
34105 +# CONFIG_I2C_DEBUG_CHIP is not set
34106 +
34107 +#
34108 +# SPI support
34109 +#
34110 +# CONFIG_SPI is not set
34111 +# CONFIG_SPI_MASTER is not set
34112 +# CONFIG_W1 is not set
34113 +# CONFIG_POWER_SUPPLY is not set
34114 +# CONFIG_HWMON is not set
34115 +# CONFIG_WATCHDOG is not set
34116 +
34117 +#
34118 +# Sonics Silicon Backplane
34119 +#
34120 +CONFIG_SSB_POSSIBLE=y
34121 +# CONFIG_SSB is not set
34122 +
34123 +#
34124 +# Multifunction device drivers
34125 +#
34126 +# CONFIG_MFD_SM501 is not set
34127 +
34128 +#
34129 +# Multimedia devices
34130 +#
34131 +# CONFIG_VIDEO_DEV is not set
34132 +# CONFIG_DVB_CORE is not set
34133 +# CONFIG_DAB is not set
34134 +
34135 +#
34136 +# Graphics support
34137 +#
34138 +# CONFIG_AGP is not set
34139 +# CONFIG_DRM is not set
34140 +# CONFIG_VGASTATE is not set
34141 +# CONFIG_VIDEO_OUTPUT_CONTROL is not set
34142 +# CONFIG_FB is not set
34143 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
34144 +
34145 +#
34146 +# Display device support
34147 +#
34148 +# CONFIG_DISPLAY_SUPPORT is not set
34149 +
34150 +#
34151 +# Sound
34152 +#
34153 +# CONFIG_SOUND is not set
34154 +CONFIG_USB_SUPPORT=y
34155 +CONFIG_USB_ARCH_HAS_HCD=y
34156 +CONFIG_USB_ARCH_HAS_OHCI=y
34157 +CONFIG_USB_ARCH_HAS_EHCI=y
34158 +CONFIG_USB=y
34159 +# CONFIG_USB_DEBUG is not set
34160 +
34161 +#
34162 +# Miscellaneous USB options
34163 +#
34164 +CONFIG_USB_DEVICEFS=y
34165 +CONFIG_USB_DEVICE_CLASS=y
34166 +# CONFIG_USB_DYNAMIC_MINORS is not set
34167 +# CONFIG_USB_OTG is not set
34168 +
34169 +#
34170 +# USB Host Controller Drivers
34171 +#
34172 +CONFIG_USB_EHCI_HCD=y
34173 +# CONFIG_USB_EHCI_SPLIT_ISO is not set
34174 +# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
34175 +# CONFIG_USB_EHCI_TT_NEWSCHED is not set
34176 +# CONFIG_USB_ISP116X_HCD is not set
34177 +CONFIG_USB_OHCI_HCD=y
34178 +# CONFIG_USB_OHCI_HCD_PPC_OF is not set
34179 +# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
34180 +# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
34181 +CONFIG_USB_OHCI_LITTLE_ENDIAN=y
34182 +# CONFIG_USB_UHCI_HCD is not set
34183 +# CONFIG_USB_SL811_HCD is not set
34184 +# CONFIG_USB_R8A66597_HCD is not set
34185 +
34186 +#
34187 +# USB Device Class drivers
34188 +#
34189 +# CONFIG_USB_ACM is not set
34190 +# CONFIG_USB_PRINTER is not set
34191 +
34192 +#
34193 +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
34194 +#
34195 +
34196 +#
34197 +# may also be needed; see USB_STORAGE Help for more information
34198 +#
34199 +CONFIG_USB_STORAGE=y
34200 +# CONFIG_USB_STORAGE_DEBUG is not set
34201 +# CONFIG_USB_STORAGE_DATAFAB is not set
34202 +# CONFIG_USB_STORAGE_FREECOM is not set
34203 +# CONFIG_USB_STORAGE_ISD200 is not set
34204 +# CONFIG_USB_STORAGE_DPCM is not set
34205 +# CONFIG_USB_STORAGE_USBAT is not set
34206 +# CONFIG_USB_STORAGE_SDDR09 is not set
34207 +# CONFIG_USB_STORAGE_SDDR55 is not set
34208 +# CONFIG_USB_STORAGE_JUMPSHOT is not set
34209 +# CONFIG_USB_STORAGE_ALAUDA is not set
34210 +# CONFIG_USB_STORAGE_KARMA is not set
34211 +# CONFIG_USB_LIBUSUAL is not set
34212 +
34213 +#
34214 +# USB Imaging devices
34215 +#
34216 +# CONFIG_USB_MDC800 is not set
34217 +# CONFIG_USB_MICROTEK is not set
34218 +# CONFIG_USB_MON is not set
34219 +
34220 +#
34221 +# USB port drivers
34222 +#
34223 +
34224 +#
34225 +# USB Serial Converter support
34226 +#
34227 +# CONFIG_USB_SERIAL is not set
34228 +
34229 +#
34230 +# USB Miscellaneous drivers
34231 +#
34232 +# CONFIG_USB_EMI62 is not set
34233 +# CONFIG_USB_EMI26 is not set
34234 +# CONFIG_USB_ADUTUX is not set
34235 +# CONFIG_USB_AUERSWALD is not set
34236 +# CONFIG_USB_RIO500 is not set
34237 +# CONFIG_USB_LEGOTOWER is not set
34238 +# CONFIG_USB_LCD is not set
34239 +# CONFIG_USB_BERRY_CHARGE is not set
34240 +# CONFIG_USB_LED is not set
34241 +# CONFIG_USB_CYPRESS_CY7C63 is not set
34242 +# CONFIG_USB_CYTHERM is not set
34243 +# CONFIG_USB_PHIDGET is not set
34244 +# CONFIG_USB_IDMOUSE is not set
34245 +# CONFIG_USB_FTDI_ELAN is not set
34246 +# CONFIG_USB_APPLEDISPLAY is not set
34247 +# CONFIG_USB_SISUSBVGA is not set
34248 +# CONFIG_USB_LD is not set
34249 +# CONFIG_USB_TRANCEVIBRATOR is not set
34250 +# CONFIG_USB_IOWARRIOR is not set
34251 +# CONFIG_USB_TEST is not set
34252 +
34253 +#
34254 +# USB DSL modem support
34255 +#
34256 +
34257 +#
34258 +# USB Gadget Support
34259 +#
34260 +# CONFIG_USB_GADGET is not set
34261 +# CONFIG_MMC is not set
34262 +# CONFIG_NEW_LEDS is not set
34263 +# CONFIG_INFINIBAND is not set
34264 +# CONFIG_EDAC is not set
34265 +CONFIG_RTC_LIB=y
34266 +CONFIG_RTC_CLASS=y
34267 +CONFIG_RTC_HCTOSYS=y
34268 +CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
34269 +# CONFIG_RTC_DEBUG is not set
34270 +
34271 +#
34272 +# RTC interfaces
34273 +#
34274 +CONFIG_RTC_INTF_SYSFS=y
34275 +CONFIG_RTC_INTF_PROC=y
34276 +CONFIG_RTC_INTF_DEV=y
34277 +# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
34278 +# CONFIG_RTC_DRV_TEST is not set
34279 +
34280 +#
34281 +# I2C RTC drivers
34282 +#
34283 +CONFIG_RTC_DRV_DS1307=y
34284 +# CONFIG_RTC_DRV_DS1374 is not set
34285 +# CONFIG_RTC_DRV_DS1672 is not set
34286 +# CONFIG_RTC_DRV_MAX6900 is not set
34287 +# CONFIG_RTC_DRV_RS5C372 is not set
34288 +# CONFIG_RTC_DRV_ISL1208 is not set
34289 +# CONFIG_RTC_DRV_X1205 is not set
34290 +# CONFIG_RTC_DRV_PCF8563 is not set
34291 +# CONFIG_RTC_DRV_PCF8583 is not set
34292 +# CONFIG_RTC_DRV_M41T80 is not set
34293 +
34294 +#
34295 +# SPI RTC drivers
34296 +#
34297 +
34298 +#
34299 +# Platform RTC drivers
34300 +#
34301 +# CONFIG_RTC_DRV_CMOS is not set
34302 +# CONFIG_RTC_DRV_DS1553 is not set
34303 +# CONFIG_RTC_DRV_STK17TA8 is not set
34304 +# CONFIG_RTC_DRV_DS1742 is not set
34305 +# CONFIG_RTC_DRV_M48T86 is not set
34306 +# CONFIG_RTC_DRV_M48T59 is not set
34307 +# CONFIG_RTC_DRV_V3020 is not set
34308 +
34309 +#
34310 +# on-CPU RTC drivers
34311 +#
34312 +
34313 +#
34314 +# Userspace I/O
34315 +#
34316 +# CONFIG_UIO is not set
34317 +
34318 +#
34319 +# File systems
34320 +#
34321 +CONFIG_EXT2_FS=y
34322 +# CONFIG_EXT2_FS_XATTR is not set
34323 +# CONFIG_EXT2_FS_XIP is not set
34324 +CONFIG_EXT3_FS=y
34325 +CONFIG_EXT3_FS_XATTR=y
34326 +# CONFIG_EXT3_FS_POSIX_ACL is not set
34327 +# CONFIG_EXT3_FS_SECURITY is not set
34328 +# CONFIG_EXT4DEV_FS is not set
34329 +CONFIG_JBD=y
34330 +CONFIG_FS_MBCACHE=y
34331 +# CONFIG_REISERFS_FS is not set
34332 +# CONFIG_JFS_FS is not set
34333 +# CONFIG_FS_POSIX_ACL is not set
34334 +CONFIG_XFS_FS=m
34335 +# CONFIG_XFS_QUOTA is not set
34336 +# CONFIG_XFS_SECURITY is not set
34337 +# CONFIG_XFS_POSIX_ACL is not set
34338 +# CONFIG_XFS_RT is not set
34339 +# CONFIG_GFS2_FS is not set
34340 +# CONFIG_OCFS2_FS is not set
34341 +# CONFIG_MINIX_FS is not set
34342 +# CONFIG_ROMFS_FS is not set
34343 +CONFIG_INOTIFY=y
34344 +CONFIG_INOTIFY_USER=y
34345 +# CONFIG_QUOTA is not set
34346 +CONFIG_DNOTIFY=y
34347 +# CONFIG_AUTOFS_FS is not set
34348 +# CONFIG_AUTOFS4_FS is not set
34349 +# CONFIG_FUSE_FS is not set
34350 +
34351 +#
34352 +# CD-ROM/DVD Filesystems
34353 +#
34354 +# CONFIG_ISO9660_FS is not set
34355 +# CONFIG_UDF_FS is not set
34356 +
34357 +#
34358 +# DOS/FAT/NT Filesystems
34359 +#
34360 +# CONFIG_MSDOS_FS is not set
34361 +# CONFIG_VFAT_FS is not set
34362 +# CONFIG_NTFS_FS is not set
34363 +
34364 +#
34365 +# Pseudo filesystems
34366 +#
34367 +CONFIG_PROC_FS=y
34368 +CONFIG_PROC_KCORE=y
34369 +CONFIG_PROC_SYSCTL=y
34370 +CONFIG_SYSFS=y
34371 +CONFIG_TMPFS=y
34372 +# CONFIG_TMPFS_POSIX_ACL is not set
34373 +# CONFIG_HUGETLB_PAGE is not set
34374 +# CONFIG_CONFIGFS_FS is not set
34375 +
34376 +#
34377 +# Miscellaneous filesystems
34378 +#
34379 +# CONFIG_ADFS_FS is not set
34380 +# CONFIG_AFFS_FS is not set
34381 +# CONFIG_HFS_FS is not set
34382 +# CONFIG_HFSPLUS_FS is not set
34383 +# CONFIG_BEFS_FS is not set
34384 +# CONFIG_BFS_FS is not set
34385 +# CONFIG_EFS_FS is not set
34386 +CONFIG_JFFS2_FS=y
34387 +CONFIG_JFFS2_FS_DEBUG=0
34388 +CONFIG_JFFS2_FS_WRITEBUFFER=y
34389 +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
34390 +# CONFIG_JFFS2_SUMMARY is not set
34391 +# CONFIG_JFFS2_FS_XATTR is not set
34392 +# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
34393 +CONFIG_JFFS2_ZLIB=y
34394 +# CONFIG_JFFS2_LZO is not set
34395 +CONFIG_JFFS2_RTIME=y
34396 +# CONFIG_JFFS2_RUBIN is not set
34397 +# CONFIG_CRAMFS is not set
34398 +# CONFIG_VXFS_FS is not set
34399 +# CONFIG_HPFS_FS is not set
34400 +# CONFIG_QNX4FS_FS is not set
34401 +# CONFIG_SYSV_FS is not set
34402 +# CONFIG_UFS_FS is not set
34403 +# CONFIG_NETWORK_FILESYSTEMS is not set
34404 +
34405 +#
34406 +# Partition Types
34407 +#
34408 +CONFIG_PARTITION_ADVANCED=y
34409 +# CONFIG_ACORN_PARTITION is not set
34410 +# CONFIG_OSF_PARTITION is not set
34411 +# CONFIG_AMIGA_PARTITION is not set
34412 +# CONFIG_ATARI_PARTITION is not set
34413 +# CONFIG_MAC_PARTITION is not set
34414 +CONFIG_MSDOS_PARTITION=y
34415 +# CONFIG_BSD_DISKLABEL is not set
34416 +# CONFIG_MINIX_SUBPARTITION is not set
34417 +# CONFIG_SOLARIS_X86_PARTITION is not set
34418 +# CONFIG_UNIXWARE_DISKLABEL is not set
34419 +# CONFIG_LDM_PARTITION is not set
34420 +# CONFIG_SGI_PARTITION is not set
34421 +# CONFIG_ULTRIX_PARTITION is not set
34422 +# CONFIG_SUN_PARTITION is not set
34423 +# CONFIG_KARMA_PARTITION is not set
34424 +# CONFIG_EFI_PARTITION is not set
34425 +# CONFIG_SYSV68_PARTITION is not set
34426 +CONFIG_NLS=y
34427 +CONFIG_NLS_DEFAULT="utf8"
34428 +CONFIG_NLS_CODEPAGE_437=y
34429 +# CONFIG_NLS_CODEPAGE_737 is not set
34430 +# CONFIG_NLS_CODEPAGE_775 is not set
34431 +# CONFIG_NLS_CODEPAGE_850 is not set
34432 +# CONFIG_NLS_CODEPAGE_852 is not set
34433 +# CONFIG_NLS_CODEPAGE_855 is not set
34434 +# CONFIG_NLS_CODEPAGE_857 is not set
34435 +# CONFIG_NLS_CODEPAGE_860 is not set
34436 +# CONFIG_NLS_CODEPAGE_861 is not set
34437 +# CONFIG_NLS_CODEPAGE_862 is not set
34438 +# CONFIG_NLS_CODEPAGE_863 is not set
34439 +# CONFIG_NLS_CODEPAGE_864 is not set
34440 +# CONFIG_NLS_CODEPAGE_865 is not set
34441 +# CONFIG_NLS_CODEPAGE_866 is not set
34442 +# CONFIG_NLS_CODEPAGE_869 is not set
34443 +# CONFIG_NLS_CODEPAGE_936 is not set
34444 +# CONFIG_NLS_CODEPAGE_950 is not set
34445 +# CONFIG_NLS_CODEPAGE_932 is not set
34446 +# CONFIG_NLS_CODEPAGE_949 is not set
34447 +# CONFIG_NLS_CODEPAGE_874 is not set
34448 +# CONFIG_NLS_ISO8859_8 is not set
34449 +# CONFIG_NLS_CODEPAGE_1250 is not set
34450 +# CONFIG_NLS_CODEPAGE_1251 is not set
34451 +# CONFIG_NLS_ASCII is not set
34452 +CONFIG_NLS_ISO8859_1=y
34453 +# CONFIG_NLS_ISO8859_2 is not set
34454 +# CONFIG_NLS_ISO8859_3 is not set
34455 +# CONFIG_NLS_ISO8859_4 is not set
34456 +# CONFIG_NLS_ISO8859_5 is not set
34457 +# CONFIG_NLS_ISO8859_6 is not set
34458 +# CONFIG_NLS_ISO8859_7 is not set
34459 +# CONFIG_NLS_ISO8859_9 is not set
34460 +# CONFIG_NLS_ISO8859_13 is not set
34461 +# CONFIG_NLS_ISO8859_14 is not set
34462 +# CONFIG_NLS_ISO8859_15 is not set
34463 +# CONFIG_NLS_KOI8_R is not set
34464 +# CONFIG_NLS_KOI8_U is not set
34465 +CONFIG_NLS_UTF8=y
34466 +# CONFIG_DLM is not set
34467 +# CONFIG_UCC_SLOW is not set
34468 +
34469 +#
34470 +# Library routines
34471 +#
34472 +CONFIG_BITREVERSE=y
34473 +# CONFIG_CRC_CCITT is not set
34474 +# CONFIG_CRC16 is not set
34475 +# CONFIG_CRC_ITU_T is not set
34476 +CONFIG_CRC32=y
34477 +# CONFIG_CRC7 is not set
34478 +# CONFIG_LIBCRC32C is not set
34479 +CONFIG_ZLIB_INFLATE=y
34480 +CONFIG_ZLIB_DEFLATE=y
34481 +CONFIG_PLIST=y
34482 +CONFIG_HAS_IOMEM=y
34483 +CONFIG_HAS_IOPORT=y
34484 +CONFIG_HAS_DMA=y
34485 +CONFIG_INSTRUMENTATION=y
34486 +# CONFIG_PROFILING is not set
34487 +# CONFIG_MARKERS is not set
34488 +
34489 +#
34490 +# Kernel hacking
34491 +#
34492 +# CONFIG_PRINTK_TIME is not set
34493 +# CONFIG_ENABLE_WARN_DEPRECATED is not set
34494 +# CONFIG_ENABLE_MUST_CHECK is not set
34495 +# CONFIG_MAGIC_SYSRQ is not set
34496 +# CONFIG_UNUSED_SYMBOLS is not set
34497 +# CONFIG_DEBUG_FS is not set
34498 +# CONFIG_HEADERS_CHECK is not set
34499 +# CONFIG_DEBUG_KERNEL is not set
34500 +# CONFIG_SLUB_DEBUG_ON is not set
34501 +# CONFIG_DEBUG_BUGVERBOSE is not set
34502 +# CONFIG_SAMPLES is not set
34503 +# CONFIG_BOOTX_TEXT is not set
34504 +# CONFIG_PPC_EARLY_DEBUG is not set
34505 +
34506 +#
34507 +# Security options
34508 +#
34509 +# CONFIG_KEYS is not set
34510 +# CONFIG_SECURITY is not set
34511 +# CONFIG_SECURITY_FILE_CAPABILITIES is not set
34512 +CONFIG_XOR_BLOCKS=y
34513 +CONFIG_ASYNC_CORE=y
34514 +CONFIG_ASYNC_MEMCPY=y
34515 +CONFIG_ASYNC_XOR=y
34516 +# CONFIG_CRYPTO is not set
34517 +# CONFIG_PPC_CLOCK is not set
34518 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/configs/taishan_defconfig powerpc.git/arch/powerpc/configs/taishan_defconfig
34519 --- linux-2.6.24/arch/powerpc/configs/taishan_defconfig 1970-01-01 01:00:00.000000000 +0100
34520 +++ powerpc.git/arch/powerpc/configs/taishan_defconfig  2008-01-28 20:25:49.000000000 +0100
34521 @@ -0,0 +1,790 @@
34522 +#
34523 +# Automatically generated make config: don't edit
34524 +# Linux kernel version: 2.6.24-rc6
34525 +# Mon Dec 24 11:23:39 2007
34526 +#
34527 +# CONFIG_PPC64 is not set
34528 +
34529 +#
34530 +# Processor support
34531 +#
34532 +# CONFIG_6xx is not set
34533 +# CONFIG_PPC_85xx is not set
34534 +# CONFIG_PPC_8xx is not set
34535 +# CONFIG_40x is not set
34536 +CONFIG_44x=y
34537 +# CONFIG_E200 is not set
34538 +CONFIG_4xx=y
34539 +CONFIG_BOOKE=y
34540 +CONFIG_PTE_64BIT=y
34541 +CONFIG_PHYS_64BIT=y
34542 +# CONFIG_PPC_MM_SLICES is not set
34543 +CONFIG_NOT_COHERENT_CACHE=y
34544 +CONFIG_PPC32=y
34545 +CONFIG_WORD_SIZE=32
34546 +CONFIG_PPC_MERGE=y
34547 +CONFIG_MMU=y
34548 +CONFIG_GENERIC_CMOS_UPDATE=y
34549 +CONFIG_GENERIC_TIME=y
34550 +CONFIG_GENERIC_TIME_VSYSCALL=y
34551 +CONFIG_GENERIC_CLOCKEVENTS=y
34552 +CONFIG_GENERIC_HARDIRQS=y
34553 +CONFIG_IRQ_PER_CPU=y
34554 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
34555 +CONFIG_ARCH_HAS_ILOG2_U32=y
34556 +CONFIG_GENERIC_HWEIGHT=y
34557 +CONFIG_GENERIC_CALIBRATE_DELAY=y
34558 +CONFIG_GENERIC_FIND_NEXT_BIT=y
34559 +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
34560 +CONFIG_PPC=y
34561 +CONFIG_EARLY_PRINTK=y
34562 +CONFIG_GENERIC_NVRAM=y
34563 +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
34564 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
34565 +CONFIG_PPC_OF=y
34566 +CONFIG_OF=y
34567 +CONFIG_PPC_UDBG_16550=y
34568 +# CONFIG_GENERIC_TBSYNC is not set
34569 +CONFIG_AUDIT_ARCH=y
34570 +CONFIG_GENERIC_BUG=y
34571 +# CONFIG_DEFAULT_UIMAGE is not set
34572 +CONFIG_PPC_DCR_NATIVE=y
34573 +# CONFIG_PPC_DCR_MMIO is not set
34574 +CONFIG_PPC_DCR=y
34575 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
34576 +
34577 +#
34578 +# General setup
34579 +#
34580 +CONFIG_EXPERIMENTAL=y
34581 +CONFIG_BROKEN_ON_SMP=y
34582 +CONFIG_INIT_ENV_ARG_LIMIT=32
34583 +CONFIG_LOCALVERSION=""
34584 +CONFIG_LOCALVERSION_AUTO=y
34585 +CONFIG_SWAP=y
34586 +CONFIG_SYSVIPC=y
34587 +CONFIG_SYSVIPC_SYSCTL=y
34588 +CONFIG_POSIX_MQUEUE=y
34589 +# CONFIG_BSD_PROCESS_ACCT is not set
34590 +# CONFIG_TASKSTATS is not set
34591 +# CONFIG_USER_NS is not set
34592 +# CONFIG_PID_NS is not set
34593 +# CONFIG_AUDIT is not set
34594 +# CONFIG_IKCONFIG is not set
34595 +CONFIG_LOG_BUF_SHIFT=14
34596 +# CONFIG_CGROUPS is not set
34597 +CONFIG_FAIR_GROUP_SCHED=y
34598 +CONFIG_FAIR_USER_SCHED=y
34599 +# CONFIG_FAIR_CGROUP_SCHED is not set
34600 +CONFIG_SYSFS_DEPRECATED=y
34601 +# CONFIG_RELAY is not set
34602 +CONFIG_BLK_DEV_INITRD=y
34603 +CONFIG_INITRAMFS_SOURCE=""
34604 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
34605 +CONFIG_SYSCTL=y
34606 +CONFIG_EMBEDDED=y
34607 +CONFIG_SYSCTL_SYSCALL=y
34608 +CONFIG_KALLSYMS=y
34609 +# CONFIG_KALLSYMS_ALL is not set
34610 +# CONFIG_KALLSYMS_EXTRA_PASS is not set
34611 +CONFIG_HOTPLUG=y
34612 +CONFIG_PRINTK=y
34613 +CONFIG_BUG=y
34614 +CONFIG_ELF_CORE=y
34615 +CONFIG_BASE_FULL=y
34616 +CONFIG_FUTEX=y
34617 +CONFIG_ANON_INODES=y
34618 +CONFIG_EPOLL=y
34619 +CONFIG_SIGNALFD=y
34620 +CONFIG_EVENTFD=y
34621 +CONFIG_SHMEM=y
34622 +CONFIG_VM_EVENT_COUNTERS=y
34623 +CONFIG_SLUB_DEBUG=y
34624 +# CONFIG_SLAB is not set
34625 +CONFIG_SLUB=y
34626 +# CONFIG_SLOB is not set
34627 +CONFIG_RT_MUTEXES=y
34628 +# CONFIG_TINY_SHMEM is not set
34629 +CONFIG_BASE_SMALL=0
34630 +CONFIG_MODULES=y
34631 +CONFIG_MODULE_UNLOAD=y
34632 +# CONFIG_MODULE_FORCE_UNLOAD is not set
34633 +# CONFIG_MODVERSIONS is not set
34634 +# CONFIG_MODULE_SRCVERSION_ALL is not set
34635 +CONFIG_KMOD=y
34636 +CONFIG_BLOCK=y
34637 +CONFIG_LBD=y
34638 +# CONFIG_BLK_DEV_IO_TRACE is not set
34639 +# CONFIG_LSF is not set
34640 +# CONFIG_BLK_DEV_BSG is not set
34641 +
34642 +#
34643 +# IO Schedulers
34644 +#
34645 +CONFIG_IOSCHED_NOOP=y
34646 +CONFIG_IOSCHED_AS=y
34647 +CONFIG_IOSCHED_DEADLINE=y
34648 +CONFIG_IOSCHED_CFQ=y
34649 +CONFIG_DEFAULT_AS=y
34650 +# CONFIG_DEFAULT_DEADLINE is not set
34651 +# CONFIG_DEFAULT_CFQ is not set
34652 +# CONFIG_DEFAULT_NOOP is not set
34653 +CONFIG_DEFAULT_IOSCHED="anticipatory"
34654 +# CONFIG_PPC4xx_PCI_EXPRESS is not set
34655 +
34656 +#
34657 +# Platform support
34658 +#
34659 +# CONFIG_PPC_MPC52xx is not set
34660 +# CONFIG_PPC_MPC5200 is not set
34661 +# CONFIG_PPC_CELL is not set
34662 +# CONFIG_PPC_CELL_NATIVE is not set
34663 +# CONFIG_PQ2ADS is not set
34664 +# CONFIG_BAMBOO is not set
34665 +# CONFIG_EBONY is not set
34666 +# CONFIG_SEQUOIA is not set
34667 +CONFIG_TAISHAN=y
34668 +# CONFIG_KATMAI is not set
34669 +# CONFIG_RAINIER is not set
34670 +CONFIG_440GX=y
34671 +# CONFIG_MPIC is not set
34672 +# CONFIG_MPIC_WEIRD is not set
34673 +# CONFIG_PPC_I8259 is not set
34674 +# CONFIG_PPC_RTAS is not set
34675 +# CONFIG_MMIO_NVRAM is not set
34676 +# CONFIG_PPC_MPC106 is not set
34677 +# CONFIG_PPC_970_NAP is not set
34678 +# CONFIG_PPC_INDIRECT_IO is not set
34679 +# CONFIG_GENERIC_IOMAP is not set
34680 +# CONFIG_CPU_FREQ is not set
34681 +# CONFIG_CPM2 is not set
34682 +# CONFIG_FSL_ULI1575 is not set
34683 +
34684 +#
34685 +# Kernel options
34686 +#
34687 +# CONFIG_HIGHMEM is not set
34688 +# CONFIG_TICK_ONESHOT is not set
34689 +# CONFIG_NO_HZ is not set
34690 +# CONFIG_HIGH_RES_TIMERS is not set
34691 +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
34692 +# CONFIG_HZ_100 is not set
34693 +CONFIG_HZ_250=y
34694 +# CONFIG_HZ_300 is not set
34695 +# CONFIG_HZ_1000 is not set
34696 +CONFIG_HZ=250
34697 +CONFIG_PREEMPT_NONE=y
34698 +# CONFIG_PREEMPT_VOLUNTARY is not set
34699 +# CONFIG_PREEMPT is not set
34700 +CONFIG_BINFMT_ELF=y
34701 +# CONFIG_BINFMT_MISC is not set
34702 +# CONFIG_MATH_EMULATION is not set
34703 +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
34704 +CONFIG_ARCH_FLATMEM_ENABLE=y
34705 +CONFIG_ARCH_POPULATES_NODE_MAP=y
34706 +CONFIG_SELECT_MEMORY_MODEL=y
34707 +CONFIG_FLATMEM_MANUAL=y
34708 +# CONFIG_DISCONTIGMEM_MANUAL is not set
34709 +# CONFIG_SPARSEMEM_MANUAL is not set
34710 +CONFIG_FLATMEM=y
34711 +CONFIG_FLAT_NODE_MEM_MAP=y
34712 +# CONFIG_SPARSEMEM_STATIC is not set
34713 +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
34714 +CONFIG_SPLIT_PTLOCK_CPUS=4
34715 +CONFIG_RESOURCES_64BIT=y
34716 +CONFIG_ZONE_DMA_FLAG=1
34717 +CONFIG_BOUNCE=y
34718 +CONFIG_VIRT_TO_BUS=y
34719 +CONFIG_PROC_DEVICETREE=y
34720 +CONFIG_CMDLINE_BOOL=y
34721 +CONFIG_CMDLINE=""
34722 +CONFIG_SECCOMP=y
34723 +CONFIG_WANT_DEVICE_TREE=y
34724 +CONFIG_DEVICE_TREE="taishan.dts"
34725 +CONFIG_ISA_DMA_API=y
34726 +
34727 +#
34728 +# Bus options
34729 +#
34730 +CONFIG_ZONE_DMA=y
34731 +CONFIG_PPC_INDIRECT_PCI=y
34732 +CONFIG_PCI=y
34733 +CONFIG_PCI_DOMAINS=y
34734 +CONFIG_PCI_SYSCALL=y
34735 +# CONFIG_PCIEPORTBUS is not set
34736 +CONFIG_ARCH_SUPPORTS_MSI=y
34737 +# CONFIG_PCI_MSI is not set
34738 +CONFIG_PCI_LEGACY=y
34739 +# CONFIG_PCI_DEBUG is not set
34740 +# CONFIG_PCCARD is not set
34741 +# CONFIG_HOTPLUG_PCI is not set
34742 +
34743 +#
34744 +# Advanced setup
34745 +#
34746 +# CONFIG_ADVANCED_OPTIONS is not set
34747 +
34748 +#
34749 +# Default settings for advanced configuration options are used
34750 +#
34751 +CONFIG_HIGHMEM_START=0xfe000000
34752 +CONFIG_LOWMEM_SIZE=0x30000000
34753 +CONFIG_KERNEL_START=0xc0000000
34754 +CONFIG_TASK_SIZE=0xc0000000
34755 +CONFIG_CONSISTENT_START=0xff100000
34756 +CONFIG_CONSISTENT_SIZE=0x00200000
34757 +CONFIG_BOOT_LOAD=0x01000000
34758 +
34759 +#
34760 +# Networking
34761 +#
34762 +CONFIG_NET=y
34763 +
34764 +#
34765 +# Networking options
34766 +#
34767 +CONFIG_PACKET=y
34768 +# CONFIG_PACKET_MMAP is not set
34769 +CONFIG_UNIX=y
34770 +# CONFIG_NET_KEY is not set
34771 +CONFIG_INET=y
34772 +# CONFIG_IP_MULTICAST is not set
34773 +# CONFIG_IP_ADVANCED_ROUTER is not set
34774 +CONFIG_IP_FIB_HASH=y
34775 +CONFIG_IP_PNP=y
34776 +CONFIG_IP_PNP_DHCP=y
34777 +CONFIG_IP_PNP_BOOTP=y
34778 +# CONFIG_IP_PNP_RARP is not set
34779 +# CONFIG_NET_IPIP is not set
34780 +# CONFIG_NET_IPGRE is not set
34781 +# CONFIG_ARPD is not set
34782 +# CONFIG_SYN_COOKIES is not set
34783 +# CONFIG_INET_AH is not set
34784 +# CONFIG_INET_ESP is not set
34785 +# CONFIG_INET_IPCOMP is not set
34786 +# CONFIG_INET_XFRM_TUNNEL is not set
34787 +# CONFIG_INET_TUNNEL is not set
34788 +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
34789 +# CONFIG_INET_XFRM_MODE_TUNNEL is not set
34790 +# CONFIG_INET_XFRM_MODE_BEET is not set
34791 +# CONFIG_INET_LRO is not set
34792 +CONFIG_INET_DIAG=y
34793 +CONFIG_INET_TCP_DIAG=y
34794 +# CONFIG_TCP_CONG_ADVANCED is not set
34795 +CONFIG_TCP_CONG_CUBIC=y
34796 +CONFIG_DEFAULT_TCP_CONG="cubic"
34797 +# CONFIG_TCP_MD5SIG is not set
34798 +# CONFIG_IPV6 is not set
34799 +# CONFIG_INET6_XFRM_TUNNEL is not set
34800 +# CONFIG_INET6_TUNNEL is not set
34801 +# CONFIG_NETWORK_SECMARK is not set
34802 +# CONFIG_NETFILTER is not set
34803 +# CONFIG_IP_DCCP is not set
34804 +# CONFIG_IP_SCTP is not set
34805 +# CONFIG_TIPC is not set
34806 +# CONFIG_ATM is not set
34807 +# CONFIG_BRIDGE is not set
34808 +# CONFIG_VLAN_8021Q is not set
34809 +# CONFIG_DECNET is not set
34810 +# CONFIG_LLC2 is not set
34811 +# CONFIG_IPX is not set
34812 +# CONFIG_ATALK is not set
34813 +# CONFIG_X25 is not set
34814 +# CONFIG_LAPB is not set
34815 +# CONFIG_ECONET is not set
34816 +# CONFIG_WAN_ROUTER is not set
34817 +# CONFIG_NET_SCHED is not set
34818 +
34819 +#
34820 +# Network testing
34821 +#
34822 +# CONFIG_NET_PKTGEN is not set
34823 +# CONFIG_HAMRADIO is not set
34824 +# CONFIG_IRDA is not set
34825 +# CONFIG_BT is not set
34826 +# CONFIG_AF_RXRPC is not set
34827 +
34828 +#
34829 +# Wireless
34830 +#
34831 +# CONFIG_CFG80211 is not set
34832 +# CONFIG_WIRELESS_EXT is not set
34833 +# CONFIG_MAC80211 is not set
34834 +# CONFIG_IEEE80211 is not set
34835 +# CONFIG_RFKILL is not set
34836 +# CONFIG_NET_9P is not set
34837 +
34838 +#
34839 +# Device Drivers
34840 +#
34841 +
34842 +#
34843 +# Generic Driver Options
34844 +#
34845 +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
34846 +CONFIG_STANDALONE=y
34847 +CONFIG_PREVENT_FIRMWARE_BUILD=y
34848 +CONFIG_FW_LOADER=y
34849 +# CONFIG_DEBUG_DRIVER is not set
34850 +# CONFIG_DEBUG_DEVRES is not set
34851 +# CONFIG_SYS_HYPERVISOR is not set
34852 +CONFIG_CONNECTOR=y
34853 +CONFIG_PROC_EVENTS=y
34854 +# CONFIG_MTD is not set
34855 +CONFIG_OF_DEVICE=y
34856 +# CONFIG_PARPORT is not set
34857 +CONFIG_BLK_DEV=y
34858 +# CONFIG_BLK_DEV_FD is not set
34859 +# CONFIG_BLK_CPQ_DA is not set
34860 +# CONFIG_BLK_CPQ_CISS_DA is not set
34861 +# CONFIG_BLK_DEV_DAC960 is not set
34862 +# CONFIG_BLK_DEV_UMEM is not set
34863 +# CONFIG_BLK_DEV_COW_COMMON is not set
34864 +# CONFIG_BLK_DEV_LOOP is not set
34865 +# CONFIG_BLK_DEV_NBD is not set
34866 +# CONFIG_BLK_DEV_SX8 is not set
34867 +CONFIG_BLK_DEV_RAM=y
34868 +CONFIG_BLK_DEV_RAM_COUNT=16
34869 +CONFIG_BLK_DEV_RAM_SIZE=35000
34870 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
34871 +# CONFIG_CDROM_PKTCDVD is not set
34872 +# CONFIG_ATA_OVER_ETH is not set
34873 +# CONFIG_XILINX_SYSACE is not set
34874 +CONFIG_MISC_DEVICES=y
34875 +# CONFIG_PHANTOM is not set
34876 +# CONFIG_EEPROM_93CX6 is not set
34877 +# CONFIG_SGI_IOC4 is not set
34878 +# CONFIG_TIFM_CORE is not set
34879 +# CONFIG_IDE is not set
34880 +
34881 +#
34882 +# SCSI device support
34883 +#
34884 +# CONFIG_RAID_ATTRS is not set
34885 +# CONFIG_SCSI is not set
34886 +# CONFIG_SCSI_DMA is not set
34887 +# CONFIG_SCSI_NETLINK is not set
34888 +# CONFIG_ATA is not set
34889 +# CONFIG_MD is not set
34890 +# CONFIG_FUSION is not set
34891 +
34892 +#
34893 +# IEEE 1394 (FireWire) support
34894 +#
34895 +# CONFIG_FIREWIRE is not set
34896 +# CONFIG_IEEE1394 is not set
34897 +# CONFIG_I2O is not set
34898 +CONFIG_MACINTOSH_DRIVERS=y
34899 +# CONFIG_MAC_EMUMOUSEBTN is not set
34900 +# CONFIG_WINDFARM is not set
34901 +CONFIG_NETDEVICES=y
34902 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
34903 +# CONFIG_DUMMY is not set
34904 +# CONFIG_BONDING is not set
34905 +# CONFIG_MACVLAN is not set
34906 +# CONFIG_EQUALIZER is not set
34907 +# CONFIG_TUN is not set
34908 +# CONFIG_VETH is not set
34909 +# CONFIG_IP1000 is not set
34910 +# CONFIG_ARCNET is not set
34911 +# CONFIG_PHYLIB is not set
34912 +CONFIG_NET_ETHERNET=y
34913 +# CONFIG_MII is not set
34914 +# CONFIG_HAPPYMEAL is not set
34915 +# CONFIG_SUNGEM is not set
34916 +# CONFIG_CASSINI is not set
34917 +# CONFIG_NET_VENDOR_3COM is not set
34918 +# CONFIG_NET_TULIP is not set
34919 +# CONFIG_HP100 is not set
34920 +CONFIG_IBM_NEW_EMAC=y
34921 +CONFIG_IBM_NEW_EMAC_RXB=128
34922 +CONFIG_IBM_NEW_EMAC_TXB=64
34923 +CONFIG_IBM_NEW_EMAC_POLL_WEIGHT=32
34924 +CONFIG_IBM_NEW_EMAC_RX_COPY_THRESHOLD=256
34925 +CONFIG_IBM_NEW_EMAC_RX_SKB_HEADROOM=0
34926 +# CONFIG_IBM_NEW_EMAC_DEBUG is not set
34927 +CONFIG_IBM_NEW_EMAC_ZMII=y
34928 +CONFIG_IBM_NEW_EMAC_RGMII=y
34929 +CONFIG_IBM_NEW_EMAC_TAH=y
34930 +CONFIG_IBM_NEW_EMAC_EMAC4=y
34931 +# CONFIG_NET_PCI is not set
34932 +# CONFIG_B44 is not set
34933 +CONFIG_NETDEV_1000=y
34934 +# CONFIG_ACENIC is not set
34935 +# CONFIG_DL2K is not set
34936 +# CONFIG_E1000 is not set
34937 +# CONFIG_E1000E is not set
34938 +# CONFIG_NS83820 is not set
34939 +# CONFIG_HAMACHI is not set
34940 +# CONFIG_YELLOWFIN is not set
34941 +# CONFIG_R8169 is not set
34942 +# CONFIG_SIS190 is not set
34943 +# CONFIG_SKGE is not set
34944 +# CONFIG_SKY2 is not set
34945 +# CONFIG_SK98LIN is not set
34946 +# CONFIG_VIA_VELOCITY is not set
34947 +# CONFIG_TIGON3 is not set
34948 +# CONFIG_BNX2 is not set
34949 +# CONFIG_QLA3XXX is not set
34950 +# CONFIG_ATL1 is not set
34951 +CONFIG_NETDEV_10000=y
34952 +# CONFIG_CHELSIO_T1 is not set
34953 +# CONFIG_CHELSIO_T3 is not set
34954 +# CONFIG_IXGBE is not set
34955 +# CONFIG_IXGB is not set
34956 +# CONFIG_S2IO is not set
34957 +# CONFIG_MYRI10GE is not set
34958 +# CONFIG_NETXEN_NIC is not set
34959 +# CONFIG_NIU is not set
34960 +# CONFIG_MLX4_CORE is not set
34961 +# CONFIG_TEHUTI is not set
34962 +# CONFIG_TR is not set
34963 +
34964 +#
34965 +# Wireless LAN
34966 +#
34967 +# CONFIG_WLAN_PRE80211 is not set
34968 +# CONFIG_WLAN_80211 is not set
34969 +# CONFIG_WAN is not set
34970 +# CONFIG_FDDI is not set
34971 +# CONFIG_HIPPI is not set
34972 +# CONFIG_PPP is not set
34973 +# CONFIG_SLIP is not set
34974 +# CONFIG_SHAPER is not set
34975 +# CONFIG_NETCONSOLE is not set
34976 +# CONFIG_NETPOLL is not set
34977 +# CONFIG_NET_POLL_CONTROLLER is not set
34978 +# CONFIG_ISDN is not set
34979 +# CONFIG_PHONE is not set
34980 +
34981 +#
34982 +# Input device support
34983 +#
34984 +# CONFIG_INPUT is not set
34985 +
34986 +#
34987 +# Hardware I/O ports
34988 +#
34989 +# CONFIG_SERIO is not set
34990 +# CONFIG_GAMEPORT is not set
34991 +
34992 +#
34993 +# Character devices
34994 +#
34995 +# CONFIG_VT is not set
34996 +# CONFIG_SERIAL_NONSTANDARD is not set
34997 +
34998 +#
34999 +# Serial drivers
35000 +#
35001 +CONFIG_SERIAL_8250=y
35002 +CONFIG_SERIAL_8250_CONSOLE=y
35003 +# CONFIG_SERIAL_8250_PCI is not set
35004 +CONFIG_SERIAL_8250_NR_UARTS=4
35005 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4
35006 +CONFIG_SERIAL_8250_EXTENDED=y
35007 +# CONFIG_SERIAL_8250_MANY_PORTS is not set
35008 +CONFIG_SERIAL_8250_SHARE_IRQ=y
35009 +# CONFIG_SERIAL_8250_DETECT_IRQ is not set
35010 +# CONFIG_SERIAL_8250_RSA is not set
35011 +
35012 +#
35013 +# Non-8250 serial port support
35014 +#
35015 +# CONFIG_SERIAL_UARTLITE is not set
35016 +CONFIG_SERIAL_CORE=y
35017 +CONFIG_SERIAL_CORE_CONSOLE=y
35018 +# CONFIG_SERIAL_JSM is not set
35019 +CONFIG_SERIAL_OF_PLATFORM=y
35020 +CONFIG_UNIX98_PTYS=y
35021 +CONFIG_LEGACY_PTYS=y
35022 +CONFIG_LEGACY_PTY_COUNT=256
35023 +# CONFIG_IPMI_HANDLER is not set
35024 +# CONFIG_HW_RANDOM is not set
35025 +# CONFIG_NVRAM is not set
35026 +# CONFIG_GEN_RTC is not set
35027 +# CONFIG_R3964 is not set
35028 +# CONFIG_APPLICOM is not set
35029 +# CONFIG_RAW_DRIVER is not set
35030 +# CONFIG_TCG_TPM is not set
35031 +CONFIG_DEVPORT=y
35032 +# CONFIG_I2C is not set
35033 +
35034 +#
35035 +# SPI support
35036 +#
35037 +# CONFIG_SPI is not set
35038 +# CONFIG_SPI_MASTER is not set
35039 +# CONFIG_W1 is not set
35040 +# CONFIG_POWER_SUPPLY is not set
35041 +# CONFIG_HWMON is not set
35042 +# CONFIG_WATCHDOG is not set
35043 +
35044 +#
35045 +# Sonics Silicon Backplane
35046 +#
35047 +CONFIG_SSB_POSSIBLE=y
35048 +# CONFIG_SSB is not set
35049 +
35050 +#
35051 +# Multifunction device drivers
35052 +#
35053 +# CONFIG_MFD_SM501 is not set
35054 +
35055 +#
35056 +# Multimedia devices
35057 +#
35058 +# CONFIG_VIDEO_DEV is not set
35059 +# CONFIG_DVB_CORE is not set
35060 +CONFIG_DAB=y
35061 +
35062 +#
35063 +# Graphics support
35064 +#
35065 +# CONFIG_AGP is not set
35066 +# CONFIG_DRM is not set
35067 +# CONFIG_VGASTATE is not set
35068 +CONFIG_VIDEO_OUTPUT_CONTROL=m
35069 +# CONFIG_FB is not set
35070 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
35071 +
35072 +#
35073 +# Display device support
35074 +#
35075 +# CONFIG_DISPLAY_SUPPORT is not set
35076 +
35077 +#
35078 +# Sound
35079 +#
35080 +# CONFIG_SOUND is not set
35081 +CONFIG_USB_SUPPORT=y
35082 +CONFIG_USB_ARCH_HAS_HCD=y
35083 +CONFIG_USB_ARCH_HAS_OHCI=y
35084 +CONFIG_USB_ARCH_HAS_EHCI=y
35085 +# CONFIG_USB is not set
35086 +
35087 +#
35088 +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
35089 +#
35090 +
35091 +#
35092 +# USB Gadget Support
35093 +#
35094 +# CONFIG_USB_GADGET is not set
35095 +# CONFIG_MMC is not set
35096 +# CONFIG_NEW_LEDS is not set
35097 +# CONFIG_INFINIBAND is not set
35098 +# CONFIG_EDAC is not set
35099 +# CONFIG_RTC_CLASS is not set
35100 +
35101 +#
35102 +# Userspace I/O
35103 +#
35104 +# CONFIG_UIO is not set
35105 +
35106 +#
35107 +# File systems
35108 +#
35109 +CONFIG_EXT2_FS=y
35110 +# CONFIG_EXT2_FS_XATTR is not set
35111 +# CONFIG_EXT2_FS_XIP is not set
35112 +# CONFIG_EXT3_FS is not set
35113 +# CONFIG_EXT4DEV_FS is not set
35114 +# CONFIG_REISERFS_FS is not set
35115 +# CONFIG_JFS_FS is not set
35116 +# CONFIG_FS_POSIX_ACL is not set
35117 +# CONFIG_XFS_FS is not set
35118 +# CONFIG_GFS2_FS is not set
35119 +# CONFIG_OCFS2_FS is not set
35120 +# CONFIG_MINIX_FS is not set
35121 +# CONFIG_ROMFS_FS is not set
35122 +CONFIG_INOTIFY=y
35123 +CONFIG_INOTIFY_USER=y
35124 +# CONFIG_QUOTA is not set
35125 +CONFIG_DNOTIFY=y
35126 +# CONFIG_AUTOFS_FS is not set
35127 +# CONFIG_AUTOFS4_FS is not set
35128 +# CONFIG_FUSE_FS is not set
35129 +
35130 +#
35131 +# CD-ROM/DVD Filesystems
35132 +#
35133 +# CONFIG_ISO9660_FS is not set
35134 +# CONFIG_UDF_FS is not set
35135 +
35136 +#
35137 +# DOS/FAT/NT Filesystems
35138 +#
35139 +# CONFIG_MSDOS_FS is not set
35140 +# CONFIG_VFAT_FS is not set
35141 +# CONFIG_NTFS_FS is not set
35142 +
35143 +#
35144 +# Pseudo filesystems
35145 +#
35146 +CONFIG_PROC_FS=y
35147 +CONFIG_PROC_KCORE=y
35148 +CONFIG_PROC_SYSCTL=y
35149 +CONFIG_SYSFS=y
35150 +CONFIG_TMPFS=y
35151 +# CONFIG_TMPFS_POSIX_ACL is not set
35152 +# CONFIG_HUGETLB_PAGE is not set
35153 +# CONFIG_CONFIGFS_FS is not set
35154 +
35155 +#
35156 +# Miscellaneous filesystems
35157 +#
35158 +# CONFIG_ADFS_FS is not set
35159 +# CONFIG_AFFS_FS is not set
35160 +# CONFIG_HFS_FS is not set
35161 +# CONFIG_HFSPLUS_FS is not set
35162 +# CONFIG_BEFS_FS is not set
35163 +# CONFIG_BFS_FS is not set
35164 +# CONFIG_EFS_FS is not set
35165 +CONFIG_CRAMFS=y
35166 +# CONFIG_VXFS_FS is not set
35167 +# CONFIG_HPFS_FS is not set
35168 +# CONFIG_QNX4FS_FS is not set
35169 +# CONFIG_SYSV_FS is not set
35170 +# CONFIG_UFS_FS is not set
35171 +CONFIG_NETWORK_FILESYSTEMS=y
35172 +CONFIG_NFS_FS=y
35173 +CONFIG_NFS_V3=y
35174 +# CONFIG_NFS_V3_ACL is not set
35175 +# CONFIG_NFS_V4 is not set
35176 +# CONFIG_NFS_DIRECTIO is not set
35177 +# CONFIG_NFSD is not set
35178 +CONFIG_ROOT_NFS=y
35179 +CONFIG_LOCKD=y
35180 +CONFIG_LOCKD_V4=y
35181 +CONFIG_NFS_COMMON=y
35182 +CONFIG_SUNRPC=y
35183 +# CONFIG_SUNRPC_BIND34 is not set
35184 +# CONFIG_RPCSEC_GSS_KRB5 is not set
35185 +# CONFIG_RPCSEC_GSS_SPKM3 is not set
35186 +# CONFIG_SMB_FS is not set
35187 +# CONFIG_CIFS is not set
35188 +# CONFIG_NCP_FS is not set
35189 +# CONFIG_CODA_FS is not set
35190 +# CONFIG_AFS_FS is not set
35191 +
35192 +#
35193 +# Partition Types
35194 +#
35195 +# CONFIG_PARTITION_ADVANCED is not set
35196 +CONFIG_MSDOS_PARTITION=y
35197 +# CONFIG_NLS is not set
35198 +# CONFIG_DLM is not set
35199 +# CONFIG_UCC_SLOW is not set
35200 +
35201 +#
35202 +# Library routines
35203 +#
35204 +CONFIG_BITREVERSE=y
35205 +# CONFIG_CRC_CCITT is not set
35206 +# CONFIG_CRC16 is not set
35207 +# CONFIG_CRC_ITU_T is not set
35208 +CONFIG_CRC32=y
35209 +# CONFIG_CRC7 is not set
35210 +# CONFIG_LIBCRC32C is not set
35211 +CONFIG_ZLIB_INFLATE=y
35212 +CONFIG_PLIST=y
35213 +CONFIG_HAS_IOMEM=y
35214 +CONFIG_HAS_IOPORT=y
35215 +CONFIG_HAS_DMA=y
35216 +CONFIG_INSTRUMENTATION=y
35217 +# CONFIG_PROFILING is not set
35218 +# CONFIG_KPROBES is not set
35219 +# CONFIG_MARKERS is not set
35220 +
35221 +#
35222 +# Kernel hacking
35223 +#
35224 +# CONFIG_PRINTK_TIME is not set
35225 +CONFIG_ENABLE_WARN_DEPRECATED=y
35226 +CONFIG_ENABLE_MUST_CHECK=y
35227 +CONFIG_MAGIC_SYSRQ=y
35228 +# CONFIG_UNUSED_SYMBOLS is not set
35229 +# CONFIG_DEBUG_FS is not set
35230 +# CONFIG_HEADERS_CHECK is not set
35231 +CONFIG_DEBUG_KERNEL=y
35232 +# CONFIG_DEBUG_SHIRQ is not set
35233 +CONFIG_DETECT_SOFTLOCKUP=y
35234 +CONFIG_SCHED_DEBUG=y
35235 +# CONFIG_SCHEDSTATS is not set
35236 +# CONFIG_TIMER_STATS is not set
35237 +# CONFIG_SLUB_DEBUG_ON is not set
35238 +# CONFIG_DEBUG_RT_MUTEXES is not set
35239 +# CONFIG_RT_MUTEX_TESTER is not set
35240 +# CONFIG_DEBUG_SPINLOCK is not set
35241 +# CONFIG_DEBUG_MUTEXES is not set
35242 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
35243 +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
35244 +# CONFIG_DEBUG_KOBJECT is not set
35245 +# CONFIG_DEBUG_BUGVERBOSE is not set
35246 +# CONFIG_DEBUG_INFO is not set
35247 +# CONFIG_DEBUG_VM is not set
35248 +# CONFIG_DEBUG_LIST is not set
35249 +# CONFIG_DEBUG_SG is not set
35250 +CONFIG_FORCED_INLINING=y
35251 +# CONFIG_BOOT_PRINTK_DELAY is not set
35252 +# CONFIG_RCU_TORTURE_TEST is not set
35253 +# CONFIG_FAULT_INJECTION is not set
35254 +# CONFIG_SAMPLES is not set
35255 +# CONFIG_DEBUG_STACKOVERFLOW is not set
35256 +# CONFIG_DEBUG_STACK_USAGE is not set
35257 +# CONFIG_DEBUG_PAGEALLOC is not set
35258 +CONFIG_DEBUGGER=y
35259 +# CONFIG_KGDB is not set
35260 +# CONFIG_XMON is not set
35261 +# CONFIG_BDI_SWITCH is not set
35262 +# CONFIG_PPC_EARLY_DEBUG is not set
35263 +
35264 +#
35265 +# Security options
35266 +#
35267 +# CONFIG_KEYS is not set
35268 +# CONFIG_SECURITY is not set
35269 +# CONFIG_SECURITY_FILE_CAPABILITIES is not set
35270 +CONFIG_CRYPTO=y
35271 +CONFIG_CRYPTO_ALGAPI=y
35272 +CONFIG_CRYPTO_BLKCIPHER=y
35273 +CONFIG_CRYPTO_MANAGER=y
35274 +# CONFIG_CRYPTO_HMAC is not set
35275 +# CONFIG_CRYPTO_XCBC is not set
35276 +# CONFIG_CRYPTO_NULL is not set
35277 +# CONFIG_CRYPTO_MD4 is not set
35278 +CONFIG_CRYPTO_MD5=y
35279 +# CONFIG_CRYPTO_SHA1 is not set
35280 +# CONFIG_CRYPTO_SHA256 is not set
35281 +# CONFIG_CRYPTO_SHA512 is not set
35282 +# CONFIG_CRYPTO_WP512 is not set
35283 +# CONFIG_CRYPTO_TGR192 is not set
35284 +# CONFIG_CRYPTO_GF128MUL is not set
35285 +CONFIG_CRYPTO_ECB=y
35286 +CONFIG_CRYPTO_CBC=y
35287 +CONFIG_CRYPTO_PCBC=y
35288 +# CONFIG_CRYPTO_LRW is not set
35289 +# CONFIG_CRYPTO_XTS is not set
35290 +# CONFIG_CRYPTO_CRYPTD is not set
35291 +CONFIG_CRYPTO_DES=y
35292 +# CONFIG_CRYPTO_FCRYPT is not set
35293 +# CONFIG_CRYPTO_BLOWFISH is not set
35294 +# CONFIG_CRYPTO_TWOFISH is not set
35295 +# CONFIG_CRYPTO_SERPENT is not set
35296 +# CONFIG_CRYPTO_AES is not set
35297 +# CONFIG_CRYPTO_CAST5 is not set
35298 +# CONFIG_CRYPTO_CAST6 is not set
35299 +# CONFIG_CRYPTO_TEA is not set
35300 +# CONFIG_CRYPTO_ARC4 is not set
35301 +# CONFIG_CRYPTO_KHAZAD is not set
35302 +# CONFIG_CRYPTO_ANUBIS is not set
35303 +# CONFIG_CRYPTO_SEED is not set
35304 +# CONFIG_CRYPTO_DEFLATE is not set
35305 +# CONFIG_CRYPTO_MICHAEL_MIC is not set
35306 +# CONFIG_CRYPTO_CRC32C is not set
35307 +# CONFIG_CRYPTO_CAMELLIA is not set
35308 +# CONFIG_CRYPTO_TEST is not set
35309 +# CONFIG_CRYPTO_AUTHENC is not set
35310 +CONFIG_CRYPTO_HW=y
35311 +# CONFIG_PPC_CLOCK is not set
35312 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/configs/walnut_defconfig powerpc.git/arch/powerpc/configs/walnut_defconfig
35313 --- linux-2.6.24/arch/powerpc/configs/walnut_defconfig  2008-01-24 23:58:37.000000000 +0100
35314 +++ powerpc.git/arch/powerpc/configs/walnut_defconfig   2008-01-28 20:25:49.000000000 +0100
35315 @@ -1,7 +1,7 @@
35316  #
35317  # Automatically generated make config: don't edit
35318 -# Linux kernel version: 2.6.24-rc4
35319 -# Thu Dec  6 16:49:33 2007
35320 +# Linux kernel version: 2.6.24-rc6
35321 +# Mon Dec 24 11:23:58 2007
35322  #
35323  # CONFIG_PPC64 is not set
35324  
35325 @@ -40,7 +40,7 @@
35326  CONFIG_ARCH_MAY_HAVE_PC_FDC=y
35327  CONFIG_PPC_OF=y
35328  CONFIG_OF=y
35329 -# CONFIG_PPC_UDBG_16550 is not set
35330 +CONFIG_PPC_UDBG_16550=y
35331  # CONFIG_GENERIC_TBSYNC is not set
35332  CONFIG_AUDIT_ARCH=y
35333  CONFIG_GENERIC_BUG=y
35334 @@ -127,6 +127,7 @@
35335  # CONFIG_DEFAULT_CFQ is not set
35336  # CONFIG_DEFAULT_NOOP is not set
35337  CONFIG_DEFAULT_IOSCHED="anticipatory"
35338 +# CONFIG_PPC4xx_PCI_EXPRESS is not set
35339  
35340  #
35341  # Platform support
35342 @@ -136,7 +137,9 @@
35343  # CONFIG_PPC_CELL is not set
35344  # CONFIG_PPC_CELL_NATIVE is not set
35345  # CONFIG_PQ2ADS is not set
35346 +# CONFIG_EP405 is not set
35347  # CONFIG_KILAUEA is not set
35348 +# CONFIG_MAKALU is not set
35349  CONFIG_WALNUT=y
35350  # CONFIG_XILINX_VIRTEX_GENERIC_BOARD is not set
35351  CONFIG_405GP=y
35352 @@ -204,11 +207,17 @@
35353  # Bus options
35354  #
35355  CONFIG_ZONE_DMA=y
35356 -# CONFIG_PCI is not set
35357 -# CONFIG_PCI_DOMAINS is not set
35358 -# CONFIG_PCI_SYSCALL is not set
35359 -# CONFIG_ARCH_SUPPORTS_MSI is not set
35360 +CONFIG_PPC_INDIRECT_PCI=y
35361 +CONFIG_PCI=y
35362 +CONFIG_PCI_DOMAINS=y
35363 +CONFIG_PCI_SYSCALL=y
35364 +# CONFIG_PCIEPORTBUS is not set
35365 +CONFIG_ARCH_SUPPORTS_MSI=y
35366 +# CONFIG_PCI_MSI is not set
35367 +# CONFIG_PCI_LEGACY is not set
35368 +# CONFIG_PCI_DEBUG is not set
35369  # CONFIG_PCCARD is not set
35370 +# CONFIG_HOTPLUG_PCI is not set
35371  
35372  #
35373  # Advanced setup
35374 @@ -373,11 +382,13 @@
35375  # CONFIG_MTD_COMPLEX_MAPPINGS is not set
35376  # CONFIG_MTD_PHYSMAP is not set
35377  CONFIG_MTD_PHYSMAP_OF=y
35378 +# CONFIG_MTD_INTEL_VR_NOR is not set
35379  # CONFIG_MTD_PLATRAM is not set
35380  
35381  #
35382  # Self-contained MTD device drivers
35383  #
35384 +# CONFIG_MTD_PMC551 is not set
35385  # CONFIG_MTD_SLRAM is not set
35386  # CONFIG_MTD_PHRAM is not set
35387  # CONFIG_MTD_MTDRAM is not set
35388 @@ -400,9 +411,14 @@
35389  # CONFIG_PARPORT is not set
35390  CONFIG_BLK_DEV=y
35391  # CONFIG_BLK_DEV_FD is not set
35392 +# CONFIG_BLK_CPQ_DA is not set
35393 +# CONFIG_BLK_CPQ_CISS_DA is not set
35394 +# CONFIG_BLK_DEV_DAC960 is not set
35395 +# CONFIG_BLK_DEV_UMEM is not set
35396  # CONFIG_BLK_DEV_COW_COMMON is not set
35397  # CONFIG_BLK_DEV_LOOP is not set
35398  # CONFIG_BLK_DEV_NBD is not set
35399 +# CONFIG_BLK_DEV_SX8 is not set
35400  CONFIG_BLK_DEV_RAM=y
35401  CONFIG_BLK_DEV_RAM_COUNT=16
35402  CONFIG_BLK_DEV_RAM_SIZE=35000
35403 @@ -411,7 +427,10 @@
35404  # CONFIG_ATA_OVER_ETH is not set
35405  # CONFIG_XILINX_SYSACE is not set
35406  CONFIG_MISC_DEVICES=y
35407 +# CONFIG_PHANTOM is not set
35408  # CONFIG_EEPROM_93CX6 is not set
35409 +# CONFIG_SGI_IOC4 is not set
35410 +# CONFIG_TIFM_CORE is not set
35411  # CONFIG_IDE is not set
35412  
35413  #
35414 @@ -423,6 +442,14 @@
35415  # CONFIG_SCSI_NETLINK is not set
35416  # CONFIG_ATA is not set
35417  # CONFIG_MD is not set
35418 +# CONFIG_FUSION is not set
35419 +
35420 +#
35421 +# IEEE 1394 (FireWire) support
35422 +#
35423 +# CONFIG_FIREWIRE is not set
35424 +# CONFIG_IEEE1394 is not set
35425 +# CONFIG_I2O is not set
35426  # CONFIG_MACINTOSH_DRIVERS is not set
35427  CONFIG_NETDEVICES=y
35428  # CONFIG_NETDEVICES_MULTIQUEUE is not set
35429 @@ -432,9 +459,17 @@
35430  # CONFIG_EQUALIZER is not set
35431  # CONFIG_TUN is not set
35432  # CONFIG_VETH is not set
35433 +# CONFIG_IP1000 is not set
35434 +# CONFIG_ARCNET is not set
35435  # CONFIG_PHYLIB is not set
35436  CONFIG_NET_ETHERNET=y
35437  # CONFIG_MII is not set
35438 +# CONFIG_HAPPYMEAL is not set
35439 +# CONFIG_SUNGEM is not set
35440 +# CONFIG_CASSINI is not set
35441 +# CONFIG_NET_VENDOR_3COM is not set
35442 +# CONFIG_NET_TULIP is not set
35443 +# CONFIG_HP100 is not set
35444  CONFIG_IBM_NEW_EMAC=y
35445  CONFIG_IBM_NEW_EMAC_RXB=128
35446  CONFIG_IBM_NEW_EMAC_TXB=64
35447 @@ -446,9 +481,38 @@
35448  # CONFIG_IBM_NEW_EMAC_RGMII is not set
35449  # CONFIG_IBM_NEW_EMAC_TAH is not set
35450  # CONFIG_IBM_NEW_EMAC_EMAC4 is not set
35451 +# CONFIG_NET_PCI is not set
35452  # CONFIG_B44 is not set
35453  CONFIG_NETDEV_1000=y
35454 +# CONFIG_ACENIC is not set
35455 +# CONFIG_DL2K is not set
35456 +# CONFIG_E1000 is not set
35457 +# CONFIG_E1000E is not set
35458 +# CONFIG_NS83820 is not set
35459 +# CONFIG_HAMACHI is not set
35460 +# CONFIG_YELLOWFIN is not set
35461 +# CONFIG_R8169 is not set
35462 +# CONFIG_SIS190 is not set
35463 +# CONFIG_SKGE is not set
35464 +# CONFIG_SKY2 is not set
35465 +# CONFIG_SK98LIN is not set
35466 +# CONFIG_VIA_VELOCITY is not set
35467 +# CONFIG_TIGON3 is not set
35468 +# CONFIG_BNX2 is not set
35469 +# CONFIG_QLA3XXX is not set
35470 +# CONFIG_ATL1 is not set
35471  CONFIG_NETDEV_10000=y
35472 +# CONFIG_CHELSIO_T1 is not set
35473 +# CONFIG_CHELSIO_T3 is not set
35474 +# CONFIG_IXGBE is not set
35475 +# CONFIG_IXGB is not set
35476 +# CONFIG_S2IO is not set
35477 +# CONFIG_MYRI10GE is not set
35478 +# CONFIG_NETXEN_NIC is not set
35479 +# CONFIG_NIU is not set
35480 +# CONFIG_MLX4_CORE is not set
35481 +# CONFIG_TEHUTI is not set
35482 +# CONFIG_TR is not set
35483  
35484  #
35485  # Wireless LAN
35486 @@ -456,6 +520,8 @@
35487  # CONFIG_WLAN_PRE80211 is not set
35488  # CONFIG_WLAN_80211 is not set
35489  # CONFIG_WAN is not set
35490 +# CONFIG_FDDI is not set
35491 +# CONFIG_HIPPI is not set
35492  # CONFIG_PPP is not set
35493  # CONFIG_SLIP is not set
35494  # CONFIG_SHAPER is not set
35495 @@ -487,6 +553,7 @@
35496  #
35497  CONFIG_SERIAL_8250=y
35498  CONFIG_SERIAL_8250_CONSOLE=y
35499 +CONFIG_SERIAL_8250_PCI=y
35500  CONFIG_SERIAL_8250_NR_UARTS=4
35501  CONFIG_SERIAL_8250_RUNTIME_UARTS=4
35502  CONFIG_SERIAL_8250_EXTENDED=y
35503 @@ -501,6 +568,7 @@
35504  # CONFIG_SERIAL_UARTLITE is not set
35505  CONFIG_SERIAL_CORE=y
35506  CONFIG_SERIAL_CORE_CONSOLE=y
35507 +# CONFIG_SERIAL_JSM is not set
35508  CONFIG_SERIAL_OF_PLATFORM=y
35509  CONFIG_UNIX98_PTYS=y
35510  CONFIG_LEGACY_PTYS=y
35511 @@ -510,8 +578,10 @@
35512  # CONFIG_NVRAM is not set
35513  # CONFIG_GEN_RTC is not set
35514  # CONFIG_R3964 is not set
35515 +# CONFIG_APPLICOM is not set
35516  # CONFIG_RAW_DRIVER is not set
35517  # CONFIG_TCG_TPM is not set
35518 +CONFIG_DEVPORT=y
35519  # CONFIG_I2C is not set
35520  
35521  #
35522 @@ -545,6 +615,8 @@
35523  #
35524  # Graphics support
35525  #
35526 +# CONFIG_AGP is not set
35527 +# CONFIG_DRM is not set
35528  # CONFIG_VGASTATE is not set
35529  CONFIG_VIDEO_OUTPUT_CONTROL=m
35530  # CONFIG_FB is not set
35531 @@ -560,9 +632,10 @@
35532  #
35533  # CONFIG_SOUND is not set
35534  CONFIG_USB_SUPPORT=y
35535 -# CONFIG_USB_ARCH_HAS_HCD is not set
35536 -# CONFIG_USB_ARCH_HAS_OHCI is not set
35537 -# CONFIG_USB_ARCH_HAS_EHCI is not set
35538 +CONFIG_USB_ARCH_HAS_HCD=y
35539 +CONFIG_USB_ARCH_HAS_OHCI=y
35540 +CONFIG_USB_ARCH_HAS_EHCI=y
35541 +# CONFIG_USB is not set
35542  
35543  #
35544  # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
35545 @@ -574,6 +647,7 @@
35546  # CONFIG_USB_GADGET is not set
35547  # CONFIG_MMC is not set
35548  # CONFIG_NEW_LEDS is not set
35549 +# CONFIG_INFINIBAND is not set
35550  # CONFIG_EDAC is not set
35551  # CONFIG_RTC_CLASS is not set
35552  
35553 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/configs/warp_defconfig powerpc.git/arch/powerpc/configs/warp_defconfig
35554 --- linux-2.6.24/arch/powerpc/configs/warp_defconfig    1970-01-01 01:00:00.000000000 +0100
35555 +++ powerpc.git/arch/powerpc/configs/warp_defconfig     2008-01-28 20:25:49.000000000 +0100
35556 @@ -0,0 +1,1057 @@
35557 +#
35558 +# Automatically generated make config: don't edit
35559 +# Linux kernel version: 2.6.24-rc6
35560 +# Tue Jan  8 12:23:23 2008
35561 +#
35562 +# CONFIG_PPC64 is not set
35563 +
35564 +#
35565 +# Processor support
35566 +#
35567 +# CONFIG_6xx is not set
35568 +# CONFIG_PPC_85xx is not set
35569 +# CONFIG_PPC_8xx is not set
35570 +# CONFIG_40x is not set
35571 +CONFIG_44x=y
35572 +# CONFIG_E200 is not set
35573 +CONFIG_PPC_FPU=y
35574 +CONFIG_4xx=y
35575 +CONFIG_BOOKE=y
35576 +CONFIG_PTE_64BIT=y
35577 +CONFIG_PHYS_64BIT=y
35578 +# CONFIG_PPC_MM_SLICES is not set
35579 +CONFIG_NOT_COHERENT_CACHE=y
35580 +CONFIG_PPC32=y
35581 +CONFIG_WORD_SIZE=32
35582 +CONFIG_PPC_MERGE=y
35583 +CONFIG_MMU=y
35584 +CONFIG_GENERIC_CMOS_UPDATE=y
35585 +CONFIG_GENERIC_TIME=y
35586 +CONFIG_GENERIC_TIME_VSYSCALL=y
35587 +CONFIG_GENERIC_CLOCKEVENTS=y
35588 +CONFIG_GENERIC_HARDIRQS=y
35589 +CONFIG_IRQ_PER_CPU=y
35590 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
35591 +CONFIG_ARCH_HAS_ILOG2_U32=y
35592 +CONFIG_GENERIC_HWEIGHT=y
35593 +CONFIG_GENERIC_CALIBRATE_DELAY=y
35594 +CONFIG_GENERIC_FIND_NEXT_BIT=y
35595 +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
35596 +CONFIG_PPC=y
35597 +CONFIG_EARLY_PRINTK=y
35598 +CONFIG_GENERIC_NVRAM=y
35599 +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
35600 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
35601 +CONFIG_PPC_OF=y
35602 +CONFIG_OF=y
35603 +CONFIG_PPC_UDBG_16550=y
35604 +# CONFIG_GENERIC_TBSYNC is not set
35605 +CONFIG_AUDIT_ARCH=y
35606 +CONFIG_GENERIC_BUG=y
35607 +# CONFIG_DEFAULT_UIMAGE is not set
35608 +CONFIG_PPC_DCR_NATIVE=y
35609 +# CONFIG_PPC_DCR_MMIO is not set
35610 +CONFIG_PPC_DCR=y
35611 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
35612 +
35613 +#
35614 +# General setup
35615 +#
35616 +CONFIG_EXPERIMENTAL=y
35617 +CONFIG_BROKEN_ON_SMP=y
35618 +CONFIG_INIT_ENV_ARG_LIMIT=32
35619 +CONFIG_LOCALVERSION="-pika"
35620 +# CONFIG_LOCALVERSION_AUTO is not set
35621 +CONFIG_SWAP=y
35622 +CONFIG_SYSVIPC=y
35623 +CONFIG_SYSVIPC_SYSCTL=y
35624 +# CONFIG_POSIX_MQUEUE is not set
35625 +# CONFIG_BSD_PROCESS_ACCT is not set
35626 +# CONFIG_TASKSTATS is not set
35627 +# CONFIG_USER_NS is not set
35628 +# CONFIG_PID_NS is not set
35629 +# CONFIG_AUDIT is not set
35630 +# CONFIG_IKCONFIG is not set
35631 +CONFIG_LOG_BUF_SHIFT=14
35632 +# CONFIG_CGROUPS is not set
35633 +CONFIG_FAIR_GROUP_SCHED=y
35634 +CONFIG_FAIR_USER_SCHED=y
35635 +# CONFIG_FAIR_CGROUP_SCHED is not set
35636 +CONFIG_SYSFS_DEPRECATED=y
35637 +# CONFIG_RELAY is not set
35638 +CONFIG_BLK_DEV_INITRD=y
35639 +CONFIG_INITRAMFS_SOURCE=""
35640 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
35641 +CONFIG_SYSCTL=y
35642 +CONFIG_EMBEDDED=y
35643 +CONFIG_SYSCTL_SYSCALL=y
35644 +CONFIG_KALLSYMS=y
35645 +# CONFIG_KALLSYMS_ALL is not set
35646 +# CONFIG_KALLSYMS_EXTRA_PASS is not set
35647 +# CONFIG_HOTPLUG is not set
35648 +CONFIG_PRINTK=y
35649 +CONFIG_BUG=y
35650 +CONFIG_ELF_CORE=y
35651 +CONFIG_BASE_FULL=y
35652 +CONFIG_FUTEX=y
35653 +CONFIG_ANON_INODES=y
35654 +CONFIG_EPOLL=y
35655 +CONFIG_SIGNALFD=y
35656 +CONFIG_EVENTFD=y
35657 +CONFIG_SHMEM=y
35658 +CONFIG_VM_EVENT_COUNTERS=y
35659 +CONFIG_SLAB=y
35660 +# CONFIG_SLUB is not set
35661 +# CONFIG_SLOB is not set
35662 +CONFIG_RT_MUTEXES=y
35663 +# CONFIG_TINY_SHMEM is not set
35664 +CONFIG_BASE_SMALL=0
35665 +CONFIG_MODULES=y
35666 +CONFIG_MODULE_UNLOAD=y
35667 +# CONFIG_MODULE_FORCE_UNLOAD is not set
35668 +# CONFIG_MODVERSIONS is not set
35669 +# CONFIG_MODULE_SRCVERSION_ALL is not set
35670 +CONFIG_KMOD=y
35671 +CONFIG_BLOCK=y
35672 +# CONFIG_LBD is not set
35673 +# CONFIG_BLK_DEV_IO_TRACE is not set
35674 +# CONFIG_LSF is not set
35675 +# CONFIG_BLK_DEV_BSG is not set
35676 +
35677 +#
35678 +# IO Schedulers
35679 +#
35680 +CONFIG_IOSCHED_NOOP=y
35681 +CONFIG_IOSCHED_AS=y
35682 +CONFIG_IOSCHED_DEADLINE=y
35683 +CONFIG_IOSCHED_CFQ=y
35684 +CONFIG_DEFAULT_AS=y
35685 +# CONFIG_DEFAULT_DEADLINE is not set
35686 +# CONFIG_DEFAULT_CFQ is not set
35687 +# CONFIG_DEFAULT_NOOP is not set
35688 +CONFIG_DEFAULT_IOSCHED="anticipatory"
35689 +
35690 +#
35691 +# Platform support
35692 +#
35693 +# CONFIG_PPC_MPC52xx is not set
35694 +# CONFIG_PPC_MPC5200 is not set
35695 +# CONFIG_PPC_CELL is not set
35696 +# CONFIG_PPC_CELL_NATIVE is not set
35697 +# CONFIG_PQ2ADS is not set
35698 +# CONFIG_BAMBOO is not set
35699 +# CONFIG_EBONY is not set
35700 +# CONFIG_SEQUOIA is not set
35701 +# CONFIG_TAISHAN is not set
35702 +# CONFIG_KATMAI is not set
35703 +# CONFIG_RAINIER is not set
35704 +CONFIG_WARP=y
35705 +CONFIG_440EP=y
35706 +CONFIG_IBM440EP_ERR42=y
35707 +# CONFIG_MPIC is not set
35708 +# CONFIG_MPIC_WEIRD is not set
35709 +# CONFIG_PPC_I8259 is not set
35710 +# CONFIG_PPC_RTAS is not set
35711 +# CONFIG_MMIO_NVRAM is not set
35712 +# CONFIG_PPC_MPC106 is not set
35713 +# CONFIG_PPC_970_NAP is not set
35714 +# CONFIG_PPC_INDIRECT_IO is not set
35715 +# CONFIG_GENERIC_IOMAP is not set
35716 +# CONFIG_CPU_FREQ is not set
35717 +# CONFIG_CPM2 is not set
35718 +# CONFIG_FSL_ULI1575 is not set
35719 +
35720 +#
35721 +# Kernel options
35722 +#
35723 +# CONFIG_HIGHMEM is not set
35724 +# CONFIG_TICK_ONESHOT is not set
35725 +# CONFIG_NO_HZ is not set
35726 +# CONFIG_HIGH_RES_TIMERS is not set
35727 +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
35728 +# CONFIG_HZ_100 is not set
35729 +# CONFIG_HZ_250 is not set
35730 +# CONFIG_HZ_300 is not set
35731 +CONFIG_HZ_1000=y
35732 +CONFIG_HZ=1000
35733 +CONFIG_PREEMPT_NONE=y
35734 +# CONFIG_PREEMPT_VOLUNTARY is not set
35735 +# CONFIG_PREEMPT is not set
35736 +CONFIG_BINFMT_ELF=y
35737 +# CONFIG_BINFMT_MISC is not set
35738 +# CONFIG_MATH_EMULATION is not set
35739 +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
35740 +CONFIG_ARCH_FLATMEM_ENABLE=y
35741 +CONFIG_ARCH_POPULATES_NODE_MAP=y
35742 +CONFIG_SELECT_MEMORY_MODEL=y
35743 +CONFIG_FLATMEM_MANUAL=y
35744 +# CONFIG_DISCONTIGMEM_MANUAL is not set
35745 +# CONFIG_SPARSEMEM_MANUAL is not set
35746 +CONFIG_FLATMEM=y
35747 +CONFIG_FLAT_NODE_MEM_MAP=y
35748 +# CONFIG_SPARSEMEM_STATIC is not set
35749 +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
35750 +CONFIG_SPLIT_PTLOCK_CPUS=4
35751 +CONFIG_RESOURCES_64BIT=y
35752 +CONFIG_ZONE_DMA_FLAG=1
35753 +CONFIG_BOUNCE=y
35754 +CONFIG_VIRT_TO_BUS=y
35755 +CONFIG_PROC_DEVICETREE=y
35756 +CONFIG_CMDLINE_BOOL=y
35757 +CONFIG_CMDLINE="ip=on"
35758 +CONFIG_SECCOMP=y
35759 +CONFIG_WANT_DEVICE_TREE=y
35760 +CONFIG_DEVICE_TREE="warp.dts"
35761 +CONFIG_ISA_DMA_API=y
35762 +
35763 +#
35764 +# Bus options
35765 +#
35766 +CONFIG_ZONE_DMA=y
35767 +# CONFIG_PCI is not set
35768 +# CONFIG_PCI_DOMAINS is not set
35769 +# CONFIG_PCI_SYSCALL is not set
35770 +# CONFIG_ARCH_SUPPORTS_MSI is not set
35771 +
35772 +#
35773 +# Advanced setup
35774 +#
35775 +# CONFIG_ADVANCED_OPTIONS is not set
35776 +
35777 +#
35778 +# Default settings for advanced configuration options are used
35779 +#
35780 +CONFIG_HIGHMEM_START=0xfe000000
35781 +CONFIG_LOWMEM_SIZE=0x30000000
35782 +CONFIG_KERNEL_START=0xc0000000
35783 +CONFIG_TASK_SIZE=0xc0000000
35784 +CONFIG_CONSISTENT_START=0xff100000
35785 +CONFIG_CONSISTENT_SIZE=0x00200000
35786 +CONFIG_BOOT_LOAD=0x01000000
35787 +
35788 +#
35789 +# Networking
35790 +#
35791 +CONFIG_NET=y
35792 +
35793 +#
35794 +# Networking options
35795 +#
35796 +CONFIG_PACKET=y
35797 +# CONFIG_PACKET_MMAP is not set
35798 +CONFIG_UNIX=y
35799 +CONFIG_XFRM=y
35800 +# CONFIG_XFRM_USER is not set
35801 +# CONFIG_XFRM_SUB_POLICY is not set
35802 +# CONFIG_XFRM_MIGRATE is not set
35803 +# CONFIG_NET_KEY is not set
35804 +CONFIG_INET=y
35805 +# CONFIG_IP_MULTICAST is not set
35806 +# CONFIG_IP_ADVANCED_ROUTER is not set
35807 +CONFIG_IP_FIB_HASH=y
35808 +CONFIG_IP_PNP=y
35809 +CONFIG_IP_PNP_DHCP=y
35810 +# CONFIG_IP_PNP_BOOTP is not set
35811 +# CONFIG_IP_PNP_RARP is not set
35812 +# CONFIG_NET_IPIP is not set
35813 +# CONFIG_NET_IPGRE is not set
35814 +# CONFIG_ARPD is not set
35815 +# CONFIG_SYN_COOKIES is not set
35816 +# CONFIG_INET_AH is not set
35817 +# CONFIG_INET_ESP is not set
35818 +# CONFIG_INET_IPCOMP is not set
35819 +# CONFIG_INET_XFRM_TUNNEL is not set
35820 +# CONFIG_INET_TUNNEL is not set
35821 +CONFIG_INET_XFRM_MODE_TRANSPORT=y
35822 +CONFIG_INET_XFRM_MODE_TUNNEL=y
35823 +CONFIG_INET_XFRM_MODE_BEET=y
35824 +# CONFIG_INET_LRO is not set
35825 +CONFIG_INET_DIAG=y
35826 +CONFIG_INET_TCP_DIAG=y
35827 +# CONFIG_TCP_CONG_ADVANCED is not set
35828 +CONFIG_TCP_CONG_CUBIC=y
35829 +CONFIG_DEFAULT_TCP_CONG="cubic"
35830 +# CONFIG_TCP_MD5SIG is not set
35831 +# CONFIG_IP_VS is not set
35832 +# CONFIG_IPV6 is not set
35833 +# CONFIG_INET6_XFRM_TUNNEL is not set
35834 +# CONFIG_INET6_TUNNEL is not set
35835 +# CONFIG_NETWORK_SECMARK is not set
35836 +CONFIG_NETFILTER=y
35837 +# CONFIG_NETFILTER_DEBUG is not set
35838 +
35839 +#
35840 +# Core Netfilter Configuration
35841 +#
35842 +# CONFIG_NETFILTER_NETLINK is not set
35843 +# CONFIG_NF_CONNTRACK_ENABLED is not set
35844 +# CONFIG_NF_CONNTRACK is not set
35845 +# CONFIG_NETFILTER_XTABLES is not set
35846 +
35847 +#
35848 +# IP: Netfilter Configuration
35849 +#
35850 +# CONFIG_IP_NF_QUEUE is not set
35851 +# CONFIG_IP_NF_IPTABLES is not set
35852 +# CONFIG_IP_NF_ARPTABLES is not set
35853 +# CONFIG_IP_DCCP is not set
35854 +# CONFIG_IP_SCTP is not set
35855 +# CONFIG_TIPC is not set
35856 +# CONFIG_ATM is not set
35857 +# CONFIG_BRIDGE is not set
35858 +CONFIG_VLAN_8021Q=y
35859 +# CONFIG_DECNET is not set
35860 +# CONFIG_LLC2 is not set
35861 +# CONFIG_IPX is not set
35862 +# CONFIG_ATALK is not set
35863 +# CONFIG_X25 is not set
35864 +# CONFIG_LAPB is not set
35865 +# CONFIG_ECONET is not set
35866 +# CONFIG_WAN_ROUTER is not set
35867 +# CONFIG_NET_SCHED is not set
35868 +
35869 +#
35870 +# Network testing
35871 +#
35872 +# CONFIG_NET_PKTGEN is not set
35873 +# CONFIG_HAMRADIO is not set
35874 +# CONFIG_IRDA is not set
35875 +# CONFIG_BT is not set
35876 +# CONFIG_AF_RXRPC is not set
35877 +
35878 +#
35879 +# Wireless
35880 +#
35881 +# CONFIG_CFG80211 is not set
35882 +# CONFIG_WIRELESS_EXT is not set
35883 +# CONFIG_MAC80211 is not set
35884 +# CONFIG_IEEE80211 is not set
35885 +# CONFIG_RFKILL is not set
35886 +# CONFIG_NET_9P is not set
35887 +
35888 +#
35889 +# Device Drivers
35890 +#
35891 +
35892 +#
35893 +# Generic Driver Options
35894 +#
35895 +# CONFIG_STANDALONE is not set
35896 +CONFIG_PREVENT_FIRMWARE_BUILD=y
35897 +# CONFIG_DEBUG_DRIVER is not set
35898 +# CONFIG_DEBUG_DEVRES is not set
35899 +# CONFIG_SYS_HYPERVISOR is not set
35900 +# CONFIG_CONNECTOR is not set
35901 +CONFIG_MTD=y
35902 +# CONFIG_MTD_DEBUG is not set
35903 +# CONFIG_MTD_CONCAT is not set
35904 +CONFIG_MTD_PARTITIONS=y
35905 +# CONFIG_MTD_REDBOOT_PARTS is not set
35906 +# CONFIG_MTD_CMDLINE_PARTS is not set
35907 +
35908 +#
35909 +# User Modules And Translation Layers
35910 +#
35911 +CONFIG_MTD_CHAR=y
35912 +CONFIG_MTD_BLKDEVS=y
35913 +CONFIG_MTD_BLOCK=y
35914 +# CONFIG_FTL is not set
35915 +# CONFIG_NFTL is not set
35916 +# CONFIG_INFTL is not set
35917 +# CONFIG_RFD_FTL is not set
35918 +# CONFIG_SSFDC is not set
35919 +CONFIG_MTD_OOPS=m
35920 +
35921 +#
35922 +# RAM/ROM/Flash chip drivers
35923 +#
35924 +CONFIG_MTD_CFI=y
35925 +# CONFIG_MTD_JEDECPROBE is not set
35926 +CONFIG_MTD_GEN_PROBE=y
35927 +# CONFIG_MTD_CFI_ADV_OPTIONS is not set
35928 +CONFIG_MTD_MAP_BANK_WIDTH_1=y
35929 +CONFIG_MTD_MAP_BANK_WIDTH_2=y
35930 +CONFIG_MTD_MAP_BANK_WIDTH_4=y
35931 +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
35932 +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
35933 +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
35934 +CONFIG_MTD_CFI_I1=y
35935 +CONFIG_MTD_CFI_I2=y
35936 +# CONFIG_MTD_CFI_I4 is not set
35937 +# CONFIG_MTD_CFI_I8 is not set
35938 +# CONFIG_MTD_CFI_INTELEXT is not set
35939 +CONFIG_MTD_CFI_AMDSTD=y
35940 +# CONFIG_MTD_CFI_STAA is not set
35941 +CONFIG_MTD_CFI_UTIL=y
35942 +# CONFIG_MTD_RAM is not set
35943 +# CONFIG_MTD_ROM is not set
35944 +# CONFIG_MTD_ABSENT is not set
35945 +
35946 +#
35947 +# Mapping drivers for chip access
35948 +#
35949 +# CONFIG_MTD_COMPLEX_MAPPINGS is not set
35950 +# CONFIG_MTD_PHYSMAP is not set
35951 +CONFIG_MTD_PHYSMAP_OF=y
35952 +# CONFIG_MTD_PLATRAM is not set
35953 +
35954 +#
35955 +# Self-contained MTD device drivers
35956 +#
35957 +# CONFIG_MTD_SLRAM is not set
35958 +# CONFIG_MTD_PHRAM is not set
35959 +# CONFIG_MTD_MTDRAM is not set
35960 +# CONFIG_MTD_BLOCK2MTD is not set
35961 +
35962 +#
35963 +# Disk-On-Chip Device Drivers
35964 +#
35965 +# CONFIG_MTD_DOC2000 is not set
35966 +# CONFIG_MTD_DOC2001 is not set
35967 +# CONFIG_MTD_DOC2001PLUS is not set
35968 +CONFIG_MTD_NAND=y
35969 +# CONFIG_MTD_NAND_VERIFY_WRITE is not set
35970 +CONFIG_MTD_NAND_ECC_SMC=y
35971 +# CONFIG_MTD_NAND_MUSEUM_IDS is not set
35972 +CONFIG_MTD_NAND_IDS=y
35973 +CONFIG_MTD_NAND_NDFC=y
35974 +# CONFIG_MTD_NAND_DISKONCHIP is not set
35975 +# CONFIG_MTD_NAND_NANDSIM is not set
35976 +# CONFIG_MTD_NAND_PLATFORM is not set
35977 +# CONFIG_MTD_ALAUDA is not set
35978 +# CONFIG_MTD_ONENAND is not set
35979 +
35980 +#
35981 +# UBI - Unsorted block images
35982 +#
35983 +# CONFIG_MTD_UBI is not set
35984 +CONFIG_OF_DEVICE=y
35985 +# CONFIG_PARPORT is not set
35986 +CONFIG_BLK_DEV=y
35987 +# CONFIG_BLK_DEV_FD is not set
35988 +# CONFIG_BLK_DEV_COW_COMMON is not set
35989 +# CONFIG_BLK_DEV_LOOP is not set
35990 +# CONFIG_BLK_DEV_NBD is not set
35991 +# CONFIG_BLK_DEV_UB is not set
35992 +CONFIG_BLK_DEV_RAM=y
35993 +CONFIG_BLK_DEV_RAM_COUNT=16
35994 +CONFIG_BLK_DEV_RAM_SIZE=4096
35995 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
35996 +# CONFIG_CDROM_PKTCDVD is not set
35997 +# CONFIG_ATA_OVER_ETH is not set
35998 +# CONFIG_XILINX_SYSACE is not set
35999 +CONFIG_MISC_DEVICES=y
36000 +# CONFIG_EEPROM_93CX6 is not set
36001 +# CONFIG_IDE is not set
36002 +
36003 +#
36004 +# SCSI device support
36005 +#
36006 +# CONFIG_RAID_ATTRS is not set
36007 +CONFIG_SCSI=y
36008 +CONFIG_SCSI_DMA=y
36009 +# CONFIG_SCSI_TGT is not set
36010 +# CONFIG_SCSI_NETLINK is not set
36011 +CONFIG_SCSI_PROC_FS=y
36012 +
36013 +#
36014 +# SCSI support type (disk, tape, CD-ROM)
36015 +#
36016 +CONFIG_BLK_DEV_SD=y
36017 +# CONFIG_CHR_DEV_ST is not set
36018 +# CONFIG_CHR_DEV_OSST is not set
36019 +# CONFIG_BLK_DEV_SR is not set
36020 +# CONFIG_CHR_DEV_SG is not set
36021 +# CONFIG_CHR_DEV_SCH is not set
36022 +
36023 +#
36024 +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
36025 +#
36026 +# CONFIG_SCSI_MULTI_LUN is not set
36027 +# CONFIG_SCSI_CONSTANTS is not set
36028 +# CONFIG_SCSI_LOGGING is not set
36029 +# CONFIG_SCSI_SCAN_ASYNC is not set
36030 +# CONFIG_SCSI_WAIT_SCAN is not set
36031 +
36032 +#
36033 +# SCSI Transports
36034 +#
36035 +CONFIG_SCSI_SPI_ATTRS=y
36036 +# CONFIG_SCSI_FC_ATTRS is not set
36037 +# CONFIG_SCSI_ISCSI_ATTRS is not set
36038 +# CONFIG_SCSI_SAS_LIBSAS is not set
36039 +# CONFIG_SCSI_SRP_ATTRS is not set
36040 +# CONFIG_SCSI_LOWLEVEL is not set
36041 +# CONFIG_ATA is not set
36042 +# CONFIG_MD is not set
36043 +# CONFIG_MACINTOSH_DRIVERS is not set
36044 +CONFIG_NETDEVICES=y
36045 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
36046 +# CONFIG_DUMMY is not set
36047 +# CONFIG_BONDING is not set
36048 +# CONFIG_MACVLAN is not set
36049 +# CONFIG_EQUALIZER is not set
36050 +# CONFIG_TUN is not set
36051 +# CONFIG_VETH is not set
36052 +# CONFIG_PHYLIB is not set
36053 +CONFIG_NET_ETHERNET=y
36054 +CONFIG_MII=y
36055 +CONFIG_IBM_NEW_EMAC=y
36056 +CONFIG_IBM_NEW_EMAC_RXB=128
36057 +CONFIG_IBM_NEW_EMAC_TXB=64
36058 +CONFIG_IBM_NEW_EMAC_POLL_WEIGHT=32
36059 +CONFIG_IBM_NEW_EMAC_RX_COPY_THRESHOLD=256
36060 +CONFIG_IBM_NEW_EMAC_RX_SKB_HEADROOM=0
36061 +# CONFIG_IBM_NEW_EMAC_DEBUG is not set
36062 +CONFIG_IBM_NEW_EMAC_ZMII=y
36063 +# CONFIG_IBM_NEW_EMAC_RGMII is not set
36064 +# CONFIG_IBM_NEW_EMAC_TAH is not set
36065 +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
36066 +# CONFIG_B44 is not set
36067 +# CONFIG_NETDEV_1000 is not set
36068 +# CONFIG_NETDEV_10000 is not set
36069 +
36070 +#
36071 +# Wireless LAN
36072 +#
36073 +# CONFIG_WLAN_PRE80211 is not set
36074 +# CONFIG_WLAN_80211 is not set
36075 +
36076 +#
36077 +# USB Network Adapters
36078 +#
36079 +# CONFIG_USB_CATC is not set
36080 +# CONFIG_USB_KAWETH is not set
36081 +# CONFIG_USB_PEGASUS is not set
36082 +# CONFIG_USB_RTL8150 is not set
36083 +# CONFIG_USB_USBNET is not set
36084 +# CONFIG_WAN is not set
36085 +# CONFIG_PPP is not set
36086 +# CONFIG_SLIP is not set
36087 +# CONFIG_SHAPER is not set
36088 +# CONFIG_NETCONSOLE is not set
36089 +# CONFIG_NETPOLL is not set
36090 +# CONFIG_NET_POLL_CONTROLLER is not set
36091 +# CONFIG_ISDN is not set
36092 +# CONFIG_PHONE is not set
36093 +
36094 +#
36095 +# Input device support
36096 +#
36097 +# CONFIG_INPUT is not set
36098 +
36099 +#
36100 +# Hardware I/O ports
36101 +#
36102 +# CONFIG_SERIO is not set
36103 +# CONFIG_GAMEPORT is not set
36104 +
36105 +#
36106 +# Character devices
36107 +#
36108 +# CONFIG_VT is not set
36109 +# CONFIG_SERIAL_NONSTANDARD is not set
36110 +
36111 +#
36112 +# Serial drivers
36113 +#
36114 +CONFIG_SERIAL_8250=y
36115 +CONFIG_SERIAL_8250_CONSOLE=y
36116 +CONFIG_SERIAL_8250_NR_UARTS=4
36117 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4
36118 +CONFIG_SERIAL_8250_EXTENDED=y
36119 +# CONFIG_SERIAL_8250_MANY_PORTS is not set
36120 +CONFIG_SERIAL_8250_SHARE_IRQ=y
36121 +# CONFIG_SERIAL_8250_DETECT_IRQ is not set
36122 +# CONFIG_SERIAL_8250_RSA is not set
36123 +
36124 +#
36125 +# Non-8250 serial port support
36126 +#
36127 +# CONFIG_SERIAL_UARTLITE is not set
36128 +CONFIG_SERIAL_CORE=y
36129 +CONFIG_SERIAL_CORE_CONSOLE=y
36130 +# CONFIG_SERIAL_OF_PLATFORM is not set
36131 +CONFIG_UNIX98_PTYS=y
36132 +CONFIG_LEGACY_PTYS=y
36133 +CONFIG_LEGACY_PTY_COUNT=256
36134 +# CONFIG_IPMI_HANDLER is not set
36135 +CONFIG_HW_RANDOM=y
36136 +# CONFIG_NVRAM is not set
36137 +# CONFIG_GEN_RTC is not set
36138 +# CONFIG_R3964 is not set
36139 +# CONFIG_RAW_DRIVER is not set
36140 +# CONFIG_TCG_TPM is not set
36141 +CONFIG_I2C=y
36142 +CONFIG_I2C_BOARDINFO=y
36143 +# CONFIG_I2C_CHARDEV is not set
36144 +
36145 +#
36146 +# I2C Algorithms
36147 +#
36148 +# CONFIG_I2C_ALGOBIT is not set
36149 +# CONFIG_I2C_ALGOPCF is not set
36150 +# CONFIG_I2C_ALGOPCA is not set
36151 +
36152 +#
36153 +# I2C Hardware Bus support
36154 +#
36155 +CONFIG_I2C_IBM_IIC=y
36156 +# CONFIG_I2C_MPC is not set
36157 +# CONFIG_I2C_OCORES is not set
36158 +# CONFIG_I2C_PARPORT_LIGHT is not set
36159 +# CONFIG_I2C_SIMTEC is not set
36160 +# CONFIG_I2C_TAOS_EVM is not set
36161 +# CONFIG_I2C_STUB is not set
36162 +# CONFIG_I2C_TINY_USB is not set
36163 +
36164 +#
36165 +# Miscellaneous I2C Chip support
36166 +#
36167 +# CONFIG_SENSORS_DS1337 is not set
36168 +# CONFIG_SENSORS_DS1374 is not set
36169 +# CONFIG_DS1682 is not set
36170 +CONFIG_SENSORS_EEPROM=y
36171 +# CONFIG_SENSORS_PCF8574 is not set
36172 +# CONFIG_SENSORS_PCA9539 is not set
36173 +# CONFIG_SENSORS_PCF8591 is not set
36174 +# CONFIG_SENSORS_M41T00 is not set
36175 +# CONFIG_SENSORS_MAX6875 is not set
36176 +# CONFIG_SENSORS_TSL2550 is not set
36177 +# CONFIG_I2C_DEBUG_CORE is not set
36178 +# CONFIG_I2C_DEBUG_ALGO is not set
36179 +# CONFIG_I2C_DEBUG_BUS is not set
36180 +# CONFIG_I2C_DEBUG_CHIP is not set
36181 +
36182 +#
36183 +# SPI support
36184 +#
36185 +# CONFIG_SPI is not set
36186 +# CONFIG_SPI_MASTER is not set
36187 +# CONFIG_W1 is not set
36188 +# CONFIG_POWER_SUPPLY is not set
36189 +CONFIG_HWMON=y
36190 +# CONFIG_HWMON_VID is not set
36191 +CONFIG_SENSORS_AD7414=y
36192 +# CONFIG_SENSORS_AD7418 is not set
36193 +# CONFIG_SENSORS_ADM1021 is not set
36194 +# CONFIG_SENSORS_ADM1025 is not set
36195 +# CONFIG_SENSORS_ADM1026 is not set
36196 +# CONFIG_SENSORS_ADM1029 is not set
36197 +# CONFIG_SENSORS_ADM1031 is not set
36198 +# CONFIG_SENSORS_ADM9240 is not set
36199 +# CONFIG_SENSORS_ADT7470 is not set
36200 +# CONFIG_SENSORS_ATXP1 is not set
36201 +# CONFIG_SENSORS_DS1621 is not set
36202 +# CONFIG_SENSORS_F71805F is not set
36203 +# CONFIG_SENSORS_F71882FG is not set
36204 +# CONFIG_SENSORS_F75375S is not set
36205 +# CONFIG_SENSORS_GL518SM is not set
36206 +# CONFIG_SENSORS_GL520SM is not set
36207 +# CONFIG_SENSORS_IT87 is not set
36208 +# CONFIG_SENSORS_LM63 is not set
36209 +# CONFIG_SENSORS_LM75 is not set
36210 +# CONFIG_SENSORS_LM77 is not set
36211 +# CONFIG_SENSORS_LM78 is not set
36212 +# CONFIG_SENSORS_LM80 is not set
36213 +# CONFIG_SENSORS_LM83 is not set
36214 +# CONFIG_SENSORS_LM85 is not set
36215 +# CONFIG_SENSORS_LM87 is not set
36216 +# CONFIG_SENSORS_LM90 is not set
36217 +# CONFIG_SENSORS_LM92 is not set
36218 +# CONFIG_SENSORS_LM93 is not set
36219 +# CONFIG_SENSORS_MAX1619 is not set
36220 +# CONFIG_SENSORS_MAX6650 is not set
36221 +# CONFIG_SENSORS_PC87360 is not set
36222 +# CONFIG_SENSORS_PC87427 is not set
36223 +# CONFIG_SENSORS_DME1737 is not set
36224 +# CONFIG_SENSORS_SMSC47M1 is not set
36225 +# CONFIG_SENSORS_SMSC47M192 is not set
36226 +# CONFIG_SENSORS_SMSC47B397 is not set
36227 +# CONFIG_SENSORS_THMC50 is not set
36228 +# CONFIG_SENSORS_VT1211 is not set
36229 +# CONFIG_SENSORS_W83781D is not set
36230 +# CONFIG_SENSORS_W83791D is not set
36231 +# CONFIG_SENSORS_W83792D is not set
36232 +# CONFIG_SENSORS_W83793 is not set
36233 +# CONFIG_SENSORS_W83L785TS is not set
36234 +# CONFIG_SENSORS_W83627HF is not set
36235 +# CONFIG_SENSORS_W83627EHF is not set
36236 +# CONFIG_HWMON_DEBUG_CHIP is not set
36237 +# CONFIG_WATCHDOG is not set
36238 +
36239 +#
36240 +# Sonics Silicon Backplane
36241 +#
36242 +CONFIG_SSB_POSSIBLE=y
36243 +# CONFIG_SSB is not set
36244 +
36245 +#
36246 +# Multifunction device drivers
36247 +#
36248 +# CONFIG_MFD_SM501 is not set
36249 +
36250 +#
36251 +# Multimedia devices
36252 +#
36253 +# CONFIG_VIDEO_DEV is not set
36254 +# CONFIG_DVB_CORE is not set
36255 +# CONFIG_DAB is not set
36256 +
36257 +#
36258 +# Graphics support
36259 +#
36260 +# CONFIG_VGASTATE is not set
36261 +# CONFIG_VIDEO_OUTPUT_CONTROL is not set
36262 +# CONFIG_FB is not set
36263 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
36264 +
36265 +#
36266 +# Display device support
36267 +#
36268 +# CONFIG_DISPLAY_SUPPORT is not set
36269 +
36270 +#
36271 +# Sound
36272 +#
36273 +# CONFIG_SOUND is not set
36274 +CONFIG_USB_SUPPORT=y
36275 +CONFIG_USB_ARCH_HAS_HCD=y
36276 +CONFIG_USB_ARCH_HAS_OHCI=y
36277 +# CONFIG_USB_ARCH_HAS_EHCI is not set
36278 +CONFIG_USB=y
36279 +# CONFIG_USB_DEBUG is not set
36280 +
36281 +#
36282 +# Miscellaneous USB options
36283 +#
36284 +# CONFIG_USB_DEVICEFS is not set
36285 +CONFIG_USB_DEVICE_CLASS=y
36286 +# CONFIG_USB_DYNAMIC_MINORS is not set
36287 +# CONFIG_USB_OTG is not set
36288 +
36289 +#
36290 +# USB Host Controller Drivers
36291 +#
36292 +# CONFIG_USB_ISP116X_HCD is not set
36293 +CONFIG_USB_OHCI_HCD=y
36294 +CONFIG_USB_OHCI_HCD_PPC_OF=y
36295 +CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
36296 +# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
36297 +CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
36298 +CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
36299 +CONFIG_USB_OHCI_LITTLE_ENDIAN=y
36300 +# CONFIG_USB_SL811_HCD is not set
36301 +# CONFIG_USB_R8A66597_HCD is not set
36302 +
36303 +#
36304 +# USB Device Class drivers
36305 +#
36306 +# CONFIG_USB_ACM is not set
36307 +# CONFIG_USB_PRINTER is not set
36308 +
36309 +#
36310 +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
36311 +#
36312 +
36313 +#
36314 +# may also be needed; see USB_STORAGE Help for more information
36315 +#
36316 +CONFIG_USB_STORAGE=y
36317 +# CONFIG_USB_STORAGE_DEBUG is not set
36318 +# CONFIG_USB_STORAGE_DATAFAB is not set
36319 +# CONFIG_USB_STORAGE_FREECOM is not set
36320 +# CONFIG_USB_STORAGE_ISD200 is not set
36321 +# CONFIG_USB_STORAGE_DPCM is not set
36322 +# CONFIG_USB_STORAGE_USBAT is not set
36323 +# CONFIG_USB_STORAGE_SDDR09 is not set
36324 +# CONFIG_USB_STORAGE_SDDR55 is not set
36325 +# CONFIG_USB_STORAGE_JUMPSHOT is not set
36326 +# CONFIG_USB_STORAGE_ALAUDA is not set
36327 +# CONFIG_USB_STORAGE_KARMA is not set
36328 +# CONFIG_USB_LIBUSUAL is not set
36329 +
36330 +#
36331 +# USB Imaging devices
36332 +#
36333 +# CONFIG_USB_MDC800 is not set
36334 +# CONFIG_USB_MICROTEK is not set
36335 +CONFIG_USB_MON=y
36336 +
36337 +#
36338 +# USB port drivers
36339 +#
36340 +
36341 +#
36342 +# USB Serial Converter support
36343 +#
36344 +# CONFIG_USB_SERIAL is not set
36345 +
36346 +#
36347 +# USB Miscellaneous drivers
36348 +#
36349 +# CONFIG_USB_EMI62 is not set
36350 +# CONFIG_USB_EMI26 is not set
36351 +# CONFIG_USB_ADUTUX is not set
36352 +# CONFIG_USB_AUERSWALD is not set
36353 +# CONFIG_USB_RIO500 is not set
36354 +# CONFIG_USB_LEGOTOWER is not set
36355 +# CONFIG_USB_LCD is not set
36356 +# CONFIG_USB_BERRY_CHARGE is not set
36357 +# CONFIG_USB_LED is not set
36358 +# CONFIG_USB_CYPRESS_CY7C63 is not set
36359 +# CONFIG_USB_CYTHERM is not set
36360 +# CONFIG_USB_PHIDGET is not set
36361 +# CONFIG_USB_IDMOUSE is not set
36362 +# CONFIG_USB_FTDI_ELAN is not set
36363 +# CONFIG_USB_APPLEDISPLAY is not set
36364 +# CONFIG_USB_LD is not set
36365 +# CONFIG_USB_TRANCEVIBRATOR is not set
36366 +# CONFIG_USB_IOWARRIOR is not set
36367 +
36368 +#
36369 +# USB DSL modem support
36370 +#
36371 +
36372 +#
36373 +# USB Gadget Support
36374 +#
36375 +# CONFIG_USB_GADGET is not set
36376 +CONFIG_MMC=m
36377 +# CONFIG_MMC_DEBUG is not set
36378 +# CONFIG_MMC_UNSAFE_RESUME is not set
36379 +
36380 +#
36381 +# MMC/SD Card Drivers
36382 +#
36383 +CONFIG_MMC_BLOCK=m
36384 +CONFIG_MMC_BLOCK_BOUNCE=y
36385 +# CONFIG_SDIO_UART is not set
36386 +
36387 +#
36388 +# MMC/SD Host Controller Drivers
36389 +#
36390 +# CONFIG_MMC_WBSD is not set
36391 +# CONFIG_NEW_LEDS is not set
36392 +# CONFIG_EDAC is not set
36393 +# CONFIG_RTC_CLASS is not set
36394 +
36395 +#
36396 +# Userspace I/O
36397 +#
36398 +# CONFIG_UIO is not set
36399 +
36400 +#
36401 +# File systems
36402 +#
36403 +CONFIG_EXT2_FS=y
36404 +# CONFIG_EXT2_FS_XATTR is not set
36405 +# CONFIG_EXT2_FS_XIP is not set
36406 +# CONFIG_EXT3_FS is not set
36407 +# CONFIG_EXT4DEV_FS is not set
36408 +# CONFIG_REISERFS_FS is not set
36409 +# CONFIG_JFS_FS is not set
36410 +# CONFIG_FS_POSIX_ACL is not set
36411 +# CONFIG_XFS_FS is not set
36412 +# CONFIG_GFS2_FS is not set
36413 +# CONFIG_OCFS2_FS is not set
36414 +# CONFIG_MINIX_FS is not set
36415 +# CONFIG_ROMFS_FS is not set
36416 +CONFIG_INOTIFY=y
36417 +CONFIG_INOTIFY_USER=y
36418 +# CONFIG_QUOTA is not set
36419 +CONFIG_DNOTIFY=y
36420 +# CONFIG_AUTOFS_FS is not set
36421 +# CONFIG_AUTOFS4_FS is not set
36422 +# CONFIG_FUSE_FS is not set
36423 +
36424 +#
36425 +# CD-ROM/DVD Filesystems
36426 +#
36427 +# CONFIG_ISO9660_FS is not set
36428 +# CONFIG_UDF_FS is not set
36429 +
36430 +#
36431 +# DOS/FAT/NT Filesystems
36432 +#
36433 +CONFIG_FAT_FS=y
36434 +CONFIG_MSDOS_FS=y
36435 +CONFIG_VFAT_FS=y
36436 +CONFIG_FAT_DEFAULT_CODEPAGE=437
36437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
36438 +# CONFIG_NTFS_FS is not set
36439 +
36440 +#
36441 +# Pseudo filesystems
36442 +#
36443 +CONFIG_PROC_FS=y
36444 +CONFIG_PROC_KCORE=y
36445 +CONFIG_PROC_SYSCTL=y
36446 +CONFIG_SYSFS=y
36447 +# CONFIG_TMPFS is not set
36448 +# CONFIG_HUGETLB_PAGE is not set
36449 +# CONFIG_CONFIGFS_FS is not set
36450 +
36451 +#
36452 +# Miscellaneous filesystems
36453 +#
36454 +# CONFIG_ADFS_FS is not set
36455 +# CONFIG_AFFS_FS is not set
36456 +# CONFIG_HFS_FS is not set
36457 +# CONFIG_HFSPLUS_FS is not set
36458 +# CONFIG_BEFS_FS is not set
36459 +# CONFIG_BFS_FS is not set
36460 +# CONFIG_EFS_FS is not set
36461 +CONFIG_JFFS2_FS=y
36462 +CONFIG_JFFS2_FS_DEBUG=0
36463 +CONFIG_JFFS2_FS_WRITEBUFFER=y
36464 +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
36465 +# CONFIG_JFFS2_SUMMARY is not set
36466 +# CONFIG_JFFS2_FS_XATTR is not set
36467 +# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
36468 +CONFIG_JFFS2_ZLIB=y
36469 +# CONFIG_JFFS2_LZO is not set
36470 +CONFIG_JFFS2_RTIME=y
36471 +# CONFIG_JFFS2_RUBIN is not set
36472 +CONFIG_CRAMFS=y
36473 +# CONFIG_VXFS_FS is not set
36474 +# CONFIG_HPFS_FS is not set
36475 +# CONFIG_QNX4FS_FS is not set
36476 +# CONFIG_SYSV_FS is not set
36477 +# CONFIG_UFS_FS is not set
36478 +CONFIG_NETWORK_FILESYSTEMS=y
36479 +CONFIG_NFS_FS=y
36480 +CONFIG_NFS_V3=y
36481 +# CONFIG_NFS_V3_ACL is not set
36482 +# CONFIG_NFS_V4 is not set
36483 +# CONFIG_NFS_DIRECTIO is not set
36484 +# CONFIG_NFSD is not set
36485 +CONFIG_ROOT_NFS=y
36486 +CONFIG_LOCKD=y
36487 +CONFIG_LOCKD_V4=y
36488 +CONFIG_NFS_COMMON=y
36489 +CONFIG_SUNRPC=y
36490 +# CONFIG_SUNRPC_BIND34 is not set
36491 +# CONFIG_RPCSEC_GSS_KRB5 is not set
36492 +# CONFIG_RPCSEC_GSS_SPKM3 is not set
36493 +# CONFIG_SMB_FS is not set
36494 +# CONFIG_CIFS is not set
36495 +# CONFIG_NCP_FS is not set
36496 +# CONFIG_CODA_FS is not set
36497 +# CONFIG_AFS_FS is not set
36498 +
36499 +#
36500 +# Partition Types
36501 +#
36502 +# CONFIG_PARTITION_ADVANCED is not set
36503 +CONFIG_MSDOS_PARTITION=y
36504 +CONFIG_NLS=y
36505 +CONFIG_NLS_DEFAULT="iso8859-1"
36506 +CONFIG_NLS_CODEPAGE_437=y
36507 +# CONFIG_NLS_CODEPAGE_737 is not set
36508 +# CONFIG_NLS_CODEPAGE_775 is not set
36509 +CONFIG_NLS_CODEPAGE_850=y
36510 +# CONFIG_NLS_CODEPAGE_852 is not set
36511 +# CONFIG_NLS_CODEPAGE_855 is not set
36512 +# CONFIG_NLS_CODEPAGE_857 is not set
36513 +# CONFIG_NLS_CODEPAGE_860 is not set
36514 +# CONFIG_NLS_CODEPAGE_861 is not set
36515 +# CONFIG_NLS_CODEPAGE_862 is not set
36516 +# CONFIG_NLS_CODEPAGE_863 is not set
36517 +# CONFIG_NLS_CODEPAGE_864 is not set
36518 +# CONFIG_NLS_CODEPAGE_865 is not set
36519 +# CONFIG_NLS_CODEPAGE_866 is not set
36520 +# CONFIG_NLS_CODEPAGE_869 is not set
36521 +# CONFIG_NLS_CODEPAGE_936 is not set
36522 +# CONFIG_NLS_CODEPAGE_950 is not set
36523 +# CONFIG_NLS_CODEPAGE_932 is not set
36524 +# CONFIG_NLS_CODEPAGE_949 is not set
36525 +# CONFIG_NLS_CODEPAGE_874 is not set
36526 +# CONFIG_NLS_ISO8859_8 is not set
36527 +# CONFIG_NLS_CODEPAGE_1250 is not set
36528 +# CONFIG_NLS_CODEPAGE_1251 is not set
36529 +CONFIG_NLS_ASCII=y
36530 +CONFIG_NLS_ISO8859_1=y
36531 +# CONFIG_NLS_ISO8859_2 is not set
36532 +# CONFIG_NLS_ISO8859_3 is not set
36533 +# CONFIG_NLS_ISO8859_4 is not set
36534 +# CONFIG_NLS_ISO8859_5 is not set
36535 +# CONFIG_NLS_ISO8859_6 is not set
36536 +# CONFIG_NLS_ISO8859_7 is not set
36537 +# CONFIG_NLS_ISO8859_9 is not set
36538 +# CONFIG_NLS_ISO8859_13 is not set
36539 +# CONFIG_NLS_ISO8859_14 is not set
36540 +CONFIG_NLS_ISO8859_15=y
36541 +# CONFIG_NLS_KOI8_R is not set
36542 +# CONFIG_NLS_KOI8_U is not set
36543 +CONFIG_NLS_UTF8=y
36544 +# CONFIG_DLM is not set
36545 +# CONFIG_UCC_SLOW is not set
36546 +
36547 +#
36548 +# Library routines
36549 +#
36550 +CONFIG_BITREVERSE=y
36551 +CONFIG_CRC_CCITT=y
36552 +# CONFIG_CRC16 is not set
36553 +# CONFIG_CRC_ITU_T is not set
36554 +CONFIG_CRC32=y
36555 +# CONFIG_CRC7 is not set
36556 +# CONFIG_LIBCRC32C is not set
36557 +CONFIG_ZLIB_INFLATE=y
36558 +CONFIG_ZLIB_DEFLATE=y
36559 +CONFIG_PLIST=y
36560 +CONFIG_HAS_IOMEM=y
36561 +CONFIG_HAS_IOPORT=y
36562 +CONFIG_HAS_DMA=y
36563 +# CONFIG_INSTRUMENTATION is not set
36564 +
36565 +#
36566 +# Kernel hacking
36567 +#
36568 +# CONFIG_PRINTK_TIME is not set
36569 +CONFIG_ENABLE_WARN_DEPRECATED=y
36570 +CONFIG_ENABLE_MUST_CHECK=y
36571 +CONFIG_MAGIC_SYSRQ=y
36572 +# CONFIG_UNUSED_SYMBOLS is not set
36573 +# CONFIG_DEBUG_FS is not set
36574 +# CONFIG_HEADERS_CHECK is not set
36575 +CONFIG_DEBUG_KERNEL=y
36576 +# CONFIG_DEBUG_SHIRQ is not set
36577 +CONFIG_DETECT_SOFTLOCKUP=y
36578 +# CONFIG_SCHED_DEBUG is not set
36579 +# CONFIG_SCHEDSTATS is not set
36580 +# CONFIG_TIMER_STATS is not set
36581 +# CONFIG_DEBUG_SLAB is not set
36582 +# CONFIG_DEBUG_RT_MUTEXES is not set
36583 +# CONFIG_RT_MUTEX_TESTER is not set
36584 +# CONFIG_DEBUG_SPINLOCK is not set
36585 +# CONFIG_DEBUG_MUTEXES is not set
36586 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
36587 +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
36588 +# CONFIG_DEBUG_KOBJECT is not set
36589 +# CONFIG_DEBUG_BUGVERBOSE is not set
36590 +CONFIG_DEBUG_INFO=y
36591 +# CONFIG_DEBUG_VM is not set
36592 +# CONFIG_DEBUG_LIST is not set
36593 +# CONFIG_DEBUG_SG is not set
36594 +CONFIG_FORCED_INLINING=y
36595 +# CONFIG_BOOT_PRINTK_DELAY is not set
36596 +# CONFIG_RCU_TORTURE_TEST is not set
36597 +# CONFIG_FAULT_INJECTION is not set
36598 +# CONFIG_SAMPLES is not set
36599 +# CONFIG_DEBUG_STACKOVERFLOW is not set
36600 +# CONFIG_DEBUG_STACK_USAGE is not set
36601 +# CONFIG_DEBUG_PAGEALLOC is not set
36602 +# CONFIG_DEBUGGER is not set
36603 +CONFIG_BDI_SWITCH=y
36604 +# CONFIG_PPC_EARLY_DEBUG is not set
36605 +
36606 +#
36607 +# Security options
36608 +#
36609 +# CONFIG_KEYS is not set
36610 +# CONFIG_SECURITY is not set
36611 +# CONFIG_SECURITY_FILE_CAPABILITIES is not set
36612 +# CONFIG_CRYPTO is not set
36613 +# CONFIG_PPC_CLOCK is not set
36614 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/Makefile powerpc.git/arch/powerpc/kernel/Makefile
36615 --- linux-2.6.24/arch/powerpc/kernel/Makefile   2008-01-24 23:58:37.000000000 +0100
36616 +++ powerpc.git/arch/powerpc/kernel/Makefile    2008-01-28 20:25:49.000000000 +0100
36617 @@ -3,7 +3,7 @@
36618  #
36619  
36620  ifeq ($(CONFIG_PPC64),y)
36621 -EXTRA_CFLAGS   += -mno-minimal-toc
36622 +CFLAGS_prom_init.o     += -mno-minimal-toc
36623  endif
36624  ifeq ($(CONFIG_PPC32),y)
36625  CFLAGS_prom_init.o      += -fPIC
36626 @@ -70,6 +70,7 @@
36627  obj-$(CONFIG_PCI)              += pci_$(CONFIG_WORD_SIZE).o $(pci64-y) \
36628                                    pci-common.o
36629  obj-$(CONFIG_PCI_MSI)          += msi.o
36630 +obj-$(CONFIG_RAPIDIO)          += rio.o
36631  obj-$(CONFIG_KEXEC)            += machine_kexec.o crash.o \
36632                                    machine_kexec_$(CONFIG_WORD_SIZE).o
36633  obj-$(CONFIG_AUDIT)            += audit.o
36634 @@ -91,3 +92,13 @@
36635  
36636  extra-$(CONFIG_PPC_FPU)                += fpu.o
36637  extra-$(CONFIG_PPC64)          += entry_64.o
36638 +
36639 +extra-y                                += systbl_chk.i
36640 +$(obj)/systbl.o:               systbl_chk
36641 +
36642 +quiet_cmd_systbl_chk = CALL    $<
36643 +      cmd_systbl_chk = $(CONFIG_SHELL) $< $(obj)/systbl_chk.i
36644 +
36645 +PHONY += systbl_chk
36646 +systbl_chk: $(src)/systbl_chk.sh $(obj)/systbl_chk.i
36647 +       $(call cmd,systbl_chk)
36648 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/btext.c powerpc.git/arch/powerpc/kernel/btext.c
36649 --- linux-2.6.24/arch/powerpc/kernel/btext.c    2008-01-24 23:58:37.000000000 +0100
36650 +++ powerpc.git/arch/powerpc/kernel/btext.c     2008-01-28 20:25:49.000000000 +0100
36651 @@ -236,7 +236,7 @@
36652         if (rc == 0 || !allow_nonstdout)
36653                 return rc;
36654  
36655 -       for (np = NULL; (np = of_find_node_by_type(np, "display"));) {
36656 +       for_each_node_by_type(np, "display") {
36657                 if (of_get_property(np, "linux,opened", NULL)) {
36658                         printk("trying %s ...\n", np->full_name);
36659                         rc = btext_initialize(np);
36660 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/cpu_setup_44x.S powerpc.git/arch/powerpc/kernel/cpu_setup_44x.S
36661 --- linux-2.6.24/arch/powerpc/kernel/cpu_setup_44x.S    2008-01-24 23:58:37.000000000 +0100
36662 +++ powerpc.git/arch/powerpc/kernel/cpu_setup_44x.S     2008-01-28 20:25:49.000000000 +0100
36663 @@ -23,11 +23,24 @@
36664         mflr    r4
36665         bl      __init_fpu_44x
36666         bl      __plb_disable_wrp
36667 +       bl      __fixup_440A_mcheck
36668         mtlr    r4
36669         blr
36670  _GLOBAL(__setup_cpu_440grx)
36671 -       b       __plb_disable_wrp
36672 +       mflr    r4
36673 +       bl      __plb_disable_wrp
36674 +       bl      __fixup_440A_mcheck
36675 +       mtlr    r4
36676 +       blr
36677 +_GLOBAL(__setup_cpu_440gx)
36678 +_GLOBAL(__setup_cpu_440spe)
36679 +       b       __fixup_440A_mcheck
36680  
36681 + /* Temporary fixup for arch/ppc until we kill the whole thing */
36682 +#ifndef CONFIG_PPC_MERGE
36683 +_GLOBAL(__fixup_440A_mcheck)
36684 +       blr
36685 +#endif
36686  
36687  /* enable APU between CPU and FPU */
36688  _GLOBAL(__init_fpu_44x)
36689 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/cputable.c powerpc.git/arch/powerpc/kernel/cputable.c
36690 --- linux-2.6.24/arch/powerpc/kernel/cputable.c 2008-01-24 23:58:37.000000000 +0100
36691 +++ powerpc.git/arch/powerpc/kernel/cputable.c  2008-01-28 20:25:49.000000000 +0100
36692 @@ -33,7 +33,9 @@
36693  #ifdef CONFIG_PPC32
36694  extern void __setup_cpu_440ep(unsigned long offset, struct cpu_spec* spec);
36695  extern void __setup_cpu_440epx(unsigned long offset, struct cpu_spec* spec);
36696 +extern void __setup_cpu_440gx(unsigned long offset, struct cpu_spec* spec);
36697  extern void __setup_cpu_440grx(unsigned long offset, struct cpu_spec* spec);
36698 +extern void __setup_cpu_440spe(unsigned long offset, struct cpu_spec* spec);
36699  extern void __setup_cpu_603(unsigned long offset, struct cpu_spec* spec);
36700  extern void __setup_cpu_604(unsigned long offset, struct cpu_spec* spec);
36701  extern void __setup_cpu_750(unsigned long offset, struct cpu_spec* spec);
36702 @@ -85,6 +87,7 @@
36703                 .pmc_type               = PPC_PMC_IBM,
36704                 .oprofile_cpu_type      = "ppc64/power3",
36705                 .oprofile_type          = PPC_OPROFILE_RS64,
36706 +               .machine_check          = machine_check_generic,
36707                 .platform               = "power3",
36708         },
36709         {       /* Power3+ */
36710 @@ -99,6 +102,7 @@
36711                 .pmc_type               = PPC_PMC_IBM,
36712                 .oprofile_cpu_type      = "ppc64/power3",
36713                 .oprofile_type          = PPC_OPROFILE_RS64,
36714 +               .machine_check          = machine_check_generic,
36715                 .platform               = "power3",
36716         },
36717         {       /* Northstar */
36718 @@ -113,6 +117,7 @@
36719                 .pmc_type               = PPC_PMC_IBM,
36720                 .oprofile_cpu_type      = "ppc64/rs64",
36721                 .oprofile_type          = PPC_OPROFILE_RS64,
36722 +               .machine_check          = machine_check_generic,
36723                 .platform               = "rs64",
36724         },
36725         {       /* Pulsar */
36726 @@ -127,6 +132,7 @@
36727                 .pmc_type               = PPC_PMC_IBM,
36728                 .oprofile_cpu_type      = "ppc64/rs64",
36729                 .oprofile_type          = PPC_OPROFILE_RS64,
36730 +               .machine_check          = machine_check_generic,
36731                 .platform               = "rs64",
36732         },
36733         {       /* I-star */
36734 @@ -141,6 +147,7 @@
36735                 .pmc_type               = PPC_PMC_IBM,
36736                 .oprofile_cpu_type      = "ppc64/rs64",
36737                 .oprofile_type          = PPC_OPROFILE_RS64,
36738 +               .machine_check          = machine_check_generic,
36739                 .platform               = "rs64",
36740         },
36741         {       /* S-star */
36742 @@ -155,6 +162,7 @@
36743                 .pmc_type               = PPC_PMC_IBM,
36744                 .oprofile_cpu_type      = "ppc64/rs64",
36745                 .oprofile_type          = PPC_OPROFILE_RS64,
36746 +               .machine_check          = machine_check_generic,
36747                 .platform               = "rs64",
36748         },
36749         {       /* Power4 */
36750 @@ -169,6 +177,7 @@
36751                 .pmc_type               = PPC_PMC_IBM,
36752                 .oprofile_cpu_type      = "ppc64/power4",
36753                 .oprofile_type          = PPC_OPROFILE_POWER4,
36754 +               .machine_check          = machine_check_generic,
36755                 .platform               = "power4",
36756         },
36757         {       /* Power4+ */
36758 @@ -183,6 +192,7 @@
36759                 .pmc_type               = PPC_PMC_IBM,
36760                 .oprofile_cpu_type      = "ppc64/power4",
36761                 .oprofile_type          = PPC_OPROFILE_POWER4,
36762 +               .machine_check          = machine_check_generic,
36763                 .platform               = "power4",
36764         },
36765         {       /* PPC970 */
36766 @@ -200,6 +210,7 @@
36767                 .cpu_restore            = __restore_cpu_ppc970,
36768                 .oprofile_cpu_type      = "ppc64/970",
36769                 .oprofile_type          = PPC_OPROFILE_POWER4,
36770 +               .machine_check          = machine_check_generic,
36771                 .platform               = "ppc970",
36772         },
36773         {       /* PPC970FX */
36774 @@ -217,6 +228,7 @@
36775                 .cpu_restore            = __restore_cpu_ppc970,
36776                 .oprofile_cpu_type      = "ppc64/970",
36777                 .oprofile_type          = PPC_OPROFILE_POWER4,
36778 +               .machine_check          = machine_check_generic,
36779                 .platform               = "ppc970",
36780         },
36781         {       /* PPC970MP DD1.0 - no DEEPNAP, use regular 970 init */
36782 @@ -234,6 +246,7 @@
36783                 .cpu_restore            = __restore_cpu_ppc970,
36784                 .oprofile_cpu_type      = "ppc64/970MP",
36785                 .oprofile_type          = PPC_OPROFILE_POWER4,
36786 +               .machine_check          = machine_check_generic,
36787                 .platform               = "ppc970",
36788         },
36789         {       /* PPC970MP */
36790 @@ -251,6 +264,7 @@
36791                 .cpu_restore            = __restore_cpu_ppc970,
36792                 .oprofile_cpu_type      = "ppc64/970MP",
36793                 .oprofile_type          = PPC_OPROFILE_POWER4,
36794 +               .machine_check          = machine_check_generic,
36795                 .platform               = "ppc970",
36796         },
36797         {       /* PPC970GX */
36798 @@ -267,6 +281,7 @@
36799                 .cpu_setup              = __setup_cpu_ppc970,
36800                 .oprofile_cpu_type      = "ppc64/970",
36801                 .oprofile_type          = PPC_OPROFILE_POWER4,
36802 +               .machine_check          = machine_check_generic,
36803                 .platform               = "ppc970",
36804         },
36805         {       /* Power5 GR */
36806 @@ -286,6 +301,7 @@
36807                  */
36808                 .oprofile_mmcra_sihv    = MMCRA_SIHV,
36809                 .oprofile_mmcra_sipr    = MMCRA_SIPR,
36810 +               .machine_check          = machine_check_generic,
36811                 .platform               = "power5",
36812         },
36813         {       /* Power5++ */
36814 @@ -301,6 +317,7 @@
36815                 .oprofile_type          = PPC_OPROFILE_POWER4,
36816                 .oprofile_mmcra_sihv    = MMCRA_SIHV,
36817                 .oprofile_mmcra_sipr    = MMCRA_SIPR,
36818 +               .machine_check          = machine_check_generic,
36819                 .platform               = "power5+",
36820         },
36821         {       /* Power5 GS */
36822 @@ -317,6 +334,7 @@
36823                 .oprofile_type          = PPC_OPROFILE_POWER4,
36824                 .oprofile_mmcra_sihv    = MMCRA_SIHV,
36825                 .oprofile_mmcra_sipr    = MMCRA_SIPR,
36826 +               .machine_check          = machine_check_generic,
36827                 .platform               = "power5+",
36828         },
36829         {       /* POWER6 in P5+ mode; 2.04-compliant processor */
36830 @@ -327,6 +345,7 @@
36831                 .cpu_user_features      = COMMON_USER_POWER5_PLUS,
36832                 .icache_bsize           = 128,
36833                 .dcache_bsize           = 128,
36834 +               .machine_check          = machine_check_generic,
36835                 .platform               = "power5+",
36836         },
36837         {       /* Power6 */
36838 @@ -346,6 +365,7 @@
36839                 .oprofile_mmcra_sipr    = POWER6_MMCRA_SIPR,
36840                 .oprofile_mmcra_clear   = POWER6_MMCRA_THRM |
36841                         POWER6_MMCRA_OTHER,
36842 +               .machine_check          = machine_check_generic,
36843                 .platform               = "power6x",
36844         },
36845         {       /* 2.05-compliant processor, i.e. Power6 "architected" mode */
36846 @@ -356,6 +376,7 @@
36847                 .cpu_user_features      = COMMON_USER_POWER6,
36848                 .icache_bsize           = 128,
36849                 .dcache_bsize           = 128,
36850 +               .machine_check          = machine_check_generic,
36851                 .platform               = "power6",
36852         },
36853         {       /* Cell Broadband Engine */
36854 @@ -372,6 +393,7 @@
36855                 .pmc_type               = PPC_PMC_IBM,
36856                 .oprofile_cpu_type      = "ppc64/cell-be",
36857                 .oprofile_type          = PPC_OPROFILE_CELL,
36858 +               .machine_check          = machine_check_generic,
36859                 .platform               = "ppc-cell-be",
36860         },
36861         {       /* PA Semi PA6T */
36862 @@ -388,6 +410,7 @@
36863                 .cpu_restore            = __restore_cpu_pa6t,
36864                 .oprofile_cpu_type      = "ppc64/pa6t",
36865                 .oprofile_type          = PPC_OPROFILE_PA6T,
36866 +               .machine_check          = machine_check_generic,
36867                 .platform               = "pa6t",
36868         },
36869         {       /* default match */
36870 @@ -400,6 +423,7 @@
36871                 .dcache_bsize           = 128,
36872                 .num_pmcs               = 6,
36873                 .pmc_type               = PPC_PMC_IBM,
36874 +               .machine_check          = machine_check_generic,
36875                 .platform               = "power4",
36876         }
36877  #endif /* CONFIG_PPC64 */
36878 @@ -414,6 +438,7 @@
36879                         PPC_FEATURE_UNIFIED_CACHE | PPC_FEATURE_NO_TB,
36880                 .icache_bsize           = 32,
36881                 .dcache_bsize           = 32,
36882 +               .machine_check          = machine_check_generic,
36883                 .platform               = "ppc601",
36884         },
36885         {       /* 603 */
36886 @@ -425,6 +450,7 @@
36887                 .icache_bsize           = 32,
36888                 .dcache_bsize           = 32,
36889                 .cpu_setup              = __setup_cpu_603,
36890 +               .machine_check          = machine_check_generic,
36891                 .platform               = "ppc603",
36892         },
36893         {       /* 603e */
36894 @@ -436,6 +462,7 @@
36895                 .icache_bsize           = 32,
36896                 .dcache_bsize           = 32,
36897                 .cpu_setup              = __setup_cpu_603,
36898 +               .machine_check          = machine_check_generic,
36899                 .platform               = "ppc603",
36900         },
36901         {       /* 603ev */
36902 @@ -447,6 +474,7 @@
36903                 .icache_bsize           = 32,
36904                 .dcache_bsize           = 32,
36905                 .cpu_setup              = __setup_cpu_603,
36906 +               .machine_check          = machine_check_generic,
36907                 .platform               = "ppc603",
36908         },
36909         {       /* 604 */
36910 @@ -459,6 +487,7 @@
36911                 .dcache_bsize           = 32,
36912                 .num_pmcs               = 2,
36913                 .cpu_setup              = __setup_cpu_604,
36914 +               .machine_check          = machine_check_generic,
36915                 .platform               = "ppc604",
36916         },
36917         {       /* 604e */
36918 @@ -471,6 +500,7 @@
36919                 .dcache_bsize           = 32,
36920                 .num_pmcs               = 4,
36921                 .cpu_setup              = __setup_cpu_604,
36922 +               .machine_check          = machine_check_generic,
36923                 .platform               = "ppc604",
36924         },
36925         {       /* 604r */
36926 @@ -483,6 +513,7 @@
36927                 .dcache_bsize           = 32,
36928                 .num_pmcs               = 4,
36929                 .cpu_setup              = __setup_cpu_604,
36930 +               .machine_check          = machine_check_generic,
36931                 .platform               = "ppc604",
36932         },
36933         {       /* 604ev */
36934 @@ -495,6 +526,7 @@
36935                 .dcache_bsize           = 32,
36936                 .num_pmcs               = 4,
36937                 .cpu_setup              = __setup_cpu_604,
36938 +               .machine_check          = machine_check_generic,
36939                 .platform               = "ppc604",
36940         },
36941         {       /* 740/750 (0x4202, don't support TAU ?) */
36942 @@ -507,6 +539,7 @@
36943                 .dcache_bsize           = 32,
36944                 .num_pmcs               = 4,
36945                 .cpu_setup              = __setup_cpu_750,
36946 +               .machine_check          = machine_check_generic,
36947                 .platform               = "ppc750",
36948         },
36949         {       /* 750CX (80100 and 8010x?) */
36950 @@ -519,6 +552,7 @@
36951                 .dcache_bsize           = 32,
36952                 .num_pmcs               = 4,
36953                 .cpu_setup              = __setup_cpu_750cx,
36954 +               .machine_check          = machine_check_generic,
36955                 .platform               = "ppc750",
36956         },
36957         {       /* 750CX (82201 and 82202) */
36958 @@ -531,6 +565,7 @@
36959                 .dcache_bsize           = 32,
36960                 .num_pmcs               = 4,
36961                 .cpu_setup              = __setup_cpu_750cx,
36962 +               .machine_check          = machine_check_generic,
36963                 .platform               = "ppc750",
36964         },
36965         {       /* 750CXe (82214) */
36966 @@ -543,6 +578,7 @@
36967                 .dcache_bsize           = 32,
36968                 .num_pmcs               = 4,
36969                 .cpu_setup              = __setup_cpu_750cx,
36970 +               .machine_check          = machine_check_generic,
36971                 .platform               = "ppc750",
36972         },
36973         {       /* 750CXe "Gekko" (83214) */
36974 @@ -555,6 +591,7 @@
36975                 .dcache_bsize           = 32,
36976                 .num_pmcs               = 4,
36977                 .cpu_setup              = __setup_cpu_750cx,
36978 +               .machine_check          = machine_check_generic,
36979                 .platform               = "ppc750",
36980         },
36981         {       /* 750CL */
36982 @@ -567,6 +604,7 @@
36983                 .dcache_bsize           = 32,
36984                 .num_pmcs               = 4,
36985                 .cpu_setup              = __setup_cpu_750,
36986 +               .machine_check          = machine_check_generic,
36987                 .platform               = "ppc750",
36988         },
36989         {       /* 745/755 */
36990 @@ -579,6 +617,7 @@
36991                 .dcache_bsize           = 32,
36992                 .num_pmcs               = 4,
36993                 .cpu_setup              = __setup_cpu_750,
36994 +               .machine_check          = machine_check_generic,
36995                 .platform               = "ppc750",
36996         },
36997         {       /* 750FX rev 1.x */
36998 @@ -591,6 +630,7 @@
36999                 .dcache_bsize           = 32,
37000                 .num_pmcs               = 4,
37001                 .cpu_setup              = __setup_cpu_750,
37002 +               .machine_check          = machine_check_generic,
37003                 .platform               = "ppc750",
37004         },
37005         {       /* 750FX rev 2.0 must disable HID0[DPM] */
37006 @@ -603,6 +643,7 @@
37007                 .dcache_bsize           = 32,
37008                 .num_pmcs               = 4,
37009                 .cpu_setup              = __setup_cpu_750,
37010 +               .machine_check          = machine_check_generic,
37011                 .platform               = "ppc750",
37012         },
37013         {       /* 750FX (All revs except 2.0) */
37014 @@ -615,6 +656,7 @@
37015                 .dcache_bsize           = 32,
37016                 .num_pmcs               = 4,
37017                 .cpu_setup              = __setup_cpu_750fx,
37018 +               .machine_check          = machine_check_generic,
37019                 .platform               = "ppc750",
37020         },
37021         {       /* 750GX */
37022 @@ -627,6 +669,7 @@
37023                 .dcache_bsize           = 32,
37024                 .num_pmcs               = 4,
37025                 .cpu_setup              = __setup_cpu_750fx,
37026 +               .machine_check          = machine_check_generic,
37027                 .platform               = "ppc750",
37028         },
37029         {       /* 740/750 (L2CR bit need fixup for 740) */
37030 @@ -639,6 +682,7 @@
37031                 .dcache_bsize           = 32,
37032                 .num_pmcs               = 4,
37033                 .cpu_setup              = __setup_cpu_750,
37034 +               .machine_check          = machine_check_generic,
37035                 .platform               = "ppc750",
37036         },
37037         {       /* 7400 rev 1.1 ? (no TAU) */
37038 @@ -652,6 +696,7 @@
37039                 .dcache_bsize           = 32,
37040                 .num_pmcs               = 4,
37041                 .cpu_setup              = __setup_cpu_7400,
37042 +               .machine_check          = machine_check_generic,
37043                 .platform               = "ppc7400",
37044         },
37045         {       /* 7400 */
37046 @@ -665,6 +710,7 @@
37047                 .dcache_bsize           = 32,
37048                 .num_pmcs               = 4,
37049                 .cpu_setup              = __setup_cpu_7400,
37050 +               .machine_check          = machine_check_generic,
37051                 .platform               = "ppc7400",
37052         },
37053         {       /* 7410 */
37054 @@ -678,6 +724,7 @@
37055                 .dcache_bsize           = 32,
37056                 .num_pmcs               = 4,
37057                 .cpu_setup              = __setup_cpu_7410,
37058 +               .machine_check          = machine_check_generic,
37059                 .platform               = "ppc7400",
37060         },
37061         {       /* 7450 2.0 - no doze/nap */
37062 @@ -693,6 +740,7 @@
37063                 .cpu_setup              = __setup_cpu_745x,
37064                 .oprofile_cpu_type      = "ppc/7450",
37065                 .oprofile_type          = PPC_OPROFILE_G4,
37066 +               .machine_check          = machine_check_generic,
37067                 .platform               = "ppc7450",
37068         },
37069         {       /* 7450 2.1 */
37070 @@ -708,6 +756,7 @@
37071                 .cpu_setup              = __setup_cpu_745x,
37072                 .oprofile_cpu_type      = "ppc/7450",
37073                 .oprofile_type          = PPC_OPROFILE_G4,
37074 +               .machine_check          = machine_check_generic,
37075                 .platform               = "ppc7450",
37076         },
37077         {       /* 7450 2.3 and newer */
37078 @@ -723,6 +772,7 @@
37079                 .cpu_setup              = __setup_cpu_745x,
37080                 .oprofile_cpu_type      = "ppc/7450",
37081                 .oprofile_type          = PPC_OPROFILE_G4,
37082 +               .machine_check          = machine_check_generic,
37083                 .platform               = "ppc7450",
37084         },
37085         {       /* 7455 rev 1.x */
37086 @@ -738,6 +788,7 @@
37087                 .cpu_setup              = __setup_cpu_745x,
37088                 .oprofile_cpu_type      = "ppc/7450",
37089                 .oprofile_type          = PPC_OPROFILE_G4,
37090 +               .machine_check          = machine_check_generic,
37091                 .platform               = "ppc7450",
37092         },
37093         {       /* 7455 rev 2.0 */
37094 @@ -753,6 +804,7 @@
37095                 .cpu_setup              = __setup_cpu_745x,
37096                 .oprofile_cpu_type      = "ppc/7450",
37097                 .oprofile_type          = PPC_OPROFILE_G4,
37098 +               .machine_check          = machine_check_generic,
37099                 .platform               = "ppc7450",
37100         },
37101         {       /* 7455 others */
37102 @@ -768,6 +820,7 @@
37103                 .cpu_setup              = __setup_cpu_745x,
37104                 .oprofile_cpu_type      = "ppc/7450",
37105                 .oprofile_type          = PPC_OPROFILE_G4,
37106 +               .machine_check          = machine_check_generic,
37107                 .platform               = "ppc7450",
37108         },
37109         {       /* 7447/7457 Rev 1.0 */
37110 @@ -783,6 +836,7 @@
37111                 .cpu_setup              = __setup_cpu_745x,
37112                 .oprofile_cpu_type      = "ppc/7450",
37113                 .oprofile_type          = PPC_OPROFILE_G4,
37114 +               .machine_check          = machine_check_generic,
37115                 .platform               = "ppc7450",
37116         },
37117         {       /* 7447/7457 Rev 1.1 */
37118 @@ -798,6 +852,7 @@
37119                 .cpu_setup              = __setup_cpu_745x,
37120                 .oprofile_cpu_type      = "ppc/7450",
37121                 .oprofile_type          = PPC_OPROFILE_G4,
37122 +               .machine_check          = machine_check_generic,
37123                 .platform               = "ppc7450",
37124         },
37125         {       /* 7447/7457 Rev 1.2 and later */
37126 @@ -812,6 +867,7 @@
37127                 .cpu_setup              = __setup_cpu_745x,
37128                 .oprofile_cpu_type      = "ppc/7450",
37129                 .oprofile_type          = PPC_OPROFILE_G4,
37130 +               .machine_check          = machine_check_generic,
37131                 .platform               = "ppc7450",
37132         },
37133         {       /* 7447A */
37134 @@ -827,6 +883,7 @@
37135                 .cpu_setup              = __setup_cpu_745x,
37136                 .oprofile_cpu_type      = "ppc/7450",
37137                 .oprofile_type          = PPC_OPROFILE_G4,
37138 +               .machine_check          = machine_check_generic,
37139                 .platform               = "ppc7450",
37140         },
37141         {       /* 7448 */
37142 @@ -842,6 +899,7 @@
37143                 .cpu_setup              = __setup_cpu_745x,
37144                 .oprofile_cpu_type      = "ppc/7450",
37145                 .oprofile_type          = PPC_OPROFILE_G4,
37146 +               .machine_check          = machine_check_generic,
37147                 .platform               = "ppc7450",
37148         },
37149         {       /* 82xx (8240, 8245, 8260 are all 603e cores) */
37150 @@ -853,6 +911,7 @@
37151                 .icache_bsize           = 32,
37152                 .dcache_bsize           = 32,
37153                 .cpu_setup              = __setup_cpu_603,
37154 +               .machine_check          = machine_check_generic,
37155                 .platform               = "ppc603",
37156         },
37157         {       /* All G2_LE (603e core, plus some) have the same pvr */
37158 @@ -864,6 +923,7 @@
37159                 .icache_bsize           = 32,
37160                 .dcache_bsize           = 32,
37161                 .cpu_setup              = __setup_cpu_603,
37162 +               .machine_check          = machine_check_generic,
37163                 .platform               = "ppc603",
37164         },
37165         {       /* e300c1 (a 603e core, plus some) on 83xx */
37166 @@ -875,6 +935,7 @@
37167                 .icache_bsize           = 32,
37168                 .dcache_bsize           = 32,
37169                 .cpu_setup              = __setup_cpu_603,
37170 +               .machine_check          = machine_check_generic,
37171                 .platform               = "ppc603",
37172         },
37173         {       /* e300c2 (an e300c1 core, plus some, minus FPU) on 83xx */
37174 @@ -886,9 +947,10 @@
37175                 .icache_bsize           = 32,
37176                 .dcache_bsize           = 32,
37177                 .cpu_setup              = __setup_cpu_603,
37178 +               .machine_check          = machine_check_generic,
37179                 .platform               = "ppc603",
37180         },
37181 -       {       /* e300c3 on 83xx  */
37182 +       {       /* e300c3 (e300c1, plus one IU, half cache size) on 83xx */
37183                 .pvr_mask               = 0x7fff0000,
37184                 .pvr_value              = 0x00850000,
37185                 .cpu_name               = "e300c3",
37186 @@ -899,6 +961,18 @@
37187                 .cpu_setup              = __setup_cpu_603,
37188                 .platform               = "ppc603",
37189         },
37190 +       {       /* e300c4 (e300c1, plus one IU) */
37191 +               .pvr_mask               = 0x7fff0000,
37192 +               .pvr_value              = 0x00860000,
37193 +               .cpu_name               = "e300c4",
37194 +               .cpu_features           = CPU_FTRS_E300,
37195 +               .cpu_user_features      = COMMON_USER,
37196 +               .icache_bsize           = 32,
37197 +               .dcache_bsize           = 32,
37198 +               .cpu_setup              = __setup_cpu_603,
37199 +               .machine_check          = machine_check_generic,
37200 +               .platform               = "ppc603",
37201 +       },
37202         {       /* default match, we assume split I/D cache & TB (non-601)... */
37203                 .pvr_mask               = 0x00000000,
37204                 .pvr_value              = 0x00000000,
37205 @@ -907,6 +981,7 @@
37206                 .cpu_user_features      = COMMON_USER,
37207                 .icache_bsize           = 32,
37208                 .dcache_bsize           = 32,
37209 +               .machine_check          = machine_check_generic,
37210                 .platform               = "ppc603",
37211         },
37212  #endif /* CLASSIC_PPC */
37213 @@ -933,6 +1008,7 @@
37214                 .cpu_user_features      = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
37215                 .icache_bsize           = 16,
37216                 .dcache_bsize           = 16,
37217 +               .machine_check          = machine_check_4xx,
37218                 .platform               = "ppc403",
37219         },
37220         {       /* 403GCX */
37221 @@ -944,6 +1020,7 @@
37222                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_NO_TB,
37223                 .icache_bsize           = 16,
37224                 .dcache_bsize           = 16,
37225 +               .machine_check          = machine_check_4xx,
37226                 .platform               = "ppc403",
37227         },
37228         {       /* 403G ?? */
37229 @@ -954,6 +1031,7 @@
37230                 .cpu_user_features      = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
37231                 .icache_bsize           = 16,
37232                 .dcache_bsize           = 16,
37233 +               .machine_check          = machine_check_4xx,
37234                 .platform               = "ppc403",
37235         },
37236         {       /* 405GP */
37237 @@ -965,6 +1043,7 @@
37238                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37239                 .icache_bsize           = 32,
37240                 .dcache_bsize           = 32,
37241 +               .machine_check          = machine_check_4xx,
37242                 .platform               = "ppc405",
37243         },
37244         {       /* STB 03xxx */
37245 @@ -976,6 +1055,7 @@
37246                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37247                 .icache_bsize           = 32,
37248                 .dcache_bsize           = 32,
37249 +               .machine_check          = machine_check_4xx,
37250                 .platform               = "ppc405",
37251         },
37252         {       /* STB 04xxx */
37253 @@ -987,6 +1067,7 @@
37254                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37255                 .icache_bsize           = 32,
37256                 .dcache_bsize           = 32,
37257 +               .machine_check          = machine_check_4xx,
37258                 .platform               = "ppc405",
37259         },
37260         {       /* NP405L */
37261 @@ -998,6 +1079,7 @@
37262                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37263                 .icache_bsize           = 32,
37264                 .dcache_bsize           = 32,
37265 +               .machine_check          = machine_check_4xx,
37266                 .platform               = "ppc405",
37267         },
37268         {       /* NP4GS3 */
37269 @@ -1009,6 +1091,7 @@
37270                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37271                 .icache_bsize           = 32,
37272                 .dcache_bsize           = 32,
37273 +               .machine_check          = machine_check_4xx,
37274                 .platform               = "ppc405",
37275         },
37276         {   /* NP405H */
37277 @@ -1020,6 +1103,7 @@
37278                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37279                 .icache_bsize           = 32,
37280                 .dcache_bsize           = 32,
37281 +               .machine_check          = machine_check_4xx,
37282                 .platform               = "ppc405",
37283         },
37284         {       /* 405GPr */
37285 @@ -1031,6 +1115,7 @@
37286                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37287                 .icache_bsize           = 32,
37288                 .dcache_bsize           = 32,
37289 +               .machine_check          = machine_check_4xx,
37290                 .platform               = "ppc405",
37291         },
37292         {   /* STBx25xx */
37293 @@ -1042,6 +1127,7 @@
37294                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37295                 .icache_bsize           = 32,
37296                 .dcache_bsize           = 32,
37297 +               .machine_check          = machine_check_4xx,
37298                 .platform               = "ppc405",
37299         },
37300         {       /* 405LP */
37301 @@ -1052,6 +1138,7 @@
37302                 .cpu_user_features      = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
37303                 .icache_bsize           = 32,
37304                 .dcache_bsize           = 32,
37305 +               .machine_check          = machine_check_4xx,
37306                 .platform               = "ppc405",
37307         },
37308         {       /* Xilinx Virtex-II Pro  */
37309 @@ -1063,6 +1150,7 @@
37310                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37311                 .icache_bsize           = 32,
37312                 .dcache_bsize           = 32,
37313 +               .machine_check          = machine_check_4xx,
37314                 .platform               = "ppc405",
37315         },
37316         {       /* Xilinx Virtex-4 FX */
37317 @@ -1074,6 +1162,7 @@
37318                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37319                 .icache_bsize           = 32,
37320                 .dcache_bsize           = 32,
37321 +               .machine_check          = machine_check_4xx,
37322                 .platform               = "ppc405",
37323         },
37324         {       /* 405EP */
37325 @@ -1085,17 +1174,31 @@
37326                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37327                 .icache_bsize           = 32,
37328                 .dcache_bsize           = 32,
37329 +               .machine_check          = machine_check_4xx,
37330                 .platform               = "ppc405",
37331         },
37332         {       /* 405EX */
37333 -               .pvr_mask               = 0xffff0000,
37334 -               .pvr_value              = 0x12910000,
37335 +               .pvr_mask               = 0xffff0004,
37336 +               .pvr_value              = 0x12910004,
37337                 .cpu_name               = "405EX",
37338                 .cpu_features           = CPU_FTRS_40X,
37339                 .cpu_user_features      = PPC_FEATURE_32 |
37340                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37341                 .icache_bsize           = 32,
37342                 .dcache_bsize           = 32,
37343 +               .machine_check          = machine_check_4xx,
37344 +               .platform               = "ppc405",
37345 +       },
37346 +       {       /* 405EXr */
37347 +               .pvr_mask               = 0xffff0004,
37348 +               .pvr_value              = 0x12910000,
37349 +               .cpu_name               = "405EXr",
37350 +               .cpu_features           = CPU_FTRS_40X,
37351 +               .cpu_user_features      = PPC_FEATURE_32 |
37352 +                       PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37353 +               .icache_bsize           = 32,
37354 +               .dcache_bsize           = 32,
37355 +               .machine_check          = machine_check_4xx,
37356                 .platform               = "ppc405",
37357         },
37358  
37359 @@ -1109,6 +1212,7 @@
37360                 .cpu_user_features      = COMMON_USER_BOOKE,
37361                 .icache_bsize           = 32,
37362                 .dcache_bsize           = 32,
37363 +               .machine_check          = machine_check_4xx,
37364                 .platform               = "ppc440",
37365         },
37366         { /* Use logical PVR for 440EP (logical pvr = pvr | 0x8) */
37367 @@ -1120,6 +1224,7 @@
37368                 .icache_bsize           = 32,
37369                 .dcache_bsize           = 32,
37370                 .cpu_setup              = __setup_cpu_440ep,
37371 +               .machine_check          = machine_check_4xx,
37372                 .platform               = "ppc440",
37373         },
37374         {
37375 @@ -1130,6 +1235,19 @@
37376                 .cpu_user_features      = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
37377                 .icache_bsize           = 32,
37378                 .dcache_bsize           = 32,
37379 +               .machine_check          = machine_check_4xx,
37380 +               .platform               = "ppc440",
37381 +       },
37382 +       { /* Matches both physical and logical PVR for 440EP (logical pvr = pvr | 0x8) */
37383 +               .pvr_mask               = 0xf0000ff7,
37384 +               .pvr_value              = 0x400008d4,
37385 +               .cpu_name               = "440EP Rev. C",
37386 +               .cpu_features           = CPU_FTRS_44X,
37387 +               .cpu_user_features      = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
37388 +               .icache_bsize           = 32,
37389 +               .dcache_bsize           = 32,
37390 +               .cpu_setup              = __setup_cpu_440ep,
37391 +               .machine_check          = machine_check_4xx,
37392                 .platform               = "ppc440",
37393         },
37394         { /* Use logical PVR for 440EP (logical pvr = pvr | 0x8) */
37395 @@ -1141,6 +1259,7 @@
37396                 .icache_bsize           = 32,
37397                 .dcache_bsize           = 32,
37398                 .cpu_setup              = __setup_cpu_440ep,
37399 +               .machine_check          = machine_check_4xx,
37400                 .platform               = "ppc440",
37401         },
37402         { /* 440GRX */
37403 @@ -1152,6 +1271,7 @@
37404                 .icache_bsize           = 32,
37405                 .dcache_bsize           = 32,
37406                 .cpu_setup              = __setup_cpu_440grx,
37407 +               .machine_check          = machine_check_440A,
37408                 .platform               = "ppc440",
37409         },
37410         { /* Use logical PVR for 440EPx (logical pvr = pvr | 0x8) */
37411 @@ -1163,6 +1283,7 @@
37412                 .icache_bsize           = 32,
37413                 .dcache_bsize           = 32,
37414                 .cpu_setup              = __setup_cpu_440epx,
37415 +               .machine_check          = machine_check_440A,
37416                 .platform               = "ppc440",
37417         },
37418         {       /* 440GP Rev. B */
37419 @@ -1173,6 +1294,7 @@
37420                 .cpu_user_features      = COMMON_USER_BOOKE,
37421                 .icache_bsize           = 32,
37422                 .dcache_bsize           = 32,
37423 +               .machine_check          = machine_check_4xx,
37424                 .platform               = "ppc440gp",
37425         },
37426         {       /* 440GP Rev. C */
37427 @@ -1183,6 +1305,7 @@
37428                 .cpu_user_features      = COMMON_USER_BOOKE,
37429                 .icache_bsize           = 32,
37430                 .dcache_bsize           = 32,
37431 +               .machine_check          = machine_check_4xx,
37432                 .platform               = "ppc440gp",
37433         },
37434         { /* 440GX Rev. A */
37435 @@ -1193,6 +1316,8 @@
37436                 .cpu_user_features      = COMMON_USER_BOOKE,
37437                 .icache_bsize           = 32,
37438                 .dcache_bsize           = 32,
37439 +               .cpu_setup              = __setup_cpu_440gx,
37440 +               .machine_check          = machine_check_440A,
37441                 .platform               = "ppc440",
37442         },
37443         { /* 440GX Rev. B */
37444 @@ -1203,6 +1328,8 @@
37445                 .cpu_user_features      = COMMON_USER_BOOKE,
37446                 .icache_bsize           = 32,
37447                 .dcache_bsize           = 32,
37448 +               .cpu_setup              = __setup_cpu_440gx,
37449 +               .machine_check          = machine_check_440A,
37450                 .platform               = "ppc440",
37451         },
37452         { /* 440GX Rev. C */
37453 @@ -1213,6 +1340,8 @@
37454                 .cpu_user_features      = COMMON_USER_BOOKE,
37455                 .icache_bsize           = 32,
37456                 .dcache_bsize           = 32,
37457 +               .cpu_setup              = __setup_cpu_440gx,
37458 +               .machine_check          = machine_check_440A,
37459                 .platform               = "ppc440",
37460         },
37461         { /* 440GX Rev. F */
37462 @@ -1223,6 +1352,8 @@
37463                 .cpu_user_features      = COMMON_USER_BOOKE,
37464                 .icache_bsize           = 32,
37465                 .dcache_bsize           = 32,
37466 +               .cpu_setup              = __setup_cpu_440gx,
37467 +               .machine_check          = machine_check_440A,
37468                 .platform               = "ppc440",
37469         },
37470         { /* 440SP Rev. A */
37471 @@ -1233,6 +1364,7 @@
37472                 .cpu_user_features      = COMMON_USER_BOOKE,
37473                 .icache_bsize           = 32,
37474                 .dcache_bsize           = 32,
37475 +               .machine_check          = machine_check_4xx,
37476                 .platform               = "ppc440",
37477         },
37478         { /* 440SPe Rev. A */
37479 @@ -1243,6 +1375,8 @@
37480                 .cpu_user_features      = COMMON_USER_BOOKE,
37481                 .icache_bsize           = 32,
37482                 .dcache_bsize           = 32,
37483 +               .cpu_setup              = __setup_cpu_440spe,
37484 +               .machine_check          = machine_check_440A,
37485                 .platform               = "ppc440",
37486         },
37487         { /* 440SPe Rev. B */
37488 @@ -1253,10 +1387,13 @@
37489                 .cpu_user_features      = COMMON_USER_BOOKE,
37490                 .icache_bsize           = 32,
37491                 .dcache_bsize           = 32,
37492 +               .cpu_setup              = __setup_cpu_440spe,
37493 +               .machine_check          = machine_check_440A,
37494                 .platform               = "ppc440",
37495         },
37496  #endif /* CONFIG_44x */
37497  #ifdef CONFIG_FSL_BOOKE
37498 +#ifdef CONFIG_E200
37499         {       /* e200z5 */
37500                 .pvr_mask               = 0xfff00000,
37501                 .pvr_value              = 0x81000000,
37502 @@ -1267,6 +1404,7 @@
37503                         PPC_FEATURE_HAS_EFP_SINGLE |
37504                         PPC_FEATURE_UNIFIED_CACHE,
37505                 .dcache_bsize           = 32,
37506 +               .machine_check          = machine_check_e200,
37507                 .platform               = "ppc5554",
37508         },
37509         {       /* e200z6 */
37510 @@ -1280,8 +1418,10 @@
37511                         PPC_FEATURE_HAS_EFP_SINGLE_COMP |
37512                         PPC_FEATURE_UNIFIED_CACHE,
37513                 .dcache_bsize           = 32,
37514 +               .machine_check          = machine_check_e200,
37515                 .platform               = "ppc5554",
37516         },
37517 +#elif defined(CONFIG_E500)
37518         {       /* e500 */
37519                 .pvr_mask               = 0xffff0000,
37520                 .pvr_value              = 0x80200000,
37521 @@ -1296,6 +1436,7 @@
37522                 .num_pmcs               = 4,
37523                 .oprofile_cpu_type      = "ppc/e500",
37524                 .oprofile_type          = PPC_OPROFILE_BOOKE,
37525 +               .machine_check          = machine_check_e500,
37526                 .platform               = "ppc8540",
37527         },
37528         {       /* e500v2 */
37529 @@ -1313,9 +1454,11 @@
37530                 .num_pmcs               = 4,
37531                 .oprofile_cpu_type      = "ppc/e500",
37532                 .oprofile_type          = PPC_OPROFILE_BOOKE,
37533 +               .machine_check          = machine_check_e500,
37534                 .platform               = "ppc8548",
37535         },
37536  #endif
37537 +#endif
37538  #if !CLASSIC_PPC
37539         {       /* default match */
37540                 .pvr_mask               = 0x00000000,
37541 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/crash.c powerpc.git/arch/powerpc/kernel/crash.c
37542 --- linux-2.6.24/arch/powerpc/kernel/crash.c    2008-01-24 23:58:37.000000000 +0100
37543 +++ powerpc.git/arch/powerpc/kernel/crash.c     2008-01-28 20:25:49.000000000 +0100
37544 @@ -32,6 +32,8 @@
37545  #include <asm/lmb.h>
37546  #include <asm/firmware.h>
37547  #include <asm/smp.h>
37548 +#include <asm/system.h>
37549 +#include <asm/setjmp.h>
37550  
37551  #ifdef DEBUG
37552  #include <asm/udbg.h>
37553 @@ -45,6 +47,11 @@
37554  static cpumask_t cpus_in_crash = CPU_MASK_NONE;
37555  cpumask_t cpus_in_sr = CPU_MASK_NONE;
37556  
37557 +#define CRASH_HANDLER_MAX 1
37558 +/* NULL terminated list of shutdown handles */
37559 +static crash_shutdown_t crash_shutdown_handles[CRASH_HANDLER_MAX+1];
37560 +static DEFINE_SPINLOCK(crash_handlers_lock);
37561 +
37562  #ifdef CONFIG_SMP
37563  static atomic_t enter_on_soft_reset = ATOMIC_INIT(0);
37564  
37565 @@ -285,9 +292,72 @@
37566  }
37567  #endif /* CONFIG_SPU_BASE */
37568  
37569 +/*
37570 + * Register a function to be called on shutdown.  Only use this if you
37571 + * can't reset your device in the second kernel.
37572 + */
37573 +int crash_shutdown_register(crash_shutdown_t handler)
37574 +{
37575 +       unsigned int i, rc;
37576 +
37577 +       spin_lock(&crash_handlers_lock);
37578 +       for (i = 0 ; i < CRASH_HANDLER_MAX; i++)
37579 +               if (!crash_shutdown_handles[i]) {
37580 +                       /* Insert handle at first empty entry */
37581 +                       crash_shutdown_handles[i] = handler;
37582 +                       rc = 0;
37583 +                       break;
37584 +               }
37585 +
37586 +       if (i == CRASH_HANDLER_MAX) {
37587 +               printk(KERN_ERR "Crash shutdown handles full, "
37588 +                      "not registered.\n");
37589 +               rc = 1;
37590 +       }
37591 +
37592 +       spin_unlock(&crash_handlers_lock);
37593 +       return rc;
37594 +}
37595 +EXPORT_SYMBOL(crash_shutdown_register);
37596 +
37597 +int crash_shutdown_unregister(crash_shutdown_t handler)
37598 +{
37599 +       unsigned int i, rc;
37600 +
37601 +       spin_lock(&crash_handlers_lock);
37602 +       for (i = 0 ; i < CRASH_HANDLER_MAX; i++)
37603 +               if (crash_shutdown_handles[i] == handler)
37604 +                       break;
37605 +
37606 +       if (i == CRASH_HANDLER_MAX) {
37607 +               printk(KERN_ERR "Crash shutdown handle not found\n");
37608 +               rc = 1;
37609 +       } else {
37610 +               /* Shift handles down */
37611 +               for (; crash_shutdown_handles[i]; i++)
37612 +                       crash_shutdown_handles[i] =
37613 +                               crash_shutdown_handles[i+1];
37614 +               rc = 0;
37615 +       }
37616 +
37617 +       spin_unlock(&crash_handlers_lock);
37618 +       return rc;
37619 +}
37620 +EXPORT_SYMBOL(crash_shutdown_unregister);
37621 +
37622 +static unsigned long crash_shutdown_buf[JMP_BUF_LEN];
37623 +
37624 +static int handle_fault(struct pt_regs *regs)
37625 +{
37626 +       longjmp(crash_shutdown_buf, 1);
37627 +       return 0;
37628 +}
37629 +
37630  void default_machine_crash_shutdown(struct pt_regs *regs)
37631  {
37632 -       unsigned int irq;
37633 +       unsigned int i;
37634 +       int (*old_handler)(struct pt_regs *regs);
37635 +
37636  
37637         /*
37638          * This function is only called after the system
37639 @@ -301,15 +371,36 @@
37640          */
37641         hard_irq_disable();
37642  
37643 -       for_each_irq(irq) {
37644 -               struct irq_desc *desc = irq_desc + irq;
37645 +       for_each_irq(i) {
37646 +               struct irq_desc *desc = irq_desc + i;
37647  
37648                 if (desc->status & IRQ_INPROGRESS)
37649 -                       desc->chip->eoi(irq);
37650 +                       desc->chip->eoi(i);
37651  
37652                 if (!(desc->status & IRQ_DISABLED))
37653 -                       desc->chip->disable(irq);
37654 +                       desc->chip->disable(i);
37655 +       }
37656 +
37657 +       /*
37658 +        * Call registered shutdown routines savely.  Swap out
37659 +        * __debugger_fault_handler, and replace on exit.
37660 +        */
37661 +       old_handler = __debugger_fault_handler;
37662 +       __debugger_fault_handler = handle_fault;
37663 +       for (i = 0; crash_shutdown_handles[i]; i++) {
37664 +               if (setjmp(crash_shutdown_buf) == 0) {
37665 +                       /*
37666 +                        * Insert syncs and delay to ensure
37667 +                        * instructions in the dangerous region don't
37668 +                        * leak away from this protected region.
37669 +                        */
37670 +                       asm volatile("sync; isync");
37671 +                       /* dangerous region */
37672 +                       crash_shutdown_handles[i]();
37673 +                       asm volatile("sync; isync");
37674 +               }
37675         }
37676 +       __debugger_fault_handler = old_handler;
37677  
37678         /*
37679          * Make a note of crashing cpu. Will be used in machine_kexec
37680 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/dma_64.c powerpc.git/arch/powerpc/kernel/dma_64.c
37681 --- linux-2.6.24/arch/powerpc/kernel/dma_64.c   2008-01-24 23:58:37.000000000 +0100
37682 +++ powerpc.git/arch/powerpc/kernel/dma_64.c    2008-01-28 20:25:49.000000000 +0100
37683 @@ -112,10 +112,16 @@
37684  /*
37685   * Generic direct DMA implementation
37686   *
37687 - * This implementation supports a global offset that can be applied if
37688 - * the address at which memory is visible to devices is not 0.
37689 + * This implementation supports a per-device offset that can be applied if
37690 + * the address at which memory is visible to devices is not 0. Platform code
37691 + * can set archdata.dma_data to an unsigned long holding the offset. By
37692 + * default the offset is zero.
37693   */
37694 -unsigned long dma_direct_offset;
37695 +
37696 +static unsigned long get_dma_direct_offset(struct device *dev)
37697 +{
37698 +       return (unsigned long)dev->archdata.dma_data;
37699 +}
37700  
37701  static void *dma_direct_alloc_coherent(struct device *dev, size_t size,
37702                                        dma_addr_t *dma_handle, gfp_t flag)
37703 @@ -124,13 +130,12 @@
37704         void *ret;
37705         int node = dev->archdata.numa_node;
37706  
37707 -       /* TODO: Maybe use the numa node here too ? */
37708         page = alloc_pages_node(node, flag, get_order(size));
37709         if (page == NULL)
37710                 return NULL;
37711         ret = page_address(page);
37712         memset(ret, 0, size);
37713 -       *dma_handle = virt_to_abs(ret) | dma_direct_offset;
37714 +       *dma_handle = virt_to_abs(ret) + get_dma_direct_offset(dev);
37715  
37716         return ret;
37717  }
37718 @@ -145,7 +150,7 @@
37719                                         size_t size,
37720                                         enum dma_data_direction direction)
37721  {
37722 -       return virt_to_abs(ptr) | dma_direct_offset;
37723 +       return virt_to_abs(ptr) + get_dma_direct_offset(dev);
37724  }
37725  
37726  static void dma_direct_unmap_single(struct device *dev, dma_addr_t dma_addr,
37727 @@ -161,7 +166,7 @@
37728         int i;
37729  
37730         for_each_sg(sgl, sg, nents, i) {
37731 -               sg->dma_address = sg_phys(sg) | dma_direct_offset;
37732 +               sg->dma_address = sg_phys(sg) + get_dma_direct_offset(dev);
37733                 sg->dma_length = sg->length;
37734         }
37735  
37736 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/head_44x.S powerpc.git/arch/powerpc/kernel/head_44x.S
37737 --- linux-2.6.24/arch/powerpc/kernel/head_44x.S 2008-01-24 23:58:37.000000000 +0100
37738 +++ powerpc.git/arch/powerpc/kernel/head_44x.S  2008-01-28 20:25:49.000000000 +0100
37739 @@ -289,11 +289,8 @@
37740         CRITICAL_EXCEPTION(0x0100, CriticalInput, unknown_exception)
37741  
37742         /* Machine Check Interrupt */
37743 -#ifdef CONFIG_440A
37744 -       MCHECK_EXCEPTION(0x0200, MachineCheck, machine_check_exception)
37745 -#else
37746         CRITICAL_EXCEPTION(0x0200, MachineCheck, machine_check_exception)
37747 -#endif
37748 +       MCHECK_EXCEPTION(0x0210, MachineCheckA, machine_check_exception)
37749  
37750         /* Data Storage Interrupt */
37751         START_EXCEPTION(DataStorage)
37752 @@ -674,6 +671,15 @@
37753   */
37754  
37755  /*
37756 + * Adjust the machine check IVOR on 440A cores
37757 + */
37758 +_GLOBAL(__fixup_440A_mcheck)
37759 +       li      r3,MachineCheckA@l
37760 +       mtspr   SPRN_IVOR1,r3
37761 +       sync
37762 +       blr
37763 +
37764 +/*
37765   * extern void giveup_altivec(struct task_struct *prev)
37766   *
37767   * The 44x core does not have an AltiVec unit.
37768 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/head_booke.h powerpc.git/arch/powerpc/kernel/head_booke.h
37769 --- linux-2.6.24/arch/powerpc/kernel/head_booke.h       2008-01-24 23:58:37.000000000 +0100
37770 +++ powerpc.git/arch/powerpc/kernel/head_booke.h        2008-01-28 20:25:49.000000000 +0100
37771 @@ -166,7 +166,7 @@
37772         mfspr   r5,SPRN_ESR;                                    \
37773         stw     r5,_ESR(r11);                                   \
37774         addi    r3,r1,STACK_FRAME_OVERHEAD;                     \
37775 -       EXC_XFER_TEMPLATE(hdlr, n+2, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \
37776 +       EXC_XFER_TEMPLATE(hdlr, n+4, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \
37777                           NOCOPY, mcheck_transfer_to_handler,   \
37778                           ret_from_mcheck_exc)
37779  
37780 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/head_fsl_booke.S powerpc.git/arch/powerpc/kernel/head_fsl_booke.S
37781 --- linux-2.6.24/arch/powerpc/kernel/head_fsl_booke.S   2008-01-24 23:58:37.000000000 +0100
37782 +++ powerpc.git/arch/powerpc/kernel/head_fsl_booke.S    2008-01-28 20:25:49.000000000 +0100
37783 @@ -73,8 +73,8 @@
37784  /* We try to not make any assumptions about how the boot loader
37785   * setup or used the TLBs.  We invalidate all mappings from the
37786   * boot loader and load a single entry in TLB1[0] to map the
37787 - * first 16M of kernel memory.  Any boot info passed from the
37788 - * bootloader needs to live in this first 16M.
37789 + * first 64M of kernel memory.  Any boot info passed from the
37790 + * bootloader needs to live in this first 64M.
37791   *
37792   * Requirement on bootloader:
37793   *  - The page we're executing in needs to reside in TLB1 and
37794 @@ -167,7 +167,7 @@
37795         mtspr   SPRN_MAS0,r7
37796         tlbre
37797  
37798 -       /* Just modify the entry ID and EPN for the temp mapping */
37799 +       /* Just modify the entry ID, EPN and RPN for the temp mapping */
37800         lis     r7,0x1000       /* Set MAS0(TLBSEL) = 1 */
37801         rlwimi  r7,r5,16,4,15   /* Setup MAS0 = TLBSEL | ESEL(r5) */
37802         mtspr   SPRN_MAS0,r7
37803 @@ -177,9 +177,12 @@
37804         ori     r6,r6,(MAS1_TSIZE(BOOKE_PAGESZ_4K))@l
37805         mtspr   SPRN_MAS1,r6
37806         mfspr   r6,SPRN_MAS2
37807 -       li      r7,0            /* temp EPN = 0 */
37808 +       lis     r7,PHYSICAL_START@h
37809         rlwimi  r7,r6,0,20,31
37810         mtspr   SPRN_MAS2,r7
37811 +       mfspr   r6,SPRN_MAS3
37812 +       rlwimi  r7,r6,0,20,31
37813 +       mtspr   SPRN_MAS3,r7
37814         tlbwe
37815  
37816         xori    r6,r4,1
37817 @@ -222,11 +225,11 @@
37818         lis     r6,0x1000               /* Set MAS0(TLBSEL) = TLB1(1), ESEL = 0 */
37819         mtspr   SPRN_MAS0,r6
37820         lis     r6,(MAS1_VALID|MAS1_IPROT)@h
37821 -       ori     r6,r6,(MAS1_TSIZE(BOOKE_PAGESZ_16M))@l
37822 +       ori     r6,r6,(MAS1_TSIZE(BOOKE_PAGESZ_64M))@l
37823         mtspr   SPRN_MAS1,r6
37824         li      r7,0
37825 -       lis     r6,KERNELBASE@h
37826 -       ori     r6,r6,KERNELBASE@l
37827 +       lis     r6,PAGE_OFFSET@h
37828 +       ori     r6,r6,PAGE_OFFSET@l
37829         rlwimi  r6,r7,0,20,31
37830         mtspr   SPRN_MAS2,r6
37831         li      r7,(MAS3_SX|MAS3_SW|MAS3_SR)
37832 @@ -234,6 +237,9 @@
37833         tlbwe
37834  
37835  /* 7. Jump to KERNELBASE mapping */
37836 +       lis     r6,KERNELBASE@h
37837 +       ori     r6,r6,KERNELBASE@l
37838 +       rlwimi  r6,r7,0,20,31
37839         lis     r7,MSR_KERNEL@h
37840         ori     r7,r7,MSR_KERNEL@l
37841         bl      1f                      /* Find our address */
37842 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/ibmebus.c powerpc.git/arch/powerpc/kernel/ibmebus.c
37843 --- linux-2.6.24/arch/powerpc/kernel/ibmebus.c  2008-01-24 23:58:37.000000000 +0100
37844 +++ powerpc.git/arch/powerpc/kernel/ibmebus.c   2008-01-28 20:25:49.000000000 +0100
37845 @@ -41,6 +41,7 @@
37846  #include <linux/kobject.h>
37847  #include <linux/dma-mapping.h>
37848  #include <linux/interrupt.h>
37849 +#include <linux/of.h>
37850  #include <linux/of_platform.h>
37851  #include <asm/ibmebus.h>
37852  #include <asm/abs_addr.h>
37853 @@ -52,7 +53,7 @@
37854  struct bus_type ibmebus_bus_type;
37855  
37856  /* These devices will automatically be added to the bus during init */
37857 -static struct of_device_id builtin_matches[] = {
37858 +static struct of_device_id __initdata builtin_matches[] = {
37859         { .compatible = "IBM,lhca" },
37860         { .compatible = "IBM,lhea" },
37861         {},
37862 @@ -171,7 +172,7 @@
37863  
37864         root = of_find_node_by_path("/");
37865  
37866 -       for (child = NULL; (child = of_get_next_child(root, child)); ) {
37867 +       for_each_child_of_node(root, child) {
37868                 if (!of_match_node(matches, child))
37869                         continue;
37870  
37871 @@ -197,16 +198,13 @@
37872         /* If the driver uses devices that ibmebus doesn't know, add them */
37873         ibmebus_create_devices(drv->match_table);
37874  
37875 -       drv->driver.name   = drv->name;
37876 -       drv->driver.bus    = &ibmebus_bus_type;
37877 -
37878 -       return driver_register(&drv->driver);
37879 +       return of_register_driver(drv, &ibmebus_bus_type);
37880  }
37881  EXPORT_SYMBOL(ibmebus_register_driver);
37882  
37883  void ibmebus_unregister_driver(struct of_platform_driver *drv)
37884  {
37885 -       driver_unregister(&drv->driver);
37886 +       of_unregister_driver(drv);
37887  }
37888  EXPORT_SYMBOL(ibmebus_unregister_driver);
37889  
37890 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/iommu.c powerpc.git/arch/powerpc/kernel/iommu.c
37891 --- linux-2.6.24/arch/powerpc/kernel/iommu.c    2008-01-24 23:58:37.000000000 +0100
37892 +++ powerpc.git/arch/powerpc/kernel/iommu.c     2008-01-28 20:25:49.000000000 +0100
37893 @@ -532,16 +532,14 @@
37894         return tbl;
37895  }
37896  
37897 -void iommu_free_table(struct device_node *dn)
37898 +void iommu_free_table(struct iommu_table *tbl, const char *node_name)
37899  {
37900 -       struct pci_dn *pdn = dn->data;
37901 -       struct iommu_table *tbl = pdn->iommu_table;
37902         unsigned long bitmap_sz, i;
37903         unsigned int order;
37904  
37905         if (!tbl || !tbl->it_map) {
37906                 printk(KERN_ERR "%s: expected TCE map for %s\n", __FUNCTION__,
37907 -                               dn->full_name);
37908 +                               node_name);
37909                 return;
37910         }
37911  
37912 @@ -550,7 +548,7 @@
37913         for (i = 0; i < (tbl->it_size/64); i++) {
37914                 if (tbl->it_map[i] != 0) {
37915                         printk(KERN_WARNING "%s: Unexpected TCEs for %s\n",
37916 -                               __FUNCTION__, dn->full_name);
37917 +                               __FUNCTION__, node_name);
37918                         break;
37919                 }
37920         }
37921 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/isa-bridge.c powerpc.git/arch/powerpc/kernel/isa-bridge.c
37922 --- linux-2.6.24/arch/powerpc/kernel/isa-bridge.c       2008-01-24 23:58:37.000000000 +0100
37923 +++ powerpc.git/arch/powerpc/kernel/isa-bridge.c        2008-01-28 20:25:49.000000000 +0100
37924 @@ -108,7 +108,7 @@
37925         if (size > 0x10000)
37926                 size = 0x10000;
37927  
37928 -       printk(KERN_ERR "no ISA IO ranges or unexpected isa range,"
37929 +       printk(KERN_ERR "no ISA IO ranges or unexpected isa range, "
37930                "mapping 64k\n");
37931  
37932         __ioremap_at(phb_io_base_phys, (void *)ISA_IO_BASE,
37933 @@ -116,7 +116,7 @@
37934         return;
37935  
37936  inval_range:
37937 -       printk(KERN_ERR "no ISA IO ranges or unexpected isa range,"
37938 +       printk(KERN_ERR "no ISA IO ranges or unexpected isa range, "
37939                "mapping 64k\n");
37940         __ioremap_at(phb_io_base_phys, (void *)ISA_IO_BASE,
37941                      0x10000, _PAGE_NO_CACHE|_PAGE_GUARDED);
37942 @@ -145,7 +145,7 @@
37943         for_each_node_by_type(np, "isa") {
37944                 /* Look for our hose being a parent */
37945                 for (parent = of_get_parent(np); parent;) {
37946 -                       if (parent == hose->arch_data) {
37947 +                       if (parent == hose->dn) {
37948                                 of_node_put(parent);
37949                                 break;
37950                         }
37951 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/legacy_serial.c powerpc.git/arch/powerpc/kernel/legacy_serial.c
37952 --- linux-2.6.24/arch/powerpc/kernel/legacy_serial.c    2008-01-24 23:58:37.000000000 +0100
37953 +++ powerpc.git/arch/powerpc/kernel/legacy_serial.c     2008-01-28 20:25:49.000000000 +0100
37954 @@ -307,7 +307,7 @@
37955         }
37956  
37957         /* First fill our array with SOC ports */
37958 -       for (np = NULL; (np = of_find_compatible_node(np, "serial", "ns16550")) != NULL;) {
37959 +       for_each_compatible_node(np, "serial", "ns16550") {
37960                 struct device_node *soc = of_get_parent(np);
37961                 if (soc && !strcmp(soc->type, "soc")) {
37962                         index = add_legacy_soc_port(np, np);
37963 @@ -318,7 +318,7 @@
37964         }
37965  
37966         /* First fill our array with ISA ports */
37967 -       for (np = NULL; (np = of_find_node_by_type(np, "serial"));) {
37968 +       for_each_node_by_type(np, "serial") {
37969                 struct device_node *isa = of_get_parent(np);
37970                 if (isa && !strcmp(isa->name, "isa")) {
37971                         index = add_legacy_isa_port(np, isa);
37972 @@ -329,7 +329,7 @@
37973         }
37974  
37975         /* First fill our array with tsi-bridge ports */
37976 -       for (np = NULL; (np = of_find_compatible_node(np, "serial", "ns16550")) != NULL;) {
37977 +       for_each_compatible_node(np, "serial", "ns16550") {
37978                 struct device_node *tsi = of_get_parent(np);
37979                 if (tsi && !strcmp(tsi->type, "tsi-bridge")) {
37980                         index = add_legacy_soc_port(np, np);
37981 @@ -340,7 +340,7 @@
37982         }
37983  
37984         /* First fill our array with opb bus ports */
37985 -       for (np = NULL; (np = of_find_compatible_node(np, "serial", "ns16550")) != NULL;) {
37986 +       for_each_compatible_node(np, "serial", "ns16550") {
37987                 struct device_node *opb = of_get_parent(np);
37988                 if (opb && (!strcmp(opb->type, "opb") ||
37989                             of_device_is_compatible(opb, "ibm,opb"))) {
37990 @@ -474,7 +474,7 @@
37991  
37992         /*
37993          * Before we register the platfrom serial devices, we need
37994 -        * to fixup their interrutps and their IO ports.
37995 +        * to fixup their interrupts and their IO ports.
37996          */
37997         DBG("Fixing serial ports interrupts and IO ports ...\n");
37998  
37999 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/lparcfg.c powerpc.git/arch/powerpc/kernel/lparcfg.c
38000 --- linux-2.6.24/arch/powerpc/kernel/lparcfg.c  2008-01-24 23:58:37.000000000 +0100
38001 +++ powerpc.git/arch/powerpc/kernel/lparcfg.c   2008-01-28 20:25:49.000000000 +0100
38002 @@ -41,7 +41,6 @@
38003  /* #define LPARCFG_DEBUG */
38004  
38005  static struct proc_dir_entry *proc_ppc64_lparcfg;
38006 -#define LPARCFG_BUFF_SIZE 4096
38007  
38008  /*
38009   * Track sum of all purrs across all processors. This is used to further
38010 @@ -595,13 +594,6 @@
38011         ent = create_proc_entry("ppc64/lparcfg", mode, NULL);
38012         if (ent) {
38013                 ent->proc_fops = &lparcfg_fops;
38014 -               ent->data = kmalloc(LPARCFG_BUFF_SIZE, GFP_KERNEL);
38015 -               if (!ent->data) {
38016 -                       printk(KERN_ERR
38017 -                              "Failed to allocate buffer for lparcfg\n");
38018 -                       remove_proc_entry("lparcfg", ent->parent);
38019 -                       return -ENOMEM;
38020 -               }
38021         } else {
38022                 printk(KERN_ERR "Failed to create ppc64/lparcfg\n");
38023                 return -EIO;
38024 @@ -613,10 +605,8 @@
38025  
38026  void __exit lparcfg_cleanup(void)
38027  {
38028 -       if (proc_ppc64_lparcfg) {
38029 -               kfree(proc_ppc64_lparcfg->data);
38030 +       if (proc_ppc64_lparcfg)
38031                 remove_proc_entry("lparcfg", proc_ppc64_lparcfg->parent);
38032 -       }
38033  }
38034  
38035  module_init(lparcfg_init);
38036 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/misc.S powerpc.git/arch/powerpc/kernel/misc.S
38037 --- linux-2.6.24/arch/powerpc/kernel/misc.S     2008-01-24 23:58:37.000000000 +0100
38038 +++ powerpc.git/arch/powerpc/kernel/misc.S      2008-01-28 20:25:49.000000000 +0100
38039 @@ -8,12 +8,17 @@
38040   * Adapted for iSeries by Mike Corrigan (mikejc@us.ibm.com)
38041   * PPC64 updates by Dave Engebretsen (engebret@us.ibm.com)
38042   *
38043 + * setjmp/longjmp code by Paul Mackerras.
38044 + *
38045   * This program is free software; you can redistribute it and/or
38046   * modify it under the terms of the GNU General Public License
38047   * as published by the Free Software Foundation; either version
38048   * 2 of the License, or (at your option) any later version.
38049   */
38050  #include <asm/ppc_asm.h>
38051 +#include <asm/unistd.h>
38052 +#include <asm/asm-compat.h>
38053 +#include <asm/asm-offsets.h>
38054  
38055         .text
38056  
38057 @@ -43,3 +48,71 @@
38058         add     r3,r3,r5
38059         mtlr    r0
38060         blr
38061 +
38062 +_GLOBAL(kernel_execve)
38063 +       li      r0,__NR_execve
38064 +       sc
38065 +       bnslr
38066 +       neg     r3,r3
38067 +       blr
38068 +
38069 +_GLOBAL(setjmp)
38070 +       mflr    r0
38071 +       PPC_STL r0,0(r3)
38072 +       PPC_STL r1,SZL(r3)
38073 +       PPC_STL r2,2*SZL(r3)
38074 +       mfcr    r0
38075 +       PPC_STL r0,3*SZL(r3)
38076 +       PPC_STL r13,4*SZL(r3)
38077 +       PPC_STL r14,5*SZL(r3)
38078 +       PPC_STL r15,6*SZL(r3)
38079 +       PPC_STL r16,7*SZL(r3)
38080 +       PPC_STL r17,8*SZL(r3)
38081 +       PPC_STL r18,9*SZL(r3)
38082 +       PPC_STL r19,10*SZL(r3)
38083 +       PPC_STL r20,11*SZL(r3)
38084 +       PPC_STL r21,12*SZL(r3)
38085 +       PPC_STL r22,13*SZL(r3)
38086 +       PPC_STL r23,14*SZL(r3)
38087 +       PPC_STL r24,15*SZL(r3)
38088 +       PPC_STL r25,16*SZL(r3)
38089 +       PPC_STL r26,17*SZL(r3)
38090 +       PPC_STL r27,18*SZL(r3)
38091 +       PPC_STL r28,19*SZL(r3)
38092 +       PPC_STL r29,20*SZL(r3)
38093 +       PPC_STL r30,21*SZL(r3)
38094 +       PPC_STL r31,22*SZL(r3)
38095 +       li      r3,0
38096 +       blr
38097 +
38098 +_GLOBAL(longjmp)
38099 +       PPC_LCMPI r4,0
38100 +       bne     1f
38101 +       li      r4,1
38102 +1:     PPC_LL  r13,4*SZL(r3)
38103 +       PPC_LL  r14,5*SZL(r3)
38104 +       PPC_LL  r15,6*SZL(r3)
38105 +       PPC_LL  r16,7*SZL(r3)
38106 +       PPC_LL  r17,8*SZL(r3)
38107 +       PPC_LL  r18,9*SZL(r3)
38108 +       PPC_LL  r19,10*SZL(r3)
38109 +       PPC_LL  r20,11*SZL(r3)
38110 +       PPC_LL  r21,12*SZL(r3)
38111 +       PPC_LL  r22,13*SZL(r3)
38112 +       PPC_LL  r23,14*SZL(r3)
38113 +       PPC_LL  r24,15*SZL(r3)
38114 +       PPC_LL  r25,16*SZL(r3)
38115 +       PPC_LL  r26,17*SZL(r3)
38116 +       PPC_LL  r27,18*SZL(r3)
38117 +       PPC_LL  r28,19*SZL(r3)
38118 +       PPC_LL  r29,20*SZL(r3)
38119 +       PPC_LL  r30,21*SZL(r3)
38120 +       PPC_LL  r31,22*SZL(r3)
38121 +       PPC_LL  r0,3*SZL(r3)
38122 +       mtcrf   0x38,r0
38123 +       PPC_LL  r0,0(r3)
38124 +       PPC_LL  r1,SZL(r3)
38125 +       PPC_LL  r2,2*SZL(r3)
38126 +       mtlr    r0
38127 +       mr      r3,r4
38128 +       blr
38129 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/misc_32.S powerpc.git/arch/powerpc/kernel/misc_32.S
38130 --- linux-2.6.24/arch/powerpc/kernel/misc_32.S  2008-01-24 23:58:37.000000000 +0100
38131 +++ powerpc.git/arch/powerpc/kernel/misc_32.S   2008-01-28 20:25:49.000000000 +0100
38132 @@ -206,6 +206,45 @@
38133         isync
38134         blr                     /* Done */
38135  
38136 +#ifdef CONFIG_40x
38137 +
38138 +/*
38139 + * Do an IO access in real mode
38140 + */
38141 +_GLOBAL(real_readb)
38142 +       mfmsr   r7
38143 +       ori     r0,r7,MSR_DR
38144 +       xori    r0,r0,MSR_DR
38145 +       sync
38146 +       mtmsr   r0
38147 +       sync
38148 +       isync
38149 +       lbz     r3,0(r3)
38150 +       sync
38151 +       mtmsr   r7
38152 +       sync
38153 +       isync
38154 +       blr
38155 +
38156 +       /*
38157 + * Do an IO access in real mode
38158 + */
38159 +_GLOBAL(real_writeb)
38160 +       mfmsr   r7
38161 +       ori     r0,r7,MSR_DR
38162 +       xori    r0,r0,MSR_DR
38163 +       sync
38164 +       mtmsr   r0
38165 +       sync
38166 +       isync
38167 +       stb     r3,0(r4)
38168 +       sync
38169 +       mtmsr   r7
38170 +       sync
38171 +       isync
38172 +       blr
38173 +
38174 +#endif /* CONFIG_40x */
38175  
38176  /*
38177   * Flush MMU TLB
38178 @@ -793,13 +832,6 @@
38179         addi    r1,r1,16
38180         blr
38181  
38182 -_GLOBAL(kernel_execve)
38183 -       li      r0,__NR_execve
38184 -       sc
38185 -       bnslr
38186 -       neg     r3,r3
38187 -       blr
38188 -
38189  /*
38190   * This routine is just here to keep GCC happy - sigh...
38191   */
38192 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/misc_64.S powerpc.git/arch/powerpc/kernel/misc_64.S
38193 --- linux-2.6.24/arch/powerpc/kernel/misc_64.S  2008-01-24 23:58:37.000000000 +0100
38194 +++ powerpc.git/arch/powerpc/kernel/misc_64.S   2008-01-28 20:25:49.000000000 +0100
38195 @@ -518,13 +518,6 @@
38196  
38197  #endif /* CONFIG_ALTIVEC */
38198  
38199 -_GLOBAL(kernel_execve)
38200 -       li      r0,__NR_execve
38201 -       sc
38202 -       bnslr
38203 -       neg     r3,r3
38204 -       blr
38205 -
38206  /* kexec_wait(phys_cpu)
38207   *
38208   * wait for the flag to change, indicating this kernel is going away but
38209 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/module_32.c powerpc.git/arch/powerpc/kernel/module_32.c
38210 --- linux-2.6.24/arch/powerpc/kernel/module_32.c        2008-01-24 23:58:37.000000000 +0100
38211 +++ powerpc.git/arch/powerpc/kernel/module_32.c 2008-01-28 20:25:49.000000000 +0100
38212 @@ -24,6 +24,7 @@
38213  #include <linux/kernel.h>
38214  #include <linux/cache.h>
38215  #include <linux/bug.h>
38216 +#include <linux/sort.h>
38217  
38218  #include "setup.h"
38219  
38220 @@ -54,22 +55,60 @@
38221     addend) */
38222  static unsigned int count_relocs(const Elf32_Rela *rela, unsigned int num)
38223  {
38224 -       unsigned int i, j, ret = 0;
38225 +       unsigned int i, r_info, r_addend, _count_relocs;
38226  
38227 -       /* Sure, this is order(n^2), but it's usually short, and not
38228 -           time critical */
38229 -       for (i = 0; i < num; i++) {
38230 -               for (j = 0; j < i; j++) {
38231 -                       /* If this addend appeared before, it's
38232 -                           already been counted */
38233 -                       if (ELF32_R_SYM(rela[i].r_info)
38234 -                           == ELF32_R_SYM(rela[j].r_info)
38235 -                           && rela[i].r_addend == rela[j].r_addend)
38236 -                               break;
38237 +       _count_relocs = 0;
38238 +       r_info = 0;
38239 +       r_addend = 0;
38240 +       for (i = 0; i < num; i++)
38241 +               /* Only count 24-bit relocs, others don't need stubs */
38242 +               if (ELF32_R_TYPE(rela[i].r_info) == R_PPC_REL24 &&
38243 +                   (r_info != ELF32_R_SYM(rela[i].r_info) ||
38244 +                    r_addend != rela[i].r_addend)) {
38245 +                       _count_relocs++;
38246 +                       r_info = ELF32_R_SYM(rela[i].r_info);
38247 +                       r_addend = rela[i].r_addend;
38248                 }
38249 -               if (j == i) ret++;
38250 +
38251 +       return _count_relocs;
38252 +}
38253 +
38254 +static int relacmp(const void *_x, const void *_y)
38255 +{
38256 +       const Elf32_Rela *x, *y;
38257 +
38258 +       y = (Elf32_Rela *)_x;
38259 +       x = (Elf32_Rela *)_y;
38260 +
38261 +       /* Compare the entire r_info (as opposed to ELF32_R_SYM(r_info) only) to
38262 +        * make the comparison cheaper/faster. It won't affect the sorting or
38263 +        * the counting algorithms' performance
38264 +        */
38265 +       if (x->r_info < y->r_info)
38266 +               return -1;
38267 +       else if (x->r_info > y->r_info)
38268 +               return 1;
38269 +       else if (x->r_addend < y->r_addend)
38270 +               return -1;
38271 +       else if (x->r_addend > y->r_addend)
38272 +               return 1;
38273 +       else
38274 +               return 0;
38275 +}
38276 +
38277 +static void relaswap(void *_x, void *_y, int size)
38278 +{
38279 +       uint32_t *x, *y, tmp;
38280 +       int i;
38281 +
38282 +       y = (uint32_t *)_x;
38283 +       x = (uint32_t *)_y;
38284 +
38285 +       for (i = 0; i < sizeof(Elf32_Rela) / sizeof(uint32_t); i++) {
38286 +               tmp = x[i];
38287 +               x[i] = y[i];
38288 +               y[i] = tmp;
38289         }
38290 -       return ret;
38291  }
38292  
38293  /* Get the potential trampolines size required of the init and
38294 @@ -100,6 +139,16 @@
38295                         DEBUGP("Ptr: %p.  Number: %u\n",
38296                                (void *)hdr + sechdrs[i].sh_offset,
38297                                sechdrs[i].sh_size / sizeof(Elf32_Rela));
38298 +
38299 +                       /* Sort the relocation information based on a symbol and
38300 +                        * addend key. This is a stable O(n*log n) complexity
38301 +                        * alogrithm but it will reduce the complexity of
38302 +                        * count_relocs() to linear complexity O(n)
38303 +                        */
38304 +                       sort((void *)hdr + sechdrs[i].sh_offset,
38305 +                            sechdrs[i].sh_size / sizeof(Elf32_Rela),
38306 +                            sizeof(Elf32_Rela), relacmp, relaswap);
38307 +
38308                         ret += count_relocs((void *)hdr
38309                                              + sechdrs[i].sh_offset,
38310                                              sechdrs[i].sh_size
38311 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/module_64.c powerpc.git/arch/powerpc/kernel/module_64.c
38312 --- linux-2.6.24/arch/powerpc/kernel/module_64.c        2008-01-24 23:58:37.000000000 +0100
38313 +++ powerpc.git/arch/powerpc/kernel/module_64.c 2008-01-28 20:25:49.000000000 +0100
38314 @@ -24,6 +24,7 @@
38315  #include <asm/module.h>
38316  #include <asm/uaccess.h>
38317  #include <asm/firmware.h>
38318 +#include <linux/sort.h>
38319  
38320  #include "setup.h"
38321  
38322 @@ -81,25 +82,23 @@
38323     different addend) */
38324  static unsigned int count_relocs(const Elf64_Rela *rela, unsigned int num)
38325  {
38326 -       unsigned int i, j, ret = 0;
38327 +       unsigned int i, r_info, r_addend, _count_relocs;
38328  
38329         /* FIXME: Only count external ones --RR */
38330 -       /* Sure, this is order(n^2), but it's usually short, and not
38331 -           time critical */
38332 -       for (i = 0; i < num; i++) {
38333 +       _count_relocs = 0;
38334 +       r_info = 0;
38335 +       r_addend = 0;
38336 +       for (i = 0; i < num; i++)
38337                 /* Only count 24-bit relocs, others don't need stubs */
38338 -               if (ELF64_R_TYPE(rela[i].r_info) != R_PPC_REL24)
38339 -                       continue;
38340 -               for (j = 0; j < i; j++) {
38341 -                       /* If this addend appeared before, it's
38342 -                           already been counted */
38343 -                       if (rela[i].r_info == rela[j].r_info
38344 -                           && rela[i].r_addend == rela[j].r_addend)
38345 -                               break;
38346 +               if (ELF64_R_TYPE(rela[i].r_info) == R_PPC_REL24 &&
38347 +                   (r_info != ELF64_R_SYM(rela[i].r_info) ||
38348 +                    r_addend != rela[i].r_addend)) {
38349 +                       _count_relocs++;
38350 +                       r_info = ELF64_R_SYM(rela[i].r_info);
38351 +                       r_addend = rela[i].r_addend;
38352                 }
38353 -               if (j == i) ret++;
38354 -       }
38355 -       return ret;
38356 +
38357 +       return _count_relocs;
38358  }
38359  
38360  void *module_alloc(unsigned long size)
38361 @@ -118,6 +117,44 @@
38362             table entries. */
38363  }
38364  
38365 +static int relacmp(const void *_x, const void *_y)
38366 +{
38367 +       const Elf64_Rela *x, *y;
38368 +
38369 +       y = (Elf64_Rela *)_x;
38370 +       x = (Elf64_Rela *)_y;
38371 +
38372 +       /* Compare the entire r_info (as opposed to ELF64_R_SYM(r_info) only) to
38373 +        * make the comparison cheaper/faster. It won't affect the sorting or
38374 +        * the counting algorithms' performance
38375 +        */
38376 +       if (x->r_info < y->r_info)
38377 +               return -1;
38378 +       else if (x->r_info > y->r_info)
38379 +               return 1;
38380 +       else if (x->r_addend < y->r_addend)
38381 +               return -1;
38382 +       else if (x->r_addend > y->r_addend)
38383 +               return 1;
38384 +       else
38385 +               return 0;
38386 +}
38387 +
38388 +static void relaswap(void *_x, void *_y, int size)
38389 +{
38390 +       uint64_t *x, *y, tmp;
38391 +       int i;
38392 +
38393 +       y = (uint64_t *)_x;
38394 +       x = (uint64_t *)_y;
38395 +
38396 +       for (i = 0; i < sizeof(Elf64_Rela) / sizeof(uint64_t); i++) {
38397 +               tmp = x[i];
38398 +               x[i] = y[i];
38399 +               y[i] = tmp;
38400 +       }
38401 +}
38402 +
38403  /* Get size of potential trampolines required. */
38404  static unsigned long get_stubs_size(const Elf64_Ehdr *hdr,
38405                                     const Elf64_Shdr *sechdrs)
38406 @@ -133,6 +170,16 @@
38407                         DEBUGP("Ptr: %p.  Number: %lu\n",
38408                                (void *)sechdrs[i].sh_addr,
38409                                sechdrs[i].sh_size / sizeof(Elf64_Rela));
38410 +
38411 +                       /* Sort the relocation information based on a symbol and
38412 +                        * addend key. This is a stable O(n*log n) complexity
38413 +                        * alogrithm but it will reduce the complexity of
38414 +                        * count_relocs() to linear complexity O(n)
38415 +                        */
38416 +                       sort((void *)sechdrs[i].sh_addr,
38417 +                            sechdrs[i].sh_size / sizeof(Elf64_Rela),
38418 +                            sizeof(Elf64_Rela), relacmp, relaswap);
38419 +
38420                         relocs += count_relocs((void *)sechdrs[i].sh_addr,
38421                                                sechdrs[i].sh_size
38422                                                / sizeof(Elf64_Rela));
38423 @@ -343,7 +390,7 @@
38424                         /* Simply set it */
38425                         *(u32 *)location = value;
38426                         break;
38427 -                       
38428 +
38429                 case R_PPC64_ADDR64:
38430                         /* Simply set it */
38431                         *(unsigned long *)location = value;
38432 @@ -399,7 +446,7 @@
38433                         }
38434  
38435                         /* Only replace bits 2 through 26 */
38436 -                       *(uint32_t *)location 
38437 +                       *(uint32_t *)location
38438                                 = (*(uint32_t *)location & ~0x03fffffc)
38439                                 | (value & 0x03fffffc);
38440                         break;
38441 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/of_device.c powerpc.git/arch/powerpc/kernel/of_device.c
38442 --- linux-2.6.24/arch/powerpc/kernel/of_device.c        2008-01-24 23:58:37.000000000 +0100
38443 +++ powerpc.git/arch/powerpc/kernel/of_device.c 2008-01-28 20:25:49.000000000 +0100
38444 @@ -5,10 +5,10 @@
38445  #include <linux/module.h>
38446  #include <linux/mod_devicetable.h>
38447  #include <linux/slab.h>
38448 +#include <linux/of_device.h>
38449  
38450  #include <asm/errno.h>
38451  #include <asm/dcr.h>
38452 -#include <asm/of_device.h>
38453  
38454  static void of_device_make_bus_id(struct of_device *dev)
38455  {
38456 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/of_platform.c powerpc.git/arch/powerpc/kernel/of_platform.c
38457 --- linux-2.6.24/arch/powerpc/kernel/of_platform.c      2008-01-24 23:58:37.000000000 +0100
38458 +++ powerpc.git/arch/powerpc/kernel/of_platform.c       2008-01-28 20:25:49.000000000 +0100
38459 @@ -19,6 +19,7 @@
38460  #include <linux/mod_devicetable.h>
38461  #include <linux/slab.h>
38462  #include <linux/pci.h>
38463 +#include <linux/of.h>
38464  #include <linux/of_device.h>
38465  #include <linux/of_platform.h>
38466  
38467 @@ -40,7 +41,7 @@
38468   * a bus type in the list
38469   */
38470  
38471 -static struct of_device_id of_default_bus_ids[] = {
38472 +static const struct of_device_id of_default_bus_ids[] = {
38473         { .type = "soc", },
38474         { .compatible = "soc", },
38475         { .type = "spider", },
38476 @@ -64,26 +65,6 @@
38477  
38478  postcore_initcall(of_bus_driver_init);
38479  
38480 -int of_register_platform_driver(struct of_platform_driver *drv)
38481 -{
38482 -       /* initialize common driver fields */
38483 -       if (!drv->driver.name)
38484 -               drv->driver.name = drv->name;
38485 -       if (!drv->driver.owner)
38486 -               drv->driver.owner = drv->owner;
38487 -       drv->driver.bus = &of_platform_bus_type;
38488 -
38489 -       /* register with core */
38490 -       return driver_register(&drv->driver);
38491 -}
38492 -EXPORT_SYMBOL(of_register_platform_driver);
38493 -
38494 -void of_unregister_platform_driver(struct of_platform_driver *drv)
38495 -{
38496 -       driver_unregister(&drv->driver);
38497 -}
38498 -EXPORT_SYMBOL(of_unregister_platform_driver);
38499 -
38500  struct of_device* of_platform_device_create(struct device_node *np,
38501                                             const char *bus_id,
38502                                             struct device *parent)
38503 @@ -120,15 +101,15 @@
38504   * @matches: match table, NULL to use the default, OF_NO_DEEP_PROBE to
38505   * disallow recursive creation of child busses
38506   */
38507 -static int of_platform_bus_create(struct device_node *bus,
38508 -                                 struct of_device_id *matches,
38509 +static int of_platform_bus_create(const struct device_node *bus,
38510 +                                 const struct of_device_id *matches,
38511                                   struct device *parent)
38512  {
38513         struct device_node *child;
38514         struct of_device *dev;
38515         int rc = 0;
38516  
38517 -       for (child = NULL; (child = of_get_next_child(bus, child)); ) {
38518 +       for_each_child_of_node(bus, child) {
38519                 pr_debug("   create child: %s\n", child->full_name);
38520                 dev = of_platform_device_create(child, NULL, parent);
38521                 if (dev == NULL)
38522 @@ -157,7 +138,7 @@
38523   */
38524  
38525  int of_platform_bus_probe(struct device_node *root,
38526 -                         struct of_device_id *matches,
38527 +                         const struct of_device_id *matches,
38528                           struct device *parent)
38529  {
38530         struct device_node *child;
38531 @@ -190,7 +171,7 @@
38532                 rc = of_platform_bus_create(root, matches, &dev->dev);
38533                 goto bail;
38534         }
38535 -       for (child = NULL; (child = of_get_next_child(root, child)); ) {
38536 +       for_each_child_of_node(root, child) {
38537                 if (!of_match_node(matches, child))
38538                         continue;
38539  
38540 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/pci-common.c powerpc.git/arch/powerpc/kernel/pci-common.c
38541 --- linux-2.6.24/arch/powerpc/kernel/pci-common.c       2008-01-24 23:58:37.000000000 +0100
38542 +++ powerpc.git/arch/powerpc/kernel/pci-common.c        2008-01-28 20:25:49.000000000 +0100
38543 @@ -48,32 +48,26 @@
38544  static DEFINE_SPINLOCK(hose_spinlock);
38545  
38546  /* XXX kill that some day ... */
38547 -int global_phb_number;         /* Global phb counter */
38548 +static int global_phb_number;          /* Global phb counter */
38549  
38550 -extern struct list_head hose_list;
38551 +/* ISA Memory physical address */
38552 +resource_size_t isa_mem_base;
38553  
38554 -/*
38555 - * pci_controller(phb) initialized common variables.
38556 - */
38557 -static void __devinit pci_setup_pci_controller(struct pci_controller *hose)
38558 -{
38559 -       memset(hose, 0, sizeof(struct pci_controller));
38560 -
38561 -       spin_lock(&hose_spinlock);
38562 -       hose->global_number = global_phb_number++;
38563 -       list_add_tail(&hose->list_node, &hose_list);
38564 -       spin_unlock(&hose_spinlock);
38565 -}
38566 +/* Default PCI flags is 0 */
38567 +unsigned int ppc_pci_flags;
38568  
38569 -struct pci_controller * pcibios_alloc_controller(struct device_node *dev)
38570 +struct pci_controller *pcibios_alloc_controller(struct device_node *dev)
38571  {
38572         struct pci_controller *phb;
38573  
38574 -       phb = alloc_maybe_bootmem(sizeof(struct pci_controller), GFP_KERNEL);
38575 +       phb = zalloc_maybe_bootmem(sizeof(struct pci_controller), GFP_KERNEL);
38576         if (phb == NULL)
38577                 return NULL;
38578 -       pci_setup_pci_controller(phb);
38579 -       phb->arch_data = dev;
38580 +       spin_lock(&hose_spinlock);
38581 +       phb->global_number = global_phb_number++;
38582 +       list_add_tail(&phb->list_node, &hose_list);
38583 +       spin_unlock(&hose_spinlock);
38584 +       phb->dn = dev;
38585         phb->is_dynamic = mem_init_done;
38586  #ifdef CONFIG_PPC64
38587         if (dev) {
38588 @@ -126,15 +120,10 @@
38589   */
38590  int pci_domain_nr(struct pci_bus *bus)
38591  {
38592 -       if (firmware_has_feature(FW_FEATURE_ISERIES))
38593 -               return 0;
38594 -       else {
38595 -               struct pci_controller *hose = pci_bus_to_host(bus);
38596 +       struct pci_controller *hose = pci_bus_to_host(bus);
38597  
38598 -               return hose->global_number;
38599 -       }
38600 +       return hose->global_number;
38601  }
38602 -
38603  EXPORT_SYMBOL(pci_domain_nr);
38604  
38605  #ifdef CONFIG_PPC_OF
38606 @@ -153,7 +142,7 @@
38607         while(node) {
38608                 struct pci_controller *hose, *tmp;
38609                 list_for_each_entry_safe(hose, tmp, &hose_list, list_node)
38610 -                       if (hose->arch_data == node)
38611 +                       if (hose->dn == node)
38612                                 return hose;
38613                 node = node->parent;
38614         }
38615 @@ -201,6 +190,20 @@
38616         struct of_irq oirq;
38617         unsigned int virq;
38618  
38619 +       /* The current device-tree that iSeries generates from the HV
38620 +        * PCI informations doesn't contain proper interrupt routing,
38621 +        * and all the fallback would do is print out crap, so we
38622 +        * don't attempt to resolve the interrupts here at all, some
38623 +        * iSeries specific fixup does it.
38624 +        *
38625 +        * In the long run, we will hopefully fix the generated device-tree
38626 +        * instead.
38627 +        */
38628 +#ifdef CONFIG_PPC_ISERIES
38629 +       if (firmware_has_feature(FW_FEATURE_ISERIES))
38630 +               return -1;
38631 +#endif
38632 +
38633         DBG("Try to map irq for %s...\n", pci_name(pci_dev));
38634  
38635  #ifdef DEBUG
38636 @@ -222,10 +225,11 @@
38637                 if (pin == 0)
38638                         return -1;
38639                 if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_LINE, &line) ||
38640 -                   line == 0xff) {
38641 +                   line == 0xff || line == 0) {
38642                         return -1;
38643                 }
38644 -               DBG(" -> no map ! Using irq line %d from PCI config\n", line);
38645 +               DBG(" -> no map ! Using line %d (pin %d) from PCI config\n",
38646 +                   line, pin);
38647  
38648                 virq = irq_create_mapping(NULL, line);
38649                 if (virq != NO_IRQ)
38650 @@ -475,3 +479,717 @@
38651         *start = rsrc->start - offset;
38652         *end = rsrc->end - offset;
38653  }
38654 +
38655 +/**
38656 + * pci_process_bridge_OF_ranges - Parse PCI bridge resources from device tree
38657 + * @hose: newly allocated pci_controller to be setup
38658 + * @dev: device node of the host bridge
38659 + * @primary: set if primary bus (32 bits only, soon to be deprecated)
38660 + *
38661 + * This function will parse the "ranges" property of a PCI host bridge device
38662 + * node and setup the resource mapping of a pci controller based on its
38663 + * content.
38664 + *
38665 + * Life would be boring if it wasn't for a few issues that we have to deal
38666 + * with here:
38667 + *
38668 + *   - We can only cope with one IO space range and up to 3 Memory space
38669 + *     ranges. However, some machines (thanks Apple !) tend to split their
38670 + *     space into lots of small contiguous ranges. So we have to coalesce.
38671 + *
38672 + *   - We can only cope with all memory ranges having the same offset
38673 + *     between CPU addresses and PCI addresses. Unfortunately, some bridges
38674 + *     are setup for a large 1:1 mapping along with a small "window" which
38675 + *     maps PCI address 0 to some arbitrary high address of the CPU space in
38676 + *     order to give access to the ISA memory hole.
38677 + *     The way out of here that I've chosen for now is to always set the
38678 + *     offset based on the first resource found, then override it if we
38679 + *     have a different offset and the previous was set by an ISA hole.
38680 + *
38681 + *   - Some busses have IO space not starting at 0, which causes trouble with
38682 + *     the way we do our IO resource renumbering. The code somewhat deals with
38683 + *     it for 64 bits but I would expect problems on 32 bits.
38684 + *
38685 + *   - Some 32 bits platforms such as 4xx can have physical space larger than
38686 + *     32 bits so we need to use 64 bits values for the parsing
38687 + */
38688 +void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose,
38689 +                                           struct device_node *dev,
38690 +                                           int primary)
38691 +{
38692 +       const u32 *ranges;
38693 +       int rlen;
38694 +       int pna = of_n_addr_cells(dev);
38695 +       int np = pna + 5;
38696 +       int memno = 0, isa_hole = -1;
38697 +       u32 pci_space;
38698 +       unsigned long long pci_addr, cpu_addr, pci_next, cpu_next, size;
38699 +       unsigned long long isa_mb = 0;
38700 +       struct resource *res;
38701 +
38702 +       printk(KERN_INFO "PCI host bridge %s %s ranges:\n",
38703 +              dev->full_name, primary ? "(primary)" : "");
38704 +
38705 +       /* Get ranges property */
38706 +       ranges = of_get_property(dev, "ranges", &rlen);
38707 +       if (ranges == NULL)
38708 +               return;
38709 +
38710 +       /* Parse it */
38711 +       while ((rlen -= np * 4) >= 0) {
38712 +               /* Read next ranges element */
38713 +               pci_space = ranges[0];
38714 +               pci_addr = of_read_number(ranges + 1, 2);
38715 +               cpu_addr = of_translate_address(dev, ranges + 3);
38716 +               size = of_read_number(ranges + pna + 3, 2);
38717 +               ranges += np;
38718 +               if (cpu_addr == OF_BAD_ADDR || size == 0)
38719 +                       continue;
38720 +
38721 +               /* Now consume following elements while they are contiguous */
38722 +               for (; rlen >= np * sizeof(u32);
38723 +                    ranges += np, rlen -= np * 4) {
38724 +                       if (ranges[0] != pci_space)
38725 +                               break;
38726 +                       pci_next = of_read_number(ranges + 1, 2);
38727 +                       cpu_next = of_translate_address(dev, ranges + 3);
38728 +                       if (pci_next != pci_addr + size ||
38729 +                           cpu_next != cpu_addr + size)
38730 +                               break;
38731 +                       size += of_read_number(ranges + pna + 3, 2);
38732 +               }
38733 +
38734 +               /* Act based on address space type */
38735 +               res = NULL;
38736 +               switch ((pci_space >> 24) & 0x3) {
38737 +               case 1:         /* PCI IO space */
38738 +                       printk(KERN_INFO
38739 +                              "  IO 0x%016llx..0x%016llx -> 0x%016llx\n",
38740 +                              cpu_addr, cpu_addr + size - 1, pci_addr);
38741 +
38742 +                       /* We support only one IO range */
38743 +                       if (hose->pci_io_size) {
38744 +                               printk(KERN_INFO
38745 +                                      " \\--> Skipped (too many) !\n");
38746 +                               continue;
38747 +                       }
38748 +#ifdef CONFIG_PPC32
38749 +                       /* On 32 bits, limit I/O space to 16MB */
38750 +                       if (size > 0x01000000)
38751 +                               size = 0x01000000;
38752 +
38753 +                       /* 32 bits needs to map IOs here */
38754 +                       hose->io_base_virt = ioremap(cpu_addr, size);
38755 +
38756 +                       /* Expect trouble if pci_addr is not 0 */
38757 +                       if (primary)
38758 +                               isa_io_base =
38759 +                                       (unsigned long)hose->io_base_virt;
38760 +#endif /* CONFIG_PPC32 */
38761 +                       /* pci_io_size and io_base_phys always represent IO
38762 +                        * space starting at 0 so we factor in pci_addr
38763 +                        */
38764 +                       hose->pci_io_size = pci_addr + size;
38765 +                       hose->io_base_phys = cpu_addr - pci_addr;
38766 +
38767 +                       /* Build resource */
38768 +                       res = &hose->io_resource;
38769 +                       res->flags = IORESOURCE_IO;
38770 +                       res->start = pci_addr;
38771 +                       break;
38772 +               case 2:         /* PCI Memory space */
38773 +                       printk(KERN_INFO
38774 +                              " MEM 0x%016llx..0x%016llx -> 0x%016llx %s\n",
38775 +                              cpu_addr, cpu_addr + size - 1, pci_addr,
38776 +                              (pci_space & 0x40000000) ? "Prefetch" : "");
38777 +
38778 +                       /* We support only 3 memory ranges */
38779 +                       if (memno >= 3) {
38780 +                               printk(KERN_INFO
38781 +                                      " \\--> Skipped (too many) !\n");
38782 +                               continue;
38783 +                       }
38784 +                       /* Handles ISA memory hole space here */
38785 +                       if (pci_addr == 0) {
38786 +                               isa_mb = cpu_addr;
38787 +                               isa_hole = memno;
38788 +                               if (primary || isa_mem_base == 0)
38789 +                                       isa_mem_base = cpu_addr;
38790 +                       }
38791 +
38792 +                       /* We get the PCI/Mem offset from the first range or
38793 +                        * the, current one if the offset came from an ISA
38794 +                        * hole. If they don't match, bugger.
38795 +                        */
38796 +                       if (memno == 0 ||
38797 +                           (isa_hole >= 0 && pci_addr != 0 &&
38798 +                            hose->pci_mem_offset == isa_mb))
38799 +                               hose->pci_mem_offset = cpu_addr - pci_addr;
38800 +                       else if (pci_addr != 0 &&
38801 +                                hose->pci_mem_offset != cpu_addr - pci_addr) {
38802 +                               printk(KERN_INFO
38803 +                                      " \\--> Skipped (offset mismatch) !\n");
38804 +                               continue;
38805 +                       }
38806 +
38807 +                       /* Build resource */
38808 +                       res = &hose->mem_resources[memno++];
38809 +                       res->flags = IORESOURCE_MEM;
38810 +                       if (pci_space & 0x40000000)
38811 +                               res->flags |= IORESOURCE_PREFETCH;
38812 +                       res->start = cpu_addr;
38813 +                       break;
38814 +               }
38815 +               if (res != NULL) {
38816 +                       res->name = dev->full_name;
38817 +                       res->end = res->start + size - 1;
38818 +                       res->parent = NULL;
38819 +                       res->sibling = NULL;
38820 +                       res->child = NULL;
38821 +               }
38822 +       }
38823 +
38824 +       /* Out of paranoia, let's put the ISA hole last if any */
38825 +       if (isa_hole >= 0 && memno > 0 && isa_hole != (memno-1)) {
38826 +               struct resource tmp = hose->mem_resources[isa_hole];
38827 +               hose->mem_resources[isa_hole] = hose->mem_resources[memno-1];
38828 +               hose->mem_resources[memno-1] = tmp;
38829 +       }
38830 +}
38831 +
38832 +/* Decide whether to display the domain number in /proc */
38833 +int pci_proc_domain(struct pci_bus *bus)
38834 +{
38835 +       struct pci_controller *hose = pci_bus_to_host(bus);
38836 +#ifdef CONFIG_PPC64
38837 +       return hose->buid != 0;
38838 +#else
38839 +       if (!(ppc_pci_flags & PPC_PCI_ENABLE_PROC_DOMAINS))
38840 +               return 0;
38841 +       if (ppc_pci_flags & PPC_PCI_COMPAT_DOMAIN_0)
38842 +               return hose->global_number != 0;
38843 +       return 1;
38844 +#endif
38845 +}
38846 +
38847 +void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
38848 +                            struct resource *res)
38849 +{
38850 +       resource_size_t offset = 0, mask = (resource_size_t)-1;
38851 +       struct pci_controller *hose = pci_bus_to_host(dev->bus);
38852 +
38853 +       if (!hose)
38854 +               return;
38855 +       if (res->flags & IORESOURCE_IO) {
38856 +               offset = (unsigned long)hose->io_base_virt - _IO_BASE;
38857 +               mask = 0xffffffffu;
38858 +       } else if (res->flags & IORESOURCE_MEM)
38859 +               offset = hose->pci_mem_offset;
38860 +
38861 +       region->start = (res->start - offset) & mask;
38862 +       region->end = (res->end - offset) & mask;
38863 +}
38864 +EXPORT_SYMBOL(pcibios_resource_to_bus);
38865 +
38866 +void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
38867 +                            struct pci_bus_region *region)
38868 +{
38869 +       resource_size_t offset = 0, mask = (resource_size_t)-1;
38870 +       struct pci_controller *hose = pci_bus_to_host(dev->bus);
38871 +
38872 +       if (!hose)
38873 +               return;
38874 +       if (res->flags & IORESOURCE_IO) {
38875 +               offset = (unsigned long)hose->io_base_virt - _IO_BASE;
38876 +               mask = 0xffffffffu;
38877 +       } else if (res->flags & IORESOURCE_MEM)
38878 +               offset = hose->pci_mem_offset;
38879 +       res->start = (region->start + offset) & mask;
38880 +       res->end = (region->end + offset) & mask;
38881 +}
38882 +EXPORT_SYMBOL(pcibios_bus_to_resource);
38883 +
38884 +/* Fixup a bus resource into a linux resource */
38885 +static void __devinit fixup_resource(struct resource *res, struct pci_dev *dev)
38886 +{
38887 +       struct pci_controller *hose = pci_bus_to_host(dev->bus);
38888 +       resource_size_t offset = 0, mask = (resource_size_t)-1;
38889 +
38890 +       if (res->flags & IORESOURCE_IO) {
38891 +               offset = (unsigned long)hose->io_base_virt - _IO_BASE;
38892 +               mask = 0xffffffffu;
38893 +       } else if (res->flags & IORESOURCE_MEM)
38894 +               offset = hose->pci_mem_offset;
38895 +
38896 +       res->start = (res->start + offset) & mask;
38897 +       res->end = (res->end + offset) & mask;
38898 +
38899 +       pr_debug("PCI:%s            %016llx-%016llx\n",
38900 +                pci_name(dev),
38901 +                (unsigned long long)res->start,
38902 +                (unsigned long long)res->end);
38903 +}
38904 +
38905 +
38906 +/* This header fixup will do the resource fixup for all devices as they are
38907 + * probed, but not for bridge ranges
38908 + */
38909 +static void __devinit pcibios_fixup_resources(struct pci_dev *dev)
38910 +{
38911 +       struct pci_controller *hose = pci_bus_to_host(dev->bus);
38912 +       int i;
38913 +
38914 +       if (!hose) {
38915 +               printk(KERN_ERR "No host bridge for PCI dev %s !\n",
38916 +                      pci_name(dev));
38917 +               return;
38918 +       }
38919 +       for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
38920 +               struct resource *res = dev->resource + i;
38921 +               if (!res->flags)
38922 +                       continue;
38923 +               if (res->end == 0xffffffff) {
38924 +                       pr_debug("PCI:%s Resource %d %016llx-%016llx [%x] is unassigned\n",
38925 +                                pci_name(dev), i,
38926 +                                (unsigned long long)res->start,
38927 +                                (unsigned long long)res->end,
38928 +                                (unsigned int)res->flags);
38929 +                       res->end -= res->start;
38930 +                       res->start = 0;
38931 +                       res->flags |= IORESOURCE_UNSET;
38932 +                       continue;
38933 +               }
38934 +
38935 +               pr_debug("PCI:%s Resource %d %016llx-%016llx [%x] fixup...\n",
38936 +                        pci_name(dev), i,
38937 +                        (unsigned long long)res->start,\
38938 +                        (unsigned long long)res->end,
38939 +                        (unsigned int)res->flags);
38940 +
38941 +               fixup_resource(res, dev);
38942 +       }
38943 +
38944 +       /* Call machine specific resource fixup */
38945 +       if (ppc_md.pcibios_fixup_resources)
38946 +               ppc_md.pcibios_fixup_resources(dev);
38947 +}
38948 +DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pcibios_fixup_resources);
38949 +
38950 +static void __devinit __pcibios_fixup_bus(struct pci_bus *bus)
38951 +{
38952 +       struct pci_controller *hose = pci_bus_to_host(bus);
38953 +       struct pci_dev *dev = bus->self;
38954 +
38955 +       pr_debug("PCI: Fixup bus %d (%s)\n", bus->number, dev ? pci_name(dev) : "PHB");
38956 +
38957 +       /* Fixup PCI<->PCI bridges. Host bridges are handled separately, for
38958 +        * now differently between 32 and 64 bits.
38959 +        */
38960 +       if (dev != NULL) {
38961 +               struct resource *res;
38962 +               int i;
38963 +
38964 +               for (i = 0; i < PCI_BUS_NUM_RESOURCES; ++i) {
38965 +                       if ((res = bus->resource[i]) == NULL)
38966 +                               continue;
38967 +                       if (!res->flags)
38968 +                               continue;
38969 +                       if (i >= 3 && bus->self->transparent)
38970 +                               continue;
38971 +                       /* On PowerMac, Apple leaves bridge windows open over
38972 +                        * an inaccessible region of memory space (0...fffff)
38973 +                        * which is somewhat bogus, but that's what they think
38974 +                        * means disabled...
38975 +                        *
38976 +                        * We clear those to force them to be reallocated later
38977 +                        *
38978 +                        * We detect such regions by the fact that the base is
38979 +                        * equal to the pci_mem_offset of the host bridge and
38980 +                        * their size is smaller than 1M.
38981 +                        */
38982 +                       if (res->flags & IORESOURCE_MEM &&
38983 +                           res->start == hose->pci_mem_offset &&
38984 +                           res->end < 0x100000) {
38985 +                               printk(KERN_INFO
38986 +                                      "PCI: Closing bogus Apple Firmware"
38987 +                                      " region %d on bus 0x%02x\n",
38988 +                                      i, bus->number);
38989 +                               res->flags = 0;
38990 +                               continue;
38991 +                       }
38992 +
38993 +                       pr_debug("PCI:%s Bus rsrc %d %016llx-%016llx [%x] fixup...\n",
38994 +                                pci_name(dev), i,
38995 +                                (unsigned long long)res->start,\
38996 +                                (unsigned long long)res->end,
38997 +                                (unsigned int)res->flags);
38998 +
38999 +                       fixup_resource(res, dev);
39000 +               }
39001 +       }
39002 +
39003 +       /* Additional setup that is different between 32 and 64 bits for now */
39004 +       pcibios_do_bus_setup(bus);
39005 +
39006 +       /* Platform specific bus fixups */
39007 +       if (ppc_md.pcibios_fixup_bus)
39008 +               ppc_md.pcibios_fixup_bus(bus);
39009 +
39010 +       /* Read default IRQs and fixup if necessary */
39011 +       list_for_each_entry(dev, &bus->devices, bus_list) {
39012 +               pci_read_irq_line(dev);
39013 +               if (ppc_md.pci_irq_fixup)
39014 +                       ppc_md.pci_irq_fixup(dev);
39015 +       }
39016 +}
39017 +
39018 +void __devinit pcibios_fixup_bus(struct pci_bus *bus)
39019 +{
39020 +       /* When called from the generic PCI probe, read PCI<->PCI bridge
39021 +        * bases before proceeding
39022 +        */
39023 +       if (bus->self != NULL)
39024 +               pci_read_bridge_bases(bus);
39025 +       __pcibios_fixup_bus(bus);
39026 +}
39027 +EXPORT_SYMBOL(pcibios_fixup_bus);
39028 +
39029 +/* When building a bus from the OF tree rather than probing, we need a
39030 + * slightly different version of the fixup which doesn't read the
39031 + * bridge bases using config space accesses
39032 + */
39033 +void __devinit pcibios_fixup_of_probed_bus(struct pci_bus *bus)
39034 +{
39035 +       __pcibios_fixup_bus(bus);
39036 +}
39037 +
39038 +static int skip_isa_ioresource_align(struct pci_dev *dev)
39039 +{
39040 +       if ((ppc_pci_flags & PPC_PCI_CAN_SKIP_ISA_ALIGN) &&
39041 +           !(dev->bus->bridge_ctl & PCI_BRIDGE_CTL_ISA))
39042 +               return 1;
39043 +       return 0;
39044 +}
39045 +
39046 +/*
39047 + * We need to avoid collisions with `mirrored' VGA ports
39048 + * and other strange ISA hardware, so we always want the
39049 + * addresses to be allocated in the 0x000-0x0ff region
39050 + * modulo 0x400.
39051 + *
39052 + * Why? Because some silly external IO cards only decode
39053 + * the low 10 bits of the IO address. The 0x00-0xff region
39054 + * is reserved for motherboard devices that decode all 16
39055 + * bits, so it's ok to allocate at, say, 0x2800-0x28ff,
39056 + * but we want to try to avoid allocating at 0x2900-0x2bff
39057 + * which might have be mirrored at 0x0100-0x03ff..
39058 + */
39059 +void pcibios_align_resource(void *data, struct resource *res,
39060 +                               resource_size_t size, resource_size_t align)
39061 +{
39062 +       struct pci_dev *dev = data;
39063 +
39064 +       if (res->flags & IORESOURCE_IO) {
39065 +               resource_size_t start = res->start;
39066 +
39067 +               if (skip_isa_ioresource_align(dev))
39068 +                       return;
39069 +               if (start & 0x300) {
39070 +                       start = (start + 0x3ff) & ~0x3ff;
39071 +                       res->start = start;
39072 +               }
39073 +       }
39074 +}
39075 +EXPORT_SYMBOL(pcibios_align_resource);
39076 +
39077 +/*
39078 + * Reparent resource children of pr that conflict with res
39079 + * under res, and make res replace those children.
39080 + */
39081 +static int __init reparent_resources(struct resource *parent,
39082 +                                    struct resource *res)
39083 +{
39084 +       struct resource *p, **pp;
39085 +       struct resource **firstpp = NULL;
39086 +
39087 +       for (pp = &parent->child; (p = *pp) != NULL; pp = &p->sibling) {
39088 +               if (p->end < res->start)
39089 +                       continue;
39090 +               if (res->end < p->start)
39091 +                       break;
39092 +               if (p->start < res->start || p->end > res->end)
39093 +                       return -1;      /* not completely contained */
39094 +               if (firstpp == NULL)
39095 +                       firstpp = pp;
39096 +       }
39097 +       if (firstpp == NULL)
39098 +               return -1;      /* didn't find any conflicting entries? */
39099 +       res->parent = parent;
39100 +       res->child = *firstpp;
39101 +       res->sibling = *pp;
39102 +       *firstpp = res;
39103 +       *pp = NULL;
39104 +       for (p = res->child; p != NULL; p = p->sibling) {
39105 +               p->parent = res;
39106 +               DBG(KERN_INFO "PCI: reparented %s [%llx..%llx] under %s\n",
39107 +                   p->name,
39108 +                   (unsigned long long)p->start,
39109 +                   (unsigned long long)p->end, res->name);
39110 +       }
39111 +       return 0;
39112 +}
39113 +
39114 +/*
39115 + *  Handle resources of PCI devices.  If the world were perfect, we could
39116 + *  just allocate all the resource regions and do nothing more.  It isn't.
39117 + *  On the other hand, we cannot just re-allocate all devices, as it would
39118 + *  require us to know lots of host bridge internals.  So we attempt to
39119 + *  keep as much of the original configuration as possible, but tweak it
39120 + *  when it's found to be wrong.
39121 + *
39122 + *  Known BIOS problems we have to work around:
39123 + *     - I/O or memory regions not configured
39124 + *     - regions configured, but not enabled in the command register
39125 + *     - bogus I/O addresses above 64K used
39126 + *     - expansion ROMs left enabled (this may sound harmless, but given
39127 + *       the fact the PCI specs explicitly allow address decoders to be
39128 + *       shared between expansion ROMs and other resource regions, it's
39129 + *       at least dangerous)
39130 + *
39131 + *  Our solution:
39132 + *     (1) Allocate resources for all buses behind PCI-to-PCI bridges.
39133 + *         This gives us fixed barriers on where we can allocate.
39134 + *     (2) Allocate resources for all enabled devices.  If there is
39135 + *         a collision, just mark the resource as unallocated. Also
39136 + *         disable expansion ROMs during this step.
39137 + *     (3) Try to allocate resources for disabled devices.  If the
39138 + *         resources were assigned correctly, everything goes well,
39139 + *         if they weren't, they won't disturb allocation of other
39140 + *         resources.
39141 + *     (4) Assign new addresses to resources which were either
39142 + *         not configured at all or misconfigured.  If explicitly
39143 + *         requested by the user, configure expansion ROM address
39144 + *         as well.
39145 + */
39146 +
39147 +static void __init pcibios_allocate_bus_resources(struct list_head *bus_list)
39148 +{
39149 +       struct pci_bus *bus;
39150 +       int i;
39151 +       struct resource *res, *pr;
39152 +
39153 +       /* Depth-First Search on bus tree */
39154 +       list_for_each_entry(bus, bus_list, node) {
39155 +               for (i = 0; i < PCI_BUS_NUM_RESOURCES; ++i) {
39156 +                       if ((res = bus->resource[i]) == NULL || !res->flags
39157 +                           || res->start > res->end)
39158 +                               continue;
39159 +                       if (bus->parent == NULL)
39160 +                               pr = (res->flags & IORESOURCE_IO) ?
39161 +                                       &ioport_resource : &iomem_resource;
39162 +                       else {
39163 +                               /* Don't bother with non-root busses when
39164 +                                * re-assigning all resources. We clear the
39165 +                                * resource flags as if they were colliding
39166 +                                * and as such ensure proper re-allocation
39167 +                                * later.
39168 +                                */
39169 +                               if (ppc_pci_flags & PPC_PCI_REASSIGN_ALL_RSRC)
39170 +                                       goto clear_resource;
39171 +                               pr = pci_find_parent_resource(bus->self, res);
39172 +                               if (pr == res) {
39173 +                                       /* this happens when the generic PCI
39174 +                                        * code (wrongly) decides that this
39175 +                                        * bridge is transparent  -- paulus
39176 +                                        */
39177 +                                       continue;
39178 +                               }
39179 +                       }
39180 +
39181 +                       DBG("PCI: %s (bus %d) bridge rsrc %d: %016llx-%016llx "
39182 +                           "[0x%x], parent %p (%s)\n",
39183 +                           bus->self ? pci_name(bus->self) : "PHB",
39184 +                           bus->number, i,
39185 +                           (unsigned long long)res->start,
39186 +                           (unsigned long long)res->end,
39187 +                           (unsigned int)res->flags,
39188 +                           pr, (pr && pr->name) ? pr->name : "nil");
39189 +
39190 +                       if (pr && !(pr->flags & IORESOURCE_UNSET)) {
39191 +                               if (request_resource(pr, res) == 0)
39192 +                                       continue;
39193 +                               /*
39194 +                                * Must be a conflict with an existing entry.
39195 +                                * Move that entry (or entries) under the
39196 +                                * bridge resource and try again.
39197 +                                */
39198 +                               if (reparent_resources(pr, res) == 0)
39199 +                                       continue;
39200 +                       }
39201 +                       printk(KERN_WARNING
39202 +                              "PCI: Cannot allocate resource region "
39203 +                              "%d of PCI bridge %d, will remap\n",
39204 +                              i, bus->number);
39205 +clear_resource:
39206 +                       res->flags = 0;
39207 +               }
39208 +               pcibios_allocate_bus_resources(&bus->children);
39209 +       }
39210 +}
39211 +
39212 +static inline void __devinit alloc_resource(struct pci_dev *dev, int idx)
39213 +{
39214 +       struct resource *pr, *r = &dev->resource[idx];
39215 +
39216 +       DBG("PCI: Allocating %s: Resource %d: %016llx..%016llx [%x]\n",
39217 +           pci_name(dev), idx,
39218 +           (unsigned long long)r->start,
39219 +           (unsigned long long)r->end,
39220 +           (unsigned int)r->flags);
39221 +
39222 +       pr = pci_find_parent_resource(dev, r);
39223 +       if (!pr || (pr->flags & IORESOURCE_UNSET) ||
39224 +           request_resource(pr, r) < 0) {
39225 +               printk(KERN_WARNING "PCI: Cannot allocate resource region %d"
39226 +                      " of device %s, will remap\n", idx, pci_name(dev));
39227 +               if (pr)
39228 +                       DBG("PCI:  parent is %p: %016llx-%016llx [%x]\n", pr,
39229 +                           (unsigned long long)pr->start,
39230 +                           (unsigned long long)pr->end,
39231 +                           (unsigned int)pr->flags);
39232 +               /* We'll assign a new address later */
39233 +               r->flags |= IORESOURCE_UNSET;
39234 +               r->end -= r->start;
39235 +               r->start = 0;
39236 +       }
39237 +}
39238 +
39239 +static void __init pcibios_allocate_resources(int pass)
39240 +{
39241 +       struct pci_dev *dev = NULL;
39242 +       int idx, disabled;
39243 +       u16 command;
39244 +       struct resource *r;
39245 +
39246 +       for_each_pci_dev(dev) {
39247 +               pci_read_config_word(dev, PCI_COMMAND, &command);
39248 +               for (idx = 0; idx < 6; idx++) {
39249 +                       r = &dev->resource[idx];
39250 +                       if (r->parent)          /* Already allocated */
39251 +                               continue;
39252 +                       if (!r->flags || (r->flags & IORESOURCE_UNSET))
39253 +                               continue;       /* Not assigned at all */
39254 +                       if (r->flags & IORESOURCE_IO)
39255 +                               disabled = !(command & PCI_COMMAND_IO);
39256 +                       else
39257 +                               disabled = !(command & PCI_COMMAND_MEMORY);
39258 +                       if (pass == disabled)
39259 +                               alloc_resource(dev, idx);
39260 +               }
39261 +               if (pass)
39262 +                       continue;
39263 +               r = &dev->resource[PCI_ROM_RESOURCE];
39264 +               if (r->flags & IORESOURCE_ROM_ENABLE) {
39265 +                       /* Turn the ROM off, leave the resource region,
39266 +                        * but keep it unregistered.
39267 +                        */
39268 +                       u32 reg;
39269 +                       DBG("PCI: Switching off ROM of %s\n", pci_name(dev));
39270 +                       r->flags &= ~IORESOURCE_ROM_ENABLE;
39271 +                       pci_read_config_dword(dev, dev->rom_base_reg, &reg);
39272 +                       pci_write_config_dword(dev, dev->rom_base_reg,
39273 +                                              reg & ~PCI_ROM_ADDRESS_ENABLE);
39274 +               }
39275 +       }
39276 +}
39277 +
39278 +void __init pcibios_resource_survey(void)
39279 +{
39280 +       /* Allocate and assign resources. If we re-assign everything, then
39281 +        * we skip the allocate phase
39282 +        */
39283 +       pcibios_allocate_bus_resources(&pci_root_buses);
39284 +
39285 +       if (!(ppc_pci_flags & PPC_PCI_REASSIGN_ALL_RSRC)) {
39286 +               pcibios_allocate_resources(0);
39287 +               pcibios_allocate_resources(1);
39288 +       }
39289 +
39290 +       if (!(ppc_pci_flags & PPC_PCI_PROBE_ONLY)) {
39291 +               DBG("PCI: Assigning unassigned resouces...\n");
39292 +               pci_assign_unassigned_resources();
39293 +       }
39294 +
39295 +       /* Call machine dependent fixup */
39296 +       if (ppc_md.pcibios_fixup)
39297 +               ppc_md.pcibios_fixup();
39298 +}
39299 +
39300 +#ifdef CONFIG_HOTPLUG
39301 +/* This is used by the pSeries hotplug driver to allocate resource
39302 + * of newly plugged busses. We can try to consolidate with the
39303 + * rest of the code later, for now, keep it as-is
39304 + */
39305 +void __devinit pcibios_claim_one_bus(struct pci_bus *bus)
39306 +{
39307 +       struct pci_dev *dev;
39308 +       struct pci_bus *child_bus;
39309 +
39310 +       list_for_each_entry(dev, &bus->devices, bus_list) {
39311 +               int i;
39312 +
39313 +               for (i = 0; i < PCI_NUM_RESOURCES; i++) {
39314 +                       struct resource *r = &dev->resource[i];
39315 +
39316 +                       if (r->parent || !r->start || !r->flags)
39317 +                               continue;
39318 +                       pci_claim_resource(dev, i);
39319 +               }
39320 +       }
39321 +
39322 +       list_for_each_entry(child_bus, &bus->children, node)
39323 +               pcibios_claim_one_bus(child_bus);
39324 +}
39325 +EXPORT_SYMBOL_GPL(pcibios_claim_one_bus);
39326 +#endif /* CONFIG_HOTPLUG */
39327 +
39328 +int pcibios_enable_device(struct pci_dev *dev, int mask)
39329 +{
39330 +       u16 cmd, old_cmd;
39331 +       int idx;
39332 +       struct resource *r;
39333 +
39334 +       if (ppc_md.pcibios_enable_device_hook)
39335 +               if (ppc_md.pcibios_enable_device_hook(dev))
39336 +                       return -EINVAL;
39337 +
39338 +       pci_read_config_word(dev, PCI_COMMAND, &cmd);
39339 +       old_cmd = cmd;
39340 +       for (idx = 0; idx < PCI_NUM_RESOURCES; idx++) {
39341 +               /* Only set up the requested stuff */
39342 +               if (!(mask & (1 << idx)))
39343 +                       continue;
39344 +               r = &dev->resource[idx];
39345 +               if (!(r->flags & (IORESOURCE_IO | IORESOURCE_MEM)))
39346 +                       continue;
39347 +               if ((idx == PCI_ROM_RESOURCE) &&
39348 +                               (!(r->flags & IORESOURCE_ROM_ENABLE)))
39349 +                       continue;
39350 +               if (r->parent == NULL) {
39351 +                       printk(KERN_ERR "PCI: Device %s not available because"
39352 +                              " of resource collisions\n", pci_name(dev));
39353 +                       return -EINVAL;
39354 +               }
39355 +               if (r->flags & IORESOURCE_IO)
39356 +                       cmd |= PCI_COMMAND_IO;
39357 +               if (r->flags & IORESOURCE_MEM)
39358 +                       cmd |= PCI_COMMAND_MEMORY;
39359 +       }
39360 +       if (cmd != old_cmd) {
39361 +               printk("PCI: Enabling device %s (%04x -> %04x)\n",
39362 +                      pci_name(dev), old_cmd, cmd);
39363 +               pci_write_config_word(dev, PCI_COMMAND, cmd);
39364 +       }
39365 +       return 0;
39366 +}
39367 +
39368 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/pci_32.c powerpc.git/arch/powerpc/kernel/pci_32.c
39369 --- linux-2.6.24/arch/powerpc/kernel/pci_32.c   2008-01-24 23:58:37.000000000 +0100
39370 +++ powerpc.git/arch/powerpc/kernel/pci_32.c    2008-01-28 20:25:49.000000000 +0100
39371 @@ -13,6 +13,7 @@
39372  #include <linux/bootmem.h>
39373  #include <linux/irq.h>
39374  #include <linux/list.h>
39375 +#include <linux/of.h>
39376  
39377  #include <asm/processor.h>
39378  #include <asm/io.h>
39379 @@ -32,19 +33,12 @@
39380  #endif
39381  
39382  unsigned long isa_io_base     = 0;
39383 -unsigned long isa_mem_base    = 0;
39384  unsigned long pci_dram_offset = 0;
39385  int pcibios_assign_bus_offset = 1;
39386  
39387  void pcibios_make_OF_bus_map(void);
39388  
39389 -static int pci_relocate_bridge_resource(struct pci_bus *bus, int i);
39390 -static int probe_resource(struct pci_bus *parent, struct resource *pr,
39391 -                         struct resource *res, struct resource **conflict);
39392 -static void update_bridge_base(struct pci_bus *bus, int i);
39393 -static void pcibios_fixup_resources(struct pci_dev* dev);
39394  static void fixup_broken_pcnet32(struct pci_dev* dev);
39395 -static int reparent_resources(struct resource *parent, struct resource *res);
39396  static void fixup_cpc710_pci64(struct pci_dev* dev);
39397  #ifdef CONFIG_PPC_OF
39398  static u8* pci_to_OF_bus_map;
39399 @@ -53,7 +47,7 @@
39400  /* By default, we don't re-assign bus numbers. We do this only on
39401   * some pmacs
39402   */
39403 -int pci_assign_all_buses;
39404 +static int pci_assign_all_buses;
39405  
39406  LIST_HEAD(hose_list);
39407  
39408 @@ -100,505 +94,6 @@
39409  }
39410  DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_IBM,    PCI_DEVICE_ID_IBM_CPC710_PCI64, fixup_cpc710_pci64);
39411  
39412 -static void
39413 -pcibios_fixup_resources(struct pci_dev *dev)
39414 -{
39415 -       struct pci_controller* hose = (struct pci_controller *)dev->sysdata;
39416 -       int i;
39417 -       unsigned long offset;
39418 -
39419 -       if (!hose) {
39420 -               printk(KERN_ERR "No hose for PCI dev %s!\n", pci_name(dev));
39421 -               return;
39422 -       }
39423 -       for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
39424 -               struct resource *res = dev->resource + i;
39425 -               if (!res->flags)
39426 -                       continue;
39427 -               if (res->end == 0xffffffff) {
39428 -                       DBG("PCI:%s Resource %d [%016llx-%016llx] is unassigned\n",
39429 -                           pci_name(dev), i, (u64)res->start, (u64)res->end);
39430 -                       res->end -= res->start;
39431 -                       res->start = 0;
39432 -                       res->flags |= IORESOURCE_UNSET;
39433 -                       continue;
39434 -               }
39435 -               offset = 0;
39436 -               if (res->flags & IORESOURCE_MEM) {
39437 -                       offset = hose->pci_mem_offset;
39438 -               } else if (res->flags & IORESOURCE_IO) {
39439 -                       offset = (unsigned long) hose->io_base_virt
39440 -                               - isa_io_base;
39441 -               }
39442 -               if (offset != 0) {
39443 -                       res->start += offset;
39444 -                       res->end += offset;
39445 -                       DBG("Fixup res %d (%lx) of dev %s: %llx -> %llx\n",
39446 -                           i, res->flags, pci_name(dev),
39447 -                           (u64)res->start - offset, (u64)res->start);
39448 -               }
39449 -       }
39450 -
39451 -       /* Call machine specific resource fixup */
39452 -       if (ppc_md.pcibios_fixup_resources)
39453 -               ppc_md.pcibios_fixup_resources(dev);
39454 -}
39455 -DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID,           PCI_ANY_ID,                     pcibios_fixup_resources);
39456 -
39457 -void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
39458 -                       struct resource *res)
39459 -{
39460 -       unsigned long offset = 0;
39461 -       struct pci_controller *hose = dev->sysdata;
39462 -
39463 -       if (hose && res->flags & IORESOURCE_IO)
39464 -               offset = (unsigned long)hose->io_base_virt - isa_io_base;
39465 -       else if (hose && res->flags & IORESOURCE_MEM)
39466 -               offset = hose->pci_mem_offset;
39467 -       region->start = res->start - offset;
39468 -       region->end = res->end - offset;
39469 -}
39470 -EXPORT_SYMBOL(pcibios_resource_to_bus);
39471 -
39472 -void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
39473 -                            struct pci_bus_region *region)
39474 -{
39475 -       unsigned long offset = 0;
39476 -       struct pci_controller *hose = dev->sysdata;
39477 -
39478 -       if (hose && res->flags & IORESOURCE_IO)
39479 -               offset = (unsigned long)hose->io_base_virt - isa_io_base;
39480 -       else if (hose && res->flags & IORESOURCE_MEM)
39481 -               offset = hose->pci_mem_offset;
39482 -       res->start = region->start + offset;
39483 -       res->end = region->end + offset;
39484 -}
39485 -EXPORT_SYMBOL(pcibios_bus_to_resource);
39486 -
39487 -/*
39488 - * We need to avoid collisions with `mirrored' VGA ports
39489 - * and other strange ISA hardware, so we always want the
39490 - * addresses to be allocated in the 0x000-0x0ff region
39491 - * modulo 0x400.
39492 - *
39493 - * Why? Because some silly external IO cards only decode
39494 - * the low 10 bits of the IO address. The 0x00-0xff region
39495 - * is reserved for motherboard devices that decode all 16
39496 - * bits, so it's ok to allocate at, say, 0x2800-0x28ff,
39497 - * but we want to try to avoid allocating at 0x2900-0x2bff
39498 - * which might have be mirrored at 0x0100-0x03ff..
39499 - */
39500 -void pcibios_align_resource(void *data, struct resource *res,
39501 -                               resource_size_t size, resource_size_t align)
39502 -{
39503 -       struct pci_dev *dev = data;
39504 -
39505 -       if (res->flags & IORESOURCE_IO) {
39506 -               resource_size_t start = res->start;
39507 -
39508 -               if (size > 0x100) {
39509 -                       printk(KERN_ERR "PCI: I/O Region %s/%d too large"
39510 -                              " (%lld bytes)\n", pci_name(dev),
39511 -                              dev->resource - res, (unsigned long long)size);
39512 -               }
39513 -
39514 -               if (start & 0x300) {
39515 -                       start = (start + 0x3ff) & ~0x3ff;
39516 -                       res->start = start;
39517 -               }
39518 -       }
39519 -}
39520 -EXPORT_SYMBOL(pcibios_align_resource);
39521 -
39522 -/*
39523 - *  Handle resources of PCI devices.  If the world were perfect, we could
39524 - *  just allocate all the resource regions and do nothing more.  It isn't.
39525 - *  On the other hand, we cannot just re-allocate all devices, as it would
39526 - *  require us to know lots of host bridge internals.  So we attempt to
39527 - *  keep as much of the original configuration as possible, but tweak it
39528 - *  when it's found to be wrong.
39529 - *
39530 - *  Known BIOS problems we have to work around:
39531 - *     - I/O or memory regions not configured
39532 - *     - regions configured, but not enabled in the command register
39533 - *     - bogus I/O addresses above 64K used
39534 - *     - expansion ROMs left enabled (this may sound harmless, but given
39535 - *       the fact the PCI specs explicitly allow address decoders to be
39536 - *       shared between expansion ROMs and other resource regions, it's
39537 - *       at least dangerous)
39538 - *
39539 - *  Our solution:
39540 - *     (1) Allocate resources for all buses behind PCI-to-PCI bridges.
39541 - *         This gives us fixed barriers on where we can allocate.
39542 - *     (2) Allocate resources for all enabled devices.  If there is
39543 - *         a collision, just mark the resource as unallocated. Also
39544 - *         disable expansion ROMs during this step.
39545 - *     (3) Try to allocate resources for disabled devices.  If the
39546 - *         resources were assigned correctly, everything goes well,
39547 - *         if they weren't, they won't disturb allocation of other
39548 - *         resources.
39549 - *     (4) Assign new addresses to resources which were either
39550 - *         not configured at all or misconfigured.  If explicitly
39551 - *         requested by the user, configure expansion ROM address
39552 - *         as well.
39553 - */
39554 -
39555 -static void __init
39556 -pcibios_allocate_bus_resources(struct list_head *bus_list)
39557 -{
39558 -       struct pci_bus *bus;
39559 -       int i;
39560 -       struct resource *res, *pr;
39561 -
39562 -       /* Depth-First Search on bus tree */
39563 -       list_for_each_entry(bus, bus_list, node) {
39564 -               for (i = 0; i < 4; ++i) {
39565 -                       if ((res = bus->resource[i]) == NULL || !res->flags
39566 -                           || res->start > res->end)
39567 -                               continue;
39568 -                       if (bus->parent == NULL)
39569 -                               pr = (res->flags & IORESOURCE_IO)?
39570 -                                       &ioport_resource: &iomem_resource;
39571 -                       else {
39572 -                               pr = pci_find_parent_resource(bus->self, res);
39573 -                               if (pr == res) {
39574 -                                       /* this happens when the generic PCI
39575 -                                        * code (wrongly) decides that this
39576 -                                        * bridge is transparent  -- paulus
39577 -                                        */
39578 -                                       continue;
39579 -                               }
39580 -                       }
39581 -
39582 -                       DBG("PCI: bridge rsrc %llx..%llx (%lx), parent %p\n",
39583 -                           (u64)res->start, (u64)res->end, res->flags, pr);
39584 -                       if (pr) {
39585 -                               if (request_resource(pr, res) == 0)
39586 -                                       continue;
39587 -                               /*
39588 -                                * Must be a conflict with an existing entry.
39589 -                                * Move that entry (or entries) under the
39590 -                                * bridge resource and try again.
39591 -                                */
39592 -                               if (reparent_resources(pr, res) == 0)
39593 -                                       continue;
39594 -                       }
39595 -                       printk(KERN_ERR "PCI: Cannot allocate resource region "
39596 -                              "%d of PCI bridge %d\n", i, bus->number);
39597 -                       if (pci_relocate_bridge_resource(bus, i))
39598 -                               bus->resource[i] = NULL;
39599 -               }
39600 -               pcibios_allocate_bus_resources(&bus->children);
39601 -       }
39602 -}
39603 -
39604 -/*
39605 - * Reparent resource children of pr that conflict with res
39606 - * under res, and make res replace those children.
39607 - */
39608 -static int __init
39609 -reparent_resources(struct resource *parent, struct resource *res)
39610 -{
39611 -       struct resource *p, **pp;
39612 -       struct resource **firstpp = NULL;
39613 -
39614 -       for (pp = &parent->child; (p = *pp) != NULL; pp = &p->sibling) {
39615 -               if (p->end < res->start)
39616 -                       continue;
39617 -               if (res->end < p->start)
39618 -                       break;
39619 -               if (p->start < res->start || p->end > res->end)
39620 -                       return -1;      /* not completely contained */
39621 -               if (firstpp == NULL)
39622 -                       firstpp = pp;
39623 -       }
39624 -       if (firstpp == NULL)
39625 -               return -1;      /* didn't find any conflicting entries? */
39626 -       res->parent = parent;
39627 -       res->child = *firstpp;
39628 -       res->sibling = *pp;
39629 -       *firstpp = res;
39630 -       *pp = NULL;
39631 -       for (p = res->child; p != NULL; p = p->sibling) {
39632 -               p->parent = res;
39633 -               DBG(KERN_INFO "PCI: reparented %s [%llx..%llx] under %s\n",
39634 -                   p->name, (u64)p->start, (u64)p->end, res->name);
39635 -       }
39636 -       return 0;
39637 -}
39638 -
39639 -/*
39640 - * A bridge has been allocated a range which is outside the range
39641 - * of its parent bridge, so it needs to be moved.
39642 - */
39643 -static int __init
39644 -pci_relocate_bridge_resource(struct pci_bus *bus, int i)
39645 -{
39646 -       struct resource *res, *pr, *conflict;
39647 -       unsigned long try, size;
39648 -       int j;
39649 -       struct pci_bus *parent = bus->parent;
39650 -
39651 -       if (parent == NULL) {
39652 -               /* shouldn't ever happen */
39653 -               printk(KERN_ERR "PCI: can't move host bridge resource\n");
39654 -               return -1;
39655 -       }
39656 -       res = bus->resource[i];
39657 -       if (res == NULL)
39658 -               return -1;
39659 -       pr = NULL;
39660 -       for (j = 0; j < 4; j++) {
39661 -               struct resource *r = parent->resource[j];
39662 -               if (!r)
39663 -                       continue;
39664 -               if ((res->flags ^ r->flags) & (IORESOURCE_IO | IORESOURCE_MEM))
39665 -                       continue;
39666 -               if (!((res->flags ^ r->flags) & IORESOURCE_PREFETCH)) {
39667 -                       pr = r;
39668 -                       break;
39669 -               }
39670 -               if (res->flags & IORESOURCE_PREFETCH)
39671 -                       pr = r;
39672 -       }
39673 -       if (pr == NULL)
39674 -               return -1;
39675 -       size = res->end - res->start;
39676 -       if (pr->start > pr->end || size > pr->end - pr->start)
39677 -               return -1;
39678 -       try = pr->end;
39679 -       for (;;) {
39680 -               res->start = try - size;
39681 -               res->end = try;
39682 -               if (probe_resource(bus->parent, pr, res, &conflict) == 0)
39683 -                       break;
39684 -               if (conflict->start <= pr->start + size)
39685 -                       return -1;
39686 -               try = conflict->start - 1;
39687 -       }
39688 -       if (request_resource(pr, res)) {
39689 -               DBG(KERN_ERR "PCI: huh? couldn't move to %llx..%llx\n",
39690 -                   (u64)res->start, (u64)res->end);
39691 -               return -1;              /* "can't happen" */
39692 -       }
39693 -       update_bridge_base(bus, i);
39694 -       printk(KERN_INFO "PCI: bridge %d resource %d moved to %llx..%llx\n",
39695 -              bus->number, i, (unsigned long long)res->start,
39696 -              (unsigned long long)res->end);
39697 -       return 0;
39698 -}
39699 -
39700 -static int __init
39701 -probe_resource(struct pci_bus *parent, struct resource *pr,
39702 -              struct resource *res, struct resource **conflict)
39703 -{
39704 -       struct pci_bus *bus;
39705 -       struct pci_dev *dev;
39706 -       struct resource *r;
39707 -       int i;
39708 -
39709 -       for (r = pr->child; r != NULL; r = r->sibling) {
39710 -               if (r->end >= res->start && res->end >= r->start) {
39711 -                       *conflict = r;
39712 -                       return 1;
39713 -               }
39714 -       }
39715 -       list_for_each_entry(bus, &parent->children, node) {
39716 -               for (i = 0; i < 4; ++i) {
39717 -                       if ((r = bus->resource[i]) == NULL)
39718 -                               continue;
39719 -                       if (!r->flags || r->start > r->end || r == res)
39720 -                               continue;
39721 -                       if (pci_find_parent_resource(bus->self, r) != pr)
39722 -                               continue;
39723 -                       if (r->end >= res->start && res->end >= r->start) {
39724 -                               *conflict = r;
39725 -                               return 1;
39726 -                       }
39727 -               }
39728 -       }
39729 -       list_for_each_entry(dev, &parent->devices, bus_list) {
39730 -               for (i = 0; i < 6; ++i) {
39731 -                       r = &dev->resource[i];
39732 -                       if (!r->flags || (r->flags & IORESOURCE_UNSET))
39733 -                               continue;
39734 -                       if (pci_find_parent_resource(dev, r) != pr)
39735 -                               continue;
39736 -                       if (r->end >= res->start && res->end >= r->start) {
39737 -                               *conflict = r;
39738 -                               return 1;
39739 -                       }
39740 -               }
39741 -       }
39742 -       return 0;
39743 -}
39744 -
39745 -void __init
39746 -update_bridge_resource(struct pci_dev *dev, struct resource *res)
39747 -{
39748 -       u8 io_base_lo, io_limit_lo;
39749 -       u16 mem_base, mem_limit;
39750 -       u16 cmd;
39751 -       unsigned long start, end, off;
39752 -       struct pci_controller *hose = dev->sysdata;
39753 -
39754 -       if (!hose) {
39755 -               printk("update_bridge_base: no hose?\n");
39756 -               return;
39757 -       }
39758 -       pci_read_config_word(dev, PCI_COMMAND, &cmd);
39759 -       pci_write_config_word(dev, PCI_COMMAND,
39760 -                             cmd & ~(PCI_COMMAND_IO | PCI_COMMAND_MEMORY));
39761 -       if (res->flags & IORESOURCE_IO) {
39762 -               off = (unsigned long) hose->io_base_virt - isa_io_base;
39763 -               start = res->start - off;
39764 -               end = res->end - off;
39765 -               io_base_lo = (start >> 8) & PCI_IO_RANGE_MASK;
39766 -               io_limit_lo = (end >> 8) & PCI_IO_RANGE_MASK;
39767 -               if (end > 0xffff)
39768 -                       io_base_lo |= PCI_IO_RANGE_TYPE_32;
39769 -               else
39770 -                       io_base_lo |= PCI_IO_RANGE_TYPE_16;
39771 -               pci_write_config_word(dev, PCI_IO_BASE_UPPER16,
39772 -                               start >> 16);
39773 -               pci_write_config_word(dev, PCI_IO_LIMIT_UPPER16,
39774 -                               end >> 16);
39775 -               pci_write_config_byte(dev, PCI_IO_BASE, io_base_lo);
39776 -               pci_write_config_byte(dev, PCI_IO_LIMIT, io_limit_lo);
39777 -
39778 -       } else if ((res->flags & (IORESOURCE_MEM | IORESOURCE_PREFETCH))
39779 -                  == IORESOURCE_MEM) {
39780 -               off = hose->pci_mem_offset;
39781 -               mem_base = ((res->start - off) >> 16) & PCI_MEMORY_RANGE_MASK;
39782 -               mem_limit = ((res->end - off) >> 16) & PCI_MEMORY_RANGE_MASK;
39783 -               pci_write_config_word(dev, PCI_MEMORY_BASE, mem_base);
39784 -               pci_write_config_word(dev, PCI_MEMORY_LIMIT, mem_limit);
39785 -
39786 -       } else if ((res->flags & (IORESOURCE_MEM | IORESOURCE_PREFETCH))
39787 -                  == (IORESOURCE_MEM | IORESOURCE_PREFETCH)) {
39788 -               off = hose->pci_mem_offset;
39789 -               mem_base = ((res->start - off) >> 16) & PCI_PREF_RANGE_MASK;
39790 -               mem_limit = ((res->end - off) >> 16) & PCI_PREF_RANGE_MASK;
39791 -               pci_write_config_word(dev, PCI_PREF_MEMORY_BASE, mem_base);
39792 -               pci_write_config_word(dev, PCI_PREF_MEMORY_LIMIT, mem_limit);
39793 -
39794 -       } else {
39795 -               DBG(KERN_ERR "PCI: ugh, bridge %s res has flags=%lx\n",
39796 -                   pci_name(dev), res->flags);
39797 -       }
39798 -       pci_write_config_word(dev, PCI_COMMAND, cmd);
39799 -}
39800 -
39801 -static void __init
39802 -update_bridge_base(struct pci_bus *bus, int i)
39803 -{
39804 -       struct resource *res = bus->resource[i];
39805 -       struct pci_dev *dev = bus->self;
39806 -       update_bridge_resource(dev, res);
39807 -}
39808 -
39809 -static inline void alloc_resource(struct pci_dev *dev, int idx)
39810 -{
39811 -       struct resource *pr, *r = &dev->resource[idx];
39812 -
39813 -       DBG("PCI:%s: Resource %d: %016llx-%016llx (f=%lx)\n",
39814 -           pci_name(dev), idx, (u64)r->start, (u64)r->end, r->flags);
39815 -       pr = pci_find_parent_resource(dev, r);
39816 -       if (!pr || request_resource(pr, r) < 0) {
39817 -               printk(KERN_ERR "PCI: Cannot allocate resource region %d"
39818 -                      " of device %s\n", idx, pci_name(dev));
39819 -               if (pr)
39820 -                       DBG("PCI:  parent is %p: %016llx-%016llx (f=%lx)\n",
39821 -                           pr, (u64)pr->start, (u64)pr->end, pr->flags);
39822 -               /* We'll assign a new address later */
39823 -               r->flags |= IORESOURCE_UNSET;
39824 -               r->end -= r->start;
39825 -               r->start = 0;
39826 -       }
39827 -}
39828 -
39829 -static void __init
39830 -pcibios_allocate_resources(int pass)
39831 -{
39832 -       struct pci_dev *dev = NULL;
39833 -       int idx, disabled;
39834 -       u16 command;
39835 -       struct resource *r;
39836 -
39837 -       for_each_pci_dev(dev) {
39838 -               pci_read_config_word(dev, PCI_COMMAND, &command);
39839 -               for (idx = 0; idx < 6; idx++) {
39840 -                       r = &dev->resource[idx];
39841 -                       if (r->parent)          /* Already allocated */
39842 -                               continue;
39843 -                       if (!r->flags || (r->flags & IORESOURCE_UNSET))
39844 -                               continue;       /* Not assigned at all */
39845 -                       if (r->flags & IORESOURCE_IO)
39846 -                               disabled = !(command & PCI_COMMAND_IO);
39847 -                       else
39848 -                               disabled = !(command & PCI_COMMAND_MEMORY);
39849 -                       if (pass == disabled)
39850 -                               alloc_resource(dev, idx);
39851 -               }
39852 -               if (pass)
39853 -                       continue;
39854 -               r = &dev->resource[PCI_ROM_RESOURCE];
39855 -               if (r->flags & IORESOURCE_ROM_ENABLE) {
39856 -                       /* Turn the ROM off, leave the resource region, but keep it unregistered. */
39857 -                       u32 reg;
39858 -                       DBG("PCI: Switching off ROM of %s\n", pci_name(dev));
39859 -                       r->flags &= ~IORESOURCE_ROM_ENABLE;
39860 -                       pci_read_config_dword(dev, dev->rom_base_reg, &reg);
39861 -                       pci_write_config_dword(dev, dev->rom_base_reg,
39862 -                                              reg & ~PCI_ROM_ADDRESS_ENABLE);
39863 -               }
39864 -       }
39865 -}
39866 -
39867 -static void __init
39868 -pcibios_assign_resources(void)
39869 -{
39870 -       struct pci_dev *dev = NULL;
39871 -       int idx;
39872 -       struct resource *r;
39873 -
39874 -       for_each_pci_dev(dev) {
39875 -               int class = dev->class >> 8;
39876 -
39877 -               /* Don't touch classless devices and host bridges */
39878 -               if (!class || class == PCI_CLASS_BRIDGE_HOST)
39879 -                       continue;
39880 -
39881 -               for (idx = 0; idx < 6; idx++) {
39882 -                       r = &dev->resource[idx];
39883 -
39884 -                       /*
39885 -                        * We shall assign a new address to this resource,
39886 -                        * either because the BIOS (sic) forgot to do so
39887 -                        * or because we have decided the old address was
39888 -                        * unusable for some reason.
39889 -                        */
39890 -                       if ((r->flags & IORESOURCE_UNSET) && r->end &&
39891 -                           (!ppc_md.pcibios_enable_device_hook ||
39892 -                            !ppc_md.pcibios_enable_device_hook(dev, 1))) {
39893 -                               int rc;
39894 -
39895 -                               r->flags &= ~IORESOURCE_UNSET;
39896 -                               rc = pci_assign_resource(dev, idx);
39897 -                               BUG_ON(rc);
39898 -                       }
39899 -               }
39900 -
39901 -#if 0 /* don't assign ROMs */
39902 -               r = &dev->resource[PCI_ROM_RESOURCE];
39903 -               r->end -= r->start;
39904 -               r->start = 0;
39905 -               if (r->end)
39906 -                       pci_assign_resource(dev, PCI_ROM_RESOURCE);
39907 -#endif
39908 -       }
39909 -}
39910 -
39911  #ifdef CONFIG_PPC_OF
39912  /*
39913   * Functions below are used on OpenFirmware machines.
39914 @@ -619,7 +114,7 @@
39915         } else
39916                 pci_to_OF_bus_map[pci_bus] = bus_range[0];
39917  
39918 -       for (node=node->child; node != 0;node = node->sibling) {
39919 +       for_each_child_of_node(node, node) {
39920                 struct pci_dev* dev;
39921                 const unsigned int *class_code, *reg;
39922         
39923 @@ -662,8 +157,8 @@
39924  
39925         /* For each hose, we begin searching bridges */
39926         list_for_each_entry_safe(hose, tmp, &hose_list, list_node) {
39927 -               struct device_node* node;       
39928 -               node = (struct device_node *)hose->arch_data;
39929 +               struct device_node* node = hose->dn;
39930 +
39931                 if (!node)
39932                         continue;
39933                 make_one_node_map(node, hose->first_busno);
39934 @@ -688,15 +183,18 @@
39935  typedef int (*pci_OF_scan_iterator)(struct device_node* node, void* data);
39936  
39937  static struct device_node*
39938 -scan_OF_pci_childs(struct device_node* node, pci_OF_scan_iterator filter, void* data)
39939 +scan_OF_pci_childs(struct device_node *parent, pci_OF_scan_iterator filter, void* data)
39940  {
39941 +       struct device_node *node;
39942         struct device_node* sub_node;
39943  
39944 -       for (; node != 0;node = node->sibling) {
39945 +       for_each_child_of_node(parent, node) {
39946                 const unsigned int *class_code;
39947         
39948 -               if (filter(node, data))
39949 +               if (filter(node, data)) {
39950 +                       of_node_put(node);
39951                         return node;
39952 +               }
39953  
39954                 /* For PCI<->PCI bridges or CardBus bridges, we go down
39955                  * Note: some OFs create a parent node "multifunc-device" as
39956 @@ -708,9 +206,11 @@
39957                         (*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS)) &&
39958                         strcmp(node->name, "multifunc-device"))
39959                         continue;
39960 -               sub_node = scan_OF_pci_childs(node->child, filter, data);
39961 -               if (sub_node)
39962 +               sub_node = scan_OF_pci_childs(node, filter, data);
39963 +               if (sub_node) {
39964 +                       of_node_put(node);
39965                         return sub_node;
39966 +               }
39967         }
39968         return NULL;
39969  }
39970 @@ -718,11 +218,11 @@
39971  static struct device_node *scan_OF_for_pci_dev(struct device_node *parent,
39972                                                unsigned int devfn)
39973  {
39974 -       struct device_node *np = NULL;
39975 +       struct device_node *np;
39976         const u32 *reg;
39977         unsigned int psize;
39978  
39979 -       while ((np = of_get_next_child(parent, np)) != NULL) {
39980 +       for_each_child_of_node(parent, np) {
39981                 reg = of_get_property(np, "reg", &psize);
39982                 if (reg == NULL || psize < 4)
39983                         continue;
39984 @@ -742,7 +242,7 @@
39985                 struct pci_controller *hose = pci_bus_to_host(bus);
39986                 if (hose == NULL)
39987                         return NULL;
39988 -               return of_node_get(hose->arch_data);
39989 +               return of_node_get(hose->dn);
39990         }
39991  
39992         /* not a root bus, we need to get our parent */
39993 @@ -812,9 +312,9 @@
39994                 return -ENODEV;
39995         /* Make sure it's really a PCI device */
39996         hose = pci_find_hose_for_OF_device(node);
39997 -       if (!hose || !hose->arch_data)
39998 +       if (!hose || !hose->dn)
39999                 return -ENODEV;
40000 -       if (!scan_OF_pci_childs(((struct device_node*)hose->arch_data)->child,
40001 +       if (!scan_OF_pci_childs(hose->dn,
40002                         find_OF_pci_device_filter, (void *)node))
40003                 return -ENODEV;
40004         reg = of_get_property(node, "reg", NULL);
40005 @@ -843,120 +343,6 @@
40006  }
40007  EXPORT_SYMBOL(pci_device_from_OF_node);
40008  
40009 -void __init
40010 -pci_process_bridge_OF_ranges(struct pci_controller *hose,
40011 -                          struct device_node *dev, int primary)
40012 -{
40013 -       static unsigned int static_lc_ranges[256] __initdata;
40014 -       const unsigned int *dt_ranges;
40015 -       unsigned int *lc_ranges, *ranges, *prev, size;
40016 -       int rlen = 0, orig_rlen;
40017 -       int memno = 0;
40018 -       struct resource *res;
40019 -       int np, na = of_n_addr_cells(dev);
40020 -       np = na + 5;
40021 -
40022 -       /* First we try to merge ranges to fix a problem with some pmacs
40023 -        * that can have more than 3 ranges, fortunately using contiguous
40024 -        * addresses -- BenH
40025 -        */
40026 -       dt_ranges = of_get_property(dev, "ranges", &rlen);
40027 -       if (!dt_ranges)
40028 -               return;
40029 -       /* Sanity check, though hopefully that never happens */
40030 -       if (rlen > sizeof(static_lc_ranges)) {
40031 -               printk(KERN_WARNING "OF ranges property too large !\n");
40032 -               rlen = sizeof(static_lc_ranges);
40033 -       }
40034 -       lc_ranges = static_lc_ranges;
40035 -       memcpy(lc_ranges, dt_ranges, rlen);
40036 -       orig_rlen = rlen;
40037 -
40038 -       /* Let's work on a copy of the "ranges" property instead of damaging
40039 -        * the device-tree image in memory
40040 -        */
40041 -       ranges = lc_ranges;
40042 -       prev = NULL;
40043 -       while ((rlen -= np * sizeof(unsigned int)) >= 0) {
40044 -               if (prev) {
40045 -                       if (prev[0] == ranges[0] && prev[1] == ranges[1] &&
40046 -                               (prev[2] + prev[na+4]) == ranges[2] &&
40047 -                               (prev[na+2] + prev[na+4]) == ranges[na+2]) {
40048 -                               prev[na+4] += ranges[na+4];
40049 -                               ranges[0] = 0;
40050 -                               ranges += np;
40051 -                               continue;
40052 -                       }
40053 -               }
40054 -               prev = ranges;
40055 -               ranges += np;
40056 -       }
40057 -
40058 -       /*
40059 -        * The ranges property is laid out as an array of elements,
40060 -        * each of which comprises:
40061 -        *   cells 0 - 2:       a PCI address
40062 -        *   cells 3 or 3+4:    a CPU physical address
40063 -        *                      (size depending on dev->n_addr_cells)
40064 -        *   cells 4+5 or 5+6:  the size of the range
40065 -        */
40066 -       ranges = lc_ranges;
40067 -       rlen = orig_rlen;
40068 -       while (ranges && (rlen -= np * sizeof(unsigned int)) >= 0) {
40069 -               res = NULL;
40070 -               size = ranges[na+4];
40071 -               switch ((ranges[0] >> 24) & 0x3) {
40072 -               case 1:         /* I/O space */
40073 -                       if (ranges[2] != 0)
40074 -                               break;
40075 -                       hose->io_base_phys = ranges[na+2];
40076 -                       /* limit I/O space to 16MB */
40077 -                       if (size > 0x01000000)
40078 -                               size = 0x01000000;
40079 -                       hose->io_base_virt = ioremap(ranges[na+2], size);
40080 -                       if (primary)
40081 -                               isa_io_base = (unsigned long) hose->io_base_virt;
40082 -                       res = &hose->io_resource;
40083 -                       res->flags = IORESOURCE_IO;
40084 -                       res->start = ranges[2];
40085 -                       DBG("PCI: IO 0x%llx -> 0x%llx\n",
40086 -                           (u64)res->start, (u64)res->start + size - 1);
40087 -                       break;
40088 -               case 2:         /* memory space */
40089 -                       memno = 0;
40090 -                       if (ranges[1] == 0 && ranges[2] == 0
40091 -                           && ranges[na+4] <= (16 << 20)) {
40092 -                               /* 1st 16MB, i.e. ISA memory area */
40093 -                               if (primary)
40094 -                                       isa_mem_base = ranges[na+2];
40095 -                               memno = 1;
40096 -                       }
40097 -                       while (memno < 3 && hose->mem_resources[memno].flags)
40098 -                               ++memno;
40099 -                       if (memno == 0)
40100 -                               hose->pci_mem_offset = ranges[na+2] - ranges[2];
40101 -                       if (memno < 3) {
40102 -                               res = &hose->mem_resources[memno];
40103 -                               res->flags = IORESOURCE_MEM;
40104 -                               if(ranges[0] & 0x40000000)
40105 -                                       res->flags |= IORESOURCE_PREFETCH;
40106 -                               res->start = ranges[na+2];
40107 -                               DBG("PCI: MEM[%d] 0x%llx -> 0x%llx\n", memno,
40108 -                                   (u64)res->start, (u64)res->start + size - 1);
40109 -                       }
40110 -                       break;
40111 -               }
40112 -               if (res != NULL) {
40113 -                       res->name = dev->full_name;
40114 -                       res->end = res->start + size - 1;
40115 -                       res->parent = NULL;
40116 -                       res->sibling = NULL;
40117 -                       res->child = NULL;
40118 -               }
40119 -               ranges += np;
40120 -       }
40121 -}
40122 -
40123  /* We create the "pci-OF-bus-map" property now so it appears in the
40124   * /proc device tree
40125   */
40126 @@ -986,219 +372,7 @@
40127  }
40128  #endif /* CONFIG_PPC_OF */
40129  
40130 -#ifdef CONFIG_PPC_PMAC
40131 -/*
40132 - * This set of routines checks for PCI<->PCI bridges that have closed
40133 - * IO resources and have child devices. It tries to re-open an IO
40134 - * window on them.
40135 - *
40136 - * This is a _temporary_ fix to workaround a problem with Apple's OF
40137 - * closing IO windows on P2P bridges when the OF drivers of cards
40138 - * below this bridge don't claim any IO range (typically ATI or
40139 - * Adaptec).
40140 - *
40141 - * A more complete fix would be to use drivers/pci/setup-bus.c, which
40142 - * involves a working pcibios_fixup_pbus_ranges(), some more care about
40143 - * ordering when creating the host bus resources, and maybe a few more
40144 - * minor tweaks
40145 - */
40146 -
40147 -/* Initialize bridges with base/limit values we have collected */
40148 -static void __init
40149 -do_update_p2p_io_resource(struct pci_bus *bus, int enable_vga)
40150 -{
40151 -       struct pci_dev *bridge = bus->self;
40152 -       struct pci_controller* hose = (struct pci_controller *)bridge->sysdata;
40153 -       u32 l;
40154 -       u16 w;
40155 -       struct resource res;
40156 -
40157 -       if (bus->resource[0] == NULL)
40158 -               return;
40159 -       res = *(bus->resource[0]);
40160 -
40161 -       DBG("Remapping Bus %d, bridge: %s\n", bus->number, pci_name(bridge));
40162 -       res.start -= ((unsigned long) hose->io_base_virt - isa_io_base);
40163 -       res.end -= ((unsigned long) hose->io_base_virt - isa_io_base);
40164 -       DBG("  IO window: %016llx-%016llx\n", res.start, res.end);
40165 -
40166 -       /* Set up the top and bottom of the PCI I/O segment for this bus. */
40167 -       pci_read_config_dword(bridge, PCI_IO_BASE, &l);
40168 -       l &= 0xffff000f;
40169 -       l |= (res.start >> 8) & 0x00f0;
40170 -       l |= res.end & 0xf000;
40171 -       pci_write_config_dword(bridge, PCI_IO_BASE, l);
40172 -
40173 -       if ((l & PCI_IO_RANGE_TYPE_MASK) == PCI_IO_RANGE_TYPE_32) {
40174 -               l = (res.start >> 16) | (res.end & 0xffff0000);
40175 -               pci_write_config_dword(bridge, PCI_IO_BASE_UPPER16, l);
40176 -       }
40177 -
40178 -       pci_read_config_word(bridge, PCI_COMMAND, &w);
40179 -       w |= PCI_COMMAND_IO;
40180 -       pci_write_config_word(bridge, PCI_COMMAND, w);
40181 -
40182 -#if 0 /* Enabling this causes XFree 4.2.0 to hang during PCI probe */
40183 -       if (enable_vga) {
40184 -               pci_read_config_word(bridge, PCI_BRIDGE_CONTROL, &w);
40185 -               w |= PCI_BRIDGE_CTL_VGA;
40186 -               pci_write_config_word(bridge, PCI_BRIDGE_CONTROL, w);
40187 -       }
40188 -#endif
40189 -}
40190 -
40191 -/* This function is pretty basic and actually quite broken for the
40192 - * general case, it's enough for us right now though. It's supposed
40193 - * to tell us if we need to open an IO range at all or not and what
40194 - * size.
40195 - */
40196 -static int __init
40197 -check_for_io_childs(struct pci_bus *bus, struct resource* res, int *found_vga)
40198 -{
40199 -       struct pci_dev *dev;
40200 -       int     i;
40201 -       int     rc = 0;
40202 -
40203 -#define push_end(res, mask) do {               \
40204 -       BUG_ON((mask+1) & mask);                \
40205 -       res->end = (res->end + mask) | mask;    \
40206 -} while (0)
40207 -
40208 -       list_for_each_entry(dev, &bus->devices, bus_list) {
40209 -               u16 class = dev->class >> 8;
40210 -
40211 -               if (class == PCI_CLASS_DISPLAY_VGA ||
40212 -                   class == PCI_CLASS_NOT_DEFINED_VGA)
40213 -                       *found_vga = 1;
40214 -               if (class >> 8 == PCI_BASE_CLASS_BRIDGE && dev->subordinate)
40215 -                       rc |= check_for_io_childs(dev->subordinate, res, found_vga);
40216 -               if (class == PCI_CLASS_BRIDGE_CARDBUS)
40217 -                       push_end(res, 0xfff);
40218 -
40219 -               for (i=0; i<PCI_NUM_RESOURCES; i++) {
40220 -                       struct resource *r;
40221 -                       unsigned long r_size;
40222 -
40223 -                       if (dev->class >> 8 == PCI_CLASS_BRIDGE_PCI
40224 -                           && i >= PCI_BRIDGE_RESOURCES)
40225 -                               continue;
40226 -                       r = &dev->resource[i];
40227 -                       r_size = r->end - r->start;
40228 -                       if (r_size < 0xfff)
40229 -                               r_size = 0xfff;
40230 -                       if (r->flags & IORESOURCE_IO && (r_size) != 0) {
40231 -                               rc = 1;
40232 -                               push_end(res, r_size);
40233 -                       }
40234 -               }
40235 -       }
40236 -
40237 -       return rc;
40238 -}
40239 -
40240 -/* Here we scan all P2P bridges of a given level that have a closed
40241 - * IO window. Note that the test for the presence of a VGA card should
40242 - * be improved to take into account already configured P2P bridges,
40243 - * currently, we don't see them and might end up configuring 2 bridges
40244 - * with VGA pass through enabled
40245 - */
40246 -static void __init
40247 -do_fixup_p2p_level(struct pci_bus *bus)
40248 -{
40249 -       struct pci_bus *b;
40250 -       int i, parent_io;
40251 -       int has_vga = 0;
40252 -
40253 -       for (parent_io=0; parent_io<4; parent_io++)
40254 -               if (bus->resource[parent_io]
40255 -                   && bus->resource[parent_io]->flags & IORESOURCE_IO)
40256 -                       break;
40257 -       if (parent_io >= 4)
40258 -               return;
40259 -
40260 -       list_for_each_entry(b, &bus->children, node) {
40261 -               struct pci_dev *d = b->self;
40262 -               struct pci_controller* hose = (struct pci_controller *)d->sysdata;
40263 -               struct resource *res = b->resource[0];
40264 -               struct resource tmp_res;
40265 -               unsigned long max;
40266 -               int found_vga = 0;
40267 -
40268 -               memset(&tmp_res, 0, sizeof(tmp_res));
40269 -               tmp_res.start = bus->resource[parent_io]->start;
40270 -
40271 -               /* We don't let low addresses go through that closed P2P bridge, well,
40272 -                * that may not be necessary but I feel safer that way
40273 -                */
40274 -               if (tmp_res.start == 0)
40275 -                       tmp_res.start = 0x1000;
40276 -       
40277 -               if (!list_empty(&b->devices) && res && res->flags == 0 &&
40278 -                   res != bus->resource[parent_io] &&
40279 -                   (d->class >> 8) == PCI_CLASS_BRIDGE_PCI &&
40280 -                   check_for_io_childs(b, &tmp_res, &found_vga)) {
40281 -                       u8 io_base_lo;
40282 -
40283 -                       printk(KERN_INFO "Fixing up IO bus %s\n", b->name);
40284 -
40285 -                       if (found_vga) {
40286 -                               if (has_vga) {
40287 -                                       printk(KERN_WARNING "Skipping VGA, already active"
40288 -                                           " on bus segment\n");
40289 -                                       found_vga = 0;
40290 -                               } else
40291 -                                       has_vga = 1;
40292 -                       }
40293 -                       pci_read_config_byte(d, PCI_IO_BASE, &io_base_lo);
40294 -
40295 -                       if ((io_base_lo & PCI_IO_RANGE_TYPE_MASK) == PCI_IO_RANGE_TYPE_32)
40296 -                               max = ((unsigned long) hose->io_base_virt
40297 -                                       - isa_io_base) + 0xffffffff;
40298 -                       else
40299 -                               max = ((unsigned long) hose->io_base_virt
40300 -                                       - isa_io_base) + 0xffff;
40301 -
40302 -                       *res = tmp_res;
40303 -                       res->flags = IORESOURCE_IO;
40304 -                       res->name = b->name;
40305 -               
40306 -                       /* Find a resource in the parent where we can allocate */
40307 -                       for (i = 0 ; i < 4; i++) {
40308 -                               struct resource *r = bus->resource[i];
40309 -                               if (!r)
40310 -                                       continue;
40311 -                               if ((r->flags & IORESOURCE_IO) == 0)
40312 -                                       continue;
40313 -                               DBG("Trying to allocate from %016llx, size %016llx from parent"
40314 -                                   " res %d: %016llx -> %016llx\n",
40315 -                                       res->start, res->end, i, r->start, r->end);
40316 -                       
40317 -                               if (allocate_resource(r, res, res->end + 1, res->start, max,
40318 -                                   res->end + 1, NULL, NULL) < 0) {
40319 -                                       DBG("Failed !\n");
40320 -                                       continue;
40321 -                               }
40322 -                               do_update_p2p_io_resource(b, found_vga);
40323 -                               break;
40324 -                       }
40325 -               }
40326 -               do_fixup_p2p_level(b);
40327 -       }
40328 -}
40329 -
40330 -static void
40331 -pcibios_fixup_p2p_bridges(void)
40332 -{
40333 -       struct pci_bus *b;
40334 -
40335 -       list_for_each_entry(b, &pci_root_buses, node)
40336 -               do_fixup_p2p_level(b);
40337 -}
40338 -
40339 -#endif /* CONFIG_PPC_PMAC */
40340 -
40341 -static int __init
40342 -pcibios_init(void)
40343 +static int __init pcibios_init(void)
40344  {
40345         struct pci_controller *hose, *tmp;
40346         struct pci_bus *bus;
40347 @@ -1206,6 +380,9 @@
40348  
40349         printk(KERN_INFO "PCI: Probing PCI hardware\n");
40350  
40351 +       if (ppc_pci_flags & PPC_PCI_REASSIGN_ALL_BUS)
40352 +               pci_assign_all_buses = 1;
40353 +
40354         /* Scan all of the recorded PCI controllers.  */
40355         list_for_each_entry_safe(hose, tmp, &hose_list, list_node) {
40356                 if (pci_assign_all_buses)
40357 @@ -1213,9 +390,10 @@
40358                 hose->last_busno = 0xff;
40359                 bus = pci_scan_bus_parented(hose->parent, hose->first_busno,
40360                                             hose->ops, hose);
40361 -               if (bus)
40362 +               if (bus) {
40363                         pci_bus_add_devices(bus);
40364 -               hose->last_busno = bus->subordinate;
40365 +                       hose->last_busno = bus->subordinate;
40366 +               }
40367                 if (pci_assign_all_buses || next_busno <= hose->last_busno)
40368                         next_busno = hose->last_busno + pcibios_assign_bus_offset;
40369         }
40370 @@ -1228,18 +406,8 @@
40371         if (pci_assign_all_buses && have_of)
40372                 pcibios_make_OF_bus_map();
40373  
40374 -       /* Call machine dependent fixup */
40375 -       if (ppc_md.pcibios_fixup)
40376 -               ppc_md.pcibios_fixup();
40377 -
40378 -       /* Allocate and assign resources */
40379 -       pcibios_allocate_bus_resources(&pci_root_buses);
40380 -       pcibios_allocate_resources(0);
40381 -       pcibios_allocate_resources(1);
40382 -#ifdef CONFIG_PPC_PMAC
40383 -       pcibios_fixup_p2p_bridges();
40384 -#endif /* CONFIG_PPC_PMAC */
40385 -       pcibios_assign_resources();
40386 +       /* Call common code to handle resource allocation */
40387 +       pcibios_resource_survey();
40388  
40389         /* Call machine dependent post-init code */
40390         if (ppc_md.pcibios_after_init)
40391 @@ -1250,14 +418,14 @@
40392  
40393  subsys_initcall(pcibios_init);
40394  
40395 -void pcibios_fixup_bus(struct pci_bus *bus)
40396 +void __devinit pcibios_do_bus_setup(struct pci_bus *bus)
40397  {
40398         struct pci_controller *hose = (struct pci_controller *) bus->sysdata;
40399         unsigned long io_offset;
40400         struct resource *res;
40401 -       struct pci_dev *dev;
40402         int i;
40403  
40404 +       /* Hookup PHB resources */
40405         io_offset = (unsigned long)hose->io_base_virt - isa_io_base;
40406         if (bus->parent == NULL) {
40407                 /* This is a host bridge - fill in its resources */
40408 @@ -1272,8 +440,8 @@
40409                         res->end = IO_SPACE_LIMIT;
40410                         res->flags = IORESOURCE_IO;
40411                 }
40412 -               res->start += io_offset;
40413 -               res->end += io_offset;
40414 +               res->start = (res->start + io_offset) & 0xffffffffu;
40415 +               res->end = (res->end + io_offset) & 0xffffffffu;
40416  
40417                 for (i = 0; i < 3; ++i) {
40418                         res = &hose->mem_resources[i];
40419 @@ -1288,35 +456,6 @@
40420                         }
40421                         bus->resource[i+1] = res;
40422                 }
40423 -       } else {
40424 -               /* This is a subordinate bridge */
40425 -               pci_read_bridge_bases(bus);
40426 -
40427 -               for (i = 0; i < 4; ++i) {
40428 -                       if ((res = bus->resource[i]) == NULL)
40429 -                               continue;
40430 -                       if (!res->flags || bus->self->transparent)
40431 -                               continue;
40432 -                       if (io_offset && (res->flags & IORESOURCE_IO)) {
40433 -                               res->start += io_offset;
40434 -                               res->end += io_offset;
40435 -                       } else if (hose->pci_mem_offset
40436 -                                  && (res->flags & IORESOURCE_MEM)) {
40437 -                               res->start += hose->pci_mem_offset;
40438 -                               res->end += hose->pci_mem_offset;
40439 -                       }
40440 -               }
40441 -       }
40442 -
40443 -       /* Platform specific bus fixups */
40444 -       if (ppc_md.pcibios_fixup_bus)
40445 -               ppc_md.pcibios_fixup_bus(bus);
40446 -
40447 -       /* Read default IRQs and fixup if necessary */
40448 -       list_for_each_entry(dev, &bus->devices, bus_list) {
40449 -               pci_read_irq_line(dev);
40450 -               if (ppc_md.pci_irq_fixup)
40451 -                       ppc_md.pci_irq_fixup(dev);
40452         }
40453  }
40454  
40455 @@ -1328,37 +467,6 @@
40456         /* XXX FIXME - update OF device tree node interrupt property */
40457  }
40458  
40459 -int pcibios_enable_device(struct pci_dev *dev, int mask)
40460 -{
40461 -       u16 cmd, old_cmd;
40462 -       int idx;
40463 -       struct resource *r;
40464 -
40465 -       if (ppc_md.pcibios_enable_device_hook)
40466 -               if (ppc_md.pcibios_enable_device_hook(dev, 0))
40467 -                       return -EINVAL;
40468 -               
40469 -       pci_read_config_word(dev, PCI_COMMAND, &cmd);
40470 -       old_cmd = cmd;
40471 -       for (idx=0; idx<6; idx++) {
40472 -               r = &dev->resource[idx];
40473 -               if (r->flags & IORESOURCE_UNSET) {
40474 -                       printk(KERN_ERR "PCI: Device %s not available because of resource collisions\n", pci_name(dev));
40475 -                       return -EINVAL;
40476 -               }
40477 -               if (r->flags & IORESOURCE_IO)
40478 -                       cmd |= PCI_COMMAND_IO;
40479 -               if (r->flags & IORESOURCE_MEM)
40480 -                       cmd |= PCI_COMMAND_MEMORY;
40481 -       }
40482 -       if (cmd != old_cmd) {
40483 -               printk("PCI: Enabling device %s (%04x -> %04x)\n",
40484 -                      pci_name(dev), old_cmd, cmd);
40485 -               pci_write_config_word(dev, PCI_COMMAND, cmd);
40486 -       }
40487 -       return 0;
40488 -}
40489 -
40490  static struct pci_controller*
40491  pci_bus_to_hose(int bus)
40492  {
40493 @@ -1381,17 +489,6 @@
40494         struct pci_controller* hose;
40495         long result = -EOPNOTSUPP;
40496  
40497 -       /* Argh ! Please forgive me for that hack, but that's the
40498 -        * simplest way to get existing XFree to not lockup on some
40499 -        * G5 machines... So when something asks for bus 0 io base
40500 -        * (bus 0 is HT root), we return the AGP one instead.
40501 -        */
40502 -#ifdef CONFIG_PPC_PMAC
40503 -       if (machine_is(powermac) && machine_is_compatible("MacRISC4"))
40504 -               if (bus == 0)
40505 -                       bus = 0xf0;
40506 -#endif /* CONFIG_PPC_PMAC */
40507 -
40508         hose = pci_bus_to_hose(bus);
40509         if (!hose)
40510                 return -ENODEV;
40511 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/pci_64.c powerpc.git/arch/powerpc/kernel/pci_64.c
40512 --- linux-2.6.24/arch/powerpc/kernel/pci_64.c   2008-01-24 23:58:37.000000000 +0100
40513 +++ powerpc.git/arch/powerpc/kernel/pci_64.c    2008-01-28 20:25:49.000000000 +0100
40514 @@ -31,7 +31,6 @@
40515  #include <asm/byteorder.h>
40516  #include <asm/machdep.h>
40517  #include <asm/ppc-pci.h>
40518 -#include <asm/firmware.h>
40519  
40520  #ifdef DEBUG
40521  #include <asm/udbg.h>
40522 @@ -41,10 +40,6 @@
40523  #endif
40524  
40525  unsigned long pci_probe_only = 1;
40526 -int pci_assign_all_buses = 0;
40527 -
40528 -static void fixup_resource(struct resource *res, struct pci_dev *dev);
40529 -static void do_bus_setup(struct pci_bus *bus);
40530  
40531  /* pci_io_base -- the base address from which io bars are offsets.
40532   * This is the lowest I/O base address (so bar values are always positive),
40533 @@ -70,139 +65,31 @@
40534  }
40535  EXPORT_SYMBOL(get_pci_dma_ops);
40536  
40537 -static void fixup_broken_pcnet32(struct pci_dev* dev)
40538 -{
40539 -       if ((dev->class>>8 == PCI_CLASS_NETWORK_ETHERNET)) {
40540 -               dev->vendor = PCI_VENDOR_ID_AMD;
40541 -               pci_write_config_word(dev, PCI_VENDOR_ID, PCI_VENDOR_ID_AMD);
40542 -       }
40543 -}
40544 -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TRIDENT, PCI_ANY_ID, fixup_broken_pcnet32);
40545 -
40546 -void  pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
40547 -                             struct resource *res)
40548 -{
40549 -       unsigned long offset = 0;
40550 -       struct pci_controller *hose = pci_bus_to_host(dev->bus);
40551 -
40552 -       if (!hose)
40553 -               return;
40554 -
40555 -       if (res->flags & IORESOURCE_IO)
40556 -               offset = (unsigned long)hose->io_base_virt - _IO_BASE;
40557 -
40558 -       if (res->flags & IORESOURCE_MEM)
40559 -               offset = hose->pci_mem_offset;
40560 -
40561 -       region->start = res->start - offset;
40562 -       region->end = res->end - offset;
40563 -}
40564  
40565 -void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
40566 -                             struct pci_bus_region *region)
40567 +int pci_set_dma_mask(struct pci_dev *dev, u64 mask)
40568  {
40569 -       unsigned long offset = 0;
40570 -       struct pci_controller *hose = pci_bus_to_host(dev->bus);
40571 -
40572 -       if (!hose)
40573 -               return;
40574 -
40575 -       if (res->flags & IORESOURCE_IO)
40576 -               offset = (unsigned long)hose->io_base_virt - _IO_BASE;
40577 -
40578 -       if (res->flags & IORESOURCE_MEM)
40579 -               offset = hose->pci_mem_offset;
40580 -
40581 -       res->start = region->start + offset;
40582 -       res->end = region->end + offset;
40583 +       return dma_set_mask(&dev->dev, mask);
40584  }
40585  
40586 -#ifdef CONFIG_HOTPLUG
40587 -EXPORT_SYMBOL(pcibios_resource_to_bus);
40588 -EXPORT_SYMBOL(pcibios_bus_to_resource);
40589 -#endif
40590 -
40591 -/*
40592 - * We need to avoid collisions with `mirrored' VGA ports
40593 - * and other strange ISA hardware, so we always want the
40594 - * addresses to be allocated in the 0x000-0x0ff region
40595 - * modulo 0x400.
40596 - *
40597 - * Why? Because some silly external IO cards only decode
40598 - * the low 10 bits of the IO address. The 0x00-0xff region
40599 - * is reserved for motherboard devices that decode all 16
40600 - * bits, so it's ok to allocate at, say, 0x2800-0x28ff,
40601 - * but we want to try to avoid allocating at 0x2900-0x2bff
40602 - * which might have be mirrored at 0x0100-0x03ff..
40603 - */
40604 -void pcibios_align_resource(void *data, struct resource *res,
40605 -                           resource_size_t size, resource_size_t align)
40606 +int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask)
40607  {
40608 -       struct pci_dev *dev = data;
40609 -       struct pci_controller *hose = pci_bus_to_host(dev->bus);
40610 -       resource_size_t start = res->start;
40611 -       unsigned long alignto;
40612 -
40613 -       if (res->flags & IORESOURCE_IO) {
40614 -               unsigned long offset = (unsigned long)hose->io_base_virt -
40615 -                                       _IO_BASE;
40616 -               /* Make sure we start at our min on all hoses */
40617 -               if (start - offset < PCIBIOS_MIN_IO)
40618 -                       start = PCIBIOS_MIN_IO + offset;
40619 -
40620 -               /*
40621 -                * Put everything into 0x00-0xff region modulo 0x400
40622 -                */
40623 -               if (start & 0x300)
40624 -                       start = (start + 0x3ff) & ~0x3ff;
40625 +       int rc;
40626  
40627 -       } else if (res->flags & IORESOURCE_MEM) {
40628 -               /* Make sure we start at our min on all hoses */
40629 -               if (start - hose->pci_mem_offset < PCIBIOS_MIN_MEM)
40630 -                       start = PCIBIOS_MIN_MEM + hose->pci_mem_offset;
40631 +       rc = dma_set_mask(&dev->dev, mask);
40632 +       dev->dev.coherent_dma_mask = dev->dma_mask;
40633  
40634 -               /* Align to multiple of size of minimum base.  */
40635 -               alignto = max(0x1000UL, align);
40636 -               start = ALIGN(start, alignto);
40637 -       }
40638 -
40639 -       res->start = start;
40640 +       return rc;
40641  }
40642  
40643 -void __devinit pcibios_claim_one_bus(struct pci_bus *b)
40644 +static void fixup_broken_pcnet32(struct pci_dev* dev)
40645  {
40646 -       struct pci_dev *dev;
40647 -       struct pci_bus *child_bus;
40648 -
40649 -       list_for_each_entry(dev, &b->devices, bus_list) {
40650 -               int i;
40651 -
40652 -               for (i = 0; i < PCI_NUM_RESOURCES; i++) {
40653 -                       struct resource *r = &dev->resource[i];
40654 -
40655 -                       if (r->parent || !r->start || !r->flags)
40656 -                               continue;
40657 -                       pci_claim_resource(dev, i);
40658 -               }
40659 +       if ((dev->class>>8 == PCI_CLASS_NETWORK_ETHERNET)) {
40660 +               dev->vendor = PCI_VENDOR_ID_AMD;
40661 +               pci_write_config_word(dev, PCI_VENDOR_ID, PCI_VENDOR_ID_AMD);
40662         }
40663 -
40664 -       list_for_each_entry(child_bus, &b->children, node)
40665 -               pcibios_claim_one_bus(child_bus);
40666  }
40667 -#ifdef CONFIG_HOTPLUG
40668 -EXPORT_SYMBOL_GPL(pcibios_claim_one_bus);
40669 -#endif
40670 -
40671 -static void __init pcibios_claim_of_setup(void)
40672 -{
40673 -       struct pci_bus *b;
40674 -
40675 -       if (firmware_has_feature(FW_FEATURE_ISERIES))
40676 -               return;
40677 +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TRIDENT, PCI_ANY_ID, fixup_broken_pcnet32);
40678  
40679 -       list_for_each_entry(b, &pci_root_buses, node)
40680 -               pcibios_claim_one_bus(b);
40681 -}
40682  
40683  static u32 get_int_prop(struct device_node *np, const char *name, u32 def)
40684  {
40685 @@ -270,7 +157,6 @@
40686                 res->end = base + size - 1;
40687                 res->flags = flags;
40688                 res->name = pci_name(dev);
40689 -               fixup_resource(res, dev);
40690         }
40691  }
40692  
40693 @@ -339,16 +225,17 @@
40694  EXPORT_SYMBOL(of_create_pci_dev);
40695  
40696  void __devinit of_scan_bus(struct device_node *node,
40697 -                                 struct pci_bus *bus)
40698 +                          struct pci_bus *bus)
40699  {
40700 -       struct device_node *child = NULL;
40701 +       struct device_node *child;
40702         const u32 *reg;
40703         int reglen, devfn;
40704         struct pci_dev *dev;
40705  
40706         DBG("of_scan_bus(%s) bus no %d... \n", node->full_name, bus->number);
40707  
40708 -       while ((child = of_get_next_child(node, child)) != NULL) {
40709 +       /* Scan direct children */
40710 +       for_each_child_of_node(node, child) {
40711                 DBG("  * %s\n", child->full_name);
40712                 reg = of_get_property(child, "reg", &reglen);
40713                 if (reg == NULL || reglen < 20)
40714 @@ -359,19 +246,26 @@
40715                 dev = of_create_pci_dev(child, bus, devfn);
40716                 if (!dev)
40717                         continue;
40718 -               DBG("dev header type: %x\n", dev->hdr_type);
40719 +               DBG("    dev header type: %x\n", dev->hdr_type);
40720 +       }
40721  
40722 +       /* Ally all fixups */
40723 +       pcibios_fixup_of_probed_bus(bus);
40724 +
40725 +       /* Now scan child busses */
40726 +       list_for_each_entry(dev, &bus->devices, bus_list) {
40727                 if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
40728 -                   dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)
40729 -                       of_scan_pci_bridge(child, dev);
40730 +                   dev->hdr_type == PCI_HEADER_TYPE_CARDBUS) {
40731 +                       struct device_node *child = pci_device_to_OF_node(dev);
40732 +                       if (dev)
40733 +                               of_scan_pci_bridge(child, dev);
40734 +               }
40735         }
40736 -
40737 -       do_bus_setup(bus);
40738  }
40739  EXPORT_SYMBOL(of_scan_bus);
40740  
40741  void __devinit of_scan_pci_bridge(struct device_node *node,
40742 -                               struct pci_dev *dev)
40743 +                                 struct pci_dev *dev)
40744  {
40745         struct pci_bus *bus;
40746         const u32 *busrange, *ranges;
40747 @@ -441,7 +335,6 @@
40748                 res->start = of_read_number(&ranges[1], 2);
40749                 res->end = res->start + size - 1;
40750                 res->flags = flags;
40751 -               fixup_resource(res, dev);
40752         }
40753         sprintf(bus->name, "PCI Bus %04x:%02x", pci_domain_nr(bus),
40754                 bus->number);
40755 @@ -462,12 +355,12 @@
40756  void __devinit scan_phb(struct pci_controller *hose)
40757  {
40758         struct pci_bus *bus;
40759 -       struct device_node *node = hose->arch_data;
40760 +       struct device_node *node = hose->dn;
40761         int i, mode;
40762 -       struct resource *res;
40763  
40764 -       DBG("Scanning PHB %s\n", node ? node->full_name : "<NO NAME>");
40765 +       DBG("PCI: Scanning PHB %s\n", node ? node->full_name : "<NO NAME>");
40766  
40767 +       /* Create an empty bus for the toplevel */
40768         bus = pci_create_bus(hose->parent, hose->first_busno, hose->ops, node);
40769         if (bus == NULL) {
40770                 printk(KERN_ERR "Failed to create bus for PCI domain %04x\n",
40771 @@ -477,27 +370,27 @@
40772         bus->secondary = hose->first_busno;
40773         hose->bus = bus;
40774  
40775 -       if (!firmware_has_feature(FW_FEATURE_ISERIES))
40776 -               pcibios_map_io_space(bus);
40777 -
40778 -       bus->resource[0] = res = &hose->io_resource;
40779 -       if (res->flags && request_resource(&ioport_resource, res)) {
40780 -               printk(KERN_ERR "Failed to request PCI IO region "
40781 -                      "on PCI domain %04x\n", hose->global_number);
40782 -               DBG("res->start = 0x%016lx, res->end = 0x%016lx\n",
40783 -                   res->start, res->end);
40784 -       }
40785 +       /* Get some IO space for the new PHB */
40786 +       pcibios_map_io_space(bus);
40787  
40788 +       /* Wire up PHB bus resources */
40789 +       DBG("PCI: PHB IO resource    = %016lx-%016lx [%lx]\n",
40790 +           hose->io_resource.start, hose->io_resource.end,
40791 +           hose->io_resource.flags);
40792 +       bus->resource[0] = &hose->io_resource;
40793         for (i = 0; i < 3; ++i) {
40794 -               res = &hose->mem_resources[i];
40795 -               bus->resource[i+1] = res;
40796 -               if (res->flags && request_resource(&iomem_resource, res))
40797 -                       printk(KERN_ERR "Failed to request PCI memory region "
40798 -                              "on PCI domain %04x\n", hose->global_number);
40799 -       }
40800 +               DBG("PCI: PHB MEM resource %d = %016lx-%016lx [%lx]\n", i,
40801 +                   hose->mem_resources[i].start,
40802 +                   hose->mem_resources[i].end,
40803 +                   hose->mem_resources[i].flags);
40804 +               bus->resource[i+1] = &hose->mem_resources[i];
40805 +       }
40806 +       DBG("PCI: PHB MEM offset     = %016lx\n", hose->pci_mem_offset);
40807 +       DBG("PCI: PHB IO  offset     = %08lx\n",
40808 +           (unsigned long)hose->io_base_virt - _IO_BASE);
40809  
40810 +       /* Get probe mode and perform scan */
40811         mode = PCI_PROBE_NORMAL;
40812 -
40813         if (node && ppc_md.pci_probe_mode)
40814                 mode = ppc_md.pci_probe_mode(bus);
40815         DBG("    probe mode: %d\n", mode);
40816 @@ -514,15 +407,15 @@
40817  {
40818         struct pci_controller *hose, *tmp;
40819  
40820 +       printk(KERN_INFO "PCI: Probing PCI hardware\n");
40821 +
40822         /* For now, override phys_mem_access_prot. If we need it,
40823          * later, we may move that initialization to each ppc_md
40824          */
40825         ppc_md.phys_mem_access_prot = pci_phys_mem_access_prot;
40826  
40827 -       if (firmware_has_feature(FW_FEATURE_ISERIES))
40828 -               iSeries_pcibios_init();
40829 -
40830 -       printk(KERN_DEBUG "PCI: Probing PCI hardware\n");
40831 +       if (pci_probe_only)
40832 +               ppc_pci_flags |= PPC_PCI_PROBE_ONLY;
40833  
40834         /* Scan all of the recorded PCI controllers.  */
40835         list_for_each_entry_safe(hose, tmp, &hose_list, list_node) {
40836 @@ -530,19 +423,8 @@
40837                 pci_bus_add_devices(hose->bus);
40838         }
40839  
40840 -       if (!firmware_has_feature(FW_FEATURE_ISERIES)) {
40841 -               if (pci_probe_only)
40842 -                       pcibios_claim_of_setup();
40843 -               else
40844 -                       /* FIXME: `else' will be removed when
40845 -                          pci_assign_unassigned_resources() is able to work
40846 -                          correctly with [partially] allocated PCI tree. */
40847 -                       pci_assign_unassigned_resources();
40848 -       }
40849 -
40850 -       /* Call machine dependent final fixup */
40851 -       if (ppc_md.pcibios_fixup)
40852 -               ppc_md.pcibios_fixup();
40853 +       /* Call common code to handle resource allocation */
40854 +       pcibios_resource_survey();
40855  
40856         printk(KERN_DEBUG "PCI: Probing PCI hardware done\n");
40857  
40858 @@ -551,141 +433,6 @@
40859  
40860  subsys_initcall(pcibios_init);
40861  
40862 -int pcibios_enable_device(struct pci_dev *dev, int mask)
40863 -{
40864 -       u16 cmd, oldcmd;
40865 -       int i;
40866 -
40867 -       pci_read_config_word(dev, PCI_COMMAND, &cmd);
40868 -       oldcmd = cmd;
40869 -
40870 -       for (i = 0; i < PCI_NUM_RESOURCES; i++) {
40871 -               struct resource *res = &dev->resource[i];
40872 -
40873 -               /* Only set up the requested stuff */
40874 -               if (!(mask & (1<<i)))
40875 -                       continue;
40876 -
40877 -               if (res->flags & IORESOURCE_IO)
40878 -                       cmd |= PCI_COMMAND_IO;
40879 -               if (res->flags & IORESOURCE_MEM)
40880 -                       cmd |= PCI_COMMAND_MEMORY;
40881 -       }
40882 -
40883 -       if (cmd != oldcmd) {
40884 -               printk(KERN_DEBUG "PCI: Enabling device: (%s), cmd %x\n",
40885 -                      pci_name(dev), cmd);
40886 -                /* Enable the appropriate bits in the PCI command register.  */
40887 -               pci_write_config_word(dev, PCI_COMMAND, cmd);
40888 -       }
40889 -       return 0;
40890 -}
40891 -
40892 -/* Decide whether to display the domain number in /proc */
40893 -int pci_proc_domain(struct pci_bus *bus)
40894 -{
40895 -       if (firmware_has_feature(FW_FEATURE_ISERIES))
40896 -               return 0;
40897 -       else {
40898 -               struct pci_controller *hose = pci_bus_to_host(bus);
40899 -               return hose->buid != 0;
40900 -       }
40901 -}
40902 -
40903 -void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose,
40904 -                                           struct device_node *dev, int prim)
40905 -{
40906 -       const unsigned int *ranges;
40907 -       unsigned int pci_space;
40908 -       unsigned long size;
40909 -       int rlen = 0;
40910 -       int memno = 0;
40911 -       struct resource *res;
40912 -       int np, na = of_n_addr_cells(dev);
40913 -       unsigned long pci_addr, cpu_phys_addr;
40914 -
40915 -       np = na + 5;
40916 -
40917 -       /* From "PCI Binding to 1275"
40918 -        * The ranges property is laid out as an array of elements,
40919 -        * each of which comprises:
40920 -        *   cells 0 - 2:       a PCI address
40921 -        *   cells 3 or 3+4:    a CPU physical address
40922 -        *                      (size depending on dev->n_addr_cells)
40923 -        *   cells 4+5 or 5+6:  the size of the range
40924 -        */
40925 -       ranges = of_get_property(dev, "ranges", &rlen);
40926 -       if (ranges == NULL)
40927 -               return;
40928 -       hose->io_base_phys = 0;
40929 -       while ((rlen -= np * sizeof(unsigned int)) >= 0) {
40930 -               res = NULL;
40931 -               pci_space = ranges[0];
40932 -               pci_addr = ((unsigned long)ranges[1] << 32) | ranges[2];
40933 -               cpu_phys_addr = of_translate_address(dev, &ranges[3]);
40934 -               size = ((unsigned long)ranges[na+3] << 32) | ranges[na+4];
40935 -               ranges += np;
40936 -               if (size == 0)
40937 -                       continue;
40938 -
40939 -               /* Now consume following elements while they are contiguous */
40940 -               while (rlen >= np * sizeof(unsigned int)) {
40941 -                       unsigned long addr, phys;
40942 -
40943 -                       if (ranges[0] != pci_space)
40944 -                               break;
40945 -                       addr = ((unsigned long)ranges[1] << 32) | ranges[2];
40946 -                       phys = ranges[3];
40947 -                       if (na >= 2)
40948 -                               phys = (phys << 32) | ranges[4];
40949 -                       if (addr != pci_addr + size ||
40950 -                           phys != cpu_phys_addr + size)
40951 -                               break;
40952 -
40953 -                       size += ((unsigned long)ranges[na+3] << 32)
40954 -                               | ranges[na+4];
40955 -                       ranges += np;
40956 -                       rlen -= np * sizeof(unsigned int);
40957 -               }
40958 -
40959 -               switch ((pci_space >> 24) & 0x3) {
40960 -               case 1:         /* I/O space */
40961 -                       hose->io_base_phys = cpu_phys_addr - pci_addr;
40962 -                       /* handle from 0 to top of I/O window */
40963 -                       hose->pci_io_size = pci_addr + size;
40964 -
40965 -                       res = &hose->io_resource;
40966 -                       res->flags = IORESOURCE_IO;
40967 -                       res->start = pci_addr;
40968 -                       DBG("phb%d: IO 0x%lx -> 0x%lx\n", hose->global_number,
40969 -                                   res->start, res->start + size - 1);
40970 -                       break;
40971 -               case 2:         /* memory space */
40972 -                       memno = 0;
40973 -                       while (memno < 3 && hose->mem_resources[memno].flags)
40974 -                               ++memno;
40975 -
40976 -                       if (memno == 0)
40977 -                               hose->pci_mem_offset = cpu_phys_addr - pci_addr;
40978 -                       if (memno < 3) {
40979 -                               res = &hose->mem_resources[memno];
40980 -                               res->flags = IORESOURCE_MEM;
40981 -                               res->start = cpu_phys_addr;
40982 -                               DBG("phb%d: MEM 0x%lx -> 0x%lx\n", hose->global_number,
40983 -                                           res->start, res->start + size - 1);
40984 -                       }
40985 -                       break;
40986 -               }
40987 -               if (res != NULL) {
40988 -                       res->name = dev->full_name;
40989 -                       res->end = res->start + size - 1;
40990 -                       res->parent = NULL;
40991 -                       res->sibling = NULL;
40992 -                       res->child = NULL;
40993 -               }
40994 -       }
40995 -}
40996 -
40997  #ifdef CONFIG_HOTPLUG
40998  
40999  int pcibios_unmap_io_space(struct pci_bus *bus)
41000 @@ -719,8 +466,7 @@
41001         if (hose->io_base_alloc == 0)
41002                 return 0;
41003  
41004 -       DBG("IO unmapping for PHB %s\n",
41005 -           ((struct device_node *)hose->arch_data)->full_name);
41006 +       DBG("IO unmapping for PHB %s\n", hose->dn->full_name);
41007         DBG("  alloc=0x%p\n", hose->io_base_alloc);
41008  
41009         /* This is a PHB, we fully unmap the IO area */
41010 @@ -779,8 +525,7 @@
41011         hose->io_base_virt = (void __iomem *)(area->addr +
41012                                               hose->io_base_phys - phys_page);
41013  
41014 -       DBG("IO mapping for PHB %s\n",
41015 -           ((struct device_node *)hose->arch_data)->full_name);
41016 +       DBG("IO mapping for PHB %s\n", hose->dn->full_name);
41017         DBG("  phys=0x%016lx, virt=0x%p (alloc=0x%p)\n",
41018             hose->io_base_phys, hose->io_base_virt, hose->io_base_alloc);
41019         DBG("  size=0x%016lx (alloc=0x%016lx)\n",
41020 @@ -803,51 +548,13 @@
41021  }
41022  EXPORT_SYMBOL_GPL(pcibios_map_io_space);
41023  
41024 -static void __devinit fixup_resource(struct resource *res, struct pci_dev *dev)
41025 -{
41026 -       struct pci_controller *hose = pci_bus_to_host(dev->bus);
41027 -       unsigned long offset;
41028 -
41029 -       if (res->flags & IORESOURCE_IO) {
41030 -               offset = (unsigned long)hose->io_base_virt - _IO_BASE;
41031 -               res->start += offset;
41032 -               res->end += offset;
41033 -       } else if (res->flags & IORESOURCE_MEM) {
41034 -               res->start += hose->pci_mem_offset;
41035 -               res->end += hose->pci_mem_offset;
41036 -       }
41037 -}
41038 -
41039 -void __devinit pcibios_fixup_device_resources(struct pci_dev *dev,
41040 -                                             struct pci_bus *bus)
41041 -{
41042 -       /* Update device resources.  */
41043 -       int i;
41044 -
41045 -       DBG("%s: Fixup resources:\n", pci_name(dev));
41046 -       for (i = 0; i < PCI_NUM_RESOURCES; i++) {
41047 -               struct resource *res = &dev->resource[i];
41048 -               if (!res->flags)
41049 -                       continue;
41050 -
41051 -               DBG("  0x%02x < %08lx:0x%016lx...0x%016lx\n",
41052 -                   i, res->flags, res->start, res->end);
41053 -
41054 -               fixup_resource(res, dev);
41055 -
41056 -               DBG("       > %08lx:0x%016lx...0x%016lx\n",
41057 -                   res->flags, res->start, res->end);
41058 -       }
41059 -}
41060 -EXPORT_SYMBOL(pcibios_fixup_device_resources);
41061 -
41062  void __devinit pcibios_setup_new_device(struct pci_dev *dev)
41063  {
41064         struct dev_archdata *sd = &dev->dev.archdata;
41065  
41066         sd->of_node = pci_device_to_OF_node(dev);
41067  
41068 -       DBG("PCI device %s OF node: %s\n", pci_name(dev),
41069 +       DBG("PCI: device %s OF node: %s\n", pci_name(dev),
41070             sd->of_node ? sd->of_node->full_name : "<none>");
41071  
41072         sd->dma_ops = pci_dma_ops;
41073 @@ -861,7 +568,7 @@
41074  }
41075  EXPORT_SYMBOL(pcibios_setup_new_device);
41076  
41077 -static void __devinit do_bus_setup(struct pci_bus *bus)
41078 +void __devinit pcibios_do_bus_setup(struct pci_bus *bus)
41079  {
41080         struct pci_dev *dev;
41081  
41082 @@ -870,42 +577,7 @@
41083  
41084         list_for_each_entry(dev, &bus->devices, bus_list)
41085                 pcibios_setup_new_device(dev);
41086 -
41087 -       /* Read default IRQs and fixup if necessary */
41088 -       list_for_each_entry(dev, &bus->devices, bus_list) {
41089 -               pci_read_irq_line(dev);
41090 -               if (ppc_md.pci_irq_fixup)
41091 -                       ppc_md.pci_irq_fixup(dev);
41092 -       }
41093 -}
41094 -
41095 -void __devinit pcibios_fixup_bus(struct pci_bus *bus)
41096 -{
41097 -       struct pci_dev *dev = bus->self;
41098 -       struct device_node *np;
41099 -
41100 -       np = pci_bus_to_OF_node(bus);
41101 -
41102 -       DBG("pcibios_fixup_bus(%s)\n", np ? np->full_name : "<???>");
41103 -
41104 -       if (dev && pci_probe_only &&
41105 -           (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) {
41106 -               /* This is a subordinate bridge */
41107 -
41108 -               pci_read_bridge_bases(bus);
41109 -               pcibios_fixup_device_resources(dev, bus);
41110 -       }
41111 -
41112 -       do_bus_setup(bus);
41113 -
41114 -       if (!pci_probe_only)
41115 -               return;
41116 -
41117 -       list_for_each_entry(dev, &bus->devices, bus_list)
41118 -               if ((dev->class >> 8) != PCI_CLASS_BRIDGE_PCI)
41119 -                       pcibios_fixup_device_resources(dev, bus);
41120  }
41121 -EXPORT_SYMBOL(pcibios_fixup_bus);
41122  
41123  unsigned long pci_address_to_pio(phys_addr_t address)
41124  {
41125 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/pci_dn.c powerpc.git/arch/powerpc/kernel/pci_dn.c
41126 --- linux-2.6.24/arch/powerpc/kernel/pci_dn.c   2008-01-24 23:58:37.000000000 +0100
41127 +++ powerpc.git/arch/powerpc/kernel/pci_dn.c    2008-01-28 20:25:49.000000000 +0100
41128 @@ -56,11 +56,6 @@
41129                 pdn->busno = (regs[0] >> 16) & 0xff;
41130                 pdn->devfn = (regs[0] >> 8) & 0xff;
41131         }
41132 -       if (firmware_has_feature(FW_FEATURE_ISERIES)) {
41133 -               const u32 *busp = of_get_property(dn, "linux,subbus", NULL);
41134 -               if (busp)
41135 -                       pdn->bussubno = *busp;
41136 -       }
41137  
41138         pdn->pci_ext_config_space = (type && *type == 1);
41139         return NULL;
41140 @@ -133,7 +128,7 @@
41141   */
41142  void __devinit pci_devs_phb_init_dynamic(struct pci_controller *phb)
41143  {
41144 -       struct device_node * dn = (struct device_node *) phb->arch_data;
41145 +       struct device_node *dn = phb->dn;
41146         struct pci_dn *pdn;
41147  
41148         /* PHB nodes themselves must not match */
41149 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/ppc_ksyms.c powerpc.git/arch/powerpc/kernel/ppc_ksyms.c
41150 --- linux-2.6.24/arch/powerpc/kernel/ppc_ksyms.c        2008-01-24 23:58:37.000000000 +0100
41151 +++ powerpc.git/arch/powerpc/kernel/ppc_ksyms.c 2008-01-28 20:25:49.000000000 +0100
41152 @@ -59,6 +59,7 @@
41153  extern int sys_sigreturn(struct pt_regs *regs);
41154  
41155  EXPORT_SYMBOL(clear_pages);
41156 +EXPORT_SYMBOL(copy_page);
41157  EXPORT_SYMBOL(ISA_DMA_THRESHOLD);
41158  EXPORT_SYMBOL(DMA_MODE_READ);
41159  EXPORT_SYMBOL(DMA_MODE_WRITE);
41160 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/prom.c powerpc.git/arch/powerpc/kernel/prom.c
41161 --- linux-2.6.24/arch/powerpc/kernel/prom.c     2008-01-24 23:58:37.000000000 +0100
41162 +++ powerpc.git/arch/powerpc/kernel/prom.c      2008-01-28 20:25:49.000000000 +0100
41163 @@ -583,6 +583,20 @@
41164                       ibm_pa_features, ARRAY_SIZE(ibm_pa_features));
41165  }
41166  
41167 +#ifdef CONFIG_PPC64
41168 +static void __init check_cpu_slb_size(unsigned long node)
41169 +{
41170 +       u32 *slb_size_ptr;
41171 +
41172 +       slb_size_ptr = of_get_flat_dt_prop(node, "ibm,slb-size", NULL);
41173 +       if (slb_size_ptr != NULL) {
41174 +               mmu_slb_size = *slb_size_ptr;
41175 +       }
41176 +}
41177 +#else
41178 +#define check_cpu_slb_size(node) do { } while(0)
41179 +#endif
41180 +
41181  static struct feature_property {
41182         const char *name;
41183         u32 min_value;
41184 @@ -600,6 +614,29 @@
41185  #endif /* CONFIG_PPC64 */
41186  };
41187  
41188 +#if defined(CONFIG_44x) && defined(CONFIG_PPC_FPU)
41189 +static inline void identical_pvr_fixup(unsigned long node)
41190 +{
41191 +       unsigned int pvr;
41192 +       char *model = of_get_flat_dt_prop(node, "model", NULL);
41193 +
41194 +       /*
41195 +        * Since 440GR(x)/440EP(x) processors have the same pvr,
41196 +        * we check the node path and set bit 28 in the cur_cpu_spec
41197 +        * pvr for EP(x) processor version. This bit is always 0 in
41198 +        * the "real" pvr. Then we call identify_cpu again with
41199 +        * the new logical pvr to enable FPU support.
41200 +        */
41201 +       if (model && strstr(model, "440EP")) {
41202 +               pvr = cur_cpu_spec->pvr_value | 0x8;
41203 +               identify_cpu(0, pvr);
41204 +               DBG("Using logical pvr %x for %s\n", pvr, model);
41205 +       }
41206 +}
41207 +#else
41208 +#define identical_pvr_fixup(node) do { } while(0)
41209 +#endif
41210 +
41211  static void __init check_cpu_feature_properties(unsigned long node)
41212  {
41213         unsigned long i;
41214 @@ -697,22 +734,13 @@
41215                 prop = of_get_flat_dt_prop(node, "cpu-version", NULL);
41216                 if (prop && (*prop & 0xff000000) == 0x0f000000)
41217                         identify_cpu(0, *prop);
41218 -#if defined(CONFIG_44x) && defined(CONFIG_PPC_FPU)
41219 -               /*
41220 -                * Since 440GR(x)/440EP(x) processors have the same pvr,
41221 -                * we check the node path and set bit 28 in the cur_cpu_spec
41222 -                * pvr for EP(x) processor version. This bit is always 0 in
41223 -                * the "real" pvr. Then we call identify_cpu again with
41224 -                * the new logical pvr to enable FPU support.
41225 -                */
41226 -               if (strstr(uname, "440EP")) {
41227 -                       identify_cpu(0, cur_cpu_spec->pvr_value | 0x8);
41228 -               }
41229 -#endif
41230 +
41231 +               identical_pvr_fixup(node);
41232         }
41233  
41234         check_cpu_feature_properties(node);
41235         check_cpu_pa_features(node);
41236 +       check_cpu_slb_size(node);
41237  
41238  #ifdef CONFIG_PPC_PSERIES
41239         if (nthreads > 1)
41240 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/prom_parse.c powerpc.git/arch/powerpc/kernel/prom_parse.c
41241 --- linux-2.6.24/arch/powerpc/kernel/prom_parse.c       2008-01-24 23:58:37.000000000 +0100
41242 +++ powerpc.git/arch/powerpc/kernel/prom_parse.c        2008-01-28 20:25:49.000000000 +0100
41243 @@ -273,7 +273,7 @@
41244  #else
41245                         struct pci_controller *host;
41246                         host = pci_bus_to_host(pdev->bus);
41247 -                       ppnode = host ? host->arch_data : NULL;
41248 +                       ppnode = host ? host->dn : NULL;
41249  #endif
41250                         /* No node for host bridge ? give up */
41251                         if (ppnode == NULL)
41252 @@ -419,7 +419,7 @@
41253  
41254  static int of_translate_one(struct device_node *parent, struct of_bus *bus,
41255                             struct of_bus *pbus, u32 *addr,
41256 -                           int na, int ns, int pna)
41257 +                           int na, int ns, int pna, const char *rprop)
41258  {
41259         const u32 *ranges;
41260         unsigned int rlen;
41261 @@ -438,7 +438,7 @@
41262          * to translate addresses that aren't supposed to be translated in
41263          * the first place. --BenH.
41264          */
41265 -       ranges = of_get_property(parent, "ranges", &rlen);
41266 +       ranges = of_get_property(parent, rprop, &rlen);
41267         if (ranges == NULL || rlen == 0) {
41268                 offset = of_read_number(addr, na);
41269                 memset(addr, 0, pna * 4);
41270 @@ -481,7 +481,8 @@
41271   * that can be mapped to a cpu physical address). This is not really specified
41272   * that way, but this is traditionally the way IBM at least do things
41273   */
41274 -u64 of_translate_address(struct device_node *dev, const u32 *in_addr)
41275 +u64 __of_translate_address(struct device_node *dev, const u32 *in_addr,
41276 +                          const char *rprop)
41277  {
41278         struct device_node *parent = NULL;
41279         struct of_bus *bus, *pbus;
41280 @@ -540,7 +541,7 @@
41281                     pbus->name, pna, pns, parent->full_name);
41282  
41283                 /* Apply bus translation */
41284 -               if (of_translate_one(dev, bus, pbus, addr, na, ns, pna))
41285 +               if (of_translate_one(dev, bus, pbus, addr, na, ns, pna, rprop))
41286                         break;
41287  
41288                 /* Complete the move up one level */
41289 @@ -556,8 +557,19 @@
41290  
41291         return result;
41292  }
41293 +
41294 +u64 of_translate_address(struct device_node *dev, const u32 *in_addr)
41295 +{
41296 +       return __of_translate_address(dev, in_addr, "ranges");
41297 +}
41298  EXPORT_SYMBOL(of_translate_address);
41299  
41300 +u64 of_translate_dma_address(struct device_node *dev, const u32 *in_addr)
41301 +{
41302 +       return __of_translate_address(dev, in_addr, "dma-ranges");
41303 +}
41304 +EXPORT_SYMBOL(of_translate_dma_address);
41305 +
41306  const u32 *of_get_address(struct device_node *dev, int index, u64 *size,
41307                     unsigned int *flags)
41308  {
41309 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/rio.c powerpc.git/arch/powerpc/kernel/rio.c
41310 --- linux-2.6.24/arch/powerpc/kernel/rio.c      1970-01-01 01:00:00.000000000 +0100
41311 +++ powerpc.git/arch/powerpc/kernel/rio.c       2008-01-28 20:25:49.000000000 +0100
41312 @@ -0,0 +1,52 @@
41313 +/*
41314 + * RapidIO PPC32 support
41315 + *
41316 + * Copyright 2005 MontaVista Software, Inc.
41317 + * Matt Porter <mporter@kernel.crashing.org>
41318 + *
41319 + * This program is free software; you can redistribute  it and/or modify it
41320 + * under  the terms of  the GNU General  Public License as published by the
41321 + * Free Software Foundation;  either version 2 of the  License, or (at your
41322 + * option) any later version.
41323 + */
41324 +
41325 +#include <linux/init.h>
41326 +#include <linux/kernel.h>
41327 +#include <linux/rio.h>
41328 +
41329 +#include <asm/rio.h>
41330 +
41331 +/**
41332 + * platform_rio_init - Do platform specific RIO init
41333 + *
41334 + * Any platform specific initialization of RapdIO
41335 + * hardware is done here as well as registration
41336 + * of any active master ports in the system.
41337 + */
41338 +void __attribute__ ((weak))
41339 +    platform_rio_init(void)
41340 +{
41341 +       printk(KERN_WARNING "RIO: No platform_rio_init() present\n");
41342 +}
41343 +
41344 +/**
41345 + * ppc_rio_init - Do PPC32 RIO init
41346 + *
41347 + * Calls platform-specific RIO init code and then calls
41348 + * rio_init_mports() to initialize any master ports that
41349 + * have been registered with the RIO subsystem.
41350 + */
41351 +static int __init ppc_rio_init(void)
41352 +{
41353 +       printk(KERN_INFO "RIO: RapidIO init\n");
41354 +
41355 +       /* Platform specific initialization */
41356 +       platform_rio_init();
41357 +
41358 +       /* Enumerate all registered ports */
41359 +       rio_init_mports();
41360 +
41361 +       return 0;
41362 +}
41363 +
41364 +subsys_initcall(ppc_rio_init);
41365 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/rtas_pci.c powerpc.git/arch/powerpc/kernel/rtas_pci.c
41366 --- linux-2.6.24/arch/powerpc/kernel/rtas_pci.c 2008-01-24 23:58:37.000000000 +0100
41367 +++ powerpc.git/arch/powerpc/kernel/rtas_pci.c  2008-01-28 20:25:49.000000000 +0100
41368 @@ -260,7 +260,7 @@
41369  
41370  int __devinit rtas_setup_phb(struct pci_controller *phb)
41371  {
41372 -       struct device_node *dev = phb->arch_data;
41373 +       struct device_node *dev = phb->dn;
41374  
41375         if (is_python(dev))
41376                 python_countermeasures(dev);
41377 @@ -280,10 +280,7 @@
41378         struct pci_controller *phb;
41379         struct device_node *root = of_find_node_by_path("/");
41380  
41381 -       for (node = of_get_next_child(root, NULL);
41382 -            node != NULL;
41383 -            node = of_get_next_child(root, node)) {
41384 -
41385 +       for_each_child_of_node(root, node) {
41386                 if (node->type == NULL || (strcmp(node->type, "pci") != 0 &&
41387                                            strcmp(node->type, "pciex") != 0))
41388                         continue;
41389 @@ -311,10 +308,12 @@
41390                 if (prop)
41391                         pci_probe_only = *prop;
41392  
41393 +#ifdef CONFIG_PPC32 /* Will be made generic soon */
41394                 prop = of_get_property(of_chosen,
41395                                 "linux,pci-assign-all-buses", NULL);
41396 -               if (prop)
41397 -                       pci_assign_all_buses = *prop;
41398 +               if (prop && *prop)
41399 +                       ppc_pci_flags |= PPC_PCI_REASSIGN_ALL_BUS;
41400 +#endif /* CONFIG_PPC32 */
41401         }
41402  }
41403  
41404 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/setup-common.c powerpc.git/arch/powerpc/kernel/setup-common.c
41405 --- linux-2.6.24/arch/powerpc/kernel/setup-common.c     2008-01-24 23:58:37.000000000 +0100
41406 +++ powerpc.git/arch/powerpc/kernel/setup-common.c      2008-01-28 20:25:49.000000000 +0100
41407 @@ -33,6 +33,7 @@
41408  #include <linux/serial.h>
41409  #include <linux/serial_8250.h>
41410  #include <linux/debugfs.h>
41411 +#include <linux/percpu.h>
41412  #include <asm/io.h>
41413  #include <asm/prom.h>
41414  #include <asm/processor.h>
41415 @@ -57,6 +58,7 @@
41416  #include <asm/mmu.h>
41417  #include <asm/lmb.h>
41418  #include <asm/xmon.h>
41419 +#include <asm/cputhreads.h>
41420  
41421  #include "setup.h"
41422  
41423 @@ -327,6 +329,31 @@
41424  
41425  #ifdef CONFIG_SMP
41426  
41427 +int threads_per_core, threads_shift;
41428 +cpumask_t threads_core_mask;
41429 +
41430 +static void __init cpu_init_thread_core_maps(int tpc)
41431 +{
41432 +       int i;
41433 +
41434 +       threads_per_core = tpc;
41435 +       threads_core_mask = CPU_MASK_NONE;
41436 +
41437 +       /* This implementation only supports power of 2 number of threads
41438 +        * for simplicity and performance
41439 +        */
41440 +       threads_shift = ilog2(tpc);
41441 +       BUG_ON(tpc != (1 << threads_shift));
41442 +
41443 +       for (i = 0; i < tpc; i++)
41444 +               cpu_set(i, threads_core_mask);
41445 +
41446 +       printk(KERN_INFO "CPU maps initialized for %d thread%s per core\n",
41447 +              tpc, tpc > 1 ? "s" : "");
41448 +       printk(KERN_DEBUG " (thread shift is %d)\n", threads_shift);
41449 +}
41450 +
41451 +
41452  /**
41453   * setup_cpu_maps - initialize the following cpu maps:
41454   *                  cpu_possible_map
41455 @@ -350,22 +377,32 @@
41456  {
41457         struct device_node *dn = NULL;
41458         int cpu = 0;
41459 +       int nthreads = 1;
41460 +
41461 +       DBG("smp_setup_cpu_maps()\n");
41462  
41463         while ((dn = of_find_node_by_type(dn, "cpu")) && cpu < NR_CPUS) {
41464                 const int *intserv;
41465 -               int j, len = sizeof(u32), nthreads = 1;
41466 +               int j, len;
41467 +
41468 +               DBG("  * %s...\n", dn->full_name);
41469  
41470                 intserv = of_get_property(dn, "ibm,ppc-interrupt-server#s",
41471                                 &len);
41472 -               if (intserv)
41473 +               if (intserv) {
41474                         nthreads = len / sizeof(int);
41475 -               else {
41476 +                       DBG("    ibm,ppc-interrupt-server#s -> %d threads\n",
41477 +                           nthreads);
41478 +               } else {
41479 +                       DBG("    no ibm,ppc-interrupt-server#s -> 1 thread\n");
41480                         intserv = of_get_property(dn, "reg", NULL);
41481                         if (!intserv)
41482                                 intserv = &cpu; /* assume logical == phys */
41483                 }
41484  
41485                 for (j = 0; j < nthreads && cpu < NR_CPUS; j++) {
41486 +                       DBG("    thread %d -> cpu %d (hard id %d)\n",
41487 +                           j, cpu, intserv[j]);
41488                         cpu_set(cpu, cpu_present_map);
41489                         set_hard_smp_processor_id(cpu, intserv[j]);
41490                         cpu_set(cpu, cpu_possible_map);
41491 @@ -373,6 +410,12 @@
41492                 }
41493         }
41494  
41495 +       /* If no SMT supported, nthreads is forced to 1 */
41496 +       if (!cpu_has_feature(CPU_FTR_SMT)) {
41497 +               DBG("  SMT disabled ! nthreads forced to 1\n");
41498 +               nthreads = 1;
41499 +       }
41500 +
41501  #ifdef CONFIG_PPC64
41502         /*
41503          * On pSeries LPAR, we need to know how many cpus
41504 @@ -395,7 +438,7 @@
41505  
41506                 /* Double maxcpus for processors which have SMT capability */
41507                 if (cpu_has_feature(CPU_FTR_SMT))
41508 -                       maxcpus *= 2;
41509 +                       maxcpus *= nthreads;
41510  
41511                 if (maxcpus > NR_CPUS) {
41512                         printk(KERN_WARNING
41513 @@ -412,9 +455,16 @@
41514         out:
41515                 of_node_put(dn);
41516         }
41517 -
41518         vdso_data->processorCount = num_present_cpus();
41519  #endif /* CONFIG_PPC64 */
41520 +
41521 +        /* Initialize CPU <=> thread mapping/
41522 +        *
41523 +        * WARNING: We assume that the number of threads is the same for
41524 +        * every CPU in the system. If that is not the case, then some code
41525 +        * here will have to be reworked
41526 +        */
41527 +       cpu_init_thread_core_maps(nthreads);
41528  }
41529  
41530  /*
41531 @@ -424,17 +474,19 @@
41532   */
41533  void __init smp_setup_cpu_sibling_map(void)
41534  {
41535 -#if defined(CONFIG_PPC64)
41536 -       int cpu;
41537 +#ifdef CONFIG_PPC64
41538 +       int i, cpu, base;
41539  
41540 -       /*
41541 -        * Do the sibling map; assume only two threads per processor.
41542 -        */
41543         for_each_possible_cpu(cpu) {
41544 -               cpu_set(cpu, per_cpu(cpu_sibling_map, cpu));
41545 -               if (cpu_has_feature(CPU_FTR_SMT))
41546 -                       cpu_set(cpu ^ 0x1, per_cpu(cpu_sibling_map, cpu));
41547 +               DBG("Sibling map for CPU %d:", cpu);
41548 +               base = cpu_first_thread_in_core(cpu);
41549 +               for (i = 0; i < threads_per_core; i++) {
41550 +                       cpu_set(base + i, per_cpu(cpu_sibling_map, cpu));
41551 +                       DBG(" %d", base + i);
41552 +               }
41553 +               DBG("\n");
41554         }
41555 +
41556  #endif /* CONFIG_PPC64 */
41557  }
41558  #endif /* CONFIG_SMP */
41559 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/signal_32.c powerpc.git/arch/powerpc/kernel/signal_32.c
41560 --- linux-2.6.24/arch/powerpc/kernel/signal_32.c        2008-01-24 23:58:37.000000000 +0100
41561 +++ powerpc.git/arch/powerpc/kernel/signal_32.c 2008-01-28 20:25:49.000000000 +0100
41562 @@ -24,13 +24,12 @@
41563  #include <linux/signal.h>
41564  #include <linux/errno.h>
41565  #include <linux/elf.h>
41566 +#include <linux/ptrace.h>
41567  #ifdef CONFIG_PPC64
41568  #include <linux/syscalls.h>
41569  #include <linux/compat.h>
41570 -#include <linux/ptrace.h>
41571  #else
41572  #include <linux/wait.h>
41573 -#include <linux/ptrace.h>
41574  #include <linux/unistd.h>
41575  #include <linux/stddef.h>
41576  #include <linux/tty.h>
41577 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/smp.c powerpc.git/arch/powerpc/kernel/smp.c
41578 --- linux-2.6.24/arch/powerpc/kernel/smp.c      2008-01-24 23:58:37.000000000 +0100
41579 +++ powerpc.git/arch/powerpc/kernel/smp.c       2008-01-28 20:25:49.000000000 +0100
41580 @@ -76,6 +76,8 @@
41581  
41582  int smt_enabled_at_boot = 1;
41583  
41584 +static int ipi_fail_ok;
41585 +
41586  static void (*crash_ipi_function_ptr)(struct pt_regs *) = NULL;
41587  
41588  #ifdef CONFIG_PPC64
41589 @@ -181,12 +183,13 @@
41590   * <wait> If true, wait (atomically) until function has completed on other CPUs.
41591   * [RETURNS] 0 on success, else a negative status code. Does not return until
41592   * remote CPUs are nearly ready to execute <<func>> or are or have executed.
41593 + * <map> is a cpu map of the cpus to send IPI to.
41594   *
41595   * You must not call this function with disabled interrupts or from a
41596   * hardware interrupt handler or from a bottom half handler.
41597   */
41598 -int smp_call_function_map(void (*func) (void *info), void *info, int nonatomic,
41599 -                       int wait, cpumask_t map)
41600 +static int __smp_call_function_map(void (*func) (void *info), void *info,
41601 +                                  int nonatomic, int wait, cpumask_t map)
41602  {
41603         struct call_data_struct data;
41604         int ret = -1, num_cpus;
41605 @@ -203,8 +206,6 @@
41606         if (wait)
41607                 atomic_set(&data.finished, 0);
41608  
41609 -       spin_lock(&call_lock);
41610 -
41611         /* remove 'self' from the map */
41612         if (cpu_isset(smp_processor_id(), map))
41613                 cpu_clear(smp_processor_id(), map);
41614 @@ -231,7 +232,8 @@
41615                         printk("smp_call_function on cpu %d: other cpus not "
41616                                 "responding (%d)\n", smp_processor_id(),
41617                                 atomic_read(&data.started));
41618 -                       debugger(NULL);
41619 +                       if (!ipi_fail_ok)
41620 +                               debugger(NULL);
41621                         goto out;
41622                 }
41623         }
41624 @@ -258,14 +260,18 @@
41625   out:
41626         call_data = NULL;
41627         HMT_medium();
41628 -       spin_unlock(&call_lock);
41629         return ret;
41630  }
41631  
41632  static int __smp_call_function(void (*func)(void *info), void *info,
41633                                int nonatomic, int wait)
41634  {
41635 -       return smp_call_function_map(func,info,nonatomic,wait,cpu_online_map);
41636 +       int ret;
41637 +       spin_lock(&call_lock);
41638 +       ret =__smp_call_function_map(func, info, nonatomic, wait,
41639 +                                      cpu_online_map);
41640 +       spin_unlock(&call_lock);
41641 +       return ret;
41642  }
41643  
41644  int smp_call_function(void (*func) (void *info), void *info, int nonatomic,
41645 @@ -278,8 +284,8 @@
41646  }
41647  EXPORT_SYMBOL(smp_call_function);
41648  
41649 -int smp_call_function_single(int cpu, void (*func) (void *info), void *info, int nonatomic,
41650 -                       int wait)
41651 +int smp_call_function_single(int cpu, void (*func) (void *info), void *info,
41652 +                            int nonatomic, int wait)
41653  {
41654         cpumask_t map = CPU_MASK_NONE;
41655         int ret = 0;
41656 @@ -291,9 +297,11 @@
41657                 return -EINVAL;
41658  
41659         cpu_set(cpu, map);
41660 -       if (cpu != get_cpu())
41661 -               ret = smp_call_function_map(func,info,nonatomic,wait,map);
41662 -       else {
41663 +       if (cpu != get_cpu()) {
41664 +               spin_lock(&call_lock);
41665 +               ret = __smp_call_function_map(func, info, nonatomic, wait, map);
41666 +               spin_unlock(&call_lock);
41667 +       } else {
41668                 local_irq_disable();
41669                 func(info);
41670                 local_irq_enable();
41671 @@ -305,7 +313,22 @@
41672  
41673  void smp_send_stop(void)
41674  {
41675 -       __smp_call_function(stop_this_cpu, NULL, 1, 0);
41676 +       int nolock;
41677 +
41678 +       /* It's OK to fail sending the IPI, since the alternative is to
41679 +        * be stuck forever waiting on the other CPU to take the interrupt.
41680 +        *
41681 +        * It's better to at least continue and go through reboot, since this
41682 +        * function is usually called at panic or reboot time in the first
41683 +        * place.
41684 +        */
41685 +       ipi_fail_ok = 1;
41686 +
41687 +       /* Don't deadlock in case we got called through panic */
41688 +       nolock = !spin_trylock(&call_lock);
41689 +       __smp_call_function_map(stop_this_cpu, NULL, 1, 0, cpu_online_map);
41690 +       if (!nolock)
41691 +               spin_unlock(&call_lock);
41692  }
41693  
41694  void smp_call_function_interrupt(void)
41695 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/systbl_chk.c powerpc.git/arch/powerpc/kernel/systbl_chk.c
41696 --- linux-2.6.24/arch/powerpc/kernel/systbl_chk.c       1970-01-01 01:00:00.000000000 +0100
41697 +++ powerpc.git/arch/powerpc/kernel/systbl_chk.c        2008-01-28 20:25:49.000000000 +0100
41698 @@ -0,0 +1,58 @@
41699 +/*
41700 + * This file, when run through CPP produces a list of syscall numbers
41701 + * in the order of systbl.h.  That way we can check for gaps and syscalls
41702 + * that are out of order.
41703 + *
41704 + * Unfortunately, we cannot check for the correct ordering of entries
41705 + * using SYSX().
41706 + *
41707 + * Copyright Â© IBM Corporation
41708 + *
41709 + * This program is free software; you can redistribute it and/or
41710 + * modify it under the terms of the GNU General Public License
41711 + * as published by the Free Software Foundation; either version
41712 + * 2 of the License, or (at your option) any later version.
41713 + */
41714 +#include <asm/unistd.h>
41715 +
41716 +#define SYSCALL(func)          __NR_##func
41717 +#define COMPAT_SYS(func)       __NR_##func
41718 +#define PPC_SYS(func)          __NR_##func
41719 +#ifdef CONFIG_PPC64
41720 +#define OLDSYS(func)           -1
41721 +#define SYS32ONLY(func)                -1
41722 +#else
41723 +#define OLDSYS(func)           __NR_old##func
41724 +#define SYS32ONLY(func)                __NR_##func
41725 +#endif
41726 +#define SYSX(f, f3264, f32)    -1
41727 +
41728 +#define SYSCALL_SPU(func)      SYSCALL(func)
41729 +#define COMPAT_SYS_SPU(func)   COMPAT_SYS(func)
41730 +#define PPC_SYS_SPU(func)      PPC_SYS(func)
41731 +#define SYSX_SPU(f, f3264, f32)        SYSX(f, f3264, f32)
41732 +
41733 +/* Just insert a marker for ni_syscalls */
41734 +#define        __NR_ni_syscall         -1
41735 +
41736 +/*
41737 + * These are the known exceptions.
41738 + * Hopefully, there will be no more.
41739 + */
41740 +#define        __NR_llseek             __NR__llseek
41741 +#undef __NR_umount
41742 +#define        __NR_umount             __NR_umount2
41743 +#define        __NR_old_getrlimit      __NR_getrlimit
41744 +#define        __NR_newstat            __NR_stat
41745 +#define        __NR_newlstat           __NR_lstat
41746 +#define        __NR_newfstat           __NR_fstat
41747 +#define        __NR_newuname           __NR_uname
41748 +#define        __NR_sysctl             __NR__sysctl
41749 +#define __NR_olddebug_setcontext       __NR_sys_debug_setcontext
41750 +
41751 +/* We call sys_ugetrlimit for syscall number __NR_getrlimit */
41752 +#define getrlimit              ugetrlimit
41753 +
41754 +START_TABLE
41755 +#include <asm/systbl.h>
41756 +END_TABLE __NR_syscalls
41757 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/systbl_chk.sh powerpc.git/arch/powerpc/kernel/systbl_chk.sh
41758 --- linux-2.6.24/arch/powerpc/kernel/systbl_chk.sh      1970-01-01 01:00:00.000000000 +0100
41759 +++ powerpc.git/arch/powerpc/kernel/systbl_chk.sh       2008-01-28 20:25:49.000000000 +0100
41760 @@ -0,0 +1,33 @@
41761 +#!/bin/sh
41762 +#
41763 +# Just process the CPP output from systbl_chk.c and complain
41764 +# if anything is out of order.
41765 +#
41766 +# Copyright Â© 2008 IBM Corporation
41767 +#
41768 +# This program is free software; you can redistribute it and/or
41769 +# modify it under the terms of the GNU General Public License
41770 +# as published by the Free Software Foundation; either version
41771 +# 2 of the License, or (at your option) any later version.
41772 +
41773 +awk    'BEGIN { num = -1; }    # Ignore the beginning of the file
41774 +       /^#/ { next; }
41775 +       /^[ \t]*$/ { next; }
41776 +       /^START_TABLE/ { num = 0; next; }
41777 +       /^END_TABLE/ {
41778 +               if (num != $2) {
41779 +                       printf "__NR_syscalls (%s) is not one more than the last syscall (%s)\n",
41780 +                               $2, num - 1;
41781 +                       exit(1);
41782 +               }
41783 +               num = -1;       # Ignore the rest of the file
41784 +       }
41785 +       {
41786 +               if (num == -1) next;
41787 +               if (($1 != -1) && ($1 != num)) {
41788 +                       printf "Syscall %s out of order (expected %s)\n",
41789 +                               $1, num;
41790 +                       exit(1);
41791 +               };
41792 +               num++;
41793 +       }' "$1"
41794 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/time.c powerpc.git/arch/powerpc/kernel/time.c
41795 --- linux-2.6.24/arch/powerpc/kernel/time.c     2008-01-24 23:58:37.000000000 +0100
41796 +++ powerpc.git/arch/powerpc/kernel/time.c      2008-01-28 20:25:49.000000000 +0100
41797 @@ -116,9 +116,12 @@
41798         .features       = CLOCK_EVT_FEAT_ONESHOT,
41799  };
41800  
41801 -static DEFINE_PER_CPU(struct clock_event_device, decrementers);
41802 -void init_decrementer_clockevent(void);
41803 -static DEFINE_PER_CPU(u64, decrementer_next_tb);
41804 +struct decrementer_clock {
41805 +       struct clock_event_device event;
41806 +       u64 next_tb;
41807 +};
41808 +
41809 +static DEFINE_PER_CPU(struct decrementer_clock, decrementers);
41810  
41811  #ifdef CONFIG_PPC_ISERIES
41812  static unsigned long __initdata iSeries_recal_titan;
41813 @@ -216,7 +219,11 @@
41814   */
41815  static u64 read_spurr(u64 purr)
41816  {
41817 -       if (cpu_has_feature(CPU_FTR_SPURR))
41818 +       /*
41819 +        * cpus without PURR won't have a SPURR
41820 +        * We already know the former when we use this, so tell gcc
41821 +        */
41822 +       if (cpu_has_feature(CPU_FTR_PURR) && cpu_has_feature(CPU_FTR_SPURR))
41823                 return mfspr(SPRN_SPURR);
41824         return purr;
41825  }
41826 @@ -227,29 +234,30 @@
41827   */
41828  void account_system_vtime(struct task_struct *tsk)
41829  {
41830 -       u64 now, nowscaled, delta, deltascaled;
41831 +       u64 now, nowscaled, delta, deltascaled, sys_time;
41832         unsigned long flags;
41833  
41834         local_irq_save(flags);
41835         now = read_purr();
41836 -       delta = now - get_paca()->startpurr;
41837 -       get_paca()->startpurr = now;
41838         nowscaled = read_spurr(now);
41839 +       delta = now - get_paca()->startpurr;
41840         deltascaled = nowscaled - get_paca()->startspurr;
41841 +       get_paca()->startpurr = now;
41842         get_paca()->startspurr = nowscaled;
41843         if (!in_interrupt()) {
41844                 /* deltascaled includes both user and system time.
41845                  * Hence scale it based on the purr ratio to estimate
41846                  * the system time */
41847 +               sys_time = get_paca()->system_time;
41848                 if (get_paca()->user_time)
41849 -                       deltascaled = deltascaled * get_paca()->system_time /
41850 -                            (get_paca()->system_time + get_paca()->user_time);
41851 -               delta += get_paca()->system_time;
41852 +                       deltascaled = deltascaled * sys_time /
41853 +                            (sys_time + get_paca()->user_time);
41854 +               delta += sys_time;
41855                 get_paca()->system_time = 0;
41856         }
41857         account_system_time(tsk, 0, delta);
41858 -       get_paca()->purrdelta = delta;
41859         account_system_time_scaled(tsk, deltascaled);
41860 +       get_paca()->purrdelta = delta;
41861         get_paca()->spurrdelta = deltascaled;
41862         local_irq_restore(flags);
41863  }
41864 @@ -326,11 +334,9 @@
41865         s64 stolen;
41866         struct cpu_purr_data *pme;
41867  
41868 -       if (!cpu_has_feature(CPU_FTR_PURR))
41869 -               return;
41870 -       pme = &per_cpu(cpu_purr_data, smp_processor_id());
41871 +       pme = &__get_cpu_var(cpu_purr_data);
41872         if (!pme->initialized)
41873 -               return;         /* this can happen in early boot */
41874 +               return;         /* !CPU_FTR_PURR or early in early boot */
41875         tb = mftb();
41876         purr = mfspr(SPRN_PURR);
41877         stolen = (tb - pme->tb) - (purr - pme->purr);
41878 @@ -353,7 +359,7 @@
41879         if (!cpu_has_feature(CPU_FTR_PURR))
41880                 return;
41881         local_irq_save(flags);
41882 -       pme = &per_cpu(cpu_purr_data, smp_processor_id());
41883 +       pme = &__get_cpu_var(cpu_purr_data);
41884         pme->tb = mftb();
41885         pme->purr = mfspr(SPRN_PURR);
41886         pme->initialized = 1;
41887 @@ -556,8 +562,8 @@
41888  void timer_interrupt(struct pt_regs * regs)
41889  {
41890         struct pt_regs *old_regs;
41891 -       int cpu = smp_processor_id();
41892 -       struct clock_event_device *evt = &per_cpu(decrementers, cpu);
41893 +       struct decrementer_clock *decrementer =  &__get_cpu_var(decrementers);
41894 +       struct clock_event_device *evt = &decrementer->event;
41895         u64 now;
41896  
41897         /* Ensure a positive value is written to the decrementer, or else
41898 @@ -570,9 +576,9 @@
41899  #endif
41900  
41901         now = get_tb_or_rtc();
41902 -       if (now < per_cpu(decrementer_next_tb, cpu)) {
41903 +       if (now < decrementer->next_tb) {
41904                 /* not time for this event yet */
41905 -               now = per_cpu(decrementer_next_tb, cpu) - now;
41906 +               now = decrementer->next_tb - now;
41907                 if (now <= DECREMENTER_MAX)
41908                         set_dec((int)now);
41909                 return;
41910 @@ -623,6 +629,45 @@
41911         set_dec(ticks);
41912  }
41913  
41914 +#ifdef CONFIG_SUSPEND
41915 +void generic_suspend_disable_irqs(void)
41916 +{
41917 +       preempt_disable();
41918 +
41919 +       /* Disable the decrementer, so that it doesn't interfere
41920 +        * with suspending.
41921 +        */
41922 +
41923 +       set_dec(0x7fffffff);
41924 +       local_irq_disable();
41925 +       set_dec(0x7fffffff);
41926 +}
41927 +
41928 +void generic_suspend_enable_irqs(void)
41929 +{
41930 +       wakeup_decrementer();
41931 +
41932 +       local_irq_enable();
41933 +       preempt_enable();
41934 +}
41935 +
41936 +/* Overrides the weak version in kernel/power/main.c */
41937 +void arch_suspend_disable_irqs(void)
41938 +{
41939 +       if (ppc_md.suspend_disable_irqs)
41940 +               ppc_md.suspend_disable_irqs();
41941 +       generic_suspend_disable_irqs();
41942 +}
41943 +
41944 +/* Overrides the weak version in kernel/power/main.c */
41945 +void arch_suspend_enable_irqs(void)
41946 +{
41947 +       generic_suspend_enable_irqs();
41948 +       if (ppc_md.suspend_enable_irqs)
41949 +               ppc_md.suspend_enable_irqs();
41950 +}
41951 +#endif
41952 +
41953  #ifdef CONFIG_SMP
41954  void __init smp_space_timers(unsigned int max_cpus)
41955  {
41956 @@ -811,7 +856,7 @@
41957  static int decrementer_set_next_event(unsigned long evt,
41958                                       struct clock_event_device *dev)
41959  {
41960 -       __get_cpu_var(decrementer_next_tb) = get_tb_or_rtc() + evt;
41961 +       __get_cpu_var(decrementers).next_tb = get_tb_or_rtc() + evt;
41962         set_dec(evt);
41963         return 0;
41964  }
41965 @@ -825,7 +870,7 @@
41966  
41967  static void register_decrementer_clockevent(int cpu)
41968  {
41969 -       struct clock_event_device *dec = &per_cpu(decrementers, cpu);
41970 +       struct clock_event_device *dec = &per_cpu(decrementers, cpu).event;
41971  
41972         *dec = decrementer_clockevent;
41973         dec->cpumask = cpumask_of_cpu(cpu);
41974 @@ -836,7 +881,7 @@
41975         clockevents_register_device(dec);
41976  }
41977  
41978 -void init_decrementer_clockevent(void)
41979 +static void __init init_decrementer_clockevent(void)
41980  {
41981         int cpu = smp_processor_id();
41982  
41983 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/traps.c powerpc.git/arch/powerpc/kernel/traps.c
41984 --- linux-2.6.24/arch/powerpc/kernel/traps.c    2008-01-24 23:58:37.000000000 +0100
41985 +++ powerpc.git/arch/powerpc/kernel/traps.c     2008-01-28 20:25:49.000000000 +0100
41986 @@ -334,18 +334,25 @@
41987  #define clear_single_step(regs)        ((regs)->msr &= ~MSR_SE)
41988  #endif
41989  
41990 -static int generic_machine_check_exception(struct pt_regs *regs)
41991 +#if defined(CONFIG_4xx)
41992 +int machine_check_4xx(struct pt_regs *regs)
41993  {
41994         unsigned long reason = get_mc_reason(regs);
41995  
41996 -#if defined(CONFIG_4xx) && !defined(CONFIG_440A)
41997         if (reason & ESR_IMCP) {
41998                 printk("Instruction");
41999                 mtspr(SPRN_ESR, reason & ~ESR_IMCP);
42000         } else
42001                 printk("Data");
42002         printk(" machine check in kernel mode.\n");
42003 -#elif defined(CONFIG_440A)
42004 +
42005 +       return 0;
42006 +}
42007 +
42008 +int machine_check_440A(struct pt_regs *regs)
42009 +{
42010 +       unsigned long reason = get_mc_reason(regs);
42011 +
42012         printk("Machine check in kernel mode.\n");
42013         if (reason & ESR_IMCP){
42014                 printk("Instruction Synchronous Machine Check exception\n");
42015 @@ -375,7 +382,13 @@
42016                 /* Clear MCSR */
42017                 mtspr(SPRN_MCSR, mcsr);
42018         }
42019 -#elif defined (CONFIG_E500)
42020 +       return 0;
42021 +}
42022 +#elif defined(CONFIG_E500)
42023 +int machine_check_e500(struct pt_regs *regs)
42024 +{
42025 +       unsigned long reason = get_mc_reason(regs);
42026 +
42027         printk("Machine check in kernel mode.\n");
42028         printk("Caused by (from MCSR=%lx): ", reason);
42029  
42030 @@ -403,7 +416,14 @@
42031                 printk("Bus - Instruction Parity Error\n");
42032         if (reason & MCSR_BUS_RPERR)
42033                 printk("Bus - Read Parity Error\n");
42034 -#elif defined (CONFIG_E200)
42035 +
42036 +       return 0;
42037 +}
42038 +#elif defined(CONFIG_E200)
42039 +int machine_check_e200(struct pt_regs *regs)
42040 +{
42041 +       unsigned long reason = get_mc_reason(regs);
42042 +
42043         printk("Machine check in kernel mode.\n");
42044         printk("Caused by (from MCSR=%lx): ", reason);
42045  
42046 @@ -421,7 +441,14 @@
42047                 printk("Bus - Read Bus Error on data load\n");
42048         if (reason & MCSR_BUS_WRERR)
42049                 printk("Bus - Write Bus Error on buffered store or cache line push\n");
42050 -#else /* !CONFIG_4xx && !CONFIG_E500 && !CONFIG_E200 */
42051 +
42052 +       return 0;
42053 +}
42054 +#else
42055 +int machine_check_generic(struct pt_regs *regs)
42056 +{
42057 +       unsigned long reason = get_mc_reason(regs);
42058 +
42059         printk("Machine check in kernel mode.\n");
42060         printk("Caused by (from SRR1=%lx): ", reason);
42061         switch (reason & 0x601F0000) {
42062 @@ -451,22 +478,26 @@
42063         default:
42064                 printk("Unknown values in msr\n");
42065         }
42066 -#endif /* CONFIG_4xx */
42067 -
42068         return 0;
42069  }
42070 +#endif /* everything else */
42071  
42072  void machine_check_exception(struct pt_regs *regs)
42073  {
42074         int recover = 0;
42075  
42076 -       /* See if any machine dependent calls */
42077 +       /* See if any machine dependent calls. In theory, we would want
42078 +        * to call the CPU first, and call the ppc_md. one if the CPU
42079 +        * one returns a positive number. However there is existing code
42080 +        * that assumes the board gets a first chance, so let's keep it
42081 +        * that way for now and fix things later. --BenH.
42082 +        */
42083         if (ppc_md.machine_check_exception)
42084                 recover = ppc_md.machine_check_exception(regs);
42085 -       else
42086 -               recover = generic_machine_check_exception(regs);
42087 +       else if (cur_cpu_spec->machine_check)
42088 +               recover = cur_cpu_spec->machine_check(regs);
42089  
42090 -       if (recover)
42091 +       if (recover > 0)
42092                 return;
42093  
42094         if (user_mode(regs)) {
42095 @@ -476,7 +507,12 @@
42096         }
42097  
42098  #if defined(CONFIG_8xx) && defined(CONFIG_PCI)
42099 -       /* the qspan pci read routines can cause machine checks -- Cort */
42100 +       /* the qspan pci read routines can cause machine checks -- Cort
42101 +        *
42102 +        * yuck !!! that totally needs to go away ! There are better ways
42103 +        * to deal with that than having a wart in the mcheck handler.
42104 +        * -- BenH
42105 +        */
42106         bad_page_fault(regs, regs->dar, SIGBUS);
42107         return;
42108  #endif
42109 @@ -622,6 +658,9 @@
42110  #define INST_POPCNTB           0x7c0000f4
42111  #define INST_POPCNTB_MASK      0xfc0007fe
42112  
42113 +#define INST_ISEL              0x7c00001e
42114 +#define INST_ISEL_MASK         0xfc00003e
42115 +
42116  static int emulate_string_inst(struct pt_regs *regs, u32 instword)
42117  {
42118         u8 rT = (instword >> 21) & 0x1f;
42119 @@ -707,6 +746,23 @@
42120         return 0;
42121  }
42122  
42123 +static int emulate_isel(struct pt_regs *regs, u32 instword)
42124 +{
42125 +       u8 rT = (instword >> 21) & 0x1f;
42126 +       u8 rA = (instword >> 16) & 0x1f;
42127 +       u8 rB = (instword >> 11) & 0x1f;
42128 +       u8 BC = (instword >> 6) & 0x1f;
42129 +       u8 bit;
42130 +       unsigned long tmp;
42131 +
42132 +       tmp = (rA == 0) ? 0 : regs->gpr[rA];
42133 +       bit = (regs->ccr >> (31 - BC)) & 0x1;
42134 +
42135 +       regs->gpr[rT] = bit ? tmp : regs->gpr[rB];
42136 +
42137 +       return 0;
42138 +}
42139 +
42140  static int emulate_instruction(struct pt_regs *regs)
42141  {
42142         u32 instword;
42143 @@ -749,6 +805,11 @@
42144                 return emulate_popcntb_inst(regs, instword);
42145         }
42146  
42147 +       /* Emulate isel (Integer Select) instruction */
42148 +       if ((instword & INST_ISEL_MASK) == INST_ISEL) {
42149 +               return emulate_isel(regs, instword);
42150 +       }
42151 +
42152         return -EINVAL;
42153  }
42154  
42155 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/udbg.c powerpc.git/arch/powerpc/kernel/udbg.c
42156 --- linux-2.6.24/arch/powerpc/kernel/udbg.c     2008-01-24 23:58:37.000000000 +0100
42157 +++ powerpc.git/arch/powerpc/kernel/udbg.c      2008-01-28 20:25:49.000000000 +0100
42158 @@ -54,9 +54,16 @@
42159  #elif defined(CONFIG_PPC_EARLY_DEBUG_44x)
42160         /* PPC44x debug */
42161         udbg_init_44x_as1();
42162 +#elif defined(CONFIG_PPC_EARLY_DEBUG_40x)
42163 +       /* PPC40x debug */
42164 +       udbg_init_40x_realmode();
42165  #elif defined(CONFIG_PPC_EARLY_DEBUG_CPM)
42166         udbg_init_cpm();
42167  #endif
42168 +
42169 +#ifdef CONFIG_PPC_EARLY_DEBUG
42170 +       console_loglevel = 10;
42171 +#endif
42172  }
42173  
42174  /* udbg library, used by xmon et al */
42175 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/kernel/udbg_16550.c powerpc.git/arch/powerpc/kernel/udbg_16550.c
42176 --- linux-2.6.24/arch/powerpc/kernel/udbg_16550.c       2008-01-24 23:58:37.000000000 +0100
42177 +++ powerpc.git/arch/powerpc/kernel/udbg_16550.c        2008-01-28 20:25:49.000000000 +0100
42178 @@ -46,7 +46,7 @@
42179  
42180  #define LCR_DLAB 0x80
42181  
42182 -static volatile struct NS16550 __iomem *udbg_comport;
42183 +static struct NS16550 __iomem *udbg_comport;
42184  
42185  static void udbg_550_putc(char c)
42186  {
42187 @@ -117,7 +117,7 @@
42188  {
42189         unsigned int dll, dlm, divisor, prescaler, speed;
42190         u8 old_lcr;
42191 -       volatile struct NS16550 __iomem *port = comport;
42192 +       struct NS16550 __iomem *port = comport;
42193  
42194         old_lcr = in_8(&port->lcr);
42195  
42196 @@ -162,7 +162,7 @@
42197  
42198  void __init udbg_init_maple_realmode(void)
42199  {
42200 -       udbg_comport = (volatile struct NS16550 __iomem *)0xf40003f8;
42201 +       udbg_comport = (struct NS16550 __iomem *)0xf40003f8;
42202  
42203         udbg_putc = udbg_maple_real_putc;
42204         udbg_getc = NULL;
42205 @@ -184,7 +184,7 @@
42206  
42207  void udbg_init_pas_realmode(void)
42208  {
42209 -       udbg_comport = (volatile struct NS16550 __iomem *)0xfcff03f8UL;
42210 +       udbg_comport = (struct NS16550 __iomem *)0xfcff03f8UL;
42211  
42212         udbg_putc = udbg_pas_real_putc;
42213         udbg_getc = NULL;
42214 @@ -219,9 +219,42 @@
42215  void __init udbg_init_44x_as1(void)
42216  {
42217         udbg_comport =
42218 -               (volatile struct NS16550 __iomem *)PPC44x_EARLY_DEBUG_VIRTADDR;
42219 +               (struct NS16550 __iomem *)PPC44x_EARLY_DEBUG_VIRTADDR;
42220  
42221         udbg_putc = udbg_44x_as1_putc;
42222         udbg_getc = udbg_44x_as1_getc;
42223  }
42224  #endif /* CONFIG_PPC_EARLY_DEBUG_44x */
42225 +
42226 +#ifdef CONFIG_PPC_EARLY_DEBUG_40x
42227 +static void udbg_40x_real_putc(char c)
42228 +{
42229 +       if (udbg_comport) {
42230 +               while ((real_readb(&udbg_comport->lsr) & LSR_THRE) == 0)
42231 +                       /* wait for idle */;
42232 +               real_writeb(c, &udbg_comport->thr); eieio();
42233 +               if (c == '\n')
42234 +                       udbg_40x_real_putc('\r');
42235 +       }
42236 +}
42237 +
42238 +static int udbg_40x_real_getc(void)
42239 +{
42240 +       if (udbg_comport) {
42241 +               while ((real_readb(&udbg_comport->lsr) & LSR_DR) == 0)
42242 +                       ; /* wait for char */
42243 +               return real_readb(&udbg_comport->rbr);
42244 +       }
42245 +       return -1;
42246 +}
42247 +
42248 +void __init udbg_init_40x_realmode(void)
42249 +{
42250 +       udbg_comport = (struct NS16550 __iomem *)
42251 +               CONFIG_PPC_EARLY_DEBUG_40x_PHYSADDR;
42252 +
42253 +       udbg_putc = udbg_40x_real_putc;
42254 +       udbg_getc = udbg_40x_real_getc;
42255 +       udbg_getc_poll = NULL;
42256 +}
42257 +#endif /* CONFIG_PPC_EARLY_DEBUG_40x */
42258 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/math-emu/op-4.h powerpc.git/arch/powerpc/math-emu/op-4.h
42259 --- linux-2.6.24/arch/powerpc/math-emu/op-4.h   2008-01-24 23:58:37.000000000 +0100
42260 +++ powerpc.git/arch/powerpc/math-emu/op-4.h    2008-01-28 20:25:49.000000000 +0100
42261 @@ -194,19 +194,39 @@
42262    (X##_f[3] = I3, X##_f[2] = I2, X##_f[1] = I1, X##_f[0] = I0)
42263  
42264  #ifndef __FP_FRAC_ADD_4
42265 -#define __FP_FRAC_ADD_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0)           \
42266 -  (r0 = x0 + y0,                                                       \
42267 -   r1 = x1 + y1 + (r0 < x0),                                           \
42268 -   r2 = x2 + y2 + (r1 < x1),                                           \
42269 -   r3 = x3 + y3 + (r2 < x2))
42270 +#define __FP_FRAC_ADD_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0)   \
42271 +  do {                                                         \
42272 +    int _c1, _c2, _c3;                                         \
42273 +    r0 = x0 + y0;                                              \
42274 +    _c1 = r0 < x0;                                             \
42275 +    r1 = x1 + y1;                                              \
42276 +    _c2 = r1 < x1;                                             \
42277 +    r1 += _c1;                                                 \
42278 +    _c2 |= r1 < _c1;                                           \
42279 +    r2 = x2 + y2;                                              \
42280 +    _c3 = r2 < x2;                                             \
42281 +    r2 += _c2;                                                 \
42282 +    _c3 |= r2 < _c2;                                           \
42283 +    r3 = x3 + y3 + _c3;                                                \
42284 +  } while (0)
42285  #endif
42286  
42287  #ifndef __FP_FRAC_SUB_4
42288 -#define __FP_FRAC_SUB_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0)           \
42289 -  (r0 = x0 - y0,                                                        \
42290 -   r1 = x1 - y1 - (r0 > x0),                                            \
42291 -   r2 = x2 - y2 - (r1 > x1),                                            \
42292 -   r3 = x3 - y3 - (r2 > x2))
42293 +#define __FP_FRAC_SUB_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0)   \
42294 +  do {                                                         \
42295 +    int _c1, _c2, _c3;                                         \
42296 +    r0 = x0 - y0;                                              \
42297 +    _c1 = r0 > x0;                                             \
42298 +    r1 = x1 - y1;                                              \
42299 +    _c2 = r1 > x1;                                             \
42300 +    r1 -= _c1;                                                 \
42301 +    _c2 |= r1 > _c1;                                           \
42302 +    r2 = x2 - y2;                                              \
42303 +    _c3 = r2 > x2;                                             \
42304 +    r2 -= _c2;                                                 \
42305 +    _c3 |= r2 > _c2;                                           \
42306 +    r3 = x3 - y3 - _c3;                                                \
42307 +  } while (0)
42308  #endif
42309  
42310  #ifndef __FP_FRAC_ADDI_4
42311 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/mm/fault.c powerpc.git/arch/powerpc/mm/fault.c
42312 --- linux-2.6.24/arch/powerpc/mm/fault.c        2008-01-24 23:58:37.000000000 +0100
42313 +++ powerpc.git/arch/powerpc/mm/fault.c 2008-01-28 20:25:49.000000000 +0100
42314 @@ -167,10 +167,8 @@
42315         if (notify_page_fault(regs))
42316                 return 0;
42317  
42318 -       if (trap == 0x300) {
42319 -               if (debugger_fault_handler(regs))
42320 -                       return 0;
42321 -       }
42322 +       if (unlikely(debugger_fault_handler(regs)))
42323 +               return 0;
42324  
42325         /* On a kernel SLB miss we can only check for a valid exception entry */
42326         if (!user_mode(regs) && (address >= TASK_SIZE))
42327 @@ -189,7 +187,7 @@
42328                         return SIGSEGV;
42329                 /* in_atomic() in user mode is really bad,
42330                    as is current->mm == NULL. */
42331 -               printk(KERN_EMERG "Page fault in user mode with"
42332 +               printk(KERN_EMERG "Page fault in user mode with "
42333                        "in_atomic() = %d mm = %p\n", in_atomic(), mm);
42334                 printk(KERN_EMERG "NIP = %lx  MSR = %lx\n",
42335                        regs->nip, regs->msr);
42336 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/mm/fsl_booke_mmu.c powerpc.git/arch/powerpc/mm/fsl_booke_mmu.c
42337 --- linux-2.6.24/arch/powerpc/mm/fsl_booke_mmu.c        2008-01-24 23:58:37.000000000 +0100
42338 +++ powerpc.git/arch/powerpc/mm/fsl_booke_mmu.c 2008-01-28 20:25:49.000000000 +0100
42339 @@ -165,15 +165,15 @@
42340  void __init cam_mapin_ram(unsigned long cam0, unsigned long cam1,
42341                 unsigned long cam2)
42342  {
42343 -       settlbcam(0, KERNELBASE, PPC_MEMSTART, cam0, _PAGE_KERNEL, 0);
42344 +       settlbcam(0, PAGE_OFFSET, PPC_MEMSTART, cam0, _PAGE_KERNEL, 0);
42345         tlbcam_index++;
42346         if (cam1) {
42347                 tlbcam_index++;
42348 -               settlbcam(1, KERNELBASE+cam0, PPC_MEMSTART+cam0, cam1, _PAGE_KERNEL, 0);
42349 +               settlbcam(1, PAGE_OFFSET+cam0, PPC_MEMSTART+cam0, cam1, _PAGE_KERNEL, 0);
42350         }
42351         if (cam2) {
42352                 tlbcam_index++;
42353 -               settlbcam(2, KERNELBASE+cam0+cam1, PPC_MEMSTART+cam0+cam1, cam2, _PAGE_KERNEL, 0);
42354 +               settlbcam(2, PAGE_OFFSET+cam0+cam1, PPC_MEMSTART+cam0+cam1, cam2, _PAGE_KERNEL, 0);
42355         }
42356  }
42357  
42358 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/mm/hash_utils_64.c powerpc.git/arch/powerpc/mm/hash_utils_64.c
42359 --- linux-2.6.24/arch/powerpc/mm/hash_utils_64.c        2008-01-24 23:58:37.000000000 +0100
42360 +++ powerpc.git/arch/powerpc/mm/hash_utils_64.c 2008-01-28 21:37:04.000000000 +0100
42361 @@ -96,6 +96,7 @@
42362  int mmu_io_psize = MMU_PAGE_4K;
42363  int mmu_kernel_ssize = MMU_SEGSIZE_256M;
42364  int mmu_highuser_ssize = MMU_SEGSIZE_256M;
42365 +u16 mmu_slb_size = 64;
42366  #ifdef CONFIG_HUGETLB_PAGE
42367  int mmu_huge_psize = MMU_PAGE_16M;
42368  unsigned int HPAGE_SHIFT;
42369 @@ -368,18 +369,11 @@
42370          * on what is available
42371          */
42372         if (mmu_psize_defs[MMU_PAGE_16M].shift)
42373 -               mmu_huge_psize = MMU_PAGE_16M;
42374 +               set_huge_psize(MMU_PAGE_16M);
42375         /* With 4k/4level pagetables, we can't (for now) cope with a
42376          * huge page size < PMD_SIZE */
42377         else if (mmu_psize_defs[MMU_PAGE_1M].shift)
42378 -               mmu_huge_psize = MMU_PAGE_1M;
42379 -
42380 -       /* Calculate HPAGE_SHIFT and sanity check it */
42381 -       if (mmu_psize_defs[mmu_huge_psize].shift > MIN_HUGEPTE_SHIFT &&
42382 -           mmu_psize_defs[mmu_huge_psize].shift < SID_SHIFT)
42383 -               HPAGE_SHIFT = mmu_psize_defs[mmu_huge_psize].shift;
42384 -       else
42385 -               HPAGE_SHIFT = 0; /* No huge pages dude ! */
42386 +               set_huge_psize(MMU_PAGE_1M);
42387  #endif /* CONFIG_HUGETLB_PAGE */
42388  }
42389  
42390 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/mm/hugetlbpage.c powerpc.git/arch/powerpc/mm/hugetlbpage.c
42391 --- linux-2.6.24/arch/powerpc/mm/hugetlbpage.c  2008-01-24 23:58:37.000000000 +0100
42392 +++ powerpc.git/arch/powerpc/mm/hugetlbpage.c   2008-01-28 20:25:49.000000000 +0100
42393 @@ -24,18 +24,17 @@
42394  #include <asm/cputable.h>
42395  #include <asm/spu.h>
42396  
42397 +#define HPAGE_SHIFT_64K        16
42398 +#define HPAGE_SHIFT_16M        24
42399 +
42400  #define NUM_LOW_AREAS  (0x100000000UL >> SID_SHIFT)
42401  #define NUM_HIGH_AREAS (PGTABLE_RANGE >> HTLB_AREA_SHIFT)
42402  
42403 -#ifdef CONFIG_PPC_64K_PAGES
42404 -#define HUGEPTE_INDEX_SIZE     (PMD_SHIFT-HPAGE_SHIFT)
42405 -#else
42406 -#define HUGEPTE_INDEX_SIZE     (PUD_SHIFT-HPAGE_SHIFT)
42407 -#endif
42408 -#define PTRS_PER_HUGEPTE       (1 << HUGEPTE_INDEX_SIZE)
42409 -#define HUGEPTE_TABLE_SIZE     (sizeof(pte_t) << HUGEPTE_INDEX_SIZE)
42410 +unsigned int hugepte_shift;
42411 +#define PTRS_PER_HUGEPTE       (1 << hugepte_shift)
42412 +#define HUGEPTE_TABLE_SIZE     (sizeof(pte_t) << hugepte_shift)
42413  
42414 -#define HUGEPD_SHIFT           (HPAGE_SHIFT + HUGEPTE_INDEX_SIZE)
42415 +#define HUGEPD_SHIFT           (HPAGE_SHIFT + hugepte_shift)
42416  #define HUGEPD_SIZE            (1UL << HUGEPD_SHIFT)
42417  #define HUGEPD_MASK            (~(HUGEPD_SIZE-1))
42418  
42419 @@ -82,11 +81,35 @@
42420         return 0;
42421  }
42422  
42423 +/* Base page size affects how we walk hugetlb page tables */
42424 +#ifdef CONFIG_PPC_64K_PAGES
42425 +#define hpmd_offset(pud, addr)         pmd_offset(pud, addr)
42426 +#define hpmd_alloc(mm, pud, addr)      pmd_alloc(mm, pud, addr)
42427 +#else
42428 +static inline
42429 +pmd_t *hpmd_offset(pud_t *pud, unsigned long addr)
42430 +{
42431 +       if (HPAGE_SHIFT == HPAGE_SHIFT_64K)
42432 +               return pmd_offset(pud, addr);
42433 +       else
42434 +               return (pmd_t *) pud;
42435 +}
42436 +static inline
42437 +pmd_t *hpmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long addr)
42438 +{
42439 +       if (HPAGE_SHIFT == HPAGE_SHIFT_64K)
42440 +               return pmd_alloc(mm, pud, addr);
42441 +       else
42442 +               return (pmd_t *) pud;
42443 +}
42444 +#endif
42445 +
42446  /* Modelled after find_linux_pte() */
42447  pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
42448  {
42449         pgd_t *pg;
42450         pud_t *pu;
42451 +       pmd_t *pm;
42452  
42453         BUG_ON(get_slice_psize(mm, addr) != mmu_huge_psize);
42454  
42455 @@ -96,14 +119,9 @@
42456         if (!pgd_none(*pg)) {
42457                 pu = pud_offset(pg, addr);
42458                 if (!pud_none(*pu)) {
42459 -#ifdef CONFIG_PPC_64K_PAGES
42460 -                       pmd_t *pm;
42461 -                       pm = pmd_offset(pu, addr);
42462 +                       pm = hpmd_offset(pu, addr);
42463                         if (!pmd_none(*pm))
42464                                 return hugepte_offset((hugepd_t *)pm, addr);
42465 -#else
42466 -                       return hugepte_offset((hugepd_t *)pu, addr);
42467 -#endif
42468                 }
42469         }
42470  
42471 @@ -114,6 +132,7 @@
42472  {
42473         pgd_t *pg;
42474         pud_t *pu;
42475 +       pmd_t *pm;
42476         hugepd_t *hpdp = NULL;
42477  
42478         BUG_ON(get_slice_psize(mm, addr) != mmu_huge_psize);
42479 @@ -124,14 +143,9 @@
42480         pu = pud_alloc(mm, pg, addr);
42481  
42482         if (pu) {
42483 -#ifdef CONFIG_PPC_64K_PAGES
42484 -               pmd_t *pm;
42485 -               pm = pmd_alloc(mm, pu, addr);
42486 +               pm = hpmd_alloc(mm, pu, addr);
42487                 if (pm)
42488                         hpdp = (hugepd_t *)pm;
42489 -#else
42490 -               hpdp = (hugepd_t *)pu;
42491 -#endif
42492         }
42493  
42494         if (! hpdp)
42495 @@ -158,7 +172,6 @@
42496                                                  PGF_CACHENUM_MASK));
42497  }
42498  
42499 -#ifdef CONFIG_PPC_64K_PAGES
42500  static void hugetlb_free_pmd_range(struct mmu_gather *tlb, pud_t *pud,
42501                                    unsigned long addr, unsigned long end,
42502                                    unsigned long floor, unsigned long ceiling)
42503 @@ -191,7 +204,6 @@
42504         pud_clear(pud);
42505         pmd_free_tlb(tlb, pmd);
42506  }
42507 -#endif
42508  
42509  static void hugetlb_free_pud_range(struct mmu_gather *tlb, pgd_t *pgd,
42510                                    unsigned long addr, unsigned long end,
42511 @@ -210,9 +222,15 @@
42512                         continue;
42513                 hugetlb_free_pmd_range(tlb, pud, addr, next, floor, ceiling);
42514  #else
42515 -               if (pud_none(*pud))
42516 -                       continue;
42517 -               free_hugepte_range(tlb, (hugepd_t *)pud);
42518 +               if (HPAGE_SHIFT == HPAGE_SHIFT_64K) {
42519 +                       if (pud_none_or_clear_bad(pud))
42520 +                               continue;
42521 +                       hugetlb_free_pmd_range(tlb, pud, addr, next, floor, ceiling);
42522 +               } else {
42523 +                       if (pud_none(*pud))
42524 +                               continue;
42525 +                       free_hugepte_range(tlb, (hugepd_t *)pud);
42526 +               }
42527  #endif
42528         } while (pud++, addr = next, addr != end);
42529  
42530 @@ -526,6 +544,57 @@
42531         return err;
42532  }
42533  
42534 +void set_huge_psize(int psize)
42535 +{
42536 +       /* Check that it is a page size supported by the hardware and
42537 +        * that it fits within pagetable limits. */
42538 +       if (mmu_psize_defs[psize].shift && mmu_psize_defs[psize].shift < SID_SHIFT &&
42539 +               (mmu_psize_defs[psize].shift > MIN_HUGEPTE_SHIFT ||
42540 +                       mmu_psize_defs[psize].shift == HPAGE_SHIFT_64K)) {
42541 +               HPAGE_SHIFT = mmu_psize_defs[psize].shift;
42542 +               mmu_huge_psize = psize;
42543 +#ifdef CONFIG_PPC_64K_PAGES
42544 +               hugepte_shift = (PMD_SHIFT-HPAGE_SHIFT);
42545 +#else
42546 +               if (HPAGE_SHIFT == HPAGE_SHIFT_64K)
42547 +                       hugepte_shift = (PMD_SHIFT-HPAGE_SHIFT);
42548 +               else
42549 +                       hugepte_shift = (PUD_SHIFT-HPAGE_SHIFT);
42550 +#endif
42551 +
42552 +       } else
42553 +               HPAGE_SHIFT = 0;
42554 +}
42555 +
42556 +static int __init hugepage_setup_sz(char *str)
42557 +{
42558 +       unsigned long long size;
42559 +       int mmu_psize = -1;
42560 +       int shift;
42561 +
42562 +       size = memparse(str, &str);
42563 +
42564 +       shift = __ffs(size);
42565 +       switch (shift) {
42566 +#ifndef CONFIG_PPC_64K_PAGES
42567 +       case HPAGE_SHIFT_64K:
42568 +               mmu_psize = MMU_PAGE_64K;
42569 +               break;
42570 +#endif
42571 +       case HPAGE_SHIFT_16M:
42572 +               mmu_psize = MMU_PAGE_16M;
42573 +               break;
42574 +       }
42575 +
42576 +       if (mmu_psize >=0 && mmu_psize_defs[mmu_psize].shift)
42577 +               set_huge_psize(mmu_psize);
42578 +       else
42579 +               printk(KERN_WARNING "Invalid huge page size specified(%llu)\n", size);
42580 +
42581 +       return 1;
42582 +}
42583 +__setup("hugepagesz=", hugepage_setup_sz);
42584 +
42585  static void zero_ctor(struct kmem_cache *cache, void *addr)
42586  {
42587         memset(addr, 0, kmem_cache_size(cache));
42588 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/mm/lmb.c powerpc.git/arch/powerpc/mm/lmb.c
42589 --- linux-2.6.24/arch/powerpc/mm/lmb.c  2008-01-24 23:58:37.000000000 +0100
42590 +++ powerpc.git/arch/powerpc/mm/lmb.c   2008-01-28 20:25:49.000000000 +0100
42591 @@ -342,3 +342,16 @@
42592                 }
42593         }
42594  }
42595 +
42596 +int __init lmb_is_reserved(unsigned long addr)
42597 +{
42598 +       int i;
42599 +
42600 +       for (i = 0; i < lmb.reserved.cnt; i++) {
42601 +               unsigned long upper = lmb.reserved.region[i].base +
42602 +                                     lmb.reserved.region[i].size - 1;
42603 +               if ((addr >= lmb.reserved.region[i].base) && (addr <= upper))
42604 +                       return 1;
42605 +       }
42606 +       return 0;
42607 +}
42608 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/mm/mem.c powerpc.git/arch/powerpc/mm/mem.c
42609 --- linux-2.6.24/arch/powerpc/mm/mem.c  2008-01-24 23:58:37.000000000 +0100
42610 +++ powerpc.git/arch/powerpc/mm/mem.c   2008-01-28 20:25:49.000000000 +0100
42611 @@ -213,15 +213,30 @@
42612          */
42613  #ifdef CONFIG_HIGHMEM
42614         free_bootmem_with_active_regions(0, total_lowmem >> PAGE_SHIFT);
42615 +
42616 +       /* reserve the sections we're already using */
42617 +       for (i = 0; i < lmb.reserved.cnt; i++) {
42618 +               unsigned long addr = lmb.reserved.region[i].base +
42619 +                                    lmb_size_bytes(&lmb.reserved, i) - 1;
42620 +               if (addr < total_lowmem)
42621 +                       reserve_bootmem(lmb.reserved.region[i].base,
42622 +                                       lmb_size_bytes(&lmb.reserved, i));
42623 +               else if (lmb.reserved.region[i].base < total_lowmem) {
42624 +                       unsigned long adjusted_size = total_lowmem -
42625 +                                     lmb.reserved.region[i].base;
42626 +                       reserve_bootmem(lmb.reserved.region[i].base,
42627 +                                       adjusted_size);
42628 +               }
42629 +       }
42630  #else
42631         free_bootmem_with_active_regions(0, max_pfn);
42632 -#endif
42633  
42634         /* reserve the sections we're already using */
42635         for (i = 0; i < lmb.reserved.cnt; i++)
42636                 reserve_bootmem(lmb.reserved.region[i].base,
42637                                 lmb_size_bytes(&lmb.reserved, i));
42638  
42639 +#endif
42640         /* XXX need to clip this if using highmem? */
42641         sparse_memory_present_with_active_regions(0);
42642  
42643 @@ -334,11 +349,13 @@
42644                 highmem_mapnr = total_lowmem >> PAGE_SHIFT;
42645                 for (pfn = highmem_mapnr; pfn < max_mapnr; ++pfn) {
42646                         struct page *page = pfn_to_page(pfn);
42647 -
42648 +                       if (lmb_is_reserved(pfn << PAGE_SHIFT))
42649 +                               continue;
42650                         ClearPageReserved(page);
42651                         init_page_count(page);
42652                         __free_page(page);
42653                         totalhigh_pages++;
42654 +                       reservedpages--;
42655                 }
42656                 totalram_pages += totalhigh_pages;
42657                 printk(KERN_DEBUG "High memory: %luk\n",
42658 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/mm/slb.c powerpc.git/arch/powerpc/mm/slb.c
42659 --- linux-2.6.24/arch/powerpc/mm/slb.c  2008-01-24 23:58:37.000000000 +0100
42660 +++ powerpc.git/arch/powerpc/mm/slb.c   2008-01-28 20:25:49.000000000 +0100
42661 @@ -256,6 +256,7 @@
42662         static int slb_encoding_inited;
42663         extern unsigned int *slb_miss_kernel_load_linear;
42664         extern unsigned int *slb_miss_kernel_load_io;
42665 +       extern unsigned int *slb_compare_rr_to_size;
42666  
42667         /* Prepare our SLB miss handler based on our page size */
42668         linear_llp = mmu_psize_defs[mmu_linear_psize].sllp;
42669 @@ -269,6 +270,8 @@
42670                                    SLB_VSID_KERNEL | linear_llp);
42671                 patch_slb_encoding(slb_miss_kernel_load_io,
42672                                    SLB_VSID_KERNEL | io_llp);
42673 +               patch_slb_encoding(slb_compare_rr_to_size,
42674 +                                  mmu_slb_size);
42675  
42676                 DBG("SLB: linear  LLP = %04x\n", linear_llp);
42677                 DBG("SLB: io      LLP = %04x\n", io_llp);
42678 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/mm/slb_low.S powerpc.git/arch/powerpc/mm/slb_low.S
42679 --- linux-2.6.24/arch/powerpc/mm/slb_low.S      2008-01-24 23:58:37.000000000 +0100
42680 +++ powerpc.git/arch/powerpc/mm/slb_low.S       2008-01-28 20:25:49.000000000 +0100
42681 @@ -227,8 +227,9 @@
42682  
42683  7:     ld      r10,PACASTABRR(r13)
42684         addi    r10,r10,1
42685 -       /* use a cpu feature mask if we ever change our slb size */
42686 -       cmpldi  r10,SLB_NUM_ENTRIES
42687 +       /* This gets soft patched on boot. */
42688 +_GLOBAL(slb_compare_rr_to_size)
42689 +       cmpldi  r10,0
42690  
42691         blt+    4f
42692         li      r10,SLB_NUM_BOLTED
42693 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/oprofile/op_model_cell.c powerpc.git/arch/powerpc/oprofile/op_model_cell.c
42694 --- linux-2.6.24/arch/powerpc/oprofile/op_model_cell.c  2008-01-24 23:58:37.000000000 +0100
42695 +++ powerpc.git/arch/powerpc/oprofile/op_model_cell.c   2008-01-28 20:25:49.000000000 +0100
42696 @@ -61,7 +61,7 @@
42697  #define NUM_THREADS 2         /* number of physical threads in
42698                                * physical processor
42699                                */
42700 -#define NUM_TRACE_BUS_WORDS 4
42701 +#define NUM_DEBUG_BUS_WORDS 4
42702  #define NUM_INPUT_BUS_WORDS 2
42703  
42704  #define MAX_SPU_COUNT 0xFFFFFF /* maximum 24 bit LFSR value */
42705 @@ -169,7 +169,6 @@
42706  
42707  static u32 ctr_enabled;
42708  
42709 -static unsigned char trace_bus[NUM_TRACE_BUS_WORDS];
42710  static unsigned char input_bus[NUM_INPUT_BUS_WORDS];
42711  
42712  /*
42713 @@ -298,7 +297,7 @@
42714  
42715         p->signal_group = event / 100;
42716         p->bus_word = bus_word;
42717 -       p->sub_unit = (unit_mask & 0x0000f000) >> 12;
42718 +       p->sub_unit = GET_SUB_UNIT(unit_mask);
42719  
42720         pm_regs.pm07_cntrl[ctr] = 0;
42721         pm_regs.pm07_cntrl[ctr] |= PM07_CTR_COUNT_CYCLES(count_cycles);
42722 @@ -334,16 +333,16 @@
42723                 p->bit = signal_bit;
42724         }
42725  
42726 -       for (i = 0; i < NUM_TRACE_BUS_WORDS; i++) {
42727 +       for (i = 0; i < NUM_DEBUG_BUS_WORDS; i++) {
42728                 if (bus_word & (1 << i)) {
42729                         pm_regs.debug_bus_control |=
42730 -                           (bus_type << (31 - (2 * i) + 1));
42731 +                           (bus_type << (30 - (2 * i)));
42732  
42733                         for (j = 0; j < NUM_INPUT_BUS_WORDS; j++) {
42734                                 if (input_bus[j] == 0xff) {
42735                                         input_bus[j] = i;
42736                                         pm_regs.group_control |=
42737 -                                           (i << (31 - i));
42738 +                                           (i << (30 - (2 * j)));
42739  
42740                                         break;
42741                                 }
42742 @@ -450,6 +449,12 @@
42743         hdw_thread = 1 ^ hdw_thread;
42744         next_hdw_thread = hdw_thread;
42745  
42746 +       pm_regs.group_control = 0;
42747 +       pm_regs.debug_bus_control = 0;
42748 +
42749 +       for (i = 0; i < NUM_INPUT_BUS_WORDS; i++)
42750 +               input_bus[i] = 0xff;
42751 +
42752         /*
42753          * There are some per thread events.  Must do the
42754          * set event, for the thread that is being started
42755 @@ -619,9 +624,6 @@
42756                 pmc_cntrl[1][i].vcntr = i;
42757         }
42758  
42759 -       for (i = 0; i < NUM_TRACE_BUS_WORDS; i++)
42760 -               trace_bus[i] = 0xff;
42761 -
42762         for (i = 0; i < NUM_INPUT_BUS_WORDS; i++)
42763                 input_bus[i] = 0xff;
42764  
42765 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/40x/Kconfig powerpc.git/arch/powerpc/platforms/40x/Kconfig
42766 --- linux-2.6.24/arch/powerpc/platforms/40x/Kconfig     2008-01-24 23:58:37.000000000 +0100
42767 +++ powerpc.git/arch/powerpc/platforms/40x/Kconfig      2008-01-28 20:25:49.000000000 +0100
42768 @@ -14,28 +14,34 @@
42769  #      help
42770  #        This option enables support for the CPCI405 board.
42771  
42772 -#config EP405
42773 -#      bool "EP405/EP405PC"
42774 -#      depends on 40x
42775 -#      default n
42776 -#      select 405GP
42777 -#      help
42778 -#        This option enables support for the EP405/EP405PC boards.
42779 -
42780 -#config EP405PC
42781 -#      bool "EP405PC Support"
42782 -#      depends on EP405
42783 -#      default y
42784 -#      help
42785 -#        This option enables support for the extra features of the EP405PC board.
42786 +config EP405
42787 +       bool "EP405/EP405PC"
42788 +       depends on 40x
42789 +       default n
42790 +       select 405GP
42791 +       select PCI
42792 +       help
42793 +         This option enables support for the EP405/EP405PC boards.
42794  
42795  config KILAUEA
42796         bool "Kilauea"
42797         depends on 40x
42798         default n
42799 +       select 405EX
42800 +       select PPC4xx_PCI_EXPRESS
42801         help
42802           This option enables support for the AMCC PPC405EX evaluation board.
42803  
42804 +config MAKALU
42805 +       bool "Makalu"
42806 +       depends on 40x
42807 +       default n
42808 +       select 405EX
42809 +       select PCI
42810 +       select PPC4xx_PCI_EXPRESS
42811 +       help
42812 +         This option enables support for the AMCC PPC405EX board.
42813 +
42814  #config REDWOOD_5
42815  #      bool "Redwood-5"
42816  #      depends on 40x
42817 @@ -65,6 +71,7 @@
42818         depends on 40x
42819         default y
42820         select 405GP
42821 +       select PCI
42822         help
42823           This option enables support for the IBM PPC405GP evaluation board.
42824  
42825 @@ -105,6 +112,11 @@
42826  config 405EP
42827         bool
42828  
42829 +config 405EX
42830 +       bool
42831 +       select IBM_NEW_EMAC_EMAC4
42832 +       select IBM_NEW_EMAC_RGMII
42833 +
42834  config 405GPR
42835         bool
42836  
42837 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/40x/Makefile powerpc.git/arch/powerpc/platforms/40x/Makefile
42838 --- linux-2.6.24/arch/powerpc/platforms/40x/Makefile    2008-01-24 23:58:37.000000000 +0100
42839 +++ powerpc.git/arch/powerpc/platforms/40x/Makefile     2008-01-28 20:25:49.000000000 +0100
42840 @@ -1,3 +1,5 @@
42841  obj-$(CONFIG_KILAUEA)                          += kilauea.o
42842 +obj-$(CONFIG_MAKALU)                           += makalu.o
42843  obj-$(CONFIG_WALNUT)                           += walnut.o
42844  obj-$(CONFIG_XILINX_VIRTEX_GENERIC_BOARD)      += virtex.o
42845 +obj-$(CONFIG_EP405)                            += ep405.o
42846 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/40x/ep405.c powerpc.git/arch/powerpc/platforms/40x/ep405.c
42847 --- linux-2.6.24/arch/powerpc/platforms/40x/ep405.c     1970-01-01 01:00:00.000000000 +0100
42848 +++ powerpc.git/arch/powerpc/platforms/40x/ep405.c      2008-01-28 20:25:49.000000000 +0100
42849 @@ -0,0 +1,123 @@
42850 +/*
42851 + * Architecture- / platform-specific boot-time initialization code for
42852 + * IBM PowerPC 4xx based boards. Adapted from original
42853 + * code by Gary Thomas, Cort Dougan <cort@fsmlabs.com>, and Dan Malek
42854 + * <dan@net4x.com>.
42855 + *
42856 + * Copyright(c) 1999-2000 Grant Erickson <grant@lcse.umn.edu>
42857 + *
42858 + * Rewritten and ported to the merged powerpc tree:
42859 + * Copyright 2007 IBM Corporation
42860 + * Josh Boyer <jwboyer@linux.vnet.ibm.com>
42861 + *
42862 + * Adapted to EP405 by Ben. Herrenschmidt <benh@kernel.crashing.org>
42863 + *
42864 + * TODO: Wire up the PCI IRQ mux and the southbridge interrupts
42865 + *
42866 + * 2002 (c) MontaVista, Software, Inc.  This file is licensed under
42867 + * the terms of the GNU General Public License version 2.  This program
42868 + * is licensed "as is" without any warranty of any kind, whether express
42869 + * or implied.
42870 + */
42871 +
42872 +#include <linux/init.h>
42873 +#include <linux/of_platform.h>
42874 +
42875 +#include <asm/machdep.h>
42876 +#include <asm/prom.h>
42877 +#include <asm/udbg.h>
42878 +#include <asm/time.h>
42879 +#include <asm/uic.h>
42880 +#include <asm/pci-bridge.h>
42881 +
42882 +static struct device_node *bcsr_node;
42883 +static void __iomem *bcsr_regs;
42884 +
42885 +/* BCSR registers  */
42886 +#define BCSR_ID                        0
42887 +#define BCSR_PCI_CTRL          1
42888 +#define BCSR_FLASH_NV_POR_CTRL 2
42889 +#define BCSR_FENET_UART_CTRL   3
42890 +#define BCSR_PCI_IRQ           4
42891 +#define BCSR_XIRQ_SELECT       5
42892 +#define BCSR_XIRQ_ROUTING      6
42893 +#define BCSR_XIRQ_STATUS       7
42894 +#define BCSR_XIRQ_STATUS2      8
42895 +#define BCSR_SW_STAT_LED_CTRL  9
42896 +#define BCSR_GPIO_IRQ_PAR_CTRL 10
42897 +/* there's more, can't be bothered typing them tho */
42898 +
42899 +
42900 +static __initdata struct of_device_id ep405_of_bus[] = {
42901 +       { .compatible = "ibm,plb3", },
42902 +       { .compatible = "ibm,opb", },
42903 +       { .compatible = "ibm,ebc", },
42904 +       {},
42905 +};
42906 +
42907 +static int __init ep405_device_probe(void)
42908 +{
42909 +       of_platform_bus_probe(NULL, ep405_of_bus, NULL);
42910 +
42911 +       return 0;
42912 +}
42913 +machine_device_initcall(ep405, ep405_device_probe);
42914 +
42915 +static void __init ep405_init_bcsr(void)
42916 +{
42917 +       const u8 *irq_routing;
42918 +       int i;
42919 +
42920 +       /* Find the bloody thing & map it */
42921 +       bcsr_node = of_find_compatible_node(NULL, NULL, "ep405-bcsr");
42922 +       if (bcsr_node == NULL) {
42923 +               printk(KERN_ERR "EP405 BCSR not found !\n");
42924 +               return;
42925 +       }
42926 +       bcsr_regs = of_iomap(bcsr_node, 0);
42927 +       if (bcsr_regs == NULL) {
42928 +               printk(KERN_ERR "EP405 BCSR failed to map !\n");
42929 +               return;
42930 +       }
42931 +
42932 +       /* Get the irq-routing property and apply the routing to the CPLD */
42933 +       irq_routing = of_get_property(bcsr_node, "irq-routing", NULL);
42934 +       if (irq_routing == NULL)
42935 +               return;
42936 +       for (i = 0; i < 16; i++) {
42937 +               u8 irq = irq_routing[i];
42938 +               out_8(bcsr_regs + BCSR_XIRQ_SELECT, i);
42939 +               out_8(bcsr_regs + BCSR_XIRQ_ROUTING, irq);
42940 +       }
42941 +       in_8(bcsr_regs + BCSR_XIRQ_SELECT);
42942 +       mb();
42943 +       out_8(bcsr_regs + BCSR_GPIO_IRQ_PAR_CTRL, 0xfe);
42944 +}
42945 +
42946 +static void __init ep405_setup_arch(void)
42947 +{
42948 +       /* Find & init the BCSR CPLD */
42949 +       ep405_init_bcsr();
42950 +
42951 +       ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
42952 +}
42953 +
42954 +static int __init ep405_probe(void)
42955 +{
42956 +       unsigned long root = of_get_flat_dt_root();
42957 +
42958 +       if (!of_flat_dt_is_compatible(root, "ep405"))
42959 +               return 0;
42960 +
42961 +       return 1;
42962 +}
42963 +
42964 +define_machine(ep405) {
42965 +       .name                   = "EP405",
42966 +       .probe                  = ep405_probe,
42967 +       .setup_arch             = ep405_setup_arch,
42968 +       .progress               = udbg_progress,
42969 +       .init_IRQ               = uic_init_tree,
42970 +       .get_irq                = uic_get_irq,
42971 +       .calibrate_decr         = generic_calibrate_decr,
42972 +};
42973 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/40x/kilauea.c powerpc.git/arch/powerpc/platforms/40x/kilauea.c
42974 --- linux-2.6.24/arch/powerpc/platforms/40x/kilauea.c   2008-01-24 23:58:37.000000000 +0100
42975 +++ powerpc.git/arch/powerpc/platforms/40x/kilauea.c    2008-01-28 20:25:49.000000000 +0100
42976 @@ -19,8 +19,9 @@
42977  #include <asm/udbg.h>
42978  #include <asm/time.h>
42979  #include <asm/uic.h>
42980 +#include <asm/pci-bridge.h>
42981  
42982 -static struct of_device_id kilauea_of_bus[] = {
42983 +static __initdata struct of_device_id kilauea_of_bus[] = {
42984         { .compatible = "ibm,plb4", },
42985         { .compatible = "ibm,opb", },
42986         { .compatible = "ibm,ebc", },
42987 @@ -29,14 +30,11 @@
42988  
42989  static int __init kilauea_device_probe(void)
42990  {
42991 -       if (!machine_is(kilauea))
42992 -               return 0;
42993 -
42994         of_platform_bus_probe(NULL, kilauea_of_bus, NULL);
42995  
42996         return 0;
42997  }
42998 -device_initcall(kilauea_device_probe);
42999 +machine_device_initcall(kilauea, kilauea_device_probe);
43000  
43001  static int __init kilauea_probe(void)
43002  {
43003 @@ -45,6 +43,8 @@
43004         if (!of_flat_dt_is_compatible(root, "amcc,kilauea"))
43005                 return 0;
43006  
43007 +       ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
43008 +
43009         return 1;
43010  }
43011  
43012 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/40x/makalu.c powerpc.git/arch/powerpc/platforms/40x/makalu.c
43013 --- linux-2.6.24/arch/powerpc/platforms/40x/makalu.c    1970-01-01 01:00:00.000000000 +0100
43014 +++ powerpc.git/arch/powerpc/platforms/40x/makalu.c     2008-01-28 20:25:49.000000000 +0100
43015 @@ -0,0 +1,58 @@
43016 +/*
43017 + * Makalu board specific routines
43018 + *
43019 + * Copyright 2007 DENX Software Engineering, Stefan Roese <sr@denx.de>
43020 + *
43021 + * Based on the Walnut code by
43022 + * Josh Boyer <jwboyer@linux.vnet.ibm.com>
43023 + * Copyright 2007 IBM Corporation
43024 + *
43025 + * This program is free software; you can redistribute  it and/or modify it
43026 + * under  the terms of  the GNU General  Public License as published by the
43027 + * Free Software Foundation;  either version 2 of the  License, or (at your
43028 + * option) any later version.
43029 + */
43030 +#include <linux/init.h>
43031 +#include <linux/of_platform.h>
43032 +#include <asm/machdep.h>
43033 +#include <asm/prom.h>
43034 +#include <asm/udbg.h>
43035 +#include <asm/time.h>
43036 +#include <asm/uic.h>
43037 +#include <asm/pci-bridge.h>
43038 +
43039 +static __initdata struct of_device_id makalu_of_bus[] = {
43040 +       { .compatible = "ibm,plb4", },
43041 +       { .compatible = "ibm,opb", },
43042 +       { .compatible = "ibm,ebc", },
43043 +       {},
43044 +};
43045 +
43046 +static int __init makalu_device_probe(void)
43047 +{
43048 +       of_platform_bus_probe(NULL, makalu_of_bus, NULL);
43049 +
43050 +       return 0;
43051 +}
43052 +machine_device_initcall(makalu, makalu_device_probe);
43053 +
43054 +static int __init makalu_probe(void)
43055 +{
43056 +       unsigned long root = of_get_flat_dt_root();
43057 +
43058 +       if (!of_flat_dt_is_compatible(root, "amcc,makalu"))
43059 +               return 0;
43060 +
43061 +       ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
43062 +
43063 +       return 1;
43064 +}
43065 +
43066 +define_machine(makalu) {
43067 +       .name                           = "Makalu",
43068 +       .probe                          = makalu_probe,
43069 +       .progress                       = udbg_progress,
43070 +       .init_IRQ                       = uic_init_tree,
43071 +       .get_irq                        = uic_get_irq,
43072 +       .calibrate_decr                 = generic_calibrate_decr,
43073 +};
43074 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/40x/virtex.c powerpc.git/arch/powerpc/platforms/40x/virtex.c
43075 --- linux-2.6.24/arch/powerpc/platforms/40x/virtex.c    2008-01-24 23:58:37.000000000 +0100
43076 +++ powerpc.git/arch/powerpc/platforms/40x/virtex.c     2008-01-28 20:25:49.000000000 +0100
43077 @@ -15,16 +15,23 @@
43078  #include <asm/time.h>
43079  #include <asm/xilinx_intc.h>
43080  
43081 +static struct of_device_id xilinx_of_bus_ids[] __initdata = {
43082 +       { .compatible = "xlnx,plb-v46-1.00.a", },
43083 +       { .compatible = "xlnx,plb-v34-1.01.a", },
43084 +       { .compatible = "xlnx,plb-v34-1.02.a", },
43085 +       { .compatible = "xlnx,opb-v20-1.10.c", },
43086 +       { .compatible = "xlnx,dcr-v29-1.00.a", },
43087 +       { .compatible = "xlnx,compound", },
43088 +       {}
43089 +};
43090 +
43091  static int __init virtex_device_probe(void)
43092  {
43093 -       if (!machine_is(virtex))
43094 -               return 0;
43095 -
43096 -       of_platform_bus_probe(NULL, NULL, NULL);
43097 +       of_platform_bus_probe(NULL, xilinx_of_bus_ids, NULL);
43098  
43099         return 0;
43100  }
43101 -device_initcall(virtex_device_probe);
43102 +machine_device_initcall(virtex, virtex_device_probe);
43103  
43104  static int __init virtex_probe(void)
43105  {
43106 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/40x/walnut.c powerpc.git/arch/powerpc/platforms/40x/walnut.c
43107 --- linux-2.6.24/arch/powerpc/platforms/40x/walnut.c    2008-01-24 23:58:37.000000000 +0100
43108 +++ powerpc.git/arch/powerpc/platforms/40x/walnut.c     2008-01-28 20:25:49.000000000 +0100
43109 @@ -24,8 +24,9 @@
43110  #include <asm/udbg.h>
43111  #include <asm/time.h>
43112  #include <asm/uic.h>
43113 +#include <asm/pci-bridge.h>
43114  
43115 -static struct of_device_id walnut_of_bus[] = {
43116 +static __initdata struct of_device_id walnut_of_bus[] = {
43117         { .compatible = "ibm,plb3", },
43118         { .compatible = "ibm,opb", },
43119         { .compatible = "ibm,ebc", },
43120 @@ -34,15 +35,12 @@
43121  
43122  static int __init walnut_device_probe(void)
43123  {
43124 -       if (!machine_is(walnut))
43125 -               return 0;
43126 -
43127 -       /* FIXME: do bus probe here */
43128         of_platform_bus_probe(NULL, walnut_of_bus, NULL);
43129 +       of_instantiate_rtc();
43130  
43131         return 0;
43132  }
43133 -device_initcall(walnut_device_probe);
43134 +machine_device_initcall(walnut, walnut_device_probe);
43135  
43136  static int __init walnut_probe(void)
43137  {
43138 @@ -51,6 +49,8 @@
43139         if (!of_flat_dt_is_compatible(root, "ibm,walnut"))
43140                 return 0;
43141  
43142 +       ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
43143 +
43144         return 1;
43145  }
43146  
43147 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/44x/Kconfig powerpc.git/arch/powerpc/platforms/44x/Kconfig
43148 --- linux-2.6.24/arch/powerpc/platforms/44x/Kconfig     2008-01-24 23:58:37.000000000 +0100
43149 +++ powerpc.git/arch/powerpc/platforms/44x/Kconfig      2008-01-28 20:25:49.000000000 +0100
43150 @@ -3,6 +3,7 @@
43151         depends on 44x
43152         default n
43153         select 440EP
43154 +       select PCI
43155         help
43156           This option enables support for the IBM PPC440EP evaluation board.
43157  
43158 @@ -11,6 +12,8 @@
43159         depends on 44x
43160         default y
43161         select 440GP
43162 +       select PCI
43163 +       select OF_RTC
43164         help
43165           This option enables support for the IBM PPC440GP evaluation board.
43166  
43167 @@ -22,6 +25,48 @@
43168         help
43169           This option enables support for the AMCC PPC440EPX evaluation board.
43170  
43171 +config TAISHAN
43172 +       bool "Taishan"
43173 +       depends on 44x
43174 +       default n
43175 +       select 440GX
43176 +       select PCI
43177 +       help
43178 +         This option enables support for the AMCC PPC440GX "Taishan"
43179 +         evaluation board.
43180 +
43181 +config KATMAI
43182 +       bool "Katmai"
43183 +       depends on 44x
43184 +       default n
43185 +       select 440SPe
43186 +       select PCI
43187 +       select PPC4xx_PCI_EXPRESS
43188 +       help
43189 +         This option enables support for the AMCC PPC440SPe evaluation board.
43190 +
43191 +config RAINIER
43192 +       bool "Rainier"
43193 +       depends on 44x
43194 +       default n
43195 +       select 440GRX
43196 +       select PCI
43197 +       help
43198 +         This option enables support for the AMCC PPC440GRX evaluation board.
43199 +
43200 +config WARP
43201 +       bool "PIKA Warp"
43202 +       depends on 44x
43203 +       default n
43204 +       select 440EP
43205 +       help
43206 +         This option enables support for the PIKA Warp(tm) Appliance. The Warp
43207 +          is a small computer replacement with up to 9 ports of FXO/FXS plus VOIP
43208 +         stations and trunks.
43209 +
43210 +         See http://www.pikatechnologies.com/ and follow the "PIKA for Computer
43211 +         Telephony Developers" link for more information.
43212 +
43213  #config LUAN
43214  #      bool "Luan"
43215  #      depends on 44x
43216 @@ -44,6 +89,7 @@
43217         select PPC_FPU
43218         select IBM440EP_ERR42
43219         select IBM_NEW_EMAC_ZMII
43220 +       select USB_ARCH_HAS_OHCI
43221  
43222  config 440EPX
43223         bool
43224 @@ -52,20 +98,29 @@
43225         select IBM_NEW_EMAC_RGMII
43226         select IBM_NEW_EMAC_ZMII
43227  
43228 +config 440GRX
43229 +       bool
43230 +       select IBM_NEW_EMAC_EMAC4
43231 +       select IBM_NEW_EMAC_RGMII
43232 +       select IBM_NEW_EMAC_ZMII
43233 +
43234  config 440GP
43235         bool
43236         select IBM_NEW_EMAC_ZMII
43237  
43238  config 440GX
43239         bool
43240 +        select IBM_NEW_EMAC_EMAC4
43241 +       select IBM_NEW_EMAC_RGMII
43242 +        select IBM_NEW_EMAC_ZMII #test only
43243 +        select IBM_NEW_EMAC_TAH  #test only
43244  
43245  config 440SP
43246         bool
43247  
43248 -config 440A
43249 +config 440SPe
43250 +        select IBM_NEW_EMAC_EMAC4
43251         bool
43252 -       depends on 440GX || 440EPX
43253 -       default y
43254  
43255  # 44x errata/workaround config symbols, selected by the CPU models above
43256  config IBM440EP_ERR42
43257 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/44x/Makefile powerpc.git/arch/powerpc/platforms/44x/Makefile
43258 --- linux-2.6.24/arch/powerpc/platforms/44x/Makefile    2008-01-24 23:58:37.000000000 +0100
43259 +++ powerpc.git/arch/powerpc/platforms/44x/Makefile     2008-01-28 20:25:49.000000000 +0100
43260 @@ -1,4 +1,9 @@
43261  obj-$(CONFIG_44x)      := misc_44x.o
43262  obj-$(CONFIG_EBONY)    += ebony.o
43263 -obj-$(CONFIG_BAMBOO) += bamboo.o
43264 +obj-$(CONFIG_TAISHAN)  += taishan.o
43265 +obj-$(CONFIG_BAMBOO)   += bamboo.o
43266  obj-$(CONFIG_SEQUOIA)  += sequoia.o
43267 +obj-$(CONFIG_KATMAI)   += katmai.o
43268 +obj-$(CONFIG_RAINIER)  += rainier.o
43269 +obj-$(CONFIG_WARP)     += warp.o
43270 +obj-$(CONFIG_WARP)     += warp-nand.o
43271 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/44x/bamboo.c powerpc.git/arch/powerpc/platforms/44x/bamboo.c
43272 --- linux-2.6.24/arch/powerpc/platforms/44x/bamboo.c    2008-01-24 23:58:37.000000000 +0100
43273 +++ powerpc.git/arch/powerpc/platforms/44x/bamboo.c     2008-01-28 20:25:49.000000000 +0100
43274 @@ -21,9 +21,11 @@
43275  #include <asm/udbg.h>
43276  #include <asm/time.h>
43277  #include <asm/uic.h>
43278 +#include <asm/pci-bridge.h>
43279 +
43280  #include "44x.h"
43281  
43282 -static struct of_device_id bamboo_of_bus[] = {
43283 +static __initdata struct of_device_id bamboo_of_bus[] = {
43284         { .compatible = "ibm,plb4", },
43285         { .compatible = "ibm,opb", },
43286         { .compatible = "ibm,ebc", },
43287 @@ -32,14 +34,11 @@
43288  
43289  static int __init bamboo_device_probe(void)
43290  {
43291 -       if (!machine_is(bamboo))
43292 -               return 0;
43293 -
43294         of_platform_bus_probe(NULL, bamboo_of_bus, NULL);
43295  
43296         return 0;
43297  }
43298 -device_initcall(bamboo_device_probe);
43299 +machine_device_initcall(bamboo, bamboo_device_probe);
43300  
43301  static int __init bamboo_probe(void)
43302  {
43303 @@ -48,6 +47,8 @@
43304         if (!of_flat_dt_is_compatible(root, "amcc,bamboo"))
43305                 return 0;
43306  
43307 +       ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
43308 +
43309         return 1;
43310  }
43311  
43312 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/44x/ebony.c powerpc.git/arch/powerpc/platforms/44x/ebony.c
43313 --- linux-2.6.24/arch/powerpc/platforms/44x/ebony.c     2008-01-24 23:58:37.000000000 +0100
43314 +++ powerpc.git/arch/powerpc/platforms/44x/ebony.c      2008-01-28 20:25:49.000000000 +0100
43315 @@ -18,16 +18,18 @@
43316  
43317  #include <linux/init.h>
43318  #include <linux/of_platform.h>
43319 +#include <linux/rtc.h>
43320  
43321  #include <asm/machdep.h>
43322  #include <asm/prom.h>
43323  #include <asm/udbg.h>
43324  #include <asm/time.h>
43325  #include <asm/uic.h>
43326 +#include <asm/pci-bridge.h>
43327  
43328  #include "44x.h"
43329  
43330 -static struct of_device_id ebony_of_bus[] = {
43331 +static __initdata struct of_device_id ebony_of_bus[] = {
43332         { .compatible = "ibm,plb4", },
43333         { .compatible = "ibm,opb", },
43334         { .compatible = "ibm,ebc", },
43335 @@ -36,14 +38,12 @@
43336  
43337  static int __init ebony_device_probe(void)
43338  {
43339 -       if (!machine_is(ebony))
43340 -               return 0;
43341 -
43342         of_platform_bus_probe(NULL, ebony_of_bus, NULL);
43343 +       of_instantiate_rtc();
43344  
43345         return 0;
43346  }
43347 -device_initcall(ebony_device_probe);
43348 +machine_device_initcall(ebony, ebony_device_probe);
43349  
43350  /*
43351   * Called very early, MMU is off, device-tree isn't unflattened
43352 @@ -55,6 +55,8 @@
43353         if (!of_flat_dt_is_compatible(root, "ibm,ebony"))
43354                 return 0;
43355  
43356 +       ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
43357 +
43358         return 1;
43359  }
43360  
43361 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/44x/katmai.c powerpc.git/arch/powerpc/platforms/44x/katmai.c
43362 --- linux-2.6.24/arch/powerpc/platforms/44x/katmai.c    1970-01-01 01:00:00.000000000 +0100
43363 +++ powerpc.git/arch/powerpc/platforms/44x/katmai.c     2008-01-28 20:25:49.000000000 +0100
43364 @@ -0,0 +1,63 @@
43365 +/*
43366 + * Katmai board specific routines
43367 + *
43368 + * Benjamin Herrenschmidt <benh@kernel.crashing.org>
43369 + * Copyright 2007 IBM Corp.
43370 + *
43371 + * Based on the Bamboo code by
43372 + * Josh Boyer <jwboyer@linux.vnet.ibm.com>
43373 + * Copyright 2007 IBM Corporation
43374 + *
43375 + * This program is free software; you can redistribute  it and/or modify it
43376 + * under  the terms of  the GNU General  Public License as published by the
43377 + * Free Software Foundation;  either version 2 of the  License, or (at your
43378 + * option) any later version.
43379 + */
43380 +#include <linux/init.h>
43381 +#include <linux/of_platform.h>
43382 +
43383 +#include <asm/machdep.h>
43384 +#include <asm/prom.h>
43385 +#include <asm/udbg.h>
43386 +#include <asm/time.h>
43387 +#include <asm/uic.h>
43388 +#include <asm/pci-bridge.h>
43389 +
43390 +#include "44x.h"
43391 +
43392 +static __initdata struct of_device_id katmai_of_bus[] = {
43393 +       { .compatible = "ibm,plb4", },
43394 +       { .compatible = "ibm,opb", },
43395 +       { .compatible = "ibm,ebc", },
43396 +       {},
43397 +};
43398 +
43399 +static int __init katmai_device_probe(void)
43400 +{
43401 +       of_platform_bus_probe(NULL, katmai_of_bus, NULL);
43402 +
43403 +       return 0;
43404 +}
43405 +machine_device_initcall(katmai, katmai_device_probe);
43406 +
43407 +static int __init katmai_probe(void)
43408 +{
43409 +       unsigned long root = of_get_flat_dt_root();
43410 +
43411 +       if (!of_flat_dt_is_compatible(root, "amcc,katmai"))
43412 +               return 0;
43413 +
43414 +       ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
43415 +
43416 +       return 1;
43417 +}
43418 +
43419 +define_machine(katmai) {
43420 +       .name                           = "Katmai",
43421 +       .probe                          = katmai_probe,
43422 +       .progress                       = udbg_progress,
43423 +       .init_IRQ                       = uic_init_tree,
43424 +       .get_irq                        = uic_get_irq,
43425 +       .restart                        = ppc44x_reset_system,
43426 +       .calibrate_decr                 = generic_calibrate_decr,
43427 +};
43428 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/44x/rainier.c powerpc.git/arch/powerpc/platforms/44x/rainier.c
43429 --- linux-2.6.24/arch/powerpc/platforms/44x/rainier.c   1970-01-01 01:00:00.000000000 +0100
43430 +++ powerpc.git/arch/powerpc/platforms/44x/rainier.c    2008-01-28 20:25:49.000000000 +0100
43431 @@ -0,0 +1,62 @@
43432 +/*
43433 + * Rainier board specific routines
43434 + *
43435 + * Valentine Barshak <vbarshak@ru.mvista.com>
43436 + * Copyright 2007 MontaVista Software Inc.
43437 + *
43438 + * Based on the Bamboo code by
43439 + * Josh Boyer <jwboyer@linux.vnet.ibm.com>
43440 + * Copyright 2007 IBM Corporation
43441 + *
43442 + * This program is free software; you can redistribute  it and/or modify it
43443 + * under  the terms of  the GNU General  Public License as published by the
43444 + * Free Software Foundation;  either version 2 of the  License, or (at your
43445 + * option) any later version.
43446 + */
43447 +#include <linux/init.h>
43448 +#include <linux/of_platform.h>
43449 +
43450 +#include <asm/machdep.h>
43451 +#include <asm/prom.h>
43452 +#include <asm/udbg.h>
43453 +#include <asm/time.h>
43454 +#include <asm/uic.h>
43455 +#include <asm/pci-bridge.h>
43456 +#include "44x.h"
43457 +
43458 +static __initdata struct of_device_id rainier_of_bus[] = {
43459 +       { .compatible = "ibm,plb4", },
43460 +       { .compatible = "ibm,opb", },
43461 +       { .compatible = "ibm,ebc", },
43462 +       {},
43463 +};
43464 +
43465 +static int __init rainier_device_probe(void)
43466 +{
43467 +       of_platform_bus_probe(NULL, rainier_of_bus, NULL);
43468 +
43469 +       return 0;
43470 +}
43471 +machine_device_initcall(rainier, rainier_device_probe);
43472 +
43473 +static int __init rainier_probe(void)
43474 +{
43475 +       unsigned long root = of_get_flat_dt_root();
43476 +
43477 +       if (!of_flat_dt_is_compatible(root, "amcc,rainier"))
43478 +               return 0;
43479 +
43480 +       ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
43481 +
43482 +       return 1;
43483 +}
43484 +
43485 +define_machine(rainier) {
43486 +       .name                           = "Rainier",
43487 +       .probe                          = rainier_probe,
43488 +       .progress                       = udbg_progress,
43489 +       .init_IRQ                       = uic_init_tree,
43490 +       .get_irq                        = uic_get_irq,
43491 +       .restart                        = ppc44x_reset_system,
43492 +       .calibrate_decr                 = generic_calibrate_decr,
43493 +};
43494 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/44x/sequoia.c powerpc.git/arch/powerpc/platforms/44x/sequoia.c
43495 --- linux-2.6.24/arch/powerpc/platforms/44x/sequoia.c   2008-01-24 23:58:37.000000000 +0100
43496 +++ powerpc.git/arch/powerpc/platforms/44x/sequoia.c    2008-01-28 20:25:49.000000000 +0100
43497 @@ -21,9 +21,11 @@
43498  #include <asm/udbg.h>
43499  #include <asm/time.h>
43500  #include <asm/uic.h>
43501 +#include <asm/pci-bridge.h>
43502 +
43503  #include "44x.h"
43504  
43505 -static struct of_device_id sequoia_of_bus[] = {
43506 +static __initdata struct of_device_id sequoia_of_bus[] = {
43507         { .compatible = "ibm,plb4", },
43508         { .compatible = "ibm,opb", },
43509         { .compatible = "ibm,ebc", },
43510 @@ -32,14 +34,11 @@
43511  
43512  static int __init sequoia_device_probe(void)
43513  {
43514 -       if (!machine_is(sequoia))
43515 -               return 0;
43516 -
43517         of_platform_bus_probe(NULL, sequoia_of_bus, NULL);
43518  
43519         return 0;
43520  }
43521 -device_initcall(sequoia_device_probe);
43522 +machine_device_initcall(sequoia, sequoia_device_probe);
43523  
43524  static int __init sequoia_probe(void)
43525  {
43526 @@ -48,6 +47,8 @@
43527         if (!of_flat_dt_is_compatible(root, "amcc,sequoia"))
43528                 return 0;
43529  
43530 +       ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
43531 +
43532         return 1;
43533  }
43534  
43535 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/44x/taishan.c powerpc.git/arch/powerpc/platforms/44x/taishan.c
43536 --- linux-2.6.24/arch/powerpc/platforms/44x/taishan.c   1970-01-01 01:00:00.000000000 +0100
43537 +++ powerpc.git/arch/powerpc/platforms/44x/taishan.c    2008-01-28 20:25:49.000000000 +0100
43538 @@ -0,0 +1,73 @@
43539 +/*
43540 + * Taishan board specific routines based off ebony.c code
43541 + * original copyrights below
43542 + *
43543 + * Matt Porter <mporter@kernel.crashing.org>
43544 + * Copyright 2002-2005 MontaVista Software Inc.
43545 + *
43546 + * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
43547 + * Copyright (c) 2003-2005 Zultys Technologies
43548 + *
43549 + * Rewritten and ported to the merged powerpc tree:
43550 + * Copyright 2007 David Gibson <dwg@au1.ibm.com>, IBM Corporation.
43551 + *
43552 + * Modified from ebony.c for taishan:
43553 + * Copyright 2007 Hugh Blemings <hugh@au.ibm.com>, IBM Corporation.
43554 + *
43555 + * This program is free software; you can redistribute  it and/or modify it
43556 + * under  the terms of  the GNU General  Public License as published by the
43557 + * Free Software Foundation;  either version 2 of the  License, or (at your
43558 + * option) any later version.
43559 + */
43560 +
43561 +#include <linux/init.h>
43562 +#include <linux/of_platform.h>
43563 +
43564 +#include <asm/machdep.h>
43565 +#include <asm/prom.h>
43566 +#include <asm/udbg.h>
43567 +#include <asm/time.h>
43568 +#include <asm/uic.h>
43569 +#include <asm/pci-bridge.h>
43570 +
43571 +#include "44x.h"
43572 +
43573 +static __initdata struct of_device_id taishan_of_bus[] = {
43574 +       { .compatible = "ibm,plb4", },
43575 +       { .compatible = "ibm,opb", },
43576 +       { .compatible = "ibm,ebc", },
43577 +       {},
43578 +};
43579 +
43580 +static int __init taishan_device_probe(void)
43581 +{
43582 +       of_platform_bus_probe(NULL, taishan_of_bus, NULL);
43583 +
43584 +       return 0;
43585 +}
43586 +machine_device_initcall(taishan, taishan_device_probe);
43587 +
43588 +/*
43589 + * Called very early, MMU is off, device-tree isn't unflattened
43590 + */
43591 +static int __init taishan_probe(void)
43592 +{
43593 +       unsigned long root = of_get_flat_dt_root();
43594 +
43595 +       if (!of_flat_dt_is_compatible(root, "amcc,taishan"))
43596 +               return 0;
43597 +
43598 +       ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
43599 +
43600 +       return 1;
43601 +}
43602 +
43603 +define_machine(taishan) {
43604 +       .name                   = "Taishan",
43605 +       .probe                  = taishan_probe,
43606 +       .progress               = udbg_progress,
43607 +       .init_IRQ               = uic_init_tree,
43608 +       .get_irq                = uic_get_irq,
43609 +       .restart                = ppc44x_reset_system,
43610 +       .calibrate_decr         = generic_calibrate_decr,
43611 +};
43612 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/44x/warp-nand.c powerpc.git/arch/powerpc/platforms/44x/warp-nand.c
43613 --- linux-2.6.24/arch/powerpc/platforms/44x/warp-nand.c 1970-01-01 01:00:00.000000000 +0100
43614 +++ powerpc.git/arch/powerpc/platforms/44x/warp-nand.c  2008-01-28 20:25:49.000000000 +0100
43615 @@ -0,0 +1,105 @@
43616 +/*
43617 + * PIKA Warp(tm) NAND flash specific routines
43618 + *
43619 + * Copyright (c) 2008 PIKA Technologies
43620 + *   Sean MacLennan <smaclennan@pikatech.com>
43621 + */
43622 +
43623 +#include <linux/platform_device.h>
43624 +#include <linux/mtd/mtd.h>
43625 +#include <linux/mtd/map.h>
43626 +#include <linux/mtd/partitions.h>
43627 +#include <linux/mtd/nand.h>
43628 +#include <linux/mtd/ndfc.h>
43629 +
43630 +#ifdef CONFIG_MTD_NAND_NDFC
43631 +
43632 +#define CS_NAND_0      1       /* use chip select 1 for NAND device 0 */
43633 +
43634 +#define WARP_NAND_FLASH_REG_ADDR       0xD0000000UL
43635 +#define WARP_NAND_FLASH_REG_SIZE       0x2000
43636 +
43637 +static struct resource warp_ndfc = {
43638 +       .start = WARP_NAND_FLASH_REG_ADDR,
43639 +       .end   = WARP_NAND_FLASH_REG_ADDR + WARP_NAND_FLASH_REG_SIZE,
43640 +       .flags = IORESOURCE_MEM,
43641 +};
43642 +
43643 +static struct mtd_partition nand_parts[] = {
43644 +       {
43645 +               .name   = "kernel",
43646 +               .offset = 0,
43647 +               .size   = 0x0200000
43648 +       },
43649 +       {
43650 +               .name   = "root",
43651 +               .offset = 0x0200000,
43652 +               .size   = 0x3400000
43653 +       },
43654 +       {
43655 +               .name   = "user",
43656 +               .offset = 0x3600000,
43657 +               .size   = 0x0A00000
43658 +       },
43659 +};
43660 +
43661 +struct ndfc_controller_settings warp_ndfc_settings = {
43662 +       .ccr_settings = (NDFC_CCR_BS(CS_NAND_0) | NDFC_CCR_ARAC1),
43663 +       .ndfc_erpn = 0,
43664 +};
43665 +
43666 +static struct ndfc_chip_settings warp_chip0_settings = {
43667 +       .bank_settings = 0x80002222,
43668 +};
43669 +
43670 +struct platform_nand_ctrl warp_nand_ctrl = {
43671 +       .priv = &warp_ndfc_settings,
43672 +};
43673 +
43674 +static struct platform_device warp_ndfc_device = {
43675 +       .name = "ndfc-nand",
43676 +       .id = 0,
43677 +       .dev = {
43678 +               .platform_data = &warp_nand_ctrl,
43679 +       },
43680 +       .num_resources = 1,
43681 +       .resource = &warp_ndfc,
43682 +};
43683 +
43684 +static struct nand_ecclayout nand_oob_16 = {
43685 +       .eccbytes = 3,
43686 +       .eccpos = { 0, 1, 2, 3, 6, 7 },
43687 +       .oobfree = { {.offset = 8, .length = 16} }
43688 +};
43689 +
43690 +static struct platform_nand_chip warp_nand_chip0 = {
43691 +       .nr_chips = 1,
43692 +       .chip_offset = CS_NAND_0,
43693 +       .nr_partitions = ARRAY_SIZE(nand_parts),
43694 +       .partitions = nand_parts,
43695 +       .chip_delay = 50,
43696 +       .ecclayout = &nand_oob_16,
43697 +       .priv = &warp_chip0_settings,
43698 +};
43699 +
43700 +static struct platform_device warp_nand_device = {
43701 +       .name = "ndfc-chip",
43702 +       .id = 0,
43703 +       .num_resources = 1,
43704 +       .resource = &warp_ndfc,
43705 +       .dev = {
43706 +               .platform_data = &warp_nand_chip0,
43707 +               .parent = &warp_ndfc_device.dev,
43708 +       }
43709 +};
43710 +
43711 +static int warp_setup_nand_flash(void)
43712 +{
43713 +       platform_device_register(&warp_ndfc_device);
43714 +       platform_device_register(&warp_nand_device);
43715 +
43716 +       return 0;
43717 +}
43718 +device_initcall(warp_setup_nand_flash);
43719 +
43720 +#endif
43721 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/44x/warp.c powerpc.git/arch/powerpc/platforms/44x/warp.c
43722 --- linux-2.6.24/arch/powerpc/platforms/44x/warp.c      1970-01-01 01:00:00.000000000 +0100
43723 +++ powerpc.git/arch/powerpc/platforms/44x/warp.c       2008-01-28 20:25:49.000000000 +0100
43724 @@ -0,0 +1,153 @@
43725 +/*
43726 + * PIKA Warp(tm) board specific routines
43727 + *
43728 + * Copyright (c) 2008 PIKA Technologies
43729 + *   Sean MacLennan <smaclennan@pikatech.com>
43730 + *
43731 + * This program is free software; you can redistribute  it and/or modify it
43732 + * under  the terms of  the GNU General  Public License as published by the
43733 + * Free Software Foundation;  either version 2 of the  License, or (at your
43734 + * option) any later version.
43735 + */
43736 +#include <linux/init.h>
43737 +#include <linux/of_platform.h>
43738 +#include <linux/kthread.h>
43739 +
43740 +#include <asm/machdep.h>
43741 +#include <asm/prom.h>
43742 +#include <asm/udbg.h>
43743 +#include <asm/time.h>
43744 +#include <asm/uic.h>
43745 +
43746 +#include "44x.h"
43747 +
43748 +
43749 +static __initdata struct of_device_id warp_of_bus[] = {
43750 +       { .compatible = "ibm,plb4", },
43751 +       { .compatible = "ibm,opb", },
43752 +       { .compatible = "ibm,ebc", },
43753 +       {},
43754 +};
43755 +
43756 +static int __init warp_device_probe(void)
43757 +{
43758 +       of_platform_bus_probe(NULL, warp_of_bus, NULL);
43759 +       return 0;
43760 +}
43761 +machine_device_initcall(warp, warp_device_probe);
43762 +
43763 +static int __init warp_probe(void)
43764 +{
43765 +       unsigned long root = of_get_flat_dt_root();
43766 +
43767 +       return of_flat_dt_is_compatible(root, "pika,warp");
43768 +}
43769 +
43770 +define_machine(warp) {
43771 +       .name           = "Warp",
43772 +       .probe          = warp_probe,
43773 +       .progress       = udbg_progress,
43774 +       .init_IRQ       = uic_init_tree,
43775 +       .get_irq        = uic_get_irq,
43776 +       .restart        = ppc44x_reset_system,
43777 +       .calibrate_decr = generic_calibrate_decr,
43778 +};
43779 +
43780 +
43781 +#define LED_GREEN (0x80000000 >> 0)
43782 +#define LED_RED   (0x80000000 >> 1)
43783 +
43784 +
43785 +/* This is for the power LEDs 1 = on, 0 = off, -1 = leave alone */
43786 +void warp_set_power_leds(int green, int red)
43787 +{
43788 +       static void __iomem *gpio_base = NULL;
43789 +       unsigned leds;
43790 +
43791 +       if (gpio_base == NULL) {
43792 +               struct device_node *np;
43793 +
43794 +               /* Power LEDS are on the second GPIO controller */
43795 +               np = of_find_compatible_node(NULL, NULL, "ibm,gpio-440EP");
43796 +               if (np)
43797 +                       np = of_find_compatible_node(np, NULL, "ibm,gpio-440EP");
43798 +               if (np == NULL) {
43799 +                       printk(KERN_ERR __FILE__ ": Unable to find gpio\n");
43800 +                       return;
43801 +               }
43802 +
43803 +               gpio_base = of_iomap(np, 0);
43804 +               of_node_put(np);
43805 +               if (gpio_base == NULL) {
43806 +                       printk(KERN_ERR __FILE__ ": Unable to map gpio");
43807 +                       return;
43808 +               }
43809 +       }
43810 +
43811 +       leds = in_be32(gpio_base);
43812 +
43813 +       switch (green) {
43814 +       case 0: leds &= ~LED_GREEN; break;
43815 +       case 1: leds |=  LED_GREEN; break;
43816 +       }
43817 +       switch (red) {
43818 +       case 0: leds &= ~LED_RED; break;
43819 +       case 1: leds |=  LED_RED; break;
43820 +       }
43821 +
43822 +       out_be32(gpio_base, leds);
43823 +}
43824 +EXPORT_SYMBOL(warp_set_power_leds);
43825 +
43826 +
43827 +#ifdef CONFIG_SENSORS_AD7414
43828 +static int pika_dtm_thread(void __iomem *fpga)
43829 +{
43830 +       extern int ad7414_get_temp(int index);
43831 +
43832 +       while (!kthread_should_stop()) {
43833 +               int temp = ad7414_get_temp(0);
43834 +
43835 +               out_be32(fpga, temp);
43836 +
43837 +               set_current_state(TASK_INTERRUPTIBLE);
43838 +               schedule_timeout(HZ);
43839 +       }
43840 +
43841 +       return 0;
43842 +}
43843 +
43844 +static int __init pika_dtm_start(void)
43845 +{
43846 +       struct task_struct *dtm_thread;
43847 +       struct device_node *np;
43848 +       struct resource res;
43849 +       void __iomem *fpga;
43850 +
43851 +       np = of_find_compatible_node(NULL, NULL, "pika,fpga");
43852 +       if (np == NULL)
43853 +               return -ENOENT;
43854 +
43855 +       /* We do not call of_iomap here since it would map in the entire
43856 +        * fpga space, which is over 8k.
43857 +        */
43858 +       if (of_address_to_resource(np, 0, &res)) {
43859 +               of_node_put(np);
43860 +               return -ENOENT;
43861 +       }
43862 +       of_node_put(np);
43863 +
43864 +       fpga = ioremap(res.start + 0x20, 4);
43865 +       if (fpga == NULL)
43866 +               return -ENOENT;
43867 +
43868 +       dtm_thread = kthread_run(pika_dtm_thread, fpga + 0x20, "pika-dtm");
43869 +       if (IS_ERR(dtm_thread)) {
43870 +               iounmap(fpga);
43871 +               return PTR_ERR(dtm_thread);
43872 +       }
43873 +
43874 +       return 0;
43875 +}
43876 +device_initcall(pika_dtm_start);
43877 +#endif
43878 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/52xx/Kconfig powerpc.git/arch/powerpc/platforms/52xx/Kconfig
43879 --- linux-2.6.24/arch/powerpc/platforms/52xx/Kconfig    2008-01-24 23:58:37.000000000 +0100
43880 +++ powerpc.git/arch/powerpc/platforms/52xx/Kconfig     2008-01-28 20:25:49.000000000 +0100
43881 @@ -19,6 +19,28 @@
43882  
43883           It is safe to say 'Y' here
43884  
43885 +config PPC_MPC5200_SIMPLE
43886 +       bool "Generic support for simple MPC5200 based boards"
43887 +       depends on PPC_MULTIPLATFORM && PPC32
43888 +       select PPC_MPC5200
43889 +       select DEFAULT_UIMAGE
43890 +       select WANT_DEVICE_TREE
43891 +       default n
43892 +       help
43893 +         This option enables support for a simple MPC52xx based boards which
43894 +         do not need a custom platform specific setup. Such boards are
43895 +         supported assuming the following:
43896 +
43897 +         - GPIO pins are configured by the firmware,
43898 +         - CDM configuration (clocking) is setup correctly by firmware,
43899 +         - if the 'fsl,has-wdt' property is present in one of the
43900 +           gpt nodes, then it is safe to use such gpt to reset the board,
43901 +         - PCI is supported if enabled in the kernel configuration
43902 +           and if there is a PCI bus node defined in the device tree.
43903 +
43904 +         Boards that are compatible with this generic platform support
43905 +         are: 'tqc,tqm5200', 'promess,motionpro', 'schindler,cm5200'.
43906 +
43907  config PPC_EFIKA
43908         bool "bPlan Efika 5k2. MPC5200B based computer"
43909         depends on PPC_MULTIPLATFORM && PPC32
43910 @@ -31,8 +53,7 @@
43911  config PPC_LITE5200
43912         bool "Freescale Lite5200 Eval Board"
43913         depends on PPC_MULTIPLATFORM && PPC32
43914 -       select WANT_DEVICE_TREE
43915         select PPC_MPC5200
43916 +       select DEFAULT_UIMAGE
43917 +       select WANT_DEVICE_TREE
43918         default n
43919 -
43920 -
43921 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/52xx/Makefile powerpc.git/arch/powerpc/platforms/52xx/Makefile
43922 --- linux-2.6.24/arch/powerpc/platforms/52xx/Makefile   2008-01-24 23:58:37.000000000 +0100
43923 +++ powerpc.git/arch/powerpc/platforms/52xx/Makefile    2008-01-28 20:25:49.000000000 +0100
43924 @@ -6,6 +6,7 @@
43925  obj-$(CONFIG_PCI)              += mpc52xx_pci.o
43926  endif
43927  
43928 +obj-$(CONFIG_PPC_MPC5200_SIMPLE) += mpc5200_simple.o
43929  obj-$(CONFIG_PPC_EFIKA)                += efika.o
43930  obj-$(CONFIG_PPC_LITE5200)     += lite5200.o
43931  
43932 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/52xx/lite5200.c powerpc.git/arch/powerpc/platforms/52xx/lite5200.c
43933 --- linux-2.6.24/arch/powerpc/platforms/52xx/lite5200.c 2008-01-24 23:58:37.000000000 +0100
43934 +++ powerpc.git/arch/powerpc/platforms/52xx/lite5200.c  2008-01-28 20:25:49.000000000 +0100
43935 @@ -42,10 +42,13 @@
43936  static void __init
43937  lite5200_fix_clock_config(void)
43938  {
43939 +       struct device_node *np;
43940         struct mpc52xx_cdm  __iomem *cdm;
43941  
43942         /* Map zones */
43943 -       cdm = mpc52xx_find_and_map("mpc5200-cdm");
43944 +       np = of_find_compatible_node(NULL, NULL, "mpc5200-cdm");
43945 +       cdm = of_iomap(np, 0);
43946 +       of_node_put(np);
43947         if (!cdm) {
43948                 printk(KERN_ERR "%s() failed; expect abnormal behaviour\n",
43949                        __FUNCTION__);
43950 @@ -74,10 +77,13 @@
43951  static void __init
43952  lite5200_fix_port_config(void)
43953  {
43954 +       struct device_node *np;
43955         struct mpc52xx_gpio __iomem *gpio;
43956         u32 port_config;
43957  
43958 -       gpio = mpc52xx_find_and_map("mpc5200-gpio");
43959 +       np = of_find_compatible_node(NULL, NULL, "mpc5200-gpio");
43960 +       gpio = of_iomap(np, 0);
43961 +       of_node_put(np);
43962         if (!gpio) {
43963                 printk(KERN_ERR "%s() failed. expect abnormal behavior\n",
43964                        __FUNCTION__);
43965 @@ -131,10 +137,6 @@
43966  
43967  static void __init lite5200_setup_arch(void)
43968  {
43969 -#ifdef CONFIG_PCI
43970 -       struct device_node *np;
43971 -#endif
43972 -
43973         if (ppc_md.progress)
43974                 ppc_md.progress("lite5200_setup_arch()", 0);
43975  
43976 @@ -154,13 +156,7 @@
43977         lite5200_pm_init();
43978  #endif
43979  
43980 -#ifdef CONFIG_PCI
43981 -       np = of_find_node_by_type(NULL, "pci");
43982 -       if (np) {
43983 -               mpc52xx_add_bridge(np);
43984 -               of_node_put(np);
43985 -       }
43986 -#endif
43987 +       mpc52xx_setup_pci();
43988  }
43989  
43990  /*
43991 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/52xx/lite5200_pm.c powerpc.git/arch/powerpc/platforms/52xx/lite5200_pm.c
43992 --- linux-2.6.24/arch/powerpc/platforms/52xx/lite5200_pm.c      2008-01-24 23:58:37.000000000 +0100
43993 +++ powerpc.git/arch/powerpc/platforms/52xx/lite5200_pm.c       2008-01-28 20:25:49.000000000 +0100
43994 @@ -42,6 +42,8 @@
43995  
43996  static int lite5200_pm_prepare(void)
43997  {
43998 +       struct device_node *np;
43999 +
44000         /* deep sleep? let mpc52xx code handle that */
44001         if (lite5200_pm_target_state == PM_SUSPEND_STANDBY)
44002                 return mpc52xx_pm_prepare();
44003 @@ -50,7 +52,9 @@
44004                 return -EINVAL;
44005  
44006         /* map registers */
44007 -       mbar = mpc52xx_find_and_map("mpc5200");
44008 +       np = of_find_compatible_node(NULL, NULL, "mpc5200");
44009 +       mbar = of_iomap(np, 0);
44010 +       of_node_put(np);
44011         if (!mbar) {
44012                 printk(KERN_ERR "%s:%i Error mapping registers\n", __func__, __LINE__);
44013                 return -ENOSYS;
44014 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/52xx/mpc5200_simple.c powerpc.git/arch/powerpc/platforms/52xx/mpc5200_simple.c
44015 --- linux-2.6.24/arch/powerpc/platforms/52xx/mpc5200_simple.c   1970-01-01 01:00:00.000000000 +0100
44016 +++ powerpc.git/arch/powerpc/platforms/52xx/mpc5200_simple.c    2008-01-28 20:25:49.000000000 +0100
44017 @@ -0,0 +1,85 @@
44018 +/*
44019 + * Support for 'mpc5200-simple-platform' compatible boards.
44020 + *
44021 + * Written by Marian Balakowicz <m8@semihalf.com>
44022 + * Copyright (C) 2007 Semihalf
44023 + *
44024 + * This program is free software; you can redistribute  it and/or modify it
44025 + * under  the terms of  the GNU General  Public License as published by the
44026 + * Free Software Foundation;  either version 2 of the  License, or (at your
44027 + * option) any later version.
44028 + *
44029 + * Description:
44030 + * This code implements support for a simple MPC52xx based boards which
44031 + * do not need a custom platform specific setup. Such boards are
44032 + * supported assuming the following:
44033 + *
44034 + * - GPIO pins are configured by the firmware,
44035 + * - CDM configuration (clocking) is setup correctly by firmware,
44036 + * - if the 'fsl,has-wdt' property is present in one of the
44037 + *   gpt nodes, then it is safe to use such gpt to reset the board,
44038 + * - PCI is supported if enabled in the kernel configuration
44039 + *   and if there is a PCI bus node defined in the device tree.
44040 + *
44041 + * Boards that are compatible with this generic platform support
44042 + * are listed in a 'board' table.
44043 + */
44044 +
44045 +#undef DEBUG
44046 +#include <asm/time.h>
44047 +#include <asm/prom.h>
44048 +#include <asm/machdep.h>
44049 +#include <asm/mpc52xx.h>
44050 +
44051 +/*
44052 + * Setup the architecture
44053 + */
44054 +static void __init mpc5200_simple_setup_arch(void)
44055 +{
44056 +       if (ppc_md.progress)
44057 +               ppc_md.progress("mpc5200_simple_setup_arch()", 0);
44058 +
44059 +       /* Some mpc5200 & mpc5200b related configuration */
44060 +       mpc5200_setup_xlb_arbiter();
44061 +
44062 +       /* Map wdt for mpc52xx_restart() */
44063 +       mpc52xx_map_wdt();
44064 +
44065 +       mpc52xx_setup_pci();
44066 +}
44067 +
44068 +/* list of the supported boards */
44069 +static char *board[] __initdata = {
44070 +       "promess,motionpro",
44071 +       "schindler,cm5200",
44072 +       "tqc,tqm5200",
44073 +       NULL
44074 +};
44075 +
44076 +/*
44077 + * Called very early, MMU is off, device-tree isn't unflattened
44078 + */
44079 +static int __init mpc5200_simple_probe(void)
44080 +{
44081 +       unsigned long node = of_get_flat_dt_root();
44082 +       int i = 0;
44083 +
44084 +       while (board[i]) {
44085 +               if (of_flat_dt_is_compatible(node, board[i]))
44086 +                       break;
44087 +               i++;
44088 +       }
44089 +       
44090 +       return (board[i] != NULL);
44091 +}
44092 +
44093 +define_machine(mpc5200_simple_platform) {
44094 +       .name           = "mpc5200-simple-platform",
44095 +       .probe          = mpc5200_simple_probe,
44096 +       .setup_arch     = mpc5200_simple_setup_arch,
44097 +       .init           = mpc52xx_declare_of_platform_devices,
44098 +       .init_IRQ       = mpc52xx_init_irq,
44099 +       .get_irq        = mpc52xx_get_irq,
44100 +       .restart        = mpc52xx_restart,
44101 +       .calibrate_decr = generic_calibrate_decr,
44102 +};
44103 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/52xx/mpc52xx_common.c powerpc.git/arch/powerpc/platforms/52xx/mpc52xx_common.c
44104 --- linux-2.6.24/arch/powerpc/platforms/52xx/mpc52xx_common.c   2008-01-24 23:58:37.000000000 +0100
44105 +++ powerpc.git/arch/powerpc/platforms/52xx/mpc52xx_common.c    2008-01-28 20:25:49.000000000 +0100
44106 @@ -26,45 +26,6 @@
44107   */
44108  static volatile struct mpc52xx_gpt *mpc52xx_wdt = NULL;
44109  
44110 -static void __iomem *
44111 -mpc52xx_map_node(struct device_node *ofn)
44112 -{
44113 -       const u32 *regaddr_p;
44114 -       u64 regaddr64, size64;
44115 -
44116 -       if (!ofn)
44117 -               return NULL;
44118 -
44119 -       regaddr_p = of_get_address(ofn, 0, &size64, NULL);
44120 -       if (!regaddr_p) {
44121 -               of_node_put(ofn);
44122 -               return NULL;
44123 -       }
44124 -
44125 -       regaddr64 = of_translate_address(ofn, regaddr_p);
44126 -
44127 -       of_node_put(ofn);
44128 -
44129 -       return ioremap((u32)regaddr64, (u32)size64);
44130 -}
44131 -
44132 -void __iomem *
44133 -mpc52xx_find_and_map(const char *compatible)
44134 -{
44135 -       return mpc52xx_map_node(
44136 -               of_find_compatible_node(NULL, NULL, compatible));
44137 -}
44138 -
44139 -EXPORT_SYMBOL(mpc52xx_find_and_map);
44140 -
44141 -void __iomem *
44142 -mpc52xx_find_and_map_path(const char *path)
44143 -{
44144 -       return mpc52xx_map_node(of_find_node_by_path(path));
44145 -}
44146 -
44147 -EXPORT_SYMBOL(mpc52xx_find_and_map_path);
44148 -
44149  /**
44150   *     mpc52xx_find_ipb_freq - Find the IPB bus frequency for a device
44151   *     @node:  device node
44152 @@ -101,9 +62,12 @@
44153  void __init
44154  mpc5200_setup_xlb_arbiter(void)
44155  {
44156 +       struct device_node *np;
44157         struct mpc52xx_xlb  __iomem *xlb;
44158  
44159 -       xlb = mpc52xx_find_and_map("mpc5200-xlb");
44160 +       np = of_find_compatible_node(NULL, NULL, "mpc5200-xlb");
44161 +       xlb = of_iomap(np, 0);
44162 +       of_node_put(np);
44163         if (!xlb) {
44164                 printk(KERN_ERR __FILE__ ": "
44165                         "Error mapping XLB in mpc52xx_setup_cpu().  "
44166 @@ -124,11 +88,21 @@
44167         iounmap(xlb);
44168  }
44169  
44170 +static struct of_device_id mpc52xx_bus_ids[] __initdata= {
44171 +       { .compatible = "fsl,mpc5200-immr", },
44172 +       { .compatible = "fsl,lpb", },
44173 +
44174 +       /* depreciated matches; shouldn't be used in new device trees */
44175 +       { .type = "builtin", .compatible = "mpc5200", }, /* efika */
44176 +       { .type = "soc", .compatible = "mpc5200", }, /* lite5200 */
44177 +       {},
44178 +};
44179 +
44180  void __init
44181  mpc52xx_declare_of_platform_devices(void)
44182  {
44183         /* Find every child of the SOC node and add it to of_platform */
44184 -       if (of_platform_bus_probe(NULL, NULL, NULL))
44185 +       if (of_platform_bus_probe(NULL, mpc52xx_bus_ids, NULL))
44186                 printk(KERN_ERR __FILE__ ": "
44187                         "Error while probing of_platform bus\n");
44188  }
44189 @@ -146,16 +120,19 @@
44190         for_each_compatible_node(np, NULL, "fsl,mpc5200-gpt") {
44191                 has_wdt = of_get_property(np, "fsl,has-wdt", NULL);
44192                 if (has_wdt) {
44193 -                       mpc52xx_wdt = mpc52xx_map_node(np);
44194 +                       mpc52xx_wdt = of_iomap(np, 0);
44195 +                       of_node_put(np);
44196                         return;
44197                 }
44198         }
44199         for_each_compatible_node(np, NULL, "mpc5200-gpt") {
44200                 has_wdt = of_get_property(np, "has-wdt", NULL);
44201                 if (has_wdt) {
44202 -                       mpc52xx_wdt = mpc52xx_map_node(np);
44203 +                       mpc52xx_wdt = of_iomap(np, 0);
44204 +                       of_node_put(np);
44205                         return;
44206                 }
44207 +
44208         }
44209  }
44210  
44211 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/52xx/mpc52xx_pci.c powerpc.git/arch/powerpc/platforms/52xx/mpc52xx_pci.c
44212 --- linux-2.6.24/arch/powerpc/platforms/52xx/mpc52xx_pci.c      2008-01-24 23:58:37.000000000 +0100
44213 +++ powerpc.git/arch/powerpc/platforms/52xx/mpc52xx_pci.c       2008-01-28 20:25:49.000000000 +0100
44214 @@ -363,7 +363,7 @@
44215  
44216         pr_debug("Adding MPC52xx PCI host bridge %s\n", node->full_name);
44217  
44218 -       pci_assign_all_buses = 1;
44219 +       ppc_pci_flags |= PPC_PCI_REASSIGN_ALL_BUS;
44220  
44221         if (of_address_to_resource(node, 0, &rsrc) != 0) {
44222                 printk(KERN_ERR "Can't get %s resources\n", node->full_name);
44223 @@ -406,3 +406,17 @@
44224  
44225         return 0;
44226  }
44227 +
44228 +void __init mpc52xx_setup_pci(void)
44229 +{
44230 +       struct device_node *pci;
44231 +
44232 +       pci = of_find_compatible_node(NULL, NULL, "fsl,mpc5200-pci");
44233 +       if (!pci)
44234 +               pci = of_find_compatible_node(NULL, NULL, "mpc5200-pci");
44235 +       if (!pci)
44236 +               return;
44237 +
44238 +       mpc52xx_add_bridge(pci);
44239 +       of_node_put(pci);
44240 +}
44241 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/52xx/mpc52xx_pic.c powerpc.git/arch/powerpc/platforms/52xx/mpc52xx_pic.c
44242 --- linux-2.6.24/arch/powerpc/platforms/52xx/mpc52xx_pic.c      2008-01-24 23:58:37.000000000 +0100
44243 +++ powerpc.git/arch/powerpc/platforms/52xx/mpc52xx_pic.c       2008-01-28 20:25:49.000000000 +0100
44244 @@ -364,16 +364,18 @@
44245  {
44246         u32 intr_ctrl;
44247         struct device_node *picnode;
44248 +       struct device_node *np;
44249  
44250         /* Remap the necessary zones */
44251         picnode = of_find_compatible_node(NULL, NULL, "mpc5200-pic");
44252 -
44253 -       intr = mpc52xx_find_and_map("mpc5200-pic");
44254 +       intr = of_iomap(picnode, 0);
44255         if (!intr)
44256                 panic(__FILE__  ": find_and_map failed on 'mpc5200-pic'. "
44257                                 "Check node !");
44258  
44259 -       sdma = mpc52xx_find_and_map("mpc5200-bestcomm");
44260 +       np = of_find_compatible_node(NULL, NULL, "mpc5200-bestcomm");
44261 +       sdma = of_iomap(np, 0);
44262 +       of_node_put(np);
44263         if (!sdma)
44264                 panic(__FILE__  ": find_and_map failed on 'mpc5200-bestcomm'. "
44265                                 "Check node !");
44266 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/52xx/mpc52xx_pm.c powerpc.git/arch/powerpc/platforms/52xx/mpc52xx_pm.c
44267 --- linux-2.6.24/arch/powerpc/platforms/52xx/mpc52xx_pm.c       2008-01-24 23:58:37.000000000 +0100
44268 +++ powerpc.git/arch/powerpc/platforms/52xx/mpc52xx_pm.c        2008-01-28 20:25:49.000000000 +0100
44269 @@ -59,10 +59,14 @@
44270  
44271  int mpc52xx_pm_prepare(void)
44272  {
44273 +       struct device_node *np;
44274 +
44275         /* map the whole register space */
44276 -       mbar = mpc52xx_find_and_map("mpc5200");
44277 +       np = of_find_compatible_node(NULL, NULL, "mpc5200");
44278 +       mbar = of_iomap(np, 0);
44279 +       of_node_put(np);
44280         if (!mbar) {
44281 -               printk(KERN_ERR "%s:%i Error mapping registers\n", __func__, __LINE__);
44282 +               pr_err("mpc52xx_pm_prepare(): could not map registers\n");
44283                 return -ENOSYS;
44284         }
44285         /* these offsets are from mpc5200 users manual */
44286 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/82xx/Kconfig powerpc.git/arch/powerpc/platforms/82xx/Kconfig
44287 --- linux-2.6.24/arch/powerpc/platforms/82xx/Kconfig    2008-01-24 23:58:37.000000000 +0100
44288 +++ powerpc.git/arch/powerpc/platforms/82xx/Kconfig     2008-01-28 20:25:49.000000000 +0100
44289 @@ -26,6 +26,19 @@
44290         help
44291           This option enables support for the PQ2FADS board
44292  
44293 +config EP8248E
44294 +       bool "Embedded Planet EP8248E (a.k.a. CWH-PPC-8248N-VE)"
44295 +       select 8272
44296 +       select 8260
44297 +       select FSL_SOC
44298 +       select PPC_CPM_NEW_BINDING
44299 +       select MDIO_BITBANG
44300 +       help
44301 +         This enables support for the Embedded Planet EP8248E board.
44302 +
44303 +         This board is also resold by Freescale as the QUICCStart
44304 +         MPC8248 Evaluation System and/or the CWH-PPC-8248N-VE.
44305 +
44306  endchoice
44307  
44308  config PQ2ADS
44309 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/82xx/Makefile powerpc.git/arch/powerpc/platforms/82xx/Makefile
44310 --- linux-2.6.24/arch/powerpc/platforms/82xx/Makefile   2008-01-24 23:58:37.000000000 +0100
44311 +++ powerpc.git/arch/powerpc/platforms/82xx/Makefile    2008-01-28 20:25:49.000000000 +0100
44312 @@ -5,3 +5,4 @@
44313  obj-$(CONFIG_CPM2) += pq2.o
44314  obj-$(CONFIG_PQ2_ADS_PCI_PIC) += pq2ads-pci-pic.o
44315  obj-$(CONFIG_PQ2FADS) += pq2fads.o
44316 +obj-$(CONFIG_EP8248E) += ep8248e.o
44317 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/82xx/ep8248e.c powerpc.git/arch/powerpc/platforms/82xx/ep8248e.c
44318 --- linux-2.6.24/arch/powerpc/platforms/82xx/ep8248e.c  1970-01-01 01:00:00.000000000 +0100
44319 +++ powerpc.git/arch/powerpc/platforms/82xx/ep8248e.c   2008-01-28 20:25:49.000000000 +0100
44320 @@ -0,0 +1,324 @@
44321 +/*
44322 + * Embedded Planet EP8248E support
44323 + *
44324 + * Copyright 2007 Freescale Semiconductor, Inc.
44325 + * Author: Scott Wood <scottwood@freescale.com>
44326 + *
44327 + * This program is free software; you can redistribute  it and/or modify it
44328 + * under  the terms of  the GNU General  Public License as published by the
44329 + * Free Software Foundation;  either version 2 of the  License, or (at your
44330 + * option) any later version.
44331 + */
44332 +
44333 +#include <linux/init.h>
44334 +#include <linux/interrupt.h>
44335 +#include <linux/fsl_devices.h>
44336 +#include <linux/mdio-bitbang.h>
44337 +#include <linux/of_platform.h>
44338 +
44339 +#include <asm/io.h>
44340 +#include <asm/cpm2.h>
44341 +#include <asm/udbg.h>
44342 +#include <asm/machdep.h>
44343 +#include <asm/time.h>
44344 +#include <asm/mpc8260.h>
44345 +#include <asm/prom.h>
44346 +
44347 +#include <sysdev/fsl_soc.h>
44348 +#include <sysdev/cpm2_pic.h>
44349 +
44350 +#include "pq2.h"
44351 +
44352 +static u8 __iomem *ep8248e_bcsr;
44353 +static struct device_node *ep8248e_bcsr_node;
44354 +
44355 +#define BCSR7_SCC2_ENABLE 0x10
44356 +
44357 +#define BCSR8_PHY1_ENABLE 0x80
44358 +#define BCSR8_PHY1_POWER  0x40
44359 +#define BCSR8_PHY2_ENABLE 0x20
44360 +#define BCSR8_PHY2_POWER  0x10
44361 +#define BCSR8_MDIO_READ   0x04
44362 +#define BCSR8_MDIO_CLOCK  0x02
44363 +#define BCSR8_MDIO_DATA   0x01
44364 +
44365 +#define BCSR9_USB_ENABLE  0x80
44366 +#define BCSR9_USB_POWER   0x40
44367 +#define BCSR9_USB_HOST    0x20
44368 +#define BCSR9_USB_FULL_SPEED_TARGET 0x10
44369 +
44370 +static void __init ep8248e_pic_init(void)
44371 +{
44372 +       struct device_node *np = of_find_compatible_node(NULL, NULL, "fsl,pq2-pic");
44373 +       if (!np) {
44374 +               printk(KERN_ERR "PIC init: can not find cpm-pic node\n");
44375 +               return;
44376 +       }
44377 +
44378 +       cpm2_pic_init(np);
44379 +       of_node_put(np);
44380 +}
44381 +
44382 +static void ep8248e_set_mdc(struct mdiobb_ctrl *ctrl, int level)
44383 +{
44384 +       if (level)
44385 +               setbits8(&ep8248e_bcsr[8], BCSR8_MDIO_CLOCK);
44386 +       else
44387 +               clrbits8(&ep8248e_bcsr[8], BCSR8_MDIO_CLOCK);
44388 +
44389 +       /* Read back to flush the write. */
44390 +       in_8(&ep8248e_bcsr[8]);
44391 +}
44392 +
44393 +static void ep8248e_set_mdio_dir(struct mdiobb_ctrl *ctrl, int output)
44394 +{
44395 +       if (output)
44396 +               clrbits8(&ep8248e_bcsr[8], BCSR8_MDIO_READ);
44397 +       else
44398 +               setbits8(&ep8248e_bcsr[8], BCSR8_MDIO_READ);
44399 +
44400 +       /* Read back to flush the write. */
44401 +       in_8(&ep8248e_bcsr[8]);
44402 +}
44403 +
44404 +static void ep8248e_set_mdio_data(struct mdiobb_ctrl *ctrl, int data)
44405 +{
44406 +       if (data)
44407 +               setbits8(&ep8248e_bcsr[8], BCSR8_MDIO_DATA);
44408 +       else
44409 +               clrbits8(&ep8248e_bcsr[8], BCSR8_MDIO_DATA);
44410 +
44411 +       /* Read back to flush the write. */
44412 +       in_8(&ep8248e_bcsr[8]);
44413 +}
44414 +
44415 +static int ep8248e_get_mdio_data(struct mdiobb_ctrl *ctrl)
44416 +{
44417 +       return in_8(&ep8248e_bcsr[8]) & BCSR8_MDIO_DATA;
44418 +}
44419 +
44420 +static const struct mdiobb_ops ep8248e_mdio_ops = {
44421 +       .set_mdc = ep8248e_set_mdc,
44422 +       .set_mdio_dir = ep8248e_set_mdio_dir,
44423 +       .set_mdio_data = ep8248e_set_mdio_data,
44424 +       .get_mdio_data = ep8248e_get_mdio_data,
44425 +       .owner = THIS_MODULE,
44426 +};
44427 +
44428 +static struct mdiobb_ctrl ep8248e_mdio_ctrl = {
44429 +       .ops = &ep8248e_mdio_ops,
44430 +};
44431 +
44432 +static int __devinit ep8248e_mdio_probe(struct of_device *ofdev,
44433 +                                        const struct of_device_id *match)
44434 +{
44435 +       struct mii_bus *bus;
44436 +       struct resource res;
44437 +       struct device_node *node;
44438 +       int ret, i;
44439 +
44440 +       node = of_get_parent(ofdev->node);
44441 +       of_node_put(node);
44442 +       if (node != ep8248e_bcsr_node)
44443 +               return -ENODEV;
44444 +
44445 +       ret = of_address_to_resource(ofdev->node, 0, &res);
44446 +       if (ret)
44447 +               return ret;
44448 +
44449 +       bus = alloc_mdio_bitbang(&ep8248e_mdio_ctrl);
44450 +       if (!bus)
44451 +               return -ENOMEM;
44452 +
44453 +       bus->phy_mask = 0;
44454 +       bus->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL);
44455 +
44456 +       for (i = 0; i < PHY_MAX_ADDR; i++)
44457 +               bus->irq[i] = -1;
44458 +
44459 +       bus->name = "ep8248e-mdio-bitbang";
44460 +       bus->dev = &ofdev->dev;
44461 +       bus->id = res.start;
44462 +
44463 +       return mdiobus_register(bus);
44464 +}
44465 +
44466 +static int ep8248e_mdio_remove(struct of_device *ofdev)
44467 +{
44468 +       BUG();
44469 +       return 0;
44470 +}
44471 +
44472 +static const struct of_device_id ep8248e_mdio_match[] = {
44473 +       {
44474 +               .compatible = "fsl,ep8248e-mdio-bitbang",
44475 +       },
44476 +       {},
44477 +};
44478 +
44479 +static struct of_platform_driver ep8248e_mdio_driver = {
44480 +       .driver = {
44481 +               .name = "ep8248e-mdio-bitbang",
44482 +       },
44483 +       .match_table = ep8248e_mdio_match,
44484 +       .probe = ep8248e_mdio_probe,
44485 +       .remove = ep8248e_mdio_remove,
44486 +};
44487 +
44488 +struct cpm_pin {
44489 +       int port, pin, flags;
44490 +};
44491 +
44492 +static __initdata struct cpm_pin ep8248e_pins[] = {
44493 +       /* SMC1 */
44494 +       {2, 4, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44495 +       {2, 5, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44496 +
44497 +       /* SCC1 */
44498 +       {2, 14, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44499 +       {2, 15, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44500 +       {3, 29, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44501 +       {3, 30, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
44502 +       {3, 31, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44503 +
44504 +       /* FCC1 */
44505 +       {0, 14, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44506 +       {0, 15, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44507 +       {0, 16, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44508 +       {0, 17, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44509 +       {0, 18, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44510 +       {0, 19, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44511 +       {0, 20, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44512 +       {0, 21, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44513 +       {0, 26, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
44514 +       {0, 27, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
44515 +       {0, 28, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
44516 +       {0, 29, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
44517 +       {0, 30, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
44518 +       {0, 31, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
44519 +       {2, 21, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44520 +       {2, 22, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44521 +
44522 +       /* FCC2 */
44523 +       {1, 18, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44524 +       {1, 19, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44525 +       {1, 20, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44526 +       {1, 21, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44527 +       {1, 22, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44528 +       {1, 23, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44529 +       {1, 24, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44530 +       {1, 25, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44531 +       {1, 26, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44532 +       {1, 27, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44533 +       {1, 28, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44534 +       {1, 29, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
44535 +       {1, 30, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44536 +       {1, 31, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44537 +       {2, 18, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44538 +       {2, 19, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44539 +
44540 +       /* I2C */
44541 +       {4, 14, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
44542 +       {4, 15, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
44543 +
44544 +       /* USB */
44545 +       {2, 10, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44546 +       {2, 11, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44547 +       {2, 20, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44548 +       {2, 24, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44549 +       {3, 23, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44550 +       {3, 24, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44551 +       {3, 25, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44552 +};
44553 +
44554 +static void __init init_ioports(void)
44555 +{
44556 +       int i;
44557 +
44558 +       for (i = 0; i < ARRAY_SIZE(ep8248e_pins); i++) {
44559 +               const struct cpm_pin *pin = &ep8248e_pins[i];
44560 +               cpm2_set_pin(pin->port, pin->pin, pin->flags);
44561 +       }
44562 +
44563 +       cpm2_smc_clk_setup(CPM_CLK_SMC1, CPM_BRG7);
44564 +       cpm2_clk_setup(CPM_CLK_SCC1, CPM_BRG1, CPM_CLK_RX);
44565 +       cpm2_clk_setup(CPM_CLK_SCC1, CPM_BRG1, CPM_CLK_TX);
44566 +       cpm2_clk_setup(CPM_CLK_SCC3, CPM_CLK8, CPM_CLK_TX); /* USB */
44567 +       cpm2_clk_setup(CPM_CLK_FCC1, CPM_CLK11, CPM_CLK_RX);
44568 +       cpm2_clk_setup(CPM_CLK_FCC1, CPM_CLK10, CPM_CLK_TX);
44569 +       cpm2_clk_setup(CPM_CLK_FCC2, CPM_CLK13, CPM_CLK_RX);
44570 +       cpm2_clk_setup(CPM_CLK_FCC2, CPM_CLK14, CPM_CLK_TX);
44571 +}
44572 +
44573 +static void __init ep8248e_setup_arch(void)
44574 +{
44575 +       if (ppc_md.progress)
44576 +               ppc_md.progress("ep8248e_setup_arch()", 0);
44577 +
44578 +       cpm2_reset();
44579 +
44580 +       /* When this is set, snooping CPM DMA from RAM causes
44581 +        * machine checks.  See erratum SIU18.
44582 +        */
44583 +       clrbits32(&cpm2_immr->im_siu_conf.siu_82xx.sc_bcr, MPC82XX_BCR_PLDP);
44584 +
44585 +       ep8248e_bcsr_node =
44586 +               of_find_compatible_node(NULL, NULL, "fsl,ep8248e-bcsr");
44587 +       if (!ep8248e_bcsr_node) {
44588 +               printk(KERN_ERR "No bcsr in device tree\n");
44589 +               return;
44590 +       }
44591 +
44592 +       ep8248e_bcsr = of_iomap(ep8248e_bcsr_node, 0);
44593 +       if (!ep8248e_bcsr) {
44594 +               printk(KERN_ERR "Cannot map BCSR registers\n");
44595 +               of_node_put(ep8248e_bcsr_node);
44596 +               ep8248e_bcsr_node = NULL;
44597 +               return;
44598 +       }
44599 +
44600 +       setbits8(&ep8248e_bcsr[7], BCSR7_SCC2_ENABLE);
44601 +       setbits8(&ep8248e_bcsr[8], BCSR8_PHY1_ENABLE | BCSR8_PHY1_POWER |
44602 +                                  BCSR8_PHY2_ENABLE | BCSR8_PHY2_POWER);
44603 +
44604 +       init_ioports();
44605 +
44606 +       if (ppc_md.progress)
44607 +               ppc_md.progress("ep8248e_setup_arch(), finish", 0);
44608 +}
44609 +
44610 +static  __initdata struct of_device_id of_bus_ids[] = {
44611 +       { .compatible = "simple-bus", },
44612 +       { .compatible = "fsl,ep8248e-bcsr", },
44613 +       {},
44614 +};
44615 +
44616 +static int __init declare_of_platform_devices(void)
44617 +{
44618 +       of_platform_bus_probe(NULL, of_bus_ids, NULL);
44619 +       of_register_platform_driver(&ep8248e_mdio_driver);
44620 +
44621 +       return 0;
44622 +}
44623 +machine_device_initcall(ep8248e, declare_of_platform_devices);
44624 +
44625 +/*
44626 + * Called very early, device-tree isn't unflattened
44627 + */
44628 +static int __init ep8248e_probe(void)
44629 +{
44630 +       unsigned long root = of_get_flat_dt_root();
44631 +       return of_flat_dt_is_compatible(root, "fsl,ep8248e");
44632 +}
44633 +
44634 +define_machine(ep8248e)
44635 +{
44636 +       .name = "Embedded Planet EP8248E",
44637 +       .probe = ep8248e_probe,
44638 +       .setup_arch = ep8248e_setup_arch,
44639 +       .init_IRQ = ep8248e_pic_init,
44640 +       .get_irq = cpm2_get_irq,
44641 +       .calibrate_decr = generic_calibrate_decr,
44642 +       .restart = pq2_restart,
44643 +       .progress = udbg_progress,
44644 +};
44645 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/82xx/pq2.c powerpc.git/arch/powerpc/platforms/82xx/pq2.c
44646 --- linux-2.6.24/arch/powerpc/platforms/82xx/pq2.c      2008-01-24 23:58:37.000000000 +0100
44647 +++ powerpc.git/arch/powerpc/platforms/82xx/pq2.c       2008-01-28 20:25:49.000000000 +0100
44648 @@ -53,13 +53,13 @@
44649         if (of_address_to_resource(np, 0, &r) || r.end - r.start < 0x10b)
44650                 goto err;
44651  
44652 -       pci_assign_all_buses = 1;
44653 +       ppc_pci_flags |= PPC_PCI_REASSIGN_ALL_BUS;
44654  
44655         hose = pcibios_alloc_controller(np);
44656         if (!hose)
44657                 return;
44658  
44659 -       hose->arch_data = np;
44660 +       hose->dn = np;
44661  
44662         setup_indirect_pci(hose, r.start + 0x100, r.start + 0x104, 0);
44663         pci_process_bridge_OF_ranges(hose, np, 1);
44664 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/82xx/pq2fads.c powerpc.git/arch/powerpc/platforms/82xx/pq2fads.c
44665 --- linux-2.6.24/arch/powerpc/platforms/82xx/pq2fads.c  2008-01-24 23:58:37.000000000 +0100
44666 +++ powerpc.git/arch/powerpc/platforms/82xx/pq2fads.c   2008-01-28 20:25:49.000000000 +0100
44667 @@ -15,12 +15,12 @@
44668  #include <linux/init.h>
44669  #include <linux/interrupt.h>
44670  #include <linux/fsl_devices.h>
44671 +#include <linux/of_platform.h>
44672  
44673  #include <asm/io.h>
44674  #include <asm/cpm2.h>
44675  #include <asm/udbg.h>
44676  #include <asm/machdep.h>
44677 -#include <asm/of_platform.h>
44678  #include <asm/time.h>
44679  
44680  #include <sysdev/fsl_soc.h>
44681 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/83xx/Kconfig powerpc.git/arch/powerpc/platforms/83xx/Kconfig
44682 --- linux-2.6.24/arch/powerpc/platforms/83xx/Kconfig    2008-01-24 23:58:37.000000000 +0100
44683 +++ powerpc.git/arch/powerpc/platforms/83xx/Kconfig     2008-01-28 20:25:49.000000000 +0100
44684 @@ -50,6 +50,11 @@
44685         help
44686           This option enables support for the MPC836x MDS Processor Board.
44687  
44688 +config MPC837x_MDS
44689 +       bool "Freescale MPC837x MDS"
44690 +       select DEFAULT_UIMAGE
44691 +       help
44692 +         This option enables support for the MPC837x MDS Processor Board.
44693  endchoice
44694  
44695  config PPC_MPC831x
44696 @@ -75,3 +80,9 @@
44697         select PPC_UDBG_16550
44698         select PPC_INDIRECT_PCI
44699         default y if MPC836x_MDS
44700 +
44701 +config PPC_MPC837x
44702 +       bool
44703 +       select PPC_UDBG_16550
44704 +       select PPC_INDIRECT_PCI
44705 +       default y if MPC837x_MDS
44706 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/83xx/Makefile powerpc.git/arch/powerpc/platforms/83xx/Makefile
44707 --- linux-2.6.24/arch/powerpc/platforms/83xx/Makefile   2008-01-24 23:58:37.000000000 +0100
44708 +++ powerpc.git/arch/powerpc/platforms/83xx/Makefile    2008-01-28 20:25:49.000000000 +0100
44709 @@ -9,3 +9,4 @@
44710  obj-$(CONFIG_MPC834x_ITX)      += mpc834x_itx.o
44711  obj-$(CONFIG_MPC836x_MDS)      += mpc836x_mds.o
44712  obj-$(CONFIG_MPC832x_MDS)      += mpc832x_mds.o
44713 +obj-$(CONFIG_MPC837x_MDS)      += mpc837x_mds.o
44714 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/83xx/mpc8313_rdb.c powerpc.git/arch/powerpc/platforms/83xx/mpc8313_rdb.c
44715 --- linux-2.6.24/arch/powerpc/platforms/83xx/mpc8313_rdb.c      2008-01-24 23:58:37.000000000 +0100
44716 +++ powerpc.git/arch/powerpc/platforms/83xx/mpc8313_rdb.c       2008-01-28 20:25:49.000000000 +0100
44717 @@ -14,6 +14,7 @@
44718   */
44719  
44720  #include <linux/pci.h>
44721 +#include <linux/of_platform.h>
44722  
44723  #include <asm/time.h>
44724  #include <asm/ipic.h>
44725 @@ -70,11 +71,23 @@
44726   */
44727  static int __init mpc8313_rdb_probe(void)
44728  {
44729 -        unsigned long root = of_get_flat_dt_root();
44730 +       unsigned long root = of_get_flat_dt_root();
44731  
44732 -        return of_flat_dt_is_compatible(root, "MPC8313ERDB");
44733 +       return of_flat_dt_is_compatible(root, "MPC8313ERDB");
44734  }
44735  
44736 +static struct of_device_id __initdata of_bus_ids[] = {
44737 +       { .compatible = "simple-bus" },
44738 +       {},
44739 +};
44740 +
44741 +static int __init declare_of_platform_devices(void)
44742 +{
44743 +       of_platform_bus_probe(NULL, of_bus_ids, NULL);
44744 +       return 0;
44745 +}
44746 +machine_device_initcall(mpc8313_rdb, declare_of_platform_devices);
44747 +
44748  define_machine(mpc8313_rdb) {
44749         .name                   = "MPC8313 RDB",
44750         .probe                  = mpc8313_rdb_probe,
44751 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/83xx/mpc832x_mds.c powerpc.git/arch/powerpc/platforms/83xx/mpc832x_mds.c
44752 --- linux-2.6.24/arch/powerpc/platforms/83xx/mpc832x_mds.c      2008-01-24 23:58:37.000000000 +0100
44753 +++ powerpc.git/arch/powerpc/platforms/83xx/mpc832x_mds.c       2008-01-28 20:25:49.000000000 +0100
44754 @@ -23,9 +23,9 @@
44755  #include <linux/seq_file.h>
44756  #include <linux/root_dev.h>
44757  #include <linux/initrd.h>
44758 +#include <linux/of_platform.h>
44759 +#include <linux/of_device.h>
44760  
44761 -#include <asm/of_device.h>
44762 -#include <asm/of_platform.h>
44763  #include <asm/system.h>
44764  #include <asm/atomic.h>
44765  #include <asm/time.h>
44766 @@ -110,15 +110,12 @@
44767  
44768  static int __init mpc832x_declare_of_platform_devices(void)
44769  {
44770 -       if (!machine_is(mpc832x_mds))
44771 -               return 0;
44772 -
44773         /* Publish the QE devices */
44774         of_platform_bus_probe(NULL, mpc832x_ids, NULL);
44775  
44776         return 0;
44777  }
44778 -device_initcall(mpc832x_declare_of_platform_devices);
44779 +machine_device_initcall(mpc832x_mds, mpc832x_declare_of_platform_devices);
44780  
44781  static void __init mpc832x_sys_init_IRQ(void)
44782  {
44783 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/83xx/mpc832x_rdb.c powerpc.git/arch/powerpc/platforms/83xx/mpc832x_rdb.c
44784 --- linux-2.6.24/arch/powerpc/platforms/83xx/mpc832x_rdb.c      2008-01-24 23:58:37.000000000 +0100
44785 +++ powerpc.git/arch/powerpc/platforms/83xx/mpc832x_rdb.c       2008-01-28 20:25:49.000000000 +0100
44786 @@ -19,8 +19,8 @@
44787  #include <linux/spi/spi.h>
44788  #include <linux/spi/mmc_spi.h>
44789  #include <linux/mmc/host.h>
44790 +#include <linux/of_platform.h>
44791  
44792 -#include <asm/of_platform.h>
44793  #include <asm/time.h>
44794  #include <asm/ipic.h>
44795  #include <asm/udbg.h>
44796 @@ -63,9 +63,6 @@
44797  
44798  static int __init mpc832x_spi_init(void)
44799  {
44800 -       if (!machine_is(mpc832x_rdb))
44801 -               return 0;
44802 -
44803         par_io_config_pin(3,  0, 3, 0, 1, 0); /* SPI1 MOSI, I/O */
44804         par_io_config_pin(3,  1, 3, 0, 1, 0); /* SPI1 MISO, I/O */
44805         par_io_config_pin(3,  2, 3, 0, 1, 0); /* SPI1 CLK,  I/O */
44806 @@ -80,7 +77,7 @@
44807                             mpc83xx_spi_deactivate_cs);
44808  }
44809  
44810 -device_initcall(mpc832x_spi_init);
44811 +machine_device_initcall(mpc832x_rdb, mpc832x_spi_init);
44812  
44813  /* ************************************************************************
44814   *
44815 @@ -123,15 +120,12 @@
44816  
44817  static int __init mpc832x_declare_of_platform_devices(void)
44818  {
44819 -       if (!machine_is(mpc832x_rdb))
44820 -               return 0;
44821 -
44822         /* Publish the QE devices */
44823         of_platform_bus_probe(NULL, mpc832x_ids, NULL);
44824  
44825         return 0;
44826  }
44827 -device_initcall(mpc832x_declare_of_platform_devices);
44828 +machine_device_initcall(mpc832x_rdb, mpc832x_declare_of_platform_devices);
44829  
44830  void __init mpc832x_rdb_init_IRQ(void)
44831  {
44832 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/83xx/mpc834x_itx.c powerpc.git/arch/powerpc/platforms/83xx/mpc834x_itx.c
44833 --- linux-2.6.24/arch/powerpc/platforms/83xx/mpc834x_itx.c      2008-01-24 23:58:37.000000000 +0100
44834 +++ powerpc.git/arch/powerpc/platforms/83xx/mpc834x_itx.c       2008-01-28 20:25:49.000000000 +0100
44835 @@ -23,6 +23,7 @@
44836  #include <linux/delay.h>
44837  #include <linux/seq_file.h>
44838  #include <linux/root_dev.h>
44839 +#include <linux/of_platform.h>
44840  
44841  #include <asm/system.h>
44842  #include <asm/atomic.h>
44843 @@ -37,6 +38,17 @@
44844  
44845  #include "mpc83xx.h"
44846  
44847 +static struct of_device_id __initdata mpc834x_itx_ids[] = {
44848 +       { .compatible = "fsl,pq2pro-localbus", },
44849 +       {},
44850 +};
44851 +
44852 +static int __init mpc834x_itx_declare_of_platform_devices(void)
44853 +{
44854 +       return of_platform_bus_probe(NULL, mpc834x_itx_ids, NULL);
44855 +}
44856 +machine_device_initcall(mpc834x_itx, mpc834x_itx_declare_of_platform_devices);
44857 +
44858  /* ************************************************************************
44859   *
44860   * Setup the architecture
44861 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/83xx/mpc834x_mds.c powerpc.git/arch/powerpc/platforms/83xx/mpc834x_mds.c
44862 --- linux-2.6.24/arch/powerpc/platforms/83xx/mpc834x_mds.c      2008-01-24 23:58:37.000000000 +0100
44863 +++ powerpc.git/arch/powerpc/platforms/83xx/mpc834x_mds.c       2008-01-28 20:25:49.000000000 +0100
44864 @@ -23,6 +23,7 @@
44865  #include <linux/delay.h>
44866  #include <linux/seq_file.h>
44867  #include <linux/root_dev.h>
44868 +#include <linux/of_platform.h>
44869  
44870  #include <asm/system.h>
44871  #include <asm/atomic.h>
44872 @@ -106,14 +107,27 @@
44873         ipic_set_default_priority();
44874  }
44875  
44876 +static struct of_device_id mpc834x_ids[] = {
44877 +       { .type = "soc", },
44878 +       { .compatible = "soc", },
44879 +       {},
44880 +};
44881 +
44882 +static int __init mpc834x_declare_of_platform_devices(void)
44883 +{
44884 +       of_platform_bus_probe(NULL, mpc834x_ids, NULL);
44885 +       return 0;
44886 +}
44887 +machine_device_initcall(mpc834x_mds, mpc834x_declare_of_platform_devices);
44888 +
44889  /*
44890   * Called very early, MMU is off, device-tree isn't unflattened
44891   */
44892  static int __init mpc834x_mds_probe(void)
44893  {
44894 -        unsigned long root = of_get_flat_dt_root();
44895 +       unsigned long root = of_get_flat_dt_root();
44896  
44897 -        return of_flat_dt_is_compatible(root, "MPC834xMDS");
44898 +       return of_flat_dt_is_compatible(root, "MPC834xMDS");
44899  }
44900  
44901  define_machine(mpc834x_mds) {
44902 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/83xx/mpc836x_mds.c powerpc.git/arch/powerpc/platforms/83xx/mpc836x_mds.c
44903 --- linux-2.6.24/arch/powerpc/platforms/83xx/mpc836x_mds.c      2008-01-24 23:58:37.000000000 +0100
44904 +++ powerpc.git/arch/powerpc/platforms/83xx/mpc836x_mds.c       2008-01-28 20:25:49.000000000 +0100
44905 @@ -29,9 +29,9 @@
44906  #include <linux/seq_file.h>
44907  #include <linux/root_dev.h>
44908  #include <linux/initrd.h>
44909 +#include <linux/of_platform.h>
44910 +#include <linux/of_device.h>
44911  
44912 -#include <asm/of_device.h>
44913 -#include <asm/of_platform.h>
44914  #include <asm/system.h>
44915  #include <asm/atomic.h>
44916  #include <asm/time.h>
44917 @@ -141,15 +141,12 @@
44918  
44919  static int __init mpc836x_declare_of_platform_devices(void)
44920  {
44921 -       if (!machine_is(mpc836x_mds))
44922 -               return 0;
44923 -
44924         /* Publish the QE devices */
44925         of_platform_bus_probe(NULL, mpc836x_ids, NULL);
44926  
44927         return 0;
44928  }
44929 -device_initcall(mpc836x_declare_of_platform_devices);
44930 +machine_device_initcall(mpc836x_mds, mpc836x_declare_of_platform_devices);
44931  
44932  static void __init mpc836x_mds_init_IRQ(void)
44933  {
44934 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/83xx/mpc837x_mds.c powerpc.git/arch/powerpc/platforms/83xx/mpc837x_mds.c
44935 --- linux-2.6.24/arch/powerpc/platforms/83xx/mpc837x_mds.c      1970-01-01 01:00:00.000000000 +0100
44936 +++ powerpc.git/arch/powerpc/platforms/83xx/mpc837x_mds.c       2008-01-28 20:25:49.000000000 +0100
44937 @@ -0,0 +1,147 @@
44938 +/*
44939 + * arch/powerpc/platforms/83xx/mpc837x_mds.c
44940 + *
44941 + * Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.
44942 + *
44943 + * MPC837x MDS board specific routines
44944 + *
44945 + * This program is free software; you can redistribute it and/or modify it
44946 + * under the terms of the GNU General Public License as published by the
44947 + * Free Software Foundation;  either version 2 of the License, or (at your
44948 + * option) any later version.
44949 + */
44950 +
44951 +#include <linux/pci.h>
44952 +#include <linux/of.h>
44953 +#include <linux/of_platform.h>
44954 +
44955 +#include <asm/time.h>
44956 +#include <asm/ipic.h>
44957 +#include <asm/udbg.h>
44958 +#include <asm/prom.h>
44959 +
44960 +#include "mpc83xx.h"
44961 +
44962 +#define BCSR12_USB_SER_MASK    0x8a
44963 +#define BCSR12_USB_SER_PIN     0x80
44964 +#define BCSR12_USB_SER_DEVICE  0x02
44965 +extern int mpc837x_usb_cfg(void);
44966 +
44967 +static int mpc837xmds_usb_cfg(void)
44968 +{
44969 +       struct device_node *np;
44970 +       const void *phy_type, *mode;
44971 +       void __iomem *bcsr_regs = NULL;
44972 +       u8 bcsr12;
44973 +       int ret;
44974 +
44975 +       ret = mpc837x_usb_cfg();
44976 +       if (ret)
44977 +               return ret;
44978 +       /* Map BCSR area */
44979 +       np = of_find_node_by_name(NULL, "bcsr");
44980 +       if (np) {
44981 +               struct resource res;
44982 +
44983 +               of_address_to_resource(np, 0, &res);
44984 +               bcsr_regs = ioremap(res.start, res.end - res.start + 1);
44985 +               of_node_put(np);
44986 +       }
44987 +       if (!bcsr_regs)
44988 +               return -1;
44989 +
44990 +       np = of_find_node_by_name(NULL, "usb");
44991 +       if (!np)
44992 +               return -ENODEV;
44993 +       phy_type = of_get_property(np, "phy_type", NULL);
44994 +       if (phy_type && !strcmp(phy_type, "ulpi")) {
44995 +               clrbits8(bcsr_regs + 12, BCSR12_USB_SER_PIN);
44996 +       } else if (phy_type && !strcmp(phy_type, "serial")) {
44997 +               mode = of_get_property(np, "dr_mode", NULL);
44998 +               bcsr12 = in_8(bcsr_regs + 12) & ~BCSR12_USB_SER_MASK;
44999 +               bcsr12 |= BCSR12_USB_SER_PIN;
45000 +               if (mode && !strcmp(mode, "peripheral"))
45001 +                       bcsr12 |= BCSR12_USB_SER_DEVICE;
45002 +               out_8(bcsr_regs + 12, bcsr12);
45003 +       } else {
45004 +               printk(KERN_ERR "USB DR: unsupported PHY\n");
45005 +       }
45006 +
45007 +       of_node_put(np);
45008 +       iounmap(bcsr_regs);
45009 +       return 0;
45010 +}
45011 +
45012 +/* ************************************************************************
45013 + *
45014 + * Setup the architecture
45015 + *
45016 + */
45017 +static void __init mpc837x_mds_setup_arch(void)
45018 +{
45019 +#ifdef CONFIG_PCI
45020 +       struct device_node *np;
45021 +#endif
45022 +
45023 +       if (ppc_md.progress)
45024 +               ppc_md.progress("mpc837x_mds_setup_arch()", 0);
45025 +
45026 +#ifdef CONFIG_PCI
45027 +       for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
45028 +               mpc83xx_add_bridge(np);
45029 +#endif
45030 +       mpc837xmds_usb_cfg();
45031 +}
45032 +
45033 +static struct of_device_id mpc837x_ids[] = {
45034 +       { .type = "soc", },
45035 +       { .compatible = "soc", },
45036 +       {},
45037 +};
45038 +
45039 +static int __init mpc837x_declare_of_platform_devices(void)
45040 +{
45041 +       /* Publish of_device */
45042 +       of_platform_bus_probe(NULL, mpc837x_ids, NULL);
45043 +
45044 +       return 0;
45045 +}
45046 +machine_device_initcall(mpc837x_mds, mpc837x_declare_of_platform_devices);
45047 +
45048 +static void __init mpc837x_mds_init_IRQ(void)
45049 +{
45050 +       struct device_node *np;
45051 +
45052 +       np = of_find_compatible_node(NULL, NULL, "fsl,ipic");
45053 +       if (!np)
45054 +               return;
45055 +
45056 +       ipic_init(np, 0);
45057 +
45058 +       /* Initialize the default interrupt mapping priorities,
45059 +        * in case the boot rom changed something on us.
45060 +        */
45061 +       ipic_set_default_priority();
45062 +}
45063 +
45064 +/*
45065 + * Called very early, MMU is off, device-tree isn't unflattened
45066 + */
45067 +static int __init mpc837x_mds_probe(void)
45068 +{
45069 +        unsigned long root = of_get_flat_dt_root();
45070 +
45071 +        return of_flat_dt_is_compatible(root, "fsl,mpc837xmds");
45072 +}
45073 +
45074 +define_machine(mpc837x_mds) {
45075 +       .name                   = "MPC837x MDS",
45076 +       .probe                  = mpc837x_mds_probe,
45077 +       .setup_arch             = mpc837x_mds_setup_arch,
45078 +       .init_IRQ               = mpc837x_mds_init_IRQ,
45079 +       .get_irq                = ipic_get_irq,
45080 +       .restart                = mpc83xx_restart,
45081 +       .time_init              = mpc83xx_time_init,
45082 +       .calibrate_decr         = generic_calibrate_decr,
45083 +       .progress               = udbg_progress,
45084 +};
45085 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/83xx/mpc83xx.h powerpc.git/arch/powerpc/platforms/83xx/mpc83xx.h
45086 --- linux-2.6.24/arch/powerpc/platforms/83xx/mpc83xx.h  2008-01-24 23:58:37.000000000 +0100
45087 +++ powerpc.git/arch/powerpc/platforms/83xx/mpc83xx.h   2008-01-28 20:25:49.000000000 +0100
45088 @@ -14,6 +14,7 @@
45089  #define MPC83XX_SCCR_USB_DRCM_11   0x00300000
45090  #define MPC83XX_SCCR_USB_DRCM_01   0x00100000
45091  #define MPC83XX_SCCR_USB_DRCM_10   0x00200000
45092 +#define MPC837X_SCCR_USB_DRCM_11   0x00c00000
45093  
45094  /* system i/o configuration register low */
45095  #define MPC83XX_SICRL_OFFS         0x114
45096 @@ -22,6 +23,8 @@
45097  #define MPC834X_SICRL_USB1         0x20000000
45098  #define MPC831X_SICRL_USB_MASK     0x00000c00
45099  #define MPC831X_SICRL_USB_ULPI     0x00000800
45100 +#define MPC837X_SICRL_USB_MASK     0xf0000000
45101 +#define MPC837X_SICRL_USB_ULPI     0x50000000
45102  
45103  /* system i/o configuration register high */
45104  #define MPC83XX_SICRH_OFFS         0x118
45105 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/83xx/pci.c powerpc.git/arch/powerpc/platforms/83xx/pci.c
45106 --- linux-2.6.24/arch/powerpc/platforms/83xx/pci.c      2008-01-24 23:58:37.000000000 +0100
45107 +++ powerpc.git/arch/powerpc/platforms/83xx/pci.c       2008-01-28 20:25:49.000000000 +0100
45108 @@ -54,7 +54,7 @@
45109                        " bus 0\n", dev->full_name);
45110         }
45111  
45112 -       pci_assign_all_buses = 1;
45113 +       ppc_pci_flags |= PPC_PCI_REASSIGN_ALL_BUS;
45114         hose = pcibios_alloc_controller(dev);
45115         if (!hose)
45116                 return -ENOMEM;
45117 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/83xx/usb.c powerpc.git/arch/powerpc/platforms/83xx/usb.c
45118 --- linux-2.6.24/arch/powerpc/platforms/83xx/usb.c      2008-01-24 23:58:37.000000000 +0100
45119 +++ powerpc.git/arch/powerpc/platforms/83xx/usb.c       2008-01-28 20:25:49.000000000 +0100
45120 @@ -41,7 +41,7 @@
45121         sicrl = in_be32(immap + MPC83XX_SICRL_OFFS) & ~MPC834X_SICRL_USB_MASK;
45122         sicrh = in_be32(immap + MPC83XX_SICRH_OFFS) & ~MPC834X_SICRH_USB_UTMI;
45123  
45124 -       np = of_find_compatible_node(NULL, "usb", "fsl-usb2-dr");
45125 +       np = of_find_compatible_node(NULL, NULL, "fsl-usb2-dr");
45126         if (np) {
45127                 sccr |= MPC83XX_SCCR_USB_DRCM_11;  /* 1:3 */
45128  
45129 @@ -67,7 +67,7 @@
45130                 port0_is_dr = 1;
45131                 of_node_put(np);
45132         }
45133 -       np = of_find_compatible_node(NULL, "usb", "fsl-usb2-mph");
45134 +       np = of_find_compatible_node(NULL, NULL, "fsl-usb2-mph");
45135         if (np) {
45136                 sccr |= MPC83XX_SCCR_USB_MPHCM_11; /* 1:3 */
45137  
45138 @@ -111,7 +111,7 @@
45139         const void *dr_mode;
45140  #endif
45141  
45142 -       np = of_find_compatible_node(NULL, "usb", "fsl-usb2-dr");
45143 +       np = of_find_compatible_node(NULL, NULL, "fsl-usb2-dr");
45144         if (!np)
45145                 return -ENODEV;
45146         prop = of_get_property(np, "phy_type", NULL);
45147 @@ -179,3 +179,43 @@
45148         return ret;
45149  }
45150  #endif /* CONFIG_PPC_MPC831x */
45151 +
45152 +#ifdef CONFIG_PPC_MPC837x
45153 +int mpc837x_usb_cfg(void)
45154 +{
45155 +       void __iomem *immap;
45156 +       struct device_node *np = NULL;
45157 +       const void *prop;
45158 +       int ret = 0;
45159 +
45160 +       np = of_find_compatible_node(NULL, NULL, "fsl-usb2-dr");
45161 +       if (!np)
45162 +               return -ENODEV;
45163 +       prop = of_get_property(np, "phy_type", NULL);
45164 +
45165 +       if (!prop || (strcmp(prop, "ulpi") && strcmp(prop, "serial"))) {
45166 +               printk(KERN_WARNING "837x USB PHY type not supported\n");
45167 +               of_node_put(np);
45168 +               return -EINVAL;
45169 +       }
45170 +
45171 +       /* Map IMMR space for pin and clock settings */
45172 +       immap = ioremap(get_immrbase(), 0x1000);
45173 +       if (!immap) {
45174 +               of_node_put(np);
45175 +               return -ENOMEM;
45176 +       }
45177 +
45178 +       /* Configure clock */
45179 +       clrsetbits_be32(immap + MPC83XX_SCCR_OFFS, MPC837X_SCCR_USB_DRCM_11,
45180 +                       MPC837X_SCCR_USB_DRCM_11);
45181 +
45182 +       /* Configure pin mux for ULPI/serial */
45183 +       clrsetbits_be32(immap + MPC83XX_SICRL_OFFS, MPC837X_SICRL_USB_MASK,
45184 +                       MPC837X_SICRL_USB_ULPI);
45185 +
45186 +       iounmap(immap);
45187 +       of_node_put(np);
45188 +       return ret;
45189 +}
45190 +#endif /* CONFIG_PPC_MPC837x */
45191 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/85xx/mpc85xx_ads.c powerpc.git/arch/powerpc/platforms/85xx/mpc85xx_ads.c
45192 --- linux-2.6.24/arch/powerpc/platforms/85xx/mpc85xx_ads.c      2008-01-24 23:58:37.000000000 +0100
45193 +++ powerpc.git/arch/powerpc/platforms/85xx/mpc85xx_ads.c       2008-01-28 20:25:49.000000000 +0100
45194 @@ -52,9 +52,9 @@
45195  {
45196         int cascade_irq;
45197  
45198 -       while ((cascade_irq = cpm2_get_irq()) >= 0) {
45199 +       while ((cascade_irq = cpm2_get_irq()) >= 0)
45200                 generic_handle_irq(cascade_irq);
45201 -       }
45202 +
45203         desc->chip->eoi(irq);
45204  }
45205  
45206 @@ -70,13 +70,12 @@
45207  #endif
45208  
45209         np = of_find_node_by_type(np, "open-pic");
45210 -
45211 -       if (np == NULL) {
45212 +       if (!np) {
45213                 printk(KERN_ERR "Could not find open-pic node\n");
45214                 return;
45215         }
45216  
45217 -       if(of_address_to_resource(np, 0, &r)) {
45218 +       if (of_address_to_resource(np, 0, &r)) {
45219                 printk(KERN_ERR "Could not map mpic register space\n");
45220                 of_node_put(np);
45221                 return;
45222 @@ -100,6 +99,7 @@
45223         irq = irq_of_parse_and_map(np, 0);
45224  
45225         cpm2_pic_init(np);
45226 +       of_node_put(np);
45227         set_irq_chained_handler(irq, cpm2_cascade);
45228  #endif
45229  }
45230 @@ -112,7 +112,7 @@
45231         int port, pin, flags;
45232  };
45233  
45234 -static struct cpm_pin mpc8560_ads_pins[] = {
45235 +static const struct cpm_pin mpc8560_ads_pins[] = {
45236         /* SCC1 */
45237         {3, 29, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
45238         {3, 30, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
45239 @@ -233,13 +233,11 @@
45240  
45241  static int __init declare_of_platform_devices(void)
45242  {
45243 -       if (!machine_is(mpc85xx_ads))
45244 -               return 0;
45245 -
45246         of_platform_bus_probe(NULL, of_bus_ids, NULL);
45247 +
45248         return 0;
45249  }
45250 -device_initcall(declare_of_platform_devices);
45251 +machine_device_initcall(mpc85xx_ads, declare_of_platform_devices);
45252  
45253  /*
45254   * Called very early, device-tree isn't unflattened
45255 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/85xx/mpc85xx_cds.c powerpc.git/arch/powerpc/platforms/85xx/mpc85xx_cds.c
45256 --- linux-2.6.24/arch/powerpc/platforms/85xx/mpc85xx_cds.c      2008-01-24 23:58:37.000000000 +0100
45257 +++ powerpc.git/arch/powerpc/platforms/85xx/mpc85xx_cds.c       2008-01-28 20:25:49.000000000 +0100
45258 @@ -222,9 +222,6 @@
45259         struct device_node *cascade_node = NULL;
45260         int cascade_irq;
45261  
45262 -       if (!machine_is(mpc85xx_cds))
45263 -               return 0;
45264 -
45265         /* Initialize the i8259 controller */
45266         for_each_node_by_type(np, "interrupt-controller")
45267                 if (of_device_is_compatible(np, "chrp,iic")) {
45268 @@ -262,8 +259,7 @@
45269  
45270         return 0;
45271  }
45272 -
45273 -device_initcall(mpc85xx_cds_8259_attach);
45274 +machine_device_initcall(mpc85xx_cds, mpc85xx_cds_8259_attach);
45275  
45276  #endif /* CONFIG_PPC_I8259 */
45277  
45278 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/85xx/mpc85xx_ds.c powerpc.git/arch/powerpc/platforms/85xx/mpc85xx_ds.c
45279 --- linux-2.6.24/arch/powerpc/platforms/85xx/mpc85xx_ds.c       2008-01-24 23:58:37.000000000 +0100
45280 +++ powerpc.git/arch/powerpc/platforms/85xx/mpc85xx_ds.c        2008-01-28 20:25:49.000000000 +0100
45281 @@ -123,7 +123,7 @@
45282         struct device_node* node;
45283         struct resource rsrc;
45284  
45285 -       node = (struct device_node *)hose->arch_data;
45286 +       node = hose->dn;
45287         of_address_to_resource(node, 0, &rsrc);
45288  
45289         if ((rsrc.start & 0xfffff) == primary_phb_addr) {
45290 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/85xx/mpc85xx_mds.c powerpc.git/arch/powerpc/platforms/85xx/mpc85xx_mds.c
45291 --- linux-2.6.24/arch/powerpc/platforms/85xx/mpc85xx_mds.c      2008-01-24 23:58:37.000000000 +0100
45292 +++ powerpc.git/arch/powerpc/platforms/85xx/mpc85xx_mds.c       2008-01-28 20:25:49.000000000 +0100
45293 @@ -30,9 +30,9 @@
45294  #include <linux/initrd.h>
45295  #include <linux/module.h>
45296  #include <linux/fsl_devices.h>
45297 +#include <linux/of_platform.h>
45298 +#include <linux/of_device.h>
45299  
45300 -#include <asm/of_device.h>
45301 -#include <asm/of_platform.h>
45302  #include <asm/system.h>
45303  #include <asm/atomic.h>
45304  #include <asm/time.h>
45305 @@ -144,15 +144,12 @@
45306  
45307  static int __init mpc85xx_publish_devices(void)
45308  {
45309 -       if (!machine_is(mpc85xx_mds))
45310 -               return 0;
45311 -
45312         /* Publish the QE devices */
45313 -       of_platform_bus_probe(NULL,mpc85xx_ids,NULL);
45314 +       of_platform_bus_probe(NULL, mpc85xx_ids, NULL);
45315  
45316         return 0;
45317  }
45318 -device_initcall(mpc85xx_publish_devices);
45319 +machine_device_initcall(mpc85xx_mds, mpc85xx_publish_devices);
45320  
45321  static void __init mpc85xx_mds_pic_init(void)
45322  {
45323 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/86xx/mpc8610_hpcd.c powerpc.git/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
45324 --- linux-2.6.24/arch/powerpc/platforms/86xx/mpc8610_hpcd.c     2008-01-24 23:58:37.000000000 +0100
45325 +++ powerpc.git/arch/powerpc/platforms/86xx/mpc8610_hpcd.c      2008-01-28 20:25:49.000000000 +0100
45326 @@ -34,9 +34,24 @@
45327  
45328  #include <asm/mpic.h>
45329  
45330 +#include <linux/of_platform.h>
45331  #include <sysdev/fsl_pci.h>
45332  #include <sysdev/fsl_soc.h>
45333  
45334 +static struct of_device_id __initdata mpc8610_ids[] = {
45335 +       { .compatible = "fsl,mpc8610-immr", },
45336 +       {}
45337 +};
45338 +
45339 +static int __init mpc8610_declare_of_platform_devices(void)
45340 +{
45341 +       /* Without this call, the SSI device driver won't get probed. */
45342 +       of_platform_bus_probe(NULL, mpc8610_ids, NULL);
45343 +
45344 +       return 0;
45345 +}
45346 +machine_device_initcall(mpc86xx_hpcd, mpc8610_declare_of_platform_devices);
45347 +
45348  void __init
45349  mpc86xx_hpcd_init_irq(void)
45350  {
45351 @@ -124,7 +139,7 @@
45352  static void __devinit final_uli5288(struct pci_dev *dev)
45353  {
45354         struct pci_controller *hose = pci_bus_to_host(dev->bus);
45355 -       struct device_node *hosenode = hose ? hose->arch_data : NULL;
45356 +       struct device_node *hosenode = hose ? hose->dn : NULL;
45357         struct of_irq oirq;
45358         int virq, pin = 2;
45359         u32 laddr[3];
45360 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c powerpc.git/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
45361 --- linux-2.6.24/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c     2008-01-24 23:58:37.000000000 +0100
45362 +++ powerpc.git/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c      2008-01-28 20:25:49.000000000 +0100
45363 @@ -18,6 +18,7 @@
45364  #include <linux/kdev_t.h>
45365  #include <linux/delay.h>
45366  #include <linux/seq_file.h>
45367 +#include <linux/of_platform.h>
45368  
45369  #include <asm/system.h>
45370  #include <asm/time.h>
45371 @@ -116,7 +117,7 @@
45372         struct device_node* node;       
45373         struct resource rsrc;
45374  
45375 -       node = (struct device_node *)hose->arch_data;
45376 +       node = hose->dn;
45377         of_address_to_resource(node, 0, &rsrc);
45378  
45379         if ((rsrc.start & 0xfffff) == 0x8000) {
45380 @@ -212,6 +213,19 @@
45381         return 0;
45382  }
45383  
45384 +static __initdata struct of_device_id of_bus_ids[] = {
45385 +       { .compatible = "simple-bus", },
45386 +       {},
45387 +};
45388 +
45389 +static int __init declare_of_platform_devices(void)
45390 +{
45391 +       of_platform_bus_probe(NULL, of_bus_ids, NULL);
45392 +
45393 +       return 0;
45394 +}
45395 +machine_device_initcall(mpc86xx_hpcn, declare_of_platform_devices);
45396 +
45397  define_machine(mpc86xx_hpcn) {
45398         .name                   = "MPC86xx HPCN",
45399         .probe                  = mpc86xx_hpcn_probe,
45400 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/8xx/Kconfig powerpc.git/arch/powerpc/platforms/8xx/Kconfig
45401 --- linux-2.6.24/arch/powerpc/platforms/8xx/Kconfig     2008-01-24 23:58:37.000000000 +0100
45402 +++ powerpc.git/arch/powerpc/platforms/8xx/Kconfig      2008-01-28 20:25:49.000000000 +0100
45403 @@ -18,6 +18,7 @@
45404  config MPC86XADS
45405         bool "MPC86XADS"
45406         select CPM1
45407 +       select PPC_CPM_NEW_BINDING
45408         help
45409           MPC86x Application Development System by Freescale Semiconductor.
45410           The MPC86xADS is meant to serve as a platform for s/w and h/w
45411 @@ -43,6 +44,15 @@
45412           This board is also resold by Freescale as the QUICCStart
45413           MPC885 Evaluation System and/or the CWH-PPC-885XN-VE.
45414  
45415 +config PPC_ADDER875
45416 +       bool "Analogue & Micro Adder 875"
45417 +       select CPM1
45418 +       select PPC_CPM_NEW_BINDING
45419 +       select REDBOOT
45420 +       help
45421 +         This enables support for the Analogue & Micro Adder 875
45422 +         board.
45423 +
45424  endchoice
45425  
45426  menu "Freescale Ethernet driver platform-specific options"
45427 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/8xx/Makefile powerpc.git/arch/powerpc/platforms/8xx/Makefile
45428 --- linux-2.6.24/arch/powerpc/platforms/8xx/Makefile    2008-01-24 23:58:37.000000000 +0100
45429 +++ powerpc.git/arch/powerpc/platforms/8xx/Makefile     2008-01-28 20:25:49.000000000 +0100
45430 @@ -5,3 +5,4 @@
45431  obj-$(CONFIG_MPC885ADS)   += mpc885ads_setup.o
45432  obj-$(CONFIG_MPC86XADS)   += mpc86xads_setup.o
45433  obj-$(CONFIG_PPC_EP88XC)  += ep88xc.o
45434 +obj-$(CONFIG_PPC_ADDER875) += adder875.o
45435 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/8xx/adder875.c powerpc.git/arch/powerpc/platforms/8xx/adder875.c
45436 --- linux-2.6.24/arch/powerpc/platforms/8xx/adder875.c  1970-01-01 01:00:00.000000000 +0100
45437 +++ powerpc.git/arch/powerpc/platforms/8xx/adder875.c   2008-01-28 20:25:49.000000000 +0100
45438 @@ -0,0 +1,118 @@
45439 +/* Analogue & Micro Adder MPC875 board support
45440 + *
45441 + * Author: Scott Wood <scottwood@freescale.com>
45442 + *
45443 + * Copyright (c) 2007 Freescale Semiconductor, Inc.
45444 + *
45445 + * This program is free software; you can redistribute  it and/or modify
45446 + * it under the terms of the GNU General Public License, version 2, as
45447 + * published by the Free Software Foundation.
45448 + */
45449 +
45450 +#include <linux/init.h>
45451 +#include <linux/fs_enet_pd.h>
45452 +#include <linux/of_platform.h>
45453 +
45454 +#include <asm/time.h>
45455 +#include <asm/machdep.h>
45456 +#include <asm/commproc.h>
45457 +#include <asm/fs_pd.h>
45458 +#include <asm/udbg.h>
45459 +#include <asm/prom.h>
45460 +
45461 +#include <sysdev/commproc.h>
45462 +
45463 +struct cpm_pin {
45464 +       int port, pin, flags;
45465 +};
45466 +
45467 +static __initdata struct cpm_pin adder875_pins[] = {
45468 +       /* SMC1 */
45469 +       {CPM_PORTB, 24, CPM_PIN_INPUT}, /* RX */
45470 +       {CPM_PORTB, 25, CPM_PIN_INPUT | CPM_PIN_SECONDARY}, /* TX */
45471 +
45472 +       /* MII1 */
45473 +       {CPM_PORTA, 0, CPM_PIN_INPUT},
45474 +       {CPM_PORTA, 1, CPM_PIN_INPUT},
45475 +       {CPM_PORTA, 2, CPM_PIN_INPUT},
45476 +       {CPM_PORTA, 3, CPM_PIN_INPUT},
45477 +       {CPM_PORTA, 4, CPM_PIN_OUTPUT},
45478 +       {CPM_PORTA, 10, CPM_PIN_OUTPUT},
45479 +       {CPM_PORTA, 11, CPM_PIN_OUTPUT},
45480 +       {CPM_PORTB, 19, CPM_PIN_INPUT},
45481 +       {CPM_PORTB, 31, CPM_PIN_INPUT},
45482 +       {CPM_PORTC, 12, CPM_PIN_INPUT},
45483 +       {CPM_PORTC, 13, CPM_PIN_INPUT},
45484 +       {CPM_PORTE, 30, CPM_PIN_OUTPUT},
45485 +       {CPM_PORTE, 31, CPM_PIN_OUTPUT},
45486 +
45487 +       /* MII2 */
45488 +       {CPM_PORTE, 14, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
45489 +       {CPM_PORTE, 15, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
45490 +       {CPM_PORTE, 16, CPM_PIN_OUTPUT},
45491 +       {CPM_PORTE, 17, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
45492 +       {CPM_PORTE, 18, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
45493 +       {CPM_PORTE, 19, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
45494 +       {CPM_PORTE, 20, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
45495 +       {CPM_PORTE, 21, CPM_PIN_OUTPUT},
45496 +       {CPM_PORTE, 22, CPM_PIN_OUTPUT},
45497 +       {CPM_PORTE, 23, CPM_PIN_OUTPUT},
45498 +       {CPM_PORTE, 24, CPM_PIN_OUTPUT},
45499 +       {CPM_PORTE, 25, CPM_PIN_OUTPUT},
45500 +       {CPM_PORTE, 26, CPM_PIN_OUTPUT},
45501 +       {CPM_PORTE, 27, CPM_PIN_OUTPUT},
45502 +       {CPM_PORTE, 28, CPM_PIN_OUTPUT},
45503 +       {CPM_PORTE, 29, CPM_PIN_OUTPUT},
45504 +};
45505 +
45506 +static void __init init_ioports(void)
45507 +{
45508 +       int i;
45509 +
45510 +       for (i = 0; i < ARRAY_SIZE(adder875_pins); i++) {
45511 +               const struct cpm_pin *pin = &adder875_pins[i];
45512 +               cpm1_set_pin(pin->port, pin->pin, pin->flags);
45513 +       }
45514 +
45515 +       cpm1_clk_setup(CPM_CLK_SMC1, CPM_BRG1, CPM_CLK_RTX);
45516 +
45517 +       /* Set FEC1 and FEC2 to MII mode */
45518 +       clrbits32(&mpc8xx_immr->im_cpm.cp_cptr, 0x00000180);
45519 +}
45520 +
45521 +static void __init adder875_setup(void)
45522 +{
45523 +       cpm_reset();
45524 +       init_ioports();
45525 +}
45526 +
45527 +static int __init adder875_probe(void)
45528 +{
45529 +       unsigned long root = of_get_flat_dt_root();
45530 +       return of_flat_dt_is_compatible(root, "analogue-and-micro,adder875");
45531 +}
45532 +
45533 +static __initdata struct of_device_id of_bus_ids[] = {
45534 +       { .compatible = "simple-bus", },
45535 +       {},
45536 +};
45537 +
45538 +static int __init declare_of_platform_devices(void)
45539 +{
45540 +       of_platform_bus_probe(NULL, of_bus_ids, NULL);
45541 +       return 0;
45542 +}
45543 +machine_device_initcall(adder875, declare_of_platform_devices);
45544 +
45545 +define_machine(adder875) {
45546 +       .name = "Adder MPC875",
45547 +       .probe = adder875_probe,
45548 +       .setup_arch = adder875_setup,
45549 +       .init_IRQ = m8xx_pic_init,
45550 +       .get_irq = mpc8xx_get_irq,
45551 +       .restart = mpc8xx_restart,
45552 +       .calibrate_decr = generic_calibrate_decr,
45553 +       .set_rtc_time = mpc8xx_set_rtc_time,
45554 +       .get_rtc_time = mpc8xx_get_rtc_time,
45555 +       .progress = udbg_progress,
45556 +};
45557 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/8xx/ep88xc.c powerpc.git/arch/powerpc/platforms/8xx/ep88xc.c
45558 --- linux-2.6.24/arch/powerpc/platforms/8xx/ep88xc.c    2008-01-24 23:58:37.000000000 +0100
45559 +++ powerpc.git/arch/powerpc/platforms/8xx/ep88xc.c     2008-01-28 20:25:49.000000000 +0100
45560 @@ -155,12 +155,11 @@
45561  static int __init declare_of_platform_devices(void)
45562  {
45563         /* Publish the QE devices */
45564 -       if (machine_is(ep88xc))
45565 -               of_platform_bus_probe(NULL, of_bus_ids, NULL);
45566 +       of_platform_bus_probe(NULL, of_bus_ids, NULL);
45567  
45568         return 0;
45569  }
45570 -device_initcall(declare_of_platform_devices);
45571 +machine_device_initcall(ep88xc, declare_of_platform_devices);
45572  
45573  define_machine(ep88xc) {
45574         .name = "Embedded Planet EP88xC",
45575 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/8xx/m8xx_setup.c powerpc.git/arch/powerpc/platforms/8xx/m8xx_setup.c
45576 --- linux-2.6.24/arch/powerpc/platforms/8xx/m8xx_setup.c        2008-01-24 23:58:37.000000000 +0100
45577 +++ powerpc.git/arch/powerpc/platforms/8xx/m8xx_setup.c 2008-01-28 20:25:49.000000000 +0100
45578 @@ -120,7 +120,7 @@
45579         ppc_tb_freq /= 16;
45580         ppc_proc_freq = 50000000;
45581         if (!get_freq("clock-frequency", &ppc_proc_freq))
45582 -               printk(KERN_ERR "WARNING: Estimating processor frequency"
45583 +               printk(KERN_ERR "WARNING: Estimating processor frequency "
45584                                 "(not found)\n");
45585  
45586         printk("Decrementer Frequency = 0x%lx\n", ppc_tb_freq);
45587 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/8xx/mpc86xads.h powerpc.git/arch/powerpc/platforms/8xx/mpc86xads.h
45588 --- linux-2.6.24/arch/powerpc/platforms/8xx/mpc86xads.h 2008-01-24 23:58:37.000000000 +0100
45589 +++ powerpc.git/arch/powerpc/platforms/8xx/mpc86xads.h  2008-01-28 20:25:49.000000000 +0100
45590 @@ -15,27 +15,6 @@
45591  #ifndef __ASM_MPC86XADS_H__
45592  #define __ASM_MPC86XADS_H__
45593  
45594 -#include <sysdev/fsl_soc.h>
45595 -
45596 -/* U-Boot maps BCSR to 0xff080000 */
45597 -#define BCSR_ADDR              ((uint)0xff080000)
45598 -#define BCSR_SIZE              ((uint)32)
45599 -#define BCSR0                  ((uint)(BCSR_ADDR + 0x00))
45600 -#define BCSR1                  ((uint)(BCSR_ADDR + 0x04))
45601 -#define BCSR2                  ((uint)(BCSR_ADDR + 0x08))
45602 -#define BCSR3                  ((uint)(BCSR_ADDR + 0x0c))
45603 -#define BCSR4                  ((uint)(BCSR_ADDR + 0x10))
45604 -
45605 -#define CFG_PHYDEV_ADDR                ((uint)0xff0a0000)
45606 -#define BCSR5                  ((uint)(CFG_PHYDEV_ADDR + 0x300))
45607 -
45608 -#define MPC8xx_CPM_OFFSET      (0x9c0)
45609 -#define CPM_MAP_ADDR           (get_immrbase() + MPC8xx_CPM_OFFSET)
45610 -#define CPM_IRQ_OFFSET         16     // for compability with cpm_uart driver
45611 -
45612 -#define PCMCIA_MEM_ADDR                ((uint)0xff020000)
45613 -#define PCMCIA_MEM_SIZE                ((uint)(64 * 1024))
45614 -
45615  /* Bits of interest in the BCSRs.
45616   */
45617  #define BCSR1_ETHEN            ((uint)0x20000000)
45618 @@ -64,28 +43,5 @@
45619  #define BCSR5_MII1_EN          0x02
45620  #define BCSR5_MII1_RST         0x01
45621  
45622 -/* Interrupt level assignments */
45623 -#define PHY_INTERRUPT  SIU_IRQ7        /* PHY link change interrupt */
45624 -#define SIU_INT_FEC1   SIU_LEVEL1      /* FEC1 interrupt */
45625 -#define FEC_INTERRUPT  SIU_INT_FEC1    /* FEC interrupt */
45626 -
45627 -/* We don't use the 8259 */
45628 -#define NR_8259_INTS   0
45629 -
45630 -/* CPM Ethernet through SCC1 */
45631 -#define PA_ENET_RXD     ((ushort)0x0001)
45632 -#define PA_ENET_TXD     ((ushort)0x0002)
45633 -#define PA_ENET_TCLK    ((ushort)0x0100)
45634 -#define PA_ENET_RCLK    ((ushort)0x0200)
45635 -#define PB_ENET_TENA    ((uint)0x00001000)
45636 -#define PC_ENET_CLSN    ((ushort)0x0010)
45637 -#define PC_ENET_RENA    ((ushort)0x0020)
45638 -
45639 -/* Control bits in the SICR to route TCLK (CLK1) and RCLK (CLK2) to
45640 - * SCC1.  Also, make sure GR1 (bit 24) and SC1 (bit 25) are zero.
45641 - */
45642 -#define SICR_ENET_MASK  ((uint)0x000000ff)
45643 -#define SICR_ENET_CLKRT ((uint)0x0000002c)
45644 -
45645  #endif /* __ASM_MPC86XADS_H__ */
45646  #endif /* __KERNEL__ */
45647 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/8xx/mpc86xads_setup.c powerpc.git/arch/powerpc/platforms/8xx/mpc86xads_setup.c
45648 --- linux-2.6.24/arch/powerpc/platforms/8xx/mpc86xads_setup.c   2008-01-24 23:58:37.000000000 +0100
45649 +++ powerpc.git/arch/powerpc/platforms/8xx/mpc86xads_setup.c    2008-01-28 20:25:49.000000000 +0100
45650 @@ -6,264 +6,133 @@
45651   *
45652   * Copyright 2005 MontaVista Software Inc.
45653   *
45654 + * Heavily modified by Scott Wood <scottwood@freescale.com>
45655 + * Copyright 2007 Freescale Semiconductor, Inc.
45656 + *
45657   * This file is licensed under the terms of the GNU General Public License
45658   * version 2. This program is licensed "as is" without any warranty of any
45659   * kind, whether express or implied.
45660   */
45661  
45662  #include <linux/init.h>
45663 -#include <linux/module.h>
45664 -#include <linux/param.h>
45665 -#include <linux/string.h>
45666 -#include <linux/ioport.h>
45667 -#include <linux/device.h>
45668 -#include <linux/delay.h>
45669 -#include <linux/root_dev.h>
45670 -
45671 -#include <linux/fs_enet_pd.h>
45672 -#include <linux/fs_uart_pd.h>
45673 -#include <linux/mii.h>
45674 +#include <linux/of_platform.h>
45675  
45676 -#include <asm/delay.h>
45677  #include <asm/io.h>
45678  #include <asm/machdep.h>
45679 -#include <asm/page.h>
45680 -#include <asm/processor.h>
45681  #include <asm/system.h>
45682  #include <asm/time.h>
45683  #include <asm/mpc8xx.h>
45684  #include <asm/8xx_immap.h>
45685  #include <asm/commproc.h>
45686  #include <asm/fs_pd.h>
45687 -#include <asm/prom.h>
45688 +#include <asm/udbg.h>
45689  
45690  #include <sysdev/commproc.h>
45691  
45692 -static void init_smc1_uart_ioports(struct fs_uart_platform_info* fpi);
45693 -static void init_smc2_uart_ioports(struct fs_uart_platform_info* fpi);
45694 -static void init_scc1_ioports(struct fs_platform_info* ptr);
45695 -
45696 -void __init mpc86xads_board_setup(void)
45697 -{
45698 -       cpm8xx_t *cp;
45699 -       unsigned int *bcsr_io;
45700 -       u8 tmpval8;
45701 -
45702 -       bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
45703 -       cp = (cpm8xx_t *)immr_map(im_cpm);
45704 +#include "mpc86xads.h"
45705  
45706 -       if (bcsr_io == NULL) {
45707 -               printk(KERN_CRIT "Could not remap BCSR\n");
45708 -               return;
45709 -       }
45710 -#ifdef CONFIG_SERIAL_CPM_SMC1
45711 -       clrbits32(bcsr_io, BCSR1_RS232EN_1);
45712 -       clrbits32(&cp->cp_simode, 0xe0000000 >> 17);    /* brg1 */
45713 -       tmpval8 = in_8(&(cp->cp_smc[0].smc_smcm)) | (SMCM_RX | SMCM_TX);
45714 -       out_8(&(cp->cp_smc[0].smc_smcm), tmpval8);
45715 -       clrbits16(&cp->cp_smc[0].smc_smcmr, SMCMR_REN | SMCMR_TEN);
45716 -#else
45717 -       setbits32(bcsr_io,BCSR1_RS232EN_1);
45718 -       out_be16(&cp->cp_smc[0].smc_smcmr, 0);
45719 -       out_8(&cp->cp_smc[0].smc_smce, 0);
45720 -#endif
45721 -
45722 -#ifdef CONFIG_SERIAL_CPM_SMC2
45723 -       clrbits32(bcsr_io,BCSR1_RS232EN_2);
45724 -       clrbits32(&cp->cp_simode, 0xe0000000 >> 1);
45725 -       setbits32(&cp->cp_simode, 0x20000000 >> 1);     /* brg2 */
45726 -       tmpval8 = in_8(&(cp->cp_smc[1].smc_smcm)) | (SMCM_RX | SMCM_TX);
45727 -       out_8(&(cp->cp_smc[1].smc_smcm), tmpval8);
45728 -       clrbits16(&cp->cp_smc[1].smc_smcmr, SMCMR_REN | SMCMR_TEN);
45729 -
45730 -       init_smc2_uart_ioports(0);
45731 -#else
45732 -       setbits32(bcsr_io,BCSR1_RS232EN_2);
45733 -       out_be16(&cp->cp_smc[1].smc_smcmr, 0);
45734 -       out_8(&cp->cp_smc[1].smc_smce, 0);
45735 -#endif
45736 -       immr_unmap(cp);
45737 -       iounmap(bcsr_io);
45738 -}
45739 +struct cpm_pin {
45740 +       int port, pin, flags;
45741 +};
45742  
45743 +static struct cpm_pin mpc866ads_pins[] = {
45744 +       /* SMC1 */
45745 +       {CPM_PORTB, 24, CPM_PIN_INPUT}, /* RX */
45746 +       {CPM_PORTB, 25, CPM_PIN_INPUT | CPM_PIN_SECONDARY}, /* TX */
45747 +
45748 +       /* SMC2 */
45749 +       {CPM_PORTB, 21, CPM_PIN_INPUT}, /* RX */
45750 +       {CPM_PORTB, 20, CPM_PIN_INPUT | CPM_PIN_SECONDARY}, /* TX */
45751 +
45752 +       /* SCC1 */
45753 +       {CPM_PORTA, 6, CPM_PIN_INPUT}, /* CLK1 */
45754 +       {CPM_PORTA, 7, CPM_PIN_INPUT}, /* CLK2 */
45755 +       {CPM_PORTA, 14, CPM_PIN_INPUT}, /* TX */
45756 +       {CPM_PORTA, 15, CPM_PIN_INPUT}, /* RX */
45757 +       {CPM_PORTB, 19, CPM_PIN_INPUT | CPM_PIN_SECONDARY}, /* TENA */
45758 +       {CPM_PORTC, 10, CPM_PIN_INPUT | CPM_PIN_SECONDARY | CPM_PIN_GPIO}, /* RENA */
45759 +       {CPM_PORTC, 11, CPM_PIN_INPUT | CPM_PIN_SECONDARY | CPM_PIN_GPIO}, /* CLSN */
45760 +
45761 +       /* MII */
45762 +       {CPM_PORTD, 3, CPM_PIN_OUTPUT},
45763 +       {CPM_PORTD, 4, CPM_PIN_OUTPUT},
45764 +       {CPM_PORTD, 5, CPM_PIN_OUTPUT},
45765 +       {CPM_PORTD, 6, CPM_PIN_OUTPUT},
45766 +       {CPM_PORTD, 7, CPM_PIN_OUTPUT},
45767 +       {CPM_PORTD, 8, CPM_PIN_OUTPUT},
45768 +       {CPM_PORTD, 9, CPM_PIN_OUTPUT},
45769 +       {CPM_PORTD, 10, CPM_PIN_OUTPUT},
45770 +       {CPM_PORTD, 11, CPM_PIN_OUTPUT},
45771 +       {CPM_PORTD, 12, CPM_PIN_OUTPUT},
45772 +       {CPM_PORTD, 13, CPM_PIN_OUTPUT},
45773 +       {CPM_PORTD, 14, CPM_PIN_OUTPUT},
45774 +       {CPM_PORTD, 15, CPM_PIN_OUTPUT},
45775 +};
45776  
45777 -static void init_fec1_ioports(struct fs_platform_info* ptr)
45778 +static void __init init_ioports(void)
45779  {
45780 -       iop8xx_t *io_port = (iop8xx_t *)immr_map(im_ioport);
45781 +       int i;
45782  
45783 -       /* configure FEC1 pins  */
45784 +       for (i = 0; i < ARRAY_SIZE(mpc866ads_pins); i++) {
45785 +               struct cpm_pin *pin = &mpc866ads_pins[i];
45786 +               cpm1_set_pin(pin->port, pin->pin, pin->flags);
45787 +       }
45788  
45789 -       setbits16(&io_port->iop_pdpar, 0x1fff);
45790 -       setbits16(&io_port->iop_pddir, 0x1fff);
45791 +       cpm1_clk_setup(CPM_CLK_SMC1, CPM_BRG1, CPM_CLK_RTX);
45792 +       cpm1_clk_setup(CPM_CLK_SMC2, CPM_BRG2, CPM_CLK_RTX);
45793 +       cpm1_clk_setup(CPM_CLK_SCC1, CPM_CLK1, CPM_CLK_TX);
45794 +       cpm1_clk_setup(CPM_CLK_SCC1, CPM_CLK2, CPM_CLK_RX);
45795  
45796 -       immr_unmap(io_port);
45797 +       /* Set FEC1 and FEC2 to MII mode */
45798 +       clrbits32(&mpc8xx_immr->im_cpm.cp_cptr, 0x00000180);
45799  }
45800  
45801 -void init_fec_ioports(struct fs_platform_info *fpi)
45802 +static void __init mpc86xads_setup_arch(void)
45803  {
45804 -       int fec_no = fs_get_fec_index(fpi->fs_no);
45805 +       struct device_node *np;
45806 +       u32 __iomem *bcsr_io;
45807 +
45808 +       cpm_reset();
45809 +       init_ioports();
45810  
45811 -       switch (fec_no) {
45812 -       case 0:
45813 -               init_fec1_ioports(fpi);
45814 -               break;
45815 -       default:
45816 -               printk(KERN_ERR "init_fec_ioports: invalid FEC number\n");
45817 +       np = of_find_compatible_node(NULL, NULL, "fsl,mpc866ads-bcsr");
45818 +       if (!np) {
45819 +               printk(KERN_CRIT "Could not find fsl,mpc866ads-bcsr node\n");
45820                 return;
45821         }
45822 -}
45823  
45824 -static void init_scc1_ioports(struct fs_platform_info* fpi)
45825 -{
45826 -       unsigned *bcsr_io;
45827 -       iop8xx_t *io_port;
45828 -       cpm8xx_t *cp;
45829 -
45830 -       bcsr_io = ioremap(BCSR_ADDR, BCSR_SIZE);
45831 -       io_port = (iop8xx_t *)immr_map(im_ioport);
45832 -       cp = (cpm8xx_t *)immr_map(im_cpm);
45833 +       bcsr_io = of_iomap(np, 0);
45834 +       of_node_put(np);
45835  
45836         if (bcsr_io == NULL) {
45837                 printk(KERN_CRIT "Could not remap BCSR\n");
45838                 return;
45839         }
45840  
45841 -       /* Configure port A pins for Txd and Rxd.
45842 -        */
45843 -       setbits16(&io_port->iop_papar, PA_ENET_RXD | PA_ENET_TXD);
45844 -       clrbits16(&io_port->iop_padir, PA_ENET_RXD | PA_ENET_TXD);
45845 -       clrbits16(&io_port->iop_paodr, PA_ENET_TXD);
45846 -
45847 -       /* Configure port C pins to enable CLSN and RENA.
45848 -        */
45849 -       clrbits16(&io_port->iop_pcpar, PC_ENET_CLSN | PC_ENET_RENA);
45850 -       clrbits16(&io_port->iop_pcdir, PC_ENET_CLSN | PC_ENET_RENA);
45851 -       setbits16(&io_port->iop_pcso, PC_ENET_CLSN | PC_ENET_RENA);
45852 -
45853 -       /* Configure port A for TCLK and RCLK.
45854 -        */
45855 -       setbits16(&io_port->iop_papar, PA_ENET_TCLK | PA_ENET_RCLK);
45856 -        clrbits16(&io_port->iop_padir, PA_ENET_TCLK | PA_ENET_RCLK);
45857 -        clrbits32(&cp->cp_pbpar, PB_ENET_TENA);
45858 -        clrbits32(&cp->cp_pbdir, PB_ENET_TENA);
45859 -
45860 -       /* Configure Serial Interface clock routing.
45861 -        * First, clear all SCC bits to zero, then set the ones we want.
45862 -        */
45863 -       clrbits32(&cp->cp_sicr, SICR_ENET_MASK);
45864 -       setbits32(&cp->cp_sicr, SICR_ENET_CLKRT);
45865 -
45866 -       /* In the original SCC enet driver the following code is placed at
45867 -          the end of the initialization */
45868 -        setbits32(&cp->cp_pbpar, PB_ENET_TENA);
45869 -        setbits32(&cp->cp_pbdir, PB_ENET_TENA);
45870 -
45871 -       clrbits32(bcsr_io+1, BCSR1_ETHEN);
45872 +       clrbits32(bcsr_io, BCSR1_RS232EN_1 | BCSR1_RS232EN_2 | BCSR1_ETHEN);
45873         iounmap(bcsr_io);
45874 -       immr_unmap(cp);
45875 -       immr_unmap(io_port);
45876 -}
45877 -
45878 -void init_scc_ioports(struct fs_platform_info *fpi)
45879 -{
45880 -       int scc_no = fs_get_scc_index(fpi->fs_no);
45881 -
45882 -       switch (scc_no) {
45883 -       case 0:
45884 -               init_scc1_ioports(fpi);
45885 -               break;
45886 -       default:
45887 -               printk(KERN_ERR "init_scc_ioports: invalid SCC number\n");
45888 -               return;
45889 -       }
45890  }
45891  
45892 -
45893 -
45894 -static void init_smc1_uart_ioports(struct fs_uart_platform_info* ptr)
45895 +static int __init mpc86xads_probe(void)
45896  {
45897 -        unsigned *bcsr_io;
45898 -       cpm8xx_t *cp = (cpm8xx_t *)immr_map(im_cpm);
45899 -
45900 -       setbits32(&cp->cp_pbpar, 0x000000c0);
45901 -       clrbits32(&cp->cp_pbdir, 0x000000c0);
45902 -       clrbits16(&cp->cp_pbodr, 0x00c0);
45903 -       immr_unmap(cp);
45904 -
45905 -        bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
45906 -
45907 -        if (bcsr_io == NULL) {
45908 -                printk(KERN_CRIT "Could not remap BCSR1\n");
45909 -                return;
45910 -        }
45911 -        clrbits32(bcsr_io,BCSR1_RS232EN_1);
45912 -        iounmap(bcsr_io);
45913 +       unsigned long root = of_get_flat_dt_root();
45914 +       return of_flat_dt_is_compatible(root, "fsl,mpc866ads");
45915  }
45916  
45917 -static void init_smc2_uart_ioports(struct fs_uart_platform_info* fpi)
45918 -{
45919 -        unsigned *bcsr_io;
45920 -       cpm8xx_t *cp = (cpm8xx_t *)immr_map(im_cpm);
45921 -
45922 -       setbits32(&cp->cp_pbpar, 0x00000c00);
45923 -       clrbits32(&cp->cp_pbdir, 0x00000c00);
45924 -       clrbits16(&cp->cp_pbodr, 0x0c00);
45925 -       immr_unmap(cp);
45926 -
45927 -        bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
45928 -
45929 -        if (bcsr_io == NULL) {
45930 -                printk(KERN_CRIT "Could not remap BCSR1\n");
45931 -                return;
45932 -        }
45933 -        clrbits32(bcsr_io,BCSR1_RS232EN_2);
45934 -        iounmap(bcsr_io);
45935 -}
45936 +static struct of_device_id __initdata of_bus_ids[] = {
45937 +       { .name = "soc", },
45938 +       { .name = "cpm", },
45939 +       { .name = "localbus", },
45940 +       {},
45941 +};
45942  
45943 -void init_smc_ioports(struct fs_uart_platform_info *data)
45944 +static int __init declare_of_platform_devices(void)
45945  {
45946 -       int smc_no = fs_uart_id_fsid2smc(data->fs_no);
45947 -
45948 -       switch (smc_no) {
45949 -       case 0:
45950 -               init_smc1_uart_ioports(data);
45951 -               data->brg = data->clk_rx;
45952 -               break;
45953 -       case 1:
45954 -               init_smc2_uart_ioports(data);
45955 -               data->brg = data->clk_rx;
45956 -               break;
45957 -       default:
45958 -               printk(KERN_ERR "init_scc_ioports: invalid SCC number\n");
45959 -               return;
45960 -       }
45961 -}
45962 +       of_platform_bus_probe(NULL, of_bus_ids, NULL);
45963  
45964 -int platform_device_skip(const char *model, int id)
45965 -{
45966         return 0;
45967  }
45968 -
45969 -static void __init mpc86xads_setup_arch(void)
45970 -{
45971 -       cpm_reset();
45972 -
45973 -       mpc86xads_board_setup();
45974 -
45975 -       ROOT_DEV = Root_NFS;
45976 -}
45977 -
45978 -static int __init mpc86xads_probe(void)
45979 -{
45980 -       char *model = of_get_flat_dt_prop(of_get_flat_dt_root(),
45981 -                                         "model", NULL);
45982 -       if (model == NULL)
45983 -               return 0;
45984 -       if (strcmp(model, "MPC866ADS"))
45985 -               return 0;
45986 -
45987 -       return 1;
45988 -}
45989 +machine_device_initcall(mpc86x_ads, declare_of_platform_devices);
45990  
45991  define_machine(mpc86x_ads) {
45992         .name                   = "MPC86x ADS",
45993 @@ -275,4 +144,5 @@
45994         .calibrate_decr         = mpc8xx_calibrate_decr,
45995         .set_rtc_time           = mpc8xx_set_rtc_time,
45996         .get_rtc_time           = mpc8xx_get_rtc_time,
45997 +       .progress               = udbg_progress,
45998  };
45999 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/8xx/mpc885ads_setup.c powerpc.git/arch/powerpc/platforms/8xx/mpc885ads_setup.c
46000 --- linux-2.6.24/arch/powerpc/platforms/8xx/mpc885ads_setup.c   2008-01-24 23:58:37.000000000 +0100
46001 +++ powerpc.git/arch/powerpc/platforms/8xx/mpc885ads_setup.c    2008-01-28 20:25:49.000000000 +0100
46002 @@ -264,12 +264,11 @@
46003  static int __init declare_of_platform_devices(void)
46004  {
46005         /* Publish the QE devices */
46006 -       if (machine_is(mpc885_ads))
46007 -               of_platform_bus_probe(NULL, of_bus_ids, NULL);
46008 +       of_platform_bus_probe(NULL, of_bus_ids, NULL);
46009  
46010         return 0;
46011  }
46012 -device_initcall(declare_of_platform_devices);
46013 +machine_device_initcall(mpc885_ads, declare_of_platform_devices);
46014  
46015  define_machine(mpc885_ads) {
46016         .name                   = "Freescale MPC885 ADS",
46017 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/Kconfig powerpc.git/arch/powerpc/platforms/Kconfig
46018 --- linux-2.6.24/arch/powerpc/platforms/Kconfig 2008-01-24 23:58:37.000000000 +0100
46019 +++ powerpc.git/arch/powerpc/platforms/Kconfig  2008-01-28 20:25:49.000000000 +0100
46020 @@ -22,6 +22,7 @@
46021         depends on 6xx
46022         select FSL_SOC
46023         select 83xx
46024 +       select IPIC
46025         select WANT_DEVICE_TREE
46026  
46027  config PPC_86xx
46028 @@ -80,6 +81,10 @@
46029         bool
46030         default y
46031  
46032 +config IPIC
46033 +       bool
46034 +       default n
46035 +
46036  config MPIC
46037         bool
46038         default n
46039 @@ -265,6 +270,7 @@
46040  config QUICC_ENGINE
46041         bool
46042         select PPC_LIB_RHEAP
46043 +       select CRC32
46044         help
46045           The QUICC Engine (QE) is a new generation of communications
46046           coprocessors on Freescale embedded CPUs (akin to CPM in older chips).
46047 @@ -315,6 +321,12 @@
46048  config CPM
46049         bool
46050  
46051 +config OF_RTC
46052 +       bool
46053 +       help
46054 +         Uses information from the OF or flattened device tree to instatiate
46055 +         platform devices for direct mapped RTC chips like the DS1742 or DS1743.
46056 +
46057  source "arch/powerpc/sysdev/bestcomm/Kconfig"
46058  
46059  endmenu
46060 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/Kconfig.cputype powerpc.git/arch/powerpc/platforms/Kconfig.cputype
46061 --- linux-2.6.24/arch/powerpc/platforms/Kconfig.cputype 2008-01-24 23:58:37.000000000 +0100
46062 +++ powerpc.git/arch/powerpc/platforms/Kconfig.cputype  2008-01-28 20:25:49.000000000 +0100
46063 @@ -43,6 +43,7 @@
46064         bool "AMCC 40x"
46065         select PPC_DCR_NATIVE
46066         select WANT_DEVICE_TREE
46067 +       select PPC_UDBG_16550
46068  
46069  config 44x
46070         bool "AMCC 44x"
46071 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/cell/Makefile powerpc.git/arch/powerpc/platforms/cell/Makefile
46072 --- linux-2.6.24/arch/powerpc/platforms/cell/Makefile   2008-01-24 23:58:37.000000000 +0100
46073 +++ powerpc.git/arch/powerpc/platforms/cell/Makefile    2008-01-28 20:25:49.000000000 +0100
46074 @@ -20,7 +20,7 @@
46075  
46076  obj-$(CONFIG_SPU_BASE)                 += spu_callbacks.o spu_base.o \
46077                                            spu_notify.o \
46078 -                                          spu_syscalls.o \
46079 +                                          spu_syscalls.o spu_fault.o \
46080                                            $(spu-priv1-y) \
46081                                            $(spu-manage-y) \
46082                                            spufs/
46083 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/cell/cbe_cpufreq.c powerpc.git/arch/powerpc/platforms/cell/cbe_cpufreq.c
46084 --- linux-2.6.24/arch/powerpc/platforms/cell/cbe_cpufreq.c      2008-01-24 23:58:37.000000000 +0100
46085 +++ powerpc.git/arch/powerpc/platforms/cell/cbe_cpufreq.c       2008-01-28 20:25:49.000000000 +0100
46086 @@ -21,8 +21,9 @@
46087   */
46088  
46089  #include <linux/cpufreq.h>
46090 +#include <linux/of_platform.h>
46091 +
46092  #include <asm/machdep.h>
46093 -#include <asm/of_platform.h>
46094  #include <asm/prom.h>
46095  #include <asm/cell-regs.h>
46096  #include "cbe_cpufreq.h"
46097 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/cell/cbe_cpufreq_pmi.c powerpc.git/arch/powerpc/platforms/cell/cbe_cpufreq_pmi.c
46098 --- linux-2.6.24/arch/powerpc/platforms/cell/cbe_cpufreq_pmi.c  2008-01-24 23:58:37.000000000 +0100
46099 +++ powerpc.git/arch/powerpc/platforms/cell/cbe_cpufreq_pmi.c   2008-01-28 20:25:49.000000000 +0100
46100 @@ -23,7 +23,8 @@
46101  #include <linux/kernel.h>
46102  #include <linux/types.h>
46103  #include <linux/timer.h>
46104 -#include <asm/of_platform.h>
46105 +#include <linux/of_platform.h>
46106 +
46107  #include <asm/processor.h>
46108  #include <asm/prom.h>
46109  #include <asm/pmi.h>
46110 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/cell/cbe_regs.c powerpc.git/arch/powerpc/platforms/cell/cbe_regs.c
46111 --- linux-2.6.24/arch/powerpc/platforms/cell/cbe_regs.c 2008-01-24 23:58:37.000000000 +0100
46112 +++ powerpc.git/arch/powerpc/platforms/cell/cbe_regs.c  2008-01-28 20:25:49.000000000 +0100
46113 @@ -9,13 +9,13 @@
46114  #include <linux/percpu.h>
46115  #include <linux/types.h>
46116  #include <linux/module.h>
46117 +#include <linux/of_device.h>
46118 +#include <linux/of_platform.h>
46119  
46120  #include <asm/io.h>
46121  #include <asm/pgtable.h>
46122  #include <asm/prom.h>
46123  #include <asm/ptrace.h>
46124 -#include <asm/of_device.h>
46125 -#include <asm/of_platform.h>
46126  #include <asm/cell-regs.h>
46127  
46128  /*
46129 @@ -256,6 +256,7 @@
46130                         printk(KERN_ERR "cbe_regs: More BE chips than supported"
46131                                "!\n");
46132                         cbe_regs_map_count--;
46133 +                       of_node_put(cpu);
46134                         return;
46135                 }
46136                 map->cpu_node = cpu;
46137 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/cell/io-workarounds.c powerpc.git/arch/powerpc/platforms/cell/io-workarounds.c
46138 --- linux-2.6.24/arch/powerpc/platforms/cell/io-workarounds.c   2008-01-24 23:58:37.000000000 +0100
46139 +++ powerpc.git/arch/powerpc/platforms/cell/io-workarounds.c    2008-01-28 20:25:49.000000000 +0100
46140 @@ -238,7 +238,7 @@
46141  static void __init spider_pci_add_one(struct pci_controller *phb)
46142  {
46143         struct spider_pci_bus *bus = &spider_pci_busses[spider_pci_count];
46144 -       struct device_node *np = phb->arch_data;
46145 +       struct device_node *np = phb->dn;
46146         struct resource rsrc;
46147         void __iomem *regs;
46148  
46149 @@ -309,15 +309,12 @@
46150  {
46151         struct pci_controller *phb;
46152  
46153 -       if (!machine_is(cell))
46154 -               return 0;
46155 -
46156         /* Find spider bridges. We assume they have been all probed
46157          * in setup_arch(). If that was to change, we would need to
46158          * update this code to cope with dynamically added busses
46159          */
46160         list_for_each_entry(phb, &hose_list, list_node) {
46161 -               struct device_node *np = phb->arch_data;
46162 +               struct device_node *np = phb->dn;
46163                 const char *model = of_get_property(np, "model", NULL);
46164  
46165                 /* If no model property or name isn't exactly "pci", skip */
46166 @@ -343,4 +340,4 @@
46167  
46168         return 0;
46169  }
46170 -arch_initcall(spider_pci_workaround_init);
46171 +machine_arch_initcall(cell, spider_pci_workaround_init);
46172 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/cell/iommu.c powerpc.git/arch/powerpc/platforms/cell/iommu.c
46173 --- linux-2.6.24/arch/powerpc/platforms/cell/iommu.c    2008-01-24 23:58:37.000000000 +0100
46174 +++ powerpc.git/arch/powerpc/platforms/cell/iommu.c     2008-01-28 20:25:49.000000000 +0100
46175 @@ -26,14 +26,15 @@
46176  #include <linux/init.h>
46177  #include <linux/interrupt.h>
46178  #include <linux/notifier.h>
46179 +#include <linux/of_platform.h>
46180  
46181  #include <asm/prom.h>
46182  #include <asm/iommu.h>
46183  #include <asm/machdep.h>
46184  #include <asm/pci-bridge.h>
46185  #include <asm/udbg.h>
46186 -#include <asm/of_platform.h>
46187  #include <asm/lmb.h>
46188 +#include <asm/firmware.h>
46189  #include <asm/cell-regs.h>
46190  
46191  #include "interrupt.h"
46192 @@ -309,8 +310,8 @@
46193  {
46194         struct page *page;
46195         int ret, i;
46196 -       unsigned long reg, segments, pages_per_segment, ptab_size, n_pte_pages;
46197 -       unsigned long xlate_base;
46198 +       unsigned long reg, segments, pages_per_segment, ptab_size, stab_size,
46199 +                     n_pte_pages, xlate_base;
46200         unsigned int virq;
46201  
46202         if (cell_iommu_find_ioc(iommu->nid, &xlate_base))
46203 @@ -327,7 +328,8 @@
46204                         __FUNCTION__, iommu->nid, segments, pages_per_segment);
46205  
46206         /* set up the segment table */
46207 -       page = alloc_pages_node(iommu->nid, GFP_KERNEL, 0);
46208 +       stab_size = segments * sizeof(unsigned long);
46209 +       page = alloc_pages_node(iommu->nid, GFP_KERNEL, get_order(stab_size));
46210         BUG_ON(!page);
46211         iommu->stab = page_address(page);
46212         clear_page(iommu->stab);
46213 @@ -489,15 +491,18 @@
46214         return NULL;
46215  }
46216  
46217 +static unsigned long cell_dma_direct_offset;
46218 +
46219  static void cell_dma_dev_setup(struct device *dev)
46220  {
46221         struct iommu_window *window;
46222         struct cbe_iommu *iommu;
46223         struct dev_archdata *archdata = &dev->archdata;
46224  
46225 -       /* If we run without iommu, no need to do anything */
46226 -       if (get_pci_dma_ops() == &dma_direct_ops)
46227 +       if (get_pci_dma_ops() == &dma_direct_ops) {
46228 +               archdata->dma_data = (void *)cell_dma_direct_offset;
46229                 return;
46230 +       }
46231  
46232         /* Current implementation uses the first window available in that
46233          * node's iommu. We -might- do something smarter later though it may
46234 @@ -653,7 +658,7 @@
46235  
46236         /* If we have no Axon, we set up the spider DMA magic offset */
46237         if (of_find_node_by_name(NULL, "axon") == NULL)
46238 -               dma_direct_offset = SPIDER_DMA_OFFSET;
46239 +               cell_dma_direct_offset = SPIDER_DMA_OFFSET;
46240  
46241         /* Now we need to check to see where the memory is mapped
46242          * in PCI space. We assume that all busses use the same dma
46243 @@ -687,10 +692,13 @@
46244                 return -ENODEV;
46245         }
46246  
46247 -       dma_direct_offset += base;
46248 +       cell_dma_direct_offset += base;
46249 +
46250 +       if (cell_dma_direct_offset != 0)
46251 +               ppc_md.pci_dma_dev_setup = cell_pci_dma_dev_setup;
46252  
46253         printk("iommu: disabled, direct DMA offset is 0x%lx\n",
46254 -              dma_direct_offset);
46255 +              cell_dma_direct_offset);
46256  
46257         return 0;
46258  }
46259 @@ -699,9 +707,6 @@
46260  {
46261         struct device_node *np;
46262  
46263 -       if (!machine_is(cell))
46264 -               return -ENODEV;
46265 -
46266         /* If IOMMU is disabled or we have little enough RAM to not need
46267          * to enable it, we setup a direct mapping.
46268          *
46269 @@ -744,5 +749,6 @@
46270  
46271         return 0;
46272  }
46273 -arch_initcall(cell_iommu_init);
46274 +machine_arch_initcall(cell, cell_iommu_init);
46275 +machine_arch_initcall(celleb_native, cell_iommu_init);
46276  
46277 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/cell/pmu.c powerpc.git/arch/powerpc/platforms/cell/pmu.c
46278 --- linux-2.6.24/arch/powerpc/platforms/cell/pmu.c      2008-01-24 23:58:37.000000000 +0100
46279 +++ powerpc.git/arch/powerpc/platforms/cell/pmu.c       2008-01-28 20:25:49.000000000 +0100
46280 @@ -213,7 +213,7 @@
46281                 break;
46282  
46283         case pm_interval:
46284 -               READ_SHADOW_REG(val, pm_interval);
46285 +               READ_MMIO_UPPER32(val, pm_interval);
46286                 break;
46287  
46288         case pm_start_stop:
46289 @@ -381,9 +381,6 @@
46290         unsigned int irq;
46291         int rc, node;
46292  
46293 -       if (!machine_is(cell))
46294 -               return 0;
46295 -
46296         for_each_node(node) {
46297                 irq = irq_create_mapping(NULL, IIC_IRQ_IOEX_PMI |
46298                                                (node << IIC_IRQ_NODE_SHIFT));
46299 @@ -404,7 +401,7 @@
46300  
46301         return 0;
46302  }
46303 -arch_initcall(cbe_init_pm_irq);
46304 +machine_arch_initcall(cell, cbe_init_pm_irq);
46305  
46306  void cbe_sync_irq(int node)
46307  {
46308 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/cell/setup.c powerpc.git/arch/powerpc/platforms/cell/setup.c
46309 --- linux-2.6.24/arch/powerpc/platforms/cell/setup.c    2008-01-24 23:58:37.000000000 +0100
46310 +++ powerpc.git/arch/powerpc/platforms/cell/setup.c     2008-01-28 20:25:49.000000000 +0100
46311 @@ -30,6 +30,7 @@
46312  #include <linux/console.h>
46313  #include <linux/mutex.h>
46314  #include <linux/memory_hotplug.h>
46315 +#include <linux/of_platform.h>
46316  
46317  #include <asm/mmu.h>
46318  #include <asm/processor.h>
46319 @@ -51,7 +52,6 @@
46320  #include <asm/spu_priv1.h>
46321  #include <asm/udbg.h>
46322  #include <asm/mpic.h>
46323 -#include <asm/of_platform.h>
46324  #include <asm/cell-regs.h>
46325  
46326  #include "interrupt.h"
46327 @@ -85,9 +85,6 @@
46328  {
46329         int node;
46330  
46331 -       if (!machine_is(cell))
46332 -               return 0;
46333 -
46334         /* Publish OF platform devices for southbridge IOs */
46335         of_platform_bus_probe(NULL, NULL, NULL);
46336  
46337 @@ -101,7 +98,7 @@
46338         }
46339         return 0;
46340  }
46341 -device_initcall(cell_publish_devices);
46342 +machine_device_initcall(cell, cell_publish_devices);
46343  
46344  static void cell_mpic_cascade(unsigned int irq, struct irq_desc *desc)
46345  {
46346 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/cell/smp.c powerpc.git/arch/powerpc/platforms/cell/smp.c
46347 --- linux-2.6.24/arch/powerpc/platforms/cell/smp.c      2008-01-24 23:58:37.000000000 +0100
46348 +++ powerpc.git/arch/powerpc/platforms/cell/smp.c       2008-01-28 20:25:49.000000000 +0100
46349 @@ -42,6 +42,7 @@
46350  #include <asm/firmware.h>
46351  #include <asm/system.h>
46352  #include <asm/rtas.h>
46353 +#include <asm/cputhreads.h>
46354  
46355  #include "interrupt.h"
46356  #include <asm/udbg.h>
46357 @@ -182,7 +183,7 @@
46358          */
46359         if (system_state < SYSTEM_RUNNING &&
46360             cpu_has_feature(CPU_FTR_SMT) &&
46361 -           !smt_enabled_at_boot && nr % 2 != 0)
46362 +           !smt_enabled_at_boot && cpu_thread_in_core(nr) != 0)
46363                 return 0;
46364  
46365         return 1;
46366 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/cell/spu_base.c powerpc.git/arch/powerpc/platforms/cell/spu_base.c
46367 --- linux-2.6.24/arch/powerpc/platforms/cell/spu_base.c 2008-01-24 23:58:37.000000000 +0100
46368 +++ powerpc.git/arch/powerpc/platforms/cell/spu_base.c  2008-01-28 20:25:49.000000000 +0100
46369 @@ -34,6 +34,7 @@
46370  #include <linux/linux_logo.h>
46371  #include <asm/spu.h>
46372  #include <asm/spu_priv1.h>
46373 +#include <asm/spu_csa.h>
46374  #include <asm/xmon.h>
46375  #include <asm/prom.h>
46376  
46377 @@ -47,6 +48,13 @@
46378  EXPORT_SYMBOL_GPL(cbe_spu_info);
46379  
46380  /*
46381 + * The spufs fault-handling code needs to call force_sig_info to raise signals
46382 + * on DMA errors. Export it here to avoid general kernel-wide access to this
46383 + * function
46384 + */
46385 +EXPORT_SYMBOL_GPL(force_sig_info);
46386 +
46387 +/*
46388   * Protects cbe_spu_info and spu->number.
46389   */
46390  static DEFINE_SPINLOCK(spu_lock);
46391 @@ -66,6 +74,10 @@
46392  static DEFINE_SPINLOCK(spu_full_list_lock);
46393  static DEFINE_MUTEX(spu_full_list_mutex);
46394  
46395 +struct spu_slb {
46396 +       u64 esid, vsid;
46397 +};
46398 +
46399  void spu_invalidate_slbs(struct spu *spu)
46400  {
46401         struct spu_priv2 __iomem *priv2 = spu->priv2;
46402 @@ -114,40 +126,36 @@
46403  }
46404  EXPORT_SYMBOL_GPL(spu_associate_mm);
46405  
46406 -static int __spu_trap_invalid_dma(struct spu *spu)
46407 +int spu_64k_pages_available(void)
46408  {
46409 -       pr_debug("%s\n", __FUNCTION__);
46410 -       spu->dma_callback(spu, SPE_EVENT_INVALID_DMA);
46411 -       return 0;
46412 +       return mmu_psize_defs[MMU_PAGE_64K].shift != 0;
46413  }
46414 +EXPORT_SYMBOL_GPL(spu_64k_pages_available);
46415  
46416 -static int __spu_trap_dma_align(struct spu *spu)
46417 +static void spu_restart_dma(struct spu *spu)
46418  {
46419 -       pr_debug("%s\n", __FUNCTION__);
46420 -       spu->dma_callback(spu, SPE_EVENT_DMA_ALIGNMENT);
46421 -       return 0;
46422 -}
46423 +       struct spu_priv2 __iomem *priv2 = spu->priv2;
46424  
46425 -static int __spu_trap_error(struct spu *spu)
46426 -{
46427 -       pr_debug("%s\n", __FUNCTION__);
46428 -       spu->dma_callback(spu, SPE_EVENT_SPE_ERROR);
46429 -       return 0;
46430 +       if (!test_bit(SPU_CONTEXT_SWITCH_PENDING, &spu->flags))
46431 +               out_be64(&priv2->mfc_control_RW, MFC_CNTL_RESTART_DMA_COMMAND);
46432  }
46433  
46434 -static void spu_restart_dma(struct spu *spu)
46435 +static inline void spu_load_slb(struct spu *spu, int slbe, struct spu_slb *slb)
46436  {
46437         struct spu_priv2 __iomem *priv2 = spu->priv2;
46438  
46439 -       if (!test_bit(SPU_CONTEXT_SWITCH_PENDING, &spu->flags))
46440 -               out_be64(&priv2->mfc_control_RW, MFC_CNTL_RESTART_DMA_COMMAND);
46441 +       pr_debug("%s: adding SLB[%d] 0x%016lx 0x%016lx\n",
46442 +                       __func__, slbe, slb->vsid, slb->esid);
46443 +
46444 +       out_be64(&priv2->slb_index_W, slbe);
46445 +       out_be64(&priv2->slb_vsid_RW, slb->vsid);
46446 +       out_be64(&priv2->slb_esid_RW, slb->esid);
46447  }
46448  
46449  static int __spu_trap_data_seg(struct spu *spu, unsigned long ea)
46450  {
46451 -       struct spu_priv2 __iomem *priv2 = spu->priv2;
46452         struct mm_struct *mm = spu->mm;
46453 -       u64 esid, vsid, llp;
46454 +       struct spu_slb slb;
46455         int psize;
46456  
46457         pr_debug("%s\n", __FUNCTION__);
46458 @@ -159,7 +167,7 @@
46459                 printk("%s: invalid access during switch!\n", __func__);
46460                 return 1;
46461         }
46462 -       esid = (ea & ESID_MASK) | SLB_ESID_V;
46463 +       slb.esid = (ea & ESID_MASK) | SLB_ESID_V;
46464  
46465         switch(REGION_ID(ea)) {
46466         case USER_REGION_ID:
46467 @@ -168,21 +176,21 @@
46468  #else
46469                 psize = mm->context.user_psize;
46470  #endif
46471 -               vsid = (get_vsid(mm->context.id, ea, MMU_SEGSIZE_256M) << SLB_VSID_SHIFT) |
46472 -                               SLB_VSID_USER;
46473 +               slb.vsid = (get_vsid(mm->context.id, ea, MMU_SEGSIZE_256M)
46474 +                               << SLB_VSID_SHIFT) | SLB_VSID_USER;
46475                 break;
46476         case VMALLOC_REGION_ID:
46477                 if (ea < VMALLOC_END)
46478                         psize = mmu_vmalloc_psize;
46479                 else
46480                         psize = mmu_io_psize;
46481 -               vsid = (get_kernel_vsid(ea, MMU_SEGSIZE_256M) << SLB_VSID_SHIFT) |
46482 -                       SLB_VSID_KERNEL;
46483 +               slb.vsid = (get_kernel_vsid(ea, MMU_SEGSIZE_256M)
46484 +                               << SLB_VSID_SHIFT) | SLB_VSID_KERNEL;
46485                 break;
46486         case KERNEL_REGION_ID:
46487                 psize = mmu_linear_psize;
46488 -               vsid = (get_kernel_vsid(ea, MMU_SEGSIZE_256M) << SLB_VSID_SHIFT) |
46489 -                       SLB_VSID_KERNEL;
46490 +               slb.vsid = (get_kernel_vsid(ea, MMU_SEGSIZE_256M)
46491 +                               << SLB_VSID_SHIFT) | SLB_VSID_KERNEL;
46492                 break;
46493         default:
46494                 /* Future: support kernel segments so that drivers
46495 @@ -191,11 +199,9 @@
46496                 pr_debug("invalid region access at %016lx\n", ea);
46497                 return 1;
46498         }
46499 -       llp = mmu_psize_defs[psize].sllp;
46500 +       slb.vsid |= mmu_psize_defs[psize].sllp;
46501  
46502 -       out_be64(&priv2->slb_index_W, spu->slb_replace);
46503 -       out_be64(&priv2->slb_vsid_RW, vsid | llp);
46504 -       out_be64(&priv2->slb_esid_RW, esid);
46505 +       spu_load_slb(spu, spu->slb_replace, &slb);
46506  
46507         spu->slb_replace++;
46508         if (spu->slb_replace >= 8)
46509 @@ -225,13 +231,83 @@
46510                 return 1;
46511         }
46512  
46513 +       spu->class_0_pending = 0;
46514         spu->dar = ea;
46515         spu->dsisr = dsisr;
46516 -       mb();
46517 +
46518         spu->stop_callback(spu);
46519 +
46520         return 0;
46521  }
46522  
46523 +static void __spu_kernel_slb(void *addr, struct spu_slb *slb)
46524 +{
46525 +       unsigned long ea = (unsigned long)addr;
46526 +       u64 llp;
46527 +
46528 +       if (REGION_ID(ea) == KERNEL_REGION_ID)
46529 +               llp = mmu_psize_defs[mmu_linear_psize].sllp;
46530 +       else
46531 +               llp = mmu_psize_defs[mmu_virtual_psize].sllp;
46532 +
46533 +       slb->vsid = (get_kernel_vsid(ea, MMU_SEGSIZE_256M) << SLB_VSID_SHIFT) |
46534 +               SLB_VSID_KERNEL | llp;
46535 +       slb->esid = (ea & ESID_MASK) | SLB_ESID_V;
46536 +}
46537 +
46538 +/**
46539 + * Given an array of @nr_slbs SLB entries, @slbs, return non-zero if the
46540 + * address @new_addr is present.
46541 + */
46542 +static inline int __slb_present(struct spu_slb *slbs, int nr_slbs,
46543 +               void *new_addr)
46544 +{
46545 +       unsigned long ea = (unsigned long)new_addr;
46546 +       int i;
46547 +
46548 +       for (i = 0; i < nr_slbs; i++)
46549 +               if (!((slbs[i].esid ^ ea) & ESID_MASK))
46550 +                       return 1;
46551 +
46552 +       return 0;
46553 +}
46554 +
46555 +/**
46556 + * Setup the SPU kernel SLBs, in preparation for a context save/restore. We
46557 + * need to map both the context save area, and the save/restore code.
46558 + *
46559 + * Because the lscsa and code may cross segment boundaires, we check to see
46560 + * if mappings are required for the start and end of each range. We currently
46561 + * assume that the mappings are smaller that one segment - if not, something
46562 + * is seriously wrong.
46563 + */
46564 +void spu_setup_kernel_slbs(struct spu *spu, struct spu_lscsa *lscsa,
46565 +               void *code, int code_size)
46566 +{
46567 +       struct spu_slb slbs[4];
46568 +       int i, nr_slbs = 0;
46569 +       /* start and end addresses of both mappings */
46570 +       void *addrs[] = {
46571 +               lscsa, (void *)lscsa + sizeof(*lscsa) - 1,
46572 +               code, code + code_size - 1
46573 +       };
46574 +
46575 +       /* check the set of addresses, and create a new entry in the slbs array
46576 +        * if there isn't already a SLB for that address */
46577 +       for (i = 0; i < ARRAY_SIZE(addrs); i++) {
46578 +               if (__slb_present(slbs, nr_slbs, addrs[i]))
46579 +                       continue;
46580 +
46581 +               __spu_kernel_slb(addrs[i], &slbs[nr_slbs]);
46582 +               nr_slbs++;
46583 +       }
46584 +
46585 +       /* Add the set of SLBs */
46586 +       for (i = 0; i < nr_slbs; i++)
46587 +               spu_load_slb(spu, i, &slbs[i]);
46588 +}
46589 +EXPORT_SYMBOL_GPL(spu_setup_kernel_slbs);
46590 +
46591  static irqreturn_t
46592  spu_irq_class_0(int irq, void *data)
46593  {
46594 @@ -240,12 +316,13 @@
46595  
46596         spu = data;
46597  
46598 +       spin_lock(&spu->register_lock);
46599         mask = spu_int_mask_get(spu, 0);
46600 -       stat = spu_int_stat_get(spu, 0);
46601 -       stat &= mask;
46602 +       stat = spu_int_stat_get(spu, 0) & mask;
46603  
46604 -       spin_lock(&spu->register_lock);
46605         spu->class_0_pending |= stat;
46606 +       spu->dsisr = spu_mfc_dsisr_get(spu);
46607 +       spu->dar = spu_mfc_dar_get(spu);
46608         spin_unlock(&spu->register_lock);
46609  
46610         spu->stop_callback(spu);
46611 @@ -255,31 +332,6 @@
46612         return IRQ_HANDLED;
46613  }
46614  
46615 -int
46616 -spu_irq_class_0_bottom(struct spu *spu)
46617 -{
46618 -       unsigned long flags;
46619 -       unsigned long stat;
46620 -
46621 -       spin_lock_irqsave(&spu->register_lock, flags);
46622 -       stat = spu->class_0_pending;
46623 -       spu->class_0_pending = 0;
46624 -
46625 -       if (stat & 1) /* invalid DMA alignment */
46626 -               __spu_trap_dma_align(spu);
46627 -
46628 -       if (stat & 2) /* invalid MFC DMA */
46629 -               __spu_trap_invalid_dma(spu);
46630 -
46631 -       if (stat & 4) /* error on SPU */
46632 -               __spu_trap_error(spu);
46633 -
46634 -       spin_unlock_irqrestore(&spu->register_lock, flags);
46635 -
46636 -       return (stat & 0x7) ? -EIO : 0;
46637 -}
46638 -EXPORT_SYMBOL_GPL(spu_irq_class_0_bottom);
46639 -
46640  static irqreturn_t
46641  spu_irq_class_1(int irq, void *data)
46642  {
46643 @@ -294,24 +346,23 @@
46644         stat  = spu_int_stat_get(spu, 1) & mask;
46645         dar   = spu_mfc_dar_get(spu);
46646         dsisr = spu_mfc_dsisr_get(spu);
46647 -       if (stat & 2) /* mapping fault */
46648 +       if (stat & CLASS1_STORAGE_FAULT_INTR)
46649                 spu_mfc_dsisr_set(spu, 0ul);
46650         spu_int_stat_clear(spu, 1, stat);
46651         spin_unlock(&spu->register_lock);
46652         pr_debug("%s: %lx %lx %lx %lx\n", __FUNCTION__, mask, stat,
46653                         dar, dsisr);
46654  
46655 -       if (stat & 1) /* segment fault */
46656 +       if (stat & CLASS1_SEGMENT_FAULT_INTR)
46657                 __spu_trap_data_seg(spu, dar);
46658  
46659 -       if (stat & 2) { /* mapping fault */
46660 +       if (stat & CLASS1_STORAGE_FAULT_INTR)
46661                 __spu_trap_data_map(spu, dar, dsisr);
46662 -       }
46663  
46664 -       if (stat & 4) /* ls compare & suspend on get */
46665 +       if (stat & CLASS1_LS_COMPARE_SUSPEND_ON_GET_INTR)
46666                 ;
46667  
46668 -       if (stat & 8) /* ls compare & suspend on put */
46669 +       if (stat & CLASS1_LS_COMPARE_SUSPEND_ON_PUT_INTR)
46670                 ;
46671  
46672         return stat ? IRQ_HANDLED : IRQ_NONE;
46673 @@ -323,6 +374,8 @@
46674         struct spu *spu;
46675         unsigned long stat;
46676         unsigned long mask;
46677 +       const int mailbox_intrs =
46678 +               CLASS2_MAILBOX_THRESHOLD_INTR | CLASS2_MAILBOX_INTR;
46679  
46680         spu = data;
46681         spin_lock(&spu->register_lock);
46682 @@ -330,31 +383,30 @@
46683         mask = spu_int_mask_get(spu, 2);
46684         /* ignore interrupts we're not waiting for */
46685         stat &= mask;
46686 -       /*
46687 -        * mailbox interrupts (0x1 and 0x10) are level triggered.
46688 -        * mask them now before acknowledging.
46689 -        */
46690 -       if (stat & 0x11)
46691 -               spu_int_mask_and(spu, 2, ~(stat & 0x11));
46692 +
46693 +       /* mailbox interrupts are level triggered. mask them now before
46694 +        * acknowledging */
46695 +       if (stat & mailbox_intrs)
46696 +               spu_int_mask_and(spu, 2, ~(stat & mailbox_intrs));
46697         /* acknowledge all interrupts before the callbacks */
46698         spu_int_stat_clear(spu, 2, stat);
46699         spin_unlock(&spu->register_lock);
46700  
46701         pr_debug("class 2 interrupt %d, %lx, %lx\n", irq, stat, mask);
46702  
46703 -       if (stat & 1)  /* PPC core mailbox */
46704 +       if (stat & CLASS2_MAILBOX_INTR)
46705                 spu->ibox_callback(spu);
46706  
46707 -       if (stat & 2) /* SPU stop-and-signal */
46708 +       if (stat & CLASS2_SPU_STOP_INTR)
46709                 spu->stop_callback(spu);
46710  
46711 -       if (stat & 4) /* SPU halted */
46712 +       if (stat & CLASS2_SPU_HALT_INTR)
46713                 spu->stop_callback(spu);
46714  
46715 -       if (stat & 8) /* DMA tag group complete */
46716 +       if (stat & CLASS2_SPU_DMA_TAG_GROUP_COMPLETE_INTR)
46717                 spu->mfc_callback(spu);
46718  
46719 -       if (stat & 0x10) /* SPU mailbox threshold */
46720 +       if (stat & CLASS2_MAILBOX_THRESHOLD_INTR)
46721                 spu->wbox_callback(spu);
46722  
46723         spu->stats.class2_intr++;
46724 @@ -479,13 +531,27 @@
46725  int spu_add_sysdev_attr_group(struct attribute_group *attrs)
46726  {
46727         struct spu *spu;
46728 +       int rc = 0;
46729  
46730         mutex_lock(&spu_full_list_mutex);
46731 -       list_for_each_entry(spu, &spu_full_list, full_list)
46732 -               sysfs_create_group(&spu->sysdev.kobj, attrs);
46733 +       list_for_each_entry(spu, &spu_full_list, full_list) {
46734 +               rc = sysfs_create_group(&spu->sysdev.kobj, attrs);
46735 +
46736 +               /* we're in trouble here, but try unwinding anyway */
46737 +               if (rc) {
46738 +                       printk(KERN_ERR "%s: can't create sysfs group '%s'\n",
46739 +                                       __func__, attrs->name);
46740 +
46741 +                       list_for_each_entry_continue_reverse(spu,
46742 +                                       &spu_full_list, full_list)
46743 +                               sysfs_remove_group(&spu->sysdev.kobj, attrs);
46744 +                       break;
46745 +               }
46746 +       }
46747 +
46748         mutex_unlock(&spu_full_list_mutex);
46749  
46750 -       return 0;
46751 +       return rc;
46752  }
46753  EXPORT_SYMBOL_GPL(spu_add_sysdev_attr_group);
46754  
46755 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/cell/spu_fault.c powerpc.git/arch/powerpc/platforms/cell/spu_fault.c
46756 --- linux-2.6.24/arch/powerpc/platforms/cell/spu_fault.c        1970-01-01 01:00:00.000000000 +0100
46757 +++ powerpc.git/arch/powerpc/platforms/cell/spu_fault.c 2008-01-28 20:25:49.000000000 +0100
46758 @@ -0,0 +1,98 @@
46759 +/*
46760 + * SPU mm fault handler
46761 + *
46762 + * (C) Copyright IBM Deutschland Entwicklung GmbH 2007
46763 + *
46764 + * Author: Arnd Bergmann <arndb@de.ibm.com>
46765 + * Author: Jeremy Kerr <jk@ozlabs.org>
46766 + *
46767 + * This program is free software; you can redistribute it and/or modify
46768 + * it under the terms of the GNU General Public License as published by
46769 + * the Free Software Foundation; either version 2, or (at your option)
46770 + * any later version.
46771 + *
46772 + * This program is distributed in the hope that it will be useful,
46773 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
46774 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
46775 + * GNU General Public License for more details.
46776 + *
46777 + * You should have received a copy of the GNU General Public License
46778 + * along with this program; if not, write to the Free Software
46779 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
46780 + */
46781 +#include <linux/sched.h>
46782 +#include <linux/mm.h>
46783 +#include <linux/module.h>
46784 +
46785 +#include <asm/spu.h>
46786 +#include <asm/spu_csa.h>
46787 +
46788 +/*
46789 + * This ought to be kept in sync with the powerpc specific do_page_fault
46790 + * function. Currently, there are a few corner cases that we haven't had
46791 + * to handle fortunately.
46792 + */
46793 +int spu_handle_mm_fault(struct mm_struct *mm, unsigned long ea,
46794 +               unsigned long dsisr, unsigned *flt)
46795 +{
46796 +       struct vm_area_struct *vma;
46797 +       unsigned long is_write;
46798 +       int ret;
46799 +
46800 +#if 0
46801 +       if (!IS_VALID_EA(ea)) {
46802 +               return -EFAULT;
46803 +       }
46804 +#endif /* XXX */
46805 +       if (mm == NULL) {
46806 +               return -EFAULT;
46807 +       }
46808 +       if (mm->pgd == NULL) {
46809 +               return -EFAULT;
46810 +       }
46811 +
46812 +       down_read(&mm->mmap_sem);
46813 +       vma = find_vma(mm, ea);
46814 +       if (!vma)
46815 +               goto bad_area;
46816 +       if (vma->vm_start <= ea)
46817 +               goto good_area;
46818 +       if (!(vma->vm_flags & VM_GROWSDOWN))
46819 +               goto bad_area;
46820 +       if (expand_stack(vma, ea))
46821 +               goto bad_area;
46822 +good_area:
46823 +       is_write = dsisr & MFC_DSISR_ACCESS_PUT;
46824 +       if (is_write) {
46825 +               if (!(vma->vm_flags & VM_WRITE))
46826 +                       goto bad_area;
46827 +       } else {
46828 +               if (dsisr & MFC_DSISR_ACCESS_DENIED)
46829 +                       goto bad_area;
46830 +               if (!(vma->vm_flags & (VM_READ | VM_EXEC)))
46831 +                       goto bad_area;
46832 +       }
46833 +       ret = 0;
46834 +       *flt = handle_mm_fault(mm, vma, ea, is_write);
46835 +       if (unlikely(*flt & VM_FAULT_ERROR)) {
46836 +               if (*flt & VM_FAULT_OOM) {
46837 +                       ret = -ENOMEM;
46838 +                       goto bad_area;
46839 +               } else if (*flt & VM_FAULT_SIGBUS) {
46840 +                       ret = -EFAULT;
46841 +                       goto bad_area;
46842 +               }
46843 +               BUG();
46844 +       }
46845 +       if (*flt & VM_FAULT_MAJOR)
46846 +               current->maj_flt++;
46847 +       else
46848 +               current->min_flt++;
46849 +       up_read(&mm->mmap_sem);
46850 +       return ret;
46851 +
46852 +bad_area:
46853 +       up_read(&mm->mmap_sem);
46854 +       return -EFAULT;
46855 +}
46856 +EXPORT_SYMBOL_GPL(spu_handle_mm_fault);
46857 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/cell/spu_manage.c powerpc.git/arch/powerpc/platforms/cell/spu_manage.c
46858 --- linux-2.6.24/arch/powerpc/platforms/cell/spu_manage.c       2008-01-24 23:58:37.000000000 +0100
46859 +++ powerpc.git/arch/powerpc/platforms/cell/spu_manage.c        2008-01-28 20:25:49.000000000 +0100
46860 @@ -35,6 +35,7 @@
46861  #include <asm/firmware.h>
46862  #include <asm/prom.h>
46863  
46864 +#include "spufs/spufs.h"
46865  #include "interrupt.h"
46866  
46867  struct device_node *spu_devnode(struct spu *spu)
46868 @@ -345,7 +346,7 @@
46869                 }
46870                 ret = spu_map_interrupts_old(spu, spe);
46871                 if (ret) {
46872 -                       printk(KERN_ERR "%s: could not map interrupts",
46873 +                       printk(KERN_ERR "%s: could not map interrupts\n",
46874                                 spu->name);
46875                         goto out_unmap;
46876                 }
46877 @@ -369,6 +370,16 @@
46878         return 0;
46879  }
46880  
46881 +static void enable_spu_by_master_run(struct spu_context *ctx)
46882 +{
46883 +       ctx->ops->master_start(ctx);
46884 +}
46885 +
46886 +static void disable_spu_by_master_run(struct spu_context *ctx)
46887 +{
46888 +       ctx->ops->master_stop(ctx);
46889 +}
46890 +
46891  /* Hardcoded affinity idxs for qs20 */
46892  #define QS20_SPES_PER_BE 8
46893  static int qs20_reg_idxs[QS20_SPES_PER_BE] =   { 0, 2, 4, 6, 7, 5, 3, 1 };
46894 @@ -411,10 +422,15 @@
46895  
46896  static int of_has_vicinity(void)
46897  {
46898 -       struct spu* spu;
46899 +       struct device_node *dn;
46900  
46901 -       spu = list_first_entry(&cbe_spu_info[0].spus, struct spu, cbe_list);
46902 -       return of_find_property(spu_devnode(spu), "vicinity", NULL) != NULL;
46903 +       for_each_node_by_type(dn, "spe") {
46904 +               if (of_find_property(dn, "vicinity", NULL))  {
46905 +                       of_node_put(dn);
46906 +                       return 1;
46907 +               }
46908 +       }
46909 +       return 0;
46910  }
46911  
46912  static struct spu *devnode_spu(int cbe, struct device_node *dn)
46913 @@ -525,7 +541,7 @@
46914                 if (of_flat_dt_is_compatible(root, "IBM,CPBW-1.0"))
46915                         init_affinity_qs20_harcoded();
46916                 else
46917 -                       printk("No affinity configuration found");
46918 +                       printk("No affinity configuration found\n");
46919         }
46920  
46921         return 0;
46922 @@ -535,5 +551,7 @@
46923         .enumerate_spus = of_enumerate_spus,
46924         .create_spu = of_create_spu,
46925         .destroy_spu = of_destroy_spu,
46926 +       .enable_spu = enable_spu_by_master_run,
46927 +       .disable_spu = disable_spu_by_master_run,
46928         .init_affinity = init_affinity,
46929  };
46930 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/cell/spufs/Makefile powerpc.git/arch/powerpc/platforms/cell/spufs/Makefile
46931 --- linux-2.6.24/arch/powerpc/platforms/cell/spufs/Makefile     2008-01-24 23:58:37.000000000 +0100
46932 +++ powerpc.git/arch/powerpc/platforms/cell/spufs/Makefile      2008-01-28 20:25:49.000000000 +0100
46933 @@ -1,8 +1,8 @@
46934 -obj-y += switch.o fault.o lscsa_alloc.o
46935  
46936  obj-$(CONFIG_SPU_FS) += spufs.o
46937  spufs-y += inode.o file.o context.o syscalls.o coredump.o
46938  spufs-y += sched.o backing_ops.o hw_ops.o run.o gang.o
46939 +spufs-y += switch.o fault.o lscsa_alloc.o
46940  
46941  # Rules to build switch.o with the help of SPU tool chain
46942  SPU_CROSS      := spu-
46943 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/cell/spufs/backing_ops.c powerpc.git/arch/powerpc/platforms/cell/spufs/backing_ops.c
46944 --- linux-2.6.24/arch/powerpc/platforms/cell/spufs/backing_ops.c        2008-01-24 23:58:37.000000000 +0100
46945 +++ powerpc.git/arch/powerpc/platforms/cell/spufs/backing_ops.c 2008-01-28 20:25:49.000000000 +0100
46946 @@ -106,16 +106,20 @@
46947                 if (stat & 0xff0000)
46948                         ret |= POLLIN | POLLRDNORM;
46949                 else {
46950 -                       ctx->csa.priv1.int_stat_class0_RW &= ~0x1;
46951 -                       ctx->csa.priv1.int_mask_class2_RW |= 0x1;
46952 +                       ctx->csa.priv1.int_stat_class2_RW &=
46953 +                               ~CLASS2_MAILBOX_INTR;
46954 +                       ctx->csa.priv1.int_mask_class2_RW |=
46955 +                               CLASS2_ENABLE_MAILBOX_INTR;
46956                 }
46957         }
46958         if (events & (POLLOUT | POLLWRNORM)) {
46959                 if (stat & 0x00ff00)
46960                         ret = POLLOUT | POLLWRNORM;
46961                 else {
46962 -                       ctx->csa.priv1.int_stat_class0_RW &= ~0x10;
46963 -                       ctx->csa.priv1.int_mask_class2_RW |= 0x10;
46964 +                       ctx->csa.priv1.int_stat_class2_RW &=
46965 +                               ~CLASS2_MAILBOX_THRESHOLD_INTR;
46966 +                       ctx->csa.priv1.int_mask_class2_RW |=
46967 +                               CLASS2_ENABLE_MAILBOX_THRESHOLD_INTR;
46968                 }
46969         }
46970         spin_unlock_irq(&ctx->csa.register_lock);
46971 @@ -139,7 +143,7 @@
46972                 ret = 4;
46973         } else {
46974                 /* make sure we get woken up by the interrupt */
46975 -               ctx->csa.priv1.int_mask_class2_RW |= 0x1UL;
46976 +               ctx->csa.priv1.int_mask_class2_RW |= CLASS2_ENABLE_MAILBOX_INTR;
46977                 ret = 0;
46978         }
46979         spin_unlock(&ctx->csa.register_lock);
46980 @@ -169,7 +173,8 @@
46981         } else {
46982                 /* make sure we get woken up by the interrupt when space
46983                    becomes available */
46984 -               ctx->csa.priv1.int_mask_class2_RW |= 0x10;
46985 +               ctx->csa.priv1.int_mask_class2_RW |=
46986 +                       CLASS2_ENABLE_MAILBOX_THRESHOLD_INTR;
46987                 ret = 0;
46988         }
46989         spin_unlock(&ctx->csa.register_lock);
46990 @@ -268,6 +273,11 @@
46991         return ctx->csa.lscsa->ls;
46992  }
46993  
46994 +static void spu_backing_privcntl_write(struct spu_context *ctx, u64 val)
46995 +{
46996 +       ctx->csa.priv2.spu_privcntl_RW = val;
46997 +}
46998 +
46999  static u32 spu_backing_runcntl_read(struct spu_context *ctx)
47000  {
47001         return ctx->csa.prob.spu_runcntl_RW;
47002 @@ -285,6 +295,11 @@
47003         spin_unlock(&ctx->csa.register_lock);
47004  }
47005  
47006 +static void spu_backing_runcntl_stop(struct spu_context *ctx)
47007 +{
47008 +       spu_backing_runcntl_write(ctx, SPU_RUNCNTL_STOP);
47009 +}
47010 +
47011  static void spu_backing_master_start(struct spu_context *ctx)
47012  {
47013         struct spu_state *csa = &ctx->csa;
47014 @@ -358,7 +373,7 @@
47015  
47016  static void spu_backing_restart_dma(struct spu_context *ctx)
47017  {
47018 -       /* nothing to do here */
47019 +       ctx->csa.priv2.mfc_control_RW |= MFC_CNTL_RESTART_DMA_COMMAND;
47020  }
47021  
47022  struct spu_context_ops spu_backing_ops = {
47023 @@ -379,8 +394,10 @@
47024         .npc_write = spu_backing_npc_write,
47025         .status_read = spu_backing_status_read,
47026         .get_ls = spu_backing_get_ls,
47027 +       .privcntl_write = spu_backing_privcntl_write,
47028         .runcntl_read = spu_backing_runcntl_read,
47029         .runcntl_write = spu_backing_runcntl_write,
47030 +       .runcntl_stop = spu_backing_runcntl_stop,
47031         .master_start = spu_backing_master_start,
47032         .master_stop = spu_backing_master_stop,
47033         .set_mfc_query = spu_backing_set_mfc_query,
47034 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/cell/spufs/context.c powerpc.git/arch/powerpc/platforms/cell/spufs/context.c
47035 --- linux-2.6.24/arch/powerpc/platforms/cell/spufs/context.c    2008-01-24 23:58:37.000000000 +0100
47036 +++ powerpc.git/arch/powerpc/platforms/cell/spufs/context.c     2008-01-28 20:25:49.000000000 +0100
47037 @@ -52,6 +52,7 @@
47038         init_waitqueue_head(&ctx->wbox_wq);
47039         init_waitqueue_head(&ctx->stop_wq);
47040         init_waitqueue_head(&ctx->mfc_wq);
47041 +       init_waitqueue_head(&ctx->run_wq);
47042         ctx->state = SPU_STATE_SAVED;
47043         ctx->ops = &spu_backing_ops;
47044         ctx->owner = get_task_mm(current);
47045 @@ -105,7 +106,17 @@
47046  void spu_forget(struct spu_context *ctx)
47047  {
47048         struct mm_struct *mm;
47049 -       spu_acquire_saved(ctx);
47050 +
47051 +       /*
47052 +        * This is basically an open-coded spu_acquire_saved, except that
47053 +        * we don't acquire the state mutex interruptible.
47054 +        */
47055 +       mutex_lock(&ctx->state_mutex);
47056 +       if (ctx->state != SPU_STATE_SAVED) {
47057 +               set_bit(SPU_SCHED_WAS_ACTIVE, &ctx->sched_flags);
47058 +               spu_deactivate(ctx);
47059 +       }
47060 +
47061         mm = ctx->owner;
47062         ctx->owner = NULL;
47063         mmput(mm);
47064 @@ -133,47 +144,23 @@
47065  }
47066  
47067  /**
47068 - * spu_acquire_runnable - lock spu contex and make sure it is in runnable state
47069 + * spu_acquire_saved - lock spu contex and make sure it is in saved state
47070   * @ctx:       spu contex to lock
47071 - *
47072 - * Note:
47073 - *     Returns 0 and with the context locked on success
47074 - *     Returns negative error and with the context _unlocked_ on failure.
47075   */
47076 -int spu_acquire_runnable(struct spu_context *ctx, unsigned long flags)
47077 +int spu_acquire_saved(struct spu_context *ctx)
47078  {
47079 -       int ret = -EINVAL;
47080 +       int ret;
47081  
47082 -       spu_acquire(ctx);
47083 -       if (ctx->state == SPU_STATE_SAVED) {
47084 -               /*
47085 -                * Context is about to be freed, so we can't acquire it anymore.
47086 -                */
47087 -               if (!ctx->owner)
47088 -                       goto out_unlock;
47089 -               ret = spu_activate(ctx, flags);
47090 -               if (ret)
47091 -                       goto out_unlock;
47092 -       }
47093 -
47094 -       return 0;
47095 +       ret = spu_acquire(ctx);
47096 +       if (ret)
47097 +               return ret;
47098  
47099 - out_unlock:
47100 -       spu_release(ctx);
47101 -       return ret;
47102 -}
47103 -
47104 -/**
47105 - * spu_acquire_saved - lock spu contex and make sure it is in saved state
47106 - * @ctx:       spu contex to lock
47107 - */
47108 -void spu_acquire_saved(struct spu_context *ctx)
47109 -{
47110 -       spu_acquire(ctx);
47111         if (ctx->state != SPU_STATE_SAVED) {
47112                 set_bit(SPU_SCHED_WAS_ACTIVE, &ctx->sched_flags);
47113                 spu_deactivate(ctx);
47114         }
47115 +
47116 +       return 0;
47117  }
47118  
47119  /**
47120 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/cell/spufs/coredump.c powerpc.git/arch/powerpc/platforms/cell/spufs/coredump.c
47121 --- linux-2.6.24/arch/powerpc/platforms/cell/spufs/coredump.c   2008-01-24 23:58:37.000000000 +0100
47122 +++ powerpc.git/arch/powerpc/platforms/cell/spufs/coredump.c    2008-01-28 20:25:49.000000000 +0100
47123 @@ -148,7 +148,9 @@
47124  
47125         fd = 0;
47126         while ((ctx = coredump_next_context(&fd)) != NULL) {
47127 -               spu_acquire_saved(ctx);
47128 +               rc = spu_acquire_saved(ctx);
47129 +               if (rc)
47130 +                       break;
47131                 rc = spufs_ctx_note_size(ctx, fd);
47132                 spu_release_saved(ctx);
47133                 if (rc < 0)
47134 @@ -224,7 +226,9 @@
47135  
47136         fd = 0;
47137         while ((ctx = coredump_next_context(&fd)) != NULL) {
47138 -               spu_acquire_saved(ctx);
47139 +               rc = spu_acquire_saved(ctx);
47140 +               if (rc)
47141 +                       return rc;
47142  
47143                 for (j = 0; spufs_coredump_read[j].name != NULL; j++) {
47144                         rc = spufs_arch_write_note(ctx, j, file, fd, foffset);
47145 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/cell/spufs/fault.c powerpc.git/arch/powerpc/platforms/cell/spufs/fault.c
47146 --- linux-2.6.24/arch/powerpc/platforms/cell/spufs/fault.c      2008-01-24 23:58:37.000000000 +0100
47147 +++ powerpc.git/arch/powerpc/platforms/cell/spufs/fault.c       2008-01-28 20:25:49.000000000 +0100
47148 @@ -28,117 +28,71 @@
47149  
47150  #include "spufs.h"
47151  
47152 -/*
47153 - * This ought to be kept in sync with the powerpc specific do_page_fault
47154 - * function. Currently, there are a few corner cases that we haven't had
47155 - * to handle fortunately.
47156 +/**
47157 + * Handle an SPE event, depending on context SPU_CREATE_EVENTS_ENABLED flag.
47158 + *
47159 + * If the context was created with events, we just set the return event.
47160 + * Otherwise, send an appropriate signal to the process.
47161   */
47162 -static int spu_handle_mm_fault(struct mm_struct *mm, unsigned long ea,
47163 -               unsigned long dsisr, unsigned *flt)
47164 -{
47165 -       struct vm_area_struct *vma;
47166 -       unsigned long is_write;
47167 -       int ret;
47168 -
47169 -#if 0
47170 -       if (!IS_VALID_EA(ea)) {
47171 -               return -EFAULT;
47172 -       }
47173 -#endif /* XXX */
47174 -       if (mm == NULL) {
47175 -               return -EFAULT;
47176 -       }
47177 -       if (mm->pgd == NULL) {
47178 -               return -EFAULT;
47179 -       }
47180 -
47181 -       down_read(&mm->mmap_sem);
47182 -       vma = find_vma(mm, ea);
47183 -       if (!vma)
47184 -               goto bad_area;
47185 -       if (vma->vm_start <= ea)
47186 -               goto good_area;
47187 -       if (!(vma->vm_flags & VM_GROWSDOWN))
47188 -               goto bad_area;
47189 -       if (expand_stack(vma, ea))
47190 -               goto bad_area;
47191 -good_area:
47192 -       is_write = dsisr & MFC_DSISR_ACCESS_PUT;
47193 -       if (is_write) {
47194 -               if (!(vma->vm_flags & VM_WRITE))
47195 -                       goto bad_area;
47196 -       } else {
47197 -               if (dsisr & MFC_DSISR_ACCESS_DENIED)
47198 -                       goto bad_area;
47199 -               if (!(vma->vm_flags & (VM_READ | VM_EXEC)))
47200 -                       goto bad_area;
47201 -       }
47202 -       ret = 0;
47203 -       *flt = handle_mm_fault(mm, vma, ea, is_write);
47204 -       if (unlikely(*flt & VM_FAULT_ERROR)) {
47205 -               if (*flt & VM_FAULT_OOM) {
47206 -                       ret = -ENOMEM;
47207 -                       goto bad_area;
47208 -               } else if (*flt & VM_FAULT_SIGBUS) {
47209 -                       ret = -EFAULT;
47210 -                       goto bad_area;
47211 -               }
47212 -               BUG();
47213 -       }
47214 -       if (*flt & VM_FAULT_MAJOR)
47215 -               current->maj_flt++;
47216 -       else
47217 -               current->min_flt++;
47218 -       up_read(&mm->mmap_sem);
47219 -       return ret;
47220 -
47221 -bad_area:
47222 -       up_read(&mm->mmap_sem);
47223 -       return -EFAULT;
47224 -}
47225 -
47226 -static void spufs_handle_dma_error(struct spu_context *ctx,
47227 +static void spufs_handle_event(struct spu_context *ctx,
47228                                 unsigned long ea, int type)
47229  {
47230 +       siginfo_t info;
47231 +
47232         if (ctx->flags & SPU_CREATE_EVENTS_ENABLED) {
47233                 ctx->event_return |= type;
47234                 wake_up_all(&ctx->stop_wq);
47235 -       } else {
47236 -               siginfo_t info;
47237 -               memset(&info, 0, sizeof(info));
47238 -
47239 -               switch (type) {
47240 -               case SPE_EVENT_INVALID_DMA:
47241 -                       info.si_signo = SIGBUS;
47242 -                       info.si_code = BUS_OBJERR;
47243 -                       break;
47244 -               case SPE_EVENT_SPE_DATA_STORAGE:
47245 -                       info.si_signo = SIGBUS;
47246 -                       info.si_addr = (void __user *)ea;
47247 -                       info.si_code = BUS_ADRERR;
47248 -                       break;
47249 -               case SPE_EVENT_DMA_ALIGNMENT:
47250 -                       info.si_signo = SIGBUS;
47251 -                       /* DAR isn't set for an alignment fault :( */
47252 -                       info.si_code = BUS_ADRALN;
47253 -                       break;
47254 -               case SPE_EVENT_SPE_ERROR:
47255 -                       info.si_signo = SIGILL;
47256 -                       info.si_addr = (void __user *)(unsigned long)
47257 -                               ctx->ops->npc_read(ctx) - 4;
47258 -                       info.si_code = ILL_ILLOPC;
47259 -                       break;
47260 -               }
47261 -               if (info.si_signo)
47262 -                       force_sig_info(info.si_signo, &info, current);
47263 +               return;
47264         }
47265 +
47266 +       memset(&info, 0, sizeof(info));
47267 +
47268 +       switch (type) {
47269 +       case SPE_EVENT_INVALID_DMA:
47270 +               info.si_signo = SIGBUS;
47271 +               info.si_code = BUS_OBJERR;
47272 +               break;
47273 +       case SPE_EVENT_SPE_DATA_STORAGE:
47274 +               info.si_signo = SIGSEGV;
47275 +               info.si_addr = (void __user *)ea;
47276 +               info.si_code = SEGV_ACCERR;
47277 +               ctx->ops->restart_dma(ctx);
47278 +               break;
47279 +       case SPE_EVENT_DMA_ALIGNMENT:
47280 +               info.si_signo = SIGBUS;
47281 +               /* DAR isn't set for an alignment fault :( */
47282 +               info.si_code = BUS_ADRALN;
47283 +               break;
47284 +       case SPE_EVENT_SPE_ERROR:
47285 +               info.si_signo = SIGILL;
47286 +               info.si_addr = (void __user *)(unsigned long)
47287 +                       ctx->ops->npc_read(ctx) - 4;
47288 +               info.si_code = ILL_ILLOPC;
47289 +               break;
47290 +       }
47291 +
47292 +       if (info.si_signo)
47293 +               force_sig_info(info.si_signo, &info, current);
47294  }
47295  
47296 -void spufs_dma_callback(struct spu *spu, int type)
47297 +int spufs_handle_class0(struct spu_context *ctx)
47298  {
47299 -       spufs_handle_dma_error(spu->ctx, spu->dar, type);
47300 +       unsigned long stat = ctx->csa.class_0_pending & CLASS0_INTR_MASK;
47301 +
47302 +       if (likely(!stat))
47303 +               return 0;
47304 +
47305 +       if (stat & CLASS0_DMA_ALIGNMENT_INTR)
47306 +               spufs_handle_event(ctx, ctx->csa.dar, SPE_EVENT_DMA_ALIGNMENT);
47307 +
47308 +       if (stat & CLASS0_INVALID_DMA_COMMAND_INTR)
47309 +               spufs_handle_event(ctx, ctx->csa.dar, SPE_EVENT_INVALID_DMA);
47310 +
47311 +       if (stat & CLASS0_SPU_ERROR_INTR)
47312 +               spufs_handle_event(ctx, ctx->csa.dar, SPE_EVENT_SPE_ERROR);
47313 +
47314 +       return -EIO;
47315  }
47316 -EXPORT_SYMBOL_GPL(spufs_dma_callback);
47317  
47318  /*
47319   * bottom half handler for page faults, we can't do this from
47320 @@ -154,7 +108,7 @@
47321         u64 ea, dsisr, access;
47322         unsigned long flags;
47323         unsigned flt = 0;
47324 -       int ret;
47325 +       int ret, ret2;
47326  
47327         /*
47328          * dar and dsisr get passed from the registers
47329 @@ -165,16 +119,8 @@
47330          * in time, we can still expect to get the same fault
47331          * the immediately after the context restore.
47332          */
47333 -       if (ctx->state == SPU_STATE_RUNNABLE) {
47334 -               ea = ctx->spu->dar;
47335 -               dsisr = ctx->spu->dsisr;
47336 -               ctx->spu->dar= ctx->spu->dsisr = 0;
47337 -       } else {
47338 -               ea = ctx->csa.priv1.mfc_dar_RW;
47339 -               dsisr = ctx->csa.priv1.mfc_dsisr_RW;
47340 -               ctx->csa.priv1.mfc_dar_RW = 0;
47341 -               ctx->csa.priv1.mfc_dsisr_RW = 0;
47342 -       }
47343 +       ea = ctx->csa.dar;
47344 +       dsisr = ctx->csa.dsisr;
47345  
47346         if (!(dsisr & (MFC_DSISR_PTE_NOT_FOUND | MFC_DSISR_ACCESS_DENIED)))
47347                 return 0;
47348 @@ -201,7 +147,22 @@
47349         if (ret)
47350                 ret = spu_handle_mm_fault(current->mm, ea, dsisr, &flt);
47351  
47352 -       spu_acquire(ctx);
47353 +       /*
47354 +        * If spu_acquire fails due to a pending signal we just want to return
47355 +        * EINTR to userspace even if that means missing the dma restart or
47356 +        * updating the page fault statistics.
47357 +        */
47358 +       ret2 = spu_acquire(ctx);
47359 +       if (ret2)
47360 +               goto out;
47361 +
47362 +       /*
47363 +        * Clear dsisr under ctxt lock after handling the fault, so that
47364 +        * time slicing will not preempt the context while the page fault
47365 +        * handler is running. Context switch code removes mappings.
47366 +        */
47367 +       ctx->csa.dar = ctx->csa.dsisr = 0;
47368 +
47369         /*
47370          * If we handled the fault successfully and are in runnable
47371          * state, restart the DMA.
47372 @@ -222,9 +183,9 @@
47373                 if (ctx->spu)
47374                         ctx->ops->restart_dma(ctx);
47375         } else
47376 -               spufs_handle_dma_error(ctx, ea, SPE_EVENT_SPE_DATA_STORAGE);
47377 +               spufs_handle_event(ctx, ea, SPE_EVENT_SPE_DATA_STORAGE);
47378  
47379 + out:
47380         spuctx_switch_state(ctx, SPU_UTIL_SYSTEM);
47381         return ret;
47382  }
47383 -EXPORT_SYMBOL_GPL(spufs_handle_class1);
47384 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/cell/spufs/file.c powerpc.git/arch/powerpc/platforms/cell/spufs/file.c
47385 --- linux-2.6.24/arch/powerpc/platforms/cell/spufs/file.c       2008-01-24 23:58:37.000000000 +0100
47386 +++ powerpc.git/arch/powerpc/platforms/cell/spufs/file.c        2008-01-28 20:25:49.000000000 +0100
47387 @@ -40,6 +40,120 @@
47388  
47389  #define SPUFS_MMAP_4K (PAGE_SIZE == 0x1000)
47390  
47391 +/* Simple attribute files */
47392 +struct spufs_attr {
47393 +       int (*get)(void *, u64 *);
47394 +       int (*set)(void *, u64);
47395 +       char get_buf[24];       /* enough to store a u64 and "\n\0" */
47396 +       char set_buf[24];
47397 +       void *data;
47398 +       const char *fmt;        /* format for read operation */
47399 +       struct mutex mutex;     /* protects access to these buffers */
47400 +};
47401 +
47402 +static int spufs_attr_open(struct inode *inode, struct file *file,
47403 +               int (*get)(void *, u64 *), int (*set)(void *, u64),
47404 +               const char *fmt)
47405 +{
47406 +       struct spufs_attr *attr;
47407 +
47408 +       attr = kmalloc(sizeof(*attr), GFP_KERNEL);
47409 +       if (!attr)
47410 +               return -ENOMEM;
47411 +
47412 +       attr->get = get;
47413 +       attr->set = set;
47414 +       attr->data = inode->i_private;
47415 +       attr->fmt = fmt;
47416 +       mutex_init(&attr->mutex);
47417 +       file->private_data = attr;
47418 +
47419 +       return nonseekable_open(inode, file);
47420 +}
47421 +
47422 +static int spufs_attr_release(struct inode *inode, struct file *file)
47423 +{
47424 +       kfree(file->private_data);
47425 +       return 0;
47426 +}
47427 +
47428 +static ssize_t spufs_attr_read(struct file *file, char __user *buf,
47429 +               size_t len, loff_t *ppos)
47430 +{
47431 +       struct spufs_attr *attr;
47432 +       size_t size;
47433 +       ssize_t ret;
47434 +
47435 +       attr = file->private_data;
47436 +       if (!attr->get)
47437 +               return -EACCES;
47438 +
47439 +       ret = mutex_lock_interruptible(&attr->mutex);
47440 +       if (ret)
47441 +               return ret;
47442 +
47443 +       if (*ppos) {            /* continued read */
47444 +               size = strlen(attr->get_buf);
47445 +       } else {                /* first read */
47446 +               u64 val;
47447 +               ret = attr->get(attr->data, &val);
47448 +               if (ret)
47449 +                       goto out;
47450 +
47451 +               size = scnprintf(attr->get_buf, sizeof(attr->get_buf),
47452 +                                attr->fmt, (unsigned long long)val);
47453 +       }
47454 +
47455 +       ret = simple_read_from_buffer(buf, len, ppos, attr->get_buf, size);
47456 +out:
47457 +       mutex_unlock(&attr->mutex);
47458 +       return ret;
47459 +}
47460 +
47461 +static ssize_t spufs_attr_write(struct file *file, const char __user *buf,
47462 +               size_t len, loff_t *ppos)
47463 +{
47464 +       struct spufs_attr *attr;
47465 +       u64 val;
47466 +       size_t size;
47467 +       ssize_t ret;
47468 +
47469 +       attr = file->private_data;
47470 +       if (!attr->set)
47471 +               return -EACCES;
47472 +
47473 +       ret = mutex_lock_interruptible(&attr->mutex);
47474 +       if (ret)
47475 +               return ret;
47476 +
47477 +       ret = -EFAULT;
47478 +       size = min(sizeof(attr->set_buf) - 1, len);
47479 +       if (copy_from_user(attr->set_buf, buf, size))
47480 +               goto out;
47481 +
47482 +       ret = len; /* claim we got the whole input */
47483 +       attr->set_buf[size] = '\0';
47484 +       val = simple_strtol(attr->set_buf, NULL, 0);
47485 +       attr->set(attr->data, val);
47486 +out:
47487 +       mutex_unlock(&attr->mutex);
47488 +       return ret;
47489 +}
47490 +
47491 +#define DEFINE_SPUFS_SIMPLE_ATTRIBUTE(__fops, __get, __set, __fmt)     \
47492 +static int __fops ## _open(struct inode *inode, struct file *file)     \
47493 +{                                                                      \
47494 +       __simple_attr_check_format(__fmt, 0ull);                        \
47495 +       return spufs_attr_open(inode, file, __get, __set, __fmt);       \
47496 +}                                                                      \
47497 +static struct file_operations __fops = {                               \
47498 +       .owner   = THIS_MODULE,                                         \
47499 +       .open    = __fops ## _open,                                     \
47500 +       .release = spufs_attr_release,                                  \
47501 +       .read    = spufs_attr_read,                                     \
47502 +       .write   = spufs_attr_write,                                    \
47503 +};
47504 +
47505  
47506  static int
47507  spufs_mem_open(struct inode *inode, struct file *file)
47508 @@ -84,9 +198,12 @@
47509         struct spu_context *ctx = file->private_data;
47510         ssize_t ret;
47511  
47512 -       spu_acquire(ctx);
47513 +       ret = spu_acquire(ctx);
47514 +       if (ret)
47515 +               return ret;
47516         ret = __spufs_mem_read(ctx, buffer, size, pos);
47517         spu_release(ctx);
47518 +
47519         return ret;
47520  }
47521  
47522 @@ -106,7 +223,10 @@
47523         if (size > LS_SIZE - pos)
47524                 size = LS_SIZE - pos;
47525  
47526 -       spu_acquire(ctx);
47527 +       ret = spu_acquire(ctx);
47528 +       if (ret)
47529 +               return ret;
47530 +
47531         local_store = ctx->ops->get_ls(ctx);
47532         ret = copy_from_user(local_store + pos, buffer, size);
47533         spu_release(ctx);
47534 @@ -146,7 +266,8 @@
47535         pr_debug("spufs_mem_mmap_nopfn address=0x%lx -> 0x%lx, offset=0x%lx\n",
47536                  addr0, address, offset);
47537  
47538 -       spu_acquire(ctx);
47539 +       if (spu_acquire(ctx))
47540 +               return NOPFN_REFAULT;
47541  
47542         if (ctx->state == SPU_STATE_SAVED) {
47543                 vma->vm_page_prot = __pgprot(pgprot_val(vma->vm_page_prot)
47544 @@ -236,23 +357,32 @@
47545  {
47546         struct spu_context *ctx = vma->vm_file->private_data;
47547         unsigned long area, offset = address - vma->vm_start;
47548 -       int ret;
47549  
47550         offset += vma->vm_pgoff << PAGE_SHIFT;
47551         if (offset >= ps_size)
47552                 return NOPFN_SIGBUS;
47553  
47554 -       /* error here usually means a signal.. we might want to test
47555 -        * the error code more precisely though
47556 +       /*
47557 +        * We have to wait for context to be loaded before we have
47558 +        * pages to hand out to the user, but we don't want to wait
47559 +        * with the mmap_sem held.
47560 +        * It is possible to drop the mmap_sem here, but then we need
47561 +        * to return NOPFN_REFAULT because the mappings may have
47562 +        * hanged.
47563          */
47564 -       ret = spu_acquire_runnable(ctx, 0);
47565 -       if (ret)
47566 +       if (spu_acquire(ctx))
47567                 return NOPFN_REFAULT;
47568  
47569 -       area = ctx->spu->problem_phys + ps_offs;
47570 -       vm_insert_pfn(vma, address, (area + offset) >> PAGE_SHIFT);
47571 -       spu_release(ctx);
47572 +       if (ctx->state == SPU_STATE_SAVED) {
47573 +               up_read(&current->mm->mmap_sem);
47574 +               spufs_wait(ctx->run_wq, ctx->state == SPU_STATE_RUNNABLE);
47575 +               down_read(&current->mm->mmap_sem);
47576 +       } else {
47577 +               area = ctx->spu->problem_phys + ps_offs;
47578 +               vm_insert_pfn(vma, address, (area + offset) >> PAGE_SHIFT);
47579 +       }
47580  
47581 +       spu_release(ctx);
47582         return NOPFN_REFAULT;
47583  }
47584  
47585 @@ -286,25 +416,32 @@
47586  #define spufs_cntl_mmap NULL
47587  #endif /* !SPUFS_MMAP_4K */
47588  
47589 -static u64 spufs_cntl_get(void *data)
47590 +static int spufs_cntl_get(void *data, u64 *val)
47591  {
47592         struct spu_context *ctx = data;
47593 -       u64 val;
47594 +       int ret;
47595  
47596 -       spu_acquire(ctx);
47597 -       val = ctx->ops->status_read(ctx);
47598 +       ret = spu_acquire(ctx);
47599 +       if (ret)
47600 +               return ret;
47601 +       *val = ctx->ops->status_read(ctx);
47602         spu_release(ctx);
47603  
47604 -       return val;
47605 +       return 0;
47606  }
47607  
47608 -static void spufs_cntl_set(void *data, u64 val)
47609 +static int spufs_cntl_set(void *data, u64 val)
47610  {
47611         struct spu_context *ctx = data;
47612 +       int ret;
47613  
47614 -       spu_acquire(ctx);
47615 +       ret = spu_acquire(ctx);
47616 +       if (ret)
47617 +               return ret;
47618         ctx->ops->runcntl_write(ctx, val);
47619         spu_release(ctx);
47620 +
47621 +       return 0;
47622  }
47623  
47624  static int spufs_cntl_open(struct inode *inode, struct file *file)
47625 @@ -317,7 +454,7 @@
47626         if (!i->i_openers++)
47627                 ctx->cntl = inode->i_mapping;
47628         mutex_unlock(&ctx->mapping_lock);
47629 -       return simple_attr_open(inode, file, spufs_cntl_get,
47630 +       return spufs_attr_open(inode, file, spufs_cntl_get,
47631                                         spufs_cntl_set, "0x%08lx");
47632  }
47633  
47634 @@ -327,7 +464,7 @@
47635         struct spufs_inode_info *i = SPUFS_I(inode);
47636         struct spu_context *ctx = i->i_ctx;
47637  
47638 -       simple_attr_close(inode, file);
47639 +       spufs_attr_release(inode, file);
47640  
47641         mutex_lock(&ctx->mapping_lock);
47642         if (!--i->i_openers)
47643 @@ -339,8 +476,8 @@
47644  static const struct file_operations spufs_cntl_fops = {
47645         .open = spufs_cntl_open,
47646         .release = spufs_cntl_release,
47647 -       .read = simple_attr_read,
47648 -       .write = simple_attr_write,
47649 +       .read = spufs_attr_read,
47650 +       .write = spufs_attr_write,
47651         .mmap = spufs_cntl_mmap,
47652  };
47653  
47654 @@ -368,7 +505,9 @@
47655         int ret;
47656         struct spu_context *ctx = file->private_data;
47657  
47658 -       spu_acquire_saved(ctx);
47659 +       ret = spu_acquire_saved(ctx);
47660 +       if (ret)
47661 +               return ret;
47662         ret = __spufs_regs_read(ctx, buffer, size, pos);
47663         spu_release_saved(ctx);
47664         return ret;
47665 @@ -387,7 +526,9 @@
47666                 return -EFBIG;
47667         *pos += size;
47668  
47669 -       spu_acquire_saved(ctx);
47670 +       ret = spu_acquire_saved(ctx);
47671 +       if (ret)
47672 +               return ret;
47673  
47674         ret = copy_from_user(lscsa->gprs + *pos - size,
47675                              buffer, size) ? -EFAULT : size;
47676 @@ -419,7 +560,9 @@
47677         int ret;
47678         struct spu_context *ctx = file->private_data;
47679  
47680 -       spu_acquire_saved(ctx);
47681 +       ret = spu_acquire_saved(ctx);
47682 +       if (ret)
47683 +               return ret;
47684         ret = __spufs_fpcr_read(ctx, buffer, size, pos);
47685         spu_release_saved(ctx);
47686         return ret;
47687 @@ -436,10 +579,12 @@
47688         size = min_t(ssize_t, sizeof(lscsa->fpcr) - *pos, size);
47689         if (size <= 0)
47690                 return -EFBIG;
47691 -       *pos += size;
47692  
47693 -       spu_acquire_saved(ctx);
47694 +       ret = spu_acquire_saved(ctx);
47695 +       if (ret)
47696 +               return ret;
47697  
47698 +       *pos += size;
47699         ret = copy_from_user((char *)&lscsa->fpcr + *pos - size,
47700                              buffer, size) ? -EFAULT : size;
47701  
47702 @@ -486,7 +631,10 @@
47703  
47704         udata = (void __user *)buf;
47705  
47706 -       spu_acquire(ctx);
47707 +       count = spu_acquire(ctx);
47708 +       if (count)
47709 +               return count;
47710 +
47711         for (count = 0; (count + 4) <= len; count += 4, udata++) {
47712                 int ret;
47713                 ret = ctx->ops->mbox_read(ctx, &mbox_data);
47714 @@ -522,12 +670,15 @@
47715                         size_t len, loff_t *pos)
47716  {
47717         struct spu_context *ctx = file->private_data;
47718 +       ssize_t ret;
47719         u32 mbox_stat;
47720  
47721         if (len < 4)
47722                 return -EINVAL;
47723  
47724 -       spu_acquire(ctx);
47725 +       ret = spu_acquire(ctx);
47726 +       if (ret)
47727 +               return ret;
47728  
47729         mbox_stat = ctx->ops->mbox_stat_read(ctx) & 0xff;
47730  
47731 @@ -562,6 +713,9 @@
47732  {
47733         struct spu_context *ctx = spu->ctx;
47734  
47735 +       if (!ctx)
47736 +               return;
47737 +
47738         wake_up_all(&ctx->ibox_wq);
47739         kill_fasync(&ctx->ibox_fasync, SIGIO, POLLIN);
47740  }
47741 @@ -593,7 +747,9 @@
47742  
47743         udata = (void __user *)buf;
47744  
47745 -       spu_acquire(ctx);
47746 +       count = spu_acquire(ctx);
47747 +       if (count)
47748 +               return count;
47749  
47750         /* wait only for the first element */
47751         count = 0;
47752 @@ -639,7 +795,11 @@
47753  
47754         poll_wait(file, &ctx->ibox_wq, wait);
47755  
47756 -       spu_acquire(ctx);
47757 +       /*
47758 +        * For now keep this uninterruptible and also ignore the rule
47759 +        * that poll should not sleep.  Will be fixed later.
47760 +        */
47761 +       mutex_lock(&ctx->state_mutex);
47762         mask = ctx->ops->mbox_stat_poll(ctx, POLLIN | POLLRDNORM);
47763         spu_release(ctx);
47764  
47765 @@ -657,12 +817,15 @@
47766                         size_t len, loff_t *pos)
47767  {
47768         struct spu_context *ctx = file->private_data;
47769 +       ssize_t ret;
47770         u32 ibox_stat;
47771  
47772         if (len < 4)
47773                 return -EINVAL;
47774  
47775 -       spu_acquire(ctx);
47776 +       ret = spu_acquire(ctx);
47777 +       if (ret)
47778 +               return ret;
47779         ibox_stat = (ctx->ops->mbox_stat_read(ctx) >> 16) & 0xff;
47780         spu_release(ctx);
47781  
47782 @@ -698,6 +861,9 @@
47783  {
47784         struct spu_context *ctx = spu->ctx;
47785  
47786 +       if (!ctx)
47787 +               return;
47788 +
47789         wake_up_all(&ctx->wbox_wq);
47790         kill_fasync(&ctx->wbox_fasync, SIGIO, POLLOUT);
47791  }
47792 @@ -731,7 +897,9 @@
47793         if (__get_user(wbox_data, udata))
47794                 return -EFAULT;
47795  
47796 -       spu_acquire(ctx);
47797 +       count = spu_acquire(ctx);
47798 +       if (count)
47799 +               return count;
47800  
47801         /*
47802          * make sure we can at least write one element, by waiting
47803 @@ -772,7 +940,11 @@
47804  
47805         poll_wait(file, &ctx->wbox_wq, wait);
47806  
47807 -       spu_acquire(ctx);
47808 +       /*
47809 +        * For now keep this uninterruptible and also ignore the rule
47810 +        * that poll should not sleep.  Will be fixed later.
47811 +        */
47812 +       mutex_lock(&ctx->state_mutex);
47813         mask = ctx->ops->mbox_stat_poll(ctx, POLLOUT | POLLWRNORM);
47814         spu_release(ctx);
47815  
47816 @@ -790,12 +962,15 @@
47817                         size_t len, loff_t *pos)
47818  {
47819         struct spu_context *ctx = file->private_data;
47820 +       ssize_t ret;
47821         u32 wbox_stat;
47822  
47823         if (len < 4)
47824                 return -EINVAL;
47825  
47826 -       spu_acquire(ctx);
47827 +       ret = spu_acquire(ctx);
47828 +       if (ret)
47829 +               return ret;
47830         wbox_stat = (ctx->ops->mbox_stat_read(ctx) >> 8) & 0xff;
47831         spu_release(ctx);
47832  
47833 @@ -866,7 +1041,9 @@
47834         int ret;
47835         struct spu_context *ctx = file->private_data;
47836  
47837 -       spu_acquire_saved(ctx);
47838 +       ret = spu_acquire_saved(ctx);
47839 +       if (ret)
47840 +               return ret;
47841         ret = __spufs_signal1_read(ctx, buf, len, pos);
47842         spu_release_saved(ctx);
47843  
47844 @@ -877,6 +1054,7 @@
47845                         size_t len, loff_t *pos)
47846  {
47847         struct spu_context *ctx;
47848 +       ssize_t ret;
47849         u32 data;
47850  
47851         ctx = file->private_data;
47852 @@ -887,7 +1065,9 @@
47853         if (copy_from_user(&data, buf, 4))
47854                 return -EFAULT;
47855  
47856 -       spu_acquire(ctx);
47857 +       ret = spu_acquire(ctx);
47858 +       if (ret)
47859 +               return ret;
47860         ctx->ops->signal1_write(ctx, data);
47861         spu_release(ctx);
47862  
47863 @@ -997,7 +1177,9 @@
47864         struct spu_context *ctx = file->private_data;
47865         int ret;
47866  
47867 -       spu_acquire_saved(ctx);
47868 +       ret = spu_acquire_saved(ctx);
47869 +       if (ret)
47870 +               return ret;
47871         ret = __spufs_signal2_read(ctx, buf, len, pos);
47872         spu_release_saved(ctx);
47873  
47874 @@ -1008,6 +1190,7 @@
47875                         size_t len, loff_t *pos)
47876  {
47877         struct spu_context *ctx;
47878 +       ssize_t ret;
47879         u32 data;
47880  
47881         ctx = file->private_data;
47882 @@ -1018,7 +1201,9 @@
47883         if (copy_from_user(&data, buf, 4))
47884                 return -EFAULT;
47885  
47886 -       spu_acquire(ctx);
47887 +       ret = spu_acquire(ctx);
47888 +       if (ret)
47889 +               return ret;
47890         ctx->ops->signal2_write(ctx, data);
47891         spu_release(ctx);
47892  
47893 @@ -1086,33 +1271,42 @@
47894  #define SPU_ATTR_ACQUIRE_SAVED 2
47895  
47896  #define DEFINE_SPUFS_ATTRIBUTE(__name, __get, __set, __fmt, __acquire) \
47897 -static u64 __##__get(void *data)                                       \
47898 +static int __##__get(void *data, u64 *val)                             \
47899  {                                                                      \
47900         struct spu_context *ctx = data;                                 \
47901 -       u64 ret;                                                        \
47902 +       int ret = 0;                                                    \
47903                                                                         \
47904         if (__acquire == SPU_ATTR_ACQUIRE) {                            \
47905 -               spu_acquire(ctx);                                       \
47906 -               ret = __get(ctx);                                       \
47907 +               ret = spu_acquire(ctx);                                 \
47908 +               if (ret)                                                \
47909 +                       return ret;                                     \
47910 +               *val = __get(ctx);                                      \
47911                 spu_release(ctx);                                       \
47912         } else if (__acquire == SPU_ATTR_ACQUIRE_SAVED) {               \
47913 -               spu_acquire_saved(ctx);                                 \
47914 -               ret = __get(ctx);                                       \
47915 +               ret = spu_acquire_saved(ctx);                           \
47916 +               if (ret)                                                \
47917 +                       return ret;                                     \
47918 +               *val = __get(ctx);                                      \
47919                 spu_release_saved(ctx);                                 \
47920         } else                                                          \
47921 -               ret = __get(ctx);                                       \
47922 +               *val = __get(ctx);                                      \
47923                                                                         \
47924 -       return ret;                                                     \
47925 +       return 0;                                                       \
47926  }                                                                      \
47927 -DEFINE_SIMPLE_ATTRIBUTE(__name, __##__get, __set, __fmt);
47928 +DEFINE_SPUFS_SIMPLE_ATTRIBUTE(__name, __##__get, __set, __fmt);
47929  
47930 -static void spufs_signal1_type_set(void *data, u64 val)
47931 +static int spufs_signal1_type_set(void *data, u64 val)
47932  {
47933         struct spu_context *ctx = data;
47934 +       int ret;
47935  
47936 -       spu_acquire(ctx);
47937 +       ret = spu_acquire(ctx);
47938 +       if (ret)
47939 +               return ret;
47940         ctx->ops->signal1_type_set(ctx, val);
47941         spu_release(ctx);
47942 +
47943 +       return 0;
47944  }
47945  
47946  static u64 spufs_signal1_type_get(struct spu_context *ctx)
47947 @@ -1123,13 +1317,18 @@
47948                        spufs_signal1_type_set, "%llu", SPU_ATTR_ACQUIRE);
47949  
47950  
47951 -static void spufs_signal2_type_set(void *data, u64 val)
47952 +static int spufs_signal2_type_set(void *data, u64 val)
47953  {
47954         struct spu_context *ctx = data;
47955 +       int ret;
47956  
47957 -       spu_acquire(ctx);
47958 +       ret = spu_acquire(ctx);
47959 +       if (ret)
47960 +               return ret;
47961         ctx->ops->signal2_type_set(ctx, val);
47962         spu_release(ctx);
47963 +
47964 +       return 0;
47965  }
47966  
47967  static u64 spufs_signal2_type_get(struct spu_context *ctx)
47968 @@ -1329,6 +1528,9 @@
47969  {
47970         struct spu_context *ctx = spu->ctx;
47971  
47972 +       if (!ctx)
47973 +               return;
47974 +
47975         wake_up_all(&ctx->mfc_wq);
47976  
47977         pr_debug("%s %s\n", __FUNCTION__, spu->name);
47978 @@ -1375,12 +1577,17 @@
47979         if (size != 4)
47980                 goto out;
47981  
47982 -       spu_acquire(ctx);
47983 +       ret = spu_acquire(ctx);
47984 +       if (ret)
47985 +               return ret;
47986 +
47987 +       ret = -EINVAL;
47988         if (file->f_flags & O_NONBLOCK) {
47989                 status = ctx->ops->read_mfc_tagstatus(ctx);
47990                 if (!(status & ctx->tagwait))
47991                         ret = -EAGAIN;
47992                 else
47993 +                       /* XXX(hch): shouldn't we clear ret here? */
47994                         ctx->tagwait &= ~status;
47995         } else {
47996                 ret = spufs_wait(ctx->mfc_wq,
47997 @@ -1505,7 +1712,11 @@
47998         if (ret)
47999                 goto out;
48000  
48001 -       ret = spu_acquire_runnable(ctx, 0);
48002 +       ret = spu_acquire(ctx);
48003 +       if (ret)
48004 +               goto out;
48005 +
48006 +       ret = spufs_wait(ctx->run_wq, ctx->state == SPU_STATE_RUNNABLE);
48007         if (ret)
48008                 goto out;
48009  
48010 @@ -1539,7 +1750,11 @@
48011  
48012         poll_wait(file, &ctx->mfc_wq, wait);
48013  
48014 -       spu_acquire(ctx);
48015 +       /*
48016 +        * For now keep this uninterruptible and also ignore the rule
48017 +        * that poll should not sleep.  Will be fixed later.
48018 +        */
48019 +       mutex_lock(&ctx->state_mutex);
48020         ctx->ops->set_mfc_query(ctx, ctx->tagwait, 2);
48021         free_elements = ctx->ops->get_mfc_free_elements(ctx);
48022         tagstatus = ctx->ops->read_mfc_tagstatus(ctx);
48023 @@ -1562,7 +1777,9 @@
48024         struct spu_context *ctx = file->private_data;
48025         int ret;
48026  
48027 -       spu_acquire(ctx);
48028 +       ret = spu_acquire(ctx);
48029 +       if (ret)
48030 +               return ret;
48031  #if 0
48032  /* this currently hangs */
48033         ret = spufs_wait(ctx->mfc_wq,
48034 @@ -1605,12 +1822,18 @@
48035         .mmap    = spufs_mfc_mmap,
48036  };
48037  
48038 -static void spufs_npc_set(void *data, u64 val)
48039 +static int spufs_npc_set(void *data, u64 val)
48040  {
48041         struct spu_context *ctx = data;
48042 -       spu_acquire(ctx);
48043 +       int ret;
48044 +
48045 +       ret = spu_acquire(ctx);
48046 +       if (ret)
48047 +               return ret;
48048         ctx->ops->npc_write(ctx, val);
48049         spu_release(ctx);
48050 +
48051 +       return 0;
48052  }
48053  
48054  static u64 spufs_npc_get(struct spu_context *ctx)
48055 @@ -1620,13 +1843,19 @@
48056  DEFINE_SPUFS_ATTRIBUTE(spufs_npc_ops, spufs_npc_get, spufs_npc_set,
48057                        "0x%llx\n", SPU_ATTR_ACQUIRE);
48058  
48059 -static void spufs_decr_set(void *data, u64 val)
48060 +static int spufs_decr_set(void *data, u64 val)
48061  {
48062         struct spu_context *ctx = data;
48063         struct spu_lscsa *lscsa = ctx->csa.lscsa;
48064 -       spu_acquire_saved(ctx);
48065 +       int ret;
48066 +
48067 +       ret = spu_acquire_saved(ctx);
48068 +       if (ret)
48069 +               return ret;
48070         lscsa->decr.slot[0] = (u32) val;
48071         spu_release_saved(ctx);
48072 +
48073 +       return 0;
48074  }
48075  
48076  static u64 spufs_decr_get(struct spu_context *ctx)
48077 @@ -1637,15 +1866,21 @@
48078  DEFINE_SPUFS_ATTRIBUTE(spufs_decr_ops, spufs_decr_get, spufs_decr_set,
48079                        "0x%llx\n", SPU_ATTR_ACQUIRE_SAVED);
48080  
48081 -static void spufs_decr_status_set(void *data, u64 val)
48082 +static int spufs_decr_status_set(void *data, u64 val)
48083  {
48084         struct spu_context *ctx = data;
48085 -       spu_acquire_saved(ctx);
48086 +       int ret;
48087 +
48088 +       ret = spu_acquire_saved(ctx);
48089 +       if (ret)
48090 +               return ret;
48091         if (val)
48092                 ctx->csa.priv2.mfc_control_RW |= MFC_CNTL_DECREMENTER_RUNNING;
48093         else
48094                 ctx->csa.priv2.mfc_control_RW &= ~MFC_CNTL_DECREMENTER_RUNNING;
48095         spu_release_saved(ctx);
48096 +
48097 +       return 0;
48098  }
48099  
48100  static u64 spufs_decr_status_get(struct spu_context *ctx)
48101 @@ -1659,13 +1894,19 @@
48102                        spufs_decr_status_set, "0x%llx\n",
48103                        SPU_ATTR_ACQUIRE_SAVED);
48104  
48105 -static void spufs_event_mask_set(void *data, u64 val)
48106 +static int spufs_event_mask_set(void *data, u64 val)
48107  {
48108         struct spu_context *ctx = data;
48109         struct spu_lscsa *lscsa = ctx->csa.lscsa;
48110 -       spu_acquire_saved(ctx);
48111 +       int ret;
48112 +
48113 +       ret = spu_acquire_saved(ctx);
48114 +       if (ret)
48115 +               return ret;
48116         lscsa->event_mask.slot[0] = (u32) val;
48117         spu_release_saved(ctx);
48118 +
48119 +       return 0;
48120  }
48121  
48122  static u64 spufs_event_mask_get(struct spu_context *ctx)
48123 @@ -1690,13 +1931,19 @@
48124  DEFINE_SPUFS_ATTRIBUTE(spufs_event_status_ops, spufs_event_status_get,
48125                        NULL, "0x%llx\n", SPU_ATTR_ACQUIRE_SAVED)
48126  
48127 -static void spufs_srr0_set(void *data, u64 val)
48128 +static int spufs_srr0_set(void *data, u64 val)
48129  {
48130         struct spu_context *ctx = data;
48131         struct spu_lscsa *lscsa = ctx->csa.lscsa;
48132 -       spu_acquire_saved(ctx);
48133 +       int ret;
48134 +
48135 +       ret = spu_acquire_saved(ctx);
48136 +       if (ret)
48137 +               return ret;
48138         lscsa->srr0.slot[0] = (u32) val;
48139         spu_release_saved(ctx);
48140 +
48141 +       return 0;
48142  }
48143  
48144  static u64 spufs_srr0_get(struct spu_context *ctx)
48145 @@ -1727,10 +1974,12 @@
48146         return ctx->object_id;
48147  }
48148  
48149 -static void spufs_object_id_set(void *data, u64 id)
48150 +static int spufs_object_id_set(void *data, u64 id)
48151  {
48152         struct spu_context *ctx = data;
48153         ctx->object_id = id;
48154 +
48155 +       return 0;
48156  }
48157  
48158  DEFINE_SPUFS_ATTRIBUTE(spufs_object_id_ops, spufs_object_id_get,
48159 @@ -1777,13 +2026,13 @@
48160  static ssize_t __spufs_mbox_info_read(struct spu_context *ctx,
48161                         char __user *buf, size_t len, loff_t *pos)
48162  {
48163 -       u32 mbox_stat;
48164         u32 data;
48165  
48166 -       mbox_stat = ctx->csa.prob.mb_stat_R;
48167 -       if (mbox_stat & 0x0000ff) {
48168 -               data = ctx->csa.prob.pu_mb_R;
48169 -       }
48170 +       /* EOF if there's no entry in the mbox */
48171 +       if (!(ctx->csa.prob.mb_stat_R & 0x0000ff))
48172 +               return 0;
48173 +
48174 +       data = ctx->csa.prob.pu_mb_R;
48175  
48176         return simple_read_from_buffer(buf, len, pos, &data, sizeof data);
48177  }
48178 @@ -1797,7 +2046,9 @@
48179         if (!access_ok(VERIFY_WRITE, buf, len))
48180                 return -EFAULT;
48181  
48182 -       spu_acquire_saved(ctx);
48183 +       ret = spu_acquire_saved(ctx);
48184 +       if (ret)
48185 +               return ret;
48186         spin_lock(&ctx->csa.register_lock);
48187         ret = __spufs_mbox_info_read(ctx, buf, len, pos);
48188         spin_unlock(&ctx->csa.register_lock);
48189 @@ -1815,13 +2066,13 @@
48190  static ssize_t __spufs_ibox_info_read(struct spu_context *ctx,
48191                                 char __user *buf, size_t len, loff_t *pos)
48192  {
48193 -       u32 ibox_stat;
48194         u32 data;
48195  
48196 -       ibox_stat = ctx->csa.prob.mb_stat_R;
48197 -       if (ibox_stat & 0xff0000) {
48198 -               data = ctx->csa.priv2.puint_mb_R;
48199 -       }
48200 +       /* EOF if there's no entry in the ibox */
48201 +       if (!(ctx->csa.prob.mb_stat_R & 0xff0000))
48202 +               return 0;
48203 +
48204 +       data = ctx->csa.priv2.puint_mb_R;
48205  
48206         return simple_read_from_buffer(buf, len, pos, &data, sizeof data);
48207  }
48208 @@ -1835,7 +2086,9 @@
48209         if (!access_ok(VERIFY_WRITE, buf, len))
48210                 return -EFAULT;
48211  
48212 -       spu_acquire_saved(ctx);
48213 +       ret = spu_acquire_saved(ctx);
48214 +       if (ret)
48215 +               return ret;
48216         spin_lock(&ctx->csa.register_lock);
48217         ret = __spufs_ibox_info_read(ctx, buf, len, pos);
48218         spin_unlock(&ctx->csa.register_lock);
48219 @@ -1876,7 +2129,9 @@
48220         if (!access_ok(VERIFY_WRITE, buf, len))
48221                 return -EFAULT;
48222  
48223 -       spu_acquire_saved(ctx);
48224 +       ret = spu_acquire_saved(ctx);
48225 +       if (ret)
48226 +               return ret;
48227         spin_lock(&ctx->csa.register_lock);
48228         ret = __spufs_wbox_info_read(ctx, buf, len, pos);
48229         spin_unlock(&ctx->csa.register_lock);
48230 @@ -1926,7 +2181,9 @@
48231         if (!access_ok(VERIFY_WRITE, buf, len))
48232                 return -EFAULT;
48233  
48234 -       spu_acquire_saved(ctx);
48235 +       ret = spu_acquire_saved(ctx);
48236 +       if (ret)
48237 +               return ret;
48238         spin_lock(&ctx->csa.register_lock);
48239         ret = __spufs_dma_info_read(ctx, buf, len, pos);
48240         spin_unlock(&ctx->csa.register_lock);
48241 @@ -1977,7 +2234,9 @@
48242         struct spu_context *ctx = file->private_data;
48243         int ret;
48244  
48245 -       spu_acquire_saved(ctx);
48246 +       ret = spu_acquire_saved(ctx);
48247 +       if (ret)
48248 +               return ret;
48249         spin_lock(&ctx->csa.register_lock);
48250         ret = __spufs_proxydma_info_read(ctx, buf, len, pos);
48251         spin_unlock(&ctx->csa.register_lock);
48252 @@ -2066,8 +2325,12 @@
48253  static int spufs_show_stat(struct seq_file *s, void *private)
48254  {
48255         struct spu_context *ctx = s->private;
48256 +       int ret;
48257 +
48258 +       ret = spu_acquire(ctx);
48259 +       if (ret)
48260 +               return ret;
48261  
48262 -       spu_acquire(ctx);
48263         seq_printf(s, "%s %llu %llu %llu %llu "
48264                       "%llu %llu %llu %llu %llu %llu %llu %llu\n",
48265                 ctx_state_names[ctx->stats.util_state],
48266 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/cell/spufs/hw_ops.c powerpc.git/arch/powerpc/platforms/cell/spufs/hw_ops.c
48267 --- linux-2.6.24/arch/powerpc/platforms/cell/spufs/hw_ops.c     2008-01-24 23:58:37.000000000 +0100
48268 +++ powerpc.git/arch/powerpc/platforms/cell/spufs/hw_ops.c      2008-01-28 20:25:49.000000000 +0100
48269 @@ -76,16 +76,18 @@
48270                 if (stat & 0xff0000)
48271                         ret |= POLLIN | POLLRDNORM;
48272                 else {
48273 -                       spu_int_stat_clear(spu, 2, 0x1);
48274 -                       spu_int_mask_or(spu, 2, 0x1);
48275 +                       spu_int_stat_clear(spu, 2, CLASS2_MAILBOX_INTR);
48276 +                       spu_int_mask_or(spu, 2, CLASS2_ENABLE_MAILBOX_INTR);
48277                 }
48278         }
48279         if (events & (POLLOUT | POLLWRNORM)) {
48280                 if (stat & 0x00ff00)
48281                         ret = POLLOUT | POLLWRNORM;
48282                 else {
48283 -                       spu_int_stat_clear(spu, 2, 0x10);
48284 -                       spu_int_mask_or(spu, 2, 0x10);
48285 +                       spu_int_stat_clear(spu, 2,
48286 +                                       CLASS2_MAILBOX_THRESHOLD_INTR);
48287 +                       spu_int_mask_or(spu, 2,
48288 +                                       CLASS2_ENABLE_MAILBOX_THRESHOLD_INTR);
48289                 }
48290         }
48291         spin_unlock_irq(&spu->register_lock);
48292 @@ -106,7 +108,7 @@
48293                 ret = 4;
48294         } else {
48295                 /* make sure we get woken up by the interrupt */
48296 -               spu_int_mask_or(spu, 2, 0x1);
48297 +               spu_int_mask_or(spu, 2, CLASS2_ENABLE_MAILBOX_INTR);
48298                 ret = 0;
48299         }
48300         spin_unlock_irq(&spu->register_lock);
48301 @@ -127,7 +129,7 @@
48302         } else {
48303                 /* make sure we get woken up by the interrupt when space
48304                    becomes available */
48305 -               spu_int_mask_or(spu, 2, 0x10);
48306 +               spu_int_mask_or(spu, 2, CLASS2_ENABLE_MAILBOX_THRESHOLD_INTR);
48307                 ret = 0;
48308         }
48309         spin_unlock_irq(&spu->register_lock);
48310 @@ -206,6 +208,11 @@
48311         return ctx->spu->local_store;
48312  }
48313  
48314 +static void spu_hw_privcntl_write(struct spu_context *ctx, u64 val)
48315 +{
48316 +       out_be64(&ctx->spu->priv2->spu_privcntl_RW, val);
48317 +}
48318 +
48319  static u32 spu_hw_runcntl_read(struct spu_context *ctx)
48320  {
48321         return in_be32(&ctx->spu->problem->spu_runcntl_RW);
48322 @@ -215,11 +222,21 @@
48323  {
48324         spin_lock_irq(&ctx->spu->register_lock);
48325         if (val & SPU_RUNCNTL_ISOLATE)
48326 -               out_be64(&ctx->spu->priv2->spu_privcntl_RW, 4LL);
48327 +               spu_hw_privcntl_write(ctx,
48328 +                       SPU_PRIVCNT_LOAD_REQUEST_ENABLE_MASK);
48329         out_be32(&ctx->spu->problem->spu_runcntl_RW, val);
48330         spin_unlock_irq(&ctx->spu->register_lock);
48331  }
48332  
48333 +static void spu_hw_runcntl_stop(struct spu_context *ctx)
48334 +{
48335 +       spin_lock_irq(&ctx->spu->register_lock);
48336 +       out_be32(&ctx->spu->problem->spu_runcntl_RW, SPU_RUNCNTL_STOP);
48337 +       while (in_be32(&ctx->spu->problem->spu_status_R) & SPU_STATUS_RUNNING)
48338 +               cpu_relax();
48339 +       spin_unlock_irq(&ctx->spu->register_lock);
48340 +}
48341 +
48342  static void spu_hw_master_start(struct spu_context *ctx)
48343  {
48344         struct spu *spu = ctx->spu;
48345 @@ -319,8 +336,10 @@
48346         .npc_write = spu_hw_npc_write,
48347         .status_read = spu_hw_status_read,
48348         .get_ls = spu_hw_get_ls,
48349 +       .privcntl_write = spu_hw_privcntl_write,
48350         .runcntl_read = spu_hw_runcntl_read,
48351         .runcntl_write = spu_hw_runcntl_write,
48352 +       .runcntl_stop = spu_hw_runcntl_stop,
48353         .master_start = spu_hw_master_start,
48354         .master_stop = spu_hw_master_stop,
48355         .set_mfc_query = spu_hw_set_mfc_query,
48356 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c powerpc.git/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c
48357 --- linux-2.6.24/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c        2008-01-24 23:58:37.000000000 +0100
48358 +++ powerpc.git/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c 2008-01-28 20:25:49.000000000 +0100
48359 @@ -28,6 +28,8 @@
48360  #include <asm/spu_csa.h>
48361  #include <asm/mmu.h>
48362  
48363 +#include "spufs.h"
48364 +
48365  static int spu_alloc_lscsa_std(struct spu_state *csa)
48366  {
48367         struct spu_lscsa *lscsa;
48368 @@ -73,7 +75,7 @@
48369         int             i, j, n_4k;
48370  
48371         /* Check availability of 64K pages */
48372 -       if (mmu_psize_defs[MMU_PAGE_64K].shift == 0)
48373 +       if (!spu_64k_pages_available())
48374                 goto fail;
48375  
48376         csa->use_big_pages = 1;
48377 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/cell/spufs/run.c powerpc.git/arch/powerpc/platforms/cell/spufs/run.c
48378 --- linux-2.6.24/arch/powerpc/platforms/cell/spufs/run.c        2008-01-24 23:58:37.000000000 +0100
48379 +++ powerpc.git/arch/powerpc/platforms/cell/spufs/run.c 2008-01-28 20:25:49.000000000 +0100
48380 @@ -15,24 +15,55 @@
48381  {
48382         struct spu_context *ctx = spu->ctx;
48383  
48384 -       wake_up_all(&ctx->stop_wq);
48385 +       /*
48386 +        * It should be impossible to preempt a context while an exception
48387 +        * is being processed, since the context switch code is specially
48388 +        * coded to deal with interrupts ... But, just in case, sanity check
48389 +        * the context pointer.  It is OK to return doing nothing since
48390 +        * the exception will be regenerated when the context is resumed.
48391 +        */
48392 +       if (ctx) {
48393 +               /* Copy exception arguments into module specific structure */
48394 +               ctx->csa.class_0_pending = spu->class_0_pending;
48395 +               ctx->csa.dsisr = spu->dsisr;
48396 +               ctx->csa.dar = spu->dar;
48397 +
48398 +               /* ensure that the exception status has hit memory before a
48399 +                * thread waiting on the context's stop queue is woken */
48400 +               smp_wmb();
48401 +
48402 +               wake_up_all(&ctx->stop_wq);
48403 +       }
48404 +
48405 +       /* Clear callback arguments from spu structure */
48406 +       spu->class_0_pending = 0;
48407 +       spu->dsisr = 0;
48408 +       spu->dar = 0;
48409  }
48410  
48411 -static inline int spu_stopped(struct spu_context *ctx, u32 *stat)
48412 +int spu_stopped(struct spu_context *ctx, u32 *stat)
48413  {
48414 -       struct spu *spu;
48415 -       u64 pte_fault;
48416 +       u64 dsisr;
48417 +       u32 stopped;
48418  
48419         *stat = ctx->ops->status_read(ctx);
48420  
48421 -       spu = ctx->spu;
48422 -       if (ctx->state != SPU_STATE_RUNNABLE ||
48423 -           test_bit(SPU_SCHED_NOTIFY_ACTIVE, &ctx->sched_flags))
48424 +       if (test_bit(SPU_SCHED_NOTIFY_ACTIVE, &ctx->sched_flags))
48425 +               return 1;
48426 +
48427 +       stopped = SPU_STATUS_INVALID_INSTR | SPU_STATUS_SINGLE_STEP |
48428 +               SPU_STATUS_STOPPED_BY_HALT | SPU_STATUS_STOPPED_BY_STOP;
48429 +       if (*stat & stopped)
48430 +               return 1;
48431 +
48432 +       dsisr = ctx->csa.dsisr;
48433 +       if (dsisr & (MFC_DSISR_PTE_NOT_FOUND | MFC_DSISR_ACCESS_DENIED))
48434                 return 1;
48435 -       pte_fault = spu->dsisr &
48436 -           (MFC_DSISR_PTE_NOT_FOUND | MFC_DSISR_ACCESS_DENIED);
48437 -       return (!(*stat & SPU_STATUS_RUNNING) || pte_fault || spu->class_0_pending) ?
48438 -               1 : 0;
48439 +
48440 +       if (ctx->csa.class_0_pending)
48441 +               return 1;
48442 +
48443 +       return 0;
48444  }
48445  
48446  static int spu_setup_isolated(struct spu_context *ctx)
48447 @@ -128,34 +159,66 @@
48448  
48449  static int spu_run_init(struct spu_context *ctx, u32 *npc)
48450  {
48451 +       unsigned long runcntl = SPU_RUNCNTL_RUNNABLE;
48452 +       int ret;
48453 +
48454         spuctx_switch_state(ctx, SPU_UTIL_SYSTEM);
48455  
48456 -       if (ctx->flags & SPU_CREATE_ISOLATE) {
48457 -               unsigned long runcntl;
48458 +       /*
48459 +        * NOSCHED is synchronous scheduling with respect to the caller.
48460 +        * The caller waits for the context to be loaded.
48461 +        */
48462 +       if (ctx->flags & SPU_CREATE_NOSCHED) {
48463 +               if (ctx->state == SPU_STATE_SAVED) {
48464 +                       ret = spu_activate(ctx, 0);
48465 +                       if (ret)
48466 +                               return ret;
48467 +               }
48468 +       }
48469  
48470 +       /*
48471 +        * Apply special setup as required.
48472 +        */
48473 +       if (ctx->flags & SPU_CREATE_ISOLATE) {
48474                 if (!(ctx->ops->status_read(ctx) & SPU_STATUS_ISOLATED_STATE)) {
48475 -                       int ret = spu_setup_isolated(ctx);
48476 +                       ret = spu_setup_isolated(ctx);
48477                         if (ret)
48478                                 return ret;
48479                 }
48480  
48481 -               /* if userspace has set the runcntrl register (eg, to issue an
48482 -                * isolated exit), we need to re-set it here */
48483 +               /*
48484 +                * If userspace has set the runcntrl register (eg, to
48485 +                * issue an isolated exit), we need to re-set it here
48486 +                */
48487                 runcntl = ctx->ops->runcntl_read(ctx) &
48488                         (SPU_RUNCNTL_RUNNABLE | SPU_RUNCNTL_ISOLATE);
48489                 if (runcntl == 0)
48490                         runcntl = SPU_RUNCNTL_RUNNABLE;
48491 +       }
48492 +
48493 +       if (ctx->flags & SPU_CREATE_NOSCHED) {
48494 +               spuctx_switch_state(ctx, SPU_UTIL_USER);
48495                 ctx->ops->runcntl_write(ctx, runcntl);
48496         } else {
48497 -               unsigned long mode = SPU_PRIVCNTL_MODE_NORMAL;
48498 -               ctx->ops->npc_write(ctx, *npc);
48499 +               unsigned long privcntl;
48500 +
48501                 if (test_thread_flag(TIF_SINGLESTEP))
48502 -                       mode = SPU_PRIVCNTL_MODE_SINGLE_STEP;
48503 -               out_be64(&ctx->spu->priv2->spu_privcntl_RW, mode);
48504 -               ctx->ops->runcntl_write(ctx, SPU_RUNCNTL_RUNNABLE);
48505 -       }
48506 +                       privcntl = SPU_PRIVCNTL_MODE_SINGLE_STEP;
48507 +               else
48508 +                       privcntl = SPU_PRIVCNTL_MODE_NORMAL;
48509  
48510 -       spuctx_switch_state(ctx, SPU_UTIL_USER);
48511 +               ctx->ops->npc_write(ctx, *npc);
48512 +               ctx->ops->privcntl_write(ctx, privcntl);
48513 +               ctx->ops->runcntl_write(ctx, runcntl);
48514 +
48515 +               if (ctx->state == SPU_STATE_SAVED) {
48516 +                       ret = spu_activate(ctx, 0);
48517 +                       if (ret)
48518 +                               return ret;
48519 +               } else {
48520 +                       spuctx_switch_state(ctx, SPU_UTIL_USER);
48521 +               }
48522 +       }
48523  
48524         return 0;
48525  }
48526 @@ -165,6 +228,8 @@
48527  {
48528         int ret = 0;
48529  
48530 +       spu_del_from_rq(ctx);
48531 +
48532         *status = ctx->ops->status_read(ctx);
48533         *npc = ctx->ops->npc_read(ctx);
48534  
48535 @@ -177,26 +242,6 @@
48536         return ret;
48537  }
48538  
48539 -static int spu_reacquire_runnable(struct spu_context *ctx, u32 *npc,
48540 -                                        u32 *status)
48541 -{
48542 -       int ret;
48543 -
48544 -       ret = spu_run_fini(ctx, npc, status);
48545 -       if (ret)
48546 -               return ret;
48547 -
48548 -       if (*status & (SPU_STATUS_STOPPED_BY_STOP | SPU_STATUS_STOPPED_BY_HALT))
48549 -               return *status;
48550 -
48551 -       ret = spu_acquire_runnable(ctx, 0);
48552 -       if (ret)
48553 -               return ret;
48554 -
48555 -       spuctx_switch_state(ctx, SPU_UTIL_USER);
48556 -       return 0;
48557 -}
48558 -
48559  /*
48560   * SPU syscall restarting is tricky because we violate the basic
48561   * assumption that the signal handler is running on the interrupted
48562 @@ -247,7 +292,7 @@
48563         u32 ls_pointer, npc;
48564         void __iomem *ls;
48565         long spu_ret;
48566 -       int ret;
48567 +       int ret, ret2;
48568  
48569         /* get syscall block from local store */
48570         npc = ctx->ops->npc_read(ctx) & ~3;
48571 @@ -269,9 +314,11 @@
48572                 if (spu_ret <= -ERESTARTSYS) {
48573                         ret = spu_handle_restartsys(ctx, &spu_ret, &npc);
48574                 }
48575 -               spu_acquire(ctx);
48576 +               ret2 = spu_acquire(ctx);
48577                 if (ret == -ERESTARTSYS)
48578                         return ret;
48579 +               if (ret2)
48580 +                       return -EINTR;
48581         }
48582  
48583         /* write result, jump over indirect pointer */
48584 @@ -281,18 +328,6 @@
48585         return ret;
48586  }
48587  
48588 -static inline int spu_process_events(struct spu_context *ctx)
48589 -{
48590 -       struct spu *spu = ctx->spu;
48591 -       int ret = 0;
48592 -
48593 -       if (spu->class_0_pending)
48594 -               ret = spu_irq_class_0_bottom(spu);
48595 -       if (!ret && signal_pending(current))
48596 -               ret = -ERESTARTSYS;
48597 -       return ret;
48598 -}
48599 -
48600  long spufs_run_spu(struct spu_context *ctx, u32 *npc, u32 *event)
48601  {
48602         int ret;
48603 @@ -302,29 +337,14 @@
48604         if (mutex_lock_interruptible(&ctx->run_mutex))
48605                 return -ERESTARTSYS;
48606  
48607 -       ctx->ops->master_start(ctx);
48608 +       spu_enable_spu(ctx);
48609         ctx->event_return = 0;
48610  
48611 -       spu_acquire(ctx);
48612 -       if (ctx->state == SPU_STATE_SAVED) {
48613 -               __spu_update_sched_info(ctx);
48614 -               spu_set_timeslice(ctx);
48615 -
48616 -               ret = spu_activate(ctx, 0);
48617 -               if (ret) {
48618 -                       spu_release(ctx);
48619 -                       goto out;
48620 -               }
48621 -       } else {
48622 -               /*
48623 -                * We have to update the scheduling priority under active_mutex
48624 -                * to protect against find_victim().
48625 -                *
48626 -                * No need to update the timeslice ASAP, it will get updated
48627 -                * once the current one has expired.
48628 -                */
48629 -               spu_update_sched_info(ctx);
48630 -       }
48631 +       ret = spu_acquire(ctx);
48632 +       if (ret)
48633 +               goto out_unlock;
48634 +
48635 +       spu_update_sched_info(ctx);
48636  
48637         ret = spu_run_init(ctx, npc);
48638         if (ret) {
48639 @@ -358,14 +378,12 @@
48640                 if (ret)
48641                         break;
48642  
48643 -               if (unlikely(ctx->state != SPU_STATE_RUNNABLE)) {
48644 -                       ret = spu_reacquire_runnable(ctx, npc, &status);
48645 -                       if (ret)
48646 -                               goto out2;
48647 -                       continue;
48648 -               }
48649 -               ret = spu_process_events(ctx);
48650 +               ret = spufs_handle_class0(ctx);
48651 +               if (ret)
48652 +                       break;
48653  
48654 +               if (signal_pending(current))
48655 +                       ret = -ERESTARTSYS;
48656         } while (!ret && !(status & (SPU_STATUS_STOPPED_BY_STOP |
48657                                       SPU_STATUS_STOPPED_BY_HALT |
48658                                        SPU_STATUS_SINGLE_STEP)));
48659 @@ -376,11 +394,10 @@
48660                 ctx->stats.libassist++;
48661  
48662  
48663 -       ctx->ops->master_stop(ctx);
48664 +       spu_disable_spu(ctx);
48665         ret = spu_run_fini(ctx, npc, &status);
48666         spu_yield(ctx);
48667  
48668 -out2:
48669         if ((ret == 0) ||
48670             ((ret == -ERESTARTSYS) &&
48671              ((status & SPU_STATUS_STOPPED_BY_HALT) ||
48672 @@ -401,6 +418,7 @@
48673  
48674  out:
48675         *event = ctx->event_return;
48676 +out_unlock:
48677         mutex_unlock(&ctx->run_mutex);
48678         return ret;
48679  }
48680 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/cell/spufs/sched.c powerpc.git/arch/powerpc/platforms/cell/spufs/sched.c
48681 --- linux-2.6.24/arch/powerpc/platforms/cell/spufs/sched.c      2008-01-24 23:58:37.000000000 +0100
48682 +++ powerpc.git/arch/powerpc/platforms/cell/spufs/sched.c       2008-01-28 20:25:49.000000000 +0100
48683 @@ -58,6 +58,7 @@
48684  static struct spu_prio_array *spu_prio;
48685  static struct task_struct *spusched_task;
48686  static struct timer_list spusched_timer;
48687 +static struct timer_list spuloadavg_timer;
48688  
48689  /*
48690   * Priority of a normal, non-rt, non-niced'd process (aka nice level 0).
48691 @@ -105,15 +106,21 @@
48692  void __spu_update_sched_info(struct spu_context *ctx)
48693  {
48694         /*
48695 -        * 32-Bit assignment are atomic on powerpc, and we don't care about
48696 -        * memory ordering here because retriving the controlling thread is
48697 -        * per defintion racy.
48698 +        * assert that the context is not on the runqueue, so it is safe
48699 +        * to change its scheduling parameters.
48700 +        */
48701 +       BUG_ON(!list_empty(&ctx->rq));
48702 +
48703 +       /*
48704 +        * 32-Bit assignments are atomic on powerpc, and we don't care about
48705 +        * memory ordering here because retrieving the controlling thread is
48706 +        * per definition racy.
48707          */
48708         ctx->tid = current->pid;
48709  
48710         /*
48711          * We do our own priority calculations, so we normally want
48712 -        * ->static_prio to start with. Unfortunately thies field
48713 +        * ->static_prio to start with. Unfortunately this field
48714          * contains junk for threads with a realtime scheduling
48715          * policy so we have to look at ->prio in this case.
48716          */
48717 @@ -124,23 +131,32 @@
48718         ctx->policy = current->policy;
48719  
48720         /*
48721 -        * A lot of places that don't hold list_mutex poke into
48722 -        * cpus_allowed, including grab_runnable_context which
48723 -        * already holds the runq_lock.  So abuse runq_lock
48724 -        * to protect this field aswell.
48725 +        * TO DO: the context may be loaded, so we may need to activate
48726 +        * it again on a different node. But it shouldn't hurt anything
48727 +        * to update its parameters, because we know that the scheduler
48728 +        * is not actively looking at this field, since it is not on the
48729 +        * runqueue. The context will be rescheduled on the proper node
48730 +        * if it is timesliced or preempted.
48731          */
48732 -       spin_lock(&spu_prio->runq_lock);
48733         ctx->cpus_allowed = current->cpus_allowed;
48734 -       spin_unlock(&spu_prio->runq_lock);
48735  }
48736  
48737  void spu_update_sched_info(struct spu_context *ctx)
48738  {
48739 -       int node = ctx->spu->node;
48740 +       int node;
48741  
48742 -       mutex_lock(&cbe_spu_info[node].list_mutex);
48743 -       __spu_update_sched_info(ctx);
48744 -       mutex_unlock(&cbe_spu_info[node].list_mutex);
48745 +       if (ctx->state == SPU_STATE_RUNNABLE) {
48746 +               node = ctx->spu->node;
48747 +
48748 +               /*
48749 +                * Take list_mutex to sync with find_victim().
48750 +                */
48751 +               mutex_lock(&cbe_spu_info[node].list_mutex);
48752 +               __spu_update_sched_info(ctx);
48753 +               mutex_unlock(&cbe_spu_info[node].list_mutex);
48754 +       } else {
48755 +               __spu_update_sched_info(ctx);
48756 +       }
48757  }
48758  
48759  static int __node_allowed(struct spu_context *ctx, int node)
48760 @@ -174,7 +190,7 @@
48761          * Wake up the active spu_contexts.
48762          *
48763          * When the awakened processes see their "notify_active" flag is set,
48764 -        * they will call spu_switch_notify();
48765 +        * they will call spu_switch_notify().
48766          */
48767         for_each_online_node(node) {
48768                 struct spu *spu;
48769 @@ -221,7 +237,6 @@
48770         spu->wbox_callback = spufs_wbox_callback;
48771         spu->stop_callback = spufs_stop_callback;
48772         spu->mfc_callback = spufs_mfc_callback;
48773 -       spu->dma_callback = spufs_dma_callback;
48774         mb();
48775         spu_unmap_mappings(ctx);
48776         spu_restore(&ctx->csa, spu);
48777 @@ -409,7 +424,6 @@
48778         spu->wbox_callback = NULL;
48779         spu->stop_callback = NULL;
48780         spu->mfc_callback = NULL;
48781 -       spu->dma_callback = NULL;
48782         spu_associate_mm(spu, NULL);
48783         spu->pid = 0;
48784         spu->tgid = 0;
48785 @@ -454,6 +468,13 @@
48786         }
48787  }
48788  
48789 +static void spu_add_to_rq(struct spu_context *ctx)
48790 +{
48791 +       spin_lock(&spu_prio->runq_lock);
48792 +       __spu_add_to_rq(ctx);
48793 +       spin_unlock(&spu_prio->runq_lock);
48794 +}
48795 +
48796  static void __spu_del_from_rq(struct spu_context *ctx)
48797  {
48798         int prio = ctx->prio;
48799 @@ -468,10 +489,24 @@
48800         }
48801  }
48802  
48803 +void spu_del_from_rq(struct spu_context *ctx)
48804 +{
48805 +       spin_lock(&spu_prio->runq_lock);
48806 +       __spu_del_from_rq(ctx);
48807 +       spin_unlock(&spu_prio->runq_lock);
48808 +}
48809 +
48810  static void spu_prio_wait(struct spu_context *ctx)
48811  {
48812         DEFINE_WAIT(wait);
48813  
48814 +       /*
48815 +        * The caller must explicitly wait for a context to be loaded
48816 +        * if the nosched flag is set.  If NOSCHED is not set, the caller
48817 +        * queues the context and waits for an spu event or error.
48818 +        */
48819 +       BUG_ON(!(ctx->flags & SPU_CREATE_NOSCHED));
48820 +
48821         spin_lock(&spu_prio->runq_lock);
48822         prepare_to_wait_exclusive(&ctx->stop_wq, &wait, TASK_INTERRUPTIBLE);
48823         if (!signal_pending(current)) {
48824 @@ -555,7 +590,7 @@
48825         /*
48826          * Look for a possible preemption candidate on the local node first.
48827          * If there is no candidate look at the other nodes.  This isn't
48828 -        * exactly fair, but so far the whole spu schedule tries to keep
48829 +        * exactly fair, but so far the whole spu scheduler tries to keep
48830          * a strong node affinity.  We might want to fine-tune this in
48831          * the future.
48832          */
48833 @@ -571,6 +606,7 @@
48834                         struct spu_context *tmp = spu->ctx;
48835  
48836                         if (tmp && tmp->prio > ctx->prio &&
48837 +                           !(tmp->flags & SPU_CREATE_NOSCHED) &&
48838                             (!victim || tmp->prio > victim->prio))
48839                                 victim = spu->ctx;
48840                 }
48841 @@ -582,6 +618,10 @@
48842                          * higher priority contexts before lower priority
48843                          * ones, so this is safe until we introduce
48844                          * priority inheritance schemes.
48845 +                        *
48846 +                        * XXX if the highest priority context is locked,
48847 +                        * this can loop a long time.  Might be better to
48848 +                        * look at another context or give up after X retries.
48849                          */
48850                         if (!mutex_trylock(&victim->state_mutex)) {
48851                                 victim = NULL;
48852 @@ -589,10 +629,10 @@
48853                         }
48854  
48855                         spu = victim->spu;
48856 -                       if (!spu) {
48857 +                       if (!spu || victim->prio <= ctx->prio) {
48858                                 /*
48859                                  * This race can happen because we've dropped
48860 -                                * the active list mutex.  No a problem, just
48861 +                                * the active list mutex.  Not a problem, just
48862                                  * restart the search.
48863                                  */
48864                                 mutex_unlock(&victim->state_mutex);
48865 @@ -607,13 +647,10 @@
48866  
48867                         victim->stats.invol_ctx_switch++;
48868                         spu->stats.invol_ctx_switch++;
48869 +                       spu_add_to_rq(victim);
48870 +
48871                         mutex_unlock(&victim->state_mutex);
48872 -                       /*
48873 -                        * We need to break out of the wait loop in spu_run
48874 -                        * manually to ensure this context gets put on the
48875 -                        * runqueue again ASAP.
48876 -                        */
48877 -                       wake_up(&victim->stop_wq);
48878 +
48879                         return spu;
48880                 }
48881         }
48882 @@ -621,6 +658,50 @@
48883         return NULL;
48884  }
48885  
48886 +static void __spu_schedule(struct spu *spu, struct spu_context *ctx)
48887 +{
48888 +       int node = spu->node;
48889 +       int success = 0;
48890 +
48891 +       spu_set_timeslice(ctx);
48892 +
48893 +       mutex_lock(&cbe_spu_info[node].list_mutex);
48894 +       if (spu->ctx == NULL) {
48895 +               spu_bind_context(spu, ctx);
48896 +               cbe_spu_info[node].nr_active++;
48897 +               spu->alloc_state = SPU_USED;
48898 +               success = 1;
48899 +       }
48900 +       mutex_unlock(&cbe_spu_info[node].list_mutex);
48901 +
48902 +       if (success)
48903 +               wake_up_all(&ctx->run_wq);
48904 +       else
48905 +               spu_add_to_rq(ctx);
48906 +}
48907 +
48908 +static void spu_schedule(struct spu *spu, struct spu_context *ctx)
48909 +{
48910 +       /* not a candidate for interruptible because it's called either
48911 +          from the scheduler thread or from spu_deactivate */
48912 +       mutex_lock(&ctx->state_mutex);
48913 +       __spu_schedule(spu, ctx);
48914 +       spu_release(ctx);
48915 +}
48916 +
48917 +static void spu_unschedule(struct spu *spu, struct spu_context *ctx)
48918 +{
48919 +       int node = spu->node;
48920 +
48921 +       mutex_lock(&cbe_spu_info[node].list_mutex);
48922 +       cbe_spu_info[node].nr_active--;
48923 +       spu->alloc_state = SPU_FREE;
48924 +       spu_unbind_context(spu, ctx);
48925 +       ctx->stats.invol_ctx_switch++;
48926 +       spu->stats.invol_ctx_switch++;
48927 +       mutex_unlock(&cbe_spu_info[node].list_mutex);
48928 +}
48929 +
48930  /**
48931   * spu_activate - find a free spu for a context and execute it
48932   * @ctx:       spu context to schedule
48933 @@ -632,39 +713,47 @@
48934   */
48935  int spu_activate(struct spu_context *ctx, unsigned long flags)
48936  {
48937 -       do {
48938 -               struct spu *spu;
48939 +       struct spu *spu;
48940  
48941 -               /*
48942 -                * If there are multiple threads waiting for a single context
48943 -                * only one actually binds the context while the others will
48944 -                * only be able to acquire the state_mutex once the context
48945 -                * already is in runnable state.
48946 -                */
48947 -               if (ctx->spu)
48948 -                       return 0;
48949 +       /*
48950 +        * If there are multiple threads waiting for a single context
48951 +        * only one actually binds the context while the others will
48952 +        * only be able to acquire the state_mutex once the context
48953 +        * already is in runnable state.
48954 +        */
48955 +       if (ctx->spu)
48956 +               return 0;
48957  
48958 -               spu = spu_get_idle(ctx);
48959 -               /*
48960 -                * If this is a realtime thread we try to get it running by
48961 -                * preempting a lower priority thread.
48962 -                */
48963 -               if (!spu && rt_prio(ctx->prio))
48964 -                       spu = find_victim(ctx);
48965 -               if (spu) {
48966 -                       int node = spu->node;
48967 +spu_activate_top:
48968 +       if (signal_pending(current))
48969 +               return -ERESTARTSYS;
48970  
48971 -                       mutex_lock(&cbe_spu_info[node].list_mutex);
48972 -                       spu_bind_context(spu, ctx);
48973 -                       cbe_spu_info[node].nr_active++;
48974 -                       mutex_unlock(&cbe_spu_info[node].list_mutex);
48975 -                       return 0;
48976 -               }
48977 +       spu = spu_get_idle(ctx);
48978 +       /*
48979 +        * If this is a realtime thread we try to get it running by
48980 +        * preempting a lower priority thread.
48981 +        */
48982 +       if (!spu && rt_prio(ctx->prio))
48983 +               spu = find_victim(ctx);
48984 +       if (spu) {
48985 +               unsigned long runcntl;
48986  
48987 +               runcntl = ctx->ops->runcntl_read(ctx);
48988 +               __spu_schedule(spu, ctx);
48989 +               if (runcntl & SPU_RUNCNTL_RUNNABLE)
48990 +                       spuctx_switch_state(ctx, SPU_UTIL_USER);
48991 +
48992 +               return 0;
48993 +       }
48994 +
48995 +       if (ctx->flags & SPU_CREATE_NOSCHED) {
48996                 spu_prio_wait(ctx);
48997 -       } while (!signal_pending(current));
48998 +               goto spu_activate_top;
48999 +       }
49000 +
49001 +       spu_add_to_rq(ctx);
49002  
49003 -       return -ERESTARTSYS;
49004 +       return 0;
49005  }
49006  
49007  /**
49008 @@ -706,21 +795,19 @@
49009         if (spu) {
49010                 new = grab_runnable_context(max_prio, spu->node);
49011                 if (new || force) {
49012 -                       int node = spu->node;
49013 -
49014 -                       mutex_lock(&cbe_spu_info[node].list_mutex);
49015 -                       spu_unbind_context(spu, ctx);
49016 -                       spu->alloc_state = SPU_FREE;
49017 -                       cbe_spu_info[node].nr_active--;
49018 -                       mutex_unlock(&cbe_spu_info[node].list_mutex);
49019 -
49020 -                       ctx->stats.vol_ctx_switch++;
49021 -                       spu->stats.vol_ctx_switch++;
49022 -
49023 -                       if (new)
49024 -                               wake_up(&new->stop_wq);
49025 +                       spu_unschedule(spu, ctx);
49026 +                       if (new) {
49027 +                               if (new->flags & SPU_CREATE_NOSCHED)
49028 +                                       wake_up(&new->stop_wq);
49029 +                               else {
49030 +                                       spu_release(ctx);
49031 +                                       spu_schedule(spu, new);
49032 +                                       /* this one can't easily be made
49033 +                                          interruptible */
49034 +                                       mutex_lock(&ctx->state_mutex);
49035 +                               }
49036 +                       }
49037                 }
49038 -
49039         }
49040  
49041         return new != NULL;
49042 @@ -757,43 +844,38 @@
49043  
49044  static noinline void spusched_tick(struct spu_context *ctx)
49045  {
49046 +       struct spu_context *new = NULL;
49047 +       struct spu *spu = NULL;
49048 +       u32 status;
49049 +
49050 +       if (spu_acquire(ctx))
49051 +               BUG();  /* a kernel thread never has signals pending */
49052 +
49053 +       if (ctx->state != SPU_STATE_RUNNABLE)
49054 +               goto out;
49055 +       if (spu_stopped(ctx, &status))
49056 +               goto out;
49057         if (ctx->flags & SPU_CREATE_NOSCHED)
49058 -               return;
49059 +               goto out;
49060         if (ctx->policy == SCHED_FIFO)
49061 -               return;
49062 +               goto out;
49063  
49064         if (--ctx->time_slice)
49065 -               return;
49066 -
49067 -       /*
49068 -        * Unfortunately list_mutex ranks outside of state_mutex, so
49069 -        * we have to trylock here.  If we fail give the context another
49070 -        * tick and try again.
49071 -        */
49072 -       if (mutex_trylock(&ctx->state_mutex)) {
49073 -               struct spu *spu = ctx->spu;
49074 -               struct spu_context *new;
49075 +               goto out;
49076  
49077 -               new = grab_runnable_context(ctx->prio + 1, spu->node);
49078 -               if (new) {
49079 -                       spu_unbind_context(spu, ctx);
49080 -                       ctx->stats.invol_ctx_switch++;
49081 -                       spu->stats.invol_ctx_switch++;
49082 -                       spu->alloc_state = SPU_FREE;
49083 -                       cbe_spu_info[spu->node].nr_active--;
49084 -                       wake_up(&new->stop_wq);
49085 -                       /*
49086 -                        * We need to break out of the wait loop in
49087 -                        * spu_run manually to ensure this context
49088 -                        * gets put on the runqueue again ASAP.
49089 -                        */
49090 -                       wake_up(&ctx->stop_wq);
49091 -               }
49092 -               spu_set_timeslice(ctx);
49093 -               mutex_unlock(&ctx->state_mutex);
49094 +       spu = ctx->spu;
49095 +       new = grab_runnable_context(ctx->prio + 1, spu->node);
49096 +       if (new) {
49097 +               spu_unschedule(spu, ctx);
49098 +               spu_add_to_rq(ctx);
49099         } else {
49100                 ctx->time_slice++;
49101         }
49102 +out:
49103 +       spu_release(ctx);
49104 +
49105 +       if (new)
49106 +               spu_schedule(spu, new);
49107  }
49108  
49109  /**
49110 @@ -817,35 +899,31 @@
49111  }
49112  
49113  /**
49114 - * spu_calc_load - given tick count, update the avenrun load estimates.
49115 - * @tick:      tick count
49116 + * spu_calc_load - update the avenrun load estimates.
49117   *
49118   * No locking against reading these values from userspace, as for
49119   * the CPU loadavg code.
49120   */
49121 -static void spu_calc_load(unsigned long ticks)
49122 +static void spu_calc_load(void)
49123  {
49124         unsigned long active_tasks; /* fixed-point */
49125 -       static int count = LOAD_FREQ;
49126  
49127 -       count -= ticks;
49128 -
49129 -       if (unlikely(count < 0)) {
49130 -               active_tasks = count_active_contexts() * FIXED_1;
49131 -               do {
49132 -                       CALC_LOAD(spu_avenrun[0], EXP_1, active_tasks);
49133 -                       CALC_LOAD(spu_avenrun[1], EXP_5, active_tasks);
49134 -                       CALC_LOAD(spu_avenrun[2], EXP_15, active_tasks);
49135 -                       count += LOAD_FREQ;
49136 -               } while (count < 0);
49137 -       }
49138 +       active_tasks = count_active_contexts() * FIXED_1;
49139 +       CALC_LOAD(spu_avenrun[0], EXP_1, active_tasks);
49140 +       CALC_LOAD(spu_avenrun[1], EXP_5, active_tasks);
49141 +       CALC_LOAD(spu_avenrun[2], EXP_15, active_tasks);
49142  }
49143  
49144  static void spusched_wake(unsigned long data)
49145  {
49146         mod_timer(&spusched_timer, jiffies + SPUSCHED_TICK);
49147         wake_up_process(spusched_task);
49148 -       spu_calc_load(SPUSCHED_TICK);
49149 +}
49150 +
49151 +static void spuloadavg_wake(unsigned long data)
49152 +{
49153 +       mod_timer(&spuloadavg_timer, jiffies + LOAD_FREQ);
49154 +       spu_calc_load();
49155  }
49156  
49157  static int spusched_thread(void *unused)
49158 @@ -857,17 +935,58 @@
49159                 set_current_state(TASK_INTERRUPTIBLE);
49160                 schedule();
49161                 for (node = 0; node < MAX_NUMNODES; node++) {
49162 -                       mutex_lock(&cbe_spu_info[node].list_mutex);
49163 -                       list_for_each_entry(spu, &cbe_spu_info[node].spus, cbe_list)
49164 -                               if (spu->ctx)
49165 -                                       spusched_tick(spu->ctx);
49166 -                       mutex_unlock(&cbe_spu_info[node].list_mutex);
49167 +                       struct mutex *mtx = &cbe_spu_info[node].list_mutex;
49168 +
49169 +                       mutex_lock(mtx);
49170 +                       list_for_each_entry(spu, &cbe_spu_info[node].spus,
49171 +                                       cbe_list) {
49172 +                               struct spu_context *ctx = spu->ctx;
49173 +
49174 +                               if (ctx) {
49175 +                                       mutex_unlock(mtx);
49176 +                                       spusched_tick(ctx);
49177 +                                       mutex_lock(mtx);
49178 +                               }
49179 +                       }
49180 +                       mutex_unlock(mtx);
49181                 }
49182         }
49183  
49184         return 0;
49185  }
49186  
49187 +void spuctx_switch_state(struct spu_context *ctx,
49188 +               enum spu_utilization_state new_state)
49189 +{
49190 +       unsigned long long curtime;
49191 +       signed long long delta;
49192 +       struct timespec ts;
49193 +       struct spu *spu;
49194 +       enum spu_utilization_state old_state;
49195 +
49196 +       ktime_get_ts(&ts);
49197 +       curtime = timespec_to_ns(&ts);
49198 +       delta = curtime - ctx->stats.tstamp;
49199 +
49200 +       WARN_ON(!mutex_is_locked(&ctx->state_mutex));
49201 +       WARN_ON(delta < 0);
49202 +
49203 +       spu = ctx->spu;
49204 +       old_state = ctx->stats.util_state;
49205 +       ctx->stats.util_state = new_state;
49206 +       ctx->stats.tstamp = curtime;
49207 +
49208 +       /*
49209 +        * Update the physical SPU utilization statistics.
49210 +        */
49211 +       if (spu) {
49212 +               ctx->stats.times[old_state] += delta;
49213 +               spu->stats.times[old_state] += delta;
49214 +               spu->stats.util_state = new_state;
49215 +               spu->stats.tstamp = curtime;
49216 +       }
49217 +}
49218 +
49219  #define LOAD_INT(x) ((x) >> FSHIFT)
49220  #define LOAD_FRAC(x) LOAD_INT(((x) & (FIXED_1-1)) * 100)
49221  
49222 @@ -881,7 +1000,7 @@
49223  
49224         /*
49225          * Note that last_pid doesn't really make much sense for the
49226 -        * SPU loadavg (it even seems very odd on the CPU side..),
49227 +        * SPU loadavg (it even seems very odd on the CPU side...),
49228          * but we include it here to have a 100% compatible interface.
49229          */
49230         seq_printf(s, "%d.%02d %d.%02d %d.%02d %ld/%d %d\n",
49231 @@ -922,6 +1041,7 @@
49232         spin_lock_init(&spu_prio->runq_lock);
49233  
49234         setup_timer(&spusched_timer, spusched_wake, 0);
49235 +       setup_timer(&spuloadavg_timer, spuloadavg_wake, 0);
49236  
49237         spusched_task = kthread_run(spusched_thread, NULL, "spusched");
49238         if (IS_ERR(spusched_task)) {
49239 @@ -929,6 +1049,8 @@
49240                 goto out_free_spu_prio;
49241         }
49242  
49243 +       mod_timer(&spuloadavg_timer, 0);
49244 +
49245         entry = create_proc_entry("spu_loadavg", 0, NULL);
49246         if (!entry)
49247                 goto out_stop_kthread;
49248 @@ -954,6 +1076,7 @@
49249         remove_proc_entry("spu_loadavg", NULL);
49250  
49251         del_timer_sync(&spusched_timer);
49252 +       del_timer_sync(&spuloadavg_timer);
49253         kthread_stop(spusched_task);
49254  
49255         for (node = 0; node < MAX_NUMNODES; node++) {
49256 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/cell/spufs/spufs.h powerpc.git/arch/powerpc/platforms/cell/spufs/spufs.h
49257 --- linux-2.6.24/arch/powerpc/platforms/cell/spufs/spufs.h      2008-01-24 23:58:37.000000000 +0100
49258 +++ powerpc.git/arch/powerpc/platforms/cell/spufs/spufs.h       2008-01-28 20:25:49.000000000 +0100
49259 @@ -71,6 +71,7 @@
49260         wait_queue_head_t wbox_wq;
49261         wait_queue_head_t stop_wq;
49262         wait_queue_head_t mfc_wq;
49263 +       wait_queue_head_t run_wq;
49264         struct fasync_struct *ibox_fasync;
49265         struct fasync_struct *wbox_fasync;
49266         struct fasync_struct *mfc_fasync;
49267 @@ -168,8 +169,10 @@
49268         void (*npc_write) (struct spu_context * ctx, u32 data);
49269          u32(*status_read) (struct spu_context * ctx);
49270         char*(*get_ls) (struct spu_context * ctx);
49271 +       void (*privcntl_write) (struct spu_context *ctx, u64 data);
49272          u32 (*runcntl_read) (struct spu_context * ctx);
49273         void (*runcntl_write) (struct spu_context * ctx, u32 data);
49274 +       void (*runcntl_stop) (struct spu_context * ctx);
49275         void (*master_start) (struct spu_context * ctx);
49276         void (*master_stop) (struct spu_context * ctx);
49277         int (*set_mfc_query)(struct spu_context * ctx, u32 mask, u32 mode);
49278 @@ -219,15 +222,16 @@
49279  
49280  /* fault handling */
49281  int spufs_handle_class1(struct spu_context *ctx);
49282 +int spufs_handle_class0(struct spu_context *ctx);
49283  
49284  /* affinity */
49285  struct spu *affinity_check(struct spu_context *ctx);
49286  
49287  /* context management */
49288  extern atomic_t nr_spu_contexts;
49289 -static inline void spu_acquire(struct spu_context *ctx)
49290 +static inline int __must_check spu_acquire(struct spu_context *ctx)
49291  {
49292 -       mutex_lock(&ctx->state_mutex);
49293 +       return mutex_lock_interruptible(&ctx->state_mutex);
49294  }
49295  
49296  static inline void spu_release(struct spu_context *ctx)
49297 @@ -242,10 +246,11 @@
49298  void spu_unmap_mappings(struct spu_context *ctx);
49299  
49300  void spu_forget(struct spu_context *ctx);
49301 -int spu_acquire_runnable(struct spu_context *ctx, unsigned long flags);
49302 -void spu_acquire_saved(struct spu_context *ctx);
49303 +int __must_check spu_acquire_saved(struct spu_context *ctx);
49304  void spu_release_saved(struct spu_context *ctx);
49305  
49306 +int spu_stopped(struct spu_context *ctx, u32 * stat);
49307 +void spu_del_from_rq(struct spu_context *ctx);
49308  int spu_activate(struct spu_context *ctx, unsigned long flags);
49309  void spu_deactivate(struct spu_context *ctx);
49310  void spu_yield(struct spu_context *ctx);
49311 @@ -279,7 +284,9 @@
49312                 }                                                       \
49313                 spu_release(ctx);                                       \
49314                 schedule();                                             \
49315 -               spu_acquire(ctx);                                       \
49316 +               __ret = spu_acquire(ctx);                               \
49317 +               if (__ret)                                              \
49318 +                       break;                                          \
49319         }                                                               \
49320         finish_wait(&(wq), &__wait);                                    \
49321         __ret;                                                          \
49322 @@ -306,41 +313,16 @@
49323  extern struct spufs_coredump_reader spufs_coredump_read[];
49324  extern int spufs_coredump_num_notes;
49325  
49326 -/*
49327 - * This function is a little bit too large for an inline, but
49328 - * as fault.c is built into the kernel we can't move it out of
49329 - * line.
49330 - */
49331 -static inline void spuctx_switch_state(struct spu_context *ctx,
49332 -               enum spu_utilization_state new_state)
49333 -{
49334 -       unsigned long long curtime;
49335 -       signed long long delta;
49336 -       struct timespec ts;
49337 -       struct spu *spu;
49338 -       enum spu_utilization_state old_state;
49339 -
49340 -       ktime_get_ts(&ts);
49341 -       curtime = timespec_to_ns(&ts);
49342 -       delta = curtime - ctx->stats.tstamp;
49343 -
49344 -       WARN_ON(!mutex_is_locked(&ctx->state_mutex));
49345 -       WARN_ON(delta < 0);
49346 -
49347 -       spu = ctx->spu;
49348 -       old_state = ctx->stats.util_state;
49349 -       ctx->stats.util_state = new_state;
49350 -       ctx->stats.tstamp = curtime;
49351 -
49352 -       /*
49353 -        * Update the physical SPU utilization statistics.
49354 -        */
49355 -       if (spu) {
49356 -               ctx->stats.times[old_state] += delta;
49357 -               spu->stats.times[old_state] += delta;
49358 -               spu->stats.util_state = new_state;
49359 -               spu->stats.tstamp = curtime;
49360 -       }
49361 -}
49362 +extern int spu_init_csa(struct spu_state *csa);
49363 +extern void spu_fini_csa(struct spu_state *csa);
49364 +extern int spu_save(struct spu_state *prev, struct spu *spu);
49365 +extern int spu_restore(struct spu_state *new, struct spu *spu);
49366 +extern int spu_switch(struct spu_state *prev, struct spu_state *new,
49367 +                     struct spu *spu);
49368 +extern int spu_alloc_lscsa(struct spu_state *csa);
49369 +extern void spu_free_lscsa(struct spu_state *csa);
49370 +
49371 +extern void spuctx_switch_state(struct spu_context *ctx,
49372 +               enum spu_utilization_state new_state);
49373  
49374  #endif
49375 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/cell/spufs/switch.c powerpc.git/arch/powerpc/platforms/cell/spufs/switch.c
49376 --- linux-2.6.24/arch/powerpc/platforms/cell/spufs/switch.c     2008-01-24 23:58:37.000000000 +0100
49377 +++ powerpc.git/arch/powerpc/platforms/cell/spufs/switch.c      2008-01-28 20:25:49.000000000 +0100
49378 @@ -48,6 +48,8 @@
49379  #include <asm/spu_csa.h>
49380  #include <asm/mmu_context.h>
49381  
49382 +#include "spufs.h"
49383 +
49384  #include "spu_save_dump.h"
49385  #include "spu_restore_dump.h"
49386  
49387 @@ -691,35 +693,9 @@
49388         out_be64(&priv2->mfc_control_RW, MFC_CNTL_RESUME_DMA_QUEUE);
49389  }
49390  
49391 -static inline void get_kernel_slb(u64 ea, u64 slb[2])
49392 +static inline void setup_mfc_slbs(struct spu_state *csa, struct spu *spu,
49393 +               unsigned int *code, int code_size)
49394  {
49395 -       u64 llp;
49396 -
49397 -       if (REGION_ID(ea) == KERNEL_REGION_ID)
49398 -               llp = mmu_psize_defs[mmu_linear_psize].sllp;
49399 -       else
49400 -               llp = mmu_psize_defs[mmu_virtual_psize].sllp;
49401 -       slb[0] = (get_kernel_vsid(ea, MMU_SEGSIZE_256M) << SLB_VSID_SHIFT) |
49402 -               SLB_VSID_KERNEL | llp;
49403 -       slb[1] = (ea & ESID_MASK) | SLB_ESID_V;
49404 -}
49405 -
49406 -static inline void load_mfc_slb(struct spu *spu, u64 slb[2], int slbe)
49407 -{
49408 -       struct spu_priv2 __iomem *priv2 = spu->priv2;
49409 -
49410 -       out_be64(&priv2->slb_index_W, slbe);
49411 -       eieio();
49412 -       out_be64(&priv2->slb_vsid_RW, slb[0]);
49413 -       out_be64(&priv2->slb_esid_RW, slb[1]);
49414 -       eieio();
49415 -}
49416 -
49417 -static inline void setup_mfc_slbs(struct spu_state *csa, struct spu *spu)
49418 -{
49419 -       u64 code_slb[2];
49420 -       u64 lscsa_slb[2];
49421 -
49422         /* Save, Step 47:
49423          * Restore, Step 30.
49424          *     If MFC_SR1[R]=1, write 0 to SLB_Invalidate_All
49425 @@ -735,11 +711,7 @@
49426          *     translation is desired by OS environment).
49427          */
49428         spu_invalidate_slbs(spu);
49429 -       get_kernel_slb((unsigned long)&spu_save_code[0], code_slb);
49430 -       get_kernel_slb((unsigned long)csa->lscsa, lscsa_slb);
49431 -       load_mfc_slb(spu, code_slb, 0);
49432 -       if ((lscsa_slb[0] != code_slb[0]) || (lscsa_slb[1] != code_slb[1]))
49433 -               load_mfc_slb(spu, lscsa_slb, 1);
49434 +       spu_setup_kernel_slbs(spu, csa->lscsa, code, code_size);
49435  }
49436  
49437  static inline void set_switch_active(struct spu_state *csa, struct spu *spu)
49438 @@ -768,9 +740,9 @@
49439          *     (translation) interrupts.
49440          */
49441         spin_lock_irq(&spu->register_lock);
49442 -       spu_int_stat_clear(spu, 0, ~0ul);
49443 -       spu_int_stat_clear(spu, 1, ~0ul);
49444 -       spu_int_stat_clear(spu, 2, ~0ul);
49445 +       spu_int_stat_clear(spu, 0, CLASS0_INTR_MASK);
49446 +       spu_int_stat_clear(spu, 1, CLASS1_INTR_MASK);
49447 +       spu_int_stat_clear(spu, 2, CLASS2_INTR_MASK);
49448         spu_int_mask_set(spu, 0, 0ul);
49449         spu_int_mask_set(spu, 1, class1_mask);
49450         spu_int_mask_set(spu, 2, 0ul);
49451 @@ -927,8 +899,8 @@
49452         POLL_WHILE_FALSE(in_be32(&prob->dma_tagstatus_R) & mask);
49453  
49454         local_irq_save(flags);
49455 -       spu_int_stat_clear(spu, 0, ~(0ul));
49456 -       spu_int_stat_clear(spu, 2, ~(0ul));
49457 +       spu_int_stat_clear(spu, 0, CLASS0_INTR_MASK);
49458 +       spu_int_stat_clear(spu, 2, CLASS2_INTR_MASK);
49459         local_irq_restore(flags);
49460  }
49461  
49462 @@ -946,8 +918,8 @@
49463         POLL_WHILE_TRUE(in_be32(&prob->spu_status_R) & SPU_STATUS_RUNNING);
49464  
49465         local_irq_save(flags);
49466 -       spu_int_stat_clear(spu, 0, ~(0ul));
49467 -       spu_int_stat_clear(spu, 2, ~(0ul));
49468 +       spu_int_stat_clear(spu, 0, CLASS0_INTR_MASK);
49469 +       spu_int_stat_clear(spu, 2, CLASS2_INTR_MASK);
49470         local_irq_restore(flags);
49471  }
49472  
49473 @@ -1423,9 +1395,9 @@
49474         spu_int_mask_set(spu, 0, 0ul);
49475         spu_int_mask_set(spu, 1, 0ul);
49476         spu_int_mask_set(spu, 2, 0ul);
49477 -       spu_int_stat_clear(spu, 0, ~0ul);
49478 -       spu_int_stat_clear(spu, 1, ~0ul);
49479 -       spu_int_stat_clear(spu, 2, ~0ul);
49480 +       spu_int_stat_clear(spu, 0, CLASS0_INTR_MASK);
49481 +       spu_int_stat_clear(spu, 1, CLASS1_INTR_MASK);
49482 +       spu_int_stat_clear(spu, 2, CLASS2_INTR_MASK);
49483         spin_unlock_irq(&spu->register_lock);
49484  }
49485  
49486 @@ -1866,7 +1838,8 @@
49487          */
49488  
49489         resume_mfc_queue(prev, spu);    /* Step 46. */
49490 -       setup_mfc_slbs(prev, spu);      /* Step 47. */
49491 +       /* Step 47. */
49492 +       setup_mfc_slbs(prev, spu, spu_save_code, sizeof(spu_save_code));
49493         set_switch_active(prev, spu);   /* Step 48. */
49494         enable_interrupts(prev, spu);   /* Step 49. */
49495         save_ls_16kb(prev, spu);        /* Step 50. */
49496 @@ -1971,7 +1944,8 @@
49497         setup_spu_status_part1(next, spu);      /* Step 27. */
49498         setup_spu_status_part2(next, spu);      /* Step 28. */
49499         restore_mfc_rag(next, spu);             /* Step 29. */
49500 -       setup_mfc_slbs(next, spu);              /* Step 30. */
49501 +       /* Step 30. */
49502 +       setup_mfc_slbs(next, spu, spu_restore_code, sizeof(spu_restore_code));
49503         set_spu_npc(next, spu);                 /* Step 31. */
49504         set_signot1(next, spu);                 /* Step 32. */
49505         set_signot2(next, spu);                 /* Step 33. */
49506 @@ -2103,10 +2077,6 @@
49507         int rc;
49508  
49509         acquire_spu_lock(spu);          /* Step 1.     */
49510 -       prev->dar = spu->dar;
49511 -       prev->dsisr = spu->dsisr;
49512 -       spu->dar = 0;
49513 -       spu->dsisr = 0;
49514         rc = __do_spu_save(prev, spu);  /* Steps 2-53. */
49515         release_spu_lock(spu);
49516         if (rc != 0 && rc != 2 && rc != 6) {
49517 @@ -2133,9 +2103,6 @@
49518         acquire_spu_lock(spu);
49519         harvest(NULL, spu);
49520         spu->slb_replace = 0;
49521 -       new->dar = 0;
49522 -       new->dsisr = 0;
49523 -       spu->class_0_pending = 0;
49524         rc = __do_spu_restore(new, spu);
49525         release_spu_lock(spu);
49526         if (rc) {
49527 @@ -2215,10 +2182,8 @@
49528  
49529         return 0;
49530  }
49531 -EXPORT_SYMBOL_GPL(spu_init_csa);
49532  
49533  void spu_fini_csa(struct spu_state *csa)
49534  {
49535         spu_free_lscsa(csa);
49536  }
49537 -EXPORT_SYMBOL_GPL(spu_fini_csa);
49538 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/celleb/Kconfig powerpc.git/arch/powerpc/platforms/celleb/Kconfig
49539 --- linux-2.6.24/arch/powerpc/platforms/celleb/Kconfig  2008-01-24 23:58:37.000000000 +0100
49540 +++ powerpc.git/arch/powerpc/platforms/celleb/Kconfig   2008-01-28 20:25:49.000000000 +0100
49541 @@ -2,6 +2,8 @@
49542         bool "Toshiba's Cell Reference Set 'Celleb' Architecture"
49543         depends on PPC_MULTIPLATFORM && PPC64
49544         select PPC_CELL
49545 +       select PPC_CELL_NATIVE
49546 +       select PPC_RTAS
49547         select PPC_INDIRECT_IO
49548         select PPC_OF_PLATFORM_PCI
49549         select HAS_TXX9_SERIAL
49550 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/celleb/io-workarounds.c powerpc.git/arch/powerpc/platforms/celleb/io-workarounds.c
49551 --- linux-2.6.24/arch/powerpc/platforms/celleb/io-workarounds.c 2008-01-24 23:58:37.000000000 +0100
49552 +++ powerpc.git/arch/powerpc/platforms/celleb/io-workarounds.c  2008-01-28 20:25:49.000000000 +0100
49553 @@ -22,6 +22,7 @@
49554  
49555  #undef DEBUG
49556  
49557 +#include <linux/of.h>
49558  #include <linux/of_device.h>
49559  #include <linux/irq.h>
49560  
49561 @@ -222,7 +223,7 @@
49562                                void (*dummy_read)(struct pci_controller *))
49563  {
49564         struct celleb_pci_bus *bus = &celleb_pci_busses[celleb_pci_count];
49565 -       struct device_node *np = phb->arch_data;
49566 +       struct device_node *np = phb->dn;
49567  
49568         if (celleb_pci_count >= MAX_CELLEB_PCI_BUS) {
49569                 printk(KERN_ERR "Too many pci bridges, workarounds"
49570 @@ -256,13 +257,13 @@
49571  
49572         celleb_dummy_page_va = kmalloc(PAGE_SIZE, GFP_KERNEL);
49573         if (!celleb_dummy_page_va) {
49574 -               printk(KERN_ERR "Celleb: dummy read disabled."
49575 +               printk(KERN_ERR "Celleb: dummy read disabled. "
49576                         "Alloc celleb_dummy_page_va failed\n");
49577                 return 1;
49578         }
49579  
49580         list_for_each_entry(phb, &hose_list, list_node) {
49581 -               node = phb->arch_data;
49582 +               node = phb->dn;
49583                 match = of_match_node(celleb_pci_workaround_match, node);
49584  
49585                 if (match) {
49586 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/celleb/iommu.c powerpc.git/arch/powerpc/platforms/celleb/iommu.c
49587 --- linux-2.6.24/arch/powerpc/platforms/celleb/iommu.c  2008-01-24 23:58:37.000000000 +0100
49588 +++ powerpc.git/arch/powerpc/platforms/celleb/iommu.c   2008-01-28 20:25:49.000000000 +0100
49589 @@ -22,8 +22,9 @@
49590  #include <linux/init.h>
49591  #include <linux/dma-mapping.h>
49592  #include <linux/pci.h>
49593 +#include <linux/of_platform.h>
49594  
49595 -#include <asm/of_platform.h>
49596 +#include <asm/machdep.h>
49597  
49598  #include "beat_wrapper.h"
49599  
49600 @@ -51,6 +52,8 @@
49601         return 0;
49602  }
49603  
49604 +static unsigned long celleb_dma_direct_offset;
49605 +
49606  static void __init celleb_init_direct_mapping(void)
49607  {
49608         u64 lpar_addr, io_addr;
49609 @@ -68,7 +71,18 @@
49610                                      ioid, DMA_FLAGS);
49611         }
49612  
49613 -       dma_direct_offset = dma_base;
49614 +       celleb_dma_direct_offset = dma_base;
49615 +}
49616 +
49617 +static void celleb_dma_dev_setup(struct device *dev)
49618 +{
49619 +       dev->archdata.dma_ops = get_pci_dma_ops();
49620 +       dev->archdata.dma_data = (void *)celleb_dma_direct_offset;
49621 +}
49622 +
49623 +static void celleb_pci_dma_dev_setup(struct pci_dev *pdev)
49624 +{
49625 +       celleb_dma_dev_setup(&pdev->dev);
49626  }
49627  
49628  static int celleb_of_bus_notify(struct notifier_block *nb,
49629 @@ -80,7 +94,7 @@
49630         if (action != BUS_NOTIFY_ADD_DEVICE)
49631                 return 0;
49632  
49633 -       dev->archdata.dma_ops = get_pci_dma_ops();
49634 +       celleb_dma_dev_setup(dev);
49635  
49636         return 0;
49637  }
49638 @@ -91,14 +105,12 @@
49639  
49640  static int __init celleb_init_iommu(void)
49641  {
49642 -       if (!machine_is(celleb))
49643 -               return -ENODEV;
49644 -
49645         celleb_init_direct_mapping();
49646         set_pci_dma_ops(&dma_direct_ops);
49647 +       ppc_md.pci_dma_dev_setup = celleb_pci_dma_dev_setup;
49648         bus_register_notifier(&of_platform_bus_type, &celleb_of_bus_notifier);
49649  
49650         return 0;
49651  }
49652  
49653 -arch_initcall(celleb_init_iommu);
49654 +machine_arch_initcall(celleb_beat, celleb_init_iommu);
49655 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/celleb/pci.c powerpc.git/arch/powerpc/platforms/celleb/pci.c
49656 --- linux-2.6.24/arch/powerpc/platforms/celleb/pci.c    2008-01-24 23:58:37.000000000 +0100
49657 +++ powerpc.git/arch/powerpc/platforms/celleb/pci.c     2008-01-28 20:25:49.000000000 +0100
49658 @@ -31,6 +31,7 @@
49659  #include <linux/init.h>
49660  #include <linux/bootmem.h>
49661  #include <linux/pci_regs.h>
49662 +#include <linux/of.h>
49663  #include <linux/of_device.h>
49664  
49665  #include <asm/io.h>
49666 @@ -138,8 +139,6 @@
49667                 *val = celleb_fake_config_readl(p);
49668                 break;
49669         }
49670 -
49671 -       return;
49672  }
49673  
49674  static void celleb_config_write_fake(unsigned char *config, int where,
49675 @@ -158,7 +157,6 @@
49676                 celleb_fake_config_writel(val, p);
49677                 break;
49678         }
49679 -       return;
49680  }
49681  
49682  static int celleb_fake_pci_read_config(struct pci_bus *bus,
49683 @@ -351,6 +349,10 @@
49684         wi1 = of_get_property(node, "vendor-id", NULL);
49685         wi2 = of_get_property(node, "class-code", NULL);
49686         wi3 = of_get_property(node, "revision-id", NULL);
49687 +       if (!wi0 || !wi1 || !wi2 || !wi3) {
49688 +               printk(KERN_ERR "PCI: Missing device tree properties.\n");
49689 +               goto error;
49690 +       }
49691  
49692         celleb_config_write_fake(*config, PCI_DEVICE_ID, 2, wi0[0] & 0xffff);
49693         celleb_config_write_fake(*config, PCI_VENDOR_ID, 2, wi1[0] & 0xffff);
49694 @@ -372,6 +374,10 @@
49695         celleb_setup_pci_base_addrs(hose, devno, fn, num_base_addr);
49696  
49697         li = of_get_property(node, "interrupts", &rlen);
49698 +       if (!li) {
49699 +               printk(KERN_ERR "PCI: interrupts not found.\n");
49700 +               goto error;
49701 +       }
49702         val = li[0];
49703         celleb_config_write_fake(*config, PCI_INTERRUPT_PIN, 1, 1);
49704         celleb_config_write_fake(*config, PCI_INTERRUPT_LINE, 1, val);
49705 @@ -475,7 +481,7 @@
49706  
49707  int __init celleb_setup_phb(struct pci_controller *phb)
49708  {
49709 -       struct device_node *dev = phb->arch_data;
49710 +       struct device_node *dev = phb->dn;
49711         const struct of_device_id *match;
49712         int (*setup_func)(struct device_node *, struct pci_controller *);
49713  
49714 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/celleb/scc_epci.c powerpc.git/arch/powerpc/platforms/celleb/scc_epci.c
49715 --- linux-2.6.24/arch/powerpc/platforms/celleb/scc_epci.c       2008-01-24 23:58:37.000000000 +0100
49716 +++ powerpc.git/arch/powerpc/platforms/celleb/scc_epci.c        2008-01-28 20:25:49.000000000 +0100
49717 @@ -95,7 +95,7 @@
49718         private->dummy_page_da = dma_map_single(hose->parent,
49719                 celleb_dummy_page_va, PAGE_SIZE, DMA_FROM_DEVICE);
49720         if (private->dummy_page_da == DMA_ERROR_CODE) {
49721 -               printk(KERN_ERR "EPCI: dummy read disabled."
49722 +               printk(KERN_ERR "EPCI: dummy read disabled. "
49723                        "Map dummy page failed.\n");
49724                 return;
49725         }
49726 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/celleb/scc_uhc.c powerpc.git/arch/powerpc/platforms/celleb/scc_uhc.c
49727 --- linux-2.6.24/arch/powerpc/platforms/celleb/scc_uhc.c        2008-01-24 23:58:37.000000000 +0100
49728 +++ powerpc.git/arch/powerpc/platforms/celleb/scc_uhc.c 2008-01-28 20:25:49.000000000 +0100
49729 @@ -47,7 +47,8 @@
49730         u32 val = 0;
49731         int i;
49732  
49733 -       if (!machine_is(celleb))
49734 +       if (!machine_is(celleb_beat) &&
49735 +           !machine_is(celleb_native))
49736                 return;
49737  
49738         uhc_base = ioremap(pci_resource_start(dev, 0),
49739 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/celleb/setup.c powerpc.git/arch/powerpc/platforms/celleb/setup.c
49740 --- linux-2.6.24/arch/powerpc/platforms/celleb/setup.c  2008-01-24 23:58:37.000000000 +0100
49741 +++ powerpc.git/arch/powerpc/platforms/celleb/setup.c   2008-01-28 20:25:49.000000000 +0100
49742 @@ -40,6 +40,7 @@
49743  #include <linux/seq_file.h>
49744  #include <linux/root_dev.h>
49745  #include <linux/console.h>
49746 +#include <linux/of_platform.h>
49747  
49748  #include <asm/mmu.h>
49749  #include <asm/processor.h>
49750 @@ -52,12 +53,16 @@
49751  #include <asm/time.h>
49752  #include <asm/spu_priv1.h>
49753  #include <asm/firmware.h>
49754 -#include <asm/of_platform.h>
49755 +#include <asm/rtas.h>
49756 +#include <asm/cell-regs.h>
49757  
49758  #include "interrupt.h"
49759  #include "beat_wrapper.h"
49760  #include "beat.h"
49761  #include "pci.h"
49762 +#include "../cell/interrupt.h"
49763 +#include "../cell/pervasive.h"
49764 +#include "../cell/ras.h"
49765  
49766  static char celleb_machine_type[128] = "Celleb";
49767  
49768 @@ -88,61 +93,122 @@
49769         printk("*** %04x : %s\n", hex, s ? s : "");
49770  }
49771  
49772 -static void __init celleb_setup_arch(void)
49773 +static void __init celleb_setup_arch_common(void)
49774 +{
49775 +       /* init to some ~sane value until calibrate_delay() runs */
49776 +       loops_per_jiffy = 50000000;
49777 +
49778 +#ifdef CONFIG_DUMMY_CONSOLE
49779 +       conswitchp = &dummy_con;
49780 +#endif
49781 +}
49782 +
49783 +static struct of_device_id celleb_bus_ids[] __initdata = {
49784 +       { .type = "scc", },
49785 +       { .type = "ioif", },    /* old style */
49786 +       {},
49787 +};
49788 +
49789 +static int __init celleb_publish_devices(void)
49790 +{
49791 +       /* Publish OF platform devices for southbridge IOs */
49792 +       of_platform_bus_probe(NULL, celleb_bus_ids, NULL);
49793 +
49794 +       celleb_pci_workaround_init();
49795 +
49796 +       return 0;
49797 +}
49798 +machine_device_initcall(celleb_beat, celleb_publish_devices);
49799 +machine_device_initcall(celleb_native, celleb_publish_devices);
49800 +
49801 +
49802 +/*
49803 + * functions for Celleb-Beat
49804 + */
49805 +static void __init celleb_setup_arch_beat(void)
49806  {
49807  #ifdef CONFIG_SPU_BASE
49808 -       spu_priv1_ops = &spu_priv1_beat_ops;
49809 -       spu_management_ops = &spu_management_of_ops;
49810 +       spu_priv1_ops           = &spu_priv1_beat_ops;
49811 +       spu_management_ops      = &spu_management_of_ops;
49812  #endif
49813  
49814  #ifdef CONFIG_SMP
49815         smp_init_celleb();
49816  #endif
49817  
49818 -       /* init to some ~sane value until calibrate_delay() runs */
49819 -       loops_per_jiffy = 50000000;
49820 -
49821 -#ifdef CONFIG_DUMMY_CONSOLE
49822 -       conswitchp = &dummy_con;
49823 -#endif
49824 +       celleb_setup_arch_common();
49825  }
49826  
49827 -static int __init celleb_probe(void)
49828 +static int __init celleb_probe_beat(void)
49829  {
49830         unsigned long root = of_get_flat_dt_root();
49831  
49832         if (!of_flat_dt_is_compatible(root, "Beat"))
49833                 return 0;
49834  
49835 -       powerpc_firmware_features |= FW_FEATURE_CELLEB_POSSIBLE;
49836 +       powerpc_firmware_features |= FW_FEATURE_CELLEB_ALWAYS
49837 +               | FW_FEATURE_BEAT | FW_FEATURE_LPAR;
49838         hpte_init_beat_v3();
49839 +
49840         return 1;
49841  }
49842  
49843 -static struct of_device_id celleb_bus_ids[] __initdata = {
49844 -       { .type = "scc", },
49845 -       { .type = "ioif", },    /* old style */
49846 -       {},
49847 -};
49848  
49849 -static int __init celleb_publish_devices(void)
49850 +/*
49851 + * functions for Celleb-native
49852 + */
49853 +static void __init celleb_init_IRQ_native(void)
49854  {
49855 -       if (!machine_is(celleb))
49856 -               return 0;
49857 +       iic_init_IRQ();
49858 +       spider_init_IRQ();
49859 +}
49860  
49861 -       /* Publish OF platform devices for southbridge IOs */
49862 -       of_platform_bus_probe(NULL, celleb_bus_ids, NULL);
49863 +static void __init celleb_setup_arch_native(void)
49864 +{
49865 +#ifdef CONFIG_SPU_BASE
49866 +       spu_priv1_ops           = &spu_priv1_mmio_ops;
49867 +       spu_management_ops      = &spu_management_of_ops;
49868 +#endif
49869  
49870 -       celleb_pci_workaround_init();
49871 +       cbe_regs_init();
49872  
49873 -       return 0;
49874 +#ifdef CONFIG_CBE_RAS
49875 +       cbe_ras_init();
49876 +#endif
49877 +
49878 +#ifdef CONFIG_SMP
49879 +       smp_init_cell();
49880 +#endif
49881 +
49882 +       cbe_pervasive_init();
49883 +
49884 +       /* XXX: nvram initialization should be added */
49885 +
49886 +       celleb_setup_arch_common();
49887 +}
49888 +
49889 +static int __init celleb_probe_native(void)
49890 +{
49891 +       unsigned long root = of_get_flat_dt_root();
49892 +
49893 +       if (of_flat_dt_is_compatible(root, "Beat") ||
49894 +           !of_flat_dt_is_compatible(root, "TOSHIBA,Celleb"))
49895 +               return 0;
49896 +
49897 +       powerpc_firmware_features |= FW_FEATURE_CELLEB_ALWAYS;
49898 +       hpte_init_native();
49899 +
49900 +       return 1;
49901  }
49902 -device_initcall(celleb_publish_devices);
49903  
49904 -define_machine(celleb) {
49905 -       .name                   = "Cell Reference Set",
49906 -       .probe                  = celleb_probe,
49907 -       .setup_arch             = celleb_setup_arch,
49908 +
49909 +/*
49910 + * machine definitions
49911 + */
49912 +define_machine(celleb_beat) {
49913 +       .name                   = "Cell Reference Set (Beat)",
49914 +       .probe                  = celleb_probe_beat,
49915 +       .setup_arch             = celleb_setup_arch_beat,
49916         .show_cpuinfo           = celleb_show_cpuinfo,
49917         .restart                = beat_restart,
49918         .power_off              = beat_power_off,
49919 @@ -167,3 +233,26 @@
49920         .machine_crash_shutdown = default_machine_crash_shutdown,
49921  #endif
49922  };
49923 +
49924 +define_machine(celleb_native) {
49925 +       .name                   = "Cell Reference Set (native)",
49926 +       .probe                  = celleb_probe_native,
49927 +       .setup_arch             = celleb_setup_arch_native,
49928 +       .show_cpuinfo           = celleb_show_cpuinfo,
49929 +       .restart                = rtas_restart,
49930 +       .power_off              = rtas_power_off,
49931 +       .halt                   = rtas_halt,
49932 +       .get_boot_time          = rtas_get_boot_time,
49933 +       .get_rtc_time           = rtas_get_rtc_time,
49934 +       .set_rtc_time           = rtas_set_rtc_time,
49935 +       .calibrate_decr         = generic_calibrate_decr,
49936 +       .progress               = celleb_progress,
49937 +       .pci_probe_mode         = celleb_pci_probe_mode,
49938 +       .pci_setup_phb          = celleb_setup_phb,
49939 +       .init_IRQ               = celleb_init_IRQ_native,
49940 +#ifdef CONFIG_KEXEC
49941 +       .machine_kexec          = default_machine_kexec,
49942 +       .machine_kexec_prepare  = default_machine_kexec_prepare,
49943 +       .machine_crash_shutdown = default_machine_crash_shutdown,
49944 +#endif
49945 +};
49946 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/chrp/pci.c powerpc.git/arch/powerpc/platforms/chrp/pci.c
49947 --- linux-2.6.24/arch/powerpc/platforms/chrp/pci.c      2008-01-24 23:58:37.000000000 +0100
49948 +++ powerpc.git/arch/powerpc/platforms/chrp/pci.c       2008-01-28 20:25:49.000000000 +0100
49949 @@ -198,7 +198,7 @@
49950                 printk ("RTAS supporting Pegasos OF not found, please upgrade"
49951                         " your firmware\n");
49952         }
49953 -       pci_assign_all_buses = 1;
49954 +       ppc_pci_flags |= PPC_PCI_REASSIGN_ALL_BUS;
49955         /* keep the reference to the root node */
49956  }
49957  
49958 @@ -354,7 +354,7 @@
49959   * mode as well. The same fixup must be done to the class-code property in
49960   * the IDE node /pci@80000000/ide@C,1
49961   */
49962 -static void __devinit chrp_pci_fixup_vt8231_ata(struct pci_dev *viaide)
49963 +static void chrp_pci_fixup_vt8231_ata(struct pci_dev *viaide)
49964  {
49965         u8 progif;
49966         struct pci_dev *viaisa;
49967 @@ -375,4 +375,4 @@
49968  
49969         pci_dev_put(viaisa);
49970  }
49971 -DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1, chrp_pci_fixup_vt8231_ata);
49972 +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1, chrp_pci_fixup_vt8231_ata);
49973 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/chrp/setup.c powerpc.git/arch/powerpc/platforms/chrp/setup.c
49974 --- linux-2.6.24/arch/powerpc/platforms/chrp/setup.c    2008-01-24 23:58:37.000000000 +0100
49975 +++ powerpc.git/arch/powerpc/platforms/chrp/setup.c     2008-01-28 20:25:49.000000000 +0100
49976 @@ -115,7 +115,7 @@
49977         seq_printf(m, "machine\t\t: CHRP %s\n", model);
49978  
49979         /* longtrail (goldengate) stuff */
49980 -       if (!strncmp(model, "IBM,LongTrail", 13)) {
49981 +       if (model && !strncmp(model, "IBM,LongTrail", 13)) {
49982                 /* VLSI VAS96011/12 `Golden Gate 2' */
49983                 /* Memory banks */
49984                 sdramen = (in_le32(gg2_pci_config_base + GG2_PCI_DRAM_CTRL)
49985 @@ -203,15 +203,20 @@
49986  static void __init sio_init(void)
49987  {
49988         struct device_node *root;
49989 +       const char *model;
49990  
49991 -       if ((root = of_find_node_by_path("/")) &&
49992 -           !strncmp(of_get_property(root, "model", NULL),
49993 -                       "IBM,LongTrail", 13)) {
49994 +       root = of_find_node_by_path("/");
49995 +       if (!root)
49996 +               return;
49997 +
49998 +       model = of_get_property(root, "model", NULL);
49999 +       if (model && !strncmp(model, "IBM,LongTrail", 13)) {
50000                 /* logical device 0 (KBC/Keyboard) */
50001                 sio_fixup_irq("keyboard", 0, 1, 2);
50002                 /* select logical device 1 (KBC/Mouse) */
50003                 sio_fixup_irq("mouse", 1, 12, 2);
50004         }
50005 +
50006         of_node_put(root);
50007  }
50008  
50009 @@ -251,6 +256,57 @@
50010         for(;;);
50011  }
50012  
50013 +/*
50014 + * Per default, input/output-device points to the keyboard/screen
50015 + * If no card is installed, the built-in serial port is used as a fallback.
50016 + * But unfortunately, the firmware does not connect /chosen/{stdin,stdout}
50017 + * the the built-in serial node. Instead, a /failsafe node is created.
50018 + */
50019 +static void chrp_init_early(void)
50020 +{
50021 +       struct device_node *node;
50022 +       const char *property;
50023 +
50024 +       if (strstr(cmd_line, "console="))
50025 +               return;
50026 +       /* find the boot console from /chosen/stdout */
50027 +       if (!of_chosen)
50028 +               return;
50029 +       node = of_find_node_by_path("/");
50030 +       if (!node)
50031 +               return;
50032 +       property = of_get_property(node, "model", NULL);
50033 +       if (!property)
50034 +               goto out_put;
50035 +       if (strcmp(property, "Pegasos2"))
50036 +               goto out_put;
50037 +       /* this is a Pegasos2 */
50038 +       property = of_get_property(of_chosen, "linux,stdout-path", NULL);
50039 +       if (!property)
50040 +               goto out_put;
50041 +       of_node_put(node);
50042 +       node = of_find_node_by_path(property);
50043 +       if (!node)
50044 +               return;
50045 +       property = of_get_property(node, "device_type", NULL);
50046 +       if (!property)
50047 +               goto out_put;
50048 +       if (strcmp(property, "serial"))
50049 +               goto out_put;
50050 +       /*
50051 +        * The 9pin connector is either /failsafe
50052 +        * or /pci@80000000/isa@C/serial@i2F8
50053 +        * The optional graphics card has also type 'serial' in VGA mode.
50054 +        */
50055 +       property = of_get_property(node, "name", NULL);
50056 +       if (!property)
50057 +               goto out_put;
50058 +       if (!strcmp(property, "failsafe") || !strcmp(property, "serial"))
50059 +               add_preferred_console("ttyS", 0, NULL);
50060 +out_put:
50061 +       of_node_put(node);
50062 +}
50063 +
50064  void __init chrp_setup_arch(void)
50065  {
50066         struct device_node *root = of_find_node_by_path("/");
50067 @@ -594,6 +650,7 @@
50068         .probe                  = chrp_probe,
50069         .setup_arch             = chrp_setup_arch,
50070         .init                   = chrp_init2,
50071 +       .init_early             = chrp_init_early,
50072         .show_cpuinfo           = chrp_show_cpuinfo,
50073         .init_IRQ               = chrp_init_IRQ,
50074         .restart                = rtas_restart,
50075 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/embedded6xx/Kconfig powerpc.git/arch/powerpc/platforms/embedded6xx/Kconfig
50076 --- linux-2.6.24/arch/powerpc/platforms/embedded6xx/Kconfig     2008-01-24 23:58:37.000000000 +0100
50077 +++ powerpc.git/arch/powerpc/platforms/embedded6xx/Kconfig      2008-01-28 20:25:49.000000000 +0100
50078 @@ -9,6 +9,8 @@
50079         select FSL_SOC
50080         select PPC_UDBG_16550 if SERIAL_8250
50081         select DEFAULT_UIMAGE
50082 +       select MPC10X_OPENPIC
50083 +       select MPC10X_BRIDGE
50084         help
50085           Select LINKSTATION if configuring for one of PPC- (MPC8241)
50086           based NAS systems from Buffalo Technology. So far only
50087 @@ -16,6 +18,19 @@
50088           Linkstation-I HD-HLAN and HD-HGLAN versions, and PPC-based
50089           Terastation systems should be supported too.
50090  
50091 +config STORCENTER
50092 +       bool "IOMEGA StorCenter"
50093 +       depends on EMBEDDED6xx
50094 +       select MPIC
50095 +       select FSL_SOC
50096 +       select PPC_UDBG_16550 if SERIAL_8250
50097 +       select WANT_DEVICE_TREE
50098 +       select MPC10X_OPENPIC
50099 +       select MPC10X_BRIDGE
50100 +       help
50101 +         Select STORCENTER if configuring for the iomega StorCenter
50102 +         with an 8241 CPU in it.
50103 +
50104  config MPC7448HPC2
50105         bool "Freescale MPC7448HPC2(Taiga)"
50106         depends on EMBEDDED6xx
50107 @@ -23,6 +38,7 @@
50108         select DEFAULT_UIMAGE
50109         select PPC_UDBG_16550
50110         select WANT_DEVICE_TREE
50111 +       select TSI108_BRIDGE
50112         help
50113           Select MPC7448HPC2 if configuring for Freescale MPC7448HPC2 (Taiga)
50114           platform
50115 @@ -33,6 +49,7 @@
50116         select TSI108_BRIDGE
50117         select PPC_UDBG_16550
50118         select WANT_DEVICE_TREE
50119 +       select TSI108_BRIDGE
50120         help
50121           Select PPC_HOLLY if configuring for an IBM 750GX/CL Eval
50122           Board with TSI108/9 bridge (Hickory/Holly)
50123 @@ -48,17 +65,13 @@
50124  
50125  config TSI108_BRIDGE
50126         bool
50127 -       depends on MPC7448HPC2 || PPC_HOLLY
50128         select PCI
50129         select MPIC
50130         select MPIC_WEIRD
50131 -       default y
50132  
50133  config MPC10X_BRIDGE
50134         bool
50135 -       depends on LINKSTATION
50136         select PPC_INDIRECT_PCI
50137 -       default y
50138  
50139  config MV64X60
50140         bool
50141 @@ -67,8 +80,6 @@
50142  
50143  config MPC10X_OPENPIC
50144         bool
50145 -       depends on LINKSTATION
50146 -       default y
50147  
50148  config MPC10X_STORE_GATHERING
50149         bool "Enable MPC10x store gathering"
50150 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/embedded6xx/Makefile powerpc.git/arch/powerpc/platforms/embedded6xx/Makefile
50151 --- linux-2.6.24/arch/powerpc/platforms/embedded6xx/Makefile    2008-01-24 23:58:37.000000000 +0100
50152 +++ powerpc.git/arch/powerpc/platforms/embedded6xx/Makefile     2008-01-28 20:25:49.000000000 +0100
50153 @@ -3,5 +3,6 @@
50154  #
50155  obj-$(CONFIG_MPC7448HPC2)      += mpc7448_hpc2.o
50156  obj-$(CONFIG_LINKSTATION)      += linkstation.o ls_uart.o
50157 +obj-$(CONFIG_STORCENTER)       += storcenter.o
50158  obj-$(CONFIG_PPC_HOLLY)                += holly.o
50159  obj-$(CONFIG_PPC_PRPMC2800)    += prpmc2800.o
50160 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/embedded6xx/holly.c powerpc.git/arch/powerpc/platforms/embedded6xx/holly.c
50161 --- linux-2.6.24/arch/powerpc/platforms/embedded6xx/holly.c     2008-01-24 23:58:37.000000000 +0100
50162 +++ powerpc.git/arch/powerpc/platforms/embedded6xx/holly.c      2008-01-28 20:25:49.000000000 +0100
50163 @@ -20,12 +20,12 @@
50164  #include <linux/console.h>
50165  #include <linux/delay.h>
50166  #include <linux/irq.h>
50167 -#include <linux/ide.h>
50168  #include <linux/seq_file.h>
50169  #include <linux/root_dev.h>
50170  #include <linux/serial.h>
50171  #include <linux/tty.h>
50172  #include <linux/serial_core.h>
50173 +#include <linux/of_platform.h>
50174  
50175  #include <asm/system.h>
50176  #include <asm/time.h>
50177 @@ -39,7 +39,6 @@
50178  #include <asm/tsi108_irq.h>
50179  #include <asm/tsi108_pci.h>
50180  #include <asm/mpic.h>
50181 -#include <asm/of_platform.h>
50182  
50183  #undef DEBUG
50184  
50185 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c powerpc.git/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
50186 --- linux-2.6.24/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c      2008-01-24 23:58:37.000000000 +0100
50187 +++ powerpc.git/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c       2008-01-28 20:25:49.000000000 +0100
50188 @@ -53,8 +53,6 @@
50189  
50190  #define MPC7448HPC2_PCI_CFG_PHYS 0xfb000000
50191  
50192 -extern void _nmask_and_or_msr(unsigned long nmask, unsigned long or_val);
50193 -
50194  int mpc7448_hpc2_exclude_device(struct pci_controller *hose,
50195                                 u_char bus, u_char devfn)
50196  {
50197 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/embedded6xx/storcenter.c powerpc.git/arch/powerpc/platforms/embedded6xx/storcenter.c
50198 --- linux-2.6.24/arch/powerpc/platforms/embedded6xx/storcenter.c        1970-01-01 01:00:00.000000000 +0100
50199 +++ powerpc.git/arch/powerpc/platforms/embedded6xx/storcenter.c 2008-01-28 20:25:49.000000000 +0100
50200 @@ -0,0 +1,192 @@
50201 +/*
50202 + * Board setup routines for the storcenter
50203 + *
50204 + * Copyright 2007 (C) Oyvind Repvik (nail@nslu2-linux.org)
50205 + * Copyright 2007 Andy Wilcox, Jon Loeliger
50206 + *
50207 + * Based on linkstation.c by G. Liakhovetski
50208 + *
50209 + * This file is licensed under the terms of the GNU General Public License
50210 + * version 2.  This program is licensed "as is" without any warranty of
50211 + * any kind, whether express or implied.
50212 + */
50213 +
50214 +#include <linux/kernel.h>
50215 +#include <linux/pci.h>
50216 +#include <linux/initrd.h>
50217 +#include <linux/mtd/physmap.h>
50218 +#include <linux/of_platform.h>
50219 +
50220 +#include <asm/system.h>
50221 +#include <asm/time.h>
50222 +#include <asm/prom.h>
50223 +#include <asm/mpic.h>
50224 +#include <asm/pci-bridge.h>
50225 +
50226 +#include "mpc10x.h"
50227 +
50228 +
50229 +#ifdef CONFIG_MTD_PHYSMAP
50230 +static struct mtd_partition storcenter_physmap_partitions[] = {
50231 +       {
50232 +               .name   = "kernel",
50233 +               .offset = 0x000000,
50234 +               .size   = 0x170000,
50235 +       },
50236 +       {
50237 +               .name   = "rootfs",
50238 +               .offset = 0x170000,
50239 +               .size   = 0x590000,
50240 +       },
50241 +       {
50242 +               .name   = "uboot",
50243 +               .offset = 0x700000,
50244 +               .size   = 0x040000,
50245 +       },
50246 +       {
50247 +               .name   = "config",
50248 +               .offset = 0x740000,
50249 +               .size   = 0x0c0000,
50250 +       },
50251 +};
50252 +#endif
50253 +
50254 +
50255 +static __initdata struct of_device_id storcenter_of_bus[] = {
50256 +       { .name = "soc", },
50257 +       {},
50258 +};
50259 +
50260 +static int __init storcenter_device_probe(void)
50261 +{
50262 +       of_platform_bus_probe(NULL, storcenter_of_bus, NULL);
50263 +       return 0;
50264 +}
50265 +machine_device_initcall(storcenter, storcenter_device_probe);
50266 +
50267 +
50268 +static int __init storcenter_add_bridge(struct device_node *dev)
50269 +{
50270 +#ifdef CONFIG_PCI
50271 +       int len;
50272 +       struct pci_controller *hose;
50273 +       const int *bus_range;
50274 +
50275 +       printk("Adding PCI host bridge %s\n", dev->full_name);
50276 +
50277 +       hose = pcibios_alloc_controller(dev);
50278 +       if (hose == NULL)
50279 +               return -ENOMEM;
50280 +
50281 +       bus_range = of_get_property(dev, "bus-range", &len);
50282 +       hose->first_busno = bus_range ? bus_range[0] : 0;
50283 +       hose->last_busno = bus_range ? bus_range[1] : 0xff;
50284 +
50285 +       setup_indirect_pci(hose, MPC10X_MAPB_CNFG_ADDR, MPC10X_MAPB_CNFG_DATA, 0);
50286 +
50287 +       /* Interpret the "ranges" property */
50288 +       /* This also maps the I/O region and sets isa_io/mem_base */
50289 +       pci_process_bridge_OF_ranges(hose, dev, 1);
50290 +#endif
50291 +
50292 +       return 0;
50293 +}
50294 +
50295 +static void __init storcenter_setup_arch(void)
50296 +{
50297 +       struct device_node *np;
50298 +
50299 +#ifdef CONFIG_MTD_PHYSMAP
50300 +       physmap_set_partitions(storcenter_physmap_partitions,
50301 +                              ARRAY_SIZE(storcenter_physmap_partitions));
50302 +#endif
50303 +
50304 +       /* Lookup PCI host bridges */
50305 +       for_each_compatible_node(np, "pci", "mpc10x-pci")
50306 +               storcenter_add_bridge(np);
50307 +
50308 +       printk(KERN_INFO "IOMEGA StorCenter\n");
50309 +}
50310 +
50311 +/*
50312 + * Interrupt setup and service.  Interrrupts on the turbostation come
50313 + * from the four PCI slots plus onboard 8241 devices: I2C, DUART.
50314 + */
50315 +static void __init storcenter_init_IRQ(void)
50316 +{
50317 +       struct mpic *mpic;
50318 +       struct device_node *dnp;
50319 +       const void *prop;
50320 +       int size;
50321 +       phys_addr_t paddr;
50322 +
50323 +       dnp = of_find_node_by_type(NULL, "open-pic");
50324 +       if (dnp == NULL)
50325 +               return;
50326 +
50327 +       prop = of_get_property(dnp, "reg", &size);
50328 +       if (prop == NULL) {
50329 +               of_node_put(dnp);
50330 +               return;
50331 +       }
50332 +
50333 +       paddr = (phys_addr_t)of_translate_address(dnp, prop);
50334 +       mpic = mpic_alloc(dnp, paddr, MPIC_PRIMARY | MPIC_WANTS_RESET,
50335 +                       4, 32, " EPIC     ");
50336 +
50337 +       of_node_put(dnp);
50338 +
50339 +       BUG_ON(mpic == NULL);
50340 +
50341 +       /* PCI IRQs */
50342 +       /*
50343 +        * 2.6.12 patch:
50344 +        *         openpic_set_sources(0, 5, OpenPIC_Addr + 0x10200);
50345 +        *         openpic_set_sources(5, 2, OpenPIC_Addr + 0x11120);
50346 +        *         first_irq, num_irqs, __iomem first_ISR
50347 +        *         o_ss: i, src: 0, fdf50200
50348 +        *         o_ss: i, src: 1, fdf50220
50349 +        *         o_ss: i, src: 2, fdf50240
50350 +        *         o_ss: i, src: 3, fdf50260
50351 +        *         o_ss: i, src: 4, fdf50280
50352 +        *         o_ss: i, src: 5, fdf51120
50353 +        *         o_ss: i, src: 6, fdf51140
50354 +        */
50355 +       mpic_assign_isu(mpic, 0, paddr + 0x10200);
50356 +       mpic_assign_isu(mpic, 1, paddr + 0x10220);
50357 +       mpic_assign_isu(mpic, 2, paddr + 0x10240);
50358 +       mpic_assign_isu(mpic, 3, paddr + 0x10260);
50359 +       mpic_assign_isu(mpic, 4, paddr + 0x10280);
50360 +       mpic_assign_isu(mpic, 5, paddr + 0x11120);
50361 +       mpic_assign_isu(mpic, 6, paddr + 0x11140);
50362 +
50363 +       mpic_init(mpic);
50364 +}
50365 +
50366 +static void storcenter_restart(char *cmd)
50367 +{
50368 +       local_irq_disable();
50369 +
50370 +       /* Set exception prefix high - to the firmware */
50371 +       _nmask_and_or_msr(0, MSR_IP);
50372 +
50373 +       /* Wait for reset to happen */
50374 +       for (;;) ;
50375 +}
50376 +
50377 +static int __init storcenter_probe(void)
50378 +{
50379 +       unsigned long root = of_get_flat_dt_root();
50380 +
50381 +       return of_flat_dt_is_compatible(root, "storcenter");
50382 +}
50383 +
50384 +define_machine(storcenter){
50385 +       .name                   = "IOMEGA StorCenter",
50386 +       .probe                  = storcenter_probe,
50387 +       .setup_arch             = storcenter_setup_arch,
50388 +       .init_IRQ               = storcenter_init_IRQ,
50389 +       .get_irq                = mpic_get_irq,
50390 +       .restart                = storcenter_restart,
50391 +       .calibrate_decr         = generic_calibrate_decr,
50392 +};
50393 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/iseries/Makefile powerpc.git/arch/powerpc/platforms/iseries/Makefile
50394 --- linux-2.6.24/arch/powerpc/platforms/iseries/Makefile        2008-01-24 23:58:37.000000000 +0100
50395 +++ powerpc.git/arch/powerpc/platforms/iseries/Makefile 2008-01-28 20:25:49.000000000 +0100
50396 @@ -5,7 +5,7 @@
50397  obj-y += exception.o
50398  obj-y += hvlog.o hvlpconfig.o lpardata.o setup.o dt_mod.o mf.o lpevents.o \
50399         hvcall.o proc.o htab.o iommu.o misc.o irq.o
50400 -obj-$(CONFIG_PCI) += pci.o vpdinfo.o
50401 +obj-$(CONFIG_PCI) += pci.o
50402  obj-$(CONFIG_SMP) += smp.o
50403  obj-$(CONFIG_VIOPATH) += viopath.o vio.o
50404  obj-$(CONFIG_MODULES) += ksyms.o
50405 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/iseries/iommu.c powerpc.git/arch/powerpc/platforms/iseries/iommu.c
50406 --- linux-2.6.24/arch/powerpc/platforms/iseries/iommu.c 2008-01-24 23:58:37.000000000 +0100
50407 +++ powerpc.git/arch/powerpc/platforms/iseries/iommu.c  2008-01-28 20:25:49.000000000 +0100
50408 @@ -163,8 +163,10 @@
50409                     (it->it_type == TCE_PCI) &&
50410                     (it->it_offset == tbl->it_offset) &&
50411                     (it->it_index == tbl->it_index) &&
50412 -                   (it->it_size == tbl->it_size))
50413 +                   (it->it_size == tbl->it_size)) {
50414 +                       of_node_put(node);
50415                         return it;
50416 +               }
50417         }
50418         return NULL;
50419  }
50420 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/iseries/lpevents.c powerpc.git/arch/powerpc/platforms/iseries/lpevents.c
50421 --- linux-2.6.24/arch/powerpc/platforms/iseries/lpevents.c      2008-01-24 23:58:37.000000000 +0100
50422 +++ powerpc.git/arch/powerpc/platforms/iseries/lpevents.c       2008-01-28 20:25:49.000000000 +0100
50423 @@ -239,7 +239,7 @@
50424                          * other CPUs, and that the deleted handler isn't
50425                          * still running on another CPU when we return.
50426                          */
50427 -                       synchronize_rcu();
50428 +                       synchronize_sched();
50429                         return 0;
50430                 }
50431         }
50432 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/iseries/pci.c powerpc.git/arch/powerpc/platforms/iseries/pci.c
50433 --- linux-2.6.24/arch/powerpc/platforms/iseries/pci.c   2008-01-24 23:58:37.000000000 +0100
50434 +++ powerpc.git/arch/powerpc/platforms/iseries/pci.c    2008-01-28 20:25:49.000000000 +0100
50435 @@ -1,5 +1,6 @@
50436  /*
50437   * Copyright (C) 2001 Allan Trautman, IBM Corporation
50438 + * Copyright (C) 2005,2007  Stephen Rothwell, IBM Corp
50439   *
50440   * iSeries specific routines for PCI.
50441   *
50442 @@ -19,13 +20,18 @@
50443   * along with this program; if not, write to the Free Software
50444   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
50445   */
50446 +
50447 +#undef DEBUG
50448 +
50449  #include <linux/kernel.h>
50450  #include <linux/list.h>
50451  #include <linux/string.h>
50452  #include <linux/init.h>
50453  #include <linux/module.h>
50454  #include <linux/pci.h>
50455 +#include <linux/of.h>
50456  
50457 +#include <asm/types.h>
50458  #include <asm/io.h>
50459  #include <asm/irq.h>
50460  #include <asm/prom.h>
50461 @@ -35,6 +41,7 @@
50462  #include <asm/abs_addr.h>
50463  #include <asm/firmware.h>
50464  
50465 +#include <asm/iseries/hv_types.h>
50466  #include <asm/iseries/hv_call_xm.h>
50467  #include <asm/iseries/mf.h>
50468  #include <asm/iseries/iommu.h>
50469 @@ -45,15 +52,8 @@
50470  #include "pci.h"
50471  #include "call_pci.h"
50472  
50473 -/*
50474 - * Forward declares of prototypes.
50475 - */
50476 -static struct device_node *find_Device_Node(int bus, int devfn);
50477 -
50478 -static int Pci_Retry_Max = 3;  /* Only retry 3 times  */
50479 -static int Pci_Error_Flag = 1; /* Set Retry Error on. */
50480 -
50481 -static struct pci_ops iSeries_pci_ops;
50482 +#define PCI_RETRY_MAX  3
50483 +static int limit_pci_retries = 1;      /* Set Retry Error on. */
50484  
50485  /*
50486   * Table defines
50487 @@ -62,6 +62,7 @@
50488  #define IOMM_TABLE_MAX_ENTRIES 1024
50489  #define IOMM_TABLE_ENTRY_SIZE  0x0000000000400000UL
50490  #define BASE_IO_MEMORY         0xE000000000000000UL
50491 +#define END_IO_MEMORY          0xEFFFFFFFFFFFFFFFUL
50492  
50493  static unsigned long max_io_memory = BASE_IO_MEMORY;
50494  static long current_iomm_table_entry;
50495 @@ -70,12 +71,237 @@
50496   * Lookup Tables.
50497   */
50498  static struct device_node *iomm_table[IOMM_TABLE_MAX_ENTRIES];
50499 -static u8 iobar_table[IOMM_TABLE_MAX_ENTRIES];
50500 +static u64 ds_addr_table[IOMM_TABLE_MAX_ENTRIES];
50501  
50502 -static const char pci_io_text[] = "iSeries PCI I/O";
50503  static DEFINE_SPINLOCK(iomm_table_lock);
50504  
50505  /*
50506 + * Generate a Direct Select Address for the Hypervisor
50507 + */
50508 +static inline u64 iseries_ds_addr(struct device_node *node)
50509 +{
50510 +       struct pci_dn *pdn = PCI_DN(node);
50511 +       const u32 *sbp = of_get_property(node, "linux,subbus", NULL);
50512 +
50513 +       return ((u64)pdn->busno << 48) + ((u64)(sbp ? *sbp : 0) << 40)
50514 +                       + ((u64)0x10 << 32);
50515 +}
50516 +
50517 +/*
50518 + * Size of Bus VPD data
50519 + */
50520 +#define BUS_VPDSIZE      1024
50521 +
50522 +/*
50523 + * Bus Vpd Tags
50524 + */
50525 +#define VPD_END_OF_AREA                0x79
50526 +#define VPD_ID_STRING          0x82
50527 +#define VPD_VENDOR_AREA                0x84
50528 +
50529 +/*
50530 + * Mfg Area Tags
50531 + */
50532 +#define VPD_FRU_FRAME_ID       0x4649  /* "FI" */
50533 +#define VPD_SLOT_MAP_FORMAT    0x4D46  /* "MF" */
50534 +#define VPD_SLOT_MAP           0x534D  /* "SM" */
50535 +
50536 +/*
50537 + * Structures of the areas
50538 + */
50539 +struct mfg_vpd_area {
50540 +       u16     tag;
50541 +       u8      length;
50542 +       u8      data1;
50543 +       u8      data2;
50544 +};
50545 +#define MFG_ENTRY_SIZE   3
50546 +
50547 +struct slot_map {
50548 +       u8      agent;
50549 +       u8      secondary_agent;
50550 +       u8      phb;
50551 +       char    card_location[3];
50552 +       char    parms[8];
50553 +       char    reserved[2];
50554 +};
50555 +#define SLOT_ENTRY_SIZE   16
50556 +
50557 +/*
50558 + * Parse the Slot Area
50559 + */
50560 +static void __init iseries_parse_slot_area(struct slot_map *map, int len,
50561 +               HvAgentId agent, u8 *phb, char card[4])
50562 +{
50563 +       /*
50564 +        * Parse Slot label until we find the one requested
50565 +        */
50566 +       while (len > 0) {
50567 +               if (map->agent == agent) {
50568 +                       /*
50569 +                        * If Phb wasn't found, grab the entry first one found.
50570 +                        */
50571 +                       if (*phb == 0xff)
50572 +                               *phb = map->phb;
50573 +                       /* Found it, extract the data. */
50574 +                       if (map->phb == *phb) {
50575 +                               memcpy(card, &map->card_location, 3);
50576 +                               card[3]  = 0;
50577 +                               break;
50578 +                       }
50579 +               }
50580 +               /* Point to the next Slot */
50581 +               map = (struct slot_map *)((char *)map + SLOT_ENTRY_SIZE);
50582 +               len -= SLOT_ENTRY_SIZE;
50583 +       }
50584 +}
50585 +
50586 +/*
50587 + * Parse the Mfg Area
50588 + */
50589 +static void __init iseries_parse_mfg_area(struct mfg_vpd_area *area, int len,
50590 +               HvAgentId agent, u8 *phb, u8 *frame, char card[4])
50591 +{
50592 +       u16 slot_map_fmt = 0;
50593 +
50594 +       /* Parse Mfg Data */
50595 +       while (len > 0) {
50596 +               int mfg_tag_len = area->length;
50597 +               /* Frame ID         (FI 4649020310 ) */
50598 +               if (area->tag == VPD_FRU_FRAME_ID)
50599 +                       *frame = area->data1;
50600 +               /* Slot Map Format  (MF 4D46020004 ) */
50601 +               else if (area->tag == VPD_SLOT_MAP_FORMAT)
50602 +                       slot_map_fmt = (area->data1 * 256)
50603 +                               + area->data2;
50604 +               /* Slot Map         (SM 534D90 */
50605 +               else if (area->tag == VPD_SLOT_MAP) {
50606 +                       struct slot_map *slot_map;
50607 +
50608 +                       if (slot_map_fmt == 0x1004)
50609 +                               slot_map = (struct slot_map *)((char *)area
50610 +                                               + MFG_ENTRY_SIZE + 1);
50611 +                       else
50612 +                               slot_map = (struct slot_map *)((char *)area
50613 +                                               + MFG_ENTRY_SIZE);
50614 +                       iseries_parse_slot_area(slot_map, mfg_tag_len,
50615 +                                       agent, phb, card);
50616 +               }
50617 +               /*
50618 +                * Point to the next Mfg Area
50619 +                * Use defined size, sizeof give wrong answer
50620 +                */
50621 +               area = (struct mfg_vpd_area *)((char *)area + mfg_tag_len
50622 +                               + MFG_ENTRY_SIZE);
50623 +               len -= (mfg_tag_len + MFG_ENTRY_SIZE);
50624 +       }
50625 +}
50626 +
50627 +/*
50628 + * Look for "BUS".. Data is not Null terminated.
50629 + * PHBID of 0xFF indicates PHB was not found in VPD Data.
50630 + */
50631 +static u8 __init iseries_parse_phbid(u8 *area, int len)
50632 +{
50633 +       while (len > 0) {
50634 +               if ((*area == 'B') && (*(area + 1) == 'U')
50635 +                               && (*(area + 2) == 'S')) {
50636 +                       area += 3;
50637 +                       while (*area == ' ')
50638 +                               area++;
50639 +                       return *area & 0x0F;
50640 +               }
50641 +               area++;
50642 +               len--;
50643 +       }
50644 +       return 0xff;
50645 +}
50646 +
50647 +/*
50648 + * Parse out the VPD Areas
50649 + */
50650 +static void __init iseries_parse_vpd(u8 *data, int data_len,
50651 +               HvAgentId agent, u8 *frame, char card[4])
50652 +{
50653 +       u8 phb = 0xff;
50654 +
50655 +       while (data_len > 0) {
50656 +               int len;
50657 +               u8 tag = *data;
50658 +
50659 +               if (tag == VPD_END_OF_AREA)
50660 +                       break;
50661 +               len = *(data + 1) + (*(data + 2) * 256);
50662 +               data += 3;
50663 +               data_len -= 3;
50664 +               if (tag == VPD_ID_STRING)
50665 +                       phb = iseries_parse_phbid(data, len);
50666 +               else if (tag == VPD_VENDOR_AREA)
50667 +                       iseries_parse_mfg_area((struct mfg_vpd_area *)data, len,
50668 +                                       agent, &phb, frame, card);
50669 +               /* Point to next Area. */
50670 +               data += len;
50671 +               data_len -= len;
50672 +       }
50673 +}
50674 +
50675 +static int __init iseries_get_location_code(u16 bus, HvAgentId agent,
50676 +               u8 *frame, char card[4])
50677 +{
50678 +       int status = 0;
50679 +       int bus_vpd_len = 0;
50680 +       u8 *bus_vpd = kmalloc(BUS_VPDSIZE, GFP_KERNEL);
50681 +
50682 +       if (bus_vpd == NULL) {
50683 +               printk("PCI: Bus VPD Buffer allocation failure.\n");
50684 +               return 0;
50685 +       }
50686 +       bus_vpd_len = HvCallPci_getBusVpd(bus, iseries_hv_addr(bus_vpd),
50687 +                                       BUS_VPDSIZE);
50688 +       if (bus_vpd_len == 0) {
50689 +               printk("PCI: Bus VPD Buffer zero length.\n");
50690 +               goto out_free;
50691 +       }
50692 +       /* printk("PCI: bus_vpd: %p, %d\n",bus_vpd, bus_vpd_len); */
50693 +       /* Make sure this is what I think it is */
50694 +       if (*bus_vpd != VPD_ID_STRING) {
50695 +               printk("PCI: Bus VPD Buffer missing starting tag.\n");
50696 +               goto out_free;
50697 +       }
50698 +       iseries_parse_vpd(bus_vpd, bus_vpd_len, agent, frame, card);
50699 +       status = 1;
50700 +out_free:
50701 +       kfree(bus_vpd);
50702 +       return status;
50703 +}
50704 +
50705 +/*
50706 + * Prints the device information.
50707 + * - Pass in pci_dev* pointer to the device.
50708 + * - Pass in the device count
50709 + *
50710 + * Format:
50711 + * PCI: Bus  0, Device 26, Vendor 0x12AE  Frame  1, Card  C10  Ethernet
50712 + * controller
50713 + */
50714 +static void __init iseries_device_information(struct pci_dev *pdev,
50715 +                                             u16 bus, HvSubBusNumber subbus)
50716 +{
50717 +       u8 frame = 0;
50718 +       char card[4];
50719 +       HvAgentId agent;
50720 +
50721 +       agent = ISERIES_PCI_AGENTID(ISERIES_GET_DEVICE_FROM_SUBBUS(subbus),
50722 +                       ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus));
50723 +
50724 +       if (iseries_get_location_code(bus, agent, &frame, card)) {
50725 +               printk(KERN_INFO "PCI: %s, Vendor %04X Frame%3d, "
50726 +                      "Card %4s  0x%04X\n", pci_name(pdev), pdev->vendor,
50727 +                      frame, card, (int)(pdev->class >> 8));
50728 +       }
50729 +}
50730 +
50731 +/*
50732   * iomm_table_allocate_entry
50733   *
50734   * Adds pci_dev entry in address translation table
50735 @@ -87,7 +313,7 @@
50736   * - CurrentIndex is incremented to keep track of the last entry.
50737   * - Builds the resource entry for allocated BARs.
50738   */
50739 -static void iomm_table_allocate_entry(struct pci_dev *dev, int bar_num)
50740 +static void __init iomm_table_allocate_entry(struct pci_dev *dev, int bar_num)
50741  {
50742         struct resource *bar_res = &dev->resource[bar_num];
50743         long bar_size = pci_resource_len(dev, bar_num);
50744 @@ -101,7 +327,6 @@
50745          * Set Resource values.
50746          */
50747         spin_lock(&iomm_table_lock);
50748 -       bar_res->name = pci_io_text;
50749         bar_res->start = BASE_IO_MEMORY +
50750                 IOMM_TABLE_ENTRY_SIZE * current_iomm_table_entry;
50751         bar_res->end = bar_res->start + bar_size - 1;
50752 @@ -110,7 +335,8 @@
50753          */
50754         while (bar_size > 0 ) {
50755                 iomm_table[current_iomm_table_entry] = dev->sysdata;
50756 -               iobar_table[current_iomm_table_entry] = bar_num;
50757 +               ds_addr_table[current_iomm_table_entry] =
50758 +                       iseries_ds_addr(dev->sysdata) | (bar_num << 24);
50759                 bar_size -= IOMM_TABLE_ENTRY_SIZE;
50760                 ++current_iomm_table_entry;
50761         }
50762 @@ -130,7 +356,7 @@
50763   * - Loops through The Bar resources(0 - 5) including the ROM
50764   *   is resource(6).
50765   */
50766 -static void allocate_device_bars(struct pci_dev *dev)
50767 +static void __init allocate_device_bars(struct pci_dev *dev)
50768  {
50769         int bar_num;
50770  
50771 @@ -145,79 +371,19 @@
50772   * PCI: Read Vendor Failed 0x18.58.10 Rc: 0x00xx
50773   * PCI: Connect Bus Unit Failed 0x18.58.10 Rc: 0x00xx
50774   */
50775 -static void pci_Log_Error(char *Error_Text, int Bus, int SubBus,
50776 -               int AgentId, int HvRc)
50777 +static void pci_log_error(char *error, int bus, int subbus,
50778 +               int agent, int hv_res)
50779  {
50780 -       if (HvRc == 0x0302)
50781 +       if (hv_res == 0x0302)
50782                 return;
50783         printk(KERN_ERR "PCI: %s Failed: 0x%02X.%02X.%02X Rc: 0x%04X",
50784 -              Error_Text, Bus, SubBus, AgentId, HvRc);
50785 -}
50786 -
50787 -/*
50788 - * iSeries_pci_final_fixup(void)
50789 - */
50790 -void __init iSeries_pci_final_fixup(void)
50791 -{
50792 -       struct pci_dev *pdev = NULL;
50793 -       struct device_node *node;
50794 -       int DeviceCount = 0;
50795 -
50796 -       /* Fix up at the device node and pci_dev relationship */
50797 -       mf_display_src(0xC9000100);
50798 -
50799 -       printk("pcibios_final_fixup\n");
50800 -       for_each_pci_dev(pdev) {
50801 -               node = find_Device_Node(pdev->bus->number, pdev->devfn);
50802 -               printk("pci dev %p (%x.%x), node %p\n", pdev,
50803 -                      pdev->bus->number, pdev->devfn, node);
50804 -
50805 -               if (node != NULL) {
50806 -                       struct pci_dn *pdn = PCI_DN(node);
50807 -                       const u32 *agent;
50808 -
50809 -                       agent = of_get_property(node, "linux,agent-id", NULL);
50810 -                       if ((pdn != NULL) && (agent != NULL)) {
50811 -                               u8 irq = iSeries_allocate_IRQ(pdn->busno, 0,
50812 -                                               pdn->bussubno);
50813 -                               int err;
50814 -
50815 -                               err = HvCallXm_connectBusUnit(pdn->busno, pdn->bussubno,
50816 -                                               *agent, irq);
50817 -                               if (err)
50818 -                                       pci_Log_Error("Connect Bus Unit",
50819 -                                               pdn->busno, pdn->bussubno, *agent, err);
50820 -                               else {
50821 -                                       err = HvCallPci_configStore8(pdn->busno, pdn->bussubno,
50822 -                                                       *agent,
50823 -                                                       PCI_INTERRUPT_LINE,
50824 -                                                       irq);
50825 -                                       if (err)
50826 -                                               pci_Log_Error("PciCfgStore Irq Failed!",
50827 -                                                       pdn->busno, pdn->bussubno, *agent, err);
50828 -                               }
50829 -                               if (!err)
50830 -                                       pdev->irq = irq;
50831 -                       }
50832 -
50833 -                       ++DeviceCount;
50834 -                       pdev->sysdata = (void *)node;
50835 -                       PCI_DN(node)->pcidev = pdev;
50836 -                       allocate_device_bars(pdev);
50837 -                       iSeries_Device_Information(pdev, DeviceCount);
50838 -                       iommu_devnode_init_iSeries(pdev, node);
50839 -               } else
50840 -                       printk("PCI: Device Tree not found for 0x%016lX\n",
50841 -                                       (unsigned long)pdev);
50842 -       }
50843 -       iSeries_activate_IRQs();
50844 -       mf_display_src(0xC9000200);
50845 +              error, bus, subbus, agent, hv_res);
50846  }
50847  
50848  /*
50849   * Look down the chain to find the matching Device Device
50850   */
50851 -static struct device_node *find_Device_Node(int bus, int devfn)
50852 +static struct device_node *find_device_node(int bus, int devfn)
50853  {
50854         struct device_node *node;
50855  
50856 @@ -230,22 +396,66 @@
50857         return NULL;
50858  }
50859  
50860 -#if 0
50861  /*
50862 - * Returns the device node for the passed pci_dev
50863 - * Sanity Check Node PciDev to passed pci_dev
50864 - * If none is found, returns a NULL which the client must handle.
50865 + * iSeries_pcibios_fixup_resources
50866 + *
50867 + * Fixes up all resources for devices
50868   */
50869 -static struct device_node *get_Device_Node(struct pci_dev *pdev)
50870 +void __init iSeries_pcibios_fixup_resources(struct pci_dev *pdev)
50871  {
50872 +       const u32 *agent;
50873 +       const u32 *sub_bus;
50874 +       unsigned char bus = pdev->bus->number;
50875         struct device_node *node;
50876 +       int i;
50877 +
50878 +       node = find_device_node(bus, pdev->devfn);
50879 +       pr_debug("PCI: iSeries %s, pdev %p, node %p\n",
50880 +                pci_name(pdev), pdev, node);
50881 +       if (!node) {
50882 +               printk("PCI: %s disabled, device tree entry not found !\n",
50883 +                      pci_name(pdev));
50884 +               for (i = 0; i <= PCI_ROM_RESOURCE; i++)
50885 +                       pdev->resource[i].flags = 0;
50886 +               return;
50887 +       }
50888 +       sub_bus = of_get_property(node, "linux,subbus", NULL);
50889 +       agent = of_get_property(node, "linux,agent-id", NULL);
50890 +       if (agent && sub_bus) {
50891 +               u8 irq = iSeries_allocate_IRQ(bus, 0, *sub_bus);
50892 +               int err;
50893 +
50894 +               err = HvCallXm_connectBusUnit(bus, *sub_bus, *agent, irq);
50895 +               if (err)
50896 +                       pci_log_error("Connect Bus Unit",
50897 +                                     bus, *sub_bus, *agent, err);
50898 +               else {
50899 +                       err = HvCallPci_configStore8(bus, *sub_bus,
50900 +                                       *agent, PCI_INTERRUPT_LINE, irq);
50901 +                       if (err)
50902 +                               pci_log_error("PciCfgStore Irq Failed!",
50903 +                                               bus, *sub_bus, *agent, err);
50904 +                       else
50905 +                               pdev->irq = irq;
50906 +               }
50907 +       }
50908  
50909 -       node = pdev->sysdata;
50910 -       if (node == NULL || PCI_DN(node)->pcidev != pdev)
50911 -               node = find_Device_Node(pdev->bus->number, pdev->devfn);
50912 -       return node;
50913 +       pdev->sysdata = node;
50914 +       allocate_device_bars(pdev);
50915 +       iseries_device_information(pdev, bus, *sub_bus);
50916 +       iommu_devnode_init_iSeries(pdev, node);
50917 +}
50918 +
50919 +/*
50920 + * iSeries_pci_final_fixup(void)
50921 + */
50922 +void __init iSeries_pci_final_fixup(void)
50923 +{
50924 +       /* Fix up at the device node and pci_dev relationship */
50925 +       mf_display_src(0xC9000100);
50926 +       iSeries_activate_IRQs();
50927 +       mf_display_src(0xC9000200);
50928  }
50929 -#endif
50930  
50931  /*
50932   * Config space read and write functions.
50933 @@ -269,7 +479,7 @@
50934  static int iSeries_pci_read_config(struct pci_bus *bus, unsigned int devfn,
50935                 int offset, int size, u32 *val)
50936  {
50937 -       struct device_node *node = find_Device_Node(bus->number, devfn);
50938 +       struct device_node *node = find_device_node(bus->number, devfn);
50939         u64 fn;
50940         struct HvCallPci_LoadReturn ret;
50941  
50942 @@ -299,7 +509,7 @@
50943  static int iSeries_pci_write_config(struct pci_bus *bus, unsigned int devfn,
50944                 int offset, int size, u32 val)
50945  {
50946 -       struct device_node *node = find_Device_Node(bus->number, devfn);
50947 +       struct device_node *node = find_device_node(bus->number, devfn);
50948         u64 fn;
50949         u64 ret;
50950  
50951 @@ -331,22 +541,22 @@
50952   * PCI: Device 23.90 ReadL Retry( 1)
50953   * PCI: Device 23.90 ReadL Retry Successful(1)
50954   */
50955 -static int CheckReturnCode(char *TextHdr, struct device_node *DevNode,
50956 +static int check_return_code(char *type, struct device_node *dn,
50957                 int *retry, u64 ret)
50958  {
50959         if (ret != 0)  {
50960 -               struct pci_dn *pdn = PCI_DN(DevNode);
50961 +               struct pci_dn *pdn = PCI_DN(dn);
50962  
50963                 (*retry)++;
50964                 printk("PCI: %s: Device 0x%04X:%02X  I/O Error(%2d): 0x%04X\n",
50965 -                               TextHdr, pdn->busno, pdn->devfn,
50966 +                               type, pdn->busno, pdn->devfn,
50967                                 *retry, (int)ret);
50968                 /*
50969                  * Bump the retry and check for retry count exceeded.
50970                  * If, Exceeded, panic the system.
50971                  */
50972 -               if (((*retry) > Pci_Retry_Max) &&
50973 -                               (Pci_Error_Flag > 0)) {
50974 +               if (((*retry) > PCI_RETRY_MAX) &&
50975 +                               (limit_pci_retries > 0)) {
50976                         mf_display_src(0xB6000103);
50977                         panic_timeout = 0;
50978                         panic("PCI: Hardware I/O Error, SRC B6000103, "
50979 @@ -363,28 +573,39 @@
50980   * the exposure of being device global.
50981   */
50982  static inline struct device_node *xlate_iomm_address(
50983 -               const volatile void __iomem *IoAddress,
50984 -               u64 *dsaptr, u64 *BarOffsetPtr)
50985 +               const volatile void __iomem *addr,
50986 +               u64 *dsaptr, u64 *bar_offset, const char *func)
50987  {
50988 -       unsigned long OrigIoAddr;
50989 -       unsigned long BaseIoAddr;
50990 -       unsigned long TableIndex;
50991 -       struct device_node *DevNode;
50992 +       unsigned long orig_addr;
50993 +       unsigned long base_addr;
50994 +       unsigned long ind;
50995 +       struct device_node *dn;
50996  
50997 -       OrigIoAddr = (unsigned long __force)IoAddress;
50998 -       if ((OrigIoAddr < BASE_IO_MEMORY) || (OrigIoAddr >= max_io_memory))
50999 +       orig_addr = (unsigned long __force)addr;
51000 +       if ((orig_addr < BASE_IO_MEMORY) || (orig_addr >= max_io_memory)) {
51001 +               static unsigned long last_jiffies;
51002 +               static int num_printed;
51003 +
51004 +               if ((jiffies - last_jiffies) > 60 * HZ) {
51005 +                       last_jiffies = jiffies;
51006 +                       num_printed = 0;
51007 +               }
51008 +               if (num_printed++ < 10)
51009 +                       printk(KERN_ERR
51010 +                               "iSeries_%s: invalid access at IO address %p\n",
51011 +                               func, addr);
51012                 return NULL;
51013 -       BaseIoAddr = OrigIoAddr - BASE_IO_MEMORY;
51014 -       TableIndex = BaseIoAddr / IOMM_TABLE_ENTRY_SIZE;
51015 -       DevNode = iomm_table[TableIndex];
51016 -
51017 -       if (DevNode != NULL) {
51018 -               int barnum = iobar_table[TableIndex];
51019 -               *dsaptr = iseries_ds_addr(DevNode) | (barnum << 24);
51020 -               *BarOffsetPtr = BaseIoAddr % IOMM_TABLE_ENTRY_SIZE;
51021 +       }
51022 +       base_addr = orig_addr - BASE_IO_MEMORY;
51023 +       ind = base_addr / IOMM_TABLE_ENTRY_SIZE;
51024 +       dn = iomm_table[ind];
51025 +
51026 +       if (dn != NULL) {
51027 +               *dsaptr = ds_addr_table[ind];
51028 +               *bar_offset = base_addr % IOMM_TABLE_ENTRY_SIZE;
51029         } else
51030 -               panic("PCI: Invalid PCI IoAddress detected!\n");
51031 -       return DevNode;
51032 +               panic("PCI: Invalid PCI IO address detected!\n");
51033 +       return dn;
51034  }
51035  
51036  /*
51037 @@ -392,91 +613,58 @@
51038   * On MM I/O error, all ones are returned and iSeries_pci_IoError is cal
51039   * else, data is returned in Big Endian format.
51040   */
51041 -static u8 iSeries_Read_Byte(const volatile void __iomem *IoAddress)
51042 +static u8 iseries_readb(const volatile void __iomem *addr)
51043  {
51044 -       u64 BarOffset;
51045 +       u64 bar_offset;
51046         u64 dsa;
51047         int retry = 0;
51048         struct HvCallPci_LoadReturn ret;
51049 -       struct device_node *DevNode =
51050 -               xlate_iomm_address(IoAddress, &dsa, &BarOffset);
51051 -
51052 -       if (DevNode == NULL) {
51053 -               static unsigned long last_jiffies;
51054 -               static int num_printed;
51055 +       struct device_node *dn =
51056 +               xlate_iomm_address(addr, &dsa, &bar_offset, "read_byte");
51057  
51058 -               if ((jiffies - last_jiffies) > 60 * HZ) {
51059 -                       last_jiffies = jiffies;
51060 -                       num_printed = 0;
51061 -               }
51062 -               if (num_printed++ < 10)
51063 -                       printk(KERN_ERR "iSeries_Read_Byte: invalid access at IO address %p\n",
51064 -                              IoAddress);
51065 +       if (dn == NULL)
51066                 return 0xff;
51067 -       }
51068         do {
51069 -               HvCall3Ret16(HvCallPciBarLoad8, &ret, dsa, BarOffset, 0);
51070 -       } while (CheckReturnCode("RDB", DevNode, &retry, ret.rc) != 0);
51071 +               HvCall3Ret16(HvCallPciBarLoad8, &ret, dsa, bar_offset, 0);
51072 +       } while (check_return_code("RDB", dn, &retry, ret.rc) != 0);
51073  
51074         return ret.value;
51075  }
51076  
51077 -static u16 iSeries_Read_Word(const volatile void __iomem *IoAddress)
51078 +static u16 iseries_readw_be(const volatile void __iomem *addr)
51079  {
51080 -       u64 BarOffset;
51081 +       u64 bar_offset;
51082         u64 dsa;
51083         int retry = 0;
51084         struct HvCallPci_LoadReturn ret;
51085 -       struct device_node *DevNode =
51086 -               xlate_iomm_address(IoAddress, &dsa, &BarOffset);
51087 -
51088 -       if (DevNode == NULL) {
51089 -               static unsigned long last_jiffies;
51090 -               static int num_printed;
51091 +       struct device_node *dn =
51092 +               xlate_iomm_address(addr, &dsa, &bar_offset, "read_word");
51093  
51094 -               if ((jiffies - last_jiffies) > 60 * HZ) {
51095 -                       last_jiffies = jiffies;
51096 -                       num_printed = 0;
51097 -               }
51098 -               if (num_printed++ < 10)
51099 -                       printk(KERN_ERR "iSeries_Read_Word: invalid access at IO address %p\n",
51100 -                              IoAddress);
51101 +       if (dn == NULL)
51102                 return 0xffff;
51103 -       }
51104         do {
51105                 HvCall3Ret16(HvCallPciBarLoad16, &ret, dsa,
51106 -                               BarOffset, 0);
51107 -       } while (CheckReturnCode("RDW", DevNode, &retry, ret.rc) != 0);
51108 +                               bar_offset, 0);
51109 +       } while (check_return_code("RDW", dn, &retry, ret.rc) != 0);
51110  
51111         return ret.value;
51112  }
51113  
51114 -static u32 iSeries_Read_Long(const volatile void __iomem *IoAddress)
51115 +static u32 iseries_readl_be(const volatile void __iomem *addr)
51116  {
51117 -       u64 BarOffset;
51118 +       u64 bar_offset;
51119         u64 dsa;
51120         int retry = 0;
51121         struct HvCallPci_LoadReturn ret;
51122 -       struct device_node *DevNode =
51123 -               xlate_iomm_address(IoAddress, &dsa, &BarOffset);
51124 +       struct device_node *dn =
51125 +               xlate_iomm_address(addr, &dsa, &bar_offset, "read_long");
51126  
51127 -       if (DevNode == NULL) {
51128 -               static unsigned long last_jiffies;
51129 -               static int num_printed;
51130 -
51131 -               if ((jiffies - last_jiffies) > 60 * HZ) {
51132 -                       last_jiffies = jiffies;
51133 -                       num_printed = 0;
51134 -               }
51135 -               if (num_printed++ < 10)
51136 -                       printk(KERN_ERR "iSeries_Read_Long: invalid access at IO address %p\n",
51137 -                              IoAddress);
51138 +       if (dn == NULL)
51139                 return 0xffffffff;
51140 -       }
51141         do {
51142                 HvCall3Ret16(HvCallPciBarLoad32, &ret, dsa,
51143 -                               BarOffset, 0);
51144 -       } while (CheckReturnCode("RDL", DevNode, &retry, ret.rc) != 0);
51145 +                               bar_offset, 0);
51146 +       } while (check_return_code("RDL", dn, &retry, ret.rc) != 0);
51147  
51148         return ret.value;
51149  }
51150 @@ -485,134 +673,72 @@
51151   * Write MM I/O Instructions for the iSeries
51152   *
51153   */
51154 -static void iSeries_Write_Byte(u8 data, volatile void __iomem *IoAddress)
51155 +static void iseries_writeb(u8 data, volatile void __iomem *addr)
51156  {
51157 -       u64 BarOffset;
51158 +       u64 bar_offset;
51159         u64 dsa;
51160         int retry = 0;
51161         u64 rc;
51162 -       struct device_node *DevNode =
51163 -               xlate_iomm_address(IoAddress, &dsa, &BarOffset);
51164 -
51165 -       if (DevNode == NULL) {
51166 -               static unsigned long last_jiffies;
51167 -               static int num_printed;
51168 +       struct device_node *dn =
51169 +               xlate_iomm_address(addr, &dsa, &bar_offset, "write_byte");
51170  
51171 -               if ((jiffies - last_jiffies) > 60 * HZ) {
51172 -                       last_jiffies = jiffies;
51173 -                       num_printed = 0;
51174 -               }
51175 -               if (num_printed++ < 10)
51176 -                       printk(KERN_ERR "iSeries_Write_Byte: invalid access at IO address %p\n", IoAddress);
51177 +       if (dn == NULL)
51178                 return;
51179 -       }
51180         do {
51181 -               rc = HvCall4(HvCallPciBarStore8, dsa, BarOffset, data, 0);
51182 -       } while (CheckReturnCode("WWB", DevNode, &retry, rc) != 0);
51183 +               rc = HvCall4(HvCallPciBarStore8, dsa, bar_offset, data, 0);
51184 +       } while (check_return_code("WWB", dn, &retry, rc) != 0);
51185  }
51186  
51187 -static void iSeries_Write_Word(u16 data, volatile void __iomem *IoAddress)
51188 +static void iseries_writew_be(u16 data, volatile void __iomem *addr)
51189  {
51190 -       u64 BarOffset;
51191 +       u64 bar_offset;
51192         u64 dsa;
51193         int retry = 0;
51194         u64 rc;
51195 -       struct device_node *DevNode =
51196 -               xlate_iomm_address(IoAddress, &dsa, &BarOffset);
51197 +       struct device_node *dn =
51198 +               xlate_iomm_address(addr, &dsa, &bar_offset, "write_word");
51199  
51200 -       if (DevNode == NULL) {
51201 -               static unsigned long last_jiffies;
51202 -               static int num_printed;
51203 -
51204 -               if ((jiffies - last_jiffies) > 60 * HZ) {
51205 -                       last_jiffies = jiffies;
51206 -                       num_printed = 0;
51207 -               }
51208 -               if (num_printed++ < 10)
51209 -                       printk(KERN_ERR "iSeries_Write_Word: invalid access at IO address %p\n",
51210 -                              IoAddress);
51211 +       if (dn == NULL)
51212                 return;
51213 -       }
51214         do {
51215 -               rc = HvCall4(HvCallPciBarStore16, dsa, BarOffset, data, 0);
51216 -       } while (CheckReturnCode("WWW", DevNode, &retry, rc) != 0);
51217 +               rc = HvCall4(HvCallPciBarStore16, dsa, bar_offset, data, 0);
51218 +       } while (check_return_code("WWW", dn, &retry, rc) != 0);
51219  }
51220  
51221 -static void iSeries_Write_Long(u32 data, volatile void __iomem *IoAddress)
51222 +static void iseries_writel_be(u32 data, volatile void __iomem *addr)
51223  {
51224 -       u64 BarOffset;
51225 +       u64 bar_offset;
51226         u64 dsa;
51227         int retry = 0;
51228         u64 rc;
51229 -       struct device_node *DevNode =
51230 -               xlate_iomm_address(IoAddress, &dsa, &BarOffset);
51231 -
51232 -       if (DevNode == NULL) {
51233 -               static unsigned long last_jiffies;
51234 -               static int num_printed;
51235 +       struct device_node *dn =
51236 +               xlate_iomm_address(addr, &dsa, &bar_offset, "write_long");
51237  
51238 -               if ((jiffies - last_jiffies) > 60 * HZ) {
51239 -                       last_jiffies = jiffies;
51240 -                       num_printed = 0;
51241 -               }
51242 -               if (num_printed++ < 10)
51243 -                       printk(KERN_ERR "iSeries_Write_Long: invalid access at IO address %p\n",
51244 -                              IoAddress);
51245 +       if (dn == NULL)
51246                 return;
51247 -       }
51248         do {
51249 -               rc = HvCall4(HvCallPciBarStore32, dsa, BarOffset, data, 0);
51250 -       } while (CheckReturnCode("WWL", DevNode, &retry, rc) != 0);
51251 -}
51252 -
51253 -static u8 iseries_readb(const volatile void __iomem *addr)
51254 -{
51255 -       return iSeries_Read_Byte(addr);
51256 +               rc = HvCall4(HvCallPciBarStore32, dsa, bar_offset, data, 0);
51257 +       } while (check_return_code("WWL", dn, &retry, rc) != 0);
51258  }
51259  
51260  static u16 iseries_readw(const volatile void __iomem *addr)
51261  {
51262 -       return le16_to_cpu(iSeries_Read_Word(addr));
51263 +       return le16_to_cpu(iseries_readw_be(addr));
51264  }
51265  
51266  static u32 iseries_readl(const volatile void __iomem *addr)
51267  {
51268 -       return le32_to_cpu(iSeries_Read_Long(addr));
51269 -}
51270 -
51271 -static u16 iseries_readw_be(const volatile void __iomem *addr)
51272 -{
51273 -       return iSeries_Read_Word(addr);
51274 -}
51275 -
51276 -static u32 iseries_readl_be(const volatile void __iomem *addr)
51277 -{
51278 -       return iSeries_Read_Long(addr);
51279 -}
51280 -
51281 -static void iseries_writeb(u8 data, volatile void __iomem *addr)
51282 -{
51283 -       iSeries_Write_Byte(data, addr);
51284 +       return le32_to_cpu(iseries_readl_be(addr));
51285  }
51286  
51287  static void iseries_writew(u16 data, volatile void __iomem *addr)
51288  {
51289 -       iSeries_Write_Word(cpu_to_le16(data), addr);
51290 +       iseries_writew_be(cpu_to_le16(data), addr);
51291  }
51292  
51293  static void iseries_writel(u32 data, volatile void __iomem *addr)
51294  {
51295 -       iSeries_Write_Long(cpu_to_le32(data), addr);
51296 -}
51297 -
51298 -static void iseries_writew_be(u16 data, volatile void __iomem *addr)
51299 -{
51300 -       iSeries_Write_Word(data, addr);
51301 -}
51302 -
51303 -static void iseries_writel_be(u32 data, volatile void __iomem *addr)
51304 -{
51305 -       iSeries_Write_Long(data, addr);
51306 +       iseries_writel(cpu_to_le32(data), addr);
51307  }
51308  
51309  static void iseries_readsb(const volatile void __iomem *addr, void *buf,
51310 @@ -620,7 +746,7 @@
51311  {
51312         u8 *dst = buf;
51313         while(count-- > 0)
51314 -               *(dst++) = iSeries_Read_Byte(addr);
51315 +               *(dst++) = iseries_readb(addr);
51316  }
51317  
51318  static void iseries_readsw(const volatile void __iomem *addr, void *buf,
51319 @@ -628,7 +754,7 @@
51320  {
51321         u16 *dst = buf;
51322         while(count-- > 0)
51323 -               *(dst++) = iSeries_Read_Word(addr);
51324 +               *(dst++) = iseries_readw_be(addr);
51325  }
51326  
51327  static void iseries_readsl(const volatile void __iomem *addr, void *buf,
51328 @@ -636,7 +762,7 @@
51329  {
51330         u32 *dst = buf;
51331         while(count-- > 0)
51332 -               *(dst++) = iSeries_Read_Long(addr);
51333 +               *(dst++) = iseries_readl_be(addr);
51334  }
51335  
51336  static void iseries_writesb(volatile void __iomem *addr, const void *buf,
51337 @@ -644,7 +770,7 @@
51338  {
51339         const u8 *src = buf;
51340         while(count-- > 0)
51341 -               iSeries_Write_Byte(*(src++), addr);
51342 +               iseries_writeb(*(src++), addr);
51343  }
51344  
51345  static void iseries_writesw(volatile void __iomem *addr, const void *buf,
51346 @@ -652,7 +778,7 @@
51347  {
51348         const u16 *src = buf;
51349         while(count-- > 0)
51350 -               iSeries_Write_Word(*(src++), addr);
51351 +               iseries_writew_be(*(src++), addr);
51352  }
51353  
51354  static void iseries_writesl(volatile void __iomem *addr, const void *buf,
51355 @@ -660,7 +786,7 @@
51356  {
51357         const u32 *src = buf;
51358         while(count-- > 0)
51359 -               iSeries_Write_Long(*(src++), addr);
51360 +               iseries_writel_be(*(src++), addr);
51361  }
51362  
51363  static void iseries_memset_io(volatile void __iomem *addr, int c,
51364 @@ -669,7 +795,7 @@
51365         volatile char __iomem *d = addr;
51366  
51367         while (n-- > 0)
51368 -               iSeries_Write_Byte(c, d++);
51369 +               iseries_writeb(c, d++);
51370  }
51371  
51372  static void iseries_memcpy_fromio(void *dest, const volatile void __iomem *src,
51373 @@ -679,7 +805,7 @@
51374         const volatile char __iomem *s = src;
51375  
51376         while (n-- > 0)
51377 -               *d++ = iSeries_Read_Byte(s++);
51378 +               *d++ = iseries_readb(s++);
51379  }
51380  
51381  static void iseries_memcpy_toio(volatile void __iomem *dest, const void *src,
51382 @@ -689,7 +815,7 @@
51383         volatile char __iomem *d = dest;
51384  
51385         while (n-- > 0)
51386 -               iSeries_Write_Byte(*s++, d++);
51387 +               iseries_writeb(*s++, d++);
51388  }
51389  
51390  /* We only set MMIO ops. The default PIO ops will be default
51391 @@ -742,6 +868,8 @@
51392         /* Install IO hooks */
51393         ppc_pci_io = iseries_pci_io;
51394  
51395 +       pci_probe_only = 1;
51396 +
51397         /* iSeries has no IO space in the common sense, it needs to set
51398          * the IO base to 0
51399          */
51400 @@ -767,11 +895,21 @@
51401                 phb = pcibios_alloc_controller(node);
51402                 if (phb == NULL)
51403                         continue;
51404 +               /* All legacy iSeries PHBs are in domain zero */
51405 +               phb->global_number = 0;
51406  
51407 -               phb->pci_mem_offset = bus;
51408                 phb->first_busno = bus;
51409                 phb->last_busno = bus;
51410                 phb->ops = &iSeries_pci_ops;
51411 +               phb->io_base_virt = (void __iomem *)_IO_BASE;
51412 +               phb->io_resource.flags = IORESOURCE_IO;
51413 +               phb->io_resource.start = BASE_IO_MEMORY;
51414 +               phb->io_resource.end = END_IO_MEMORY;
51415 +               phb->io_resource.name = "iSeries PCI IO";
51416 +               phb->mem_resources[0].flags = IORESOURCE_MEM;
51417 +               phb->mem_resources[0].start = BASE_IO_MEMORY;
51418 +               phb->mem_resources[0].end = END_IO_MEMORY;
51419 +               phb->mem_resources[0].name = "Series PCI MEM";
51420         }
51421  
51422         of_node_put(root);
51423 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/iseries/pci.h powerpc.git/arch/powerpc/platforms/iseries/pci.h
51424 --- linux-2.6.24/arch/powerpc/platforms/iseries/pci.h   2008-01-24 23:58:37.000000000 +0100
51425 +++ powerpc.git/arch/powerpc/platforms/iseries/pci.h    2008-01-28 20:25:49.000000000 +0100
51426 @@ -30,10 +30,6 @@
51427   * End Change Activity
51428   */
51429  
51430 -#include <asm/pci-bridge.h>
51431 -
51432 -struct pci_dev;                                /* For Forward Reference */
51433 -
51434  /*
51435   * Decodes Linux DevFn to iSeries DevFn, bridge device, or function.
51436   * For Linux, see PCI_SLOT and PCI_FUNC in include/linux/pci.h
51437 @@ -47,17 +43,16 @@
51438  #define ISERIES_GET_DEVICE_FROM_SUBBUS(subbus)         ((subbus >> 5) & 0x7)
51439  #define ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus)       ((subbus >> 2) & 0x7)
51440  
51441 -/*
51442 - * Generate a Direct Select Address for the Hypervisor
51443 - */
51444 -static inline u64 iseries_ds_addr(struct device_node *node)
51445 -{
51446 -       struct pci_dn *pdn = PCI_DN(node);
51447 -
51448 -       return ((u64)pdn->busno << 48) + ((u64)pdn->bussubno << 40)
51449 -                       + ((u64)0x10 << 32);
51450 -}
51451 +struct pci_dev;
51452  
51453 -extern void    iSeries_Device_Information(struct pci_dev*, int);
51454 +#ifdef CONFIG_PCI
51455 +extern void    iSeries_pcibios_init(void);
51456 +extern void    iSeries_pci_final_fixup(void);
51457 +extern void    iSeries_pcibios_fixup_resources(struct pci_dev *dev);
51458 +#else
51459 +static inline void     iSeries_pcibios_init(void) { }
51460 +static inline void     iSeries_pci_final_fixup(void) { }
51461 +static inline void     iSeries_pcibios_fixup_resources(struct pci_dev *dev) {}
51462 +#endif
51463  
51464  #endif /* _PLATFORMS_ISERIES_PCI_H */
51465 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/iseries/setup.c powerpc.git/arch/powerpc/platforms/iseries/setup.c
51466 --- linux-2.6.24/arch/powerpc/platforms/iseries/setup.c 2008-01-24 23:58:37.000000000 +0100
51467 +++ powerpc.git/arch/powerpc/platforms/iseries/setup.c  2008-01-28 20:25:49.000000000 +0100
51468 @@ -63,6 +63,7 @@
51469  #include "main_store.h"
51470  #include "call_sm.h"
51471  #include "call_hpt.h"
51472 +#include "pci.h"
51473  
51474  #ifdef DEBUG
51475  #define DBG(fmt...) udbg_printf(fmt)
51476 @@ -74,11 +75,6 @@
51477  static unsigned long build_iSeries_Memory_Map(void);
51478  static void iseries_shared_idle(void);
51479  static void iseries_dedicated_idle(void);
51480 -#ifdef CONFIG_PCI
51481 -extern void iSeries_pci_final_fixup(void);
51482 -#else
51483 -static void iSeries_pci_final_fixup(void) { }
51484 -#endif
51485  
51486  
51487  struct MemoryBlock {
51488 @@ -112,13 +108,13 @@
51489          * correctly.
51490          */
51491         mb_array[0].logicalStart = 0;
51492 -       mb_array[0].logicalEnd = 0x100000000;
51493 +       mb_array[0].logicalEnd = 0x100000000UL;
51494         mb_array[0].absStart = 0;
51495 -       mb_array[0].absEnd = 0x100000000;
51496 +       mb_array[0].absEnd = 0x100000000UL;
51497  
51498         if (holeSize) {
51499                 numMemoryBlocks = 2;
51500 -               holeStart = holeStart & 0x000fffffffffffff;
51501 +               holeStart = holeStart & 0x000fffffffffffffUL;
51502                 holeStart = addr_to_chunk(holeStart);
51503                 holeFirstChunk = holeStart;
51504                 holeSize = addr_to_chunk(holeSize);
51505 @@ -128,9 +124,9 @@
51506                 mb_array[0].logicalEnd = holeFirstChunk;
51507                 mb_array[0].absEnd = holeFirstChunk;
51508                 mb_array[1].logicalStart = holeFirstChunk;
51509 -               mb_array[1].logicalEnd = 0x100000000 - holeSizeChunks;
51510 +               mb_array[1].logicalEnd = 0x100000000UL - holeSizeChunks;
51511                 mb_array[1].absStart = holeFirstChunk + holeSizeChunks;
51512 -               mb_array[1].absEnd = 0x100000000;
51513 +               mb_array[1].absEnd = 0x100000000UL;
51514         }
51515         return numMemoryBlocks;
51516  }
51517 @@ -234,9 +230,9 @@
51518                                 mb_array[i].logicalEnd,
51519                                 mb_array[i].absStart, mb_array[i].absEnd);
51520                 mb_array[i].absStart = addr_to_chunk(mb_array[i].absStart &
51521 -                               0x000fffffffffffff);
51522 +                               0x000fffffffffffffUL);
51523                 mb_array[i].absEnd = addr_to_chunk(mb_array[i].absEnd &
51524 -                               0x000fffffffffffff);
51525 +                               0x000fffffffffffffUL);
51526                 mb_array[i].logicalStart =
51527                         addr_to_chunk(mb_array[i].logicalStart);
51528                 mb_array[i].logicalEnd = addr_to_chunk(mb_array[i].logicalEnd);
51529 @@ -320,7 +316,7 @@
51530  };
51531  EXPORT_SYMBOL(mschunks_map);
51532  
51533 -void mschunks_alloc(unsigned long num_chunks)
51534 +static void mschunks_alloc(unsigned long num_chunks)
51535  {
51536         klimit = _ALIGN(klimit, sizeof(u32));
51537         mschunks_map.mapping = (u32 *)klimit;
51538 @@ -499,6 +495,8 @@
51539                         itVpdAreas.xSlicMaxLogicalProcs);
51540         printk("Max physical processors = %d\n",
51541                         itVpdAreas.xSlicMaxPhysicalProcs);
51542 +
51543 +       iSeries_pcibios_init();
51544  }
51545  
51546  static void iSeries_show_cpuinfo(struct seq_file *m)
51547 @@ -641,24 +639,25 @@
51548  }
51549  
51550  define_machine(iseries) {
51551 -       .name           = "iSeries",
51552 -       .setup_arch     = iSeries_setup_arch,
51553 -       .show_cpuinfo   = iSeries_show_cpuinfo,
51554 -       .init_IRQ       = iSeries_init_IRQ,
51555 -       .get_irq        = iSeries_get_irq,
51556 -       .init_early     = iSeries_init_early,
51557 -       .pcibios_fixup  = iSeries_pci_final_fixup,
51558 -       .restart        = mf_reboot,
51559 -       .power_off      = mf_power_off,
51560 -       .halt           = mf_power_off,
51561 -       .get_boot_time  = iSeries_get_boot_time,
51562 -       .set_rtc_time   = iSeries_set_rtc_time,
51563 -       .get_rtc_time   = iSeries_get_rtc_time,
51564 -       .calibrate_decr = generic_calibrate_decr,
51565 -       .progress       = iSeries_progress,
51566 -       .probe          = iseries_probe,
51567 -       .ioremap        = iseries_ioremap,
51568 -       .iounmap        = iseries_iounmap,
51569 +       .name                   = "iSeries",
51570 +       .setup_arch             = iSeries_setup_arch,
51571 +       .show_cpuinfo           = iSeries_show_cpuinfo,
51572 +       .init_IRQ               = iSeries_init_IRQ,
51573 +       .get_irq                = iSeries_get_irq,
51574 +       .init_early             = iSeries_init_early,
51575 +       .pcibios_fixup          = iSeries_pci_final_fixup,
51576 +       .pcibios_fixup_resources= iSeries_pcibios_fixup_resources,
51577 +       .restart                = mf_reboot,
51578 +       .power_off              = mf_power_off,
51579 +       .halt                   = mf_power_off,
51580 +       .get_boot_time          = iSeries_get_boot_time,
51581 +       .set_rtc_time           = iSeries_set_rtc_time,
51582 +       .get_rtc_time           = iSeries_get_rtc_time,
51583 +       .calibrate_decr         = generic_calibrate_decr,
51584 +       .progress               = iSeries_progress,
51585 +       .probe                  = iseries_probe,
51586 +       .ioremap                = iseries_ioremap,
51587 +       .iounmap                = iseries_iounmap,
51588         /* XXX Implement enable_pmcs for iSeries */
51589  };
51590  
51591 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/iseries/setup.h powerpc.git/arch/powerpc/platforms/iseries/setup.h
51592 --- linux-2.6.24/arch/powerpc/platforms/iseries/setup.h 2008-01-24 23:58:37.000000000 +0100
51593 +++ powerpc.git/arch/powerpc/platforms/iseries/setup.h  2008-01-28 20:25:49.000000000 +0100
51594 @@ -17,6 +17,7 @@
51595  #ifndef        __ISERIES_SETUP_H__
51596  #define        __ISERIES_SETUP_H__
51597  
51598 +extern void *iSeries_early_setup(void);
51599  extern unsigned long iSeries_get_boot_time(void);
51600  extern int iSeries_set_rtc_time(struct rtc_time *tm);
51601  extern void iSeries_get_rtc_time(struct rtc_time *tm);
51602 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/iseries/vpdinfo.c powerpc.git/arch/powerpc/platforms/iseries/vpdinfo.c
51603 --- linux-2.6.24/arch/powerpc/platforms/iseries/vpdinfo.c       2008-01-24 23:58:37.000000000 +0100
51604 +++ powerpc.git/arch/powerpc/platforms/iseries/vpdinfo.c        1970-01-01 01:00:00.000000000 +0100
51605 @@ -1,275 +0,0 @@
51606 -/*
51607 - * This code gets the card location of the hardware
51608 - * Copyright (C) 2001  <Allan H Trautman> <IBM Corp>
51609 - * Copyright (C) 2005  Stephen Rothwel, IBM Corp
51610 - *
51611 - * This program is free software; you can redistribute it and/or modify
51612 - * it under the terms of the GNU General Public License as published by
51613 - * the Free Software Foundation; either version 2 of the License, or
51614 - * (at your option) any later version.
51615 - *
51616 - * This program is distributed in the hope that it will be useful,
51617 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
51618 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
51619 - * GNU General Public License for more details.
51620 - *
51621 - * You should have received a copy of the GNU General Public License
51622 - * along with this program; if not, write to the:
51623 - * Free Software Foundation, Inc.,
51624 - * 59 Temple Place, Suite 330,
51625 - * Boston, MA  02111-1307  USA
51626 - *
51627 - * Change Activity:
51628 - *   Created, Feb 2, 2001
51629 - *   Ported to ppc64, August 20, 2001
51630 - * End Change Activity
51631 - */
51632 -#include <linux/init.h>
51633 -#include <linux/module.h>
51634 -#include <linux/pci.h>
51635 -
51636 -#include <asm/types.h>
51637 -#include <asm/resource.h>
51638 -#include <asm/abs_addr.h>
51639 -#include <asm/pci-bridge.h>
51640 -#include <asm/iseries/hv_types.h>
51641 -
51642 -#include "pci.h"
51643 -#include "call_pci.h"
51644 -
51645 -/*
51646 - * Size of Bus VPD data
51647 - */
51648 -#define BUS_VPDSIZE      1024
51649 -
51650 -/*
51651 - * Bus Vpd Tags
51652 - */
51653 -#define  VpdEndOfAreaTag   0x79
51654 -#define  VpdIdStringTag    0x82
51655 -#define  VpdVendorAreaTag  0x84
51656 -
51657 -/*
51658 - * Mfg Area Tags
51659 - */
51660 -#define  VpdFruFrameId    0x4649     // "FI"
51661 -#define  VpdSlotMapFormat 0x4D46     // "MF"
51662 -#define  VpdSlotMap       0x534D     // "SM"
51663 -
51664 -/*
51665 - * Structures of the areas
51666 - */
51667 -struct MfgVpdAreaStruct {
51668 -       u16 Tag;
51669 -       u8  TagLength;
51670 -       u8  AreaData1;
51671 -       u8  AreaData2;
51672 -};
51673 -typedef struct MfgVpdAreaStruct MfgArea;
51674 -#define MFG_ENTRY_SIZE   3
51675 -
51676 -struct SlotMapStruct {
51677 -       u8   AgentId;
51678 -       u8   SecondaryAgentId;
51679 -       u8   PhbId;
51680 -       char CardLocation[3];
51681 -       char Parms[8];
51682 -       char Reserved[2];
51683 -};
51684 -typedef struct SlotMapStruct SlotMap;
51685 -#define SLOT_ENTRY_SIZE   16
51686 -
51687 -/*
51688 - * Parse the Slot Area
51689 - */
51690 -static void __init iSeries_Parse_SlotArea(SlotMap *MapPtr, int MapLen,
51691 -               HvAgentId agent, u8 *PhbId, char card[4])
51692 -{
51693 -       int SlotMapLen = MapLen;
51694 -       SlotMap *SlotMapPtr = MapPtr;
51695 -
51696 -       /*
51697 -        * Parse Slot label until we find the one requested
51698 -        */
51699 -       while (SlotMapLen > 0) {
51700 -               if (SlotMapPtr->AgentId == agent) {
51701 -                       /*
51702 -                        * If Phb wasn't found, grab the entry first one found.
51703 -                        */
51704 -                       if (*PhbId == 0xff)
51705 -                               *PhbId = SlotMapPtr->PhbId;
51706 -                       /* Found it, extract the data. */
51707 -                       if (SlotMapPtr->PhbId == *PhbId) {
51708 -                               memcpy(card, &SlotMapPtr->CardLocation, 3);
51709 -                               card[3]  = 0;
51710 -                               break;
51711 -                       }
51712 -               }
51713 -               /* Point to the next Slot */
51714 -               SlotMapPtr = (SlotMap *)((char *)SlotMapPtr + SLOT_ENTRY_SIZE);
51715 -               SlotMapLen -= SLOT_ENTRY_SIZE;
51716 -       }
51717 -}
51718 -
51719 -/*
51720 - * Parse the Mfg Area
51721 - */
51722 -static void __init iSeries_Parse_MfgArea(u8 *AreaData, int AreaLen,
51723 -               HvAgentId agent, u8 *PhbId,
51724 -               u8 *frame, char card[4])
51725 -{
51726 -       MfgArea *MfgAreaPtr = (MfgArea *)AreaData;
51727 -       int MfgAreaLen = AreaLen;
51728 -       u16 SlotMapFmt = 0;
51729 -
51730 -       /* Parse Mfg Data */
51731 -       while (MfgAreaLen > 0) {
51732 -               int MfgTagLen = MfgAreaPtr->TagLength;
51733 -               /* Frame ID         (FI 4649020310 ) */
51734 -               if (MfgAreaPtr->Tag == VpdFruFrameId)           /* FI  */
51735 -                       *frame = MfgAreaPtr->AreaData1;
51736 -               /* Slot Map Format  (MF 4D46020004 ) */
51737 -               else if (MfgAreaPtr->Tag == VpdSlotMapFormat)   /* MF  */
51738 -                       SlotMapFmt = (MfgAreaPtr->AreaData1 * 256)
51739 -                               + MfgAreaPtr->AreaData2;
51740 -               /* Slot Map         (SM 534D90 */
51741 -               else if (MfgAreaPtr->Tag == VpdSlotMap) {       /* SM  */
51742 -                       SlotMap *SlotMapPtr;
51743 -
51744 -                       if (SlotMapFmt == 0x1004)
51745 -                               SlotMapPtr = (SlotMap *)((char *)MfgAreaPtr
51746 -                                               + MFG_ENTRY_SIZE + 1);
51747 -                       else
51748 -                               SlotMapPtr = (SlotMap *)((char *)MfgAreaPtr
51749 -                                               + MFG_ENTRY_SIZE);
51750 -                       iSeries_Parse_SlotArea(SlotMapPtr, MfgTagLen,
51751 -                                       agent, PhbId, card);
51752 -               }
51753 -               /*
51754 -                * Point to the next Mfg Area
51755 -                * Use defined size, sizeof give wrong answer
51756 -                */
51757 -               MfgAreaPtr = (MfgArea *)((char *)MfgAreaPtr + MfgTagLen
51758 -                               + MFG_ENTRY_SIZE);
51759 -               MfgAreaLen -= (MfgTagLen + MFG_ENTRY_SIZE);
51760 -       }
51761 -}
51762 -
51763 -/*
51764 - * Look for "BUS".. Data is not Null terminated.
51765 - * PHBID of 0xFF indicates PHB was not found in VPD Data.
51766 - */
51767 -static int __init iSeries_Parse_PhbId(u8 *AreaPtr, int AreaLength)
51768 -{
51769 -       u8 *PhbPtr = AreaPtr;
51770 -       int DataLen = AreaLength;
51771 -       char PhbId = 0xFF;
51772 -
51773 -       while (DataLen > 0) {
51774 -               if ((*PhbPtr == 'B') && (*(PhbPtr + 1) == 'U')
51775 -                               && (*(PhbPtr + 2) == 'S')) {
51776 -                       PhbPtr += 3;
51777 -                       while (*PhbPtr == ' ')
51778 -                               ++PhbPtr;
51779 -                       PhbId = (*PhbPtr & 0x0F);
51780 -                       break;
51781 -               }
51782 -               ++PhbPtr;
51783 -               --DataLen;
51784 -       }
51785 -       return PhbId;
51786 -}
51787 -
51788 -/*
51789 - * Parse out the VPD Areas
51790 - */
51791 -static void __init iSeries_Parse_Vpd(u8 *VpdData, int VpdDataLen,
51792 -               HvAgentId agent, u8 *frame, char card[4])
51793 -{
51794 -       u8 *TagPtr = VpdData;
51795 -       int DataLen = VpdDataLen - 3;
51796 -       u8 PhbId = 0xff;
51797 -
51798 -       while ((*TagPtr != VpdEndOfAreaTag) && (DataLen > 0)) {
51799 -               int AreaLen = *(TagPtr + 1) + (*(TagPtr + 2) * 256);
51800 -               u8 *AreaData  = TagPtr + 3;
51801 -
51802 -               if (*TagPtr == VpdIdStringTag)
51803 -                       PhbId = iSeries_Parse_PhbId(AreaData, AreaLen);
51804 -               else if (*TagPtr == VpdVendorAreaTag)
51805 -                       iSeries_Parse_MfgArea(AreaData, AreaLen,
51806 -                                       agent, &PhbId, frame, card);
51807 -               /* Point to next Area. */
51808 -               TagPtr  = AreaData + AreaLen;
51809 -               DataLen -= AreaLen;
51810 -       }
51811 -}
51812 -
51813 -static int __init iSeries_Get_Location_Code(u16 bus, HvAgentId agent,
51814 -               u8 *frame, char card[4])
51815 -{
51816 -       int status = 0;
51817 -       int BusVpdLen = 0;
51818 -       u8 *BusVpdPtr = kmalloc(BUS_VPDSIZE, GFP_KERNEL);
51819 -
51820 -       if (BusVpdPtr == NULL) {
51821 -               printk("PCI: Bus VPD Buffer allocation failure.\n");
51822 -               return 0;
51823 -       }
51824 -       BusVpdLen = HvCallPci_getBusVpd(bus, iseries_hv_addr(BusVpdPtr),
51825 -                                       BUS_VPDSIZE);
51826 -       if (BusVpdLen == 0) {
51827 -               printk("PCI: Bus VPD Buffer zero length.\n");
51828 -               goto out_free;
51829 -       }
51830 -       /* printk("PCI: BusVpdPtr: %p, %d\n",BusVpdPtr, BusVpdLen); */
51831 -       /* Make sure this is what I think it is */
51832 -       if (*BusVpdPtr != VpdIdStringTag) {     /* 0x82 */
51833 -               printk("PCI: Bus VPD Buffer missing starting tag.\n");
51834 -               goto out_free;
51835 -       }
51836 -       iSeries_Parse_Vpd(BusVpdPtr, BusVpdLen, agent, frame, card);
51837 -       status = 1;
51838 -out_free:
51839 -       kfree(BusVpdPtr);
51840 -       return status;
51841 -}
51842 -
51843 -/*
51844 - * Prints the device information.
51845 - * - Pass in pci_dev* pointer to the device.
51846 - * - Pass in the device count
51847 - *
51848 - * Format:
51849 - * PCI: Bus  0, Device 26, Vendor 0x12AE  Frame  1, Card  C10  Ethernet
51850 - * controller
51851 - */
51852 -void __init iSeries_Device_Information(struct pci_dev *PciDev, int count)
51853 -{
51854 -       struct device_node *DevNode = PciDev->sysdata;
51855 -       struct pci_dn *pdn;
51856 -       u16 bus;
51857 -       u8 frame = 0;
51858 -       char card[4];
51859 -       HvSubBusNumber subbus;
51860 -       HvAgentId agent;
51861 -
51862 -       if (DevNode == NULL) {
51863 -               printk("%d. PCI: iSeries_Device_Information DevNode is NULL\n",
51864 -                               count);
51865 -               return;
51866 -       }
51867 -
51868 -       pdn = PCI_DN(DevNode);
51869 -       bus = pdn->busno;
51870 -       subbus = pdn->bussubno;
51871 -       agent = ISERIES_PCI_AGENTID(ISERIES_GET_DEVICE_FROM_SUBBUS(subbus),
51872 -                       ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus));
51873 -
51874 -       if (iSeries_Get_Location_Code(bus, agent, &frame, card)) {
51875 -               printk("%d. PCI: Bus%3d, Device%3d, Vendor %04X Frame%3d, "
51876 -                       "Card %4s  0x%04X\n", count, bus,
51877 -                       PCI_SLOT(PciDev->devfn), PciDev->vendor, frame,
51878 -                       card, (int)(PciDev->class >> 8));
51879 -       }
51880 -}
51881 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/maple/Kconfig powerpc.git/arch/powerpc/platforms/maple/Kconfig
51882 --- linux-2.6.24/arch/powerpc/platforms/maple/Kconfig   2008-01-24 23:58:37.000000000 +0100
51883 +++ powerpc.git/arch/powerpc/platforms/maple/Kconfig    2008-01-28 20:25:49.000000000 +0100
51884 @@ -1,6 +1,7 @@
51885  config PPC_MAPLE
51886         depends on PPC_MULTIPLATFORM && PPC64
51887         bool "Maple 970FX Evaluation Board"
51888 +       select PCI
51889         select MPIC
51890         select U3_DART
51891         select MPIC_U3_HT_IRQS
51892 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/maple/pci.c powerpc.git/arch/powerpc/platforms/maple/pci.c
51893 --- linux-2.6.24/arch/powerpc/platforms/maple/pci.c     2008-01-24 23:58:37.000000000 +0100
51894 +++ powerpc.git/arch/powerpc/platforms/maple/pci.c      2008-01-28 20:25:49.000000000 +0100
51895 @@ -558,7 +558,7 @@
51896          * safe assumptions hopefully.
51897          */
51898         if (u3_agp) {
51899 -               struct device_node *np = u3_agp->arch_data;
51900 +               struct device_node *np = u3_agp->dn;
51901                 PCI_DN(np)->busno = 0xf0;
51902                 for (np = np->child; np; np = np->sibling)
51903                         PCI_DN(np)->busno = 0xf0;
51904 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/maple/setup.c powerpc.git/arch/powerpc/platforms/maple/setup.c
51905 --- linux-2.6.24/arch/powerpc/platforms/maple/setup.c   2008-01-24 23:58:37.000000000 +0100
51906 +++ powerpc.git/arch/powerpc/platforms/maple/setup.c    2008-01-28 20:25:49.000000000 +0100
51907 @@ -42,6 +42,7 @@
51908  #include <linux/serial.h>
51909  #include <linux/smp.h>
51910  #include <linux/bitops.h>
51911 +#include <linux/of_device.h>
51912  
51913  #include <asm/processor.h>
51914  #include <asm/sections.h>
51915 @@ -56,7 +57,6 @@
51916  #include <asm/dma.h>
51917  #include <asm/cputable.h>
51918  #include <asm/time.h>
51919 -#include <asm/of_device.h>
51920  #include <asm/lmb.h>
51921  #include <asm/mpic.h>
51922  #include <asm/rtas.h>
51923 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/pasemi/Kconfig powerpc.git/arch/powerpc/platforms/pasemi/Kconfig
51924 --- linux-2.6.24/arch/powerpc/platforms/pasemi/Kconfig  2008-01-24 23:58:37.000000000 +0100
51925 +++ powerpc.git/arch/powerpc/platforms/pasemi/Kconfig   2008-01-28 20:25:49.000000000 +0100
51926 @@ -3,6 +3,7 @@
51927         bool "PA Semi SoC-based platforms"
51928         default n
51929         select MPIC
51930 +       select PCI
51931         select PPC_UDBG_16550
51932         select PPC_NATIVE
51933         select MPIC_BROKEN_REGREAD
51934 @@ -17,7 +18,7 @@
51935         bool "PA Semi IOMMU support"
51936         depends on PPC_PASEMI
51937         help
51938 -         IOMMU support for PA6T-1682M
51939 +         IOMMU support for PA Semi PWRficient
51940  
51941  config PPC_PASEMI_IOMMU_DMA_FORCE
51942         bool "Force DMA engine to use IOMMU"
51943 @@ -36,13 +37,4 @@
51944         help
51945           Driver for MDIO via GPIO on PWRficient platforms
51946  
51947 -config ELECTRA_IDE
51948 -      tristate "Electra IDE driver"
51949 -      default y
51950 -      depends on PPC_PASEMI && ATA
51951 -      select PATA_PLATFORM
51952 -      help
51953 -       This includes driver support for the Electra on-board IDE
51954 -       interface.
51955 -
51956  endmenu
51957 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/pasemi/Makefile powerpc.git/arch/powerpc/platforms/pasemi/Makefile
51958 --- linux-2.6.24/arch/powerpc/platforms/pasemi/Makefile 2008-01-24 23:58:37.000000000 +0100
51959 +++ powerpc.git/arch/powerpc/platforms/pasemi/Makefile  2008-01-28 20:25:49.000000000 +0100
51960 @@ -1,4 +1,3 @@
51961  obj-y  += setup.o pci.o time.o idle.o powersave.o iommu.o
51962  obj-$(CONFIG_PPC_PASEMI_MDIO)  += gpio_mdio.o
51963 -obj-$(CONFIG_ELECTRA_IDE) += electra_ide.o
51964  obj-$(CONFIG_PPC_PASEMI_CPUFREQ) += cpufreq.o
51965 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/pasemi/cpufreq.c powerpc.git/arch/powerpc/platforms/pasemi/cpufreq.c
51966 --- linux-2.6.24/arch/powerpc/platforms/pasemi/cpufreq.c        2008-01-24 23:58:37.000000000 +0100
51967 +++ powerpc.git/arch/powerpc/platforms/pasemi/cpufreq.c 2008-01-28 20:25:49.000000000 +0100
51968 @@ -32,6 +32,7 @@
51969  #include <asm/io.h>
51970  #include <asm/prom.h>
51971  #include <asm/time.h>
51972 +#include <asm/smp.h>
51973  
51974  #define SDCASR_REG             0x0100
51975  #define SDCASR_REG_STRIDE      0x1000
51976 @@ -124,6 +125,11 @@
51977         local_irq_restore(flags);
51978  }
51979  
51980 +int check_astate(void)
51981 +{
51982 +       return get_cur_astate(hard_smp_processor_id());
51983 +}
51984 +
51985  void restore_astate(int cpu)
51986  {
51987         set_astate(cpu, current_astate);
51988 @@ -147,7 +153,10 @@
51989         if (!cpu)
51990                 goto out;
51991  
51992 -       dn = of_find_compatible_node(NULL, "sdc", "1682m-sdc");
51993 +       dn = of_find_compatible_node(NULL, NULL, "1682m-sdc");
51994 +       if (!dn)
51995 +               dn = of_find_compatible_node(NULL, NULL,
51996 +                                            "pasemi,pwrficient-sdc");
51997         if (!dn)
51998                 goto out;
51999         err = of_address_to_resource(dn, 0, &res);
52000 @@ -160,7 +169,10 @@
52001                 goto out;
52002         }
52003  
52004 -       dn = of_find_compatible_node(NULL, "gizmo", "1682m-gizmo");
52005 +       dn = of_find_compatible_node(NULL, NULL, "1682m-gizmo");
52006 +       if (!dn)
52007 +               dn = of_find_compatible_node(NULL, NULL,
52008 +                                            "pasemi,pwrficient-gizmo");
52009         if (!dn) {
52010                 err = -ENODEV;
52011                 goto out_unmap_sdcasr;
52012 @@ -292,7 +304,8 @@
52013  
52014  static int __init pas_cpufreq_init(void)
52015  {
52016 -       if (!machine_is_compatible("PA6T-1682M"))
52017 +       if (!machine_is_compatible("PA6T-1682M") &&
52018 +           !machine_is_compatible("pasemi,pwrficient"))
52019                 return -ENODEV;
52020  
52021         return cpufreq_register_driver(&pas_cpufreq_driver);
52022 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/pasemi/electra_ide.c powerpc.git/arch/powerpc/platforms/pasemi/electra_ide.c
52023 --- linux-2.6.24/arch/powerpc/platforms/pasemi/electra_ide.c    2008-01-24 23:58:37.000000000 +0100
52024 +++ powerpc.git/arch/powerpc/platforms/pasemi/electra_ide.c     1970-01-01 01:00:00.000000000 +0100
52025 @@ -1,96 +0,0 @@
52026 -/*
52027 - * Copyright (C) 2007 PA Semi, Inc
52028 - *
52029 - * Maintained by: Olof Johansson <olof@lixom.net>
52030 - *
52031 - * This program is free software; you can redistribute it and/or modify
52032 - * it under the terms of the GNU General Public License version 2 as
52033 - * published by the Free Software Foundation.
52034 - *
52035 - * This program is distributed in the hope that it will be useful,
52036 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
52037 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
52038 - * GNU General Public License for more details.
52039 - *
52040 - * You should have received a copy of the GNU General Public License
52041 - * along with this program; if not, write to the Free Software
52042 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
52043 - */
52044 -
52045 -#include <linux/platform_device.h>
52046 -
52047 -#include <asm/prom.h>
52048 -#include <asm/system.h>
52049 -
52050 -/* The electra IDE interface is incredibly simple: Just a device on the localbus
52051 - * with interrupts hooked up to one of the GPIOs. The device tree contains the
52052 - * address window and interrupt mappings already, and the pata_platform driver handles
52053 - * the rest. We just need to hook the two up.
52054 - */
52055 -
52056 -#define MAX_IFS        4       /* really, we have only one */
52057 -
52058 -static struct platform_device *pdevs[MAX_IFS];
52059 -
52060 -static int __devinit electra_ide_init(void)
52061 -{
52062 -       struct device_node *np;
52063 -       struct resource r[3];
52064 -       int ret = 0;
52065 -       int i;
52066 -
52067 -       np = of_find_compatible_node(NULL, "ide", "electra-ide");
52068 -       i = 0;
52069 -
52070 -       while (np && i < MAX_IFS) {
52071 -               memset(r, 0, sizeof(r));
52072 -
52073 -               /* pata_platform wants two address ranges: one for the base registers,
52074 -                * another for the control (altstatus). It's located at offset 0x3f6 in
52075 -                * the window, but the device tree only has one large register window
52076 -                * that covers both ranges. So we need to split it up by hand here:
52077 -                */
52078 -
52079 -               ret = of_address_to_resource(np, 0, &r[0]);
52080 -               if (ret)
52081 -                       goto out;
52082 -               ret = of_address_to_resource(np, 0, &r[1]);
52083 -               if (ret)
52084 -                       goto out;
52085 -
52086 -               r[1].start += 0x3f6;
52087 -               r[0].end = r[1].start-1;
52088 -
52089 -               r[2].start = irq_of_parse_and_map(np, 0);
52090 -               r[2].end = irq_of_parse_and_map(np, 0);
52091 -               r[2].flags = IORESOURCE_IRQ;
52092 -
52093 -               pr_debug("registering platform device at 0x%lx/0x%lx, irq is %ld\n",
52094 -                        r[0].start, r[1].start, r[2].start);
52095 -               pdevs[i] = platform_device_register_simple("pata_platform", i, r, 3);
52096 -               if (IS_ERR(pdevs[i])) {
52097 -                       ret = PTR_ERR(pdevs[i]);
52098 -                       pdevs[i] = NULL;
52099 -                       goto out;
52100 -               }
52101 -               np = of_find_compatible_node(np, "ide", "electra-ide");
52102 -       }
52103 -out:
52104 -       return ret;
52105 -}
52106 -module_init(electra_ide_init);
52107 -
52108 -static void __devexit electra_ide_exit(void)
52109 -{
52110 -       int i;
52111 -
52112 -       for (i = 0; i < MAX_IFS; i++)
52113 -               if (pdevs[i])
52114 -                       platform_device_unregister(pdevs[i]);
52115 -}
52116 -module_exit(electra_ide_exit);
52117 -
52118 -
52119 -MODULE_LICENSE("GPL");
52120 -MODULE_AUTHOR ("Olof Johansson <olof@lixom.net>");
52121 -MODULE_DESCRIPTION("PA Semi Electra IDE driver");
52122 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/pasemi/gpio_mdio.c powerpc.git/arch/powerpc/platforms/pasemi/gpio_mdio.c
52123 --- linux-2.6.24/arch/powerpc/platforms/pasemi/gpio_mdio.c      2008-01-24 23:58:37.000000000 +0100
52124 +++ powerpc.git/arch/powerpc/platforms/pasemi/gpio_mdio.c       2008-01-28 20:25:49.000000000 +0100
52125 @@ -30,7 +30,7 @@
52126  #include <linux/interrupt.h>
52127  #include <linux/phy.h>
52128  #include <linux/platform_device.h>
52129 -#include <asm/of_platform.h>
52130 +#include <linux/of_platform.h>
52131  
52132  #define DELAY 1
52133  
52134 @@ -218,45 +218,27 @@
52135                                      const struct of_device_id *match)
52136  {
52137         struct device *dev = &ofdev->dev;
52138 -       struct device_node *np = ofdev->node;
52139 -       struct device_node *gpio_np;
52140 +       struct device_node *phy_dn, *np = ofdev->node;
52141         struct mii_bus *new_bus;
52142 -       struct resource res;
52143         struct gpio_priv *priv;
52144         const unsigned int *prop;
52145 -       int err = 0;
52146 +       int err;
52147         int i;
52148  
52149 -       gpio_np = of_find_compatible_node(NULL, "gpio", "1682m-gpio");
52150 -
52151 -       if (!gpio_np)
52152 -               return -ENODEV;
52153 -
52154 -       err = of_address_to_resource(gpio_np, 0, &res);
52155 -       of_node_put(gpio_np);
52156 -
52157 -       if (err)
52158 -               return -EINVAL;
52159 -
52160 -       if (!gpio_regs)
52161 -               gpio_regs = ioremap(res.start, 0x100);
52162 -
52163 -       if (!gpio_regs)
52164 -               return -EPERM;
52165 -
52166 +       err = -ENOMEM;
52167         priv = kzalloc(sizeof(struct gpio_priv), GFP_KERNEL);
52168 -       if (priv == NULL)
52169 -               return -ENOMEM;
52170 +       if (!priv)
52171 +               goto out;
52172  
52173         new_bus = kzalloc(sizeof(struct mii_bus), GFP_KERNEL);
52174  
52175 -       if (new_bus == NULL)
52176 -               return -ENOMEM;
52177 +       if (!new_bus)
52178 +               goto out_free_priv;
52179  
52180 -       new_bus->name = "pasemi gpio mdio bus",
52181 -       new_bus->read = &gpio_mdio_read,
52182 -       new_bus->write = &gpio_mdio_write,
52183 -       new_bus->reset = &gpio_mdio_reset,
52184 +       new_bus->name = "pasemi gpio mdio bus";
52185 +       new_bus->read = &gpio_mdio_read;
52186 +       new_bus->write = &gpio_mdio_write;
52187 +       new_bus->reset = &gpio_mdio_reset;
52188  
52189         prop = of_get_property(np, "reg", NULL);
52190         new_bus->id = *prop;
52191 @@ -265,9 +247,24 @@
52192         new_bus->phy_mask = 0;
52193  
52194         new_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
52195 -       for(i = 0; i < PHY_MAX_ADDR; ++i)
52196 -               new_bus->irq[i] = irq_create_mapping(NULL, 10);
52197  
52198 +       if (!new_bus->irq)
52199 +               goto out_free_bus;
52200 +
52201 +       for (i = 0; i < PHY_MAX_ADDR; i++)
52202 +               new_bus->irq[i] = NO_IRQ;
52203 +
52204 +       for (phy_dn = of_get_next_child(np, NULL);
52205 +            phy_dn != NULL;
52206 +            phy_dn = of_get_next_child(np, phy_dn)) {
52207 +               const unsigned int *ip, *regp;
52208 +
52209 +               ip = of_get_property(phy_dn, "interrupts", NULL);
52210 +               regp = of_get_property(phy_dn, "reg", NULL);
52211 +               if (!ip || !regp || *regp >= PHY_MAX_ADDR)
52212 +                       continue;
52213 +               new_bus->irq[*regp] = irq_create_mapping(NULL, *ip);
52214 +       }
52215  
52216         prop = of_get_property(np, "mdc-pin", NULL);
52217         priv->mdc_pin = *prop;
52218 @@ -280,17 +277,21 @@
52219  
52220         err = mdiobus_register(new_bus);
52221  
52222 -       if (0 != err) {
52223 +       if (err != 0) {
52224                 printk(KERN_ERR "%s: Cannot register as MDIO bus, err %d\n",
52225                                 new_bus->name, err);
52226 -               goto bus_register_fail;
52227 +               goto out_free_irq;
52228         }
52229  
52230         return 0;
52231  
52232 -bus_register_fail:
52233 +out_free_irq:
52234 +       kfree(new_bus->irq);
52235 +out_free_bus:
52236         kfree(new_bus);
52237 -
52238 +out_free_priv:
52239 +       kfree(priv);
52240 +out:
52241         return err;
52242  }
52243  
52244 @@ -317,6 +318,7 @@
52245         },
52246         {},
52247  };
52248 +MODULE_DEVICE_TABLE(of, gpio_mdio_match);
52249  
52250  static struct of_platform_driver gpio_mdio_driver =
52251  {
52252 @@ -330,12 +332,32 @@
52253  
52254  int gpio_mdio_init(void)
52255  {
52256 +       struct device_node *np;
52257 +
52258 +       np = of_find_compatible_node(NULL, NULL, "1682m-gpio");
52259 +       if (!np)
52260 +               np = of_find_compatible_node(NULL, NULL,
52261 +                                            "pasemi,pwrficient-gpio");
52262 +       if (!np)
52263 +               return -ENODEV;
52264 +       gpio_regs = of_iomap(np, 0);
52265 +       of_node_put(np);
52266 +
52267 +       if (!gpio_regs)
52268 +               return -ENODEV;
52269 +
52270         return of_register_platform_driver(&gpio_mdio_driver);
52271  }
52272 +module_init(gpio_mdio_init);
52273  
52274  void gpio_mdio_exit(void)
52275  {
52276         of_unregister_platform_driver(&gpio_mdio_driver);
52277 +       if (gpio_regs)
52278 +               iounmap(gpio_regs);
52279  }
52280 -device_initcall(gpio_mdio_init);
52281 +module_exit(gpio_mdio_exit);
52282  
52283 +MODULE_LICENSE("GPL");
52284 +MODULE_AUTHOR("Olof Johansson <olof@lixom.net>");
52285 +MODULE_DESCRIPTION("Driver for MDIO over GPIO on PA Semi PWRficient-based boards");
52286 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/pasemi/idle.c powerpc.git/arch/powerpc/platforms/pasemi/idle.c
52287 --- linux-2.6.24/arch/powerpc/platforms/pasemi/idle.c   2008-01-24 23:58:37.000000000 +0100
52288 +++ powerpc.git/arch/powerpc/platforms/pasemi/idle.c    2008-01-28 20:25:49.000000000 +0100
52289 @@ -74,9 +74,6 @@
52290  
52291  static int __init pasemi_idle_init(void)
52292  {
52293 -       if (!machine_is(pasemi))
52294 -               return -ENODEV;
52295 -
52296  #ifndef CONFIG_PPC_PASEMI_CPUFREQ
52297         printk(KERN_WARNING "No cpufreq driver, powersavings modes disabled\n");
52298         current_mode = 0;
52299 @@ -88,7 +85,7 @@
52300  
52301         return 0;
52302  }
52303 -late_initcall(pasemi_idle_init);
52304 +machine_late_initcall(pasemi, pasemi_idle_init);
52305  
52306  static int __init idle_param(char *p)
52307  {
52308 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/pasemi/pasemi.h powerpc.git/arch/powerpc/platforms/pasemi/pasemi.h
52309 --- linux-2.6.24/arch/powerpc/platforms/pasemi/pasemi.h 2008-01-24 23:58:37.000000000 +0100
52310 +++ powerpc.git/arch/powerpc/platforms/pasemi/pasemi.h  2008-01-28 20:25:49.000000000 +0100
52311 @@ -16,8 +16,14 @@
52312  
52313  /* Restore astate to last set */
52314  #ifdef CONFIG_PPC_PASEMI_CPUFREQ
52315 +extern int check_astate(void);
52316  extern void restore_astate(int cpu);
52317  #else
52318 +static inline int check_astate(void)
52319 +{
52320 +       /* Always return >0 so we never power save */
52321 +       return 1;
52322 +}
52323  static inline void restore_astate(int cpu)
52324  {
52325  }
52326 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/pasemi/powersave.S powerpc.git/arch/powerpc/platforms/pasemi/powersave.S
52327 --- linux-2.6.24/arch/powerpc/platforms/pasemi/powersave.S      2008-01-24 23:58:37.000000000 +0100
52328 +++ powerpc.git/arch/powerpc/platforms/pasemi/powersave.S       2008-01-28 20:25:49.000000000 +0100
52329 @@ -62,7 +62,16 @@
52330         mflr    r0
52331         std     r0, 16(r1)
52332         stdu    r1,-64(r1)
52333 +#ifdef CONFIG_PPC_PASEMI_CPUFREQ
52334 +       std     r3, 48(r1)
52335  
52336 +       /* Only do power savings when in astate 0 */
52337 +       bl      .check_astate
52338 +       cmpwi   r3,0
52339 +       bne     1f
52340 +
52341 +       ld      r3, 48(r1)
52342 +#endif
52343         LOAD_REG_IMMEDIATE(r6,MSR_DR|MSR_IR|MSR_ME|MSR_EE)
52344         mfmsr   r4
52345         andc    r5,r4,r6
52346 @@ -73,7 +82,7 @@
52347  
52348         mtmsrd  r4,0
52349  
52350 -       addi    r1,r1,64
52351 +1:     addi    r1,r1,64
52352         ld      r0,16(r1)
52353         mtlr    r0
52354         blr
52355 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/pasemi/setup.c powerpc.git/arch/powerpc/platforms/pasemi/setup.c
52356 --- linux-2.6.24/arch/powerpc/platforms/pasemi/setup.c  2008-01-24 23:58:37.000000000 +0100
52357 +++ powerpc.git/arch/powerpc/platforms/pasemi/setup.c   2008-01-28 20:25:49.000000000 +0100
52358 @@ -27,6 +27,7 @@
52359  #include <linux/delay.h>
52360  #include <linux/console.h>
52361  #include <linux/pci.h>
52362 +#include <linux/of_platform.h>
52363  
52364  #include <asm/prom.h>
52365  #include <asm/system.h>
52366 @@ -35,7 +36,7 @@
52367  #include <asm/mpic.h>
52368  #include <asm/smp.h>
52369  #include <asm/time.h>
52370 -#include <asm/of_platform.h>
52371 +#include <asm/mmu.h>
52372  
52373  #include <pcmcia/ss.h>
52374  #include <pcmcia/cistpl.h>
52375 @@ -43,6 +44,10 @@
52376  
52377  #include "pasemi.h"
52378  
52379 +#if !defined(CONFIG_SMP)
52380 +static void smp_send_stop(void) {}
52381 +#endif
52382 +
52383  /* SDC reset register, must be pre-mapped at reset time */
52384  static void __iomem *reset_reg;
52385  
52386 @@ -56,10 +61,14 @@
52387  
52388  static struct mce_regs mce_regs[MAX_MCE_REGS];
52389  static int num_mce_regs;
52390 +static int nmi_virq = NO_IRQ;
52391  
52392  
52393  static void pas_restart(char *cmd)
52394  {
52395 +       /* Need to put others cpu in hold loop so they're not sleeping */
52396 +       smp_send_stop();
52397 +       udelay(10000);
52398         printk("Restarting...\n");
52399         while (1)
52400                 out_le32(reset_reg, 0x6000000);
52401 @@ -126,9 +135,6 @@
52402         struct pci_dev *dev;
52403         int reg;
52404  
52405 -       if (!machine_is(pasemi))
52406 -               return -ENODEV;
52407 -
52408         /* Remap various SoC status registers for use by the MCE handler */
52409  
52410         reg = 0;
52411 @@ -172,7 +178,7 @@
52412  
52413         return 0;
52414  }
52415 -device_initcall(pas_setup_mce_regs);
52416 +machine_device_initcall(pasemi, pas_setup_mce_regs);
52417  
52418  static __init void pas_init_IRQ(void)
52419  {
52420 @@ -181,6 +187,8 @@
52421         unsigned long openpic_addr;
52422         const unsigned int *opprop;
52423         int naddr, opplen;
52424 +       int mpic_flags;
52425 +       const unsigned int *nmiprop;
52426         struct mpic *mpic;
52427  
52428         mpic_node = NULL;
52429 @@ -213,13 +221,26 @@
52430         openpic_addr = of_read_number(opprop, naddr);
52431         printk(KERN_DEBUG "OpenPIC addr: %lx\n", openpic_addr);
52432  
52433 +       mpic_flags = MPIC_PRIMARY | MPIC_LARGE_VECTORS | MPIC_NO_BIAS;
52434 +
52435 +       nmiprop = of_get_property(mpic_node, "nmi-source", NULL);
52436 +       if (nmiprop)
52437 +               mpic_flags |= MPIC_ENABLE_MCK;
52438 +
52439         mpic = mpic_alloc(mpic_node, openpic_addr,
52440 -                         MPIC_PRIMARY|MPIC_LARGE_VECTORS,
52441 -                         0, 0, " PAS-OPIC  ");
52442 +                         mpic_flags, 0, 0, "PASEMI-OPIC");
52443         BUG_ON(!mpic);
52444  
52445         mpic_assign_isu(mpic, 0, openpic_addr + 0x10000);
52446         mpic_init(mpic);
52447 +       /* The NMI/MCK source needs to be prio 15 */
52448 +       if (nmiprop) {
52449 +               nmi_virq = irq_create_mapping(NULL, *nmiprop);
52450 +               mpic_irq_set_priority(nmi_virq, 15);
52451 +               set_irq_type(nmi_virq, IRQ_TYPE_EDGE_RISING);
52452 +               mpic_unmask_irq(nmi_virq);
52453 +       }
52454 +
52455         of_node_put(mpic_node);
52456         of_node_put(root);
52457  }
52458 @@ -239,6 +260,14 @@
52459  
52460         srr0 = regs->nip;
52461         srr1 = regs->msr;
52462 +
52463 +       if (nmi_virq != NO_IRQ && mpic_get_mcirq() == nmi_virq) {
52464 +               printk(KERN_ERR "NMI delivered\n");
52465 +               debugger(regs);
52466 +               mpic_end_irq(nmi_virq);
52467 +               goto out;
52468 +       }
52469 +
52470         dsisr = mfspr(SPRN_DSISR);
52471         printk(KERN_ERR "Machine Check on CPU %d\n", cpu);
52472         printk(KERN_ERR "SRR0  0x%016lx SRR1 0x%016lx\n", srr0, srr1);
52473 @@ -295,14 +324,14 @@
52474                 int i;
52475  
52476                 printk(KERN_ERR "slb contents:\n");
52477 -               for (i = 0; i < SLB_NUM_ENTRIES; i++) {
52478 +               for (i = 0; i < mmu_slb_size; i++) {
52479                         asm volatile("slbmfee  %0,%1" : "=r" (e) : "r" (i));
52480                         asm volatile("slbmfev  %0,%1" : "=r" (v) : "r" (i));
52481                         printk(KERN_ERR "%02d %016lx %016lx\n", i, e, v);
52482                 }
52483         }
52484  
52485 -
52486 +out:
52487         /* SRR1[62] is from MSR[62] if recoverable, so pass that back */
52488         return !!(srr1 & 0x2);
52489  }
52490 @@ -362,16 +391,17 @@
52491  
52492  
52493  static struct of_device_id pasemi_bus_ids[] = {
52494 +       /* Unfortunately needed for legacy firmwares */
52495         { .type = "localbus", },
52496         { .type = "sdc", },
52497 +       /* These are the proper entries, which newer firmware uses */
52498 +       { .compatible = "pasemi,localbus", },
52499 +       { .compatible = "pasemi,sdc", },
52500         {},
52501  };
52502  
52503  static int __init pasemi_publish_devices(void)
52504  {
52505 -       if (!machine_is(pasemi))
52506 -               return 0;
52507 -
52508         pasemi_pcmcia_init();
52509  
52510         /* Publish OF platform devices for SDC and other non-PCI devices */
52511 @@ -379,7 +409,7 @@
52512  
52513         return 0;
52514  }
52515 -device_initcall(pasemi_publish_devices);
52516 +machine_device_initcall(pasemi, pasemi_publish_devices);
52517  
52518  
52519  /*
52520 @@ -389,7 +419,8 @@
52521  {
52522         unsigned long root = of_get_flat_dt_root();
52523  
52524 -       if (!of_flat_dt_is_compatible(root, "PA6T-1682M"))
52525 +       if (!of_flat_dt_is_compatible(root, "PA6T-1682M") &&
52526 +           !of_flat_dt_is_compatible(root, "pasemi,pwrficient"))
52527                 return 0;
52528  
52529         hpte_init_native();
52530 @@ -400,7 +431,7 @@
52531  }
52532  
52533  define_machine(pasemi) {
52534 -       .name                   = "PA Semi PA6T-1682M",
52535 +       .name                   = "PA Semi PWRficient",
52536         .probe                  = pas_probe,
52537         .setup_arch             = pas_setup_arch,
52538         .init_early             = pas_init_early,
52539 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/powermac/low_i2c.c powerpc.git/arch/powerpc/platforms/powermac/low_i2c.c
52540 --- linux-2.6.24/arch/powerpc/platforms/powermac/low_i2c.c      2008-01-24 23:58:37.000000000 +0100
52541 +++ powerpc.git/arch/powerpc/platforms/powermac/low_i2c.c       2008-01-28 20:25:49.000000000 +0100
52542 @@ -585,8 +585,7 @@
52543         struct device_node *np, *child, *parent;
52544  
52545         /* Probe keywest-i2c busses */
52546 -       for (np = NULL;
52547 -            (np = of_find_compatible_node(np, "i2c","keywest-i2c")) != NULL;){
52548 +       for_each_compatible_node(np, "i2c","keywest-i2c") {
52549                 struct pmac_i2c_host_kw *host;
52550                 int multibus, chans, i;
52551  
52552 @@ -1462,9 +1461,6 @@
52553                 return 0;
52554         i2c_inited = 1;
52555  
52556 -       if (!machine_is(powermac))
52557 -               return 0;
52558 -
52559         /* Probe keywest-i2c busses */
52560         kw_i2c_probe();
52561  
52562 @@ -1483,7 +1479,7 @@
52563  
52564         return 0;
52565  }
52566 -arch_initcall(pmac_i2c_init);
52567 +machine_arch_initcall(powermac, pmac_i2c_init);
52568  
52569  /* Since pmac_i2c_init can be called too early for the platform device
52570   * registration, we need to do it at a later time. In our case, subsys
52571 @@ -1515,4 +1511,4 @@
52572  
52573         return 0;
52574  }
52575 -subsys_initcall(pmac_i2c_create_platform_devices);
52576 +machine_subsys_initcall(powermac, pmac_i2c_create_platform_devices);
52577 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/powermac/pci.c powerpc.git/arch/powerpc/platforms/powermac/pci.c
52578 --- linux-2.6.24/arch/powerpc/platforms/powermac/pci.c  2008-01-24 23:58:37.000000000 +0100
52579 +++ powerpc.git/arch/powerpc/platforms/powermac/pci.c   2008-01-28 20:25:49.000000000 +0100
52580 @@ -40,8 +40,6 @@
52581  static int has_uninorth;
52582  #ifdef CONFIG_PPC64
52583  static struct pci_controller *u3_agp;
52584 -static struct pci_controller *u4_pcie;
52585 -static struct pci_controller *u3_ht;
52586  #else
52587  static int has_second_ohare;
52588  #endif /* CONFIG_PPC64 */
52589 @@ -314,12 +312,15 @@
52590  
52591         /* We only allow config cycles to devices that are in OF device-tree
52592          * as we are apparently having some weird things going on with some
52593 -        * revs of K2 on recent G5s
52594 +        * revs of K2 on recent G5s, except for the host bridge itself, which
52595 +        * is missing from the tree but we know we can probe.
52596          */
52597         if (bus->self)
52598                 busdn = pci_device_to_OF_node(bus->self);
52599 +       else if (devfn == 0)
52600 +               return 0;
52601         else
52602 -               busdn = hose->arch_data;
52603 +               busdn = hose->dn;
52604         for (dn = busdn->child; dn; dn = dn->sibling)
52605                 if (PCI_DN(dn) && PCI_DN(dn)->devfn == devfn)
52606                         break;
52607 @@ -344,14 +345,15 @@
52608                 + (((unsigned int)bus) << 16) \
52609                 + 0x01000000UL)
52610  
52611 -static volatile void __iomem *u3_ht_cfg_access(struct pci_controller* hose,
52612 -                                            u8 bus, u8 devfn, u8 offset)
52613 +static void __iomem *u3_ht_cfg_access(struct pci_controller *hose, u8 bus,
52614 +                                     u8 devfn, u8 offset, int *swap)
52615  {
52616 +       *swap = 1;
52617         if (bus == hose->first_busno) {
52618 -               /* For now, we don't self probe U3 HT bridge */
52619 -               if (PCI_SLOT(devfn) == 0)
52620 -                       return NULL;
52621 -               return hose->cfg_data + U3_HT_CFA0(devfn, offset);
52622 +               if (devfn != 0)
52623 +                       return hose->cfg_data + U3_HT_CFA0(devfn, offset);
52624 +               *swap = 0;
52625 +               return ((void __iomem *)hose->cfg_addr) + (offset << 2);
52626         } else
52627                 return hose->cfg_data + U3_HT_CFA1(bus, devfn, offset);
52628  }
52629 @@ -360,14 +362,15 @@
52630                                     int offset, int len, u32 *val)
52631  {
52632         struct pci_controller *hose;
52633 -       volatile void __iomem *addr;
52634 +       void __iomem *addr;
52635 +       int swap;
52636  
52637         hose = pci_bus_to_host(bus);
52638         if (hose == NULL)
52639                 return PCIBIOS_DEVICE_NOT_FOUND;
52640         if (offset >= 0x100)
52641                 return  PCIBIOS_BAD_REGISTER_NUMBER;
52642 -       addr = u3_ht_cfg_access(hose, bus->number, devfn, offset);
52643 +       addr = u3_ht_cfg_access(hose, bus->number, devfn, offset, &swap);
52644         if (!addr)
52645                 return PCIBIOS_DEVICE_NOT_FOUND;
52646  
52647 @@ -397,10 +400,10 @@
52648                 *val = in_8(addr);
52649                 break;
52650         case 2:
52651 -               *val = in_le16(addr);
52652 +               *val = swap ? in_le16(addr) : in_be16(addr);
52653                 break;
52654         default:
52655 -               *val = in_le32(addr);
52656 +               *val = swap ? in_le32(addr) : in_be32(addr);
52657                 break;
52658         }
52659         return PCIBIOS_SUCCESSFUL;
52660 @@ -410,14 +413,15 @@
52661                                      int offset, int len, u32 val)
52662  {
52663         struct pci_controller *hose;
52664 -       volatile void __iomem *addr;
52665 +       void __iomem *addr;
52666 +       int swap;
52667  
52668         hose = pci_bus_to_host(bus);
52669         if (hose == NULL)
52670                 return PCIBIOS_DEVICE_NOT_FOUND;
52671         if (offset >= 0x100)
52672                 return  PCIBIOS_BAD_REGISTER_NUMBER;
52673 -       addr = u3_ht_cfg_access(hose, bus->number, devfn, offset);
52674 +       addr = u3_ht_cfg_access(hose, bus->number, devfn, offset, &swap);
52675         if (!addr)
52676                 return PCIBIOS_DEVICE_NOT_FOUND;
52677  
52678 @@ -439,10 +443,10 @@
52679                 out_8(addr, val);
52680                 break;
52681         case 2:
52682 -               out_le16(addr, val);
52683 +               swap ? out_le16(addr, val) : out_be16(addr, val);
52684                 break;
52685         default:
52686 -               out_le32((u32 __iomem *)addr, val);
52687 +               swap ? out_le32(addr, val) : out_be32(addr, val);
52688                 break;
52689         }
52690         return PCIBIOS_SUCCESSFUL;
52691 @@ -725,7 +729,7 @@
52692  static int __init setup_uninorth(struct pci_controller *hose,
52693                                  struct resource *addr)
52694  {
52695 -       pci_assign_all_buses = 1;
52696 +       ppc_pci_flags |= PPC_PCI_REASSIGN_ALL_BUS;
52697         has_uninorth = 1;
52698         hose->ops = &macrisc_pci_ops;
52699         hose->cfg_addr = ioremap(addr->start + 0x800000, 0x1000);
52700 @@ -773,31 +777,72 @@
52701          */
52702         hose->first_busno = 0x00;
52703         hose->last_busno = 0xff;
52704 -       u4_pcie = hose;
52705  }
52706  
52707 -static void __init setup_u3_ht(struct pci_controller* hose)
52708 +static void __init parse_region_decode(struct pci_controller *hose,
52709 +                                      u32 decode)
52710  {
52711 -       struct device_node *np = (struct device_node *)hose->arch_data;
52712 -       struct pci_controller *other = NULL;
52713 -       int i, cur;
52714 +       unsigned long base, end, next = -1;
52715 +       int i, cur = -1;
52716  
52717 +       /* Iterate through all bits. We ignore the last bit as this region is
52718 +        * reserved for the ROM among other niceties
52719 +        */
52720 +       for (i = 0; i < 31; i++) {
52721 +               if ((decode & (0x80000000 >> i)) == 0)
52722 +                       continue;
52723 +               if (i < 16) {
52724 +                       base = 0xf0000000 | (((u32)i) << 24);
52725 +                       end = base + 0x00ffffff;
52726 +               } else {
52727 +                       base = ((u32)i-16) << 28;
52728 +                       end = base + 0x0fffffff;
52729 +               }
52730 +               if (base != next) {
52731 +                       if (++cur >= 3) {
52732 +                               printk(KERN_WARNING "PCI: Too many ranges !\n");
52733 +                               break;
52734 +                       }
52735 +                       hose->mem_resources[cur].flags = IORESOURCE_MEM;
52736 +                       hose->mem_resources[cur].name = hose->dn->full_name;
52737 +                       hose->mem_resources[cur].start = base;
52738 +                       hose->mem_resources[cur].end = end;
52739 +                       DBG("  %d: 0x%08lx-0x%08lx\n", cur, base, end);
52740 +               } else {
52741 +                       DBG("   :           -0x%08lx\n", end);
52742 +                       hose->mem_resources[cur].end = end;
52743 +               }
52744 +               next = end + 1;
52745 +       }
52746 +}
52747 +
52748 +static void __init setup_u3_ht(struct pci_controller* hose)
52749 +{
52750 +       struct device_node *np = hose->dn;
52751 +       struct resource cfg_res, self_res;
52752 +       u32 decode;
52753  
52754         hose->ops = &u3_ht_pci_ops;
52755  
52756 -       /* We hard code the address because of the different size of
52757 -        * the reg address cell, we shall fix that by killing struct
52758 -        * reg_property and using some accessor functions instead
52759 +       /* Get base addresses from OF tree
52760          */
52761 -       hose->cfg_data = ioremap(0xf2000000, 0x02000000);
52762 +       if (of_address_to_resource(np, 0, &cfg_res) ||
52763 +           of_address_to_resource(np, 1, &self_res)) {
52764 +               printk(KERN_ERR "PCI: Failed to get U3/U4 HT resources !\n");
52765 +               return;
52766 +       }
52767 +
52768 +       /* Map external cfg space access into cfg_data and self registers
52769 +        * into cfg_addr
52770 +        */
52771 +       hose->cfg_data = ioremap(cfg_res.start, 0x02000000);
52772 +       hose->cfg_addr = ioremap(self_res.start,
52773 +                                self_res.end - self_res.start + 1);
52774  
52775         /*
52776 -        * /ht node doesn't expose a "ranges" property, so we "remove"
52777 -        * regions that have been allocated to AGP. So far, this version of
52778 -        * the code doesn't assign any of the 0xfxxxxxxx "fine" memory regions
52779 -        * to /ht. We need to fix that sooner or later by either parsing all
52780 -        * child "ranges" properties or figuring out the U3 address space
52781 -        * decoding logic and then read its configuration register (if any).
52782 +        * /ht node doesn't expose a "ranges" property, we read the register
52783 +        * that controls the decoding logic and use that for memory regions.
52784 +        * The IO region is hard coded since it is fixed in HW as well.
52785          */
52786         hose->io_base_phys = 0xf4000000;
52787         hose->pci_io_size = 0x00400000;
52788 @@ -808,76 +853,33 @@
52789         hose->pci_mem_offset = 0;
52790         hose->first_busno = 0;
52791         hose->last_busno = 0xef;
52792 -       hose->mem_resources[0].name = np->full_name;
52793 -       hose->mem_resources[0].start = 0x80000000;
52794 -       hose->mem_resources[0].end = 0xefffffff;
52795 -       hose->mem_resources[0].flags = IORESOURCE_MEM;
52796 -
52797 -       u3_ht = hose;
52798 -
52799 -       if (u3_agp != NULL)
52800 -               other = u3_agp;
52801 -       else if (u4_pcie != NULL)
52802 -               other = u4_pcie;
52803  
52804 -       if (other == NULL) {
52805 -               DBG("U3/4 has no AGP/PCIE, using full resource range\n");
52806 -               return;
52807 -       }
52808 +       /* Note: fix offset when cfg_addr becomes a void * */
52809 +       decode = in_be32(hose->cfg_addr + 0x80);
52810  
52811 -       /* Fixup bus range vs. PCIE */
52812 -       if (u4_pcie)
52813 -               hose->last_busno = u4_pcie->first_busno - 1;
52814 -
52815 -       /* We "remove" the AGP resources from the resources allocated to HT,
52816 -        * that is we create "holes". However, that code does assumptions
52817 -        * that so far happen to be true (cross fingers...), typically that
52818 -        * resources in the AGP node are properly ordered
52819 -        */
52820 -       cur = 0;
52821 -       for (i=0; i<3; i++) {
52822 -               struct resource *res = &other->mem_resources[i];
52823 -               if (res->flags != IORESOURCE_MEM)
52824 -                       continue;
52825 -               /* We don't care about "fine" resources */
52826 -               if (res->start >= 0xf0000000)
52827 -                       continue;
52828 -               /* Check if it's just a matter of "shrinking" us in one
52829 -                * direction
52830 -                */
52831 -               if (hose->mem_resources[cur].start == res->start) {
52832 -                       DBG("U3/HT: shrink start of %d, %08lx -> %08lx\n",
52833 -                           cur, hose->mem_resources[cur].start,
52834 -                           res->end + 1);
52835 -                       hose->mem_resources[cur].start = res->end + 1;
52836 -                       continue;
52837 -               }
52838 -               if (hose->mem_resources[cur].end == res->end) {
52839 -                       DBG("U3/HT: shrink end of %d, %08lx -> %08lx\n",
52840 -                           cur, hose->mem_resources[cur].end,
52841 -                           res->start - 1);
52842 -                       hose->mem_resources[cur].end = res->start - 1;
52843 -                       continue;
52844 -               }
52845 -               /* No, it's not the case, we need a hole */
52846 -               if (cur == 2) {
52847 -                       /* not enough resources for a hole, we drop part
52848 -                        * of the range
52849 -                        */
52850 -                       printk(KERN_WARNING "Running out of resources"
52851 -                              " for /ht host !\n");
52852 -                       hose->mem_resources[cur].end = res->start - 1;
52853 -                       continue;
52854 -               }
52855 -               cur++;
52856 -               DBG("U3/HT: hole, %d end at %08lx, %d start at %08lx\n",
52857 -                   cur-1, res->start - 1, cur, res->end + 1);
52858 -               hose->mem_resources[cur].name = np->full_name;
52859 -               hose->mem_resources[cur].flags = IORESOURCE_MEM;
52860 -               hose->mem_resources[cur].start = res->end + 1;
52861 -               hose->mem_resources[cur].end = hose->mem_resources[cur-1].end;
52862 -               hose->mem_resources[cur-1].end = res->start - 1;
52863 -       }
52864 +       DBG("PCI: Apple HT bridge decode register: 0x%08x\n", decode);
52865 +
52866 +       /* NOTE: The decode register setup is a bit weird... region
52867 +        * 0xf8000000 for example is marked as enabled in there while it's
52868 +        & actually the memory controller registers.
52869 +        * That means that we are incorrectly attributing it to HT.
52870 +        *
52871 +        * In a similar vein, region 0xf4000000 is actually the HT IO space but
52872 +        * also marked as enabled in here and 0xf9000000 is used by some other
52873 +        * internal bits of the northbridge.
52874 +        *
52875 +        * Unfortunately, we can't just mask out those bit as we would end
52876 +        * up with more regions than we can cope (linux can only cope with
52877 +        * 3 memory regions for a PHB at this stage).
52878 +        *
52879 +        * So for now, we just do a little hack. We happen to -know- that
52880 +        * Apple firmware doesn't assign things below 0xfa000000 for that
52881 +        * bridge anyway so we mask out all bits we don't want.
52882 +        */
52883 +       decode &= 0x003fffff;
52884 +
52885 +       /* Now parse the resulting bits and build resources */
52886 +       parse_region_decode(hose, decode);
52887  }
52888  #endif /* CONFIG_PPC64 */
52889  
52890 @@ -994,6 +996,8 @@
52891         struct device_node *np, *root;
52892         struct device_node *ht = NULL;
52893  
52894 +       ppc_pci_flags = PPC_PCI_CAN_SKIP_ISA_ALIGN;
52895 +
52896         root = of_find_node_by_path("/");
52897         if (root == NULL) {
52898                 printk(KERN_CRIT "pmac_pci_init: can't find root "
52899 @@ -1032,15 +1036,15 @@
52900          * future though
52901          */
52902         if (u3_agp) {
52903 -               struct device_node *np = u3_agp->arch_data;
52904 +               struct device_node *np = u3_agp->dn;
52905                 PCI_DN(np)->busno = 0xf0;
52906                 for (np = np->child; np; np = np->sibling)
52907                         PCI_DN(np)->busno = 0xf0;
52908         }
52909         /* pmac_check_ht_link(); */
52910  
52911 -       /* Tell pci.c to not use the common resource allocation mechanism */
52912 -       pci_probe_only = 1;
52913 +       /* We can allocate missing resources if any */
52914 +       pci_probe_only = 0;
52915  
52916  #else /* CONFIG_PPC64 */
52917         init_p2pbridge();
52918 @@ -1051,13 +1055,13 @@
52919          * some offset between bus number and domains for now when we
52920          * assign all busses should help for now
52921          */
52922 -       if (pci_assign_all_buses)
52923 +       if (ppc_pci_flags & PPC_PCI_REASSIGN_ALL_BUS)
52924                 pcibios_assign_bus_offset = 0x10;
52925  #endif
52926  }
52927  
52928 -int
52929 -pmac_pci_enable_device_hook(struct pci_dev *dev, int initial)
52930 +#ifdef CONFIG_PPC32
52931 +int pmac_pci_enable_device_hook(struct pci_dev *dev)
52932  {
52933         struct device_node* node;
52934         int updatecfg = 0;
52935 @@ -1099,24 +1103,21 @@
52936                 updatecfg = 1;
52937         }
52938  
52939 +       /*
52940 +        * Fixup various header fields on 32 bits. We don't do that on
52941 +        * 64 bits as some of these have strange values behind the HT
52942 +        * bridge and we must not, for example, enable MWI or set the
52943 +        * cache line size on them.
52944 +        */
52945         if (updatecfg) {
52946                 u16 cmd;
52947  
52948 -               /*
52949 -                * Make sure PCI is correctly configured
52950 -                *
52951 -                * We use old pci_bios versions of the function since, by
52952 -                * default, gmac is not powered up, and so will be absent
52953 -                * from the kernel initial PCI lookup.
52954 -                *
52955 -                * Should be replaced by 2.4 new PCI mechanisms and really
52956 -                * register the device.
52957 -                */
52958                 pci_read_config_word(dev, PCI_COMMAND, &cmd);
52959                 cmd |= PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER
52960                         | PCI_COMMAND_INVALIDATE;
52961                 pci_write_config_word(dev, PCI_COMMAND, cmd);
52962                 pci_write_config_byte(dev, PCI_LATENCY_TIMER, 16);
52963 +
52964                 pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE,
52965                                       L1_CACHE_BYTES >> 2);
52966         }
52967 @@ -1124,6 +1125,18 @@
52968         return 0;
52969  }
52970  
52971 +void __devinit pmac_pci_fixup_ohci(struct pci_dev *dev)
52972 +{
52973 +       struct device_node *node = pci_device_to_OF_node(dev);
52974 +
52975 +       /* We don't want to assign resources to USB controllers
52976 +        * absent from the OF tree (iBook second controller)
52977 +        */
52978 +       if (dev->class == PCI_CLASS_SERIAL_USB_OHCI && !node)
52979 +               dev->resource[0].flags = 0;
52980 +}
52981 +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_APPLE, PCI_ANY_ID, pmac_pci_fixup_ohci);
52982 +
52983  /* We power down some devices after they have been probed. They'll
52984   * be powered back on later on
52985   */
52986 @@ -1171,7 +1184,6 @@
52987         of_node_put(nd);
52988  }
52989  
52990 -#ifdef CONFIG_PPC32
52991  void pmac_pci_fixup_cardbus(struct pci_dev* dev)
52992  {
52993         if (!machine_is(powermac))
52994 @@ -1259,7 +1271,7 @@
52995         }
52996  }
52997  DECLARE_PCI_FIXUP_EARLY(PCI_ANY_ID, PCI_ANY_ID, pmac_pci_fixup_pciata);
52998 -#endif
52999 +#endif /* CONFIG_PPC32 */
53000  
53001  /*
53002   * Disable second function on K2-SATA, it's broken
53003 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/powermac/pfunc_base.c powerpc.git/arch/powerpc/platforms/powermac/pfunc_base.c
53004 --- linux-2.6.24/arch/powerpc/platforms/powermac/pfunc_base.c   2008-01-24 23:58:37.000000000 +0100
53005 +++ powerpc.git/arch/powerpc/platforms/powermac/pfunc_base.c    2008-01-28 20:25:49.000000000 +0100
53006 @@ -363,8 +363,7 @@
53007  
53008         return 0;
53009  }
53010 -
53011 -arch_initcall(pmac_pfunc_base_install);
53012 +machine_arch_initcall(powermac, pmac_pfunc_base_install);
53013  
53014  #ifdef CONFIG_PM
53015  
53016 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/powermac/pic.c powerpc.git/arch/powerpc/platforms/powermac/pic.c
53017 --- linux-2.6.24/arch/powerpc/platforms/powermac/pic.c  2008-01-24 23:58:37.000000000 +0100
53018 +++ powerpc.git/arch/powerpc/platforms/powermac/pic.c   2008-01-28 20:25:49.000000000 +0100
53019 @@ -690,6 +690,5 @@
53020         sysdev_driver_register(&pmacpic_sysclass, &driver_pmacpic);
53021         return 0;
53022  }
53023 -
53024 -subsys_initcall(init_pmacpic_sysfs);
53025 +machine_subsys_initcall(powermac, init_pmacpic_sysfs);
53026  
53027 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/powermac/pmac.h powerpc.git/arch/powerpc/platforms/powermac/pmac.h
53028 --- linux-2.6.24/arch/powerpc/platforms/powermac/pmac.h 2008-01-24 23:58:37.000000000 +0100
53029 +++ powerpc.git/arch/powerpc/platforms/powermac/pmac.h  2008-01-28 20:25:49.000000000 +0100
53030 @@ -26,7 +26,7 @@
53031  extern void pmac_nvram_update(void);
53032  extern unsigned char pmac_nvram_read_byte(int addr);
53033  extern void pmac_nvram_write_byte(int addr, unsigned char val);
53034 -extern int pmac_pci_enable_device_hook(struct pci_dev *dev, int initial);
53035 +extern int pmac_pci_enable_device_hook(struct pci_dev *dev);
53036  extern void pmac_pcibios_after_init(void);
53037  extern int of_show_percpuinfo(struct seq_file *m, int i);
53038  
53039 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/powermac/setup.c powerpc.git/arch/powerpc/platforms/powermac/setup.c
53040 --- linux-2.6.24/arch/powerpc/platforms/powermac/setup.c        2008-01-24 23:58:37.000000000 +0100
53041 +++ powerpc.git/arch/powerpc/platforms/powermac/setup.c 2008-01-28 20:25:49.000000000 +0100
53042 @@ -51,6 +51,8 @@
53043  #include <linux/root_dev.h>
53044  #include <linux/bitops.h>
53045  #include <linux/suspend.h>
53046 +#include <linux/of_device.h>
53047 +#include <linux/of_platform.h>
53048  
53049  #include <asm/reg.h>
53050  #include <asm/sections.h>
53051 @@ -68,8 +70,6 @@
53052  #include <asm/btext.h>
53053  #include <asm/pmac_feature.h>
53054  #include <asm/time.h>
53055 -#include <asm/of_device.h>
53056 -#include <asm/of_platform.h>
53057  #include <asm/mmu_context.h>
53058  #include <asm/iommu.h>
53059  #include <asm/smu.h>
53060 @@ -94,7 +94,6 @@
53061  #define DEFAULT_ROOT_DEVICE Root_SDA1  /* sda1 - slightly silly choice */
53062  
53063  #ifdef CONFIG_PPC64
53064 -#include <asm/udbg.h>
53065  int sccdbg;
53066  #endif
53067  
53068 @@ -398,17 +397,13 @@
53069  
53070  static int pmac_late_init(void)
53071  {
53072 -       if (!machine_is(powermac))
53073 -               return -ENODEV;
53074 -
53075         initializing = 0;
53076         /* this is udbg (which is __init) and we can later use it during
53077          * cpu hotplug (in smp_core99_kick_cpu) */
53078         ppc_md.progress = NULL;
53079         return 0;
53080  }
53081 -
53082 -late_initcall(pmac_late_init);
53083 +machine_late_initcall(powermac, pmac_late_init);
53084  
53085  /*
53086   * This is __init_refok because we check for "initializing" before
53087 @@ -535,9 +530,6 @@
53088         if (machine_is(chrp))
53089                 return -1;
53090  
53091 -       if (!machine_is(powermac))
53092 -               return 0;
53093 -
53094         np = of_find_node_by_name(NULL, "valkyrie");
53095         if (np)
53096                 of_platform_device_create(np, "valkyrie", NULL);
53097 @@ -552,8 +544,7 @@
53098  
53099         return 0;
53100  }
53101 -
53102 -device_initcall(pmac_declare_of_platform_devices);
53103 +machine_device_initcall(powermac, pmac_declare_of_platform_devices);
53104  
53105  /*
53106   * Called very early, MMU is off, device-tree isn't unflattened
53107 @@ -613,9 +604,11 @@
53108  
53109         /* We need to use normal PCI probing for the AGP bus,
53110          * since the device for the AGP bridge isn't in the tree.
53111 +        * Same for the PCIe host on U4 and the HT host bridge.
53112          */
53113         if (bus->self == NULL && (of_device_is_compatible(node, "u3-agp") ||
53114 -                                 of_device_is_compatible(node, "u4-pcie")))
53115 +                                 of_device_is_compatible(node, "u4-pcie") ||
53116 +                                 of_device_is_compatible(node, "u3-ht")))
53117                 return PCI_PROBE_NORMAL;
53118         return PCI_PROBE_DEVTREE;
53119  }
53120 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/powermac/time.c powerpc.git/arch/powerpc/platforms/powermac/time.c
53121 --- linux-2.6.24/arch/powerpc/platforms/powermac/time.c 2008-01-24 23:58:37.000000000 +0100
53122 +++ powerpc.git/arch/powerpc/platforms/powermac/time.c  2008-01-28 20:25:49.000000000 +0100
53123 @@ -84,12 +84,14 @@
53124         return delta;
53125  }
53126  
53127 +#if defined(CONFIG_ADB_CUDA) || defined(CONFIG_ADB_PMU)
53128  static void to_rtc_time(unsigned long now, struct rtc_time *tm)
53129  {
53130         to_tm(now, tm);
53131         tm->tm_year -= 1900;
53132         tm->tm_mon -= 1;
53133  }
53134 +#endif
53135  
53136  static unsigned long from_rtc_time(struct rtc_time *tm)
53137  {
53138 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/ps3/Kconfig powerpc.git/arch/powerpc/platforms/ps3/Kconfig
53139 --- linux-2.6.24/arch/powerpc/platforms/ps3/Kconfig     2008-01-24 23:58:37.000000000 +0100
53140 +++ powerpc.git/arch/powerpc/platforms/ps3/Kconfig      2008-01-28 20:25:49.000000000 +0100
53141 @@ -61,17 +61,6 @@
53142           This support is mainly for Linux kernel development.  If unsure,
53143           say N.
53144  
53145 -config PS3_USE_LPAR_ADDR
53146 -       depends on PPC_PS3 && EXPERIMENTAL
53147 -       bool "PS3 use lpar address space"
53148 -       default y
53149 -       help
53150 -         This option is solely for experimentation by experts.  Disables
53151 -         translation of lpar addresses.  SPE support currently won't work
53152 -         without this set to y.
53153 -
53154 -         If you have any doubt, choose the default y.
53155 -
53156  config PS3_VUART
53157         depends on PPC_PS3
53158         tristate
53159 @@ -138,4 +127,17 @@
53160           be disabled on the kernel command line using "ps3flash=off", to
53161           not allocate this fixed buffer.
53162  
53163 +config PS3_LPM
53164 +       tristate "PS3 Logical Performance Monitor support"
53165 +       depends on PPC_PS3
53166 +       help
53167 +         Include support for the PS3 Logical Performance Monitor.
53168 +
53169 +         This support is required to use the logical performance monitor
53170 +         of the PS3's LV1 hypervisor.
53171 +
53172 +         If you intend to use the advanced performance monitoring and
53173 +         profiling support of the Cell processor with programs like
53174 +         oprofile and perfmon2, then say Y or M, otherwise say N.
53175 +
53176  endmenu
53177 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/ps3/device-init.c powerpc.git/arch/powerpc/platforms/ps3/device-init.c
53178 --- linux-2.6.24/arch/powerpc/platforms/ps3/device-init.c       2008-01-24 23:58:37.000000000 +0100
53179 +++ powerpc.git/arch/powerpc/platforms/ps3/device-init.c        2008-01-28 20:25:49.000000000 +0100
53180 @@ -23,6 +23,7 @@
53181  #include <linux/kernel.h>
53182  #include <linux/kthread.h>
53183  #include <linux/init.h>
53184 +#include <linux/reboot.h>
53185  
53186  #include <asm/firmware.h>
53187  #include <asm/lv1call.h>
53188 @@ -30,6 +31,89 @@
53189  
53190  #include "platform.h"
53191  
53192 +static int __init ps3_register_lpm_devices(void)
53193 +{
53194 +       int result;
53195 +       u64 tmp1;
53196 +       u64 tmp2;
53197 +       struct ps3_system_bus_device *dev;
53198 +
53199 +       pr_debug(" -> %s:%d\n", __func__, __LINE__);
53200 +
53201 +       dev = kzalloc(sizeof(*dev), GFP_KERNEL);
53202 +       if (!dev)
53203 +               return -ENOMEM;
53204 +
53205 +       dev->match_id = PS3_MATCH_ID_LPM;
53206 +       dev->dev_type = PS3_DEVICE_TYPE_LPM;
53207 +
53208 +       /* The current lpm driver only supports a single BE processor. */
53209 +
53210 +       result = ps3_repository_read_be_node_id(0, &dev->lpm.node_id);
53211 +
53212 +       if (result) {
53213 +               pr_debug("%s:%d: ps3_repository_read_be_node_id failed \n",
53214 +                       __func__, __LINE__);
53215 +               goto fail_read_repo;
53216 +       }
53217 +
53218 +       result = ps3_repository_read_lpm_privileges(dev->lpm.node_id, &tmp1,
53219 +               &dev->lpm.rights);
53220 +
53221 +       if (result) {
53222 +               pr_debug("%s:%d: ps3_repository_read_lpm_privleges failed \n",
53223 +                       __func__, __LINE__);
53224 +               goto fail_read_repo;
53225 +       }
53226 +
53227 +       lv1_get_logical_partition_id(&tmp2);
53228 +
53229 +       if (tmp1 != tmp2) {
53230 +               pr_debug("%s:%d: wrong lpar\n",
53231 +                       __func__, __LINE__);
53232 +               result = -ENODEV;
53233 +               goto fail_rights;
53234 +       }
53235 +
53236 +       if (!(dev->lpm.rights & PS3_LPM_RIGHTS_USE_LPM)) {
53237 +               pr_debug("%s:%d: don't have rights to use lpm\n",
53238 +                       __func__, __LINE__);
53239 +               result = -EPERM;
53240 +               goto fail_rights;
53241 +       }
53242 +
53243 +       pr_debug("%s:%d: pu_id %lu, rights %lu(%lxh)\n",
53244 +               __func__, __LINE__, dev->lpm.pu_id, dev->lpm.rights,
53245 +               dev->lpm.rights);
53246 +
53247 +       result = ps3_repository_read_pu_id(0, &dev->lpm.pu_id);
53248 +
53249 +       if (result) {
53250 +               pr_debug("%s:%d: ps3_repository_read_pu_id failed \n",
53251 +                       __func__, __LINE__);
53252 +               goto fail_read_repo;
53253 +       }
53254 +
53255 +       result = ps3_system_bus_device_register(dev);
53256 +
53257 +       if (result) {
53258 +               pr_debug("%s:%d ps3_system_bus_device_register failed\n",
53259 +                       __func__, __LINE__);
53260 +               goto fail_register;
53261 +       }
53262 +
53263 +       pr_debug(" <- %s:%d\n", __func__, __LINE__);
53264 +       return 0;
53265 +
53266 +
53267 +fail_register:
53268 +fail_rights:
53269 +fail_read_repo:
53270 +       kfree(dev);
53271 +       pr_debug(" <- %s:%d: failed\n", __func__, __LINE__);
53272 +       return result;
53273 +}
53274 +
53275  /**
53276   * ps3_setup_gelic_device - Setup and register a gelic device instance.
53277   *
53278 @@ -238,166 +322,6 @@
53279         return result;
53280  }
53281  
53282 -static int ps3stor_wait_for_completion(u64 dev_id, u64 tag,
53283 -                                      unsigned int timeout)
53284 -{
53285 -       int result = -1;
53286 -       unsigned int retries = 0;
53287 -       u64 status;
53288 -
53289 -       for (retries = 0; retries < timeout; retries++) {
53290 -               result = lv1_storage_check_async_status(dev_id, tag, &status);
53291 -               if (!result)
53292 -                       break;
53293 -
53294 -               msleep(1);
53295 -       }
53296 -
53297 -       if (result)
53298 -               pr_debug("%s:%u: check_async_status: %s, status %lx\n",
53299 -                        __func__, __LINE__, ps3_result(result), status);
53300 -
53301 -       return result;
53302 -}
53303 -
53304 -/**
53305 - * ps3_storage_wait_for_device - Wait for a storage device to become ready.
53306 - * @repo: The repository device to wait for.
53307 - *
53308 - * Uses the hypervisor's storage device notification mechanism to wait until
53309 - * a storage device is ready.  The device notification mechanism uses a
53310 - * psuedo device (id = -1) to asynchronously notify the guest when storage
53311 - * devices become ready.  The notification device has a block size of 512
53312 - * bytes.
53313 - */
53314 -
53315 -static int ps3_storage_wait_for_device(const struct ps3_repository_device *repo)
53316 -{
53317 -       int error = -ENODEV;
53318 -       int result;
53319 -       const u64 notification_dev_id = (u64)-1LL;
53320 -       const unsigned int timeout = HZ;
53321 -       u64 lpar;
53322 -       u64 tag;
53323 -       void *buf;
53324 -       enum ps3_notify_type {
53325 -               notify_device_ready = 0,
53326 -               notify_region_probe = 1,
53327 -               notify_region_update = 2,
53328 -       };
53329 -       struct {
53330 -               u64 operation_code;     /* must be zero */
53331 -               u64 event_mask;         /* OR of 1UL << enum ps3_notify_type */
53332 -       } *notify_cmd;
53333 -       struct {
53334 -               u64 event_type;         /* enum ps3_notify_type */
53335 -               u64 bus_id;
53336 -               u64 dev_id;
53337 -               u64 dev_type;
53338 -               u64 dev_port;
53339 -       } *notify_event;
53340 -
53341 -       pr_debug(" -> %s:%u: (%u:%u:%u)\n", __func__, __LINE__, repo->bus_id,
53342 -                repo->dev_id, repo->dev_type);
53343 -
53344 -       buf = kzalloc(512, GFP_KERNEL);
53345 -       if (!buf)
53346 -               return -ENOMEM;
53347 -
53348 -       lpar = ps3_mm_phys_to_lpar(__pa(buf));
53349 -       notify_cmd = buf;
53350 -       notify_event = buf;
53351 -
53352 -       result = lv1_open_device(repo->bus_id, notification_dev_id, 0);
53353 -       if (result) {
53354 -               printk(KERN_ERR "%s:%u: lv1_open_device %s\n", __func__,
53355 -                      __LINE__, ps3_result(result));
53356 -               goto fail_free;
53357 -       }
53358 -
53359 -       /* Setup and write the request for device notification. */
53360 -
53361 -       notify_cmd->operation_code = 0; /* must be zero */
53362 -       notify_cmd->event_mask = 1UL << notify_region_probe;
53363 -
53364 -       result = lv1_storage_write(notification_dev_id, 0, 0, 1, 0, lpar,
53365 -                                  &tag);
53366 -       if (result) {
53367 -               printk(KERN_ERR "%s:%u: write failed %s\n", __func__, __LINE__,
53368 -                      ps3_result(result));
53369 -               goto fail_close;
53370 -       }
53371 -
53372 -       /* Wait for the write completion */
53373 -
53374 -       result = ps3stor_wait_for_completion(notification_dev_id, tag,
53375 -                                            timeout);
53376 -       if (result) {
53377 -               printk(KERN_ERR "%s:%u: write not completed %s\n", __func__,
53378 -                      __LINE__, ps3_result(result));
53379 -               goto fail_close;
53380 -       }
53381 -
53382 -       /* Loop here processing the requested notification events. */
53383 -
53384 -       while (1) {
53385 -               memset(notify_event, 0, sizeof(*notify_event));
53386 -
53387 -               result = lv1_storage_read(notification_dev_id, 0, 0, 1, 0,
53388 -                                         lpar, &tag);
53389 -               if (result) {
53390 -                       printk(KERN_ERR "%s:%u: write failed %s\n", __func__,
53391 -                              __LINE__, ps3_result(result));
53392 -                       break;
53393 -               }
53394 -
53395 -               result = ps3stor_wait_for_completion(notification_dev_id, tag,
53396 -                                                    timeout);
53397 -               if (result) {
53398 -                       printk(KERN_ERR "%s:%u: read not completed %s\n",
53399 -                              __func__, __LINE__, ps3_result(result));
53400 -                       break;
53401 -               }
53402 -
53403 -               pr_debug("%s:%d: notify event (%u:%u:%u): event_type 0x%lx, "
53404 -                        "port %lu\n", __func__, __LINE__, repo->bus_index,
53405 -                        repo->dev_index, repo->dev_type,
53406 -                        notify_event->event_type, notify_event->dev_port);
53407 -
53408 -               if (notify_event->event_type != notify_region_probe ||
53409 -                   notify_event->bus_id != repo->bus_id) {
53410 -                       pr_debug("%s:%u: bad notify_event: event %lu, "
53411 -                                "dev_id %lu, dev_type %lu\n",
53412 -                                __func__, __LINE__, notify_event->event_type,
53413 -                                notify_event->dev_id, notify_event->dev_type);
53414 -                       break;
53415 -               }
53416 -
53417 -               if (notify_event->dev_id == repo->dev_id &&
53418 -                   notify_event->dev_type == repo->dev_type) {
53419 -                       pr_debug("%s:%u: device ready (%u:%u:%u)\n", __func__,
53420 -                                __LINE__, repo->bus_index, repo->dev_index,
53421 -                                repo->dev_type);
53422 -                       error = 0;
53423 -                       break;
53424 -               }
53425 -
53426 -               if (notify_event->dev_id == repo->dev_id &&
53427 -                   notify_event->dev_type == PS3_DEV_TYPE_NOACCESS) {
53428 -                       pr_debug("%s:%u: no access: dev_id %u\n", __func__,
53429 -                                __LINE__, repo->dev_id);
53430 -                       break;
53431 -               }
53432 -       }
53433 -
53434 -fail_close:
53435 -       lv1_close_device(repo->bus_id, notification_dev_id);
53436 -fail_free:
53437 -       kfree(buf);
53438 -       pr_debug(" <- %s:%u\n", __func__, __LINE__);
53439 -       return error;
53440 -}
53441 -
53442  static int ps3_setup_storage_dev(const struct ps3_repository_device *repo,
53443                                  enum ps3_match_id match_id)
53444  {
53445 @@ -449,16 +373,6 @@
53446                 goto fail_find_interrupt;
53447         }
53448  
53449 -       /* FIXME: Arrange to only do this on a 'cold' boot */
53450 -
53451 -       result = ps3_storage_wait_for_device(repo);
53452 -       if (result) {
53453 -               printk(KERN_ERR "%s:%u: storage_notification failed %d\n",
53454 -                      __func__, __LINE__, result);
53455 -               result = -ENODEV;
53456 -               goto fail_probe_notification;
53457 -       }
53458 -
53459         for (i = 0; i < num_regions; i++) {
53460                 unsigned int id;
53461                 u64 start, size;
53462 @@ -494,7 +408,6 @@
53463  
53464  fail_device_register:
53465  fail_read_region:
53466 -fail_probe_notification:
53467  fail_find_interrupt:
53468         kfree(p);
53469  fail_malloc:
53470 @@ -659,62 +572,268 @@
53471         return result;
53472  }
53473  
53474 +static void ps3_find_and_add_device(u64 bus_id, u64 dev_id)
53475 +{
53476 +       struct ps3_repository_device repo;
53477 +       int res;
53478 +       unsigned int retries;
53479 +       unsigned long rem;
53480 +
53481 +       /*
53482 +        * On some firmware versions (e.g. 1.90), the device may not show up
53483 +        * in the repository immediately
53484 +        */
53485 +       for (retries = 0; retries < 10; retries++) {
53486 +               res = ps3_repository_find_device_by_id(&repo, bus_id, dev_id);
53487 +               if (!res)
53488 +                       goto found;
53489 +
53490 +               rem = msleep_interruptible(100);
53491 +               if (rem)
53492 +                       break;
53493 +       }
53494 +       pr_warning("%s:%u: device %lu:%lu not found\n", __func__, __LINE__,
53495 +                  bus_id, dev_id);
53496 +       return;
53497 +
53498 +found:
53499 +       if (retries)
53500 +               pr_debug("%s:%u: device %lu:%lu found after %u retries\n",
53501 +                        __func__, __LINE__, bus_id, dev_id, retries);
53502 +
53503 +       ps3_register_repository_device(&repo);
53504 +       return;
53505 +}
53506 +
53507 +#define PS3_NOTIFICATION_DEV_ID                ULONG_MAX
53508 +#define PS3_NOTIFICATION_INTERRUPT_ID  0
53509 +
53510 +struct ps3_notification_device {
53511 +       struct ps3_system_bus_device sbd;
53512 +       spinlock_t lock;
53513 +       u64 tag;
53514 +       u64 lv1_status;
53515 +       struct completion done;
53516 +};
53517 +
53518 +enum ps3_notify_type {
53519 +       notify_device_ready = 0,
53520 +       notify_region_probe = 1,
53521 +       notify_region_update = 2,
53522 +};
53523 +
53524 +struct ps3_notify_cmd {
53525 +       u64 operation_code;             /* must be zero */
53526 +       u64 event_mask;                 /* OR of 1UL << enum ps3_notify_type */
53527 +};
53528 +
53529 +struct ps3_notify_event {
53530 +       u64 event_type;                 /* enum ps3_notify_type */
53531 +       u64 bus_id;
53532 +       u64 dev_id;
53533 +       u64 dev_type;
53534 +       u64 dev_port;
53535 +};
53536 +
53537 +static irqreturn_t ps3_notification_interrupt(int irq, void *data)
53538 +{
53539 +       struct ps3_notification_device *dev = data;
53540 +       int res;
53541 +       u64 tag, status;
53542 +
53543 +       spin_lock(&dev->lock);
53544 +       res = lv1_storage_get_async_status(PS3_NOTIFICATION_DEV_ID, &tag,
53545 +                                          &status);
53546 +       if (tag != dev->tag)
53547 +               pr_err("%s:%u: tag mismatch, got %lx, expected %lx\n",
53548 +                      __func__, __LINE__, tag, dev->tag);
53549 +
53550 +       if (res) {
53551 +               pr_err("%s:%u: res %d status 0x%lx\n", __func__, __LINE__, res,
53552 +                      status);
53553 +       } else {
53554 +               pr_debug("%s:%u: completed, status 0x%lx\n", __func__,
53555 +                        __LINE__, status);
53556 +               dev->lv1_status = status;
53557 +               complete(&dev->done);
53558 +       }
53559 +       spin_unlock(&dev->lock);
53560 +       return IRQ_HANDLED;
53561 +}
53562 +
53563 +static int ps3_notification_read_write(struct ps3_notification_device *dev,
53564 +                                      u64 lpar, int write)
53565 +{
53566 +       const char *op = write ? "write" : "read";
53567 +       unsigned long flags;
53568 +       int res;
53569 +
53570 +       init_completion(&dev->done);
53571 +       spin_lock_irqsave(&dev->lock, flags);
53572 +       res = write ? lv1_storage_write(dev->sbd.dev_id, 0, 0, 1, 0, lpar,
53573 +                                       &dev->tag)
53574 +                   : lv1_storage_read(dev->sbd.dev_id, 0, 0, 1, 0, lpar,
53575 +                                      &dev->tag);
53576 +       spin_unlock_irqrestore(&dev->lock, flags);
53577 +       if (res) {
53578 +               pr_err("%s:%u: %s failed %d\n", __func__, __LINE__, op, res);
53579 +               return -EPERM;
53580 +       }
53581 +       pr_debug("%s:%u: notification %s issued\n", __func__, __LINE__, op);
53582 +
53583 +       res = wait_event_interruptible(dev->done.wait,
53584 +                                      dev->done.done || kthread_should_stop());
53585 +       if (kthread_should_stop())
53586 +               res = -EINTR;
53587 +       if (res) {
53588 +               pr_debug("%s:%u: interrupted %s\n", __func__, __LINE__, op);
53589 +               return res;
53590 +       }
53591 +
53592 +       if (dev->lv1_status) {
53593 +               pr_err("%s:%u: %s not completed, status 0x%lx\n", __func__,
53594 +                      __LINE__, op, dev->lv1_status);
53595 +               return -EIO;
53596 +       }
53597 +       pr_debug("%s:%u: notification %s completed\n", __func__, __LINE__, op);
53598 +
53599 +       return 0;
53600 +}
53601 +
53602 +static struct task_struct *probe_task;
53603 +
53604  /**
53605   * ps3_probe_thread - Background repository probing at system startup.
53606   *
53607   * This implementation only supports background probing on a single bus.
53608 + * It uses the hypervisor's storage device notification mechanism to wait until
53609 + * a storage device is ready.  The device notification mechanism uses a
53610 + * pseudo device to asynchronously notify the guest when storage devices become
53611 + * ready.  The notification device has a block size of 512 bytes.
53612   */
53613  
53614  static int ps3_probe_thread(void *data)
53615  {
53616 -       struct ps3_repository_device *repo = data;
53617 -       int result;
53618 -       unsigned int ms = 250;
53619 +       struct ps3_notification_device dev;
53620 +       int res;
53621 +       unsigned int irq;
53622 +       u64 lpar;
53623 +       void *buf;
53624 +       struct ps3_notify_cmd *notify_cmd;
53625 +       struct ps3_notify_event *notify_event;
53626  
53627         pr_debug(" -> %s:%u: kthread started\n", __func__, __LINE__);
53628  
53629 -       do {
53630 -               try_to_freeze();
53631 +       buf = kzalloc(512, GFP_KERNEL);
53632 +       if (!buf)
53633 +               return -ENOMEM;
53634  
53635 -               pr_debug("%s:%u: probing...\n", __func__, __LINE__);
53636 +       lpar = ps3_mm_phys_to_lpar(__pa(buf));
53637 +       notify_cmd = buf;
53638 +       notify_event = buf;
53639 +
53640 +       /* dummy system bus device */
53641 +       dev.sbd.bus_id = (u64)data;
53642 +       dev.sbd.dev_id = PS3_NOTIFICATION_DEV_ID;
53643 +       dev.sbd.interrupt_id = PS3_NOTIFICATION_INTERRUPT_ID;
53644 +
53645 +       res = lv1_open_device(dev.sbd.bus_id, dev.sbd.dev_id, 0);
53646 +       if (res) {
53647 +               pr_err("%s:%u: lv1_open_device failed %s\n", __func__,
53648 +                      __LINE__, ps3_result(res));
53649 +               goto fail_free;
53650 +       }
53651 +
53652 +       res = ps3_sb_event_receive_port_setup(&dev.sbd, PS3_BINDING_CPU_ANY,
53653 +                                             &irq);
53654 +       if (res) {
53655 +               pr_err("%s:%u: ps3_sb_event_receive_port_setup failed %d\n",
53656 +                      __func__, __LINE__, res);
53657 +              goto fail_close_device;
53658 +       }
53659 +
53660 +       spin_lock_init(&dev.lock);
53661 +
53662 +       res = request_irq(irq, ps3_notification_interrupt, IRQF_DISABLED,
53663 +                         "ps3_notification", &dev);
53664 +       if (res) {
53665 +               pr_err("%s:%u: request_irq failed %d\n", __func__, __LINE__,
53666 +                      res);
53667 +               goto fail_sb_event_receive_port_destroy;
53668 +       }
53669 +
53670 +       /* Setup and write the request for device notification. */
53671 +       notify_cmd->operation_code = 0; /* must be zero */
53672 +       notify_cmd->event_mask = 1UL << notify_region_probe;
53673  
53674 -               do {
53675 -                       result = ps3_repository_find_device(repo);
53676 +       res = ps3_notification_read_write(&dev, lpar, 1);
53677 +       if (res)
53678 +               goto fail_free_irq;
53679  
53680 -                       if (result == -ENODEV)
53681 -                               pr_debug("%s:%u: nothing new\n", __func__,
53682 -                                       __LINE__);
53683 -                       else if (result)
53684 -                               pr_debug("%s:%u: find device error.\n",
53685 -                                       __func__, __LINE__);
53686 -                       else {
53687 -                               pr_debug("%s:%u: found device (%u:%u:%u)\n",
53688 -                                        __func__, __LINE__, repo->bus_index,
53689 -                                        repo->dev_index, repo->dev_type);
53690 -                               ps3_register_repository_device(repo);
53691 -                               ps3_repository_bump_device(repo);
53692 -                               ms = 250;
53693 -                       }
53694 -               } while (!result);
53695 +       /* Loop here processing the requested notification events. */
53696 +       do {
53697 +               try_to_freeze();
53698  
53699 -               pr_debug("%s:%u: ms %u\n", __func__, __LINE__, ms);
53700 +               memset(notify_event, 0, sizeof(*notify_event));
53701  
53702 -               if ( ms > 60000)
53703 +               res = ps3_notification_read_write(&dev, lpar, 0);
53704 +               if (res)
53705                         break;
53706  
53707 -               msleep_interruptible(ms);
53708 +               pr_debug("%s:%u: notify event type 0x%lx bus id %lu dev id %lu"
53709 +                        " type %lu port %lu\n", __func__, __LINE__,
53710 +                        notify_event->event_type, notify_event->bus_id,
53711 +                        notify_event->dev_id, notify_event->dev_type,
53712 +                        notify_event->dev_port);
53713 +
53714 +               if (notify_event->event_type != notify_region_probe ||
53715 +                   notify_event->bus_id != dev.sbd.bus_id) {
53716 +                       pr_warning("%s:%u: bad notify_event: event %lu, "
53717 +                                  "dev_id %lu, dev_type %lu\n",
53718 +                                  __func__, __LINE__, notify_event->event_type,
53719 +                                  notify_event->dev_id,
53720 +                                  notify_event->dev_type);
53721 +                       continue;
53722 +               }
53723  
53724 -               /* An exponential backoff. */
53725 -               ms <<= 1;
53726 +               ps3_find_and_add_device(dev.sbd.bus_id, notify_event->dev_id);
53727  
53728         } while (!kthread_should_stop());
53729  
53730 +fail_free_irq:
53731 +       free_irq(irq, &dev);
53732 +fail_sb_event_receive_port_destroy:
53733 +       ps3_sb_event_receive_port_destroy(&dev.sbd, irq);
53734 +fail_close_device:
53735 +       lv1_close_device(dev.sbd.bus_id, dev.sbd.dev_id);
53736 +fail_free:
53737 +       kfree(buf);
53738 +
53739 +       probe_task = NULL;
53740 +
53741         pr_debug(" <- %s:%u: kthread finished\n", __func__, __LINE__);
53742  
53743         return 0;
53744  }
53745  
53746  /**
53747 + * ps3_stop_probe_thread - Stops the background probe thread.
53748 + *
53749 + */
53750 +
53751 +static int ps3_stop_probe_thread(struct notifier_block *nb, unsigned long code,
53752 +                                void *data)
53753 +{
53754 +       if (probe_task)
53755 +               kthread_stop(probe_task);
53756 +       return 0;
53757 +}
53758 +
53759 +static struct notifier_block nb = {
53760 +       .notifier_call = ps3_stop_probe_thread
53761 +};
53762 +
53763 +/**
53764   * ps3_start_probe_thread - Starts the background probe thread.
53765   *
53766   */
53767 @@ -723,7 +842,7 @@
53768  {
53769         int result;
53770         struct task_struct *task;
53771 -       static struct ps3_repository_device repo; /* must be static */
53772 +       struct ps3_repository_device repo;
53773  
53774         pr_debug(" -> %s:%d\n", __func__, __LINE__);
53775  
53776 @@ -746,7 +865,8 @@
53777                 return -ENODEV;
53778         }
53779  
53780 -       task = kthread_run(ps3_probe_thread, &repo, "ps3-probe-%u", bus_type);
53781 +       task = kthread_run(ps3_probe_thread, (void *)repo.bus_id,
53782 +                          "ps3-probe-%u", bus_type);
53783  
53784         if (IS_ERR(task)) {
53785                 result = PTR_ERR(task);
53786 @@ -755,6 +875,9 @@
53787                 return result;
53788         }
53789  
53790 +       probe_task = task;
53791 +       register_reboot_notifier(&nb);
53792 +
53793         pr_debug(" <- %s:%d\n", __func__, __LINE__);
53794         return 0;
53795  }
53796 @@ -787,6 +910,8 @@
53797  
53798         ps3_register_sound_devices();
53799  
53800 +       ps3_register_lpm_devices();
53801 +
53802         pr_debug(" <- %s:%d\n", __func__, __LINE__);
53803         return 0;
53804  }
53805 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/ps3/mm.c powerpc.git/arch/powerpc/platforms/ps3/mm.c
53806 --- linux-2.6.24/arch/powerpc/platforms/ps3/mm.c        2008-01-24 23:58:37.000000000 +0100
53807 +++ powerpc.git/arch/powerpc/platforms/ps3/mm.c 2008-01-28 20:25:49.000000000 +0100
53808 @@ -36,11 +36,6 @@
53809  #endif
53810  
53811  enum {
53812 -#if defined(CONFIG_PS3_USE_LPAR_ADDR)
53813 -       USE_LPAR_ADDR = 1,
53814 -#else
53815 -       USE_LPAR_ADDR = 0,
53816 -#endif
53817  #if defined(CONFIG_PS3_DYNAMIC_DMA)
53818         USE_DYNAMIC_DMA = 1,
53819  #else
53820 @@ -137,11 +132,8 @@
53821  unsigned long ps3_mm_phys_to_lpar(unsigned long phys_addr)
53822  {
53823         BUG_ON(is_kernel_addr(phys_addr));
53824 -       if (USE_LPAR_ADDR)
53825 -               return phys_addr;
53826 -       else
53827 -               return (phys_addr < map.rm.size || phys_addr >= map.total)
53828 -                       ? phys_addr : phys_addr + map.r1.offset;
53829 +       return (phys_addr < map.rm.size || phys_addr >= map.total)
53830 +               ? phys_addr : phys_addr + map.r1.offset;
53831  }
53832  
53833  EXPORT_SYMBOL(ps3_mm_phys_to_lpar);
53834 @@ -309,7 +301,7 @@
53835  
53836         BUG_ON(!mem_init_done);
53837  
53838 -       start_addr = USE_LPAR_ADDR ? map.r1.base : map.rm.size;
53839 +       start_addr = map.rm.size;
53840         start_pfn = start_addr >> PAGE_SHIFT;
53841         nr_pages = (map.r1.size + PAGE_SIZE - 1) >> PAGE_SHIFT;
53842  
53843 @@ -359,7 +351,7 @@
53844  static void  __maybe_unused _dma_dump_region(const struct ps3_dma_region *r,
53845         const char *func, int line)
53846  {
53847 -       DBG("%s:%d: dev        %u:%u\n", func, line, r->dev->bus_id,
53848 +       DBG("%s:%d: dev        %lu:%lu\n", func, line, r->dev->bus_id,
53849                 r->dev->dev_id);
53850         DBG("%s:%d: page_size  %u\n", func, line, r->page_size);
53851         DBG("%s:%d: bus_addr   %lxh\n", func, line, r->bus_addr);
53852 @@ -394,7 +386,7 @@
53853  static void _dma_dump_chunk (const struct dma_chunk* c, const char* func,
53854         int line)
53855  {
53856 -       DBG("%s:%d: r.dev        %u:%u\n", func, line,
53857 +       DBG("%s:%d: r.dev        %lu:%lu\n", func, line,
53858                 c->region->dev->bus_id, c->region->dev->dev_id);
53859         DBG("%s:%d: r.bus_addr   %lxh\n", func, line, c->region->bus_addr);
53860         DBG("%s:%d: r.page_size  %u\n", func, line, c->region->page_size);
53861 @@ -658,7 +650,7 @@
53862         BUG_ON(!r);
53863  
53864         if (!r->dev->bus_id) {
53865 -               pr_info("%s:%d: %u:%u no dma\n", __func__, __LINE__,
53866 +               pr_info("%s:%d: %lu:%lu no dma\n", __func__, __LINE__,
53867                         r->dev->bus_id, r->dev->dev_id);
53868                 return 0;
53869         }
53870 @@ -724,7 +716,7 @@
53871         BUG_ON(!r);
53872  
53873         if (!r->dev->bus_id) {
53874 -               pr_info("%s:%d: %u:%u no dma\n", __func__, __LINE__,
53875 +               pr_info("%s:%d: %lu:%lu no dma\n", __func__, __LINE__,
53876                         r->dev->bus_id, r->dev->dev_id);
53877                 return 0;
53878         }
53879 @@ -1007,7 +999,7 @@
53880  
53881         if (r->offset + r->len > map.rm.size) {
53882                 /* Map (part of) 2nd RAM chunk */
53883 -               virt_addr = USE_LPAR_ADDR ? map.r1.base : map.rm.size;
53884 +               virt_addr = map.rm.size;
53885                 len = r->len;
53886                 if (r->offset >= map.rm.size)
53887                         virt_addr += r->offset - map.rm.size;
53888 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/ps3/platform.h powerpc.git/arch/powerpc/platforms/ps3/platform.h
53889 --- linux-2.6.24/arch/powerpc/platforms/ps3/platform.h  2008-01-24 23:58:37.000000000 +0100
53890 +++ powerpc.git/arch/powerpc/platforms/ps3/platform.h   2008-01-28 20:25:49.000000000 +0100
53891 @@ -89,13 +89,11 @@
53892         PS3_DEV_TYPE_STOR_ROM = TYPE_ROM,       /* 5 */
53893         PS3_DEV_TYPE_SB_GPIO = 6,
53894         PS3_DEV_TYPE_STOR_FLASH = TYPE_RBC,     /* 14 */
53895 -       PS3_DEV_TYPE_STOR_DUMMY = 32,
53896 -       PS3_DEV_TYPE_NOACCESS = 255,
53897  };
53898  
53899  int ps3_repository_read_bus_str(unsigned int bus_index, const char *bus_str,
53900         u64 *value);
53901 -int ps3_repository_read_bus_id(unsigned int bus_index, unsigned int *bus_id);
53902 +int ps3_repository_read_bus_id(unsigned int bus_index, u64 *bus_id);
53903  int ps3_repository_read_bus_type(unsigned int bus_index,
53904         enum ps3_bus_type *bus_type);
53905  int ps3_repository_read_bus_num_dev(unsigned int bus_index,
53906 @@ -119,7 +117,7 @@
53907  int ps3_repository_read_dev_str(unsigned int bus_index,
53908         unsigned int dev_index, const char *dev_str, u64 *value);
53909  int ps3_repository_read_dev_id(unsigned int bus_index, unsigned int dev_index,
53910 -       unsigned int *dev_id);
53911 +       u64 *dev_id);
53912  int ps3_repository_read_dev_type(unsigned int bus_index,
53913         unsigned int dev_index, enum ps3_dev_type *dev_type);
53914  int ps3_repository_read_dev_intr(unsigned int bus_index,
53915 @@ -138,21 +136,17 @@
53916  /* repository bus enumerators */
53917  
53918  struct ps3_repository_device {
53919 -       enum ps3_bus_type bus_type;
53920         unsigned int bus_index;
53921 -       unsigned int bus_id;
53922 -       enum ps3_dev_type dev_type;
53923         unsigned int dev_index;
53924 -       unsigned int dev_id;
53925 +       enum ps3_bus_type bus_type;
53926 +       enum ps3_dev_type dev_type;
53927 +       u64 bus_id;
53928 +       u64 dev_id;
53929  };
53930  
53931 -static inline struct ps3_repository_device *ps3_repository_bump_device(
53932 -       struct ps3_repository_device *repo)
53933 -{
53934 -       repo->dev_index++;
53935 -       return repo;
53936 -}
53937  int ps3_repository_find_device(struct ps3_repository_device *repo);
53938 +int ps3_repository_find_device_by_id(struct ps3_repository_device *repo,
53939 +                                    u64 bus_id, u64 dev_id);
53940  int ps3_repository_find_devices(enum ps3_bus_type bus_type,
53941         int (*callback)(const struct ps3_repository_device *repo));
53942  int ps3_repository_find_bus(enum ps3_bus_type bus_type, unsigned int from,
53943 @@ -186,10 +180,10 @@
53944         unsigned int dev_index, unsigned int region_index,
53945         unsigned int *region_id, u64 *region_start, u64 *region_size);
53946  
53947 -/* repository pu and memory info */
53948 +/* repository logical pu and memory info */
53949  
53950 -int ps3_repository_read_num_pu(unsigned int *num_pu);
53951 -int ps3_repository_read_ppe_id(unsigned int *pu_index, unsigned int *ppe_id);
53952 +int ps3_repository_read_num_pu(u64 *num_pu);
53953 +int ps3_repository_read_pu_id(unsigned int pu_index, u64 *pu_id);
53954  int ps3_repository_read_rm_base(unsigned int ppe_id, u64 *rm_base);
53955  int ps3_repository_read_rm_size(unsigned int ppe_id, u64 *rm_size);
53956  int ps3_repository_read_region_total(u64 *region_total);
53957 @@ -200,9 +194,15 @@
53958  
53959  int ps3_repository_read_num_be(unsigned int *num_be);
53960  int ps3_repository_read_be_node_id(unsigned int be_index, u64 *node_id);
53961 +int ps3_repository_read_be_id(u64 node_id, u64 *be_id);
53962  int ps3_repository_read_tb_freq(u64 node_id, u64 *tb_freq);
53963  int ps3_repository_read_be_tb_freq(unsigned int be_index, u64 *tb_freq);
53964  
53965 +/* repository performance monitor info */
53966 +
53967 +int ps3_repository_read_lpm_privileges(unsigned int be_index, u64 *lpar,
53968 +       u64 *rights);
53969 +
53970  /* repository 'Other OS' area */
53971  
53972  int ps3_repository_read_boot_dat_addr(u64 *lpar_addr);
53973 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/ps3/repository.c powerpc.git/arch/powerpc/platforms/ps3/repository.c
53974 --- linux-2.6.24/arch/powerpc/platforms/ps3/repository.c        2008-01-24 23:58:37.000000000 +0100
53975 +++ powerpc.git/arch/powerpc/platforms/ps3/repository.c 2008-01-28 20:25:49.000000000 +0100
53976 @@ -33,7 +33,7 @@
53977  };
53978  
53979  #define dump_field(_a, _b) _dump_field(_a, _b, __func__, __LINE__)
53980 -static void _dump_field(const char *hdr, u64 n, const char* func, int line)
53981 +static void _dump_field(const char *hdr, u64 n, const char *func, int line)
53982  {
53983  #if defined(DEBUG)
53984         char s[16];
53985 @@ -50,8 +50,8 @@
53986  
53987  #define dump_node_name(_a, _b, _c, _d, _e) \
53988         _dump_node_name(_a, _b, _c, _d, _e, __func__, __LINE__)
53989 -static void _dump_node_name (unsigned int lpar_id, u64 n1, u64 n2, u64 n3,
53990 -       u64 n4, const char* func, int line)
53991 +static void _dump_node_name(unsigned int lpar_id, u64 n1, u64 n2, u64 n3,
53992 +       u64 n4, const char *func, int line)
53993  {
53994         pr_debug("%s:%d: lpar: %u\n", func, line, lpar_id);
53995         _dump_field("n1: ", n1, func, line);
53996 @@ -63,7 +63,7 @@
53997  #define dump_node(_a, _b, _c, _d, _e, _f, _g) \
53998         _dump_node(_a, _b, _c, _d, _e, _f, _g, __func__, __LINE__)
53999  static void _dump_node(unsigned int lpar_id, u64 n1, u64 n2, u64 n3, u64 n4,
54000 -       u64 v1, u64 v2, const char* func, int line)
54001 +       u64 v1, u64 v2, const char *func, int line)
54002  {
54003         pr_debug("%s:%d: lpar: %u\n", func, line, lpar_id);
54004         _dump_field("n1: ", n1, func, line);
54005 @@ -165,21 +165,18 @@
54006                 make_first_field("bus", bus_index),
54007                 make_field(bus_str, 0),
54008                 0, 0,
54009 -               value, 0);
54010 +               value, NULL);
54011  }
54012  
54013 -int ps3_repository_read_bus_id(unsigned int bus_index, unsigned int *bus_id)
54014 +int ps3_repository_read_bus_id(unsigned int bus_index, u64 *bus_id)
54015  {
54016         int result;
54017 -       u64 v1;
54018 -       u64 v2; /* unused */
54019  
54020         result = read_node(PS3_LPAR_ID_PME,
54021                 make_first_field("bus", bus_index),
54022                 make_field("id", 0),
54023                 0, 0,
54024 -               &v1, &v2);
54025 -       *bus_id = v1;
54026 +               bus_id, NULL);
54027         return result;
54028  }
54029  
54030 @@ -193,7 +190,7 @@
54031                 make_first_field("bus", bus_index),
54032                 make_field("type", 0),
54033                 0, 0,
54034 -               &v1, 0);
54035 +               &v1, NULL);
54036         *bus_type = v1;
54037         return result;
54038  }
54039 @@ -208,7 +205,7 @@
54040                 make_first_field("bus", bus_index),
54041                 make_field("num_dev", 0),
54042                 0, 0,
54043 -               &v1, 0);
54044 +               &v1, NULL);
54045         *num_dev = v1;
54046         return result;
54047  }
54048 @@ -221,22 +218,20 @@
54049                 make_field("dev", dev_index),
54050                 make_field(dev_str, 0),
54051                 0,
54052 -               value, 0);
54053 +               value, NULL);
54054  }
54055  
54056  int ps3_repository_read_dev_id(unsigned int bus_index, unsigned int dev_index,
54057 -       unsigned int *dev_id)
54058 +       u64 *dev_id)
54059  {
54060         int result;
54061 -       u64 v1;
54062  
54063         result = read_node(PS3_LPAR_ID_PME,
54064                 make_first_field("bus", bus_index),
54065                 make_field("dev", dev_index),
54066                 make_field("id", 0),
54067                 0,
54068 -               &v1, 0);
54069 -       *dev_id = v1;
54070 +               dev_id, NULL);
54071         return result;
54072  }
54073  
54074 @@ -251,14 +246,14 @@
54075                 make_field("dev", dev_index),
54076                 make_field("type", 0),
54077                 0,
54078 -               &v1, 0);
54079 +               &v1, NULL);
54080         *dev_type = v1;
54081         return result;
54082  }
54083  
54084  int ps3_repository_read_dev_intr(unsigned int bus_index,
54085         unsigned int dev_index, unsigned int intr_index,
54086 -       enum ps3_interrupt_type *intr_type, unsigned int* interrupt_id)
54087 +       enum ps3_interrupt_type *intr_type, unsigned int *interrupt_id)
54088  {
54089         int result;
54090         u64 v1;
54091 @@ -287,7 +282,7 @@
54092                 make_field("dev", dev_index),
54093                 make_field("reg", reg_index),
54094                 make_field("type", 0),
54095 -               &v1, 0);
54096 +               &v1, NULL);
54097         *reg_type = v1;
54098         return result;
54099  }
54100 @@ -332,7 +327,7 @@
54101                 return result;
54102         }
54103  
54104 -       pr_debug("%s:%d: bus_type %u, bus_index %u, bus_id %u, num_dev %u\n",
54105 +       pr_debug("%s:%d: bus_type %u, bus_index %u, bus_id %lu, num_dev %u\n",
54106                 __func__, __LINE__, tmp.bus_type, tmp.bus_index, tmp.bus_id,
54107                 num_dev);
54108  
54109 @@ -349,47 +344,95 @@
54110                 return result;
54111         }
54112  
54113 -       if (tmp.bus_type == PS3_BUS_TYPE_STORAGE) {
54114 -               /*
54115 -                * A storage device may show up in the repository before the
54116 -                * hypervisor has finished probing its type and regions
54117 -                */
54118 -               unsigned int num_regions;
54119 -
54120 -               if (tmp.dev_type == PS3_DEV_TYPE_STOR_DUMMY) {
54121 -                       pr_debug("%s:%u storage device not ready\n", __func__,
54122 -                                __LINE__);
54123 -                       return -ENODEV;
54124 -               }
54125 +       result = ps3_repository_read_dev_id(tmp.bus_index, tmp.dev_index,
54126 +               &tmp.dev_id);
54127  
54128 -               result = ps3_repository_read_stor_dev_num_regions(tmp.bus_index,
54129 -                                                                 tmp.dev_index,
54130 -                                                                 &num_regions);
54131 +       if (result) {
54132 +               pr_debug("%s:%d ps3_repository_read_dev_id failed\n", __func__,
54133 +               __LINE__);
54134 +               return result;
54135 +       }
54136 +
54137 +       pr_debug("%s:%d: found: dev_type %u, dev_index %u, dev_id %lu\n",
54138 +               __func__, __LINE__, tmp.dev_type, tmp.dev_index, tmp.dev_id);
54139 +
54140 +       *repo = tmp;
54141 +       return 0;
54142 +}
54143 +
54144 +int ps3_repository_find_device_by_id(struct ps3_repository_device *repo,
54145 +                                    u64 bus_id, u64 dev_id)
54146 +{
54147 +       int result = -ENODEV;
54148 +       struct ps3_repository_device tmp;
54149 +       unsigned int num_dev;
54150 +
54151 +       pr_debug(" -> %s:%u: find device by id %lu:%lu\n", __func__, __LINE__,
54152 +                bus_id, dev_id);
54153 +
54154 +       for (tmp.bus_index = 0; tmp.bus_index < 10; tmp.bus_index++) {
54155 +               result = ps3_repository_read_bus_id(tmp.bus_index,
54156 +                                                   &tmp.bus_id);
54157                 if (result) {
54158 -                       pr_debug("%s:%d read_stor_dev_num_regions failed\n",
54159 -                                __func__, __LINE__);
54160 +                       pr_debug("%s:%u read_bus_id(%u) failed\n", __func__,
54161 +                                __LINE__, tmp.bus_index);
54162                         return result;
54163                 }
54164  
54165 -               if (!num_regions) {
54166 -                       pr_debug("%s:%u storage device has no regions yet\n",
54167 -                                __func__, __LINE__);
54168 -                       return -ENODEV;
54169 -               }
54170 +               if (tmp.bus_id == bus_id)
54171 +                       goto found_bus;
54172 +
54173 +               pr_debug("%s:%u: skip, bus_id %lu\n", __func__, __LINE__,
54174 +                        tmp.bus_id);
54175         }
54176 +       pr_debug(" <- %s:%u: bus not found\n", __func__, __LINE__);
54177 +       return result;
54178  
54179 -       result = ps3_repository_read_dev_id(tmp.bus_index, tmp.dev_index,
54180 -               &tmp.dev_id);
54181 +found_bus:
54182 +       result = ps3_repository_read_bus_type(tmp.bus_index, &tmp.bus_type);
54183 +       if (result) {
54184 +               pr_debug("%s:%u read_bus_type(%u) failed\n", __func__,
54185 +                        __LINE__, tmp.bus_index);
54186 +               return result;
54187 +       }
54188  
54189 +       result = ps3_repository_read_bus_num_dev(tmp.bus_index, &num_dev);
54190         if (result) {
54191 -               pr_debug("%s:%d ps3_repository_read_dev_id failed\n", __func__,
54192 -               __LINE__);
54193 +               pr_debug("%s:%u read_bus_num_dev failed\n", __func__,
54194 +                        __LINE__);
54195                 return result;
54196         }
54197  
54198 -       pr_debug("%s:%d: found: dev_type %u, dev_index %u, dev_id %u\n",
54199 -               __func__, __LINE__, tmp.dev_type, tmp.dev_index, tmp.dev_id);
54200 +       for (tmp.dev_index = 0; tmp.dev_index < num_dev; tmp.dev_index++) {
54201 +               result = ps3_repository_read_dev_id(tmp.bus_index,
54202 +                                                   tmp.dev_index,
54203 +                                                   &tmp.dev_id);
54204 +               if (result) {
54205 +                       pr_debug("%s:%u read_dev_id(%u:%u) failed\n", __func__,
54206 +                                __LINE__, tmp.bus_index, tmp.dev_index);
54207 +                       return result;
54208 +               }
54209 +
54210 +               if (tmp.dev_id == dev_id)
54211 +                       goto found_dev;
54212 +
54213 +               pr_debug("%s:%u: skip, dev_id %lu\n", __func__, __LINE__,
54214 +                        tmp.dev_id);
54215 +       }
54216 +       pr_debug(" <- %s:%u: dev not found\n", __func__, __LINE__);
54217 +       return result;
54218 +
54219 +found_dev:
54220 +       result = ps3_repository_read_dev_type(tmp.bus_index, tmp.dev_index,
54221 +                                             &tmp.dev_type);
54222 +       if (result) {
54223 +               pr_debug("%s:%u read_dev_type failed\n", __func__, __LINE__);
54224 +               return result;
54225 +       }
54226  
54227 +       pr_debug(" <- %s:%u: found: type (%u:%u) index (%u:%u) id (%lu:%lu)\n",
54228 +                __func__, __LINE__, tmp.bus_type, tmp.dev_type, tmp.bus_index,
54229 +                tmp.dev_index, tmp.bus_id, tmp.dev_id);
54230         *repo = tmp;
54231         return 0;
54232  }
54233 @@ -402,50 +445,34 @@
54234  
54235         pr_debug(" -> %s:%d: find bus_type %u\n", __func__, __LINE__, bus_type);
54236  
54237 -       for (repo.bus_index = 0; repo.bus_index < 10; repo.bus_index++) {
54238 +       repo.bus_type = bus_type;
54239 +       result = ps3_repository_find_bus(repo.bus_type, 0, &repo.bus_index);
54240 +       if (result) {
54241 +               pr_debug(" <- %s:%u: bus not found\n", __func__, __LINE__);
54242 +               return result;
54243 +       }
54244  
54245 -               result = ps3_repository_read_bus_type(repo.bus_index,
54246 -                       &repo.bus_type);
54247 +       result = ps3_repository_read_bus_id(repo.bus_index, &repo.bus_id);
54248 +       if (result) {
54249 +               pr_debug("%s:%d read_bus_id(%u) failed\n", __func__, __LINE__,
54250 +                        repo.bus_index);
54251 +               return result;
54252 +       }
54253  
54254 -               if (result) {
54255 -                       pr_debug("%s:%d read_bus_type(%u) failed\n",
54256 -                               __func__, __LINE__, repo.bus_index);
54257 +       for (repo.dev_index = 0; ; repo.dev_index++) {
54258 +               result = ps3_repository_find_device(&repo);
54259 +               if (result == -ENODEV) {
54260 +                       result = 0;
54261 +                       break;
54262 +               } else if (result)
54263                         break;
54264 -               }
54265 -
54266 -               if (repo.bus_type != bus_type) {
54267 -                       pr_debug("%s:%d: skip, bus_type %u\n", __func__,
54268 -                               __LINE__, repo.bus_type);
54269 -                       continue;
54270 -               }
54271 -
54272 -               result = ps3_repository_read_bus_id(repo.bus_index,
54273 -                       &repo.bus_id);
54274  
54275 +               result = callback(&repo);
54276                 if (result) {
54277 -                       pr_debug("%s:%d read_bus_id(%u) failed\n",
54278 -                               __func__, __LINE__, repo.bus_index);
54279 -                       continue;
54280 -               }
54281 -
54282 -               for (repo.dev_index = 0; ; repo.dev_index++) {
54283 -                       result = ps3_repository_find_device(&repo);
54284 -
54285 -                       if (result == -ENODEV) {
54286 -                               result = 0;
54287 -                               break;
54288 -                       } else if (result)
54289 -                               break;
54290 -
54291 -                       result = callback(&repo);
54292 -
54293 -                       if (result) {
54294 -                               pr_debug("%s:%d: abort at callback\n", __func__,
54295 -                                       __LINE__);
54296 -                               break;
54297 -                       }
54298 +                       pr_debug("%s:%d: abort at callback\n", __func__,
54299 +                               __LINE__);
54300 +                       break;
54301                 }
54302 -               break;
54303         }
54304  
54305         pr_debug(" <- %s:%d\n", __func__, __LINE__);
54306 @@ -561,7 +588,7 @@
54307                 make_first_field("bus", bus_index),
54308                 make_field("dev", dev_index),
54309                 make_field("port", 0),
54310 -               0, port, 0);
54311 +               0, port, NULL);
54312  }
54313  
54314  int ps3_repository_read_stor_dev_blk_size(unsigned int bus_index,
54315 @@ -571,7 +598,7 @@
54316                 make_first_field("bus", bus_index),
54317                 make_field("dev", dev_index),
54318                 make_field("blk_size", 0),
54319 -               0, blk_size, 0);
54320 +               0, blk_size, NULL);
54321  }
54322  
54323  int ps3_repository_read_stor_dev_num_blocks(unsigned int bus_index,
54324 @@ -581,7 +608,7 @@
54325                 make_first_field("bus", bus_index),
54326                 make_field("dev", dev_index),
54327                 make_field("n_blocks", 0),
54328 -               0, num_blocks, 0);
54329 +               0, num_blocks, NULL);
54330  }
54331  
54332  int ps3_repository_read_stor_dev_num_regions(unsigned int bus_index,
54333 @@ -594,7 +621,7 @@
54334                 make_first_field("bus", bus_index),
54335                 make_field("dev", dev_index),
54336                 make_field("n_regs", 0),
54337 -               0, &v1, 0);
54338 +               0, &v1, NULL);
54339         *num_regions = v1;
54340         return result;
54341  }
54342 @@ -611,7 +638,7 @@
54343             make_field("dev", dev_index),
54344             make_field("region", region_index),
54345             make_field("id", 0),
54346 -           &v1, 0);
54347 +           &v1, NULL);
54348         *region_id = v1;
54349         return result;
54350  }
54351 @@ -624,7 +651,7 @@
54352             make_field("dev", dev_index),
54353             make_field("region", region_index),
54354             make_field("size", 0),
54355 -           region_size, 0);
54356 +           region_size, NULL);
54357  }
54358  
54359  int ps3_repository_read_stor_dev_region_start(unsigned int bus_index,
54360 @@ -635,7 +662,7 @@
54361             make_field("dev", dev_index),
54362             make_field("region", region_index),
54363             make_field("start", 0),
54364 -           region_start, 0);
54365 +           region_start, NULL);
54366  }
54367  
54368  int ps3_repository_read_stor_dev_info(unsigned int bus_index,
54369 @@ -684,6 +711,35 @@
54370         return result;
54371  }
54372  
54373 +/**
54374 + * ps3_repository_read_num_pu - Number of logical PU processors for this lpar.
54375 + */
54376 +
54377 +int ps3_repository_read_num_pu(u64 *num_pu)
54378 +{
54379 +       *num_pu = 0;
54380 +       return read_node(PS3_LPAR_ID_CURRENT,
54381 +                          make_first_field("bi", 0),
54382 +                          make_field("pun", 0),
54383 +                          0, 0,
54384 +                          num_pu, NULL);
54385 +}
54386 +
54387 +/**
54388 + * ps3_repository_read_pu_id - Read the logical PU id.
54389 + * @pu_index: Zero based index.
54390 + * @pu_id: The logical PU id.
54391 + */
54392 +
54393 +int ps3_repository_read_pu_id(unsigned int pu_index, u64 *pu_id)
54394 +{
54395 +       return read_node(PS3_LPAR_ID_CURRENT,
54396 +               make_first_field("bi", 0),
54397 +               make_field("pu", pu_index),
54398 +               0, 0,
54399 +               pu_id, NULL);
54400 +}
54401 +
54402  int ps3_repository_read_rm_size(unsigned int ppe_id, u64 *rm_size)
54403  {
54404         return read_node(PS3_LPAR_ID_CURRENT,
54405 @@ -691,7 +747,7 @@
54406                 make_field("pu", 0),
54407                 ppe_id,
54408                 make_field("rm_size", 0),
54409 -               rm_size, 0);
54410 +               rm_size, NULL);
54411  }
54412  
54413  int ps3_repository_read_region_total(u64 *region_total)
54414 @@ -700,7 +756,7 @@
54415                 make_first_field("bi", 0),
54416                 make_field("rgntotal", 0),
54417                 0, 0,
54418 -               region_total, 0);
54419 +               region_total, NULL);
54420  }
54421  
54422  /**
54423 @@ -736,7 +792,7 @@
54424                 make_first_field("bi", 0),
54425                 make_field("spun", 0),
54426                 0, 0,
54427 -               &v1, 0);
54428 +               &v1, NULL);
54429         *num_spu_reserved = v1;
54430         return result;
54431  }
54432 @@ -755,7 +811,7 @@
54433                 make_first_field("bi", 0),
54434                 make_field("spursvn", 0),
54435                 0, 0,
54436 -               &v1, 0);
54437 +               &v1, NULL);
54438         *num_resource_id = v1;
54439         return result;
54440  }
54441 @@ -768,7 +824,7 @@
54442   */
54443  
54444  int ps3_repository_read_spu_resource_id(unsigned int res_index,
54445 -       enum ps3_spu_resource_type* resource_type, unsigned int *resource_id)
54446 +       enum ps3_spu_resource_type *resource_type, unsigned int *resource_id)
54447  {
54448         int result;
54449         u64 v1;
54450 @@ -785,14 +841,14 @@
54451         return result;
54452  }
54453  
54454 -int ps3_repository_read_boot_dat_address(u64 *address)
54455 +static int ps3_repository_read_boot_dat_address(u64 *address)
54456  {
54457         return read_node(PS3_LPAR_ID_CURRENT,
54458                 make_first_field("bi", 0),
54459                 make_field("boot_dat", 0),
54460                 make_field("address", 0),
54461                 0,
54462 -               address, 0);
54463 +               address, NULL);
54464  }
54465  
54466  int ps3_repository_read_boot_dat_size(unsigned int *size)
54467 @@ -805,7 +861,7 @@
54468                 make_field("boot_dat", 0),
54469                 make_field("size", 0),
54470                 0,
54471 -               &v1, 0);
54472 +               &v1, NULL);
54473         *size = v1;
54474         return result;
54475  }
54476 @@ -820,7 +876,7 @@
54477                 make_field("vir_uart", 0),
54478                 make_field("port", 0),
54479                 make_field("avset", 0),
54480 -               &v1, 0);
54481 +               &v1, NULL);
54482         *port = v1;
54483         return result;
54484  }
54485 @@ -835,7 +891,7 @@
54486                 make_field("vir_uart", 0),
54487                 make_field("port", 0),
54488                 make_field("sysmgr", 0),
54489 -               &v1, 0);
54490 +               &v1, NULL);
54491         *port = v1;
54492         return result;
54493  }
54494 @@ -856,6 +912,10 @@
54495                 : ps3_repository_read_boot_dat_size(size);
54496  }
54497  
54498 +/**
54499 + * ps3_repository_read_num_be - Number of physical BE processors in the system.
54500 + */
54501 +
54502  int ps3_repository_read_num_be(unsigned int *num_be)
54503  {
54504         int result;
54505 @@ -866,11 +926,17 @@
54506                 0,
54507                 0,
54508                 0,
54509 -               &v1, 0);
54510 +               &v1, NULL);
54511         *num_be = v1;
54512         return result;
54513  }
54514  
54515 +/**
54516 + * ps3_repository_read_be_node_id - Read the physical BE processor node id.
54517 + * @be_index: Zero based index.
54518 + * @node_id: The BE processor node id.
54519 + */
54520 +
54521  int ps3_repository_read_be_node_id(unsigned int be_index, u64 *node_id)
54522  {
54523         return read_node(PS3_LPAR_ID_PME,
54524 @@ -878,7 +944,23 @@
54525                 0,
54526                 0,
54527                 0,
54528 -               node_id, 0);
54529 +               node_id, NULL);
54530 +}
54531 +
54532 +/**
54533 + * ps3_repository_read_be_id - Read the physical BE processor id.
54534 + * @node_id: The BE processor node id.
54535 + * @be_id: The BE processor id.
54536 + */
54537 +
54538 +int ps3_repository_read_be_id(u64 node_id, u64 *be_id)
54539 +{
54540 +       return read_node(PS3_LPAR_ID_PME,
54541 +               make_first_field("be", 0),
54542 +               node_id,
54543 +               0,
54544 +               0,
54545 +               be_id, NULL);
54546  }
54547  
54548  int ps3_repository_read_tb_freq(u64 node_id, u64 *tb_freq)
54549 @@ -888,7 +970,7 @@
54550                 node_id,
54551                 make_field("clock", 0),
54552                 0,
54553 -               tb_freq, 0);
54554 +               tb_freq, NULL);
54555  }
54556  
54557  int ps3_repository_read_be_tb_freq(unsigned int be_index, u64 *tb_freq)
54558 @@ -897,11 +979,29 @@
54559         u64 node_id;
54560  
54561         *tb_freq = 0;
54562 -       result = ps3_repository_read_be_node_id(0, &node_id);
54563 +       result = ps3_repository_read_be_node_id(be_index, &node_id);
54564         return result ? result
54565                 : ps3_repository_read_tb_freq(node_id, tb_freq);
54566  }
54567  
54568 +int ps3_repository_read_lpm_privileges(unsigned int be_index, u64 *lpar,
54569 +       u64 *rights)
54570 +{
54571 +       int result;
54572 +       u64 node_id;
54573 +
54574 +       *lpar = 0;
54575 +       *rights = 0;
54576 +       result = ps3_repository_read_be_node_id(be_index, &node_id);
54577 +       return result ? result
54578 +               : read_node(PS3_LPAR_ID_PME,
54579 +                           make_first_field("be", 0),
54580 +                           node_id,
54581 +                           make_field("lpm", 0),
54582 +                           make_field("priv", 0),
54583 +                           lpar, rights);
54584 +}
54585 +
54586  #if defined(DEBUG)
54587  
54588  int ps3_repository_dump_resource_info(const struct ps3_repository_device *repo)
54589 @@ -1034,7 +1134,7 @@
54590                         continue;
54591                 }
54592  
54593 -               pr_debug("%s:%d  (%u:%u): dev_type %u, dev_id %u\n", __func__,
54594 +               pr_debug("%s:%d  (%u:%u): dev_type %u, dev_id %lu\n", __func__,
54595                         __LINE__, repo->bus_index, repo->dev_index,
54596                         repo->dev_type, repo->dev_id);
54597  
54598 @@ -1091,7 +1191,7 @@
54599                         continue;
54600                 }
54601  
54602 -               pr_debug("%s:%d bus_%u: bus_type %u, bus_id %u, num_dev %u\n",
54603 +               pr_debug("%s:%d bus_%u: bus_type %u, bus_id %lu, num_dev %u\n",
54604                         __func__, __LINE__, repo.bus_index, repo.bus_type,
54605                         repo.bus_id, num_dev);
54606  
54607 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/ps3/spu.c powerpc.git/arch/powerpc/platforms/ps3/spu.c
54608 --- linux-2.6.24/arch/powerpc/platforms/ps3/spu.c       2008-01-24 23:58:37.000000000 +0100
54609 +++ powerpc.git/arch/powerpc/platforms/ps3/spu.c        2008-01-28 20:25:49.000000000 +0100
54610 @@ -28,6 +28,7 @@
54611  #include <asm/spu_priv1.h>
54612  #include <asm/lv1call.h>
54613  
54614 +#include "../cell/spufs/spufs.h"
54615  #include "platform.h"
54616  
54617  /* spu_management_ops */
54618 @@ -419,10 +420,34 @@
54619         return 0;
54620  }
54621  
54622 +/**
54623 + * ps3_enable_spu - Enable SPU run control.
54624 + *
54625 + * An outstanding enhancement for the PS3 would be to add a guard to check
54626 + * for incorrect access to the spu problem state when the spu context is
54627 + * disabled.  This check could be implemented with a flag added to the spu
54628 + * context that would inhibit mapping problem state pages, and a routine
54629 + * to unmap spu problem state pages.  When the spu is enabled with
54630 + * ps3_enable_spu() the flag would be set allowing pages to be mapped,
54631 + * and when the spu is disabled with ps3_disable_spu() the flag would be
54632 + * cleared and the mapped problem state pages would be unmapped.
54633 + */
54634 +
54635 +static void ps3_enable_spu(struct spu_context *ctx)
54636 +{
54637 +}
54638 +
54639 +static void ps3_disable_spu(struct spu_context *ctx)
54640 +{
54641 +       ctx->ops->runcntl_stop(ctx);
54642 +}
54643 +
54644  const struct spu_management_ops spu_management_ps3_ops = {
54645         .enumerate_spus = ps3_enumerate_spus,
54646         .create_spu = ps3_create_spu,
54647         .destroy_spu = ps3_destroy_spu,
54648 +       .enable_spu = ps3_enable_spu,
54649 +       .disable_spu = ps3_disable_spu,
54650         .init_affinity = ps3_init_affinity,
54651  };
54652  
54653 @@ -505,8 +530,6 @@
54654         static const u64 allowed = ~(MFC_STATE1_LOCAL_STORAGE_DECODE_MASK
54655                 | MFC_STATE1_PROBLEM_STATE_MASK);
54656  
54657 -       sr1 |= MFC_STATE1_MASTER_RUN_CONTROL_MASK;
54658 -
54659         BUG_ON((sr1 & allowed) != (spu_pdata(spu)->cache.sr1 & allowed));
54660  
54661         spu_pdata(spu)->cache.sr1 = sr1;
54662 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/ps3/system-bus.c powerpc.git/arch/powerpc/platforms/ps3/system-bus.c
54663 --- linux-2.6.24/arch/powerpc/platforms/ps3/system-bus.c        2008-01-24 23:58:37.000000000 +0100
54664 +++ powerpc.git/arch/powerpc/platforms/ps3/system-bus.c 2008-01-28 20:25:49.000000000 +0100
54665 @@ -42,8 +42,8 @@
54666         int gpu;
54667  } static usage_hack;
54668  
54669 -static int ps3_is_device(struct ps3_system_bus_device *dev,
54670 -                        unsigned int bus_id, unsigned int dev_id)
54671 +static int ps3_is_device(struct ps3_system_bus_device *dev, u64 bus_id,
54672 +                        u64 dev_id)
54673  {
54674         return dev->bus_id == bus_id && dev->dev_id == dev_id;
54675  }
54676 @@ -182,8 +182,8 @@
54677         case PS3_MATCH_ID_SYSTEM_MANAGER:
54678                 pr_debug("%s:%d: unsupported match_id: %u\n", __func__,
54679                         __LINE__, dev->match_id);
54680 -               pr_debug("%s:%d: bus_id: %u\n", __func__,
54681 -                       __LINE__, dev->bus_id);
54682 +               pr_debug("%s:%d: bus_id: %lu\n", __func__, __LINE__,
54683 +                       dev->bus_id);
54684                 BUG();
54685                 return -EINVAL;
54686  
54687 @@ -220,8 +220,8 @@
54688         case PS3_MATCH_ID_SYSTEM_MANAGER:
54689                 pr_debug("%s:%d: unsupported match_id: %u\n", __func__,
54690                         __LINE__, dev->match_id);
54691 -               pr_debug("%s:%d: bus_id: %u\n", __func__,
54692 -                       __LINE__, dev->bus_id);
54693 +               pr_debug("%s:%d: bus_id: %lu\n", __func__, __LINE__,
54694 +                       dev->bus_id);
54695                 BUG();
54696                 return -EINVAL;
54697  
54698 @@ -240,7 +240,7 @@
54699  static void _dump_mmio_region(const struct ps3_mmio_region* r,
54700         const char* func, int line)
54701  {
54702 -       pr_debug("%s:%d: dev       %u:%u\n", func, line, r->dev->bus_id,
54703 +       pr_debug("%s:%d: dev       %lu:%lu\n", func, line, r->dev->bus_id,
54704                 r->dev->dev_id);
54705         pr_debug("%s:%d: bus_addr  %lxh\n", func, line, r->bus_addr);
54706         pr_debug("%s:%d: len       %lxh\n", func, line, r->len);
54707 @@ -715,6 +715,7 @@
54708         static unsigned int dev_ioc0_count;
54709         static unsigned int dev_sb_count;
54710         static unsigned int dev_vuart_count;
54711 +       static unsigned int dev_lpm_count;
54712  
54713         if (!dev->core.parent)
54714                 dev->core.parent = &ps3_system_bus;
54715 @@ -737,6 +738,10 @@
54716                 snprintf(dev->core.bus_id, sizeof(dev->core.bus_id),
54717                         "vuart_%02x", ++dev_vuart_count);
54718                 break;
54719 +       case PS3_DEVICE_TYPE_LPM:
54720 +               snprintf(dev->core.bus_id, sizeof(dev->core.bus_id),
54721 +                       "lpm_%02x", ++dev_lpm_count);
54722 +               break;
54723         default:
54724                 BUG();
54725         };
54726 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/pseries/eeh.c powerpc.git/arch/powerpc/platforms/pseries/eeh.c
54727 --- linux-2.6.24/arch/powerpc/platforms/pseries/eeh.c   2008-01-24 23:58:37.000000000 +0100
54728 +++ powerpc.git/arch/powerpc/platforms/pseries/eeh.c    2008-01-28 20:25:49.000000000 +0100
54729 @@ -29,6 +29,8 @@
54730  #include <linux/rbtree.h>
54731  #include <linux/seq_file.h>
54732  #include <linux/spinlock.h>
54733 +#include <linux/of.h>
54734 +
54735  #include <asm/atomic.h>
54736  #include <asm/eeh.h>
54737  #include <asm/eeh_event.h>
54738 @@ -169,7 +171,6 @@
54739   */
54740  static size_t gather_pci_data(struct pci_dn *pdn, char * buf, size_t len)
54741  {
54742 -       struct device_node *dn;
54743         struct pci_dev *dev = pdn->pcidev;
54744         u32 cfg;
54745         int cap, i;
54746 @@ -243,12 +244,12 @@
54747  
54748         /* Gather status on devices under the bridge */
54749         if (dev->class >> 16 == PCI_BASE_CLASS_BRIDGE) {
54750 -               dn = pdn->node->child;
54751 -               while (dn) {
54752 +               struct device_node *dn;
54753 +
54754 +               for_each_child_of_node(pdn->node, dn) {
54755                         pdn = PCI_DN(dn);
54756                         if (pdn)
54757                                 n += gather_pci_data(pdn, buf+n, len-n);
54758 -                       dn = dn->sibling;
54759                 }
54760         }
54761  
54762 @@ -372,7 +373,7 @@
54763         return dn;
54764  }
54765  
54766 -/** Mark all devices that are peers of this device as failed.
54767 +/** Mark all devices that are children of this device as failed.
54768   *  Mark the device driver too, so that it can see the failure
54769   *  immediately; this is critical, since some drivers poll
54770   *  status registers in interrupts ... If a driver is polling,
54771 @@ -380,9 +381,11 @@
54772   *  an interrupt context, which is bad.
54773   */
54774  
54775 -static void __eeh_mark_slot (struct device_node *dn, int mode_flag)
54776 +static void __eeh_mark_slot(struct device_node *parent, int mode_flag)
54777  {
54778 -       while (dn) {
54779 +       struct device_node *dn;
54780 +
54781 +       for_each_child_of_node(parent, dn) {
54782                 if (PCI_DN(dn)) {
54783                         /* Mark the pci device driver too */
54784                         struct pci_dev *dev = PCI_DN(dn)->pcidev;
54785 @@ -392,10 +395,8 @@
54786                         if (dev && dev->driver)
54787                                 dev->error_state = pci_channel_io_frozen;
54788  
54789 -                       if (dn->child)
54790 -                               __eeh_mark_slot (dn->child, mode_flag);
54791 +                       __eeh_mark_slot(dn, mode_flag);
54792                 }
54793 -               dn = dn->sibling;
54794         }
54795  }
54796  
54797 @@ -415,19 +416,19 @@
54798         if (dev)
54799                 dev->error_state = pci_channel_io_frozen;
54800  
54801 -       __eeh_mark_slot (dn->child, mode_flag);
54802 +       __eeh_mark_slot(dn, mode_flag);
54803  }
54804  
54805 -static void __eeh_clear_slot (struct device_node *dn, int mode_flag)
54806 +static void __eeh_clear_slot(struct device_node *parent, int mode_flag)
54807  {
54808 -       while (dn) {
54809 +       struct device_node *dn;
54810 +
54811 +       for_each_child_of_node(parent, dn) {
54812                 if (PCI_DN(dn)) {
54813                         PCI_DN(dn)->eeh_mode &= ~mode_flag;
54814                         PCI_DN(dn)->eeh_check_count = 0;
54815 -                       if (dn->child)
54816 -                               __eeh_clear_slot (dn->child, mode_flag);
54817 +                       __eeh_clear_slot(dn, mode_flag);
54818                 }
54819 -               dn = dn->sibling;
54820         }
54821  }
54822  
54823 @@ -444,7 +445,7 @@
54824  
54825         PCI_DN(dn)->eeh_mode &= ~mode_flag;
54826         PCI_DN(dn)->eeh_check_count = 0;
54827 -       __eeh_clear_slot (dn->child, mode_flag);
54828 +       __eeh_clear_slot(dn, mode_flag);
54829         spin_unlock_irqrestore(&confirm_error_lock, flags);
54830  }
54831  
54832 @@ -480,6 +481,7 @@
54833                 no_dn++;
54834                 return 0;
54835         }
54836 +       dn = find_device_pe(dn);
54837         pdn = PCI_DN(dn);
54838  
54839         /* Access to IO BARs might get this far and still not want checking. */
54840 @@ -545,7 +547,7 @@
54841  
54842         /* Note that config-io to empty slots may fail;
54843          * they are empty when they don't have children. */
54844 -       if ((rets[0] == 5) && (dn->child == NULL)) {
54845 +       if ((rets[0] == 5) && (rets[2] == 0) && (dn->child == NULL)) {
54846                 false_positives++;
54847                 pdn->eeh_false_positives ++;
54848                 rc = 0;
54849 @@ -848,11 +850,8 @@
54850         if ((pdn->eeh_mode & EEH_MODE_SUPPORTED) && !IS_BRIDGE(pdn->class_code))
54851                 __restore_bars (pdn);
54852  
54853 -       dn = pdn->node->child;
54854 -       while (dn) {
54855 +       for_each_child_of_node(pdn->node, dn)
54856                 eeh_restore_bars (PCI_DN(dn));
54857 -               dn = dn->sibling;
54858 -       }
54859  }
54860  
54861  /**
54862 @@ -1130,7 +1129,8 @@
54863  void eeh_add_device_tree_early(struct device_node *dn)
54864  {
54865         struct device_node *sib;
54866 -       for (sib = dn->child; sib; sib = sib->sibling)
54867 +
54868 +       for_each_child_of_node(dn, sib)
54869                 eeh_add_device_tree_early(sib);
54870         eeh_add_device_early(dn);
54871  }
54872 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/pseries/eeh_driver.c powerpc.git/arch/powerpc/platforms/pseries/eeh_driver.c
54873 --- linux-2.6.24/arch/powerpc/platforms/pseries/eeh_driver.c    2008-01-24 23:58:37.000000000 +0100
54874 +++ powerpc.git/arch/powerpc/platforms/pseries/eeh_driver.c     2008-01-28 20:25:49.000000000 +0100
54875 @@ -310,8 +310,6 @@
54876         const char *location, *pci_str, *drv_str;
54877  
54878         frozen_dn = find_device_pe(event->dn);
54879 -       frozen_bus = pcibios_find_pci_bus(frozen_dn);
54880 -
54881         if (!frozen_dn) {
54882  
54883                 location = of_get_property(event->dn, "ibm,loc-code", NULL);
54884 @@ -321,6 +319,8 @@
54885                         location, pci_name(event->dev));
54886                 return NULL;
54887         }
54888 +
54889 +       frozen_bus = pcibios_find_pci_bus(frozen_dn);
54890         location = of_get_property(frozen_dn, "ibm,loc-code", NULL);
54891         location = location ? location : "unknown";
54892  
54893 @@ -354,13 +354,6 @@
54894         if (frozen_pdn->eeh_freeze_count > EEH_MAX_ALLOWED_FREEZES)
54895                 goto excess_failures;
54896  
54897 -       /* Get the current PCI slot state. */
54898 -       rc = eeh_wait_for_slot_status (frozen_pdn, MAX_WAIT_FOR_RECOVERY*1000);
54899 -       if (rc < 0) {
54900 -               printk(KERN_WARNING "EEH: Permanent failure\n");
54901 -               goto hard_fail;
54902 -       }
54903 -
54904         printk(KERN_WARNING
54905            "EEH: This PCI device has failed %d times in the last hour:\n",
54906                 frozen_pdn->eeh_freeze_count);
54907 @@ -376,6 +369,14 @@
54908          */
54909         pci_walk_bus(frozen_bus, eeh_report_error, &result);
54910  
54911 +       /* Get the current PCI slot state. This can take a long time,
54912 +        * sometimes over 3 seconds for certain systems. */
54913 +       rc = eeh_wait_for_slot_status (frozen_pdn, MAX_WAIT_FOR_RECOVERY*1000);
54914 +       if (rc < 0) {
54915 +               printk(KERN_WARNING "EEH: Permanent failure\n");
54916 +               goto hard_fail;
54917 +       }
54918 +
54919         /* Since rtas may enable MMIO when posting the error log,
54920          * don't post the error log until after all dev drivers
54921          * have been informed.
54922 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/pseries/iommu.c powerpc.git/arch/powerpc/platforms/pseries/iommu.c
54923 --- linux-2.6.24/arch/powerpc/platforms/pseries/iommu.c 2008-01-24 23:58:37.000000000 +0100
54924 +++ powerpc.git/arch/powerpc/platforms/pseries/iommu.c  2008-01-28 20:25:49.000000000 +0100
54925 @@ -251,7 +251,7 @@
54926         const unsigned long *basep;
54927         const u32 *sizep;
54928  
54929 -       node = (struct device_node *)phb->arch_data;
54930 +       node = phb->dn;
54931  
54932         basep = of_get_property(node, "linux,tce-base", NULL);
54933         sizep = of_get_property(node, "linux,tce-size", NULL);
54934 @@ -296,11 +296,12 @@
54935  static void iommu_table_setparms_lpar(struct pci_controller *phb,
54936                                       struct device_node *dn,
54937                                       struct iommu_table *tbl,
54938 -                                     const void *dma_window)
54939 +                                     const void *dma_window,
54940 +                                     int bussubno)
54941  {
54942         unsigned long offset, size;
54943  
54944 -       tbl->it_busno  = PCI_DN(dn)->bussubno;
54945 +       tbl->it_busno  = bussubno;
54946         of_parse_dma_window(dn, dma_window, &tbl->it_index, &offset, &size);
54947  
54948         tbl->it_base   = 0;
54949 @@ -420,17 +421,10 @@
54950             pdn->full_name, ppci->iommu_table);
54951  
54952         if (!ppci->iommu_table) {
54953 -               /* Bussubno hasn't been copied yet.
54954 -                * Do it now because iommu_table_setparms_lpar needs it.
54955 -                */
54956 -
54957 -               ppci->bussubno = bus->number;
54958 -
54959                 tbl = kmalloc_node(sizeof(struct iommu_table), GFP_KERNEL,
54960                                    ppci->phb->node);
54961 -
54962 -               iommu_table_setparms_lpar(ppci->phb, pdn, tbl, dma_window);
54963 -
54964 +               iommu_table_setparms_lpar(ppci->phb, pdn, tbl, dma_window,
54965 +                       bus->number);
54966                 ppci->iommu_table = iommu_init_table(tbl, ppci->phb->node);
54967                 DBG("  created table: %p\n", ppci->iommu_table);
54968         }
54969 @@ -523,14 +517,10 @@
54970  
54971         pci = PCI_DN(pdn);
54972         if (!pci->iommu_table) {
54973 -               /* iommu_table_setparms_lpar needs bussubno. */
54974 -               pci->bussubno = pci->phb->bus->number;
54975 -
54976                 tbl = kmalloc_node(sizeof(struct iommu_table), GFP_KERNEL,
54977                                    pci->phb->node);
54978 -
54979 -               iommu_table_setparms_lpar(pci->phb, pdn, tbl, dma_window);
54980 -
54981 +               iommu_table_setparms_lpar(pci->phb, pdn, tbl, dma_window,
54982 +                       pci->phb->bus->number);
54983                 pci->iommu_table = iommu_init_table(tbl, pci->phb->node);
54984                 DBG("  created table: %p\n", pci->iommu_table);
54985         } else {
54986 @@ -556,7 +546,7 @@
54987         case PSERIES_RECONFIG_REMOVE:
54988                 if (pci && pci->iommu_table &&
54989                     of_get_property(np, "ibm,dma-window", NULL))
54990 -                       iommu_free_table(np);
54991 +                       iommu_free_table(pci->iommu_table, np->full_name);
54992                 break;
54993         default:
54994                 err = NOTIFY_DONE;
54995 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/pseries/pci_dlpar.c powerpc.git/arch/powerpc/platforms/pseries/pci_dlpar.c
54996 --- linux-2.6.24/arch/powerpc/platforms/pseries/pci_dlpar.c     2008-01-24 23:58:37.000000000 +0100
54997 +++ powerpc.git/arch/powerpc/platforms/pseries/pci_dlpar.c      2008-01-28 20:25:49.000000000 +0100
54998 @@ -83,7 +83,7 @@
54999  
55000  /* Must be called before pci_bus_add_devices */
55001  void
55002 -pcibios_fixup_new_pci_devices(struct pci_bus *bus, int fix_bus)
55003 +pcibios_fixup_new_pci_devices(struct pci_bus *bus)
55004  {
55005         struct pci_dev *dev;
55006  
55007 @@ -98,8 +98,6 @@
55008                         /* Fill device archdata and setup iommu table */
55009                         pcibios_setup_new_device(dev);
55010  
55011 -                       if(fix_bus)
55012 -                               pcibios_fixup_device_resources(dev, bus);
55013                         pci_read_irq_line(dev);
55014                         for (i = 0; i < PCI_NUM_RESOURCES; i++) {
55015                                 struct resource *r = &dev->resource[i];
55016 @@ -132,8 +130,8 @@
55017  
55018         pci_scan_child_bus(child_bus);
55019  
55020 -       /* Fixup new pci devices without touching bus struct */
55021 -       pcibios_fixup_new_pci_devices(child_bus, 0);
55022 +       /* Fixup new pci devices */
55023 +       pcibios_fixup_new_pci_devices(child_bus);
55024  
55025         /* Make the discovered devices available */
55026         pci_bus_add_devices(child_bus);
55027 @@ -169,7 +167,7 @@
55028                 /* use ofdt-based probe */
55029                 of_scan_bus(dn, bus);
55030                 if (!list_empty(&bus->devices)) {
55031 -                       pcibios_fixup_new_pci_devices(bus, 0);
55032 +                       pcibios_fixup_new_pci_devices(bus);
55033                         pci_bus_add_devices(bus);
55034                         eeh_add_device_tree_late(bus);
55035                 }
55036 @@ -178,7 +176,7 @@
55037                 slotno = PCI_SLOT(PCI_DN(dn->child)->devfn);
55038                 num = pci_scan_slot(bus, PCI_DEVFN(slotno, 0));
55039                 if (num) {
55040 -                       pcibios_fixup_new_pci_devices(bus, 1);
55041 +                       pcibios_fixup_new_pci_devices(bus);
55042                         pci_bus_add_devices(bus);
55043                         eeh_add_device_tree_late(bus);
55044                 }
55045 @@ -208,7 +206,7 @@
55046                 eeh_add_device_tree_early(dn);
55047  
55048         scan_phb(phb);
55049 -       pcibios_fixup_new_pci_devices(phb->bus, 0);
55050 +       pcibios_fixup_new_pci_devices(phb->bus);
55051         pci_bus_add_devices(phb->bus);
55052         eeh_add_device_tree_late(phb->bus);
55053  
55054 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/pseries/plpar_wrappers.h powerpc.git/arch/powerpc/platforms/pseries/plpar_wrappers.h
55055 --- linux-2.6.24/arch/powerpc/platforms/pseries/plpar_wrappers.h        2008-01-24 23:58:37.000000000 +0100
55056 +++ powerpc.git/arch/powerpc/platforms/pseries/plpar_wrappers.h 2008-01-28 20:25:49.000000000 +0100
55057 @@ -8,11 +8,6 @@
55058         return plpar_hcall_norets(H_POLL_PENDING);
55059  }
55060  
55061 -static inline long prod_processor(void)
55062 -{
55063 -       return plpar_hcall_norets(H_PROD);
55064 -}
55065 -
55066  static inline long cede_processor(void)
55067  {
55068         return plpar_hcall_norets(H_CEDE);
55069 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/pseries/smp.c powerpc.git/arch/powerpc/platforms/pseries/smp.c
55070 --- linux-2.6.24/arch/powerpc/platforms/pseries/smp.c   2008-01-24 23:58:37.000000000 +0100
55071 +++ powerpc.git/arch/powerpc/platforms/pseries/smp.c    2008-01-28 20:25:49.000000000 +0100
55072 @@ -46,6 +46,7 @@
55073  #include <asm/pSeries_reconfig.h>
55074  #include <asm/mpic.h>
55075  #include <asm/vdso_datapage.h>
55076 +#include <asm/cputhreads.h>
55077  
55078  #include "plpar_wrappers.h"
55079  #include "pseries.h"
55080 @@ -202,7 +203,7 @@
55081          */
55082         if (system_state < SYSTEM_RUNNING &&
55083             cpu_has_feature(CPU_FTR_SMT) &&
55084 -           !smt_enabled_at_boot && nr % 2 != 0)
55085 +           !smt_enabled_at_boot && cpu_thread_in_core(nr) != 0)
55086                 return 0;
55087  
55088         return 1;
55089 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/pseries/xics.c powerpc.git/arch/powerpc/platforms/pseries/xics.c
55090 --- linux-2.6.24/arch/powerpc/platforms/pseries/xics.c  2008-01-24 23:58:37.000000000 +0100
55091 +++ powerpc.git/arch/powerpc/platforms/pseries/xics.c   2008-01-28 20:25:49.000000000 +0100
55092 @@ -87,19 +87,25 @@
55093  /* Direct HW low level accessors */
55094  
55095  
55096 -static inline unsigned int direct_xirr_info_get(int n_cpu)
55097 +static inline unsigned int direct_xirr_info_get(void)
55098  {
55099 -       return in_be32(&xics_per_cpu[n_cpu]->xirr.word);
55100 +       int cpu = smp_processor_id();
55101 +
55102 +       return in_be32(&xics_per_cpu[cpu]->xirr.word);
55103  }
55104  
55105 -static inline void direct_xirr_info_set(int n_cpu, int value)
55106 +static inline void direct_xirr_info_set(int value)
55107  {
55108 -       out_be32(&xics_per_cpu[n_cpu]->xirr.word, value);
55109 +       int cpu = smp_processor_id();
55110 +
55111 +       out_be32(&xics_per_cpu[cpu]->xirr.word, value);
55112  }
55113  
55114 -static inline void direct_cppr_info(int n_cpu, u8 value)
55115 +static inline void direct_cppr_info(u8 value)
55116  {
55117 -       out_8(&xics_per_cpu[n_cpu]->xirr.bytes[0], value);
55118 +       int cpu = smp_processor_id();
55119 +
55120 +       out_8(&xics_per_cpu[cpu]->xirr.bytes[0], value);
55121  }
55122  
55123  static inline void direct_qirr_info(int n_cpu, u8 value)
55124 @@ -111,7 +117,7 @@
55125  /* LPAR low level accessors */
55126  
55127  
55128 -static inline unsigned int lpar_xirr_info_get(int n_cpu)
55129 +static inline unsigned int lpar_xirr_info_get(void)
55130  {
55131         unsigned long lpar_rc;
55132         unsigned long return_value;
55133 @@ -122,7 +128,7 @@
55134         return (unsigned int)return_value;
55135  }
55136  
55137 -static inline void lpar_xirr_info_set(int n_cpu, int value)
55138 +static inline void lpar_xirr_info_set(int value)
55139  {
55140         unsigned long lpar_rc;
55141         unsigned long val64 = value & 0xffffffff;
55142 @@ -133,7 +139,7 @@
55143                       val64);
55144  }
55145  
55146 -static inline void lpar_cppr_info(int n_cpu, u8 value)
55147 +static inline void lpar_cppr_info(u8 value)
55148  {
55149         unsigned long lpar_rc;
55150  
55151 @@ -275,21 +281,19 @@
55152  
55153  static void xics_eoi_direct(unsigned int virq)
55154  {
55155 -       int cpu = smp_processor_id();
55156         unsigned int irq = (unsigned int)irq_map[virq].hwirq;
55157  
55158         iosync();
55159 -       direct_xirr_info_set(cpu, (0xff << 24) | irq);
55160 +       direct_xirr_info_set((0xff << 24) | irq);
55161  }
55162  
55163  
55164  static void xics_eoi_lpar(unsigned int virq)
55165  {
55166 -       int cpu = smp_processor_id();
55167         unsigned int irq = (unsigned int)irq_map[virq].hwirq;
55168  
55169         iosync();
55170 -       lpar_xirr_info_set(cpu, (0xff << 24) | irq);
55171 +       lpar_xirr_info_set((0xff << 24) | irq);
55172  }
55173  
55174  static inline unsigned int xics_remap_irq(unsigned int vec)
55175 @@ -312,16 +316,12 @@
55176  
55177  static unsigned int xics_get_irq_direct(void)
55178  {
55179 -       unsigned int cpu = smp_processor_id();
55180 -
55181 -       return xics_remap_irq(direct_xirr_info_get(cpu));
55182 +       return xics_remap_irq(direct_xirr_info_get());
55183  }
55184  
55185  static unsigned int xics_get_irq_lpar(void)
55186  {
55187 -       unsigned int cpu = smp_processor_id();
55188 -
55189 -       return xics_remap_irq(lpar_xirr_info_get(cpu));
55190 +       return xics_remap_irq(lpar_xirr_info_get());
55191  }
55192  
55193  #ifdef CONFIG_SMP
55194 @@ -387,12 +387,12 @@
55195  
55196  #endif /* CONFIG_SMP */
55197  
55198 -static void xics_set_cpu_priority(int cpu, unsigned char cppr)
55199 +static void xics_set_cpu_priority(unsigned char cppr)
55200  {
55201         if (firmware_has_feature(FW_FEATURE_LPAR))
55202 -               lpar_cppr_info(cpu, cppr);
55203 +               lpar_cppr_info(cppr);
55204         else
55205 -               direct_cppr_info(cpu, cppr);
55206 +               direct_cppr_info(cppr);
55207         iosync();
55208  }
55209  
55210 @@ -440,9 +440,7 @@
55211  
55212  void xics_setup_cpu(void)
55213  {
55214 -       int cpu = smp_processor_id();
55215 -
55216 -       xics_set_cpu_priority(cpu, 0xff);
55217 +       xics_set_cpu_priority(0xff);
55218  
55219         /*
55220          * Put the calling processor into the GIQ.  This is really only
55221 @@ -783,7 +781,7 @@
55222         unsigned int ipi;
55223         struct irq_desc *desc;
55224  
55225 -       xics_set_cpu_priority(cpu, 0);
55226 +       xics_set_cpu_priority(0);
55227  
55228         /*
55229          * Clear IPI
55230 @@ -824,10 +822,11 @@
55231  void xics_migrate_irqs_away(void)
55232  {
55233         int status;
55234 -       unsigned int irq, virq, cpu = smp_processor_id();
55235 +       int cpu = smp_processor_id(), hw_cpu = hard_smp_processor_id();
55236 +       unsigned int irq, virq;
55237  
55238         /* Reject any interrupt that was queued to us... */
55239 -       xics_set_cpu_priority(cpu, 0);
55240 +       xics_set_cpu_priority(0);
55241  
55242         /* remove ourselves from the global interrupt queue */
55243         status = rtas_set_indicator_fast(GLOBAL_INTERRUPT_QUEUE,
55244 @@ -835,7 +834,7 @@
55245         WARN_ON(status < 0);
55246  
55247         /* Allow IPIs again... */
55248 -       xics_set_cpu_priority(cpu, DEFAULT_PRIORITY);
55249 +       xics_set_cpu_priority(DEFAULT_PRIORITY);
55250  
55251         for_each_irq(virq) {
55252                 struct irq_desc *desc;
55253 @@ -874,7 +873,7 @@
55254                  * The irq has to be migrated only in the single cpu
55255                  * case.
55256                  */
55257 -               if (xics_status[0] != get_hard_smp_processor_id(cpu))
55258 +               if (xics_status[0] != hw_cpu)
55259                         goto unlock;
55260  
55261                 printk(KERN_WARNING "IRQ %u affinity broken off cpu %u\n",
55262 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/platforms/pseries/xics.h powerpc.git/arch/powerpc/platforms/pseries/xics.h
55263 --- linux-2.6.24/arch/powerpc/platforms/pseries/xics.h  2008-01-24 23:58:37.000000000 +0100
55264 +++ powerpc.git/arch/powerpc/platforms/pseries/xics.h   2008-01-28 20:25:49.000000000 +0100
55265 @@ -21,9 +21,6 @@
55266  extern  void xics_request_IPIs(void);
55267  extern void xics_migrate_irqs_away(void);
55268  
55269 -/* first argument is ignored for now*/
55270 -void pSeriesLP_cppr_info(int n_cpu, u8 value);
55271 -
55272  struct xics_ipi_struct {
55273         volatile unsigned long value;
55274  } ____cacheline_aligned;
55275 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/sysdev/Kconfig powerpc.git/arch/powerpc/sysdev/Kconfig
55276 --- linux-2.6.24/arch/powerpc/sysdev/Kconfig    1970-01-01 01:00:00.000000000 +0100
55277 +++ powerpc.git/arch/powerpc/sysdev/Kconfig     2008-01-28 20:25:49.000000000 +0100
55278 @@ -0,0 +1,8 @@
55279 +# For a description of the syntax of this configuration file,
55280 +# see Documentation/kbuild/kconfig-language.txt.
55281 +#
55282 +
55283 +config PPC4xx_PCI_EXPRESS
55284 +       bool
55285 +       depends on PCI && 4xx
55286 +       default n
55287 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/sysdev/Makefile powerpc.git/arch/powerpc/sysdev/Makefile
55288 --- linux-2.6.24/arch/powerpc/sysdev/Makefile   2008-01-24 23:58:37.000000000 +0100
55289 +++ powerpc.git/arch/powerpc/sysdev/Makefile    2008-01-28 20:25:49.000000000 +0100
55290 @@ -2,7 +2,7 @@
55291  EXTRA_CFLAGS                   += -mno-minimal-toc
55292  endif
55293  
55294 -mpic-msi-obj-$(CONFIG_PCI_MSI) += mpic_msi.o mpic_u3msi.o
55295 +mpic-msi-obj-$(CONFIG_PCI_MSI) += mpic_msi.o mpic_u3msi.o mpic_pasemi_msi.o
55296  obj-$(CONFIG_MPIC)             += mpic.o $(mpic-msi-obj-y)
55297  
55298  obj-$(CONFIG_PPC_MPC106)       += grackle.o
55299 @@ -12,6 +12,7 @@
55300  obj-$(CONFIG_MMIO_NVRAM)       += mmio_nvram.o
55301  obj-$(CONFIG_FSL_SOC)          += fsl_soc.o
55302  obj-$(CONFIG_FSL_PCI)          += fsl_pci.o
55303 +obj-$(CONFIG_RAPIDIO)          += fsl_rio.o
55304  obj-$(CONFIG_TSI108_BRIDGE)    += tsi108_pci.o tsi108_dev.o
55305  obj-$(CONFIG_QUICC_ENGINE)     += qe_lib/
55306  obj-$(CONFIG_PPC_BESTCOMM)     += bestcomm/
55307 @@ -24,9 +25,13 @@
55308  ifeq ($(CONFIG_PPC_MERGE),y)
55309  obj-$(CONFIG_PPC_INDIRECT_PCI) += indirect_pci.o
55310  obj-$(CONFIG_PPC_I8259)                += i8259.o
55311 -obj-$(CONFIG_PPC_83xx)         += ipic.o
55312 +obj-$(CONFIG_IPIC)             += ipic.o
55313  obj-$(CONFIG_4xx)              += uic.o
55314  obj-$(CONFIG_XILINX_VIRTEX)    += xilinx_intc.o
55315 +obj-$(CONFIG_OF_RTC)           += of_rtc.o
55316 +ifeq ($(CONFIG_PCI),y)
55317 +obj-$(CONFIG_4xx)              += ppc4xx_pci.o
55318 +endif
55319  endif
55320  
55321  # Temporary hack until we have migrated to asm-powerpc
55322 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/sysdev/axonram.c powerpc.git/arch/powerpc/sysdev/axonram.c
55323 --- linux-2.6.24/arch/powerpc/sysdev/axonram.c  2008-01-24 23:58:37.000000000 +0100
55324 +++ powerpc.git/arch/powerpc/sysdev/axonram.c   2008-01-28 20:25:49.000000000 +0100
55325 @@ -42,8 +42,9 @@
55326  #include <linux/slab.h>
55327  #include <linux/string.h>
55328  #include <linux/types.h>
55329 -#include <asm/of_device.h>
55330 -#include <asm/of_platform.h>
55331 +#include <linux/of_device.h>
55332 +#include <linux/of_platform.h>
55333 +
55334  #include <asm/page.h>
55335  #include <asm/prom.h>
55336  
55337 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/sysdev/bestcomm/bestcomm.h powerpc.git/arch/powerpc/sysdev/bestcomm/bestcomm.h
55338 --- linux-2.6.24/arch/powerpc/sysdev/bestcomm/bestcomm.h        2008-01-24 23:58:37.000000000 +0100
55339 +++ powerpc.git/arch/powerpc/sysdev/bestcomm/bestcomm.h 2008-01-28 20:25:49.000000000 +0100
55340 @@ -20,7 +20,7 @@
55341  
55342  
55343  /* ======================================================================== */
55344 -/* Generic task managment                                                   */
55345 +/* Generic task management                                                   */
55346  /* ======================================================================== */
55347  
55348  /**
55349 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/sysdev/commproc.c powerpc.git/arch/powerpc/sysdev/commproc.c
55350 --- linux-2.6.24/arch/powerpc/sysdev/commproc.c 2008-01-24 23:58:37.000000000 +0100
55351 +++ powerpc.git/arch/powerpc/sysdev/commproc.c  2008-01-28 20:25:49.000000000 +0100
55352 @@ -240,6 +240,34 @@
55353  #endif
55354  }
55355  
55356 +static DEFINE_SPINLOCK(cmd_lock);
55357 +
55358 +#define MAX_CR_CMD_LOOPS        10000
55359 +
55360 +int cpm_command(u32 command, u8 opcode)
55361 +{
55362 +       int i, ret;
55363 +       unsigned long flags;
55364 +
55365 +       if (command & 0xffffff0f)
55366 +               return -EINVAL;
55367 +
55368 +       spin_lock_irqsave(&cmd_lock, flags);
55369 +
55370 +       ret = 0;
55371 +       out_be16(&cpmp->cp_cpcr, command | CPM_CR_FLG | (opcode << 8));
55372 +       for (i = 0; i < MAX_CR_CMD_LOOPS; i++)
55373 +               if ((in_be16(&cpmp->cp_cpcr) & CPM_CR_FLG) == 0)
55374 +                       goto out;
55375 +
55376 +       printk(KERN_ERR "%s(): Not able to issue CPM command\n", __FUNCTION__);
55377 +       ret = -EIO;
55378 +out:
55379 +       spin_unlock_irqrestore(&cmd_lock, flags);
55380 +       return ret;
55381 +}
55382 +EXPORT_SYMBOL(cpm_command);
55383 +
55384  /* We used to do this earlier, but have to postpone as long as possible
55385   * to ensure the kernel VM is now running.
55386   */
55387 @@ -408,7 +436,7 @@
55388  #endif /* !CONFIG_PPC_CPM_NEW_BINDING */
55389  
55390  struct cpm_ioport16 {
55391 -       __be16 dir, par, sor, dat, intr;
55392 +       __be16 dir, par, odr_sor, dat, intr;
55393         __be16 res[3];
55394  };
55395  
55396 @@ -438,6 +466,13 @@
55397         else
55398                 clrbits32(&iop->par, pin);
55399  
55400 +       if (port == CPM_PORTB) {
55401 +               if (flags & CPM_PIN_OPENDRAIN)
55402 +                       setbits16(&mpc8xx_immr->im_cpm.cp_pbodr, pin);
55403 +               else
55404 +                       clrbits16(&mpc8xx_immr->im_cpm.cp_pbodr, pin);
55405 +       }
55406 +
55407         if (port == CPM_PORTE) {
55408                 if (flags & CPM_PIN_SECONDARY)
55409                         setbits32(&iop->sor, pin);
55410 @@ -471,11 +506,17 @@
55411         else
55412                 clrbits16(&iop->par, pin);
55413  
55414 +       if (port == CPM_PORTA) {
55415 +               if (flags & CPM_PIN_OPENDRAIN)
55416 +                       setbits16(&iop->odr_sor, pin);
55417 +               else
55418 +                       clrbits16(&iop->odr_sor, pin);
55419 +       }
55420         if (port == CPM_PORTC) {
55421                 if (flags & CPM_PIN_SECONDARY)
55422 -                       setbits16(&iop->sor, pin);
55423 +                       setbits16(&iop->odr_sor, pin);
55424                 else
55425 -                       clrbits16(&iop->sor, pin);
55426 +                       clrbits16(&iop->odr_sor, pin);
55427         }
55428  }
55429  
55430 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/sysdev/cpm2_common.c powerpc.git/arch/powerpc/sysdev/cpm2_common.c
55431 --- linux-2.6.24/arch/powerpc/sysdev/cpm2_common.c      2008-01-24 23:58:37.000000000 +0100
55432 +++ powerpc.git/arch/powerpc/sysdev/cpm2_common.c       2008-01-28 20:25:49.000000000 +0100
55433 @@ -82,6 +82,31 @@
55434         cpmp = &cpm2_immr->im_cpm;
55435  }
55436  
55437 +static DEFINE_SPINLOCK(cmd_lock);
55438 +
55439 +#define MAX_CR_CMD_LOOPS        10000
55440 +
55441 +int cpm_command(u32 command, u8 opcode)
55442 +{
55443 +       int i, ret;
55444 +       unsigned long flags;
55445 +
55446 +       spin_lock_irqsave(&cmd_lock, flags);
55447 +
55448 +       ret = 0;
55449 +       out_be32(&cpmp->cp_cpcr, command | opcode | CPM_CR_FLG);
55450 +       for (i = 0; i < MAX_CR_CMD_LOOPS; i++)
55451 +               if ((in_be32(&cpmp->cp_cpcr) & CPM_CR_FLG) == 0)
55452 +                       goto out;
55453 +
55454 +       printk(KERN_ERR "%s(): Not able to issue CPM command\n", __FUNCTION__);
55455 +       ret = -EIO;
55456 +out:
55457 +       spin_unlock_irqrestore(&cmd_lock, flags);
55458 +       return ret;
55459 +}
55460 +EXPORT_SYMBOL(cpm_command);
55461 +
55462  /* Set a baud rate generator.  This needs lots of work.  There are
55463   * eight BRGs, which can be connected to the CPM channels or output
55464   * as clocks.  The BRGs are in two different block of internal
55465 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/sysdev/fsl_pci.c powerpc.git/arch/powerpc/sysdev/fsl_pci.c
55466 --- linux-2.6.24/arch/powerpc/sysdev/fsl_pci.c  2008-01-24 23:58:37.000000000 +0100
55467 +++ powerpc.git/arch/powerpc/sysdev/fsl_pci.c   2008-01-28 20:25:49.000000000 +0100
55468 @@ -33,8 +33,8 @@
55469         struct ccsr_pci __iomem *pci;
55470         int i;
55471  
55472 -       pr_debug("PCI memory map start 0x%x, size 0x%x\n", rsrc->start,
55473 -                       rsrc->end - rsrc->start + 1);
55474 +       pr_debug("PCI memory map start 0x%016llx, size 0x%016llx\n",
55475 +                   (u64)rsrc->start, (u64)rsrc->end - (u64)rsrc->start + 1);
55476         pci = ioremap(rsrc->start, rsrc->end - rsrc->start + 1);
55477  
55478         /* Disable all windows (except powar0 since its ignored) */
55479 @@ -46,17 +46,17 @@
55480         /* Setup outbound MEM window */
55481         for(i = 0; i < 3; i++)
55482                 if (hose->mem_resources[i].flags & IORESOURCE_MEM){
55483 -                       pr_debug("PCI MEM resource start 0x%08x, size 0x%08x.\n",
55484 -                               hose->mem_resources[i].start,
55485 -                               hose->mem_resources[i].end
55486 -                                 - hose->mem_resources[i].start + 1);
55487 -                       out_be32(&pci->pow[i+1].potar,
55488 -                               (hose->mem_resources[i].start >> 12)
55489 -                               & 0x000fffff);
55490 +                       resource_size_t pci_addr_start =
55491 +                                hose->mem_resources[i].start -
55492 +                                hose->pci_mem_offset;
55493 +                       pr_debug("PCI MEM resource start 0x%016llx, size 0x%016llx.\n",
55494 +                               (u64)hose->mem_resources[i].start,
55495 +                               (u64)hose->mem_resources[i].end
55496 +                                 - (u64)hose->mem_resources[i].start + 1);
55497 +                       out_be32(&pci->pow[i+1].potar, (pci_addr_start >> 12));
55498                         out_be32(&pci->pow[i+1].potear, 0);
55499                         out_be32(&pci->pow[i+1].powbar,
55500 -                               (hose->mem_resources[i].start >> 12)
55501 -                               & 0x000fffff);
55502 +                               (hose->mem_resources[i].start >> 12));
55503                         /* Enable, Mem R/W */
55504                         out_be32(&pci->pow[i+1].powar, 0x80044000
55505                                 | (__ilog2(hose->mem_resources[i].end
55506 @@ -65,15 +65,14 @@
55507  
55508         /* Setup outbound IO window */
55509         if (hose->io_resource.flags & IORESOURCE_IO){
55510 -               pr_debug("PCI IO resource start 0x%08x, size 0x%08x, phy base 0x%08x.\n",
55511 -                       hose->io_resource.start,
55512 -                       hose->io_resource.end - hose->io_resource.start + 1,
55513 -                       hose->io_base_phys);
55514 -               out_be32(&pci->pow[i+1].potar, (hose->io_resource.start >> 12)
55515 -                               & 0x000fffff);
55516 +               pr_debug("PCI IO resource start 0x%016llx, size 0x%016llx, "
55517 +                        "phy base 0x%016llx.\n",
55518 +                       (u64)hose->io_resource.start,
55519 +                       (u64)hose->io_resource.end - (u64)hose->io_resource.start + 1,
55520 +                       (u64)hose->io_base_phys);
55521 +               out_be32(&pci->pow[i+1].potar, (hose->io_resource.start >> 12));
55522                 out_be32(&pci->pow[i+1].potear, 0);
55523 -               out_be32(&pci->pow[i+1].powbar, (hose->io_base_phys >> 12)
55524 -                               & 0x000fffff);
55525 +               out_be32(&pci->pow[i+1].powbar, (hose->io_base_phys >> 12));
55526                 /* Enable, IO R/W */
55527                 out_be32(&pci->pow[i+1].powar, 0x80088000
55528                         | (__ilog2(hose->io_resource.end
55529 @@ -107,55 +106,17 @@
55530         }
55531  }
55532  
55533 -static void __init quirk_fsl_pcie_transparent(struct pci_dev *dev)
55534 -{
55535 -       struct resource *res;
55536 -       int i, res_idx = PCI_BRIDGE_RESOURCES;
55537 -       struct pci_controller *hose;
55538 +static int fsl_pcie_bus_fixup;
55539  
55540 +static void __init quirk_fsl_pcie_header(struct pci_dev *dev)
55541 +{
55542         /* if we aren't a PCIe don't bother */
55543         if (!pci_find_capability(dev, PCI_CAP_ID_EXP))
55544                 return ;
55545  
55546 -       /*
55547 -        * Make the bridge be transparent.
55548 -        */
55549 -       dev->transparent = 1;
55550 -
55551 -       hose = pci_bus_to_host(dev->bus);
55552 -       if (!hose) {
55553 -               printk(KERN_ERR "Can't find hose for bus %d\n",
55554 -                      dev->bus->number);
55555 -               return;
55556 -       }
55557 -
55558 -       /* Clear out any of the virtual P2P bridge registers */
55559 -       pci_write_config_word(dev, PCI_IO_BASE_UPPER16, 0);
55560 -       pci_write_config_word(dev, PCI_IO_LIMIT_UPPER16, 0);
55561 -       pci_write_config_byte(dev, PCI_IO_BASE, 0x10);
55562 -       pci_write_config_byte(dev, PCI_IO_LIMIT, 0);
55563 -       pci_write_config_word(dev, PCI_MEMORY_BASE, 0x10);
55564 -       pci_write_config_word(dev, PCI_MEMORY_LIMIT, 0);
55565 -       pci_write_config_word(dev, PCI_PREF_BASE_UPPER32, 0x0);
55566 -       pci_write_config_word(dev, PCI_PREF_LIMIT_UPPER32, 0x0);
55567 -       pci_write_config_word(dev, PCI_PREF_MEMORY_BASE, 0x10);
55568 -       pci_write_config_word(dev, PCI_PREF_MEMORY_LIMIT, 0);
55569 -
55570 -       if (hose->io_resource.flags) {
55571 -               res = &dev->resource[res_idx++];
55572 -               res->start = hose->io_resource.start;
55573 -               res->end = hose->io_resource.end;
55574 -               res->flags = hose->io_resource.flags;
55575 -               update_bridge_resource(dev, res);
55576 -       }
55577 -
55578 -       for (i = 0; i < 3; i++) {
55579 -               res = &dev->resource[res_idx + i];
55580 -               res->start = hose->mem_resources[i].start;
55581 -               res->end = hose->mem_resources[i].end;
55582 -               res->flags = hose->mem_resources[i].flags;
55583 -               update_bridge_resource(dev, res);
55584 -       }
55585 +       dev->class = PCI_CLASS_BRIDGE_PCI << 8;
55586 +       fsl_pcie_bus_fixup = 1;
55587 +       return ;
55588  }
55589  
55590  int __init fsl_pcie_check_link(struct pci_controller *hose)
55591 @@ -172,11 +133,24 @@
55592         struct pci_controller *hose = (struct pci_controller *) bus->sysdata;
55593         int i;
55594  
55595 -       /* deal with bogus pci_bus when we don't have anything connected on PCIe */
55596 -       if (hose->indirect_type & PPC_INDIRECT_TYPE_NO_PCIE_LINK) {
55597 -               if (bus->parent) {
55598 -                       for (i = 0; i < 4; ++i)
55599 -                               bus->resource[i] = bus->parent->resource[i];
55600 +       if ((bus->parent == hose->bus) &&
55601 +           ((fsl_pcie_bus_fixup &&
55602 +             early_find_capability(hose, 0, 0, PCI_CAP_ID_EXP)) ||
55603 +            (hose->indirect_type & PPC_INDIRECT_TYPE_NO_PCIE_LINK)))
55604 +       {
55605 +               for (i = 0; i < 4; ++i) {
55606 +                       struct resource *res = bus->resource[i];
55607 +                       struct resource *par = bus->parent->resource[i];
55608 +                       if (res) {
55609 +                               res->start = 0;
55610 +                               res->end   = 0;
55611 +                               res->flags = 0;
55612 +                       }
55613 +                       if (res && par) {
55614 +                               res->start = par->start;
55615 +                               res->end   = par->end;
55616 +                               res->flags = par->flags;
55617 +                       }
55618                 }
55619         }
55620  }
55621 @@ -202,7 +176,7 @@
55622                 printk(KERN_WARNING "Can't get bus-range for %s, assume"
55623                         " bus 0\n", dev->full_name);
55624  
55625 -       pci_assign_all_buses = 1;
55626 +       ppc_pci_flags |= PPC_PCI_REASSIGN_ALL_BUS;
55627         hose = pcibios_alloc_controller(dev);
55628         if (!hose)
55629                 return -ENOMEM;
55630 @@ -222,7 +196,7 @@
55631                         hose->indirect_type |= PPC_INDIRECT_TYPE_NO_PCIE_LINK;
55632         }
55633  
55634 -       printk(KERN_INFO "Found FSL PCI host bridge at 0x%016llx."
55635 +       printk(KERN_INFO "Found FSL PCI host bridge at 0x%016llx. "
55636                 "Firmware bus number: %d->%d\n",
55637                 (unsigned long long)rsrc.start, hose->first_busno,
55638                 hose->last_busno);
55639 @@ -240,23 +214,23 @@
55640         return 0;
55641  }
55642  
55643 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8548E, quirk_fsl_pcie_transparent);
55644 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8548, quirk_fsl_pcie_transparent);
55645 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8543E, quirk_fsl_pcie_transparent);
55646 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8543, quirk_fsl_pcie_transparent);
55647 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8547E, quirk_fsl_pcie_transparent);
55648 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8545E, quirk_fsl_pcie_transparent);
55649 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8545, quirk_fsl_pcie_transparent);
55650 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8568E, quirk_fsl_pcie_transparent);
55651 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8568, quirk_fsl_pcie_transparent);
55652 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8567E, quirk_fsl_pcie_transparent);
55653 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8567, quirk_fsl_pcie_transparent);
55654 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8533E, quirk_fsl_pcie_transparent);
55655 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8533, quirk_fsl_pcie_transparent);
55656 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8544E, quirk_fsl_pcie_transparent);
55657 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8544, quirk_fsl_pcie_transparent);
55658 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8572E, quirk_fsl_pcie_transparent);
55659 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8572, quirk_fsl_pcie_transparent);
55660 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8641, quirk_fsl_pcie_transparent);
55661 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8641D, quirk_fsl_pcie_transparent);
55662 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8610, quirk_fsl_pcie_transparent);
55663 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8548E, quirk_fsl_pcie_header);
55664 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8548, quirk_fsl_pcie_header);
55665 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8543E, quirk_fsl_pcie_header);
55666 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8543, quirk_fsl_pcie_header);
55667 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8547E, quirk_fsl_pcie_header);
55668 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8545E, quirk_fsl_pcie_header);
55669 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8545, quirk_fsl_pcie_header);
55670 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8568E, quirk_fsl_pcie_header);
55671 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8568, quirk_fsl_pcie_header);
55672 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8567E, quirk_fsl_pcie_header);
55673 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8567, quirk_fsl_pcie_header);
55674 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8533E, quirk_fsl_pcie_header);
55675 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8533, quirk_fsl_pcie_header);
55676 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8544E, quirk_fsl_pcie_header);
55677 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8544, quirk_fsl_pcie_header);
55678 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8572E, quirk_fsl_pcie_header);
55679 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8572, quirk_fsl_pcie_header);
55680 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8641, quirk_fsl_pcie_header);
55681 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8641D, quirk_fsl_pcie_header);
55682 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8610, quirk_fsl_pcie_header);
55683 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/sysdev/fsl_rio.c powerpc.git/arch/powerpc/sysdev/fsl_rio.c
55684 --- linux-2.6.24/arch/powerpc/sysdev/fsl_rio.c  1970-01-01 01:00:00.000000000 +0100
55685 +++ powerpc.git/arch/powerpc/sysdev/fsl_rio.c   2008-01-28 20:25:49.000000000 +0100
55686 @@ -0,0 +1,932 @@
55687 +/*
55688 + * MPC85xx RapidIO support
55689 + *
55690 + * Copyright 2005 MontaVista Software, Inc.
55691 + * Matt Porter <mporter@kernel.crashing.org>
55692 + *
55693 + * This program is free software; you can redistribute  it and/or modify it
55694 + * under  the terms of  the GNU General  Public License as published by the
55695 + * Free Software Foundation;  either version 2 of the  License, or (at your
55696 + * option) any later version.
55697 + */
55698 +
55699 +#include <linux/init.h>
55700 +#include <linux/module.h>
55701 +#include <linux/types.h>
55702 +#include <linux/dma-mapping.h>
55703 +#include <linux/interrupt.h>
55704 +#include <linux/rio.h>
55705 +#include <linux/rio_drv.h>
55706 +
55707 +#include <asm/io.h>
55708 +
55709 +#define RIO_REGS_BASE          (CCSRBAR + 0xc0000)
55710 +#define RIO_ATMU_REGS_OFFSET   0x10c00
55711 +#define RIO_MSG_REGS_OFFSET    0x11000
55712 +#define RIO_MAINT_WIN_SIZE     0x400000
55713 +#define RIO_DBELL_WIN_SIZE     0x1000
55714 +
55715 +#define RIO_MSG_OMR_MUI                0x00000002
55716 +#define RIO_MSG_OSR_TE         0x00000080
55717 +#define RIO_MSG_OSR_QOI                0x00000020
55718 +#define RIO_MSG_OSR_QFI                0x00000010
55719 +#define RIO_MSG_OSR_MUB                0x00000004
55720 +#define RIO_MSG_OSR_EOMI       0x00000002
55721 +#define RIO_MSG_OSR_QEI                0x00000001
55722 +
55723 +#define RIO_MSG_IMR_MI         0x00000002
55724 +#define RIO_MSG_ISR_TE         0x00000080
55725 +#define RIO_MSG_ISR_QFI                0x00000010
55726 +#define RIO_MSG_ISR_DIQI       0x00000001
55727 +
55728 +#define RIO_MSG_DESC_SIZE      32
55729 +#define RIO_MSG_BUFFER_SIZE    4096
55730 +#define RIO_MIN_TX_RING_SIZE   2
55731 +#define RIO_MAX_TX_RING_SIZE   2048
55732 +#define RIO_MIN_RX_RING_SIZE   2
55733 +#define RIO_MAX_RX_RING_SIZE   2048
55734 +
55735 +#define DOORBELL_DMR_DI                0x00000002
55736 +#define DOORBELL_DSR_TE                0x00000080
55737 +#define DOORBELL_DSR_QFI       0x00000010
55738 +#define DOORBELL_DSR_DIQI      0x00000001
55739 +#define DOORBELL_TID_OFFSET    0x03
55740 +#define DOORBELL_SID_OFFSET    0x05
55741 +#define DOORBELL_INFO_OFFSET   0x06
55742 +
55743 +#define DOORBELL_MESSAGE_SIZE  0x08
55744 +#define DBELL_SID(x)           (*(u8 *)(x + DOORBELL_SID_OFFSET))
55745 +#define DBELL_TID(x)           (*(u8 *)(x + DOORBELL_TID_OFFSET))
55746 +#define DBELL_INF(x)           (*(u16 *)(x + DOORBELL_INFO_OFFSET))
55747 +
55748 +struct rio_atmu_regs {
55749 +       u32 rowtar;
55750 +       u32 pad1;
55751 +       u32 rowbar;
55752 +       u32 pad2;
55753 +       u32 rowar;
55754 +       u32 pad3[3];
55755 +};
55756 +
55757 +struct rio_msg_regs {
55758 +       u32 omr;
55759 +       u32 osr;
55760 +       u32 pad1;
55761 +       u32 odqdpar;
55762 +       u32 pad2;
55763 +       u32 osar;
55764 +       u32 odpr;
55765 +       u32 odatr;
55766 +       u32 odcr;
55767 +       u32 pad3;
55768 +       u32 odqepar;
55769 +       u32 pad4[13];
55770 +       u32 imr;
55771 +       u32 isr;
55772 +       u32 pad5;
55773 +       u32 ifqdpar;
55774 +       u32 pad6;
55775 +       u32 ifqepar;
55776 +       u32 pad7[250];
55777 +       u32 dmr;
55778 +       u32 dsr;
55779 +       u32 pad8;
55780 +       u32 dqdpar;
55781 +       u32 pad9;
55782 +       u32 dqepar;
55783 +       u32 pad10[26];
55784 +       u32 pwmr;
55785 +       u32 pwsr;
55786 +       u32 pad11;
55787 +       u32 pwqbar;
55788 +};
55789 +
55790 +struct rio_tx_desc {
55791 +       u32 res1;
55792 +       u32 saddr;
55793 +       u32 dport;
55794 +       u32 dattr;
55795 +       u32 res2;
55796 +       u32 res3;
55797 +       u32 dwcnt;
55798 +       u32 res4;
55799 +};
55800 +
55801 +static u32 regs_win;
55802 +static struct rio_atmu_regs *atmu_regs;
55803 +static struct rio_atmu_regs *maint_atmu_regs;
55804 +static struct rio_atmu_regs *dbell_atmu_regs;
55805 +static u32 dbell_win;
55806 +static u32 maint_win;
55807 +static struct rio_msg_regs *msg_regs;
55808 +
55809 +static struct rio_dbell_ring {
55810 +       void *virt;
55811 +       dma_addr_t phys;
55812 +} dbell_ring;
55813 +
55814 +static struct rio_msg_tx_ring {
55815 +       void *virt;
55816 +       dma_addr_t phys;
55817 +       void *virt_buffer[RIO_MAX_TX_RING_SIZE];
55818 +       dma_addr_t phys_buffer[RIO_MAX_TX_RING_SIZE];
55819 +       int tx_slot;
55820 +       int size;
55821 +       void *dev_id;
55822 +} msg_tx_ring;
55823 +
55824 +static struct rio_msg_rx_ring {
55825 +       void *virt;
55826 +       dma_addr_t phys;
55827 +       void *virt_buffer[RIO_MAX_RX_RING_SIZE];
55828 +       int rx_slot;
55829 +       int size;
55830 +       void *dev_id;
55831 +} msg_rx_ring;
55832 +
55833 +/**
55834 + * mpc85xx_rio_doorbell_send - Send a MPC85xx doorbell message
55835 + * @index: ID of RapidIO interface
55836 + * @destid: Destination ID of target device
55837 + * @data: 16-bit info field of RapidIO doorbell message
55838 + *
55839 + * Sends a MPC85xx doorbell message. Returns %0 on success or
55840 + * %-EINVAL on failure.
55841 + */
55842 +static int mpc85xx_rio_doorbell_send(int index, u16 destid, u16 data)
55843 +{
55844 +       pr_debug("mpc85xx_doorbell_send: index %d destid %4.4x data %4.4x\n",
55845 +                index, destid, data);
55846 +       out_be32((void *)&dbell_atmu_regs->rowtar, destid << 22);
55847 +       out_be16((void *)(dbell_win), data);
55848 +
55849 +       return 0;
55850 +}
55851 +
55852 +/**
55853 + * mpc85xx_local_config_read - Generate a MPC85xx local config space read
55854 + * @index: ID of RapdiIO interface
55855 + * @offset: Offset into configuration space
55856 + * @len: Length (in bytes) of the maintenance transaction
55857 + * @data: Value to be read into
55858 + *
55859 + * Generates a MPC85xx local configuration space read. Returns %0 on
55860 + * success or %-EINVAL on failure.
55861 + */
55862 +static int mpc85xx_local_config_read(int index, u32 offset, int len, u32 * data)
55863 +{
55864 +       pr_debug("mpc85xx_local_config_read: index %d offset %8.8x\n", index,
55865 +                offset);
55866 +       *data = in_be32((void *)(regs_win + offset));
55867 +
55868 +       return 0;
55869 +}
55870 +
55871 +/**
55872 + * mpc85xx_local_config_write - Generate a MPC85xx local config space write
55873 + * @index: ID of RapdiIO interface
55874 + * @offset: Offset into configuration space
55875 + * @len: Length (in bytes) of the maintenance transaction
55876 + * @data: Value to be written
55877 + *
55878 + * Generates a MPC85xx local configuration space write. Returns %0 on
55879 + * success or %-EINVAL on failure.
55880 + */
55881 +static int mpc85xx_local_config_write(int index, u32 offset, int len, u32 data)
55882 +{
55883 +       pr_debug
55884 +           ("mpc85xx_local_config_write: index %d offset %8.8x data %8.8x\n",
55885 +            index, offset, data);
55886 +       out_be32((void *)(regs_win + offset), data);
55887 +
55888 +       return 0;
55889 +}
55890 +
55891 +/**
55892 + * mpc85xx_rio_config_read - Generate a MPC85xx read maintenance transaction
55893 + * @index: ID of RapdiIO interface
55894 + * @destid: Destination ID of transaction
55895 + * @hopcount: Number of hops to target device
55896 + * @offset: Offset into configuration space
55897 + * @len: Length (in bytes) of the maintenance transaction
55898 + * @val: Location to be read into
55899 + *
55900 + * Generates a MPC85xx read maintenance transaction. Returns %0 on
55901 + * success or %-EINVAL on failure.
55902 + */
55903 +static int
55904 +mpc85xx_rio_config_read(int index, u16 destid, u8 hopcount, u32 offset, int len,
55905 +                       u32 * val)
55906 +{
55907 +       u8 *data;
55908 +
55909 +       pr_debug
55910 +           ("mpc85xx_rio_config_read: index %d destid %d hopcount %d offset %8.8x len %d\n",
55911 +            index, destid, hopcount, offset, len);
55912 +       out_be32((void *)&maint_atmu_regs->rowtar,
55913 +                (destid << 22) | (hopcount << 12) | ((offset & ~0x3) >> 9));
55914 +
55915 +       data = (u8 *) maint_win + offset;
55916 +       switch (len) {
55917 +       case 1:
55918 +               *val = in_8((u8 *) data);
55919 +               break;
55920 +       case 2:
55921 +               *val = in_be16((u16 *) data);
55922 +               break;
55923 +       default:
55924 +               *val = in_be32((u32 *) data);
55925 +               break;
55926 +       }
55927 +
55928 +       return 0;
55929 +}
55930 +
55931 +/**
55932 + * mpc85xx_rio_config_write - Generate a MPC85xx write maintenance transaction
55933 + * @index: ID of RapdiIO interface
55934 + * @destid: Destination ID of transaction
55935 + * @hopcount: Number of hops to target device
55936 + * @offset: Offset into configuration space
55937 + * @len: Length (in bytes) of the maintenance transaction
55938 + * @val: Value to be written
55939 + *
55940 + * Generates an MPC85xx write maintenance transaction. Returns %0 on
55941 + * success or %-EINVAL on failure.
55942 + */
55943 +static int
55944 +mpc85xx_rio_config_write(int index, u16 destid, u8 hopcount, u32 offset,
55945 +                        int len, u32 val)
55946 +{
55947 +       u8 *data;
55948 +       pr_debug
55949 +           ("mpc85xx_rio_config_write: index %d destid %d hopcount %d offset %8.8x len %d val %8.8x\n",
55950 +            index, destid, hopcount, offset, len, val);
55951 +       out_be32((void *)&maint_atmu_regs->rowtar,
55952 +                (destid << 22) | (hopcount << 12) | ((offset & ~0x3) >> 9));
55953 +
55954 +       data = (u8 *) maint_win + offset;
55955 +       switch (len) {
55956 +       case 1:
55957 +               out_8((u8 *) data, val);
55958 +               break;
55959 +       case 2:
55960 +               out_be16((u16 *) data, val);
55961 +               break;
55962 +       default:
55963 +               out_be32((u32 *) data, val);
55964 +               break;
55965 +       }
55966 +
55967 +       return 0;
55968 +}
55969 +
55970 +/**
55971 + * rio_hw_add_outb_message - Add message to the MPC85xx outbound message queue
55972 + * @mport: Master port with outbound message queue
55973 + * @rdev: Target of outbound message
55974 + * @mbox: Outbound mailbox
55975 + * @buffer: Message to add to outbound queue
55976 + * @len: Length of message
55977 + *
55978 + * Adds the @buffer message to the MPC85xx outbound message queue. Returns
55979 + * %0 on success or %-EINVAL on failure.
55980 + */
55981 +int
55982 +rio_hw_add_outb_message(struct rio_mport *mport, struct rio_dev *rdev, int mbox,
55983 +                       void *buffer, size_t len)
55984 +{
55985 +       u32 omr;
55986 +       struct rio_tx_desc *desc =
55987 +           (struct rio_tx_desc *)msg_tx_ring.virt + msg_tx_ring.tx_slot;
55988 +       int ret = 0;
55989 +
55990 +       pr_debug
55991 +           ("RIO: rio_hw_add_outb_message(): destid %4.4x mbox %d buffer %8.8x len %8.8x\n",
55992 +            rdev->destid, mbox, (int)buffer, len);
55993 +
55994 +       if ((len < 8) || (len > RIO_MAX_MSG_SIZE)) {
55995 +               ret = -EINVAL;
55996 +               goto out;
55997 +       }
55998 +
55999 +       /* Copy and clear rest of buffer */
56000 +       memcpy(msg_tx_ring.virt_buffer[msg_tx_ring.tx_slot], buffer, len);
56001 +       if (len < (RIO_MAX_MSG_SIZE - 4))
56002 +               memset((void *)((u32) msg_tx_ring.
56003 +                               virt_buffer[msg_tx_ring.tx_slot] + len), 0,
56004 +                      RIO_MAX_MSG_SIZE - len);
56005 +
56006 +       /* Set mbox field for message */
56007 +       desc->dport = mbox & 0x3;
56008 +
56009 +       /* Enable EOMI interrupt, set priority, and set destid */
56010 +       desc->dattr = 0x28000000 | (rdev->destid << 2);
56011 +
56012 +       /* Set transfer size aligned to next power of 2 (in double words) */
56013 +       desc->dwcnt = is_power_of_2(len) ? len : 1 << get_bitmask_order(len);
56014 +
56015 +       /* Set snooping and source buffer address */
56016 +       desc->saddr = 0x00000004 | msg_tx_ring.phys_buffer[msg_tx_ring.tx_slot];
56017 +
56018 +       /* Increment enqueue pointer */
56019 +       omr = in_be32((void *)&msg_regs->omr);
56020 +       out_be32((void *)&msg_regs->omr, omr | RIO_MSG_OMR_MUI);
56021 +
56022 +       /* Go to next descriptor */
56023 +       if (++msg_tx_ring.tx_slot == msg_tx_ring.size)
56024 +               msg_tx_ring.tx_slot = 0;
56025 +
56026 +      out:
56027 +       return ret;
56028 +}
56029 +
56030 +EXPORT_SYMBOL_GPL(rio_hw_add_outb_message);
56031 +
56032 +/**
56033 + * mpc85xx_rio_tx_handler - MPC85xx outbound message interrupt handler
56034 + * @irq: Linux interrupt number
56035 + * @dev_instance: Pointer to interrupt-specific data
56036 + *
56037 + * Handles outbound message interrupts. Executes a register outbound
56038 + * mailbox event handler and acks the interrupt occurrence.
56039 + */
56040 +static irqreturn_t
56041 +mpc85xx_rio_tx_handler(int irq, void *dev_instance)
56042 +{
56043 +       int osr;
56044 +       struct rio_mport *port = (struct rio_mport *)dev_instance;
56045 +
56046 +       osr = in_be32((void *)&msg_regs->osr);
56047 +
56048 +       if (osr & RIO_MSG_OSR_TE) {
56049 +               pr_info("RIO: outbound message transmission error\n");
56050 +               out_be32((void *)&msg_regs->osr, RIO_MSG_OSR_TE);
56051 +               goto out;
56052 +       }
56053 +
56054 +       if (osr & RIO_MSG_OSR_QOI) {
56055 +               pr_info("RIO: outbound message queue overflow\n");
56056 +               out_be32((void *)&msg_regs->osr, RIO_MSG_OSR_QOI);
56057 +               goto out;
56058 +       }
56059 +
56060 +       if (osr & RIO_MSG_OSR_EOMI) {
56061 +               u32 dqp = in_be32((void *)&msg_regs->odqdpar);
56062 +               int slot = (dqp - msg_tx_ring.phys) >> 5;
56063 +               port->outb_msg[0].mcback(port, msg_tx_ring.dev_id, -1, slot);
56064 +
56065 +               /* Ack the end-of-message interrupt */
56066 +               out_be32((void *)&msg_regs->osr, RIO_MSG_OSR_EOMI);
56067 +       }
56068 +
56069 +      out:
56070 +       return IRQ_HANDLED;
56071 +}
56072 +
56073 +/**
56074 + * rio_open_outb_mbox - Initialize MPC85xx outbound mailbox
56075 + * @mport: Master port implementing the outbound message unit
56076 + * @dev_id: Device specific pointer to pass on event
56077 + * @mbox: Mailbox to open
56078 + * @entries: Number of entries in the outbound mailbox ring
56079 + *
56080 + * Initializes buffer ring, request the outbound message interrupt,
56081 + * and enables the outbound message unit. Returns %0 on success and
56082 + * %-EINVAL or %-ENOMEM on failure.
56083 + */
56084 +int rio_open_outb_mbox(struct rio_mport *mport, void *dev_id, int mbox, int entries)
56085 +{
56086 +       int i, j, rc = 0;
56087 +
56088 +       if ((entries < RIO_MIN_TX_RING_SIZE) ||
56089 +           (entries > RIO_MAX_TX_RING_SIZE) || (!is_power_of_2(entries))) {
56090 +               rc = -EINVAL;
56091 +               goto out;
56092 +       }
56093 +
56094 +       /* Initialize shadow copy ring */
56095 +       msg_tx_ring.dev_id = dev_id;
56096 +       msg_tx_ring.size = entries;
56097 +
56098 +       for (i = 0; i < msg_tx_ring.size; i++) {
56099 +               if (!
56100 +                   (msg_tx_ring.virt_buffer[i] =
56101 +                    dma_alloc_coherent(NULL, RIO_MSG_BUFFER_SIZE,
56102 +                                       &msg_tx_ring.phys_buffer[i],
56103 +                                       GFP_KERNEL))) {
56104 +                       rc = -ENOMEM;
56105 +                       for (j = 0; j < msg_tx_ring.size; j++)
56106 +                               if (msg_tx_ring.virt_buffer[j])
56107 +                                       dma_free_coherent(NULL,
56108 +                                                         RIO_MSG_BUFFER_SIZE,
56109 +                                                         msg_tx_ring.
56110 +                                                         virt_buffer[j],
56111 +                                                         msg_tx_ring.
56112 +                                                         phys_buffer[j]);
56113 +                       goto out;
56114 +               }
56115 +       }
56116 +
56117 +       /* Initialize outbound message descriptor ring */
56118 +       if (!(msg_tx_ring.virt = dma_alloc_coherent(NULL,
56119 +                                                   msg_tx_ring.size *
56120 +                                                   RIO_MSG_DESC_SIZE,
56121 +                                                   &msg_tx_ring.phys,
56122 +                                                   GFP_KERNEL))) {
56123 +               rc = -ENOMEM;
56124 +               goto out_dma;
56125 +       }
56126 +       memset(msg_tx_ring.virt, 0, msg_tx_ring.size * RIO_MSG_DESC_SIZE);
56127 +       msg_tx_ring.tx_slot = 0;
56128 +
56129 +       /* Point dequeue/enqueue pointers at first entry in ring */
56130 +       out_be32((void *)&msg_regs->odqdpar, msg_tx_ring.phys);
56131 +       out_be32((void *)&msg_regs->odqepar, msg_tx_ring.phys);
56132 +
56133 +       /* Configure for snooping */
56134 +       out_be32((void *)&msg_regs->osar, 0x00000004);
56135 +
56136 +       /* Clear interrupt status */
56137 +       out_be32((void *)&msg_regs->osr, 0x000000b3);
56138 +
56139 +       /* Hook up outbound message handler */
56140 +       if ((rc =
56141 +            request_irq(MPC85xx_IRQ_RIO_TX, mpc85xx_rio_tx_handler, 0,
56142 +                        "msg_tx", (void *)mport)) < 0)
56143 +               goto out_irq;
56144 +
56145 +       /*
56146 +        * Configure outbound message unit
56147 +        *      Snooping
56148 +        *      Interrupts (all enabled, except QEIE)
56149 +        *      Chaining mode
56150 +        *      Disable
56151 +        */
56152 +       out_be32((void *)&msg_regs->omr, 0x00100220);
56153 +
56154 +       /* Set number of entries */
56155 +       out_be32((void *)&msg_regs->omr,
56156 +                in_be32((void *)&msg_regs->omr) |
56157 +                ((get_bitmask_order(entries) - 2) << 12));
56158 +
56159 +       /* Now enable the unit */
56160 +       out_be32((void *)&msg_regs->omr, in_be32((void *)&msg_regs->omr) | 0x1);
56161 +
56162 +      out:
56163 +       return rc;
56164 +
56165 +      out_irq:
56166 +       dma_free_coherent(NULL, msg_tx_ring.size * RIO_MSG_DESC_SIZE,
56167 +                         msg_tx_ring.virt, msg_tx_ring.phys);
56168 +
56169 +      out_dma:
56170 +       for (i = 0; i < msg_tx_ring.size; i++)
56171 +               dma_free_coherent(NULL, RIO_MSG_BUFFER_SIZE,
56172 +                                 msg_tx_ring.virt_buffer[i],
56173 +                                 msg_tx_ring.phys_buffer[i]);
56174 +
56175 +       return rc;
56176 +}
56177 +
56178 +/**
56179 + * rio_close_outb_mbox - Shut down MPC85xx outbound mailbox
56180 + * @mport: Master port implementing the outbound message unit
56181 + * @mbox: Mailbox to close
56182 + *
56183 + * Disables the outbound message unit, free all buffers, and
56184 + * frees the outbound message interrupt.
56185 + */
56186 +void rio_close_outb_mbox(struct rio_mport *mport, int mbox)
56187 +{
56188 +       /* Disable inbound message unit */
56189 +       out_be32((void *)&msg_regs->omr, 0);
56190 +
56191 +       /* Free ring */
56192 +       dma_free_coherent(NULL, msg_tx_ring.size * RIO_MSG_DESC_SIZE,
56193 +                         msg_tx_ring.virt, msg_tx_ring.phys);
56194 +
56195 +       /* Free interrupt */
56196 +       free_irq(MPC85xx_IRQ_RIO_TX, (void *)mport);
56197 +}
56198 +
56199 +/**
56200 + * mpc85xx_rio_rx_handler - MPC85xx inbound message interrupt handler
56201 + * @irq: Linux interrupt number
56202 + * @dev_instance: Pointer to interrupt-specific data
56203 + *
56204 + * Handles inbound message interrupts. Executes a registered inbound
56205 + * mailbox event handler and acks the interrupt occurrence.
56206 + */
56207 +static irqreturn_t
56208 +mpc85xx_rio_rx_handler(int irq, void *dev_instance)
56209 +{
56210 +       int isr;
56211 +       struct rio_mport *port = (struct rio_mport *)dev_instance;
56212 +
56213 +       isr = in_be32((void *)&msg_regs->isr);
56214 +
56215 +       if (isr & RIO_MSG_ISR_TE) {
56216 +               pr_info("RIO: inbound message reception error\n");
56217 +               out_be32((void *)&msg_regs->isr, RIO_MSG_ISR_TE);
56218 +               goto out;
56219 +       }
56220 +
56221 +       /* XXX Need to check/dispatch until queue empty */
56222 +       if (isr & RIO_MSG_ISR_DIQI) {
56223 +               /*
56224 +                * We implement *only* mailbox 0, but can receive messages
56225 +                * for any mailbox/letter to that mailbox destination. So,
56226 +                * make the callback with an unknown/invalid mailbox number
56227 +                * argument.
56228 +                */
56229 +               port->inb_msg[0].mcback(port, msg_rx_ring.dev_id, -1, -1);
56230 +
56231 +               /* Ack the queueing interrupt */
56232 +               out_be32((void *)&msg_regs->isr, RIO_MSG_ISR_DIQI);
56233 +       }
56234 +
56235 +      out:
56236 +       return IRQ_HANDLED;
56237 +}
56238 +
56239 +/**
56240 + * rio_open_inb_mbox - Initialize MPC85xx inbound mailbox
56241 + * @mport: Master port implementing the inbound message unit
56242 + * @dev_id: Device specific pointer to pass on event
56243 + * @mbox: Mailbox to open
56244 + * @entries: Number of entries in the inbound mailbox ring
56245 + *
56246 + * Initializes buffer ring, request the inbound message interrupt,
56247 + * and enables the inbound message unit. Returns %0 on success
56248 + * and %-EINVAL or %-ENOMEM on failure.
56249 + */
56250 +int rio_open_inb_mbox(struct rio_mport *mport, void *dev_id, int mbox, int entries)
56251 +{
56252 +       int i, rc = 0;
56253 +
56254 +       if ((entries < RIO_MIN_RX_RING_SIZE) ||
56255 +           (entries > RIO_MAX_RX_RING_SIZE) || (!is_power_of_2(entries))) {
56256 +               rc = -EINVAL;
56257 +               goto out;
56258 +       }
56259 +
56260 +       /* Initialize client buffer ring */
56261 +       msg_rx_ring.dev_id = dev_id;
56262 +       msg_rx_ring.size = entries;
56263 +       msg_rx_ring.rx_slot = 0;
56264 +       for (i = 0; i < msg_rx_ring.size; i++)
56265 +               msg_rx_ring.virt_buffer[i] = NULL;
56266 +
56267 +       /* Initialize inbound message ring */
56268 +       if (!(msg_rx_ring.virt = dma_alloc_coherent(NULL,
56269 +                                                   msg_rx_ring.size *
56270 +                                                   RIO_MAX_MSG_SIZE,
56271 +                                                   &msg_rx_ring.phys,
56272 +                                                   GFP_KERNEL))) {
56273 +               rc = -ENOMEM;
56274 +               goto out;
56275 +       }
56276 +
56277 +       /* Point dequeue/enqueue pointers at first entry in ring */
56278 +       out_be32((void *)&msg_regs->ifqdpar, (u32) msg_rx_ring.phys);
56279 +       out_be32((void *)&msg_regs->ifqepar, (u32) msg_rx_ring.phys);
56280 +
56281 +       /* Clear interrupt status */
56282 +       out_be32((void *)&msg_regs->isr, 0x00000091);
56283 +
56284 +       /* Hook up inbound message handler */
56285 +       if ((rc =
56286 +            request_irq(MPC85xx_IRQ_RIO_RX, mpc85xx_rio_rx_handler, 0,
56287 +                        "msg_rx", (void *)mport)) < 0) {
56288 +               dma_free_coherent(NULL, RIO_MSG_BUFFER_SIZE,
56289 +                                 msg_tx_ring.virt_buffer[i],
56290 +                                 msg_tx_ring.phys_buffer[i]);
56291 +               goto out;
56292 +       }
56293 +
56294 +       /*
56295 +        * Configure inbound message unit:
56296 +        *      Snooping
56297 +        *      4KB max message size
56298 +        *      Unmask all interrupt sources
56299 +        *      Disable
56300 +        */
56301 +       out_be32((void *)&msg_regs->imr, 0x001b0060);
56302 +
56303 +       /* Set number of queue entries */
56304 +       out_be32((void *)&msg_regs->imr,
56305 +                in_be32((void *)&msg_regs->imr) |
56306 +                ((get_bitmask_order(entries) - 2) << 12));
56307 +
56308 +       /* Now enable the unit */
56309 +       out_be32((void *)&msg_regs->imr, in_be32((void *)&msg_regs->imr) | 0x1);
56310 +
56311 +      out:
56312 +       return rc;
56313 +}
56314 +
56315 +/**
56316 + * rio_close_inb_mbox - Shut down MPC85xx inbound mailbox
56317 + * @mport: Master port implementing the inbound message unit
56318 + * @mbox: Mailbox to close
56319 + *
56320 + * Disables the inbound message unit, free all buffers, and
56321 + * frees the inbound message interrupt.
56322 + */
56323 +void rio_close_inb_mbox(struct rio_mport *mport, int mbox)
56324 +{
56325 +       /* Disable inbound message unit */
56326 +       out_be32((void *)&msg_regs->imr, 0);
56327 +
56328 +       /* Free ring */
56329 +       dma_free_coherent(NULL, msg_rx_ring.size * RIO_MAX_MSG_SIZE,
56330 +                         msg_rx_ring.virt, msg_rx_ring.phys);
56331 +
56332 +       /* Free interrupt */
56333 +       free_irq(MPC85xx_IRQ_RIO_RX, (void *)mport);
56334 +}
56335 +
56336 +/**
56337 + * rio_hw_add_inb_buffer - Add buffer to the MPC85xx inbound message queue
56338 + * @mport: Master port implementing the inbound message unit
56339 + * @mbox: Inbound mailbox number
56340 + * @buf: Buffer to add to inbound queue
56341 + *
56342 + * Adds the @buf buffer to the MPC85xx inbound message queue. Returns
56343 + * %0 on success or %-EINVAL on failure.
56344 + */
56345 +int rio_hw_add_inb_buffer(struct rio_mport *mport, int mbox, void *buf)
56346 +{
56347 +       int rc = 0;
56348 +
56349 +       pr_debug("RIO: rio_hw_add_inb_buffer(), msg_rx_ring.rx_slot %d\n",
56350 +                msg_rx_ring.rx_slot);
56351 +
56352 +       if (msg_rx_ring.virt_buffer[msg_rx_ring.rx_slot]) {
56353 +               printk(KERN_ERR
56354 +                      "RIO: error adding inbound buffer %d, buffer exists\n",
56355 +                      msg_rx_ring.rx_slot);
56356 +               rc = -EINVAL;
56357 +               goto out;
56358 +       }
56359 +
56360 +       msg_rx_ring.virt_buffer[msg_rx_ring.rx_slot] = buf;
56361 +       if (++msg_rx_ring.rx_slot == msg_rx_ring.size)
56362 +               msg_rx_ring.rx_slot = 0;
56363 +
56364 +      out:
56365 +       return rc;
56366 +}
56367 +
56368 +EXPORT_SYMBOL_GPL(rio_hw_add_inb_buffer);
56369 +
56370 +/**
56371 + * rio_hw_get_inb_message - Fetch inbound message from the MPC85xx message unit
56372 + * @mport: Master port implementing the inbound message unit
56373 + * @mbox: Inbound mailbox number
56374 + *
56375 + * Gets the next available inbound message from the inbound message queue.
56376 + * A pointer to the message is returned on success or NULL on failure.
56377 + */
56378 +void *rio_hw_get_inb_message(struct rio_mport *mport, int mbox)
56379 +{
56380 +       u32 imr;
56381 +       u32 phys_buf, virt_buf;
56382 +       void *buf = NULL;
56383 +       int buf_idx;
56384 +
56385 +       phys_buf = in_be32((void *)&msg_regs->ifqdpar);
56386 +
56387 +       /* If no more messages, then bail out */
56388 +       if (phys_buf == in_be32((void *)&msg_regs->ifqepar))
56389 +               goto out2;
56390 +
56391 +       virt_buf = (u32) msg_rx_ring.virt + (phys_buf - msg_rx_ring.phys);
56392 +       buf_idx = (phys_buf - msg_rx_ring.phys) / RIO_MAX_MSG_SIZE;
56393 +       buf = msg_rx_ring.virt_buffer[buf_idx];
56394 +
56395 +       if (!buf) {
56396 +               printk(KERN_ERR
56397 +                      "RIO: inbound message copy failed, no buffers\n");
56398 +               goto out1;
56399 +       }
56400 +
56401 +       /* Copy max message size, caller is expected to allocate that big */
56402 +       memcpy(buf, (void *)virt_buf, RIO_MAX_MSG_SIZE);
56403 +
56404 +       /* Clear the available buffer */
56405 +       msg_rx_ring.virt_buffer[buf_idx] = NULL;
56406 +
56407 +      out1:
56408 +       imr = in_be32((void *)&msg_regs->imr);
56409 +       out_be32((void *)&msg_regs->imr, imr | RIO_MSG_IMR_MI);
56410 +
56411 +      out2:
56412 +       return buf;
56413 +}
56414 +
56415 +EXPORT_SYMBOL_GPL(rio_hw_get_inb_message);
56416 +
56417 +/**
56418 + * mpc85xx_rio_dbell_handler - MPC85xx doorbell interrupt handler
56419 + * @irq: Linux interrupt number
56420 + * @dev_instance: Pointer to interrupt-specific data
56421 + *
56422 + * Handles doorbell interrupts. Parses a list of registered
56423 + * doorbell event handlers and executes a matching event handler.
56424 + */
56425 +static irqreturn_t
56426 +mpc85xx_rio_dbell_handler(int irq, void *dev_instance)
56427 +{
56428 +       int dsr;
56429 +       struct rio_mport *port = (struct rio_mport *)dev_instance;
56430 +
56431 +       dsr = in_be32((void *)&msg_regs->dsr);
56432 +
56433 +       if (dsr & DOORBELL_DSR_TE) {
56434 +               pr_info("RIO: doorbell reception error\n");
56435 +               out_be32((void *)&msg_regs->dsr, DOORBELL_DSR_TE);
56436 +               goto out;
56437 +       }
56438 +
56439 +       if (dsr & DOORBELL_DSR_QFI) {
56440 +               pr_info("RIO: doorbell queue full\n");
56441 +               out_be32((void *)&msg_regs->dsr, DOORBELL_DSR_QFI);
56442 +               goto out;
56443 +       }
56444 +
56445 +       /* XXX Need to check/dispatch until queue empty */
56446 +       if (dsr & DOORBELL_DSR_DIQI) {
56447 +               u32 dmsg =
56448 +                   (u32) dbell_ring.virt +
56449 +                   (in_be32((void *)&msg_regs->dqdpar) & 0xfff);
56450 +               u32 dmr;
56451 +               struct rio_dbell *dbell;
56452 +               int found = 0;
56453 +
56454 +               pr_debug
56455 +                   ("RIO: processing doorbell, sid %2.2x tid %2.2x info %4.4x\n",
56456 +                    DBELL_SID(dmsg), DBELL_TID(dmsg), DBELL_INF(dmsg));
56457 +
56458 +               list_for_each_entry(dbell, &port->dbells, node) {
56459 +                       if ((dbell->res->start <= DBELL_INF(dmsg)) &&
56460 +                           (dbell->res->end >= DBELL_INF(dmsg))) {
56461 +                               found = 1;
56462 +                               break;
56463 +                       }
56464 +               }
56465 +               if (found) {
56466 +                       dbell->dinb(port, dbell->dev_id, DBELL_SID(dmsg), DBELL_TID(dmsg),
56467 +                                   DBELL_INF(dmsg));
56468 +               } else {
56469 +                       pr_debug
56470 +                           ("RIO: spurious doorbell, sid %2.2x tid %2.2x info %4.4x\n",
56471 +                            DBELL_SID(dmsg), DBELL_TID(dmsg), DBELL_INF(dmsg));
56472 +               }
56473 +               dmr = in_be32((void *)&msg_regs->dmr);
56474 +               out_be32((void *)&msg_regs->dmr, dmr | DOORBELL_DMR_DI);
56475 +               out_be32((void *)&msg_regs->dsr, DOORBELL_DSR_DIQI);
56476 +       }
56477 +
56478 +      out:
56479 +       return IRQ_HANDLED;
56480 +}
56481 +
56482 +/**
56483 + * mpc85xx_rio_doorbell_init - MPC85xx doorbell interface init
56484 + * @mport: Master port implementing the inbound doorbell unit
56485 + *
56486 + * Initializes doorbell unit hardware and inbound DMA buffer
56487 + * ring. Called from mpc85xx_rio_setup(). Returns %0 on success
56488 + * or %-ENOMEM on failure.
56489 + */
56490 +static int mpc85xx_rio_doorbell_init(struct rio_mport *mport)
56491 +{
56492 +       int rc = 0;
56493 +
56494 +       /* Map outbound doorbell window immediately after maintenance window */
56495 +       if (!(dbell_win =
56496 +             (u32) ioremap(mport->iores.start + RIO_MAINT_WIN_SIZE,
56497 +                           RIO_DBELL_WIN_SIZE))) {
56498 +               printk(KERN_ERR
56499 +                      "RIO: unable to map outbound doorbell window\n");
56500 +               rc = -ENOMEM;
56501 +               goto out;
56502 +       }
56503 +
56504 +       /* Initialize inbound doorbells */
56505 +       if (!(dbell_ring.virt = dma_alloc_coherent(NULL,
56506 +                                                  512 * DOORBELL_MESSAGE_SIZE,
56507 +                                                  &dbell_ring.phys,
56508 +                                                  GFP_KERNEL))) {
56509 +               printk(KERN_ERR "RIO: unable allocate inbound doorbell ring\n");
56510 +               rc = -ENOMEM;
56511 +               iounmap((void *)dbell_win);
56512 +               goto out;
56513 +       }
56514 +
56515 +       /* Point dequeue/enqueue pointers at first entry in ring */
56516 +       out_be32((void *)&msg_regs->dqdpar, (u32) dbell_ring.phys);
56517 +       out_be32((void *)&msg_regs->dqepar, (u32) dbell_ring.phys);
56518 +
56519 +       /* Clear interrupt status */
56520 +       out_be32((void *)&msg_regs->dsr, 0x00000091);
56521 +
56522 +       /* Hook up doorbell handler */
56523 +       if ((rc =
56524 +            request_irq(MPC85xx_IRQ_RIO_BELL, mpc85xx_rio_dbell_handler, 0,
56525 +                        "dbell_rx", (void *)mport) < 0)) {
56526 +               iounmap((void *)dbell_win);
56527 +               dma_free_coherent(NULL, 512 * DOORBELL_MESSAGE_SIZE,
56528 +                                 dbell_ring.virt, dbell_ring.phys);
56529 +               printk(KERN_ERR
56530 +                      "MPC85xx RIO: unable to request inbound doorbell irq");
56531 +               goto out;
56532 +       }
56533 +
56534 +       /* Configure doorbells for snooping, 512 entries, and enable */
56535 +       out_be32((void *)&msg_regs->dmr, 0x00108161);
56536 +
56537 +      out:
56538 +       return rc;
56539 +}
56540 +
56541 +static char *cmdline = NULL;
56542 +
56543 +static int mpc85xx_rio_get_hdid(int index)
56544 +{
56545 +       /* XXX Need to parse multiple entries in some format */
56546 +       if (!cmdline)
56547 +               return -1;
56548 +
56549 +       return simple_strtol(cmdline, NULL, 0);
56550 +}
56551 +
56552 +static int mpc85xx_rio_get_cmdline(char *s)
56553 +{
56554 +       if (!s)
56555 +               return 0;
56556 +
56557 +       cmdline = s;
56558 +       return 1;
56559 +}
56560 +
56561 +__setup("riohdid=", mpc85xx_rio_get_cmdline);
56562 +
56563 +/**
56564 + * mpc85xx_rio_setup - Setup MPC85xx RapidIO interface
56565 + * @law_start: Starting physical address of RapidIO LAW
56566 + * @law_size: Size of RapidIO LAW
56567 + *
56568 + * Initializes MPC85xx RapidIO hardware interface, configures
56569 + * master port with system-specific info, and registers the
56570 + * master port with the RapidIO subsystem.
56571 + */
56572 +void mpc85xx_rio_setup(int law_start, int law_size)
56573 +{
56574 +       struct rio_ops *ops;
56575 +       struct rio_mport *port;
56576 +
56577 +       ops = kmalloc(sizeof(struct rio_ops), GFP_KERNEL);
56578 +       ops->lcread = mpc85xx_local_config_read;
56579 +       ops->lcwrite = mpc85xx_local_config_write;
56580 +       ops->cread = mpc85xx_rio_config_read;
56581 +       ops->cwrite = mpc85xx_rio_config_write;
56582 +       ops->dsend = mpc85xx_rio_doorbell_send;
56583 +
56584 +       port = kmalloc(sizeof(struct rio_mport), GFP_KERNEL);
56585 +       port->id = 0;
56586 +       port->index = 0;
56587 +       INIT_LIST_HEAD(&port->dbells);
56588 +       port->iores.start = law_start;
56589 +       port->iores.end = law_start + law_size;
56590 +       port->iores.flags = IORESOURCE_MEM;
56591 +
56592 +       rio_init_dbell_res(&port->riores[RIO_DOORBELL_RESOURCE], 0, 0xffff);
56593 +       rio_init_mbox_res(&port->riores[RIO_INB_MBOX_RESOURCE], 0, 0);
56594 +       rio_init_mbox_res(&port->riores[RIO_OUTB_MBOX_RESOURCE], 0, 0);
56595 +       strcpy(port->name, "RIO0 mport");
56596 +
56597 +       port->ops = ops;
56598 +       port->host_deviceid = mpc85xx_rio_get_hdid(port->id);
56599 +
56600 +       rio_register_mport(port);
56601 +
56602 +       regs_win = (u32) ioremap(RIO_REGS_BASE, 0x20000);
56603 +       atmu_regs = (struct rio_atmu_regs *)(regs_win + RIO_ATMU_REGS_OFFSET);
56604 +       maint_atmu_regs = atmu_regs + 1;
56605 +       dbell_atmu_regs = atmu_regs + 2;
56606 +       msg_regs = (struct rio_msg_regs *)(regs_win + RIO_MSG_REGS_OFFSET);
56607 +
56608 +       /* Configure maintenance transaction window */
56609 +       out_be32((void *)&maint_atmu_regs->rowbar, 0x000c0000);
56610 +       out_be32((void *)&maint_atmu_regs->rowar, 0x80077015);
56611 +
56612 +       maint_win = (u32) ioremap(law_start, RIO_MAINT_WIN_SIZE);
56613 +
56614 +       /* Configure outbound doorbell window */
56615 +       out_be32((void *)&dbell_atmu_regs->rowbar, 0x000c0400);
56616 +       out_be32((void *)&dbell_atmu_regs->rowar, 0x8004200b);
56617 +       mpc85xx_rio_doorbell_init(port);
56618 +}
56619 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/sysdev/fsl_rio.h powerpc.git/arch/powerpc/sysdev/fsl_rio.h
56620 --- linux-2.6.24/arch/powerpc/sysdev/fsl_rio.h  1970-01-01 01:00:00.000000000 +0100
56621 +++ powerpc.git/arch/powerpc/sysdev/fsl_rio.h   2008-01-28 20:25:49.000000000 +0100
56622 @@ -0,0 +1,20 @@
56623 +/*
56624 + * MPC85xx RapidIO definitions
56625 + *
56626 + * Copyright 2005 MontaVista Software, Inc.
56627 + * Matt Porter <mporter@kernel.crashing.org>
56628 + *
56629 + * This program is free software; you can redistribute  it and/or modify it
56630 + * under  the terms of  the GNU General  Public License as published by the
56631 + * Free Software Foundation;  either version 2 of the  License, or (at your
56632 + * option) any later version.
56633 + */
56634 +
56635 +#ifndef __PPC_SYSLIB_PPC85XX_RIO_H
56636 +#define __PPC_SYSLIB_PPC85XX_RIO_H
56637 +
56638 +#include <linux/init.h>
56639 +
56640 +extern void mpc85xx_rio_setup(int law_start, int law_size);
56641 +
56642 +#endif                         /* __PPC_SYSLIB_PPC85XX_RIO_H */
56643 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/sysdev/fsl_soc.c powerpc.git/arch/powerpc/sysdev/fsl_soc.c
56644 --- linux-2.6.24/arch/powerpc/sysdev/fsl_soc.c  2008-01-24 23:58:37.000000000 +0100
56645 +++ powerpc.git/arch/powerpc/sysdev/fsl_soc.c   2008-01-28 20:25:49.000000000 +0100
56646 @@ -24,6 +24,7 @@
56647  #include <linux/platform_device.h>
56648  #include <linux/of_platform.h>
56649  #include <linux/phy.h>
56650 +#include <linux/phy_fixed.h>
56651  #include <linux/spi/spi.h>
56652  #include <linux/fsl_devices.h>
56653  #include <linux/fs_enet_pd.h>
56654 @@ -54,10 +55,18 @@
56655         soc = of_find_node_by_type(NULL, "soc");
56656         if (soc) {
56657                 int size;
56658 -               const void *prop = of_get_property(soc, "reg", &size);
56659 +               u32 naddr;
56660 +               const u32 *prop = of_get_property(soc, "#address-cells", &size);
56661  
56662 +               if (prop && size == 4)
56663 +                       naddr = *prop;
56664 +               else
56665 +                       naddr = 2;
56666 +
56667 +               prop = of_get_property(soc, "ranges", &size);
56668                 if (prop)
56669 -                       immrbase = of_translate_address(soc, prop);
56670 +                       immrbase = of_translate_address(soc, prop + naddr);
56671 +
56672                 of_node_put(soc);
56673         }
56674  
56675 @@ -130,17 +139,51 @@
56676  EXPORT_SYMBOL(get_baudrate);
56677  #endif /* CONFIG_CPM2 */
56678  
56679 -static int __init gfar_mdio_of_init(void)
56680 +#ifdef CONFIG_FIXED_PHY
56681 +static int __init of_add_fixed_phys(void)
56682  {
56683 +       int ret;
56684         struct device_node *np;
56685 -       unsigned int i;
56686 +       u32 *fixed_link;
56687 +       struct fixed_phy_status status = {};
56688 +
56689 +       for_each_node_by_name(np, "ethernet") {
56690 +               fixed_link  = (u32 *)of_get_property(np, "fixed-link", NULL);
56691 +               if (!fixed_link)
56692 +                       continue;
56693 +
56694 +               status.link = 1;
56695 +               status.duplex = fixed_link[1];
56696 +               status.speed = fixed_link[2];
56697 +               status.pause = fixed_link[3];
56698 +               status.asym_pause = fixed_link[4];
56699 +
56700 +               ret = fixed_phy_add(PHY_POLL, fixed_link[0], &status);
56701 +               if (ret) {
56702 +                       of_node_put(np);
56703 +                       return ret;
56704 +               }
56705 +       }
56706 +
56707 +       return 0;
56708 +}
56709 +arch_initcall(of_add_fixed_phys);
56710 +#endif /* CONFIG_FIXED_PHY */
56711 +
56712 +static int __init gfar_mdio_of_init(void)
56713 +{
56714 +       struct device_node *np = NULL;
56715         struct platform_device *mdio_dev;
56716         struct resource res;
56717         int ret;
56718  
56719 -       for (np = NULL, i = 0;
56720 -            (np = of_find_compatible_node(np, "mdio", "gianfar")) != NULL;
56721 -            i++) {
56722 +       np = of_find_compatible_node(np, NULL, "fsl,gianfar-mdio");
56723 +
56724 +       /* try the deprecated version */
56725 +       if (!np)
56726 +               np = of_find_compatible_node(np, "mdio", "gianfar");
56727 +
56728 +       if (np) {
56729                 int k;
56730                 struct device_node *child = NULL;
56731                 struct gianfar_mdio_data mdio_data;
56732 @@ -179,11 +222,13 @@
56733                         goto unreg;
56734         }
56735  
56736 +       of_node_put(np);
56737         return 0;
56738  
56739  unreg:
56740         platform_device_unregister(mdio_dev);
56741  err:
56742 +       of_node_put(np);
56743         return ret;
56744  }
56745  
56746 @@ -193,7 +238,6 @@
56747  static const char *gfar_rx_intr = "rx";
56748  static const char *gfar_err_intr = "error";
56749  
56750 -
56751  static int __init gfar_of_init(void)
56752  {
56753         struct device_node *np;
56754 @@ -277,29 +321,43 @@
56755                         gfar_data.interface = PHY_INTERFACE_MODE_MII;
56756  
56757                 ph = of_get_property(np, "phy-handle", NULL);
56758 -               phy = of_find_node_by_phandle(*ph);
56759 +               if (ph == NULL) {
56760 +                       u32 *fixed_link;
56761  
56762 -               if (phy == NULL) {
56763 -                       ret = -ENODEV;
56764 -                       goto unreg;
56765 -               }
56766 +                       fixed_link = (u32 *)of_get_property(np, "fixed-link",
56767 +                                                          NULL);
56768 +                       if (!fixed_link) {
56769 +                               ret = -ENODEV;
56770 +                               goto unreg;
56771 +                       }
56772  
56773 -               mdio = of_get_parent(phy);
56774 +                       gfar_data.bus_id = 0;
56775 +                       gfar_data.phy_id = fixed_link[0];
56776 +               } else {
56777 +                       phy = of_find_node_by_phandle(*ph);
56778 +
56779 +                       if (phy == NULL) {
56780 +                               ret = -ENODEV;
56781 +                               goto unreg;
56782 +                       }
56783 +
56784 +                       mdio = of_get_parent(phy);
56785 +
56786 +                       id = of_get_property(phy, "reg", NULL);
56787 +                       ret = of_address_to_resource(mdio, 0, &res);
56788 +                       if (ret) {
56789 +                               of_node_put(phy);
56790 +                               of_node_put(mdio);
56791 +                               goto unreg;
56792 +                       }
56793 +
56794 +                       gfar_data.phy_id = *id;
56795 +                       gfar_data.bus_id = res.start;
56796  
56797 -               id = of_get_property(phy, "reg", NULL);
56798 -               ret = of_address_to_resource(mdio, 0, &res);
56799 -               if (ret) {
56800                         of_node_put(phy);
56801                         of_node_put(mdio);
56802 -                       goto unreg;
56803                 }
56804  
56805 -               gfar_data.phy_id = *id;
56806 -               gfar_data.bus_id = res.start;
56807 -
56808 -               of_node_put(phy);
56809 -               of_node_put(mdio);
56810 -
56811                 ret =
56812                     platform_device_add_data(gfar_dev, &gfar_data,
56813                                              sizeof(struct
56814 @@ -390,13 +448,11 @@
56815  static int __init fsl_i2c_of_init(void)
56816  {
56817         struct device_node *np;
56818 -       unsigned int i;
56819 +       unsigned int i = 0;
56820         struct platform_device *i2c_dev;
56821         int ret;
56822  
56823 -       for (np = NULL, i = 0;
56824 -            (np = of_find_compatible_node(np, "i2c", "fsl-i2c")) != NULL;
56825 -            i++) {
56826 +       for_each_compatible_node(np, NULL, "fsl-i2c") {
56827                 struct resource r[2];
56828                 struct fsl_i2c_platform_data i2c_data;
56829                 const unsigned char *flags = NULL;
56830 @@ -432,7 +488,7 @@
56831                 if (ret)
56832                         goto unreg;
56833  
56834 -               of_register_i2c_devices(np, i);
56835 +               of_register_i2c_devices(np, i++);
56836         }
56837  
56838         return 0;
56839 @@ -528,14 +584,12 @@
56840  static int __init fsl_usb_of_init(void)
56841  {
56842         struct device_node *np;
56843 -       unsigned int i;
56844 +       unsigned int i = 0;
56845         struct platform_device *usb_dev_mph = NULL, *usb_dev_dr_host = NULL,
56846                 *usb_dev_dr_client = NULL;
56847         int ret;
56848  
56849 -       for (np = NULL, i = 0;
56850 -            (np = of_find_compatible_node(np, "usb", "fsl-usb2-mph")) != NULL;
56851 -            i++) {
56852 +       for_each_compatible_node(np, NULL, "fsl-usb2-mph") {
56853                 struct resource r[2];
56854                 struct fsl_usb2_platform_data usb_data;
56855                 const unsigned char *prop = NULL;
56856 @@ -578,11 +632,10 @@
56857                                                     fsl_usb2_platform_data));
56858                 if (ret)
56859                         goto unreg_mph;
56860 +               i++;
56861         }
56862  
56863 -       for (np = NULL;
56864 -            (np = of_find_compatible_node(np, "usb", "fsl-usb2-dr")) != NULL;
56865 -            i++) {
56866 +       for_each_compatible_node(np, NULL, "fsl-usb2-dr") {
56867                 struct resource r[2];
56868                 struct fsl_usb2_platform_data usb_data;
56869                 const unsigned char *prop = NULL;
56870 @@ -654,6 +707,7 @@
56871                                                 fsl_usb2_platform_data))))
56872                                 goto unreg_dr;
56873                 }
56874 +               i++;
56875         }
56876         return 0;
56877  
56878 @@ -1125,13 +1179,12 @@
56879  
56880  static int __init fsl_pcmcia_of_init(void)
56881  {
56882 -       struct device_node *np = NULL;
56883 +       struct device_node *np;
56884         /*
56885          * Register all the devices which type is "pcmcia"
56886          */
56887 -       while ((np = of_find_compatible_node(np,
56888 -                       "pcmcia", "fsl,pq-pcmcia")) != NULL)
56889 -                           of_platform_device_create(np, "m8xx-pcmcia", NULL);
56890 +       for_each_compatible_node(np, "pcmcia", "fsl,pq-pcmcia")
56891 +               of_platform_device_create(np, "m8xx-pcmcia", NULL);
56892         return 0;
56893  }
56894  
56895 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/sysdev/grackle.c powerpc.git/arch/powerpc/sysdev/grackle.c
56896 --- linux-2.6.24/arch/powerpc/sysdev/grackle.c  2008-01-24 23:58:37.000000000 +0100
56897 +++ powerpc.git/arch/powerpc/sysdev/grackle.c   2008-01-28 20:25:49.000000000 +0100
56898 @@ -57,7 +57,7 @@
56899  {
56900         setup_indirect_pci(hose, 0xfec00000, 0xfee00000, 0);
56901         if (machine_is_compatible("PowerMac1,1"))
56902 -               pci_assign_all_buses = 1;
56903 +               ppc_pci_flags |= PPC_PCI_REASSIGN_ALL_BUS;
56904         if (machine_is_compatible("AAPL,PowerBook1998"))
56905                 grackle_set_loop_snoop(hose, 1);
56906  #if 0  /* Disabled for now, HW problems ??? */
56907 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/sysdev/ipic.c powerpc.git/arch/powerpc/sysdev/ipic.c
56908 --- linux-2.6.24/arch/powerpc/sysdev/ipic.c     2008-01-24 23:58:37.000000000 +0100
56909 +++ powerpc.git/arch/powerpc/sysdev/ipic.c      2008-01-28 20:25:49.000000000 +0100
56910 @@ -30,11 +30,67 @@
56911  #include "ipic.h"
56912  
56913  static struct ipic * primary_ipic;
56914 +static struct irq_chip ipic_level_irq_chip, ipic_edge_irq_chip;
56915  static DEFINE_SPINLOCK(ipic_lock);
56916  
56917  static struct ipic_info ipic_info[] = {
56918 +       [1] = {
56919 +               .mask   = IPIC_SIMSR_H,
56920 +               .prio   = IPIC_SIPRR_C,
56921 +               .force  = IPIC_SIFCR_H,
56922 +               .bit    = 16,
56923 +               .prio_mask = 0,
56924 +       },
56925 +       [2] = {
56926 +               .mask   = IPIC_SIMSR_H,
56927 +               .prio   = IPIC_SIPRR_C,
56928 +               .force  = IPIC_SIFCR_H,
56929 +               .bit    = 17,
56930 +               .prio_mask = 1,
56931 +       },
56932 +       [3] = {
56933 +               .mask   = IPIC_SIMSR_H,
56934 +               .prio   = IPIC_SIPRR_C,
56935 +               .force  = IPIC_SIFCR_H,
56936 +               .bit    = 18,
56937 +               .prio_mask = 2,
56938 +       },
56939 +       [4] = {
56940 +               .mask   = IPIC_SIMSR_H,
56941 +               .prio   = IPIC_SIPRR_C,
56942 +               .force  = IPIC_SIFCR_H,
56943 +               .bit    = 19,
56944 +               .prio_mask = 3,
56945 +       },
56946 +       [5] = {
56947 +               .mask   = IPIC_SIMSR_H,
56948 +               .prio   = IPIC_SIPRR_C,
56949 +               .force  = IPIC_SIFCR_H,
56950 +               .bit    = 20,
56951 +               .prio_mask = 4,
56952 +       },
56953 +       [6] = {
56954 +               .mask   = IPIC_SIMSR_H,
56955 +               .prio   = IPIC_SIPRR_C,
56956 +               .force  = IPIC_SIFCR_H,
56957 +               .bit    = 21,
56958 +               .prio_mask = 5,
56959 +       },
56960 +       [7] = {
56961 +               .mask   = IPIC_SIMSR_H,
56962 +               .prio   = IPIC_SIPRR_C,
56963 +               .force  = IPIC_SIFCR_H,
56964 +               .bit    = 22,
56965 +               .prio_mask = 6,
56966 +       },
56967 +       [8] = {
56968 +               .mask   = IPIC_SIMSR_H,
56969 +               .prio   = IPIC_SIPRR_C,
56970 +               .force  = IPIC_SIFCR_H,
56971 +               .bit    = 23,
56972 +               .prio_mask = 7,
56973 +       },
56974         [9] = {
56975 -               .pend   = IPIC_SIPNR_H,
56976                 .mask   = IPIC_SIMSR_H,
56977                 .prio   = IPIC_SIPRR_D,
56978                 .force  = IPIC_SIFCR_H,
56979 @@ -42,7 +98,6 @@
56980                 .prio_mask = 0,
56981         },
56982         [10] = {
56983 -               .pend   = IPIC_SIPNR_H,
56984                 .mask   = IPIC_SIMSR_H,
56985                 .prio   = IPIC_SIPRR_D,
56986                 .force  = IPIC_SIFCR_H,
56987 @@ -50,15 +105,27 @@
56988                 .prio_mask = 1,
56989         },
56990         [11] = {
56991 -               .pend   = IPIC_SIPNR_H,
56992                 .mask   = IPIC_SIMSR_H,
56993                 .prio   = IPIC_SIPRR_D,
56994                 .force  = IPIC_SIFCR_H,
56995                 .bit    = 26,
56996                 .prio_mask = 2,
56997         },
56998 +       [12] = {
56999 +               .mask   = IPIC_SIMSR_H,
57000 +               .prio   = IPIC_SIPRR_D,
57001 +               .force  = IPIC_SIFCR_H,
57002 +               .bit    = 27,
57003 +               .prio_mask = 3,
57004 +       },
57005 +       [13] = {
57006 +               .mask   = IPIC_SIMSR_H,
57007 +               .prio   = IPIC_SIPRR_D,
57008 +               .force  = IPIC_SIFCR_H,
57009 +               .bit    = 28,
57010 +               .prio_mask = 4,
57011 +       },
57012         [14] = {
57013 -               .pend   = IPIC_SIPNR_H,
57014                 .mask   = IPIC_SIMSR_H,
57015                 .prio   = IPIC_SIPRR_D,
57016                 .force  = IPIC_SIFCR_H,
57017 @@ -66,7 +133,6 @@
57018                 .prio_mask = 5,
57019         },
57020         [15] = {
57021 -               .pend   = IPIC_SIPNR_H,
57022                 .mask   = IPIC_SIMSR_H,
57023                 .prio   = IPIC_SIPRR_D,
57024                 .force  = IPIC_SIFCR_H,
57025 @@ -74,7 +140,6 @@
57026                 .prio_mask = 6,
57027         },
57028         [16] = {
57029 -               .pend   = IPIC_SIPNR_H,
57030                 .mask   = IPIC_SIMSR_H,
57031                 .prio   = IPIC_SIPRR_D,
57032                 .force  = IPIC_SIFCR_H,
57033 @@ -82,7 +147,7 @@
57034                 .prio_mask = 7,
57035         },
57036         [17] = {
57037 -               .pend   = IPIC_SEPNR,
57038 +               .ack    = IPIC_SEPNR,
57039                 .mask   = IPIC_SEMSR,
57040                 .prio   = IPIC_SMPRR_A,
57041                 .force  = IPIC_SEFCR,
57042 @@ -90,7 +155,7 @@
57043                 .prio_mask = 5,
57044         },
57045         [18] = {
57046 -               .pend   = IPIC_SEPNR,
57047 +               .ack    = IPIC_SEPNR,
57048                 .mask   = IPIC_SEMSR,
57049                 .prio   = IPIC_SMPRR_A,
57050                 .force  = IPIC_SEFCR,
57051 @@ -98,7 +163,7 @@
57052                 .prio_mask = 6,
57053         },
57054         [19] = {
57055 -               .pend   = IPIC_SEPNR,
57056 +               .ack    = IPIC_SEPNR,
57057                 .mask   = IPIC_SEMSR,
57058                 .prio   = IPIC_SMPRR_A,
57059                 .force  = IPIC_SEFCR,
57060 @@ -106,7 +171,7 @@
57061                 .prio_mask = 7,
57062         },
57063         [20] = {
57064 -               .pend   = IPIC_SEPNR,
57065 +               .ack    = IPIC_SEPNR,
57066                 .mask   = IPIC_SEMSR,
57067                 .prio   = IPIC_SMPRR_B,
57068                 .force  = IPIC_SEFCR,
57069 @@ -114,7 +179,7 @@
57070                 .prio_mask = 4,
57071         },
57072         [21] = {
57073 -               .pend   = IPIC_SEPNR,
57074 +               .ack    = IPIC_SEPNR,
57075                 .mask   = IPIC_SEMSR,
57076                 .prio   = IPIC_SMPRR_B,
57077                 .force  = IPIC_SEFCR,
57078 @@ -122,7 +187,7 @@
57079                 .prio_mask = 5,
57080         },
57081         [22] = {
57082 -               .pend   = IPIC_SEPNR,
57083 +               .ack    = IPIC_SEPNR,
57084                 .mask   = IPIC_SEMSR,
57085                 .prio   = IPIC_SMPRR_B,
57086                 .force  = IPIC_SEFCR,
57087 @@ -130,7 +195,7 @@
57088                 .prio_mask = 6,
57089         },
57090         [23] = {
57091 -               .pend   = IPIC_SEPNR,
57092 +               .ack    = IPIC_SEPNR,
57093                 .mask   = IPIC_SEMSR,
57094                 .prio   = IPIC_SMPRR_B,
57095                 .force  = IPIC_SEFCR,
57096 @@ -138,7 +203,6 @@
57097                 .prio_mask = 7,
57098         },
57099         [32] = {
57100 -               .pend   = IPIC_SIPNR_H,
57101                 .mask   = IPIC_SIMSR_H,
57102                 .prio   = IPIC_SIPRR_A,
57103                 .force  = IPIC_SIFCR_H,
57104 @@ -146,7 +210,6 @@
57105                 .prio_mask = 0,
57106         },
57107         [33] = {
57108 -               .pend   = IPIC_SIPNR_H,
57109                 .mask   = IPIC_SIMSR_H,
57110                 .prio   = IPIC_SIPRR_A,
57111                 .force  = IPIC_SIFCR_H,
57112 @@ -154,7 +217,6 @@
57113                 .prio_mask = 1,
57114         },
57115         [34] = {
57116 -               .pend   = IPIC_SIPNR_H,
57117                 .mask   = IPIC_SIMSR_H,
57118                 .prio   = IPIC_SIPRR_A,
57119                 .force  = IPIC_SIFCR_H,
57120 @@ -162,7 +224,6 @@
57121                 .prio_mask = 2,
57122         },
57123         [35] = {
57124 -               .pend   = IPIC_SIPNR_H,
57125                 .mask   = IPIC_SIMSR_H,
57126                 .prio   = IPIC_SIPRR_A,
57127                 .force  = IPIC_SIFCR_H,
57128 @@ -170,7 +231,6 @@
57129                 .prio_mask = 3,
57130         },
57131         [36] = {
57132 -               .pend   = IPIC_SIPNR_H,
57133                 .mask   = IPIC_SIMSR_H,
57134                 .prio   = IPIC_SIPRR_A,
57135                 .force  = IPIC_SIFCR_H,
57136 @@ -178,7 +238,6 @@
57137                 .prio_mask = 4,
57138         },
57139         [37] = {
57140 -               .pend   = IPIC_SIPNR_H,
57141                 .mask   = IPIC_SIMSR_H,
57142                 .prio   = IPIC_SIPRR_A,
57143                 .force  = IPIC_SIFCR_H,
57144 @@ -186,7 +245,6 @@
57145                 .prio_mask = 5,
57146         },
57147         [38] = {
57148 -               .pend   = IPIC_SIPNR_H,
57149                 .mask   = IPIC_SIMSR_H,
57150                 .prio   = IPIC_SIPRR_A,
57151                 .force  = IPIC_SIFCR_H,
57152 @@ -194,15 +252,69 @@
57153                 .prio_mask = 6,
57154         },
57155         [39] = {
57156 -               .pend   = IPIC_SIPNR_H,
57157                 .mask   = IPIC_SIMSR_H,
57158                 .prio   = IPIC_SIPRR_A,
57159                 .force  = IPIC_SIFCR_H,
57160                 .bit    = 7,
57161                 .prio_mask = 7,
57162         },
57163 +       [40] = {
57164 +               .mask   = IPIC_SIMSR_H,
57165 +               .prio   = IPIC_SIPRR_B,
57166 +               .force  = IPIC_SIFCR_H,
57167 +               .bit    = 8,
57168 +               .prio_mask = 0,
57169 +       },
57170 +       [41] = {
57171 +               .mask   = IPIC_SIMSR_H,
57172 +               .prio   = IPIC_SIPRR_B,
57173 +               .force  = IPIC_SIFCR_H,
57174 +               .bit    = 9,
57175 +               .prio_mask = 1,
57176 +       },
57177 +       [42] = {
57178 +               .mask   = IPIC_SIMSR_H,
57179 +               .prio   = IPIC_SIPRR_B,
57180 +               .force  = IPIC_SIFCR_H,
57181 +               .bit    = 10,
57182 +               .prio_mask = 2,
57183 +       },
57184 +       [43] = {
57185 +               .mask   = IPIC_SIMSR_H,
57186 +               .prio   = IPIC_SIPRR_B,
57187 +               .force  = IPIC_SIFCR_H,
57188 +               .bit    = 11,
57189 +               .prio_mask = 3,
57190 +       },
57191 +       [44] = {
57192 +               .mask   = IPIC_SIMSR_H,
57193 +               .prio   = IPIC_SIPRR_B,
57194 +               .force  = IPIC_SIFCR_H,
57195 +               .bit    = 12,
57196 +               .prio_mask = 4,
57197 +       },
57198 +       [45] = {
57199 +               .mask   = IPIC_SIMSR_H,
57200 +               .prio   = IPIC_SIPRR_B,
57201 +               .force  = IPIC_SIFCR_H,
57202 +               .bit    = 13,
57203 +               .prio_mask = 5,
57204 +       },
57205 +       [46] = {
57206 +               .mask   = IPIC_SIMSR_H,
57207 +               .prio   = IPIC_SIPRR_B,
57208 +               .force  = IPIC_SIFCR_H,
57209 +               .bit    = 14,
57210 +               .prio_mask = 6,
57211 +       },
57212 +       [47] = {
57213 +               .mask   = IPIC_SIMSR_H,
57214 +               .prio   = IPIC_SIPRR_B,
57215 +               .force  = IPIC_SIFCR_H,
57216 +               .bit    = 15,
57217 +               .prio_mask = 7,
57218 +       },
57219         [48] = {
57220 -               .pend   = IPIC_SEPNR,
57221                 .mask   = IPIC_SEMSR,
57222                 .prio   = IPIC_SMPRR_A,
57223                 .force  = IPIC_SEFCR,
57224 @@ -210,7 +322,6 @@
57225                 .prio_mask = 4,
57226         },
57227         [64] = {
57228 -               .pend   = IPIC_SIPNR_L,
57229                 .mask   = IPIC_SIMSR_L,
57230                 .prio   = IPIC_SMPRR_A,
57231                 .force  = IPIC_SIFCR_L,
57232 @@ -218,7 +329,6 @@
57233                 .prio_mask = 0,
57234         },
57235         [65] = {
57236 -               .pend   = IPIC_SIPNR_L,
57237                 .mask   = IPIC_SIMSR_L,
57238                 .prio   = IPIC_SMPRR_A,
57239                 .force  = IPIC_SIFCR_L,
57240 @@ -226,7 +336,6 @@
57241                 .prio_mask = 1,
57242         },
57243         [66] = {
57244 -               .pend   = IPIC_SIPNR_L,
57245                 .mask   = IPIC_SIMSR_L,
57246                 .prio   = IPIC_SMPRR_A,
57247                 .force  = IPIC_SIFCR_L,
57248 @@ -234,7 +343,6 @@
57249                 .prio_mask = 2,
57250         },
57251         [67] = {
57252 -               .pend   = IPIC_SIPNR_L,
57253                 .mask   = IPIC_SIMSR_L,
57254                 .prio   = IPIC_SMPRR_A,
57255                 .force  = IPIC_SIFCR_L,
57256 @@ -242,7 +350,6 @@
57257                 .prio_mask = 3,
57258         },
57259         [68] = {
57260 -               .pend   = IPIC_SIPNR_L,
57261                 .mask   = IPIC_SIMSR_L,
57262                 .prio   = IPIC_SMPRR_B,
57263                 .force  = IPIC_SIFCR_L,
57264 @@ -250,7 +357,6 @@
57265                 .prio_mask = 0,
57266         },
57267         [69] = {
57268 -               .pend   = IPIC_SIPNR_L,
57269                 .mask   = IPIC_SIMSR_L,
57270                 .prio   = IPIC_SMPRR_B,
57271                 .force  = IPIC_SIFCR_L,
57272 @@ -258,7 +364,6 @@
57273                 .prio_mask = 1,
57274         },
57275         [70] = {
57276 -               .pend   = IPIC_SIPNR_L,
57277                 .mask   = IPIC_SIMSR_L,
57278                 .prio   = IPIC_SMPRR_B,
57279                 .force  = IPIC_SIFCR_L,
57280 @@ -266,7 +371,6 @@
57281                 .prio_mask = 2,
57282         },
57283         [71] = {
57284 -               .pend   = IPIC_SIPNR_L,
57285                 .mask   = IPIC_SIMSR_L,
57286                 .prio   = IPIC_SMPRR_B,
57287                 .force  = IPIC_SIFCR_L,
57288 @@ -274,91 +378,120 @@
57289                 .prio_mask = 3,
57290         },
57291         [72] = {
57292 -               .pend   = IPIC_SIPNR_L,
57293                 .mask   = IPIC_SIMSR_L,
57294                 .prio   = 0,
57295                 .force  = IPIC_SIFCR_L,
57296                 .bit    = 8,
57297         },
57298         [73] = {
57299 -               .pend   = IPIC_SIPNR_L,
57300                 .mask   = IPIC_SIMSR_L,
57301                 .prio   = 0,
57302                 .force  = IPIC_SIFCR_L,
57303                 .bit    = 9,
57304         },
57305         [74] = {
57306 -               .pend   = IPIC_SIPNR_L,
57307                 .mask   = IPIC_SIMSR_L,
57308                 .prio   = 0,
57309                 .force  = IPIC_SIFCR_L,
57310                 .bit    = 10,
57311         },
57312         [75] = {
57313 -               .pend   = IPIC_SIPNR_L,
57314                 .mask   = IPIC_SIMSR_L,
57315                 .prio   = 0,
57316                 .force  = IPIC_SIFCR_L,
57317                 .bit    = 11,
57318         },
57319         [76] = {
57320 -               .pend   = IPIC_SIPNR_L,
57321                 .mask   = IPIC_SIMSR_L,
57322                 .prio   = 0,
57323                 .force  = IPIC_SIFCR_L,
57324                 .bit    = 12,
57325         },
57326         [77] = {
57327 -               .pend   = IPIC_SIPNR_L,
57328                 .mask   = IPIC_SIMSR_L,
57329                 .prio   = 0,
57330                 .force  = IPIC_SIFCR_L,
57331                 .bit    = 13,
57332         },
57333         [78] = {
57334 -               .pend   = IPIC_SIPNR_L,
57335                 .mask   = IPIC_SIMSR_L,
57336                 .prio   = 0,
57337                 .force  = IPIC_SIFCR_L,
57338                 .bit    = 14,
57339         },
57340         [79] = {
57341 -               .pend   = IPIC_SIPNR_L,
57342                 .mask   = IPIC_SIMSR_L,
57343                 .prio   = 0,
57344                 .force  = IPIC_SIFCR_L,
57345                 .bit    = 15,
57346         },
57347         [80] = {
57348 -               .pend   = IPIC_SIPNR_L,
57349                 .mask   = IPIC_SIMSR_L,
57350                 .prio   = 0,
57351                 .force  = IPIC_SIFCR_L,
57352                 .bit    = 16,
57353         },
57354 +       [81] = {
57355 +               .mask   = IPIC_SIMSR_L,
57356 +               .prio   = 0,
57357 +               .force  = IPIC_SIFCR_L,
57358 +               .bit    = 17,
57359 +       },
57360 +       [82] = {
57361 +               .mask   = IPIC_SIMSR_L,
57362 +               .prio   = 0,
57363 +               .force  = IPIC_SIFCR_L,
57364 +               .bit    = 18,
57365 +       },
57366 +       [83] = {
57367 +               .mask   = IPIC_SIMSR_L,
57368 +               .prio   = 0,
57369 +               .force  = IPIC_SIFCR_L,
57370 +               .bit    = 19,
57371 +       },
57372         [84] = {
57373 -               .pend   = IPIC_SIPNR_L,
57374                 .mask   = IPIC_SIMSR_L,
57375                 .prio   = 0,
57376                 .force  = IPIC_SIFCR_L,
57377                 .bit    = 20,
57378         },
57379         [85] = {
57380 -               .pend   = IPIC_SIPNR_L,
57381                 .mask   = IPIC_SIMSR_L,
57382                 .prio   = 0,
57383                 .force  = IPIC_SIFCR_L,
57384                 .bit    = 21,
57385         },
57386 +       [86] = {
57387 +               .mask   = IPIC_SIMSR_L,
57388 +               .prio   = 0,
57389 +               .force  = IPIC_SIFCR_L,
57390 +               .bit    = 22,
57391 +       },
57392 +       [87] = {
57393 +               .mask   = IPIC_SIMSR_L,
57394 +               .prio   = 0,
57395 +               .force  = IPIC_SIFCR_L,
57396 +               .bit    = 23,
57397 +       },
57398 +       [88] = {
57399 +               .mask   = IPIC_SIMSR_L,
57400 +               .prio   = 0,
57401 +               .force  = IPIC_SIFCR_L,
57402 +               .bit    = 24,
57403 +       },
57404 +       [89] = {
57405 +               .mask   = IPIC_SIMSR_L,
57406 +               .prio   = 0,
57407 +               .force  = IPIC_SIFCR_L,
57408 +               .bit    = 25,
57409 +       },
57410         [90] = {
57411 -               .pend   = IPIC_SIPNR_L,
57412                 .mask   = IPIC_SIMSR_L,
57413                 .prio   = 0,
57414                 .force  = IPIC_SIFCR_L,
57415                 .bit    = 26,
57416         },
57417         [91] = {
57418 -               .pend   = IPIC_SIPNR_L,
57419                 .mask   = IPIC_SIMSR_L,
57420                 .prio   = 0,
57421                 .force  = IPIC_SIFCR_L,
57422 @@ -412,6 +545,10 @@
57423         temp &= ~(1 << (31 - ipic_info[src].bit));
57424         ipic_write(ipic->regs, ipic_info[src].mask, temp);
57425  
57426 +       /* mb() can't guarantee that masking is finished.  But it does finish
57427 +        * for nearly all cases. */
57428 +       mb();
57429 +
57430         spin_unlock_irqrestore(&ipic_lock, flags);
57431  }
57432  
57433 @@ -424,9 +561,13 @@
57434  
57435         spin_lock_irqsave(&ipic_lock, flags);
57436  
57437 -       temp = ipic_read(ipic->regs, ipic_info[src].pend);
57438 +       temp = ipic_read(ipic->regs, ipic_info[src].ack);
57439         temp |= (1 << (31 - ipic_info[src].bit));
57440 -       ipic_write(ipic->regs, ipic_info[src].pend, temp);
57441 +       ipic_write(ipic->regs, ipic_info[src].ack, temp);
57442 +
57443 +       /* mb() can't guarantee that ack is finished.  But it does finish
57444 +        * for nearly all cases. */
57445 +       mb();
57446  
57447         spin_unlock_irqrestore(&ipic_lock, flags);
57448  }
57449 @@ -444,9 +585,13 @@
57450         temp &= ~(1 << (31 - ipic_info[src].bit));
57451         ipic_write(ipic->regs, ipic_info[src].mask, temp);
57452  
57453 -       temp = ipic_read(ipic->regs, ipic_info[src].pend);
57454 +       temp = ipic_read(ipic->regs, ipic_info[src].ack);
57455         temp |= (1 << (31 - ipic_info[src].bit));
57456 -       ipic_write(ipic->regs, ipic_info[src].pend, temp);
57457 +       ipic_write(ipic->regs, ipic_info[src].ack, temp);
57458 +
57459 +       /* mb() can't guarantee that ack is finished.  But it does finish
57460 +        * for nearly all cases. */
57461 +       mb();
57462  
57463         spin_unlock_irqrestore(&ipic_lock, flags);
57464  }
57465 @@ -468,14 +613,22 @@
57466                         flow_type);
57467                 return -EINVAL;
57468         }
57469 +       /* ipic supports only edge mode on external interrupts */
57470 +       if ((flow_type & IRQ_TYPE_EDGE_FALLING) && !ipic_info[src].ack) {
57471 +               printk(KERN_ERR "ipic: edge sense not supported on internal "
57472 +                               "interrupts\n");
57473 +               return -EINVAL;
57474 +       }
57475  
57476         desc->status &= ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL);
57477         desc->status |= flow_type & IRQ_TYPE_SENSE_MASK;
57478         if (flow_type & IRQ_TYPE_LEVEL_LOW)  {
57479                 desc->status |= IRQ_LEVEL;
57480                 desc->handle_irq = handle_level_irq;
57481 +               desc->chip = &ipic_level_irq_chip;
57482         } else {
57483                 desc->handle_irq = handle_edge_irq;
57484 +               desc->chip = &ipic_edge_irq_chip;
57485         }
57486  
57487         /* only EXT IRQ senses are programmable on ipic
57488 @@ -500,7 +653,16 @@
57489         return 0;
57490  }
57491  
57492 -static struct irq_chip ipic_irq_chip = {
57493 +/* level interrupts and edge interrupts have different ack operations */
57494 +static struct irq_chip ipic_level_irq_chip = {
57495 +       .typename       = " IPIC  ",
57496 +       .unmask         = ipic_unmask_irq,
57497 +       .mask           = ipic_mask_irq,
57498 +       .mask_ack       = ipic_mask_irq,
57499 +       .set_type       = ipic_set_irq_type,
57500 +};
57501 +
57502 +static struct irq_chip ipic_edge_irq_chip = {
57503         .typename       = " IPIC  ",
57504         .unmask         = ipic_unmask_irq,
57505         .mask           = ipic_mask_irq,
57506 @@ -519,13 +681,9 @@
57507                          irq_hw_number_t hw)
57508  {
57509         struct ipic *ipic = h->host_data;
57510 -       struct irq_chip *chip;
57511 -
57512 -       /* Default chip */
57513 -       chip = &ipic->hc_irq;
57514  
57515         set_irq_chip_data(virq, ipic);
57516 -       set_irq_chip_and_handler(virq, chip, handle_level_irq);
57517 +       set_irq_chip_and_handler(virq, &ipic_level_irq_chip, handle_level_irq);
57518  
57519         /* Set default irq type */
57520         set_irq_type(virq, IRQ_TYPE_NONE);
57521 @@ -584,7 +742,6 @@
57522         ipic->regs = ioremap(res.start, res.end - res.start + 1);
57523  
57524         ipic->irqhost->host_data = ipic;
57525 -       ipic->hc_irq = ipic_irq_chip;
57526  
57527         /* init hw */
57528         ipic_write(ipic->regs, IPIC_SICNR, 0x0);
57529 @@ -593,6 +750,10 @@
57530          * configure SICFR accordingly */
57531         if (flags & IPIC_SPREADMODE_GRP_A)
57532                 temp |= SICFR_IPSA;
57533 +       if (flags & IPIC_SPREADMODE_GRP_B)
57534 +               temp |= SICFR_IPSB;
57535 +       if (flags & IPIC_SPREADMODE_GRP_C)
57536 +               temp |= SICFR_IPSC;
57537         if (flags & IPIC_SPREADMODE_GRP_D)
57538                 temp |= SICFR_IPSD;
57539         if (flags & IPIC_SPREADMODE_MIX_A)
57540 @@ -600,7 +761,7 @@
57541         if (flags & IPIC_SPREADMODE_MIX_B)
57542                 temp |= SICFR_MPSB;
57543  
57544 -       ipic_write(ipic->regs, IPIC_SICNR, temp);
57545 +       ipic_write(ipic->regs, IPIC_SICFR, temp);
57546  
57547         /* handle MCP route */
57548         temp = 0;
57549 @@ -672,10 +833,12 @@
57550  
57551  void ipic_set_default_priority(void)
57552  {
57553 -       ipic_write(primary_ipic->regs, IPIC_SIPRR_A, IPIC_SIPRR_A_DEFAULT);
57554 -       ipic_write(primary_ipic->regs, IPIC_SIPRR_D, IPIC_SIPRR_D_DEFAULT);
57555 -       ipic_write(primary_ipic->regs, IPIC_SMPRR_A, IPIC_SMPRR_A_DEFAULT);
57556 -       ipic_write(primary_ipic->regs, IPIC_SMPRR_B, IPIC_SMPRR_B_DEFAULT);
57557 +       ipic_write(primary_ipic->regs, IPIC_SIPRR_A, IPIC_PRIORITY_DEFAULT);
57558 +       ipic_write(primary_ipic->regs, IPIC_SIPRR_B, IPIC_PRIORITY_DEFAULT);
57559 +       ipic_write(primary_ipic->regs, IPIC_SIPRR_C, IPIC_PRIORITY_DEFAULT);
57560 +       ipic_write(primary_ipic->regs, IPIC_SIPRR_D, IPIC_PRIORITY_DEFAULT);
57561 +       ipic_write(primary_ipic->regs, IPIC_SMPRR_A, IPIC_PRIORITY_DEFAULT);
57562 +       ipic_write(primary_ipic->regs, IPIC_SMPRR_B, IPIC_PRIORITY_DEFAULT);
57563  }
57564  
57565  void ipic_enable_mcp(enum ipic_mcp_irq mcp_irq)
57566 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/sysdev/ipic.h powerpc.git/arch/powerpc/sysdev/ipic.h
57567 --- linux-2.6.24/arch/powerpc/sysdev/ipic.h     2008-01-24 23:58:37.000000000 +0100
57568 +++ powerpc.git/arch/powerpc/sysdev/ipic.h      2008-01-28 20:25:49.000000000 +0100
57569 @@ -23,13 +23,12 @@
57570  #define IPIC_IRQ_EXT7 23
57571  
57572  /* Default Priority Registers */
57573 -#define IPIC_SIPRR_A_DEFAULT 0x05309770
57574 -#define IPIC_SIPRR_D_DEFAULT 0x05309770
57575 -#define IPIC_SMPRR_A_DEFAULT 0x05309770
57576 -#define IPIC_SMPRR_B_DEFAULT 0x05309770
57577 +#define IPIC_PRIORITY_DEFAULT 0x05309770
57578  
57579  /* System Global Interrupt Configuration Register */
57580  #define        SICFR_IPSA      0x00010000
57581 +#define        SICFR_IPSB      0x00020000
57582 +#define        SICFR_IPSC      0x00040000
57583  #define        SICFR_IPSD      0x00080000
57584  #define        SICFR_MPSA      0x00200000
57585  #define        SICFR_MPSB      0x00400000
57586 @@ -45,13 +44,11 @@
57587  
57588         /* The remapper for this IPIC */
57589         struct irq_host         *irqhost;
57590 -
57591 -       /* The "linux" controller struct */
57592 -       struct irq_chip         hc_irq;
57593  };
57594  
57595  struct ipic_info {
57596 -       u8      pend;           /* pending register offset from base */
57597 +       u8      ack;            /* pending register offset from base if the irq
57598 +                                  supports ack operation */
57599         u8      mask;           /* mask register offset from base */
57600         u8      prio;           /* priority register offset from base */
57601         u8      force;          /* force register offset from base */
57602 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/sysdev/mmio_nvram.c powerpc.git/arch/powerpc/sysdev/mmio_nvram.c
57603 --- linux-2.6.24/arch/powerpc/sysdev/mmio_nvram.c       2008-01-24 23:58:37.000000000 +0100
57604 +++ powerpc.git/arch/powerpc/sysdev/mmio_nvram.c        2008-01-28 20:25:49.000000000 +0100
57605 @@ -99,7 +99,7 @@
57606         nvram_addr = r.start;
57607         mmio_nvram_len = r.end - r.start + 1;
57608         if ( (!mmio_nvram_len) || (!nvram_addr) ) {
57609 -               printk(KERN_WARNING "nvram: address or lenght is 0\n");
57610 +               printk(KERN_WARNING "nvram: address or length is 0\n");
57611                 ret = -EIO;
57612                 goto out;
57613         }
57614 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/sysdev/mpic.c powerpc.git/arch/powerpc/sysdev/mpic.c
57615 --- linux-2.6.24/arch/powerpc/sysdev/mpic.c     2008-01-24 23:58:37.000000000 +0100
57616 +++ powerpc.git/arch/powerpc/sysdev/mpic.c      2008-01-28 20:25:49.000000000 +0100
57617 @@ -83,6 +83,7 @@
57618                 MPIC_CPU_WHOAMI,
57619                 MPIC_CPU_INTACK,
57620                 MPIC_CPU_EOI,
57621 +               MPIC_CPU_MCACK,
57622  
57623                 MPIC_IRQ_BASE,
57624                 MPIC_IRQ_STRIDE,
57625 @@ -121,6 +122,7 @@
57626                 TSI108_CPU_WHOAMI,
57627                 TSI108_CPU_INTACK,
57628                 TSI108_CPU_EOI,
57629 +               TSI108_CPU_MCACK,
57630  
57631                 TSI108_IRQ_BASE,
57632                 TSI108_IRQ_STRIDE,
57633 @@ -265,7 +267,7 @@
57634   */
57635  
57636  
57637 -static void _mpic_map_mmio(struct mpic *mpic, unsigned long phys_addr,
57638 +static void _mpic_map_mmio(struct mpic *mpic, phys_addr_t phys_addr,
57639                            struct mpic_reg_bank *rb, unsigned int offset,
57640                            unsigned int size)
57641  {
57642 @@ -285,7 +287,7 @@
57643         BUG_ON(!DCR_MAP_OK(rb->dhost));
57644  }
57645  
57646 -static inline void mpic_map(struct mpic *mpic, unsigned long phys_addr,
57647 +static inline void mpic_map(struct mpic *mpic, phys_addr_t phys_addr,
57648                             struct mpic_reg_bank *rb, unsigned int offset,
57649                             unsigned int size)
57650  {
57651 @@ -612,12 +614,11 @@
57652  }
57653  
57654  #ifdef CONFIG_SMP
57655 -static irqreturn_t mpic_ipi_action(int irq, void *dev_id)
57656 +static irqreturn_t mpic_ipi_action(int irq, void *data)
57657  {
57658 -       struct mpic *mpic;
57659 +       long ipi = (long)data;
57660  
57661 -       mpic = mpic_find(irq, NULL);
57662 -       smp_message_recv(mpic_irq_to_hw(irq) - mpic->ipi_vecs[0]);
57663 +       smp_message_recv(ipi);
57664  
57665         return IRQ_HANDLED;
57666  }
57667 @@ -842,6 +843,24 @@
57668         return 0;
57669  }
57670  
57671 +void mpic_set_vector(unsigned int virq, unsigned int vector)
57672 +{
57673 +       struct mpic *mpic = mpic_from_irq(virq);
57674 +       unsigned int src = mpic_irq_to_hw(virq);
57675 +       unsigned int vecpri;
57676 +
57677 +       DBG("mpic: set_vector(mpic:@%p,virq:%d,src:%d,vector:0x%x)\n",
57678 +           mpic, virq, src, vector);
57679 +
57680 +       if (src >= mpic->irq_count)
57681 +               return;
57682 +
57683 +       vecpri = mpic_irq_read(src, MPIC_INFO(IRQ_VECTOR_PRI));
57684 +       vecpri = vecpri & ~MPIC_INFO(VECPRI_VECTOR_MASK);
57685 +       vecpri |= vector;
57686 +       mpic_irq_write(src, MPIC_INFO(IRQ_VECTOR_PRI), vecpri);
57687 +}
57688 +
57689  static struct irq_chip mpic_irq_chip = {
57690         .mask           = mpic_mask_irq,
57691         .unmask         = mpic_unmask_irq,
57692 @@ -1109,6 +1128,11 @@
57693                         mb();
57694         }
57695  
57696 +       if (flags & MPIC_ENABLE_MCK)
57697 +               mpic_write(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0),
57698 +                          mpic_read(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0))
57699 +                          | MPIC_GREG_GCONF_MCK);
57700 +
57701         /* Read feature register, calculate num CPUs and, for non-ISU
57702          * MPICs, num sources as well. On ISU MPICs, sources are counted
57703          * as ISUs are added
57704 @@ -1230,6 +1254,8 @@
57705                 mpic_u3msi_init(mpic);
57706         }
57707  
57708 +       mpic_pasemi_msi_init(mpic);
57709 +
57710         for (i = 0; i < mpic->num_sources; i++) {
57711                 /* start with vector = source number, and masked */
57712                 u32 vecpri = MPIC_VECPRI_MASK | i |
57713 @@ -1253,6 +1279,11 @@
57714                            mpic_read(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0))
57715                            | MPIC_GREG_GCONF_8259_PTHROU_DIS);
57716  
57717 +       if (mpic->flags & MPIC_NO_BIAS)
57718 +               mpic_write(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0),
57719 +                       mpic_read(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0))
57720 +                       | MPIC_GREG_GCONF_NO_BIAS);
57721 +
57722         /* Set current processor priority to 0 */
57723         mpic_cpu_write(MPIC_INFO(CPU_CURRENT_TASK_PRI), 0);
57724  
57725 @@ -1419,13 +1450,13 @@
57726                        mpic_physmask(cpu_mask & cpus_addr(cpu_online_map)[0]));
57727  }
57728  
57729 -unsigned int mpic_get_one_irq(struct mpic *mpic)
57730 +static unsigned int _mpic_get_one_irq(struct mpic *mpic, int reg)
57731  {
57732         u32 src;
57733  
57734 -       src = mpic_cpu_read(MPIC_INFO(CPU_INTACK)) & MPIC_INFO(VECPRI_VECTOR_MASK);
57735 +       src = mpic_cpu_read(reg) & MPIC_INFO(VECPRI_VECTOR_MASK);
57736  #ifdef DEBUG_LOW
57737 -       DBG("%s: get_one_irq(): %d\n", mpic->name, src);
57738 +       DBG("%s: get_one_irq(reg 0x%x): %d\n", mpic->name, reg, src);
57739  #endif
57740         if (unlikely(src == mpic->spurious_vec)) {
57741                 if (mpic->flags & MPIC_SPV_EOI)
57742 @@ -1443,6 +1474,11 @@
57743         return irq_linear_revmap(mpic->irqhost, src);
57744  }
57745  
57746 +unsigned int mpic_get_one_irq(struct mpic *mpic)
57747 +{
57748 +       return _mpic_get_one_irq(mpic, MPIC_INFO(CPU_INTACK));
57749 +}
57750 +
57751  unsigned int mpic_get_irq(void)
57752  {
57753         struct mpic *mpic = mpic_primary;
57754 @@ -1452,12 +1488,20 @@
57755         return mpic_get_one_irq(mpic);
57756  }
57757  
57758 +unsigned int mpic_get_mcirq(void)
57759 +{
57760 +       struct mpic *mpic = mpic_primary;
57761 +
57762 +       BUG_ON(mpic == NULL);
57763 +
57764 +       return _mpic_get_one_irq(mpic, MPIC_INFO(CPU_MCACK));
57765 +}
57766  
57767  #ifdef CONFIG_SMP
57768  void mpic_request_ipis(void)
57769  {
57770         struct mpic *mpic = mpic_primary;
57771 -       int i, err;
57772 +       long i, err;
57773         static char *ipi_names[] = {
57774                 "IPI0 (call function)",
57775                 "IPI1 (reschedule)",
57776 @@ -1472,14 +1516,14 @@
57777                 unsigned int vipi = irq_create_mapping(mpic->irqhost,
57778                                                        mpic->ipi_vecs[0] + i);
57779                 if (vipi == NO_IRQ) {
57780 -                       printk(KERN_ERR "Failed to map IPI %d\n", i);
57781 +                       printk(KERN_ERR "Failed to map IPI %ld\n", i);
57782                         break;
57783                 }
57784                 err = request_irq(vipi, mpic_ipi_action,
57785                                   IRQF_DISABLED|IRQF_PERCPU,
57786 -                                 ipi_names[i], mpic);
57787 +                                 ipi_names[i], (void *)i);
57788                 if (err) {
57789 -                       printk(KERN_ERR "Request of irq %d for IPI %d failed\n",
57790 +                       printk(KERN_ERR "Request of irq %d for IPI %ld failed\n",
57791                                vipi, i);
57792                         break;
57793                 }
57794 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/sysdev/mpic.h powerpc.git/arch/powerpc/sysdev/mpic.h
57795 --- linux-2.6.24/arch/powerpc/sysdev/mpic.h     2008-01-24 23:58:37.000000000 +0100
57796 +++ powerpc.git/arch/powerpc/sysdev/mpic.h      2008-01-28 20:25:49.000000000 +0100
57797 @@ -17,6 +17,7 @@
57798  extern irq_hw_number_t mpic_msi_alloc_hwirqs(struct mpic *mpic, int num);
57799  extern void mpic_msi_free_hwirqs(struct mpic *mpic, int offset, int num);
57800  extern int mpic_u3msi_init(struct mpic *mpic);
57801 +extern int mpic_pasemi_msi_init(struct mpic *mpic);
57802  #else
57803  static inline void mpic_msi_reserve_hwirq(struct mpic *mpic,
57804                                           irq_hw_number_t hwirq)
57805 @@ -28,12 +29,15 @@
57806  {
57807         return -1;
57808  }
57809 +
57810 +static inline int mpic_pasemi_msi_init(struct mpic *mpic)
57811 +{
57812 +       return -1;
57813 +}
57814  #endif
57815  
57816  extern int mpic_set_irq_type(unsigned int virq, unsigned int flow_type);
57817 -extern void mpic_end_irq(unsigned int irq);
57818 -extern void mpic_mask_irq(unsigned int irq);
57819 -extern void mpic_unmask_irq(unsigned int irq);
57820 +extern void mpic_set_vector(unsigned int virq, unsigned int vector);
57821  extern void mpic_set_affinity(unsigned int irq, cpumask_t cpumask);
57822  
57823  #endif /* _POWERPC_SYSDEV_MPIC_H */
57824 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/sysdev/mpic_pasemi_msi.c powerpc.git/arch/powerpc/sysdev/mpic_pasemi_msi.c
57825 --- linux-2.6.24/arch/powerpc/sysdev/mpic_pasemi_msi.c  1970-01-01 01:00:00.000000000 +0100
57826 +++ powerpc.git/arch/powerpc/sysdev/mpic_pasemi_msi.c   2008-01-28 20:25:49.000000000 +0100
57827 @@ -0,0 +1,172 @@
57828 +/*
57829 + * Copyright 2007, Olof Johansson, PA Semi
57830 + *
57831 + * Based on arch/powerpc/sysdev/mpic_u3msi.c:
57832 + *
57833 + * Copyright 2006, Segher Boessenkool, IBM Corporation.
57834 + * Copyright 2006-2007, Michael Ellerman, IBM Corporation.
57835 + *
57836 + * This program is free software; you can redistribute it and/or
57837 + * modify it under the terms of the GNU General Public License
57838 + * as published by the Free Software Foundation; version 2 of the
57839 + * License.
57840 + *
57841 + */
57842 +
57843 +#undef DEBUG
57844 +
57845 +#include <linux/irq.h>
57846 +#include <linux/bootmem.h>
57847 +#include <linux/msi.h>
57848 +#include <asm/mpic.h>
57849 +#include <asm/prom.h>
57850 +#include <asm/hw_irq.h>
57851 +#include <asm/ppc-pci.h>
57852 +
57853 +#include "mpic.h"
57854 +
57855 +/* Allocate 16 interrupts per device, to give an alignment of 16,
57856 + * since that's the size of the grouping w.r.t. affinity. If someone
57857 + * needs more than 32 MSI's down the road we'll have to rethink this,
57858 + * but it should be OK for now.
57859 + */
57860 +#define ALLOC_CHUNK 16
57861 +
57862 +#define PASEMI_MSI_ADDR 0xfc080000
57863 +
57864 +/* A bit ugly, can we get this from the pci_dev somehow? */
57865 +static struct mpic *msi_mpic;
57866 +
57867 +
57868 +static void mpic_pasemi_msi_mask_irq(unsigned int irq)
57869 +{
57870 +       pr_debug("mpic_pasemi_msi_mask_irq %d\n", irq);
57871 +       mask_msi_irq(irq);
57872 +       mpic_mask_irq(irq);
57873 +}
57874 +
57875 +static void mpic_pasemi_msi_unmask_irq(unsigned int irq)
57876 +{
57877 +       pr_debug("mpic_pasemi_msi_unmask_irq %d\n", irq);
57878 +       mpic_unmask_irq(irq);
57879 +       unmask_msi_irq(irq);
57880 +}
57881 +
57882 +static struct irq_chip mpic_pasemi_msi_chip = {
57883 +       .shutdown       = mpic_pasemi_msi_mask_irq,
57884 +       .mask           = mpic_pasemi_msi_mask_irq,
57885 +       .unmask         = mpic_pasemi_msi_unmask_irq,
57886 +       .eoi            = mpic_end_irq,
57887 +       .set_type       = mpic_set_irq_type,
57888 +       .set_affinity   = mpic_set_affinity,
57889 +       .typename       = "PASEMI-MSI ",
57890 +};
57891 +
57892 +static int pasemi_msi_check_device(struct pci_dev *pdev, int nvec, int type)
57893 +{
57894 +       if (type == PCI_CAP_ID_MSIX)
57895 +               pr_debug("pasemi_msi: MSI-X untested, trying anyway\n");
57896 +
57897 +       return 0;
57898 +}
57899 +
57900 +static void pasemi_msi_teardown_msi_irqs(struct pci_dev *pdev)
57901 +{
57902 +       struct msi_desc *entry;
57903 +
57904 +       pr_debug("pasemi_msi_teardown_msi_irqs, pdev %p\n", pdev);
57905 +
57906 +       list_for_each_entry(entry, &pdev->msi_list, list) {
57907 +               if (entry->irq == NO_IRQ)
57908 +                       continue;
57909 +
57910 +               set_irq_msi(entry->irq, NULL);
57911 +               mpic_msi_free_hwirqs(msi_mpic, virq_to_hw(entry->irq),
57912 +                                    ALLOC_CHUNK);
57913 +               irq_dispose_mapping(entry->irq);
57914 +       }
57915 +
57916 +       return;
57917 +}
57918 +
57919 +static int pasemi_msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
57920 +{
57921 +       irq_hw_number_t hwirq;
57922 +       unsigned int virq;
57923 +       struct msi_desc *entry;
57924 +       struct msi_msg msg;
57925 +       u64 addr;
57926 +
57927 +       pr_debug("pasemi_msi_setup_msi_irqs, pdev %p nvec %d type %d\n",
57928 +                pdev, nvec, type);
57929 +
57930 +       msg.address_hi = 0;
57931 +       msg.address_lo = PASEMI_MSI_ADDR;
57932 +
57933 +       list_for_each_entry(entry, &pdev->msi_list, list) {
57934 +               /* Allocate 16 interrupts for now, since that's the grouping for
57935 +                * affinity. This can be changed later if it turns out 32 is too
57936 +                * few MSIs for someone, but restrictions will apply to how the
57937 +                * sources can be changed independently.
57938 +                */
57939 +               hwirq = mpic_msi_alloc_hwirqs(msi_mpic, ALLOC_CHUNK);
57940 +               if (hwirq < 0) {
57941 +                       pr_debug("pasemi_msi: failed allocating hwirq\n");
57942 +                       return hwirq;
57943 +               }
57944 +
57945 +               virq = irq_create_mapping(msi_mpic->irqhost, hwirq);
57946 +               if (virq == NO_IRQ) {
57947 +                       pr_debug("pasemi_msi: failed mapping hwirq 0x%lx\n", hwirq);
57948 +                       mpic_msi_free_hwirqs(msi_mpic, hwirq, ALLOC_CHUNK);
57949 +                       return -ENOSPC;
57950 +               }
57951 +
57952 +               /* Vector on MSI is really an offset, the hardware adds
57953 +                * it to the value written at the magic address. So set
57954 +                * it to 0 to remain sane.
57955 +                */
57956 +               mpic_set_vector(virq, 0);
57957 +
57958 +               set_irq_msi(virq, entry);
57959 +               set_irq_chip(virq, &mpic_pasemi_msi_chip);
57960 +               set_irq_type(virq, IRQ_TYPE_EDGE_RISING);
57961 +
57962 +               pr_debug("pasemi_msi: allocated virq 0x%x (hw 0x%lx) addr 0x%lx\n",
57963 +                         virq, hwirq, addr);
57964 +
57965 +               /* Likewise, the device writes [0...511] into the target
57966 +                * register to generate MSI [512...1023]
57967 +                */
57968 +               msg.data = hwirq-0x200;
57969 +               write_msi_msg(virq, &msg);
57970 +       }
57971 +
57972 +       return 0;
57973 +}
57974 +
57975 +int mpic_pasemi_msi_init(struct mpic *mpic)
57976 +{
57977 +       int rc;
57978 +
57979 +       if (!mpic->irqhost->of_node ||
57980 +           !of_device_is_compatible(mpic->irqhost->of_node,
57981 +                                    "pasemi,pwrficient-openpic"))
57982 +               return -ENODEV;
57983 +
57984 +       rc = mpic_msi_init_allocator(mpic);
57985 +       if (rc) {
57986 +               pr_debug("pasemi_msi: Error allocating bitmap!\n");
57987 +               return rc;
57988 +       }
57989 +
57990 +       pr_debug("pasemi_msi: Registering PA Semi MPIC MSI callbacks\n");
57991 +
57992 +       msi_mpic = mpic;
57993 +       WARN_ON(ppc_md.setup_msi_irqs);
57994 +       ppc_md.setup_msi_irqs = pasemi_msi_setup_msi_irqs;
57995 +       ppc_md.teardown_msi_irqs = pasemi_msi_teardown_msi_irqs;
57996 +       ppc_md.msi_check_device = pasemi_msi_check_device;
57997 +
57998 +       return 0;
57999 +}
58000 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/sysdev/mv64x60_dev.c powerpc.git/arch/powerpc/sysdev/mv64x60_dev.c
58001 --- linux-2.6.24/arch/powerpc/sysdev/mv64x60_dev.c      2008-01-24 23:58:37.000000000 +0100
58002 +++ powerpc.git/arch/powerpc/sysdev/mv64x60_dev.c       2008-01-28 20:25:49.000000000 +0100
58003 @@ -241,7 +241,7 @@
58004  
58005         /* only register the shared platform device the first time through */
58006         if (id == 0 && (err = eth_register_shared_pdev(np)))
58007 -               return err;;
58008 +               return err;
58009  
58010         memset(r, 0, sizeof(r));
58011         of_irq_to_resource(np, 0, &r[0]);
58012 @@ -451,22 +451,19 @@
58013         int id;
58014         int err;
58015  
58016 -       for (id = 0;
58017 -            (np = of_find_compatible_node(np, "serial", "marvell,mpsc")); id++)
58018 -               if ((err = mv64x60_mpsc_device_setup(np, id)))
58019 +       id = 0;
58020 +       for_each_compatible_node(np, "serial", "marvell,mpsc")
58021 +               if ((err = mv64x60_mpsc_device_setup(np, id++)))
58022                         goto error;
58023  
58024 -       for (id = 0;
58025 -            (np = of_find_compatible_node(np, "network",
58026 -                                          "marvell,mv64x60-eth"));
58027 -            id++)
58028 -               if ((err = mv64x60_eth_device_setup(np, id)))
58029 +       id = 0;
58030 +       for_each_compatible_node(np, "network", "marvell,mv64x60-eth")
58031 +               if ((err = mv64x60_eth_device_setup(np, id++)))
58032                         goto error;
58033  
58034 -       for (id = 0;
58035 -            (np = of_find_compatible_node(np, "i2c", "marvell,mv64x60-i2c"));
58036 -            id++)
58037 -               if ((err = mv64x60_i2c_device_setup(np, id)))
58038 +       id = 0;
58039 +       for_each_compatible_node(np, "i2c", "marvell,mv64x60-i2c")
58040 +               if ((err = mv64x60_i2c_device_setup(np, id++)))
58041                         goto error;
58042  
58043         /* support up to one watchdog timer */
58044 @@ -477,7 +474,6 @@
58045                 of_node_put(np);
58046         }
58047  
58048 -
58049         return 0;
58050  
58051  error:
58052 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/sysdev/mv64x60_pci.c powerpc.git/arch/powerpc/sysdev/mv64x60_pci.c
58053 --- linux-2.6.24/arch/powerpc/sysdev/mv64x60_pci.c      2008-01-24 23:58:37.000000000 +0100
58054 +++ powerpc.git/arch/powerpc/sysdev/mv64x60_pci.c       2008-01-28 20:25:49.000000000 +0100
58055 @@ -164,8 +164,8 @@
58056  
58057  void __init mv64x60_pci_init(void)
58058  {
58059 -       struct device_node *np = NULL;
58060 +       struct device_node *np;
58061  
58062 -       while ((np = of_find_compatible_node(np, "pci", "marvell,mv64x60-pci")))
58063 +       for_each_compatible_node(np, "pci", "marvell,mv64x60-pci")
58064                 mv64x60_add_bridge(np);
58065  }
58066 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/sysdev/mv64x60_udbg.c powerpc.git/arch/powerpc/sysdev/mv64x60_udbg.c
58067 --- linux-2.6.24/arch/powerpc/sysdev/mv64x60_udbg.c     2008-01-24 23:58:37.000000000 +0100
58068 +++ powerpc.git/arch/powerpc/sysdev/mv64x60_udbg.c      2008-01-28 20:25:49.000000000 +0100
58069 @@ -85,10 +85,10 @@
58070         if (!stdout)
58071                 return;
58072  
58073 -       for (np = NULL;
58074 -            (np = of_find_compatible_node(np, "serial", "marvell,mpsc")); )
58075 +       for_each_compatible_node(np, "serial", "marvell,mpsc") {
58076                 if (np == stdout)
58077                         break;
58078 +       }
58079  
58080         of_node_put(stdout);
58081         if (!np)
58082 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/sysdev/of_rtc.c powerpc.git/arch/powerpc/sysdev/of_rtc.c
58083 --- linux-2.6.24/arch/powerpc/sysdev/of_rtc.c   1970-01-01 01:00:00.000000000 +0100
58084 +++ powerpc.git/arch/powerpc/sysdev/of_rtc.c    2008-01-28 20:25:49.000000000 +0100
58085 @@ -0,0 +1,59 @@
58086 +/*
58087 + * Instantiate mmio-mapped RTC chips based on device tree information
58088 + *
58089 + * Copyright 2007 David Gibson <dwg@au1.ibm.com>, IBM Corporation.
58090 + *
58091 + * This program is free software; you can redistribute  it and/or modify it
58092 + * under  the terms of  the GNU General  Public License as published by the
58093 + * Free Software Foundation;  either version 2 of the  License, or (at your
58094 + * option) any later version.
58095 + */
58096 +#include <linux/kernel.h>
58097 +#include <linux/of.h>
58098 +#include <linux/init.h>
58099 +#include <linux/of_platform.h>
58100 +
58101 +static __initdata struct {
58102 +       const char *compatible;
58103 +       char *plat_name;
58104 +} of_rtc_table[] = {
58105 +       { "ds1743-nvram", "rtc-ds1742" },
58106 +};
58107 +
58108 +void __init of_instantiate_rtc(void)
58109 +{
58110 +       struct device_node *node;
58111 +       int err;
58112 +       int i;
58113 +
58114 +       for (i = 0; i < ARRAY_SIZE(of_rtc_table); i++) {
58115 +               char *plat_name = of_rtc_table[i].plat_name;
58116 +
58117 +               for_each_compatible_node(node, NULL,
58118 +                                        of_rtc_table[i].compatible) {
58119 +                       struct resource *res;
58120 +
58121 +                       res = kmalloc(sizeof(*res), GFP_KERNEL);
58122 +                       if (!res) {
58123 +                               printk(KERN_ERR "OF RTC: Out of memory "
58124 +                                      "allocating resource structure for %s\n",
58125 +                                      node->full_name);
58126 +                               continue;
58127 +                       }
58128 +
58129 +                       err = of_address_to_resource(node, 0, res);
58130 +                       if (err) {
58131 +                               printk(KERN_ERR "OF RTC: Error "
58132 +                                      "translating resources for %s\n",
58133 +                                      node->full_name);
58134 +                               continue;
58135 +                       }
58136 +
58137 +                       printk(KERN_INFO "OF_RTC: %s is a %s @ 0x%llx-0x%llx\n",
58138 +                              node->full_name, plat_name,
58139 +                              (unsigned long long)res->start,
58140 +                              (unsigned long long)res->end);
58141 +                       platform_device_register_simple(plat_name, -1, res, 1);
58142 +               }
58143 +       }
58144 +}
58145 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/sysdev/pmi.c powerpc.git/arch/powerpc/sysdev/pmi.c
58146 --- linux-2.6.24/arch/powerpc/sysdev/pmi.c      2008-01-24 23:58:37.000000000 +0100
58147 +++ powerpc.git/arch/powerpc/sysdev/pmi.c       2008-01-28 20:25:49.000000000 +0100
58148 @@ -28,9 +28,9 @@
58149  #include <linux/completion.h>
58150  #include <linux/spinlock.h>
58151  #include <linux/workqueue.h>
58152 +#include <linux/of_device.h>
58153 +#include <linux/of_platform.h>
58154  
58155 -#include <asm/of_device.h>
58156 -#include <asm/of_platform.h>
58157  #include <asm/io.h>
58158  #include <asm/pmi.h>
58159  #include <asm/prom.h>
58160 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/sysdev/ppc4xx_pci.c powerpc.git/arch/powerpc/sysdev/ppc4xx_pci.c
58161 --- linux-2.6.24/arch/powerpc/sysdev/ppc4xx_pci.c       1970-01-01 01:00:00.000000000 +0100
58162 +++ powerpc.git/arch/powerpc/sysdev/ppc4xx_pci.c        2008-01-28 20:25:49.000000000 +0100
58163 @@ -0,0 +1,1528 @@
58164 +/*
58165 + * PCI / PCI-X / PCI-Express support for 4xx parts
58166 + *
58167 + * Copyright 2007 Ben. Herrenschmidt <benh@kernel.crashing.org>, IBM Corp.
58168 + *
58169 + * Most PCI Express code is coming from Stefan Roese implementation for
58170 + * arch/ppc in the Denx tree, slightly reworked by me.
58171 + *
58172 + * Copyright 2007 DENX Software Engineering, Stefan Roese <sr@denx.de>
58173 + *
58174 + * Some of that comes itself from a previous implementation for 440SPE only
58175 + * by Roland Dreier:
58176 + *
58177 + * Copyright (c) 2005 Cisco Systems.  All rights reserved.
58178 + * Roland Dreier <rolandd@cisco.com>
58179 + *
58180 + */
58181 +
58182 +#undef DEBUG
58183 +
58184 +#include <linux/kernel.h>
58185 +#include <linux/pci.h>
58186 +#include <linux/init.h>
58187 +#include <linux/of.h>
58188 +#include <linux/bootmem.h>
58189 +#include <linux/delay.h>
58190 +
58191 +#include <asm/io.h>
58192 +#include <asm/pci-bridge.h>
58193 +#include <asm/machdep.h>
58194 +#include <asm/dcr.h>
58195 +#include <asm/dcr-regs.h>
58196 +
58197 +#include "ppc4xx_pci.h"
58198 +
58199 +static int dma_offset_set;
58200 +
58201 +/* Move that to a useable header */
58202 +extern unsigned long total_memory;
58203 +
58204 +#define U64_TO_U32_LOW(val)    ((u32)((val) & 0x00000000ffffffffULL))
58205 +#define U64_TO_U32_HIGH(val)   ((u32)((val) >> 32))
58206 +
58207 +#ifdef CONFIG_RESOURCES_64BIT
58208 +#define RES_TO_U32_LOW(val)    U64_TO_U32_LOW(val)
58209 +#define RES_TO_U32_HIGH(val)   U64_TO_U32_HIGH(val)
58210 +#else
58211 +#define RES_TO_U32_LOW(val)    (val)
58212 +#define RES_TO_U32_HIGH(val)   (0)
58213 +#endif
58214 +
58215 +static inline int ppc440spe_revA(void)
58216 +{
58217 +       /* Catch both 440SPe variants, with and without RAID6 support */
58218 +        if ((mfspr(SPRN_PVR) & 0xffefffff) == 0x53421890)
58219 +                return 1;
58220 +        else
58221 +                return 0;
58222 +}
58223 +
58224 +static void fixup_ppc4xx_pci_bridge(struct pci_dev *dev)
58225 +{
58226 +       struct pci_controller *hose;
58227 +       int i;
58228 +
58229 +       if (dev->devfn != 0 || dev->bus->self != NULL)
58230 +               return;
58231 +
58232 +       hose = pci_bus_to_host(dev->bus);
58233 +       if (hose == NULL)
58234 +               return;
58235 +
58236 +       if (!of_device_is_compatible(hose->dn, "ibm,plb-pciex") &&
58237 +           !of_device_is_compatible(hose->dn, "ibm,plb-pcix") &&
58238 +           !of_device_is_compatible(hose->dn, "ibm,plb-pci"))
58239 +               return;
58240 +
58241 +       /* Hide the PCI host BARs from the kernel as their content doesn't
58242 +        * fit well in the resource management
58243 +        */
58244 +       for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
58245 +               dev->resource[i].start = dev->resource[i].end = 0;
58246 +               dev->resource[i].flags = 0;
58247 +       }
58248 +
58249 +       printk(KERN_INFO "PCI: Hiding 4xx host bridge resources %s\n",
58250 +              pci_name(dev));
58251 +}
58252 +DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, fixup_ppc4xx_pci_bridge);
58253 +
58254 +static int __init ppc4xx_parse_dma_ranges(struct pci_controller *hose,
58255 +                                         void __iomem *reg,
58256 +                                         struct resource *res)
58257 +{
58258 +       u64 size;
58259 +       const u32 *ranges;
58260 +       int rlen;
58261 +       int pna = of_n_addr_cells(hose->dn);
58262 +       int np = pna + 5;
58263 +
58264 +       /* Default */
58265 +       res->start = 0;
58266 +       res->end = size = 0x80000000;
58267 +       res->flags = IORESOURCE_MEM | IORESOURCE_PREFETCH;
58268 +
58269 +       /* Get dma-ranges property */
58270 +       ranges = of_get_property(hose->dn, "dma-ranges", &rlen);
58271 +       if (ranges == NULL)
58272 +               goto out;
58273 +
58274 +       /* Walk it */
58275 +       while ((rlen -= np * 4) >= 0) {
58276 +               u32 pci_space = ranges[0];
58277 +               u64 pci_addr = of_read_number(ranges + 1, 2);
58278 +               u64 cpu_addr = of_translate_dma_address(hose->dn, ranges + 3);
58279 +               size = of_read_number(ranges + pna + 3, 2);
58280 +               ranges += np;
58281 +               if (cpu_addr == OF_BAD_ADDR || size == 0)
58282 +                       continue;
58283 +
58284 +               /* We only care about memory */
58285 +               if ((pci_space & 0x03000000) != 0x02000000)
58286 +                       continue;
58287 +
58288 +               /* We currently only support memory at 0, and pci_addr
58289 +                * within 32 bits space
58290 +                */
58291 +               if (cpu_addr != 0 || pci_addr > 0xffffffff) {
58292 +                       printk(KERN_WARNING "%s: Ignored unsupported dma range"
58293 +                              " 0x%016llx...0x%016llx -> 0x%016llx\n",
58294 +                              hose->dn->full_name,
58295 +                              pci_addr, pci_addr + size - 1, cpu_addr);
58296 +                       continue;
58297 +               }
58298 +
58299 +               /* Check if not prefetchable */
58300 +               if (!(pci_space & 0x40000000))
58301 +                       res->flags &= ~IORESOURCE_PREFETCH;
58302 +
58303 +
58304 +               /* Use that */
58305 +               res->start = pci_addr;
58306 +#ifndef CONFIG_RESOURCES_64BIT
58307 +               /* Beware of 32 bits resources */
58308 +               if ((pci_addr + size) > 0x100000000ull)
58309 +                       res->end = 0xffffffff;
58310 +               else
58311 +#endif
58312 +                       res->end = res->start + size - 1;
58313 +               break;
58314 +       }
58315 +
58316 +       /* We only support one global DMA offset */
58317 +       if (dma_offset_set && pci_dram_offset != res->start) {
58318 +               printk(KERN_ERR "%s: dma-ranges(s) mismatch\n",
58319 +                      hose->dn->full_name);
58320 +               return -ENXIO;
58321 +       }
58322 +
58323 +       /* Check that we can fit all of memory as we don't support
58324 +        * DMA bounce buffers
58325 +        */
58326 +       if (size < total_memory) {
58327 +               printk(KERN_ERR "%s: dma-ranges too small "
58328 +                      "(size=%llx total_memory=%lx)\n",
58329 +                      hose->dn->full_name, size, total_memory);
58330 +               return -ENXIO;
58331 +       }
58332 +
58333 +       /* Check we are a power of 2 size and that base is a multiple of size*/
58334 +       if (!is_power_of_2(size) ||
58335 +           (res->start & (size - 1)) != 0) {
58336 +               printk(KERN_ERR "%s: dma-ranges unaligned\n",
58337 +                      hose->dn->full_name);
58338 +               return -ENXIO;
58339 +       }
58340 +
58341 +       /* Check that we are fully contained within 32 bits space */
58342 +       if (res->end > 0xffffffff) {
58343 +               printk(KERN_ERR "%s: dma-ranges outside of 32 bits space\n",
58344 +                      hose->dn->full_name);
58345 +               return -ENXIO;
58346 +       }
58347 + out:
58348 +       dma_offset_set = 1;
58349 +       pci_dram_offset = res->start;
58350 +
58351 +       printk(KERN_INFO "4xx PCI DMA offset set to 0x%08lx\n",
58352 +              pci_dram_offset);
58353 +       return 0;
58354 +}
58355 +
58356 +/*
58357 + * 4xx PCI 2.x part
58358 + */
58359 +
58360 +static void __init ppc4xx_configure_pci_PMMs(struct pci_controller *hose,
58361 +                                            void __iomem *reg)
58362 +{
58363 +       u32 la, ma, pcila, pciha;
58364 +       int i, j;
58365 +
58366 +       /* Setup outbound memory windows */
58367 +       for (i = j = 0; i < 3; i++) {
58368 +               struct resource *res = &hose->mem_resources[i];
58369 +
58370 +               /* we only care about memory windows */
58371 +               if (!(res->flags & IORESOURCE_MEM))
58372 +                       continue;
58373 +               if (j > 2) {
58374 +                       printk(KERN_WARNING "%s: Too many ranges\n",
58375 +                              hose->dn->full_name);
58376 +                       break;
58377 +               }
58378 +
58379 +               /* Calculate register values */
58380 +               la = res->start;
58381 +               pciha = RES_TO_U32_HIGH(res->start - hose->pci_mem_offset);
58382 +               pcila = RES_TO_U32_LOW(res->start - hose->pci_mem_offset);
58383 +
58384 +               ma = res->end + 1 - res->start;
58385 +               if (!is_power_of_2(ma) || ma < 0x1000 || ma > 0xffffffffu) {
58386 +                       printk(KERN_WARNING "%s: Resource out of range\n",
58387 +                              hose->dn->full_name);
58388 +                       continue;
58389 +               }
58390 +               ma = (0xffffffffu << ilog2(ma)) | 0x1;
58391 +               if (res->flags & IORESOURCE_PREFETCH)
58392 +                       ma |= 0x2;
58393 +
58394 +               /* Program register values */
58395 +               writel(la, reg + PCIL0_PMM0LA + (0x10 * j));
58396 +               writel(pcila, reg + PCIL0_PMM0PCILA + (0x10 * j));
58397 +               writel(pciha, reg + PCIL0_PMM0PCIHA + (0x10 * j));
58398 +               writel(ma, reg + PCIL0_PMM0MA + (0x10 * j));
58399 +               j++;
58400 +       }
58401 +}
58402 +
58403 +static void __init ppc4xx_configure_pci_PTMs(struct pci_controller *hose,
58404 +                                            void __iomem *reg,
58405 +                                            const struct resource *res)
58406 +{
58407 +       resource_size_t size = res->end - res->start + 1;
58408 +       u32 sa;
58409 +
58410 +       /* Calculate window size */
58411 +       sa = (0xffffffffu << ilog2(size)) | 1;
58412 +       sa |= 0x1;
58413 +
58414 +       /* RAM is always at 0 local for now */
58415 +       writel(0, reg + PCIL0_PTM1LA);
58416 +       writel(sa, reg + PCIL0_PTM1MS);
58417 +
58418 +       /* Map on PCI side */
58419 +       early_write_config_dword(hose, hose->first_busno, 0,
58420 +                                PCI_BASE_ADDRESS_1, res->start);
58421 +       early_write_config_dword(hose, hose->first_busno, 0,
58422 +                                PCI_BASE_ADDRESS_2, 0x00000000);
58423 +       early_write_config_word(hose, hose->first_busno, 0,
58424 +                               PCI_COMMAND, 0x0006);
58425 +}
58426 +
58427 +static void __init ppc4xx_probe_pci_bridge(struct device_node *np)
58428 +{
58429 +       /* NYI */
58430 +       struct resource rsrc_cfg;
58431 +       struct resource rsrc_reg;
58432 +       struct resource dma_window;
58433 +       struct pci_controller *hose = NULL;
58434 +       void __iomem *reg = NULL;
58435 +       const int *bus_range;
58436 +       int primary = 0;
58437 +
58438 +       /* Fetch config space registers address */
58439 +       if (of_address_to_resource(np, 0, &rsrc_cfg)) {
58440 +               printk(KERN_ERR "%s:Can't get PCI config register base !",
58441 +                      np->full_name);
58442 +               return;
58443 +       }
58444 +       /* Fetch host bridge internal registers address */
58445 +       if (of_address_to_resource(np, 3, &rsrc_reg)) {
58446 +               printk(KERN_ERR "%s: Can't get PCI internal register base !",
58447 +                      np->full_name);
58448 +               return;
58449 +       }
58450 +
58451 +       /* Check if primary bridge */
58452 +       if (of_get_property(np, "primary", NULL))
58453 +               primary = 1;
58454 +
58455 +       /* Get bus range if any */
58456 +       bus_range = of_get_property(np, "bus-range", NULL);
58457 +
58458 +       /* Map registers */
58459 +       reg = ioremap(rsrc_reg.start, rsrc_reg.end + 1 - rsrc_reg.start);
58460 +       if (reg == NULL) {
58461 +               printk(KERN_ERR "%s: Can't map registers !", np->full_name);
58462 +               goto fail;
58463 +       }
58464 +
58465 +       /* Allocate the host controller data structure */
58466 +       hose = pcibios_alloc_controller(np);
58467 +       if (!hose)
58468 +               goto fail;
58469 +
58470 +       hose->first_busno = bus_range ? bus_range[0] : 0x0;
58471 +       hose->last_busno = bus_range ? bus_range[1] : 0xff;
58472 +
58473 +       /* Setup config space */
58474 +       setup_indirect_pci(hose, rsrc_cfg.start, rsrc_cfg.start + 0x4, 0);
58475 +
58476 +       /* Disable all windows */
58477 +       writel(0, reg + PCIL0_PMM0MA);
58478 +       writel(0, reg + PCIL0_PMM1MA);
58479 +       writel(0, reg + PCIL0_PMM2MA);
58480 +       writel(0, reg + PCIL0_PTM1MS);
58481 +       writel(0, reg + PCIL0_PTM2MS);
58482 +
58483 +       /* Parse outbound mapping resources */
58484 +       pci_process_bridge_OF_ranges(hose, np, primary);
58485 +
58486 +       /* Parse inbound mapping resources */
58487 +       if (ppc4xx_parse_dma_ranges(hose, reg, &dma_window) != 0)
58488 +               goto fail;
58489 +
58490 +       /* Configure outbound ranges POMs */
58491 +       ppc4xx_configure_pci_PMMs(hose, reg);
58492 +
58493 +       /* Configure inbound ranges PIMs */
58494 +       ppc4xx_configure_pci_PTMs(hose, reg, &dma_window);
58495 +
58496 +       /* We don't need the registers anymore */
58497 +       iounmap(reg);
58498 +       return;
58499 +
58500 + fail:
58501 +       if (hose)
58502 +               pcibios_free_controller(hose);
58503 +       if (reg)
58504 +               iounmap(reg);
58505 +}
58506 +
58507 +/*
58508 + * 4xx PCI-X part
58509 + */
58510 +
58511 +static void __init ppc4xx_configure_pcix_POMs(struct pci_controller *hose,
58512 +                                             void __iomem *reg)
58513 +{
58514 +       u32 lah, lal, pciah, pcial, sa;
58515 +       int i, j;
58516 +
58517 +       /* Setup outbound memory windows */
58518 +       for (i = j = 0; i < 3; i++) {
58519 +               struct resource *res = &hose->mem_resources[i];
58520 +
58521 +               /* we only care about memory windows */
58522 +               if (!(res->flags & IORESOURCE_MEM))
58523 +                       continue;
58524 +               if (j > 1) {
58525 +                       printk(KERN_WARNING "%s: Too many ranges\n",
58526 +                              hose->dn->full_name);
58527 +                       break;
58528 +               }
58529 +
58530 +               /* Calculate register values */
58531 +               lah = RES_TO_U32_HIGH(res->start);
58532 +               lal = RES_TO_U32_LOW(res->start);
58533 +               pciah = RES_TO_U32_HIGH(res->start - hose->pci_mem_offset);
58534 +               pcial = RES_TO_U32_LOW(res->start - hose->pci_mem_offset);
58535 +               sa = res->end + 1 - res->start;
58536 +               if (!is_power_of_2(sa) || sa < 0x100000 ||
58537 +                   sa > 0xffffffffu) {
58538 +                       printk(KERN_WARNING "%s: Resource out of range\n",
58539 +                              hose->dn->full_name);
58540 +                       continue;
58541 +               }
58542 +               sa = (0xffffffffu << ilog2(sa)) | 0x1;
58543 +
58544 +               /* Program register values */
58545 +               if (j == 0) {
58546 +                       writel(lah, reg + PCIX0_POM0LAH);
58547 +                       writel(lal, reg + PCIX0_POM0LAL);
58548 +                       writel(pciah, reg + PCIX0_POM0PCIAH);
58549 +                       writel(pcial, reg + PCIX0_POM0PCIAL);
58550 +                       writel(sa, reg + PCIX0_POM0SA);
58551 +               } else {
58552 +                       writel(lah, reg + PCIX0_POM1LAH);
58553 +                       writel(lal, reg + PCIX0_POM1LAL);
58554 +                       writel(pciah, reg + PCIX0_POM1PCIAH);
58555 +                       writel(pcial, reg + PCIX0_POM1PCIAL);
58556 +                       writel(sa, reg + PCIX0_POM1SA);
58557 +               }
58558 +               j++;
58559 +       }
58560 +}
58561 +
58562 +static void __init ppc4xx_configure_pcix_PIMs(struct pci_controller *hose,
58563 +                                             void __iomem *reg,
58564 +                                             const struct resource *res,
58565 +                                             int big_pim,
58566 +                                             int enable_msi_hole)
58567 +{
58568 +       resource_size_t size = res->end - res->start + 1;
58569 +       u32 sa;
58570 +
58571 +       /* RAM is always at 0 */
58572 +       writel(0x00000000, reg + PCIX0_PIM0LAH);
58573 +       writel(0x00000000, reg + PCIX0_PIM0LAL);
58574 +
58575 +       /* Calculate window size */
58576 +       sa = (0xffffffffu << ilog2(size)) | 1;
58577 +       sa |= 0x1;
58578 +       if (res->flags & IORESOURCE_PREFETCH)
58579 +               sa |= 0x2;
58580 +       if (enable_msi_hole)
58581 +               sa |= 0x4;
58582 +       writel(sa, reg + PCIX0_PIM0SA);
58583 +       if (big_pim)
58584 +               writel(0xffffffff, reg + PCIX0_PIM0SAH);
58585 +
58586 +       /* Map on PCI side */
58587 +       writel(0x00000000, reg + PCIX0_BAR0H);
58588 +       writel(res->start, reg + PCIX0_BAR0L);
58589 +       writew(0x0006, reg + PCIX0_COMMAND);
58590 +}
58591 +
58592 +static void __init ppc4xx_probe_pcix_bridge(struct device_node *np)
58593 +{
58594 +       struct resource rsrc_cfg;
58595 +       struct resource rsrc_reg;
58596 +       struct resource dma_window;
58597 +       struct pci_controller *hose = NULL;
58598 +       void __iomem *reg = NULL;
58599 +       const int *bus_range;
58600 +       int big_pim = 0, msi = 0, primary = 0;
58601 +
58602 +       /* Fetch config space registers address */
58603 +       if (of_address_to_resource(np, 0, &rsrc_cfg)) {
58604 +               printk(KERN_ERR "%s:Can't get PCI-X config register base !",
58605 +                      np->full_name);
58606 +               return;
58607 +       }
58608 +       /* Fetch host bridge internal registers address */
58609 +       if (of_address_to_resource(np, 3, &rsrc_reg)) {
58610 +               printk(KERN_ERR "%s: Can't get PCI-X internal register base !",
58611 +                      np->full_name);
58612 +               return;
58613 +       }
58614 +
58615 +       /* Check if it supports large PIMs (440GX) */
58616 +       if (of_get_property(np, "large-inbound-windows", NULL))
58617 +               big_pim = 1;
58618 +
58619 +       /* Check if we should enable MSIs inbound hole */
58620 +       if (of_get_property(np, "enable-msi-hole", NULL))
58621 +               msi = 1;
58622 +
58623 +       /* Check if primary bridge */
58624 +       if (of_get_property(np, "primary", NULL))
58625 +               primary = 1;
58626 +
58627 +       /* Get bus range if any */
58628 +       bus_range = of_get_property(np, "bus-range", NULL);
58629 +
58630 +       /* Map registers */
58631 +       reg = ioremap(rsrc_reg.start, rsrc_reg.end + 1 - rsrc_reg.start);
58632 +       if (reg == NULL) {
58633 +               printk(KERN_ERR "%s: Can't map registers !", np->full_name);
58634 +               goto fail;
58635 +       }
58636 +
58637 +       /* Allocate the host controller data structure */
58638 +       hose = pcibios_alloc_controller(np);
58639 +       if (!hose)
58640 +               goto fail;
58641 +
58642 +       hose->first_busno = bus_range ? bus_range[0] : 0x0;
58643 +       hose->last_busno = bus_range ? bus_range[1] : 0xff;
58644 +
58645 +       /* Setup config space */
58646 +       setup_indirect_pci(hose, rsrc_cfg.start, rsrc_cfg.start + 0x4, 0);
58647 +
58648 +       /* Disable all windows */
58649 +       writel(0, reg + PCIX0_POM0SA);
58650 +       writel(0, reg + PCIX0_POM1SA);
58651 +       writel(0, reg + PCIX0_POM2SA);
58652 +       writel(0, reg + PCIX0_PIM0SA);
58653 +       writel(0, reg + PCIX0_PIM1SA);
58654 +       writel(0, reg + PCIX0_PIM2SA);
58655 +       if (big_pim) {
58656 +               writel(0, reg + PCIX0_PIM0SAH);
58657 +               writel(0, reg + PCIX0_PIM2SAH);
58658 +       }
58659 +
58660 +       /* Parse outbound mapping resources */
58661 +       pci_process_bridge_OF_ranges(hose, np, primary);
58662 +
58663 +       /* Parse inbound mapping resources */
58664 +       if (ppc4xx_parse_dma_ranges(hose, reg, &dma_window) != 0)
58665 +               goto fail;
58666 +
58667 +       /* Configure outbound ranges POMs */
58668 +       ppc4xx_configure_pcix_POMs(hose, reg);
58669 +
58670 +       /* Configure inbound ranges PIMs */
58671 +       ppc4xx_configure_pcix_PIMs(hose, reg, &dma_window, big_pim, msi);
58672 +
58673 +       /* We don't need the registers anymore */
58674 +       iounmap(reg);
58675 +       return;
58676 +
58677 + fail:
58678 +       if (hose)
58679 +               pcibios_free_controller(hose);
58680 +       if (reg)
58681 +               iounmap(reg);
58682 +}
58683 +
58684 +#ifdef CONFIG_PPC4xx_PCI_EXPRESS
58685 +
58686 +/*
58687 + * 4xx PCI-Express part
58688 + *
58689 + * We support 3 parts currently based on the compatible property:
58690 + *
58691 + * ibm,plb-pciex-440spe
58692 + * ibm,plb-pciex-405ex
58693 + *
58694 + * Anything else will be rejected for now as they are all subtly
58695 + * different unfortunately.
58696 + *
58697 + */
58698 +
58699 +#define MAX_PCIE_BUS_MAPPED    0x40
58700 +
58701 +struct ppc4xx_pciex_port
58702 +{
58703 +       struct pci_controller   *hose;
58704 +       struct device_node      *node;
58705 +       unsigned int            index;
58706 +       int                     endpoint;
58707 +       int                     link;
58708 +       int                     has_ibpre;
58709 +       unsigned int            sdr_base;
58710 +       dcr_host_t              dcrs;
58711 +       struct resource         cfg_space;
58712 +       struct resource         utl_regs;
58713 +       void __iomem            *utl_base;
58714 +};
58715 +
58716 +static struct ppc4xx_pciex_port *ppc4xx_pciex_ports;
58717 +static unsigned int ppc4xx_pciex_port_count;
58718 +
58719 +struct ppc4xx_pciex_hwops
58720 +{
58721 +       int (*core_init)(struct device_node *np);
58722 +       int (*port_init_hw)(struct ppc4xx_pciex_port *port);
58723 +       int (*setup_utl)(struct ppc4xx_pciex_port *port);
58724 +};
58725 +
58726 +static struct ppc4xx_pciex_hwops *ppc4xx_pciex_hwops;
58727 +
58728 +#ifdef CONFIG_44x
58729 +
58730 +/* Check various reset bits of the 440SPe PCIe core */
58731 +static int __init ppc440spe_pciex_check_reset(struct device_node *np)
58732 +{
58733 +       u32 valPE0, valPE1, valPE2;
58734 +       int err = 0;
58735 +
58736 +       /* SDR0_PEGPLLLCT1 reset */
58737 +       if (!(mfdcri(SDR0, PESDR0_PLLLCT1) & 0x01000000)) {
58738 +               /*
58739 +                * the PCIe core was probably already initialised
58740 +                * by firmware - let's re-reset RCSSET regs
58741 +                *
58742 +                * -- Shouldn't we also re-reset the whole thing ? -- BenH
58743 +                */
58744 +               pr_debug("PCIE: SDR0_PLLLCT1 already reset.\n");
58745 +               mtdcri(SDR0, PESDR0_440SPE_RCSSET, 0x01010000);
58746 +               mtdcri(SDR0, PESDR1_440SPE_RCSSET, 0x01010000);
58747 +               mtdcri(SDR0, PESDR2_440SPE_RCSSET, 0x01010000);
58748 +       }
58749 +
58750 +       valPE0 = mfdcri(SDR0, PESDR0_440SPE_RCSSET);
58751 +       valPE1 = mfdcri(SDR0, PESDR1_440SPE_RCSSET);
58752 +       valPE2 = mfdcri(SDR0, PESDR2_440SPE_RCSSET);
58753 +
58754 +       /* SDR0_PExRCSSET rstgu */
58755 +       if (!(valPE0 & 0x01000000) ||
58756 +           !(valPE1 & 0x01000000) ||
58757 +           !(valPE2 & 0x01000000)) {
58758 +               printk(KERN_INFO "PCIE: SDR0_PExRCSSET rstgu error\n");
58759 +               err = -1;
58760 +       }
58761 +
58762 +       /* SDR0_PExRCSSET rstdl */
58763 +       if (!(valPE0 & 0x00010000) ||
58764 +           !(valPE1 & 0x00010000) ||
58765 +           !(valPE2 & 0x00010000)) {
58766 +               printk(KERN_INFO "PCIE: SDR0_PExRCSSET rstdl error\n");
58767 +               err = -1;
58768 +       }
58769 +
58770 +       /* SDR0_PExRCSSET rstpyn */
58771 +       if ((valPE0 & 0x00001000) ||
58772 +           (valPE1 & 0x00001000) ||
58773 +           (valPE2 & 0x00001000)) {
58774 +               printk(KERN_INFO "PCIE: SDR0_PExRCSSET rstpyn error\n");
58775 +               err = -1;
58776 +       }
58777 +
58778 +       /* SDR0_PExRCSSET hldplb */
58779 +       if ((valPE0 & 0x10000000) ||
58780 +           (valPE1 & 0x10000000) ||
58781 +           (valPE2 & 0x10000000)) {
58782 +               printk(KERN_INFO "PCIE: SDR0_PExRCSSET hldplb error\n");
58783 +               err = -1;
58784 +       }
58785 +
58786 +       /* SDR0_PExRCSSET rdy */
58787 +       if ((valPE0 & 0x00100000) ||
58788 +           (valPE1 & 0x00100000) ||
58789 +           (valPE2 & 0x00100000)) {
58790 +               printk(KERN_INFO "PCIE: SDR0_PExRCSSET rdy error\n");
58791 +               err = -1;
58792 +       }
58793 +
58794 +       /* SDR0_PExRCSSET shutdown */
58795 +       if ((valPE0 & 0x00000100) ||
58796 +           (valPE1 & 0x00000100) ||
58797 +           (valPE2 & 0x00000100)) {
58798 +               printk(KERN_INFO "PCIE: SDR0_PExRCSSET shutdown error\n");
58799 +               err = -1;
58800 +       }
58801 +
58802 +       return err;
58803 +}
58804 +
58805 +/* Global PCIe core initializations for 440SPe core */
58806 +static int __init ppc440spe_pciex_core_init(struct device_node *np)
58807 +{
58808 +       int time_out = 20;
58809 +
58810 +       /* Set PLL clock receiver to LVPECL */
58811 +       mtdcri(SDR0, PESDR0_PLLLCT1, mfdcri(SDR0, PESDR0_PLLLCT1) | 1 << 28);
58812 +
58813 +       /* Shouldn't we do all the calibration stuff etc... here ? */
58814 +       if (ppc440spe_pciex_check_reset(np))
58815 +               return -ENXIO;
58816 +
58817 +       if (!(mfdcri(SDR0, PESDR0_PLLLCT2) & 0x10000)) {
58818 +               printk(KERN_INFO "PCIE: PESDR_PLLCT2 resistance calibration "
58819 +                      "failed (0x%08x)\n",
58820 +                      mfdcri(SDR0, PESDR0_PLLLCT2));
58821 +               return -1;
58822 +       }
58823 +
58824 +       /* De-assert reset of PCIe PLL, wait for lock */
58825 +       mtdcri(SDR0, PESDR0_PLLLCT1,
58826 +              mfdcri(SDR0, PESDR0_PLLLCT1) & ~(1 << 24));
58827 +       udelay(3);
58828 +
58829 +       while (time_out) {
58830 +               if (!(mfdcri(SDR0, PESDR0_PLLLCT3) & 0x10000000)) {
58831 +                       time_out--;
58832 +                       udelay(1);
58833 +               } else
58834 +                       break;
58835 +       }
58836 +       if (!time_out) {
58837 +               printk(KERN_INFO "PCIE: VCO output not locked\n");
58838 +               return -1;
58839 +       }
58840 +
58841 +       pr_debug("PCIE initialization OK\n");
58842 +
58843 +       return 3;
58844 +}
58845 +
58846 +static int ppc440spe_pciex_init_port_hw(struct ppc4xx_pciex_port *port)
58847 +{
58848 +       u32 val = 1 << 24;
58849 +
58850 +       if (port->endpoint)
58851 +               val = PTYPE_LEGACY_ENDPOINT << 20;
58852 +       else
58853 +               val = PTYPE_ROOT_PORT << 20;
58854 +
58855 +       if (port->index == 0)
58856 +               val |= LNKW_X8 << 12;
58857 +       else
58858 +               val |= LNKW_X4 << 12;
58859 +
58860 +       mtdcri(SDR0, port->sdr_base + PESDRn_DLPSET, val);
58861 +       mtdcri(SDR0, port->sdr_base + PESDRn_UTLSET1, 0x20222222);
58862 +       if (ppc440spe_revA())
58863 +               mtdcri(SDR0, port->sdr_base + PESDRn_UTLSET2, 0x11000000);
58864 +       mtdcri(SDR0, port->sdr_base + PESDRn_440SPE_HSSL0SET1, 0x35000000);
58865 +       mtdcri(SDR0, port->sdr_base + PESDRn_440SPE_HSSL1SET1, 0x35000000);
58866 +       mtdcri(SDR0, port->sdr_base + PESDRn_440SPE_HSSL2SET1, 0x35000000);
58867 +       mtdcri(SDR0, port->sdr_base + PESDRn_440SPE_HSSL3SET1, 0x35000000);
58868 +       if (port->index == 0) {
58869 +               mtdcri(SDR0, port->sdr_base + PESDRn_440SPE_HSSL4SET1,
58870 +                      0x35000000);
58871 +               mtdcri(SDR0, port->sdr_base + PESDRn_440SPE_HSSL5SET1,
58872 +                      0x35000000);
58873 +               mtdcri(SDR0, port->sdr_base + PESDRn_440SPE_HSSL6SET1,
58874 +                      0x35000000);
58875 +               mtdcri(SDR0, port->sdr_base + PESDRn_440SPE_HSSL7SET1,
58876 +                      0x35000000);
58877 +       }
58878 +       val = mfdcri(SDR0, port->sdr_base + PESDRn_RCSSET);
58879 +       mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET,
58880 +              (val & ~(1 << 24 | 1 << 16)) | 1 << 12);
58881 +
58882 +       return 0;
58883 +}
58884 +
58885 +static int ppc440speA_pciex_init_port_hw(struct ppc4xx_pciex_port *port)
58886 +{
58887 +       return ppc440spe_pciex_init_port_hw(port);
58888 +}
58889 +
58890 +static int ppc440speB_pciex_init_port_hw(struct ppc4xx_pciex_port *port)
58891 +{
58892 +       int rc = ppc440spe_pciex_init_port_hw(port);
58893 +
58894 +       port->has_ibpre = 1;
58895 +
58896 +       return rc;
58897 +}
58898 +
58899 +static int ppc440speA_pciex_init_utl(struct ppc4xx_pciex_port *port)
58900 +{
58901 +       /* XXX Check what that value means... I hate magic */
58902 +       dcr_write(port->dcrs, DCRO_PEGPL_SPECIAL, 0x68782800);
58903 +
58904 +       /*
58905 +        * Set buffer allocations and then assert VRB and TXE.
58906 +        */
58907 +       out_be32(port->utl_base + PEUTL_OUTTR,   0x08000000);
58908 +       out_be32(port->utl_base + PEUTL_INTR,    0x02000000);
58909 +       out_be32(port->utl_base + PEUTL_OPDBSZ,  0x10000000);
58910 +       out_be32(port->utl_base + PEUTL_PBBSZ,   0x53000000);
58911 +       out_be32(port->utl_base + PEUTL_IPHBSZ,  0x08000000);
58912 +       out_be32(port->utl_base + PEUTL_IPDBSZ,  0x10000000);
58913 +       out_be32(port->utl_base + PEUTL_RCIRQEN, 0x00f00000);
58914 +       out_be32(port->utl_base + PEUTL_PCTL,    0x80800066);
58915 +
58916 +       return 0;
58917 +}
58918 +
58919 +static int ppc440speB_pciex_init_utl(struct ppc4xx_pciex_port *port)
58920 +{
58921 +       /* Report CRS to the operating system */
58922 +       out_be32(port->utl_base + PEUTL_PBCTL,    0x08000000);
58923 +
58924 +       return 0;
58925 +}
58926 +
58927 +static struct ppc4xx_pciex_hwops ppc440speA_pcie_hwops __initdata =
58928 +{
58929 +       .core_init      = ppc440spe_pciex_core_init,
58930 +       .port_init_hw   = ppc440speA_pciex_init_port_hw,
58931 +       .setup_utl      = ppc440speA_pciex_init_utl,
58932 +};
58933 +
58934 +static struct ppc4xx_pciex_hwops ppc440speB_pcie_hwops __initdata =
58935 +{
58936 +       .core_init      = ppc440spe_pciex_core_init,
58937 +       .port_init_hw   = ppc440speB_pciex_init_port_hw,
58938 +       .setup_utl      = ppc440speB_pciex_init_utl,
58939 +};
58940 +
58941 +#endif /* CONFIG_44x */
58942 +
58943 +#ifdef CONFIG_40x
58944 +
58945 +static int __init ppc405ex_pciex_core_init(struct device_node *np)
58946 +{
58947 +       /* Nothing to do, return 2 ports */
58948 +       return 2;
58949 +}
58950 +
58951 +static void ppc405ex_pcie_phy_reset(struct ppc4xx_pciex_port *port)
58952 +{
58953 +       /* Assert the PE0_PHY reset */
58954 +       mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET, 0x01010000);
58955 +       msleep(1);
58956 +
58957 +       /* deassert the PE0_hotreset */
58958 +       if (port->endpoint)
58959 +               mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET, 0x01111000);
58960 +       else
58961 +               mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET, 0x01101000);
58962 +
58963 +       /* poll for phy !reset */
58964 +       /* XXX FIXME add timeout */
58965 +       while (!(mfdcri(SDR0, port->sdr_base + PESDRn_405EX_PHYSTA) & 0x00001000))
58966 +               ;
58967 +
58968 +       /* deassert the PE0_gpl_utl_reset */
58969 +       mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET, 0x00101000);
58970 +}
58971 +
58972 +static int ppc405ex_pciex_init_port_hw(struct ppc4xx_pciex_port *port)
58973 +{
58974 +       u32 val;
58975 +
58976 +       if (port->endpoint)
58977 +               val = PTYPE_LEGACY_ENDPOINT;
58978 +       else
58979 +               val = PTYPE_ROOT_PORT;
58980 +
58981 +       mtdcri(SDR0, port->sdr_base + PESDRn_DLPSET,
58982 +              1 << 24 | val << 20 | LNKW_X1 << 12);
58983 +
58984 +       mtdcri(SDR0, port->sdr_base + PESDRn_UTLSET1, 0x00000000);
58985 +       mtdcri(SDR0, port->sdr_base + PESDRn_UTLSET2, 0x01010000);
58986 +       mtdcri(SDR0, port->sdr_base + PESDRn_405EX_PHYSET1, 0x720F0000);
58987 +       mtdcri(SDR0, port->sdr_base + PESDRn_405EX_PHYSET2, 0x70600003);
58988 +
58989 +       /*
58990 +        * Only reset the PHY when no link is currently established.
58991 +        * This is for the Atheros PCIe board which has problems to establish
58992 +        * the link (again) after this PHY reset. All other currently tested
58993 +        * PCIe boards don't show this problem.
58994 +        * This has to be re-tested and fixed in a later release!
58995 +        */
58996 +#if 0 /* XXX FIXME: Not resetting the PHY will leave all resources
58997 +       * configured as done previously by U-Boot. Then Linux will currently
58998 +       * not reassign them. So the PHY reset is now done always. This will
58999 +       * lead to problems with the Atheros PCIe board again.
59000 +       */
59001 +       val = mfdcri(SDR0, port->sdr_base + PESDRn_LOOP);
59002 +       if (!(val & 0x00001000))
59003 +               ppc405ex_pcie_phy_reset(port);
59004 +#else
59005 +       ppc405ex_pcie_phy_reset(port);
59006 +#endif
59007 +
59008 +       dcr_write(port->dcrs, DCRO_PEGPL_CFG, 0x10000000);  /* guarded on */
59009 +
59010 +       port->has_ibpre = 1;
59011 +
59012 +       return 0;
59013 +}
59014 +
59015 +static int ppc405ex_pciex_init_utl(struct ppc4xx_pciex_port *port)
59016 +{
59017 +       dcr_write(port->dcrs, DCRO_PEGPL_SPECIAL, 0x0);
59018 +
59019 +       /*
59020 +        * Set buffer allocations and then assert VRB and TXE.
59021 +        */
59022 +       out_be32(port->utl_base + PEUTL_OUTTR,   0x02000000);
59023 +       out_be32(port->utl_base + PEUTL_INTR,    0x02000000);
59024 +       out_be32(port->utl_base + PEUTL_OPDBSZ,  0x04000000);
59025 +       out_be32(port->utl_base + PEUTL_PBBSZ,   0x21000000);
59026 +       out_be32(port->utl_base + PEUTL_IPHBSZ,  0x02000000);
59027 +       out_be32(port->utl_base + PEUTL_IPDBSZ,  0x04000000);
59028 +       out_be32(port->utl_base + PEUTL_RCIRQEN, 0x00f00000);
59029 +       out_be32(port->utl_base + PEUTL_PCTL,    0x80800066);
59030 +
59031 +       out_be32(port->utl_base + PEUTL_PBCTL,   0x08000000);
59032 +
59033 +       return 0;
59034 +}
59035 +
59036 +static struct ppc4xx_pciex_hwops ppc405ex_pcie_hwops __initdata =
59037 +{
59038 +       .core_init      = ppc405ex_pciex_core_init,
59039 +       .port_init_hw   = ppc405ex_pciex_init_port_hw,
59040 +       .setup_utl      = ppc405ex_pciex_init_utl,
59041 +};
59042 +
59043 +#endif /* CONFIG_40x */
59044 +
59045 +
59046 +/* Check that the core has been initied and if not, do it */
59047 +static int __init ppc4xx_pciex_check_core_init(struct device_node *np)
59048 +{
59049 +       static int core_init;
59050 +       int count = -ENODEV;
59051 +
59052 +       if (core_init++)
59053 +               return 0;
59054 +
59055 +#ifdef CONFIG_44x
59056 +       if (of_device_is_compatible(np, "ibm,plb-pciex-440spe")) {
59057 +               if (ppc440spe_revA())
59058 +                       ppc4xx_pciex_hwops = &ppc440speA_pcie_hwops;
59059 +               else
59060 +                       ppc4xx_pciex_hwops = &ppc440speB_pcie_hwops;
59061 +       }
59062 +#endif /* CONFIG_44x    */
59063 +#ifdef CONFIG_40x
59064 +       if (of_device_is_compatible(np, "ibm,plb-pciex-405ex"))
59065 +               ppc4xx_pciex_hwops = &ppc405ex_pcie_hwops;
59066 +#endif
59067 +       if (ppc4xx_pciex_hwops == NULL) {
59068 +               printk(KERN_WARNING "PCIE: unknown host type %s\n",
59069 +                      np->full_name);
59070 +               return -ENODEV;
59071 +       }
59072 +
59073 +       count = ppc4xx_pciex_hwops->core_init(np);
59074 +       if (count > 0) {
59075 +               ppc4xx_pciex_ports =
59076 +                      kzalloc(count * sizeof(struct ppc4xx_pciex_port),
59077 +                              GFP_KERNEL);
59078 +               if (ppc4xx_pciex_ports) {
59079 +                       ppc4xx_pciex_port_count = count;
59080 +                       return 0;
59081 +               }
59082 +               printk(KERN_WARNING "PCIE: failed to allocate ports array\n");
59083 +               return -ENOMEM;
59084 +       }
59085 +       return -ENODEV;
59086 +}
59087 +
59088 +static void __init ppc4xx_pciex_port_init_mapping(struct ppc4xx_pciex_port *port)
59089 +{
59090 +       /* We map PCI Express configuration based on the reg property */
59091 +       dcr_write(port->dcrs, DCRO_PEGPL_CFGBAH,
59092 +                 RES_TO_U32_HIGH(port->cfg_space.start));
59093 +       dcr_write(port->dcrs, DCRO_PEGPL_CFGBAL,
59094 +                 RES_TO_U32_LOW(port->cfg_space.start));
59095 +
59096 +       /* XXX FIXME: Use size from reg property. For now, map 512M */
59097 +       dcr_write(port->dcrs, DCRO_PEGPL_CFGMSK, 0xe0000001);
59098 +
59099 +       /* We map UTL registers based on the reg property */
59100 +       dcr_write(port->dcrs, DCRO_PEGPL_REGBAH,
59101 +                 RES_TO_U32_HIGH(port->utl_regs.start));
59102 +       dcr_write(port->dcrs, DCRO_PEGPL_REGBAL,
59103 +                 RES_TO_U32_LOW(port->utl_regs.start));
59104 +
59105 +       /* XXX FIXME: Use size from reg property */
59106 +       dcr_write(port->dcrs, DCRO_PEGPL_REGMSK, 0x00007001);
59107 +
59108 +       /* Disable all other outbound windows */
59109 +       dcr_write(port->dcrs, DCRO_PEGPL_OMR1MSKL, 0);
59110 +       dcr_write(port->dcrs, DCRO_PEGPL_OMR2MSKL, 0);
59111 +       dcr_write(port->dcrs, DCRO_PEGPL_OMR3MSKL, 0);
59112 +       dcr_write(port->dcrs, DCRO_PEGPL_MSGMSK, 0);
59113 +}
59114 +
59115 +static int __init ppc4xx_pciex_wait_on_sdr(struct ppc4xx_pciex_port *port,
59116 +                                          unsigned int sdr_offset,
59117 +                                          unsigned int mask,
59118 +                                          unsigned int value,
59119 +                                          int timeout_ms)
59120 +{
59121 +       u32 val;
59122 +
59123 +       while(timeout_ms--) {
59124 +               val = mfdcri(SDR0, port->sdr_base + sdr_offset);
59125 +               if ((val & mask) == value) {
59126 +                       pr_debug("PCIE%d: Wait on SDR %x success with tm %d (%08x)\n",
59127 +                                port->index, sdr_offset, timeout_ms, val);
59128 +                       return 0;
59129 +               }
59130 +               msleep(1);
59131 +       }
59132 +       return -1;
59133 +}
59134 +
59135 +static int __init ppc4xx_pciex_port_init(struct ppc4xx_pciex_port *port)
59136 +{
59137 +       int rc = 0;
59138 +
59139 +       /* Init HW */
59140 +       if (ppc4xx_pciex_hwops->port_init_hw)
59141 +               rc = ppc4xx_pciex_hwops->port_init_hw(port);
59142 +       if (rc != 0)
59143 +               return rc;
59144 +
59145 +       printk(KERN_INFO "PCIE%d: Checking link...\n",
59146 +              port->index);
59147 +
59148 +       /* Wait for reset to complete */
59149 +       if (ppc4xx_pciex_wait_on_sdr(port, PESDRn_RCSSTS, 1 << 20, 0, 10)) {
59150 +               printk(KERN_WARNING "PCIE%d: PGRST failed\n",
59151 +                      port->index);
59152 +               return -1;
59153 +       }
59154 +
59155 +       /* Check for card presence detect if supported, if not, just wait for
59156 +        * link unconditionally.
59157 +        *
59158 +        * note that we don't fail if there is no link, we just filter out
59159 +        * config space accesses. That way, it will be easier to implement
59160 +        * hotplug later on.
59161 +        */
59162 +       if (!port->has_ibpre ||
59163 +           !ppc4xx_pciex_wait_on_sdr(port, PESDRn_LOOP,
59164 +                                     1 << 28, 1 << 28, 100)) {
59165 +               printk(KERN_INFO
59166 +                      "PCIE%d: Device detected, waiting for link...\n",
59167 +                      port->index);
59168 +               if (ppc4xx_pciex_wait_on_sdr(port, PESDRn_LOOP,
59169 +                                            0x1000, 0x1000, 2000))
59170 +                       printk(KERN_WARNING
59171 +                              "PCIE%d: Link up failed\n", port->index);
59172 +               else {
59173 +                       printk(KERN_INFO
59174 +                              "PCIE%d: link is up !\n", port->index);
59175 +                       port->link = 1;
59176 +               }
59177 +       } else
59178 +               printk(KERN_INFO "PCIE%d: No device detected.\n", port->index);
59179 +
59180 +       /*
59181 +        * Initialize mapping: disable all regions and configure
59182 +        * CFG and REG regions based on resources in the device tree
59183 +        */
59184 +       ppc4xx_pciex_port_init_mapping(port);
59185 +
59186 +       /*
59187 +        * Map UTL
59188 +        */
59189 +       port->utl_base = ioremap(port->utl_regs.start, 0x100);
59190 +       BUG_ON(port->utl_base == NULL);
59191 +
59192 +       /*
59193 +        * Setup UTL registers --BenH.
59194 +        */
59195 +       if (ppc4xx_pciex_hwops->setup_utl)
59196 +               ppc4xx_pciex_hwops->setup_utl(port);
59197 +
59198 +       /*
59199 +        * Check for VC0 active and assert RDY.
59200 +        */
59201 +       if (port->link &&
59202 +           ppc4xx_pciex_wait_on_sdr(port, PESDRn_RCSSTS,
59203 +                                    1 << 16, 1 << 16, 5000)) {
59204 +               printk(KERN_INFO "PCIE%d: VC0 not active\n", port->index);
59205 +               port->link = 0;
59206 +       }
59207 +
59208 +       mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET,
59209 +              mfdcri(SDR0, port->sdr_base + PESDRn_RCSSET) | 1 << 20);
59210 +       msleep(100);
59211 +
59212 +       return 0;
59213 +}
59214 +
59215 +static int ppc4xx_pciex_validate_bdf(struct ppc4xx_pciex_port *port,
59216 +                                    struct pci_bus *bus,
59217 +                                    unsigned int devfn)
59218 +{
59219 +       static int message;
59220 +
59221 +       /* Endpoint can not generate upstream(remote) config cycles */
59222 +       if (port->endpoint && bus->number != port->hose->first_busno)
59223 +               return PCIBIOS_DEVICE_NOT_FOUND;
59224 +
59225 +       /* Check we are within the mapped range */
59226 +       if (bus->number > port->hose->last_busno) {
59227 +               if (!message) {
59228 +                       printk(KERN_WARNING "Warning! Probing bus %u"
59229 +                              " out of range !\n", bus->number);
59230 +                       message++;
59231 +               }
59232 +               return PCIBIOS_DEVICE_NOT_FOUND;
59233 +       }
59234 +
59235 +       /* The root complex has only one device / function */
59236 +       if (bus->number == port->hose->first_busno && devfn != 0)
59237 +               return PCIBIOS_DEVICE_NOT_FOUND;
59238 +
59239 +       /* The other side of the RC has only one device as well */
59240 +       if (bus->number == (port->hose->first_busno + 1) &&
59241 +           PCI_SLOT(devfn) != 0)
59242 +               return PCIBIOS_DEVICE_NOT_FOUND;
59243 +
59244 +       /* Check if we have a link */
59245 +       if ((bus->number != port->hose->first_busno) && !port->link)
59246 +               return PCIBIOS_DEVICE_NOT_FOUND;
59247 +
59248 +       return 0;
59249 +}
59250 +
59251 +static void __iomem *ppc4xx_pciex_get_config_base(struct ppc4xx_pciex_port *port,
59252 +                                                 struct pci_bus *bus,
59253 +                                                 unsigned int devfn)
59254 +{
59255 +       int relbus;
59256 +
59257 +       /* Remove the casts when we finally remove the stupid volatile
59258 +        * in struct pci_controller
59259 +        */
59260 +       if (bus->number == port->hose->first_busno)
59261 +               return (void __iomem *)port->hose->cfg_addr;
59262 +
59263 +       relbus = bus->number - (port->hose->first_busno + 1);
59264 +       return (void __iomem *)port->hose->cfg_data +
59265 +               ((relbus  << 20) | (devfn << 12));
59266 +}
59267 +
59268 +static int ppc4xx_pciex_read_config(struct pci_bus *bus, unsigned int devfn,
59269 +                                   int offset, int len, u32 *val)
59270 +{
59271 +       struct pci_controller *hose = (struct pci_controller *) bus->sysdata;
59272 +       struct ppc4xx_pciex_port *port =
59273 +               &ppc4xx_pciex_ports[hose->indirect_type];
59274 +       void __iomem *addr;
59275 +       u32 gpl_cfg;
59276 +
59277 +       BUG_ON(hose != port->hose);
59278 +
59279 +       if (ppc4xx_pciex_validate_bdf(port, bus, devfn) != 0)
59280 +               return PCIBIOS_DEVICE_NOT_FOUND;
59281 +
59282 +       addr = ppc4xx_pciex_get_config_base(port, bus, devfn);
59283 +
59284 +       /*
59285 +        * Reading from configuration space of non-existing device can
59286 +        * generate transaction errors. For the read duration we suppress
59287 +        * assertion of machine check exceptions to avoid those.
59288 +        */
59289 +       gpl_cfg = dcr_read(port->dcrs, DCRO_PEGPL_CFG);
59290 +       dcr_write(port->dcrs, DCRO_PEGPL_CFG, gpl_cfg | GPL_DMER_MASK_DISA);
59291 +
59292 +       /* Make sure no CRS is recorded */
59293 +       out_be32(port->utl_base + PEUTL_RCSTA, 0x00040000);
59294 +
59295 +       switch (len) {
59296 +       case 1:
59297 +               *val = in_8((u8 *)(addr + offset));
59298 +               break;
59299 +       case 2:
59300 +               *val = in_le16((u16 *)(addr + offset));
59301 +               break;
59302 +       default:
59303 +               *val = in_le32((u32 *)(addr + offset));
59304 +               break;
59305 +       }
59306 +
59307 +       pr_debug("pcie-config-read: bus=%3d [%3d..%3d] devfn=0x%04x"
59308 +                " offset=0x%04x len=%d, addr=0x%p val=0x%08x\n",
59309 +                bus->number, hose->first_busno, hose->last_busno,
59310 +                devfn, offset, len, addr + offset, *val);
59311 +
59312 +       /* Check for CRS (440SPe rev B does that for us but heh ..) */
59313 +       if (in_be32(port->utl_base + PEUTL_RCSTA) & 0x00040000) {
59314 +               pr_debug("Got CRS !\n");
59315 +               if (len != 4 || offset != 0)
59316 +                       return PCIBIOS_DEVICE_NOT_FOUND;
59317 +               *val = 0xffff0001;
59318 +       }
59319 +
59320 +       dcr_write(port->dcrs, DCRO_PEGPL_CFG, gpl_cfg);
59321 +
59322 +       return PCIBIOS_SUCCESSFUL;
59323 +}
59324 +
59325 +static int ppc4xx_pciex_write_config(struct pci_bus *bus, unsigned int devfn,
59326 +                                    int offset, int len, u32 val)
59327 +{
59328 +       struct pci_controller *hose = (struct pci_controller *) bus->sysdata;
59329 +       struct ppc4xx_pciex_port *port =
59330 +               &ppc4xx_pciex_ports[hose->indirect_type];
59331 +       void __iomem *addr;
59332 +       u32 gpl_cfg;
59333 +
59334 +       if (ppc4xx_pciex_validate_bdf(port, bus, devfn) != 0)
59335 +               return PCIBIOS_DEVICE_NOT_FOUND;
59336 +
59337 +       addr = ppc4xx_pciex_get_config_base(port, bus, devfn);
59338 +
59339 +       /*
59340 +        * Reading from configuration space of non-existing device can
59341 +        * generate transaction errors. For the read duration we suppress
59342 +        * assertion of machine check exceptions to avoid those.
59343 +        */
59344 +       gpl_cfg = dcr_read(port->dcrs, DCRO_PEGPL_CFG);
59345 +       dcr_write(port->dcrs, DCRO_PEGPL_CFG, gpl_cfg | GPL_DMER_MASK_DISA);
59346 +
59347 +       pr_debug("pcie-config-write: bus=%3d [%3d..%3d] devfn=0x%04x"
59348 +                " offset=0x%04x len=%d, addr=0x%p val=0x%08x\n",
59349 +                bus->number, hose->first_busno, hose->last_busno,
59350 +                devfn, offset, len, addr + offset, val);
59351 +
59352 +       switch (len) {
59353 +       case 1:
59354 +               out_8((u8 *)(addr + offset), val);
59355 +               break;
59356 +       case 2:
59357 +               out_le16((u16 *)(addr + offset), val);
59358 +               break;
59359 +       default:
59360 +               out_le32((u32 *)(addr + offset), val);
59361 +               break;
59362 +       }
59363 +
59364 +       dcr_write(port->dcrs, DCRO_PEGPL_CFG, gpl_cfg);
59365 +
59366 +       return PCIBIOS_SUCCESSFUL;
59367 +}
59368 +
59369 +static struct pci_ops ppc4xx_pciex_pci_ops =
59370 +{
59371 +       .read  = ppc4xx_pciex_read_config,
59372 +       .write = ppc4xx_pciex_write_config,
59373 +};
59374 +
59375 +static void __init ppc4xx_configure_pciex_POMs(struct ppc4xx_pciex_port *port,
59376 +                                              struct pci_controller *hose,
59377 +                                              void __iomem *mbase)
59378 +{
59379 +       u32 lah, lal, pciah, pcial, sa;
59380 +       int i, j;
59381 +
59382 +       /* Setup outbound memory windows */
59383 +       for (i = j = 0; i < 3; i++) {
59384 +               struct resource *res = &hose->mem_resources[i];
59385 +
59386 +               /* we only care about memory windows */
59387 +               if (!(res->flags & IORESOURCE_MEM))
59388 +                       continue;
59389 +               if (j > 1) {
59390 +                       printk(KERN_WARNING "%s: Too many ranges\n",
59391 +                              port->node->full_name);
59392 +                       break;
59393 +               }
59394 +
59395 +               /* Calculate register values */
59396 +               lah = RES_TO_U32_HIGH(res->start);
59397 +               lal = RES_TO_U32_LOW(res->start);
59398 +               pciah = RES_TO_U32_HIGH(res->start - hose->pci_mem_offset);
59399 +               pcial = RES_TO_U32_LOW(res->start - hose->pci_mem_offset);
59400 +               sa = res->end + 1 - res->start;
59401 +               if (!is_power_of_2(sa) || sa < 0x100000 ||
59402 +                   sa > 0xffffffffu) {
59403 +                       printk(KERN_WARNING "%s: Resource out of range\n",
59404 +                              port->node->full_name);
59405 +                       continue;
59406 +               }
59407 +               sa = (0xffffffffu << ilog2(sa)) | 0x1;
59408 +
59409 +               /* Program register values */
59410 +               switch (j) {
59411 +               case 0:
59412 +                       out_le32(mbase + PECFG_POM0LAH, pciah);
59413 +                       out_le32(mbase + PECFG_POM0LAL, pcial);
59414 +                       dcr_write(port->dcrs, DCRO_PEGPL_OMR1BAH, lah);
59415 +                       dcr_write(port->dcrs, DCRO_PEGPL_OMR1BAL, lal);
59416 +                       dcr_write(port->dcrs, DCRO_PEGPL_OMR1MSKH, 0x7fffffff);
59417 +                       dcr_write(port->dcrs, DCRO_PEGPL_OMR1MSKL, sa | 3);
59418 +                       break;
59419 +               case 1:
59420 +                       out_le32(mbase + PECFG_POM1LAH, pciah);
59421 +                       out_le32(mbase + PECFG_POM1LAL, pcial);
59422 +                       dcr_write(port->dcrs, DCRO_PEGPL_OMR2BAH, lah);
59423 +                       dcr_write(port->dcrs, DCRO_PEGPL_OMR2BAL, lal);
59424 +                       dcr_write(port->dcrs, DCRO_PEGPL_OMR2MSKH, 0x7fffffff);
59425 +                       dcr_write(port->dcrs, DCRO_PEGPL_OMR2MSKL, sa | 3);
59426 +                       break;
59427 +               }
59428 +               j++;
59429 +       }
59430 +
59431 +       /* Configure IO, always 64K starting at 0 */
59432 +       if (hose->io_resource.flags & IORESOURCE_IO) {
59433 +               lah = RES_TO_U32_HIGH(hose->io_base_phys);
59434 +               lal = RES_TO_U32_LOW(hose->io_base_phys);
59435 +               out_le32(mbase + PECFG_POM2LAH, 0);
59436 +               out_le32(mbase + PECFG_POM2LAL, 0);
59437 +               dcr_write(port->dcrs, DCRO_PEGPL_OMR3BAH, lah);
59438 +               dcr_write(port->dcrs, DCRO_PEGPL_OMR3BAL, lal);
59439 +               dcr_write(port->dcrs, DCRO_PEGPL_OMR3MSKH, 0x7fffffff);
59440 +               dcr_write(port->dcrs, DCRO_PEGPL_OMR3MSKL, 0xffff0000 | 3);
59441 +       }
59442 +}
59443 +
59444 +static void __init ppc4xx_configure_pciex_PIMs(struct ppc4xx_pciex_port *port,
59445 +                                              struct pci_controller *hose,
59446 +                                              void __iomem *mbase,
59447 +                                              struct resource *res)
59448 +{
59449 +       resource_size_t size = res->end - res->start + 1;
59450 +       u64 sa;
59451 +
59452 +       /* Calculate window size */
59453 +       sa = (0xffffffffffffffffull << ilog2(size));;
59454 +       if (res->flags & IORESOURCE_PREFETCH)
59455 +               sa |= 0x8;
59456 +
59457 +       out_le32(mbase + PECFG_BAR0HMPA, RES_TO_U32_HIGH(sa));
59458 +       out_le32(mbase + PECFG_BAR0LMPA, RES_TO_U32_LOW(sa));
59459 +
59460 +       /* The setup of the split looks weird to me ... let's see if it works */
59461 +       out_le32(mbase + PECFG_PIM0LAL, 0x00000000);
59462 +       out_le32(mbase + PECFG_PIM0LAH, 0x00000000);
59463 +       out_le32(mbase + PECFG_PIM1LAL, 0x00000000);
59464 +       out_le32(mbase + PECFG_PIM1LAH, 0x00000000);
59465 +       out_le32(mbase + PECFG_PIM01SAH, 0xffff0000);
59466 +       out_le32(mbase + PECFG_PIM01SAL, 0x00000000);
59467 +
59468 +       /* Enable inbound mapping */
59469 +       out_le32(mbase + PECFG_PIMEN, 0x1);
59470 +
59471 +       out_le32(mbase + PCI_BASE_ADDRESS_0, RES_TO_U32_LOW(res->start));
59472 +       out_le32(mbase + PCI_BASE_ADDRESS_1, RES_TO_U32_HIGH(res->start));
59473 +
59474 +       /* Enable I/O, Mem, and Busmaster cycles */
59475 +       out_le16(mbase + PCI_COMMAND,
59476 +                in_le16(mbase + PCI_COMMAND) |
59477 +                PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
59478 +}
59479 +
59480 +static void __init ppc4xx_pciex_port_setup_hose(struct ppc4xx_pciex_port *port)
59481 +{
59482 +       struct resource dma_window;
59483 +       struct pci_controller *hose = NULL;
59484 +       const int *bus_range;
59485 +       int primary = 0, busses;
59486 +       void __iomem *mbase = NULL, *cfg_data = NULL;
59487 +
59488 +       /* XXX FIXME: Handle endpoint mode properly */
59489 +       if (port->endpoint) {
59490 +               printk(KERN_WARNING "PCIE%d: Port in endpoint mode !\n",
59491 +                      port->index);
59492 +               return;
59493 +       }
59494 +
59495 +       /* Check if primary bridge */
59496 +       if (of_get_property(port->node, "primary", NULL))
59497 +               primary = 1;
59498 +
59499 +       /* Get bus range if any */
59500 +       bus_range = of_get_property(port->node, "bus-range", NULL);
59501 +
59502 +       /* Allocate the host controller data structure */
59503 +       hose = pcibios_alloc_controller(port->node);
59504 +       if (!hose)
59505 +               goto fail;
59506 +
59507 +       /* We stick the port number in "indirect_type" so the config space
59508 +        * ops can retrieve the port data structure easily
59509 +        */
59510 +       hose->indirect_type = port->index;
59511 +
59512 +       /* Get bus range */
59513 +       hose->first_busno = bus_range ? bus_range[0] : 0x0;
59514 +       hose->last_busno = bus_range ? bus_range[1] : 0xff;
59515 +
59516 +       /* Because of how big mapping the config space is (1M per bus), we
59517 +        * limit how many busses we support. In the long run, we could replace
59518 +        * that with something akin to kmap_atomic instead. We set aside 1 bus
59519 +        * for the host itself too.
59520 +        */
59521 +       busses = hose->last_busno - hose->first_busno; /* This is off by 1 */
59522 +       if (busses > MAX_PCIE_BUS_MAPPED) {
59523 +               busses = MAX_PCIE_BUS_MAPPED;
59524 +               hose->last_busno = hose->first_busno + busses;
59525 +       }
59526 +
59527 +       /* We map the external config space in cfg_data and the host config
59528 +        * space in cfg_addr. External space is 1M per bus, internal space
59529 +        * is 4K
59530 +        */
59531 +       cfg_data = ioremap(port->cfg_space.start +
59532 +                                (hose->first_busno + 1) * 0x100000,
59533 +                                busses * 0x100000);
59534 +       mbase = ioremap(port->cfg_space.start + 0x10000000, 0x1000);
59535 +       if (cfg_data == NULL || mbase == NULL) {
59536 +               printk(KERN_ERR "%s: Can't map config space !",
59537 +                      port->node->full_name);
59538 +               goto fail;
59539 +       }
59540 +
59541 +       hose->cfg_data = cfg_data;
59542 +       hose->cfg_addr = mbase;
59543 +
59544 +       pr_debug("PCIE %s, bus %d..%d\n", port->node->full_name,
59545 +                hose->first_busno, hose->last_busno);
59546 +       pr_debug("     config space mapped at: root @0x%p, other @0x%p\n",
59547 +                hose->cfg_addr, hose->cfg_data);
59548 +
59549 +       /* Setup config space */
59550 +       hose->ops = &ppc4xx_pciex_pci_ops;
59551 +       port->hose = hose;
59552 +       mbase = (void __iomem *)hose->cfg_addr;
59553 +
59554 +       /*
59555 +        * Set bus numbers on our root port
59556 +        */
59557 +       out_8(mbase + PCI_PRIMARY_BUS, hose->first_busno);
59558 +       out_8(mbase + PCI_SECONDARY_BUS, hose->first_busno + 1);
59559 +       out_8(mbase + PCI_SUBORDINATE_BUS, hose->last_busno);
59560 +
59561 +       /*
59562 +        * OMRs are already reset, also disable PIMs
59563 +        */
59564 +       out_le32(mbase + PECFG_PIMEN, 0);
59565 +
59566 +       /* Parse outbound mapping resources */
59567 +       pci_process_bridge_OF_ranges(hose, port->node, primary);
59568 +
59569 +       /* Parse inbound mapping resources */
59570 +       if (ppc4xx_parse_dma_ranges(hose, mbase, &dma_window) != 0)
59571 +               goto fail;
59572 +
59573 +       /* Configure outbound ranges POMs */
59574 +       ppc4xx_configure_pciex_POMs(port, hose, mbase);
59575 +
59576 +       /* Configure inbound ranges PIMs */
59577 +       ppc4xx_configure_pciex_PIMs(port, hose, mbase, &dma_window);
59578 +
59579 +       /* The root complex doesn't show up if we don't set some vendor
59580 +        * and device IDs into it. Those are the same bogus one that the
59581 +        * initial code in arch/ppc add. We might want to change that.
59582 +        */
59583 +       out_le16(mbase + 0x200, 0xaaa0 + port->index);
59584 +       out_le16(mbase + 0x202, 0xbed0 + port->index);
59585 +
59586 +       /* Set Class Code to PCI-PCI bridge and Revision Id to 1 */
59587 +       out_le32(mbase + 0x208, 0x06040001);
59588 +
59589 +       printk(KERN_INFO "PCIE%d: successfully set as root-complex\n",
59590 +              port->index);
59591 +       return;
59592 + fail:
59593 +       if (hose)
59594 +               pcibios_free_controller(hose);
59595 +       if (cfg_data)
59596 +               iounmap(cfg_data);
59597 +       if (mbase)
59598 +               iounmap(mbase);
59599 +}
59600 +
59601 +static void __init ppc4xx_probe_pciex_bridge(struct device_node *np)
59602 +{
59603 +       struct ppc4xx_pciex_port *port;
59604 +       const u32 *pval;
59605 +       int portno;
59606 +       unsigned int dcrs;
59607 +
59608 +       /* First, proceed to core initialization as we assume there's
59609 +        * only one PCIe core in the system
59610 +        */
59611 +       if (ppc4xx_pciex_check_core_init(np))
59612 +               return;
59613 +
59614 +       /* Get the port number from the device-tree */
59615 +       pval = of_get_property(np, "port", NULL);
59616 +       if (pval == NULL) {
59617 +               printk(KERN_ERR "PCIE: Can't find port number for %s\n",
59618 +                      np->full_name);
59619 +               return;
59620 +       }
59621 +       portno = *pval;
59622 +       if (portno >= ppc4xx_pciex_port_count) {
59623 +               printk(KERN_ERR "PCIE: port number out of range for %s\n",
59624 +                      np->full_name);
59625 +               return;
59626 +       }
59627 +       port = &ppc4xx_pciex_ports[portno];
59628 +       port->index = portno;
59629 +       port->node = of_node_get(np);
59630 +       pval = of_get_property(np, "sdr-base", NULL);
59631 +       if (pval == NULL) {
59632 +               printk(KERN_ERR "PCIE: missing sdr-base for %s\n",
59633 +                      np->full_name);
59634 +               return;
59635 +       }
59636 +       port->sdr_base = *pval;
59637 +
59638 +       /* XXX Currently, we only support root complex mode */
59639 +       port->endpoint = 0;
59640 +
59641 +       /* Fetch config space registers address */
59642 +       if (of_address_to_resource(np, 0, &port->cfg_space)) {
59643 +               printk(KERN_ERR "%s: Can't get PCI-E config space !",
59644 +                      np->full_name);
59645 +               return;
59646 +       }
59647 +       /* Fetch host bridge internal registers address */
59648 +       if (of_address_to_resource(np, 1, &port->utl_regs)) {
59649 +               printk(KERN_ERR "%s: Can't get UTL register base !",
59650 +                      np->full_name);
59651 +               return;
59652 +       }
59653 +
59654 +       /* Map DCRs */
59655 +       dcrs = dcr_resource_start(np, 0);
59656 +       if (dcrs == 0) {
59657 +               printk(KERN_ERR "%s: Can't get DCR register base !",
59658 +                      np->full_name);
59659 +               return;
59660 +       }
59661 +       port->dcrs = dcr_map(np, dcrs, dcr_resource_len(np, 0));
59662 +
59663 +       /* Initialize the port specific registers */
59664 +       if (ppc4xx_pciex_port_init(port)) {
59665 +               printk(KERN_WARNING "PCIE%d: Port init failed\n", port->index);
59666 +               return;
59667 +       }
59668 +
59669 +       /* Setup the linux hose data structure */
59670 +       ppc4xx_pciex_port_setup_hose(port);
59671 +}
59672 +
59673 +#endif /* CONFIG_PPC4xx_PCI_EXPRESS */
59674 +
59675 +static int __init ppc4xx_pci_find_bridges(void)
59676 +{
59677 +       struct device_node *np;
59678 +
59679 +#ifdef CONFIG_PPC4xx_PCI_EXPRESS
59680 +       for_each_compatible_node(np, NULL, "ibm,plb-pciex")
59681 +               ppc4xx_probe_pciex_bridge(np);
59682 +#endif
59683 +       for_each_compatible_node(np, NULL, "ibm,plb-pcix")
59684 +               ppc4xx_probe_pcix_bridge(np);
59685 +       for_each_compatible_node(np, NULL, "ibm,plb-pci")
59686 +               ppc4xx_probe_pci_bridge(np);
59687 +
59688 +       return 0;
59689 +}
59690 +arch_initcall(ppc4xx_pci_find_bridges);
59691 +
59692 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/sysdev/ppc4xx_pci.h powerpc.git/arch/powerpc/sysdev/ppc4xx_pci.h
59693 --- linux-2.6.24/arch/powerpc/sysdev/ppc4xx_pci.h       1970-01-01 01:00:00.000000000 +0100
59694 +++ powerpc.git/arch/powerpc/sysdev/ppc4xx_pci.h        2008-01-28 20:25:49.000000000 +0100
59695 @@ -0,0 +1,369 @@
59696 +/*
59697 + * PCI / PCI-X / PCI-Express support for 4xx parts
59698 + *
59699 + * Copyright 2007 Ben. Herrenschmidt <benh@kernel.crashing.org>, IBM Corp.
59700 + *
59701 + * Bits and pieces extracted from arch/ppc support by
59702 + *
59703 + * Matt Porter <mporter@kernel.crashing.org>
59704 + *
59705 + * Copyright 2002-2005 MontaVista Software Inc.
59706 + */
59707 +#ifndef __PPC4XX_PCI_H__
59708 +#define __PPC4XX_PCI_H__
59709 +
59710 +/*
59711 + * 4xx PCI-X bridge register definitions
59712 + */
59713 +#define PCIX0_VENDID           0x000
59714 +#define PCIX0_DEVID            0x002
59715 +#define PCIX0_COMMAND          0x004
59716 +#define PCIX0_STATUS           0x006
59717 +#define PCIX0_REVID            0x008
59718 +#define PCIX0_CLS              0x009
59719 +#define PCIX0_CACHELS          0x00c
59720 +#define PCIX0_LATTIM           0x00d
59721 +#define PCIX0_HDTYPE           0x00e
59722 +#define PCIX0_BIST             0x00f
59723 +#define PCIX0_BAR0L            0x010
59724 +#define PCIX0_BAR0H            0x014
59725 +#define PCIX0_BAR1             0x018
59726 +#define PCIX0_BAR2L            0x01c
59727 +#define PCIX0_BAR2H            0x020
59728 +#define PCIX0_BAR3             0x024
59729 +#define PCIX0_CISPTR           0x028
59730 +#define PCIX0_SBSYSVID         0x02c
59731 +#define PCIX0_SBSYSID          0x02e
59732 +#define PCIX0_EROMBA           0x030
59733 +#define PCIX0_CAP              0x034
59734 +#define PCIX0_RES0             0x035
59735 +#define PCIX0_RES1             0x036
59736 +#define PCIX0_RES2             0x038
59737 +#define PCIX0_INTLN            0x03c
59738 +#define PCIX0_INTPN            0x03d
59739 +#define PCIX0_MINGNT           0x03e
59740 +#define PCIX0_MAXLTNCY         0x03f
59741 +#define PCIX0_BRDGOPT1         0x040
59742 +#define PCIX0_BRDGOPT2         0x044
59743 +#define PCIX0_ERREN            0x050
59744 +#define PCIX0_ERRSTS           0x054
59745 +#define PCIX0_PLBBESR          0x058
59746 +#define PCIX0_PLBBEARL         0x05c
59747 +#define PCIX0_PLBBEARH         0x060
59748 +#define PCIX0_POM0LAL          0x068
59749 +#define PCIX0_POM0LAH          0x06c
59750 +#define PCIX0_POM0SA           0x070
59751 +#define PCIX0_POM0PCIAL                0x074
59752 +#define PCIX0_POM0PCIAH                0x078
59753 +#define PCIX0_POM1LAL          0x07c
59754 +#define PCIX0_POM1LAH          0x080
59755 +#define PCIX0_POM1SA           0x084
59756 +#define PCIX0_POM1PCIAL                0x088
59757 +#define PCIX0_POM1PCIAH                0x08c
59758 +#define PCIX0_POM2SA           0x090
59759 +#define PCIX0_PIM0SAL          0x098
59760 +#define PCIX0_PIM0SA           PCIX0_PIM0SAL
59761 +#define PCIX0_PIM0LAL          0x09c
59762 +#define PCIX0_PIM0LAH          0x0a0
59763 +#define PCIX0_PIM1SA           0x0a4
59764 +#define PCIX0_PIM1LAL          0x0a8
59765 +#define PCIX0_PIM1LAH          0x0ac
59766 +#define PCIX0_PIM2SAL          0x0b0
59767 +#define PCIX0_PIM2SA           PCIX0_PIM2SAL
59768 +#define PCIX0_PIM2LAL          0x0b4
59769 +#define PCIX0_PIM2LAH          0x0b8
59770 +#define PCIX0_OMCAPID          0x0c0
59771 +#define PCIX0_OMNIPTR          0x0c1
59772 +#define PCIX0_OMMC             0x0c2
59773 +#define PCIX0_OMMA             0x0c4
59774 +#define PCIX0_OMMUA            0x0c8
59775 +#define PCIX0_OMMDATA          0x0cc
59776 +#define PCIX0_OMMEOI           0x0ce
59777 +#define PCIX0_PMCAPID          0x0d0
59778 +#define PCIX0_PMNIPTR          0x0d1
59779 +#define PCIX0_PMC              0x0d2
59780 +#define PCIX0_PMCSR            0x0d4
59781 +#define PCIX0_PMCSRBSE         0x0d6
59782 +#define PCIX0_PMDATA           0x0d7
59783 +#define PCIX0_PMSCRR           0x0d8
59784 +#define PCIX0_CAPID            0x0dc
59785 +#define PCIX0_NIPTR            0x0dd
59786 +#define PCIX0_CMD              0x0de
59787 +#define PCIX0_STS              0x0e0
59788 +#define PCIX0_IDR              0x0e4
59789 +#define PCIX0_CID              0x0e8
59790 +#define PCIX0_RID              0x0ec
59791 +#define PCIX0_PIM0SAH          0x0f8
59792 +#define PCIX0_PIM2SAH          0x0fc
59793 +#define PCIX0_MSGIL            0x100
59794 +#define PCIX0_MSGIH            0x104
59795 +#define PCIX0_MSGOL            0x108
59796 +#define PCIX0_MSGOH            0x10c
59797 +#define PCIX0_IM               0x1f8
59798 +
59799 +/*
59800 + * 4xx PCI bridge register definitions
59801 + */
59802 +#define PCIL0_PMM0LA           0x00
59803 +#define PCIL0_PMM0MA           0x04
59804 +#define PCIL0_PMM0PCILA                0x08
59805 +#define PCIL0_PMM0PCIHA                0x0c
59806 +#define PCIL0_PMM1LA           0x10
59807 +#define PCIL0_PMM1MA           0x14
59808 +#define PCIL0_PMM1PCILA                0x18
59809 +#define PCIL0_PMM1PCIHA                0x1c
59810 +#define PCIL0_PMM2LA           0x20
59811 +#define PCIL0_PMM2MA           0x24
59812 +#define PCIL0_PMM2PCILA                0x28
59813 +#define PCIL0_PMM2PCIHA                0x2c
59814 +#define PCIL0_PTM1MS           0x30
59815 +#define PCIL0_PTM1LA           0x34
59816 +#define PCIL0_PTM2MS           0x38
59817 +#define PCIL0_PTM2LA           0x3c
59818 +
59819 +/*
59820 + * 4xx PCIe bridge register definitions
59821 + */
59822 +
59823 +/* DCR offsets */
59824 +#define DCRO_PEGPL_CFGBAH              0x00
59825 +#define DCRO_PEGPL_CFGBAL              0x01
59826 +#define DCRO_PEGPL_CFGMSK              0x02
59827 +#define DCRO_PEGPL_MSGBAH              0x03
59828 +#define DCRO_PEGPL_MSGBAL              0x04
59829 +#define DCRO_PEGPL_MSGMSK              0x05
59830 +#define DCRO_PEGPL_OMR1BAH             0x06
59831 +#define DCRO_PEGPL_OMR1BAL             0x07
59832 +#define DCRO_PEGPL_OMR1MSKH            0x08
59833 +#define DCRO_PEGPL_OMR1MSKL            0x09
59834 +#define DCRO_PEGPL_OMR2BAH             0x0a
59835 +#define DCRO_PEGPL_OMR2BAL             0x0b
59836 +#define DCRO_PEGPL_OMR2MSKH            0x0c
59837 +#define DCRO_PEGPL_OMR2MSKL            0x0d
59838 +#define DCRO_PEGPL_OMR3BAH             0x0e
59839 +#define DCRO_PEGPL_OMR3BAL             0x0f
59840 +#define DCRO_PEGPL_OMR3MSKH            0x10
59841 +#define DCRO_PEGPL_OMR3MSKL            0x11
59842 +#define DCRO_PEGPL_REGBAH              0x12
59843 +#define DCRO_PEGPL_REGBAL              0x13
59844 +#define DCRO_PEGPL_REGMSK              0x14
59845 +#define DCRO_PEGPL_SPECIAL             0x15
59846 +#define DCRO_PEGPL_CFG                 0x16
59847 +#define DCRO_PEGPL_ESR                 0x17
59848 +#define DCRO_PEGPL_EARH                        0x18
59849 +#define DCRO_PEGPL_EARL                        0x19
59850 +#define DCRO_PEGPL_EATR                        0x1a
59851 +
59852 +/* DMER mask */
59853 +#define GPL_DMER_MASK_DISA     0x02000000
59854 +
59855 +/*
59856 + * System DCRs (SDRs)
59857 + */
59858 +#define PESDR0_PLLLCT1                 0x03a0
59859 +#define PESDR0_PLLLCT2                 0x03a1
59860 +#define PESDR0_PLLLCT3                 0x03a2
59861 +
59862 +/*
59863 + * 440SPe additional DCRs
59864 + */
59865 +#define PESDR0_440SPE_UTLSET1          0x0300
59866 +#define PESDR0_440SPE_UTLSET2          0x0301
59867 +#define PESDR0_440SPE_DLPSET           0x0302
59868 +#define PESDR0_440SPE_LOOP             0x0303
59869 +#define PESDR0_440SPE_RCSSET           0x0304
59870 +#define PESDR0_440SPE_RCSSTS           0x0305
59871 +#define PESDR0_440SPE_HSSL0SET1                0x0306
59872 +#define PESDR0_440SPE_HSSL0SET2                0x0307
59873 +#define PESDR0_440SPE_HSSL0STS         0x0308
59874 +#define PESDR0_440SPE_HSSL1SET1                0x0309
59875 +#define PESDR0_440SPE_HSSL1SET2                0x030a
59876 +#define PESDR0_440SPE_HSSL1STS         0x030b
59877 +#define PESDR0_440SPE_HSSL2SET1                0x030c
59878 +#define PESDR0_440SPE_HSSL2SET2                0x030d
59879 +#define PESDR0_440SPE_HSSL2STS         0x030e
59880 +#define PESDR0_440SPE_HSSL3SET1                0x030f
59881 +#define PESDR0_440SPE_HSSL3SET2                0x0310
59882 +#define PESDR0_440SPE_HSSL3STS         0x0311
59883 +#define PESDR0_440SPE_HSSL4SET1                0x0312
59884 +#define PESDR0_440SPE_HSSL4SET2                0x0313
59885 +#define PESDR0_440SPE_HSSL4STS         0x0314
59886 +#define PESDR0_440SPE_HSSL5SET1                0x0315
59887 +#define PESDR0_440SPE_HSSL5SET2                0x0316
59888 +#define PESDR0_440SPE_HSSL5STS         0x0317
59889 +#define PESDR0_440SPE_HSSL6SET1                0x0318
59890 +#define PESDR0_440SPE_HSSL6SET2                0x0319
59891 +#define PESDR0_440SPE_HSSL6STS         0x031a
59892 +#define PESDR0_440SPE_HSSL7SET1                0x031b
59893 +#define PESDR0_440SPE_HSSL7SET2                0x031c
59894 +#define PESDR0_440SPE_HSSL7STS         0x031d
59895 +#define PESDR0_440SPE_HSSCTLSET                0x031e
59896 +#define PESDR0_440SPE_LANE_ABCD                0x031f
59897 +#define PESDR0_440SPE_LANE_EFGH                0x0320
59898 +
59899 +#define PESDR1_440SPE_UTLSET1          0x0340
59900 +#define PESDR1_440SPE_UTLSET2          0x0341
59901 +#define PESDR1_440SPE_DLPSET           0x0342
59902 +#define PESDR1_440SPE_LOOP             0x0343
59903 +#define PESDR1_440SPE_RCSSET           0x0344
59904 +#define PESDR1_440SPE_RCSSTS           0x0345
59905 +#define PESDR1_440SPE_HSSL0SET1                0x0346
59906 +#define PESDR1_440SPE_HSSL0SET2                0x0347
59907 +#define PESDR1_440SPE_HSSL0STS         0x0348
59908 +#define PESDR1_440SPE_HSSL1SET1                0x0349
59909 +#define PESDR1_440SPE_HSSL1SET2                0x034a
59910 +#define PESDR1_440SPE_HSSL1STS         0x034b
59911 +#define PESDR1_440SPE_HSSL2SET1                0x034c
59912 +#define PESDR1_440SPE_HSSL2SET2                0x034d
59913 +#define PESDR1_440SPE_HSSL2STS         0x034e
59914 +#define PESDR1_440SPE_HSSL3SET1                0x034f
59915 +#define PESDR1_440SPE_HSSL3SET2                0x0350
59916 +#define PESDR1_440SPE_HSSL3STS         0x0351
59917 +#define PESDR1_440SPE_HSSCTLSET                0x0352
59918 +#define PESDR1_440SPE_LANE_ABCD                0x0353
59919 +
59920 +#define PESDR2_440SPE_UTLSET1          0x0370
59921 +#define PESDR2_440SPE_UTLSET2          0x0371
59922 +#define PESDR2_440SPE_DLPSET           0x0372
59923 +#define PESDR2_440SPE_LOOP             0x0373
59924 +#define PESDR2_440SPE_RCSSET           0x0374
59925 +#define PESDR2_440SPE_RCSSTS           0x0375
59926 +#define PESDR2_440SPE_HSSL0SET1                0x0376
59927 +#define PESDR2_440SPE_HSSL0SET2                0x0377
59928 +#define PESDR2_440SPE_HSSL0STS         0x0378
59929 +#define PESDR2_440SPE_HSSL1SET1                0x0379
59930 +#define PESDR2_440SPE_HSSL1SET2                0x037a
59931 +#define PESDR2_440SPE_HSSL1STS         0x037b
59932 +#define PESDR2_440SPE_HSSL2SET1                0x037c
59933 +#define PESDR2_440SPE_HSSL2SET2                0x037d
59934 +#define PESDR2_440SPE_HSSL2STS         0x037e
59935 +#define PESDR2_440SPE_HSSL3SET1                0x037f
59936 +#define PESDR2_440SPE_HSSL3SET2                0x0380
59937 +#define PESDR2_440SPE_HSSL3STS         0x0381
59938 +#define PESDR2_440SPE_HSSCTLSET                0x0382
59939 +#define PESDR2_440SPE_LANE_ABCD                0x0383
59940 +
59941 +/*
59942 + * 405EX additional DCRs
59943 + */
59944 +#define PESDR0_405EX_UTLSET1           0x0400
59945 +#define PESDR0_405EX_UTLSET2           0x0401
59946 +#define PESDR0_405EX_DLPSET            0x0402
59947 +#define PESDR0_405EX_LOOP              0x0403
59948 +#define PESDR0_405EX_RCSSET            0x0404
59949 +#define PESDR0_405EX_RCSSTS            0x0405
59950 +#define PESDR0_405EX_PHYSET1           0x0406
59951 +#define PESDR0_405EX_PHYSET2           0x0407
59952 +#define PESDR0_405EX_BIST              0x0408
59953 +#define PESDR0_405EX_LPB               0x040B
59954 +#define PESDR0_405EX_PHYSTA            0x040C
59955 +
59956 +#define PESDR1_405EX_UTLSET1           0x0440
59957 +#define PESDR1_405EX_UTLSET2           0x0441
59958 +#define PESDR1_405EX_DLPSET            0x0442
59959 +#define PESDR1_405EX_LOOP              0x0443
59960 +#define PESDR1_405EX_RCSSET            0x0444
59961 +#define PESDR1_405EX_RCSSTS            0x0445
59962 +#define PESDR1_405EX_PHYSET1           0x0446
59963 +#define PESDR1_405EX_PHYSET2           0x0447
59964 +#define PESDR1_405EX_BIST              0x0448
59965 +#define PESDR1_405EX_LPB               0x044B
59966 +#define PESDR1_405EX_PHYSTA            0x044C
59967 +
59968 +/*
59969 + * Of the above, some are common offsets from the base
59970 + */
59971 +#define PESDRn_UTLSET1                 0x00
59972 +#define PESDRn_UTLSET2                 0x01
59973 +#define PESDRn_DLPSET                  0x02
59974 +#define PESDRn_LOOP                    0x03
59975 +#define PESDRn_RCSSET                  0x04
59976 +#define PESDRn_RCSSTS                  0x05
59977 +
59978 +/* 440spe only */
59979 +#define PESDRn_440SPE_HSSL0SET1                0x06
59980 +#define PESDRn_440SPE_HSSL0SET2                0x07
59981 +#define PESDRn_440SPE_HSSL0STS         0x08
59982 +#define PESDRn_440SPE_HSSL1SET1                0x09
59983 +#define PESDRn_440SPE_HSSL1SET2                0x0a
59984 +#define PESDRn_440SPE_HSSL1STS         0x0b
59985 +#define PESDRn_440SPE_HSSL2SET1                0x0c
59986 +#define PESDRn_440SPE_HSSL2SET2                0x0d
59987 +#define PESDRn_440SPE_HSSL2STS         0x0e
59988 +#define PESDRn_440SPE_HSSL3SET1                0x0f
59989 +#define PESDRn_440SPE_HSSL3SET2                0x10
59990 +#define PESDRn_440SPE_HSSL3STS         0x11
59991 +
59992 +/* 440spe port 0 only */
59993 +#define PESDRn_440SPE_HSSL4SET1                0x12
59994 +#define PESDRn_440SPE_HSSL4SET2                0x13
59995 +#define PESDRn_440SPE_HSSL4STS         0x14
59996 +#define PESDRn_440SPE_HSSL5SET1                0x15
59997 +#define PESDRn_440SPE_HSSL5SET2                0x16
59998 +#define PESDRn_440SPE_HSSL5STS         0x17
59999 +#define PESDRn_440SPE_HSSL6SET1                0x18
60000 +#define PESDRn_440SPE_HSSL6SET2                0x19
60001 +#define PESDRn_440SPE_HSSL6STS         0x1a
60002 +#define PESDRn_440SPE_HSSL7SET1                0x1b
60003 +#define PESDRn_440SPE_HSSL7SET2                0x1c
60004 +#define PESDRn_440SPE_HSSL7STS         0x1d
60005 +
60006 +/* 405ex only */
60007 +#define PESDRn_405EX_PHYSET1           0x06
60008 +#define PESDRn_405EX_PHYSET2           0x07
60009 +#define PESDRn_405EX_PHYSTA            0x0c
60010 +
60011 +/*
60012 + * UTL register offsets
60013 + */
60014 +#define PEUTL_PBCTL            0x00
60015 +#define PEUTL_PBBSZ            0x20
60016 +#define PEUTL_OPDBSZ           0x68
60017 +#define PEUTL_IPHBSZ           0x70
60018 +#define PEUTL_IPDBSZ           0x78
60019 +#define PEUTL_OUTTR            0x90
60020 +#define PEUTL_INTR             0x98
60021 +#define PEUTL_PCTL             0xa0
60022 +#define PEUTL_RCSTA            0xB0
60023 +#define PEUTL_RCIRQEN          0xb8
60024 +
60025 +/*
60026 + * Config space register offsets
60027 + */
60028 +#define PECFG_ECRTCTL          0x074
60029 +
60030 +#define PECFG_BAR0LMPA         0x210
60031 +#define PECFG_BAR0HMPA         0x214
60032 +#define PECFG_BAR1MPA          0x218
60033 +#define PECFG_BAR2LMPA         0x220
60034 +#define PECFG_BAR2HMPA         0x224
60035 +
60036 +#define PECFG_PIMEN            0x33c
60037 +#define PECFG_PIM0LAL          0x340
60038 +#define PECFG_PIM0LAH          0x344
60039 +#define PECFG_PIM1LAL          0x348
60040 +#define PECFG_PIM1LAH          0x34c
60041 +#define PECFG_PIM01SAL         0x350
60042 +#define PECFG_PIM01SAH         0x354
60043 +
60044 +#define PECFG_POM0LAL          0x380
60045 +#define PECFG_POM0LAH          0x384
60046 +#define PECFG_POM1LAL          0x388
60047 +#define PECFG_POM1LAH          0x38c
60048 +#define PECFG_POM2LAL          0x390
60049 +#define PECFG_POM2LAH          0x394
60050 +
60051 +
60052 +enum
60053 +{
60054 +       PTYPE_ENDPOINT          = 0x0,
60055 +       PTYPE_LEGACY_ENDPOINT   = 0x1,
60056 +       PTYPE_ROOT_PORT         = 0x4,
60057 +
60058 +       LNKW_X1                 = 0x1,
60059 +       LNKW_X4                 = 0x4,
60060 +       LNKW_X8                 = 0x8
60061 +};
60062 +
60063 +
60064 +#endif /* __PPC4XX_PCI_H__ */
60065 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/sysdev/qe_lib/Kconfig powerpc.git/arch/powerpc/sysdev/qe_lib/Kconfig
60066 --- linux-2.6.24/arch/powerpc/sysdev/qe_lib/Kconfig     2008-01-24 23:58:37.000000000 +0100
60067 +++ powerpc.git/arch/powerpc/sysdev/qe_lib/Kconfig      2008-01-28 20:25:49.000000000 +0100
60068 @@ -4,7 +4,7 @@
60069  
60070  config UCC_SLOW
60071         bool
60072 -       default n
60073 +       default y if SERIAL_QE
60074         help
60075           This option provides qe_lib support to UCC slow
60076           protocols: UART, BISYNC, QMC
60077 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/sysdev/qe_lib/qe.c powerpc.git/arch/powerpc/sysdev/qe_lib/qe.c
60078 --- linux-2.6.24/arch/powerpc/sysdev/qe_lib/qe.c        2008-01-24 23:58:37.000000000 +0100
60079 +++ powerpc.git/arch/powerpc/sysdev/qe_lib/qe.c 2008-01-28 20:25:49.000000000 +0100
60080 @@ -25,6 +25,7 @@
60081  #include <linux/module.h>
60082  #include <linux/delay.h>
60083  #include <linux/ioport.h>
60084 +#include <linux/crc32.h>
60085  #include <asm/irq.h>
60086  #include <asm/page.h>
60087  #include <asm/pgtable.h>
60088 @@ -167,19 +168,20 @@
60089  
60090  /* Program the BRG to the given sampling rate and multiplier
60091   *
60092 - * @brg: the BRG, 1-16
60093 + * @brg: the BRG, QE_BRG1 - QE_BRG16
60094   * @rate: the desired sampling rate
60095   * @multiplier: corresponds to the value programmed in GUMR_L[RDCR] or
60096   * GUMR_L[TDCR].  E.g., if this BRG is the RX clock, and GUMR_L[RDCR]=01,
60097   * then 'multiplier' should be 8.
60098 - *
60099 - * Also note that the value programmed into the BRGC register must be even.
60100   */
60101 -void qe_setbrg(unsigned int brg, unsigned int rate, unsigned int multiplier)
60102 +int qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier)
60103  {
60104         u32 divisor, tempval;
60105         u32 div16 = 0;
60106  
60107 +       if ((brg < QE_BRG1) || (brg > QE_BRG16))
60108 +               return -EINVAL;
60109 +
60110         divisor = get_brg_clk() / (rate * multiplier);
60111  
60112         if (divisor > QE_BRGC_DIVISOR_MAX + 1) {
60113 @@ -196,8 +198,43 @@
60114         tempval = ((divisor - 1) << QE_BRGC_DIVISOR_SHIFT) |
60115                 QE_BRGC_ENABLE | div16;
60116  
60117 -       out_be32(&qe_immr->brg.brgc[brg - 1], tempval);
60118 +       out_be32(&qe_immr->brg.brgc[brg - QE_BRG1], tempval);
60119 +
60120 +       return 0;
60121 +}
60122 +EXPORT_SYMBOL(qe_setbrg);
60123 +
60124 +/* Convert a string to a QE clock source enum
60125 + *
60126 + * This function takes a string, typically from a property in the device
60127 + * tree, and returns the corresponding "enum qe_clock" value.
60128 +*/
60129 +enum qe_clock qe_clock_source(const char *source)
60130 +{
60131 +       unsigned int i;
60132 +
60133 +       if (strcasecmp(source, "none") == 0)
60134 +               return QE_CLK_NONE;
60135 +
60136 +       if (strncasecmp(source, "brg", 3) == 0) {
60137 +               i = simple_strtoul(source + 3, NULL, 10);
60138 +               if ((i >= 1) && (i <= 16))
60139 +                       return (QE_BRG1 - 1) + i;
60140 +               else
60141 +                       return QE_CLK_DUMMY;
60142 +       }
60143 +
60144 +       if (strncasecmp(source, "clk", 3) == 0) {
60145 +               i = simple_strtoul(source + 3, NULL, 10);
60146 +               if ((i >= 1) && (i <= 24))
60147 +                       return (QE_CLK1 - 1) + i;
60148 +               else
60149 +                       return QE_CLK_DUMMY;
60150 +       }
60151 +
60152 +       return QE_CLK_DUMMY;
60153  }
60154 +EXPORT_SYMBOL(qe_clock_source);
60155  
60156  /* Initialize SNUMs (thread serial numbers) according to
60157   * QE Module Control chapter, SNUM table
60158 @@ -358,3 +395,249 @@
60159         return (void *)&qe_immr->muram[offset];
60160  }
60161  EXPORT_SYMBOL(qe_muram_addr);
60162 +
60163 +/* The maximum number of RISCs we support */
60164 +#define MAX_QE_RISC     2
60165 +
60166 +/* Firmware information stored here for qe_get_firmware_info() */
60167 +static struct qe_firmware_info qe_firmware_info;
60168 +
60169 +/*
60170 + * Set to 1 if QE firmware has been uploaded, and therefore
60171 + * qe_firmware_info contains valid data.
60172 + */
60173 +static int qe_firmware_uploaded;
60174 +
60175 +/*
60176 + * Upload a QE microcode
60177 + *
60178 + * This function is a worker function for qe_upload_firmware().  It does
60179 + * the actual uploading of the microcode.
60180 + */
60181 +static void qe_upload_microcode(const void *base,
60182 +       const struct qe_microcode *ucode)
60183 +{
60184 +       const __be32 *code = base + be32_to_cpu(ucode->code_offset);
60185 +       unsigned int i;
60186 +
60187 +       if (ucode->major || ucode->minor || ucode->revision)
60188 +               printk(KERN_INFO "qe-firmware: "
60189 +                       "uploading microcode '%s' version %u.%u.%u\n",
60190 +                       ucode->id, ucode->major, ucode->minor, ucode->revision);
60191 +       else
60192 +               printk(KERN_INFO "qe-firmware: "
60193 +                       "uploading microcode '%s'\n", ucode->id);
60194 +
60195 +       /* Use auto-increment */
60196 +       out_be32(&qe_immr->iram.iadd, be32_to_cpu(ucode->iram_offset) |
60197 +               QE_IRAM_IADD_AIE | QE_IRAM_IADD_BADDR);
60198 +
60199 +       for (i = 0; i < be32_to_cpu(ucode->count); i++)
60200 +               out_be32(&qe_immr->iram.idata, be32_to_cpu(code[i]));
60201 +}
60202 +
60203 +/*
60204 + * Upload a microcode to the I-RAM at a specific address.
60205 + *
60206 + * See Documentation/powerpc/qe-firmware.txt for information on QE microcode
60207 + * uploading.
60208 + *
60209 + * Currently, only version 1 is supported, so the 'version' field must be
60210 + * set to 1.
60211 + *
60212 + * The SOC model and revision are not validated, they are only displayed for
60213 + * informational purposes.
60214 + *
60215 + * 'calc_size' is the calculated size, in bytes, of the firmware structure and
60216 + * all of the microcode structures, minus the CRC.
60217 + *
60218 + * 'length' is the size that the structure says it is, including the CRC.
60219 + */
60220 +int qe_upload_firmware(const struct qe_firmware *firmware)
60221 +{
60222 +       unsigned int i;
60223 +       unsigned int j;
60224 +       u32 crc;
60225 +       size_t calc_size = sizeof(struct qe_firmware);
60226 +       size_t length;
60227 +       const struct qe_header *hdr;
60228 +
60229 +       if (!firmware) {
60230 +               printk(KERN_ERR "qe-firmware: invalid pointer\n");
60231 +               return -EINVAL;
60232 +       }
60233 +
60234 +       hdr = &firmware->header;
60235 +       length = be32_to_cpu(hdr->length);
60236 +
60237 +       /* Check the magic */
60238 +       if ((hdr->magic[0] != 'Q') || (hdr->magic[1] != 'E') ||
60239 +           (hdr->magic[2] != 'F')) {
60240 +               printk(KERN_ERR "qe-firmware: not a microcode\n");
60241 +               return -EPERM;
60242 +       }
60243 +
60244 +       /* Check the version */
60245 +       if (hdr->version != 1) {
60246 +               printk(KERN_ERR "qe-firmware: unsupported version\n");
60247 +               return -EPERM;
60248 +       }
60249 +
60250 +       /* Validate some of the fields */
60251 +       if ((firmware->count < 1) || (firmware->count >= MAX_QE_RISC)) {
60252 +               printk(KERN_ERR "qe-firmware: invalid data\n");
60253 +               return -EINVAL;
60254 +       }
60255 +
60256 +       /* Validate the length and check if there's a CRC */
60257 +       calc_size += (firmware->count - 1) * sizeof(struct qe_microcode);
60258 +
60259 +       for (i = 0; i < firmware->count; i++)
60260 +               /*
60261 +                * For situations where the second RISC uses the same microcode
60262 +                * as the first, the 'code_offset' and 'count' fields will be
60263 +                * zero, so it's okay to add those.
60264 +                */
60265 +               calc_size += sizeof(__be32) *
60266 +                       be32_to_cpu(firmware->microcode[i].count);
60267 +
60268 +       /* Validate the length */
60269 +       if (length != calc_size + sizeof(__be32)) {
60270 +               printk(KERN_ERR "qe-firmware: invalid length\n");
60271 +               return -EPERM;
60272 +       }
60273 +
60274 +       /* Validate the CRC */
60275 +       crc = be32_to_cpu(*(__be32 *)((void *)firmware + calc_size));
60276 +       if (crc != crc32(0, firmware, calc_size)) {
60277 +               printk(KERN_ERR "qe-firmware: firmware CRC is invalid\n");
60278 +               return -EIO;
60279 +       }
60280 +
60281 +       /*
60282 +        * If the microcode calls for it, split the I-RAM.
60283 +        */
60284 +       if (!firmware->split)
60285 +               setbits16(&qe_immr->cp.cercr, QE_CP_CERCR_CIR);
60286 +
60287 +       if (firmware->soc.model)
60288 +               printk(KERN_INFO
60289 +                       "qe-firmware: firmware '%s' for %u V%u.%u\n",
60290 +                       firmware->id, be16_to_cpu(firmware->soc.model),
60291 +                       firmware->soc.major, firmware->soc.minor);
60292 +       else
60293 +               printk(KERN_INFO "qe-firmware: firmware '%s'\n",
60294 +                       firmware->id);
60295 +
60296 +       /*
60297 +        * The QE only supports one microcode per RISC, so clear out all the
60298 +        * saved microcode information and put in the new.
60299 +        */
60300 +       memset(&qe_firmware_info, 0, sizeof(qe_firmware_info));
60301 +       strcpy(qe_firmware_info.id, firmware->id);
60302 +       qe_firmware_info.extended_modes = firmware->extended_modes;
60303 +       memcpy(qe_firmware_info.vtraps, firmware->vtraps,
60304 +               sizeof(firmware->vtraps));
60305 +
60306 +       /* Loop through each microcode. */
60307 +       for (i = 0; i < firmware->count; i++) {
60308 +               const struct qe_microcode *ucode = &firmware->microcode[i];
60309 +
60310 +               /* Upload a microcode if it's present */
60311 +               if (ucode->code_offset)
60312 +                       qe_upload_microcode(firmware, ucode);
60313 +
60314 +               /* Program the traps for this processor */
60315 +               for (j = 0; j < 16; j++) {
60316 +                       u32 trap = be32_to_cpu(ucode->traps[j]);
60317 +
60318 +                       if (trap)
60319 +                               out_be32(&qe_immr->rsp[i].tibcr[j], trap);
60320 +               }
60321 +
60322 +               /* Enable traps */
60323 +               out_be32(&qe_immr->rsp[i].eccr, be32_to_cpu(ucode->eccr));
60324 +       }
60325 +
60326 +       qe_firmware_uploaded = 1;
60327 +
60328 +       return 0;
60329 +}
60330 +EXPORT_SYMBOL(qe_upload_firmware);
60331 +
60332 +/*
60333 + * Get info on the currently-loaded firmware
60334 + *
60335 + * This function also checks the device tree to see if the boot loader has
60336 + * uploaded a firmware already.
60337 + */
60338 +struct qe_firmware_info *qe_get_firmware_info(void)
60339 +{
60340 +       static int initialized;
60341 +       struct property *prop;
60342 +       struct device_node *qe;
60343 +       struct device_node *fw = NULL;
60344 +       const char *sprop;
60345 +       unsigned int i;
60346 +
60347 +       /*
60348 +        * If we haven't checked yet, and a driver hasn't uploaded a firmware
60349 +        * yet, then check the device tree for information.
60350 +        */
60351 +       if (initialized || qe_firmware_uploaded)
60352 +               return NULL;
60353 +
60354 +       initialized = 1;
60355 +
60356 +       /*
60357 +        * Newer device trees have an "fsl,qe" compatible property for the QE
60358 +        * node, but we still need to support older device trees.
60359 +       */
60360 +       qe = of_find_compatible_node(NULL, NULL, "fsl,qe");
60361 +       if (!qe) {
60362 +               qe = of_find_node_by_type(NULL, "qe");
60363 +               if (!qe)
60364 +                       return NULL;
60365 +       }
60366 +
60367 +       /* Find the 'firmware' child node */
60368 +       for_each_child_of_node(qe, fw) {
60369 +               if (strcmp(fw->name, "firmware") == 0)
60370 +                       break;
60371 +       }
60372 +
60373 +       of_node_put(qe);
60374 +
60375 +       /* Did we find the 'firmware' node? */
60376 +       if (!fw)
60377 +               return NULL;
60378 +
60379 +       qe_firmware_uploaded = 1;
60380 +
60381 +       /* Copy the data into qe_firmware_info*/
60382 +       sprop = of_get_property(fw, "id", NULL);
60383 +       if (sprop)
60384 +               strncpy(qe_firmware_info.id, sprop,
60385 +                       sizeof(qe_firmware_info.id) - 1);
60386 +
60387 +       prop = of_find_property(fw, "extended-modes", NULL);
60388 +       if (prop && (prop->length == sizeof(u64))) {
60389 +               const u64 *iprop = prop->value;
60390 +
60391 +               qe_firmware_info.extended_modes = *iprop;
60392 +       }
60393 +
60394 +       prop = of_find_property(fw, "virtual-traps", NULL);
60395 +       if (prop && (prop->length == 32)) {
60396 +               const u32 *iprop = prop->value;
60397 +
60398 +               for (i = 0; i < ARRAY_SIZE(qe_firmware_info.vtraps); i++)
60399 +                       qe_firmware_info.vtraps[i] = iprop[i];
60400 +       }
60401 +
60402 +       of_node_put(fw);
60403 +
60404 +       return &qe_firmware_info;
60405 +}
60406 +EXPORT_SYMBOL(qe_get_firmware_info);
60407 +
60408 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/sysdev/qe_lib/ucc_slow.c powerpc.git/arch/powerpc/sysdev/qe_lib/ucc_slow.c
60409 --- linux-2.6.24/arch/powerpc/sysdev/qe_lib/ucc_slow.c  2008-01-24 23:58:37.000000000 +0100
60410 +++ powerpc.git/arch/powerpc/sysdev/qe_lib/ucc_slow.c   2008-01-28 20:25:49.000000000 +0100
60411 @@ -19,6 +19,7 @@
60412  #include <linux/stddef.h>
60413  #include <linux/interrupt.h>
60414  #include <linux/err.h>
60415 +#include <linux/module.h>
60416  
60417  #include <asm/io.h>
60418  #include <asm/immap_qe.h>
60419 @@ -41,6 +42,7 @@
60420         default: return QE_CR_SUBBLOCK_INVALID;
60421         }
60422  }
60423 +EXPORT_SYMBOL(ucc_slow_get_qe_cr_subblock);
60424  
60425  void ucc_slow_poll_transmitter_now(struct ucc_slow_private * uccs)
60426  {
60427 @@ -56,6 +58,7 @@
60428         qe_issue_cmd(QE_GRACEFUL_STOP_TX, id,
60429                          QE_CR_PROTOCOL_UNSPECIFIED, 0);
60430  }
60431 +EXPORT_SYMBOL(ucc_slow_graceful_stop_tx);
60432  
60433  void ucc_slow_stop_tx(struct ucc_slow_private * uccs)
60434  {
60435 @@ -65,6 +68,7 @@
60436         id = ucc_slow_get_qe_cr_subblock(us_info->ucc_num);
60437         qe_issue_cmd(QE_STOP_TX, id, QE_CR_PROTOCOL_UNSPECIFIED, 0);
60438  }
60439 +EXPORT_SYMBOL(ucc_slow_stop_tx);
60440  
60441  void ucc_slow_restart_tx(struct ucc_slow_private * uccs)
60442  {
60443 @@ -74,6 +78,7 @@
60444         id = ucc_slow_get_qe_cr_subblock(us_info->ucc_num);
60445         qe_issue_cmd(QE_RESTART_TX, id, QE_CR_PROTOCOL_UNSPECIFIED, 0);
60446  }
60447 +EXPORT_SYMBOL(ucc_slow_restart_tx);
60448  
60449  void ucc_slow_enable(struct ucc_slow_private * uccs, enum comm_dir mode)
60450  {
60451 @@ -94,6 +99,7 @@
60452         }
60453         out_be32(&us_regs->gumr_l, gumr_l);
60454  }
60455 +EXPORT_SYMBOL(ucc_slow_enable);
60456  
60457  void ucc_slow_disable(struct ucc_slow_private * uccs, enum comm_dir mode)
60458  {
60459 @@ -114,6 +120,7 @@
60460         }
60461         out_be32(&us_regs->gumr_l, gumr_l);
60462  }
60463 +EXPORT_SYMBOL(ucc_slow_disable);
60464  
60465  /* Initialize the UCC for Slow operations
60466   *
60467 @@ -347,6 +354,7 @@
60468         *uccs_ret = uccs;
60469         return 0;
60470  }
60471 +EXPORT_SYMBOL(ucc_slow_init);
60472  
60473  void ucc_slow_free(struct ucc_slow_private * uccs)
60474  {
60475 @@ -366,5 +374,5 @@
60476  
60477         kfree(uccs);
60478  }
60479 -
60480 +EXPORT_SYMBOL(ucc_slow_free);
60481  
60482 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/sysdev/tsi108_dev.c powerpc.git/arch/powerpc/sysdev/tsi108_dev.c
60483 --- linux-2.6.24/arch/powerpc/sysdev/tsi108_dev.c       2008-01-24 23:58:37.000000000 +0100
60484 +++ powerpc.git/arch/powerpc/sysdev/tsi108_dev.c        2008-01-28 20:25:49.000000000 +0100
60485 @@ -66,14 +66,12 @@
60486  static int __init tsi108_eth_of_init(void)
60487  {
60488         struct device_node *np;
60489 -       unsigned int i;
60490 +       unsigned int i = 0;
60491         struct platform_device *tsi_eth_dev;
60492         struct resource res;
60493         int ret;
60494  
60495 -       for (np = NULL, i = 0;
60496 -            (np = of_find_compatible_node(np, "network", "tsi108-ethernet")) != NULL;
60497 -            i++) {
60498 +       for_each_compatible_node(np, "network", "tsi108-ethernet") {
60499                 struct resource r[2];
60500                 struct device_node *phy, *mdio;
60501                 hw_info tsi_eth_data;
60502 @@ -98,7 +96,7 @@
60503                         __FUNCTION__,r[1].name, r[1].start, r[1].end);
60504  
60505                 tsi_eth_dev =
60506 -                   platform_device_register_simple("tsi-ethernet", i, &r[0],
60507 +                   platform_device_register_simple("tsi-ethernet", i++, &r[0],
60508                                                     1);
60509  
60510                 if (IS_ERR(tsi_eth_dev)) {
60511 @@ -154,6 +152,7 @@
60512  unreg:
60513         platform_device_unregister(tsi_eth_dev);
60514  err:
60515 +       of_node_put(np);
60516         return ret;
60517  }
60518  
60519 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/sysdev/uic.c powerpc.git/arch/powerpc/sysdev/uic.c
60520 --- linux-2.6.24/arch/powerpc/sysdev/uic.c      2008-01-24 23:58:37.000000000 +0100
60521 +++ powerpc.git/arch/powerpc/sysdev/uic.c       2008-01-28 20:25:49.000000000 +0100
60522 @@ -53,21 +53,23 @@
60523  
60524         /* The remapper for this UIC */
60525         struct irq_host *irqhost;
60526 -
60527 -       /* For secondary UICs, the cascade interrupt's irqaction */
60528 -       struct irqaction cascade;
60529  };
60530  
60531  static void uic_unmask_irq(unsigned int virq)
60532  {
60533 +       struct irq_desc *desc = get_irq_desc(virq);
60534         struct uic *uic = get_irq_chip_data(virq);
60535         unsigned int src = uic_irq_to_hw(virq);
60536         unsigned long flags;
60537 -       u32 er;
60538 +       u32 er, sr;
60539  
60540 +       sr = 1 << (31-src);
60541         spin_lock_irqsave(&uic->lock, flags);
60542 +       /* ack level-triggered interrupts here */
60543 +       if (desc->status & IRQ_LEVEL)
60544 +               mtdcr(uic->dcrbase + UIC_SR, sr);
60545         er = mfdcr(uic->dcrbase + UIC_ER);
60546 -       er |= 1 << (31 - src);
60547 +       er |= sr;
60548         mtdcr(uic->dcrbase + UIC_ER, er);
60549         spin_unlock_irqrestore(&uic->lock, flags);
60550  }
60551 @@ -99,6 +101,7 @@
60552  
60553  static void uic_mask_ack_irq(unsigned int virq)
60554  {
60555 +       struct irq_desc *desc = get_irq_desc(virq);
60556         struct uic *uic = get_irq_chip_data(virq);
60557         unsigned int src = uic_irq_to_hw(virq);
60558         unsigned long flags;
60559 @@ -109,7 +112,16 @@
60560         er = mfdcr(uic->dcrbase + UIC_ER);
60561         er &= ~sr;
60562         mtdcr(uic->dcrbase + UIC_ER, er);
60563 -       mtdcr(uic->dcrbase + UIC_SR, sr);
60564 +       /* On the UIC, acking (i.e. clearing the SR bit)
60565 +        * a level irq will have no effect if the interrupt
60566 +        * is still asserted by the device, even if
60567 +        * the interrupt is already masked. Therefore
60568 +        * we only ack the egde interrupts here, while
60569 +        * level interrupts are ack'ed after the actual
60570 +        * isr call in the uic_unmask_irq()
60571 +        */
60572 +       if (!(desc->status & IRQ_LEVEL))
60573 +               mtdcr(uic->dcrbase + UIC_SR, sr);
60574         spin_unlock_irqrestore(&uic->lock, flags);
60575  }
60576  
60577 @@ -173,64 +185,6 @@
60578         .set_type       = uic_set_irq_type,
60579  };
60580  
60581 -/**
60582 - *     handle_uic_irq - irq flow handler for UIC
60583 - *     @irq:   the interrupt number
60584 - *     @desc:  the interrupt description structure for this irq
60585 - *
60586 - * This is modified version of the generic handle_level_irq() suitable
60587 - * for the UIC.  On the UIC, acking (i.e. clearing the SR bit) a level
60588 - * irq will have no effect if the interrupt is still asserted by the
60589 - * device, even if the interrupt is already masked.  Therefore, unlike
60590 - * the standard handle_level_irq(), we must ack the interrupt *after*
60591 - * invoking the ISR (which should have de-asserted the interrupt in
60592 - * the external source).  For edge interrupts we ack at the beginning
60593 - * instead of the end, to keep the window in which we can miss an
60594 - * interrupt as small as possible.
60595 - */
60596 -void fastcall handle_uic_irq(unsigned int irq, struct irq_desc *desc)
60597 -{
60598 -       unsigned int cpu = smp_processor_id();
60599 -       struct irqaction *action;
60600 -       irqreturn_t action_ret;
60601 -
60602 -       spin_lock(&desc->lock);
60603 -       if (desc->status & IRQ_LEVEL)
60604 -               desc->chip->mask(irq);
60605 -       else
60606 -               desc->chip->mask_ack(irq);
60607 -
60608 -       if (unlikely(desc->status & IRQ_INPROGRESS))
60609 -               goto out_unlock;
60610 -       desc->status &= ~(IRQ_REPLAY | IRQ_WAITING);
60611 -       kstat_cpu(cpu).irqs[irq]++;
60612 -
60613 -       /*
60614 -        * If its disabled or no action available
60615 -        * keep it masked and get out of here
60616 -        */
60617 -       action = desc->action;
60618 -       if (unlikely(!action || (desc->status & IRQ_DISABLED))) {
60619 -               desc->status |= IRQ_PENDING;
60620 -               goto out_unlock;
60621 -       }
60622 -
60623 -       desc->status |= IRQ_INPROGRESS;
60624 -       desc->status &= ~IRQ_PENDING;
60625 -       spin_unlock(&desc->lock);
60626 -
60627 -       action_ret = handle_IRQ_event(irq, action);
60628 -
60629 -       spin_lock(&desc->lock);
60630 -       desc->status &= ~IRQ_INPROGRESS;
60631 -       if (desc->status & IRQ_LEVEL)
60632 -               desc->chip->ack(irq);
60633 -       if (!(desc->status & IRQ_DISABLED) && desc->chip->unmask)
60634 -               desc->chip->unmask(irq);
60635 -out_unlock:
60636 -       spin_unlock(&desc->lock);
60637 -}
60638 -
60639  static int uic_host_map(struct irq_host *h, unsigned int virq,
60640                         irq_hw_number_t hw)
60641  {
60642 @@ -239,7 +193,7 @@
60643         set_irq_chip_data(virq, uic);
60644         /* Despite the name, handle_level_irq() works for both level
60645          * and edge irqs on UIC.  FIXME: check this is correct */
60646 -       set_irq_chip_and_handler(virq, &uic_irq_chip, handle_uic_irq);
60647 +       set_irq_chip_and_handler(virq, &uic_irq_chip, handle_level_irq);
60648  
60649         /* Set default irq type */
60650         set_irq_type(virq, IRQ_TYPE_NONE);
60651 @@ -264,23 +218,36 @@
60652         .xlate  = uic_host_xlate,
60653  };
60654  
60655 -irqreturn_t uic_cascade(int virq, void *data)
60656 +void uic_irq_cascade(unsigned int virq, struct irq_desc *desc)
60657  {
60658 -       struct uic *uic = data;
60659 +       struct uic *uic = get_irq_data(virq);
60660         u32 msr;
60661         int src;
60662         int subvirq;
60663  
60664 +       spin_lock(&desc->lock);
60665 +       if (desc->status & IRQ_LEVEL)
60666 +               desc->chip->mask(virq);
60667 +       else
60668 +               desc->chip->mask_ack(virq);
60669 +       spin_unlock(&desc->lock);
60670 +
60671         msr = mfdcr(uic->dcrbase + UIC_MSR);
60672         if (!msr) /* spurious interrupt */
60673 -               return IRQ_HANDLED;
60674 +               goto uic_irq_ret;
60675  
60676         src = 32 - ffs(msr);
60677  
60678         subvirq = irq_linear_revmap(uic->irqhost, src);
60679         generic_handle_irq(subvirq);
60680  
60681 -       return IRQ_HANDLED;
60682 +uic_irq_ret:
60683 +       spin_lock(&desc->lock);
60684 +       if (desc->status & IRQ_LEVEL)
60685 +               desc->chip->ack(virq);
60686 +       if (!(desc->status & IRQ_DISABLED) && desc->chip->unmask)
60687 +               desc->chip->unmask(virq);
60688 +       spin_unlock(&desc->lock);
60689  }
60690  
60691  static struct uic * __init uic_init_one(struct device_node *node)
60692 @@ -342,33 +309,27 @@
60693         const u32 *interrupts;
60694  
60695         /* First locate and initialize the top-level UIC */
60696 -
60697 -       np = of_find_compatible_node(NULL, NULL, "ibm,uic");
60698 -       while (np) {
60699 +       for_each_compatible_node(np, NULL, "ibm,uic") {
60700                 interrupts = of_get_property(np, "interrupts", NULL);
60701 -               if (! interrupts)
60702 +               if (!interrupts)
60703                         break;
60704 -
60705 -               np = of_find_compatible_node(np, NULL, "ibm,uic");
60706         }
60707  
60708         BUG_ON(!np); /* uic_init_tree() assumes there's a UIC as the
60709                       * top-level interrupt controller */
60710         primary_uic = uic_init_one(np);
60711 -       if (! primary_uic)
60712 +       if (!primary_uic)
60713                 panic("Unable to initialize primary UIC %s\n", np->full_name);
60714  
60715         irq_set_default_host(primary_uic->irqhost);
60716         of_node_put(np);
60717  
60718         /* The scan again for cascaded UICs */
60719 -       np = of_find_compatible_node(NULL, NULL, "ibm,uic");
60720 -       while (np) {
60721 +       for_each_compatible_node(np, NULL, "ibm,uic") {
60722                 interrupts = of_get_property(np, "interrupts", NULL);
60723                 if (interrupts) {
60724                         /* Secondary UIC */
60725                         int cascade_virq;
60726 -                       int ret;
60727  
60728                         uic = uic_init_one(np);
60729                         if (! uic)
60730 @@ -377,20 +338,11 @@
60731  
60732                         cascade_virq = irq_of_parse_and_map(np, 0);
60733  
60734 -                       uic->cascade.handler = uic_cascade;
60735 -                       uic->cascade.name = "UIC cascade";
60736 -                       uic->cascade.dev_id = uic;
60737 -
60738 -                       ret = setup_irq(cascade_virq, &uic->cascade);
60739 -                       if (ret)
60740 -                               printk(KERN_ERR "Failed to setup_irq(%d) for "
60741 -                                      "UIC%d cascade\n", cascade_virq,
60742 -                                      uic->index);
60743 +                       set_irq_data(cascade_virq, uic);
60744 +                       set_irq_chained_handler(cascade_virq, uic_irq_cascade);
60745  
60746                         /* FIXME: setup critical cascade?? */
60747                 }
60748 -
60749 -               np = of_find_compatible_node(np, NULL, "ibm,uic");
60750         }
60751  }
60752  
60753 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/sysdev/xilinx_intc.c powerpc.git/arch/powerpc/sysdev/xilinx_intc.c
60754 --- linux-2.6.24/arch/powerpc/sysdev/xilinx_intc.c      2008-01-24 23:58:37.000000000 +0100
60755 +++ powerpc.git/arch/powerpc/sysdev/xilinx_intc.c       2008-01-28 20:25:49.000000000 +0100
60756 @@ -135,10 +135,16 @@
60757         struct device_node *np;
60758  
60759         /* find top level interrupt controller */
60760 -       for_each_compatible_node(np, NULL, "xilinx,intc") {
60761 +       for_each_compatible_node(np, NULL, "xlnx,opb-intc-1.00.c") {
60762                 if (!of_get_property(np, "interrupts", NULL))
60763                         break;
60764         }
60765 +       if (!np) {
60766 +               for_each_compatible_node(np, NULL, "xlnx,xps-intc-1.00.a") {
60767 +                       if (!of_get_property(np, "interrupts", NULL))
60768 +                               break;
60769 +               }
60770 +       }
60771  
60772         /* xilinx interrupt controller needs to be top level */
60773         BUG_ON(!np);
60774 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/xmon/setjmp.S powerpc.git/arch/powerpc/xmon/setjmp.S
60775 --- linux-2.6.24/arch/powerpc/xmon/setjmp.S     2008-01-24 23:58:37.000000000 +0100
60776 +++ powerpc.git/arch/powerpc/xmon/setjmp.S      2008-01-28 20:25:49.000000000 +0100
60777 @@ -12,67 +12,6 @@
60778  #include <asm/ppc_asm.h>
60779  #include <asm/asm-offsets.h>
60780  
60781 -_GLOBAL(xmon_setjmp)
60782 -       mflr    r0
60783 -       PPC_STL r0,0(r3)
60784 -       PPC_STL r1,SZL(r3)
60785 -       PPC_STL r2,2*SZL(r3)
60786 -       mfcr    r0
60787 -       PPC_STL r0,3*SZL(r3)
60788 -       PPC_STL r13,4*SZL(r3)
60789 -       PPC_STL r14,5*SZL(r3)
60790 -       PPC_STL r15,6*SZL(r3)
60791 -       PPC_STL r16,7*SZL(r3)
60792 -       PPC_STL r17,8*SZL(r3)
60793 -       PPC_STL r18,9*SZL(r3)
60794 -       PPC_STL r19,10*SZL(r3)
60795 -       PPC_STL r20,11*SZL(r3)
60796 -       PPC_STL r21,12*SZL(r3)
60797 -       PPC_STL r22,13*SZL(r3)
60798 -       PPC_STL r23,14*SZL(r3)
60799 -       PPC_STL r24,15*SZL(r3)
60800 -       PPC_STL r25,16*SZL(r3)
60801 -       PPC_STL r26,17*SZL(r3)
60802 -       PPC_STL r27,18*SZL(r3)
60803 -       PPC_STL r28,19*SZL(r3)
60804 -       PPC_STL r29,20*SZL(r3)
60805 -       PPC_STL r30,21*SZL(r3)
60806 -       PPC_STL r31,22*SZL(r3)
60807 -       li      r3,0
60808 -       blr
60809 -
60810 -_GLOBAL(xmon_longjmp)
60811 -       PPC_LCMPI r4,0
60812 -       bne     1f
60813 -       li      r4,1
60814 -1:     PPC_LL  r13,4*SZL(r3)
60815 -       PPC_LL  r14,5*SZL(r3)
60816 -       PPC_LL  r15,6*SZL(r3)
60817 -       PPC_LL  r16,7*SZL(r3)
60818 -       PPC_LL  r17,8*SZL(r3)
60819 -       PPC_LL  r18,9*SZL(r3)
60820 -       PPC_LL  r19,10*SZL(r3)
60821 -       PPC_LL  r20,11*SZL(r3)
60822 -       PPC_LL  r21,12*SZL(r3)
60823 -       PPC_LL  r22,13*SZL(r3)
60824 -       PPC_LL  r23,14*SZL(r3)
60825 -       PPC_LL  r24,15*SZL(r3)
60826 -       PPC_LL  r25,16*SZL(r3)
60827 -       PPC_LL  r26,17*SZL(r3)
60828 -       PPC_LL  r27,18*SZL(r3)
60829 -       PPC_LL  r28,19*SZL(r3)
60830 -       PPC_LL  r29,20*SZL(r3)
60831 -       PPC_LL  r30,21*SZL(r3)
60832 -       PPC_LL  r31,22*SZL(r3)
60833 -       PPC_LL  r0,3*SZL(r3)
60834 -       mtcrf   0x38,r0
60835 -       PPC_LL  r0,0(r3)
60836 -       PPC_LL  r1,SZL(r3)
60837 -       PPC_LL  r2,2*SZL(r3)
60838 -       mtlr    r0
60839 -       mr      r3,r4
60840 -       blr
60841 -
60842  /*
60843   * Grab the register values as they are now.
60844   * This won't do a particularily good job because we really
60845 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/powerpc/xmon/xmon.c powerpc.git/arch/powerpc/xmon/xmon.c
60846 --- linux-2.6.24/arch/powerpc/xmon/xmon.c       2008-01-24 23:58:37.000000000 +0100
60847 +++ powerpc.git/arch/powerpc/xmon/xmon.c        2008-01-28 20:25:49.000000000 +0100
60848 @@ -40,6 +40,7 @@
60849  #include <asm/spu.h>
60850  #include <asm/spu_priv1.h>
60851  #include <asm/firmware.h>
60852 +#include <asm/setjmp.h>
60853  
60854  #ifdef CONFIG_PPC64
60855  #include <asm/hvcall.h>
60856 @@ -71,12 +72,9 @@
60857  static int termch;
60858  static char tmpstr[128];
60859  
60860 -#define JMP_BUF_LEN    23
60861  static long bus_error_jmp[JMP_BUF_LEN];
60862  static int catch_memory_errors;
60863  static long *xmon_fault_jmp[NR_CPUS];
60864 -#define setjmp xmon_setjmp
60865 -#define longjmp xmon_longjmp
60866  
60867  /* Breakpoint stuff */
60868  struct bpt {
60869 @@ -153,13 +151,15 @@
60870  
60871  static int do_spu_cmd(void);
60872  
60873 +#ifdef CONFIG_44x
60874 +static void dump_tlb_44x(void);
60875 +#endif
60876 +
60877  int xmon_no_auto_backtrace;
60878  
60879  extern void xmon_enter(void);
60880  extern void xmon_leave(void);
60881  
60882 -extern long setjmp(long *);
60883 -extern void longjmp(long *, long);
60884  extern void xmon_save_regs(struct pt_regs *);
60885  
60886  #ifdef CONFIG_PPC64
60887 @@ -231,6 +231,9 @@
60888  #ifdef CONFIG_PPC_STD_MMU_32
60889  "  u   dump segment registers\n"
60890  #endif
60891 +#ifdef CONFIG_44x
60892 +"  u   dump TLB\n"
60893 +#endif
60894  "  ?   help\n"
60895  "  zr  reboot\n\
60896    zh   halt\n"
60897 @@ -856,6 +859,11 @@
60898                         dump_segments();
60899                         break;
60900  #endif
60901 +#ifdef CONFIG_4xx
60902 +               case 'u':
60903 +                       dump_tlb_44x();
60904 +                       break;
60905 +#endif
60906                 default:
60907                         printf("Unrecognized command: ");
60908                         do {
60909 @@ -2527,16 +2535,33 @@
60910  static void dump_slb(void)
60911  {
60912         int i;
60913 -       unsigned long tmp;
60914 +       unsigned long esid,vsid,valid;
60915 +       unsigned long llp;
60916  
60917         printf("SLB contents of cpu %x\n", smp_processor_id());
60918  
60919 -       for (i = 0; i < SLB_NUM_ENTRIES; i++) {
60920 -               asm volatile("slbmfee  %0,%1" : "=r" (tmp) : "r" (i));
60921 -               printf("%02d %016lx ", i, tmp);
60922 -
60923 -               asm volatile("slbmfev  %0,%1" : "=r" (tmp) : "r" (i));
60924 -               printf("%016lx\n", tmp);
60925 +       for (i = 0; i < mmu_slb_size; i++) {
60926 +               asm volatile("slbmfee  %0,%1" : "=r" (esid) : "r" (i));
60927 +               asm volatile("slbmfev  %0,%1" : "=r" (vsid) : "r" (i));
60928 +               valid = (esid & SLB_ESID_V);
60929 +               if (valid | esid | vsid) {
60930 +                       printf("%02d %016lx %016lx", i, esid, vsid);
60931 +                       if (valid) {
60932 +                               llp = vsid & SLB_VSID_LLP;
60933 +                               if (vsid & SLB_VSID_B_1T) {
60934 +                                       printf("  1T  ESID=%9lx  VSID=%13lx LLP:%3lx \n",
60935 +                                               GET_ESID_1T(esid),
60936 +                                               (vsid & ~SLB_VSID_B) >> SLB_VSID_SHIFT_1T,
60937 +                                               llp);
60938 +                               } else {
60939 +                                       printf(" 256M ESID=%9lx  VSID=%13lx LLP:%3lx \n",
60940 +                                               GET_ESID(esid),
60941 +                                               (vsid & ~SLB_VSID_B) >> SLB_VSID_SHIFT,
60942 +                                               llp);
60943 +                               }
60944 +                       } else
60945 +                               printf("\n");
60946 +               }
60947         }
60948  }
60949  
60950 @@ -2581,6 +2606,32 @@
60951  }
60952  #endif
60953  
60954 +#ifdef CONFIG_44x
60955 +static void dump_tlb_44x(void)
60956 +{
60957 +       int i;
60958 +
60959 +       for (i = 0; i < PPC44x_TLB_SIZE; i++) {
60960 +               unsigned long w0,w1,w2;
60961 +               asm volatile("tlbre  %0,%1,0" : "=r" (w0) : "r" (i));
60962 +               asm volatile("tlbre  %0,%1,1" : "=r" (w1) : "r" (i));
60963 +               asm volatile("tlbre  %0,%1,2" : "=r" (w2) : "r" (i));
60964 +               printf("[%02x] %08x %08x %08x ", i, w0, w1, w2);
60965 +               if (w0 & PPC44x_TLB_VALID) {
60966 +                       printf("V %08x -> %01x%08x %c%c%c%c%c",
60967 +                              w0 & PPC44x_TLB_EPN_MASK,
60968 +                              w1 & PPC44x_TLB_ERPN_MASK,
60969 +                              w1 & PPC44x_TLB_RPN_MASK,
60970 +                              (w2 & PPC44x_TLB_W) ? 'W' : 'w',
60971 +                              (w2 & PPC44x_TLB_I) ? 'I' : 'i',
60972 +                              (w2 & PPC44x_TLB_M) ? 'M' : 'm',
60973 +                              (w2 & PPC44x_TLB_G) ? 'G' : 'g',
60974 +                              (w2 & PPC44x_TLB_E) ? 'E' : 'e');
60975 +               }
60976 +               printf("\n");
60977 +       }
60978 +}
60979 +#endif /* CONFIG_44x */
60980  void xmon_init(int enable)
60981  {
60982  #ifdef CONFIG_PPC_ISERIES
60983 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/ppc/kernel/Makefile powerpc.git/arch/ppc/kernel/Makefile
60984 --- linux-2.6.24/arch/ppc/kernel/Makefile       2008-01-24 23:58:37.000000000 +0100
60985 +++ powerpc.git/arch/ppc/kernel/Makefile        2008-01-28 20:25:50.000000000 +0100
60986 @@ -13,7 +13,6 @@
60987                                         ppc_htab.o
60988  obj-$(CONFIG_MODULES)          += ppc_ksyms.o
60989  obj-$(CONFIG_PCI)              += pci.o
60990 -obj-$(CONFIG_RAPIDIO)          += rio.o
60991  obj-$(CONFIG_KGDB)             += ppc-stub.o
60992  obj-$(CONFIG_SMP)              += smp.o smp-tbsync.o
60993  obj-$(CONFIG_KEXEC)            += machine_kexec.o relocate_kernel.o
60994 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/ppc/kernel/head_44x.S powerpc.git/arch/ppc/kernel/head_44x.S
60995 --- linux-2.6.24/arch/ppc/kernel/head_44x.S     2008-01-24 23:58:37.000000000 +0100
60996 +++ powerpc.git/arch/ppc/kernel/head_44x.S      2008-01-28 20:25:50.000000000 +0100
60997 @@ -195,7 +195,7 @@
60998         li      r5,0
60999         ori     r5,r5,(PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_I | PPC44x_TLB_G)
61000  
61001 -        li      r0,0                    /* TLB slot 0 */
61002 +       li      r0,62                   /* TLB slot 62 */
61003  
61004         tlbwe   r3,r0,PPC44x_TLB_PAGEID /* Load the pageid fields */
61005         tlbwe   r4,r0,PPC44x_TLB_XLAT   /* Load the translation fields */
61006 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/ppc/kernel/rio.c powerpc.git/arch/ppc/kernel/rio.c
61007 --- linux-2.6.24/arch/ppc/kernel/rio.c  2008-01-24 23:58:37.000000000 +0100
61008 +++ powerpc.git/arch/ppc/kernel/rio.c   1970-01-01 01:00:00.000000000 +0100
61009 @@ -1,52 +0,0 @@
61010 -/*
61011 - * RapidIO PPC32 support
61012 - *
61013 - * Copyright 2005 MontaVista Software, Inc.
61014 - * Matt Porter <mporter@kernel.crashing.org>
61015 - *
61016 - * This program is free software; you can redistribute  it and/or modify it
61017 - * under  the terms of  the GNU General  Public License as published by the
61018 - * Free Software Foundation;  either version 2 of the  License, or (at your
61019 - * option) any later version.
61020 - */
61021 -
61022 -#include <linux/init.h>
61023 -#include <linux/kernel.h>
61024 -#include <linux/rio.h>
61025 -
61026 -#include <asm/rio.h>
61027 -
61028 -/**
61029 - * platform_rio_init - Do platform specific RIO init
61030 - *
61031 - * Any platform specific initialization of RapdIO
61032 - * hardware is done here as well as registration
61033 - * of any active master ports in the system.
61034 - */
61035 -void __attribute__ ((weak))
61036 -    platform_rio_init(void)
61037 -{
61038 -       printk(KERN_WARNING "RIO: No platform_rio_init() present\n");
61039 -}
61040 -
61041 -/**
61042 - * ppc_rio_init - Do PPC32 RIO init
61043 - *
61044 - * Calls platform-specific RIO init code and then calls
61045 - * rio_init_mports() to initialize any master ports that
61046 - * have been registered with the RIO subsystem.
61047 - */
61048 -static int __init ppc_rio_init(void)
61049 -{
61050 -       printk(KERN_INFO "RIO: RapidIO init\n");
61051 -
61052 -       /* Platform specific initialization */
61053 -       platform_rio_init();
61054 -
61055 -       /* Enumerate all registered ports */
61056 -       rio_init_mports();
61057 -
61058 -       return 0;
61059 -}
61060 -
61061 -subsys_initcall(ppc_rio_init);
61062 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/ppc/kernel/setup.c powerpc.git/arch/ppc/kernel/setup.c
61063 --- linux-2.6.24/arch/ppc/kernel/setup.c        2008-01-24 23:58:37.000000000 +0100
61064 +++ powerpc.git/arch/ppc/kernel/setup.c 2008-01-28 20:25:50.000000000 +0100
61065 @@ -37,7 +37,6 @@
61066  #include <asm/nvram.h>
61067  #include <asm/xmon.h>
61068  #include <asm/ocp.h>
61069 -#include <asm/prom.h>
61070  
61071  #define USES_PPC_SYS (defined(CONFIG_85xx) || defined(CONFIG_83xx) || \
61072                       defined(CONFIG_MPC10X_BRIDGE) || defined(CONFIG_8260) || \
61073 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/ppc/kernel/traps.c powerpc.git/arch/ppc/kernel/traps.c
61074 --- linux-2.6.24/arch/ppc/kernel/traps.c        2008-01-24 23:58:37.000000000 +0100
61075 +++ powerpc.git/arch/ppc/kernel/traps.c 2008-01-28 20:25:50.000000000 +0100
61076 @@ -231,39 +231,25 @@
61077  {
61078  }
61079  
61080 -void machine_check_exception(struct pt_regs *regs)
61081 +#if defined(CONFIG_4xx)
61082 +int machine_check_4xx(struct pt_regs *regs)
61083  {
61084         unsigned long reason = get_mc_reason(regs);
61085  
61086 -       if (user_mode(regs)) {
61087 -               regs->msr |= MSR_RI;
61088 -               _exception(SIGBUS, regs, BUS_ADRERR, regs->nip);
61089 -               return;
61090 -       }
61091 -
61092 -#if defined(CONFIG_8xx) && defined(CONFIG_PCI)
61093 -       /* the qspan pci read routines can cause machine checks -- Cort */
61094 -       bad_page_fault(regs, regs->dar, SIGBUS);
61095 -       return;
61096 -#endif
61097 -
61098 -       if (debugger_fault_handler) {
61099 -               debugger_fault_handler(regs);
61100 -               regs->msr |= MSR_RI;
61101 -               return;
61102 -       }
61103 -
61104 -       if (check_io_access(regs))
61105 -               return;
61106 -
61107 -#if defined(CONFIG_4xx) && !defined(CONFIG_440A)
61108         if (reason & ESR_IMCP) {
61109                 printk("Instruction");
61110                 mtspr(SPRN_ESR, reason & ~ESR_IMCP);
61111         } else
61112                 printk("Data");
61113         printk(" machine check in kernel mode.\n");
61114 -#elif defined(CONFIG_440A)
61115 +
61116 +       return 0;
61117 +}
61118 +
61119 +int machine_check_440A(struct pt_regs *regs)
61120 +{
61121 +       unsigned long reason = get_mc_reason(regs);
61122 +
61123         printk("Machine check in kernel mode.\n");
61124         if (reason & ESR_IMCP){
61125                 printk("Instruction Synchronous Machine Check exception\n");
61126 @@ -293,7 +279,13 @@
61127                 /* Clear MCSR */
61128                 mtspr(SPRN_MCSR, mcsr);
61129         }
61130 -#elif defined (CONFIG_E500)
61131 +       return 0;
61132 +}
61133 +#elif defined(CONFIG_E500)
61134 +int machine_check_e500(struct pt_regs *regs)
61135 +{
61136 +       unsigned long reason = get_mc_reason(regs);
61137 +
61138         printk("Machine check in kernel mode.\n");
61139         printk("Caused by (from MCSR=%lx): ", reason);
61140  
61141 @@ -305,8 +297,6 @@
61142                 printk("Data Cache Push Parity Error\n");
61143         if (reason & MCSR_DCPERR)
61144                 printk("Data Cache Parity Error\n");
61145 -       if (reason & MCSR_GL_CI)
61146 -               printk("Guarded Load or Cache-Inhibited stwcx.\n");
61147         if (reason & MCSR_BUS_IAERR)
61148                 printk("Bus - Instruction Address Error\n");
61149         if (reason & MCSR_BUS_RAERR)
61150 @@ -318,12 +308,19 @@
61151         if (reason & MCSR_BUS_RBERR)
61152                 printk("Bus - Read Data Bus Error\n");
61153         if (reason & MCSR_BUS_WBERR)
61154 -               printk("Bus - Write Data Bus Error\n");
61155 +               printk("Bus - Read Data Bus Error\n");
61156         if (reason & MCSR_BUS_IPERR)
61157                 printk("Bus - Instruction Parity Error\n");
61158         if (reason & MCSR_BUS_RPERR)
61159                 printk("Bus - Read Parity Error\n");
61160 -#elif defined (CONFIG_E200)
61161 +
61162 +       return 0;
61163 +}
61164 +#elif defined(CONFIG_E200)
61165 +int machine_check_e200(struct pt_regs *regs)
61166 +{
61167 +       unsigned long reason = get_mc_reason(regs);
61168 +
61169         printk("Machine check in kernel mode.\n");
61170         printk("Caused by (from MCSR=%lx): ", reason);
61171  
61172 @@ -341,7 +338,14 @@
61173                 printk("Bus - Read Bus Error on data load\n");
61174         if (reason & MCSR_BUS_WRERR)
61175                 printk("Bus - Write Bus Error on buffered store or cache line push\n");
61176 -#else /* !CONFIG_4xx && !CONFIG_E500 && !CONFIG_E200 */
61177 +
61178 +       return 0;
61179 +}
61180 +#else
61181 +int machine_check_generic(struct pt_regs *regs)
61182 +{
61183 +       unsigned long reason = get_mc_reason(regs);
61184 +
61185         printk("Machine check in kernel mode.\n");
61186         printk("Caused by (from SRR1=%lx): ", reason);
61187         switch (reason & 0x601F0000) {
61188 @@ -371,7 +375,39 @@
61189         default:
61190                 printk("Unknown values in msr\n");
61191         }
61192 -#endif /* CONFIG_4xx */
61193 +       return 0;
61194 +}
61195 +#endif /* everything else */
61196 +
61197 +void machine_check_exception(struct pt_regs *regs)
61198 +{
61199 +       int recover = 0;
61200 +
61201 +       if (cur_cpu_spec->machine_check)
61202 +               recover = cur_cpu_spec->machine_check(regs);
61203 +       if (recover > 0)
61204 +               return;
61205 +
61206 +       if (user_mode(regs)) {
61207 +               regs->msr |= MSR_RI;
61208 +               _exception(SIGBUS, regs, BUS_ADRERR, regs->nip);
61209 +               return;
61210 +       }
61211 +
61212 +#if defined(CONFIG_8xx) && defined(CONFIG_PCI)
61213 +       /* the qspan pci read routines can cause machine checks -- Cort */
61214 +       bad_page_fault(regs, regs->dar, SIGBUS);
61215 +       return;
61216 +#endif
61217 +
61218 +       if (debugger_fault_handler) {
61219 +               debugger_fault_handler(regs);
61220 +               regs->msr |= MSR_RI;
61221 +               return;
61222 +       }
61223 +
61224 +       if (check_io_access(regs))
61225 +               return;
61226  
61227         /*
61228          * Optional platform-provided routine to print out
61229 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/ppc/mm/44x_mmu.c powerpc.git/arch/ppc/mm/44x_mmu.c
61230 --- linux-2.6.24/arch/ppc/mm/44x_mmu.c  2008-01-24 23:58:37.000000000 +0100
61231 +++ powerpc.git/arch/ppc/mm/44x_mmu.c   2008-01-28 20:25:51.000000000 +0100
61232 @@ -60,38 +60,28 @@
61233   * Just needed it declared someplace.
61234   */
61235  unsigned int tlb_44x_index = 0;
61236 -unsigned int tlb_44x_hwater = 62;
61237 +unsigned int tlb_44x_hwater = PPC4XX_TLB_SIZE - 1 - PPC44x_EARLY_TLBS;
61238  int icache_44x_need_flush;
61239  
61240  /*
61241   * "Pins" a 256MB TLB entry in AS0 for kernel lowmem
61242   */
61243 -static void __init
61244 -ppc44x_pin_tlb(int slot, unsigned int virt, unsigned int phys)
61245 +static void __init ppc44x_pin_tlb(unsigned int virt, unsigned int phys)
61246  {
61247 -       unsigned long attrib = 0;
61248 -
61249 -       __asm__ __volatile__("\
61250 -       clrrwi  %2,%2,10\n\
61251 -       ori     %2,%2,%4\n\
61252 -       clrrwi  %1,%1,10\n\
61253 -       li      %0,0\n\
61254 -       ori     %0,%0,%5\n\
61255 -       tlbwe   %2,%3,%6\n\
61256 -       tlbwe   %1,%3,%7\n\
61257 -       tlbwe   %0,%3,%8"
61258 +       __asm__ __volatile__(
61259 +               "tlbwe  %2,%3,%4\n"
61260 +               "tlbwe  %1,%3,%5\n"
61261 +               "tlbwe  %0,%3,%6\n"
61262         :
61263 -       : "r" (attrib), "r" (phys), "r" (virt), "r" (slot),
61264 -         "i" (PPC44x_TLB_VALID | PPC44x_TLB_256M),
61265 -         "i" (PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | PPC44x_TLB_G),
61266 +       : "r" (PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | PPC44x_TLB_G),
61267 +         "r" (phys),
61268 +         "r" (virt | PPC44x_TLB_VALID | PPC44x_TLB_256M),
61269 +         "r" (tlb_44x_hwater--), /* slot for this TLB entry */
61270           "i" (PPC44x_TLB_PAGEID),
61271           "i" (PPC44x_TLB_XLAT),
61272           "i" (PPC44x_TLB_ATTRIB));
61273  }
61274  
61275 -/*
61276 - * MMU_init_hw does the chip-specific initialization of the MMU hardware.
61277 - */
61278  void __init MMU_init_hw(void)
61279  {
61280         flush_instruction_cache();
61281 @@ -99,22 +89,13 @@
61282  
61283  unsigned long __init mmu_mapin_ram(void)
61284  {
61285 -       unsigned int pinned_tlbs = 1;
61286 -       int i;
61287 -
61288 -       /* Determine number of entries necessary to cover lowmem */
61289 -       pinned_tlbs = (unsigned int)
61290 -               (_ALIGN(total_lowmem, PPC_PIN_SIZE) >> PPC44x_PIN_SHIFT);
61291 -
61292 -       /* Write upper watermark to save location */
61293 -       tlb_44x_hwater = PPC44x_LOW_SLOT - pinned_tlbs;
61294 +       unsigned long addr;
61295  
61296 -       /* If necessary, set additional pinned TLBs */
61297 -       if (pinned_tlbs > 1)
61298 -               for (i = (PPC44x_LOW_SLOT-(pinned_tlbs-1)); i < PPC44x_LOW_SLOT; i++) {
61299 -                       unsigned int phys_addr = (PPC44x_LOW_SLOT-i) * PPC_PIN_SIZE;
61300 -                       ppc44x_pin_tlb(i, phys_addr+PAGE_OFFSET, phys_addr);
61301 -               }
61302 +       /* Pin in enough TLBs to cover any lowmem not covered by the
61303 +        * initial 256M mapping established in head_44x.S */
61304 +       for (addr = PPC_PIN_SIZE; addr < total_lowmem;
61305 +            addr += PPC_PIN_SIZE)
61306 +               ppc44x_pin_tlb(addr + PAGE_OFFSET, addr);
61307  
61308         return total_lowmem;
61309  }
61310 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/ppc/platforms/85xx/mpc85xx_ads_common.c powerpc.git/arch/ppc/platforms/85xx/mpc85xx_ads_common.c
61311 --- linux-2.6.24/arch/ppc/platforms/85xx/mpc85xx_ads_common.c   2008-01-24 23:58:37.000000000 +0100
61312 +++ powerpc.git/arch/ppc/platforms/85xx/mpc85xx_ads_common.c    2008-01-28 20:25:51.000000000 +0100
61313 @@ -42,8 +42,6 @@
61314  
61315  #include <mm/mmu_decl.h>
61316  
61317 -#include <syslib/ppc85xx_rio.h>
61318 -
61319  #include <platforms/85xx/mpc85xx_ads_common.h>
61320  
61321  #ifndef CONFIG_PCI
61322 @@ -190,6 +188,7 @@
61323  #endif /* CONFIG_PCI */
61324  
61325  #ifdef CONFIG_RAPIDIO
61326 +extern void mpc85xx_rio_setup(int law_start, int law_size);
61327  void platform_rio_init(void)
61328  {
61329         /* 512MB RIO LAW at 0xc0000000 */
61330 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/ppc/platforms/85xx/stx_gp3.c powerpc.git/arch/ppc/platforms/85xx/stx_gp3.c
61331 --- linux-2.6.24/arch/ppc/platforms/85xx/stx_gp3.c      2008-01-24 23:58:37.000000000 +0100
61332 +++ powerpc.git/arch/ppc/platforms/85xx/stx_gp3.c       2008-01-28 20:25:51.000000000 +0100
61333 @@ -50,12 +50,10 @@
61334  #include <asm/irq.h>
61335  #include <asm/immap_85xx.h>
61336  #include <asm/cpm2.h>
61337 -#include <asm/mpc85xx.h>
61338  #include <asm/ppc_sys.h>
61339  
61340  #include <syslib/cpm2_pic.h>
61341  #include <syslib/ppc85xx_common.h>
61342 -#include <syslib/ppc85xx_rio.h>
61343  
61344  
61345  unsigned char __res[sizeof(bd_t)];
61346 @@ -271,6 +269,7 @@
61347  #endif /* CONFIG_PCI */
61348  
61349  #ifdef CONFIG_RAPIDIO
61350 +extern void mpc85xx_rio_setup(int law_start, int law_size);
61351  void
61352  platform_rio_init(void)
61353  {
61354 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/ppc/platforms/85xx/tqm85xx.c powerpc.git/arch/ppc/platforms/85xx/tqm85xx.c
61355 --- linux-2.6.24/arch/ppc/platforms/85xx/tqm85xx.c      2008-01-24 23:58:37.000000000 +0100
61356 +++ powerpc.git/arch/ppc/platforms/85xx/tqm85xx.c       2008-01-28 20:25:51.000000000 +0100
61357 @@ -54,7 +54,6 @@
61358  #include <syslib/ppc85xx_setup.h>
61359  #include <syslib/cpm2_pic.h>
61360  #include <syslib/ppc85xx_common.h>
61361 -#include <syslib/ppc85xx_rio.h>
61362  
61363  #ifndef CONFIG_PCI
61364  unsigned long isa_io_base = 0;
61365 @@ -309,6 +308,7 @@
61366  #endif /* CONFIG_PCI */
61367  
61368  #ifdef CONFIG_RAPIDIO
61369 +extern void mpc85xx_rio_setup(int law_start, int law_size);
61370  void platform_rio_init(void)
61371  {
61372         /* 512MB RIO LAW at 0xc0000000 */
61373 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/ppc/platforms/ev64260.c powerpc.git/arch/ppc/platforms/ev64260.c
61374 --- linux-2.6.24/arch/ppc/platforms/ev64260.c   2008-01-24 23:58:37.000000000 +0100
61375 +++ powerpc.git/arch/ppc/platforms/ev64260.c    2008-01-28 20:25:51.000000000 +0100
61376 @@ -336,7 +336,7 @@
61377  #endif
61378  
61379                 if (early_serial_setup(&port) != 0)
61380 -                       printk(KERN_WARNING "Early serial init of port 0"
61381 +                       printk(KERN_WARNING "Early serial init of port 0 "
61382                                 "failed\n");
61383  
61384                 first_time = 0;
61385 @@ -388,7 +388,7 @@
61386         ev64260_early_serial_map();
61387  #endif
61388  
61389 -       printk(KERN_INFO "%s %s port (C) 2001 MontaVista Software, Inc."
61390 +       printk(KERN_INFO "%s %s port (C) 2001 MontaVista Software, Inc. "
61391                 "(source@mvista.com)\n", BOARD_VENDOR, BOARD_MACHINE);
61392  
61393         if (ppc_md.progress)
61394 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/ppc/platforms/prep_pci.c powerpc.git/arch/ppc/platforms/prep_pci.c
61395 --- linux-2.6.24/arch/ppc/platforms/prep_pci.c  2008-01-24 23:58:37.000000000 +0100
61396 +++ powerpc.git/arch/ppc/platforms/prep_pci.c   2008-01-28 20:25:52.000000000 +0100
61397 @@ -1099,7 +1099,6 @@
61398                                 pci_write_config_byte(dev, 0x43, reg);
61399                         }
61400                 }
61401 -               pci_dev_put(dev);
61402         }
61403  
61404         if ((dev = pci_get_device(PCI_VENDOR_ID_WINBOND,
61405 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/ppc/syslib/Makefile powerpc.git/arch/ppc/syslib/Makefile
61406 --- linux-2.6.24/arch/ppc/syslib/Makefile       2008-01-24 23:58:37.000000000 +0100
61407 +++ powerpc.git/arch/ppc/syslib/Makefile        2008-01-28 20:25:52.000000000 +0100
61408 @@ -93,7 +93,6 @@
61409  ifeq ($(CONFIG_85xx),y)
61410  obj-$(CONFIG_PCI)              += pci_auto.o
61411  endif
61412 -obj-$(CONFIG_RAPIDIO)          += ppc85xx_rio.o
61413  obj-$(CONFIG_83xx)             += ppc83xx_setup.o ppc_sys.o \
61414                                         mpc83xx_sys.o mpc83xx_devices.o ipic.o
61415  ifeq ($(CONFIG_83xx),y)
61416 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/ppc/syslib/gt64260_pic.c powerpc.git/arch/ppc/syslib/gt64260_pic.c
61417 --- linux-2.6.24/arch/ppc/syslib/gt64260_pic.c  2008-01-24 23:58:37.000000000 +0100
61418 +++ powerpc.git/arch/ppc/syslib/gt64260_pic.c   2008-01-28 20:25:52.000000000 +0100
61419 @@ -35,7 +35,6 @@
61420  #include <linux/interrupt.h>
61421  #include <linux/sched.h>
61422  #include <linux/signal.h>
61423 -#include <linux/stddef.h>
61424  #include <linux/delay.h>
61425  #include <linux/irq.h>
61426  
61427 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/ppc/syslib/mpc52xx_pic.c powerpc.git/arch/ppc/syslib/mpc52xx_pic.c
61428 --- linux-2.6.24/arch/ppc/syslib/mpc52xx_pic.c  2008-01-24 23:58:37.000000000 +0100
61429 +++ powerpc.git/arch/ppc/syslib/mpc52xx_pic.c   2008-01-28 20:25:52.000000000 +0100
61430 @@ -20,7 +20,6 @@
61431  #include <linux/init.h>
61432  #include <linux/sched.h>
61433  #include <linux/signal.h>
61434 -#include <linux/stddef.h>
61435  #include <linux/delay.h>
61436  #include <linux/irq.h>
61437  
61438 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/ppc/syslib/mv64360_pic.c powerpc.git/arch/ppc/syslib/mv64360_pic.c
61439 --- linux-2.6.24/arch/ppc/syslib/mv64360_pic.c  2008-01-24 23:58:37.000000000 +0100
61440 +++ powerpc.git/arch/ppc/syslib/mv64360_pic.c   2008-01-28 20:25:52.000000000 +0100
61441 @@ -36,7 +36,6 @@
61442  #include <linux/init.h>
61443  #include <linux/sched.h>
61444  #include <linux/signal.h>
61445 -#include <linux/stddef.h>
61446  #include <linux/delay.h>
61447  #include <linux/irq.h>
61448  #include <linux/interrupt.h>
61449 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/ppc/syslib/ocp.c powerpc.git/arch/ppc/syslib/ocp.c
61450 --- linux-2.6.24/arch/ppc/syslib/ocp.c  2008-01-24 23:58:37.000000000 +0100
61451 +++ powerpc.git/arch/ppc/syslib/ocp.c   2008-01-28 20:25:52.000000000 +0100
61452 @@ -376,7 +376,7 @@
61453  
61454         down_write(&ocp_devices_sem);
61455         dev = __ocp_find_device(vendor, function, index);
61456 -       list_del((struct list_head *)dev);
61457 +       list_del(&dev->link);
61458         up_write(&ocp_devices_sem);
61459  
61460         DBG(("ocp: ocp_remove_one_device(vendor: %x, function: %x, index: %d)... done.\n", vendor, function, index));
61461 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/ppc/syslib/ppc83xx_setup.c powerpc.git/arch/ppc/syslib/ppc83xx_setup.c
61462 --- linux-2.6.24/arch/ppc/syslib/ppc83xx_setup.c        2008-01-24 23:58:37.000000000 +0100
61463 +++ powerpc.git/arch/ppc/syslib/ppc83xx_setup.c 2008-01-28 20:25:52.000000000 +0100
61464 @@ -41,7 +41,6 @@
61465  
61466  #include <syslib/ppc83xx_setup.h>
61467  #if defined(CONFIG_PCI)
61468 -#include <asm/delay.h>
61469  #include <syslib/ppc83xx_pci.h>
61470  #endif
61471  
61472 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/ppc/syslib/ppc85xx_rio.c powerpc.git/arch/ppc/syslib/ppc85xx_rio.c
61473 --- linux-2.6.24/arch/ppc/syslib/ppc85xx_rio.c  2008-01-24 23:58:37.000000000 +0100
61474 +++ powerpc.git/arch/ppc/syslib/ppc85xx_rio.c   1970-01-01 01:00:00.000000000 +0100
61475 @@ -1,932 +0,0 @@
61476 -/*
61477 - * MPC85xx RapidIO support
61478 - *
61479 - * Copyright 2005 MontaVista Software, Inc.
61480 - * Matt Porter <mporter@kernel.crashing.org>
61481 - *
61482 - * This program is free software; you can redistribute  it and/or modify it
61483 - * under  the terms of  the GNU General  Public License as published by the
61484 - * Free Software Foundation;  either version 2 of the  License, or (at your
61485 - * option) any later version.
61486 - */
61487 -
61488 -#include <linux/init.h>
61489 -#include <linux/module.h>
61490 -#include <linux/types.h>
61491 -#include <linux/dma-mapping.h>
61492 -#include <linux/interrupt.h>
61493 -#include <linux/rio.h>
61494 -#include <linux/rio_drv.h>
61495 -
61496 -#include <asm/io.h>
61497 -
61498 -#define RIO_REGS_BASE          (CCSRBAR + 0xc0000)
61499 -#define RIO_ATMU_REGS_OFFSET   0x10c00
61500 -#define RIO_MSG_REGS_OFFSET    0x11000
61501 -#define RIO_MAINT_WIN_SIZE     0x400000
61502 -#define RIO_DBELL_WIN_SIZE     0x1000
61503 -
61504 -#define RIO_MSG_OMR_MUI                0x00000002
61505 -#define RIO_MSG_OSR_TE         0x00000080
61506 -#define RIO_MSG_OSR_QOI                0x00000020
61507 -#define RIO_MSG_OSR_QFI                0x00000010
61508 -#define RIO_MSG_OSR_MUB                0x00000004
61509 -#define RIO_MSG_OSR_EOMI       0x00000002
61510 -#define RIO_MSG_OSR_QEI                0x00000001
61511 -
61512 -#define RIO_MSG_IMR_MI         0x00000002
61513 -#define RIO_MSG_ISR_TE         0x00000080
61514 -#define RIO_MSG_ISR_QFI                0x00000010
61515 -#define RIO_MSG_ISR_DIQI       0x00000001
61516 -
61517 -#define RIO_MSG_DESC_SIZE      32
61518 -#define RIO_MSG_BUFFER_SIZE    4096
61519 -#define RIO_MIN_TX_RING_SIZE   2
61520 -#define RIO_MAX_TX_RING_SIZE   2048
61521 -#define RIO_MIN_RX_RING_SIZE   2
61522 -#define RIO_MAX_RX_RING_SIZE   2048
61523 -
61524 -#define DOORBELL_DMR_DI                0x00000002
61525 -#define DOORBELL_DSR_TE                0x00000080
61526 -#define DOORBELL_DSR_QFI       0x00000010
61527 -#define DOORBELL_DSR_DIQI      0x00000001
61528 -#define DOORBELL_TID_OFFSET    0x03
61529 -#define DOORBELL_SID_OFFSET    0x05
61530 -#define DOORBELL_INFO_OFFSET   0x06
61531 -
61532 -#define DOORBELL_MESSAGE_SIZE  0x08
61533 -#define DBELL_SID(x)           (*(u8 *)(x + DOORBELL_SID_OFFSET))
61534 -#define DBELL_TID(x)           (*(u8 *)(x + DOORBELL_TID_OFFSET))
61535 -#define DBELL_INF(x)           (*(u16 *)(x + DOORBELL_INFO_OFFSET))
61536 -
61537 -struct rio_atmu_regs {
61538 -       u32 rowtar;
61539 -       u32 pad1;
61540 -       u32 rowbar;
61541 -       u32 pad2;
61542 -       u32 rowar;
61543 -       u32 pad3[3];
61544 -};
61545 -
61546 -struct rio_msg_regs {
61547 -       u32 omr;
61548 -       u32 osr;
61549 -       u32 pad1;
61550 -       u32 odqdpar;
61551 -       u32 pad2;
61552 -       u32 osar;
61553 -       u32 odpr;
61554 -       u32 odatr;
61555 -       u32 odcr;
61556 -       u32 pad3;
61557 -       u32 odqepar;
61558 -       u32 pad4[13];
61559 -       u32 imr;
61560 -       u32 isr;
61561 -       u32 pad5;
61562 -       u32 ifqdpar;
61563 -       u32 pad6;
61564 -       u32 ifqepar;
61565 -       u32 pad7[250];
61566 -       u32 dmr;
61567 -       u32 dsr;
61568 -       u32 pad8;
61569 -       u32 dqdpar;
61570 -       u32 pad9;
61571 -       u32 dqepar;
61572 -       u32 pad10[26];
61573 -       u32 pwmr;
61574 -       u32 pwsr;
61575 -       u32 pad11;
61576 -       u32 pwqbar;
61577 -};
61578 -
61579 -struct rio_tx_desc {
61580 -       u32 res1;
61581 -       u32 saddr;
61582 -       u32 dport;
61583 -       u32 dattr;
61584 -       u32 res2;
61585 -       u32 res3;
61586 -       u32 dwcnt;
61587 -       u32 res4;
61588 -};
61589 -
61590 -static u32 regs_win;
61591 -static struct rio_atmu_regs *atmu_regs;
61592 -static struct rio_atmu_regs *maint_atmu_regs;
61593 -static struct rio_atmu_regs *dbell_atmu_regs;
61594 -static u32 dbell_win;
61595 -static u32 maint_win;
61596 -static struct rio_msg_regs *msg_regs;
61597 -
61598 -static struct rio_dbell_ring {
61599 -       void *virt;
61600 -       dma_addr_t phys;
61601 -} dbell_ring;
61602 -
61603 -static struct rio_msg_tx_ring {
61604 -       void *virt;
61605 -       dma_addr_t phys;
61606 -       void *virt_buffer[RIO_MAX_TX_RING_SIZE];
61607 -       dma_addr_t phys_buffer[RIO_MAX_TX_RING_SIZE];
61608 -       int tx_slot;
61609 -       int size;
61610 -       void *dev_id;
61611 -} msg_tx_ring;
61612 -
61613 -static struct rio_msg_rx_ring {
61614 -       void *virt;
61615 -       dma_addr_t phys;
61616 -       void *virt_buffer[RIO_MAX_RX_RING_SIZE];
61617 -       int rx_slot;
61618 -       int size;
61619 -       void *dev_id;
61620 -} msg_rx_ring;
61621 -
61622 -/**
61623 - * mpc85xx_rio_doorbell_send - Send a MPC85xx doorbell message
61624 - * @index: ID of RapidIO interface
61625 - * @destid: Destination ID of target device
61626 - * @data: 16-bit info field of RapidIO doorbell message
61627 - *
61628 - * Sends a MPC85xx doorbell message. Returns %0 on success or
61629 - * %-EINVAL on failure.
61630 - */
61631 -static int mpc85xx_rio_doorbell_send(int index, u16 destid, u16 data)
61632 -{
61633 -       pr_debug("mpc85xx_doorbell_send: index %d destid %4.4x data %4.4x\n",
61634 -                index, destid, data);
61635 -       out_be32((void *)&dbell_atmu_regs->rowtar, destid << 22);
61636 -       out_be16((void *)(dbell_win), data);
61637 -
61638 -       return 0;
61639 -}
61640 -
61641 -/**
61642 - * mpc85xx_local_config_read - Generate a MPC85xx local config space read
61643 - * @index: ID of RapdiIO interface
61644 - * @offset: Offset into configuration space
61645 - * @len: Length (in bytes) of the maintenance transaction
61646 - * @data: Value to be read into
61647 - *
61648 - * Generates a MPC85xx local configuration space read. Returns %0 on
61649 - * success or %-EINVAL on failure.
61650 - */
61651 -static int mpc85xx_local_config_read(int index, u32 offset, int len, u32 * data)
61652 -{
61653 -       pr_debug("mpc85xx_local_config_read: index %d offset %8.8x\n", index,
61654 -                offset);
61655 -       *data = in_be32((void *)(regs_win + offset));
61656 -
61657 -       return 0;
61658 -}
61659 -
61660 -/**
61661 - * mpc85xx_local_config_write - Generate a MPC85xx local config space write
61662 - * @index: ID of RapdiIO interface
61663 - * @offset: Offset into configuration space
61664 - * @len: Length (in bytes) of the maintenance transaction
61665 - * @data: Value to be written
61666 - *
61667 - * Generates a MPC85xx local configuration space write. Returns %0 on
61668 - * success or %-EINVAL on failure.
61669 - */
61670 -static int mpc85xx_local_config_write(int index, u32 offset, int len, u32 data)
61671 -{
61672 -       pr_debug
61673 -           ("mpc85xx_local_config_write: index %d offset %8.8x data %8.8x\n",
61674 -            index, offset, data);
61675 -       out_be32((void *)(regs_win + offset), data);
61676 -
61677 -       return 0;
61678 -}
61679 -
61680 -/**
61681 - * mpc85xx_rio_config_read - Generate a MPC85xx read maintenance transaction
61682 - * @index: ID of RapdiIO interface
61683 - * @destid: Destination ID of transaction
61684 - * @hopcount: Number of hops to target device
61685 - * @offset: Offset into configuration space
61686 - * @len: Length (in bytes) of the maintenance transaction
61687 - * @val: Location to be read into
61688 - *
61689 - * Generates a MPC85xx read maintenance transaction. Returns %0 on
61690 - * success or %-EINVAL on failure.
61691 - */
61692 -static int
61693 -mpc85xx_rio_config_read(int index, u16 destid, u8 hopcount, u32 offset, int len,
61694 -                       u32 * val)
61695 -{
61696 -       u8 *data;
61697 -
61698 -       pr_debug
61699 -           ("mpc85xx_rio_config_read: index %d destid %d hopcount %d offset %8.8x len %d\n",
61700 -            index, destid, hopcount, offset, len);
61701 -       out_be32((void *)&maint_atmu_regs->rowtar,
61702 -                (destid << 22) | (hopcount << 12) | ((offset & ~0x3) >> 9));
61703 -
61704 -       data = (u8 *) maint_win + offset;
61705 -       switch (len) {
61706 -       case 1:
61707 -               *val = in_8((u8 *) data);
61708 -               break;
61709 -       case 2:
61710 -               *val = in_be16((u16 *) data);
61711 -               break;
61712 -       default:
61713 -               *val = in_be32((u32 *) data);
61714 -               break;
61715 -       }
61716 -
61717 -       return 0;
61718 -}
61719 -
61720 -/**
61721 - * mpc85xx_rio_config_write - Generate a MPC85xx write maintenance transaction
61722 - * @index: ID of RapdiIO interface
61723 - * @destid: Destination ID of transaction
61724 - * @hopcount: Number of hops to target device
61725 - * @offset: Offset into configuration space
61726 - * @len: Length (in bytes) of the maintenance transaction
61727 - * @val: Value to be written
61728 - *
61729 - * Generates an MPC85xx write maintenance transaction. Returns %0 on
61730 - * success or %-EINVAL on failure.
61731 - */
61732 -static int
61733 -mpc85xx_rio_config_write(int index, u16 destid, u8 hopcount, u32 offset,
61734 -                        int len, u32 val)
61735 -{
61736 -       u8 *data;
61737 -       pr_debug
61738 -           ("mpc85xx_rio_config_write: index %d destid %d hopcount %d offset %8.8x len %d val %8.8x\n",
61739 -            index, destid, hopcount, offset, len, val);
61740 -       out_be32((void *)&maint_atmu_regs->rowtar,
61741 -                (destid << 22) | (hopcount << 12) | ((offset & ~0x3) >> 9));
61742 -
61743 -       data = (u8 *) maint_win + offset;
61744 -       switch (len) {
61745 -       case 1:
61746 -               out_8((u8 *) data, val);
61747 -               break;
61748 -       case 2:
61749 -               out_be16((u16 *) data, val);
61750 -               break;
61751 -       default:
61752 -               out_be32((u32 *) data, val);
61753 -               break;
61754 -       }
61755 -
61756 -       return 0;
61757 -}
61758 -
61759 -/**
61760 - * rio_hw_add_outb_message - Add message to the MPC85xx outbound message queue
61761 - * @mport: Master port with outbound message queue
61762 - * @rdev: Target of outbound message
61763 - * @mbox: Outbound mailbox
61764 - * @buffer: Message to add to outbound queue
61765 - * @len: Length of message
61766 - *
61767 - * Adds the @buffer message to the MPC85xx outbound message queue. Returns
61768 - * %0 on success or %-EINVAL on failure.
61769 - */
61770 -int
61771 -rio_hw_add_outb_message(struct rio_mport *mport, struct rio_dev *rdev, int mbox,
61772 -                       void *buffer, size_t len)
61773 -{
61774 -       u32 omr;
61775 -       struct rio_tx_desc *desc =
61776 -           (struct rio_tx_desc *)msg_tx_ring.virt + msg_tx_ring.tx_slot;
61777 -       int ret = 0;
61778 -
61779 -       pr_debug
61780 -           ("RIO: rio_hw_add_outb_message(): destid %4.4x mbox %d buffer %8.8x len %8.8x\n",
61781 -            rdev->destid, mbox, (int)buffer, len);
61782 -
61783 -       if ((len < 8) || (len > RIO_MAX_MSG_SIZE)) {
61784 -               ret = -EINVAL;
61785 -               goto out;
61786 -       }
61787 -
61788 -       /* Copy and clear rest of buffer */
61789 -       memcpy(msg_tx_ring.virt_buffer[msg_tx_ring.tx_slot], buffer, len);
61790 -       if (len < (RIO_MAX_MSG_SIZE - 4))
61791 -               memset((void *)((u32) msg_tx_ring.
61792 -                               virt_buffer[msg_tx_ring.tx_slot] + len), 0,
61793 -                      RIO_MAX_MSG_SIZE - len);
61794 -
61795 -       /* Set mbox field for message */
61796 -       desc->dport = mbox & 0x3;
61797 -
61798 -       /* Enable EOMI interrupt, set priority, and set destid */
61799 -       desc->dattr = 0x28000000 | (rdev->destid << 2);
61800 -
61801 -       /* Set transfer size aligned to next power of 2 (in double words) */
61802 -       desc->dwcnt = is_power_of_2(len) ? len : 1 << get_bitmask_order(len);
61803 -
61804 -       /* Set snooping and source buffer address */
61805 -       desc->saddr = 0x00000004 | msg_tx_ring.phys_buffer[msg_tx_ring.tx_slot];
61806 -
61807 -       /* Increment enqueue pointer */
61808 -       omr = in_be32((void *)&msg_regs->omr);
61809 -       out_be32((void *)&msg_regs->omr, omr | RIO_MSG_OMR_MUI);
61810 -
61811 -       /* Go to next descriptor */
61812 -       if (++msg_tx_ring.tx_slot == msg_tx_ring.size)
61813 -               msg_tx_ring.tx_slot = 0;
61814 -
61815 -      out:
61816 -       return ret;
61817 -}
61818 -
61819 -EXPORT_SYMBOL_GPL(rio_hw_add_outb_message);
61820 -
61821 -/**
61822 - * mpc85xx_rio_tx_handler - MPC85xx outbound message interrupt handler
61823 - * @irq: Linux interrupt number
61824 - * @dev_instance: Pointer to interrupt-specific data
61825 - *
61826 - * Handles outbound message interrupts. Executes a register outbound
61827 - * mailbox event handler and acks the interrupt occurrence.
61828 - */
61829 -static irqreturn_t
61830 -mpc85xx_rio_tx_handler(int irq, void *dev_instance)
61831 -{
61832 -       int osr;
61833 -       struct rio_mport *port = (struct rio_mport *)dev_instance;
61834 -
61835 -       osr = in_be32((void *)&msg_regs->osr);
61836 -
61837 -       if (osr & RIO_MSG_OSR_TE) {
61838 -               pr_info("RIO: outbound message transmission error\n");
61839 -               out_be32((void *)&msg_regs->osr, RIO_MSG_OSR_TE);
61840 -               goto out;
61841 -       }
61842 -
61843 -       if (osr & RIO_MSG_OSR_QOI) {
61844 -               pr_info("RIO: outbound message queue overflow\n");
61845 -               out_be32((void *)&msg_regs->osr, RIO_MSG_OSR_QOI);
61846 -               goto out;
61847 -       }
61848 -
61849 -       if (osr & RIO_MSG_OSR_EOMI) {
61850 -               u32 dqp = in_be32((void *)&msg_regs->odqdpar);
61851 -               int slot = (dqp - msg_tx_ring.phys) >> 5;
61852 -               port->outb_msg[0].mcback(port, msg_tx_ring.dev_id, -1, slot);
61853 -
61854 -               /* Ack the end-of-message interrupt */
61855 -               out_be32((void *)&msg_regs->osr, RIO_MSG_OSR_EOMI);
61856 -       }
61857 -
61858 -      out:
61859 -       return IRQ_HANDLED;
61860 -}
61861 -
61862 -/**
61863 - * rio_open_outb_mbox - Initialize MPC85xx outbound mailbox
61864 - * @mport: Master port implementing the outbound message unit
61865 - * @dev_id: Device specific pointer to pass on event
61866 - * @mbox: Mailbox to open
61867 - * @entries: Number of entries in the outbound mailbox ring
61868 - *
61869 - * Initializes buffer ring, request the outbound message interrupt,
61870 - * and enables the outbound message unit. Returns %0 on success and
61871 - * %-EINVAL or %-ENOMEM on failure.
61872 - */
61873 -int rio_open_outb_mbox(struct rio_mport *mport, void *dev_id, int mbox, int entries)
61874 -{
61875 -       int i, j, rc = 0;
61876 -
61877 -       if ((entries < RIO_MIN_TX_RING_SIZE) ||
61878 -           (entries > RIO_MAX_TX_RING_SIZE) || (!is_power_of_2(entries))) {
61879 -               rc = -EINVAL;
61880 -               goto out;
61881 -       }
61882 -
61883 -       /* Initialize shadow copy ring */
61884 -       msg_tx_ring.dev_id = dev_id;
61885 -       msg_tx_ring.size = entries;
61886 -
61887 -       for (i = 0; i < msg_tx_ring.size; i++) {
61888 -               if (!
61889 -                   (msg_tx_ring.virt_buffer[i] =
61890 -                    dma_alloc_coherent(NULL, RIO_MSG_BUFFER_SIZE,
61891 -                                       &msg_tx_ring.phys_buffer[i],
61892 -                                       GFP_KERNEL))) {
61893 -                       rc = -ENOMEM;
61894 -                       for (j = 0; j < msg_tx_ring.size; j++)
61895 -                               if (msg_tx_ring.virt_buffer[j])
61896 -                                       dma_free_coherent(NULL,
61897 -                                                         RIO_MSG_BUFFER_SIZE,
61898 -                                                         msg_tx_ring.
61899 -                                                         virt_buffer[j],
61900 -                                                         msg_tx_ring.
61901 -                                                         phys_buffer[j]);
61902 -                       goto out;
61903 -               }
61904 -       }
61905 -
61906 -       /* Initialize outbound message descriptor ring */
61907 -       if (!(msg_tx_ring.virt = dma_alloc_coherent(NULL,
61908 -                                                   msg_tx_ring.size *
61909 -                                                   RIO_MSG_DESC_SIZE,
61910 -                                                   &msg_tx_ring.phys,
61911 -                                                   GFP_KERNEL))) {
61912 -               rc = -ENOMEM;
61913 -               goto out_dma;
61914 -       }
61915 -       memset(msg_tx_ring.virt, 0, msg_tx_ring.size * RIO_MSG_DESC_SIZE);
61916 -       msg_tx_ring.tx_slot = 0;
61917 -
61918 -       /* Point dequeue/enqueue pointers at first entry in ring */
61919 -       out_be32((void *)&msg_regs->odqdpar, msg_tx_ring.phys);
61920 -       out_be32((void *)&msg_regs->odqepar, msg_tx_ring.phys);
61921 -
61922 -       /* Configure for snooping */
61923 -       out_be32((void *)&msg_regs->osar, 0x00000004);
61924 -
61925 -       /* Clear interrupt status */
61926 -       out_be32((void *)&msg_regs->osr, 0x000000b3);
61927 -
61928 -       /* Hook up outbound message handler */
61929 -       if ((rc =
61930 -            request_irq(MPC85xx_IRQ_RIO_TX, mpc85xx_rio_tx_handler, 0,
61931 -                        "msg_tx", (void *)mport)) < 0)
61932 -               goto out_irq;
61933 -
61934 -       /*
61935 -        * Configure outbound message unit
61936 -        *      Snooping
61937 -        *      Interrupts (all enabled, except QEIE)
61938 -        *      Chaining mode
61939 -        *      Disable
61940 -        */
61941 -       out_be32((void *)&msg_regs->omr, 0x00100220);
61942 -
61943 -       /* Set number of entries */
61944 -       out_be32((void *)&msg_regs->omr,
61945 -                in_be32((void *)&msg_regs->omr) |
61946 -                ((get_bitmask_order(entries) - 2) << 12));
61947 -
61948 -       /* Now enable the unit */
61949 -       out_be32((void *)&msg_regs->omr, in_be32((void *)&msg_regs->omr) | 0x1);
61950 -
61951 -      out:
61952 -       return rc;
61953 -
61954 -      out_irq:
61955 -       dma_free_coherent(NULL, msg_tx_ring.size * RIO_MSG_DESC_SIZE,
61956 -                         msg_tx_ring.virt, msg_tx_ring.phys);
61957 -
61958 -      out_dma:
61959 -       for (i = 0; i < msg_tx_ring.size; i++)
61960 -               dma_free_coherent(NULL, RIO_MSG_BUFFER_SIZE,
61961 -                                 msg_tx_ring.virt_buffer[i],
61962 -                                 msg_tx_ring.phys_buffer[i]);
61963 -
61964 -       return rc;
61965 -}
61966 -
61967 -/**
61968 - * rio_close_outb_mbox - Shut down MPC85xx outbound mailbox
61969 - * @mport: Master port implementing the outbound message unit
61970 - * @mbox: Mailbox to close
61971 - *
61972 - * Disables the outbound message unit, free all buffers, and
61973 - * frees the outbound message interrupt.
61974 - */
61975 -void rio_close_outb_mbox(struct rio_mport *mport, int mbox)
61976 -{
61977 -       /* Disable inbound message unit */
61978 -       out_be32((void *)&msg_regs->omr, 0);
61979 -
61980 -       /* Free ring */
61981 -       dma_free_coherent(NULL, msg_tx_ring.size * RIO_MSG_DESC_SIZE,
61982 -                         msg_tx_ring.virt, msg_tx_ring.phys);
61983 -
61984 -       /* Free interrupt */
61985 -       free_irq(MPC85xx_IRQ_RIO_TX, (void *)mport);
61986 -}
61987 -
61988 -/**
61989 - * mpc85xx_rio_rx_handler - MPC85xx inbound message interrupt handler
61990 - * @irq: Linux interrupt number
61991 - * @dev_instance: Pointer to interrupt-specific data
61992 - *
61993 - * Handles inbound message interrupts. Executes a registered inbound
61994 - * mailbox event handler and acks the interrupt occurrence.
61995 - */
61996 -static irqreturn_t
61997 -mpc85xx_rio_rx_handler(int irq, void *dev_instance)
61998 -{
61999 -       int isr;
62000 -       struct rio_mport *port = (struct rio_mport *)dev_instance;
62001 -
62002 -       isr = in_be32((void *)&msg_regs->isr);
62003 -
62004 -       if (isr & RIO_MSG_ISR_TE) {
62005 -               pr_info("RIO: inbound message reception error\n");
62006 -               out_be32((void *)&msg_regs->isr, RIO_MSG_ISR_TE);
62007 -               goto out;
62008 -       }
62009 -
62010 -       /* XXX Need to check/dispatch until queue empty */
62011 -       if (isr & RIO_MSG_ISR_DIQI) {
62012 -               /*
62013 -                * We implement *only* mailbox 0, but can receive messages
62014 -                * for any mailbox/letter to that mailbox destination. So,
62015 -                * make the callback with an unknown/invalid mailbox number
62016 -                * argument.
62017 -                */
62018 -               port->inb_msg[0].mcback(port, msg_rx_ring.dev_id, -1, -1);
62019 -
62020 -               /* Ack the queueing interrupt */
62021 -               out_be32((void *)&msg_regs->isr, RIO_MSG_ISR_DIQI);
62022 -       }
62023 -
62024 -      out:
62025 -       return IRQ_HANDLED;
62026 -}
62027 -
62028 -/**
62029 - * rio_open_inb_mbox - Initialize MPC85xx inbound mailbox
62030 - * @mport: Master port implementing the inbound message unit
62031 - * @dev_id: Device specific pointer to pass on event
62032 - * @mbox: Mailbox to open
62033 - * @entries: Number of entries in the inbound mailbox ring
62034 - *
62035 - * Initializes buffer ring, request the inbound message interrupt,
62036 - * and enables the inbound message unit. Returns %0 on success
62037 - * and %-EINVAL or %-ENOMEM on failure.
62038 - */
62039 -int rio_open_inb_mbox(struct rio_mport *mport, void *dev_id, int mbox, int entries)
62040 -{
62041 -       int i, rc = 0;
62042 -
62043 -       if ((entries < RIO_MIN_RX_RING_SIZE) ||
62044 -           (entries > RIO_MAX_RX_RING_SIZE) || (!is_power_of_2(entries))) {
62045 -               rc = -EINVAL;
62046 -               goto out;
62047 -       }
62048 -
62049 -       /* Initialize client buffer ring */
62050 -       msg_rx_ring.dev_id = dev_id;
62051 -       msg_rx_ring.size = entries;
62052 -       msg_rx_ring.rx_slot = 0;
62053 -       for (i = 0; i < msg_rx_ring.size; i++)
62054 -               msg_rx_ring.virt_buffer[i] = NULL;
62055 -
62056 -       /* Initialize inbound message ring */
62057 -       if (!(msg_rx_ring.virt = dma_alloc_coherent(NULL,
62058 -                                                   msg_rx_ring.size *
62059 -                                                   RIO_MAX_MSG_SIZE,
62060 -                                                   &msg_rx_ring.phys,
62061 -                                                   GFP_KERNEL))) {
62062 -               rc = -ENOMEM;
62063 -               goto out;
62064 -       }
62065 -
62066 -       /* Point dequeue/enqueue pointers at first entry in ring */
62067 -       out_be32((void *)&msg_regs->ifqdpar, (u32) msg_rx_ring.phys);
62068 -       out_be32((void *)&msg_regs->ifqepar, (u32) msg_rx_ring.phys);
62069 -
62070 -       /* Clear interrupt status */
62071 -       out_be32((void *)&msg_regs->isr, 0x00000091);
62072 -
62073 -       /* Hook up inbound message handler */
62074 -       if ((rc =
62075 -            request_irq(MPC85xx_IRQ_RIO_RX, mpc85xx_rio_rx_handler, 0,
62076 -                        "msg_rx", (void *)mport)) < 0) {
62077 -               dma_free_coherent(NULL, RIO_MSG_BUFFER_SIZE,
62078 -                                 msg_tx_ring.virt_buffer[i],
62079 -                                 msg_tx_ring.phys_buffer[i]);
62080 -               goto out;
62081 -       }
62082 -
62083 -       /*
62084 -        * Configure inbound message unit:
62085 -        *      Snooping
62086 -        *      4KB max message size
62087 -        *      Unmask all interrupt sources
62088 -        *      Disable
62089 -        */
62090 -       out_be32((void *)&msg_regs->imr, 0x001b0060);
62091 -
62092 -       /* Set number of queue entries */
62093 -       out_be32((void *)&msg_regs->imr,
62094 -                in_be32((void *)&msg_regs->imr) |
62095 -                ((get_bitmask_order(entries) - 2) << 12));
62096 -
62097 -       /* Now enable the unit */
62098 -       out_be32((void *)&msg_regs->imr, in_be32((void *)&msg_regs->imr) | 0x1);
62099 -
62100 -      out:
62101 -       return rc;
62102 -}
62103 -
62104 -/**
62105 - * rio_close_inb_mbox - Shut down MPC85xx inbound mailbox
62106 - * @mport: Master port implementing the inbound message unit
62107 - * @mbox: Mailbox to close
62108 - *
62109 - * Disables the inbound message unit, free all buffers, and
62110 - * frees the inbound message interrupt.
62111 - */
62112 -void rio_close_inb_mbox(struct rio_mport *mport, int mbox)
62113 -{
62114 -       /* Disable inbound message unit */
62115 -       out_be32((void *)&msg_regs->imr, 0);
62116 -
62117 -       /* Free ring */
62118 -       dma_free_coherent(NULL, msg_rx_ring.size * RIO_MAX_MSG_SIZE,
62119 -                         msg_rx_ring.virt, msg_rx_ring.phys);
62120 -
62121 -       /* Free interrupt */
62122 -       free_irq(MPC85xx_IRQ_RIO_RX, (void *)mport);
62123 -}
62124 -
62125 -/**
62126 - * rio_hw_add_inb_buffer - Add buffer to the MPC85xx inbound message queue
62127 - * @mport: Master port implementing the inbound message unit
62128 - * @mbox: Inbound mailbox number
62129 - * @buf: Buffer to add to inbound queue
62130 - *
62131 - * Adds the @buf buffer to the MPC85xx inbound message queue. Returns
62132 - * %0 on success or %-EINVAL on failure.
62133 - */
62134 -int rio_hw_add_inb_buffer(struct rio_mport *mport, int mbox, void *buf)
62135 -{
62136 -       int rc = 0;
62137 -
62138 -       pr_debug("RIO: rio_hw_add_inb_buffer(), msg_rx_ring.rx_slot %d\n",
62139 -                msg_rx_ring.rx_slot);
62140 -
62141 -       if (msg_rx_ring.virt_buffer[msg_rx_ring.rx_slot]) {
62142 -               printk(KERN_ERR
62143 -                      "RIO: error adding inbound buffer %d, buffer exists\n",
62144 -                      msg_rx_ring.rx_slot);
62145 -               rc = -EINVAL;
62146 -               goto out;
62147 -       }
62148 -
62149 -       msg_rx_ring.virt_buffer[msg_rx_ring.rx_slot] = buf;
62150 -       if (++msg_rx_ring.rx_slot == msg_rx_ring.size)
62151 -               msg_rx_ring.rx_slot = 0;
62152 -
62153 -      out:
62154 -       return rc;
62155 -}
62156 -
62157 -EXPORT_SYMBOL_GPL(rio_hw_add_inb_buffer);
62158 -
62159 -/**
62160 - * rio_hw_get_inb_message - Fetch inbound message from the MPC85xx message unit
62161 - * @mport: Master port implementing the inbound message unit
62162 - * @mbox: Inbound mailbox number
62163 - *
62164 - * Gets the next available inbound message from the inbound message queue.
62165 - * A pointer to the message is returned on success or NULL on failure.
62166 - */
62167 -void *rio_hw_get_inb_message(struct rio_mport *mport, int mbox)
62168 -{
62169 -       u32 imr;
62170 -       u32 phys_buf, virt_buf;
62171 -       void *buf = NULL;
62172 -       int buf_idx;
62173 -
62174 -       phys_buf = in_be32((void *)&msg_regs->ifqdpar);
62175 -
62176 -       /* If no more messages, then bail out */
62177 -       if (phys_buf == in_be32((void *)&msg_regs->ifqepar))
62178 -               goto out2;
62179 -
62180 -       virt_buf = (u32) msg_rx_ring.virt + (phys_buf - msg_rx_ring.phys);
62181 -       buf_idx = (phys_buf - msg_rx_ring.phys) / RIO_MAX_MSG_SIZE;
62182 -       buf = msg_rx_ring.virt_buffer[buf_idx];
62183 -
62184 -       if (!buf) {
62185 -               printk(KERN_ERR
62186 -                      "RIO: inbound message copy failed, no buffers\n");
62187 -               goto out1;
62188 -       }
62189 -
62190 -       /* Copy max message size, caller is expected to allocate that big */
62191 -       memcpy(buf, (void *)virt_buf, RIO_MAX_MSG_SIZE);
62192 -
62193 -       /* Clear the available buffer */
62194 -       msg_rx_ring.virt_buffer[buf_idx] = NULL;
62195 -
62196 -      out1:
62197 -       imr = in_be32((void *)&msg_regs->imr);
62198 -       out_be32((void *)&msg_regs->imr, imr | RIO_MSG_IMR_MI);
62199 -
62200 -      out2:
62201 -       return buf;
62202 -}
62203 -
62204 -EXPORT_SYMBOL_GPL(rio_hw_get_inb_message);
62205 -
62206 -/**
62207 - * mpc85xx_rio_dbell_handler - MPC85xx doorbell interrupt handler
62208 - * @irq: Linux interrupt number
62209 - * @dev_instance: Pointer to interrupt-specific data
62210 - *
62211 - * Handles doorbell interrupts. Parses a list of registered
62212 - * doorbell event handlers and executes a matching event handler.
62213 - */
62214 -static irqreturn_t
62215 -mpc85xx_rio_dbell_handler(int irq, void *dev_instance)
62216 -{
62217 -       int dsr;
62218 -       struct rio_mport *port = (struct rio_mport *)dev_instance;
62219 -
62220 -       dsr = in_be32((void *)&msg_regs->dsr);
62221 -
62222 -       if (dsr & DOORBELL_DSR_TE) {
62223 -               pr_info("RIO: doorbell reception error\n");
62224 -               out_be32((void *)&msg_regs->dsr, DOORBELL_DSR_TE);
62225 -               goto out;
62226 -       }
62227 -
62228 -       if (dsr & DOORBELL_DSR_QFI) {
62229 -               pr_info("RIO: doorbell queue full\n");
62230 -               out_be32((void *)&msg_regs->dsr, DOORBELL_DSR_QFI);
62231 -               goto out;
62232 -       }
62233 -
62234 -       /* XXX Need to check/dispatch until queue empty */
62235 -       if (dsr & DOORBELL_DSR_DIQI) {
62236 -               u32 dmsg =
62237 -                   (u32) dbell_ring.virt +
62238 -                   (in_be32((void *)&msg_regs->dqdpar) & 0xfff);
62239 -               u32 dmr;
62240 -               struct rio_dbell *dbell;
62241 -               int found = 0;
62242 -
62243 -               pr_debug
62244 -                   ("RIO: processing doorbell, sid %2.2x tid %2.2x info %4.4x\n",
62245 -                    DBELL_SID(dmsg), DBELL_TID(dmsg), DBELL_INF(dmsg));
62246 -
62247 -               list_for_each_entry(dbell, &port->dbells, node) {
62248 -                       if ((dbell->res->start <= DBELL_INF(dmsg)) &&
62249 -                           (dbell->res->end >= DBELL_INF(dmsg))) {
62250 -                               found = 1;
62251 -                               break;
62252 -                       }
62253 -               }
62254 -               if (found) {
62255 -                       dbell->dinb(port, dbell->dev_id, DBELL_SID(dmsg), DBELL_TID(dmsg),
62256 -                                   DBELL_INF(dmsg));
62257 -               } else {
62258 -                       pr_debug
62259 -                           ("RIO: spurious doorbell, sid %2.2x tid %2.2x info %4.4x\n",
62260 -                            DBELL_SID(dmsg), DBELL_TID(dmsg), DBELL_INF(dmsg));
62261 -               }
62262 -               dmr = in_be32((void *)&msg_regs->dmr);
62263 -               out_be32((void *)&msg_regs->dmr, dmr | DOORBELL_DMR_DI);
62264 -               out_be32((void *)&msg_regs->dsr, DOORBELL_DSR_DIQI);
62265 -       }
62266 -
62267 -      out:
62268 -       return IRQ_HANDLED;
62269 -}
62270 -
62271 -/**
62272 - * mpc85xx_rio_doorbell_init - MPC85xx doorbell interface init
62273 - * @mport: Master port implementing the inbound doorbell unit
62274 - *
62275 - * Initializes doorbell unit hardware and inbound DMA buffer
62276 - * ring. Called from mpc85xx_rio_setup(). Returns %0 on success
62277 - * or %-ENOMEM on failure.
62278 - */
62279 -static int mpc85xx_rio_doorbell_init(struct rio_mport *mport)
62280 -{
62281 -       int rc = 0;
62282 -
62283 -       /* Map outbound doorbell window immediately after maintenance window */
62284 -       if (!(dbell_win =
62285 -             (u32) ioremap(mport->iores.start + RIO_MAINT_WIN_SIZE,
62286 -                           RIO_DBELL_WIN_SIZE))) {
62287 -               printk(KERN_ERR
62288 -                      "RIO: unable to map outbound doorbell window\n");
62289 -               rc = -ENOMEM;
62290 -               goto out;
62291 -       }
62292 -
62293 -       /* Initialize inbound doorbells */
62294 -       if (!(dbell_ring.virt = dma_alloc_coherent(NULL,
62295 -                                                  512 * DOORBELL_MESSAGE_SIZE,
62296 -                                                  &dbell_ring.phys,
62297 -                                                  GFP_KERNEL))) {
62298 -               printk(KERN_ERR "RIO: unable allocate inbound doorbell ring\n");
62299 -               rc = -ENOMEM;
62300 -               iounmap((void *)dbell_win);
62301 -               goto out;
62302 -       }
62303 -
62304 -       /* Point dequeue/enqueue pointers at first entry in ring */
62305 -       out_be32((void *)&msg_regs->dqdpar, (u32) dbell_ring.phys);
62306 -       out_be32((void *)&msg_regs->dqepar, (u32) dbell_ring.phys);
62307 -
62308 -       /* Clear interrupt status */
62309 -       out_be32((void *)&msg_regs->dsr, 0x00000091);
62310 -
62311 -       /* Hook up doorbell handler */
62312 -       if ((rc =
62313 -            request_irq(MPC85xx_IRQ_RIO_BELL, mpc85xx_rio_dbell_handler, 0,
62314 -                        "dbell_rx", (void *)mport) < 0)) {
62315 -               iounmap((void *)dbell_win);
62316 -               dma_free_coherent(NULL, 512 * DOORBELL_MESSAGE_SIZE,
62317 -                                 dbell_ring.virt, dbell_ring.phys);
62318 -               printk(KERN_ERR
62319 -                      "MPC85xx RIO: unable to request inbound doorbell irq");
62320 -               goto out;
62321 -       }
62322 -
62323 -       /* Configure doorbells for snooping, 512 entries, and enable */
62324 -       out_be32((void *)&msg_regs->dmr, 0x00108161);
62325 -
62326 -      out:
62327 -       return rc;
62328 -}
62329 -
62330 -static char *cmdline = NULL;
62331 -
62332 -static int mpc85xx_rio_get_hdid(int index)
62333 -{
62334 -       /* XXX Need to parse multiple entries in some format */
62335 -       if (!cmdline)
62336 -               return -1;
62337 -
62338 -       return simple_strtol(cmdline, NULL, 0);
62339 -}
62340 -
62341 -static int mpc85xx_rio_get_cmdline(char *s)
62342 -{
62343 -       if (!s)
62344 -               return 0;
62345 -
62346 -       cmdline = s;
62347 -       return 1;
62348 -}
62349 -
62350 -__setup("riohdid=", mpc85xx_rio_get_cmdline);
62351 -
62352 -/**
62353 - * mpc85xx_rio_setup - Setup MPC85xx RapidIO interface
62354 - * @law_start: Starting physical address of RapidIO LAW
62355 - * @law_size: Size of RapidIO LAW
62356 - *
62357 - * Initializes MPC85xx RapidIO hardware interface, configures
62358 - * master port with system-specific info, and registers the
62359 - * master port with the RapidIO subsystem.
62360 - */
62361 -void mpc85xx_rio_setup(int law_start, int law_size)
62362 -{
62363 -       struct rio_ops *ops;
62364 -       struct rio_mport *port;
62365 -
62366 -       ops = kmalloc(sizeof(struct rio_ops), GFP_KERNEL);
62367 -       ops->lcread = mpc85xx_local_config_read;
62368 -       ops->lcwrite = mpc85xx_local_config_write;
62369 -       ops->cread = mpc85xx_rio_config_read;
62370 -       ops->cwrite = mpc85xx_rio_config_write;
62371 -       ops->dsend = mpc85xx_rio_doorbell_send;
62372 -
62373 -       port = kmalloc(sizeof(struct rio_mport), GFP_KERNEL);
62374 -       port->id = 0;
62375 -       port->index = 0;
62376 -       INIT_LIST_HEAD(&port->dbells);
62377 -       port->iores.start = law_start;
62378 -       port->iores.end = law_start + law_size;
62379 -       port->iores.flags = IORESOURCE_MEM;
62380 -
62381 -       rio_init_dbell_res(&port->riores[RIO_DOORBELL_RESOURCE], 0, 0xffff);
62382 -       rio_init_mbox_res(&port->riores[RIO_INB_MBOX_RESOURCE], 0, 0);
62383 -       rio_init_mbox_res(&port->riores[RIO_OUTB_MBOX_RESOURCE], 0, 0);
62384 -       strcpy(port->name, "RIO0 mport");
62385 -
62386 -       port->ops = ops;
62387 -       port->host_deviceid = mpc85xx_rio_get_hdid(port->id);
62388 -
62389 -       rio_register_mport(port);
62390 -
62391 -       regs_win = (u32) ioremap(RIO_REGS_BASE, 0x20000);
62392 -       atmu_regs = (struct rio_atmu_regs *)(regs_win + RIO_ATMU_REGS_OFFSET);
62393 -       maint_atmu_regs = atmu_regs + 1;
62394 -       dbell_atmu_regs = atmu_regs + 2;
62395 -       msg_regs = (struct rio_msg_regs *)(regs_win + RIO_MSG_REGS_OFFSET);
62396 -
62397 -       /* Configure maintenance transaction window */
62398 -       out_be32((void *)&maint_atmu_regs->rowbar, 0x000c0000);
62399 -       out_be32((void *)&maint_atmu_regs->rowar, 0x80077015);
62400 -
62401 -       maint_win = (u32) ioremap(law_start, RIO_MAINT_WIN_SIZE);
62402 -
62403 -       /* Configure outbound doorbell window */
62404 -       out_be32((void *)&dbell_atmu_regs->rowbar, 0x000c0400);
62405 -       out_be32((void *)&dbell_atmu_regs->rowar, 0x8004200b);
62406 -       mpc85xx_rio_doorbell_init(port);
62407 -}
62408 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/ppc/syslib/ppc85xx_rio.h powerpc.git/arch/ppc/syslib/ppc85xx_rio.h
62409 --- linux-2.6.24/arch/ppc/syslib/ppc85xx_rio.h  2008-01-24 23:58:37.000000000 +0100
62410 +++ powerpc.git/arch/ppc/syslib/ppc85xx_rio.h   1970-01-01 01:00:00.000000000 +0100
62411 @@ -1,20 +0,0 @@
62412 -/*
62413 - * MPC85xx RapidIO definitions
62414 - *
62415 - * Copyright 2005 MontaVista Software, Inc.
62416 - * Matt Porter <mporter@kernel.crashing.org>
62417 - *
62418 - * This program is free software; you can redistribute  it and/or modify it
62419 - * under  the terms of  the GNU General  Public License as published by the
62420 - * Free Software Foundation;  either version 2 of the  License, or (at your
62421 - * option) any later version.
62422 - */
62423 -
62424 -#ifndef __PPC_SYSLIB_PPC85XX_RIO_H
62425 -#define __PPC_SYSLIB_PPC85XX_RIO_H
62426 -
62427 -#include <linux/init.h>
62428 -
62429 -extern void mpc85xx_rio_setup(int law_start, int law_size);
62430 -
62431 -#endif                         /* __PPC_SYSLIB_PPC85XX_RIO_H */
62432 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/ppc/syslib/ppc8xx_pic.c powerpc.git/arch/ppc/syslib/ppc8xx_pic.c
62433 --- linux-2.6.24/arch/ppc/syslib/ppc8xx_pic.c   2008-01-24 23:58:37.000000000 +0100
62434 +++ powerpc.git/arch/ppc/syslib/ppc8xx_pic.c    2008-01-28 20:25:52.000000000 +0100
62435 @@ -16,7 +16,7 @@
62436   * the only interrupt controller.  Some boards, like the MBX and
62437   * Sandpoint have the 8259 as a secondary controller.  Depending
62438   * upon the processor type, the internal controller can have as
62439 - * few as 16 interrups or as many as 64.  We could use  the
62440 + * few as 16 interrupts or as many as 64.  We could use  the
62441   * "clear_bit()" and "set_bit()" functions like other platforms,
62442   * but they are overkill for us.
62443   */
62444 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/ppc/syslib/ppc_sys.c powerpc.git/arch/ppc/syslib/ppc_sys.c
62445 --- linux-2.6.24/arch/ppc/syslib/ppc_sys.c      2008-01-24 23:58:37.000000000 +0100
62446 +++ powerpc.git/arch/ppc/syslib/ppc_sys.c       2008-01-28 20:25:52.000000000 +0100
62447 @@ -185,7 +185,7 @@
62448   */
62449  
62450  /*
62451 -   Here we'll replace .name pointers with fixed-lenght strings
62452 +   Here we'll replace .name pointers with fixed-length strings
62453     Hereby, this should be called *before* any func stuff triggeded.
62454   */
62455  void ppc_sys_device_initfunc(void)
62456 diff -x .git -x .gitignore -Nur linux-2.6.24/arch/ppc/xmon/start.c powerpc.git/arch/ppc/xmon/start.c
62457 --- linux-2.6.24/arch/ppc/xmon/start.c  2008-01-24 23:58:37.000000000 +0100
62458 +++ powerpc.git/arch/ppc/xmon/start.c   2008-01-28 20:25:52.000000000 +0100
62459 @@ -10,7 +10,6 @@
62460  #include <linux/sysrq.h>
62461  #include <linux/bitops.h>
62462  #include <asm/xmon.h>
62463 -#include <asm/machdep.h>
62464  #include <asm/errno.h>
62465  #include <asm/processor.h>
62466  #include <asm/delay.h>
62467 diff -x .git -x .gitignore -Nur linux-2.6.24/drivers/ata/Kconfig powerpc.git/drivers/ata/Kconfig
62468 --- linux-2.6.24/drivers/ata/Kconfig    2008-01-24 23:58:37.000000000 +0100
62469 +++ powerpc.git/drivers/ata/Kconfig     2008-01-28 20:25:59.000000000 +0100
62470 @@ -607,13 +607,23 @@
62471  
62472  config PATA_PLATFORM
62473         tristate "Generic platform device PATA support"
62474 -       depends on EMBEDDED || ARCH_RPC
62475 +       depends on EMBEDDED || ARCH_RPC || PPC
62476         help
62477           This option enables support for generic directly connected ATA
62478           devices commonly found on embedded systems.
62479  
62480           If unsure, say N.
62481  
62482 +config PATA_OF_PLATFORM
62483 +       tristate "OpenFirmware platform device PATA support"
62484 +       depends on PATA_PLATFORM && PPC_OF
62485 +       help
62486 +         This option enables support for generic directly connected ATA
62487 +         devices commonly found on embedded systems with OpenFirmware
62488 +         bindings.
62489 +
62490 +         If unsure, say N.
62491 +
62492  config PATA_ICSIDE
62493         tristate "Acorn ICS PATA support"
62494         depends on ARM && ARCH_ACORN
62495 diff -x .git -x .gitignore -Nur linux-2.6.24/drivers/ata/Makefile powerpc.git/drivers/ata/Makefile
62496 --- linux-2.6.24/drivers/ata/Makefile   2008-01-24 23:58:37.000000000 +0100
62497 +++ powerpc.git/drivers/ata/Makefile    2008-01-28 20:25:59.000000000 +0100
62498 @@ -67,6 +67,7 @@
62499  obj-$(CONFIG_PATA_SCC)         += pata_scc.o
62500  obj-$(CONFIG_PATA_BF54X)       += pata_bf54x.o
62501  obj-$(CONFIG_PATA_PLATFORM)    += pata_platform.o
62502 +obj-$(CONFIG_PATA_OF_PLATFORM) += pata_of_platform.o
62503  obj-$(CONFIG_PATA_ICSIDE)      += pata_icside.o
62504  # Should be last but two libata driver
62505  obj-$(CONFIG_PATA_ACPI)                += pata_acpi.o
62506 diff -x .git -x .gitignore -Nur linux-2.6.24/drivers/ata/pata_of_platform.c powerpc.git/drivers/ata/pata_of_platform.c
62507 --- linux-2.6.24/drivers/ata/pata_of_platform.c 1970-01-01 01:00:00.000000000 +0100
62508 +++ powerpc.git/drivers/ata/pata_of_platform.c  2008-01-28 20:25:59.000000000 +0100
62509 @@ -0,0 +1,114 @@
62510 +/*
62511 + * OF-platform PATA driver
62512 + *
62513 + * Copyright (c) 2007  MontaVista Software, Inc.
62514 + *                     Anton Vorontsov <avorontsov@ru.mvista.com>
62515 + *
62516 + * This program is free software; you can redistribute it and/or modify
62517 + * it under the terms of the GNU General Public License (Version 2) as
62518 + * published by the Free Software Foundation.
62519 + */
62520 +
62521 +#include <linux/kernel.h>
62522 +#include <linux/module.h>
62523 +#include <linux/of_platform.h>
62524 +#include <linux/pata_platform.h>
62525 +
62526 +static int __devinit pata_of_platform_probe(struct of_device *ofdev,
62527 +                                           const struct of_device_id *match)
62528 +{
62529 +       int ret;
62530 +       struct device_node *dn = ofdev->node;
62531 +       struct resource io_res;
62532 +       struct resource ctl_res;
62533 +       struct resource irq_res;
62534 +       unsigned int reg_shift = 0;
62535 +       int pio_mode = 0;
62536 +       int pio_mask;
62537 +       const u32 *prop;
62538 +
62539 +       ret = of_address_to_resource(dn, 0, &io_res);
62540 +       if (ret) {
62541 +               dev_err(&ofdev->dev, "can't get IO address from "
62542 +                       "device tree\n");
62543 +               return -EINVAL;
62544 +       }
62545 +
62546 +       if (of_device_is_compatible(dn, "electra-ide")) {
62547 +               /* Altstatus is really at offset 0x3f6 from the primary window
62548 +                * on electra-ide. Adjust ctl_res and io_res accordingly.
62549 +                */
62550 +               ctl_res = io_res;
62551 +               ctl_res.start = ctl_res.start+0x3f6;
62552 +               io_res.end = ctl_res.start-1;
62553 +       } else {
62554 +               ret = of_address_to_resource(dn, 1, &ctl_res);
62555 +               if (ret) {
62556 +                       dev_err(&ofdev->dev, "can't get CTL address from "
62557 +                               "device tree\n");
62558 +                       return -EINVAL;
62559 +               }
62560 +       }
62561 +
62562 +       ret = of_irq_to_resource(dn, 0, &irq_res);
62563 +       if (ret == NO_IRQ)
62564 +               irq_res.start = irq_res.end = -1;
62565 +       else
62566 +               irq_res.flags = 0;
62567 +
62568 +       prop = of_get_property(dn, "reg-shift", NULL);
62569 +       if (prop)
62570 +               reg_shift = *prop;
62571 +
62572 +       prop = of_get_property(dn, "pio-mode", NULL);
62573 +       if (prop) {
62574 +               pio_mode = *prop;
62575 +               if (pio_mode > 6) {
62576 +                       dev_err(&ofdev->dev, "invalid pio-mode\n");
62577 +                       return -EINVAL;
62578 +               }
62579 +       } else {
62580 +               dev_info(&ofdev->dev, "pio-mode unspecified, assuming PIO0\n");
62581 +       }
62582 +
62583 +       pio_mask = 1 << pio_mode;
62584 +       pio_mask |= (1 << pio_mode) - 1;
62585 +
62586 +       return __pata_platform_probe(&ofdev->dev, &io_res, &ctl_res, &irq_res,
62587 +                                    reg_shift, pio_mask);
62588 +}
62589 +
62590 +static int __devexit pata_of_platform_remove(struct of_device *ofdev)
62591 +{
62592 +       return __pata_platform_remove(&ofdev->dev);
62593 +}
62594 +
62595 +static struct of_device_id pata_of_platform_match[] = {
62596 +       { .compatible = "ata-generic", },
62597 +       { .compatible = "electra-ide", },
62598 +       {},
62599 +};
62600 +MODULE_DEVICE_TABLE(of, pata_of_platform_match);
62601 +
62602 +static struct of_platform_driver pata_of_platform_driver = {
62603 +       .name           = "pata_of_platform",
62604 +       .match_table    = pata_of_platform_match,
62605 +       .probe          = pata_of_platform_probe,
62606 +       .remove         = __devexit_p(pata_of_platform_remove),
62607 +};
62608 +
62609 +static int __init pata_of_platform_init(void)
62610 +{
62611 +       return of_register_platform_driver(&pata_of_platform_driver);
62612 +}
62613 +module_init(pata_of_platform_init);
62614 +
62615 +static void __exit pata_of_platform_exit(void)
62616 +{
62617 +       of_unregister_platform_driver(&pata_of_platform_driver);
62618 +}
62619 +module_exit(pata_of_platform_exit);
62620 +
62621 +MODULE_DESCRIPTION("OF-platform PATA driver");
62622 +MODULE_AUTHOR("Anton Vorontsov <avorontsov@ru.mvista.com>");
62623 +MODULE_LICENSE("GPL");
62624 diff -x .git -x .gitignore -Nur linux-2.6.24/drivers/ata/pata_platform.c powerpc.git/drivers/ata/pata_platform.c
62625 --- linux-2.6.24/drivers/ata/pata_platform.c    2008-01-24 23:58:37.000000000 +0100
62626 +++ powerpc.git/drivers/ata/pata_platform.c     2008-01-28 20:25:59.000000000 +0100
62627 @@ -93,14 +93,9 @@
62628  };
62629  
62630  static void pata_platform_setup_port(struct ata_ioports *ioaddr,
62631 -                                    struct pata_platform_info *info)
62632 +                                    unsigned int shift)
62633  {
62634 -       unsigned int shift = 0;
62635 -
62636         /* Fixup the port shift for platforms that need it */
62637 -       if (info && info->ioport_shift)
62638 -               shift = info->ioport_shift;
62639 -
62640         ioaddr->data_addr       = ioaddr->cmd_addr + (ATA_REG_DATA    << shift);
62641         ioaddr->error_addr      = ioaddr->cmd_addr + (ATA_REG_ERR     << shift);
62642         ioaddr->feature_addr    = ioaddr->cmd_addr + (ATA_REG_FEATURE << shift);
62643 @@ -114,8 +109,13 @@
62644  }
62645  
62646  /**
62647 - *     pata_platform_probe             -       attach a platform interface
62648 - *     @pdev: platform device
62649 + *     __pata_platform_probe           -       attach a platform interface
62650 + *     @dev: device
62651 + *     @io_res: Resource representing I/O base
62652 + *     @ctl_res: Resource representing CTL base
62653 + *     @irq_res: Resource representing IRQ and its flags
62654 + *     @ioport_shift: I/O port shift
62655 + *     @__pio_mask: PIO mask
62656   *
62657   *     Register a platform bus IDE interface. Such interfaces are PIO and we
62658   *     assume do not support IRQ sharing.
62659 @@ -135,42 +135,18 @@
62660   *
62661   *     If no IRQ resource is present, PIO polling mode is used instead.
62662   */
62663 -static int __devinit pata_platform_probe(struct platform_device *pdev)
62664 +int __devinit __pata_platform_probe(struct device *dev,
62665 +                                   struct resource *io_res,
62666 +                                   struct resource *ctl_res,
62667 +                                   struct resource *irq_res,
62668 +                                   unsigned int ioport_shift,
62669 +                                   int __pio_mask)
62670  {
62671 -       struct resource *io_res, *ctl_res;
62672         struct ata_host *host;
62673         struct ata_port *ap;
62674 -       struct pata_platform_info *pp_info;
62675         unsigned int mmio;
62676 -       int irq;
62677 -
62678 -       /*
62679 -        * Simple resource validation ..
62680 -        */
62681 -       if ((pdev->num_resources != 3) && (pdev->num_resources != 2)) {
62682 -               dev_err(&pdev->dev, "invalid number of resources\n");
62683 -               return -EINVAL;
62684 -       }
62685 -
62686 -       /*
62687 -        * Get the I/O base first
62688 -        */
62689 -       io_res = platform_get_resource(pdev, IORESOURCE_IO, 0);
62690 -       if (io_res == NULL) {
62691 -               io_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
62692 -               if (unlikely(io_res == NULL))
62693 -                       return -EINVAL;
62694 -       }
62695 -
62696 -       /*
62697 -        * Then the CTL base
62698 -        */
62699 -       ctl_res = platform_get_resource(pdev, IORESOURCE_IO, 1);
62700 -       if (ctl_res == NULL) {
62701 -               ctl_res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
62702 -               if (unlikely(ctl_res == NULL))
62703 -                       return -EINVAL;
62704 -       }
62705 +       int irq = 0;
62706 +       int irq_flags = 0;
62707  
62708         /*
62709          * Check for MMIO
62710 @@ -181,20 +157,21 @@
62711         /*
62712          * And the IRQ
62713          */
62714 -       irq = platform_get_irq(pdev, 0);
62715 -       if (irq < 0)
62716 -               irq = 0;        /* no irq */
62717 +       if (irq_res && irq_res->start > 0) {
62718 +               irq = irq_res->start;
62719 +               irq_flags = irq_res->flags;
62720 +       }
62721  
62722         /*
62723          * Now that that's out of the way, wire up the port..
62724          */
62725 -       host = ata_host_alloc(&pdev->dev, 1);
62726 +       host = ata_host_alloc(dev, 1);
62727         if (!host)
62728                 return -ENOMEM;
62729         ap = host->ports[0];
62730  
62731         ap->ops = &pata_platform_port_ops;
62732 -       ap->pio_mask = pio_mask;
62733 +       ap->pio_mask = __pio_mask;
62734         ap->flags |= ATA_FLAG_SLAVE_POSS;
62735  
62736         /*
62737 @@ -209,25 +186,24 @@
62738          * Handle the MMIO case
62739          */
62740         if (mmio) {
62741 -               ap->ioaddr.cmd_addr = devm_ioremap(&pdev->dev, io_res->start,
62742 +               ap->ioaddr.cmd_addr = devm_ioremap(dev, io_res->start,
62743                                 io_res->end - io_res->start + 1);
62744 -               ap->ioaddr.ctl_addr = devm_ioremap(&pdev->dev, ctl_res->start,
62745 +               ap->ioaddr.ctl_addr = devm_ioremap(dev, ctl_res->start,
62746                                 ctl_res->end - ctl_res->start + 1);
62747         } else {
62748 -               ap->ioaddr.cmd_addr = devm_ioport_map(&pdev->dev, io_res->start,
62749 +               ap->ioaddr.cmd_addr = devm_ioport_map(dev, io_res->start,
62750                                 io_res->end - io_res->start + 1);
62751 -               ap->ioaddr.ctl_addr = devm_ioport_map(&pdev->dev, ctl_res->start,
62752 +               ap->ioaddr.ctl_addr = devm_ioport_map(dev, ctl_res->start,
62753                                 ctl_res->end - ctl_res->start + 1);
62754         }
62755         if (!ap->ioaddr.cmd_addr || !ap->ioaddr.ctl_addr) {
62756 -               dev_err(&pdev->dev, "failed to map IO/CTL base\n");
62757 +               dev_err(dev, "failed to map IO/CTL base\n");
62758                 return -ENOMEM;
62759         }
62760  
62761         ap->ioaddr.altstatus_addr = ap->ioaddr.ctl_addr;
62762  
62763 -       pp_info = pdev->dev.platform_data;
62764 -       pata_platform_setup_port(&ap->ioaddr, pp_info);
62765 +       pata_platform_setup_port(&ap->ioaddr, ioport_shift);
62766  
62767         ata_port_desc(ap, "%s cmd 0x%llx ctl 0x%llx", mmio ? "mmio" : "ioport",
62768                       (unsigned long long)io_res->start,
62769 @@ -235,26 +211,78 @@
62770  
62771         /* activate */
62772         return ata_host_activate(host, irq, irq ? ata_interrupt : NULL,
62773 -                                pp_info ? pp_info->irq_flags : 0,
62774 -                                &pata_platform_sht);
62775 +                                irq_flags, &pata_platform_sht);
62776  }
62777 +EXPORT_SYMBOL_GPL(__pata_platform_probe);
62778  
62779  /**
62780 - *     pata_platform_remove    -       unplug a platform interface
62781 - *     @pdev: platform device
62782 + *     __pata_platform_remove          -       unplug a platform interface
62783 + *     @dev: device
62784   *
62785   *     A platform bus ATA device has been unplugged. Perform the needed
62786   *     cleanup. Also called on module unload for any active devices.
62787   */
62788 -static int __devexit pata_platform_remove(struct platform_device *pdev)
62789 +int __devexit __pata_platform_remove(struct device *dev)
62790  {
62791 -       struct device *dev = &pdev->dev;
62792         struct ata_host *host = dev_get_drvdata(dev);
62793  
62794         ata_host_detach(host);
62795  
62796         return 0;
62797  }
62798 +EXPORT_SYMBOL_GPL(__pata_platform_remove);
62799 +
62800 +static int __devinit pata_platform_probe(struct platform_device *pdev)
62801 +{
62802 +       struct resource *io_res;
62803 +       struct resource *ctl_res;
62804 +       struct resource *irq_res;
62805 +       struct pata_platform_info *pp_info = pdev->dev.platform_data;
62806 +
62807 +       /*
62808 +        * Simple resource validation ..
62809 +        */
62810 +       if ((pdev->num_resources != 3) && (pdev->num_resources != 2)) {
62811 +               dev_err(&pdev->dev, "invalid number of resources\n");
62812 +               return -EINVAL;
62813 +       }
62814 +
62815 +       /*
62816 +        * Get the I/O base first
62817 +        */
62818 +       io_res = platform_get_resource(pdev, IORESOURCE_IO, 0);
62819 +       if (io_res == NULL) {
62820 +               io_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
62821 +               if (unlikely(io_res == NULL))
62822 +                       return -EINVAL;
62823 +       }
62824 +
62825 +       /*
62826 +        * Then the CTL base
62827 +        */
62828 +       ctl_res = platform_get_resource(pdev, IORESOURCE_IO, 1);
62829 +       if (ctl_res == NULL) {
62830 +               ctl_res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
62831 +               if (unlikely(ctl_res == NULL))
62832 +                       return -EINVAL;
62833 +       }
62834 +
62835 +       /*
62836 +        * And the IRQ
62837 +        */
62838 +       irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
62839 +       if (irq_res)
62840 +               irq_res->flags = pp_info ? pp_info->irq_flags : 0;
62841 +
62842 +       return __pata_platform_probe(&pdev->dev, io_res, ctl_res, irq_res,
62843 +                                    pp_info ? pp_info->ioport_shift : 0,
62844 +                                    pio_mask);
62845 +}
62846 +
62847 +static int __devexit pata_platform_remove(struct platform_device *pdev)
62848 +{
62849 +       return __pata_platform_remove(&pdev->dev);
62850 +}
62851  
62852  static struct platform_driver pata_platform_driver = {
62853         .probe          = pata_platform_probe,
62854 diff -x .git -x .gitignore -Nur linux-2.6.24/drivers/char/hw_random/Kconfig powerpc.git/drivers/char/hw_random/Kconfig
62855 --- linux-2.6.24/drivers/char/hw_random/Kconfig 2008-01-24 23:58:37.000000000 +0100
62856 +++ powerpc.git/drivers/char/hw_random/Kconfig  2008-01-28 20:25:59.000000000 +0100
62857 @@ -98,7 +98,7 @@
62858         default HW_RANDOM
62859         ---help---
62860           This driver provides kernel-side support for the Random Number
62861 -         Generator hardware found on PA6T-1682M processor.
62862 +         Generator hardware found on PA Semi PWRficient SoCs.
62863  
62864           To compile this driver as a module, choose M here: the
62865           module will be called pasemi-rng.
62866 diff -x .git -x .gitignore -Nur linux-2.6.24/drivers/char/hw_random/pasemi-rng.c powerpc.git/drivers/char/hw_random/pasemi-rng.c
62867 --- linux-2.6.24/drivers/char/hw_random/pasemi-rng.c    2008-01-24 23:58:37.000000000 +0100
62868 +++ powerpc.git/drivers/char/hw_random/pasemi-rng.c     2008-01-28 20:25:59.000000000 +0100
62869 @@ -126,10 +126,9 @@
62870  }
62871  
62872  static struct of_device_id rng_match[] = {
62873 -       {
62874 -               .compatible      = "1682m-rng",
62875 -       },
62876 -       {},
62877 +       { .compatible      = "1682m-rng", },
62878 +       { .compatible      = "pasemi,pwrficient-rng", },
62879 +       { },
62880  };
62881  
62882  static struct of_platform_driver rng_driver = {
62883 diff -x .git -x .gitignore -Nur linux-2.6.24/drivers/edac/pasemi_edac.c powerpc.git/drivers/edac/pasemi_edac.c
62884 --- linux-2.6.24/drivers/edac/pasemi_edac.c     2008-01-24 23:58:37.000000000 +0100
62885 +++ powerpc.git/drivers/edac/pasemi_edac.c      2008-01-28 20:26:00.000000000 +0100
62886 @@ -225,7 +225,7 @@
62887                 EDAC_FLAG_NONE;
62888         mci->mod_name = MODULE_NAME;
62889         mci->dev_name = pci_name(pdev);
62890 -       mci->ctl_name = "pasemi,1682m-mc";
62891 +       mci->ctl_name = "pasemi,pwrficient-mc";
62892         mci->edac_check = pasemi_edac_check;
62893         mci->ctl_page_to_phys = NULL;
62894         pci_read_config_dword(pdev, MCCFG_SCRUB, &scrub);
62895 @@ -297,4 +297,4 @@
62896  
62897  MODULE_LICENSE("GPL");
62898  MODULE_AUTHOR("Egor Martovetsky <egor@pasemi.com>");
62899 -MODULE_DESCRIPTION("MC support for PA Semi PA6T-1682M memory controller");
62900 +MODULE_DESCRIPTION("MC support for PA Semi PWRficient memory controller");
62901 diff -x .git -x .gitignore -Nur linux-2.6.24/drivers/macintosh/adb.c powerpc.git/drivers/macintosh/adb.c
62902 --- linux-2.6.24/drivers/macintosh/adb.c        2008-01-24 23:58:37.000000000 +0100
62903 +++ powerpc.git/drivers/macintosh/adb.c 2008-01-28 20:26:08.000000000 +0100
62904 @@ -35,6 +35,7 @@
62905  #include <linux/spinlock.h>
62906  #include <linux/completion.h>
62907  #include <linux/device.h>
62908 +#include <linux/kthread.h>
62909  
62910  #include <asm/uaccess.h>
62911  #include <asm/semaphore.h>
62912 @@ -82,21 +83,11 @@
62913  BLOCKING_NOTIFIER_HEAD(adb_client_list);
62914  static int adb_got_sleep;
62915  static int adb_inited;
62916 -static pid_t adb_probe_task_pid;
62917  static DECLARE_MUTEX(adb_probe_mutex);
62918 -static struct completion adb_probe_task_comp;
62919  static int sleepy_trackpad;
62920  static int autopoll_devs;
62921  int __adb_probe_sync;
62922  
62923 -#ifdef CONFIG_PM_SLEEP
62924 -static void adb_notify_sleep(struct pmu_sleep_notifier *self, int when);
62925 -static struct pmu_sleep_notifier adb_sleep_notifier = {
62926 -       adb_notify_sleep,
62927 -       SLEEP_LEVEL_ADB,
62928 -};
62929 -#endif
62930 -
62931  static int adb_scan_bus(void);
62932  static int do_adb_reset_bus(void);
62933  static void adbdev_init(void);
62934 @@ -134,16 +125,6 @@
62935  }
62936  #endif
62937  
62938 -
62939 -static __inline__ void adb_wait_ms(unsigned int ms)
62940 -{
62941 -       if (current->pid && adb_probe_task_pid &&
62942 -         adb_probe_task_pid == current->pid)
62943 -               msleep(ms);
62944 -       else
62945 -               mdelay(ms);
62946 -}
62947 -
62948  static int adb_scan_bus(void)
62949  {
62950         int i, highFree=0, noMovement;
62951 @@ -248,13 +229,10 @@
62952  static int
62953  adb_probe_task(void *x)
62954  {
62955 -       strcpy(current->comm, "kadbprobe");
62956 -
62957         printk(KERN_INFO "adb: starting probe task...\n");
62958         do_adb_reset_bus();
62959         printk(KERN_INFO "adb: finished probe task...\n");
62960  
62961 -       adb_probe_task_pid = 0;
62962         up(&adb_probe_mutex);
62963  
62964         return 0;
62965 @@ -263,7 +241,7 @@
62966  static void
62967  __adb_probe_task(struct work_struct *bullshit)
62968  {
62969 -       adb_probe_task_pid = kernel_thread(adb_probe_task, NULL, SIGCHLD | CLONE_KERNEL);
62970 +       kthread_run(adb_probe_task, NULL, "kadbprobe");
62971  }
62972  
62973  static DECLARE_WORK(adb_reset_work, __adb_probe_task);
62974 @@ -281,6 +259,36 @@
62975         return 0;
62976  }
62977  
62978 +#ifdef CONFIG_PM
62979 +/*
62980 + * notify clients before sleep
62981 + */
62982 +static int adb_suspend(struct platform_device *dev, pm_message_t state)
62983 +{
62984 +       adb_got_sleep = 1;
62985 +       /* We need to get a lock on the probe thread */
62986 +       down(&adb_probe_mutex);
62987 +       /* Stop autopoll */
62988 +       if (adb_controller->autopoll)
62989 +               adb_controller->autopoll(0);
62990 +       blocking_notifier_call_chain(&adb_client_list, ADB_MSG_POWERDOWN, NULL);
62991 +
62992 +       return 0;
62993 +}
62994 +
62995 +/*
62996 + * reset bus after sleep
62997 + */
62998 +static int adb_resume(struct platform_device *dev)
62999 +{
63000 +       adb_got_sleep = 0;
63001 +       up(&adb_probe_mutex);
63002 +       adb_reset_bus();
63003 +
63004 +       return 0;
63005 +}
63006 +#endif /* CONFIG_PM */
63007 +
63008  int __init adb_init(void)
63009  {
63010         struct adb_driver *driver;
63011 @@ -313,15 +321,12 @@
63012                 printk(KERN_WARNING "Warning: no ADB interface detected\n");
63013                 adb_controller = NULL;
63014         } else {
63015 -#ifdef CONFIG_PM_SLEEP
63016 -               pmu_register_sleep_notifier(&adb_sleep_notifier);
63017 -#endif /* CONFIG_PM */
63018  #ifdef CONFIG_PPC
63019                 if (machine_is_compatible("AAPL,PowerBook1998") ||
63020                         machine_is_compatible("PowerBook1,1"))
63021                         sleepy_trackpad = 1;
63022  #endif /* CONFIG_PPC */
63023 -               init_completion(&adb_probe_task_comp);
63024 +
63025                 adbdev_init();
63026                 adb_reset_bus();
63027         }
63028 @@ -330,33 +335,6 @@
63029  
63030  __initcall(adb_init);
63031  
63032 -#ifdef CONFIG_PM
63033 -/*
63034 - * notify clients before sleep and reset bus afterwards
63035 - */
63036 -void
63037 -adb_notify_sleep(struct pmu_sleep_notifier *self, int when)
63038 -{
63039 -       switch (when) {
63040 -       case PBOOK_SLEEP_REQUEST:
63041 -               adb_got_sleep = 1;
63042 -               /* We need to get a lock on the probe thread */
63043 -               down(&adb_probe_mutex);
63044 -               /* Stop autopoll */
63045 -               if (adb_controller->autopoll)
63046 -                       adb_controller->autopoll(0);
63047 -               blocking_notifier_call_chain(&adb_client_list,
63048 -                       ADB_MSG_POWERDOWN, NULL);
63049 -               break;
63050 -       case PBOOK_WAKE:
63051 -               adb_got_sleep = 0;
63052 -               up(&adb_probe_mutex);
63053 -               adb_reset_bus();
63054 -               break;
63055 -       }
63056 -}
63057 -#endif /* CONFIG_PM */
63058 -
63059  static int
63060  do_adb_reset_bus(void)
63061  {
63062 @@ -373,7 +351,7 @@
63063  
63064         if (sleepy_trackpad) {
63065                 /* Let the trackpad settle down */
63066 -               adb_wait_ms(500);
63067 +               msleep(500);
63068         }
63069  
63070         down(&adb_handler_sem);
63071 @@ -389,7 +367,7 @@
63072  
63073         if (sleepy_trackpad) {
63074                 /* Let the trackpad settle down */
63075 -               adb_wait_ms(1500);
63076 +               msleep(1500);
63077         }
63078  
63079         if (!ret) {
63080 @@ -413,41 +391,27 @@
63081         adb_controller->poll();
63082  }
63083  
63084 -static void
63085 -adb_probe_wakeup(struct adb_request *req)
63086 +static void adb_sync_req_done(struct adb_request *req)
63087  {
63088 -       complete(&adb_probe_task_comp);
63089 -}
63090 +       struct completion *comp = req->arg;
63091  
63092 -/* Static request used during probe */
63093 -static struct adb_request adb_sreq;
63094 -static unsigned long adb_sreq_lock; // Use semaphore ! */ 
63095 +       complete(comp);
63096 +}
63097  
63098  int
63099  adb_request(struct adb_request *req, void (*done)(struct adb_request *),
63100             int flags, int nbytes, ...)
63101  {
63102         va_list list;
63103 -       int i, use_sreq;
63104 +       int i;
63105         int rc;
63106 +       struct completion comp;
63107  
63108         if ((adb_controller == NULL) || (adb_controller->send_request == NULL))
63109                 return -ENXIO;
63110         if (nbytes < 1)
63111                 return -EINVAL;
63112 -       if (req == NULL && (flags & ADBREQ_NOSEND))
63113 -               return -EINVAL;
63114 -       
63115 -       if (req == NULL) {
63116 -               if (test_and_set_bit(0,&adb_sreq_lock)) {
63117 -                       printk("adb.c: Warning: contention on static request !\n");
63118 -                       return -EPERM;
63119 -               }
63120 -               req = &adb_sreq;
63121 -               flags |= ADBREQ_SYNC;
63122 -               use_sreq = 1;
63123 -       } else
63124 -               use_sreq = 0;
63125 +
63126         req->nbytes = nbytes+1;
63127         req->done = done;
63128         req->reply_expected = flags & ADBREQ_REPLY;
63129 @@ -460,25 +424,18 @@
63130         if (flags & ADBREQ_NOSEND)
63131                 return 0;
63132  
63133 -       /* Synchronous requests send from the probe thread cause it to
63134 -        * block. Beware that the "done" callback will be overriden !
63135 -        */
63136 -       if ((flags & ADBREQ_SYNC) &&
63137 -           (current->pid && adb_probe_task_pid &&
63138 -           adb_probe_task_pid == current->pid)) {
63139 -               req->done = adb_probe_wakeup;
63140 -               rc = adb_controller->send_request(req, 0);
63141 -               if (rc || req->complete)
63142 -                       goto bail;
63143 -               wait_for_completion(&adb_probe_task_comp);
63144 -               rc = 0;
63145 -               goto bail;
63146 -       }
63147 -
63148 -       rc = adb_controller->send_request(req, flags & ADBREQ_SYNC);
63149 -bail:
63150 -       if (use_sreq)
63151 -               clear_bit(0, &adb_sreq_lock);
63152 +       /* Synchronous requests block using an on-stack completion */
63153 +       if (flags & ADBREQ_SYNC) {
63154 +               WARN_ON(done);
63155 +               req->done = adb_sync_req_done;
63156 +               req->arg = &comp;
63157 +               init_completion(&comp);
63158 +       }
63159 +
63160 +       rc = adb_controller->send_request(req, 0);
63161 +
63162 +       if ((flags & ADBREQ_SYNC) && !rc && !req->complete)
63163 +               wait_for_completion(&comp);
63164  
63165         return rc;
63166  }
63167 @@ -864,7 +821,29 @@
63168         .release        = adb_release,
63169  };
63170  
63171 -static void
63172 +static struct platform_driver adb_pfdrv = {
63173 +       .driver = {
63174 +               .name = "adb",
63175 +       },
63176 +#ifdef CONFIG_PM
63177 +       .suspend = adb_suspend,
63178 +       .resume = adb_resume,
63179 +#endif
63180 +};
63181 +
63182 +static struct platform_device adb_pfdev = {
63183 +       .name = "adb",
63184 +};
63185 +
63186 +static int __init
63187 +adb_dummy_probe(struct platform_device *dev)
63188 +{
63189 +       if (dev == &adb_pfdev)
63190 +               return 0;
63191 +       return -ENODEV;
63192 +}
63193 +
63194 +static void __init
63195  adbdev_init(void)
63196  {
63197         if (register_chrdev(ADB_MAJOR, "adb", &adb_fops)) {
63198 @@ -876,4 +855,7 @@
63199         if (IS_ERR(adb_dev_class))
63200                 return;
63201         class_device_create(adb_dev_class, NULL, MKDEV(ADB_MAJOR, 0), NULL, "adb");
63202 +
63203 +       platform_device_register(&adb_pfdev);
63204 +       platform_driver_probe(&adb_pfdrv, adb_dummy_probe);
63205  }
63206 diff -x .git -x .gitignore -Nur linux-2.6.24/drivers/macintosh/mediabay.c powerpc.git/drivers/macintosh/mediabay.c
63207 --- linux-2.6.24/drivers/macintosh/mediabay.c   2008-01-24 23:58:37.000000000 +0100
63208 +++ powerpc.git/drivers/macintosh/mediabay.c    2008-01-28 20:26:08.000000000 +0100
63209 @@ -20,6 +20,7 @@
63210  #include <linux/stddef.h>
63211  #include <linux/init.h>
63212  #include <linux/ide.h>
63213 +#include <linux/kthread.h>
63214  #include <asm/prom.h>
63215  #include <asm/pgtable.h>
63216  #include <asm/io.h>
63217 @@ -35,7 +36,6 @@
63218  
63219  
63220  #define MB_DEBUG
63221 -#define MB_IGNORE_SIGNALS
63222  
63223  #ifdef MB_DEBUG
63224  #define MBDBG(fmt, arg...)     printk(KERN_INFO fmt , ## arg)
63225 @@ -622,12 +622,7 @@
63226  {
63227         int     i;
63228  
63229 -       strcpy(current->comm, "media-bay");
63230 -#ifdef MB_IGNORE_SIGNALS
63231 -       sigfillset(&current->blocked);
63232 -#endif
63233 -
63234 -       for (;;) {
63235 +       while (!kthread_should_stop()) {
63236                 for (i = 0; i < media_bay_count; ++i) {
63237                         down(&media_bays[i].lock);
63238                         if (!media_bays[i].sleeping)
63239 @@ -636,9 +631,8 @@
63240                 }
63241  
63242                 msleep_interruptible(MB_POLL_DELAY);
63243 -               if (signal_pending(current))
63244 -                       return 0;
63245         }
63246 +       return 0;
63247  }
63248  
63249  static int __devinit media_bay_attach(struct macio_dev *mdev, const struct of_device_id *match)
63250 @@ -699,7 +693,7 @@
63251  
63252         /* Startup kernel thread */
63253         if (i == 0)
63254 -               kernel_thread(media_bay_task, NULL, CLONE_KERNEL);
63255 +               kthread_run(media_bay_task, NULL, "media-bay");
63256  
63257         return 0;
63258  
63259 diff -x .git -x .gitignore -Nur linux-2.6.24/drivers/macintosh/therm_adt746x.c powerpc.git/drivers/macintosh/therm_adt746x.c
63260 --- linux-2.6.24/drivers/macintosh/therm_adt746x.c      2008-01-24 23:58:37.000000000 +0100
63261 +++ powerpc.git/drivers/macintosh/therm_adt746x.c       2008-01-28 20:26:08.000000000 +0100
63262 @@ -553,6 +553,7 @@
63263         struct device_node* np;
63264         const u32 *prop;
63265         int i = 0, offset = 0;
63266 +       int err;
63267         
63268         np = of_find_node_by_name(NULL, "fan");
63269         if (!np)
63270 @@ -612,17 +613,20 @@
63271                 return -ENODEV;
63272         }
63273         
63274 -       device_create_file(&of_dev->dev, &dev_attr_sensor1_temperature);
63275 -       device_create_file(&of_dev->dev, &dev_attr_sensor2_temperature);
63276 -       device_create_file(&of_dev->dev, &dev_attr_sensor1_limit);
63277 -       device_create_file(&of_dev->dev, &dev_attr_sensor2_limit);
63278 -       device_create_file(&of_dev->dev, &dev_attr_sensor1_location);
63279 -       device_create_file(&of_dev->dev, &dev_attr_sensor2_location);
63280 -       device_create_file(&of_dev->dev, &dev_attr_limit_adjust);
63281 -       device_create_file(&of_dev->dev, &dev_attr_specified_fan_speed);
63282 -       device_create_file(&of_dev->dev, &dev_attr_sensor1_fan_speed);
63283 +       err = device_create_file(&of_dev->dev, &dev_attr_sensor1_temperature);
63284 +       err |= device_create_file(&of_dev->dev, &dev_attr_sensor2_temperature);
63285 +       err |= device_create_file(&of_dev->dev, &dev_attr_sensor1_limit);
63286 +       err |= device_create_file(&of_dev->dev, &dev_attr_sensor2_limit);
63287 +       err |= device_create_file(&of_dev->dev, &dev_attr_sensor1_location);
63288 +       err |= device_create_file(&of_dev->dev, &dev_attr_sensor2_location);
63289 +       err |= device_create_file(&of_dev->dev, &dev_attr_limit_adjust);
63290 +       err |= device_create_file(&of_dev->dev, &dev_attr_specified_fan_speed);
63291 +       err |= device_create_file(&of_dev->dev, &dev_attr_sensor1_fan_speed);
63292         if(therm_type == ADT7460)
63293 -               device_create_file(&of_dev->dev, &dev_attr_sensor2_fan_speed);
63294 +               err |= device_create_file(&of_dev->dev, &dev_attr_sensor2_fan_speed);
63295 +       if (err)
63296 +               printk(KERN_WARNING
63297 +                       "Failed to create tempertaure attribute file(s).\n");
63298  
63299  #ifndef CONFIG_I2C_POWERMAC
63300         request_module("i2c-powermac");
63301 diff -x .git -x .gitignore -Nur linux-2.6.24/drivers/macintosh/therm_pm72.c powerpc.git/drivers/macintosh/therm_pm72.c
63302 --- linux-2.6.24/drivers/macintosh/therm_pm72.c 2008-01-24 23:58:37.000000000 +0100
63303 +++ powerpc.git/drivers/macintosh/therm_pm72.c  2008-01-28 20:26:08.000000000 +0100
63304 @@ -121,6 +121,7 @@
63305  #include <linux/reboot.h>
63306  #include <linux/kmod.h>
63307  #include <linux/i2c.h>
63308 +#include <linux/kthread.h>
63309  #include <asm/prom.h>
63310  #include <asm/machdep.h>
63311  #include <asm/io.h>
63312 @@ -161,7 +162,7 @@
63313  static int                             state;
63314  static int                             cpu_count;
63315  static int                             cpu_pid_type;
63316 -static pid_t                           ctrl_task;
63317 +static struct task_struct              *ctrl_task;
63318  static struct completion               ctrl_complete;
63319  static int                             critical_state;
63320  static int                             rackmac;
63321 @@ -1156,6 +1157,8 @@
63322   */
63323  static int init_cpu_state(struct cpu_pid_state *state, int index)
63324  {
63325 +       int err;
63326 +
63327         state->index = index;
63328         state->first = 1;
63329         state->rpm = (cpu_pid_type == CPU_PID_TYPE_RACKMAC) ? 4000 : 1000;
63330 @@ -1181,18 +1184,21 @@
63331         DBG("CPU %d Using %d power history entries\n", index, state->count_power);
63332  
63333         if (index == 0) {
63334 -               device_create_file(&of_dev->dev, &dev_attr_cpu0_temperature);
63335 -               device_create_file(&of_dev->dev, &dev_attr_cpu0_voltage);
63336 -               device_create_file(&of_dev->dev, &dev_attr_cpu0_current);
63337 -               device_create_file(&of_dev->dev, &dev_attr_cpu0_exhaust_fan_rpm);
63338 -               device_create_file(&of_dev->dev, &dev_attr_cpu0_intake_fan_rpm);
63339 +               err = device_create_file(&of_dev->dev, &dev_attr_cpu0_temperature);
63340 +               err |= device_create_file(&of_dev->dev, &dev_attr_cpu0_voltage);
63341 +               err |= device_create_file(&of_dev->dev, &dev_attr_cpu0_current);
63342 +               err |= device_create_file(&of_dev->dev, &dev_attr_cpu0_exhaust_fan_rpm);
63343 +               err |= device_create_file(&of_dev->dev, &dev_attr_cpu0_intake_fan_rpm);
63344         } else {
63345 -               device_create_file(&of_dev->dev, &dev_attr_cpu1_temperature);
63346 -               device_create_file(&of_dev->dev, &dev_attr_cpu1_voltage);
63347 -               device_create_file(&of_dev->dev, &dev_attr_cpu1_current);
63348 -               device_create_file(&of_dev->dev, &dev_attr_cpu1_exhaust_fan_rpm);
63349 -               device_create_file(&of_dev->dev, &dev_attr_cpu1_intake_fan_rpm);
63350 -       }
63351 +               err = device_create_file(&of_dev->dev, &dev_attr_cpu1_temperature);
63352 +               err |= device_create_file(&of_dev->dev, &dev_attr_cpu1_voltage);
63353 +               err |= device_create_file(&of_dev->dev, &dev_attr_cpu1_current);
63354 +               err |= device_create_file(&of_dev->dev, &dev_attr_cpu1_exhaust_fan_rpm);
63355 +               err |= device_create_file(&of_dev->dev, &dev_attr_cpu1_intake_fan_rpm);
63356 +       }
63357 +       if (err)
63358 +               printk(KERN_WARNING "Failed to create some of the atribute"
63359 +                       "files for CPU %d\n", index);
63360  
63361         return 0;
63362   fail:
63363 @@ -1328,6 +1334,7 @@
63364  {
63365         struct device_node *u3;
63366         int u3h = 1; /* conservative by default */
63367 +       int err;
63368  
63369         /*
63370          * There are different PID params for machines with U3 and machines
63371 @@ -1379,8 +1386,11 @@
63372         if (state->monitor == NULL)
63373                 return -ENODEV;
63374  
63375 -       device_create_file(&of_dev->dev, &dev_attr_backside_temperature);
63376 -       device_create_file(&of_dev->dev, &dev_attr_backside_fan_pwm);
63377 +       err = device_create_file(&of_dev->dev, &dev_attr_backside_temperature);
63378 +       err |= device_create_file(&of_dev->dev, &dev_attr_backside_fan_pwm);
63379 +       if (err)
63380 +               printk(KERN_WARNING "Failed to create attribute file(s)"
63381 +                       " for backside fan\n");
63382  
63383         return 0;
63384  }
63385 @@ -1491,6 +1501,8 @@
63386   */
63387  static int init_drives_state(struct drives_pid_state *state)
63388  {
63389 +       int err;
63390 +
63391         state->ticks = 1;
63392         state->first = 1;
63393         state->rpm = 1000;
63394 @@ -1499,8 +1511,11 @@
63395         if (state->monitor == NULL)
63396                 return -ENODEV;
63397  
63398 -       device_create_file(&of_dev->dev, &dev_attr_drives_temperature);
63399 -       device_create_file(&of_dev->dev, &dev_attr_drives_fan_rpm);
63400 +       err = device_create_file(&of_dev->dev, &dev_attr_drives_temperature);
63401 +       err |= device_create_file(&of_dev->dev, &dev_attr_drives_fan_rpm);
63402 +       if (err)
63403 +               printk(KERN_WARNING "Failed to create attribute file(s)"
63404 +                       " for drives bay fan\n");
63405  
63406         return 0;
63407  }
63408 @@ -1621,7 +1636,9 @@
63409         if (state->monitor == NULL)
63410                 return -ENODEV;
63411  
63412 -               device_create_file(&of_dev->dev, &dev_attr_dimms_temperature);
63413 +       if (device_create_file(&of_dev->dev, &dev_attr_dimms_temperature))
63414 +               printk(KERN_WARNING "Failed to create attribute file"
63415 +                       " for DIMM temperature\n");
63416  
63417         return 0;
63418  }
63419 @@ -1731,6 +1748,8 @@
63420   */
63421  static int init_slots_state(struct slots_pid_state *state)
63422  {
63423 +       int err;
63424 +
63425         state->ticks = 1;
63426         state->first = 1;
63427         state->pwm = 50;
63428 @@ -1739,8 +1758,11 @@
63429         if (state->monitor == NULL)
63430                 return -ENODEV;
63431  
63432 -       device_create_file(&of_dev->dev, &dev_attr_slots_temperature);
63433 -       device_create_file(&of_dev->dev, &dev_attr_slots_fan_pwm);
63434 +       err = device_create_file(&of_dev->dev, &dev_attr_slots_temperature);
63435 +       err |= device_create_file(&of_dev->dev, &dev_attr_slots_fan_pwm);
63436 +       if (err)
63437 +               printk(KERN_WARNING "Failed to create attribute file(s)"
63438 +                       " for slots bay fan\n");
63439  
63440         return 0;
63441  }
63442 @@ -1779,8 +1801,6 @@
63443   */
63444  static int main_control_loop(void *x)
63445  {
63446 -       daemonize("kfand");
63447 -
63448         DBG("main_control_loop started\n");
63449  
63450         down(&driver_lock);
63451 @@ -1956,7 +1976,7 @@
63452  {
63453         init_completion(&ctrl_complete);
63454  
63455 -       ctrl_task = kernel_thread(main_control_loop, NULL, SIGCHLD | CLONE_KERNEL);
63456 +       ctrl_task = kthread_run(main_control_loop, NULL, "kfand");
63457  }
63458  
63459  /*
63460 @@ -1964,7 +1984,7 @@
63461   */
63462  static void stop_control_loops(void)
63463  {
63464 -       if (ctrl_task != 0)
63465 +       if (ctrl_task)
63466                 wait_for_completion(&ctrl_complete);
63467  }
63468  
63469 diff -x .git -x .gitignore -Nur linux-2.6.24/drivers/macintosh/therm_windtunnel.c powerpc.git/drivers/macintosh/therm_windtunnel.c
63470 --- linux-2.6.24/drivers/macintosh/therm_windtunnel.c   2008-01-24 23:58:37.000000000 +0100
63471 +++ powerpc.git/drivers/macintosh/therm_windtunnel.c    2008-01-28 20:26:08.000000000 +0100
63472 @@ -36,6 +36,7 @@
63473  #include <linux/i2c.h>
63474  #include <linux/slab.h>
63475  #include <linux/init.h>
63476 +#include <linux/kthread.h>
63477  
63478  #include <asm/prom.h>
63479  #include <asm/machdep.h>
63480 @@ -61,8 +62,7 @@
63481  
63482  static struct {
63483         volatile int            running;
63484 -       struct completion       completion;
63485 -       pid_t                   poll_task;
63486 +       struct task_struct      *poll_task;
63487         
63488         struct semaphore        lock;
63489         struct of_device        *of_dev;
63490 @@ -223,6 +223,7 @@
63491  setup_hardware( void )
63492  {
63493         int val;
63494 +       int err;
63495  
63496         /* save registers (if we unload the module) */
63497         x.r0 = read_reg( x.fan, 0x00, 1 );
63498 @@ -265,8 +266,11 @@
63499         x.upind = -1;
63500         /* tune_fan( fan_up_table[x.upind].fan_setting ); */
63501  
63502 -       device_create_file( &x.of_dev->dev, &dev_attr_cpu_temperature );
63503 -       device_create_file( &x.of_dev->dev, &dev_attr_case_temperature );
63504 +       err = device_create_file( &x.of_dev->dev, &dev_attr_cpu_temperature );
63505 +       err |= device_create_file( &x.of_dev->dev, &dev_attr_case_temperature );
63506 +       if (err)
63507 +               printk(KERN_WARNING
63508 +                       "Failed to create temperature attribute file(s).\n");
63509  }
63510  
63511  static void
63512 @@ -282,27 +286,27 @@
63513         write_reg( x.fan, 0x00, x.r0, 1 );
63514  }
63515  
63516 -static int
63517 -control_loop( void *dummy )
63518 +static int control_loop(void *dummy)
63519  {
63520 -       daemonize("g4fand");
63521 -
63522 -       down( &x.lock );
63523 +       down(&x.lock);
63524         setup_hardware();
63525 +       up(&x.lock);
63526  
63527 -       while( x.running ) {
63528 -               up( &x.lock );
63529 -
63530 +       for (;;) {
63531                 msleep_interruptible(8000);
63532 -               
63533 -               down( &x.lock );
63534 +               if (kthread_should_stop())
63535 +                       break;
63536 +
63537 +               down(&x.lock);
63538                 poll_temp();
63539 +               up(&x.lock);
63540         }
63541  
63542 +       down(&x.lock);
63543         restore_regs();
63544 -       up( &x.lock );
63545 +       up(&x.lock);
63546  
63547 -       complete_and_exit( &x.completion, 0 );
63548 +       return 0;
63549  }
63550  
63551  
63552 @@ -322,8 +326,7 @@
63553                 ret = i2c_probe( adapter, &addr_data, &do_probe );
63554                 if( x.thermostat && x.fan ) {
63555                         x.running = 1;
63556 -                       init_completion( &x.completion );
63557 -                       x.poll_task = kernel_thread( control_loop, NULL, SIGCHLD | CLONE_KERNEL );
63558 +                       x.poll_task = kthread_run(control_loop, NULL, "g4fand");
63559                 }
63560         }
63561         return ret;
63562 @@ -339,7 +342,8 @@
63563         else {
63564                 if( x.running ) {
63565                         x.running = 0;
63566 -                       wait_for_completion( &x.completion );
63567 +                       kthread_stop(x.poll_task);
63568 +                       x.poll_task = NULL;
63569                 }
63570                 if( client == x.thermostat )
63571                         x.thermostat = NULL;
63572 diff -x .git -x .gitignore -Nur linux-2.6.24/drivers/macintosh/via-pmu-backlight.c powerpc.git/drivers/macintosh/via-pmu-backlight.c
63573 --- linux-2.6.24/drivers/macintosh/via-pmu-backlight.c  2008-01-24 23:58:37.000000000 +0100
63574 +++ powerpc.git/drivers/macintosh/via-pmu-backlight.c   2008-01-28 20:26:08.000000000 +0100
63575 @@ -22,7 +22,7 @@
63576  
63577  static void pmu_backlight_init_curve(u8 off, u8 min, u8 max)
63578  {
63579 -       unsigned int i, flat, count, range = (max - min);
63580 +       int i, flat, count, range = (max - min);
63581  
63582         bl_curve[0] = off;
63583  
63584 @@ -68,17 +68,11 @@
63585         return pmulevel;
63586  }
63587  
63588 -static int pmu_backlight_update_status(struct backlight_device *bd)
63589 +static int __pmu_backlight_update_status(struct backlight_device *bd)
63590  {
63591         struct adb_request req;
63592 -       unsigned long flags;
63593         int level = bd->props.brightness;
63594  
63595 -       spin_lock_irqsave(&pmu_backlight_lock, flags);
63596 -
63597 -       /* Don't update brightness when sleeping */
63598 -       if (sleeping)
63599 -               goto out;
63600  
63601         if (bd->props.power != FB_BLANK_UNBLANK ||
63602             bd->props.fb_blank != FB_BLANK_UNBLANK)
63603 @@ -99,12 +93,23 @@
63604                 pmu_wait_complete(&req);
63605         }
63606  
63607 -out:
63608 -       spin_unlock_irqrestore(&pmu_backlight_lock, flags);
63609 -
63610         return 0;
63611  }
63612  
63613 +static int pmu_backlight_update_status(struct backlight_device *bd)
63614 +{
63615 +       unsigned long flags;
63616 +       int rc = 0;
63617 +
63618 +       spin_lock_irqsave(&pmu_backlight_lock, flags);
63619 +       /* Don't update brightness when sleeping */
63620 +       if (!sleeping)
63621 +               rc = __pmu_backlight_update_status(bd);
63622 +       spin_unlock_irqrestore(&pmu_backlight_lock, flags);
63623 +       return rc;
63624 +}
63625 +
63626 +
63627  static int pmu_backlight_get_brightness(struct backlight_device *bd)
63628  {
63629         return bd->props.brightness;
63630 @@ -123,6 +128,16 @@
63631  
63632         spin_lock_irqsave(&pmu_backlight_lock, flags);
63633         sleeping = sleep;
63634 +       if (pmac_backlight) {
63635 +               if (sleep) {
63636 +                       struct adb_request req;
63637 +
63638 +                       pmu_request(&req, NULL, 2, PMU_POWER_CTRL,
63639 +                                   PMU_POW_BACKLIGHT | PMU_POW_OFF);
63640 +                       pmu_wait_complete(&req);
63641 +               } else
63642 +                       __pmu_backlight_update_status(pmac_backlight);
63643 +       }
63644         spin_unlock_irqrestore(&pmu_backlight_lock, flags);
63645  }
63646  #endif /* CONFIG_PM */
63647 @@ -148,8 +163,8 @@
63648  
63649         bd = backlight_device_register(name, NULL, NULL, &pmu_backlight_data);
63650         if (IS_ERR(bd)) {
63651 -               printk("pmubl: Backlight registration failed\n");
63652 -               goto error;
63653 +               printk(KERN_ERR "PMU Backlight registration failed\n");
63654 +               return;
63655         }
63656         bd->props.max_brightness = FB_BACKLIGHT_LEVELS - 1;
63657         pmu_backlight_init_curve(0x7F, 0x46, 0x0E);
63658 @@ -171,10 +186,5 @@
63659         bd->props.power = FB_BLANK_UNBLANK;
63660         backlight_update_status(bd);
63661  
63662 -       printk("pmubl: Backlight initialized (%s)\n", name);
63663 -
63664 -       return;
63665 -
63666 -error:
63667 -       return;
63668 +       printk(KERN_INFO "PMU Backlight initialized (%s)\n", name);
63669  }
63670 diff -x .git -x .gitignore -Nur linux-2.6.24/drivers/macintosh/via-pmu.c powerpc.git/drivers/macintosh/via-pmu.c
63671 --- linux-2.6.24/drivers/macintosh/via-pmu.c    2008-01-24 23:58:37.000000000 +0100
63672 +++ powerpc.git/drivers/macintosh/via-pmu.c     2008-01-28 20:26:08.000000000 +0100
63673 @@ -10,13 +10,11 @@
63674   *
63675   * Copyright (C) 1998 Paul Mackerras and Fabio Riccardi.
63676   * Copyright (C) 2001-2002 Benjamin Herrenschmidt
63677 + * Copyright (C) 2006-2007 Johannes Berg
63678   *
63679   * THIS DRIVER IS BECOMING A TOTAL MESS !
63680   *  - Cleanup atomically disabling reply to PMU events after
63681   *    a sleep or a freq. switch
63682 - *  - Move sleep code out of here to pmac_pm, merge into new
63683 - *    common PM infrastructure
63684 - *  - Save/Restore PCI space properly
63685   *
63686   */
63687  #include <stdarg.h>
63688 @@ -33,7 +31,6 @@
63689  #include <linux/adb.h>
63690  #include <linux/pmu.h>
63691  #include <linux/cuda.h>
63692 -#include <linux/smp_lock.h>
63693  #include <linux/module.h>
63694  #include <linux/spinlock.h>
63695  #include <linux/pm.h>
63696 @@ -65,9 +62,7 @@
63697  #include "via-pmu-event.h"
63698  
63699  /* Some compile options */
63700 -#undef SUSPEND_USES_PMU
63701 -#define DEBUG_SLEEP
63702 -#undef HACKED_PCI_SAVE
63703 +#undef DEBUG_SLEEP
63704  
63705  /* Misc minor number allocated for /dev/pmu */
63706  #define PMU_MINOR              154
63707 @@ -152,12 +147,9 @@
63708  static u8 pmu_intr_mask;
63709  static int pmu_version;
63710  static int drop_interrupts;
63711 -#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32)
63712 +#if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC32)
63713  static int option_lid_wakeup = 1;
63714 -#endif /* CONFIG_PM_SLEEP && CONFIG_PPC32 */
63715 -#if (defined(CONFIG_PM_SLEEP)&&defined(CONFIG_PPC32))||defined(CONFIG_PMAC_BACKLIGHT_LEGACY)
63716 -static int sleep_in_progress;
63717 -#endif
63718 +#endif /* CONFIG_SUSPEND && CONFIG_PPC32 */
63719  static unsigned long async_req_locks;
63720  static unsigned int pmu_irq_stats[11];
63721  
63722 @@ -177,7 +169,6 @@
63723  
63724  int __fake_sleep;
63725  int asleep;
63726 -BLOCKING_NOTIFIER_HEAD(sleep_notifier_list);
63727  
63728  #ifdef CONFIG_ADB
63729  static int adb_dev_map;
63730 @@ -224,7 +215,7 @@
63731  
63732  #ifdef DEBUG_SLEEP
63733  int pmu_polled_request(struct adb_request *req);
63734 -int pmu_wink(struct adb_request *req);
63735 +void pmu_blink(int n);
63736  #endif
63737  
63738  /*
63739 @@ -875,7 +866,7 @@
63740  {
63741         char *p = page;
63742  
63743 -#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32)
63744 +#if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC32)
63745         if (pmu_kind == PMU_KEYLARGO_BASED &&
63746             pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,-1) >= 0)
63747                 p += sprintf(p, "lid_wakeup=%d\n", option_lid_wakeup);
63748 @@ -916,7 +907,7 @@
63749         *(val++) = 0;
63750         while(*val == ' ')
63751                 val++;
63752 -#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32)
63753 +#if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC32)
63754         if (pmu_kind == PMU_KEYLARGO_BASED &&
63755             pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,-1) >= 0)
63756                 if (!strcmp(label, "lid_wakeup"))
63757 @@ -1256,9 +1247,7 @@
63758  pmu_suspend(void)
63759  {
63760         unsigned long flags;
63761 -#ifdef SUSPEND_USES_PMU
63762 -       struct adb_request *req;
63763 -#endif
63764 +
63765         if (!via)
63766                 return;
63767         
63768 @@ -1276,17 +1265,10 @@
63769                 via_pmu_interrupt(0, NULL);
63770                 spin_lock_irqsave(&pmu_lock, flags);
63771                 if (!adb_int_pending && pmu_state == idle && !req_awaiting_reply) {
63772 -#ifdef SUSPEND_USES_PMU
63773 -                       pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, 0);
63774 -                       spin_unlock_irqrestore(&pmu_lock, flags);
63775 -                       while(!req.complete)
63776 -                               pmu_poll();
63777 -#else /* SUSPEND_USES_PMU */
63778                         if (gpio_irq >= 0)
63779                                 disable_irq_nosync(gpio_irq);
63780                         out_8(&via[IER], CB1_INT | IER_CLR);
63781                         spin_unlock_irqrestore(&pmu_lock, flags);
63782 -#endif /* SUSPEND_USES_PMU */
63783                         break;
63784                 }
63785         } while (1);
63786 @@ -1307,18 +1289,11 @@
63787                 return;
63788         }
63789         adb_int_pending = 1;
63790 -#ifdef SUSPEND_USES_PMU
63791 -       pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, pmu_intr_mask);
63792 -       spin_unlock_irqrestore(&pmu_lock, flags);
63793 -       while(!req.complete)
63794 -               pmu_poll();
63795 -#else /* SUSPEND_USES_PMU */
63796         if (gpio_irq >= 0)
63797                 enable_irq(gpio_irq);
63798         out_8(&via[IER], CB1_INT | IER_SET);
63799         spin_unlock_irqrestore(&pmu_lock, flags);
63800         pmu_poll();
63801 -#endif /* SUSPEND_USES_PMU */
63802  }
63803  
63804  /* Interrupt data could be the result data from an ADB cmd */
63805 @@ -1738,228 +1713,7 @@
63806         return via != 0;
63807  }
63808  
63809 -#ifdef CONFIG_PM_SLEEP
63810 -
63811 -static LIST_HEAD(sleep_notifiers);
63812 -
63813 -int
63814 -pmu_register_sleep_notifier(struct pmu_sleep_notifier *n)
63815 -{
63816 -       struct list_head *list;
63817 -       struct pmu_sleep_notifier *notifier;
63818 -
63819 -       for (list = sleep_notifiers.next; list != &sleep_notifiers;
63820 -            list = list->next) {
63821 -               notifier = list_entry(list, struct pmu_sleep_notifier, list);
63822 -               if (n->priority > notifier->priority)
63823 -                       break;
63824 -       }
63825 -       __list_add(&n->list, list->prev, list);
63826 -       return 0;
63827 -}
63828 -EXPORT_SYMBOL(pmu_register_sleep_notifier);
63829 -
63830 -int
63831 -pmu_unregister_sleep_notifier(struct pmu_sleep_notifier* n)
63832 -{
63833 -       if (n->list.next == 0)
63834 -               return -ENOENT;
63835 -       list_del(&n->list);
63836 -       n->list.next = NULL;
63837 -       return 0;
63838 -}
63839 -EXPORT_SYMBOL(pmu_unregister_sleep_notifier);
63840 -#endif /* CONFIG_PM_SLEEP */
63841 -
63842 -#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32)
63843 -
63844 -/* Sleep is broadcast last-to-first */
63845 -static void broadcast_sleep(int when)
63846 -{
63847 -       struct list_head *list;
63848 -       struct pmu_sleep_notifier *notifier;
63849 -
63850 -       for (list = sleep_notifiers.prev; list != &sleep_notifiers;
63851 -            list = list->prev) {
63852 -               notifier = list_entry(list, struct pmu_sleep_notifier, list);
63853 -               notifier->notifier_call(notifier, when);
63854 -       }
63855 -}
63856 -
63857 -/* Wake is broadcast first-to-last */
63858 -static void broadcast_wake(void)
63859 -{
63860 -       struct list_head *list;
63861 -       struct pmu_sleep_notifier *notifier;
63862 -
63863 -       for (list = sleep_notifiers.next; list != &sleep_notifiers;
63864 -            list = list->next) {
63865 -               notifier = list_entry(list, struct pmu_sleep_notifier, list);
63866 -               notifier->notifier_call(notifier, PBOOK_WAKE);
63867 -       }
63868 -}
63869 -
63870 -/*
63871 - * This struct is used to store config register values for
63872 - * PCI devices which may get powered off when we sleep.
63873 - */
63874 -static struct pci_save {
63875 -#ifndef HACKED_PCI_SAVE
63876 -       u16     command;
63877 -       u16     cache_lat;
63878 -       u16     intr;
63879 -       u32     rom_address;
63880 -#else
63881 -       u32     config[16];
63882 -#endif 
63883 -} *pbook_pci_saves;
63884 -static int pbook_npci_saves;
63885 -
63886 -static void
63887 -pbook_alloc_pci_save(void)
63888 -{
63889 -       int npci;
63890 -       struct pci_dev *pd = NULL;
63891 -
63892 -       npci = 0;
63893 -       while ((pd = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) {
63894 -               ++npci;
63895 -       }
63896 -       if (npci == 0)
63897 -               return;
63898 -       pbook_pci_saves = (struct pci_save *)
63899 -               kmalloc(npci * sizeof(struct pci_save), GFP_KERNEL);
63900 -       pbook_npci_saves = npci;
63901 -}
63902 -
63903 -static void
63904 -pbook_free_pci_save(void)
63905 -{
63906 -       if (pbook_pci_saves == NULL)
63907 -               return;
63908 -       kfree(pbook_pci_saves);
63909 -       pbook_pci_saves = NULL;
63910 -       pbook_npci_saves = 0;
63911 -}
63912 -
63913 -static void
63914 -pbook_pci_save(void)
63915 -{
63916 -       struct pci_save *ps = pbook_pci_saves;
63917 -       struct pci_dev *pd = NULL;
63918 -       int npci = pbook_npci_saves;
63919 -       
63920 -       if (ps == NULL)
63921 -               return;
63922 -
63923 -       while ((pd = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) {
63924 -               if (npci-- == 0) {
63925 -                       pci_dev_put(pd);
63926 -                       return;
63927 -               }
63928 -#ifndef HACKED_PCI_SAVE
63929 -               pci_read_config_word(pd, PCI_COMMAND, &ps->command);
63930 -               pci_read_config_word(pd, PCI_CACHE_LINE_SIZE, &ps->cache_lat);
63931 -               pci_read_config_word(pd, PCI_INTERRUPT_LINE, &ps->intr);
63932 -               pci_read_config_dword(pd, PCI_ROM_ADDRESS, &ps->rom_address);
63933 -#else
63934 -               int i;
63935 -               for (i=1;i<16;i++)
63936 -                       pci_read_config_dword(pd, i<<4, &ps->config[i]);
63937 -#endif
63938 -               ++ps;
63939 -       }
63940 -}
63941 -
63942 -/* For this to work, we must take care of a few things: If gmac was enabled
63943 - * during boot, it will be in the pci dev list. If it's disabled at this point
63944 - * (and it will probably be), then you can't access it's config space.
63945 - */
63946 -static void
63947 -pbook_pci_restore(void)
63948 -{
63949 -       u16 cmd;
63950 -       struct pci_save *ps = pbook_pci_saves - 1;
63951 -       struct pci_dev *pd = NULL;
63952 -       int npci = pbook_npci_saves;
63953 -       int j;
63954 -
63955 -       while ((pd = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) {
63956 -#ifdef HACKED_PCI_SAVE
63957 -               int i;
63958 -               if (npci-- == 0) {
63959 -                       pci_dev_put(pd);
63960 -                       return;
63961 -               }
63962 -               ps++;
63963 -               for (i=2;i<16;i++)
63964 -                       pci_write_config_dword(pd, i<<4, ps->config[i]);
63965 -               pci_write_config_dword(pd, 4, ps->config[1]);
63966 -#else
63967 -               if (npci-- == 0)
63968 -                       return;
63969 -               ps++;
63970 -               if (ps->command == 0)
63971 -                       continue;
63972 -               pci_read_config_word(pd, PCI_COMMAND, &cmd);
63973 -               if ((ps->command & ~cmd) == 0)
63974 -                       continue;
63975 -               switch (pd->hdr_type) {
63976 -               case PCI_HEADER_TYPE_NORMAL:
63977 -                       for (j = 0; j < 6; ++j)
63978 -                               pci_write_config_dword(pd,
63979 -                                       PCI_BASE_ADDRESS_0 + j*4,
63980 -                                       pd->resource[j].start);
63981 -                       pci_write_config_dword(pd, PCI_ROM_ADDRESS,
63982 -                               ps->rom_address);
63983 -                       pci_write_config_word(pd, PCI_CACHE_LINE_SIZE,
63984 -                               ps->cache_lat);
63985 -                       pci_write_config_word(pd, PCI_INTERRUPT_LINE,
63986 -                               ps->intr);
63987 -                       pci_write_config_word(pd, PCI_COMMAND, ps->command);
63988 -                       break;
63989 -               }
63990 -#endif 
63991 -       }
63992 -}
63993 -
63994 -#ifdef DEBUG_SLEEP
63995 -/* N.B. This doesn't work on the 3400 */
63996 -void 
63997 -pmu_blink(int n)
63998 -{
63999 -       struct adb_request req;
64000 -
64001 -       memset(&req, 0, sizeof(req));
64002 -
64003 -       for (; n > 0; --n) {
64004 -               req.nbytes = 4;
64005 -               req.done = NULL;
64006 -               req.data[0] = 0xee;
64007 -               req.data[1] = 4;
64008 -               req.data[2] = 0;
64009 -               req.data[3] = 1;
64010 -               req.reply[0] = ADB_RET_OK;
64011 -               req.reply_len = 1;
64012 -               req.reply_expected = 0;
64013 -               pmu_polled_request(&req);
64014 -               mdelay(50);
64015 -               req.nbytes = 4;
64016 -               req.done = NULL;
64017 -               req.data[0] = 0xee;
64018 -               req.data[1] = 4;
64019 -               req.data[2] = 0;
64020 -               req.data[3] = 0;
64021 -               req.reply[0] = ADB_RET_OK;
64022 -               req.reply_len = 1;
64023 -               req.reply_expected = 0;
64024 -               pmu_polled_request(&req);
64025 -               mdelay(50);
64026 -       }
64027 -       mdelay(50);
64028 -}
64029 -#endif
64030 -
64031 +#if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC32)
64032  /*
64033   * Put the powerbook to sleep.
64034   */
64035 @@ -1994,134 +1748,6 @@
64036         out_8(&via[IER], IER_SET | SR_INT | CB1_INT);
64037  }
64038  
64039 -extern void pmu_backlight_set_sleep(int sleep);
64040 -
64041 -static int
64042 -pmac_suspend_devices(void)
64043 -{
64044 -       int ret;
64045 -
64046 -       pm_prepare_console();
64047 -       
64048 -       /* Notify old-style device drivers */
64049 -       broadcast_sleep(PBOOK_SLEEP_REQUEST);
64050 -
64051 -       /* Sync the disks. */
64052 -       /* XXX It would be nice to have some way to ensure that
64053 -        * nobody is dirtying any new buffers while we wait. That
64054 -        * could be achieved using the refrigerator for processes
64055 -        * that swsusp uses
64056 -        */
64057 -       sys_sync();
64058 -
64059 -       broadcast_sleep(PBOOK_SLEEP_NOW);
64060 -
64061 -       /* Send suspend call to devices, hold the device core's dpm_sem */
64062 -       ret = device_suspend(PMSG_SUSPEND);
64063 -       if (ret) {
64064 -               broadcast_wake();
64065 -               printk(KERN_ERR "Driver sleep failed\n");
64066 -               return -EBUSY;
64067 -       }
64068 -
64069 -#ifdef CONFIG_PMAC_BACKLIGHT
64070 -       /* Tell backlight code not to muck around with the chip anymore */
64071 -       pmu_backlight_set_sleep(1);
64072 -#endif
64073 -
64074 -       /* Call platform functions marked "on sleep" */
64075 -       pmac_pfunc_i2c_suspend();
64076 -       pmac_pfunc_base_suspend();
64077 -
64078 -       /* Stop preemption */
64079 -       preempt_disable();
64080 -
64081 -       /* Make sure the decrementer won't interrupt us */
64082 -       asm volatile("mtdec %0" : : "r" (0x7fffffff));
64083 -       /* Make sure any pending DEC interrupt occurring while we did
64084 -        * the above didn't re-enable the DEC */
64085 -       mb();
64086 -       asm volatile("mtdec %0" : : "r" (0x7fffffff));
64087 -
64088 -       /* We can now disable MSR_EE. This code of course works properly only
64089 -        * on UP machines... For SMP, if we ever implement sleep, we'll have to
64090 -        * stop the "other" CPUs way before we do all that stuff.
64091 -        */
64092 -       local_irq_disable();
64093 -
64094 -       /* Broadcast power down irq
64095 -        * This isn't that useful in most cases (only directly wired devices can
64096 -        * use this but still... This will take care of sysdev's as well, so
64097 -        * we exit from here with local irqs disabled and PIC off.
64098 -        */
64099 -       ret = device_power_down(PMSG_SUSPEND);
64100 -       if (ret) {
64101 -               wakeup_decrementer();
64102 -               local_irq_enable();
64103 -               preempt_enable();
64104 -               device_resume();
64105 -               broadcast_wake();
64106 -               printk(KERN_ERR "Driver powerdown failed\n");
64107 -               return -EBUSY;
64108 -       }
64109 -
64110 -       /* Wait for completion of async requests */
64111 -       while (!batt_req.complete)
64112 -               pmu_poll();
64113 -
64114 -       /* Giveup the lazy FPU & vec so we don't have to back them
64115 -        * up from the low level code
64116 -        */
64117 -       enable_kernel_fp();
64118 -
64119 -#ifdef CONFIG_ALTIVEC
64120 -       if (cpu_has_feature(CPU_FTR_ALTIVEC))
64121 -               enable_kernel_altivec();
64122 -#endif /* CONFIG_ALTIVEC */
64123 -
64124 -       return 0;
64125 -}
64126 -
64127 -static int
64128 -pmac_wakeup_devices(void)
64129 -{
64130 -       mdelay(100);
64131 -
64132 -#ifdef CONFIG_PMAC_BACKLIGHT
64133 -       /* Tell backlight code it can use the chip again */
64134 -       pmu_backlight_set_sleep(0);
64135 -#endif
64136 -
64137 -       /* Power back up system devices (including the PIC) */
64138 -       device_power_up();
64139 -
64140 -       /* Force a poll of ADB interrupts */
64141 -       adb_int_pending = 1;
64142 -       via_pmu_interrupt(0, NULL);
64143 -
64144 -       /* Restart jiffies & scheduling */
64145 -       wakeup_decrementer();
64146 -
64147 -       /* Re-enable local CPU interrupts */
64148 -       local_irq_enable();
64149 -       mdelay(10);
64150 -       preempt_enable();
64151 -
64152 -       /* Call platform functions marked "on wake" */
64153 -       pmac_pfunc_base_resume();
64154 -       pmac_pfunc_i2c_resume();
64155 -
64156 -       /* Resume devices */
64157 -       device_resume();
64158 -
64159 -       /* Notify old style drivers */
64160 -       broadcast_wake();
64161 -
64162 -       pm_restore_console();
64163 -
64164 -       return 0;
64165 -}
64166 -
64167  #define        GRACKLE_PM      (1<<7)
64168  #define GRACKLE_DOZE   (1<<5)
64169  #define        GRACKLE_NAP     (1<<4)
64170 @@ -2132,19 +1758,12 @@
64171         unsigned long save_l2cr;
64172         unsigned short pmcr1;
64173         struct adb_request req;
64174 -       int ret;
64175         struct pci_dev *grackle;
64176  
64177         grackle = pci_get_bus_and_slot(0, 0);
64178         if (!grackle)
64179                 return -ENODEV;
64180  
64181 -       ret = pmac_suspend_devices();
64182 -       if (ret) {
64183 -               printk(KERN_ERR "Sleep rejected by devices\n");
64184 -               return ret;
64185 -       }
64186 -       
64187         /* Turn off various things. Darwin does some retry tests here... */
64188         pmu_request(&req, NULL, 2, PMU_POWER_CTRL0, PMU_POW0_OFF|PMU_POW0_HARD_DRIVE);
64189         pmu_wait_complete(&req);
64190 @@ -2207,8 +1826,6 @@
64191                         PMU_POW_ON|PMU_POW_BACKLIGHT|PMU_POW_CHARGER|PMU_POW_IRLED|PMU_POW_MEDIABAY);
64192         pmu_wait_complete(&req);
64193  
64194 -       pmac_wakeup_devices();
64195 -
64196         return 0;
64197  }
64198  
64199 @@ -2218,7 +1835,6 @@
64200         unsigned long save_l2cr;
64201         unsigned long save_l3cr;
64202         struct adb_request req;
64203 -       int ret;
64204         
64205         if (pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,-1) < 0) {
64206                 printk(KERN_ERR "Sleep mode not supported on this machine\n");
64207 @@ -2228,12 +1844,6 @@
64208         if (num_online_cpus() > 1 || cpu_is_offline(0))
64209                 return -EAGAIN;
64210  
64211 -       ret = pmac_suspend_devices();
64212 -       if (ret) {
64213 -               printk(KERN_ERR "Sleep rejected by devices\n");
64214 -               return ret;
64215 -       }
64216 -
64217         /* Stop environment and ADB interrupts */
64218         pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, 0);
64219         pmu_wait_complete(&req);
64220 @@ -2304,45 +1914,33 @@
64221         /* Restore LPJ, cpufreq will adjust the cpu frequency */
64222         loops_per_jiffy /= 2;
64223  
64224 -       pmac_wakeup_devices();
64225 -
64226         return 0;
64227  }
64228  
64229  #define PB3400_MEM_CTRL                0xf8000000
64230  #define PB3400_MEM_CTRL_SLEEP  0x70
64231  
64232 -static int
64233 -powerbook_sleep_3400(void)
64234 +static void __iomem *pb3400_mem_ctrl;
64235 +
64236 +static void powerbook_sleep_init_3400(void)
64237  {
64238 -       int ret, i, x;
64239 +       /* map in the memory controller registers */
64240 +       pb3400_mem_ctrl = ioremap(PB3400_MEM_CTRL, 0x100);
64241 +       if (pb3400_mem_ctrl == NULL)
64242 +               printk(KERN_WARNING "ioremap failed: sleep won't be possible");
64243 +}
64244 +
64245 +static int powerbook_sleep_3400(void)
64246 +{
64247 +       int i, x;
64248         unsigned int hid0;
64249 -       unsigned long p;
64250 +       unsigned long msr;
64251         struct adb_request sleep_req;
64252 -       void __iomem *mem_ctrl;
64253         unsigned int __iomem *mem_ctrl_sleep;
64254  
64255 -       /* first map in the memory controller registers */
64256 -       mem_ctrl = ioremap(PB3400_MEM_CTRL, 0x100);
64257 -       if (mem_ctrl == NULL) {
64258 -               printk("powerbook_sleep_3400: ioremap failed\n");
64259 +       if (pb3400_mem_ctrl == NULL)
64260                 return -ENOMEM;
64261 -       }
64262 -       mem_ctrl_sleep = mem_ctrl + PB3400_MEM_CTRL_SLEEP;
64263 -
64264 -       /* Allocate room for PCI save */
64265 -       pbook_alloc_pci_save();
64266 -
64267 -       ret = pmac_suspend_devices();
64268 -       if (ret) {
64269 -               pbook_free_pci_save();
64270 -               iounmap(mem_ctrl);
64271 -               printk(KERN_ERR "Sleep rejected by devices\n");
64272 -               return ret;
64273 -       }
64274 -
64275 -       /* Save the state of PCI config space for some slots */
64276 -       pbook_pci_save();
64277 +       mem_ctrl_sleep = pb3400_mem_ctrl + PB3400_MEM_CTRL_SLEEP;
64278  
64279         /* Set the memory controller to keep the memory refreshed
64280            while we're asleep */
64281 @@ -2357,41 +1955,34 @@
64282  
64283         /* Ask the PMU to put us to sleep */
64284         pmu_request(&sleep_req, NULL, 5, PMU_SLEEP, 'M', 'A', 'T', 'T');
64285 -       while (!sleep_req.complete)
64286 -               mb();
64287 +       pmu_wait_complete(&sleep_req);
64288 +       pmu_unlock();
64289  
64290 -       pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,1);
64291 +       pmac_call_feature(PMAC_FTR_SLEEP_STATE, NULL, 0, 1);
64292  
64293 -       /* displacement-flush the L2 cache - necessary? */
64294 -       for (p = KERNELBASE; p < KERNELBASE + 0x100000; p += 0x1000)
64295 -               i = *(volatile int *)p;
64296         asleep = 1;
64297  
64298         /* Put the CPU into sleep mode */
64299         hid0 = mfspr(SPRN_HID0);
64300         hid0 = (hid0 & ~(HID0_NAP | HID0_DOZE)) | HID0_SLEEP;
64301         mtspr(SPRN_HID0, hid0);
64302 -       mtmsr(mfmsr() | MSR_POW | MSR_EE);
64303 -       udelay(10);
64304 +       local_irq_enable();
64305 +       msr = mfmsr() | MSR_POW;
64306 +       while (asleep) {
64307 +               mb();
64308 +               mtmsr(msr);
64309 +               isync();
64310 +       }
64311 +       local_irq_disable();
64312  
64313         /* OK, we're awake again, start restoring things */
64314         out_be32(mem_ctrl_sleep, 0x3f);
64315 -       pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,0);
64316 -       pbook_pci_restore();
64317 -       pmu_unlock();
64318 -
64319 -       /* wait for the PMU interrupt sequence to complete */
64320 -       while (asleep)
64321 -               mb();
64322 -
64323 -       pmac_wakeup_devices();
64324 -       pbook_free_pci_save();
64325 -       iounmap(mem_ctrl);
64326 +       pmac_call_feature(PMAC_FTR_SLEEP_STATE, NULL, 0, 0);
64327  
64328         return 0;
64329  }
64330  
64331 -#endif /* CONFIG_PM_SLEEP && CONFIG_PPC32 */
64332 +#endif /* CONFIG_SUSPEND && CONFIG_PPC32 */
64333  
64334  /*
64335   * Support for /dev/pmu device
64336 @@ -2548,7 +2139,6 @@
64337         struct pmu_private *pp = file->private_data;
64338         unsigned long flags;
64339  
64340 -       lock_kernel();
64341         if (pp != 0) {
64342                 file->private_data = NULL;
64343                 spin_lock_irqsave(&all_pvt_lock, flags);
64344 @@ -2562,10 +2152,96 @@
64345  
64346                 kfree(pp);
64347         }
64348 -       unlock_kernel();
64349         return 0;
64350  }
64351  
64352 +#if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC32)
64353 +static void pmac_suspend_disable_irqs(void)
64354 +{
64355 +       /* Call platform functions marked "on sleep" */
64356 +       pmac_pfunc_i2c_suspend();
64357 +       pmac_pfunc_base_suspend();
64358 +}
64359 +
64360 +static int powerbook_sleep(suspend_state_t state)
64361 +{
64362 +       int error = 0;
64363 +
64364 +       /* Wait for completion of async requests */
64365 +       while (!batt_req.complete)
64366 +               pmu_poll();
64367 +
64368 +       /* Giveup the lazy FPU & vec so we don't have to back them
64369 +        * up from the low level code
64370 +        */
64371 +       enable_kernel_fp();
64372 +
64373 +#ifdef CONFIG_ALTIVEC
64374 +       if (cpu_has_feature(CPU_FTR_ALTIVEC))
64375 +               enable_kernel_altivec();
64376 +#endif /* CONFIG_ALTIVEC */
64377 +
64378 +       switch (pmu_kind) {
64379 +       case PMU_OHARE_BASED:
64380 +               error = powerbook_sleep_3400();
64381 +               break;
64382 +       case PMU_HEATHROW_BASED:
64383 +       case PMU_PADDINGTON_BASED:
64384 +               error = powerbook_sleep_grackle();
64385 +               break;
64386 +       case PMU_KEYLARGO_BASED:
64387 +               error = powerbook_sleep_Core99();
64388 +               break;
64389 +       default:
64390 +               return -ENOSYS;
64391 +       }
64392 +
64393 +       if (error)
64394 +               return error;
64395 +
64396 +       mdelay(100);
64397 +
64398 +       return 0;
64399 +}
64400 +
64401 +static void pmac_suspend_enable_irqs(void)
64402 +{
64403 +       /* Force a poll of ADB interrupts */
64404 +       adb_int_pending = 1;
64405 +       via_pmu_interrupt(0, NULL);
64406 +
64407 +       mdelay(10);
64408 +
64409 +       /* Call platform functions marked "on wake" */
64410 +       pmac_pfunc_base_resume();
64411 +       pmac_pfunc_i2c_resume();
64412 +}
64413 +
64414 +static int pmu_sleep_valid(suspend_state_t state)
64415 +{
64416 +       return state == PM_SUSPEND_MEM
64417 +               && (pmac_call_feature(PMAC_FTR_SLEEP_STATE, NULL, 0, -1) >= 0);
64418 +}
64419 +
64420 +static struct platform_suspend_ops pmu_pm_ops = {
64421 +       .enter = powerbook_sleep,
64422 +       .valid = pmu_sleep_valid,
64423 +};
64424 +
64425 +static int register_pmu_pm_ops(void)
64426 +{
64427 +       if (pmu_kind == PMU_OHARE_BASED)
64428 +               powerbook_sleep_init_3400();
64429 +       ppc_md.suspend_disable_irqs = pmac_suspend_disable_irqs;
64430 +       ppc_md.suspend_enable_irqs = pmac_suspend_enable_irqs;
64431 +       suspend_set_ops(&pmu_pm_ops);
64432 +
64433 +       return 0;
64434 +}
64435 +
64436 +device_initcall(register_pmu_pm_ops);
64437 +#endif
64438 +
64439  static int
64440  pmu_ioctl(struct inode * inode, struct file *filp,
64441                      u_int cmd, u_long arg)
64442 @@ -2574,35 +2250,15 @@
64443         int error = -EINVAL;
64444  
64445         switch (cmd) {
64446 -#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32)
64447         case PMU_IOC_SLEEP:
64448                 if (!capable(CAP_SYS_ADMIN))
64449                         return -EACCES;
64450 -               if (sleep_in_progress)
64451 -                       return -EBUSY;
64452 -               sleep_in_progress = 1;
64453 -               switch (pmu_kind) {
64454 -               case PMU_OHARE_BASED:
64455 -                       error = powerbook_sleep_3400();
64456 -                       break;
64457 -               case PMU_HEATHROW_BASED:
64458 -               case PMU_PADDINGTON_BASED:
64459 -                       error = powerbook_sleep_grackle();
64460 -                       break;
64461 -               case PMU_KEYLARGO_BASED:
64462 -                       error = powerbook_sleep_Core99();
64463 -                       break;
64464 -               default:
64465 -                       error = -ENOSYS;
64466 -               }
64467 -               sleep_in_progress = 0;
64468 -               break;
64469 +               return pm_suspend(PM_SUSPEND_MEM);
64470         case PMU_IOC_CAN_SLEEP:
64471 -               if (pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,-1) < 0)
64472 +               if (pmac_call_feature(PMAC_FTR_SLEEP_STATE, NULL, 0, -1) < 0)
64473                         return put_user(0, argp);
64474                 else
64475                         return put_user(1, argp);
64476 -#endif /* CONFIG_PM_SLEEP && CONFIG_PPC32 */
64477  
64478  #ifdef CONFIG_PMAC_BACKLIGHT_LEGACY
64479         /* Compatibility ioctl's for backlight */
64480 @@ -2610,9 +2266,6 @@
64481         {
64482                 int brightness;
64483  
64484 -               if (sleep_in_progress)
64485 -                       return -EBUSY;
64486 -
64487                 brightness = pmac_backlight_get_legacy_brightness();
64488                 if (brightness < 0)
64489                         return brightness;
64490 @@ -2624,9 +2277,6 @@
64491         {
64492                 int brightness;
64493  
64494 -               if (sleep_in_progress)
64495 -                       return -EBUSY;
64496 -
64497                 error = get_user(brightness, argp);
64498                 if (error)
64499                         return error;
64500 @@ -2751,15 +2401,43 @@
64501         local_irq_restore(flags);
64502         return 0;
64503  }
64504 -#endif /* DEBUG_SLEEP */
64505  
64506 +/* N.B. This doesn't work on the 3400 */
64507 +void pmu_blink(int n)
64508 +{
64509 +       struct adb_request req;
64510  
64511 -/* FIXME: This is a temporary set of callbacks to enable us
64512 - * to do suspend-to-disk.
64513 - */
64514 +       memset(&req, 0, sizeof(req));
64515  
64516 -#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32)
64517 +       for (; n > 0; --n) {
64518 +               req.nbytes = 4;
64519 +               req.done = NULL;
64520 +               req.data[0] = 0xee;
64521 +               req.data[1] = 4;
64522 +               req.data[2] = 0;
64523 +               req.data[3] = 1;
64524 +               req.reply[0] = ADB_RET_OK;
64525 +               req.reply_len = 1;
64526 +               req.reply_expected = 0;
64527 +               pmu_polled_request(&req);
64528 +               mdelay(50);
64529 +               req.nbytes = 4;
64530 +               req.done = NULL;
64531 +               req.data[0] = 0xee;
64532 +               req.data[1] = 4;
64533 +               req.data[2] = 0;
64534 +               req.data[3] = 0;
64535 +               req.reply[0] = ADB_RET_OK;
64536 +               req.reply_len = 1;
64537 +               req.reply_expected = 0;
64538 +               pmu_polled_request(&req);
64539 +               mdelay(50);
64540 +       }
64541 +       mdelay(50);
64542 +}
64543 +#endif /* DEBUG_SLEEP */
64544  
64545 +#if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC32)
64546  int pmu_sys_suspended;
64547  
64548  static int pmu_sys_suspend(struct sys_device *sysdev, pm_message_t state)
64549 @@ -2767,10 +2445,15 @@
64550         if (state.event != PM_EVENT_SUSPEND || pmu_sys_suspended)
64551                 return 0;
64552  
64553 -       /* Suspend PMU event interrupts */
64554 +       /* Suspend PMU event interrupts */\
64555         pmu_suspend();
64556 -
64557         pmu_sys_suspended = 1;
64558 +
64559 +#ifdef CONFIG_PMAC_BACKLIGHT
64560 +       /* Tell backlight code not to muck around with the chip anymore */
64561 +       pmu_backlight_set_sleep(1);
64562 +#endif
64563 +
64564         return 0;
64565  }
64566  
64567 @@ -2785,15 +2468,18 @@
64568         pmu_request(&req, NULL, 2, PMU_SYSTEM_READY, 2);
64569         pmu_wait_complete(&req);
64570  
64571 +#ifdef CONFIG_PMAC_BACKLIGHT
64572 +       /* Tell backlight code it can use the chip again */
64573 +       pmu_backlight_set_sleep(0);
64574 +#endif
64575         /* Resume PMU event interrupts */
64576         pmu_resume();
64577 -
64578         pmu_sys_suspended = 0;
64579  
64580         return 0;
64581  }
64582  
64583 -#endif /* CONFIG_PM_SLEEP && CONFIG_PPC32 */
64584 +#endif /* CONFIG_SUSPEND && CONFIG_PPC32 */
64585  
64586  static struct sysdev_class pmu_sysclass = {
64587         set_kset_name("pmu"),
64588 @@ -2804,10 +2490,10 @@
64589  };
64590  
64591  static struct sysdev_driver driver_pmu = {
64592 -#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32)
64593 +#if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC32)
64594         .suspend        = &pmu_sys_suspend,
64595         .resume         = &pmu_sys_resume,
64596 -#endif /* CONFIG_PM_SLEEP && CONFIG_PPC32 */
64597 +#endif /* CONFIG_SUSPEND && CONFIG_PPC32 */
64598  };
64599  
64600  static int __init init_pmu_sysfs(void)
64601 @@ -2842,10 +2528,10 @@
64602  EXPORT_SYMBOL(pmu_suspend);
64603  EXPORT_SYMBOL(pmu_resume);
64604  EXPORT_SYMBOL(pmu_unlock);
64605 -#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32)
64606 +#if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC32)
64607  EXPORT_SYMBOL(pmu_enable_irled);
64608  EXPORT_SYMBOL(pmu_battery_count);
64609  EXPORT_SYMBOL(pmu_batteries);
64610  EXPORT_SYMBOL(pmu_power_flags);
64611 -#endif /* CONFIG_PM_SLEEP && CONFIG_PPC32 */
64612 +#endif /* CONFIG_SUSPEND && CONFIG_PPC32 */
64613  
64614 diff -x .git -x .gitignore -Nur linux-2.6.24/drivers/net/fs_enet/fs_enet-main.c powerpc.git/drivers/net/fs_enet/fs_enet-main.c
64615 --- linux-2.6.24/drivers/net/fs_enet/fs_enet-main.c     2008-01-24 23:58:37.000000000 +0100
64616 +++ powerpc.git/drivers/net/fs_enet/fs_enet-main.c      2008-01-28 20:26:12.000000000 +0100
64617 @@ -1178,8 +1178,15 @@
64618         struct device_node *phynode, *mdionode;
64619         struct resource res;
64620         int ret = 0, len;
64621 +       const u32 *data;
64622 +
64623 +       data  = of_get_property(np, "fixed-link", NULL);
64624 +       if (data) {
64625 +               snprintf(fpi->bus_id, 16, PHY_ID_FMT, 0, *data);
64626 +               return 0;
64627 +       }
64628  
64629 -       const u32 *data = of_get_property(np, "phy-handle", &len);
64630 +       data = of_get_property(np, "phy-handle", &len);
64631         if (!data || len != 4)
64632                 return -EINVAL;
64633  
64634 diff -x .git -x .gitignore -Nur linux-2.6.24/drivers/net/fs_enet/mac-fcc.c powerpc.git/drivers/net/fs_enet/mac-fcc.c
64635 --- linux-2.6.24/drivers/net/fs_enet/mac-fcc.c  2008-01-24 23:58:37.000000000 +0100
64636 +++ powerpc.git/drivers/net/fs_enet/mac-fcc.c   2008-01-28 20:26:12.000000000 +0100
64637 @@ -81,16 +81,8 @@
64638  static inline int fcc_cr_cmd(struct fs_enet_private *fep, u32 op)
64639  {
64640         const struct fs_platform_info *fpi = fep->fpi;
64641 -       int i;
64642  
64643 -       W32(cpmp, cp_cpcr, fpi->cp_command | op | CPM_CR_FLG);
64644 -       for (i = 0; i < MAX_CR_CMD_LOOPS; i++)
64645 -               if ((R32(cpmp, cp_cpcr) & CPM_CR_FLG) == 0)
64646 -                       return 0;
64647 -
64648 -       printk(KERN_ERR "%s(): Not able to issue CPM command\n",
64649 -              __FUNCTION__);
64650 -       return 1;
64651 +       return cpm_command(fpi->cp_command, op);
64652  }
64653  
64654  static int do_pd_setup(struct fs_enet_private *fep)
64655 diff -x .git -x .gitignore -Nur linux-2.6.24/drivers/net/fs_enet/mac-scc.c powerpc.git/drivers/net/fs_enet/mac-scc.c
64656 --- linux-2.6.24/drivers/net/fs_enet/mac-scc.c  2008-01-24 23:58:37.000000000 +0100
64657 +++ powerpc.git/drivers/net/fs_enet/mac-scc.c   2008-01-28 20:26:12.000000000 +0100
64658 @@ -89,21 +89,12 @@
64659   * Delay to wait for SCC reset command to complete (in us)
64660   */
64661  #define SCC_RESET_DELAY                50
64662 -#define MAX_CR_CMD_LOOPS       10000
64663  
64664  static inline int scc_cr_cmd(struct fs_enet_private *fep, u32 op)
64665  {
64666         const struct fs_platform_info *fpi = fep->fpi;
64667 -       int i;
64668  
64669 -       W16(cpmp, cp_cpcr, fpi->cp_command | CPM_CR_FLG | (op << 8));
64670 -       for (i = 0; i < MAX_CR_CMD_LOOPS; i++)
64671 -               if ((R16(cpmp, cp_cpcr) & CPM_CR_FLG) == 0)
64672 -                       return 0;
64673 -
64674 -       printk(KERN_ERR "%s(): Not able to issue CPM command\n",
64675 -               __FUNCTION__);
64676 -       return 1;
64677 +       return cpm_command(fpi->cp_command, op);
64678  }
64679  
64680  static int do_pd_setup(struct fs_enet_private *fep)
64681 diff -x .git -x .gitignore -Nur linux-2.6.24/drivers/net/ibm_newemac/core.c powerpc.git/drivers/net/ibm_newemac/core.c
64682 --- linux-2.6.24/drivers/net/ibm_newemac/core.c 2008-01-24 23:58:37.000000000 +0100
64683 +++ powerpc.git/drivers/net/ibm_newemac/core.c  2008-01-28 20:26:12.000000000 +0100
64684 @@ -37,6 +37,7 @@
64685  #include <linux/mii.h>
64686  #include <linux/bitops.h>
64687  #include <linux/workqueue.h>
64688 +#include <linux/of.h>
64689  
64690  #include <asm/processor.h>
64691  #include <asm/io.h>
64692 diff -x .git -x .gitignore -Nur linux-2.6.24/drivers/net/phy/Kconfig powerpc.git/drivers/net/phy/Kconfig
64693 --- linux-2.6.24/drivers/net/phy/Kconfig        2008-01-24 23:58:37.000000000 +0100
64694 +++ powerpc.git/drivers/net/phy/Kconfig 2008-01-28 20:26:14.000000000 +0100
64695 @@ -61,34 +61,12 @@
64696           Currently supports the IP175C PHY.
64697  
64698  config FIXED_PHY
64699 -       tristate "Drivers for PHY emulation on fixed speed/link"
64700 +       bool "Driver for MDIO Bus/PHY emulation with fixed speed/link PHYs"
64701         ---help---
64702 -         Adds the driver to PHY layer to cover the boards that do not have any PHY bound,
64703 -         but with the ability to manipulate the speed/link in software. The relevant MII
64704 -         speed/duplex parameters could be effectively handled in a user-specified function.
64705 -         Currently tested with mpc866ads.
64706 +         Adds the platform "fixed" MDIO Bus to cover the boards that use
64707 +         PHYs that are not connected to the real MDIO bus.
64708  
64709 -config FIXED_MII_10_FDX
64710 -       bool "Emulation for 10M Fdx fixed PHY behavior"
64711 -       depends on FIXED_PHY
64712 -
64713 -config FIXED_MII_100_FDX
64714 -       bool "Emulation for 100M Fdx fixed PHY behavior"
64715 -       depends on FIXED_PHY
64716 -
64717 -config FIXED_MII_1000_FDX
64718 -       bool "Emulation for 1000M Fdx fixed PHY behavior"
64719 -       depends on FIXED_PHY
64720 -
64721 -config FIXED_MII_AMNT
64722 -        int "Number of emulated PHYs to allocate "
64723 -        depends on FIXED_PHY
64724 -        default "1"
64725 -        ---help---
64726 -        Sometimes it is required to have several independent emulated
64727 -        PHYs on the bus (in case of multi-eth but phy-less HW for instance).
64728 -        This control will have specified number allocated for each fixed
64729 -        PHY type enabled.
64730 +         Currently tested with mpc866ads and mpc8349e-mitx.
64731  
64732  config MDIO_BITBANG
64733         tristate "Support for bitbanged MDIO buses"
64734 diff -x .git -x .gitignore -Nur linux-2.6.24/drivers/net/phy/fixed.c powerpc.git/drivers/net/phy/fixed.c
64735 --- linux-2.6.24/drivers/net/phy/fixed.c        2008-01-24 23:58:37.000000000 +0100
64736 +++ powerpc.git/drivers/net/phy/fixed.c 2008-01-28 20:26:14.000000000 +0100
64737 @@ -1,362 +1,253 @@
64738  /*
64739 - * drivers/net/phy/fixed.c
64740 + * Fixed MDIO bus (MDIO bus emulation with fixed PHYs)
64741   *
64742 - * Driver for fixed PHYs, when transceiver is able to operate in one fixed mode.
64743 + * Author: Vitaly Bordug <vbordug@ru.mvista.com>
64744 + *         Anton Vorontsov <avorontsov@ru.mvista.com>
64745   *
64746 - * Author: Vitaly Bordug
64747 - *
64748 - * Copyright (c) 2006 MontaVista Software, Inc.
64749 + * Copyright (c) 2006-2007 MontaVista Software, Inc.
64750   *
64751   * This program is free software; you can redistribute  it and/or modify it
64752   * under  the terms of  the GNU General  Public License as published by the
64753   * Free Software Foundation;  either version 2 of the  License, or (at your
64754   * option) any later version.
64755 - *
64756   */
64757 +
64758  #include <linux/kernel.h>
64759 -#include <linux/string.h>
64760 -#include <linux/errno.h>
64761 -#include <linux/unistd.h>
64762 -#include <linux/slab.h>
64763 -#include <linux/interrupt.h>
64764 -#include <linux/init.h>
64765 -#include <linux/delay.h>
64766 -#include <linux/netdevice.h>
64767 -#include <linux/etherdevice.h>
64768 -#include <linux/skbuff.h>
64769 -#include <linux/spinlock.h>
64770 -#include <linux/mm.h>
64771  #include <linux/module.h>
64772 +#include <linux/platform_device.h>
64773 +#include <linux/list.h>
64774  #include <linux/mii.h>
64775 -#include <linux/ethtool.h>
64776  #include <linux/phy.h>
64777  #include <linux/phy_fixed.h>
64778  
64779 -#include <asm/io.h>
64780 -#include <asm/irq.h>
64781 -#include <asm/uaccess.h>
64782 -
64783 -/* we need to track the allocated pointers in order to free them on exit */
64784 -static struct fixed_info *fixed_phy_ptrs[CONFIG_FIXED_MII_AMNT*MAX_PHY_AMNT];
64785 -
64786 -/*-----------------------------------------------------------------------------
64787 - *  If something weird is required to be done with link/speed,
64788 - * network driver is able to assign a function to implement this.
64789 - * May be useful for PHY's that need to be software-driven.
64790 - *-----------------------------------------------------------------------------*/
64791 -int fixed_mdio_set_link_update(struct phy_device *phydev,
64792 -                              int (*link_update) (struct net_device *,
64793 -                                                  struct fixed_phy_status *))
64794 -{
64795 -       struct fixed_info *fixed;
64796 -
64797 -       if (link_update == NULL)
64798 -               return -EINVAL;
64799 +#define MII_REGS_NUM 29
64800  
64801 -       if (phydev) {
64802 -               if (phydev->bus) {
64803 -                       fixed = phydev->bus->priv;
64804 -                       fixed->link_update = link_update;
64805 -                       return 0;
64806 -               }
64807 -       }
64808 -       return -EINVAL;
64809 -}
64810 -
64811 -EXPORT_SYMBOL(fixed_mdio_set_link_update);
64812 +struct fixed_mdio_bus {
64813 +       int irqs[PHY_MAX_ADDR];
64814 +       struct mii_bus mii_bus;
64815 +       struct list_head phys;
64816 +};
64817  
64818 -struct fixed_info *fixed_mdio_get_phydev (int phydev_ind)
64819 -{
64820 -       if (phydev_ind >= MAX_PHY_AMNT)
64821 -               return NULL;
64822 -       return fixed_phy_ptrs[phydev_ind];
64823 -}
64824 +struct fixed_phy {
64825 +       int id;
64826 +       u16 regs[MII_REGS_NUM];
64827 +       struct phy_device *phydev;
64828 +       struct fixed_phy_status status;
64829 +       int (*link_update)(struct net_device *, struct fixed_phy_status *);
64830 +       struct list_head node;
64831 +};
64832  
64833 -EXPORT_SYMBOL(fixed_mdio_get_phydev);
64834 +static struct platform_device *pdev;
64835 +static struct fixed_mdio_bus platform_fmb = {
64836 +       .phys = LIST_HEAD_INIT(platform_fmb.phys),
64837 +};
64838  
64839 -/*-----------------------------------------------------------------------------
64840 - *  This is used for updating internal mii regs from the status
64841 - *-----------------------------------------------------------------------------*/
64842 -#if defined(CONFIG_FIXED_MII_100_FDX) || defined(CONFIG_FIXED_MII_10_FDX) || defined(CONFIG_FIXED_MII_1000_FDX)
64843 -static int fixed_mdio_update_regs(struct fixed_info *fixed)
64844 +static int fixed_phy_update_regs(struct fixed_phy *fp)
64845  {
64846 -       u16 *regs = fixed->regs;
64847 -       u16 bmsr = 0;
64848 +       u16 bmsr = BMSR_ANEGCAPABLE;
64849         u16 bmcr = 0;
64850 +       u16 lpagb = 0;
64851 +       u16 lpa = 0;
64852  
64853 -       if (!regs) {
64854 -               printk(KERN_ERR "%s: regs not set up", __FUNCTION__);
64855 -               return -EINVAL;
64856 -       }
64857 -
64858 -       if (fixed->phy_status.link)
64859 -               bmsr |= BMSR_LSTATUS;
64860 -
64861 -       if (fixed->phy_status.duplex) {
64862 +       if (fp->status.duplex) {
64863                 bmcr |= BMCR_FULLDPLX;
64864  
64865 -               switch (fixed->phy_status.speed) {
64866 +               switch (fp->status.speed) {
64867 +               case 1000:
64868 +                       bmsr |= BMSR_ESTATEN;
64869 +                       bmcr |= BMCR_SPEED1000;
64870 +                       lpagb |= LPA_1000FULL;
64871 +                       break;
64872                 case 100:
64873                         bmsr |= BMSR_100FULL;
64874                         bmcr |= BMCR_SPEED100;
64875 +                       lpa |= LPA_100FULL;
64876                         break;
64877 -
64878                 case 10:
64879                         bmsr |= BMSR_10FULL;
64880 +                       lpa |= LPA_10FULL;
64881                         break;
64882 +               default:
64883 +                       printk(KERN_WARNING "fixed phy: unknown speed\n");
64884 +                       return -EINVAL;
64885                 }
64886         } else {
64887 -               switch (fixed->phy_status.speed) {
64888 +               switch (fp->status.speed) {
64889 +               case 1000:
64890 +                       bmsr |= BMSR_ESTATEN;
64891 +                       bmcr |= BMCR_SPEED1000;
64892 +                       lpagb |= LPA_1000HALF;
64893 +                       break;
64894                 case 100:
64895                         bmsr |= BMSR_100HALF;
64896                         bmcr |= BMCR_SPEED100;
64897 +                       lpa |= LPA_100HALF;
64898                         break;
64899 -
64900                 case 10:
64901 -                       bmsr |= BMSR_100HALF;
64902 +                       bmsr |= BMSR_10HALF;
64903 +                       lpa |= LPA_10HALF;
64904                         break;
64905 +               default:
64906 +                       printk(KERN_WARNING "fixed phy: unknown speed\n");
64907 +                       return -EINVAL;
64908                 }
64909         }
64910  
64911 -       regs[MII_BMCR] = bmcr;
64912 -       regs[MII_BMSR] = bmsr | 0x800;  /*we are always capable of 10 hdx */
64913 +       if (fp->status.link)
64914 +               bmsr |= BMSR_LSTATUS | BMSR_ANEGCOMPLETE;
64915 +
64916 +       if (fp->status.pause)
64917 +               lpa |= LPA_PAUSE_CAP;
64918 +
64919 +       if (fp->status.asym_pause)
64920 +               lpa |= LPA_PAUSE_ASYM;
64921 +
64922 +       fp->regs[MII_PHYSID1] = fp->id >> 16;
64923 +       fp->regs[MII_PHYSID2] = fp->id;
64924 +
64925 +       fp->regs[MII_BMSR] = bmsr;
64926 +       fp->regs[MII_BMCR] = bmcr;
64927 +       fp->regs[MII_LPA] = lpa;
64928 +       fp->regs[MII_STAT1000] = lpagb;
64929  
64930         return 0;
64931  }
64932  
64933 -static int fixed_mii_read(struct mii_bus *bus, int phy_id, int location)
64934 +static int fixed_mdio_read(struct mii_bus *bus, int phy_id, int reg_num)
64935  {
64936 -       struct fixed_info *fixed = bus->priv;
64937 +       struct fixed_mdio_bus *fmb = container_of(bus, struct fixed_mdio_bus,
64938 +                                                 mii_bus);
64939 +       struct fixed_phy *fp;
64940  
64941 -       /* if user has registered link update callback, use it */
64942 -       if (fixed->phydev)
64943 -               if (fixed->phydev->attached_dev) {
64944 -                       if (fixed->link_update) {
64945 -                               fixed->link_update(fixed->phydev->attached_dev,
64946 -                                                  &fixed->phy_status);
64947 -                               fixed_mdio_update_regs(fixed);
64948 +       if (reg_num >= MII_REGS_NUM)
64949 +               return -1;
64950 +
64951 +       list_for_each_entry(fp, &fmb->phys, node) {
64952 +               if (fp->id == phy_id) {
64953 +                       /* Issue callback if user registered it. */
64954 +                       if (fp->link_update) {
64955 +                               fp->link_update(fp->phydev->attached_dev,
64956 +                                               &fp->status);
64957 +                               fixed_phy_update_regs(fp);
64958                         }
64959 +                       return fp->regs[reg_num];
64960                 }
64961 +       }
64962  
64963 -       if ((unsigned int)location >= fixed->regs_num)
64964 -               return -1;
64965 -       return fixed->regs[location];
64966 +       return 0xFFFF;
64967  }
64968  
64969 -static int fixed_mii_write(struct mii_bus *bus, int phy_id, int location,
64970 -                          u16 val)
64971 +static int fixed_mdio_write(struct mii_bus *bus, int phy_id, int reg_num,
64972 +                           u16 val)
64973  {
64974 -       /* do nothing for now */
64975         return 0;
64976  }
64977  
64978 -static int fixed_mii_reset(struct mii_bus *bus)
64979 +/*
64980 + * If something weird is required to be done with link/speed,
64981 + * network driver is able to assign a function to implement this.
64982 + * May be useful for PHY's that need to be software-driven.
64983 + */
64984 +int fixed_phy_set_link_update(struct phy_device *phydev,
64985 +                             int (*link_update)(struct net_device *,
64986 +                                                struct fixed_phy_status *))
64987  {
64988 -       /*nothing here - no way/need to reset it */
64989 -       return 0;
64990 -}
64991 -#endif
64992 +       struct fixed_mdio_bus *fmb = &platform_fmb;
64993 +       struct fixed_phy *fp;
64994  
64995 -static int fixed_config_aneg(struct phy_device *phydev)
64996 -{
64997 -       /* :TODO:03/13/2006 09:45:37 PM::
64998 -          The full autoneg funcionality can be emulated,
64999 -          but no need to have anything here for now
65000 -        */
65001 -       return 0;
65002 -}
65003 +       if (!link_update || !phydev || !phydev->bus)
65004 +               return -EINVAL;
65005  
65006 -/*-----------------------------------------------------------------------------
65007 - * the manual bind will do the magic - with phy_id_mask == 0
65008 - * match will never return true...
65009 - *-----------------------------------------------------------------------------*/
65010 -static struct phy_driver fixed_mdio_driver = {
65011 -       .name = "Fixed PHY",
65012 -#ifdef CONFIG_FIXED_MII_1000_FDX
65013 -       .features = PHY_GBIT_FEATURES,
65014 -#else
65015 -       .features = PHY_BASIC_FEATURES,
65016 -#endif
65017 -       .config_aneg = fixed_config_aneg,
65018 -       .read_status = genphy_read_status,
65019 -       .driver = { .owner = THIS_MODULE, },
65020 -};
65021 +       list_for_each_entry(fp, &fmb->phys, node) {
65022 +               if (fp->id == phydev->phy_id) {
65023 +                       fp->link_update = link_update;
65024 +                       fp->phydev = phydev;
65025 +                       return 0;
65026 +               }
65027 +       }
65028  
65029 -static void fixed_mdio_release(struct device *dev)
65030 -{
65031 -       struct phy_device *phydev = container_of(dev, struct phy_device, dev);
65032 -       struct mii_bus *bus = phydev->bus;
65033 -       struct fixed_info *fixed = bus->priv;
65034 -
65035 -       kfree(phydev);
65036 -       kfree(bus->dev);
65037 -       kfree(bus);
65038 -       kfree(fixed->regs);
65039 -       kfree(fixed);
65040 +       return -ENOENT;
65041  }
65042 +EXPORT_SYMBOL_GPL(fixed_phy_set_link_update);
65043  
65044 -/*-----------------------------------------------------------------------------
65045 - *  This func is used to create all the necessary stuff, bind
65046 - * the fixed phy driver and register all it on the mdio_bus_type.
65047 - * speed is either 10 or 100 or 1000, duplex is boolean.
65048 - * number is used to create multiple fixed PHYs, so that several devices can
65049 - * utilize them simultaneously.
65050 - *
65051 - * The device on mdio bus will look like [bus_id]:[phy_id],
65052 - * bus_id = number
65053 - * phy_id = speed+duplex.
65054 - *-----------------------------------------------------------------------------*/
65055 -#if defined(CONFIG_FIXED_MII_100_FDX) || defined(CONFIG_FIXED_MII_10_FDX) || defined(CONFIG_FIXED_MII_1000_FDX)
65056 -struct fixed_info *fixed_mdio_register_device(
65057 -       int bus_id, int speed, int duplex, u8 phy_id)
65058 +int fixed_phy_add(unsigned int irq, int phy_id,
65059 +                 struct fixed_phy_status *status)
65060  {
65061 -       struct mii_bus *new_bus;
65062 -       struct fixed_info *fixed;
65063 -       struct phy_device *phydev;
65064 -       int err;
65065 +       int ret;
65066 +       struct fixed_mdio_bus *fmb = &platform_fmb;
65067 +       struct fixed_phy *fp;
65068  
65069 -       struct device *dev = kzalloc(sizeof(struct device), GFP_KERNEL);
65070 +       fp = kzalloc(sizeof(*fp), GFP_KERNEL);
65071 +       if (!fp)
65072 +               return -ENOMEM;
65073  
65074 -       if (dev == NULL)
65075 -               goto err_dev_alloc;
65076 +       memset(fp->regs, 0xFF,  sizeof(fp->regs[0]) * MII_REGS_NUM);
65077  
65078 -       new_bus = kzalloc(sizeof(struct mii_bus), GFP_KERNEL);
65079 +       fmb->irqs[phy_id] = irq;
65080  
65081 -       if (new_bus == NULL)
65082 -               goto err_bus_alloc;
65083 -
65084 -       fixed = kzalloc(sizeof(struct fixed_info), GFP_KERNEL);
65085 -
65086 -       if (fixed == NULL)
65087 -               goto err_fixed_alloc;
65088 -
65089 -       fixed->regs = kzalloc(MII_REGS_NUM * sizeof(int), GFP_KERNEL);
65090 -       if (NULL == fixed->regs)
65091 -               goto err_fixed_regs_alloc;
65092 -
65093 -       fixed->regs_num = MII_REGS_NUM;
65094 -       fixed->phy_status.speed = speed;
65095 -       fixed->phy_status.duplex = duplex;
65096 -       fixed->phy_status.link = 1;
65097 -
65098 -       new_bus->name = "Fixed MII Bus";
65099 -       new_bus->read = &fixed_mii_read;
65100 -       new_bus->write = &fixed_mii_write;
65101 -       new_bus->reset = &fixed_mii_reset;
65102 -       /*set up workspace */
65103 -       fixed_mdio_update_regs(fixed);
65104 -       new_bus->priv = fixed;
65105 -
65106 -       new_bus->dev = dev;
65107 -       dev_set_drvdata(dev, new_bus);
65108 -
65109 -       /* create phy_device and register it on the mdio bus */
65110 -       phydev = phy_device_create(new_bus, 0, 0);
65111 -       if (phydev == NULL)
65112 -               goto err_phy_dev_create;
65113 -
65114 -       /*
65115 -        * Put the phydev pointer into the fixed pack so that bus read/write
65116 -        * code could be able to access for instance attached netdev. Well it
65117 -        * doesn't have to do so, only in case of utilizing user-specified
65118 -        * link-update...
65119 -        */
65120 -
65121 -       fixed->phydev = phydev;
65122 -       phydev->speed = speed;
65123 -       phydev->duplex = duplex;
65124 -
65125 -       phydev->irq = PHY_IGNORE_INTERRUPT;
65126 -       phydev->dev.bus = &mdio_bus_type;
65127 -
65128 -       snprintf(phydev->dev.bus_id, BUS_ID_SIZE,
65129 -                PHY_ID_FMT, bus_id, phy_id);
65130 -
65131 -       phydev->bus = new_bus;
65132 -
65133 -       phydev->dev.driver = &fixed_mdio_driver.driver;
65134 -       phydev->dev.release = fixed_mdio_release;
65135 -       err = phydev->dev.driver->probe(&phydev->dev);
65136 -       if (err < 0) {
65137 -               printk(KERN_ERR "Phy %s: problems with fixed driver\n",
65138 -                      phydev->dev.bus_id);
65139 -               goto err_out;
65140 -       }
65141 -       err = device_register(&phydev->dev);
65142 -       if (err) {
65143 -               printk(KERN_ERR "Phy %s failed to register\n",
65144 -                      phydev->dev.bus_id);
65145 -               goto err_out;
65146 -       }
65147 -       //phydev->state = PHY_RUNNING; /* make phy go up quick, but in 10Mbit/HDX
65148 -       return fixed;
65149 +       fp->id = phy_id;
65150 +       fp->status = *status;
65151  
65152 -err_out:
65153 -       kfree(phydev);
65154 -err_phy_dev_create:
65155 -       kfree(fixed->regs);
65156 -err_fixed_regs_alloc:
65157 -       kfree(fixed);
65158 -err_fixed_alloc:
65159 -       kfree(new_bus);
65160 -err_bus_alloc:
65161 -       kfree(dev);
65162 -err_dev_alloc:
65163 +       ret = fixed_phy_update_regs(fp);
65164 +       if (ret)
65165 +               goto err_regs;
65166  
65167 -       return NULL;
65168 +       list_add_tail(&fp->node, &fmb->phys);
65169  
65170 -}
65171 -#endif
65172 +       return 0;
65173  
65174 -MODULE_DESCRIPTION("Fixed PHY device & driver for PAL");
65175 -MODULE_AUTHOR("Vitaly Bordug");
65176 -MODULE_LICENSE("GPL");
65177 +err_regs:
65178 +       kfree(fp);
65179 +       return ret;
65180 +}
65181 +EXPORT_SYMBOL_GPL(fixed_phy_add);
65182  
65183 -static int __init fixed_init(void)
65184 +static int __init fixed_mdio_bus_init(void)
65185  {
65186 -       int cnt = 0;
65187 -       int i;
65188 -/* register on the bus... Not expected to be matched
65189 - * with anything there...
65190 - *
65191 - */
65192 -       phy_driver_register(&fixed_mdio_driver);
65193 +       struct fixed_mdio_bus *fmb = &platform_fmb;
65194 +       int ret;
65195  
65196 -/* We will create several mdio devices here, and will bound the upper
65197 - * driver to them.
65198 - *
65199 - * Then the external software can lookup the phy bus by searching
65200 - * for 0:101, to be connected to the virtual 100M Fdx phy.
65201 - *
65202 - * In case several virtual PHYs required, the bus_id will be in form
65203 - * [num]:[duplex]+[speed], which make it able even to define
65204 - * driver-specific link control callback, if for instance PHY is
65205 - * completely SW-driven.
65206 - */
65207 -       for (i=1; i <= CONFIG_FIXED_MII_AMNT; i++) {
65208 -#ifdef CONFIG_FIXED_MII_1000_FDX
65209 -               fixed_phy_ptrs[cnt++] = fixed_mdio_register_device(0, 1000, 1, i);
65210 -#endif
65211 -#ifdef CONFIG_FIXED_MII_100_FDX
65212 -               fixed_phy_ptrs[cnt++] = fixed_mdio_register_device(1, 100, 1, i);
65213 -#endif
65214 -#ifdef CONFIG_FIXED_MII_10_FDX
65215 -               fixed_phy_ptrs[cnt++] = fixed_mdio_register_device(2, 10, 1, i);
65216 -#endif
65217 +       pdev = platform_device_register_simple("Fixed MDIO bus", 0, NULL, 0);
65218 +       if (!pdev) {
65219 +               ret = -ENOMEM;
65220 +               goto err_pdev;
65221         }
65222  
65223 +       fmb->mii_bus.id = 0;
65224 +       fmb->mii_bus.name = "Fixed MDIO Bus";
65225 +       fmb->mii_bus.dev = &pdev->dev;
65226 +       fmb->mii_bus.read = &fixed_mdio_read;
65227 +       fmb->mii_bus.write = &fixed_mdio_write;
65228 +       fmb->mii_bus.irq = fmb->irqs;
65229 +
65230 +       ret = mdiobus_register(&fmb->mii_bus);
65231 +       if (ret)
65232 +               goto err_mdiobus_reg;
65233 +
65234         return 0;
65235 +
65236 +err_mdiobus_reg:
65237 +       platform_device_unregister(pdev);
65238 +err_pdev:
65239 +       return ret;
65240  }
65241 +module_init(fixed_mdio_bus_init);
65242  
65243 -static void __exit fixed_exit(void)
65244 +static void __exit fixed_mdio_bus_exit(void)
65245  {
65246 -       int i;
65247 +       struct fixed_mdio_bus *fmb = &platform_fmb;
65248 +       struct fixed_phy *fp;
65249  
65250 -       phy_driver_unregister(&fixed_mdio_driver);
65251 -       for (i=0; i < MAX_PHY_AMNT; i++)
65252 -               if ( fixed_phy_ptrs[i] )
65253 -                       device_unregister(&fixed_phy_ptrs[i]->phydev->dev);
65254 +       mdiobus_unregister(&fmb->mii_bus);
65255 +       platform_device_unregister(pdev);
65256 +
65257 +       list_for_each_entry(fp, &fmb->phys, node) {
65258 +               list_del(&fp->node);
65259 +               kfree(fp);
65260 +       }
65261  }
65262 +module_exit(fixed_mdio_bus_exit);
65263  
65264 -module_init(fixed_init);
65265 -module_exit(fixed_exit);
65266 +MODULE_DESCRIPTION("Fixed MDIO bus (MDIO bus emulation with fixed PHYs)");
65267 +MODULE_AUTHOR("Vitaly Bordug");
65268 +MODULE_LICENSE("GPL");
65269 diff -x .git -x .gitignore -Nur linux-2.6.24/drivers/net/ps3_gelic_net.c powerpc.git/drivers/net/ps3_gelic_net.c
65270 --- linux-2.6.24/drivers/net/ps3_gelic_net.c    2008-01-24 23:58:37.000000000 +0100
65271 +++ powerpc.git/drivers/net/ps3_gelic_net.c     2008-01-28 20:26:14.000000000 +0100
65272 @@ -58,11 +58,11 @@
65273  {
65274         return &card->dev->core;
65275  }
65276 -static inline unsigned int bus_id(struct gelic_net_card *card)
65277 +static inline u64 bus_id(struct gelic_net_card *card)
65278  {
65279         return card->dev->bus_id;
65280  }
65281 -static inline unsigned int dev_id(struct gelic_net_card *card)
65282 +static inline u64 dev_id(struct gelic_net_card *card)
65283  {
65284         return card->dev->dev_id;
65285  }
65286 diff -x .git -x .gitignore -Nur linux-2.6.24/drivers/net/ucc_geth.c powerpc.git/drivers/net/ucc_geth.c
65287 --- linux-2.6.24/drivers/net/ucc_geth.c 2008-01-24 23:58:37.000000000 +0100
65288 +++ powerpc.git/drivers/net/ucc_geth.c  2008-01-28 20:26:14.000000000 +0100
65289 @@ -3822,6 +3822,7 @@
65290         int err, ucc_num, max_speed = 0;
65291         const phandle *ph;
65292         const unsigned int *prop;
65293 +       const char *sprop;
65294         const void *mac_addr;
65295         phy_interface_t phy_interface;
65296         static const int enet_to_speed[] = {
65297 @@ -3854,10 +3855,56 @@
65298  
65299         ug_info->uf_info.ucc_num = ucc_num;
65300  
65301 -       prop = of_get_property(np, "rx-clock", NULL);
65302 -       ug_info->uf_info.rx_clock = *prop;
65303 -       prop = of_get_property(np, "tx-clock", NULL);
65304 -       ug_info->uf_info.tx_clock = *prop;
65305 +       sprop = of_get_property(np, "rx-clock-name", NULL);
65306 +       if (sprop) {
65307 +               ug_info->uf_info.rx_clock = qe_clock_source(sprop);
65308 +               if ((ug_info->uf_info.rx_clock < QE_CLK_NONE) ||
65309 +                   (ug_info->uf_info.rx_clock > QE_CLK24)) {
65310 +                       printk(KERN_ERR
65311 +                               "ucc_geth: invalid rx-clock-name property\n");
65312 +                       return -EINVAL;
65313 +               }
65314 +       } else {
65315 +               prop = of_get_property(np, "rx-clock", NULL);
65316 +               if (!prop) {
65317 +                       /* If both rx-clock-name and rx-clock are missing,
65318 +                          we want to tell people to use rx-clock-name. */
65319 +                       printk(KERN_ERR
65320 +                               "ucc_geth: missing rx-clock-name property\n");
65321 +                       return -EINVAL;
65322 +               }
65323 +               if ((*prop < QE_CLK_NONE) || (*prop > QE_CLK24)) {
65324 +                       printk(KERN_ERR
65325 +                               "ucc_geth: invalid rx-clock propperty\n");
65326 +                       return -EINVAL;
65327 +               }
65328 +               ug_info->uf_info.rx_clock = *prop;
65329 +       }
65330 +
65331 +       sprop = of_get_property(np, "tx-clock-name", NULL);
65332 +       if (sprop) {
65333 +               ug_info->uf_info.tx_clock = qe_clock_source(sprop);
65334 +               if ((ug_info->uf_info.tx_clock < QE_CLK_NONE) ||
65335 +                   (ug_info->uf_info.tx_clock > QE_CLK24)) {
65336 +                       printk(KERN_ERR
65337 +                               "ucc_geth: invalid tx-clock-name property\n");
65338 +                       return -EINVAL;
65339 +               }
65340 +       } else {
65341 +               prop = of_get_property(np, "rx-clock", NULL);
65342 +               if (!prop) {
65343 +                       printk(KERN_ERR
65344 +                               "ucc_geth: mising tx-clock-name property\n");
65345 +                       return -EINVAL;
65346 +               }
65347 +               if ((*prop < QE_CLK_NONE) || (*prop > QE_CLK24)) {
65348 +                       printk(KERN_ERR
65349 +                               "ucc_geth: invalid tx-clock property\n");
65350 +                       return -EINVAL;
65351 +               }
65352 +               ug_info->uf_info.tx_clock = *prop;
65353 +       }
65354 +
65355         err = of_address_to_resource(np, 0, &res);
65356         if (err)
65357                 return -EINVAL;
65358 diff -x .git -x .gitignore -Nur linux-2.6.24/drivers/of/base.c powerpc.git/drivers/of/base.c
65359 --- linux-2.6.24/drivers/of/base.c      2008-01-24 23:58:37.000000000 +0100
65360 +++ powerpc.git/drivers/of/base.c       2008-01-28 20:26:17.000000000 +0100
65361 @@ -273,3 +273,61 @@
65362         return np;
65363  }
65364  EXPORT_SYMBOL(of_find_compatible_node);
65365 +
65366 +/**
65367 + * of_match_node - Tell if an device_node has a matching of_match structure
65368 + *     @matches:       array of of device match structures to search in
65369 + *     @node:          the of device structure to match against
65370 + *
65371 + *     Low level utility function used by device matching.
65372 + */
65373 +const struct of_device_id *of_match_node(const struct of_device_id *matches,
65374 +                                        const struct device_node *node)
65375 +{
65376 +       while (matches->name[0] || matches->type[0] || matches->compatible[0]) {
65377 +               int match = 1;
65378 +               if (matches->name[0])
65379 +                       match &= node->name
65380 +                               && !strcmp(matches->name, node->name);
65381 +               if (matches->type[0])
65382 +                       match &= node->type
65383 +                               && !strcmp(matches->type, node->type);
65384 +               if (matches->compatible[0])
65385 +                       match &= of_device_is_compatible(node,
65386 +                                               matches->compatible);
65387 +               if (match)
65388 +                       return matches;
65389 +               matches++;
65390 +       }
65391 +       return NULL;
65392 +}
65393 +EXPORT_SYMBOL(of_match_node);
65394 +
65395 +/**
65396 + *     of_find_matching_node - Find a node based on an of_device_id match
65397 + *                             table.
65398 + *     @from:          The node to start searching from or NULL, the node
65399 + *                     you pass will not be searched, only the next one
65400 + *                     will; typically, you pass what the previous call
65401 + *                     returned. of_node_put() will be called on it
65402 + *     @matches:       array of of device match structures to search in
65403 + *
65404 + *     Returns a node pointer with refcount incremented, use
65405 + *     of_node_put() on it when done.
65406 + */
65407 +struct device_node *of_find_matching_node(struct device_node *from,
65408 +                                         const struct of_device_id *matches)
65409 +{
65410 +       struct device_node *np;
65411 +
65412 +       read_lock(&devtree_lock);
65413 +       np = from ? from->allnext : allnodes;
65414 +       for (; np; np = np->allnext) {
65415 +               if (of_match_node(matches, np) && of_node_get(np))
65416 +                       break;
65417 +       }
65418 +       of_node_put(from);
65419 +       read_unlock(&devtree_lock);
65420 +       return np;
65421 +}
65422 +EXPORT_SYMBOL(of_find_matching_node);
65423 diff -x .git -x .gitignore -Nur linux-2.6.24/drivers/of/device.c powerpc.git/drivers/of/device.c
65424 --- linux-2.6.24/drivers/of/device.c    2008-01-24 23:58:37.000000000 +0100
65425 +++ powerpc.git/drivers/of/device.c     2008-01-28 20:26:17.000000000 +0100
65426 @@ -10,35 +10,6 @@
65427  #include <asm/errno.h>
65428  
65429  /**
65430 - * of_match_node - Tell if an device_node has a matching of_match structure
65431 - * @ids: array of of device match structures to search in
65432 - * @node: the of device structure to match against
65433 - *
65434 - * Low level utility function used by device matching.
65435 - */
65436 -const struct of_device_id *of_match_node(const struct of_device_id *matches,
65437 -                                        const struct device_node *node)
65438 -{
65439 -       while (matches->name[0] || matches->type[0] || matches->compatible[0]) {
65440 -               int match = 1;
65441 -               if (matches->name[0])
65442 -                       match &= node->name
65443 -                               && !strcmp(matches->name, node->name);
65444 -               if (matches->type[0])
65445 -                       match &= node->type
65446 -                               && !strcmp(matches->type, node->type);
65447 -               if (matches->compatible[0])
65448 -                       match &= of_device_is_compatible(node,
65449 -                                               matches->compatible);
65450 -               if (match)
65451 -                       return matches;
65452 -               matches++;
65453 -       }
65454 -       return NULL;
65455 -}
65456 -EXPORT_SYMBOL(of_match_node);
65457 -
65458 -/**
65459   * of_match_device - Tell if an of_device structure has a matching
65460   * of_match structure
65461   * @ids: array of of device match structures to search in
65462 diff -x .git -x .gitignore -Nur linux-2.6.24/drivers/ps3/Makefile powerpc.git/drivers/ps3/Makefile
65463 --- linux-2.6.24/drivers/ps3/Makefile   2008-01-24 23:58:37.000000000 +0100
65464 +++ powerpc.git/drivers/ps3/Makefile    2008-01-28 20:26:18.000000000 +0100
65465 @@ -4,3 +4,4 @@
65466  obj-$(CONFIG_PPC_PS3) += sys-manager-core.o
65467  obj-$(CONFIG_PS3_SYS_MANAGER) += ps3-sys-manager.o
65468  obj-$(CONFIG_PS3_STORAGE) += ps3stor_lib.o
65469 +obj-$(CONFIG_PS3_LPM) += ps3-lpm.o
65470 diff -x .git -x .gitignore -Nur linux-2.6.24/drivers/ps3/ps3-lpm.c powerpc.git/drivers/ps3/ps3-lpm.c
65471 --- linux-2.6.24/drivers/ps3/ps3-lpm.c  1970-01-01 01:00:00.000000000 +0100
65472 +++ powerpc.git/drivers/ps3/ps3-lpm.c   2008-01-28 20:26:18.000000000 +0100
65473 @@ -0,0 +1,1248 @@
65474 +/*
65475 + * PS3 Logical Performance Monitor.
65476 + *
65477 + *  Copyright (C) 2007 Sony Computer Entertainment Inc.
65478 + *  Copyright 2007 Sony Corp.
65479 + *
65480 + *  This program is free software; you can redistribute it and/or modify
65481 + *  it under the terms of the GNU General Public License as published by
65482 + *  the Free Software Foundation; version 2 of the License.
65483 + *
65484 + *  This program is distributed in the hope that it will be useful,
65485 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
65486 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
65487 + *  GNU General Public License for more details.
65488 + *
65489 + *  You should have received a copy of the GNU General Public License
65490 + *  along with this program; if not, write to the Free Software
65491 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
65492 + */
65493 +
65494 +#include <linux/kernel.h>
65495 +#include <linux/module.h>
65496 +#include <linux/interrupt.h>
65497 +#include <linux/uaccess.h>
65498 +#include <asm/ps3.h>
65499 +#include <asm/lv1call.h>
65500 +#include <asm/cell-pmu.h>
65501 +
65502 +
65503 +/* BOOKMARK tag macros */
65504 +#define PS3_PM_BOOKMARK_START                    0x8000000000000000ULL
65505 +#define PS3_PM_BOOKMARK_STOP                     0x4000000000000000ULL
65506 +#define PS3_PM_BOOKMARK_TAG_KERNEL               0x1000000000000000ULL
65507 +#define PS3_PM_BOOKMARK_TAG_USER                 0x3000000000000000ULL
65508 +#define PS3_PM_BOOKMARK_TAG_MASK_HI              0xF000000000000000ULL
65509 +#define PS3_PM_BOOKMARK_TAG_MASK_LO              0x0F00000000000000ULL
65510 +
65511 +/* CBE PM CONTROL register macros */
65512 +#define PS3_PM_CONTROL_PPU_TH0_BOOKMARK          0x00001000
65513 +#define PS3_PM_CONTROL_PPU_TH1_BOOKMARK          0x00000800
65514 +#define PS3_PM_CONTROL_PPU_COUNT_MODE_MASK       0x000C0000
65515 +#define PS3_PM_CONTROL_PPU_COUNT_MODE_PROBLEM    0x00080000
65516 +#define PS3_WRITE_PM_MASK                        0xFFFFFFFFFFFFFFFFULL
65517 +
65518 +/* CBE PM START STOP register macros */
65519 +#define PS3_PM_START_STOP_PPU_TH0_BOOKMARK_START 0x02000000
65520 +#define PS3_PM_START_STOP_PPU_TH1_BOOKMARK_START 0x01000000
65521 +#define PS3_PM_START_STOP_PPU_TH0_BOOKMARK_STOP  0x00020000
65522 +#define PS3_PM_START_STOP_PPU_TH1_BOOKMARK_STOP  0x00010000
65523 +#define PS3_PM_START_STOP_START_MASK             0xFF000000
65524 +#define PS3_PM_START_STOP_STOP_MASK              0x00FF0000
65525 +
65526 +/* CBE PM COUNTER register macres */
65527 +#define PS3_PM_COUNTER_MASK_HI                   0xFFFFFFFF00000000ULL
65528 +#define PS3_PM_COUNTER_MASK_LO                   0x00000000FFFFFFFFULL
65529 +
65530 +/* BASE SIGNAL GROUP NUMBER macros */
65531 +#define PM_ISLAND2_BASE_SIGNAL_GROUP_NUMBER  0
65532 +#define PM_ISLAND2_SIGNAL_GROUP_NUMBER1      6
65533 +#define PM_ISLAND2_SIGNAL_GROUP_NUMBER2      7
65534 +#define PM_ISLAND3_BASE_SIGNAL_GROUP_NUMBER  7
65535 +#define PM_ISLAND4_BASE_SIGNAL_GROUP_NUMBER  15
65536 +#define PM_SPU_TRIGGER_SIGNAL_GROUP_NUMBER   17
65537 +#define PM_SPU_EVENT_SIGNAL_GROUP_NUMBER     18
65538 +#define PM_ISLAND5_BASE_SIGNAL_GROUP_NUMBER  18
65539 +#define PM_ISLAND6_BASE_SIGNAL_GROUP_NUMBER  24
65540 +#define PM_ISLAND7_BASE_SIGNAL_GROUP_NUMBER  49
65541 +#define PM_ISLAND8_BASE_SIGNAL_GROUP_NUMBER  52
65542 +#define PM_SIG_GROUP_SPU                     41
65543 +#define PM_SIG_GROUP_SPU_TRIGGER             42
65544 +#define PM_SIG_GROUP_SPU_EVENT               43
65545 +#define PM_SIG_GROUP_MFC_MAX                 60
65546 +
65547 +/**
65548 + * struct ps3_lpm_shadow_regs - Performance monitor shadow registers.
65549 + *
65550 + * @pm_control: Shadow of the processor's pm_control register.
65551 + * @pm_start_stop: Shadow of the processor's pm_start_stop register.
65552 + * @pm_interval: Shadow of the processor's pm_interval register.
65553 + * @group_control: Shadow of the processor's group_control register.
65554 + * @debug_bus_control: Shadow of the processor's debug_bus_control register.
65555 + *
65556 + * The logical performance monitor provides a write-only interface to
65557 + * these processor registers.  These shadow variables cache the processor
65558 + * register values for reading.
65559 + *
65560 + * The initial value of the shadow registers at lpm creation is
65561 + * PS3_LPM_SHADOW_REG_INIT.
65562 + */
65563 +
65564 +struct ps3_lpm_shadow_regs {
65565 +       u64 pm_control;
65566 +       u64 pm_start_stop;
65567 +       u64 pm_interval;
65568 +       u64 group_control;
65569 +       u64 debug_bus_control;
65570 +};
65571 +
65572 +#define PS3_LPM_SHADOW_REG_INIT 0xFFFFFFFF00000000ULL
65573 +
65574 +/**
65575 + * struct ps3_lpm_priv - Private lpm device data.
65576 + *
65577 + * @open: An atomic variable indicating the lpm driver has been opened.
65578 + * @rights: The lpm rigths granted by the system policy module.  A logical
65579 + *  OR of enum ps3_lpm_rights.
65580 + * @node_id: The node id of a BE prosessor whose performance monitor this
65581 + *  lpar has the right to use.
65582 + * @pu_id: The lv1 id of the logical PU.
65583 + * @lpm_id: The lv1 id of this lpm instance.
65584 + * @outlet_id: The outlet created by lv1 for this lpm instance.
65585 + * @tb_count: The number of bytes of data held in the lv1 trace buffer.
65586 + * @tb_cache: Kernel buffer to receive the data from the lv1 trace buffer.
65587 + *  Must be 128 byte aligned.
65588 + * @tb_cache_size: Size of the kernel @tb_cache buffer.  Must be 128 byte
65589 + *  aligned.
65590 + * @tb_cache_internal: An unaligned buffer allocated by this driver to be
65591 + *  used for the trace buffer cache when ps3_lpm_open() is called with a
65592 + *  NULL tb_cache argument.  Otherwise unused.
65593 + * @shadow: Processor register shadow of type struct ps3_lpm_shadow_regs.
65594 + * @sbd: The struct ps3_system_bus_device attached to this driver.
65595 + *
65596 + * The trace buffer is a buffer allocated and used internally to the lv1
65597 + * hypervisor to collect trace data.  The trace buffer cache is a guest
65598 + * buffer that accepts the trace data from the trace buffer.
65599 + */
65600 +
65601 +struct ps3_lpm_priv {
65602 +       atomic_t open;
65603 +       u64 rights;
65604 +       u64 node_id;
65605 +       u64 pu_id;
65606 +       u64 lpm_id;
65607 +       u64 outlet_id;
65608 +       u64 tb_count;
65609 +       void *tb_cache;
65610 +       u64 tb_cache_size;
65611 +       void *tb_cache_internal;
65612 +       struct ps3_lpm_shadow_regs shadow;
65613 +       struct ps3_system_bus_device *sbd;
65614 +};
65615 +
65616 +enum {
65617 +       PS3_LPM_DEFAULT_TB_CACHE_SIZE = 0x4000,
65618 +};
65619 +
65620 +/**
65621 + * lpm_priv - Static instance of the lpm data.
65622 + *
65623 + * Since the exported routines don't support the notion of a device
65624 + * instance we need to hold the instance in this static variable
65625 + * and then only allow at most one instance at a time to be created.
65626 + */
65627 +
65628 +static struct ps3_lpm_priv *lpm_priv;
65629 +
65630 +static struct device *sbd_core(void)
65631 +{
65632 +       BUG_ON(!lpm_priv || !lpm_priv->sbd);
65633 +       return &lpm_priv->sbd->core;
65634 +}
65635 +
65636 +/**
65637 + * use_start_stop_bookmark - Enable the PPU bookmark trace.
65638 + *
65639 + * And it enables PPU bookmark triggers ONLY if the other triggers are not set.
65640 + * The start/stop bookmarks are inserted at ps3_enable_pm() and ps3_disable_pm()
65641 + * to start/stop LPM.
65642 + *
65643 + * Used to get good quality of the performance counter.
65644 + */
65645 +
65646 +enum {use_start_stop_bookmark = 1,};
65647 +
65648 +void ps3_set_bookmark(u64 bookmark)
65649 +{
65650 +       /*
65651 +        * As per the PPE book IV, to avoid bookmark loss there must
65652 +        * not be a traced branch within 10 cycles of setting the
65653 +        * SPRN_BKMK register.  The actual text is unclear if 'within'
65654 +        * includes cycles before the call.
65655 +        */
65656 +
65657 +       asm volatile("or 29, 29, 29;"); /* db10cyc */
65658 +       mtspr(SPRN_BKMK, bookmark);
65659 +       asm volatile("or 29, 29, 29;"); /* db10cyc */
65660 +}
65661 +EXPORT_SYMBOL_GPL(ps3_set_bookmark);
65662 +
65663 +void ps3_set_pm_bookmark(u64 tag, u64 incident, u64 th_id)
65664 +{
65665 +       u64 bookmark;
65666 +
65667 +       bookmark = (get_tb() & 0x00000000FFFFFFFFULL) |
65668 +               PS3_PM_BOOKMARK_TAG_KERNEL;
65669 +       bookmark = ((tag << 56) & PS3_PM_BOOKMARK_TAG_MASK_LO) |
65670 +               (incident << 48) | (th_id << 32) | bookmark;
65671 +       ps3_set_bookmark(bookmark);
65672 +}
65673 +EXPORT_SYMBOL_GPL(ps3_set_pm_bookmark);
65674 +
65675 +/**
65676 + * ps3_read_phys_ctr - Read physical counter registers.
65677 + *
65678 + * Each physical counter can act as one 32 bit counter or as two 16 bit
65679 + * counters.
65680 + */
65681 +
65682 +u32 ps3_read_phys_ctr(u32 cpu, u32 phys_ctr)
65683 +{
65684 +       int result;
65685 +       u64 counter0415;
65686 +       u64 counter2637;
65687 +
65688 +       if (phys_ctr >= NR_PHYS_CTRS) {
65689 +               dev_dbg(sbd_core(), "%s:%u: phys_ctr too big: %u\n", __func__,
65690 +                       __LINE__, phys_ctr);
65691 +               return 0;
65692 +       }
65693 +
65694 +       result = lv1_set_lpm_counter(lpm_priv->lpm_id, 0, 0, 0, 0, &counter0415,
65695 +                                    &counter2637);
65696 +       if (result) {
65697 +               dev_err(sbd_core(), "%s:%u: lv1_set_lpm_counter failed: "
65698 +                       "phys_ctr %u, %s\n", __func__, __LINE__, phys_ctr,
65699 +                       ps3_result(result));
65700 +               return 0;
65701 +       }
65702 +
65703 +       switch (phys_ctr) {
65704 +       case 0:
65705 +               return counter0415 >> 32;
65706 +       case 1:
65707 +               return counter0415 & PS3_PM_COUNTER_MASK_LO;
65708 +       case 2:
65709 +               return counter2637 >> 32;
65710 +       case 3:
65711 +               return counter2637 & PS3_PM_COUNTER_MASK_LO;
65712 +       default:
65713 +               BUG();
65714 +       }
65715 +       return 0;
65716 +}
65717 +EXPORT_SYMBOL_GPL(ps3_read_phys_ctr);
65718 +
65719 +/**
65720 + * ps3_write_phys_ctr - Write physical counter registers.
65721 + *
65722 + * Each physical counter can act as one 32 bit counter or as two 16 bit
65723 + * counters.
65724 + */
65725 +
65726 +void ps3_write_phys_ctr(u32 cpu, u32 phys_ctr, u32 val)
65727 +{
65728 +       u64 counter0415;
65729 +       u64 counter0415_mask;
65730 +       u64 counter2637;
65731 +       u64 counter2637_mask;
65732 +       int result;
65733 +
65734 +       if (phys_ctr >= NR_PHYS_CTRS) {
65735 +               dev_dbg(sbd_core(), "%s:%u: phys_ctr too big: %u\n", __func__,
65736 +                       __LINE__, phys_ctr);
65737 +               return;
65738 +       }
65739 +
65740 +       switch (phys_ctr) {
65741 +       case 0:
65742 +               counter0415 = (u64)val << 32;
65743 +               counter0415_mask = PS3_PM_COUNTER_MASK_HI;
65744 +               counter2637 = 0x0;
65745 +               counter2637_mask = 0x0;
65746 +               break;
65747 +       case 1:
65748 +               counter0415 = (u64)val;
65749 +               counter0415_mask = PS3_PM_COUNTER_MASK_LO;
65750 +               counter2637 = 0x0;
65751 +               counter2637_mask = 0x0;
65752 +               break;
65753 +       case 2:
65754 +               counter0415 = 0x0;
65755 +               counter0415_mask = 0x0;
65756 +               counter2637 = (u64)val << 32;
65757 +               counter2637_mask = PS3_PM_COUNTER_MASK_HI;
65758 +               break;
65759 +       case 3:
65760 +               counter0415 = 0x0;
65761 +               counter0415_mask = 0x0;
65762 +               counter2637 = (u64)val;
65763 +               counter2637_mask = PS3_PM_COUNTER_MASK_LO;
65764 +               break;
65765 +       default:
65766 +               BUG();
65767 +       }
65768 +
65769 +       result = lv1_set_lpm_counter(lpm_priv->lpm_id,
65770 +                                    counter0415, counter0415_mask,
65771 +                                    counter2637, counter2637_mask,
65772 +                                    &counter0415, &counter2637);
65773 +       if (result)
65774 +               dev_err(sbd_core(), "%s:%u: lv1_set_lpm_counter failed: "
65775 +                       "phys_ctr %u, val %u, %s\n", __func__, __LINE__,
65776 +                       phys_ctr, val, ps3_result(result));
65777 +}
65778 +EXPORT_SYMBOL_GPL(ps3_write_phys_ctr);
65779 +
65780 +/**
65781 + * ps3_read_ctr - Read counter.
65782 + *
65783 + * Read 16 or 32 bits depending on the current size of the counter.
65784 + * Counters 4, 5, 6 & 7 are always 16 bit.
65785 + */
65786 +
65787 +u32 ps3_read_ctr(u32 cpu, u32 ctr)
65788 +{
65789 +       u32 val;
65790 +       u32 phys_ctr = ctr & (NR_PHYS_CTRS - 1);
65791 +
65792 +       val = ps3_read_phys_ctr(cpu, phys_ctr);
65793 +
65794 +       if (ps3_get_ctr_size(cpu, phys_ctr) == 16)
65795 +               val = (ctr < NR_PHYS_CTRS) ? (val >> 16) : (val & 0xffff);
65796 +
65797 +       return val;
65798 +}
65799 +EXPORT_SYMBOL_GPL(ps3_read_ctr);
65800 +
65801 +/**
65802 + * ps3_write_ctr - Write counter.
65803 + *
65804 + * Write 16 or 32 bits depending on the current size of the counter.
65805 + * Counters 4, 5, 6 & 7 are always 16 bit.
65806 + */
65807 +
65808 +void ps3_write_ctr(u32 cpu, u32 ctr, u32 val)
65809 +{
65810 +       u32 phys_ctr;
65811 +       u32 phys_val;
65812 +
65813 +       phys_ctr = ctr & (NR_PHYS_CTRS - 1);
65814 +
65815 +       if (ps3_get_ctr_size(cpu, phys_ctr) == 16) {
65816 +               phys_val = ps3_read_phys_ctr(cpu, phys_ctr);
65817 +
65818 +               if (ctr < NR_PHYS_CTRS)
65819 +                       val = (val << 16) | (phys_val & 0xffff);
65820 +               else
65821 +                       val = (val & 0xffff) | (phys_val & 0xffff0000);
65822 +       }
65823 +
65824 +       ps3_write_phys_ctr(cpu, phys_ctr, val);
65825 +}
65826 +EXPORT_SYMBOL_GPL(ps3_write_ctr);
65827 +
65828 +/**
65829 + * ps3_read_pm07_control - Read counter control registers.
65830 + *
65831 + * Each logical counter has a corresponding control register.
65832 + */
65833 +
65834 +u32 ps3_read_pm07_control(u32 cpu, u32 ctr)
65835 +{
65836 +       return 0;
65837 +}
65838 +EXPORT_SYMBOL_GPL(ps3_read_pm07_control);
65839 +
65840 +/**
65841 + * ps3_write_pm07_control - Write counter control registers.
65842 + *
65843 + * Each logical counter has a corresponding control register.
65844 + */
65845 +
65846 +void ps3_write_pm07_control(u32 cpu, u32 ctr, u32 val)
65847 +{
65848 +       int result;
65849 +       static const u64 mask = 0xFFFFFFFFFFFFFFFFULL;
65850 +       u64 old_value;
65851 +
65852 +       if (ctr >= NR_CTRS) {
65853 +               dev_dbg(sbd_core(), "%s:%u: ctr too big: %u\n", __func__,
65854 +                       __LINE__, ctr);
65855 +               return;
65856 +       }
65857 +
65858 +       result = lv1_set_lpm_counter_control(lpm_priv->lpm_id, ctr, val, mask,
65859 +                                            &old_value);
65860 +       if (result)
65861 +               dev_err(sbd_core(), "%s:%u: lv1_set_lpm_counter_control "
65862 +                       "failed: ctr %u, %s\n", __func__, __LINE__, ctr,
65863 +                       ps3_result(result));
65864 +}
65865 +EXPORT_SYMBOL_GPL(ps3_write_pm07_control);
65866 +
65867 +/**
65868 + * ps3_read_pm - Read Other LPM control registers.
65869 + */
65870 +
65871 +u32 ps3_read_pm(u32 cpu, enum pm_reg_name reg)
65872 +{
65873 +       int result = 0;
65874 +       u64 val = 0;
65875 +
65876 +       switch (reg) {
65877 +       case pm_control:
65878 +               return lpm_priv->shadow.pm_control;
65879 +       case trace_address:
65880 +               return CBE_PM_TRACE_BUF_EMPTY;
65881 +       case pm_start_stop:
65882 +               return lpm_priv->shadow.pm_start_stop;
65883 +       case pm_interval:
65884 +               return lpm_priv->shadow.pm_interval;
65885 +       case group_control:
65886 +               return lpm_priv->shadow.group_control;
65887 +       case debug_bus_control:
65888 +               return lpm_priv->shadow.debug_bus_control;
65889 +       case pm_status:
65890 +               result = lv1_get_lpm_interrupt_status(lpm_priv->lpm_id,
65891 +                                                     &val);
65892 +               if (result) {
65893 +                       val = 0;
65894 +                       dev_dbg(sbd_core(), "%s:%u: lv1 get_lpm_status failed: "
65895 +                               "reg %u, %s\n", __func__, __LINE__, reg,
65896 +                               ps3_result(result));
65897 +               }
65898 +               return (u32)val;
65899 +       case ext_tr_timer:
65900 +               return 0;
65901 +       default:
65902 +               dev_dbg(sbd_core(), "%s:%u: unknown reg: %d\n", __func__,
65903 +                       __LINE__, reg);
65904 +               BUG();
65905 +               break;
65906 +       }
65907 +
65908 +       return 0;
65909 +}
65910 +EXPORT_SYMBOL_GPL(ps3_read_pm);
65911 +
65912 +/**
65913 + * ps3_write_pm - Write Other LPM control registers.
65914 + */
65915 +
65916 +void ps3_write_pm(u32 cpu, enum pm_reg_name reg, u32 val)
65917 +{
65918 +       int result = 0;
65919 +       u64 dummy;
65920 +
65921 +       switch (reg) {
65922 +       case group_control:
65923 +               if (val != lpm_priv->shadow.group_control)
65924 +                       result = lv1_set_lpm_group_control(lpm_priv->lpm_id,
65925 +                                                          val,
65926 +                                                          PS3_WRITE_PM_MASK,
65927 +                                                          &dummy);
65928 +               lpm_priv->shadow.group_control = val;
65929 +               break;
65930 +       case debug_bus_control:
65931 +               if (val != lpm_priv->shadow.debug_bus_control)
65932 +                       result = lv1_set_lpm_debug_bus_control(lpm_priv->lpm_id,
65933 +                                                             val,
65934 +                                                             PS3_WRITE_PM_MASK,
65935 +                                                             &dummy);
65936 +               lpm_priv->shadow.debug_bus_control = val;
65937 +               break;
65938 +       case pm_control:
65939 +               if (use_start_stop_bookmark)
65940 +                       val |= (PS3_PM_CONTROL_PPU_TH0_BOOKMARK |
65941 +                               PS3_PM_CONTROL_PPU_TH1_BOOKMARK);
65942 +               if (val != lpm_priv->shadow.pm_control)
65943 +                       result = lv1_set_lpm_general_control(lpm_priv->lpm_id,
65944 +                                                            val,
65945 +                                                            PS3_WRITE_PM_MASK,
65946 +                                                            0, 0, &dummy,
65947 +                                                            &dummy);
65948 +               lpm_priv->shadow.pm_control = val;
65949 +               break;
65950 +       case pm_interval:
65951 +               if (val != lpm_priv->shadow.pm_interval)
65952 +                       result = lv1_set_lpm_interval(lpm_priv->lpm_id, val,
65953 +                                                  PS3_WRITE_PM_MASK, &dummy);
65954 +               lpm_priv->shadow.pm_interval = val;
65955 +               break;
65956 +       case pm_start_stop:
65957 +               if (val != lpm_priv->shadow.pm_start_stop)
65958 +                       result = lv1_set_lpm_trigger_control(lpm_priv->lpm_id,
65959 +                                                            val,
65960 +                                                            PS3_WRITE_PM_MASK,
65961 +                                                            &dummy);
65962 +               lpm_priv->shadow.pm_start_stop = val;
65963 +               break;
65964 +       case trace_address:
65965 +       case ext_tr_timer:
65966 +       case pm_status:
65967 +               break;
65968 +       default:
65969 +               dev_dbg(sbd_core(), "%s:%u: unknown reg: %d\n", __func__,
65970 +                       __LINE__, reg);
65971 +               BUG();
65972 +               break;
65973 +       }
65974 +
65975 +       if (result)
65976 +               dev_err(sbd_core(), "%s:%u: lv1 set_control failed: "
65977 +                       "reg %u, %s\n", __func__, __LINE__, reg,
65978 +                       ps3_result(result));
65979 +}
65980 +EXPORT_SYMBOL_GPL(ps3_write_pm);
65981 +
65982 +/**
65983 + * ps3_get_ctr_size - Get the size of a physical counter.
65984 + *
65985 + * Returns either 16 or 32.
65986 + */
65987 +
65988 +u32 ps3_get_ctr_size(u32 cpu, u32 phys_ctr)
65989 +{
65990 +       u32 pm_ctrl;
65991 +
65992 +       if (phys_ctr >= NR_PHYS_CTRS) {
65993 +               dev_dbg(sbd_core(), "%s:%u: phys_ctr too big: %u\n", __func__,
65994 +                       __LINE__, phys_ctr);
65995 +               return 0;
65996 +       }
65997 +
65998 +       pm_ctrl = ps3_read_pm(cpu, pm_control);
65999 +       return (pm_ctrl & CBE_PM_16BIT_CTR(phys_ctr)) ? 16 : 32;
66000 +}
66001 +EXPORT_SYMBOL_GPL(ps3_get_ctr_size);
66002 +
66003 +/**
66004 + * ps3_set_ctr_size - Set the size of a physical counter to 16 or 32 bits.
66005 + */
66006 +
66007 +void ps3_set_ctr_size(u32 cpu, u32 phys_ctr, u32 ctr_size)
66008 +{
66009 +       u32 pm_ctrl;
66010 +
66011 +       if (phys_ctr >= NR_PHYS_CTRS) {
66012 +               dev_dbg(sbd_core(), "%s:%u: phys_ctr too big: %u\n", __func__,
66013 +                       __LINE__, phys_ctr);
66014 +               return;
66015 +       }
66016 +
66017 +       pm_ctrl = ps3_read_pm(cpu, pm_control);
66018 +
66019 +       switch (ctr_size) {
66020 +       case 16:
66021 +               pm_ctrl |= CBE_PM_16BIT_CTR(phys_ctr);
66022 +               ps3_write_pm(cpu, pm_control, pm_ctrl);
66023 +               break;
66024 +
66025 +       case 32:
66026 +               pm_ctrl &= ~CBE_PM_16BIT_CTR(phys_ctr);
66027 +               ps3_write_pm(cpu, pm_control, pm_ctrl);
66028 +               break;
66029 +       default:
66030 +               BUG();
66031 +       }
66032 +}
66033 +EXPORT_SYMBOL_GPL(ps3_set_ctr_size);
66034 +
66035 +static u64 pm_translate_signal_group_number_on_island2(u64 subgroup)
66036 +{
66037 +
66038 +       if (subgroup == 2)
66039 +               subgroup = 3;
66040 +
66041 +       if (subgroup <= 6)
66042 +               return PM_ISLAND2_BASE_SIGNAL_GROUP_NUMBER + subgroup;
66043 +       else if (subgroup == 7)
66044 +               return PM_ISLAND2_SIGNAL_GROUP_NUMBER1;
66045 +       else
66046 +               return PM_ISLAND2_SIGNAL_GROUP_NUMBER2;
66047 +}
66048 +
66049 +static u64 pm_translate_signal_group_number_on_island3(u64 subgroup)
66050 +{
66051 +
66052 +       switch (subgroup) {
66053 +       case 2:
66054 +       case 3:
66055 +       case 4:
66056 +               subgroup += 2;
66057 +               break;
66058 +       case 5:
66059 +               subgroup = 8;
66060 +               break;
66061 +       default:
66062 +               break;
66063 +       }
66064 +       return PM_ISLAND3_BASE_SIGNAL_GROUP_NUMBER + subgroup;
66065 +}
66066 +
66067 +static u64 pm_translate_signal_group_number_on_island4(u64 subgroup)
66068 +{
66069 +       return PM_ISLAND4_BASE_SIGNAL_GROUP_NUMBER + subgroup;
66070 +}
66071 +
66072 +static u64 pm_translate_signal_group_number_on_island5(u64 subgroup)
66073 +{
66074 +
66075 +       switch (subgroup) {
66076 +       case 3:
66077 +               subgroup = 4;
66078 +               break;
66079 +       case 4:
66080 +               subgroup = 6;
66081 +               break;
66082 +       default:
66083 +               break;
66084 +       }
66085 +       return PM_ISLAND5_BASE_SIGNAL_GROUP_NUMBER + subgroup;
66086 +}
66087 +
66088 +static u64 pm_translate_signal_group_number_on_island6(u64 subgroup,
66089 +                                                      u64 subsubgroup)
66090 +{
66091 +       switch (subgroup) {
66092 +       case 3:
66093 +       case 4:
66094 +       case 5:
66095 +               subgroup += 1;
66096 +               break;
66097 +       default:
66098 +               break;
66099 +       }
66100 +
66101 +       switch (subsubgroup) {
66102 +       case 4:
66103 +       case 5:
66104 +       case 6:
66105 +               subsubgroup += 2;
66106 +               break;
66107 +       case 7:
66108 +       case 8:
66109 +       case 9:
66110 +       case 10:
66111 +               subsubgroup += 4;
66112 +               break;
66113 +       case 11:
66114 +       case 12:
66115 +       case 13:
66116 +               subsubgroup += 5;
66117 +               break;
66118 +       default:
66119 +               break;
66120 +       }
66121 +
66122 +       if (subgroup <= 5)
66123 +               return (PM_ISLAND6_BASE_SIGNAL_GROUP_NUMBER + subgroup);
66124 +       else
66125 +               return (PM_ISLAND6_BASE_SIGNAL_GROUP_NUMBER + subgroup
66126 +                       + subsubgroup - 1);
66127 +}
66128 +
66129 +static u64 pm_translate_signal_group_number_on_island7(u64 subgroup)
66130 +{
66131 +       return PM_ISLAND7_BASE_SIGNAL_GROUP_NUMBER + subgroup;
66132 +}
66133 +
66134 +static u64 pm_translate_signal_group_number_on_island8(u64 subgroup)
66135 +{
66136 +       return PM_ISLAND8_BASE_SIGNAL_GROUP_NUMBER + subgroup;
66137 +}
66138 +
66139 +static u64 pm_signal_group_to_ps3_lv1_signal_group(u64 group)
66140 +{
66141 +       u64 island;
66142 +       u64 subgroup;
66143 +       u64 subsubgroup;
66144 +
66145 +       subgroup = 0;
66146 +       subsubgroup = 0;
66147 +       island = 0;
66148 +       if (group < 1000) {
66149 +               if (group < 100) {
66150 +                       if (20 <= group && group < 30) {
66151 +                               island = 2;
66152 +                               subgroup = group - 20;
66153 +                       } else if (30 <= group && group < 40) {
66154 +                               island = 3;
66155 +                               subgroup = group - 30;
66156 +                       } else if (40 <= group && group < 50) {
66157 +                               island = 4;
66158 +                               subgroup = group - 40;
66159 +                       } else if (50 <= group && group < 60) {
66160 +                               island = 5;
66161 +                               subgroup = group - 50;
66162 +                       } else if (60 <= group && group < 70) {
66163 +                               island = 6;
66164 +                               subgroup = group - 60;
66165 +                       } else if (70 <= group && group < 80) {
66166 +                               island = 7;
66167 +                               subgroup = group - 70;
66168 +                       } else if (80 <= group && group < 90) {
66169 +                               island = 8;
66170 +                               subgroup = group - 80;
66171 +                       }
66172 +               } else if (200 <= group && group < 300) {
66173 +                       island = 2;
66174 +                       subgroup = group - 200;
66175 +               } else if (600 <= group && group < 700) {
66176 +                       island = 6;
66177 +                       subgroup = 5;
66178 +                       subsubgroup = group - 650;
66179 +               }
66180 +       } else if (6000 <= group && group < 7000) {
66181 +               island = 6;
66182 +               subgroup = 5;
66183 +               subsubgroup = group - 6500;
66184 +       }
66185 +
66186 +       switch (island) {
66187 +       case 2:
66188 +               return pm_translate_signal_group_number_on_island2(subgroup);
66189 +       case 3:
66190 +               return pm_translate_signal_group_number_on_island3(subgroup);
66191 +       case 4:
66192 +               return pm_translate_signal_group_number_on_island4(subgroup);
66193 +       case 5:
66194 +               return pm_translate_signal_group_number_on_island5(subgroup);
66195 +       case 6:
66196 +               return pm_translate_signal_group_number_on_island6(subgroup,
66197 +                                                                  subsubgroup);
66198 +       case 7:
66199 +               return pm_translate_signal_group_number_on_island7(subgroup);
66200 +       case 8:
66201 +               return pm_translate_signal_group_number_on_island8(subgroup);
66202 +       default:
66203 +               dev_dbg(sbd_core(), "%s:%u: island not found: %lu\n", __func__,
66204 +                       __LINE__, group);
66205 +               BUG();
66206 +               break;
66207 +       }
66208 +       return 0;
66209 +}
66210 +
66211 +static u64 pm_bus_word_to_ps3_lv1_bus_word(u8 word)
66212 +{
66213 +
66214 +       switch (word) {
66215 +       case 1:
66216 +               return 0xF000;
66217 +       case 2:
66218 +               return 0x0F00;
66219 +       case 4:
66220 +               return 0x00F0;
66221 +       case 8:
66222 +       default:
66223 +               return 0x000F;
66224 +       }
66225 +}
66226 +
66227 +static int __ps3_set_signal(u64 lv1_signal_group, u64 bus_select,
66228 +                           u64 signal_select, u64 attr1, u64 attr2, u64 attr3)
66229 +{
66230 +       int ret;
66231 +
66232 +       ret = lv1_set_lpm_signal(lpm_priv->lpm_id, lv1_signal_group, bus_select,
66233 +                                signal_select, attr1, attr2, attr3);
66234 +       if (ret)
66235 +               dev_err(sbd_core(),
66236 +                       "%s:%u: error:%d 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx\n",
66237 +                       __func__, __LINE__, ret, lv1_signal_group, bus_select,
66238 +                       signal_select, attr1, attr2, attr3);
66239 +
66240 +       return ret;
66241 +}
66242 +
66243 +int ps3_set_signal(u64 signal_group, u8 signal_bit, u16 sub_unit,
66244 +                  u8 bus_word)
66245 +{
66246 +       int ret;
66247 +       u64 lv1_signal_group;
66248 +       u64 bus_select;
66249 +       u64 signal_select;
66250 +       u64 attr1, attr2, attr3;
66251 +
66252 +       if (signal_group == 0)
66253 +               return __ps3_set_signal(0, 0, 0, 0, 0, 0);
66254 +
66255 +       lv1_signal_group =
66256 +               pm_signal_group_to_ps3_lv1_signal_group(signal_group);
66257 +       bus_select = pm_bus_word_to_ps3_lv1_bus_word(bus_word);
66258 +
66259 +       switch (signal_group) {
66260 +       case PM_SIG_GROUP_SPU_TRIGGER:
66261 +               signal_select = 1;
66262 +               signal_select = signal_select << (63 - signal_bit);
66263 +               break;
66264 +       case PM_SIG_GROUP_SPU_EVENT:
66265 +               signal_select = 1;
66266 +               signal_select = (signal_select << (63 - signal_bit)) | 0x3;
66267 +               break;
66268 +       default:
66269 +               signal_select = 0;
66270 +               break;
66271 +       }
66272 +
66273 +       /*
66274 +        * 0: physical object.
66275 +        * 1: logical object.
66276 +        * This parameter is only used for the PPE and SPE signals.
66277 +        */
66278 +       attr1 = 1;
66279 +
66280 +       /*
66281 +        * This parameter is used to specify the target physical/logical
66282 +        * PPE/SPE object.
66283 +        */
66284 +       if (PM_SIG_GROUP_SPU <= signal_group &&
66285 +               signal_group < PM_SIG_GROUP_MFC_MAX)
66286 +               attr2 = sub_unit;
66287 +       else
66288 +               attr2 = lpm_priv->pu_id;
66289 +
66290 +       /*
66291 +        * This parameter is only used for setting the SPE signal.
66292 +        */
66293 +       attr3 = 0;
66294 +
66295 +       ret = __ps3_set_signal(lv1_signal_group, bus_select, signal_select,
66296 +                              attr1, attr2, attr3);
66297 +       if (ret)
66298 +               dev_err(sbd_core(), "%s:%u: __ps3_set_signal failed: %d\n",
66299 +                       __func__, __LINE__, ret);
66300 +
66301 +       return ret;
66302 +}
66303 +EXPORT_SYMBOL_GPL(ps3_set_signal);
66304 +
66305 +u32 ps3_get_hw_thread_id(int cpu)
66306 +{
66307 +       return get_hard_smp_processor_id(cpu);
66308 +}
66309 +EXPORT_SYMBOL_GPL(ps3_get_hw_thread_id);
66310 +
66311 +/**
66312 + * ps3_enable_pm - Enable the entire performance monitoring unit.
66313 + *
66314 + * When we enable the LPM, all pending writes to counters get committed.
66315 + */
66316 +
66317 +void ps3_enable_pm(u32 cpu)
66318 +{
66319 +       int result;
66320 +       u64 tmp;
66321 +       int insert_bookmark = 0;
66322 +
66323 +       lpm_priv->tb_count = 0;
66324 +
66325 +       if (use_start_stop_bookmark) {
66326 +               if (!(lpm_priv->shadow.pm_start_stop &
66327 +                       (PS3_PM_START_STOP_START_MASK
66328 +                       | PS3_PM_START_STOP_STOP_MASK))) {
66329 +                       result = lv1_set_lpm_trigger_control(lpm_priv->lpm_id,
66330 +                               (PS3_PM_START_STOP_PPU_TH0_BOOKMARK_START |
66331 +                               PS3_PM_START_STOP_PPU_TH1_BOOKMARK_START |
66332 +                               PS3_PM_START_STOP_PPU_TH0_BOOKMARK_STOP |
66333 +                               PS3_PM_START_STOP_PPU_TH1_BOOKMARK_STOP),
66334 +                               0xFFFFFFFFFFFFFFFFULL, &tmp);
66335 +
66336 +                       if (result)
66337 +                               dev_err(sbd_core(), "%s:%u: "
66338 +                                       "lv1_set_lpm_trigger_control failed: "
66339 +                                       "%s\n", __func__, __LINE__,
66340 +                                       ps3_result(result));
66341 +
66342 +                       insert_bookmark = !result;
66343 +               }
66344 +       }
66345 +
66346 +       result = lv1_start_lpm(lpm_priv->lpm_id);
66347 +
66348 +       if (result)
66349 +               dev_err(sbd_core(), "%s:%u: lv1_start_lpm failed: %s\n",
66350 +                       __func__, __LINE__, ps3_result(result));
66351 +
66352 +       if (use_start_stop_bookmark && !result && insert_bookmark)
66353 +               ps3_set_bookmark(get_tb() | PS3_PM_BOOKMARK_START);
66354 +}
66355 +EXPORT_SYMBOL_GPL(ps3_enable_pm);
66356 +
66357 +/**
66358 + * ps3_disable_pm - Disable the entire performance monitoring unit.
66359 + */
66360 +
66361 +void ps3_disable_pm(u32 cpu)
66362 +{
66363 +       int result;
66364 +       u64 tmp;
66365 +
66366 +       ps3_set_bookmark(get_tb() | PS3_PM_BOOKMARK_STOP);
66367 +
66368 +       result = lv1_stop_lpm(lpm_priv->lpm_id, &tmp);
66369 +
66370 +       if (result) {
66371 +               if(result != LV1_WRONG_STATE)
66372 +                       dev_err(sbd_core(), "%s:%u: lv1_stop_lpm failed: %s\n",
66373 +                               __func__, __LINE__, ps3_result(result));
66374 +               return;
66375 +       }
66376 +
66377 +       lpm_priv->tb_count = tmp;
66378 +
66379 +       dev_dbg(sbd_core(), "%s:%u: tb_count %lu (%lxh)\n", __func__, __LINE__,
66380 +               lpm_priv->tb_count, lpm_priv->tb_count);
66381 +}
66382 +EXPORT_SYMBOL_GPL(ps3_disable_pm);
66383 +
66384 +/**
66385 + * ps3_lpm_copy_tb - Copy data from the trace buffer to a kernel buffer.
66386 + * @offset: Offset in bytes from the start of the trace buffer.
66387 + * @buf: Copy destination.
66388 + * @count: Maximum count of bytes to copy.
66389 + * @bytes_copied: Pointer to a variable that will recieve the number of
66390 + *  bytes copied to @buf.
66391 + *
66392 + * On error @buf will contain any successfully copied trace buffer data
66393 + * and bytes_copied will be set to the number of bytes successfully copied.
66394 + */
66395 +
66396 +int ps3_lpm_copy_tb(unsigned long offset, void *buf, unsigned long count,
66397 +                   unsigned long *bytes_copied)
66398 +{
66399 +       int result;
66400 +
66401 +       *bytes_copied = 0;
66402 +
66403 +       if (!lpm_priv->tb_cache)
66404 +               return -EPERM;
66405 +
66406 +       if (offset >= lpm_priv->tb_count)
66407 +               return 0;
66408 +
66409 +       count = min(count, lpm_priv->tb_count - offset);
66410 +
66411 +       while (*bytes_copied < count) {
66412 +               const unsigned long request = count - *bytes_copied;
66413 +               u64 tmp;
66414 +
66415 +               result = lv1_copy_lpm_trace_buffer(lpm_priv->lpm_id, offset,
66416 +                                                  request, &tmp);
66417 +               if (result) {
66418 +                       dev_dbg(sbd_core(), "%s:%u: 0x%lx bytes at 0x%lx\n",
66419 +                               __func__, __LINE__, request, offset);
66420 +
66421 +                       dev_err(sbd_core(), "%s:%u: lv1_copy_lpm_trace_buffer "
66422 +                               "failed: %s\n", __func__, __LINE__,
66423 +                               ps3_result(result));
66424 +                       return result == LV1_WRONG_STATE ? -EBUSY : -EINVAL;
66425 +               }
66426 +
66427 +               memcpy(buf, lpm_priv->tb_cache, tmp);
66428 +               buf += tmp;
66429 +               *bytes_copied += tmp;
66430 +               offset += tmp;
66431 +       }
66432 +       dev_dbg(sbd_core(), "%s:%u: copied %lxh bytes\n", __func__, __LINE__,
66433 +               *bytes_copied);
66434 +
66435 +       return 0;
66436 +}
66437 +EXPORT_SYMBOL_GPL(ps3_lpm_copy_tb);
66438 +
66439 +/**
66440 + * ps3_lpm_copy_tb_to_user - Copy data from the trace buffer to a user buffer.
66441 + * @offset: Offset in bytes from the start of the trace buffer.
66442 + * @buf: A __user copy destination.
66443 + * @count: Maximum count of bytes to copy.
66444 + * @bytes_copied: Pointer to a variable that will recieve the number of
66445 + *  bytes copied to @buf.
66446 + *
66447 + * On error @buf will contain any successfully copied trace buffer data
66448 + * and bytes_copied will be set to the number of bytes successfully copied.
66449 + */
66450 +
66451 +int ps3_lpm_copy_tb_to_user(unsigned long offset, void __user *buf,
66452 +                           unsigned long count, unsigned long *bytes_copied)
66453 +{
66454 +       int result;
66455 +
66456 +       *bytes_copied = 0;
66457 +
66458 +       if (!lpm_priv->tb_cache)
66459 +               return -EPERM;
66460 +
66461 +       if (offset >= lpm_priv->tb_count)
66462 +               return 0;
66463 +
66464 +       count = min(count, lpm_priv->tb_count - offset);
66465 +
66466 +       while (*bytes_copied < count) {
66467 +               const unsigned long request = count - *bytes_copied;
66468 +               u64 tmp;
66469 +
66470 +               result = lv1_copy_lpm_trace_buffer(lpm_priv->lpm_id, offset,
66471 +                                                  request, &tmp);
66472 +               if (result) {
66473 +                       dev_dbg(sbd_core(), "%s:%u: 0x%lx bytes at 0x%lx\n",
66474 +                               __func__, __LINE__, request, offset);
66475 +                       dev_err(sbd_core(), "%s:%u: lv1_copy_lpm_trace_buffer "
66476 +                               "failed: %s\n", __func__, __LINE__,
66477 +                               ps3_result(result));
66478 +                       return result == LV1_WRONG_STATE ? -EBUSY : -EINVAL;
66479 +               }
66480 +
66481 +               result = copy_to_user(buf, lpm_priv->tb_cache, tmp);
66482 +
66483 +               if (result) {
66484 +                       dev_dbg(sbd_core(), "%s:%u: 0x%lx bytes at 0x%p\n",
66485 +                               __func__, __LINE__, tmp, buf);
66486 +                       dev_err(sbd_core(), "%s:%u: copy_to_user failed: %d\n",
66487 +                               __func__, __LINE__, result);
66488 +                       return -EFAULT;
66489 +               }
66490 +
66491 +               buf += tmp;
66492 +               *bytes_copied += tmp;
66493 +               offset += tmp;
66494 +       }
66495 +       dev_dbg(sbd_core(), "%s:%u: copied %lxh bytes\n", __func__, __LINE__,
66496 +               *bytes_copied);
66497 +
66498 +       return 0;
66499 +}
66500 +EXPORT_SYMBOL_GPL(ps3_lpm_copy_tb_to_user);
66501 +
66502 +/**
66503 + * ps3_get_and_clear_pm_interrupts -
66504 + *
66505 + * Clearing interrupts for the entire performance monitoring unit.
66506 + * Reading pm_status clears the interrupt bits.
66507 + */
66508 +
66509 +u32 ps3_get_and_clear_pm_interrupts(u32 cpu)
66510 +{
66511 +       return ps3_read_pm(cpu, pm_status);
66512 +}
66513 +EXPORT_SYMBOL_GPL(ps3_get_and_clear_pm_interrupts);
66514 +
66515 +/**
66516 + * ps3_enable_pm_interrupts -
66517 + *
66518 + * Enabling interrupts for the entire performance monitoring unit.
66519 + * Enables the interrupt bits in the pm_status register.
66520 + */
66521 +
66522 +void ps3_enable_pm_interrupts(u32 cpu, u32 thread, u32 mask)
66523 +{
66524 +       if (mask)
66525 +               ps3_write_pm(cpu, pm_status, mask);
66526 +}
66527 +EXPORT_SYMBOL_GPL(ps3_enable_pm_interrupts);
66528 +
66529 +/**
66530 + * ps3_enable_pm_interrupts -
66531 + *
66532 + * Disabling interrupts for the entire performance monitoring unit.
66533 + */
66534 +
66535 +void ps3_disable_pm_interrupts(u32 cpu)
66536 +{
66537 +       ps3_get_and_clear_pm_interrupts(cpu);
66538 +       ps3_write_pm(cpu, pm_status, 0);
66539 +}
66540 +EXPORT_SYMBOL_GPL(ps3_disable_pm_interrupts);
66541 +
66542 +/**
66543 + * ps3_lpm_open - Open the logical performance monitor device.
66544 + * @tb_type: Specifies the type of trace buffer lv1 sould use for this lpm
66545 + *  instance, specified by one of enum ps3_lpm_tb_type.
66546 + * @tb_cache: Optional user supplied buffer to use as the trace buffer cache.
66547 + *  If NULL, the driver will allocate and manage an internal buffer.
66548 + *  Unused when when @tb_type is PS3_LPM_TB_TYPE_NONE.
66549 + * @tb_cache_size: The size in bytes of the user supplied @tb_cache buffer.
66550 + *  Unused when @tb_cache is NULL or @tb_type is PS3_LPM_TB_TYPE_NONE.
66551 + */
66552 +
66553 +int ps3_lpm_open(enum ps3_lpm_tb_type tb_type, void *tb_cache,
66554 +       u64 tb_cache_size)
66555 +{
66556 +       int result;
66557 +       u64 tb_size;
66558 +
66559 +       BUG_ON(!lpm_priv);
66560 +       BUG_ON(tb_type != PS3_LPM_TB_TYPE_NONE
66561 +               && tb_type != PS3_LPM_TB_TYPE_INTERNAL);
66562 +
66563 +       if (tb_type == PS3_LPM_TB_TYPE_NONE && tb_cache)
66564 +               dev_dbg(sbd_core(), "%s:%u: bad in vals\n", __func__, __LINE__);
66565 +
66566 +       if (!atomic_add_unless(&lpm_priv->open, 1, 1)) {
66567 +               dev_dbg(sbd_core(), "%s:%u: busy\n", __func__, __LINE__);
66568 +               return -EBUSY;
66569 +       }
66570 +
66571 +       /* Note tb_cache needs 128 byte alignment. */
66572 +
66573 +       if (tb_type == PS3_LPM_TB_TYPE_NONE) {
66574 +               lpm_priv->tb_cache_size = 0;
66575 +               lpm_priv->tb_cache_internal = NULL;
66576 +               lpm_priv->tb_cache = NULL;
66577 +       } else if (tb_cache) {
66578 +               if (tb_cache != (void *)_ALIGN_UP((unsigned long)tb_cache, 128)
66579 +                       || tb_cache_size != _ALIGN_UP(tb_cache_size, 128)) {
66580 +                       dev_err(sbd_core(), "%s:%u: unaligned tb_cache\n",
66581 +                               __func__, __LINE__);
66582 +                       result = -EINVAL;
66583 +                       goto fail_align;
66584 +               }
66585 +               lpm_priv->tb_cache_size = tb_cache_size;
66586 +               lpm_priv->tb_cache_internal = NULL;
66587 +               lpm_priv->tb_cache = tb_cache;
66588 +       } else {
66589 +               lpm_priv->tb_cache_size = PS3_LPM_DEFAULT_TB_CACHE_SIZE;
66590 +               lpm_priv->tb_cache_internal = kzalloc(
66591 +                       lpm_priv->tb_cache_size + 127, GFP_KERNEL);
66592 +               if (!lpm_priv->tb_cache_internal) {
66593 +                       dev_err(sbd_core(), "%s:%u: alloc internal tb_cache "
66594 +                               "failed\n", __func__, __LINE__);
66595 +                       result = -ENOMEM;
66596 +                       goto fail_malloc;
66597 +               }
66598 +               lpm_priv->tb_cache = (void *)_ALIGN_UP(
66599 +                       (unsigned long)lpm_priv->tb_cache_internal, 128);
66600 +       }
66601 +
66602 +       result = lv1_construct_lpm(lpm_priv->node_id, tb_type, 0, 0,
66603 +                               ps3_mm_phys_to_lpar(__pa(lpm_priv->tb_cache)),
66604 +                               lpm_priv->tb_cache_size, &lpm_priv->lpm_id,
66605 +                               &lpm_priv->outlet_id, &tb_size);
66606 +
66607 +       if (result) {
66608 +               dev_err(sbd_core(), "%s:%u: lv1_construct_lpm failed: %s\n",
66609 +                       __func__, __LINE__, ps3_result(result));
66610 +               result = -EINVAL;
66611 +               goto fail_construct;
66612 +       }
66613 +
66614 +       lpm_priv->shadow.pm_control = PS3_LPM_SHADOW_REG_INIT;
66615 +       lpm_priv->shadow.pm_start_stop = PS3_LPM_SHADOW_REG_INIT;
66616 +       lpm_priv->shadow.pm_interval = PS3_LPM_SHADOW_REG_INIT;
66617 +       lpm_priv->shadow.group_control = PS3_LPM_SHADOW_REG_INIT;
66618 +       lpm_priv->shadow.debug_bus_control = PS3_LPM_SHADOW_REG_INIT;
66619 +
66620 +       dev_dbg(sbd_core(), "%s:%u: lpm_id 0x%lx, outlet_id 0x%lx, "
66621 +               "tb_size 0x%lx\n", __func__, __LINE__, lpm_priv->lpm_id,
66622 +               lpm_priv->outlet_id, tb_size);
66623 +
66624 +       return 0;
66625 +
66626 +fail_construct:
66627 +       kfree(lpm_priv->tb_cache_internal);
66628 +       lpm_priv->tb_cache_internal = NULL;
66629 +fail_malloc:
66630 +fail_align:
66631 +       atomic_dec(&lpm_priv->open);
66632 +       return result;
66633 +}
66634 +EXPORT_SYMBOL_GPL(ps3_lpm_open);
66635 +
66636 +/**
66637 + * ps3_lpm_close - Close the lpm device.
66638 + *
66639 + */
66640 +
66641 +int ps3_lpm_close(void)
66642 +{
66643 +       dev_dbg(sbd_core(), "%s:%u\n", __func__, __LINE__);
66644 +
66645 +       lv1_destruct_lpm(lpm_priv->lpm_id);
66646 +       lpm_priv->lpm_id = 0;
66647 +
66648 +       kfree(lpm_priv->tb_cache_internal);
66649 +       lpm_priv->tb_cache_internal = NULL;
66650 +
66651 +       atomic_dec(&lpm_priv->open);
66652 +       return 0;
66653 +}
66654 +EXPORT_SYMBOL_GPL(ps3_lpm_close);
66655 +
66656 +static int __devinit ps3_lpm_probe(struct ps3_system_bus_device *dev)
66657 +{
66658 +       dev_dbg(&dev->core, " -> %s:%u\n", __func__, __LINE__);
66659 +
66660 +       if (lpm_priv) {
66661 +               dev_info(&dev->core, "%s:%u: called twice\n",
66662 +                       __func__, __LINE__);
66663 +               return -EBUSY;
66664 +       }
66665 +
66666 +       lpm_priv = kzalloc(sizeof(*lpm_priv), GFP_KERNEL);
66667 +
66668 +       if (!lpm_priv)
66669 +               return -ENOMEM;
66670 +
66671 +       lpm_priv->sbd = dev;
66672 +       lpm_priv->node_id = dev->lpm.node_id;
66673 +       lpm_priv->pu_id = dev->lpm.pu_id;
66674 +       lpm_priv->rights = dev->lpm.rights;
66675 +
66676 +       dev_info(&dev->core, " <- %s:%u:\n", __func__, __LINE__);
66677 +
66678 +       return 0;
66679 +}
66680 +
66681 +static int ps3_lpm_remove(struct ps3_system_bus_device *dev)
66682 +{
66683 +       dev_dbg(&dev->core, " -> %s:%u:\n", __func__, __LINE__);
66684 +
66685 +       ps3_lpm_close();
66686 +
66687 +       kfree(lpm_priv);
66688 +       lpm_priv = NULL;
66689 +
66690 +       dev_info(&dev->core, " <- %s:%u:\n", __func__, __LINE__);
66691 +       return 0;
66692 +}
66693 +
66694 +static struct ps3_system_bus_driver ps3_lpm_driver = {
66695 +       .match_id = PS3_MATCH_ID_LPM,
66696 +       .core.name      = "ps3-lpm",
66697 +       .core.owner     = THIS_MODULE,
66698 +       .probe          = ps3_lpm_probe,
66699 +       .remove         = ps3_lpm_remove,
66700 +       .shutdown       = ps3_lpm_remove,
66701 +};
66702 +
66703 +static int __init ps3_lpm_init(void)
66704 +{
66705 +       pr_debug("%s:%d:\n", __func__, __LINE__);
66706 +       return ps3_system_bus_driver_register(&ps3_lpm_driver);
66707 +}
66708 +
66709 +static void __exit ps3_lpm_exit(void)
66710 +{
66711 +       pr_debug("%s:%d:\n", __func__, __LINE__);
66712 +       ps3_system_bus_driver_unregister(&ps3_lpm_driver);
66713 +}
66714 +
66715 +module_init(ps3_lpm_init);
66716 +module_exit(ps3_lpm_exit);
66717 +
66718 +MODULE_LICENSE("GPL v2");
66719 +MODULE_DESCRIPTION("PS3 Logical Performance Monitor Driver");
66720 +MODULE_AUTHOR("Sony Corporation");
66721 +MODULE_ALIAS(PS3_MODULE_ALIAS_LPM);
66722 diff -x .git -x .gitignore -Nur linux-2.6.24/drivers/ps3/ps3-sys-manager.c powerpc.git/drivers/ps3/ps3-sys-manager.c
66723 --- linux-2.6.24/drivers/ps3/ps3-sys-manager.c  2008-01-24 23:58:37.000000000 +0100
66724 +++ powerpc.git/drivers/ps3/ps3-sys-manager.c   2008-01-28 20:26:18.000000000 +0100
66725 @@ -452,7 +452,7 @@
66726         case PS3_SM_EVENT_THERMAL_ALERT:
66727                 dev_dbg(&dev->core, "%s:%d: THERMAL_ALERT (zone %u)\n",
66728                         __func__, __LINE__, event.value);
66729 -               printk(KERN_INFO "PS3 Thermal Alert Zone %u\n", event.value);
66730 +               pr_info("PS3 Thermal Alert Zone %u\n", event.value);
66731                 break;
66732         case PS3_SM_EVENT_THERMAL_CLEARED:
66733                 dev_dbg(&dev->core, "%s:%d: THERMAL_CLEARED (zone %u)\n",
66734 @@ -488,7 +488,7 @@
66735         result = ps3_vuart_read(dev, &cmd, sizeof(cmd));
66736         BUG_ON(result && "need to retry here");
66737  
66738 -       if(result)
66739 +       if (result)
66740                 return result;
66741  
66742         if (cmd.version != 1) {
66743 @@ -521,7 +521,7 @@
66744         result = ps3_vuart_read(dev, &header,
66745                 sizeof(struct ps3_sys_manager_header));
66746  
66747 -       if(result)
66748 +       if (result)
66749                 return result;
66750  
66751         if (header.version != 1) {
66752 @@ -589,9 +589,9 @@
66753                 PS3_SM_WAKE_DEFAULT);
66754         ps3_sys_manager_send_request_shutdown(dev);
66755  
66756 -       printk(KERN_EMERG "System Halted, OK to turn off power\n");
66757 +       pr_emerg("System Halted, OK to turn off power\n");
66758  
66759 -       while(1)
66760 +       while (1)
66761                 ps3_sys_manager_handle_msg(dev);
66762  }
66763  
66764 @@ -626,9 +626,9 @@
66765                 PS3_SM_WAKE_DEFAULT);
66766         ps3_sys_manager_send_request_shutdown(dev);
66767  
66768 -       printk(KERN_EMERG "System Halted, OK to turn off power\n");
66769 +       pr_emerg("System Halted, OK to turn off power\n");
66770  
66771 -       while(1)
66772 +       while (1)
66773                 ps3_sys_manager_handle_msg(dev);
66774  }
66775  
66776 diff -x .git -x .gitignore -Nur linux-2.6.24/drivers/ps3/ps3-vuart.c powerpc.git/drivers/ps3/ps3-vuart.c
66777 --- linux-2.6.24/drivers/ps3/ps3-vuart.c        2008-01-24 23:58:37.000000000 +0100
66778 +++ powerpc.git/drivers/ps3/ps3-vuart.c 2008-01-28 20:26:18.000000000 +0100
66779 @@ -108,18 +108,18 @@
66780  struct ports_bmp {
66781         u64 status;
66782         u64 unused[3];
66783 -} __attribute__ ((aligned (32)));
66784 +} __attribute__((aligned(32)));
66785  
66786  #define dump_ports_bmp(_b) _dump_ports_bmp(_b, __func__, __LINE__)
66787  static void __maybe_unused _dump_ports_bmp(
66788 -       const struct ports_bmp* bmp, const char* func, int line)
66789 +       const struct ports_bmp *bmp, const char *func, int line)
66790  {
66791         pr_debug("%s:%d: ports_bmp: %016lxh\n", func, line, bmp->status);
66792  }
66793  
66794  #define dump_port_params(_b) _dump_port_params(_b, __func__, __LINE__)
66795  static void __maybe_unused _dump_port_params(unsigned int port_number,
66796 -       const char* func, int line)
66797 +       const char *func, int line)
66798  {
66799  #if defined(DEBUG)
66800         static const char *strings[] = {
66801 @@ -363,7 +363,7 @@
66802   */
66803  
66804  static int ps3_vuart_raw_write(struct ps3_system_bus_device *dev,
66805 -       const void* buf, unsigned int bytes, unsigned long *bytes_written)
66806 +       const void *buf, unsigned int bytes, unsigned long *bytes_written)
66807  {
66808         int result;
66809         struct ps3_vuart_port_priv *priv = to_port_priv(dev);
66810 @@ -431,7 +431,7 @@
66811         int result;
66812         struct ps3_vuart_port_priv *priv = to_port_priv(dev);
66813         u64 bytes_waiting;
66814 -       void* tmp;
66815 +       void *tmp;
66816  
66817         result = ps3_vuart_get_rx_bytes_waiting(dev, &bytes_waiting);
66818  
66819 @@ -526,9 +526,8 @@
66820  
66821         lb = kmalloc(sizeof(struct list_buffer) + bytes, GFP_KERNEL);
66822  
66823 -       if (!lb) {
66824 +       if (!lb)
66825                 return -ENOMEM;
66826 -       }
66827  
66828         memcpy(lb->data, buf, bytes);
66829         lb->head = lb->data;
66830 @@ -878,7 +877,7 @@
66831  struct vuart_bus_priv {
66832         struct ports_bmp *bmp;
66833         unsigned int virq;
66834 -       struct semaphore probe_mutex;
66835 +       struct mutex probe_mutex;
66836         int use_count;
66837         struct ps3_system_bus_device *devices[PORT_COUNT];
66838  } static vuart_bus_priv;
66839 @@ -926,9 +925,8 @@
66840  
66841         BUG_ON(vuart_bus_priv.use_count > 2);
66842  
66843 -       if (vuart_bus_priv.use_count != 1) {
66844 +       if (vuart_bus_priv.use_count != 1)
66845                 return 0;
66846 -       }
66847  
66848         BUG_ON(vuart_bus_priv.bmp);
66849  
66850 @@ -1017,7 +1015,7 @@
66851                 return -EINVAL;
66852         }
66853  
66854 -       down(&vuart_bus_priv.probe_mutex);
66855 +       mutex_lock(&vuart_bus_priv.probe_mutex);
66856  
66857         result = ps3_vuart_bus_interrupt_get();
66858  
66859 @@ -1077,7 +1075,7 @@
66860                 goto fail_probe;
66861         }
66862  
66863 -       up(&vuart_bus_priv.probe_mutex);
66864 +       mutex_unlock(&vuart_bus_priv.probe_mutex);
66865  
66866         return result;
66867  
66868 @@ -1090,7 +1088,7 @@
66869  fail_busy:
66870         ps3_vuart_bus_interrupt_put();
66871  fail_setup_interrupt:
66872 -       up(&vuart_bus_priv.probe_mutex);
66873 +       mutex_unlock(&vuart_bus_priv.probe_mutex);
66874         dev_dbg(&dev->core, "%s:%d: failed\n", __func__, __LINE__);
66875         return result;
66876  }
66877 @@ -1129,7 +1127,7 @@
66878  
66879         BUG_ON(!dev);
66880  
66881 -       down(&vuart_bus_priv.probe_mutex);
66882 +       mutex_lock(&vuart_bus_priv.probe_mutex);
66883  
66884         dev_dbg(&dev->core, " -> %s:%d: match_id %d\n", __func__, __LINE__,
66885                 dev->match_id);
66886 @@ -1137,7 +1135,7 @@
66887         if (!dev->core.driver) {
66888                 dev_dbg(&dev->core, "%s:%d: no driver bound\n", __func__,
66889                         __LINE__);
66890 -               up(&vuart_bus_priv.probe_mutex);
66891 +               mutex_unlock(&vuart_bus_priv.probe_mutex);
66892                 return 0;
66893         }
66894  
66895 @@ -1160,7 +1158,7 @@
66896         priv = NULL;
66897  
66898         dev_dbg(&dev->core, " <- %s:%d\n", __func__, __LINE__);
66899 -       up(&vuart_bus_priv.probe_mutex);
66900 +       mutex_unlock(&vuart_bus_priv.probe_mutex);
66901         return 0;
66902  }
66903  
66904 @@ -1180,7 +1178,7 @@
66905  
66906         BUG_ON(!dev);
66907  
66908 -       down(&vuart_bus_priv.probe_mutex);
66909 +       mutex_lock(&vuart_bus_priv.probe_mutex);
66910  
66911         dev_dbg(&dev->core, " -> %s:%d: match_id %d\n", __func__, __LINE__,
66912                 dev->match_id);
66913 @@ -1188,7 +1186,7 @@
66914         if (!dev->core.driver) {
66915                 dev_dbg(&dev->core, "%s:%d: no driver bound\n", __func__,
66916                         __LINE__);
66917 -               up(&vuart_bus_priv.probe_mutex);
66918 +               mutex_unlock(&vuart_bus_priv.probe_mutex);
66919                 return 0;
66920         }
66921  
66922 @@ -1212,7 +1210,7 @@
66923  
66924         dev_dbg(&dev->core, " <- %s:%d\n", __func__, __LINE__);
66925  
66926 -       up(&vuart_bus_priv.probe_mutex);
66927 +       mutex_unlock(&vuart_bus_priv.probe_mutex);
66928         return 0;
66929  }
66930  
66931 @@ -1223,7 +1221,7 @@
66932         if (!firmware_has_feature(FW_FEATURE_PS3_LV1))
66933                 return -ENODEV;
66934  
66935 -       init_MUTEX(&vuart_bus_priv.probe_mutex);
66936 +       mutex_init(&vuart_bus_priv.probe_mutex);
66937  
66938         return 0;
66939  }
66940 diff -x .git -x .gitignore -Nur linux-2.6.24/drivers/serial/Kconfig powerpc.git/drivers/serial/Kconfig
66941 --- linux-2.6.24/drivers/serial/Kconfig 2008-01-24 23:58:37.000000000 +0100
66942 +++ powerpc.git/drivers/serial/Kconfig  2008-01-28 20:26:19.000000000 +0100
66943 @@ -1284,4 +1284,14 @@
66944           Currently, only 8250 compatible ports are supported, but
66945           others can easily be added.
66946  
66947 +config SERIAL_QE
66948 +       tristate "Freescale QUICC Engine serial port support"
66949 +       depends on QUICC_ENGINE
66950 +       select SERIAL_CORE
66951 +       select FW_LOADER
66952 +       default n
66953 +       help
66954 +         This driver supports the QE serial ports on Freescale embedded
66955 +         PowerPC that contain a QUICC Engine.
66956 +
66957  endmenu
66958 diff -x .git -x .gitignore -Nur linux-2.6.24/drivers/serial/Makefile powerpc.git/drivers/serial/Makefile
66959 --- linux-2.6.24/drivers/serial/Makefile        2008-01-24 23:58:37.000000000 +0100
66960 +++ powerpc.git/drivers/serial/Makefile 2008-01-28 20:26:19.000000000 +0100
66961 @@ -64,3 +64,4 @@
66962  obj-$(CONFIG_SERIAL_NETX) += netx-serial.o
66963  obj-$(CONFIG_SERIAL_OF_PLATFORM) += of_serial.o
66964  obj-$(CONFIG_SERIAL_KS8695) += serial_ks8695.o
66965 +obj-$(CONFIG_SERIAL_QE) += ucc_uart.o
66966 diff -x .git -x .gitignore -Nur linux-2.6.24/drivers/serial/cpm_uart/cpm_uart_cpm1.c powerpc.git/drivers/serial/cpm_uart/cpm_uart_cpm1.c
66967 --- linux-2.6.24/drivers/serial/cpm_uart/cpm_uart_cpm1.c        2008-01-24 23:58:37.000000000 +0100
66968 +++ powerpc.git/drivers/serial/cpm_uart/cpm_uart_cpm1.c 2008-01-28 20:26:19.000000000 +0100
66969 @@ -52,11 +52,7 @@
66970  #ifdef CONFIG_PPC_CPM_NEW_BINDING
66971  void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd)
66972  {
66973 -       u16 __iomem *cpcr = &cpmp->cp_cpcr;
66974 -
66975 -       out_be16(cpcr, port->command | (cmd << 8) | CPM_CR_FLG);
66976 -       while (in_be16(cpcr) & CPM_CR_FLG)
66977 -               ;
66978 +       cpm_command(port->command, cmd);
66979  }
66980  #else
66981  void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd)
66982 diff -x .git -x .gitignore -Nur linux-2.6.24/drivers/serial/cpm_uart/cpm_uart_cpm2.c powerpc.git/drivers/serial/cpm_uart/cpm_uart_cpm2.c
66983 --- linux-2.6.24/drivers/serial/cpm_uart/cpm_uart_cpm2.c        2008-01-24 23:58:37.000000000 +0100
66984 +++ powerpc.git/drivers/serial/cpm_uart/cpm_uart_cpm2.c 2008-01-28 20:26:19.000000000 +0100
66985 @@ -52,13 +52,7 @@
66986  #ifdef CONFIG_PPC_CPM_NEW_BINDING
66987  void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd)
66988  {
66989 -       cpm_cpm2_t __iomem *cp = cpm2_map(im_cpm);
66990 -
66991 -       out_be32(&cp->cp_cpcr, port->command | cmd | CPM_CR_FLG);
66992 -       while (in_be32(&cp->cp_cpcr) & CPM_CR_FLG)
66993 -               ;
66994 -
66995 -       cpm2_unmap(cp);
66996 +       cpm_command(port->command, cmd);
66997  }
66998  #else
66999  void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd)
67000 @@ -171,9 +165,9 @@
67001          * really has to get out of the driver so boards can
67002          * be supported in a sane fashion.
67003          */
67004 +       volatile cpmux_t *cpmux = cpm2_map(im_cpmux);
67005  #ifndef CONFIG_STX_GP3
67006         volatile iop_cpm2_t *io = cpm2_map(im_ioport);
67007 -       volatile cpmux_t *cpmux = cpm2_map(im_cpmux);
67008  
67009         io->iop_pparb |= 0x008b0000;
67010         io->iop_pdirb |= 0x00880000;
67011 diff -x .git -x .gitignore -Nur linux-2.6.24/drivers/serial/mpc52xx_uart.c powerpc.git/drivers/serial/mpc52xx_uart.c
67012 --- linux-2.6.24/drivers/serial/mpc52xx_uart.c  2008-01-24 23:58:37.000000000 +0100
67013 +++ powerpc.git/drivers/serial/mpc52xx_uart.c   2008-01-28 20:26:19.000000000 +0100
67014 @@ -36,7 +36,7 @@
67015   * DCD. However, the pin multiplexing aren't changed and should be set either
67016   * by the bootloader or in the platform init code.
67017   *
67018 - * The idx field must be equal to the PSC index ( e.g. 0 for PSC1, 1 for PSC2,
67019 + * The idx field must be equal to the PSC index (e.g. 0 for PSC1, 1 for PSC2,
67020   * and so on). So the PSC1 is mapped to /dev/ttyPSC0, PSC2 to /dev/ttyPSC1 and
67021   * so on. But be warned, it's an ABSOLUTE REQUIREMENT ! This is needed mainly
67022   * fpr the console code : without this 1:1 mapping, at early boot time, when we
67023 @@ -68,11 +68,12 @@
67024  #include <linux/sysrq.h>
67025  #include <linux/console.h>
67026  
67027 -#include <asm/delay.h>
67028 -#include <asm/io.h>
67029 +#include <linux/delay.h>
67030 +#include <linux/io.h>
67031  
67032  #if defined(CONFIG_PPC_MERGE)
67033 -#include <asm/of_platform.h>
67034 +#include <linux/of.h>
67035 +#include <linux/of_platform.h>
67036  #else
67037  #include <linux/platform_device.h>
67038  #endif
67039 @@ -111,16 +112,18 @@
67040  #endif
67041  
67042  #define PSC(port) ((struct mpc52xx_psc __iomem *)((port)->membase))
67043 +#define FIFO(port) ((struct mpc52xx_psc_fifo __iomem *)(PSC(port)+1))
67044  
67045  
67046  /* Forward declaration of the interruption handling routine */
67047 -static irqreturn_t mpc52xx_uart_int(int irq,void *dev_id);
67048 +static irqreturn_t mpc52xx_uart_int(int irq, void *dev_id);
67049  
67050  
67051  /* Simple macro to test if a port is console or not. This one is taken
67052   * for serial_core.c and maybe should be moved to serial_core.h ? */
67053  #ifdef CONFIG_SERIAL_CORE_CONSOLE
67054 -#define uart_console(port)     ((port)->cons && (port)->cons->index == (port)->line)
67055 +#define uart_console(port) \
67056 +       ((port)->cons && (port)->cons->index == (port)->line)
67057  #else
67058  #define uart_console(port)     (0)
67059  #endif
67060 @@ -162,7 +165,7 @@
67061  {
67062         /* port->lock taken by caller */
67063         port->read_status_mask &= ~MPC52xx_PSC_IMR_TXRDY;
67064 -       out_be16(&PSC(port)->mpc52xx_psc_imr,port->read_status_mask);
67065 +       out_be16(&PSC(port)->mpc52xx_psc_imr, port->read_status_mask);
67066  }
67067  
67068  static void
67069 @@ -170,7 +173,7 @@
67070  {
67071         /* port->lock taken by caller */
67072         port->read_status_mask |= MPC52xx_PSC_IMR_TXRDY;
67073 -       out_be16(&PSC(port)->mpc52xx_psc_imr,port->read_status_mask);
67074 +       out_be16(&PSC(port)->mpc52xx_psc_imr, port->read_status_mask);
67075  }
67076  
67077  static void
67078 @@ -184,7 +187,7 @@
67079                 /* Make sure tx interrupts are on */
67080                 /* Truly necessary ??? They should be anyway */
67081                 port->read_status_mask |= MPC52xx_PSC_IMR_TXRDY;
67082 -               out_be16(&PSC(port)->mpc52xx_psc_imr,port->read_status_mask);
67083 +               out_be16(&PSC(port)->mpc52xx_psc_imr, port->read_status_mask);
67084         }
67085  
67086         spin_unlock_irqrestore(&port->lock, flags);
67087 @@ -195,7 +198,7 @@
67088  {
67089         /* port->lock taken by caller */
67090         port->read_status_mask &= ~MPC52xx_PSC_IMR_RXRDY;
67091 -       out_be16(&PSC(port)->mpc52xx_psc_imr,port->read_status_mask);
67092 +       out_be16(&PSC(port)->mpc52xx_psc_imr, port->read_status_mask);
67093  }
67094  
67095  static void
67096 @@ -210,10 +213,10 @@
67097         unsigned long flags;
67098         spin_lock_irqsave(&port->lock, flags);
67099  
67100 -       if ( ctl == -1 )
67101 -               out_8(&PSC(port)->command,MPC52xx_PSC_START_BRK);
67102 +       if (ctl == -1)
67103 +               out_8(&PSC(port)->command, MPC52xx_PSC_START_BRK);
67104         else
67105 -               out_8(&PSC(port)->command,MPC52xx_PSC_STOP_BRK);
67106 +               out_8(&PSC(port)->command, MPC52xx_PSC_STOP_BRK);
67107  
67108         spin_unlock_irqrestore(&port->lock, flags);
67109  }
67110 @@ -222,6 +225,7 @@
67111  mpc52xx_uart_startup(struct uart_port *port)
67112  {
67113         struct mpc52xx_psc __iomem *psc = PSC(port);
67114 +       struct mpc52xx_psc_fifo __iomem *fifo = FIFO(port);
67115         int ret;
67116  
67117         /* Request IRQ */
67118 @@ -231,23 +235,23 @@
67119                 return ret;
67120  
67121         /* Reset/activate the port, clear and enable interrupts */
67122 -       out_8(&psc->command,MPC52xx_PSC_RST_RX);
67123 -       out_8(&psc->command,MPC52xx_PSC_RST_TX);
67124 +       out_8(&psc->command, MPC52xx_PSC_RST_RX);
67125 +       out_8(&psc->command, MPC52xx_PSC_RST_TX);
67126  
67127 -       out_be32(&psc->sicr,0); /* UART mode DCD ignored */
67128 +       out_be32(&psc->sicr, 0);        /* UART mode DCD ignored */
67129  
67130         out_be16(&psc->mpc52xx_psc_clock_select, 0xdd00); /* /16 prescaler on */
67131  
67132 -       out_8(&psc->rfcntl, 0x00);
67133 -       out_be16(&psc->rfalarm, 0x1ff);
67134 -       out_8(&psc->tfcntl, 0x07);
67135 -       out_be16(&psc->tfalarm, 0x80);
67136 +       out_8(&fifo->rfcntl, 0x00);
67137 +       out_be16(&fifo->rfalarm, 0x1ff);
67138 +       out_8(&fifo->tfcntl, 0x07);
67139 +       out_be16(&fifo->tfalarm, 0x80);
67140  
67141         port->read_status_mask |= MPC52xx_PSC_IMR_RXRDY | MPC52xx_PSC_IMR_TXRDY;
67142 -       out_be16(&psc->mpc52xx_psc_imr,port->read_status_mask);
67143 +       out_be16(&psc->mpc52xx_psc_imr, port->read_status_mask);
67144  
67145 -       out_8(&psc->command,MPC52xx_PSC_TX_ENABLE);
67146 -       out_8(&psc->command,MPC52xx_PSC_RX_ENABLE);
67147 +       out_8(&psc->command, MPC52xx_PSC_TX_ENABLE);
67148 +       out_8(&psc->command, MPC52xx_PSC_RX_ENABLE);
67149  
67150         return 0;
67151  }
67152 @@ -258,12 +262,12 @@
67153         struct mpc52xx_psc __iomem *psc = PSC(port);
67154  
67155         /* Shut down the port.  Leave TX active if on a console port */
67156 -       out_8(&psc->command,MPC52xx_PSC_RST_RX);
67157 +       out_8(&psc->command, MPC52xx_PSC_RST_RX);
67158         if (!uart_console(port))
67159 -               out_8(&psc->command,MPC52xx_PSC_RST_TX);
67160 +               out_8(&psc->command, MPC52xx_PSC_RST_TX);
67161  
67162         port->read_status_mask = 0;
67163 -       out_be16(&psc->mpc52xx_psc_imr,port->read_status_mask);
67164 +       out_be16(&psc->mpc52xx_psc_imr, port->read_status_mask);
67165  
67166         /* Release interrupt */
67167         free_irq(port->irq, port);
67168 @@ -271,7 +275,7 @@
67169  
67170  static void
67171  mpc52xx_uart_set_termios(struct uart_port *port, struct ktermios *new,
67172 -                         struct ktermios *old)
67173 +                        struct ktermios *old)
67174  {
67175         struct mpc52xx_psc __iomem *psc = PSC(port);
67176         unsigned long flags;
67177 @@ -283,14 +287,14 @@
67178         mr1 = 0;
67179  
67180         switch (new->c_cflag & CSIZE) {
67181 -               case CS5:       mr1 |= MPC52xx_PSC_MODE_5_BITS;
67182 -                               break;
67183 -               case CS6:       mr1 |= MPC52xx_PSC_MODE_6_BITS;
67184 -                               break;
67185 -               case CS7:       mr1 |= MPC52xx_PSC_MODE_7_BITS;
67186 -                               break;
67187 -               case CS8:
67188 -               default:        mr1 |= MPC52xx_PSC_MODE_8_BITS;
67189 +       case CS5:       mr1 |= MPC52xx_PSC_MODE_5_BITS;
67190 +               break;
67191 +       case CS6:       mr1 |= MPC52xx_PSC_MODE_6_BITS;
67192 +               break;
67193 +       case CS7:       mr1 |= MPC52xx_PSC_MODE_7_BITS;
67194 +               break;
67195 +       case CS8:
67196 +       default:        mr1 |= MPC52xx_PSC_MODE_8_BITS;
67197         }
67198  
67199         if (new->c_cflag & PARENB) {
67200 @@ -332,24 +336,24 @@
67201                 udelay(1);
67202  
67203         if (!j)
67204 -               printk( KERN_ERR "mpc52xx_uart.c: "
67205 +               printk(KERN_ERR "mpc52xx_uart.c: "
67206                         "Unable to flush RX & TX fifos in-time in set_termios."
67207 -                       "Some chars may have been lost.\n" );
67208 +                       "Some chars may have been lost.\n");
67209  
67210         /* Reset the TX & RX */
67211 -       out_8(&psc->command,MPC52xx_PSC_RST_RX);
67212 -       out_8(&psc->command,MPC52xx_PSC_RST_TX);
67213 +       out_8(&psc->command, MPC52xx_PSC_RST_RX);
67214 +       out_8(&psc->command, MPC52xx_PSC_RST_TX);
67215  
67216         /* Send new mode settings */
67217 -       out_8(&psc->command,MPC52xx_PSC_SEL_MODE_REG_1);
67218 -       out_8(&psc->mode,mr1);
67219 -       out_8(&psc->mode,mr2);
67220 -       out_8(&psc->ctur,ctr >> 8);
67221 -       out_8(&psc->ctlr,ctr & 0xff);
67222 +       out_8(&psc->command, MPC52xx_PSC_SEL_MODE_REG_1);
67223 +       out_8(&psc->mode, mr1);
67224 +       out_8(&psc->mode, mr2);
67225 +       out_8(&psc->ctur, ctr >> 8);
67226 +       out_8(&psc->ctlr, ctr & 0xff);
67227  
67228         /* Reenable TX & RX */
67229 -       out_8(&psc->command,MPC52xx_PSC_TX_ENABLE);
67230 -       out_8(&psc->command,MPC52xx_PSC_RX_ENABLE);
67231 +       out_8(&psc->command, MPC52xx_PSC_TX_ENABLE);
67232 +       out_8(&psc->command, MPC52xx_PSC_RX_ENABLE);
67233  
67234         /* We're all set, release the lock */
67235         spin_unlock_irqrestore(&port->lock, flags);
67236 @@ -364,7 +368,8 @@
67237  static void
67238  mpc52xx_uart_release_port(struct uart_port *port)
67239  {
67240 -       if (port->flags & UPF_IOREMAP) { /* remapped by us ? */
67241 +       /* remapped by us ? */
67242 +       if (port->flags & UPF_IOREMAP) {
67243                 iounmap(port->membase);
67244                 port->membase = NULL;
67245         }
67246 @@ -379,7 +384,7 @@
67247  
67248         if (port->flags & UPF_IOREMAP) /* Need to remap ? */
67249                 port->membase = ioremap(port->mapbase,
67250 -                                       sizeof(struct mpc52xx_psc));
67251 +                                       sizeof(struct mpc52xx_psc));
67252  
67253         if (!port->membase)
67254                 return -EINVAL;
67255 @@ -398,22 +403,22 @@
67256  static void
67257  mpc52xx_uart_config_port(struct uart_port *port, int flags)
67258  {
67259 -       if ( (flags & UART_CONFIG_TYPE) &&
67260 -            (mpc52xx_uart_request_port(port) == 0) )
67261 -               port->type = PORT_MPC52xx;
67262 +       if ((flags & UART_CONFIG_TYPE)
67263 +               && (mpc52xx_uart_request_port(port) == 0))
67264 +               port->type = PORT_MPC52xx;
67265  }
67266  
67267  static int
67268  mpc52xx_uart_verify_port(struct uart_port *port, struct serial_struct *ser)
67269  {
67270 -       if ( ser->type != PORT_UNKNOWN && ser->type != PORT_MPC52xx )
67271 +       if (ser->type != PORT_UNKNOWN && ser->type != PORT_MPC52xx)
67272                 return -EINVAL;
67273  
67274 -       if ( (ser->irq != port->irq) ||
67275 -            (ser->io_type != SERIAL_IO_MEM) ||
67276 -            (ser->baud_base != port->uartclk)  ||
67277 -            (ser->iomem_base != (void*)port->mapbase) ||
67278 -            (ser->hub6 != 0 ) )
67279 +       if ((ser->irq != port->irq) ||
67280 +           (ser->io_type != SERIAL_IO_MEM) ||
67281 +           (ser->baud_base != port->uartclk)  ||
67282 +           (ser->iomem_base != (void *)port->mapbase) ||
67283 +           (ser->hub6 != 0))
67284                 return -EINVAL;
67285  
67286         return 0;
67287 @@ -455,8 +460,8 @@
67288         unsigned short status;
67289  
67290         /* While we can read, do so ! */
67291 -       while ( (status = in_be16(&PSC(port)->mpc52xx_psc_status)) &
67292 -               MPC52xx_PSC_SR_RXRDY) {
67293 +       while ((status = in_be16(&PSC(port)->mpc52xx_psc_status)) &
67294 +               MPC52xx_PSC_SR_RXRDY) {
67295  
67296                 /* Get the char */
67297                 ch = in_8(&PSC(port)->mpc52xx_psc_buffer_8);
67298 @@ -474,9 +479,9 @@
67299                 flag = TTY_NORMAL;
67300                 port->icount.rx++;
67301  
67302 -               if ( status & (MPC52xx_PSC_SR_PE |
67303 -                              MPC52xx_PSC_SR_FE |
67304 -                              MPC52xx_PSC_SR_RB) ) {
67305 +               if (status & (MPC52xx_PSC_SR_PE |
67306 +                             MPC52xx_PSC_SR_FE |
67307 +                             MPC52xx_PSC_SR_RB)) {
67308  
67309                         if (status & MPC52xx_PSC_SR_RB) {
67310                                 flag = TTY_BREAK;
67311 @@ -487,7 +492,7 @@
67312                                 flag = TTY_FRAME;
67313  
67314                         /* Clear error condition */
67315 -                       out_8(&PSC(port)->command,MPC52xx_PSC_RST_ERR_STAT);
67316 +                       out_8(&PSC(port)->command, MPC52xx_PSC_RST_ERR_STAT);
67317  
67318                 }
67319                 tty_insert_flip_char(tty, ch, flag);
67320 @@ -568,16 +573,16 @@
67321  
67322                 /* Do we need to receive chars ? */
67323                 /* For this RX interrupts must be on and some chars waiting */
67324 -               if ( status & MPC52xx_PSC_IMR_RXRDY )
67325 +               if (status & MPC52xx_PSC_IMR_RXRDY)
67326                         keepgoing |= mpc52xx_uart_int_rx_chars(port);
67327  
67328                 /* Do we need to send chars ? */
67329                 /* For this, TX must be ready and TX interrupt enabled */
67330 -               if ( status & MPC52xx_PSC_IMR_TXRDY )
67331 +               if (status & MPC52xx_PSC_IMR_TXRDY)
67332                         keepgoing |= mpc52xx_uart_int_tx_chars(port);
67333  
67334                 /* Limit number of iteration */
67335 -               if ( !(--pass) )
67336 +               if (!(--pass))
67337                         keepgoing = 0;
67338  
67339         } while (keepgoing);
67340 @@ -596,7 +601,7 @@
67341  
67342  static void __init
67343  mpc52xx_console_get_options(struct uart_port *port,
67344 -                            int *baud, int *parity, int *bits, int *flow)
67345 +                           int *baud, int *parity, int *bits, int *flow)
67346  {
67347         struct mpc52xx_psc __iomem *psc = PSC(port);
67348         unsigned char mr1;
67349 @@ -604,7 +609,7 @@
67350         pr_debug("mpc52xx_console_get_options(port=%p)\n", port);
67351  
67352         /* Read the mode registers */
67353 -       out_8(&psc->command,MPC52xx_PSC_SEL_MODE_REG_1);
67354 +       out_8(&psc->command, MPC52xx_PSC_SEL_MODE_REG_1);
67355         mr1 = in_8(&psc->mode);
67356  
67357         /* CT{U,L}R are write-only ! */
67358 @@ -616,11 +621,18 @@
67359  
67360         /* Parse them */
67361         switch (mr1 & MPC52xx_PSC_MODE_BITS_MASK) {
67362 -               case MPC52xx_PSC_MODE_5_BITS:   *bits = 5; break;
67363 -               case MPC52xx_PSC_MODE_6_BITS:   *bits = 6; break;
67364 -               case MPC52xx_PSC_MODE_7_BITS:   *bits = 7; break;
67365 -               case MPC52xx_PSC_MODE_8_BITS:
67366 -               default:                        *bits = 8;
67367 +       case MPC52xx_PSC_MODE_5_BITS:
67368 +               *bits = 5;
67369 +               break;
67370 +       case MPC52xx_PSC_MODE_6_BITS:
67371 +               *bits = 6;
67372 +               break;
67373 +       case MPC52xx_PSC_MODE_7_BITS:
67374 +               *bits = 7;
67375 +               break;
67376 +       case MPC52xx_PSC_MODE_8_BITS:
67377 +       default:
67378 +               *bits = 8;
67379         }
67380  
67381         if (mr1 & MPC52xx_PSC_MODE_PARNONE)
67382 @@ -657,7 +669,7 @@
67383                 /* Wait the TX buffer to be empty */
67384                 j = 20000;      /* Maximum wait */
67385                 while (!(in_be16(&psc->mpc52xx_psc_status) &
67386 -                        MPC52xx_PSC_SR_TXEMP) && --j)
67387 +                        MPC52xx_PSC_SR_TXEMP) && --j)
67388                         udelay(1);
67389         }
67390  
67391 @@ -730,16 +742,18 @@
67392         }
67393  
67394         pr_debug("Console on ttyPSC%x is %s\n",
67395 -                co->index, mpc52xx_uart_nodes[co->index]->full_name);
67396 +                co->index, mpc52xx_uart_nodes[co->index]->full_name);
67397  
67398         /* Fetch register locations */
67399 -       if ((ret = of_address_to_resource(np, 0, &res)) != 0) {
67400 +       ret = of_address_to_resource(np, 0, &res);
67401 +       if (ret) {
67402                 pr_debug("Could not get resources for PSC%x\n", co->index);
67403                 return ret;
67404         }
67405  
67406         /* Search for bus-frequency property in this node or a parent */
67407 -       if ((ipb_freq = mpc52xx_find_ipb_freq(np)) == 0) {
67408 +       ipb_freq = mpc52xx_find_ipb_freq(np);
67409 +       if (ipb_freq == 0) {
67410                 pr_debug("Could not find IPB bus frequency!\n");
67411                 return -EINVAL;
67412         }
67413 @@ -757,7 +771,8 @@
67414                 return -EINVAL;
67415  
67416         pr_debug("mpc52xx-psc uart at %p, mapped to %p, irq=%x, freq=%i\n",
67417 -                (void*)port->mapbase, port->membase, port->irq, port->uartclk);
67418 +                (void *)port->mapbase, port->membase,
67419 +                port->irq, port->uartclk);
67420  
67421         /* Setup the port parameters accoding to options */
67422         if (options)
67423 @@ -766,7 +781,7 @@
67424                 mpc52xx_console_get_options(port, &baud, &parity, &bits, &flow);
67425  
67426         pr_debug("Setting console parameters: %i %i%c1 flow=%c\n",
67427 -                baud, bits, parity, flow);
67428 +                baud, bits, parity, flow);
67429  
67430         return uart_set_options(port, co, baud, parity, bits, flow);
67431  }
67432 @@ -781,7 +796,7 @@
67433         .device = uart_console_device,
67434         .setup  = mpc52xx_console_setup,
67435         .flags  = CON_PRINTBUFFER,
67436 -       .index  = -1,   /* Specified on the cmdline (e.g. console=ttyPSC0 ) */
67437 +       .index  = -1,   /* Specified on the cmdline (e.g. console=ttyPSC0) */
67438         .data   = &mpc52xx_uart_driver,
67439  };
67440  
67441 @@ -809,7 +824,6 @@
67442  /* ======================================================================== */
67443  
67444  static struct uart_driver mpc52xx_uart_driver = {
67445 -       .owner          = THIS_MODULE,
67446         .driver_name    = "mpc52xx_psc_uart",
67447         .dev_name       = "ttyPSC",
67448         .major          = SERIAL_PSC_MAJOR,
67449 @@ -837,7 +851,7 @@
67450         if (idx < 0 || idx >= MPC52xx_PSC_MAXNUM)
67451                 return -EINVAL;
67452  
67453 -       if (!mpc52xx_match_psc_function(idx,"uart"))
67454 +       if (!mpc52xx_match_psc_function(idx, "uart"))
67455                 return -ENODEV;
67456  
67457         /* Init the port structure */
67458 @@ -848,13 +862,13 @@
67459         port->fifosize  = 512;
67460         port->iotype    = UPIO_MEM;
67461         port->flags     = UPF_BOOT_AUTOCONF |
67462 -                         ( uart_console(port) ? 0 : UPF_IOREMAP );
67463 +                         (uart_console(port) ? 0 : UPF_IOREMAP);
67464         port->line      = idx;
67465         port->ops       = &mpc52xx_uart_ops;
67466         port->dev       = &dev->dev;
67467  
67468         /* Search for IRQ and mapbase */
67469 -       for (i=0 ; i<dev->num_resources ; i++, res++) {
67470 +       for (i = 0 ; i < dev->num_resources ; i++, res++) {
67471                 if (res->flags & IORESOURCE_MEM)
67472                         port->mapbase = res->start;
67473                 else if (res->flags & IORESOURCE_IRQ)
67474 @@ -866,7 +880,7 @@
67475         /* Add the port to the uart sub-system */
67476         ret = uart_add_one_port(&mpc52xx_uart_driver, port);
67477         if (!ret)
67478 -               platform_set_drvdata(dev, (void*)port);
67479 +               platform_set_drvdata(dev, (void *)port);
67480  
67481         return ret;
67482  }
67483 @@ -917,6 +931,7 @@
67484         .resume         = mpc52xx_uart_resume,
67485  #endif
67486         .driver         = {
67487 +               .owner  = THIS_MODULE,
67488                 .name   = "mpc52xx-psc",
67489         },
67490  };
67491 @@ -946,10 +961,11 @@
67492         if (idx >= MPC52xx_PSC_MAXNUM)
67493                 return -EINVAL;
67494         pr_debug("Found %s assigned to ttyPSC%x\n",
67495 -                mpc52xx_uart_nodes[idx]->full_name, idx);
67496 +                mpc52xx_uart_nodes[idx]->full_name, idx);
67497  
67498         /* Search for bus-frequency property in this node or a parent */
67499 -       if ((ipb_freq = mpc52xx_find_ipb_freq(op->node)) == 0) {
67500 +       ipb_freq = mpc52xx_find_ipb_freq(op->node);
67501 +       if (ipb_freq == 0) {
67502                 dev_dbg(&op->dev, "Could not find IPB bus frequency!\n");
67503                 return -EINVAL;
67504         }
67505 @@ -962,22 +978,23 @@
67506         port->fifosize  = 512;
67507         port->iotype    = UPIO_MEM;
67508         port->flags     = UPF_BOOT_AUTOCONF |
67509 -                         ( uart_console(port) ? 0 : UPF_IOREMAP );
67510 +                         (uart_console(port) ? 0 : UPF_IOREMAP);
67511         port->line      = idx;
67512         port->ops       = &mpc52xx_uart_ops;
67513         port->dev       = &op->dev;
67514  
67515         /* Search for IRQ and mapbase */
67516 -       if ((ret = of_address_to_resource(op->node, 0, &res)) != 0)
67517 +       ret = of_address_to_resource(op->node, 0, &res);
67518 +       if (ret)
67519                 return ret;
67520  
67521         port->mapbase = res.start;
67522         port->irq = irq_of_parse_and_map(op->node, 0);
67523  
67524         dev_dbg(&op->dev, "mpc52xx-psc uart at %p, irq=%x, freq=%i\n",
67525 -               (void*)port->mapbase, port->irq, port->uartclk);
67526 +               (void *)port->mapbase, port->irq, port->uartclk);
67527  
67528 -       if ((port->irq==NO_IRQ) || !port->mapbase) {
67529 +       if ((port->irq == NO_IRQ) || !port->mapbase) {
67530                 printk(KERN_ERR "Could not allocate resources for PSC\n");
67531                 return -EINVAL;
67532         }
67533 @@ -985,7 +1002,7 @@
67534         /* Add the port to the uart sub-system */
67535         ret = uart_add_one_port(&mpc52xx_uart_driver, port);
67536         if (!ret)
67537 -               dev_set_drvdata(&op->dev, (void*)port);
67538 +               dev_set_drvdata(&op->dev, (void *)port);
67539  
67540         return ret;
67541  }
67542 @@ -1048,6 +1065,7 @@
67543         if (idx < 0)
67544                 return; /* No free slot; abort */
67545  
67546 +       of_node_get(np);
67547         /* If the slot is already occupied, then swap slots */
67548         if (mpc52xx_uart_nodes[idx] && (free_idx != -1))
67549                 mpc52xx_uart_nodes[free_idx] = mpc52xx_uart_nodes[idx];
67550 @@ -1057,7 +1075,7 @@
67551  static void
67552  mpc52xx_uart_of_enumerate(void)
67553  {
67554 -       static int enum_done = 0;
67555 +       static int enum_done;
67556         struct device_node *np;
67557         const unsigned int *devno;
67558         int i;
67559 @@ -1071,7 +1089,7 @@
67560  
67561                 /* Is a particular device number requested? */
67562                 devno = of_get_property(np, "port-number", NULL);
67563 -               mpc52xx_uart_of_assign(of_node_get(np), devno ? *devno : -1);
67564 +               mpc52xx_uart_of_assign(np, devno ? *devno : -1);
67565         }
67566  
67567         enum_done = 1;
67568 @@ -1079,15 +1097,13 @@
67569         for (i = 0; i < MPC52xx_PSC_MAXNUM; i++) {
67570                 if (mpc52xx_uart_nodes[i])
67571                         pr_debug("%s assigned to ttyPSC%x\n",
67572 -                                mpc52xx_uart_nodes[i]->full_name, i);
67573 +                                mpc52xx_uart_nodes[i]->full_name, i);
67574         }
67575  }
67576  
67577  MODULE_DEVICE_TABLE(of, mpc52xx_uart_of_match);
67578  
67579  static struct of_platform_driver mpc52xx_uart_of_driver = {
67580 -       .owner          = THIS_MODULE,
67581 -       .name           = "mpc52xx-psc-uart",
67582         .match_table    = mpc52xx_uart_of_match,
67583         .probe          = mpc52xx_uart_of_probe,
67584         .remove         = mpc52xx_uart_of_remove,
67585 @@ -1113,7 +1129,8 @@
67586  
67587         printk(KERN_INFO "Serial: MPC52xx PSC UART driver\n");
67588  
67589 -       if ((ret = uart_register_driver(&mpc52xx_uart_driver)) != 0) {
67590 +       ret = uart_register_driver(&mpc52xx_uart_driver);
67591 +       if (ret) {
67592                 printk(KERN_ERR "%s: uart_register_driver failed (%i)\n",
67593                        __FILE__, ret);
67594                 return ret;
67595 diff -x .git -x .gitignore -Nur linux-2.6.24/drivers/serial/uartlite.c powerpc.git/drivers/serial/uartlite.c
67596 --- linux-2.6.24/drivers/serial/uartlite.c      2008-01-24 23:58:37.000000000 +0100
67597 +++ powerpc.git/drivers/serial/uartlite.c       2008-01-28 20:26:19.000000000 +0100
67598 @@ -539,7 +539,7 @@
67599   *
67600   * @dev: pointer to device structure
67601   */
67602 -static int __devinit ulite_release(struct device *dev)
67603 +static int __devexit ulite_release(struct device *dev)
67604  {
67605         struct uart_port *port = dev_get_drvdata(dev);
67606         int rc = 0;
67607 @@ -572,14 +572,14 @@
67608         return ulite_assign(&pdev->dev, pdev->id, res->start, res2->start);
67609  }
67610  
67611 -static int ulite_remove(struct platform_device *pdev)
67612 +static int __devexit ulite_remove(struct platform_device *pdev)
67613  {
67614         return ulite_release(&pdev->dev);
67615  }
67616  
67617  static struct platform_driver ulite_platform_driver = {
67618         .probe  = ulite_probe,
67619 -       .remove = ulite_remove,
67620 +       .remove = __devexit_p(ulite_remove),
67621         .driver = {
67622                    .owner = THIS_MODULE,
67623                    .name  = "uartlite",
67624 diff -x .git -x .gitignore -Nur linux-2.6.24/drivers/serial/ucc_uart.c powerpc.git/drivers/serial/ucc_uart.c
67625 --- linux-2.6.24/drivers/serial/ucc_uart.c      1970-01-01 01:00:00.000000000 +0100
67626 +++ powerpc.git/drivers/serial/ucc_uart.c       2008-01-28 20:26:20.000000000 +0100
67627 @@ -0,0 +1,1514 @@
67628 +/*
67629 + * Freescale QUICC Engine UART device driver
67630 + *
67631 + * Author: Timur Tabi <timur@freescale.com>
67632 + *
67633 + * Copyright 2007 Freescale Semiconductor, Inc.  This file is licensed under
67634 + * the terms of the GNU General Public License version 2.  This program
67635 + * is licensed "as is" without any warranty of any kind, whether express
67636 + * or implied.
67637 + *
67638 + * This driver adds support for UART devices via Freescale's QUICC Engine
67639 + * found on some Freescale SOCs.
67640 + *
67641 + * If Soft-UART support is needed but not already present, then this driver
67642 + * will request and upload the "Soft-UART" microcode upon probe.  The
67643 + * filename of the microcode should be fsl_qe_ucode_uart_X_YZ.bin, where "X"
67644 + * is the name of the SOC (e.g. 8323), and YZ is the revision of the SOC,
67645 + * (e.g. "11" for 1.1).
67646 + */
67647 +
67648 +#include <linux/module.h>
67649 +#include <linux/serial.h>
67650 +#include <linux/serial_core.h>
67651 +#include <linux/io.h>
67652 +#include <linux/of_platform.h>
67653 +#include <linux/dma-mapping.h>
67654 +
67655 +#include <linux/fs_uart_pd.h>
67656 +#include <asm/ucc_slow.h>
67657 +
67658 +#include <linux/firmware.h>
67659 +#include <asm/reg.h>
67660 +
67661 +/*
67662 + * The GUMR flag for Soft UART.  This would normally be defined in qe.h,
67663 + * but Soft-UART is a hack and we want to keep everything related to it in
67664 + * this file.
67665 + */
67666 +#define UCC_SLOW_GUMR_H_SUART          0x00004000      /* Soft-UART */
67667 +
67668 +/*
67669 + * soft_uart is 1 if we need to use Soft-UART mode
67670 + */
67671 +static int soft_uart;
67672 +/*
67673 + * firmware_loaded is 1 if the firmware has been loaded, 0 otherwise.
67674 + */
67675 +static int firmware_loaded;
67676 +
67677 +/* Enable this macro to configure all serial ports in internal loopback
67678 +   mode */
67679 +/* #define LOOPBACK */
67680 +
67681 +/* The major and minor device numbers are defined in
67682 + * http://www.lanana.org/docs/device-list/devices-2.6+.txt.  For the QE
67683 + * UART, we have major number 204 and minor numbers 46 - 49, which are the
67684 + * same as for the CPM2.  This decision was made because no Freescale part
67685 + * has both a CPM and a QE.
67686 + */
67687 +#define SERIAL_QE_MAJOR 204
67688 +#define SERIAL_QE_MINOR 46
67689 +
67690 +/* Since we only have minor numbers 46 - 49, there is a hard limit of 4 ports */
67691 +#define UCC_MAX_UART    4
67692 +
67693 +/* The number of buffer descriptors for receiving characters. */
67694 +#define RX_NUM_FIFO     4
67695 +
67696 +/* The number of buffer descriptors for transmitting characters. */
67697 +#define TX_NUM_FIFO     4
67698 +
67699 +/* The maximum size of the character buffer for a single RX BD. */
67700 +#define RX_BUF_SIZE     32
67701 +
67702 +/* The maximum size of the character buffer for a single TX BD. */
67703 +#define TX_BUF_SIZE     32
67704 +
67705 +/*
67706 + * The number of jiffies to wait after receiving a close command before the
67707 + * device is actually closed.  This allows the last few characters to be
67708 + * sent over the wire.
67709 + */
67710 +#define UCC_WAIT_CLOSING 100
67711 +
67712 +struct ucc_uart_pram {
67713 +       struct ucc_slow_pram common;
67714 +       u8 res1[8];             /* reserved */
67715 +       __be16 maxidl;          /* Maximum idle chars */
67716 +       __be16 idlc;            /* temp idle counter */
67717 +       __be16 brkcr;           /* Break count register */
67718 +       __be16 parec;           /* receive parity error counter */
67719 +       __be16 frmec;           /* receive framing error counter */
67720 +       __be16 nosec;           /* receive noise counter */
67721 +       __be16 brkec;           /* receive break condition counter */
67722 +       __be16 brkln;           /* last received break length */
67723 +       __be16 uaddr[2];        /* UART address character 1 & 2 */
67724 +       __be16 rtemp;           /* Temp storage */
67725 +       __be16 toseq;           /* Transmit out of sequence char */
67726 +       __be16 cchars[8];       /* control characters 1-8 */
67727 +       __be16 rccm;            /* receive control character mask */
67728 +       __be16 rccr;            /* receive control character register */
67729 +       __be16 rlbc;            /* receive last break character */
67730 +       __be16 res2;            /* reserved */
67731 +       __be32 res3;            /* reserved, should be cleared */
67732 +       u8 res4;                /* reserved, should be cleared */
67733 +       u8 res5[3];             /* reserved, should be cleared */
67734 +       __be32 res6;            /* reserved, should be cleared */
67735 +       __be32 res7;            /* reserved, should be cleared */
67736 +       __be32 res8;            /* reserved, should be cleared */
67737 +       __be32 res9;            /* reserved, should be cleared */
67738 +       __be32 res10;           /* reserved, should be cleared */
67739 +       __be32 res11;           /* reserved, should be cleared */
67740 +       __be32 res12;           /* reserved, should be cleared */
67741 +       __be32 res13;           /* reserved, should be cleared */
67742 +/* The rest is for Soft-UART only */
67743 +       __be16 supsmr;          /* 0x90, Shadow UPSMR */
67744 +       __be16 res92;           /* 0x92, reserved, initialize to 0 */
67745 +       __be32 rx_state;        /* 0x94, RX state, initialize to 0 */
67746 +       __be32 rx_cnt;          /* 0x98, RX count, initialize to 0 */
67747 +       u8 rx_length;           /* 0x9C, Char length, set to 1+CL+PEN+1+SL */
67748 +       u8 rx_bitmark;          /* 0x9D, reserved, initialize to 0 */
67749 +       u8 rx_temp_dlst_qe;     /* 0x9E, reserved, initialize to 0 */
67750 +       u8 res14[0xBC - 0x9F];  /* reserved */
67751 +       __be32 dump_ptr;        /* 0xBC, Dump pointer */
67752 +       __be32 rx_frame_rem;    /* 0xC0, reserved, initialize to 0 */
67753 +       u8 rx_frame_rem_size;   /* 0xC4, reserved, initialize to 0 */
67754 +       u8 tx_mode;             /* 0xC5, mode, 0=AHDLC, 1=UART */
67755 +       __be16 tx_state;        /* 0xC6, TX state */
67756 +       u8 res15[0xD0 - 0xC8];  /* reserved */
67757 +       __be32 resD0;           /* 0xD0, reserved, initialize to 0 */
67758 +       u8 resD4;               /* 0xD4, reserved, initialize to 0 */
67759 +       __be16 resD5;           /* 0xD5, reserved, initialize to 0 */
67760 +} __attribute__ ((packed));
67761 +
67762 +/* SUPSMR definitions, for Soft-UART only */
67763 +#define UCC_UART_SUPSMR_SL             0x8000
67764 +#define UCC_UART_SUPSMR_RPM_MASK       0x6000
67765 +#define UCC_UART_SUPSMR_RPM_ODD        0x0000
67766 +#define UCC_UART_SUPSMR_RPM_LOW        0x2000
67767 +#define UCC_UART_SUPSMR_RPM_EVEN       0x4000
67768 +#define UCC_UART_SUPSMR_RPM_HIGH       0x6000
67769 +#define UCC_UART_SUPSMR_PEN            0x1000
67770 +#define UCC_UART_SUPSMR_TPM_MASK       0x0C00
67771 +#define UCC_UART_SUPSMR_TPM_ODD        0x0000
67772 +#define UCC_UART_SUPSMR_TPM_LOW        0x0400
67773 +#define UCC_UART_SUPSMR_TPM_EVEN       0x0800
67774 +#define UCC_UART_SUPSMR_TPM_HIGH       0x0C00
67775 +#define UCC_UART_SUPSMR_FRZ            0x0100
67776 +#define UCC_UART_SUPSMR_UM_MASK        0x00c0
67777 +#define UCC_UART_SUPSMR_UM_NORMAL       0x0000
67778 +#define UCC_UART_SUPSMR_UM_MAN_MULTI    0x0040
67779 +#define UCC_UART_SUPSMR_UM_AUTO_MULTI   0x00c0
67780 +#define UCC_UART_SUPSMR_CL_MASK        0x0030
67781 +#define UCC_UART_SUPSMR_CL_8           0x0030
67782 +#define UCC_UART_SUPSMR_CL_7           0x0020
67783 +#define UCC_UART_SUPSMR_CL_6           0x0010
67784 +#define UCC_UART_SUPSMR_CL_5           0x0000
67785 +
67786 +#define UCC_UART_TX_STATE_AHDLC        0x00
67787 +#define UCC_UART_TX_STATE_UART         0x01
67788 +#define UCC_UART_TX_STATE_X1           0x00
67789 +#define UCC_UART_TX_STATE_X16          0x80
67790 +
67791 +#define UCC_UART_PRAM_ALIGNMENT 0x100
67792 +
67793 +#define UCC_UART_SIZE_OF_BD     UCC_SLOW_SIZE_OF_BD
67794 +#define NUM_CONTROL_CHARS       8
67795 +
67796 +/* Private per-port data structure */
67797 +struct uart_qe_port {
67798 +       struct uart_port port;
67799 +       struct ucc_slow __iomem *uccp;
67800 +       struct ucc_uart_pram __iomem *uccup;
67801 +       struct ucc_slow_info us_info;
67802 +       struct ucc_slow_private *us_private;
67803 +       struct device_node *np;
67804 +       unsigned int ucc_num;   /* First ucc is 0, not 1 */
67805 +
67806 +       u16 rx_nrfifos;
67807 +       u16 rx_fifosize;
67808 +       u16 tx_nrfifos;
67809 +       u16 tx_fifosize;
67810 +       int wait_closing;
67811 +       u32 flags;
67812 +       struct qe_bd *rx_bd_base;
67813 +       struct qe_bd *rx_cur;
67814 +       struct qe_bd *tx_bd_base;
67815 +       struct qe_bd *tx_cur;
67816 +       unsigned char *tx_buf;
67817 +       unsigned char *rx_buf;
67818 +       void *bd_virt;          /* virtual address of the BD buffers */
67819 +       dma_addr_t bd_dma_addr; /* bus address of the BD buffers */
67820 +       unsigned int bd_size;   /* size of BD buffer space */
67821 +};
67822 +
67823 +static struct uart_driver ucc_uart_driver = {
67824 +       .owner          = THIS_MODULE,
67825 +       .driver_name    = "serial",
67826 +       .dev_name       = "ttyQE",
67827 +       .major          = SERIAL_QE_MAJOR,
67828 +       .minor          = SERIAL_QE_MINOR,
67829 +       .nr             = UCC_MAX_UART,
67830 +};
67831 +
67832 +/*
67833 + * Virtual to physical address translation.
67834 + *
67835 + * Given the virtual address for a character buffer, this function returns
67836 + * the physical (DMA) equivalent.
67837 + */
67838 +static inline dma_addr_t cpu2qe_addr(void *addr, struct uart_qe_port *qe_port)
67839 +{
67840 +       if (likely((addr >= qe_port->bd_virt)) &&
67841 +           (addr < (qe_port->bd_virt + qe_port->bd_size)))
67842 +               return qe_port->bd_dma_addr + (addr - qe_port->bd_virt);
67843 +
67844 +       /* something nasty happened */
67845 +       printk(KERN_ERR "%s: addr=%p\n", __FUNCTION__, addr);
67846 +       BUG();
67847 +       return 0;
67848 +}
67849 +
67850 +/*
67851 + * Physical to virtual address translation.
67852 + *
67853 + * Given the physical (DMA) address for a character buffer, this function
67854 + * returns the virtual equivalent.
67855 + */
67856 +static inline void *qe2cpu_addr(dma_addr_t addr, struct uart_qe_port *qe_port)
67857 +{
67858 +       /* sanity check */
67859 +       if (likely((addr >= qe_port->bd_dma_addr) &&
67860 +                  (addr < (qe_port->bd_dma_addr + qe_port->bd_size))))
67861 +               return qe_port->bd_virt + (addr - qe_port->bd_dma_addr);
67862 +
67863 +       /* something nasty happened */
67864 +       printk(KERN_ERR "%s: addr=%x\n", __FUNCTION__, addr);
67865 +       BUG();
67866 +       return NULL;
67867 +}
67868 +
67869 +/*
67870 + * Return 1 if the QE is done transmitting all buffers for this port
67871 + *
67872 + * This function scans each BD in sequence.  If we find a BD that is not
67873 + * ready (READY=1), then we return 0 indicating that the QE is still sending
67874 + * data.  If we reach the last BD (WRAP=1), then we know we've scanned
67875 + * the entire list, and all BDs are done.
67876 + */
67877 +static unsigned int qe_uart_tx_empty(struct uart_port *port)
67878 +{
67879 +       struct uart_qe_port *qe_port =
67880 +               container_of(port, struct uart_qe_port, port);
67881 +       struct qe_bd *bdp = qe_port->tx_bd_base;
67882 +
67883 +       while (1) {
67884 +               if (in_be16(&bdp->status) & BD_SC_READY)
67885 +                       /* This BD is not done, so return "not done" */
67886 +                       return 0;
67887 +
67888 +               if (in_be16(&bdp->status) & BD_SC_WRAP)
67889 +                       /*
67890 +                        * This BD is done and it's the last one, so return
67891 +                        * "done"
67892 +                        */
67893 +                       return 1;
67894 +
67895 +               bdp++;
67896 +       };
67897 +}
67898 +
67899 +/*
67900 + * Set the modem control lines
67901 + *
67902 + * Although the QE can control the modem control lines (e.g. CTS), we
67903 + * don't need that support. This function must exist, however, otherwise
67904 + * the kernel will panic.
67905 + */
67906 +void qe_uart_set_mctrl(struct uart_port *port, unsigned int mctrl)
67907 +{
67908 +}
67909 +
67910 +/*
67911 + * Get the current modem control line status
67912 + *
67913 + * Although the QE can control the modem control lines (e.g. CTS), this
67914 + * driver currently doesn't support that, so we always return Carrier
67915 + * Detect, Data Set Ready, and Clear To Send.
67916 + */
67917 +static unsigned int qe_uart_get_mctrl(struct uart_port *port)
67918 +{
67919 +       return TIOCM_CAR | TIOCM_DSR | TIOCM_CTS;
67920 +}
67921 +
67922 +/*
67923 + * Disable the transmit interrupt.
67924 + *
67925 + * Although this function is called "stop_tx", it does not actually stop
67926 + * transmission of data.  Instead, it tells the QE to not generate an
67927 + * interrupt when the UCC is finished sending characters.
67928 + */
67929 +static void qe_uart_stop_tx(struct uart_port *port)
67930 +{
67931 +       struct uart_qe_port *qe_port =
67932 +               container_of(port, struct uart_qe_port, port);
67933 +
67934 +       clrbits16(&qe_port->uccp->uccm, UCC_UART_UCCE_TX);
67935 +}
67936 +
67937 +/*
67938 + * Transmit as many characters to the HW as possible.
67939 + *
67940 + * This function will attempt to stuff of all the characters from the
67941 + * kernel's transmit buffer into TX BDs.
67942 + *
67943 + * A return value of non-zero indicates that it sucessfully stuffed all
67944 + * characters from the kernel buffer.
67945 + *
67946 + * A return value of zero indicates that there are still characters in the
67947 + * kernel's buffer that have not been transmitted, but there are no more BDs
67948 + * available.  This function should be called again after a BD has been made
67949 + * available.
67950 + */
67951 +static int qe_uart_tx_pump(struct uart_qe_port *qe_port)
67952 +{
67953 +       struct qe_bd *bdp;
67954 +       unsigned char *p;
67955 +       unsigned int count;
67956 +       struct uart_port *port = &qe_port->port;
67957 +       struct circ_buf *xmit = &port->info->xmit;
67958 +
67959 +       bdp = qe_port->rx_cur;
67960 +
67961 +       /* Handle xon/xoff */
67962 +       if (port->x_char) {
67963 +               /* Pick next descriptor and fill from buffer */
67964 +               bdp = qe_port->tx_cur;
67965 +
67966 +               p = qe2cpu_addr(bdp->buf, qe_port);
67967 +
67968 +               *p++ = port->x_char;
67969 +               out_be16(&bdp->length, 1);
67970 +               setbits16(&bdp->status, BD_SC_READY);
67971 +               /* Get next BD. */
67972 +               if (in_be16(&bdp->status) & BD_SC_WRAP)
67973 +                       bdp = qe_port->tx_bd_base;
67974 +               else
67975 +                       bdp++;
67976 +               qe_port->tx_cur = bdp;
67977 +
67978 +               port->icount.tx++;
67979 +               port->x_char = 0;
67980 +               return 1;
67981 +       }
67982 +
67983 +       if (uart_circ_empty(xmit) || uart_tx_stopped(port)) {
67984 +               qe_uart_stop_tx(port);
67985 +               return 0;
67986 +       }
67987 +
67988 +       /* Pick next descriptor and fill from buffer */
67989 +       bdp = qe_port->tx_cur;
67990 +
67991 +       while (!(in_be16(&bdp->status) & BD_SC_READY) &&
67992 +              (xmit->tail != xmit->head)) {
67993 +               count = 0;
67994 +               p = qe2cpu_addr(bdp->buf, qe_port);
67995 +               while (count < qe_port->tx_fifosize) {
67996 +                       *p++ = xmit->buf[xmit->tail];
67997 +                       xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
67998 +                       port->icount.tx++;
67999 +                       count++;
68000 +                       if (xmit->head == xmit->tail)
68001 +                               break;
68002 +               }
68003 +
68004 +               out_be16(&bdp->length, count);
68005 +               setbits16(&bdp->status, BD_SC_READY);
68006 +
68007 +               /* Get next BD. */
68008 +               if (in_be16(&bdp->status) & BD_SC_WRAP)
68009 +                       bdp = qe_port->tx_bd_base;
68010 +               else
68011 +                       bdp++;
68012 +       }
68013 +       qe_port->tx_cur = bdp;
68014 +
68015 +       if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
68016 +               uart_write_wakeup(port);
68017 +
68018 +       if (uart_circ_empty(xmit)) {
68019 +               /* The kernel buffer is empty, so turn off TX interrupts.  We
68020 +                  don't need to be told when the QE is finished transmitting
68021 +                  the data. */
68022 +               qe_uart_stop_tx(port);
68023 +               return 0;
68024 +       }
68025 +
68026 +       return 1;
68027 +}
68028 +
68029 +/*
68030 + * Start transmitting data
68031 + *
68032 + * This function will start transmitting any available data, if the port
68033 + * isn't already transmitting data.
68034 + */
68035 +static void qe_uart_start_tx(struct uart_port *port)
68036 +{
68037 +       struct uart_qe_port *qe_port =
68038 +               container_of(port, struct uart_qe_port, port);
68039 +
68040 +       /* If we currently are transmitting, then just return */
68041 +       if (in_be16(&qe_port->uccp->uccm) & UCC_UART_UCCE_TX)
68042 +               return;
68043 +
68044 +       /* Otherwise, pump the port and start transmission */
68045 +       if (qe_uart_tx_pump(qe_port))
68046 +               setbits16(&qe_port->uccp->uccm, UCC_UART_UCCE_TX);
68047 +}
68048 +
68049 +/*
68050 + * Stop transmitting data
68051 + */
68052 +static void qe_uart_stop_rx(struct uart_port *port)
68053 +{
68054 +       struct uart_qe_port *qe_port =
68055 +               container_of(port, struct uart_qe_port, port);
68056 +
68057 +       clrbits16(&qe_port->uccp->uccm, UCC_UART_UCCE_RX);
68058 +}
68059 +
68060 +/*
68061 + * Enable status change interrupts
68062 + *
68063 + * We don't support status change interrupts, but we need to define this
68064 + * function otherwise the kernel will panic.
68065 + */
68066 +static void qe_uart_enable_ms(struct uart_port *port)
68067 +{
68068 +}
68069 +
68070 +/* Start or stop sending  break signal
68071 + *
68072 + * This function controls the sending of a break signal.  If break_state=1,
68073 + * then we start sending a break signal.  If break_state=0, then we stop
68074 + * sending the break signal.
68075 + */
68076 +static void qe_uart_break_ctl(struct uart_port *port, int break_state)
68077 +{
68078 +       struct uart_qe_port *qe_port =
68079 +               container_of(port, struct uart_qe_port, port);
68080 +
68081 +       if (break_state)
68082 +               ucc_slow_stop_tx(qe_port->us_private);
68083 +       else
68084 +               ucc_slow_restart_tx(qe_port->us_private);
68085 +}
68086 +
68087 +/* ISR helper function for receiving character.
68088 + *
68089 + * This function is called by the ISR to handling receiving characters
68090 + */
68091 +static void qe_uart_int_rx(struct uart_qe_port *qe_port)
68092 +{
68093 +       int i;
68094 +       unsigned char ch, *cp;
68095 +       struct uart_port *port = &qe_port->port;
68096 +       struct tty_struct *tty = port->info->tty;
68097 +       struct qe_bd *bdp;
68098 +       u16 status;
68099 +       unsigned int flg;
68100 +
68101 +       /* Just loop through the closed BDs and copy the characters into
68102 +        * the buffer.
68103 +        */
68104 +       bdp = qe_port->rx_cur;
68105 +       while (1) {
68106 +               status = in_be16(&bdp->status);
68107 +
68108 +               /* If this one is empty, then we assume we've read them all */
68109 +               if (status & BD_SC_EMPTY)
68110 +                       break;
68111 +
68112 +               /* get number of characters, and check space in RX buffer */
68113 +               i = in_be16(&bdp->length);
68114 +
68115 +               /* If we don't have enough room in RX buffer for the entire BD,
68116 +                * then we try later, which will be the next RX interrupt.
68117 +                */
68118 +               if (tty_buffer_request_room(tty, i) < i) {
68119 +                       dev_dbg(port->dev, "ucc-uart: no room in RX buffer\n");
68120 +                       return;
68121 +               }
68122 +
68123 +               /* get pointer */
68124 +               cp = qe2cpu_addr(bdp->buf, qe_port);
68125 +
68126 +               /* loop through the buffer */
68127 +               while (i-- > 0) {
68128 +                       ch = *cp++;
68129 +                       port->icount.rx++;
68130 +                       flg = TTY_NORMAL;
68131 +
68132 +                       if (!i && status &
68133 +                           (BD_SC_BR | BD_SC_FR | BD_SC_PR | BD_SC_OV))
68134 +                               goto handle_error;
68135 +                       if (uart_handle_sysrq_char(port, ch))
68136 +                               continue;
68137 +
68138 +error_return:
68139 +                       tty_insert_flip_char(tty, ch, flg);
68140 +
68141 +               }
68142 +
68143 +               /* This BD is ready to be used again. Clear status. get next */
68144 +               clrsetbits_be16(&bdp->status, BD_SC_BR | BD_SC_FR | BD_SC_PR |
68145 +                       BD_SC_OV | BD_SC_ID, BD_SC_EMPTY);
68146 +               if (in_be16(&bdp->status) & BD_SC_WRAP)
68147 +                       bdp = qe_port->rx_bd_base;
68148 +               else
68149 +                       bdp++;
68150 +
68151 +       }
68152 +
68153 +       /* Write back buffer pointer */
68154 +       qe_port->rx_cur = bdp;
68155 +
68156 +       /* Activate BH processing */
68157 +       tty_flip_buffer_push(tty);
68158 +
68159 +       return;
68160 +
68161 +       /* Error processing */
68162 +
68163 +handle_error:
68164 +       /* Statistics */
68165 +       if (status & BD_SC_BR)
68166 +               port->icount.brk++;
68167 +       if (status & BD_SC_PR)
68168 +               port->icount.parity++;
68169 +       if (status & BD_SC_FR)
68170 +               port->icount.frame++;
68171 +       if (status & BD_SC_OV)
68172 +               port->icount.overrun++;
68173 +
68174 +       /* Mask out ignored conditions */
68175 +       status &= port->read_status_mask;
68176 +
68177 +       /* Handle the remaining ones */
68178 +       if (status & BD_SC_BR)
68179 +               flg = TTY_BREAK;
68180 +       else if (status & BD_SC_PR)
68181 +               flg = TTY_PARITY;
68182 +       else if (status & BD_SC_FR)
68183 +               flg = TTY_FRAME;
68184 +
68185 +       /* Overrun does not affect the current character ! */
68186 +       if (status & BD_SC_OV)
68187 +               tty_insert_flip_char(tty, 0, TTY_OVERRUN);
68188 +#ifdef SUPPORT_SYSRQ
68189 +       port->sysrq = 0;
68190 +#endif
68191 +       goto error_return;
68192 +}
68193 +
68194 +/* Interrupt handler
68195 + *
68196 + * This interrupt handler is called after a BD is processed.
68197 + */
68198 +static irqreturn_t qe_uart_int(int irq, void *data)
68199 +{
68200 +       struct uart_qe_port *qe_port = (struct uart_qe_port *) data;
68201 +       struct ucc_slow __iomem *uccp = qe_port->uccp;
68202 +       u16 events;
68203 +
68204 +       /* Clear the interrupts */
68205 +       events = in_be16(&uccp->ucce);
68206 +       out_be16(&uccp->ucce, events);
68207 +
68208 +       if (events & UCC_UART_UCCE_BRKE)
68209 +               uart_handle_break(&qe_port->port);
68210 +
68211 +       if (events & UCC_UART_UCCE_RX)
68212 +               qe_uart_int_rx(qe_port);
68213 +
68214 +       if (events & UCC_UART_UCCE_TX)
68215 +               qe_uart_tx_pump(qe_port);
68216 +
68217 +       return events ? IRQ_HANDLED : IRQ_NONE;
68218 +}
68219 +
68220 +/* Initialize buffer descriptors
68221 + *
68222 + * This function initializes all of the RX and TX buffer descriptors.
68223 + */
68224 +static void qe_uart_initbd(struct uart_qe_port *qe_port)
68225 +{
68226 +       int i;
68227 +       void *bd_virt;
68228 +       struct qe_bd *bdp;
68229 +
68230 +       /* Set the physical address of the host memory buffers in the buffer
68231 +        * descriptors, and the virtual address for us to work with.
68232 +        */
68233 +       bd_virt = qe_port->bd_virt;
68234 +       bdp = qe_port->rx_bd_base;
68235 +       qe_port->rx_cur = qe_port->rx_bd_base;
68236 +       for (i = 0; i < (qe_port->rx_nrfifos - 1); i++) {
68237 +               out_be16(&bdp->status, BD_SC_EMPTY | BD_SC_INTRPT);
68238 +               out_be32(&bdp->buf, cpu2qe_addr(bd_virt, qe_port));
68239 +               out_be16(&bdp->length, 0);
68240 +               bd_virt += qe_port->rx_fifosize;
68241 +               bdp++;
68242 +       }
68243 +
68244 +       /* */
68245 +       out_be16(&bdp->status, BD_SC_WRAP | BD_SC_EMPTY | BD_SC_INTRPT);
68246 +       out_be32(&bdp->buf, cpu2qe_addr(bd_virt, qe_port));
68247 +       out_be16(&bdp->length, 0);
68248 +
68249 +       /* Set the physical address of the host memory
68250 +        * buffers in the buffer descriptors, and the
68251 +        * virtual address for us to work with.
68252 +        */
68253 +       bd_virt = qe_port->bd_virt +
68254 +               L1_CACHE_ALIGN(qe_port->rx_nrfifos * qe_port->rx_fifosize);
68255 +       qe_port->tx_cur = qe_port->tx_bd_base;
68256 +       bdp = qe_port->tx_bd_base;
68257 +       for (i = 0; i < (qe_port->tx_nrfifos - 1); i++) {
68258 +               out_be16(&bdp->status, BD_SC_INTRPT);
68259 +               out_be32(&bdp->buf, cpu2qe_addr(bd_virt, qe_port));
68260 +               out_be16(&bdp->length, 0);
68261 +               bd_virt += qe_port->tx_fifosize;
68262 +               bdp++;
68263 +       }
68264 +
68265 +       /* Loopback requires the preamble bit to be set on the first TX BD */
68266 +#ifdef LOOPBACK
68267 +       setbits16(&qe_port->tx_cur->status, BD_SC_P);
68268 +#endif
68269 +
68270 +       out_be16(&bdp->status, BD_SC_WRAP | BD_SC_INTRPT);
68271 +       out_be32(&bdp->buf, cpu2qe_addr(bd_virt, qe_port));
68272 +       out_be16(&bdp->length, 0);
68273 +}
68274 +
68275 +/*
68276 + * Initialize a UCC for UART.
68277 + *
68278 + * This function configures a given UCC to be used as a UART device. Basic
68279 + * UCC initialization is handled in qe_uart_request_port().  This function
68280 + * does all the UART-specific stuff.
68281 + */
68282 +static void qe_uart_init_ucc(struct uart_qe_port *qe_port)
68283 +{
68284 +       u32 cecr_subblock;
68285 +       struct ucc_slow __iomem *uccp = qe_port->uccp;
68286 +       struct ucc_uart_pram *uccup = qe_port->uccup;
68287 +
68288 +       unsigned int i;
68289 +
68290 +       /* First, disable TX and RX in the UCC */
68291 +       ucc_slow_disable(qe_port->us_private, COMM_DIR_RX_AND_TX);
68292 +
68293 +       /* Program the UCC UART parameter RAM */
68294 +       out_8(&uccup->common.rbmr, UCC_BMR_GBL | UCC_BMR_BO_BE);
68295 +       out_8(&uccup->common.tbmr, UCC_BMR_GBL | UCC_BMR_BO_BE);
68296 +       out_be16(&uccup->common.mrblr, qe_port->rx_fifosize);
68297 +       out_be16(&uccup->maxidl, 0x10);
68298 +       out_be16(&uccup->brkcr, 1);
68299 +       out_be16(&uccup->parec, 0);
68300 +       out_be16(&uccup->frmec, 0);
68301 +       out_be16(&uccup->nosec, 0);
68302 +       out_be16(&uccup->brkec, 0);
68303 +       out_be16(&uccup->uaddr[0], 0);
68304 +       out_be16(&uccup->uaddr[1], 0);
68305 +       out_be16(&uccup->toseq, 0);
68306 +       for (i = 0; i < 8; i++)
68307 +               out_be16(&uccup->cchars[i], 0xC000);
68308 +       out_be16(&uccup->rccm, 0xc0ff);
68309 +
68310 +       /* Configure the GUMR registers for UART */
68311 +       if (soft_uart)
68312 +               /* Soft-UART requires a 1X multiplier for TX */
68313 +               clrsetbits_be32(&uccp->gumr_l,
68314 +                       UCC_SLOW_GUMR_L_MODE_MASK | UCC_SLOW_GUMR_L_TDCR_MASK |
68315 +                       UCC_SLOW_GUMR_L_RDCR_MASK,
68316 +                       UCC_SLOW_GUMR_L_MODE_UART | UCC_SLOW_GUMR_L_TDCR_1 |
68317 +                       UCC_SLOW_GUMR_L_RDCR_16);
68318 +       else
68319 +               clrsetbits_be32(&uccp->gumr_l,
68320 +                       UCC_SLOW_GUMR_L_MODE_MASK | UCC_SLOW_GUMR_L_TDCR_MASK |
68321 +                       UCC_SLOW_GUMR_L_RDCR_MASK,
68322 +                       UCC_SLOW_GUMR_L_MODE_UART | UCC_SLOW_GUMR_L_TDCR_16 |
68323 +                       UCC_SLOW_GUMR_L_RDCR_16);
68324 +
68325 +       clrsetbits_be32(&uccp->gumr_h, UCC_SLOW_GUMR_H_RFW,
68326 +               UCC_SLOW_GUMR_H_TRX | UCC_SLOW_GUMR_H_TTX);
68327 +
68328 +#ifdef LOOPBACK
68329 +       clrsetbits_be32(&uccp->gumr_l, UCC_SLOW_GUMR_L_DIAG_MASK,
68330 +               UCC_SLOW_GUMR_L_DIAG_LOOP);
68331 +       clrsetbits_be32(&uccp->gumr_h,
68332 +               UCC_SLOW_GUMR_H_CTSP | UCC_SLOW_GUMR_H_RSYN,
68333 +               UCC_SLOW_GUMR_H_CDS);
68334 +#endif
68335 +
68336 +       /* Enable rx interrupts  and clear all pending events.  */
68337 +       out_be16(&uccp->uccm, 0);
68338 +       out_be16(&uccp->ucce, 0xffff);
68339 +       out_be16(&uccp->udsr, 0x7e7e);
68340 +
68341 +       /* Initialize UPSMR */
68342 +       out_be16(&uccp->upsmr, 0);
68343 +
68344 +       if (soft_uart) {
68345 +               out_be16(&uccup->supsmr, 0x30);
68346 +               out_be16(&uccup->res92, 0);
68347 +               out_be32(&uccup->rx_state, 0);
68348 +               out_be32(&uccup->rx_cnt, 0);
68349 +               out_8(&uccup->rx_bitmark, 0);
68350 +               out_8(&uccup->rx_length, 10);
68351 +               out_be32(&uccup->dump_ptr, 0x4000);
68352 +               out_8(&uccup->rx_temp_dlst_qe, 0);
68353 +               out_be32(&uccup->rx_frame_rem, 0);
68354 +               out_8(&uccup->rx_frame_rem_size, 0);
68355 +               /* Soft-UART requires TX to be 1X */
68356 +               out_8(&uccup->tx_mode,
68357 +                       UCC_UART_TX_STATE_UART | UCC_UART_TX_STATE_X1);
68358 +               out_be16(&uccup->tx_state, 0);
68359 +               out_8(&uccup->resD4, 0);
68360 +               out_be16(&uccup->resD5, 0);
68361 +
68362 +               /* Set UART mode.
68363 +                * Enable receive and transmit.
68364 +                */
68365 +
68366 +               /* From the microcode errata:
68367 +                * 1.GUMR_L register, set mode=0010 (QMC).
68368 +                * 2.Set GUMR_H[17] bit. (UART/AHDLC mode).
68369 +                * 3.Set GUMR_H[19:20] (Transparent mode)
68370 +                * 4.Clear GUMR_H[26] (RFW)
68371 +                * ...
68372 +                * 6.Receiver must use 16x over sampling
68373 +                */
68374 +               clrsetbits_be32(&uccp->gumr_l,
68375 +                       UCC_SLOW_GUMR_L_MODE_MASK | UCC_SLOW_GUMR_L_TDCR_MASK |
68376 +                       UCC_SLOW_GUMR_L_RDCR_MASK,
68377 +                       UCC_SLOW_GUMR_L_MODE_QMC | UCC_SLOW_GUMR_L_TDCR_16 |
68378 +                       UCC_SLOW_GUMR_L_RDCR_16);
68379 +
68380 +               clrsetbits_be32(&uccp->gumr_h,
68381 +                       UCC_SLOW_GUMR_H_RFW | UCC_SLOW_GUMR_H_RSYN,
68382 +                       UCC_SLOW_GUMR_H_SUART | UCC_SLOW_GUMR_H_TRX |
68383 +                       UCC_SLOW_GUMR_H_TTX | UCC_SLOW_GUMR_H_TFL);
68384 +
68385 +#ifdef LOOPBACK
68386 +               clrsetbits_be32(&uccp->gumr_l, UCC_SLOW_GUMR_L_DIAG_MASK,
68387 +                               UCC_SLOW_GUMR_L_DIAG_LOOP);
68388 +               clrbits32(&uccp->gumr_h, UCC_SLOW_GUMR_H_CTSP |
68389 +                         UCC_SLOW_GUMR_H_CDS);
68390 +#endif
68391 +
68392 +               cecr_subblock = ucc_slow_get_qe_cr_subblock(qe_port->ucc_num);
68393 +               qe_issue_cmd(QE_INIT_TX_RX, cecr_subblock,
68394 +                       QE_CR_PROTOCOL_UNSPECIFIED, 0);
68395 +       }
68396 +}
68397 +
68398 +/*
68399 + * Initialize the port.
68400 + */
68401 +static int qe_uart_startup(struct uart_port *port)
68402 +{
68403 +       struct uart_qe_port *qe_port =
68404 +               container_of(port, struct uart_qe_port, port);
68405 +       int ret;
68406 +
68407 +       /*
68408 +        * If we're using Soft-UART mode, then we need to make sure the
68409 +        * firmware has been uploaded first.
68410 +        */
68411 +       if (soft_uart && !firmware_loaded) {
68412 +               dev_err(port->dev, "Soft-UART firmware not uploaded\n");
68413 +               return -ENODEV;
68414 +       }
68415 +
68416 +       qe_uart_initbd(qe_port);
68417 +       qe_uart_init_ucc(qe_port);
68418 +
68419 +       /* Install interrupt handler. */
68420 +       ret = request_irq(port->irq, qe_uart_int, IRQF_SHARED, "ucc-uart",
68421 +               qe_port);
68422 +       if (ret) {
68423 +               dev_err(port->dev, "could not claim IRQ %u\n", port->irq);
68424 +               return ret;
68425 +       }
68426 +
68427 +       /* Startup rx-int */
68428 +       setbits16(&qe_port->uccp->uccm, UCC_UART_UCCE_RX);
68429 +       ucc_slow_enable(qe_port->us_private, COMM_DIR_RX_AND_TX);
68430 +
68431 +       return 0;
68432 +}
68433 +
68434 +/*
68435 + * Shutdown the port.
68436 + */
68437 +static void qe_uart_shutdown(struct uart_port *port)
68438 +{
68439 +       struct uart_qe_port *qe_port =
68440 +               container_of(port, struct uart_qe_port, port);
68441 +       struct ucc_slow __iomem *uccp = qe_port->uccp;
68442 +       unsigned int timeout = 20;
68443 +
68444 +       /* Disable RX and TX */
68445 +
68446 +       /* Wait for all the BDs marked sent */
68447 +       while (!qe_uart_tx_empty(port)) {
68448 +               if (!--timeout) {
68449 +                       dev_warn(port->dev, "shutdown timeout\n");
68450 +                       break;
68451 +               }
68452 +               set_current_state(TASK_UNINTERRUPTIBLE);
68453 +               schedule_timeout(2);
68454 +       }
68455 +
68456 +       if (qe_port->wait_closing) {
68457 +               /* Wait a bit longer */
68458 +               set_current_state(TASK_UNINTERRUPTIBLE);
68459 +               schedule_timeout(qe_port->wait_closing);
68460 +       }
68461 +
68462 +       /* Stop uarts */
68463 +       ucc_slow_disable(qe_port->us_private, COMM_DIR_RX_AND_TX);
68464 +       clrbits16(&uccp->uccm, UCC_UART_UCCE_TX | UCC_UART_UCCE_RX);
68465 +
68466 +       /* Shut them really down and reinit buffer descriptors */
68467 +       ucc_slow_graceful_stop_tx(qe_port->us_private);
68468 +       qe_uart_initbd(qe_port);
68469 +
68470 +       free_irq(port->irq, qe_port);
68471 +}
68472 +
68473 +/*
68474 + * Set the serial port parameters.
68475 + */
68476 +static void qe_uart_set_termios(struct uart_port *port,
68477 +                               struct ktermios *termios, struct ktermios *old)
68478 +{
68479 +       struct uart_qe_port *qe_port =
68480 +               container_of(port, struct uart_qe_port, port);
68481 +       struct ucc_slow __iomem *uccp = qe_port->uccp;
68482 +       unsigned int baud;
68483 +       unsigned long flags;
68484 +       u16 upsmr = in_be16(&uccp->upsmr);
68485 +       struct ucc_uart_pram __iomem *uccup = qe_port->uccup;
68486 +       u16 supsmr = in_be16(&uccup->supsmr);
68487 +       u8 char_length = 2; /* 1 + CL + PEN + 1 + SL */
68488 +
68489 +       /* Character length programmed into the mode register is the
68490 +        * sum of: 1 start bit, number of data bits, 0 or 1 parity bit,
68491 +        * 1 or 2 stop bits, minus 1.
68492 +        * The value 'bits' counts this for us.
68493 +        */
68494 +
68495 +       /* byte size */
68496 +       upsmr &= UCC_UART_UPSMR_CL_MASK;
68497 +       supsmr &= UCC_UART_SUPSMR_CL_MASK;
68498 +
68499 +       switch (termios->c_cflag & CSIZE) {
68500 +       case CS5:
68501 +               upsmr |= UCC_UART_UPSMR_CL_5;
68502 +               supsmr |= UCC_UART_SUPSMR_CL_5;
68503 +               char_length += 5;
68504 +               break;
68505 +       case CS6:
68506 +               upsmr |= UCC_UART_UPSMR_CL_6;
68507 +               supsmr |= UCC_UART_SUPSMR_CL_6;
68508 +               char_length += 6;
68509 +               break;
68510 +       case CS7:
68511 +               upsmr |= UCC_UART_UPSMR_CL_7;
68512 +               supsmr |= UCC_UART_SUPSMR_CL_7;
68513 +               char_length += 7;
68514 +               break;
68515 +       default:        /* case CS8 */
68516 +               upsmr |= UCC_UART_UPSMR_CL_8;
68517 +               supsmr |= UCC_UART_SUPSMR_CL_8;
68518 +               char_length += 8;
68519 +               break;
68520 +       }
68521 +
68522 +       /* If CSTOPB is set, we want two stop bits */
68523 +       if (termios->c_cflag & CSTOPB) {
68524 +               upsmr |= UCC_UART_UPSMR_SL;
68525 +               supsmr |= UCC_UART_SUPSMR_SL;
68526 +               char_length++;  /* + SL */
68527 +       }
68528 +
68529 +       if (termios->c_cflag & PARENB) {
68530 +               upsmr |= UCC_UART_UPSMR_PEN;
68531 +               supsmr |= UCC_UART_SUPSMR_PEN;
68532 +               char_length++;  /* + PEN */
68533 +
68534 +               if (!(termios->c_cflag & PARODD)) {
68535 +                       upsmr &= ~(UCC_UART_UPSMR_RPM_MASK |
68536 +                                  UCC_UART_UPSMR_TPM_MASK);
68537 +                       upsmr |= UCC_UART_UPSMR_RPM_EVEN |
68538 +                               UCC_UART_UPSMR_TPM_EVEN;
68539 +                       supsmr &= ~(UCC_UART_SUPSMR_RPM_MASK |
68540 +                                   UCC_UART_SUPSMR_TPM_MASK);
68541 +                       supsmr |= UCC_UART_SUPSMR_RPM_EVEN |
68542 +                               UCC_UART_SUPSMR_TPM_EVEN;
68543 +               }
68544 +       }
68545 +
68546 +       /*
68547 +        * Set up parity check flag
68548 +        */
68549 +       port->read_status_mask = BD_SC_EMPTY | BD_SC_OV;
68550 +       if (termios->c_iflag & INPCK)
68551 +               port->read_status_mask |= BD_SC_FR | BD_SC_PR;
68552 +       if (termios->c_iflag & (BRKINT | PARMRK))
68553 +               port->read_status_mask |= BD_SC_BR;
68554 +
68555 +       /*
68556 +        * Characters to ignore
68557 +        */
68558 +       port->ignore_status_mask = 0;
68559 +       if (termios->c_iflag & IGNPAR)
68560 +               port->ignore_status_mask |= BD_SC_PR | BD_SC_FR;
68561 +       if (termios->c_iflag & IGNBRK) {
68562 +               port->ignore_status_mask |= BD_SC_BR;
68563 +               /*
68564 +                * If we're ignore parity and break indicators, ignore
68565 +                * overruns too.  (For real raw support).
68566 +                */
68567 +               if (termios->c_iflag & IGNPAR)
68568 +                       port->ignore_status_mask |= BD_SC_OV;
68569 +       }
68570 +       /*
68571 +        * !!! ignore all characters if CREAD is not set
68572 +        */
68573 +       if ((termios->c_cflag & CREAD) == 0)
68574 +               port->read_status_mask &= ~BD_SC_EMPTY;
68575 +
68576 +       baud = uart_get_baud_rate(port, termios, old, 0, 115200);
68577 +
68578 +       /* Do we really need a spinlock here? */
68579 +       spin_lock_irqsave(&port->lock, flags);
68580 +
68581 +       out_be16(&uccp->upsmr, upsmr);
68582 +       if (soft_uart) {
68583 +               out_be16(&uccup->supsmr, supsmr);
68584 +               out_8(&uccup->rx_length, char_length);
68585 +
68586 +               /* Soft-UART requires a 1X multiplier for TX */
68587 +               qe_setbrg(qe_port->us_info.rx_clock, baud, 16);
68588 +               qe_setbrg(qe_port->us_info.tx_clock, baud, 1);
68589 +       } else {
68590 +               qe_setbrg(qe_port->us_info.rx_clock, baud, 16);
68591 +               qe_setbrg(qe_port->us_info.tx_clock, baud, 16);
68592 +       }
68593 +
68594 +       spin_unlock_irqrestore(&port->lock, flags);
68595 +}
68596 +
68597 +/*
68598 + * Return a pointer to a string that describes what kind of port this is.
68599 + */
68600 +static const char *qe_uart_type(struct uart_port *port)
68601 +{
68602 +       return "QE";
68603 +}
68604 +
68605 +/*
68606 + * Allocate any memory and I/O resources required by the port.
68607 + */
68608 +static int qe_uart_request_port(struct uart_port *port)
68609 +{
68610 +       int ret;
68611 +       struct uart_qe_port *qe_port =
68612 +               container_of(port, struct uart_qe_port, port);
68613 +       struct ucc_slow_info *us_info = &qe_port->us_info;
68614 +       struct ucc_slow_private *uccs;
68615 +       unsigned int rx_size, tx_size;
68616 +       void *bd_virt;
68617 +       dma_addr_t bd_dma_addr = 0;
68618 +
68619 +       ret = ucc_slow_init(us_info, &uccs);
68620 +       if (ret) {
68621 +               dev_err(port->dev, "could not initialize UCC%u\n",
68622 +                      qe_port->ucc_num);
68623 +               return ret;
68624 +       }
68625 +
68626 +       qe_port->us_private = uccs;
68627 +       qe_port->uccp = uccs->us_regs;
68628 +       qe_port->uccup = (struct ucc_uart_pram *) uccs->us_pram;
68629 +       qe_port->rx_bd_base = uccs->rx_bd;
68630 +       qe_port->tx_bd_base = uccs->tx_bd;
68631 +
68632 +       /*
68633 +        * Allocate the transmit and receive data buffers.
68634 +        */
68635 +
68636 +       rx_size = L1_CACHE_ALIGN(qe_port->rx_nrfifos * qe_port->rx_fifosize);
68637 +       tx_size = L1_CACHE_ALIGN(qe_port->tx_nrfifos * qe_port->tx_fifosize);
68638 +
68639 +       bd_virt = dma_alloc_coherent(NULL, rx_size + tx_size, &bd_dma_addr,
68640 +               GFP_KERNEL);
68641 +       if (!bd_virt) {
68642 +               dev_err(port->dev, "could not allocate buffer descriptors\n");
68643 +               return -ENOMEM;
68644 +       }
68645 +
68646 +       qe_port->bd_virt = bd_virt;
68647 +       qe_port->bd_dma_addr = bd_dma_addr;
68648 +       qe_port->bd_size = rx_size + tx_size;
68649 +
68650 +       qe_port->rx_buf = bd_virt;
68651 +       qe_port->tx_buf = qe_port->rx_buf + rx_size;
68652 +
68653 +       return 0;
68654 +}
68655 +
68656 +/*
68657 + * Configure the port.
68658 + *
68659 + * We say we're a CPM-type port because that's mostly true.  Once the device
68660 + * is configured, this driver operates almost identically to the CPM serial
68661 + * driver.
68662 + */
68663 +static void qe_uart_config_port(struct uart_port *port, int flags)
68664 +{
68665 +       if (flags & UART_CONFIG_TYPE) {
68666 +               port->type = PORT_CPM;
68667 +               qe_uart_request_port(port);
68668 +       }
68669 +}
68670 +
68671 +/*
68672 + * Release any memory and I/O resources that were allocated in
68673 + * qe_uart_request_port().
68674 + */
68675 +static void qe_uart_release_port(struct uart_port *port)
68676 +{
68677 +       struct uart_qe_port *qe_port =
68678 +               container_of(port, struct uart_qe_port, port);
68679 +       struct ucc_slow_private *uccs = qe_port->us_private;
68680 +
68681 +       dma_free_coherent(NULL, qe_port->bd_size, qe_port->bd_virt,
68682 +                         qe_port->bd_dma_addr);
68683 +
68684 +       ucc_slow_free(uccs);
68685 +}
68686 +
68687 +/*
68688 + * Verify that the data in serial_struct is suitable for this device.
68689 + */
68690 +static int qe_uart_verify_port(struct uart_port *port,
68691 +                              struct serial_struct *ser)
68692 +{
68693 +       if (ser->type != PORT_UNKNOWN && ser->type != PORT_CPM)
68694 +               return -EINVAL;
68695 +
68696 +       if (ser->irq < 0 || ser->irq >= NR_IRQS)
68697 +               return -EINVAL;
68698 +
68699 +       if (ser->baud_base < 9600)
68700 +               return -EINVAL;
68701 +
68702 +       return 0;
68703 +}
68704 +/* UART operations
68705 + *
68706 + * Details on these functions can be found in Documentation/serial/driver
68707 + */
68708 +static struct uart_ops qe_uart_pops = {
68709 +       .tx_empty       = qe_uart_tx_empty,
68710 +       .set_mctrl      = qe_uart_set_mctrl,
68711 +       .get_mctrl      = qe_uart_get_mctrl,
68712 +       .stop_tx        = qe_uart_stop_tx,
68713 +       .start_tx       = qe_uart_start_tx,
68714 +       .stop_rx        = qe_uart_stop_rx,
68715 +       .enable_ms      = qe_uart_enable_ms,
68716 +       .break_ctl      = qe_uart_break_ctl,
68717 +       .startup        = qe_uart_startup,
68718 +       .shutdown       = qe_uart_shutdown,
68719 +       .set_termios    = qe_uart_set_termios,
68720 +       .type           = qe_uart_type,
68721 +       .release_port   = qe_uart_release_port,
68722 +       .request_port   = qe_uart_request_port,
68723 +       .config_port    = qe_uart_config_port,
68724 +       .verify_port    = qe_uart_verify_port,
68725 +};
68726 +
68727 +/*
68728 + * Obtain the SOC model number and revision level
68729 + *
68730 + * This function parses the device tree to obtain the SOC model.  It then
68731 + * reads the SVR register to the revision.
68732 + *
68733 + * The device tree stores the SOC model two different ways.
68734 + *
68735 + * The new way is:
68736 + *
68737 + *             cpu@0 {
68738 + *                     compatible = "PowerPC,8323";
68739 + *                     device_type = "cpu";
68740 + *                     ...
68741 + *
68742 + *
68743 + * The old way is:
68744 + *              PowerPC,8323@0 {
68745 + *                     device_type = "cpu";
68746 + *                     ...
68747 + *
68748 + * This code first checks the new way, and then the old way.
68749 + */
68750 +static unsigned int soc_info(unsigned int *rev_h, unsigned int *rev_l)
68751 +{
68752 +       struct device_node *np;
68753 +       const char *soc_string;
68754 +       unsigned int svr;
68755 +       unsigned int soc;
68756 +
68757 +       /* Find the CPU node */
68758 +       np = of_find_node_by_type(NULL, "cpu");
68759 +       if (!np)
68760 +               return 0;
68761 +       /* Find the compatible property */
68762 +       soc_string = of_get_property(np, "compatible", NULL);
68763 +       if (!soc_string)
68764 +               /* No compatible property, so try the name. */
68765 +               soc_string = np->name;
68766 +
68767 +       /* Extract the SOC number from the "PowerPC," string */
68768 +       if ((sscanf(soc_string, "PowerPC,%u", &soc) != 1) || !soc)
68769 +               return 0;
68770 +
68771 +       /* Get the revision from the SVR */
68772 +       svr = mfspr(SPRN_SVR);
68773 +       *rev_h = (svr >> 4) & 0xf;
68774 +       *rev_l = svr & 0xf;
68775 +
68776 +       return soc;
68777 +}
68778 +
68779 +/*
68780 + * requst_firmware_nowait() callback function
68781 + *
68782 + * This function is called by the kernel when a firmware is made available,
68783 + * or if it times out waiting for the firmware.
68784 + */
68785 +static void uart_firmware_cont(const struct firmware *fw, void *context)
68786 +{
68787 +       struct qe_firmware *firmware;
68788 +       struct device *dev = context;
68789 +       int ret;
68790 +
68791 +       if (!fw) {
68792 +               dev_err(dev, "firmware not found\n");
68793 +               return;
68794 +       }
68795 +
68796 +       firmware = (struct qe_firmware *) fw->data;
68797 +
68798 +       if (firmware->header.length != fw->size) {
68799 +               dev_err(dev, "invalid firmware\n");
68800 +               return;
68801 +       }
68802 +
68803 +       ret = qe_upload_firmware(firmware);
68804 +       if (ret) {
68805 +               dev_err(dev, "could not load firmware\n");
68806 +               return;
68807 +       }
68808 +
68809 +       firmware_loaded = 1;
68810 +}
68811 +
68812 +static int ucc_uart_probe(struct of_device *ofdev,
68813 +       const struct of_device_id *match)
68814 +{
68815 +       struct device_node *np = ofdev->node;
68816 +       const unsigned int *iprop;      /* Integer OF properties */
68817 +       const char *sprop;      /* String OF properties */
68818 +       struct uart_qe_port *qe_port = NULL;
68819 +       struct resource res;
68820 +       int ret;
68821 +
68822 +       /*
68823 +        * Determine if we need Soft-UART mode
68824 +        */
68825 +       if (of_find_property(np, "soft-uart", NULL)) {
68826 +               dev_dbg(&ofdev->dev, "using Soft-UART mode\n");
68827 +               soft_uart = 1;
68828 +       }
68829 +
68830 +       /*
68831 +        * If we are using Soft-UART, determine if we need to upload the
68832 +        * firmware, too.
68833 +        */
68834 +       if (soft_uart) {
68835 +               struct qe_firmware_info *qe_fw_info;
68836 +
68837 +               qe_fw_info = qe_get_firmware_info();
68838 +
68839 +               /* Check if the firmware has been uploaded. */
68840 +               if (qe_fw_info && strstr(qe_fw_info->id, "Soft-UART")) {
68841 +                       firmware_loaded = 1;
68842 +               } else {
68843 +                       char filename[32];
68844 +                       unsigned int soc;
68845 +                       unsigned int rev_h;
68846 +                       unsigned int rev_l;
68847 +
68848 +                       soc = soc_info(&rev_h, &rev_l);
68849 +                       if (!soc) {
68850 +                               dev_err(&ofdev->dev, "unknown CPU model\n");
68851 +                               return -ENXIO;
68852 +                       }
68853 +                       sprintf(filename, "fsl_qe_ucode_uart_%u_%u%u.bin",
68854 +                               soc, rev_h, rev_l);
68855 +
68856 +                       dev_info(&ofdev->dev, "waiting for firmware %s\n",
68857 +                               filename);
68858 +
68859 +                       /*
68860 +                        * We call request_firmware_nowait instead of
68861 +                        * request_firmware so that the driver can load and
68862 +                        * initialize the ports without holding up the rest of
68863 +                        * the kernel.  If hotplug support is enabled in the
68864 +                        * kernel, then we use it.
68865 +                        */
68866 +                       ret = request_firmware_nowait(THIS_MODULE,
68867 +                               FW_ACTION_HOTPLUG, filename, &ofdev->dev,
68868 +                               &ofdev->dev, uart_firmware_cont);
68869 +                       if (ret) {
68870 +                               dev_err(&ofdev->dev,
68871 +                                       "could not load firmware %s\n",
68872 +                                       filename);
68873 +                               return ret;
68874 +                       }
68875 +               }
68876 +       }
68877 +
68878 +       qe_port = kzalloc(sizeof(struct uart_qe_port), GFP_KERNEL);
68879 +       if (!qe_port) {
68880 +               dev_err(&ofdev->dev, "can't allocate QE port structure\n");
68881 +               return -ENOMEM;
68882 +       }
68883 +
68884 +       /* Search for IRQ and mapbase */
68885 +       ret = of_address_to_resource(np, 0, &res);
68886 +       if (ret) {
68887 +               dev_err(&ofdev->dev, "missing 'reg' property in device tree\n");
68888 +               kfree(qe_port);
68889 +               return ret;
68890 +       }
68891 +       if (!res.start) {
68892 +               dev_err(&ofdev->dev, "invalid 'reg' property in device tree\n");
68893 +               kfree(qe_port);
68894 +               return -EINVAL;
68895 +       }
68896 +       qe_port->port.mapbase = res.start;
68897 +
68898 +       /* Get the UCC number (device ID) */
68899 +       /* UCCs are numbered 1-7 */
68900 +       iprop = of_get_property(np, "device-id", NULL);
68901 +       if (!iprop || (*iprop < 1) || (*iprop > UCC_MAX_NUM)) {
68902 +               dev_err(&ofdev->dev,
68903 +                       "missing or invalid UCC specified in device tree\n");
68904 +               kfree(qe_port);
68905 +               return -ENODEV;
68906 +       }
68907 +       qe_port->ucc_num = *iprop - 1;
68908 +
68909 +       /*
68910 +        * In the future, we should not require the BRG to be specified in the
68911 +        * device tree.  If no clock-source is specified, then just pick a BRG
68912 +        * to use.  This requires a new QE library function that manages BRG
68913 +        * assignments.
68914 +        */
68915 +
68916 +       sprop = of_get_property(np, "rx-clock-name", NULL);
68917 +       if (!sprop) {
68918 +               dev_err(&ofdev->dev, "missing rx-clock-name in device tree\n");
68919 +               kfree(qe_port);
68920 +               return -ENODEV;
68921 +       }
68922 +
68923 +       qe_port->us_info.rx_clock = qe_clock_source(sprop);
68924 +       if ((qe_port->us_info.rx_clock < QE_BRG1) ||
68925 +           (qe_port->us_info.rx_clock > QE_BRG16)) {
68926 +               dev_err(&ofdev->dev, "rx-clock-name must be a BRG for UART\n");
68927 +               kfree(qe_port);
68928 +               return -ENODEV;
68929 +       }
68930 +
68931 +#ifdef LOOPBACK
68932 +       /* In internal loopback mode, TX and RX must use the same clock */
68933 +       qe_port->us_info.tx_clock = qe_port->us_info.rx_clock;
68934 +#else
68935 +       sprop = of_get_property(np, "tx-clock-name", NULL);
68936 +       if (!sprop) {
68937 +               dev_err(&ofdev->dev, "missing tx-clock-name in device tree\n");
68938 +               kfree(qe_port);
68939 +               return -ENODEV;
68940 +       }
68941 +       qe_port->us_info.tx_clock = qe_clock_source(sprop);
68942 +#endif
68943 +       if ((qe_port->us_info.tx_clock < QE_BRG1) ||
68944 +           (qe_port->us_info.tx_clock > QE_BRG16)) {
68945 +               dev_err(&ofdev->dev, "tx-clock-name must be a BRG for UART\n");
68946 +               kfree(qe_port);
68947 +               return -ENODEV;
68948 +       }
68949 +
68950 +       /* Get the port number, numbered 0-3 */
68951 +       iprop = of_get_property(np, "port-number", NULL);
68952 +       if (!iprop) {
68953 +               dev_err(&ofdev->dev, "missing port-number in device tree\n");
68954 +               kfree(qe_port);
68955 +               return -EINVAL;
68956 +       }
68957 +       qe_port->port.line = *iprop;
68958 +       if (qe_port->port.line >= UCC_MAX_UART) {
68959 +               dev_err(&ofdev->dev, "port-number must be 0-%u\n",
68960 +                       UCC_MAX_UART - 1);
68961 +               kfree(qe_port);
68962 +               return -EINVAL;
68963 +       }
68964 +
68965 +       qe_port->port.irq = irq_of_parse_and_map(np, 0);
68966 +       if (qe_port->port.irq == NO_IRQ) {
68967 +               dev_err(&ofdev->dev, "could not map IRQ for UCC%u\n",
68968 +                      qe_port->ucc_num + 1);
68969 +               kfree(qe_port);
68970 +               return -EINVAL;
68971 +       }
68972 +
68973 +       /*
68974 +        * Newer device trees have an "fsl,qe" compatible property for the QE
68975 +        * node, but we still need to support older device trees.
68976 +        */
68977 +       np = of_find_compatible_node(NULL, NULL, "fsl,qe");
68978 +       if (!np) {
68979 +               np = of_find_node_by_type(NULL, "qe");
68980 +               if (!np) {
68981 +                       dev_err(&ofdev->dev, "could not find 'qe' node\n");
68982 +                       kfree(qe_port);
68983 +                       return -EINVAL;
68984 +               }
68985 +       }
68986 +
68987 +       iprop = of_get_property(np, "brg-frequency", NULL);
68988 +       if (!iprop) {
68989 +               dev_err(&ofdev->dev,
68990 +                      "missing brg-frequency in device tree\n");
68991 +               kfree(qe_port);
68992 +               return -EINVAL;
68993 +       }
68994 +
68995 +       if (*iprop)
68996 +               qe_port->port.uartclk = *iprop;
68997 +       else {
68998 +               /*
68999 +                * Older versions of U-Boot do not initialize the brg-frequency
69000 +                * property, so in this case we assume the BRG frequency is
69001 +                * half the QE bus frequency.
69002 +                */
69003 +               iprop = of_get_property(np, "bus-frequency", NULL);
69004 +               if (!iprop) {
69005 +                       dev_err(&ofdev->dev,
69006 +                               "missing QE bus-frequency in device tree\n");
69007 +                       kfree(qe_port);
69008 +                       return -EINVAL;
69009 +               }
69010 +               if (*iprop)
69011 +                       qe_port->port.uartclk = *iprop / 2;
69012 +               else {
69013 +                       dev_err(&ofdev->dev,
69014 +                               "invalid QE bus-frequency in device tree\n");
69015 +                       kfree(qe_port);
69016 +                       return -EINVAL;
69017 +               }
69018 +       }
69019 +
69020 +       spin_lock_init(&qe_port->port.lock);
69021 +       qe_port->np = np;
69022 +       qe_port->port.dev = &ofdev->dev;
69023 +       qe_port->port.ops = &qe_uart_pops;
69024 +       qe_port->port.iotype = UPIO_MEM;
69025 +
69026 +       qe_port->tx_nrfifos = TX_NUM_FIFO;
69027 +       qe_port->tx_fifosize = TX_BUF_SIZE;
69028 +       qe_port->rx_nrfifos = RX_NUM_FIFO;
69029 +       qe_port->rx_fifosize = RX_BUF_SIZE;
69030 +
69031 +       qe_port->wait_closing = UCC_WAIT_CLOSING;
69032 +       qe_port->port.fifosize = 512;
69033 +       qe_port->port.flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP;
69034 +
69035 +       qe_port->us_info.ucc_num = qe_port->ucc_num;
69036 +       qe_port->us_info.regs = (phys_addr_t) res.start;
69037 +       qe_port->us_info.irq = qe_port->port.irq;
69038 +
69039 +       qe_port->us_info.rx_bd_ring_len = qe_port->rx_nrfifos;
69040 +       qe_port->us_info.tx_bd_ring_len = qe_port->tx_nrfifos;
69041 +
69042 +       /* Make sure ucc_slow_init() initializes both TX and RX */
69043 +       qe_port->us_info.init_tx = 1;
69044 +       qe_port->us_info.init_rx = 1;
69045 +
69046 +       /* Add the port to the uart sub-system.  This will cause
69047 +        * qe_uart_config_port() to be called, so the us_info structure must
69048 +        * be initialized.
69049 +        */
69050 +       ret = uart_add_one_port(&ucc_uart_driver, &qe_port->port);
69051 +       if (ret) {
69052 +               dev_err(&ofdev->dev, "could not add /dev/ttyQE%u\n",
69053 +                      qe_port->port.line);
69054 +               kfree(qe_port);
69055 +               return ret;
69056 +       }
69057 +
69058 +       dev_set_drvdata(&ofdev->dev, qe_port);
69059 +
69060 +       dev_info(&ofdev->dev, "UCC%u assigned to /dev/ttyQE%u\n",
69061 +               qe_port->ucc_num + 1, qe_port->port.line);
69062 +
69063 +       /* Display the mknod command for this device */
69064 +       dev_dbg(&ofdev->dev, "mknod command is 'mknod /dev/ttyQE%u c %u %u'\n",
69065 +              qe_port->port.line, SERIAL_QE_MAJOR,
69066 +              SERIAL_QE_MINOR + qe_port->port.line);
69067 +
69068 +       return 0;
69069 +}
69070 +
69071 +static int ucc_uart_remove(struct of_device *ofdev)
69072 +{
69073 +       struct uart_qe_port *qe_port = dev_get_drvdata(&ofdev->dev);
69074 +
69075 +       dev_info(&ofdev->dev, "removing /dev/ttyQE%u\n", qe_port->port.line);
69076 +
69077 +       uart_remove_one_port(&ucc_uart_driver, &qe_port->port);
69078 +
69079 +       dev_set_drvdata(&ofdev->dev, NULL);
69080 +       kfree(qe_port);
69081 +
69082 +       return 0;
69083 +}
69084 +
69085 +static struct of_device_id ucc_uart_match[] = {
69086 +       {
69087 +               .type = "serial",
69088 +               .compatible = "ucc_uart",
69089 +       },
69090 +       {},
69091 +};
69092 +MODULE_DEVICE_TABLE(of, ucc_uart_match);
69093 +
69094 +static struct of_platform_driver ucc_uart_of_driver = {
69095 +       .owner          = THIS_MODULE,
69096 +       .name           = "ucc_uart",
69097 +       .match_table    = ucc_uart_match,
69098 +       .probe          = ucc_uart_probe,
69099 +       .remove         = ucc_uart_remove,
69100 +};
69101 +
69102 +static int __init ucc_uart_init(void)
69103 +{
69104 +       int ret;
69105 +
69106 +       printk(KERN_INFO "Freescale QUICC Engine UART device driver\n");
69107 +#ifdef LOOPBACK
69108 +       printk(KERN_INFO "ucc-uart: Using loopback mode\n");
69109 +#endif
69110 +
69111 +       ret = uart_register_driver(&ucc_uart_driver);
69112 +       if (ret) {
69113 +               printk(KERN_ERR "ucc-uart: could not register UART driver\n");
69114 +               return ret;
69115 +       }
69116 +
69117 +       ret = of_register_platform_driver(&ucc_uart_of_driver);
69118 +       if (ret)
69119 +               printk(KERN_ERR
69120 +                      "ucc-uart: could not register platform driver\n");
69121 +
69122 +       return ret;
69123 +}
69124 +
69125 +static void __exit ucc_uart_exit(void)
69126 +{
69127 +       printk(KERN_INFO
69128 +              "Freescale QUICC Engine UART device driver unloading\n");
69129 +
69130 +       of_unregister_platform_driver(&ucc_uart_of_driver);
69131 +       uart_unregister_driver(&ucc_uart_driver);
69132 +}
69133 +
69134 +module_init(ucc_uart_init);
69135 +module_exit(ucc_uart_exit);
69136 +
69137 +MODULE_DESCRIPTION("Freescale QUICC Engine (QE) UART");
69138 +MODULE_AUTHOR("Timur Tabi <timur@freescale.com>");
69139 +MODULE_LICENSE("GPL v2");
69140 +MODULE_ALIAS_CHARDEV_MAJOR(SERIAL_QE_MAJOR);
69141 +
69142 diff -x .git -x .gitignore -Nur linux-2.6.24/drivers/spi/mpc52xx_psc_spi.c powerpc.git/drivers/spi/mpc52xx_psc_spi.c
69143 --- linux-2.6.24/drivers/spi/mpc52xx_psc_spi.c  2008-01-24 23:58:37.000000000 +0100
69144 +++ powerpc.git/drivers/spi/mpc52xx_psc_spi.c   2008-01-28 20:26:20.000000000 +0100
69145 @@ -330,6 +330,7 @@
69146  
69147  static int mpc52xx_psc_spi_port_config(int psc_id, struct mpc52xx_psc_spi *mps)
69148  {
69149 +       struct device_node *np;
69150         struct mpc52xx_cdm __iomem *cdm;
69151         struct mpc52xx_gpio __iomem *gpio;
69152         struct mpc52xx_psc __iomem *psc = mps->psc;
69153 @@ -338,8 +339,12 @@
69154         int ret = 0;
69155  
69156  #if defined(CONFIG_PPC_MERGE)
69157 -       cdm = mpc52xx_find_and_map("mpc5200-cdm");
69158 -       gpio = mpc52xx_find_and_map("mpc5200-gpio");
69159 +       np = of_find_compatible_node(NULL, NULL, "mpc5200-cdm");
69160 +       cdm = of_iomap(np, 0);
69161 +       of_node_put(np);
69162 +       np = of_find_compatible_node(NULL, NULL, "mpc5200-gpio");
69163 +       gpio = of_iomap(np, 0);
69164 +       of_node_put(np);
69165  #else
69166         cdm = ioremap(MPC52xx_PA(MPC52xx_CDM_OFFSET), MPC52xx_CDM_SIZE);
69167         gpio = ioremap(MPC52xx_PA(MPC52xx_GPIO_OFFSET), MPC52xx_GPIO_SIZE);
69168 diff -x .git -x .gitignore -Nur linux-2.6.24/fs/openpromfs/inode.c powerpc.git/fs/openpromfs/inode.c
69169 --- linux-2.6.24/fs/openpromfs/inode.c  2008-01-28 20:50:11.000000000 +0100
69170 +++ powerpc.git/fs/openpromfs/inode.c   2008-01-28 20:26:31.000000000 +0100
69171 @@ -131,7 +131,7 @@
69172         /* Nothing to do */
69173  }
69174  
69175 -static const struct seq_operations property_op = {
69176 +static struct seq_operations property_op = {
69177         .start          = property_start,
69178         .next           = property_next,
69179         .stop           = property_stop,
69180 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/8xx_immap.h powerpc.git/include/asm-powerpc/8xx_immap.h
69181 --- linux-2.6.24/include/asm-powerpc/8xx_immap.h        2008-01-24 23:58:37.000000000 +0100
69182 +++ powerpc.git/include/asm-powerpc/8xx_immap.h 2008-01-28 20:26:42.000000000 +0100
69183 @@ -123,7 +123,7 @@
69184  #define OR_G5LA                0x00000400      /* Output #GPL5 on #GPL_A5              */
69185  #define OR_G5LS                0x00000200      /* Drive #GPL high on falling edge of...*/
69186  #define OR_BI          0x00000100      /* Burst inhibit                        */
69187 -#define OR_SCY_MSK     0x000000f0      /* Cycle Lenght in Clocks               */
69188 +#define OR_SCY_MSK     0x000000f0      /* Cycle Length in Clocks               */
69189  #define OR_SCY_0_CLK   0x00000000      /* 0 clock cycles wait states           */
69190  #define OR_SCY_1_CLK   0x00000010      /* 1 clock cycles wait states           */
69191  #define OR_SCY_2_CLK   0x00000020      /* 2 clock cycles wait states           */
69192 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/commproc.h powerpc.git/include/asm-powerpc/commproc.h
69193 --- linux-2.6.24/include/asm-powerpc/commproc.h 2008-01-24 23:58:37.000000000 +0100
69194 +++ powerpc.git/include/asm-powerpc/commproc.h  2008-01-28 20:26:42.000000000 +0100
69195 @@ -693,7 +693,7 @@
69196  #define        CICR_SCC_SCC3           ((uint)0x00200000)      /* SCC3 @ SCCc */
69197  #define        CICR_SCB_SCC2           ((uint)0x00040000)      /* SCC2 @ SCCb */
69198  #define        CICR_SCA_SCC1           ((uint)0x00000000)      /* SCC1 @ SCCa */
69199 -#define CICR_IRL_MASK          ((uint)0x0000e000)      /* Core interrrupt */
69200 +#define CICR_IRL_MASK          ((uint)0x0000e000)      /* Core interrupt */
69201  #define CICR_HP_MASK           ((uint)0x00001f00)      /* Hi-pri int. */
69202  #define CICR_IEN               ((uint)0x00000080)      /* Int. enable */
69203  #define CICR_SPS               ((uint)0x00000001)      /* SCC Spread */
69204 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/cpm.h powerpc.git/include/asm-powerpc/cpm.h
69205 --- linux-2.6.24/include/asm-powerpc/cpm.h      2008-01-24 23:58:37.000000000 +0100
69206 +++ powerpc.git/include/asm-powerpc/cpm.h       2008-01-28 20:26:42.000000000 +0100
69207 @@ -10,5 +10,6 @@
69208  unsigned long cpm_muram_alloc_fixed(unsigned long offset, unsigned long size);
69209  void __iomem *cpm_muram_addr(unsigned long offset);
69210  dma_addr_t cpm_muram_dma(void __iomem *addr);
69211 +int cpm_command(u32 command, u8 opcode);
69212  
69213  #endif
69214 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/cputable.h powerpc.git/include/asm-powerpc/cputable.h
69215 --- linux-2.6.24/include/asm-powerpc/cputable.h 2008-01-24 23:58:37.000000000 +0100
69216 +++ powerpc.git/include/asm-powerpc/cputable.h  2008-01-28 20:26:42.000000000 +0100
69217 @@ -57,6 +57,14 @@
69218         PPC_PMC_PA6T = 2,
69219  };
69220  
69221 +struct pt_regs;
69222 +
69223 +extern int machine_check_generic(struct pt_regs *regs);
69224 +extern int machine_check_4xx(struct pt_regs *regs);
69225 +extern int machine_check_440A(struct pt_regs *regs);
69226 +extern int machine_check_e500(struct pt_regs *regs);
69227 +extern int machine_check_e200(struct pt_regs *regs);
69228 +
69229  /* NOTE WELL: Update identify_cpu() if fields are added or removed! */
69230  struct cpu_spec {
69231         /* CPU is matched via (PVR & pvr_mask) == pvr_value */
69232 @@ -97,6 +105,11 @@
69233  
69234         /* Name of processor class, for the ELF AT_PLATFORM entry */
69235         char            *platform;
69236 +
69237 +       /* Processor specific machine check handling. Return negative
69238 +        * if the error is fatal, 1 if it was fully recovered and 0 to
69239 +        * pass up (not CPU originated) */
69240 +       int             (*machine_check)(struct pt_regs *regs);
69241  };
69242  
69243  extern struct cpu_spec         *cur_cpu_spec;
69244 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/cputhreads.h powerpc.git/include/asm-powerpc/cputhreads.h
69245 --- linux-2.6.24/include/asm-powerpc/cputhreads.h       1970-01-01 01:00:00.000000000 +0100
69246 +++ powerpc.git/include/asm-powerpc/cputhreads.h        2008-01-28 20:26:42.000000000 +0100
69247 @@ -0,0 +1,71 @@
69248 +#ifndef _ASM_POWERPC_CPUTHREADS_H
69249 +#define _ASM_POWERPC_CPUTHREADS_H
69250 +
69251 +#include <linux/cpumask.h>
69252 +
69253 +/*
69254 + * Mapping of threads to cores
69255 + */
69256 +
69257 +#ifdef CONFIG_SMP
69258 +extern int threads_per_core;
69259 +extern int threads_shift;
69260 +extern cpumask_t threads_core_mask;
69261 +#else
69262 +#define threads_per_core       1
69263 +#define threads_shift          0
69264 +#define threads_core_mask      (CPU_MASK_CPU0)
69265 +#endif
69266 +
69267 +/* cpu_thread_mask_to_cores - Return a cpumask of one per cores
69268 + *                            hit by the argument
69269 + *
69270 + * @threads:   a cpumask of threads
69271 + *
69272 + * This function returns a cpumask which will have one "cpu" (or thread)
69273 + * bit set for each core that has at least one thread set in the argument.
69274 + *
69275 + * This can typically be used for things like IPI for tlb invalidations
69276 + * since those need to be done only once per core/TLB
69277 + */
69278 +static inline cpumask_t cpu_thread_mask_to_cores(cpumask_t threads)
69279 +{
69280 +       cpumask_t       tmp, res;
69281 +       int             i;
69282 +
69283 +       res = CPU_MASK_NONE;
69284 +       for (i = 0; i < NR_CPUS; i += threads_per_core) {
69285 +               cpus_shift_right(tmp, threads_core_mask, i);
69286 +               if (cpus_intersects(threads, tmp))
69287 +                       cpu_set(i, res);
69288 +       }
69289 +       return res;
69290 +}
69291 +
69292 +static inline int cpu_nr_cores(void)
69293 +{
69294 +       return NR_CPUS >> threads_shift;
69295 +}
69296 +
69297 +static inline cpumask_t cpu_online_cores_map(void)
69298 +{
69299 +       return cpu_thread_mask_to_cores(cpu_online_map);
69300 +}
69301 +
69302 +static inline int cpu_thread_to_core(int cpu)
69303 +{
69304 +       return cpu >> threads_shift;
69305 +}
69306 +
69307 +static inline int cpu_thread_in_core(int cpu)
69308 +{
69309 +       return cpu & (threads_per_core - 1);
69310 +}
69311 +
69312 +static inline int cpu_first_thread_in_core(int cpu)
69313 +{
69314 +       return cpu & ~(threads_per_core - 1);
69315 +}
69316 +
69317 +#endif /* _ASM_POWERPC_CPUTHREADS_H */
69318 +
69319 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/dcr-native.h powerpc.git/include/asm-powerpc/dcr-native.h
69320 --- linux-2.6.24/include/asm-powerpc/dcr-native.h       2008-01-24 23:58:37.000000000 +0100
69321 +++ powerpc.git/include/asm-powerpc/dcr-native.h        2008-01-28 20:26:42.000000000 +0100
69322 @@ -22,6 +22,8 @@
69323  #ifdef __KERNEL__
69324  #ifndef __ASSEMBLY__
69325  
69326 +#include <linux/spinlock.h>
69327 +
69328  typedef struct {
69329         unsigned int base;
69330  } dcr_host_t;
69331 @@ -55,20 +57,28 @@
69332  } while (0)
69333  
69334  /* R/W of indirect DCRs make use of standard naming conventions for DCRs */
69335 -#define mfdcri(base, reg)                      \
69336 -({                                             \
69337 -       mtdcr(base ## _CFGADDR, base ## _ ## reg);      \
69338 -       mfdcr(base ## _CFGDATA);                        \
69339 +extern spinlock_t dcr_ind_lock;
69340 +
69341 +#define mfdcri(base, reg)                              \
69342 +({                                                     \
69343 +       unsigned long flags;                            \
69344 +       unsigned int val;                               \
69345 +       spin_lock_irqsave(&dcr_ind_lock, flags);        \
69346 +       mtdcr(DCRN_ ## base ## _CONFIG_ADDR, reg);      \
69347 +       val = mfdcr(DCRN_ ## base ## _CONFIG_DATA);     \
69348 +       spin_unlock_irqrestore(&dcr_ind_lock, flags);   \
69349 +       val;                                            \
69350  })
69351  
69352 -#define mtdcri(base, reg, data)                        \
69353 -do {                                           \
69354 -       mtdcr(base ## _CFGADDR, base ## _ ## reg);      \
69355 -       mtdcr(base ## _CFGDATA, data);          \
69356 +#define mtdcri(base, reg, data)                                \
69357 +do {                                                   \
69358 +       unsigned long flags;                            \
69359 +       spin_lock_irqsave(&dcr_ind_lock, flags);        \
69360 +       mtdcr(DCRN_ ## base ## _CONFIG_ADDR, reg);      \
69361 +       mtdcr(DCRN_ ## base ## _CONFIG_DATA, data);     \
69362 +       spin_unlock_irqrestore(&dcr_ind_lock, flags);   \
69363  } while (0)
69364  
69365  #endif /* __ASSEMBLY__ */
69366  #endif /* __KERNEL__ */
69367  #endif /* _ASM_POWERPC_DCR_NATIVE_H */
69368 -
69369 -
69370 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/dcr-regs.h powerpc.git/include/asm-powerpc/dcr-regs.h
69371 --- linux-2.6.24/include/asm-powerpc/dcr-regs.h 1970-01-01 01:00:00.000000000 +0100
69372 +++ powerpc.git/include/asm-powerpc/dcr-regs.h  2008-01-28 20:26:42.000000000 +0100
69373 @@ -0,0 +1,71 @@
69374 +/*
69375 + * Common DCR / SDR / CPR register definitions used on various IBM/AMCC
69376 + * 4xx processors
69377 + *
69378 + *    Copyright 2007 Benjamin Herrenschmidt, IBM Corp
69379 + *                   <benh@kernel.crashing.org>
69380 + *
69381 + * Mostly lifted from asm-ppc/ibm4xx.h by
69382 + *
69383 + *    Copyright (c) 1999 Grant Erickson <grant@lcse.umn.edu>
69384 + *
69385 + */
69386 +
69387 +#ifndef __DCR_REGS_H__
69388 +#define __DCR_REGS_H__
69389 +
69390 +/*
69391 + * Most DCRs used for controlling devices such as the MAL, DMA engine,
69392 + * etc... are obtained for the device tree.
69393 + *
69394 + * The definitions in this files are fixed DCRs and indirect DCRs that
69395 + * are commonly used outside of specific drivers or refer to core
69396 + * common registers that may occasionally have to be tweaked outside
69397 + * of the driver main register set
69398 + */
69399 +
69400 +/* CPRs (440GX and 440SP/440SPe) */
69401 +#define DCRN_CPR0_CONFIG_ADDR  0xc
69402 +#define DCRN_CPR0_CONFIG_DATA  0xd
69403 +
69404 +/* SDRs (440GX and 440SP/440SPe) */
69405 +#define DCRN_SDR0_CONFIG_ADDR  0xe
69406 +#define DCRN_SDR0_CONFIG_DATA  0xf
69407 +
69408 +#define SDR0_PFC0              0x4100
69409 +#define SDR0_PFC1              0x4101
69410 +#define SDR0_PFC1_EPS          0x1c00000
69411 +#define SDR0_PFC1_EPS_SHIFT    22
69412 +#define SDR0_PFC1_RMII         0x02000000
69413 +#define SDR0_MFR               0x4300
69414 +#define SDR0_MFR_TAH0          0x80000000      /* TAHOE0 Enable */
69415 +#define SDR0_MFR_TAH1          0x40000000      /* TAHOE1 Enable */
69416 +#define SDR0_MFR_PCM           0x10000000      /* PPC440GP irq compat mode */
69417 +#define SDR0_MFR_ECS           0x08000000      /* EMAC int clk */
69418 +#define SDR0_MFR_T0TXFL                0x00080000
69419 +#define SDR0_MFR_T0TXFH                0x00040000
69420 +#define SDR0_MFR_T1TXFL                0x00020000
69421 +#define SDR0_MFR_T1TXFH                0x00010000
69422 +#define SDR0_MFR_E0TXFL                0x00008000
69423 +#define SDR0_MFR_E0TXFH                0x00004000
69424 +#define SDR0_MFR_E0RXFL                0x00002000
69425 +#define SDR0_MFR_E0RXFH                0x00001000
69426 +#define SDR0_MFR_E1TXFL                0x00000800
69427 +#define SDR0_MFR_E1TXFH                0x00000400
69428 +#define SDR0_MFR_E1RXFL                0x00000200
69429 +#define SDR0_MFR_E1RXFH                0x00000100
69430 +#define SDR0_MFR_E2TXFL                0x00000080
69431 +#define SDR0_MFR_E2TXFH                0x00000040
69432 +#define SDR0_MFR_E2RXFL                0x00000020
69433 +#define SDR0_MFR_E2RXFH                0x00000010
69434 +#define SDR0_MFR_E3TXFL                0x00000008
69435 +#define SDR0_MFR_E3TXFH                0x00000004
69436 +#define SDR0_MFR_E3RXFL                0x00000002
69437 +#define SDR0_MFR_E3RXFH                0x00000001
69438 +#define SDR0_UART0             0x0120
69439 +#define SDR0_UART1             0x0121
69440 +#define SDR0_UART2             0x0122
69441 +#define SDR0_UART3             0x0123
69442 +#define SDR0_CUST0             0x4000
69443 +
69444 +#endif /* __DCR_REGS_H__ */
69445 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/dma-mapping.h powerpc.git/include/asm-powerpc/dma-mapping.h
69446 --- linux-2.6.24/include/asm-powerpc/dma-mapping.h      2008-01-24 23:58:37.000000000 +0100
69447 +++ powerpc.git/include/asm-powerpc/dma-mapping.h       2008-01-28 20:26:42.000000000 +0100
69448 @@ -87,6 +87,9 @@
69449         return dma_ops->dma_supported(dev, mask);
69450  }
69451  
69452 +/* We have our own implementation of pci_set_dma_mask() */
69453 +#define HAVE_ARCH_PCI_SET_DMA_MASK
69454 +
69455  static inline int dma_set_mask(struct device *dev, u64 dma_mask)
69456  {
69457         struct dma_mapping_ops *dma_ops = get_dma_ops(dev);
69458 @@ -186,8 +189,6 @@
69459  extern struct dma_mapping_ops dma_iommu_ops;
69460  extern struct dma_mapping_ops dma_direct_ops;
69461  
69462 -extern unsigned long dma_direct_offset;
69463 -
69464  #else /* CONFIG_PPC64 */
69465  
69466  #define dma_supported(dev, mask)       (1)
69467 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/firmware.h powerpc.git/include/asm-powerpc/firmware.h
69468 --- linux-2.6.24/include/asm-powerpc/firmware.h 2008-01-24 23:58:37.000000000 +0100
69469 +++ powerpc.git/include/asm-powerpc/firmware.h  2008-01-28 20:26:42.000000000 +0100
69470 @@ -64,7 +64,7 @@
69471         FW_FEATURE_PS3_POSSIBLE = FW_FEATURE_LPAR | FW_FEATURE_PS3_LV1,
69472         FW_FEATURE_PS3_ALWAYS = FW_FEATURE_LPAR | FW_FEATURE_PS3_LV1,
69473         FW_FEATURE_CELLEB_POSSIBLE = FW_FEATURE_LPAR | FW_FEATURE_BEAT,
69474 -       FW_FEATURE_CELLEB_ALWAYS = FW_FEATURE_LPAR | FW_FEATURE_BEAT,
69475 +       FW_FEATURE_CELLEB_ALWAYS = 0,
69476         FW_FEATURE_NATIVE_POSSIBLE = 0,
69477         FW_FEATURE_NATIVE_ALWAYS = 0,
69478         FW_FEATURE_POSSIBLE =
69479 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/immap_86xx.h powerpc.git/include/asm-powerpc/immap_86xx.h
69480 --- linux-2.6.24/include/asm-powerpc/immap_86xx.h       2008-01-24 23:58:37.000000000 +0100
69481 +++ powerpc.git/include/asm-powerpc/immap_86xx.h        2008-01-28 20:26:42.000000000 +0100
69482 @@ -89,14 +89,14 @@
69483   * them.
69484   *
69485   * guts: Pointer to GUTS structure
69486 - * co: The DMA controller (1 or 2)
69487 + * co: The DMA controller (0 or 1)
69488   * ch: The channel on the DMA controller (0, 1, 2, or 3)
69489   * device: The device to set as the source (CCSR_GUTS_DMACR_DEV_xx)
69490   */
69491  static inline void guts_set_dmacr(struct ccsr_guts __iomem *guts,
69492         unsigned int co, unsigned int ch, unsigned int device)
69493  {
69494 -       unsigned int shift = 16 + (8 * (2 - co) + 2 * (3 - ch));
69495 +       unsigned int shift = 16 + (8 * (1 - co) + 2 * (3 - ch));
69496  
69497         clrsetbits_be32(&guts->dmacr, 3 << shift, device << shift);
69498  }
69499 @@ -118,6 +118,27 @@
69500  #define CCSR_GUTS_PMUXCR_DMA1_0                0x00000002
69501  #define CCSR_GUTS_PMUXCR_DMA1_3                0x00000001
69502  
69503 +/*
69504 + * Set the DMA external control bits in the GUTS
69505 + *
69506 + * The DMA external control bits in the PMUXCR are only meaningful for
69507 + * channels 0 and 3.  Any other channels are ignored.
69508 + *
69509 + * guts: Pointer to GUTS structure
69510 + * co: The DMA controller (0 or 1)
69511 + * ch: The channel on the DMA controller (0, 1, 2, or 3)
69512 + * value: the new value for the bit (0 or 1)
69513 + */
69514 +static inline void guts_set_pmuxcr_dma(struct ccsr_guts __iomem *guts,
69515 +       unsigned int co, unsigned int ch, unsigned int value)
69516 +{
69517 +       if ((ch == 0) || (ch == 3)) {
69518 +               unsigned int shift = 2 * (co + 1) - (ch & 1) - 1;
69519 +
69520 +               clrsetbits_be32(&guts->pmuxcr, 1 << shift, value << shift);
69521 +       }
69522 +}
69523 +
69524  #define CCSR_GUTS_CLKDVDR_PXCKEN       0x80000000
69525  #define CCSR_GUTS_CLKDVDR_SSICKEN      0x20000000
69526  #define CCSR_GUTS_CLKDVDR_PXCKINV      0x10000000
69527 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/immap_qe.h powerpc.git/include/asm-powerpc/immap_qe.h
69528 --- linux-2.6.24/include/asm-powerpc/immap_qe.h 2008-01-24 23:58:37.000000000 +0100
69529 +++ powerpc.git/include/asm-powerpc/immap_qe.h  2008-01-28 20:26:42.000000000 +0100
69530 @@ -393,9 +393,39 @@
69531         u8      res2[0x48];
69532  } __attribute__ ((packed));
69533  
69534 -/* RISC Special Registers (Trap and Breakpoint) */
69535 +/*
69536 + * RISC Special Registers (Trap and Breakpoint).  These are described in
69537 + * the QE Developer's Handbook.
69538 + */
69539  struct rsp {
69540 -       u32     reg[0x40];      /* 64 32-bit registers */
69541 +       __be32 tibcr[16];       /* Trap/instruction breakpoint control regs */
69542 +       u8 res0[64];
69543 +       __be32 ibcr0;
69544 +       __be32 ibs0;
69545 +       __be32 ibcnr0;
69546 +       u8 res1[4];
69547 +       __be32 ibcr1;
69548 +       __be32 ibs1;
69549 +       __be32 ibcnr1;
69550 +       __be32 npcr;
69551 +       __be32 dbcr;
69552 +       __be32 dbar;
69553 +       __be32 dbamr;
69554 +       __be32 dbsr;
69555 +       __be32 dbcnr;
69556 +       u8 res2[12];
69557 +       __be32 dbdr_h;
69558 +       __be32 dbdr_l;
69559 +       __be32 dbdmr_h;
69560 +       __be32 dbdmr_l;
69561 +       __be32 bsr;
69562 +       __be32 bor;
69563 +       __be32 bior;
69564 +       u8 res3[4];
69565 +       __be32 iatr[4];
69566 +       __be32 eccr;            /* Exception control configuration register */
69567 +       __be32 eicr;
69568 +       u8 res4[0x100-0xf8];
69569  } __attribute__ ((packed));
69570  
69571  struct qe_immap {
69572 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/io.h powerpc.git/include/asm-powerpc/io.h
69573 --- linux-2.6.24/include/asm-powerpc/io.h       2008-01-24 23:58:37.000000000 +0100
69574 +++ powerpc.git/include/asm-powerpc/io.h        2008-01-28 20:26:42.000000000 +0100
69575 @@ -50,15 +50,16 @@
69576  #define PCI_DRAM_OFFSET        pci_dram_offset
69577  #else
69578  #define _IO_BASE       pci_io_base
69579 -#define _ISA_MEM_BASE  0
69580 +#define _ISA_MEM_BASE  isa_mem_base
69581  #define PCI_DRAM_OFFSET        0
69582  #endif
69583  
69584  extern unsigned long isa_io_base;
69585 -extern unsigned long isa_mem_base;
69586  extern unsigned long pci_io_base;
69587  extern unsigned long pci_dram_offset;
69588  
69589 +extern resource_size_t isa_mem_base;
69590 +
69591  #if defined(CONFIG_PPC32) && defined(CONFIG_PPC_INDIRECT_IO)
69592  #error CONFIG_PPC_INDIRECT_IO is not yet supported on 32 bits
69593  #endif
69594 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/iommu.h powerpc.git/include/asm-powerpc/iommu.h
69595 --- linux-2.6.24/include/asm-powerpc/iommu.h    2008-01-24 23:58:37.000000000 +0100
69596 +++ powerpc.git/include/asm-powerpc/iommu.h     2008-01-28 20:26:42.000000000 +0100
69597 @@ -69,10 +69,9 @@
69598  };
69599  
69600  struct scatterlist;
69601 -struct device_node;
69602  
69603  /* Frees table for an individual device node */
69604 -extern void iommu_free_table(struct device_node *dn);
69605 +extern void iommu_free_table(struct iommu_table *tbl, const char *node_name);
69606  
69607  /* Initializes an iommu_table based in values set in the passed-in
69608   * structure
69609 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/ipic.h powerpc.git/include/asm-powerpc/ipic.h
69610 --- linux-2.6.24/include/asm-powerpc/ipic.h     2008-01-24 23:58:37.000000000 +0100
69611 +++ powerpc.git/include/asm-powerpc/ipic.h      2008-01-28 20:26:42.000000000 +0100
69612 @@ -20,11 +20,13 @@
69613  
69614  /* Flags when we init the IPIC */
69615  #define IPIC_SPREADMODE_GRP_A  0x00000001
69616 -#define IPIC_SPREADMODE_GRP_D  0x00000002
69617 -#define IPIC_SPREADMODE_MIX_A  0x00000004
69618 -#define IPIC_SPREADMODE_MIX_B  0x00000008
69619 -#define IPIC_DISABLE_MCP_OUT   0x00000010
69620 -#define IPIC_IRQ0_MCP          0x00000020
69621 +#define IPIC_SPREADMODE_GRP_B  0x00000002
69622 +#define IPIC_SPREADMODE_GRP_C  0x00000004
69623 +#define IPIC_SPREADMODE_GRP_D  0x00000008
69624 +#define IPIC_SPREADMODE_MIX_A  0x00000010
69625 +#define IPIC_SPREADMODE_MIX_B  0x00000020
69626 +#define IPIC_DISABLE_MCP_OUT   0x00000040
69627 +#define IPIC_IRQ0_MCP          0x00000080
69628  
69629  /* IPIC registers offsets */
69630  #define IPIC_SICFR     0x00    /* System Global Interrupt Configuration Register */
69631 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/iseries/hv_lp_event.h powerpc.git/include/asm-powerpc/iseries/hv_lp_event.h
69632 --- linux-2.6.24/include/asm-powerpc/iseries/hv_lp_event.h      2008-01-24 23:58:37.000000000 +0100
69633 +++ powerpc.git/include/asm-powerpc/iseries/hv_lp_event.h       2008-01-28 20:26:42.000000000 +0100
69634 @@ -78,7 +78,7 @@
69635  
69636  /*
69637   * Close an Lp Event Path for a type and partition
69638 - * returns 0 on sucess
69639 + * returns 0 on success
69640   */
69641  extern int HvLpEvent_closePath(HvLpEvent_Type eventType, HvLpIndex lpIndex);
69642  
69643 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/kexec.h powerpc.git/include/asm-powerpc/kexec.h
69644 --- linux-2.6.24/include/asm-powerpc/kexec.h    2008-01-24 23:58:37.000000000 +0100
69645 +++ powerpc.git/include/asm-powerpc/kexec.h     2008-01-28 20:26:42.000000000 +0100
69646 @@ -123,6 +123,9 @@
69647  extern void default_machine_kexec(struct kimage *image);
69648  extern int default_machine_kexec_prepare(struct kimage *image);
69649  extern void default_machine_crash_shutdown(struct pt_regs *regs);
69650 +typedef void (*crash_shutdown_t)(void);
69651 +extern int crash_shutdown_register(crash_shutdown_t handler);
69652 +extern int crash_shutdown_unregister(crash_shutdown_t handler);
69653  
69654  extern void machine_kexec_simple(struct kimage *image);
69655  extern void crash_kexec_secondary(struct pt_regs *regs);
69656 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/lmb.h powerpc.git/include/asm-powerpc/lmb.h
69657 --- linux-2.6.24/include/asm-powerpc/lmb.h      2008-01-24 23:58:37.000000000 +0100
69658 +++ powerpc.git/include/asm-powerpc/lmb.h       2008-01-28 20:26:42.000000000 +0100
69659 @@ -51,6 +51,7 @@
69660  extern unsigned long __init lmb_phys_mem_size(void);
69661  extern unsigned long __init lmb_end_of_DRAM(void);
69662  extern void __init lmb_enforce_memory_limit(unsigned long memory_limit);
69663 +extern int __init lmb_is_reserved(unsigned long addr);
69664  
69665  extern void lmb_dump_all(void);
69666  
69667 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/machdep.h powerpc.git/include/asm-powerpc/machdep.h
69668 --- linux-2.6.24/include/asm-powerpc/machdep.h  2008-01-24 23:58:37.000000000 +0100
69669 +++ powerpc.git/include/asm-powerpc/machdep.h   2008-01-28 20:26:42.000000000 +0100
69670 @@ -204,6 +204,13 @@
69671         /*
69672          * optional PCI "hooks"
69673          */
69674 +       /* Called in indirect_* to avoid touching devices */
69675 +       int (*pci_exclude_device)(struct pci_controller *, unsigned char, unsigned char);
69676 +
69677 +       /* Called at then very end of pcibios_init() */
69678 +       void (*pcibios_after_init)(void);
69679 +
69680 +#endif /* CONFIG_PPC32 */
69681  
69682         /* Called after PPC generic resource fixup to perform
69683            machine specific fixups */
69684 @@ -212,18 +219,9 @@
69685         /* Called for each PCI bus in the system when it's probed */
69686         void (*pcibios_fixup_bus)(struct pci_bus *);
69687  
69688 -       /* Called when pci_enable_device() is called (initial=0) or
69689 -        * when a device with no assigned resource is found (initial=1).
69690 -        * Returns 0 to allow assignment/enabling of the device. */
69691 -       int  (*pcibios_enable_device_hook)(struct pci_dev *, int initial);
69692 -
69693 -       /* Called in indirect_* to avoid touching devices */
69694 -       int (*pci_exclude_device)(struct pci_controller *, unsigned char, unsigned char);
69695 -
69696 -       /* Called at then very end of pcibios_init() */
69697 -       void (*pcibios_after_init)(void);
69698 -
69699 -#endif /* CONFIG_PPC32 */
69700 +       /* Called when pci_enable_device() is called. Returns 0 to
69701 +        * allow assignment/enabling of the device. */
69702 +       int  (*pcibios_enable_device_hook)(struct pci_dev *);
69703  
69704         /* Called to shutdown machine specific hardware not already controlled
69705          * by other drivers.
69706 @@ -253,6 +251,16 @@
69707          */
69708         void (*machine_kexec)(struct kimage *image);
69709  #endif /* CONFIG_KEXEC */
69710 +
69711 +#ifdef CONFIG_SUSPEND
69712 +       /* These are called to disable and enable, respectively, IRQs when
69713 +        * entering a suspend state.  If NULL, then the generic versions
69714 +        * will be called.  The generic versions disable/enable the
69715 +        * decrementer along with interrupts.
69716 +        */
69717 +       void (*suspend_disable_irqs)(void);
69718 +       void (*suspend_enable_irqs)(void);
69719 +#endif
69720  };
69721  
69722  extern void power4_idle(void);
69723 @@ -326,5 +334,31 @@
69724                 ppc_md.log_error(buf, err_type, fatal);
69725  }
69726  
69727 +#define __define_machine_initcall(mach,level,fn,id) \
69728 +       static int __init __machine_initcall_##mach##_##fn(void) { \
69729 +               if (machine_is(mach)) return fn(); \
69730 +               return 0; \
69731 +       } \
69732 +       __define_initcall(level,__machine_initcall_##mach##_##fn,id);
69733 +
69734 +#define machine_core_initcall(mach,fn)         __define_machine_initcall(mach,"1",fn,1)
69735 +#define machine_core_initcall_sync(mach,fn)    __define_machine_initcall(mach,"1s",fn,1s)
69736 +#define machine_postcore_initcall(mach,fn)     __define_machine_initcall(mach,"2",fn,2)
69737 +#define machine_postcore_initcall_sync(mach,fn)        __define_machine_initcall(mach,"2s",fn,2s)
69738 +#define machine_arch_initcall(mach,fn)         __define_machine_initcall(mach,"3",fn,3)
69739 +#define machine_arch_initcall_sync(mach,fn)    __define_machine_initcall(mach,"3s",fn,3s)
69740 +#define machine_subsys_initcall(mach,fn)       __define_machine_initcall(mach,"4",fn,4)
69741 +#define machine_subsys_initcall_sync(mach,fn)  __define_machine_initcall(mach,"4s",fn,4s)
69742 +#define machine_fs_initcall(mach,fn)           __define_machine_initcall(mach,"5",fn,5)
69743 +#define machine_fs_initcall_sync(mach,fn)      __define_machine_initcall(mach,"5s",fn,5s)
69744 +#define machine_rootfs_initcall(mach,fn)       __define_machine_initcall(mach,"rootfs",fn,rootfs)
69745 +#define machine_device_initcall(mach,fn)       __define_machine_initcall(mach,"6",fn,6)
69746 +#define machine_device_initcall_sync(mach,fn)  __define_machine_initcall(mach,"6s",fn,6s)
69747 +#define machine_late_initcall(mach,fn)         __define_machine_initcall(mach,"7",fn,7)
69748 +#define machine_late_initcall_sync(mach,fn)    __define_machine_initcall(mach,"7s",fn,7s)
69749 +
69750 +void generic_suspend_disable_irqs(void);
69751 +void generic_suspend_enable_irqs(void);
69752 +
69753  #endif /* __KERNEL__ */
69754  #endif /* _ASM_POWERPC_MACHDEP_H */
69755 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/mmu-hash64.h powerpc.git/include/asm-powerpc/mmu-hash64.h
69756 --- linux-2.6.24/include/asm-powerpc/mmu-hash64.h       2008-01-24 23:58:37.000000000 +0100
69757 +++ powerpc.git/include/asm-powerpc/mmu-hash64.h        2008-01-28 21:37:04.000000000 +0100
69758 @@ -80,7 +80,7 @@
69759  #define HPTE_V_AVPN_SHIFT      7
69760  #define HPTE_V_AVPN            ASM_CONST(0x3fffffffffffff80)
69761  #define HPTE_V_AVPN_VAL(x)     (((x) & HPTE_V_AVPN) >> HPTE_V_AVPN_SHIFT)
69762 -#define HPTE_V_COMPARE(x,y)    (!(((x) ^ (y)) & 0xffffffffffffff80))
69763 +#define HPTE_V_COMPARE(x,y)    (!(((x) ^ (y)) & 0xffffffffffffff80UL))
69764  #define HPTE_V_BOLTED          ASM_CONST(0x0000000000000010)
69765  #define HPTE_V_LOCK            ASM_CONST(0x0000000000000008)
69766  #define HPTE_V_LARGE           ASM_CONST(0x0000000000000004)
69767 @@ -180,6 +180,7 @@
69768  extern int mmu_io_psize;
69769  extern int mmu_kernel_ssize;
69770  extern int mmu_highuser_ssize;
69771 +extern u16 mmu_slb_size;
69772  
69773  /*
69774   * If the processor supports 64k normal pages but not 64k cache
69775 @@ -277,6 +278,7 @@
69776  extern int htab_bolt_mapping(unsigned long vstart, unsigned long vend,
69777                              unsigned long pstart, unsigned long mode,
69778                              int psize, int ssize);
69779 +extern void set_huge_psize(int psize);
69780  
69781  extern void htab_initialize(void);
69782  extern void htab_initialize_secondary(void);
69783 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/mpc52xx.h powerpc.git/include/asm-powerpc/mpc52xx.h
69784 --- linux-2.6.24/include/asm-powerpc/mpc52xx.h  2008-01-24 23:58:37.000000000 +0100
69785 +++ powerpc.git/include/asm-powerpc/mpc52xx.h   2008-01-28 20:26:42.000000000 +0100
69786 @@ -248,8 +248,6 @@
69787  
69788  #ifndef __ASSEMBLY__
69789  
69790 -extern void __iomem * mpc52xx_find_and_map(const char *);
69791 -extern void __iomem * mpc52xx_find_and_map_path(const char *path);
69792  extern unsigned int mpc52xx_find_ipb_freq(struct device_node *node);
69793  extern void mpc5200_setup_xlb_arbiter(void);
69794  extern void mpc52xx_declare_of_platform_devices(void);
69795 @@ -257,7 +255,12 @@
69796  extern void mpc52xx_init_irq(void);
69797  extern unsigned int mpc52xx_get_irq(void);
69798  
69799 +#ifdef CONFIG_PCI
69800  extern int __init mpc52xx_add_bridge(struct device_node *node);
69801 +extern void __init mpc52xx_setup_pci(void);
69802 +#else
69803 +static inline void mpc52xx_setup_pci(void) { }
69804 +#endif
69805  
69806  extern void __init mpc52xx_map_wdt(void);
69807  extern void mpc52xx_restart(char *cmd);
69808 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/mpc52xx_psc.h powerpc.git/include/asm-powerpc/mpc52xx_psc.h
69809 --- linux-2.6.24/include/asm-powerpc/mpc52xx_psc.h      2008-01-24 23:58:37.000000000 +0100
69810 +++ powerpc.git/include/asm-powerpc/mpc52xx_psc.h       2008-01-28 20:26:42.000000000 +0100
69811 @@ -153,6 +153,9 @@
69812         u8              reserved16[3];
69813         u8              irfdr;          /* PSC + 0x54 */
69814         u8              reserved17[3];
69815 +};
69816 +
69817 +struct mpc52xx_psc_fifo {
69818         u16             rfnum;          /* PSC + 0x58 */
69819         u16             reserved18;
69820         u16             tfnum;          /* PSC + 0x5c */
69821 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/mpc8260.h powerpc.git/include/asm-powerpc/mpc8260.h
69822 --- linux-2.6.24/include/asm-powerpc/mpc8260.h  2008-01-24 23:58:37.000000000 +0100
69823 +++ powerpc.git/include/asm-powerpc/mpc8260.h   2008-01-28 20:26:42.000000000 +0100
69824 @@ -8,6 +8,7 @@
69825  #ifndef __ASM_POWERPC_MPC8260_H__
69826  #define __ASM_POWERPC_MPC8260_H__
69827  
69828 +#define MPC82XX_BCR_PLDP 0x00800000 /* Pipeline Maximum Depth */
69829  
69830  #ifdef CONFIG_8260
69831  
69832 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/mpic.h powerpc.git/include/asm-powerpc/mpic.h
69833 --- linux-2.6.24/include/asm-powerpc/mpic.h     2008-01-24 23:58:37.000000000 +0100
69834 +++ powerpc.git/include/asm-powerpc/mpic.h      2008-01-28 20:26:42.000000000 +0100
69835 @@ -22,7 +22,9 @@
69836  #define MPIC_GREG_GLOBAL_CONF_0                0x00020
69837  #define                MPIC_GREG_GCONF_RESET                   0x80000000
69838  #define                MPIC_GREG_GCONF_8259_PTHROU_DIS         0x20000000
69839 +#define                MPIC_GREG_GCONF_NO_BIAS                 0x10000000
69840  #define                MPIC_GREG_GCONF_BASE_MASK               0x000fffff
69841 +#define                MPIC_GREG_GCONF_MCK                     0x08000000
69842  #define MPIC_GREG_GLOBAL_CONF_1                0x00030
69843  #define                MPIC_GREG_GLOBAL_CONF_1_SIE             0x08000000
69844  #define                MPIC_GREG_GLOBAL_CONF_1_CLK_RATIO_MASK  0x70000000
69845 @@ -78,6 +80,7 @@
69846  #define        MPIC_CPU_WHOAMI_MASK                    0x0000001f
69847  #define MPIC_CPU_INTACK                        0x000a0
69848  #define MPIC_CPU_EOI                   0x000b0
69849 +#define MPIC_CPU_MCACK                 0x000c0
69850  
69851  /*
69852   * Per-source registers
69853 @@ -141,6 +144,7 @@
69854  #define TSI108_CPU_WHOAMI              0xffffffff
69855  #define TSI108_CPU_INTACK              0x00004
69856  #define TSI108_CPU_EOI                 0x00008
69857 +#define TSI108_CPU_MCACK               0x00004 /* Doesn't really exist here */
69858  
69859  /*
69860   * Per-source registers
69861 @@ -183,6 +187,7 @@
69862         MPIC_IDX_CPU_WHOAMI,
69863         MPIC_IDX_CPU_INTACK,
69864         MPIC_IDX_CPU_EOI,
69865 +       MPIC_IDX_CPU_MCACK,
69866  
69867         MPIC_IDX_IRQ_BASE,
69868         MPIC_IDX_IRQ_STRIDE,
69869 @@ -344,6 +349,10 @@
69870  #define MPIC_USES_DCR                  0x00000080
69871  /* MPIC has 11-bit vector fields (or larger) */
69872  #define MPIC_LARGE_VECTORS             0x00000100
69873 +/* Enable delivery of prio 15 interrupts as MCK instead of EE */
69874 +#define MPIC_ENABLE_MCK                        0x00000200
69875 +/* Disable bias among target selection, spread interrupts evenly */
69876 +#define MPIC_NO_BIAS                   0x00000400
69877  
69878  /* MPIC HW modification ID */
69879  #define MPIC_REGSET_MASK               0xf0000000
69880 @@ -447,10 +456,19 @@
69881  /* Send a message (IPI) to a given target (cpu number or MSG_*) */
69882  void smp_mpic_message_pass(int target, int msg);
69883  
69884 +/* Unmask a specific virq */
69885 +extern void mpic_unmask_irq(unsigned int irq);
69886 +/* Mask a specific virq */
69887 +extern void mpic_mask_irq(unsigned int irq);
69888 +/* EOI a specific virq */
69889 +extern void mpic_end_irq(unsigned int irq);
69890 +
69891  /* Fetch interrupt from a given mpic */
69892  extern unsigned int mpic_get_one_irq(struct mpic *mpic);
69893 -/* This one gets to the primary mpic */
69894 +/* This one gets from the primary mpic */
69895  extern unsigned int mpic_get_irq(void);
69896 +/* Fetch Machine Check interrupt from primary mpic */
69897 +extern unsigned int mpic_get_mcirq(void);
69898  
69899  /* Set the EPIC clock ratio */
69900  void mpic_set_clk_ratio(struct mpic *mpic, u32 clock_ratio);
69901 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/nvram.h powerpc.git/include/asm-powerpc/nvram.h
69902 --- linux-2.6.24/include/asm-powerpc/nvram.h    2008-01-24 23:58:37.000000000 +0100
69903 +++ powerpc.git/include/asm-powerpc/nvram.h     2008-01-28 20:26:42.000000000 +0100
69904 @@ -10,6 +10,8 @@
69905  #ifndef _ASM_POWERPC_NVRAM_H
69906  #define _ASM_POWERPC_NVRAM_H
69907  
69908 +#include <linux/errno.h>
69909 +
69910  #define NVRW_CNT 0x20
69911  #define NVRAM_HEADER_LEN 16 /* sizeof(struct nvram_header) */
69912  #define NVRAM_BLOCK_LEN 16
69913 @@ -71,7 +73,16 @@
69914  extern struct nvram_partition *nvram_find_partition(int sig, const char *name);
69915  
69916  extern int pSeries_nvram_init(void);
69917 +
69918 +#ifdef CONFIG_MMIO_NVRAM
69919  extern int mmio_nvram_init(void);
69920 +#else
69921 +static inline int mmio_nvram_init(void)
69922 +{
69923 +       return -ENODEV;
69924 +}
69925 +#endif
69926 +
69927  #endif /* __KERNEL__ */
69928  
69929  /* PowerMac specific nvram stuffs */
69930 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/of_platform.h powerpc.git/include/asm-powerpc/of_platform.h
69931 --- linux-2.6.24/include/asm-powerpc/of_platform.h      2008-01-24 23:58:37.000000000 +0100
69932 +++ powerpc.git/include/asm-powerpc/of_platform.h       2008-01-28 20:26:42.000000000 +0100
69933 @@ -15,8 +15,14 @@
69934  #include <linux/of_platform.h>
69935  
69936  /* Platform drivers register/unregister */
69937 -extern int of_register_platform_driver(struct of_platform_driver *drv);
69938 -extern void of_unregister_platform_driver(struct of_platform_driver *drv);
69939 +static inline int of_register_platform_driver(struct of_platform_driver *drv)
69940 +{
69941 +       return of_register_driver(drv, &of_platform_bus_type);
69942 +}
69943 +static inline void of_unregister_platform_driver(struct of_platform_driver *drv)
69944 +{
69945 +       of_unregister_driver(drv);
69946 +}
69947  
69948  /* Platform devices and busses creation */
69949  extern struct of_device *of_platform_device_create(struct device_node *np,
69950 @@ -26,9 +32,11 @@
69951  #define OF_NO_DEEP_PROBE ((struct of_device_id *)-1)
69952  
69953  extern int of_platform_bus_probe(struct device_node *root,
69954 -                                struct of_device_id *matches,
69955 +                                const struct of_device_id *matches,
69956                                  struct device *parent);
69957  
69958  extern struct of_device *of_find_device_by_phandle(phandle ph);
69959  
69960 +extern void of_instantiate_rtc(void);
69961 +
69962  #endif /* _ASM_POWERPC_OF_PLATFORM_H */
69963 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/pci-bridge.h powerpc.git/include/asm-powerpc/pci-bridge.h
69964 --- linux-2.6.24/include/asm-powerpc/pci-bridge.h       2008-01-24 23:58:37.000000000 +0100
69965 +++ powerpc.git/include/asm-powerpc/pci-bridge.h        2008-01-28 20:26:42.000000000 +0100
69966 @@ -1,15 +1,42 @@
69967  #ifndef _ASM_POWERPC_PCI_BRIDGE_H
69968  #define _ASM_POWERPC_PCI_BRIDGE_H
69969  #ifdef __KERNEL__
69970 -
69971 +/*
69972 + * This program is free software; you can redistribute it and/or
69973 + * modify it under the terms of the GNU General Public License
69974 + * as published by the Free Software Foundation; either version
69975 + * 2 of the License, or (at your option) any later version.
69976 + */
69977  #include <linux/pci.h>
69978  #include <linux/list.h>
69979  #include <linux/ioport.h>
69980  
69981 -#ifndef CONFIG_PPC64
69982 -
69983  struct device_node;
69984 -struct pci_controller;
69985 +
69986 +extern unsigned int ppc_pci_flags;
69987 +enum {
69988 +       /* Force re-assigning all resources (ignore firmware
69989 +        * setup completely)
69990 +        */
69991 +       PPC_PCI_REASSIGN_ALL_RSRC       = 0x00000001,
69992 +
69993 +       /* Re-assign all bus numbers */
69994 +       PPC_PCI_REASSIGN_ALL_BUS        = 0x00000002,
69995 +
69996 +       /* Do not try to assign, just use existing setup */
69997 +       PPC_PCI_PROBE_ONLY              = 0x00000004,
69998 +
69999 +       /* Don't bother with ISA alignment unless the bridge has
70000 +        * ISA forwarding enabled
70001 +        */
70002 +       PPC_PCI_CAN_SKIP_ISA_ALIGN      = 0x00000008,
70003 +
70004 +       /* Enable domain numbers in /proc */
70005 +       PPC_PCI_ENABLE_PROC_DOMAINS     = 0x00000010,
70006 +       /* ... except for domain 0 */
70007 +       PPC_PCI_COMPAT_DOMAIN_0         = 0x00000020,
70008 +};
70009 +
70010  
70011  /*
70012   * Structure of a PCI controller (host bridge)
70013 @@ -17,26 +44,41 @@
70014  struct pci_controller {
70015         struct pci_bus *bus;
70016         char is_dynamic;
70017 -       void *arch_data;
70018 +#ifdef CONFIG_PPC64
70019 +       int node;
70020 +#endif
70021 +       struct device_node *dn;
70022         struct list_head list_node;
70023         struct device *parent;
70024  
70025         int first_busno;
70026         int last_busno;
70027 +#ifndef CONFIG_PPC64
70028         int self_busno;
70029 +#endif
70030  
70031         void __iomem *io_base_virt;
70032 +#ifdef CONFIG_PPC64
70033 +       void *io_base_alloc;
70034 +#endif
70035         resource_size_t io_base_phys;
70036 +#ifndef CONFIG_PPC64
70037 +       resource_size_t pci_io_size;
70038 +#endif
70039  
70040         /* Some machines (PReP) have a non 1:1 mapping of
70041          * the PCI memory space in the CPU bus space
70042          */
70043         resource_size_t pci_mem_offset;
70044 +#ifdef CONFIG_PPC64
70045 +       unsigned long pci_io_size;
70046 +#endif
70047  
70048         struct pci_ops *ops;
70049 -       volatile unsigned int __iomem *cfg_addr;
70050 -       volatile void __iomem *cfg_data;
70051 +       unsigned int __iomem *cfg_addr;
70052 +       void __iomem *cfg_data;
70053  
70054 +#ifndef CONFIG_PPC64
70055         /*
70056          * Used for variants of PCI indirect handling and possible quirks:
70057          *  SET_CFG_TYPE - used on 4xx or any PHB that does explicit type0/1
70058 @@ -51,21 +93,30 @@
70059          *   set.
70060          *  BIG_ENDIAN - cfg_addr is a big endian register
70061          */
70062 -#define PPC_INDIRECT_TYPE_SET_CFG_TYPE         (0x00000001)
70063 -#define PPC_INDIRECT_TYPE_EXT_REG              (0x00000002)
70064 -#define PPC_INDIRECT_TYPE_SURPRESS_PRIMARY_BUS (0x00000004)
70065 -#define PPC_INDIRECT_TYPE_NO_PCIE_LINK         (0x00000008)
70066 -#define PPC_INDIRECT_TYPE_BIG_ENDIAN           (0x00000010)
70067 +#define PPC_INDIRECT_TYPE_SET_CFG_TYPE         0x00000001
70068 +#define PPC_INDIRECT_TYPE_EXT_REG              0x00000002
70069 +#define PPC_INDIRECT_TYPE_SURPRESS_PRIMARY_BUS 0x00000004
70070 +#define PPC_INDIRECT_TYPE_NO_PCIE_LINK         0x00000008
70071 +#define PPC_INDIRECT_TYPE_BIG_ENDIAN           0x00000010
70072         u32 indirect_type;
70073 -
70074 +#endif /* !CONFIG_PPC64 */
70075         /* Currently, we limit ourselves to 1 IO range and 3 mem
70076          * ranges since the common pci_bus structure can't handle more
70077          */
70078         struct resource io_resource;
70079         struct resource mem_resources[3];
70080         int global_number;              /* PCI domain number */
70081 +#ifdef CONFIG_PPC64
70082 +       unsigned long buid;
70083 +       unsigned long dma_window_base_cur;
70084 +       unsigned long dma_window_size;
70085 +
70086 +       void *private_data;
70087 +#endif /* CONFIG_PPC64 */
70088  };
70089  
70090 +#ifndef CONFIG_PPC64
70091 +
70092  static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus)
70093  {
70094         return bus->sysdata;
70095 @@ -81,18 +132,18 @@
70096  
70097  /* These are used for config access before all the PCI probing
70098     has been done. */
70099 -int early_read_config_byte(struct pci_controller *hose, int bus, int dev_fn,
70100 -                          int where, u8 *val);
70101 -int early_read_config_word(struct pci_controller *hose, int bus, int dev_fn,
70102 -                          int where, u16 *val);
70103 -int early_read_config_dword(struct pci_controller *hose, int bus, int dev_fn,
70104 -                           int where, u32 *val);
70105 -int early_write_config_byte(struct pci_controller *hose, int bus, int dev_fn,
70106 -                           int where, u8 val);
70107 -int early_write_config_word(struct pci_controller *hose, int bus, int dev_fn,
70108 -                           int where, u16 val);
70109 -int early_write_config_dword(struct pci_controller *hose, int bus, int dev_fn,
70110 -                            int where, u32 val);
70111 +extern int early_read_config_byte(struct pci_controller *hose, int bus,
70112 +                       int dev_fn, int where, u8 *val);
70113 +extern int early_read_config_word(struct pci_controller *hose, int bus,
70114 +                       int dev_fn, int where, u16 *val);
70115 +extern int early_read_config_dword(struct pci_controller *hose, int bus,
70116 +                       int dev_fn, int where, u32 *val);
70117 +extern int early_write_config_byte(struct pci_controller *hose, int bus,
70118 +                       int dev_fn, int where, u8 val);
70119 +extern int early_write_config_word(struct pci_controller *hose, int bus,
70120 +                       int dev_fn, int where, u16 val);
70121 +extern int early_write_config_dword(struct pci_controller *hose, int bus,
70122 +                       int dev_fn, int where, u32 val);
70123  
70124  extern int early_find_capability(struct pci_controller *hose, int bus,
70125                                  int dev_fn, int cap);
70126 @@ -101,87 +152,33 @@
70127                                resource_size_t cfg_addr,
70128                                resource_size_t cfg_data, u32 flags);
70129  extern void setup_grackle(struct pci_controller *hose);
70130 -extern void __init update_bridge_resource(struct pci_dev *dev,
70131 -                                         struct resource *res);
70132 -
70133 -#else
70134 -
70135 -
70136 -/*
70137 - * This program is free software; you can redistribute it and/or
70138 - * modify it under the terms of the GNU General Public License
70139 - * as published by the Free Software Foundation; either version
70140 - * 2 of the License, or (at your option) any later version.
70141 - */
70142 -
70143 -/*
70144 - * Structure of a PCI controller (host bridge)
70145 - */
70146 -struct pci_controller {
70147 -       struct pci_bus *bus;
70148 -       char is_dynamic;
70149 -       int node;
70150 -       void *arch_data;
70151 -       struct list_head list_node;
70152 -       struct device *parent;
70153 -
70154 -       int first_busno;
70155 -       int last_busno;
70156 -
70157 -       void __iomem *io_base_virt;
70158 -       void *io_base_alloc;
70159 -       resource_size_t io_base_phys;
70160 -
70161 -       /* Some machines have a non 1:1 mapping of
70162 -        * the PCI memory space in the CPU bus space
70163 -        */
70164 -       resource_size_t pci_mem_offset;
70165 -       unsigned long pci_io_size;
70166 -
70167 -       struct pci_ops *ops;
70168 -       volatile unsigned int __iomem *cfg_addr;
70169 -       volatile void __iomem *cfg_data;
70170 -
70171 -       /* Currently, we limit ourselves to 1 IO range and 3 mem
70172 -        * ranges since the common pci_bus structure can't handle more
70173 -        */
70174 -       struct resource io_resource;
70175 -       struct resource mem_resources[3];
70176 -       int global_number;
70177 -       unsigned long buid;
70178 -       unsigned long dma_window_base_cur;
70179 -       unsigned long dma_window_size;
70180 -
70181 -       void *private_data;
70182 -};
70183 +#else  /* CONFIG_PPC64 */
70184  
70185  /*
70186   * PCI stuff, for nodes representing PCI devices, pointed to
70187   * by device_node->data.
70188   */
70189 -struct pci_controller;
70190  struct iommu_table;
70191  
70192  struct pci_dn {
70193         int     busno;                  /* pci bus number */
70194 -       int     bussubno;               /* pci subordinate bus number */
70195         int     devfn;                  /* pci device and function number */
70196 -       int     class_code;             /* pci device class */
70197  
70198         struct  pci_controller *phb;    /* for pci devices */
70199         struct  iommu_table *iommu_table;       /* for phb's or bridges */
70200 -       struct  pci_dev *pcidev;        /* back-pointer to the pci device */
70201         struct  device_node *node;      /* back-pointer to the device_node */
70202  
70203         int     pci_ext_config_space;   /* for pci devices */
70204  
70205  #ifdef CONFIG_EEH
70206 +       struct  pci_dev *pcidev;        /* back-pointer to the pci device */
70207 +       int     class_code;             /* pci device class */
70208         int     eeh_mode;               /* See eeh.h for possible EEH_MODEs */
70209         int     eeh_config_addr;
70210         int     eeh_pe_config_addr; /* new-style partition endpoint address */
70211 -       int     eeh_check_count;        /* # times driver ignored error */
70212 -       int     eeh_freeze_count;       /* # times this device froze up. */
70213 -       int     eeh_false_positives;    /* # times this device reported #ff's */
70214 +       int     eeh_check_count;        /* # times driver ignored error */
70215 +       int     eeh_freeze_count;       /* # times this device froze up. */
70216 +       int     eeh_false_positives;    /* # times this device reported #ff's */
70217         u32     config_space[16];       /* saved PCI config space */
70218  #endif
70219  };
70220 @@ -189,7 +186,7 @@
70221  /* Get the pointer to a device_node's pci_dn */
70222  #define PCI_DN(dn)     ((struct pci_dn *) (dn)->data)
70223  
70224 -struct device_node *fetch_dev_dn(struct pci_dev *dev);
70225 +extern struct device_node *fetch_dev_dn(struct pci_dev *dev);
70226  
70227  /* Get a device_node from a pci_dev.  This code must be fast except
70228   * in the case where the sysdata is incorrect and needs to be fixed
70229 @@ -227,14 +224,14 @@
70230  }
70231  
70232  /** Find the bus corresponding to the indicated device node */
70233 -struct pci_bus * pcibios_find_pci_bus(struct device_node *dn);
70234 +extern struct pci_bus *pcibios_find_pci_bus(struct device_node *dn);
70235  
70236  /** Remove all of the PCI devices under this bus */
70237 -void pcibios_remove_pci_devices(struct pci_bus *bus);
70238 +extern void pcibios_remove_pci_devices(struct pci_bus *bus);
70239  
70240  /** Discover new pci devices under this bus, and add them */
70241 -void pcibios_add_pci_devices(struct pci_bus * bus);
70242 -void pcibios_fixup_new_pci_devices(struct pci_bus *bus, int fix_bus);
70243 +extern void pcibios_add_pci_devices(struct pci_bus *bus);
70244 +extern void pcibios_fixup_new_pci_devices(struct pci_bus *bus);
70245  
70246  extern int pcibios_remove_root_bus(struct pci_controller *phb);
70247  
70248 @@ -270,20 +267,18 @@
70249  #define PHB_SET_NODE(PHB, NODE)                ((PHB)->node = -1)
70250  #endif
70251  
70252 -#endif /* CONFIG_PPC64 */
70253 +#endif /* CONFIG_PPC64 */
70254  
70255  /* Get the PCI host controller for an OF device */
70256 -extern struct pci_controller*
70257 -pci_find_hose_for_OF_device(struct device_node* node);
70258 +extern struct pci_controller *pci_find_hose_for_OF_device(
70259 +                       struct device_node* node);
70260  
70261  /* Fill up host controller resources from the OF node */
70262 -extern void
70263 -pci_process_bridge_OF_ranges(struct pci_controller *hose,
70264 -                          struct device_node *dev, int primary);
70265 +extern void pci_process_bridge_OF_ranges(struct pci_controller *hose,
70266 +                       struct device_node *dev, int primary);
70267  
70268  /* Allocate & free a PCI host bridge structure */
70269 -extern struct pci_controller *
70270 -pcibios_alloc_controller(struct device_node *dev);
70271 +extern struct pci_controller *pcibios_alloc_controller(struct device_node *dev);
70272  extern void pcibios_free_controller(struct pci_controller *phb);
70273  
70274  #ifdef CONFIG_PCI
70275 @@ -298,9 +293,7 @@
70276  {
70277         return 0;
70278  }
70279 -#endif
70280 -
70281 +#endif /* CONFIG_PCI */
70282  
70283 -
70284 -#endif /* __KERNEL__ */
70285 -#endif
70286 +#endif /* __KERNEL__ */
70287 +#endif /* _ASM_POWERPC_PCI_BRIDGE_H */
70288 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/pci.h powerpc.git/include/asm-powerpc/pci.h
70289 --- linux-2.6.24/include/asm-powerpc/pci.h      2008-01-24 23:58:37.000000000 +0100
70290 +++ powerpc.git/include/asm-powerpc/pci.h       2008-01-28 20:26:42.000000000 +0100
70291 @@ -36,11 +36,10 @@
70292  
70293  /*
70294   * Set this to 1 if you want the kernel to re-assign all PCI
70295 - * bus numbers
70296 + * bus numbers (don't do that on ppc64 yet !)
70297   */
70298 -extern int pci_assign_all_buses;
70299 -#define pcibios_assign_all_busses()    (pci_assign_all_buses)
70300 -
70301 +#define pcibios_assign_all_busses()            (ppc_pci_flags & \
70302 +                                        PPC_PCI_REASSIGN_ALL_BUS)
70303  #define pcibios_scan_all_fns(a, b)     0
70304  
70305  static inline void pcibios_set_master(struct pci_dev *dev)
70306 @@ -95,9 +94,6 @@
70307  #define get_pci_dma_ops()      NULL
70308  #endif
70309  
70310 -/* Decide whether to display the domain number in /proc */
70311 -extern int pci_proc_domain(struct pci_bus *bus);
70312 -
70313  #else /* 32-bit */
70314  
70315  #ifdef CONFIG_PCI
70316 @@ -109,17 +105,14 @@
70317         *strategy_parameter = ~0UL;
70318  }
70319  #endif
70320 -
70321 -/* Set the name of the bus as it appears in /proc/bus/pci */
70322 -static inline int pci_proc_domain(struct pci_bus *bus)
70323 -{
70324 -       return 0;
70325 -}
70326 -
70327  #endif /* CONFIG_PPC64 */
70328  
70329  extern int pci_domain_nr(struct pci_bus *bus);
70330  
70331 +/* Decide whether to display the domain number in /proc */
70332 +extern int pci_proc_domain(struct pci_bus *bus);
70333 +
70334 +
70335  struct vm_area_struct;
70336  /* Map a range of PCI memory or I/O space for a device into user space */
70337  int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma,
70338 @@ -199,13 +192,12 @@
70339         return root;
70340  }
70341  
70342 -extern void pcibios_fixup_device_resources(struct pci_dev *dev,
70343 -                       struct pci_bus *bus);
70344 -
70345  extern void pcibios_setup_new_device(struct pci_dev *dev);
70346  
70347  extern void pcibios_claim_one_bus(struct pci_bus *b);
70348  
70349 +extern void pcibios_resource_survey(void);
70350 +
70351  extern struct pci_controller *init_phb_dynamic(struct device_node *dn);
70352  
70353  extern struct pci_dev *of_create_pci_dev(struct device_node *node,
70354 @@ -229,5 +221,8 @@
70355                                  const struct resource *rsrc,
70356                                  resource_size_t *start, resource_size_t *end);
70357  
70358 +extern void pcibios_do_bus_setup(struct pci_bus *bus);
70359 +extern void pcibios_fixup_of_probed_bus(struct pci_bus *bus);
70360 +
70361  #endif /* __KERNEL__ */
70362  #endif /* __ASM_POWERPC_PCI_H */
70363 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/ppc-pci.h powerpc.git/include/asm-powerpc/ppc-pci.h
70364 --- linux-2.6.24/include/asm-powerpc/ppc-pci.h  2008-01-24 23:58:37.000000000 +0100
70365 +++ powerpc.git/include/asm-powerpc/ppc-pci.h   2008-01-28 20:26:42.000000000 +0100
70366 @@ -22,7 +22,6 @@
70367  
70368  
70369  extern struct list_head hose_list;
70370 -extern int global_phb_number;
70371  
70372  extern void find_and_init_phbs(void);
70373  
70374 @@ -47,9 +46,6 @@
70375  extern unsigned long get_phb_buid (struct device_node *);
70376  extern int rtas_setup_phb(struct pci_controller *phb);
70377  
70378 -/* From iSeries PCI */
70379 -extern void iSeries_pcibios_init(void);
70380 -
70381  extern unsigned long pci_probe_only;
70382  
70383  /* ---- EEH internal-use-only related routines ---- */
70384 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/prom.h powerpc.git/include/asm-powerpc/prom.h
70385 --- linux-2.6.24/include/asm-powerpc/prom.h     2008-01-24 23:58:37.000000000 +0100
70386 +++ powerpc.git/include/asm-powerpc/prom.h      2008-01-28 20:26:42.000000000 +0100
70387 @@ -202,6 +202,10 @@
70388   */
70389  extern u64 of_translate_address(struct device_node *np, const u32 *addr);
70390  
70391 +/* Translate a DMA address from device space to CPU space */
70392 +extern u64 of_translate_dma_address(struct device_node *dev,
70393 +                                   const u32 *in_addr);
70394 +
70395  /* Extract an address from a device, returns the region size and
70396   * the address space flags too. The PCI version uses a BAR number
70397   * instead of an absolute index
70398 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/ps3.h powerpc.git/include/asm-powerpc/ps3.h
70399 --- linux-2.6.24/include/asm-powerpc/ps3.h      2008-01-24 23:58:37.000000000 +0100
70400 +++ powerpc.git/include/asm-powerpc/ps3.h       2008-01-28 20:26:42.000000000 +0100
70401 @@ -24,6 +24,7 @@
70402  #include <linux/init.h>
70403  #include <linux/types.h>
70404  #include <linux/device.h>
70405 +#include "cell-pmu.h"
70406  
70407  union ps3_firmware_version {
70408         u64 raw;
70409 @@ -317,6 +318,7 @@
70410         PS3_MATCH_ID_STOR_FLASH     = 8,
70411         PS3_MATCH_ID_SOUND          = 9,
70412         PS3_MATCH_ID_GRAPHICS       = 10,
70413 +       PS3_MATCH_ID_LPM            = 11,
70414  };
70415  
70416  #define PS3_MODULE_ALIAS_EHCI           "ps3:1"
70417 @@ -329,11 +331,13 @@
70418  #define PS3_MODULE_ALIAS_STOR_FLASH     "ps3:8"
70419  #define PS3_MODULE_ALIAS_SOUND          "ps3:9"
70420  #define PS3_MODULE_ALIAS_GRAPHICS       "ps3:10"
70421 +#define PS3_MODULE_ALIAS_LPM            "ps3:11"
70422  
70423  enum ps3_system_bus_device_type {
70424         PS3_DEVICE_TYPE_IOC0 = 1,
70425         PS3_DEVICE_TYPE_SB,
70426         PS3_DEVICE_TYPE_VUART,
70427 +       PS3_DEVICE_TYPE_LPM,
70428  };
70429  
70430  /**
70431 @@ -344,12 +348,17 @@
70432         enum ps3_match_id match_id;
70433         enum ps3_system_bus_device_type dev_type;
70434  
70435 -       unsigned int bus_id;              /* SB */
70436 -       unsigned int dev_id;              /* SB */
70437 +       u64 bus_id;                       /* SB */
70438 +       u64 dev_id;                       /* SB */
70439         unsigned int interrupt_id;        /* SB */
70440         struct ps3_dma_region *d_region;  /* SB, IOC0 */
70441         struct ps3_mmio_region *m_region; /* SB, IOC0*/
70442         unsigned int port_number;         /* VUART */
70443 +       struct {                          /* LPM */
70444 +               u64 node_id;
70445 +               u64 pu_id;
70446 +               u64 rights;
70447 +       } lpm;
70448  
70449  /*     struct iommu_table *iommu_table; -- waiting for BenH's cleanups */
70450         struct device core;
70451 @@ -438,5 +447,66 @@
70452  extern struct ps3_prealloc ps3fb_videomemory;
70453  extern struct ps3_prealloc ps3flash_bounce_buffer;
70454  
70455 +/* logical performance monitor */
70456 +
70457 +/**
70458 + * enum ps3_lpm_rights - Rigths granted by the system policy module.
70459 + *
70460 + * @PS3_LPM_RIGHTS_USE_LPM: The right to use the lpm.
70461 + * @PS3_LPM_RIGHTS_USE_TB: The right to use the internal trace buffer.
70462 + */
70463 +
70464 +enum ps3_lpm_rights {
70465 +       PS3_LPM_RIGHTS_USE_LPM = 0x001,
70466 +       PS3_LPM_RIGHTS_USE_TB = 0x100,
70467 +};
70468 +
70469 +/**
70470 + * enum ps3_lpm_tb_type - Type of trace buffer lv1 should use.
70471 + *
70472 + * @PS3_LPM_TB_TYPE_NONE: Do not use a trace buffer.
70473 + * @PS3_LPM_RIGHTS_USE_TB: Use the lv1 internal trace buffer.  Must have
70474 + *  rights @PS3_LPM_RIGHTS_USE_TB.
70475 + */
70476 +
70477 +enum ps3_lpm_tb_type {
70478 +       PS3_LPM_TB_TYPE_NONE = 0,
70479 +       PS3_LPM_TB_TYPE_INTERNAL = 1,
70480 +};
70481 +
70482 +int ps3_lpm_open(enum ps3_lpm_tb_type tb_type, void *tb_cache,
70483 +       u64 tb_cache_size);
70484 +int ps3_lpm_close(void);
70485 +int ps3_lpm_copy_tb(unsigned long offset, void *buf, unsigned long count,
70486 +       unsigned long *bytes_copied);
70487 +int ps3_lpm_copy_tb_to_user(unsigned long offset, void __user *buf,
70488 +       unsigned long count, unsigned long *bytes_copied);
70489 +void ps3_set_bookmark(u64 bookmark);
70490 +void ps3_set_pm_bookmark(u64 tag, u64 incident, u64 th_id);
70491 +int ps3_set_signal(u64 rtas_signal_group, u8 signal_bit, u16 sub_unit,
70492 +       u8 bus_word);
70493 +
70494 +u32 ps3_read_phys_ctr(u32 cpu, u32 phys_ctr);
70495 +void ps3_write_phys_ctr(u32 cpu, u32 phys_ctr, u32 val);
70496 +u32 ps3_read_ctr(u32 cpu, u32 ctr);
70497 +void ps3_write_ctr(u32 cpu, u32 ctr, u32 val);
70498 +
70499 +u32 ps3_read_pm07_control(u32 cpu, u32 ctr);
70500 +void ps3_write_pm07_control(u32 cpu, u32 ctr, u32 val);
70501 +u32 ps3_read_pm(u32 cpu, enum pm_reg_name reg);
70502 +void ps3_write_pm(u32 cpu, enum pm_reg_name reg, u32 val);
70503 +
70504 +u32 ps3_get_ctr_size(u32 cpu, u32 phys_ctr);
70505 +void ps3_set_ctr_size(u32 cpu, u32 phys_ctr, u32 ctr_size);
70506 +
70507 +void ps3_enable_pm(u32 cpu);
70508 +void ps3_disable_pm(u32 cpu);
70509 +void ps3_enable_pm_interrupts(u32 cpu, u32 thread, u32 mask);
70510 +void ps3_disable_pm_interrupts(u32 cpu);
70511 +
70512 +u32 ps3_get_and_clear_pm_interrupts(u32 cpu);
70513 +void ps3_sync_irq(int node);
70514 +u32 ps3_get_hw_thread_id(int cpu);
70515 +u64 ps3_get_spe_id(void *arg);
70516  
70517  #endif
70518 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/ptrace.h powerpc.git/include/asm-powerpc/ptrace.h
70519 --- linux-2.6.24/include/asm-powerpc/ptrace.h   2008-01-24 23:58:37.000000000 +0100
70520 +++ powerpc.git/include/asm-powerpc/ptrace.h    2008-01-28 20:26:42.000000000 +0100
70521 @@ -106,7 +106,8 @@
70522   */
70523  #define FULL_REGS(regs)                (((regs)->trap & 1) == 0)
70524  #ifndef __powerpc64__
70525 -#define IS_CRITICAL_EXC(regs)  (((regs)->trap & 2) == 0)
70526 +#define IS_CRITICAL_EXC(regs)  (((regs)->trap & 2) != 0)
70527 +#define IS_MCHECK_EXC(regs)    (((regs)->trap & 4) != 0)
70528  #endif /* ! __powerpc64__ */
70529  #define TRAP(regs)             ((regs)->trap & ~0xF)
70530  #ifdef __powerpc64__
70531 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/qe.h powerpc.git/include/asm-powerpc/qe.h
70532 --- linux-2.6.24/include/asm-powerpc/qe.h       2008-01-24 23:58:37.000000000 +0100
70533 +++ powerpc.git/include/asm-powerpc/qe.h        2008-01-28 20:26:42.000000000 +0100
70534 @@ -28,6 +28,52 @@
70535  #define MEM_PART_SECONDARY     1
70536  #define MEM_PART_MURAM         2
70537  
70538 +/* Clocks and BRGs */
70539 +enum qe_clock {
70540 +       QE_CLK_NONE = 0,
70541 +       QE_BRG1,                /* Baud Rate Generator 1 */
70542 +       QE_BRG2,                /* Baud Rate Generator 2 */
70543 +       QE_BRG3,                /* Baud Rate Generator 3 */
70544 +       QE_BRG4,                /* Baud Rate Generator 4 */
70545 +       QE_BRG5,                /* Baud Rate Generator 5 */
70546 +       QE_BRG6,                /* Baud Rate Generator 6 */
70547 +       QE_BRG7,                /* Baud Rate Generator 7 */
70548 +       QE_BRG8,                /* Baud Rate Generator 8 */
70549 +       QE_BRG9,                /* Baud Rate Generator 9 */
70550 +       QE_BRG10,               /* Baud Rate Generator 10 */
70551 +       QE_BRG11,               /* Baud Rate Generator 11 */
70552 +       QE_BRG12,               /* Baud Rate Generator 12 */
70553 +       QE_BRG13,               /* Baud Rate Generator 13 */
70554 +       QE_BRG14,               /* Baud Rate Generator 14 */
70555 +       QE_BRG15,               /* Baud Rate Generator 15 */
70556 +       QE_BRG16,               /* Baud Rate Generator 16 */
70557 +       QE_CLK1,                /* Clock 1 */
70558 +       QE_CLK2,                /* Clock 2 */
70559 +       QE_CLK3,                /* Clock 3 */
70560 +       QE_CLK4,                /* Clock 4 */
70561 +       QE_CLK5,                /* Clock 5 */
70562 +       QE_CLK6,                /* Clock 6 */
70563 +       QE_CLK7,                /* Clock 7 */
70564 +       QE_CLK8,                /* Clock 8 */
70565 +       QE_CLK9,                /* Clock 9 */
70566 +       QE_CLK10,               /* Clock 10 */
70567 +       QE_CLK11,               /* Clock 11 */
70568 +       QE_CLK12,               /* Clock 12 */
70569 +       QE_CLK13,               /* Clock 13 */
70570 +       QE_CLK14,               /* Clock 14 */
70571 +       QE_CLK15,               /* Clock 15 */
70572 +       QE_CLK16,               /* Clock 16 */
70573 +       QE_CLK17,               /* Clock 17 */
70574 +       QE_CLK18,               /* Clock 18 */
70575 +       QE_CLK19,               /* Clock 19 */
70576 +       QE_CLK20,               /* Clock 20 */
70577 +       QE_CLK21,               /* Clock 21 */
70578 +       QE_CLK22,               /* Clock 22 */
70579 +       QE_CLK23,               /* Clock 23 */
70580 +       QE_CLK24,               /* Clock 24 */
70581 +       QE_CLK_DUMMY
70582 +};
70583 +
70584  /* Export QE common operations */
70585  extern void qe_reset(void);
70586  extern int par_io_init(struct device_node *np);
70587 @@ -38,7 +84,8 @@
70588  
70589  /* QE internal API */
70590  int qe_issue_cmd(u32 cmd, u32 device, u8 mcn_protocol, u32 cmd_input);
70591 -void qe_setbrg(unsigned int brg, unsigned int rate, unsigned int multiplier);
70592 +enum qe_clock qe_clock_source(const char *source);
70593 +int qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier);
70594  int qe_get_snum(void);
70595  void qe_put_snum(u8 snum);
70596  unsigned long qe_muram_alloc(int size, int align);
70597 @@ -47,6 +94,58 @@
70598  void qe_muram_dump(void);
70599  void *qe_muram_addr(unsigned long offset);
70600  
70601 +/* Structure that defines QE firmware binary files.
70602 + *
70603 + * See Documentation/powerpc/qe-firmware.txt for a description of these
70604 + * fields.
70605 + */
70606 +struct qe_firmware {
70607 +       struct qe_header {
70608 +               __be32 length;  /* Length of the entire structure, in bytes */
70609 +               u8 magic[3];    /* Set to { 'Q', 'E', 'F' } */
70610 +               u8 version;     /* Version of this layout. First ver is '1' */
70611 +       } header;
70612 +       u8 id[62];      /* Null-terminated identifier string */
70613 +       u8 split;       /* 0 = shared I-RAM, 1 = split I-RAM */
70614 +       u8 count;       /* Number of microcode[] structures */
70615 +       struct {
70616 +               __be16 model;           /* The SOC model  */
70617 +               u8 major;               /* The SOC revision major */
70618 +               u8 minor;               /* The SOC revision minor */
70619 +       } __attribute__ ((packed)) soc;
70620 +       u8 padding[4];                  /* Reserved, for alignment */
70621 +       __be64 extended_modes;          /* Extended modes */
70622 +       __be32 vtraps[8];               /* Virtual trap addresses */
70623 +       u8 reserved[4];                 /* Reserved, for future expansion */
70624 +       struct qe_microcode {
70625 +               u8 id[32];              /* Null-terminated identifier */
70626 +               __be32 traps[16];       /* Trap addresses, 0 == ignore */
70627 +               __be32 eccr;            /* The value for the ECCR register */
70628 +               __be32 iram_offset;     /* Offset into I-RAM for the code */
70629 +               __be32 count;           /* Number of 32-bit words of the code */
70630 +               __be32 code_offset;     /* Offset of the actual microcode */
70631 +               u8 major;               /* The microcode version major */
70632 +               u8 minor;               /* The microcode version minor */
70633 +               u8 revision;            /* The microcode version revision */
70634 +               u8 padding;             /* Reserved, for alignment */
70635 +               u8 reserved[4];         /* Reserved, for future expansion */
70636 +       } __attribute__ ((packed)) microcode[1];
70637 +       /* All microcode binaries should be located here */
70638 +       /* CRC32 should be located here, after the microcode binaries */
70639 +} __attribute__ ((packed));
70640 +
70641 +struct qe_firmware_info {
70642 +       char id[64];            /* Firmware name */
70643 +       u32 vtraps[8];          /* Virtual trap addresses */
70644 +       u64 extended_modes;     /* Extended modes */
70645 +};
70646 +
70647 +/* Upload a firmware to the QE */
70648 +int qe_upload_firmware(const struct qe_firmware *firmware);
70649 +
70650 +/* Obtain information on the uploaded firmware */
70651 +struct qe_firmware_info *qe_get_firmware_info(void);
70652 +
70653  /* Buffer descriptors */
70654  struct qe_bd {
70655         __be16 status;
70656 @@ -129,52 +228,6 @@
70657         COMM_DIR_RX_AND_TX = 3
70658  };
70659  
70660 -/* Clocks and BRGs */
70661 -enum qe_clock {
70662 -       QE_CLK_NONE = 0,
70663 -       QE_BRG1,                /* Baud Rate Generator 1 */
70664 -       QE_BRG2,                /* Baud Rate Generator 2 */
70665 -       QE_BRG3,                /* Baud Rate Generator 3 */
70666 -       QE_BRG4,                /* Baud Rate Generator 4 */
70667 -       QE_BRG5,                /* Baud Rate Generator 5 */
70668 -       QE_BRG6,                /* Baud Rate Generator 6 */
70669 -       QE_BRG7,                /* Baud Rate Generator 7 */
70670 -       QE_BRG8,                /* Baud Rate Generator 8 */
70671 -       QE_BRG9,                /* Baud Rate Generator 9 */
70672 -       QE_BRG10,               /* Baud Rate Generator 10 */
70673 -       QE_BRG11,               /* Baud Rate Generator 11 */
70674 -       QE_BRG12,               /* Baud Rate Generator 12 */
70675 -       QE_BRG13,               /* Baud Rate Generator 13 */
70676 -       QE_BRG14,               /* Baud Rate Generator 14 */
70677 -       QE_BRG15,               /* Baud Rate Generator 15 */
70678 -       QE_BRG16,               /* Baud Rate Generator 16 */
70679 -       QE_CLK1,                /* Clock 1 */
70680 -       QE_CLK2,                /* Clock 2 */
70681 -       QE_CLK3,                /* Clock 3 */
70682 -       QE_CLK4,                /* Clock 4 */
70683 -       QE_CLK5,                /* Clock 5 */
70684 -       QE_CLK6,                /* Clock 6 */
70685 -       QE_CLK7,                /* Clock 7 */
70686 -       QE_CLK8,                /* Clock 8 */
70687 -       QE_CLK9,                /* Clock 9 */
70688 -       QE_CLK10,               /* Clock 10 */
70689 -       QE_CLK11,               /* Clock 11 */
70690 -       QE_CLK12,               /* Clock 12 */
70691 -       QE_CLK13,               /* Clock 13 */
70692 -       QE_CLK14,               /* Clock 14 */
70693 -       QE_CLK15,               /* Clock 15 */
70694 -       QE_CLK16,               /* Clock 16 */
70695 -       QE_CLK17,               /* Clock 17 */
70696 -       QE_CLK18,               /* Clock 18 */
70697 -       QE_CLK19,               /* Clock 19 */
70698 -       QE_CLK20,               /* Clock 20 */
70699 -       QE_CLK21,               /* Clock 21 */
70700 -       QE_CLK22,               /* Clock 22 */
70701 -       QE_CLK23,               /* Clock 23 */
70702 -       QE_CLK24,               /* Clock 24 */
70703 -       QE_CLK_DUMMY,
70704 -};
70705 -
70706  /* QE CMXUCR Registers.
70707   * There are two UCCs represented in each of the four CMXUCR registers.
70708   * These values are for the UCC in the LSBs
70709 @@ -328,6 +381,15 @@
70710  
70711  #define QE_SDEBCR_BA_MASK      0x01FFFFFF
70712  
70713 +/* Communication Processor */
70714 +#define QE_CP_CERCR_MEE                0x8000  /* Multi-user RAM ECC enable */
70715 +#define QE_CP_CERCR_IEE                0x4000  /* Instruction RAM ECC enable */
70716 +#define QE_CP_CERCR_CIR                0x0800  /* Common instruction RAM */
70717 +
70718 +/* I-RAM */
70719 +#define QE_IRAM_IADD_AIE       0x80000000      /* Auto Increment Enable */
70720 +#define QE_IRAM_IADD_BADDR     0x00080000      /* Base Address */
70721 +
70722  /* UPC */
70723  #define UPGCR_PROTOCOL 0x80000000      /* protocol ul2 or pl2 */
70724  #define UPGCR_TMS      0x40000000      /* Transmit master/slave mode */
70725 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/reg.h powerpc.git/include/asm-powerpc/reg.h
70726 --- linux-2.6.24/include/asm-powerpc/reg.h      2008-01-24 23:58:37.000000000 +0100
70727 +++ powerpc.git/include/asm-powerpc/reg.h       2008-01-28 20:26:42.000000000 +0100
70728 @@ -553,6 +553,7 @@
70729  #define SPRN_PA6T_BTCR 978     /* Breakpoint and Tagging Control Register */
70730  #define SPRN_PA6T_IMAAT        979     /* Instruction Match Array Action Table */
70731  #define SPRN_PA6T_PCCR 1019    /* Power Counter Control Register */
70732 +#define SPRN_BKMK      1020    /* Cell Bookmark Register */
70733  #define SPRN_PA6T_RPCCR        1021    /* Retire PC Trace Control Register */
70734  
70735  
70736 @@ -691,12 +692,6 @@
70737  #define PV_BE          0x0070
70738  #define PV_PA6T                0x0090
70739  
70740 -/*
70741 - * Number of entries in the SLB. If this ever changes we should handle
70742 - * it with a use a cpu feature fixup.
70743 - */
70744 -#define SLB_NUM_ENTRIES 64
70745 -
70746  /* Macros for setting and retrieving special purpose registers */
70747  #ifndef __ASSEMBLY__
70748  #define mfmsr()                ({unsigned long rval; \
70749 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/reg_booke.h powerpc.git/include/asm-powerpc/reg_booke.h
70750 --- linux-2.6.24/include/asm-powerpc/reg_booke.h        2008-01-24 23:58:37.000000000 +0100
70751 +++ powerpc.git/include/asm-powerpc/reg_booke.h 2008-01-28 20:26:42.000000000 +0100
70752 @@ -123,16 +123,23 @@
70753  #define SPRN_SPEFSCR   0x200   /* SPE & Embedded FP Status & Control */
70754  #define SPRN_BBEAR     0x201   /* Branch Buffer Entry Address Register */
70755  #define SPRN_BBTAR     0x202   /* Branch Buffer Target Address Register */
70756 +#define SPRN_ATB       0x20E   /* Alternate Time Base */
70757 +#define SPRN_ATBL      0x20E   /* Alternate Time Base Lower */
70758 +#define SPRN_ATBU      0x20F   /* Alternate Time Base Upper */
70759  #define SPRN_IVOR32    0x210   /* Interrupt Vector Offset Register 32 */
70760  #define SPRN_IVOR33    0x211   /* Interrupt Vector Offset Register 33 */
70761  #define SPRN_IVOR34    0x212   /* Interrupt Vector Offset Register 34 */
70762  #define SPRN_IVOR35    0x213   /* Interrupt Vector Offset Register 35 */
70763 +#define SPRN_IVOR36    0x214   /* Interrupt Vector Offset Register 36 */
70764 +#define SPRN_IVOR37    0x215   /* Interrupt Vector Offset Register 37 */
70765  #define SPRN_MCSRR0    0x23A   /* Machine Check Save and Restore Register 0 */
70766  #define SPRN_MCSRR1    0x23B   /* Machine Check Save and Restore Register 1 */
70767  #define SPRN_MCSR      0x23C   /* Machine Check Status Register */
70768  #define SPRN_MCAR      0x23D   /* Machine Check Address Register */
70769  #define SPRN_DSRR0     0x23E   /* Debug Save and Restore Register 0 */
70770  #define SPRN_DSRR1     0x23F   /* Debug Save and Restore Register 1 */
70771 +#define SPRN_SPRG8     0x25C   /* Special Purpose Register General 8 */
70772 +#define SPRN_SPRG9     0x25D   /* Special Purpose Register General 9 */
70773  #define SPRN_MAS0      0x270   /* MMU Assist Register 0 */
70774  #define SPRN_MAS1      0x271   /* MMU Assist Register 1 */
70775  #define SPRN_MAS2      0x272   /* MMU Assist Register 2 */
70776 @@ -140,15 +147,18 @@
70777  #define SPRN_MAS4      0x274   /* MMU Assist Register 4 */
70778  #define SPRN_MAS5      0x275   /* MMU Assist Register 5 */
70779  #define SPRN_MAS6      0x276   /* MMU Assist Register 6 */
70780 -#define SPRN_MAS7      0x3b0   /* MMU Assist Register 7 */
70781  #define SPRN_PID1      0x279   /* Process ID Register 1 */
70782  #define SPRN_PID2      0x27A   /* Process ID Register 2 */
70783  #define SPRN_TLB0CFG   0x2B0   /* TLB 0 Config Register */
70784  #define SPRN_TLB1CFG   0x2B1   /* TLB 1 Config Register */
70785 +#define SPRN_EPR       0x2BE   /* External Proxy Register */
70786  #define SPRN_CCR1      0x378   /* Core Configuration Register 1 */
70787  #define SPRN_ZPR       0x3B0   /* Zone Protection Register (40x) */
70788 +#define SPRN_MAS7      0x3B0   /* MMU Assist Register 7 */
70789  #define SPRN_MMUCR     0x3B2   /* MMU Control Register */
70790  #define SPRN_CCR0      0x3B3   /* Core Configuration Register 0 */
70791 +#define SPRN_EPLC      0x3B3   /* External Process ID Load Context */
70792 +#define SPRN_EPSC      0x3B4   /* External Process ID Store Context */
70793  #define SPRN_SGR       0x3B9   /* Storage Guarded Register */
70794  #define SPRN_DCWR      0x3BA   /* Data Cache Write-thru Register */
70795  #define SPRN_SLER      0x3BB   /* Little-endian real mode */
70796 @@ -159,6 +169,7 @@
70797  #define SPRN_L1CSR0    0x3F2   /* L1 Cache Control and Status Register 0 */
70798  #define SPRN_L1CSR1    0x3F3   /* L1 Cache Control and Status Register 1 */
70799  #define SPRN_PIT       0x3DB   /* Programmable Interval Timer */
70800 +#define SPRN_BUCSR     0x3F5   /* Branch Unit Control and Status */
70801  #define SPRN_DCCR      0x3FA   /* Data Cache Cacheability Register */
70802  #define SPRN_ICCR      0x3FB   /* Instruction Cache Cacheability Register */
70803  #define SPRN_SVR       0x3FF   /* System Version Register */
70804 @@ -207,7 +218,6 @@
70805  #define        CCR1_TCS        0x00000080 /* Timer Clock Select */
70806  
70807  /* Bit definitions for the MCSR. */
70808 -#ifdef CONFIG_440A
70809  #define MCSR_MCS       0x80000000 /* Machine Check Summary */
70810  #define MCSR_IB                0x40000000 /* Instruction PLB Error */
70811  #define MCSR_DRB       0x20000000 /* Data Read PLB Error */
70812 @@ -217,7 +227,7 @@
70813  #define MCSR_DCSP      0x02000000 /* D-Cache Search Parity Error */
70814  #define MCSR_DCFP      0x01000000 /* D-Cache Flush Parity Error */
70815  #define MCSR_IMPE      0x00800000 /* Imprecise Machine Check Exception */
70816 -#endif
70817 +
70818  #ifdef CONFIG_E500
70819  #define MCSR_MCP       0x80000000UL /* Machine Check Input Pin */
70820  #define MCSR_ICPERR    0x40000000UL /* I-Cache Parity Error */
70821 @@ -293,7 +303,7 @@
70822  #define ESR_IMCB       0x20000000      /* Instr. Machine Check - Bus error */
70823  #define ESR_IMCT       0x10000000      /* Instr. Machine Check - Timeout */
70824  #define ESR_PIL                0x08000000      /* Program Exception - Illegal */
70825 -#define ESR_PPR                0x04000000      /* Program Exception - Priveleged */
70826 +#define ESR_PPR                0x04000000      /* Program Exception - Privileged */
70827  #define ESR_PTR                0x02000000      /* Program Exception - Trap */
70828  #define ESR_FP         0x01000000      /* Floating Point Operation */
70829  #define ESR_DST                0x00800000      /* Storage Exception - Data miss */
70830 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/setjmp.h powerpc.git/include/asm-powerpc/setjmp.h
70831 --- linux-2.6.24/include/asm-powerpc/setjmp.h   1970-01-01 01:00:00.000000000 +0100
70832 +++ powerpc.git/include/asm-powerpc/setjmp.h    2008-01-28 20:26:42.000000000 +0100
70833 @@ -0,0 +1,18 @@
70834 +/*
70835 + * Copyright Â© 2008 Michael Neuling IBM Corporation
70836 + *
70837 + *      This program is free software; you can redistribute it and/or
70838 + *      modify it under the terms of the GNU General Public License
70839 + *      as published by the Free Software Foundation; either version
70840 + *      2 of the License, or (at your option) any later version.
70841 + *
70842 + */
70843 +#ifndef _ASM_POWERPC_SETJMP_H
70844 +#define _ASM_POWERPC_SETJMP_H
70845 +
70846 +#define JMP_BUF_LEN    23
70847 +
70848 +extern long setjmp(long *);
70849 +extern void longjmp(long *, long);
70850 +
70851 +#endif /* _ASM_POWERPC_SETJMP_H */
70852 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/smu.h powerpc.git/include/asm-powerpc/smu.h
70853 --- linux-2.6.24/include/asm-powerpc/smu.h      2008-01-24 23:58:37.000000000 +0100
70854 +++ powerpc.git/include/asm-powerpc/smu.h       2008-01-28 20:26:42.000000000 +0100
70855 @@ -22,7 +22,7 @@
70856   * Partition info commands
70857   *
70858   * These commands are used to retrieve the sdb-partition-XX datas from
70859 - * the SMU. The lenght is always 2. First byte is the subcommand code
70860 + * the SMU. The length is always 2. First byte is the subcommand code
70861   * and second byte is the partition ID.
70862   *
70863   * The reply is 6 bytes:
70864 @@ -173,12 +173,12 @@
70865   * Power supply control
70866   *
70867   * The "sub" command is an ASCII string in the data, the
70868 - * data lenght is that of the string.
70869 + * data length is that of the string.
70870   *
70871   * The VSLEW command can be used to get or set the voltage slewing.
70872 - *  - lenght 5 (only "VSLEW") : it returns "DONE" and 3 bytes of
70873 + *  - length 5 (only "VSLEW") : it returns "DONE" and 3 bytes of
70874   *    reply at data offset 6, 7 and 8.
70875 - *  - lenght 8 ("VSLEWxyz") has 3 additional bytes appended, and is
70876 + *  - length 8 ("VSLEWxyz") has 3 additional bytes appended, and is
70877   *    used to set the voltage slewing point. The SMU replies with "DONE"
70878   * I yet have to figure out their exact meaning of those 3 bytes in
70879   * both cases. They seem to be:
70880 @@ -201,20 +201,90 @@
70881   */
70882  #define SMU_CMD_READ_ADC                       0xd8
70883  
70884 +
70885  /* Misc commands
70886   *
70887   * This command seem to be a grab bag of various things
70888 + *
70889 + * Parameters:
70890 + *   1: subcommand
70891   */
70892  #define SMU_CMD_MISC_df_COMMAND                        0xdf
70893 -#define   SMU_CMD_MISC_df_SET_DISPLAY_LIT      0x02 /* i: 1 byte */
70894 +
70895 +/*
70896 + * Sets "system ready" status
70897 + *
70898 + * I did not yet understand how it exactly works or what it does.
70899 + *
70900 + * Guessing from OF code, 0x02 activates the display backlight. Apple uses/used
70901 + * the same codebase for all OF versions. On PowerBooks, this command would
70902 + * enable the backlight. For the G5s, it only activates the front LED. However,
70903 + * don't take this for granted.
70904 + *
70905 + * Parameters:
70906 + *   2: status [0x00, 0x01 or 0x02]
70907 + */
70908 +#define   SMU_CMD_MISC_df_SET_DISPLAY_LIT      0x02
70909 +
70910 +/*
70911 + * Sets mode of power switch.
70912 + *
70913 + * What this actually does is not yet known. Maybe it enables some interrupt.
70914 + *
70915 + * Parameters:
70916 + *   2: enable power switch? [0x00 or 0x01]
70917 + *   3 (optional): enable nmi? [0x00 or 0x01]
70918 + *
70919 + * Returns:
70920 + *   If parameter 2 is 0x00 and parameter 3 is not specified, returns wether
70921 + *   NMI is enabled. Otherwise unknown.
70922 + */
70923  #define   SMU_CMD_MISC_df_NMI_OPTION           0x04
70924  
70925 +/* Sets LED dimm offset.
70926 + *
70927 + * The front LED dimms itself during sleep. Its brightness (or, well, the PWM
70928 + * frequency) depends on current time. Therefore, the SMU needs to know the
70929 + * timezone.
70930 + *
70931 + * Parameters:
70932 + *   2-8: unknown (BCD coding)
70933 + */
70934 +#define   SMU_CMD_MISC_df_DIMM_OFFSET          0x99
70935 +
70936 +
70937  /*
70938   * Version info commands
70939   *
70940 - * I haven't quite tried to figure out how these work
70941 + * Parameters:
70942 + *   1 (optional): Specifies version part to retrieve
70943 + *
70944 + * Returns:
70945 + *   Version value
70946   */
70947  #define SMU_CMD_VERSION_COMMAND                        0xea
70948 +#define   SMU_VERSION_RUNNING                  0x00
70949 +#define   SMU_VERSION_BASE                     0x01
70950 +#define   SMU_VERSION_UPDATE                   0x02
70951 +
70952 +
70953 +/*
70954 + * Switches
70955 + *
70956 + * These are switches whose status seems to be known to the SMU.
70957 + *
70958 + * Parameters:
70959 + *   none
70960 + *
70961 + * Result:
70962 + *   Switch bits (ORed, see below)
70963 + */
70964 +#define SMU_CMD_SWITCHES                       0xdc
70965 +
70966 +/* Switches bits */
70967 +#define SMU_SWITCH_CASE_CLOSED                 0x01
70968 +#define SMU_SWITCH_AC_POWER                    0x04
70969 +#define SMU_SWITCH_POWER_SWITCH                        0x08
70970  
70971  
70972  /*
70973 @@ -243,10 +313,64 @@
70974   */
70975  #define SMU_CMD_MISC_ee_COMMAND                        0xee
70976  #define   SMU_CMD_MISC_ee_GET_DATABLOCK_REC    0x02
70977 -#define          SMU_CMD_MISC_ee_LEDS_CTRL             0x04 /* i: 00 (00,01) [00] */
70978 +
70979 +/* Retrieves currently used watts.
70980 + *
70981 + * Parameters:
70982 + *   1: 0x03 (Meaning unknown)
70983 + */
70984 +#define   SMU_CMD_MISC_ee_GET_WATTS            0x03
70985 +
70986 +#define   SMU_CMD_MISC_ee_LEDS_CTRL            0x04 /* i: 00 (00,01) [00] */
70987  #define   SMU_CMD_MISC_ee_GET_DATA             0x05 /* i: 00 , o: ?? */
70988  
70989  
70990 +/*
70991 + * Power related commands
70992 + *
70993 + * Parameters:
70994 + *   1: subcommand
70995 + */
70996 +#define SMU_CMD_POWER_EVENTS_COMMAND           0x8f
70997 +
70998 +/* SMU_POWER_EVENTS subcommands */
70999 +enum {
71000 +       SMU_PWR_GET_POWERUP_EVENTS      = 0x00,
71001 +       SMU_PWR_SET_POWERUP_EVENTS      = 0x01,
71002 +       SMU_PWR_CLR_POWERUP_EVENTS      = 0x02,
71003 +       SMU_PWR_GET_WAKEUP_EVENTS       = 0x03,
71004 +       SMU_PWR_SET_WAKEUP_EVENTS       = 0x04,
71005 +       SMU_PWR_CLR_WAKEUP_EVENTS       = 0x05,
71006 +
71007 +       /*
71008 +        * Get last shutdown cause
71009 +        *
71010 +        * Returns:
71011 +        *   1 byte (signed char): Last shutdown cause. Exact meaning unknown.
71012 +        */
71013 +       SMU_PWR_LAST_SHUTDOWN_CAUSE     = 0x07,
71014 +
71015 +       /*
71016 +        * Sets or gets server ID. Meaning or use is unknown.
71017 +        *
71018 +        * Parameters:
71019 +        *   2 (optional): Set server ID (1 byte)
71020 +        *
71021 +        * Returns:
71022 +        *   1 byte (server ID?)
71023 +        */
71024 +       SMU_PWR_SERVER_ID               = 0x08,
71025 +};
71026 +
71027 +/* Power events wakeup bits */
71028 +enum {
71029 +       SMU_PWR_WAKEUP_KEY              = 0x01, /* Wake on key press */
71030 +       SMU_PWR_WAKEUP_AC_INSERT        = 0x02, /* Wake on AC adapter plug */
71031 +       SMU_PWR_WAKEUP_AC_CHANGE        = 0x04,
71032 +       SMU_PWR_WAKEUP_LID_OPEN         = 0x08,
71033 +       SMU_PWR_WAKEUP_RING             = 0x10,
71034 +};
71035 +
71036  
71037  /*
71038   * - Kernel side interface -
71039 @@ -564,13 +688,13 @@
71040  
71041         __u8            cmd;                    /* SMU command byte */
71042         __u8            pad[3];                 /* padding */
71043 -       __u32           data_len;               /* Lenght of data following */
71044 +       __u32           data_len;               /* Length of data following */
71045  };
71046  
71047  struct smu_user_reply_hdr
71048  {
71049         __u32           status;                 /* Command status */
71050 -       __u32           reply_len;              /* Lenght of data follwing */
71051 +       __u32           reply_len;              /* Length of data follwing */
71052  };
71053  
71054  #endif /*  _SMU_H */
71055 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/sparsemem.h powerpc.git/include/asm-powerpc/sparsemem.h
71056 --- linux-2.6.24/include/asm-powerpc/sparsemem.h        2008-01-24 23:58:37.000000000 +0100
71057 +++ powerpc.git/include/asm-powerpc/sparsemem.h 2008-01-28 20:26:42.000000000 +0100
71058 @@ -10,13 +10,8 @@
71059   */
71060  #define SECTION_SIZE_BITS       24
71061  
71062 -#if defined(CONFIG_PS3_USE_LPAR_ADDR)
71063 -#define MAX_PHYSADDR_BITS       47
71064 -#define MAX_PHYSMEM_BITS        47
71065 -#else
71066  #define MAX_PHYSADDR_BITS       44
71067  #define MAX_PHYSMEM_BITS        44
71068 -#endif
71069  
71070  #ifdef CONFIG_MEMORY_HOTPLUG
71071  extern void create_section_mapping(unsigned long start, unsigned long end);
71072 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/spu.h powerpc.git/include/asm-powerpc/spu.h
71073 --- linux-2.6.24/include/asm-powerpc/spu.h      2008-01-24 23:58:37.000000000 +0100
71074 +++ powerpc.git/include/asm-powerpc/spu.h       2008-01-28 20:26:42.000000000 +0100
71075 @@ -104,6 +104,7 @@
71076  
71077  struct spu_context;
71078  struct spu_runqueue;
71079 +struct spu_lscsa;
71080  struct device_node;
71081  
71082  enum spu_utilization_state {
71083 @@ -145,7 +146,6 @@
71084         void (* ibox_callback)(struct spu *spu);
71085         void (* stop_callback)(struct spu *spu);
71086         void (* mfc_callback)(struct spu *spu);
71087 -       void (* dma_callback)(struct spu *spu, int type);
71088  
71089         char irq_c0[8];
71090         char irq_c1[8];
71091 @@ -196,10 +196,11 @@
71092  extern struct cbe_spu_info cbe_spu_info[];
71093  
71094  void spu_init_channels(struct spu *spu);
71095 -int spu_irq_class_0_bottom(struct spu *spu);
71096 -int spu_irq_class_1_bottom(struct spu *spu);
71097  void spu_irq_setaffinity(struct spu *spu, int cpu);
71098  
71099 +void spu_setup_kernel_slbs(struct spu *spu, struct spu_lscsa *lscsa,
71100 +               void *code, int code_size);
71101 +
71102  #ifdef CONFIG_KEXEC
71103  void crash_register_spus(struct list_head *list);
71104  #else
71105 @@ -210,6 +211,7 @@
71106  
71107  extern void spu_invalidate_slbs(struct spu *spu);
71108  extern void spu_associate_mm(struct spu *spu, struct mm_struct *mm);
71109 +int spu_64k_pages_available(void);
71110  
71111  /* Calls from the memory management to the SPU */
71112  struct mm_struct;
71113 @@ -279,6 +281,8 @@
71114  int spu_add_sysdev_attr_group(struct attribute_group *attrs);
71115  void spu_remove_sysdev_attr_group(struct attribute_group *attrs);
71116  
71117 +int spu_handle_mm_fault(struct mm_struct *mm, unsigned long ea,
71118 +               unsigned long dsisr, unsigned *flt);
71119  
71120  /*
71121   * Notifier blocks:
71122 @@ -303,7 +307,7 @@
71123  extern void do_notify_spus_active(void);
71124  
71125  /*
71126 - * This defines the Local Store, Problem Area and Privlege Area of an SPU.
71127 + * This defines the Local Store, Problem Area and Privilege Area of an SPU.
71128   */
71129  
71130  union mfc_tag_size_class_cmd {
71131 @@ -524,8 +528,24 @@
71132  #define CLASS2_ENABLE_SPU_STOP_INTR                    0x2L
71133  #define CLASS2_ENABLE_SPU_HALT_INTR                    0x4L
71134  #define CLASS2_ENABLE_SPU_DMA_TAG_GROUP_COMPLETE_INTR  0x8L
71135 +#define CLASS2_ENABLE_MAILBOX_THRESHOLD_INTR           0x10L
71136         u8  pad_0x118_0x140[0x28];                              /* 0x118 */
71137         u64 int_stat_RW[3];                                     /* 0x140 */
71138 +#define CLASS0_DMA_ALIGNMENT_INTR                      0x1L
71139 +#define CLASS0_INVALID_DMA_COMMAND_INTR                        0x2L
71140 +#define CLASS0_SPU_ERROR_INTR                          0x4L
71141 +#define CLASS0_INTR_MASK                               0x7L
71142 +#define CLASS1_SEGMENT_FAULT_INTR                      0x1L
71143 +#define CLASS1_STORAGE_FAULT_INTR                      0x2L
71144 +#define CLASS1_LS_COMPARE_SUSPEND_ON_GET_INTR          0x4L
71145 +#define CLASS1_LS_COMPARE_SUSPEND_ON_PUT_INTR          0x8L
71146 +#define CLASS1_INTR_MASK                               0xfL
71147 +#define CLASS2_MAILBOX_INTR                            0x1L
71148 +#define CLASS2_SPU_STOP_INTR                           0x2L
71149 +#define CLASS2_SPU_HALT_INTR                           0x4L
71150 +#define CLASS2_SPU_DMA_TAG_GROUP_COMPLETE_INTR         0x8L
71151 +#define CLASS2_MAILBOX_THRESHOLD_INTR                  0x10L
71152 +#define CLASS2_INTR_MASK                               0x1fL
71153         u8  pad_0x158_0x180[0x28];                              /* 0x158 */
71154         u64 int_route_RW;                                       /* 0x180 */
71155  
71156 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/spu_csa.h powerpc.git/include/asm-powerpc/spu_csa.h
71157 --- linux-2.6.24/include/asm-powerpc/spu_csa.h  2008-01-24 23:58:37.000000000 +0100
71158 +++ powerpc.git/include/asm-powerpc/spu_csa.h   2008-01-28 20:26:42.000000000 +0100
71159 @@ -194,7 +194,7 @@
71160  };
71161  
71162  /*
71163 - * struct spu_priv2_collapsed - condensed priviliged 2 area, w/o pads.
71164 + * struct spu_priv2_collapsed - condensed privileged 2 area, w/o pads.
71165   */
71166  struct spu_priv2_collapsed {
71167         u64 slb_index_W;
71168 @@ -254,20 +254,11 @@
71169         u64 spu_chnldata_RW[32];
71170         u32 spu_mailbox_data[4];
71171         u32 pu_mailbox_data[1];
71172 -       u64 dar, dsisr;
71173 +       u64 dar, dsisr, class_0_pending;
71174         unsigned long suspend_time;
71175         spinlock_t register_lock;
71176  };
71177  
71178 -extern int spu_init_csa(struct spu_state *csa);
71179 -extern void spu_fini_csa(struct spu_state *csa);
71180 -extern int spu_save(struct spu_state *prev, struct spu *spu);
71181 -extern int spu_restore(struct spu_state *new, struct spu *spu);
71182 -extern int spu_switch(struct spu_state *prev, struct spu_state *new,
71183 -                     struct spu *spu);
71184 -extern int spu_alloc_lscsa(struct spu_state *csa);
71185 -extern void spu_free_lscsa(struct spu_state *csa);
71186 -
71187  #endif /* !__SPU__ */
71188  #endif /* __KERNEL__ */
71189  #endif /* !__ASSEMBLY__ */
71190 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/spu_priv1.h powerpc.git/include/asm-powerpc/spu_priv1.h
71191 --- linux-2.6.24/include/asm-powerpc/spu_priv1.h        2008-01-24 23:58:37.000000000 +0100
71192 +++ powerpc.git/include/asm-powerpc/spu_priv1.h 2008-01-28 20:26:42.000000000 +0100
71193 @@ -24,6 +24,7 @@
71194  #include <linux/types.h>
71195  
71196  struct spu;
71197 +struct spu_context;
71198  
71199  /* access to priv1 registers */
71200  
71201 @@ -178,6 +179,8 @@
71202         int (*enumerate_spus)(int (*fn)(void *data));
71203         int (*create_spu)(struct spu *spu, void *data);
71204         int (*destroy_spu)(struct spu *spu);
71205 +       void (*enable_spu)(struct spu_context *ctx);
71206 +       void (*disable_spu)(struct spu_context *ctx);
71207         int (*init_affinity)(void);
71208  };
71209  
71210 @@ -207,6 +210,18 @@
71211         return spu_management_ops->init_affinity();
71212  }
71213  
71214 +static inline void
71215 +spu_enable_spu (struct spu_context *ctx)
71216 +{
71217 +       spu_management_ops->enable_spu(ctx);
71218 +}
71219 +
71220 +static inline void
71221 +spu_disable_spu (struct spu_context *ctx)
71222 +{
71223 +       spu_management_ops->disable_spu(ctx);
71224 +}
71225 +
71226  /*
71227   * The declarations folowing are put here for convenience
71228   * and only intended to be used by the platform setup code.
71229 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/system.h powerpc.git/include/asm-powerpc/system.h
71230 --- linux-2.6.24/include/asm-powerpc/system.h   2008-01-24 23:58:37.000000000 +0100
71231 +++ powerpc.git/include/asm-powerpc/system.h    2008-01-28 20:26:42.000000000 +0100
71232 @@ -169,6 +169,8 @@
71233  extern void bad_page_fault(struct pt_regs *, unsigned long, int);
71234  extern int die(const char *, struct pt_regs *, long);
71235  extern void _exception(int, struct pt_regs *, int, unsigned long);
71236 +extern void _nmask_and_or_msr(unsigned long nmask, unsigned long or_val);
71237 +
71238  #ifdef CONFIG_BOOKE_WDT
71239  extern u32 booke_wdt_enabled;
71240  extern u32 booke_wdt_period;
71241 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-powerpc/udbg.h powerpc.git/include/asm-powerpc/udbg.h
71242 --- linux-2.6.24/include/asm-powerpc/udbg.h     2008-01-24 23:58:37.000000000 +0100
71243 +++ powerpc.git/include/asm-powerpc/udbg.h      2008-01-28 20:26:42.000000000 +0100
71244 @@ -48,6 +48,7 @@
71245  extern void __init udbg_init_debug_beat(void);
71246  extern void __init udbg_init_btext(void);
71247  extern void __init udbg_init_44x_as1(void);
71248 +extern void __init udbg_init_40x_realmode(void);
71249  extern void __init udbg_init_cpm(void);
71250  
71251  #endif /* __KERNEL__ */
71252 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-ppc/8xx_immap.h powerpc.git/include/asm-ppc/8xx_immap.h
71253 --- linux-2.6.24/include/asm-ppc/8xx_immap.h    2008-01-24 23:58:37.000000000 +0100
71254 +++ powerpc.git/include/asm-ppc/8xx_immap.h     2008-01-28 20:26:42.000000000 +0100
71255 @@ -123,7 +123,7 @@
71256  #define OR_G5LA                0x00000400      /* Output #GPL5 on #GPL_A5              */
71257  #define OR_G5LS                0x00000200      /* Drive #GPL high on falling edge of...*/
71258  #define OR_BI          0x00000100      /* Burst inhibit                        */
71259 -#define OR_SCY_MSK     0x000000f0      /* Cycle Lenght in Clocks               */
71260 +#define OR_SCY_MSK     0x000000f0      /* Cycle Length in Clocks               */
71261  #define OR_SCY_0_CLK   0x00000000      /* 0 clock cycles wait states           */
71262  #define OR_SCY_1_CLK   0x00000010      /* 1 clock cycles wait states           */
71263  #define OR_SCY_2_CLK   0x00000020      /* 2 clock cycles wait states           */
71264 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-ppc/commproc.h powerpc.git/include/asm-ppc/commproc.h
71265 --- linux-2.6.24/include/asm-ppc/commproc.h     2008-01-24 23:58:37.000000000 +0100
71266 +++ powerpc.git/include/asm-ppc/commproc.h      2008-01-28 20:26:42.000000000 +0100
71267 @@ -681,7 +681,7 @@
71268  #define        CICR_SCC_SCC3           ((uint)0x00200000)      /* SCC3 @ SCCc */
71269  #define        CICR_SCB_SCC2           ((uint)0x00040000)      /* SCC2 @ SCCb */
71270  #define        CICR_SCA_SCC1           ((uint)0x00000000)      /* SCC1 @ SCCa */
71271 -#define CICR_IRL_MASK          ((uint)0x0000e000)      /* Core interrrupt */
71272 +#define CICR_IRL_MASK          ((uint)0x0000e000)      /* Core interrupt */
71273  #define CICR_HP_MASK           ((uint)0x00001f00)      /* Hi-pri int. */
71274  #define CICR_IEN               ((uint)0x00000080)      /* Int. enable */
71275  #define CICR_SPS               ((uint)0x00000001)      /* SCC Spread */
71276 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-ppc/mmu.h powerpc.git/include/asm-ppc/mmu.h
71277 --- linux-2.6.24/include/asm-ppc/mmu.h  2008-01-24 23:58:37.000000000 +0100
71278 +++ powerpc.git/include/asm-ppc/mmu.h   2008-01-28 20:26:43.000000000 +0100
71279 @@ -383,6 +383,12 @@
71280  #define BOOKE_PAGESZ_256GB     14
71281  #define BOOKE_PAGESZ_1TB       15
71282  
71283 +#ifndef CONFIG_SERIAL_TEXT_DEBUG
71284 +#define PPC44x_EARLY_TLBS      1
71285 +#else
71286 +#define PPC44x_EARLY_TLBS      2
71287 +#endif
71288 +
71289  /*
71290   * Freescale Book-E MMU support
71291   */
71292 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-ppc/mpc52xx_psc.h powerpc.git/include/asm-ppc/mpc52xx_psc.h
71293 --- linux-2.6.24/include/asm-ppc/mpc52xx_psc.h  2008-01-24 23:58:37.000000000 +0100
71294 +++ powerpc.git/include/asm-ppc/mpc52xx_psc.h   2008-01-28 20:26:43.000000000 +0100
71295 @@ -159,6 +159,9 @@
71296         u8              reserved16[3];
71297         u8              irfdr;          /* PSC + 0x54 */
71298         u8              reserved17[3];
71299 +};
71300 +
71301 +struct mpc52xx_psc_fifo {
71302         u16             rfnum;          /* PSC + 0x58 */
71303         u16             reserved18;
71304         u16             tfnum;          /* PSC + 0x5c */
71305 diff -x .git -x .gitignore -Nur linux-2.6.24/include/asm-ppc/reg_booke.h powerpc.git/include/asm-ppc/reg_booke.h
71306 --- linux-2.6.24/include/asm-ppc/reg_booke.h    2008-01-24 23:58:37.000000000 +0100
71307 +++ powerpc.git/include/asm-ppc/reg_booke.h     2008-01-28 20:26:43.000000000 +0100
71308 @@ -207,7 +207,7 @@
71309  #define        CCR1_TCS        0x00000080 /* Timer Clock Select */
71310  
71311  /* Bit definitions for the MCSR. */
71312 -#ifdef CONFIG_440A
71313 +#ifdef CONFIG_4xx
71314  #define MCSR_MCS       0x80000000 /* Machine Check Summary */
71315  #define MCSR_IB                0x40000000 /* Instruction PLB Error */
71316  #define MCSR_DRB       0x20000000 /* Data Read PLB Error */
71317 @@ -283,7 +283,7 @@
71318  #define ESR_IMCB       0x20000000      /* Instr. Machine Check - Bus error */
71319  #define ESR_IMCT       0x10000000      /* Instr. Machine Check - Timeout */
71320  #define ESR_PIL                0x08000000      /* Program Exception - Illegal */
71321 -#define ESR_PPR                0x04000000      /* Program Exception - Priveleged */
71322 +#define ESR_PPR                0x04000000      /* Program Exception - Privileged */
71323  #define ESR_PTR                0x02000000      /* Program Exception - Trap */
71324  #define ESR_FP         0x01000000      /* Floating Point Operation */
71325  #define ESR_DST                0x00800000      /* Storage Exception - Data miss */
71326 diff -x .git -x .gitignore -Nur linux-2.6.24/include/linux/of.h powerpc.git/include/linux/of.h
71327 --- linux-2.6.24/include/linux/of.h     2008-01-24 23:58:37.000000000 +0100
71328 +++ powerpc.git/include/linux/of.h      2008-01-28 20:26:44.000000000 +0100
71329 @@ -17,6 +17,7 @@
71330   */
71331  #include <linux/types.h>
71332  #include <linux/bitops.h>
71333 +#include <linux/mod_devicetable.h>
71334  
71335  #include <asm/prom.h>
71336  
71337 @@ -41,11 +42,20 @@
71338  #define for_each_compatible_node(dn, type, compatible) \
71339         for (dn = of_find_compatible_node(NULL, type, compatible); dn; \
71340              dn = of_find_compatible_node(dn, type, compatible))
71341 +extern struct device_node *of_find_matching_node(struct device_node *from,
71342 +       const struct of_device_id *matches);
71343 +#define for_each_matching_node(dn, matches) \
71344 +       for (dn = of_find_matching_node(NULL, matches); dn; \
71345 +            dn = of_find_matching_node(dn, matches))
71346  extern struct device_node *of_find_node_by_path(const char *path);
71347  extern struct device_node *of_find_node_by_phandle(phandle handle);
71348  extern struct device_node *of_get_parent(const struct device_node *node);
71349  extern struct device_node *of_get_next_child(const struct device_node *node,
71350                                              struct device_node *prev);
71351 +#define for_each_child_of_node(parent, child) \
71352 +       for (child = of_get_next_child(parent, NULL); child != NULL; \
71353 +            child = of_get_next_child(parent, child))
71354 +
71355  extern struct property *of_find_property(const struct device_node *np,
71356                                          const char *name,
71357                                          int *lenp);
71358 @@ -56,5 +66,7 @@
71359                                 int *lenp);
71360  extern int of_n_addr_cells(struct device_node *np);
71361  extern int of_n_size_cells(struct device_node *np);
71362 +extern const struct of_device_id *of_match_node(
71363 +       const struct of_device_id *matches, const struct device_node *node);
71364  
71365  #endif /* _LINUX_OF_H */
71366 diff -x .git -x .gitignore -Nur linux-2.6.24/include/linux/of_device.h powerpc.git/include/linux/of_device.h
71367 --- linux-2.6.24/include/linux/of_device.h      2008-01-24 23:58:37.000000000 +0100
71368 +++ powerpc.git/include/linux/of_device.h       2008-01-28 20:26:44.000000000 +0100
71369 @@ -10,8 +10,6 @@
71370  
71371  #define        to_of_device(d) container_of(d, struct of_device, dev)
71372  
71373 -extern const struct of_device_id *of_match_node(
71374 -       const struct of_device_id *matches, const struct device_node *node);
71375  extern const struct of_device_id *of_match_device(
71376         const struct of_device_id *matches, const struct of_device *dev);
71377  
71378 diff -x .git -x .gitignore -Nur linux-2.6.24/include/linux/pata_platform.h powerpc.git/include/linux/pata_platform.h
71379 --- linux-2.6.24/include/linux/pata_platform.h  2008-01-24 23:58:37.000000000 +0100
71380 +++ powerpc.git/include/linux/pata_platform.h   2008-01-28 20:26:44.000000000 +0100
71381 @@ -15,4 +15,13 @@
71382         unsigned int irq_flags;
71383  };
71384  
71385 +extern int __devinit __pata_platform_probe(struct device *dev,
71386 +                                          struct resource *io_res,
71387 +                                          struct resource *ctl_res,
71388 +                                          struct resource *irq_res,
71389 +                                          unsigned int ioport_shift,
71390 +                                          int __pio_mask);
71391 +
71392 +extern int __devexit __pata_platform_remove(struct device *dev);
71393 +
71394  #endif /* __LINUX_PATA_PLATFORM_H */
71395 diff -x .git -x .gitignore -Nur linux-2.6.24/include/linux/phy_fixed.h powerpc.git/include/linux/phy_fixed.h
71396 --- linux-2.6.24/include/linux/phy_fixed.h      2008-01-24 23:58:37.000000000 +0100
71397 +++ powerpc.git/include/linux/phy_fixed.h       2008-01-28 20:26:44.000000000 +0100
71398 @@ -1,38 +1,31 @@
71399  #ifndef __PHY_FIXED_H
71400  #define __PHY_FIXED_H
71401  
71402 -#define MII_REGS_NUM   29
71403 -
71404 -/* max number of virtual phy stuff */
71405 -#define MAX_PHY_AMNT   10
71406 -/*
71407 -    The idea is to emulate normal phy behavior by responding with
71408 -    pre-defined values to mii BMCR read, so that read_status hook could
71409 -    take all the needed info.
71410 -*/
71411 -
71412  struct fixed_phy_status {
71413 -       u8 link;
71414 -       u16 speed;
71415 -       u8 duplex;
71416 +       int link;
71417 +       int speed;
71418 +       int duplex;
71419 +       int pause;
71420 +       int asym_pause;
71421  };
71422  
71423 -/*-----------------------------------------------------------------------------
71424 - *  Private information hoder for mii_bus
71425 - *-----------------------------------------------------------------------------*/
71426 -struct fixed_info {
71427 -       u16 *regs;
71428 -       u8 regs_num;
71429 -       struct fixed_phy_status phy_status;
71430 -       struct phy_device *phydev;      /* pointer to the container */
71431 -       /* link & speed cb */
71432 -       int (*link_update) (struct net_device *, struct fixed_phy_status *);
71433 +#ifdef CONFIG_FIXED_PHY
71434 +extern int fixed_phy_add(unsigned int irq, int phy_id,
71435 +                        struct fixed_phy_status *status);
71436 +#else
71437 +static inline int fixed_phy_add(unsigned int irq, int phy_id,
71438 +                               struct fixed_phy_status *status)
71439 +{
71440 +       return -ENODEV;
71441 +}
71442 +#endif /* CONFIG_FIXED_PHY */
71443  
71444 -};
71445 -
71446 -
71447 -int fixed_mdio_set_link_update(struct phy_device *,
71448 -       int (*link_update) (struct net_device *, struct fixed_phy_status *));
71449 -struct fixed_info *fixed_mdio_get_phydev (int phydev_ind);
71450 +/*
71451 + * This function issued only by fixed_phy-aware drivers, no need
71452 + * protect it with #ifdef
71453 + */
71454 +extern int fixed_phy_set_link_update(struct phy_device *phydev,
71455 +                       int (*link_update)(struct net_device *,
71456 +                                          struct fixed_phy_status *));
71457  
71458  #endif /* __PHY_FIXED_H */
71459 diff -x .git -x .gitignore -Nur linux-2.6.24/include/linux/pmu.h powerpc.git/include/linux/pmu.h
71460 --- linux-2.6.24/include/linux/pmu.h    2008-01-24 23:58:37.000000000 +0100
71461 +++ powerpc.git/include/linux/pmu.h     2008-01-28 20:26:44.000000000 +0100
71462 @@ -159,41 +159,7 @@
71463  extern int pmu_present(void);
71464  extern int pmu_get_model(void);
71465  
71466 -#ifdef CONFIG_PM
71467 -/*
71468 - * Stuff for putting the powerbook to sleep and waking it again.
71469 - *
71470 - */
71471 -#include <linux/list.h>
71472 -
71473 -struct pmu_sleep_notifier
71474 -{
71475 -       void (*notifier_call)(struct pmu_sleep_notifier *self, int when);
71476 -       int priority;
71477 -       struct list_head list;
71478 -};
71479 -
71480 -/* Code values for calling sleep/wakeup handlers
71481 - */
71482 -#define PBOOK_SLEEP_REQUEST    1
71483 -#define PBOOK_SLEEP_NOW                2
71484 -#define PBOOK_WAKE             3
71485 -
71486 -/* priority levels in notifiers */
71487 -#define SLEEP_LEVEL_VIDEO      100     /* Video driver (first wake) */
71488 -#define SLEEP_LEVEL_MEDIABAY   90      /* Media bay driver */
71489 -#define SLEEP_LEVEL_BLOCK      80      /* IDE, SCSI */
71490 -#define SLEEP_LEVEL_NET                70      /* bmac, gmac */
71491 -#define SLEEP_LEVEL_MISC       60      /* Anything else */
71492 -#define SLEEP_LEVEL_USERLAND   55      /* Reserved for apm_emu */
71493 -#define SLEEP_LEVEL_ADB                50      /* ADB (async) */
71494 -#define SLEEP_LEVEL_SOUND      40      /* Sound driver (blocking) */
71495 -
71496 -/* special register notifier functions */
71497 -int pmu_register_sleep_notifier(struct pmu_sleep_notifier* notifier);
71498 -int pmu_unregister_sleep_notifier(struct pmu_sleep_notifier* notifier);
71499 -
71500 -#endif /* CONFIG_PM */
71501 +extern void pmu_backlight_set_sleep(int sleep);
71502  
71503  #define PMU_MAX_BATTERIES      2
71504