LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] Remove unnecessary loops_per_jiffy initialization code
From: Jon Loeliger @ 2007-07-27 18:23 UTC (permalink / raw)
  To: linuxppc-dev@ozlabs.org

This patch series removes lingering jiffies initialization
code from several platforms.  Note that the first patch in
this series for the 86xx has been rebased to current top of
Paul's repository and replaces an earlier version.


 arch/powerpc/platforms/52xx/lite5200.c         |   13 ++-----------
 arch/powerpc/platforms/85xx/mpc85xx_ads.c      |   13 -------------
 arch/powerpc/platforms/85xx/mpc85xx_cds.c      |   13 -------------
 arch/powerpc/platforms/85xx/mpc85xx_mds.c      |   11 -----------
 arch/powerpc/platforms/86xx/mpc86xx_hpcn.c     |   14 ++------------
 arch/powerpc/platforms/8xx/mpc86xads_setup.c   |   14 --------------
 arch/powerpc/platforms/8xx/mpc885ads_setup.c   |   14 --------------
 arch/powerpc/platforms/embedded6xx/holly.c     |   12 ------------
 arch/powerpc/platforms/embedded6xx/prpmc2800.c |    7 -------
 9 files changed, 4 insertions(+), 107 deletions(-)

^ permalink raw reply

* Re: a question about mpc8xx linux
From: Scott Wood @ 2007-07-27 17:56 UTC (permalink / raw)
  To: Scott Wood; +Cc: poorbeyond, Linux-ppc mail list
In-Reply-To: <46AA3127.4060806@freescale.com>

Scott Wood wrote:
> poorbeyond wrote:
> 
>>my cpu is MPC860, use u-boot-1.1.4, linux-2.6.20.14
>>
>>i use the "tftp 300000 uImage" command download kernel image,
>>
>>then use the "bootm 300000" command boot the image.
> 
> 
> You'll need either a device-tree-aware u-boot or 8xx cuImage support; 
> you can get the latter from the patchset I posted recently.

Sorry, I missed that you're using arch/ppc rather than arch/powerpc.

arch/ppc doesn't require a device tree, though it would be good to 
switch to arch/powerpc once my 8xx fixes go in -- arch/ppc is deprecated.

-Scott

^ permalink raw reply

* Re: a question about mpc8xx linux
From: Scott Wood @ 2007-07-27 17:53 UTC (permalink / raw)
  To: poorbeyond; +Cc: Linux-ppc mail list
In-Reply-To: <200707272111187341027@163.com>

poorbeyond wrote:
> my cpu is MPC860, use u-boot-1.1.4, linux-2.6.20.14
> 
> i use the "tftp 300000 uImage" command download kernel image,
> 
> then use the "bootm 300000" command boot the image.

You'll need either a device-tree-aware u-boot or 8xx cuImage support; 
you can get the latter from the patchset I posted recently.

> i found the bootm cmd entered the /arch/ppc/kernel/head_8xx.s, stop at the instruction "rfi".
> is it right? after the instruction, where does the code go normally ? what should i do now?

The rfi transfers control to start_here:

-Scott

^ permalink raw reply

* Re: pq2fads support...
From: Scott Wood @ 2007-07-27 17:45 UTC (permalink / raw)
  To: Alexandros Kostopoulos; +Cc: linuxppc-dev
In-Reply-To: <op.tv4vfiaunhx3hy@phoenix>

Alexandros Kostopoulos wrote:
> Thanks for your reply, Scott,
> 
> one question though: I am NOT using the bootwrapper, I'm instead 
> feeding  dtb and uImage directly to u-boot. This probably means that
> I should fill  in lots of stuff manually into dts, right?

No, u-boot should fill in the same stuff.  It may require the empty
fields to be there, though (it definitely requires it if you're using
the old, non-libfdt code -- if you are, you should also remove the 
/chosen node, or else you'll get two of them).

> But, (and please forgive my  ignorance) who does actually fill in
> stuff (like e.g. clock-frequency or  bus-frequency), except, of
> course, from the trivial modifications u-boot  does to dtb? The
> wrapper script seems to do nothing more that simply  running dtc on
> dts.

In the bootwrapper case, it's the code in cuboot-pq2.c and devtree.c. 
In the no-bootwrapper case, it's u-boot.

-Scott

^ permalink raw reply

* Re: pq2fads support...
From: Alexandros Kostopoulos @ 2007-07-27 17:12 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev
In-Reply-To: <20070727163529.GA26893@ld0162-tx32.am.freescale.net>

Thanks for your reply, Scott,

one question though: I am NOT using the bootwrapper, I'm instead feeding  
dtb and uImage directly to u-boot. This probably means that I should fill  
in lots of stuff manually into dts, right? But, (and please forgive my  
ignorance) who does actually fill in stuff (like e.g. clock-frequency or  
bus-frequency), except, of course, from the trivial modifications u-boot  
does to dtb? The wrapper script seems to do nothing more that simply  
running dtc on dts.

Thanks again

Alex

On Fri, 27 Jul 2007 19:35:29 +0300, Scott Wood <scottwood@freescale.com>  
wrote:

> On Fri, Jul 27, 2007 at 03:24:08PM +0300, Alexandros Kostopoulos wrote:
>> In your patch for the pq2fads support, the device tree seems to be  
>> missing
>> a memory node, for which dtc complains loudly. Is this board tested to
>> boot with these patches (because I'm now using this as a template for my
>> board - with your patchset applied to Paul's git)
>
> Sorry about that -- dtc complains about a lot of silly things, falsely
> assuming that the result is intended to be a complete tree ready for
> passing to Linux (which is rarely true).  I'd been running with a patch
> to remove some of those checks, but it got rejected, and I forgot to
> stick the templates back into the dts.
>
> The next patchset will have a dts that works with current dtc; in the
> meantime, you can add the -f flag to dtc in arch/powerpc/boot/wrapper, or
> add the missing nodes based on the mpc8272ads device tree (the actual
> information will be filled in by the bootwrapper).
>
>> PS. What's about this new cpm-serial driver? is this supposed to be a
>> replacement for cpm_uart?
>
> No, it's a minimal driver for the bootwrapper.
>
> -Scott

^ permalink raw reply

* Re: [RFC][PATCH] MPC832x_RDB: update dts to use spi, register mmc_spi stub
From: Scott Wood @ 2007-07-27 16:40 UTC (permalink / raw)
  To: Anton Vorontsov; +Cc: linuxppc-dev
In-Reply-To: <20070727114559.GB11463@localhost.localdomain>

On Fri, Jul 27, 2007 at 03:45:59PM +0400, Anton Vorontsov wrote:
> Sure, technically nothing prevents this. But, QE specs names
> SPIs by these ids. Plus, from the kernel side spi name will be
> not pretty, it will be spi1216.1. Reg value making little sense
> to the userspace (or kernel-side SPI layer). Still want get
> rid of device-id?

Naming devices for human consumption is a more general problem than
device-id addresses; I'd like to see a standard "label" property added to
the device tree spec that software could use to present a human-friendly
label that corresponds to markings on the case, position on the board,
etc.

-Scott

^ permalink raw reply

* Re: pq2fads support...
From: Scott Wood @ 2007-07-27 16:35 UTC (permalink / raw)
  To: Alexandros Kostopoulos; +Cc: linuxppc-dev
In-Reply-To: <op.tv4h01apnhx3hy@phoenix>

On Fri, Jul 27, 2007 at 03:24:08PM +0300, Alexandros Kostopoulos wrote:
> In your patch for the pq2fads support, the device tree seems to be missing  
> a memory node, for which dtc complains loudly. Is this board tested to  
> boot with these patches (because I'm now using this as a template for my  
> board - with your patchset applied to Paul's git)

Sorry about that -- dtc complains about a lot of silly things, falsely
assuming that the result is intended to be a complete tree ready for
passing to Linux (which is rarely true).  I'd been running with a patch
to remove some of those checks, but it got rejected, and I forgot to
stick the templates back into the dts.

The next patchset will have a dts that works with current dtc; in the
meantime, you can add the -f flag to dtc in arch/powerpc/boot/wrapper, or
add the missing nodes based on the mpc8272ads device tree (the actual
information will be filled in by the bootwrapper).

> PS. What's about this new cpm-serial driver? is this supposed to be a  
> replacement for cpm_uart?

No, it's a minimal driver for the bootwrapper.

-Scott

^ permalink raw reply

* Re: [PATCH] fix ppc kernels after build-id addition
From: Meelis Roos @ 2007-07-27 15:01 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, Linux Kernel list
In-Reply-To: <18088.10923.67233.336636@cargo.ozlabs.ibm.com>

> > This patch fixes arch/ppc kernels, at least for prep subarch, after 
> > build-id addition. Without the patch, kernels were 3 times the size and 
> > bootloader refused to load them. Now they are back to normal again.
> 
> I just built an ARCH=ppc kernel for the prep subarch and the vmlinux
> size was normal.  Can you identify exactly why the kernels got so much
> bigger, i.e. what is taking up all the space?

Now I got the previous patches tested and got to this one. Retested with 
fresh git (build-id patch already applied) and latest Debian unstable 
(binutils package 2.17cvs20070718-1, GNU ld (GNU Binutils for Debian) 
2.17.50.20070718).

size -A vmlinux yields the same results (module notes section) and is 
roughly the same size:

vmlinux  :
section                      size         addr
.note.gnu.build-id             36          180
.text                     2399820   3221225472
.rodata                    378440   3223625728
.pci_fixup                   1448   3224004168
__ksymtab                   18376   3224005616
__ksymtab_gpl                4600   3224023992
__ksymtab_strings           53334   3224028592
__param                      1600   3224081928
__ex_table                  11096   3224084480
__bug_table                 18276   3224095576
.data                      126504   3224117248
.data.page_aligned          12288   3224244224
.data.read_mostly            5468   3224256512
.data.cacheline_aligned       256   3224264704
.data.init_task              8192   3224272896
.init.text                 103668   3224281088
.exit.text                   2964   3224384768
.init.data                  21516   3224387732
.init.setup                   684   3224409248
.initcall.init                556   3224409932
.con_initcall.init              8   3224410488
__ftr_fixup                   544   3224410496
.bss                       198296   3224412160
.stab                        1236            0
.stabstr                     1783            0
.comment                    34278            0
Total                     3405267

The differneces come in under arc/ppc/boot/images.
Without the patch:

-rwxr-xr-x 1 mroos mroos    4654112 2007-07-27 17:20 zImage.bugboot
-rwxr-xr-x 1 mroos mroos    4719626 2007-07-27 17:20 zImage.elf
-rwxr-xr-x 1 mroos mroos    4655114 2007-07-27 17:20 zImage.prep
-rw-r--r-- 1 mroos mroos 3224410860 2007-07-27 17:00 vmlinux.bin
-rw-r--r-- 1 mroos mroos    4604269 2007-07-27 17:14 vmlinux.gz

With the patch:

-rwxr-xr-x 1 mroos mroos 1528864 2007-07-27 02:01 zImage.bugboot
-rwxr-xr-x 1 mroos mroos 1594378 2007-07-27 02:01 zImage.elf
-rwxr-xr-x 1 mroos mroos 1529866 2007-07-27 02:01 zImage.prep
-rwxr-xr-x 1 mroos mroos 3189664 2007-07-27 01:31 vmlinux.bin
-rw-r--r-- 1 mroos mroos 1476643 2007-07-27 01:31 vmlinux.gz

Without the patch, vmlinux.bin is ... huge. However, only zImage.elf is 
easily measurable with size.

size -A arch/ppc/boot/images/zImage.elf (without patch):
section      size       addr
.text     24964    8388608
.data   4620288    8417280
.bss      35660   13037568
Total   4680912

size -A arch/ppc/boot/images/zImage.elf (with patch): 
section      size      addr
.text     24964   8388608
.data   1495040   8417280
.bss      35660   9912320
Total   1555664

It seems the differences come in in .data section.

objdump -t -j .data arch/ppc/boot/images/zImage.elf (without patch):

arch/ppc/boot/images/zImage.elf:     file format elf32-powerpc

SYMBOL TABLE:
00807000 l    d  .data	00000000 .data
00808f38 l     O .data	00000130 rs_table
008090dc l     O .data	00000026 order.2247
00809182 l     O .data	00000800 lenfix.2194
00809102 l     O .data	00000080 distfix.2195
008099c2 l     O .data	00000040 dbase.2118
00809982 l     O .data	00000040 dext.2119
00809a40 l     O .data	0000003e lbase.2116
00809a02 l     O .data	0000003e lext.2117
008089d0 l     O .data	00000004 key_pending
00809ab0 l     O .data	00000ff0 font
00807634 g     O .data	00000200 ctrl_map
00807434 g     O .data	00000200 altgr_map
00c6efb5 g       .data	00000000 __image_end
00808db0 g     O .data	00000015 AC
00808dc8 g     O .data	000000c0 PCI_slots
00808e88 g     O .data	00000004 cmd_line
00807a34 g     O .data	00000200 alt_map
0080ae48 g       .data	00000000 __image_begin
00808ea0 g     O .data	00000004 orig_y
00c6f000 g       .data	00000000 __ramdisk_begin
00808e9c g     O .data	00000004 cols
00808234 g     O .data	00000099 func_buf
00808e90 g     O .data	00000004 hold_residual
00807c34 g     O .data	00000200 ctrl_alt_map
00808eac g     O .data	00000004 funcbufsize
00808eb0 g     O .data	00000004 accent_table_size
00808e8c g     O .data	00000004 keyb_present
00808ea8 g     O .data	00000004 funcbufptr
00807e34 g     O .data	00000400 key_maps
00808e94 g     O .data	00000004 vidmem
00808ea4 g     O .data	00000004 keymap_count
008089d4 g     O .data	000000dc GenVgaTextRegs
00807834 g     O .data	00000200 shift_ctrl_map
00807034 g     O .data	00000200 plain_map
0080702f g       .data	00000000 timebase_period_ns
00c6f000 g       .data	00000000 __ramdisk_end
008082d0 g     O .data	00000400 func_table
00807234 g     O .data	00000200 shift_map
008086d0 g     O .data	00000300 accent_table
00808ab0 g     O .data	00000300 TextCLUT
00807000 g     O .data	0000002f cmd_preset
00808e98 g     O .data	00000004 lines

objdump -t -j .data arch/ppc/boot/images/zImage.elf (with patch):

/home/mroos/kraam/linux-2.6/arch/ppc/boot/images/zImage.elf:     file format elf32-powerpc

SYMBOL TABLE:
00807000 l    d  .data	00000000 .data
00808f38 l     O .data	00000130 rs_table
008090dc l     O .data	00000026 order.2247
00809182 l     O .data	00000800 lenfix.2194
00809102 l     O .data	00000080 distfix.2195
008099c2 l     O .data	00000040 dbase.2118
00809982 l     O .data	00000040 dext.2119
00809a40 l     O .data	0000003e lbase.2116
00809a02 l     O .data	0000003e lext.2117
008089d0 l     O .data	00000004 key_pending
00809ab0 l     O .data	00000ff0 font
00807634 g     O .data	00000200 ctrl_map
00807434 g     O .data	00000200 altgr_map
0097366b g       .data	00000000 __image_end
00808db0 g     O .data	00000015 AC
00808dc8 g     O .data	000000c0 PCI_slots
00808e88 g     O .data	00000004 cmd_line
00807a34 g     O .data	00000200 alt_map
0080ae48 g       .data	00000000 __image_begin
00808ea0 g     O .data	00000004 orig_y
00974000 g       .data	00000000 __ramdisk_begin
00808e9c g     O .data	00000004 cols
00808234 g     O .data	00000099 func_buf
00808e90 g     O .data	00000004 hold_residual
00807c34 g     O .data	00000200 ctrl_alt_map
00808eac g     O .data	00000004 funcbufsize
00808eb0 g     O .data	00000004 accent_table_size
00808e8c g     O .data	00000004 keyb_present
00808ea8 g     O .data	00000004 funcbufptr
00807e34 g     O .data	00000400 key_maps
00808e94 g     O .data	00000004 vidmem
00808ea4 g     O .data	00000004 keymap_count
008089d4 g     O .data	000000dc GenVgaTextRegs
00807834 g     O .data	00000200 shift_ctrl_map
00807034 g     O .data	00000200 plain_map
0080702f g       .data	00000000 timebase_period_ns
00974000 g       .data	00000000 __ramdisk_end
008082d0 g     O .data	00000400 func_table
00807234 g     O .data	00000200 shift_map
008086d0 g     O .data	00000300 accent_table
00808ab0 g     O .data	00000300 TextCLUT
00807000 g     O .data	0000002f cmd_preset
00808e98 g     O .data	00000004 lines

The only differences are __image_end, __ramdisk_begin and __ramdisk_end.

What more to look at?

-- 
Meelis Roos (mroos@linux.ee)

^ permalink raw reply

* Re: [RFC][PATCH] MPC832x_RDB: update dts to use spi, register mmc_spi stub
From: Kumar Gala @ 2007-07-27 13:55 UTC (permalink / raw)
  To: avorontsov; +Cc: linuxppc-dev
In-Reply-To: <20070727114559.GB11463@localhost.localdomain>


On Jul 27, 2007, at 6:45 AM, Anton Vorontsov wrote:

> On Fri, Jul 27, 2007 at 03:14:06AM -0500, Kumar Gala wrote:
>>
>> On Jul 26, 2007, at 8:57 AM, Anton Vorontsov wrote:
> [...]
>>>
>>> @@ -207,20 +222,36 @@
>>>
>>>  		spi@4c0 {
>>>  			device_type = "spi";
>>> +			device-id = <1>;
>>
>> Can we just use the reg value for bus_num in the kernel.
>
> Sure, technically nothing prevents this. But, QE specs names
> SPIs by these ids. Plus, from the kernel side spi name will be
> not pretty, it will be spi1216.1. Reg value making little sense
> to the userspace (or kernel-side SPI layer). Still want get
> rid of device-id?
>
>>>  			compatible = "fsl_spi";
>>>  			reg = <4c0 40>;
>>>  			interrupts = <2>;
>>>  			interrupt-parent = <&qeic>;
>>> -			mode = "cpu";
>>> +			mode = "qe";
>>> +			sysclk = <5f5e100>; /* 100000000 Hz */
>>
>> we don't need this in the spi node, its just the system clock  
>> frequency
>> which we can get other ways.
>
> Will try, I guess "bus-frequency" property of soc8323 is what I need.
>
>>> +			max-chipselect = <1>;
>>
>> I'm not sure how I feel about this in here, I'm thinking it should  
>> go.
>
> It's board-specific, i.e. how much chips connected to this SPI bus.
> SPI layer needs this. Otherwise I have to pass it from board file,
> but isn't it fits nicely in the DT?
>
>>> +			pio-handle = <&spi1pio>;
>>> +
>>> +			mmc@01 {
>>> +				device_type = "mmc";
>>> +				compatible = "mmc-spi";
>>> +				device-id = <1>;
>>> +				max-speed-hz = <bebc20>; /* 12500000 Hz */
>>> +				chip-select = <0>;
>>> +				pio-handle = <&mmc1pio>;
>>> +			};
>>
>> we should do this in board code and not the device tree.
>
> Well, I've done this initially. But Vitaly hinted that this could
> be done in the DT instead, which made sense to me - mmc is the child
> device of SPI bus. Why do you think it shouldn't be in the DT? I'm
> not arguing, just want understand this.

I understand. Look at the dts/device tree from a non-Linux  
perspective.  From that point of view its not always clear how one  
would interpret some of the fields or if they are necessary.  I get  
very concerned when we start trying to describe any devices connect  
to a bus when the bus doesn't have any specific for things that are  
just software convention for a given OS.

The "id" concept and number is from Linux and another OS may have  
come up w/some other way of describe this.

- k

^ permalink raw reply

* Re: [spi-devel-general] [PATCH 1/4] [POWERPC][SPI] spi_mpc83xx.c: should turn off SPI unit while switching any mode.
From: Anton Vorontsov @ 2007-07-27 13:36 UTC (permalink / raw)
  To: Kumar Gala; +Cc: spi-devel-general, linuxppc-dev
In-Reply-To: <250FD11F-9ADC-46CC-B652-1148FC549316@kernel.crashing.org>

On Fri, Jul 27, 2007 at 01:32:27AM -0500, Kumar Gala wrote:
>
> On Jul 26, 2007, at 8:13 AM, Anton Vorontsov wrote:
>
>> Documentation clearly states, that mode should not be changed
>> till SPMODE_ENABLE bit set. I've seen hangs w/o this patch.
>
> Out of interest what board/part do you see the hang on?

It's MPC8323E-RDB.

Using spidev_test utility:

root@10.0.0.99:~# ./a.out -D /dev/spidev1.0
spi mode: 0
bits per word: 8
max speed: Hz (kHz): 500000 (500)
...
root@10.0.0.99:~#


Then trying change bits per word to 32:

root@10.0.0.99:~# ./a.out -D /dev/spidev1.0 -b 32
spi mode: 0
bits per word: 32
max speed: Hz (kHz): 500000 (500)
<---- hang

Board is still alive, but SPI isn't.

Though, there are various steps to reproduce the same.
So SPI unit should be really turned off to change mode.

Thanks,

-- 
Anton Vorontsov
email: cbou@mail.ru
backup email: ya-cbou@yandex.ru
irc://irc.freenode.net/bd2

^ permalink raw reply

* Re: [spi-devel-general] [PATCH 2/3] [SPI] Add new mode: SPI_LOOP
From: Anton Vorontsov @ 2007-07-27 13:27 UTC (permalink / raw)
  To: David Brownell; +Cc: spi-devel-general, Stephen Street, linuxppc-dev
In-Reply-To: <200707262007.07537.david-b@pacbell.net>

On Thu, Jul 26, 2007 at 08:07:07PM -0700, David Brownell wrote:
> On Thursday 26 July 2007, Anton Vorontsov wrote:
> > Loopback mode is supported by various controllers, this mode
> > is useful for testing, especially in conjunction with spidev
> > driver.
> 
> ISTR that Stephen Street provided a loopback mode for debug
> in his pxa2xx_spi code.  And I know you're fight that this
> mode shows up in a lot of hardware.
> 
> Comments, anyone?  This seems like a fair way to expose this
> mechanism.  And I tend to agree that it'd mostly be useful in
> conjunction with "spidev".
> 
> Anton -- assuming this goes in, it'd be nice if you could
> contribute a simple test program using this, which we could
> keep in Documentation/spi somewhere.  (Maybe with other testing
> notes, if anyone comes up with such.)

Sure. Test utility is below.

I'm aware it's not perfect, it sends just one transfer message,
which not covers all testing requirements. So implementing
--datafile switch to pass .ppm-alike files (as in
drivers/video/logo/) would be great. But I'm leaving this feature
implementation to those who will really need it. ;-)

Thanks!

- - - -
From: Anton Vorontsov <avorontsov@ru.mvista.com>
Subject: [SPI] spidev_test utility

This is simple utility used to test SPI functionality.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
 Documentation/spi/spidev_test.c |  202 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 202 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/spi/spidev_test.c

diff --git a/Documentation/spi/spidev_test.c b/Documentation/spi/spidev_test.c
new file mode 100644
index 0000000..d76a72b
--- /dev/null
+++ b/Documentation/spi/spidev_test.c
@@ -0,0 +1,202 @@
+/*
+ * SPI testing utility (using spidev driver)
+ *
+ * Copyright (c) 2007  MontaVista Software, Inc.
+ * Copyright (c) 2007  Anton Vorontsov <avorontsov@ru.mvista.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License.
+ *
+ * Cross-compile with cross-gcc -I/path/to/cross-kernel/include
+ */
+
+#define _GNU_SOURCE
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <getopt.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#include <linux/types.h>
+#include <linux/spi/spidev.h>
+
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
+
+static void pabort(const char *s)
+{
+	perror(s);
+	abort();
+}
+
+static char *device = "/dev/spidev1.1";
+static uint8_t mode;
+static uint8_t bits = 8;
+static uint32_t speed = 500000;
+static uint16_t delay;
+
+static void transfer(int fd)
+{
+	int ret;
+	uint8_t tx[] = {
+		0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+		0x40, 0x00, 0x00, 0x00, 0x00, 0x95,
+		0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+		0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+		0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+		0xDE, 0xAD, 0xBE, 0xEF, 0xBA, 0xAD,
+		0xF0, 0x0D,
+	};
+	uint8_t rx[ARRAY_SIZE(tx)] = {0, };
+	struct spi_ioc_transfer tr = {
+		.tx_buf = (unsigned long)tx,
+		.rx_buf = (unsigned long)rx,
+		.len = ARRAY_SIZE(tx),
+		.delay_usecs = delay,
+		.speed_hz = speed,
+		.bits_per_word = bits,
+	};
+
+	ret = ioctl(fd, SPI_IOC_MESSAGE(1), &tr);
+	if (ret == 1)
+		pabort("can't send spi message");
+
+	for (ret = 0; ret < ARRAY_SIZE(tx); ret++) {
+		if (!(ret % 6))
+			puts("");
+		printf("%.2X ", rx[ret]);
+	}
+	puts("");
+}
+
+void print_usage(char *prog)
+{
+	printf("Usage: %s [-DsbdlHOLC3]\n", prog);
+	puts("  -D --device   device to use (default /dev/spidev1.1)\n"
+	     "  -s --speed    speed (Hz)\n"
+	     "  -d --delay    delay (usec)\n"
+	     "  -b --bpw      bits per word \n"
+	     "  -l --loop     loopback\n"
+	     "  -H --cpha     clock phase\n"
+	     "  -O --cpol     clock polarity\n"
+	     "  -L --lsb      least significant bit first\n"
+	     "  -C --cs-high  chip select active high\n"
+	     "  -3 --3wire    SI/SO signals shared\n");
+	exit(1);
+}
+
+void parse_opts(int argc, char *argv[])
+{
+	while (1) {
+		static struct option lopts[] = {
+			{ "device",  1, 0, 'D' },
+			{ "speed",   1, 0, 's' },
+			{ "delay",   1, 0, 'd' },
+			{ "bpw",     1, 0, 'b' },
+			{ "loop",    0, 0, 'l' },
+			{ "cpha",    0, 0, 'H' },
+			{ "cpol",    0, 0, 'O' },
+			{ "lsb",     0, 0, 'L' },
+			{ "cs-high", 0, 0, 'C' },
+			{ "3wire",   0, 0, '3' },
+			{ NULL, 0, 0, 0 },
+		};
+		int c;
+
+		c = getopt_long(argc, argv, "D:s:d:b:lHOLC3", lopts, NULL);
+
+		if (c == -1)
+			break;
+
+		switch (c) {
+		case 'D':
+			device = optarg;
+			break;
+		case 's':
+			speed = atoi(optarg);
+			break;
+		case 'd':
+			delay = atoi(optarg);
+			break;
+		case 'b':
+			bits = atoi(optarg);
+			break;
+		case 'l':
+			mode |= SPI_LOOP;
+			break;
+		case 'H':
+			mode |= SPI_CPHA;
+			break;
+		case 'O':
+			mode |= SPI_CPOL;
+			break;
+		case 'L':
+			mode |= SPI_LSB_FIRST;
+			break;
+		case 'C':
+			mode |= SPI_CS_HIGH;
+			break;
+		case '3':
+			mode |= SPI_3WIRE;
+			break;
+		default:
+			print_usage(argv[0]);
+			break;
+		}
+	}
+}
+
+int main(int argc, char *argv[])
+{
+	int ret = 0;
+	int fd;
+
+	parse_opts(argc, argv);
+
+	fd = open(device, O_RDWR);
+	if (fd < 0)
+		pabort("can't open device");
+
+	/*
+	 * spi mode
+	 */
+	ret = ioctl(fd, SPI_IOC_WR_MODE, &mode);
+	if (ret == -1)
+		pabort("can't set spi mode");
+
+	ret = ioctl(fd, SPI_IOC_RD_MODE, &mode);
+	if (ret == -1)
+		pabort("can't get spi mode");
+
+	/*
+	 * bits per word
+	 */
+	ret = ioctl(fd, SPI_IOC_WR_BITS_PER_WORD, &bits);
+	if (ret == -1)
+		pabort("can't set bits per word");
+
+	ret = ioctl(fd, SPI_IOC_RD_BITS_PER_WORD, &bits);
+	if (ret == -1)
+		pabort("can't get bits per word");
+
+	/*
+	 * max speed hz
+	 */
+	ret = ioctl(fd, SPI_IOC_WR_MAX_SPEED_HZ, &speed);
+	if (ret == -1)
+		pabort("can't set max speed hz");
+
+	ret = ioctl(fd, SPI_IOC_RD_MAX_SPEED_HZ, &speed);
+	if (ret == -1)
+		pabort("can't get max speed hz");
+
+	printf("spi mode: %d\n", mode);
+	printf("bits per word: %d\n", bits);
+	printf("max speed: Hz (kHz): %d (%d)\n", speed, speed/1000);
+
+	transfer(fd);
+
+	close(fd);
+
+	return ret;
+}
-- 
1.5.0.6

^ permalink raw reply related

* a question about mpc8xx linux
From: poorbeyond @ 2007-07-27 13:11 UTC (permalink / raw)
  To: Linux-ppc mail list

[-- Attachment #1: Type: text/plain, Size: 863 bytes --]

my cpu is MPC860, use u-boot-1.1.4, linux-2.6.20.14

i use the "tftp 300000 uImage" command download kernel image,

then use the "bootm 300000" command boot the image.


i found the bootm cmd entered the /arch/ppc/kernel/head_8xx.s, stop at the instruction "rfi".
is it right? after the instruction, where does the code go normally ? what should i do now?

thanks

 .globl __start
__start:
 mr r31,r3   /* save parameters */
 mr r30,r4
 mr r29,r5
 mr r28,r6
 mr r27,r7

 /* We have to turn on the MMU right away so we get cache modes
  * set correctly.
  */
 bl initial_mmu

/* We now have the lower 8 Meg mapped into TLB entries, and the caches
 * ready to work.
 */

turn_on_mmu:
 mfmsr r0
 ori r0,r0,MSR_DR|MSR_IR
 mtspr SPRN_SRR1,r0
 lis r0,start_here@h
 ori r0,r0,start_here@l
 mtspr SPRN_SRR0,r0
 SYNC
 rfi    /* enables MMU */







poorbeyond
2007-07-27

[-- Attachment #2: Type: text/html, Size: 2368 bytes --]

^ permalink raw reply

* Re: [RFC 0/1] lro: Generic Large Receive Offload for TCP traffic
From: Jeff Garzik @ 2007-07-27 13:00 UTC (permalink / raw)
  To: Jan-Bernd Themann
  Cc: Thomas Klein, Jan-Bernd Themann, netdev, linux-kernel, linux-ppc,
	Christoph Raisch, Marcus Eder, Andrew Gallatin, Stefan Roscher,
	David Miller
In-Reply-To: <200707271418.49781.ossthema@de.ibm.com>

Just to chime in...

In general, I like where this LRO effort is going, and I really 
appreciate you guys working on it.

	Jeff

^ permalink raw reply

* Re: [RFC 0/1] lro: Generic Large Receive Offload for TCP traffic
From: Jan-Bernd Themann @ 2007-07-27 12:18 UTC (permalink / raw)
  To: Andrew Gallatin
  Cc: Thomas Klein, Jeff Garzik, Jan-Bernd Themann, netdev,
	linux-kernel, linux-ppc, Christoph Raisch, Marcus Eder,
	Stefan Roscher, David Miller
In-Reply-To: <46A785C2.9090708@myri.com>

Hi Drew,

thanks a lot for your good feedback. See comments below.
I'll try to provide an updated version next week. It would
be nice if you could post a patch for your driver once
we have addressed the issues you mentioned. Then we would
have the eHEA driver for the SKB interface, and your driver
for the "receive in pages" interface.

Thanks,
Jan-Bernd

On Wednesday 25 July 2007 19:17, Andrew Gallatin wrote:
> Code review / comments:
> ===================
> 
> 1) Checksum information for CHECKSUM_COMPLETE drivers.
> 
> Our NIC passes partial checksums to our driver.  In the current code,
> it seems impossible for page based CHECKSUM_COMPLETE drivers to behave
> correctly in the case of "rejected" frames.  Eg, there is no way
> to pass the partial checksum to the LRO module so that it gets
> set in the skb header and passed up the stack.
> 
> Further, there seems to be no (easy) way to use CHECKSUM_COMPLETE
> on an aggregated packet at LRO flush time.  By the time a packet
> is aggregated, the partial checksum from the first segment is
> out of date.
> 
> I think it would make sense to require that a CHECKSUM_COMPLETE style
> driver verify the checksum in its get_frag_header / get_skb_header
> callback.  This allows the LRO code to unconditionally set
> CHECKSUM_UNNECESSARY.

I agree

> 2) Non-accelerated VLAN tags
> 
> Our firmware currently does not do vlan tag insertion
> and removal.  This causes a problem in __lro_proc_segment()
> where the tcp and ip headers are setup to point into the
> newly created skb.  A frame containing an unstripped vlan
> tag will cause the headers to be garbage.
> 
> The attached patch modifies __lro_proc_segment() to offset
> those pointers by VLAN_HLEN when required.
> 

The modifications you propose are not sufficient to work with HW
which actually extracts the VLAN IDs but does not change the 
eth protocol. Thus we have to add an additional field in
lro_mgr indicating how to interpret the eth protocol regarding
the VLAN header.

> 3) Padded frames.
> 
> I may be missing something, but I don't see where you
> either strip padding from frames or reject padded frames.
> (see the pskb_trim_rcsum() in net/ipv4/ip_input.c:ip_rcv()
> 
I think I missed something :-) Will fix that.
In lro_tcp_ip_check we check for the "SKB aggregation interface"
the skb->len against ip->tot_len. This catches padded frames as
eth_type_trans(skb, dev) reduces the length of the SKB.
However, the possible VLAN header is not taken into account. 
And for the "receive in pages" interface a wrong length is passed
as argument as well. 

I'd suggest to reject padded frames for aggregation as we do now
(when bugs are fixed) and thus keep the code simple.
I guess that padded frames don't occur too often in high load 
situations. If we detect a real performance issue we can still
change that later.

> I did not add such a feature as I was confused about the intended
> use of len/true_size.
len: number of bytes received
true_size: used to fill the "truesize" field in the SKB. Thus this reflects
           the amount of memory that is actually used by that SKB. If you
           receive into pages und you have some space between packets, you
           should take this into account. Example: you use 1 page for each
           packet, then you pass 4096 as argument.

> 
> Also, trimming is a pain when dealing with pure frags (without a
> containing skb).  We have code in our out-of-kernel driver to deal
> with it which you are welcome to use.
> 
> 

> 4) LRO_MIN_PG_HLEN (== 80)
> 
> This confuses me.  Can you please explain what you're trying to do?
> Because of this, I kept getting crashes in the skb_pull() done by
> eth_type_trans() because I was passing segments which were 60 bytes
> and the skb->data_len of the skb constructed by lro_gen_skb() was -20.
> I added my own code to bump the length to a magic 80 bytes, and the
> panics disappeared.  This may cause data corruption because of
> #3 above!
Yes, I see the point... I'm not sure in how far there are any requirements
that a certain amount of data (header) for other types of traffic
has to be in the skb->data field and not in frags. Maybe someone
can comment on this?
I suggest to remove LRO_MIN_PG_HLEN for tcp/ip packets that are aggregated,
but should we use a minimal length for other traffic (depending on the
number of received bytes)? Is that necessary?

> 
> 5) NAPI/non-NAPI
> 
> The LRO code assumes the underlying driver uses NAPI, and calls
> netif_receive_skb() rather than netif_rx().  Perhaps there should be a
> field in the lro_mgr struct to specify napi / non-napi.
> 
Yes, if someone intends to use it without napi, we can add this.

> 6) The checks for when to stop aggregating and flush in
>     __lro_proc_{segment|skb} need some improvement.
> 
> The skb variant currently uses a pure count (max_aggr).  In order to
> keep the resulting aggregated frame below 64KB, the underlying driver
> computes max_aggr as 0xffff / MTU.  This reduces the effectiveness of
> LRO on mixed MTU networks.  Eg, this causes packets coming from a
> source with a 1500b MTU to be aggregated after 7 frames when using a
> 9000b MTU on the receiver, rather than after 43 frames.  As you can
> see from the differences in inet_lro's performance in the table
> above, this is a real problem.
> 
> I believe that a hybrid byte / max_aggr model should be used.  The
> __lro_proc_segment takes this approach.  Note that there is a subtle
> bug in that the maximum aggregated bytes should not be be 0xffff.
> Rather, one must leave room for the next frame to arrive by setting
> the max aggregated bytes to 0xffff - dev->mtu.  This is masked
> by the driver computing max_aggr as above.

This suggestions sounds good. Will add it.

^ permalink raw reply

* pq2fads support...
From: Alexandros Kostopoulos @ 2007-07-27 12:24 UTC (permalink / raw)
  To: linuxppc-dev

Hello Scott and all,

In your patch for the pq2fads support, the device tree seems to be missing  
a memory node, for which dtc complains loudly. Is this board tested to  
boot with these patches (because I'm now using this as a template for my  
board - with your patchset applied to Paul's git)

thanks a lot

Alex

PS. What's about this new cpm-serial driver? is this supposed to be a  
replacement for cpm_uart?

^ permalink raw reply

* Re: [RFC][PATCH] MPC832x_RDB: update dts to use spi, register mmc_spi stub
From: Anton Vorontsov @ 2007-07-27 11:45 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <7BACDD73-9097-4139-8331-A1A14A6134D0@kernel.crashing.org>

On Fri, Jul 27, 2007 at 03:14:06AM -0500, Kumar Gala wrote:
>
> On Jul 26, 2007, at 8:57 AM, Anton Vorontsov wrote:
[...]
>>
>> @@ -207,20 +222,36 @@
>>
>>  		spi@4c0 {
>>  			device_type = "spi";
>> +			device-id = <1>;
>
> Can we just use the reg value for bus_num in the kernel.

Sure, technically nothing prevents this. But, QE specs names
SPIs by these ids. Plus, from the kernel side spi name will be
not pretty, it will be spi1216.1. Reg value making little sense
to the userspace (or kernel-side SPI layer). Still want get
rid of device-id?

>>  			compatible = "fsl_spi";
>>  			reg = <4c0 40>;
>>  			interrupts = <2>;
>>  			interrupt-parent = <&qeic>;
>> -			mode = "cpu";
>> +			mode = "qe";
>> +			sysclk = <5f5e100>; /* 100000000 Hz */
>
> we don't need this in the spi node, its just the system clock frequency 
> which we can get other ways.

Will try, I guess "bus-frequency" property of soc8323 is what I need.

>> +			max-chipselect = <1>;
>
> I'm not sure how I feel about this in here, I'm thinking it should go.

It's board-specific, i.e. how much chips connected to this SPI bus.
SPI layer needs this. Otherwise I have to pass it from board file,
but isn't it fits nicely in the DT?

>> +			pio-handle = <&spi1pio>;
>> +
>> +			mmc@01 {
>> +				device_type = "mmc";
>> +				compatible = "mmc-spi";
>> +				device-id = <1>;
>> +				max-speed-hz = <bebc20>; /* 12500000 Hz */
>> +				chip-select = <0>;
>> +				pio-handle = <&mmc1pio>;
>> +			};
>
> we should do this in board code and not the device tree.

Well, I've done this initially. But Vitaly hinted that this could
be done in the DT instead, which made sense to me - mmc is the child
device of SPI bus. Why do you think it shouldn't be in the DT? I'm
not arguing, just want understand this.

Thanks!

-- 
Anton Vorontsov
email: cbou@mail.ru
backup email: ya-cbou@yandex.ru
irc://irc.freenode.net/bd2

^ permalink raw reply

* Re: [RFC][PATCH] fsl_soc: add support for fsl_spi
From: Anton Vorontsov @ 2007-07-27 11:12 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev
In-Reply-To: <20070726164508.GB28491@ld0162-tx32.am.freescale.net>

On Thu, Jul 26, 2007 at 11:45:08AM -0500, Scott Wood wrote:
> On Thu, Jul 26, 2007 at 05:56:55PM +0400, Anton Vorontsov wrote:
> > +void (*fsl_spi_activate_cs)(u8 cs, u8 polarity) = NULL;
> > +EXPORT_SYMBOL(fsl_spi_activate_cs);
> > +void (*fsl_spi_deactivate_cs)(u8 cs, u8 polarity) = NULL;
> > +EXPORT_SYMBOL(fsl_spi_deactivate_cs);
> 
> What are these for?  It looks like you're using them to set pins,
> but that should be done in the firmware (and if the firmware sucks, then
> do it in the platform code at bootup).

Nope, this is not to set [initial state of] pins. SPI layer needs
this to trigger MMC's chipselect, it's wired as usual GPIO pin, which
should be asserted (and then deasserted) by software at proper time.

Every board may have different implementation of
activate_cs/deactivate_cs, in mpc8323_rdb case it's implemented using
par_io_data_set().

(1)
Kumar Gala suggested to not use arch_initcall, but call fsl_spi_init()
explicitly by board file. So these global *_cs functions will go away.

> > +static int __init fsl_spi_of_init(void)
> > +{
> > +	struct device_node *np;
> > +	unsigned int i;
> > +
> > +	for (np = NULL, i = 1;
> > +	     (np = of_find_compatible_node(np, "spi", "fsl_spi")) != NULL;
> > +	     i++) {
> 
> s/fsl_spi/fsl,mpc8323-spi/, please.

Will do for mpc832x_rdb. Should I also prepare patch to change all
instances of "fsl_spi" in the arch/powerpc/boot/dts/*?

> Why not make the fsl spi driver an of_platform device?

Well, I guess this is rhetoric question. Is fsl_soc.c's
OF<->platform_devices bindings officially deprecated?

If they're, I'll surely volunteer to convert it to of_platform.
But then (1) should be solved another way, yet don't know how.

> -Scott

Thanks!

-- 
Anton Vorontsov
email: cbou@mail.ru
backup email: ya-cbou@yandex.ru
irc://irc.freenode.net/bd2

^ permalink raw reply

* Re: [PATCH 1/2] ehca: remove checkpatch.pl's warnings "externs should be avoided in .c files"
From: Sam Ravnborg @ 2007-07-27 11:01 UTC (permalink / raw)
  To: Hoang-Nam Nguyen
  Cc: Roland Dreier, linux-kernel, linuxppc-dev, raisch, general,
	stefan.roscher
In-Reply-To: <200707271254.51055.hnguyen@linux.vnet.ibm.com>

On Fri, Jul 27, 2007 at 12:54:50PM +0200, Hoang-Nam Nguyen wrote:
> >From b5d0336089b5ebe5b18acb94b2c94c2026cb95ee Mon Sep 17 00:00:00 2001
> From: Hoang-Nam Nguyen <hnguyen at de.ibm.com>
> Date: Fri, 27 Jul 2007 10:24:49 +0200
> Subject: [PATCH] remove checkpatch.pl's warnings "externs should be avoided in .c files"
> 
> Signed-off-by: Hoang-Nam Nguyen <hnguyen@de.ibm.com>

And you checked that said .h file was indeed included by the .c file that has the original definition?
Otherwise the definition and the declaration can get out of sync without notice.

	Sam

^ permalink raw reply

* [PATCH 2/2] ehca: correction include order according kernel coding style
From: Hoang-Nam Nguyen @ 2007-07-27 10:55 UTC (permalink / raw)
  To: Roland Dreier, linux-kernel, linuxppc-dev, general; +Cc: raisch, stefan.roscher

=46rom a2794450cbee597cefd7b6e159257583c459d358 Mon Sep 17 00:00:00 2001
=46rom: Hoang-Nam Nguyen <hnguyen at de.ibm.com>
Date: Fri, 27 Jul 2007 10:26:40 +0200
Subject: [PATCH] correction include order according kernel coding style

Signed-off-by: Hoang-Nam Nguyen <hnguyen@de.ibm.com>
=2D--
 drivers/infiniband/hw/ehca/ehca_mrmw.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/ehca/ehca_mrmw.c b/drivers/infiniband/hw=
/ehca/ehca_mrmw.c
index 773ac3f..1180b65 100644
=2D-- a/drivers/infiniband/hw/ehca/ehca_mrmw.c
+++ b/drivers/infiniband/hw/ehca/ehca_mrmw.c
@@ -40,9 +40,8 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
=20
=2D#include <rdma/ib_umem.h>
=2D
 #include <asm/current.h>
+#include <rdma/ib_umem.h>
=20
 #include "ehca_iverbs.h"
 #include "ehca_mrmw.h"
=2D-=20
1.5.2

^ permalink raw reply

* [PATCH 1/2] ehca: remove checkpatch.pl's warnings "externs should be avoided in .c files"
From: Hoang-Nam Nguyen @ 2007-07-27 10:54 UTC (permalink / raw)
  To: Roland Dreier, linux-kernel, linuxppc-dev, general; +Cc: raisch, stefan.roscher

=46rom b5d0336089b5ebe5b18acb94b2c94c2026cb95ee Mon Sep 17 00:00:00 2001
=46rom: Hoang-Nam Nguyen <hnguyen at de.ibm.com>
Date: Fri, 27 Jul 2007 10:24:49 +0200
Subject: [PATCH] remove checkpatch.pl's warnings "externs should be avoided=
 in .c files"

Signed-off-by: Hoang-Nam Nguyen <hnguyen@de.ibm.com>
=2D--
 drivers/infiniband/hw/ehca/ehca_classes.h |    1 +
 drivers/infiniband/hw/ehca/ehca_mrmw.c    |    2 --
 drivers/infiniband/hw/ehca/ehca_pd.c      |    1 -
 drivers/infiniband/hw/ehca/hcp_if.c       |    1 -
 drivers/infiniband/hw/ehca/ipz_pt_fn.h    |    2 ++
 5 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/infiniband/hw/ehca/ehca_classes.h b/drivers/infiniband=
/hw/ehca/ehca_classes.h
index 3725aa8..b5e9603 100644
=2D-- a/drivers/infiniband/hw/ehca/ehca_classes.h
+++ b/drivers/infiniband/hw/ehca/ehca_classes.h
@@ -322,6 +322,7 @@ extern int ehca_static_rate;
 extern int ehca_port_act_time;
 extern int ehca_use_hp_mr;
 extern int ehca_scaling_code;
+extern int ehca_mr_largepage;
=20
 struct ipzu_queue_resp {
 	u32 qe_size;      /* queue entry size */
diff --git a/drivers/infiniband/hw/ehca/ehca_mrmw.c b/drivers/infiniband/hw=
/ehca/ehca_mrmw.c
index c1b868b..773ac3f 100644
=2D-- a/drivers/infiniband/hw/ehca/ehca_mrmw.c
+++ b/drivers/infiniband/hw/ehca/ehca_mrmw.c
@@ -64,8 +64,6 @@ enum ehca_mr_pgsize {
 	EHCA_MR_PGSIZE16M =3D 0x1000000L
 };
=20
=2Dextern int ehca_mr_largepage;
=2D
 static u32 ehca_encode_hwpage_size(u32 pgsize)
 {
 	u32 idx =3D 0;
diff --git a/drivers/infiniband/hw/ehca/ehca_pd.c b/drivers/infiniband/hw/e=
hca/ehca_pd.c
index 3dafd7f..43bcf08 100644
=2D-- a/drivers/infiniband/hw/ehca/ehca_pd.c
+++ b/drivers/infiniband/hw/ehca/ehca_pd.c
@@ -88,7 +88,6 @@ int ehca_dealloc_pd(struct ib_pd *pd)
 	u32 cur_pid =3D current->tgid;
 	struct ehca_pd *my_pd =3D container_of(pd, struct ehca_pd, ib_pd);
 	int i, leftovers =3D 0;
=2D	extern struct kmem_cache *small_qp_cache;
 	struct ipz_small_queue_page *page, *tmp;
=20
 	if (my_pd->ib_pd.uobject && my_pd->ib_pd.uobject->context &&
diff --git a/drivers/infiniband/hw/ehca/hcp_if.c b/drivers/infiniband/hw/eh=
ca/hcp_if.c
index fdbfebe..24f4541 100644
=2D-- a/drivers/infiniband/hw/ehca/hcp_if.c
+++ b/drivers/infiniband/hw/ehca/hcp_if.c
@@ -758,7 +758,6 @@ u64 hipz_h_register_rpage_mr(const struct ipz_adapter_h=
andle adapter_handle,
 			     const u64 logical_address_of_page,
 			     const u64 count)
 {
=2D	extern int ehca_debug_level;
 	u64 ret;
=20
 	if (unlikely(ehca_debug_level >=3D 2)) {
diff --git a/drivers/infiniband/hw/ehca/ipz_pt_fn.h b/drivers/infiniband/hw=
/ehca/ipz_pt_fn.h
index c6937a0..a801274 100644
=2D-- a/drivers/infiniband/hw/ehca/ipz_pt_fn.h
+++ b/drivers/infiniband/hw/ehca/ipz_pt_fn.h
@@ -54,6 +54,8 @@
 struct ehca_pd;
 struct ipz_small_queue_page;
=20
+extern struct kmem_cache *small_qp_cache;
+
 /* struct generic ehca page */
 struct ipz_page {
 	u8 entries[EHCA_PAGESIZE];
=2D-=20
1.5.2

^ permalink raw reply

* [PATCH 0/2] ehca: remove WARNING: externs should be avoided in .c files
From: Hoang-Nam Nguyen @ 2007-07-27 10:52 UTC (permalink / raw)
  To: Roland Dreier, linux-kernel, linuxppc-dev, general; +Cc: raisch, stefan.roscher

Hello Roland!
This small patch set fixes some coding-style related issues for ehca:
[1/2] remove checkpatch.pl's warnings "externs should be avoided in .c files"
[2/2] correction include order according kernel coding style
Thanks
Nam

^ permalink raw reply

* Re: [PATCH] mpc832x_rdb.c: prevent using uninitialized variable
From: Anton Vorontsov @ 2007-07-27 10:23 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev
In-Reply-To: <20070726164833.GC28491@ld0162-tx32.am.freescale.net>

On Thu, Jul 26, 2007 at 11:48:33AM -0500, Scott Wood wrote:
> On Thu, Jul 26, 2007 at 06:01:39PM +0400, Anton Vorontsov wrote:
> > If CONFIG_PCI undefined, np will be used uninitialized, thereby
> > find_node_by_name(np, "par_io") will fail.
> 
> This is the wrong fix -- you should be passing NULL to the par_io call
> rather than np.  Otherwise, if the par_io is earlier in the tree than the
> pci, you won't find it.

Oops. Right you are, thanks!

I hope this is proper fix.

- - - -
From: Anton Vorontsov <avorontsov@ru.mvista.com>
Subject: [POWERPC] mpc832x_rdb.c: prevent using uninitialized variable

If CONFIG_PCI undefined, np will be used uninitialized, thereby
find_node_by_name(np, "par_io") will fail.

of_find_node_by_name(np, "par_io") isn't used inside loop,
thus we can safely pass NULL instead of np.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
 arch/powerpc/platforms/83xx/mpc832x_rdb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
index b2b28a4..93ba957 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
@@ -56,7 +56,7 @@ static void __init mpc832x_rdb_setup_arch(void)
 #ifdef CONFIG_QUICC_ENGINE
 	qe_reset();
 
-	if ((np = of_find_node_by_name(np, "par_io")) != NULL) {
+	if ((np = of_find_node_by_name(NULL, "par_io")) != NULL) {
 		par_io_init(np);
 		of_node_put(np);
 
-- 
1.5.0.6

^ permalink raw reply related

* Re: creation of jffs2 rootfile system..
From: Nethra @ 2007-07-27 10:22 UTC (permalink / raw)
  To: linuxppc-embedded
In-Reply-To: <20070727104023.78048ea4.fvoegel@carangul.com>


I m creating jffs2 root file system using devrocket,

this is the bootlog i m getting....

VFS: Mounted root (jffs2 filesystem).
Freeing unused kernel memory: 108k init
readlink: /etc/mtab: No such file or directory
0
readlink: /etc/mtab: No such file or directory
Mounting local filesystems: mount nothing was mounted
Cleaning: /tmp BusyBox v1.01 (2005.12.18-04:27+0000) multi-call binary

Usage: find [PATH...] [EXPRESSION]

Search for files in a directory hierarchy.  The default PATH is
the current directory; default EXPRESSION is '-print'

EXPRESSION may consist of:
        -follow         Dereference symbolic links.
        -name PATTERN   File name (leading directories removed) matches
PATTERN.
        -print          Print (default and assumed).

        -type X         Filetype matches X (where X is one of:
f,d,l,b,c,...)
        -perm PERMS     Permissions match any of (+NNN); all of (-NNN);
                        or exactly (NNN)
        -mtime TIME     Modified time is greater than (+N); less than (-N);
                        or exactly (N) days

/var/lock cd: 77: can't cd to /var/lock
/var/run BusyBox v1.01 (2005.12.18-04:27+0000) multi-call binary

Usage: find [PATH...] [EXPRESSION]

Search for files in a directory hierarchy.  The default PATH is
the current directory; default EXPRESSION is '-print'

EXPRESSION may consist of:
        -follow         Dereference symbolic links.
        -name PATTERN   File name (leading directories removed) matches
PATTERN.
        -print          Print (default and assumed).

        -type X         Filetype matches X (where X is one of:
f,d,l,b,c,...)
        -perm PERMS     Permissions match any of (+NNN); all of (-NNN);
                        or exactly (NNN)
        -mtime TIME     Modified time is greater than (+N); less than (-N);
                        or exactly (N) days

grep: /etc/group: No such file or directory
done.
Setting pseudo-terminal access permissions...chown: unknown group name: tty
done.
Updating /etc/motd...sed: /etc/motd: No such file or directory
done.
/etc/rc.d/rcS.d/S55bootmisc.sh: 119: cannot create /var/log/dmesg: Directory
nonexistent
: done.

Please press Enter to activate this console.
/#

now ps command is working properly.

why i m not getting login..?


Florian A. Voegel wrote:
> 
> 
> Hi Nethra,
> 
> what does your inittab and your startup files look like? It looks like
> 
> - your inittab does not start a getty but rather a shell, thus no login
> - your /proc isn't mounted, and it's needed for ps to work properly
> 
> 
> Greets,
> 
> Florian Voegel
> Carangul.Tech
> 
> On Thu, 26 Jul 2007 23:41:32 -0700 (PDT)
> Nethra <nethra_gmit@yahoo.co.in> wrote:
> 
>> 
>> when boot the board with jffs2 rootfile system i m getting output like
>> this,
>> 
>> TCP: Hash tables configured (established 4096 bind 8192)
>> IPv4 over IPv4 tunneling driver
>> NET: Registered protocol family 1
>> NET: Registered protocol family 10
>> IPv6 over IPv4 tunneling driver
>> NET: Registered protocol family 17
>> Disabled Privacy Extensions on device c02527a0(lo)
>> IP-Config: Incomplete network configuration information.
>> Empty flash at 0x0000ffa0 ends at 0x00010000
>> Empty flash at 0x0002ffec ends at 0x00030000
>> Empty flash at 0x0004ffe8 ends at 0x00050000
>> Empty flash at 0x0006ffc8 ends at 0x00070000
>> Empty flash at 0x0008fffc ends at 0x00090000
>> Empty flash at 0x000afffc ends at 0x000b0000
>> Empty flash at 0x000cfffc ends at 0x000d0000
>> Empty flash at 0x000efffc ends at 0x000f0000
>> Empty flash at 0x0010fffc ends at 0x00110000
>> Empty flash at 0x0012fffc ends at 0x00130000
>> Empty flash at 0x0014fffc ends at 0x00150000
>> Empty flash at 0x0016fffc ends at 0x00170000
>> Empty flash at 0x0018fffc ends at 0x00190000
>> Empty flash at 0x001cfffc ends at 0x001d0000
>> Empty flash at 0x001efffc ends at 0x001f0000
>> Empty flash at 0x0020fffc ends at 0x00210000
>> Empty flash at 0x0022fffc ends at 0x00230000
>> Empty flash at 0x0024fffc ends at 0x00250000
>> Empty flash at 0x0026fffc ends at 0x00270000
>> Empty flash at 0x002afffc ends at 0x002b0000
>> Empty flash at 0x002cfffc ends at 0x002d0000
>> VFS: Mounted root (jffs2 filesystem).
>> Freeing unused kernel memory: 108k init
>> 
>> Please press Enter to activate this console.
>> / #
>> / #
>> / #
>> 
>> login prompt itself is not coming and
>>  
>> ps command is not working....
>> # ps
>>   PID  Uid     VmSize Stat Command
>> #
>> 
>> what is the problem..?
>> 
>> waiting for early response,
>> Nethra
>> 
>> -- 
>> View this message in context:
>> http://www.nabble.com/creation-of-jffs2-rootfile-system..-tf4155759.html#a11823840
>> Sent from the linuxppc-embedded mailing list archive at Nabble.com.
>> 
>> _______________________________________________
>> Linuxppc-embedded mailing list
>> Linuxppc-embedded@ozlabs.org
>> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>> 
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
> 
> 

-- 
View this message in context: http://www.nabble.com/creation-of-jffs2-rootfile-system..-tf4155759.html#a11826448
Sent from the linuxppc-embedded mailing list archive at Nabble.com.

^ permalink raw reply

* [PATCH 12/68] 0 -> NULL, for arch/powerpc
From: Yoann Padioleau @ 2007-07-27  9:45 UTC (permalink / raw)
  To: kernel-janitors; +Cc: linuxppc-dev, akpm, paulus, linux-kernel


When comparing a pointer, it's clearer to compare it to NULL than to 0.

Here is an excerpt of the semantic patch: 

@@
expression *E;
@@

  E ==
- 0
+ NULL

@@
expression *E;
@@

  E !=
- 0
+ NULL

Signed-off-by: Yoann Padioleau <padator@wanadoo.fr>
Cc: paulus@samba.org
Cc: linuxppc-dev@ozlabs.org
Cc: benh@kernel.crashing.org
Cc: akpm@linux-foundation.org
---

 boot/prpmc2800.c                |    2 +-
 kernel/btext.c                  |    8 ++++----
 kernel/legacy_serial.c          |    2 +-
 kernel/pci-common.c             |    2 +-
 kernel/pci_32.c                 |    8 ++++----
 kernel/prom.c                   |    4 ++--
 kernel/setup_64.c               |    4 ++--
 kernel/signal_64.c              |    4 ++--
 mm/mmu_decl.h                   |    2 +-
 mm/pgtable_32.c                 |    4 ++--
 mm/ppc_mmu_32.c                 |    2 +-
 mm/tlb_32.c                     |   12 ++++++------
 platforms/52xx/lite5200.c       |    2 +-
 platforms/83xx/mpc832x_mds.c    |    2 +-
 platforms/83xx/mpc836x_mds.c    |    2 +-
 platforms/85xx/mpc85xx_ads.c    |    4 ++--
 platforms/85xx/mpc85xx_cds.c    |    4 ++--
 platforms/86xx/mpc86xx_hpcn.c   |    4 ++--
 platforms/8xx/mpc86xads_setup.c |    4 ++--
 platforms/8xx/mpc885ads_setup.c |    4 ++--
 platforms/maple/pci.c           |    2 +-
 platforms/maple/setup.c         |    2 +-
 platforms/powermac/pci.c        |    2 +-
 platforms/powermac/pfunc_core.c |    2 +-
 platforms/powermac/setup.c      |    6 +++---
 platforms/powermac/time.c       |    6 +++---
 platforms/pseries/setup.c       |    2 +-
 sysdev/qe_lib/qe_io.c           |    2 +-
 xmon/spu-dis.c                  |   18 +++++++++---------
 xmon/xmon.c                     |    4 ++--
 30 files changed, 63 insertions(+), 63 deletions(-)

diff --git a/arch/powerpc/boot/prpmc2800.c b/arch/powerpc/boot/prpmc2800.c
index f428bac..b130e5b 100644
--- a/arch/powerpc/boot/prpmc2800.c
+++ b/arch/powerpc/boot/prpmc2800.c
@@ -480,7 +480,7 @@ static void prpmc2800_reset(void)
 
 	udelay(5000000);
 
-	if (bridge_base != 0) {
+	if (bridge_base != NULL) {
 		temp = in_le32((u32 *)(bridge_base + MV64x60_MPP_CNTL_0));
 		temp &= 0xFFFF0FFF;
 		out_le32((u32 *)(bridge_base + MV64x60_MPP_CNTL_0), temp);
diff --git a/arch/powerpc/kernel/btext.c b/arch/powerpc/kernel/btext.c
index e7b6846..6d9b68b 100644
--- a/arch/powerpc/kernel/btext.c
+++ b/arch/powerpc/kernel/btext.c
@@ -142,14 +142,14 @@ static void map_boot_text(void)
 
 	/* By default, we are no longer mapped */
 	boot_text_mapped = 0;
-	if (dispDeviceBase == 0)
+	if (dispDeviceBase == NULL)
 		return;
 	base = ((unsigned long) dispDeviceBase) & 0xFFFFF000UL;
 	offset = ((unsigned long) dispDeviceBase) - base;
 	size = dispDeviceRowBytes * dispDeviceRect[3] + offset
 		+ dispDeviceRect[0];
 	vbase = __ioremap(base, size, _PAGE_NO_CACHE);
-	if (vbase == 0)
+	if (vbase == NULL)
 		return;
 	logicalDisplayBase = vbase + offset;
 	boot_text_mapped = 1;
@@ -253,7 +253,7 @@ static unsigned char * calc_base(int x, 
 	unsigned char *base;
 
 	base = logicalDisplayBase;
-	if (base == 0)
+	if (base == NULL)
 		base = dispDeviceBase;
 	base += (x + dispDeviceRect[0]) * (dispDeviceDepth >> 3);
 	base += (y + dispDeviceRect[1]) * dispDeviceRowBytes;
@@ -264,7 +264,7 @@ static unsigned char * calc_base(int x, 
 void btext_update_display(unsigned long phys, int width, int height,
 			  int depth, int pitch)
 {
-	if (dispDeviceBase == 0)
+	if (dispDeviceBase == NULL)
 		return;
 
 	/* check it's the same frame buffer (within 256MB) */
diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c
index cea8045..330bd21 100644
--- a/arch/powerpc/kernel/legacy_serial.c
+++ b/arch/powerpc/kernel/legacy_serial.c
@@ -67,7 +67,7 @@ static int __init add_legacy_port(struct
 		legacy_serial_count = index + 1;
 
 	/* Check if there is a port who already claimed our slot */
-	if (legacy_serial_infos[index].np != 0) {
+	if (legacy_serial_infos[index].np != NULL) {
 		/* if we still have some room, move it, else override */
 		if (legacy_serial_count < MAX_LEGACY_SERIAL_PORTS) {
 			printk(KERN_DEBUG "Moved legacy port %d -> %d\n",
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index fe7d125..5fa0be3 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -256,7 +256,7 @@ static struct resource *__pci_mmap_make_
 	unsigned long io_offset = 0;
 	int i, res_bit;
 
-	if (hose == 0)
+	if (hose == NULL)
 		return NULL;		/* should never happen */
 
 	/* If memory, add on the PCI bridge address offset */
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index 721a694..4edefa6 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -598,7 +598,7 @@ make_one_node_map(struct device_node* no
 	} else
 		pci_to_OF_bus_map[pci_bus] = bus_range[0];
 
-	for (node=node->child; node != 0;node = node->sibling) {
+	for (node=node->child; node != NULL;node = node->sibling) {
 		struct pci_dev* dev;
 		const unsigned int *class_code, *reg;
 	
@@ -671,7 +671,7 @@ scan_OF_pci_childs(struct device_node* n
 {
 	struct device_node* sub_node;
 
-	for (; node != 0;node = node->sibling) {
+	for (; node != NULL;node = node->sibling) {
 		const unsigned int *class_code;
 	
 		if (filter(node, data))
@@ -1449,9 +1449,9 @@ fake_pci_bus(struct pci_controller *hose
 {
 	static struct pci_bus bus;
 
-	if (hose == 0) {
+	if (hose == NULL) {
 		hose = pci_bus_to_hose(busnr);
-		if (hose == 0)
+		if (hose == NULL)
 			printk(KERN_ERR "Can't find hose for PCI bus %d!\n", busnr);
 	}
 	bus.number = busnr;
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index a38197b..509f1e2 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -1095,7 +1095,7 @@ struct device_node *of_find_node_by_phan
 	struct device_node *np;
 
 	read_lock(&devtree_lock);
-	for (np = allnodes; np != 0; np = np->allnext)
+	for (np = allnodes; np != NULL; np = np->allnext)
 		if (np->linux_phandle == handle)
 			break;
 	of_node_get(np);
@@ -1118,7 +1118,7 @@ struct device_node *of_find_all_nodes(st
 
 	read_lock(&devtree_lock);
 	np = prev ? prev->allnext : allnodes;
-	for (; np != 0; np = np->allnext)
+	for (; np != NULL; np = np->allnext)
 		if (of_node_get(np))
 			break;
 	of_node_put(prev);
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 6018178..95119a5 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -310,7 +310,7 @@ static void __init initialize_cache_info
 			lsizep = of_get_property(np, dc, NULL);
 			if (lsizep != NULL)
 				lsize = *lsizep;
-			if (sizep == 0 || lsizep == 0)
+			if (sizep == NULL || lsizep == NULL)
 				DBG("Argh, can't find dcache properties ! "
 				    "sizep: %p, lsizep: %p\n", sizep, lsizep);
 
@@ -327,7 +327,7 @@ static void __init initialize_cache_info
 			lsizep = of_get_property(np, ic, NULL);
 			if (lsizep != NULL)
 				lsize = *lsizep;
-			if (sizep == 0 || lsizep == 0)
+			if (sizep == NULL || lsizep == NULL)
 				DBG("Argh, can't find icache properties ! "
 				    "sizep: %p, lsizep: %p\n", sizep, lsizep);
 
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c
index de895e6..6e02ec6 100644
--- a/arch/powerpc/kernel/signal_64.c
+++ b/arch/powerpc/kernel/signal_64.c
@@ -184,13 +184,13 @@ #ifdef CONFIG_ALTIVEC
 	if (v_regs && !access_ok(VERIFY_READ, v_regs, 34 * sizeof(vector128)))
 		return -EFAULT;
 	/* Copy 33 vec registers (vr0..31 and vscr) from the stack */
-	if (v_regs != 0 && (msr & MSR_VEC) != 0)
+	if (v_regs != NULL && (msr & MSR_VEC) != 0)
 		err |= __copy_from_user(current->thread.vr, v_regs,
 					33 * sizeof(vector128));
 	else if (current->thread.used_vr)
 		memset(current->thread.vr, 0, 33 * sizeof(vector128));
 	/* Always get VRSAVE back */
-	if (v_regs != 0)
+	if (v_regs != NULL)
 		err |= __get_user(current->thread.vrsave, (u32 __user *)&v_regs[33]);
 	else
 		current->thread.vrsave = 0;
diff --git a/arch/powerpc/mm/mmu_decl.h b/arch/powerpc/mm/mmu_decl.h
index c94a64f..b956e8b 100644
--- a/arch/powerpc/mm/mmu_decl.h
+++ b/arch/powerpc/mm/mmu_decl.h
@@ -83,7 +83,7 @@ extern unsigned long mmu_mapin_ram(void)
 static inline void flush_HPTE(unsigned context, unsigned long va,
 			      unsigned long pdval)
 {
-	if ((Hash != 0) &&
+	if ((Hash != NULL) &&
 	    cpu_has_feature(CPU_FTR_HPTE_TABLE))
 		flush_hash_pages(0, va, pdval, 1);
 	else
diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c
index 6448872..6c5b368 100644
--- a/arch/powerpc/mm/pgtable_32.c
+++ b/arch/powerpc/mm/pgtable_32.c
@@ -209,7 +209,7 @@ __ioremap(phys_addr_t addr, unsigned lon
 	if (mem_init_done) {
 		struct vm_struct *area;
 		area = get_vm_area(size, VM_IOREMAP);
-		if (area == 0)
+		if (area == NULL)
 			return NULL;
 		v = (unsigned long) area->addr;
 	} else {
@@ -262,7 +262,7 @@ int map_page(unsigned long va, phys_addr
 	pd = pmd_offset(pud_offset(pgd_offset_k(va), va), va);
 	/* Use middle 10 bits of VA to index the second-level map */
 	pg = pte_alloc_kernel(pd, va);
-	if (pg != 0) {
+	if (pg != NULL) {
 		err = 0;
 		/* The PTE should never be already set nor present in the
 		 * hash table
diff --git a/arch/powerpc/mm/ppc_mmu_32.c b/arch/powerpc/mm/ppc_mmu_32.c
index 5c45d47..8e95c56 100644
--- a/arch/powerpc/mm/ppc_mmu_32.c
+++ b/arch/powerpc/mm/ppc_mmu_32.c
@@ -182,7 +182,7 @@ void hash_preload(struct mm_struct *mm, 
 {
 	pmd_t *pmd;
 
-	if (Hash == 0)
+	if (Hash == NULL)
 		return;
 	pmd = pmd_offset(pud_offset(pgd_offset(mm, ea), ea), ea);
 	if (!pmd_none(*pmd))
diff --git a/arch/powerpc/mm/tlb_32.c b/arch/powerpc/mm/tlb_32.c
index eb4b512..5db5aff 100644
--- a/arch/powerpc/mm/tlb_32.c
+++ b/arch/powerpc/mm/tlb_32.c
@@ -40,7 +40,7 @@ void flush_hash_entry(struct mm_struct *
 {
 	unsigned long ptephys;
 
-	if (Hash != 0) {
+	if (Hash != NULL) {
 		ptephys = __pa(ptep) & PAGE_MASK;
 		flush_hash_pages(mm->context.id, addr, ptephys, 1);
 	}
@@ -52,7 +52,7 @@ void flush_hash_entry(struct mm_struct *
  */
 void flush_tlb_page_nohash(struct vm_area_struct *vma, unsigned long addr)
 {
-	if (Hash != 0)
+	if (Hash != NULL)
 		return;
 	_tlbie(addr);
 }
@@ -63,7 +63,7 @@ void flush_tlb_page_nohash(struct vm_are
  */
 void tlb_flush(struct mmu_gather *tlb)
 {
-	if (Hash == 0) {
+	if (Hash == NULL) {
 		/*
 		 * 603 needs to flush the whole TLB here since
 		 * it doesn't use a hash table.
@@ -104,7 +104,7 @@ static void flush_range(struct mm_struct
 	int count;
 	unsigned int ctx = mm->context.id;
 
-	if (Hash == 0) {
+	if (Hash == NULL) {
 		_tlbia();
 		return;
 	}
@@ -144,7 +144,7 @@ void flush_tlb_mm(struct mm_struct *mm)
 {
 	struct vm_area_struct *mp;
 
-	if (Hash == 0) {
+	if (Hash == NULL) {
 		_tlbia();
 		return;
 	}
@@ -165,7 +165,7 @@ void flush_tlb_page(struct vm_area_struc
 	struct mm_struct *mm;
 	pmd_t *pmd;
 
-	if (Hash == 0) {
+	if (Hash == NULL) {
 		_tlbie(vmaddr);
 		return;
 	}
diff --git a/arch/powerpc/platforms/52xx/lite5200.c b/arch/powerpc/platforms/52xx/lite5200.c
index 5c46e89..9926396 100644
--- a/arch/powerpc/platforms/52xx/lite5200.c
+++ b/arch/powerpc/platforms/52xx/lite5200.c
@@ -118,7 +118,7 @@ static void __init lite5200_setup_arch(v
 	if (np) {
 		const unsigned int *fp =
 			of_get_property(np, "clock-frequency", NULL);
-		if (fp != 0)
+		if (fp != NULL)
 			loops_per_jiffy = *fp / HZ;
 		else
 			loops_per_jiffy = 50000000 / HZ;
diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c b/arch/powerpc/platforms/83xx/mpc832x_mds.c
index b39cb52..b2bf27d 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c
@@ -65,7 +65,7 @@ static void __init mpc832x_sys_setup_arc
 
 	/* Map BCSR area */
 	np = of_find_node_by_name(NULL, "bcsr");
-	if (np != 0) {
+	if (np != NULL) {
 		struct resource res;
 
 		of_address_to_resource(np, 0, &res);
diff --git a/arch/powerpc/platforms/83xx/mpc836x_mds.c b/arch/powerpc/platforms/83xx/mpc836x_mds.c
index 0e615fd..b979fcf 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_mds.c
@@ -71,7 +71,7 @@ static void __init mpc836x_mds_setup_arc
 
 	/* Map BCSR area */
 	np = of_find_node_by_name(NULL, "bcsr");
-	if (np != 0) {
+	if (np != NULL) {
 		struct resource res;
 
 		of_address_to_resource(np, 0, &res);
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
index 40a8286..083f915 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
@@ -201,11 +201,11 @@ #endif
 		ppc_md.progress("mpc85xx_ads_setup_arch()", 0);
 
 	cpu = of_find_node_by_type(NULL, "cpu");
-	if (cpu != 0) {
+	if (cpu != NULL) {
 		const unsigned int *fp;
 
 		fp = of_get_property(cpu, "clock-frequency", NULL);
-		if (fp != 0)
+		if (fp != NULL)
 			loops_per_jiffy = *fp / HZ;
 		else
 			loops_per_jiffy = 50000000 / HZ;
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
index 6a171e9..bc29eff 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -275,11 +275,11 @@ #endif
 		ppc_md.progress("mpc85xx_cds_setup_arch()", 0);
 
 	cpu = of_find_node_by_type(NULL, "cpu");
-	if (cpu != 0) {
+	if (cpu != NULL) {
 		const unsigned int *fp;
 
 		fp = of_get_property(cpu, "clock-frequency", NULL);
-		if (fp != 0)
+		if (fp != NULL)
 			loops_per_jiffy = *fp / HZ;
 		else
 			loops_per_jiffy = 500000000 / HZ;
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
index e9eaa07..fad9418 100644
--- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
+++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -333,11 +333,11 @@ mpc86xx_hpcn_setup_arch(void)
 		ppc_md.progress("mpc86xx_hpcn_setup_arch()", 0);
 
 	np = of_find_node_by_type(NULL, "cpu");
-	if (np != 0) {
+	if (np != NULL) {
 		const unsigned int *fp;
 
 		fp = of_get_property(np, "clock-frequency", NULL);
-		if (fp != 0)
+		if (fp != NULL)
 			loops_per_jiffy = *fp / HZ;
 		else
 			loops_per_jiffy = 50000000 / HZ;
diff --git a/arch/powerpc/platforms/8xx/mpc86xads_setup.c b/arch/powerpc/platforms/8xx/mpc86xads_setup.c
index cf0e7bc..1b02ff1 100644
--- a/arch/powerpc/platforms/8xx/mpc86xads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc86xads_setup.c
@@ -257,11 +257,11 @@ static void __init mpc86xads_setup_arch(
 	struct device_node *cpu;
 
 	cpu = of_find_node_by_type(NULL, "cpu");
-	if (cpu != 0) {
+	if (cpu != NULL) {
 		const unsigned int *fp;
 
 		fp = of_get_property(cpu, "clock-frequency", NULL);
-		if (fp != 0)
+		if (fp != NULL)
 			loops_per_jiffy = *fp / HZ;
 		else
 			loops_per_jiffy = 50000000 / HZ;
diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
index 5a808d6..cd435f2 100644
--- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
@@ -409,11 +409,11 @@ static void __init mpc885ads_setup_arch(
 	struct device_node *cpu;
 
 	cpu = of_find_node_by_type(NULL, "cpu");
-	if (cpu != 0) {
+	if (cpu != NULL) {
 		const unsigned int *fp;
 
 		fp = of_get_property(cpu, "clock-frequency", NULL);
-		if (fp != 0)
+		if (fp != NULL)
 			loops_per_jiffy = *fp / HZ;
 		else
 			loops_per_jiffy = 50000000 / HZ;
diff --git a/arch/powerpc/platforms/maple/pci.c b/arch/powerpc/platforms/maple/pci.c
index fceaae4..3e928d6 100644
--- a/arch/powerpc/platforms/maple/pci.c
+++ b/arch/powerpc/platforms/maple/pci.c
@@ -38,7 +38,7 @@ static struct pci_controller *u3_agp, *u
 
 static int __init fixup_one_level_bus_range(struct device_node *node, int higher)
 {
-	for (; node != 0;node = node->sibling) {
+	for (; node != NULL;node = node->sibling) {
 		const int *bus_range;
 		const unsigned int *class_code;
 		int len;
diff --git a/arch/powerpc/platforms/maple/setup.c b/arch/powerpc/platforms/maple/setup.c
index 354c058..b075c15 100644
--- a/arch/powerpc/platforms/maple/setup.c
+++ b/arch/powerpc/platforms/maple/setup.c
@@ -250,7 +250,7 @@ static void __init maple_init_IRQ(void)
 	root = of_find_node_by_path("/");
 	naddr = of_n_addr_cells(root);
 	opprop = of_get_property(root, "platform-open-pic", &opplen);
-	if (opprop != 0) {
+	if (opprop != NULL) {
 		openpic_addr = of_read_number(opprop, naddr);
 		has_isus = (opplen > naddr);
 		printk(KERN_DEBUG "OpenPIC addr: %lx, has ISUs: %d\n",
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c
index 92586db..0943d69 100644
--- a/arch/powerpc/platforms/powermac/pci.c
+++ b/arch/powerpc/platforms/powermac/pci.c
@@ -62,7 +62,7 @@ #define BANDIT_COHERENT	0x40
 
 static int __init fixup_one_level_bus_range(struct device_node *node, int higher)
 {
-	for (; node != 0;node = node->sibling) {
+	for (; node != NULL;node = node->sibling) {
 		const int * bus_range;
 		const unsigned int *class_code;
 		int len;
diff --git a/arch/powerpc/platforms/powermac/pfunc_core.c b/arch/powerpc/platforms/powermac/pfunc_core.c
index 8543423..aed0c15 100644
--- a/arch/powerpc/platforms/powermac/pfunc_core.c
+++ b/arch/powerpc/platforms/powermac/pfunc_core.c
@@ -685,7 +685,7 @@ #define PP_PREFIX "platform-do-"
 	const int plen = strlen(PP_PREFIX);
 	int count = 0;
 
-	for (pp = dev->node->properties; pp != 0; pp = pp->next) {
+	for (pp = dev->node->properties; pp != NULL; pp = pp->next) {
 		char *name;
 		if (strncmp(pp->name, PP_PREFIX, plen) != 0)
 			continue;
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index 7ccb923..75b600a 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -261,12 +261,12 @@ static void __init l2cr_init(void)
 	/* Checks "l2cr-value" property in the registry */
 	if (cpu_has_feature(CPU_FTR_L2CR)) {
 		struct device_node *np = of_find_node_by_name(NULL, "cpus");
-		if (np == 0)
+		if (np == NULL)
 			np = of_find_node_by_type(NULL, "cpu");
-		if (np != 0) {
+		if (np != NULL) {
 			const unsigned int *l2cr =
 				of_get_property(np, "l2cr-value", NULL);
-			if (l2cr != 0) {
+			if (l2cr != NULL) {
 				ppc_override_l2cr = 1;
 				ppc_override_l2cr_value = *l2cr;
 				_set_L2CR(0);
diff --git a/arch/powerpc/platforms/powermac/time.c b/arch/powerpc/platforms/powermac/time.c
index bf9da56..1767b2d 100644
--- a/arch/powerpc/platforms/powermac/time.c
+++ b/arch/powerpc/platforms/powermac/time.c
@@ -260,11 +260,11 @@ int __init via_calibrate_decr(void)
 	struct resource rsrc;
 
 	vias = of_find_node_by_name(NULL, "via-cuda");
-	if (vias == 0)
+	if (vias == NULL)
 		vias = of_find_node_by_name(NULL, "via-pmu");
-	if (vias == 0)
+	if (vias == NULL)
 		vias = of_find_node_by_name(NULL, "via");
-	if (vias == 0 || of_address_to_resource(vias, 0, &rsrc))
+	if (vias == NULL || of_address_to_resource(vias, 0, &rsrc))
 		return 0;
 	via = ioremap(rsrc.start, rsrc.end - rsrc.start + 1);
 	if (via == NULL) {
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index f0b7146..10681c0 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -141,7 +141,7 @@ static void __init pseries_mpic_init_IRQ
 	np = of_find_node_by_path("/");
 	naddr = of_n_addr_cells(np);
 	opprop = of_get_property(np, "platform-open-pic", &opplen);
-	if (opprop != 0) {
+	if (opprop != NULL) {
 		openpic_addr = of_read_number(opprop, naddr);
 		printk(KERN_DEBUG "OpenPIC addr: %lx\n", openpic_addr);
 	}
diff --git a/arch/powerpc/sysdev/qe_lib/qe_io.c b/arch/powerpc/sysdev/qe_lib/qe_io.c
index e32b45b..575ae0a 100644
--- a/arch/powerpc/sysdev/qe_lib/qe_io.c
+++ b/arch/powerpc/sysdev/qe_lib/qe_io.c
@@ -162,7 +162,7 @@ int par_io_of_config(struct device_node 
 	}
 
 	ph = of_get_property(np, "pio-handle", NULL);
-	if (ph == 0) {
+	if (ph == NULL) {
 		printk(KERN_ERR "pio-handle not available \n");
 		return -1;
 	}
diff --git a/arch/powerpc/xmon/spu-dis.c b/arch/powerpc/xmon/spu-dis.c
index e5f8983..d9ef4dc 100644
--- a/arch/powerpc/xmon/spu-dis.c
+++ b/arch/powerpc/xmon/spu-dis.c
@@ -45,7 +45,7 @@ init_spu_disassemble (void)
       int o = spu_opcodes[i].opcode;
       if (o >= SPU_DISASM_TBL_SIZE)
 	continue; /* abort (); */
-      if (spu_disassemble_table[o] == 0)
+      if (spu_disassemble_table[o] == NULL)
 	spu_disassemble_table[o] = &spu_opcodes[i];
     }
 }
@@ -59,30 +59,30 @@ get_index_for_opcode (unsigned int insn)
 
   /* Init the table.  This assumes that element 0/opcode 0 (currently
    * NOP) is always used */
-  if (spu_disassemble_table[0] == 0)
+  if (spu_disassemble_table[0] == NULL)
     init_spu_disassemble ();
 
-  if ((index = spu_disassemble_table[opcode & 0x780]) != 0
+  if ((index = spu_disassemble_table[opcode & 0x780]) != NULL
       && index->insn_type == RRR)
     return index;
 
-  if ((index = spu_disassemble_table[opcode & 0x7f0]) != 0
+  if ((index = spu_disassemble_table[opcode & 0x7f0]) != NULL
       && (index->insn_type == RI18 || index->insn_type == LBT))
     return index;
 
-  if ((index = spu_disassemble_table[opcode & 0x7f8]) != 0
+  if ((index = spu_disassemble_table[opcode & 0x7f8]) != NULL
       && index->insn_type == RI10)
     return index;
 
-  if ((index = spu_disassemble_table[opcode & 0x7fc]) != 0
+  if ((index = spu_disassemble_table[opcode & 0x7fc]) != NULL
       && (index->insn_type == RI16))
     return index;
 
-  if ((index = spu_disassemble_table[opcode & 0x7fe]) != 0
+  if ((index = spu_disassemble_table[opcode & 0x7fe]) != NULL
       && (index->insn_type == RI8))
     return index;
 
-  if ((index = spu_disassemble_table[opcode & 0x7ff]) != 0)
+  if ((index = spu_disassemble_table[opcode & 0x7ff]) != NULL)
     return index;
 
   return NULL;
@@ -100,7 +100,7 @@ print_insn_spu (unsigned long insn, unsi
 
   index = get_index_for_opcode (insn);
 
-  if (index == 0)
+  if (index == NULL)
     {
       printf(".long 0x%x", insn);
     }
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 121b04d..3c37276 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -591,7 +591,7 @@ static int xmon_iabr_match(struct pt_reg
 {
 	if ((regs->msr & (MSR_IR|MSR_PR|MSR_SF)) != (MSR_IR|MSR_SF))
 		return 0;
-	if (iabr == 0)
+	if (iabr == NULL)
 		return 0;
 	xmon_core(regs, 0);
 	return 1;
@@ -1135,7 +1135,7 @@ #endif
 		} else {
 			/* assume a breakpoint address */
 			bp = at_breakpoint(a);
-			if (bp == 0) {
+			if (bp == NULL) {
 				printf("No breakpoint at %x\n", a);
 				break;
 			}

^ permalink raw reply related

* RE: [PATCH 1/5 v3] Add the explanation and a sample of RapidIO OF node to the document of booting-without-of.txt file.
From: Zhang Wei-r63237 @ 2007-07-27  9:12 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev, paulus, linux-kernel
In-Reply-To: <98CA70A1-9888-4508-A0E9-0EB28C14945F@kernel.crashing.org>

Hi, Kumar,=20
> +   RapidIO is a definition of a system interconnect. This node add
> > +   the support for RapidIO processor in kernel. The node name is
> > +   suggested to be 'rapidio'.
> > +
> > +   Required properties:
> > +
> > +    - compatible : Using "fsl,rapidio-delta" for Freescale PowerPC
> > +      RapidIO controller.
> > +    - #address-cells : Address representation for=20
> "rapidio" devices.
> > +      This field represents the number of cells needed to represent
> > +      the RapidIO address of the registers.
>=20
> Can you explain this a little further.  I'm a bit confused by =20
> 'RapidIO address of the registers'.
>=20
I want to present "This field represents the number of cells [needed to
represent the RapidIO address] of the registers."
Maybe I should remove 'of the registers' to be more clear.

Thanks!
-zw

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox