Booting the board using NFS on AMCC PPC 405EP

2008-03-28 Thread zechao wang
Hello Everyone :

I'm failed when booting the board using NFS on AMCC PPC 405EP.
I think i have read the getting started guide carefully!
The tftp server and nfs server can works well. 
And the firewall was disabled, too.

My env was set as below:
-
= printenv
baudrate=115200
loads_echo=1
preboot=echo;echo You are welcom!;echo;
netdev=eth0
hostname=IOStation
addip=setenv bootargs $(bootargs) 
ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname):$(netdev):off 
panic=1
addtty=setenv bootargs $(bootargs) console=ttyS0,$(baudrate)
flash_nfs=run nfsargs addip addtty;bootm $(kernel_addr)
nfs_boot=tftp $(kernel_addr) $(bootfile);run flash_nfs
bootfile=uImage
kernel_addr=20
ethaddr=00:01:02:03:04:87
bootargs=console=ttyS0,115200
cleanenv=protect off fffa fffb;erase fffa fffb
upuboot=tftp 10 u-boot.bin;protect off fffc ;era fffc 
;cp.b 10 fffc 4
burnKernel=tftp 20 uImage;nand erase 0 20;nand write.jffs2 ${fileaddr} 
0 ${filesize}
burnInitrd=tftp 20 uInitrd;nand erase 20 8;nand write.jffs2 
${fileaddr} 20 ${filesize}
burnCramfs=tftp 20 cramfs.img;nand erase 28 158;nand write.jffs2 
${fileaddr} 28 ${filesize}
burnJffs2=tftp 20 jffs2.img;nand erase 180 50;nand write.jffs2 
${fileaddr} 180 ${filesize}
burnFirmware=run burnKernel;run burnInitrd;run burnCramfs;run burnJffs2
flashboot=setenv bootargs console=ttyS0,115200;nand read.jffs2 20 0 
20;nand read.jffs2 40 20 8;bootm 20 40
ethact=VT6122
bootcmd=run nfs_boot
bootdelay=10
filesize=10930b
fileaddr=10
gatewayip=192.168.1.1
ipaddr=192.168.1.120
serverip=192.168.1.142
rootpath=/opt/eldk/ppc_4xx
nfsargs=setenv bootargs root=/dev/nfs rw nfsroot=$(serverip):$(rootpath)
stdin=serial
stdout=serial
stderr=serial
ver=U-Boot 1.2.0 (Jan 26 2008 - 18:50:29)

Environment size: 1600/65532 bytes
-

And the whole log is:
-
U-Boot 1.2.0 (Jan 26 2008 - 18:50:29)

CPU:   AMCC PowerPC 405EP Rev. B at 266.666 MHz (PLB=133, OPB=66, EBC=66 MHz)
   I2C boot EEPROM disabled
   Internal PCI arbiter enabled
   16 kB I-Cache 16 kB D-Cache
Board: Bubinga - AMCC PPC405EP Evaluation Board
I2C:   ready
DRAM:  64 MB
FLASH: 512 kB
NAND:  64 MiB
In:serial
Out:   serial
Err:   serial
Net:   VT6122

You are welcom!

Hit any key to stop autoboot:  0
Link autonegation speed 100M bps full duplex
Using VT6122 device
TFTP from server 192.168.1.142; our IP address is 192.168.1.120
Filename 'uImage'.
Load address: 0x20
Loading: #
 #
 #
 ##
done
Bytes transferred = 1086219 (10930b hex)
Checking ...
Check1. Check2. ## Booting image at 0020 ...
   Image Name:   Linux-2.6.19.2
   Created:  2008-03-25  11:15:51 UTC
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:1086155 Bytes =  1 MB
   Load Address: 
   Entry Point:  
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
Linux version 2.6.19.2 ([EMAIL PROTECTED]) (gcc version 4.0.0 (DENX ELDK 4.1 
4.0.0)) #6 Tue Mar 25 19:15:48 CST 2008
IBM Bubinga port (MontaVista Software, Inc. [EMAIL PROTECTED])
Zone PFN ranges:
  DMA 0 -16384
  Normal  16384 -16384
early_node_map[1] active PFN ranges
0:0 -16384
Built 1 zonelists.  Total pages: 16256
Kernel command line: root=/dev/nfs rw nfsroot=192.168.1.142:/opt/eldk/ppc_4xx 
ip=192.168.1.120:192.168.1.142:192.168.1.1::IOStation:eth0:off p0PID hash table 
entries: 256 (order: 8, 1024 bytes)
Warning: real time clock seems stuck!
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 62592k available (1764k kernel code, 428k data, 132k init, 0k highmem)
Mount-cache hash table entries: 512
NET: Registered protocol family 16
PCI: Probing PCI hardware
NET: Registered protocol family 2
IP route cache hash table entries: 512 (order: -1, 2048 bytes)
TCP established hash table entries: 2048 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 2048 bind 1024)
TCP reno registered
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
Generic RTC Driver v1.07
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing disabled
serial8250: ttyS0 at MMIO 0x0 (irq = 0) is a 16550A
serial8250: ttyS1 at MMIO 0x0 (irq = 1) is a 16550A
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
loop: loaded (max 8 devices)
VIA Networking 

Re: Patch: FW:Xilinx: BSP: Updated ML405 to match hardware used fortesting

2008-03-28 Thread Guillaume Dargaud
 I'm trying to get things up and running on a Xilinx Virtex-4 ml405 
board,
 and as such I've been trying to figure out the following recent message 
to

 the list:
 http://patchwork.ozlabs.org/linuxppc/patch?person=1226id=17037

 I don't understand what this patch applies to: it references files such 
as

 ml405_defconfig which are not part of the normal kernel tree and which I
 cannot find anywhere. Is there some other kind of patch that needs to 
apply

 first in order to get for instance CONFIG_XILINX_DRIVERS,
 CONFIG_XILINX_EMAC, etc...



It applies to Xilinx's git tree of the Linux kernel.


Fair enough.

OK, I managed to install git, download the Xilinx kernel source tree, 
integrate it into root and compile it successfully...


Now I'd like to understand this ml405_defconfig file. I cannot replace my 
.config with it because it gives me:


$ make ARCH=ppc linux26-menuconfig
[ -f 
/home/guinevere/buildroot/project_build_ppc/genepy/linux-2.6.24/.config ] |
| cp local/genepy/linux-2.6.24.config 
/home/guinevere/buildroot/project_build_pp

c/genepy/linux-2.6.24/.config
/usr/bin/make -j1 HOSTCC=/usr/bin/gcc HOSTCFLAGS= ARCH=powerpc 
CFLAGS_KERNEL

=-Os -I/home/guinevere/buildroot/build_ppc/staging_dir/usr/include -I/home/guin
evere/buildroot/build_ppc/staging_dir/include --sysroot=/home/guinevere/buildroo
t/build_ppc/staging_dir/ -isysroot 
/home/guinevere/buildroot/build_ppc/staging_d
ir -mtune=405 
INSTALL_MOD_PATH=/home/guinevere/buildroot/project_build_ppc/gene
py/root 
CROSS_COMPILE=/home/guinevere/buildroot/build_ppc/staging_dir/usr/bin/pp
c-linux-uclibc- 
LDFLAGS=-L/home/guinevere/buildroot/build_ppc/staging_dir/lib -

L/home/guinevere/buildroot/build_ppc/staging_dir/usr/lib --sysroot=/home/guineve
re/buildroot/build_ppc/staging_dir/ 
LZMA=/home/guinevere/buildroot/toolchain_b
uild_ppc/bin/lzma  -C 
/home/guinevere/buildroot/project_build_ppc/genepy/linux-

2.6.24 menuconfig
make[1]: Entering directory 
`/home/guinevere/buildroot/project_build_ppc/genepy/

linux-2.6.24'
scripts/kconfig/mconf arch/powerpc/Kconfig
.config:117:warning: trying to assign nonexistent symbol WANT_EARLY_SERIAL
.config:122:warning: trying to assign nonexistent symbol BUBINGA
.config:123:warning: trying to assign nonexistent symbol CPCI405
.config:124:warning: trying to assign nonexistent symbol EP405
.config:127:warning: trying to assign nonexistent symbol SYCAMORE
.config:129:warning: trying to assign nonexistent symbol XILINX_ML300
.config:130:warning: trying to assign nonexistent symbol XILINX_XUPV2P
.config:131:warning: trying to assign nonexistent symbol XILINX_ML403
.config:132:warning: trying to assign nonexistent symbol XILINX_ML405
.config:133:warning: trying to assign nonexistent symbol XILINX_ML41x
.config:138:warning: trying to assign nonexistent symbol XILINX_EMBED_CONFIG
.config:139:warning: trying to assign nonexistent symbol EMBEDDEDBOOT
.config:140:warning: trying to assign nonexistent symbol PPC4xx_DMA
.config:142:warning: trying to assign nonexistent symbol UART0_TTYS0
.config:143:warning: trying to assign nonexistent symbol UART0_TTYS1
.config:149:warning: trying to assign nonexistent symbol PC_KEYBOARD
.config:759:warning: trying to assign nonexistent symbol SERIAL_TEXT_DEBUG

So my question is that even with a full (?) Xilinx kernel, there seems to be 
missing drivers. Does this have to do with the BSP ?


Thanks
--
Guillaume Dargaud
http://www.gdargaud.net/


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: OF compatible MTD platform RAM driver ?

2008-03-28 Thread Sergei Shtylyov

David Gibson wrote:

  Heh, we've gone thru physmap before -- it was labelled 
Linux-specific name (well, I'd agree with that).



physmap stands for physically mapped. That doesn't sound
Linux-specific to me, the fact that the MTD driver has the same name
is a pure coincidence.  linmap-rom and linmap-rom sound even more
Linux-specific :-)



It may not be Linux specific per se, but it's a bad name, because the
fact that the device is physically direct mapped isn't a useful
distinguishing feature of the device.


  Yeah, it's not a propery of a device itself (yet, the device would be 
useless if this information is not supplied in the tree somehow). Yet 
remember the now ungoing discussion about reg-shift property for UARTs -- 
some people said that the fact that this property may not be a feature of 
device is irrelevant WRT the binding. :-)


Main memory is also direct physically mapped, after all,  but that's not 
what you want to cover

with this description.


 Haven't ever seen the description of memory as a device (unless you mean 
the memory node which can hardly be considered proper device -- mainly 
because of their usual placement at the top of the tree, and not where a 
RAM device logically should be in the bus hierarchy).



Yes, I mean the memory node.  And although it's no very likely,
there's no inherent reason a RAM device couldn't also be at the top of
the tree, on a CPU with the right sort of localbus.


   Yeah, according to the spec. this represents a RAM device. Too bad it's 
too often misplaced in the tree being on the top layer, and creating confusion 
(I used to misplace MTD device because of that)... :-(


In general how a device is wired is described by where it sits in the 
tree, not by its properties.


  Oh, another argument against reg-shift in the Xilinx UART quarry... 
:-)



Not really.  I was perhaps a bit strong, wiring information in the
properties isn't necessarily wrong, but it does need a close look.
reg-shift is a useful compromise.


   And I've heard it's been spec'ed already. :-)
   And MTD could surely a subject to alike compromise since it can be wired 
to the bus in a weird way too (not very likely though).



not inherent; it could be trivially extended to also instantiate a
non-direct-mapped device (as long as the underlying mtd layer
supported it, of course).   It bears no relation at all to the
physmap driver, except historical accident.


  This driver resides on the top, device mapping layer of the MTD 


   Which is actually bottom of course call-wise since it reads/writes the 
actual data for the upper layers.


hierarchy, and I don't see a point of cramming support for all the possible 
mappings into one driver vs doing it as the *separate* specific drivers in 
drivers/mtd/mapps/



Because doing it as separate drivers would mean duplicating most of
physmap_of for absolutely no reason.  I'll say it again there is


   Duplicating what, device probe/remove code? Partition parsing has been at 
last factored out into separate module by somebody (that patch should be 
queued in the MTD tree though I'm not sure), the old probing/partition code 
(i.e. our lame one) is not needed for the newly added devices...



*nothing* that actually relies on the direct mapping in physmap_of;


   Really? Even simple_map_init() call it does?


the *only* thing it does is take the device tree information and
marshal it into an initialization call for the appropriate mtd chip
drivers.


   No, not only that...


I really should get around to sending a patch to rename physmap_of to
of_mtd.c.


   I don't think you should bother with that.

-- as it has been done in the MTD tree before the great 
OF revolution. This is really strange idea...



The only reason mtd needs heaps of little map drivers (which barely
deserve the title of driver)


   It's a layered driver structure


is because there wasn't a single
generally available source of information about where and how flash
was mapped


   Not entirely true. You could try passing extra info with the platform 
device information...



so a whole pile of platform or sitation specific ways of
getting that information were needed.


   Some drivers read the h/w registers to determine the right type of mapping 
-- well, this probably could be replaced with reading this info from the 
device tree...



With a device tree all that can
be replaced with just getting the information from the device tree.


   Don't forget that such a universal driver would be taking extra kernel 
memory space as well, being loaded with the unused code handling all known 
mappings as well as extra probe/remove code...


WBR, Sergei
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: Patch: FW:Xilinx: BSP: Updated ML405 to match hardware usedfortesting

2008-03-28 Thread Guillaume Dargaud

I should add that I've tried several things:
- compile the Xilinx kernel as indicated in my previous message.
- compile it with just the xparameters_ml*.h files added
- copy all the files from the BSP into the (Xilinx) kernel tree
- directly generate the BSP into the (Xilinx) kernel tree

For instance, the last one still gives me:
.config:117:warning: trying to assign nonexistent symbol WANT_EARLY_SERIAL
.config:122:warning: trying to assign nonexistent symbol BUBINGA
.config:123:warning: trying to assign nonexistent symbol CPCI405
.config:124:warning: trying to assign nonexistent symbol EP405
.config:127:warning: trying to assign nonexistent symbol SYCAMORE
.config:129:warning: trying to assign nonexistent symbol XILINX_ML300
.config:130:warning: trying to assign nonexistent symbol XILINX_XUPV2P
.config:131:warning: trying to assign nonexistent symbol XILINX_ML403
.config:132:warning: trying to assign nonexistent symbol XILINX_ML405
.config:133:warning: trying to assign nonexistent symbol XILINX_ML41x
.config:138:warning: trying to assign nonexistent symbol XILINX_EMBED_CONFIG
.config:139:warning: trying to assign nonexistent symbol EMBEDDEDBOOT
.config:140:warning: trying to assign nonexistent symbol PPC4xx_DMA
.config:142:warning: trying to assign nonexistent symbol UART0_TTYS0
.config:143:warning: trying to assign nonexistent symbol UART0_TTYS1
.config:149:warning: trying to assign nonexistent symbol PC_KEYBOARD
.config:759:warning: trying to assign nonexistent symbol SERIAL_TEXT_DEBUG
.config:772:warning: trying to assign nonexistent symbol XILINX_OCP
.config:773:warning: trying to assign nonexistent symbol XILINX_ML40x


Two more things:

$ make ARCH=ppc ml405_defconfig
cp  .config
cp: missing destination file operand after `.config'
Try `cp --help' for more information.
make: *** [ml405_defconfig] Error 1


And on the page http://wiki.secretlab.ca/index.php/Linux_on_Xilinx_Virtex
which I've been studying closely, I also tried the Secret Lab repository:
$ git clone git://git.secretlab.ca/git/linux-2.6-virtex.git
Initialized empty Git repository in 
/home/guinevere/buildroot/linux-2.6-virtex/.git/

fatal: The remote end hung up unexpectedly
fetch-pack from 'git://git.secretlab.ca/git/linux-2.6-virtex.git' failed.
--
Guillaume Dargaud
http://www.gdargaud.net/


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Please pull powerpc.git merge branch

2008-03-28 Thread Paul Mackerras
Linus,

I have added another commit to the powerpc.git merge branch, so when
you do:

git pull \
git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc.git merge

you'll get a fix for a bug where the hardware data breakpoint would
sometimes fail to trigger on powerpc, if multiple threads put a
breakpoint on the same address.  The bug has been around for a while
and Michael Ellerman just found the cause and posted a fix.

Thanks,
Paul.

 arch/powerpc/configs/pasemi_defconfig |  142 -
 arch/powerpc/kernel/process.c |   10 +-
 2 files changed, 93 insertions(+), 59 deletions(-)

commit a2ceff5e555e664751bc653a4d9b133efa18c742
Author: Michael Ellerman [EMAIL PROTECTED]
Date:   Fri Mar 28 19:11:48 2008 +1100

[POWERPC] Fix missed hardware breakpoints across multiple threads

There is a bug in the powerpc DABR (data access breakpoint) handling,
which can result in us missing breakpoints if several threads are trying
to break on the same address.

The circumstances are that do_page_fault() calls do_dabr(), this clears
the DABR (sets it to 0) and sets up the signal which will report to
userspace that the DABR was hit. The do_signal() code will restore the DABR
value on the way out to userspace.

If we reschedule before calling do_signal(), __switch_to() will check the
cached DABR value and compare it to the new thread's value, if they match
we don't set the DABR in hardware.

So if two threads have the same DABR value, and we schedule from one to
the other after taking the interrupt for the first thread hitting the DABR,
the second thread will run without the DABR set in hardware.

The cleanest fix is to move the cache update into set_dabr(), that way we
can't forget to do it.

Reported-by: Jan Kratochvil [EMAIL PROTECTED]
Signed-off-by: Michael Ellerman [EMAIL PROTECTED]
Signed-off-by: Paul Mackerras [EMAIL PROTECTED]

commit 5c29934de29ddd7ecd913d83cad28e872f2e8c78
Author: Olof Johansson [EMAIL PROTECTED]
Date:   Tue Mar 25 10:28:26 2008 -0500

[POWERPC] update pasemi_defconfig

Disable GEN_RTC since it conflicts with the i2c rtc drivers registering,
besides that keep most of the new defaults.

Signed-off-by: Olof Johansson [EMAIL PROTECTED]
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: Missing patch for MPC5200B register definitions?

2008-03-28 Thread Matt Sealey


Grant Likely wrote:

On Wed, Mar 26, 2008 at 10:15 AM, Matt Sealey [EMAIL PROTECTED] wrote:

I've just been looking into the MPC5200B AC97 driver breakage with the
 latest Git kernel, and found the following patch;

 http://ozlabs.org/pipermail/linuxppc-dev/2007-May/035952.html

 Is not in the latest tree. As such anything which uses the new MPC5200B
 registers (especially important on AC97 and probably not used otherwise)
 has not or was not applied.

 Since the latest kernel source from git actually includes the MPC5121E
 differences, I assume this is a regression?

 How do we go about fixing this?


Write a patch to apply that change in arch/powerpc and post it to the
list.  If it looks good, I'll pick it up.


I'll make one now. The AC97 driver needs it anyway, later, plus some
definitions are missing for PSC control.. also only used by the AC97
driver for now, but still probably quite important (or just hardcoded
elsewhere).


BTW, did you figure out if the AC97 driver is being picked up by the
ALSA maintainers?


We just worked around a crash bug (somehow..) but now we get no audio.
I'm not going to submit it to them until we can actually get sound
out of the damn thing..

--
Matt Sealey [EMAIL PROTECTED]
Genesi, Manager, Developer Relations
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: Booting the board using NFS on AMCC PPC 405EP

2008-03-28 Thread Stefan Roese
On Friday 28 March 2008, zechao wang wrote:
 I'm failed when booting the board using NFS on AMCC PPC 405EP.
 I think i have read the getting started guide carefully!
 The tftp server and nfs server can works well.
 And the firewall was disabled, too.

snip

 U-Boot 1.2.0 (Jan 26 2008 - 18:50:29)

 CPU:   AMCC PowerPC 405EP Rev. B at 266.666 MHz (PLB=133, OPB=66, EBC=66
 MHz) I2C boot EEPROM disabled
Internal PCI arbiter enabled
16 kB I-Cache 16 kB D-Cache
 Board: Bubinga - AMCC PPC405EP Evaluation Board

Is this really an IBM/AMCC Bubinga board?

 I2C:   ready
 DRAM:  64 MB
 FLASH: 512 kB
 NAND:  64 MiB
 In:serial
 Out:   serial
 Err:   serial
 Net:   VT6122

You are using not the SoC EMAC here. Why not? Is this Via chip connected to 
the PCI bus?

 You are welcom!

 Hit any key to stop autoboot:  0
 Link autonegation speed 100M bps full duplex
 Using VT6122 device
 TFTP from server 192.168.1.142; our IP address is 192.168.1.120
 Filename 'uImage'.
 Load address: 0x20
 Loading: #
  #
  #
  ##
 done
 Bytes transferred = 1086219 (10930b hex)
 Checking ...
 Check1. Check2. ## Booting image at 0020 ...
Image Name:   Linux-2.6.19.2
Created:  2008-03-25  11:15:51 UTC
Image Type:   PowerPC Linux Kernel Image (gzip compressed)
Data Size:1086155 Bytes =  1 MB
Load Address: 
Entry Point:  
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
 Linux version 2.6.19.2 ([EMAIL PROTECTED]) (gcc version 4.0.0 (DENX ELDK 4.1
 4.0.0)) #6 Tue Mar 25 19:15:48 CST 2008 IBM Bubinga port (MontaVista
 Software, Inc. [EMAIL PROTECTED])
 Zone PFN ranges:
   DMA 0 -16384
   Normal  16384 -16384
 early_node_map[1] active PFN ranges
 0:0 -16384
 Built 1 zonelists.  Total pages: 16256
 Kernel command line: root=/dev/nfs rw
 nfsroot=192.168.1.142:/opt/eldk/ppc_4xx
 ip=192.168.1.120:192.168.1.142:192.168.1.1::IOStation:eth0:off p0PID hash
 table entries: 256 (order: 8, 1024 bytes) Warning: real time clock seems
 stuck!
 Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
 Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
 Memory: 62592k available (1764k kernel code, 428k data, 132k init, 0k
 highmem) Mount-cache hash table entries: 512
 NET: Registered protocol family 16
 PCI: Probing PCI hardware
 NET: Registered protocol family 2
 IP route cache hash table entries: 512 (order: -1, 2048 bytes)
 TCP established hash table entries: 2048 (order: 1, 8192 bytes)
 TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
 TCP: Hash tables configured (established 2048 bind 1024)
 TCP reno registered
 io scheduler noop registered
 io scheduler anticipatory registered (default)
 io scheduler deadline registered
 io scheduler cfq registered
 Generic RTC Driver v1.07
 Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing disabled
 serial8250: ttyS0 at MMIO 0x0 (irq = 0) is a 16550A
 serial8250: ttyS1 at MMIO 0x0 (irq = 1) is a 16550A
 RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
 loop: loaded (max 8 devices)
 VIA Networking Velocity Family Gigabit Ethernet Adapter Driver Ver. 1.14
 Copyright (c) 2002, 2003 VIA Networking Technologies, Inc.
 Copyright (c) 2004 Red Hat Inc.
 eth0: VIA Networking Velocity Family Gigabit Ethernet Adapter
 eth0: Ethernet Address: 00:01:02:03:04:87

Again, not the SoC EMAC here.

 Found: AMD AM29LV040B
 PPC40x-flash: Found 1 x8 devices at 0x0 in 8-bit bank
 number of JEDEC chips: 1
 cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
 Creating 3 MTD partitions on PPC40x-flash:
 0x-0x0002 : reserved
 0x0002-0x0004 : env
 0x0004-0x0008 : u-boot
 TCP cubic registered
 NET: Registered protocol family 1
 NET: Registered protocol family 17
 NET: Registered protocol family 15
 Velocity is AUTO mode
 IP-Config: Guessing netmask 255.255.255.0
 IP-Config: Complete:
   device=eth0, addr=192.168.1.120, mask=255.255.255.0, gw=192..168.1.1,
  host=IOStation, domain=, nis-domain=(none),
  bootserver=192.168.1.142, rootserver=192.168.1.142, rootpath=
 Looking up port of RPC 13/2 on 192.168.1.142
 eth0: Link autonegation speed 100M bps full duplex
 TD structure errror TDindex=0

This seems to be an error message from the network driver. I don't know this 
Via driver, so can't help here. But this seems to be the problem.

Best regards,
Stefan

=
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: [EMAIL PROTECTED]

Re: [PATCHv2 2/3] ep8248e: Reference SMC parameter RAM base in the device tree.

2008-03-28 Thread Laurent Pinchart
On Thursday 27 March 2008 16:39, Scott Wood wrote:
 On Thu, Mar 27, 2008 at 10:10:33AM +0100, Laurent Pinchart wrote:
  On Wednesday 26 March 2008 17:59, Scott Wood wrote:
   This breaks the bootwrapper console.
  
  And of course I forgot about that :-)
  
  The boot wrapper code doesn't have any dpram allocator. Any objection 
  against 
  using a chunk of dpram at a fixed location ? What about at the beginning of 
  the dpram ? The DTS muram node would then exclude a chunk of dpram at 
  offset 
  0x instead of 0x1100.
 
 I'm not entirely comfortable with using a chunk outside of what's in the
 muram node, and assuming that it's for the SMC pram -- what if there's
 microcode or something there?
 
 Since udbg is only for debugging, and is marked as potentially dangerous,
 how about just using the end of muram (as described in the device tree)? 
 If the muram is fully allocated, it won't happen until after the real
 serial console is initialized.

Very good idea. I'll prepare a new patch.

-- 
Laurent Pinchart
CSE Semaphore Belgium

Chaussée de Bruxelles, 732A
B-1410 Waterloo
Belgium

T +32 (2) 387 42 59
F +32 (2) 387 42 75


pgpBDePsDZGE8.pgp
Description: PGP signature
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [PATCHv2 2/3] ep8248e: Reference SMC parameter RAM base in the device tree.

2008-03-28 Thread Laurent Pinchart
On Friday 28 March 2008 14:58, Laurent Pinchart wrote:
 On Thursday 27 March 2008 16:39, Scott Wood wrote:
  On Thu, Mar 27, 2008 at 10:10:33AM +0100, Laurent Pinchart wrote:
   On Wednesday 26 March 2008 17:59, Scott Wood wrote:
This breaks the bootwrapper console.
   
   And of course I forgot about that :-)
   
   The boot wrapper code doesn't have any dpram allocator. Any objection 
against 
   using a chunk of dpram at a fixed location ? What about at the beginning 
of 
   the dpram ? The DTS muram node would then exclude a chunk of dpram at 
offset 
   0x instead of 0x1100.
  
  I'm not entirely comfortable with using a chunk outside of what's in the
  muram node, and assuming that it's for the SMC pram -- what if there's
  microcode or something there?
  
  Since udbg is only for debugging, and is marked as potentially dangerous,
  how about just using the end of muram (as described in the device tree)? 
  If the muram is fully allocated, it won't happen until after the real
  serial console is initialized.
 
 Very good idea. I'll prepare a new patch.

arch/powerpc/boot/cpm-serial.c stores the udbg buffer descriptors at the 
beginning of the muram. Should I move them at the end as well ?

-- 
Laurent Pinchart
CSE Semaphore Belgium

Chaussée de Bruxelles, 732A
B-1410 Waterloo
Belgium

T +32 (2) 387 42 59
F +32 (2) 387 42 75


pgpWJ7Sujdp9M.pgp
Description: PGP signature
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [PATCHv2 2/3] ep8248e: Reference SMC parameter RAM base in the device tree.

2008-03-28 Thread Scott Wood
On Fri, Mar 28, 2008 at 03:06:58PM +0100, Laurent Pinchart wrote:
 arch/powerpc/boot/cpm-serial.c stores the udbg buffer descriptors at the 
 beginning of the muram. Should I move them at the end as well ?

Sure; make sure to update the default descriptor addresses in the
Kconfig.

-Scott
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 1/3] mpc83xx: fix usb phy_type in mpc837x rdb device trees

2008-03-28 Thread Kim Phillips
the mpc837x rdb board uses low pin count interfaces (ULPI) to connect
to the USB PHY.

Signed-off-by: Kim Phillips [EMAIL PROTECTED]
---
 arch/powerpc/boot/dts/mpc8377_rdb.dts |2 +-
 arch/powerpc/boot/dts/mpc8378_rdb.dts |2 +-
 arch/powerpc/boot/dts/mpc8379_rdb.dts |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc8377_rdb.dts 
b/arch/powerpc/boot/dts/mpc8377_rdb.dts
index 440aa4d..1a7d516 100644
--- a/arch/powerpc/boot/dts/mpc8377_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc8377_rdb.dts
@@ -151,7 +151,7 @@
#size-cells = 0;
interrupt-parent = ipic;
interrupts = 38 0x8;
-   phy_type = utmi;
+   phy_type = ulpi;
};
 
[EMAIL PROTECTED] {
diff --git a/arch/powerpc/boot/dts/mpc8378_rdb.dts 
b/arch/powerpc/boot/dts/mpc8378_rdb.dts
index 9271153..9d259a1 100644
--- a/arch/powerpc/boot/dts/mpc8378_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc8378_rdb.dts
@@ -151,7 +151,7 @@
#size-cells = 0;
interrupt-parent = ipic;
interrupts = 38 0x8;
-   phy_type = utmi;
+   phy_type = ulpi;
};
 
[EMAIL PROTECTED] {
diff --git a/arch/powerpc/boot/dts/mpc8379_rdb.dts 
b/arch/powerpc/boot/dts/mpc8379_rdb.dts
index 0dda2fc..8dec2ee 100644
--- a/arch/powerpc/boot/dts/mpc8379_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc8379_rdb.dts
@@ -151,7 +151,7 @@
#size-cells = 0;
interrupt-parent = ipic;
interrupts = 38 0x8;
-   phy_type = utmi;
+   phy_type = ulpi;
};
 
[EMAIL PROTECTED] {
-- 
1.5.4.4.481.g5075

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 3/3] sata_fsl: reduce compatibility to fsl,pq-sata

2008-03-28 Thread Kim Phillips
as prescribed in Documentation/powerpc/booting-without-of.txt.

Signed-off-by: Kim Phillips [EMAIL PROTECTED]
Cc: Jeff Garzik [EMAIL PROTECTED]
---
 arch/powerpc/boot/dts/mpc8377_mds.dts |4 ++--
 arch/powerpc/boot/dts/mpc8379_mds.dts |8 
 drivers/ata/sata_fsl.c|5 +
 3 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc8377_mds.dts 
b/arch/powerpc/boot/dts/mpc8377_mds.dts
index 49c05e9..eac8e1b 100644
--- a/arch/powerpc/boot/dts/mpc8377_mds.dts
+++ b/arch/powerpc/boot/dts/mpc8377_mds.dts
@@ -255,14 +255,14 @@
};
 
[EMAIL PROTECTED] {
-   compatible = fsl,mpc8379-sata;
+   compatible = fsl,mpc8379-sata, fsl,pq-sata;
reg = 0x18000 0x1000;
interrupts = 44 0x8;
interrupt-parent = ipic;
};
 
[EMAIL PROTECTED] {
-   compatible = fsl,mpc8379-sata;
+   compatible = fsl,mpc8379-sata, fsl,pq-sata;
reg = 0x19000 0x1000;
interrupts = 45 0x8;
interrupt-parent = ipic;
diff --git a/arch/powerpc/boot/dts/mpc8379_mds.dts 
b/arch/powerpc/boot/dts/mpc8379_mds.dts
index fdb4a92..6f78a9f 100644
--- a/arch/powerpc/boot/dts/mpc8379_mds.dts
+++ b/arch/powerpc/boot/dts/mpc8379_mds.dts
@@ -255,28 +255,28 @@
};
 
[EMAIL PROTECTED] {
-   compatible = fsl,mpc8379-sata;
+   compatible = fsl,mpc8379-sata, fsl,pq-sata;
reg = 0x18000 0x1000;
interrupts = 44 0x8;
interrupt-parent = ipic;
};
 
[EMAIL PROTECTED] {
-   compatible = fsl,mpc8379-sata;
+   compatible = fsl,mpc8379-sata, fsl,pq-sata;
reg = 0x19000 0x1000;
interrupts = 45 0x8;
interrupt-parent = ipic;
};
 
[EMAIL PROTECTED] {
-   compatible = fsl,mpc8379-sata;
+   compatible = fsl,mpc8379-sata, fsl,pq-sata;
reg = 0x1a000 0x1000;
interrupts = 46 0x8;
interrupt-parent = ipic;
};
 
[EMAIL PROTECTED] {
-   compatible = fsl,mpc8379-sata;
+   compatible = fsl,mpc8379-sata, fsl,pq-sata;
reg = 0x1b000 0x1000;
interrupts = 47 0x8;
interrupt-parent = ipic;
diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c
index 07791a7..4c19855 100644
--- a/drivers/ata/sata_fsl.c
+++ b/drivers/ata/sata_fsl.c
@@ -1348,10 +1348,7 @@ static int sata_fsl_remove(struct of_device *ofdev)
 
 static struct of_device_id fsl_sata_match[] = {
{
-   .compatible = fsl,mpc8315-sata,
-   },
-   {
-   .compatible = fsl,mpc8379-sata,
+   .compatible = fsl,pq-sata,
},
{},
 };
-- 
1.5.4.4.481.g5075

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 3/3] sata_fsl: reduce compatibility to fsl,pq-sata

2008-03-28 Thread Kumar Gala


On Mar 28, 2008, at 10:51 AM, Kim Phillips wrote:

as prescribed in Documentation/powerpc/booting-without-of.txt.

Signed-off-by: Kim Phillips [EMAIL PROTECTED]
Cc: Jeff Garzik [EMAIL PROTECTED]
---


Jeff, I'll take this via the powerpc tree if you don't have any issue.

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] powerpc: move_device_tree() should be __init

2008-03-28 Thread Geert Uytterhoeven
WARNING: vmlinux.o(.text+0x1e4c0): Section mismatch in reference from the
function .move_device_tree() to the function .init.text:.lmb_alloc_base()
The function .move_device_tree() references
the function __init .lmb_alloc_base().
This is often because .move_device_tree lacks a __init 
annotation or the annotation of .lmb_alloc_base is wrong.

move_device_tree() is called from early_init_devtree() only, which is __init

Signed-off-by: Geert Uytterhoeven [EMAIL PROTECTED]
---
 arch/powerpc/kernel/prom.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -436,7 +436,7 @@ early_param(mem, early_parse_mem);
  * The device tree may be allocated beyond our memory limit, or inside the
  * crash kernel region for kdump. If so, move it out of the way.
  */
-static void move_device_tree(void)
+static void __init move_device_tree(void)
 {
unsigned long start, size;
void *p;

With kind regards,

Geert Uytterhoeven
Software Architect

Sony Network and Software Technology Center Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:+32 (0)2 700 8453
Fax:  +32 (0)2 700 8622
E-mail:   [EMAIL PROTECTED]
Internet: http://www.sony-europe.com/

Sony Network and Software Technology Center Europe
A division of Sony Service Centre (Europe) N.V.
Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium
VAT BE 0413.825.160 · RPR Brussels
Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

[PATCH] powerpc: arch_add_memory() cannot be __devinit

2008-03-28 Thread Geert Uytterhoeven
WARNING: vmlinux.o(.text+0xb41b0): Section mismatch in reference from the
function .add_memory() to the function .devinit.text:.arch_add_memory()
The function .add_memory() references
the function __devinit .arch_add_memory().
This is often because .add_memory lacks a __devinit 
annotation or the annotation of .arch_add_memory is wrong.

arch_add_memory() is also not __devinit on other architectures

Signed-off-by: Geert Uytterhoeven [EMAIL PROTECTED]
---
 arch/powerpc/mm/mem.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -111,7 +111,7 @@ int memory_add_physaddr_to_nid(u64 start
 }
 #endif
 
-int __devinit arch_add_memory(int nid, u64 start, u64 size)
+int arch_add_memory(int nid, u64 start, u64 size)
 {
struct pglist_data *pgdata;
struct zone *zone;

With kind regards,

Geert Uytterhoeven
Software Architect

Sony Network and Software Technology Center Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:+32 (0)2 700 8453
Fax:  +32 (0)2 700 8622
E-mail:   [EMAIL PROTECTED]
Internet: http://www.sony-europe.com/

Sony Network and Software Technology Center Europe
A division of Sony Service Centre (Europe) N.V.
Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium
VAT BE 0413.825.160 · RPR Brussels
Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

[PATCH 1/5] [v2][POWERPC] refactor dcr code

2008-03-28 Thread Stephen Neuendorffer
Previously, dcr support was configured at compile time to either using
MMIO or native dcr instructions.  Although this works for most
platforms, it fails on FPGA platforms:

1) Systems may include more than one dcr bus.
2) Systems may be native dcr capable and still use memory mapped dcr interface.

This patch provides runtime support based on the device trees for the
case where CONFIG_PPC_DCR_MMIO and CONFIG_PPC_DCR_NATIVE are both
selected.  Previously, this was a poorly defined configuration, which
happened to provide NATIVE support.  The runtime selection is made
based on the dcr slave device having a 'dcr-access-method' attribute
in the device tree.  If only one of the above options is selected,
then the code uses #defines to select only the used code in order to
avoid interoducing overhead in existing usage.

Signed-off-by: Stephen Neuendorffer [EMAIL PROTECTED]
---
 arch/powerpc/sysdev/dcr.c |   91 -
 include/asm-powerpc/dcr-generic.h |   49 
 include/asm-powerpc/dcr-mmio.h|   20 +---
 include/asm-powerpc/dcr-native.h  |   16 ---
 include/asm-powerpc/dcr.h |   36 ++-
 5 files changed, 186 insertions(+), 26 deletions(-)
 create mode 100644 include/asm-powerpc/dcr-generic.h

diff --git a/arch/powerpc/sysdev/dcr.c b/arch/powerpc/sysdev/dcr.c
index 437e48d..d3de0ff 100644
--- a/arch/powerpc/sysdev/dcr.c
+++ b/arch/powerpc/sysdev/dcr.c
@@ -23,6 +23,68 @@
 #include asm/prom.h
 #include asm/dcr.h
 
+#if defined(CONFIG_PPC_DCR_NATIVE)  defined(CONFIG_PPC_DCR_MMIO)
+
+bool dcr_map_ok_generic(dcr_host_t host)
+{
+   if (host.type == INVALID)
+   return 0;
+   else if (host.type == NATIVE)
+   return dcr_map_ok_native(host.host.native);
+   else
+   return dcr_map_ok_mmio(host.host.mmio);
+}
+EXPORT_SYMBOL_GPL(dcr_map_ok_generic);
+
+dcr_host_t dcr_map_generic(struct device_node *dev,
+  unsigned int dcr_n,
+  unsigned int dcr_c)
+{
+   dcr_host_t host;
+   const char *prop = of_get_property(dev, dcr-access-method, NULL);
+
+   if (!strcmp(prop, native)) {
+   host.type = NATIVE;
+   host.host.native = dcr_map_native(dev, dcr_n, dcr_c);
+   } else if (!strcmp(prop, mmio)) {
+   host.type = MMIO;
+   host.host.mmio = dcr_map_mmio(dev, dcr_n, dcr_c);
+   } else
+   host.type = INVALID;
+
+   return host;
+}
+EXPORT_SYMBOL_GPL(dcr_map_generic);
+
+void dcr_unmap_generic(dcr_host_t host, unsigned int dcr_c)
+{
+   if (host.type == NATIVE)
+   dcr_unmap_native(host.host.native, dcr_c);
+   else
+   dcr_unmap_mmio(host.host.mmio, dcr_c);
+}
+EXPORT_SYMBOL_GPL(dcr_unmap_generic);
+
+u32 dcr_read_generic(dcr_host_t host, unsigned int dcr_n)
+{
+   if (host.type == NATIVE)
+   return dcr_read_native(host.host.native, dcr_n);
+   else
+   return dcr_read_mmio(host.host.mmio, dcr_n);
+}
+EXPORT_SYMBOL_GPL(dcr_read_generic);
+
+void dcr_write_generic(dcr_host_t host, unsigned int dcr_n, u32 value)
+{
+   if (host.type == NATIVE)
+   dcr_write_native(host.host.native, dcr_n, value);
+   else
+   dcr_write_mmio(host.host.mmio, dcr_n, value);
+}
+EXPORT_SYMBOL_GPL(dcr_write_generic);
+
+#endif /* defined(CONFIG_PPC_DCR_NATIVE)  defined(CONFIG_PPC_DCR_MMIO) */
+
 unsigned int dcr_resource_start(struct device_node *np, unsigned int index)
 {
unsigned int ds;
@@ -47,7 +109,7 @@ unsigned int dcr_resource_len(struct device_node *np, 
unsigned int index)
 }
 EXPORT_SYMBOL_GPL(dcr_resource_len);
 
-#ifndef CONFIG_PPC_DCR_NATIVE
+#ifdef CONFIG_PPC_DCR_MMIO
 
 static struct device_node * find_dcr_parent(struct device_node * node)
 {
@@ -101,18 +163,19 @@ u64 of_translate_dcr_address(struct device_node *dev,
return ret;
 }
 
-dcr_host_t dcr_map(struct device_node *dev, unsigned int dcr_n,
-  unsigned int dcr_c)
+dcr_host_mmio_t dcr_map_mmio(struct device_node *dev,
+unsigned int dcr_n,
+unsigned int dcr_c)
 {
-   dcr_host_t ret = { .token = NULL, .stride = 0, .base = dcr_n };
+   dcr_host_mmio_t ret = { .token = NULL, .stride = 0, .base = dcr_n };
u64 addr;
 
pr_debug(dcr_map(%s, 0x%x, 0x%x)\n,
 dev-full_name, dcr_n, dcr_c);
 
addr = of_translate_dcr_address(dev, dcr_n, ret.stride);
-   pr_debug(translates to addr: 0x%lx, stride: 0x%x\n,
-addr, ret.stride);
+   pr_debug(translates to addr: 0x%llx, stride: 0x%x\n,
+(unsigned long long) addr, ret.stride);
if (addr == OF_BAD_ADDR)
return ret;
pr_debug(mapping 0x%x bytes\n, dcr_c * ret.stride);
@@ -124,11 +187,11 @@ dcr_host_t dcr_map(struct device_node *dev, unsigned int 
dcr_n,
ret.token -= dcr_n * 

[PATCH 3/5] [POWERPC] explicit dcr support

2008-03-28 Thread Stephen Neuendorffer
Added literal mapping support if no device-tree support.  Added
CONFIG_OF to guard device-tree parts, since literal support works for
arch=ppc.

Signed-off-by: Stephen Neuendorffer [EMAIL PROTECTED]
---
 arch/powerpc/sysdev/dcr.c |   82 -
 include/asm-powerpc/dcr-generic.h |2 +
 include/asm-powerpc/dcr-mmio.h|   11 +
 include/asm-powerpc/dcr-native.h  |8 
 include/asm-powerpc/dcr.h |   24 +++
 5 files changed, 108 insertions(+), 19 deletions(-)

diff --git a/arch/powerpc/sysdev/dcr.c b/arch/powerpc/sysdev/dcr.c
index d3de0ff..2ccae80 100644
--- a/arch/powerpc/sysdev/dcr.c
+++ b/arch/powerpc/sysdev/dcr.c
@@ -20,9 +20,34 @@
 #undef DEBUG
 
 #include linux/kernel.h
+#include linux/module.h
 #include asm/prom.h
 #include asm/dcr.h
 
+#ifdef CONFIG_OF
+static struct device_node *find_dcr_parent(struct device_node *node)
+{
+   struct device_node *par, *tmp;
+   const u32 *p;
+
+   for (par = of_node_get(node); par;) {
+   if (of_get_property(par, dcr-controller, NULL))
+   break;
+   p = of_get_property(par, dcr-parent, NULL);
+   tmp = par;
+   if (p == NULL)
+   par = of_get_parent(par);
+   else
+   par = of_find_node_by_phandle(*p);
+   of_node_put(tmp);
+   }
+   return par;
+}
+#endif /* CONFIG_OF */
+
+
+/* Indirection layer for providing both NATIVE and MMIO support. */
+
 #if defined(CONFIG_PPC_DCR_NATIVE)  defined(CONFIG_PPC_DCR_MMIO)
 
 bool dcr_map_ok_generic(dcr_host_t host)
@@ -36,12 +61,24 @@ bool dcr_map_ok_generic(dcr_host_t host)
 }
 EXPORT_SYMBOL_GPL(dcr_map_ok_generic);
 
+#ifdef CONFIG_OF
 dcr_host_t dcr_map_generic(struct device_node *dev,
   unsigned int dcr_n,
   unsigned int dcr_c)
 {
dcr_host_t host;
-   const char *prop = of_get_property(dev, dcr-access-method, NULL);
+   struct device_node *dp;
+
+   dp = find_dcr_parent(dev);
+   if (dp == NULL) {
+   host.type = INVALID;
+   return host;
+   }
+
+   const char *prop = of_get_property(dp, dcr-access-method, NULL);
+
+   pr_debug(dcr_map_generic(dcr-access-method = %s)\n,
+prop);
 
if (!strcmp(prop, native)) {
host.type = NATIVE;
@@ -56,6 +93,8 @@ dcr_host_t dcr_map_generic(struct device_node *dev,
 }
 EXPORT_SYMBOL_GPL(dcr_map_generic);
 
+#endif /* CONFIG_OF */
+
 void dcr_unmap_generic(dcr_host_t host, unsigned int dcr_c)
 {
if (host.type == NATIVE)
@@ -85,9 +124,10 @@ EXPORT_SYMBOL_GPL(dcr_write_generic);
 
 #endif /* defined(CONFIG_PPC_DCR_NATIVE)  defined(CONFIG_PPC_DCR_MMIO) */
 
+#ifdef CONFIG_OF
 unsigned int dcr_resource_start(struct device_node *np, unsigned int index)
 {
-   unsigned int ds;
+   int ds;
const u32 *dr = of_get_property(np, dcr-reg, ds);
 
if (dr == NULL || ds  1 || index = (ds / 8))
@@ -99,7 +139,7 @@ EXPORT_SYMBOL_GPL(dcr_resource_start);
 
 unsigned int dcr_resource_len(struct device_node *np, unsigned int index)
 {
-   unsigned int ds;
+   int ds;
const u32 *dr = of_get_property(np, dcr-reg, ds);
 
if (dr == NULL || ds  1 || index = (ds / 8))
@@ -109,26 +149,28 @@ unsigned int dcr_resource_len(struct device_node *np, 
unsigned int index)
 }
 EXPORT_SYMBOL_GPL(dcr_resource_len);
 
+#endif /* CONFIG_OF */
+
+
+
+/* Support for MMIO */
 #ifdef CONFIG_PPC_DCR_MMIO
 
-static struct device_node * find_dcr_parent(struct device_node * node)
+dcr_host_mmio_t dcr_map_mmio_literal_mmio(resource_size_t mmio_start,
+ unsigned int stride,
+ unsigned int dcr_n,
+ unsigned int dcr_c)
 {
-   struct device_node *par, *tmp;
-   const u32 *p;
-
-   for (par = of_node_get(node); par;) {
-   if (of_get_property(par, dcr-controller, NULL))
-   break;
-   p = of_get_property(par, dcr-parent, NULL);
-   tmp = par;
-   if (p == NULL)
-   par = of_get_parent(par);
-   else
-   par = of_find_node_by_phandle(*p);
-   of_node_put(tmp);
-   }
-   return par;
+   dcr_host_mmio_t host;
+   host.stride = stride;
+   host.token = ioremap(mmio_start, dcr_c * stride);
+   host.token -= dcr_n * stride;
+   host.base = dcr_n;
+   return host;
 }
+EXPORT_SYMBOL_GPL(dcr_map_mmio_literal_mmio);
+
+#ifdef CONFIG_OF
 
 u64 of_translate_dcr_address(struct device_node *dev,
 unsigned int dcr_n,
@@ -189,6 +231,8 @@ dcr_host_mmio_t dcr_map_mmio(struct device_node *dev,
 }
 EXPORT_SYMBOL_GPL(dcr_map_mmio);
 
+#endif /* CONFIG_OF */
+
 void dcr_unmap_mmio(dcr_host_mmio_t host, unsigned int dcr_c)
 {
   

Re: [PATCHv2 2/3] ep8248e: Reference SMC parameter RAM base in the device tree.

2008-03-28 Thread Laurent Pinchart
On Thursday 27 March 2008 16:39, Scott Wood wrote:
 On Thu, Mar 27, 2008 at 10:10:33AM +0100, Laurent Pinchart wrote:
  On Wednesday 26 March 2008 17:59, Scott Wood wrote:
   This breaks the bootwrapper console.
  
  And of course I forgot about that :-)
  
  The boot wrapper code doesn't have any dpram allocator. Any objection
  against using a chunk of dpram at a fixed location ? What about at the
  beginning of the dpram ? The DTS muram node would then exclude a chunk of
  dpram at offset 0x instead of 0x1100.
 
 I'm not entirely comfortable with using a chunk outside of what's in the
 muram node, and assuming that it's for the SMC pram -- what if there's
 microcode or something there?
 
 Since udbg is only for debugging, and is marked as potentially dangerous,
 how about just using the end of muram (as described in the device tree)? 
 If the muram is fully allocated, it won't happen until after the real
 serial console is initialized.

Locating the end of the muram isn't as straightforward as it could be. As the 
current code already uses the beginning of the muram to store the BDs and 
data buffers, should I really bother locating the end or can I store the SMC 
parameter ram at the beginning as well ?

If I'm not mistaken, once the SMC parameter ram gets relocated to the 
beginning/end of the muram, the boot loader preallocated space can be 
reclaimed and can be added to the muram in the device tree like I did in my 
previous patch. Is that correct ?

-- 
Laurent Pinchart
CSE Semaphore Belgium

Chaussée de Bruxelles, 732A
B-1410 Waterloo
Belgium

T +32 (2) 387 42 59
F +32 (2) 387 42 75


pgpHxgjsPOIfJ.pgp
Description: PGP signature
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [PATCH 3/3] sata_fsl: reduce compatibility to fsl,pq-sata

2008-03-28 Thread Jeff Garzik

Kumar Gala wrote:


On Mar 28, 2008, at 10:51 AM, Kim Phillips wrote:

as prescribed in Documentation/powerpc/booting-without-of.txt.

Signed-off-by: Kim Phillips [EMAIL PROTECTED]
Cc: Jeff Garzik [EMAIL PROTECTED]
---


Jeff, I'll take this via the powerpc tree if you don't have any issue.


ACK


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 2/5] [POWERPC] Xilinx: Virtex: Enable dcr for MMIO and NATIVE

2008-03-28 Thread Stephen Neuendorffer
FPGA designs may have need of both MMIO-based and NATIVE-based dcr
interfaces.

Signed-off-by: Stephen Neuendorffer [EMAIL PROTECTED]
---
 arch/powerpc/platforms/40x/Kconfig |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/platforms/40x/Kconfig 
b/arch/powerpc/platforms/40x/Kconfig
index a9260e2..b8e06df 100644
--- a/arch/powerpc/platforms/40x/Kconfig
+++ b/arch/powerpc/platforms/40x/Kconfig
@@ -123,6 +123,8 @@ config 405GPR
 
 config XILINX_VIRTEX
bool
+   select PPC_DCR_MMIO
+   select PPC_DCR_NATIVE
 
 config XILINX_VIRTEX_II_PRO
bool
-- 
1.5.3.4-dirty


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 1/3] mpc83xx: fix usb phy_type in mpc837x rdb device trees

2008-03-28 Thread Anton Vorontsov
On Fri, Mar 28, 2008 at 10:51:25AM -0500, Kim Phillips wrote:
 the mpc837x rdb board uses low pin count interfaces (ULPI) to connect
 to the USB PHY.

I've sent this fix two weeks ago...

http://ozlabs.org/pipermail/linuxppc-dev/2008-March/052926.html

 Signed-off-by: Kim Phillips [EMAIL PROTECTED]
 ---
  arch/powerpc/boot/dts/mpc8377_rdb.dts |2 +-
  arch/powerpc/boot/dts/mpc8378_rdb.dts |2 +-
  arch/powerpc/boot/dts/mpc8379_rdb.dts |2 +-
  3 files changed, 3 insertions(+), 3 deletions(-)
 
 diff --git a/arch/powerpc/boot/dts/mpc8377_rdb.dts 
 b/arch/powerpc/boot/dts/mpc8377_rdb.dts
 index 440aa4d..1a7d516 100644
 --- a/arch/powerpc/boot/dts/mpc8377_rdb.dts
 +++ b/arch/powerpc/boot/dts/mpc8377_rdb.dts
 @@ -151,7 +151,7 @@
   #size-cells = 0;
   interrupt-parent = ipic;
   interrupts = 38 0x8;
 - phy_type = utmi;
 + phy_type = ulpi;
   };
  
   [EMAIL PROTECTED] {
 diff --git a/arch/powerpc/boot/dts/mpc8378_rdb.dts 
 b/arch/powerpc/boot/dts/mpc8378_rdb.dts
 index 9271153..9d259a1 100644
 --- a/arch/powerpc/boot/dts/mpc8378_rdb.dts
 +++ b/arch/powerpc/boot/dts/mpc8378_rdb.dts
 @@ -151,7 +151,7 @@
   #size-cells = 0;
   interrupt-parent = ipic;
   interrupts = 38 0x8;
 - phy_type = utmi;
 + phy_type = ulpi;
   };
  
   [EMAIL PROTECTED] {
 diff --git a/arch/powerpc/boot/dts/mpc8379_rdb.dts 
 b/arch/powerpc/boot/dts/mpc8379_rdb.dts
 index 0dda2fc..8dec2ee 100644
 --- a/arch/powerpc/boot/dts/mpc8379_rdb.dts
 +++ b/arch/powerpc/boot/dts/mpc8379_rdb.dts
 @@ -151,7 +151,7 @@
   #size-cells = 0;
   interrupt-parent = ipic;
   interrupts = 38 0x8;
 - phy_type = utmi;
 + phy_type = ulpi;
   };
  
   [EMAIL PROTECTED] {
 -- 
 1.5.4.4.481.g5075

-- 
Anton Vorontsov
email: [EMAIL PROTECTED]
irc://irc.freenode.net/bd2
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 4/5] [PPC] update lmb for hotplug memory add/remove

2008-03-28 Thread Badari Pulavarty

Kumar Gala wrote:


On Mar 27, 2008, at 7:39 PM, Badari Pulavarty wrote:

ppc kernel maintains information about logical memory blocks in
lmb.memory structure at the boot time. Its not updated for
hotplug memory add/remove. hotplug memory notifier for memory
add/remove now updates lmb.memory.

This information is useful for eHEA driver to find out the memory
layout and holes.

NOTE: No special locking is needed for lmb_add() and lmb_remove().
Calls to these are serialized by caller. (pSeries_reconfig_chain).

Signed-off-by: Badari Pulavarty [EMAIL PROTECTED]
---
arch/powerpc/platforms/pseries/hotplug-memory.c |   43 +++
include/linux/lmb.h |3 -
lib/lmb.c   |   66 


3 files changed, 102 insertions(+), 10 deletions(-)


How is lmb_remove different than lmb_alloc?

- k

lmb_remove() can be used to punch a hole in to the existing memory block.
lmb_alloc() tries to allocate for a given alignment, I don't think it can
adjust the current entries. Isn't it ?

Thanks,
Badari

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[patch] PS3: Split device setup for static vs. dynamic devices

2008-03-28 Thread Geoff Levand

From: Geert Uytterhoeven [EMAIL PROTECTED]

Split the device setup code in ps3_register_repository_device() in two
routines:
  1. ps3_setup_static_device(), to handle the setup of static devices in the
 PS3 repository, which can be __init,
  2. ps3_setup_dynamic_device(), to handle the setup of storage devices that
 may appear later in the PS3 repository.

This fixes a few section mismatch warnings.

Signed-off-by: Geert Uytterhoeven [EMAIL PROTECTED]
Signed-off-by: Geoff Levand [EMAIL PROTECTED]
---

Hi Paul,

Here is another one for 2.6.26 that Geert just sent me.  Please apply.

-Geoff

 arch/powerpc/platforms/ps3/device-init.c |   78 ++-
 1 file changed, 46 insertions(+), 32 deletions(-)

--- a/arch/powerpc/platforms/ps3/device-init.c
+++ b/arch/powerpc/platforms/ps3/device-init.c
@@ -499,41 +499,14 @@ static int __init ps3_register_graphics_
 }
 
 /**
- * ps3_register_repository_device - Register a device from the repositiory 
info.
- *
+ * ps3_setup_dynamic_device - Setup a dynamic device from the repository
  */
 
-static int ps3_register_repository_device(
-   const struct ps3_repository_device *repo)
+static int ps3_setup_dynamic_device(const struct ps3_repository_device *repo)
 {
int result;
 
switch (repo-dev_type) {
-   case PS3_DEV_TYPE_SB_GELIC:
-   result = ps3_setup_gelic_device(repo);
-   if (result) {
-   pr_debug(%s:%d ps3_setup_gelic_device failed\n,
-   __func__, __LINE__);
-   }
-   break;
-   case PS3_DEV_TYPE_SB_USB:
-
-   /* Each USB device has both an EHCI and an OHCI HC */
-
-   result = ps3_setup_ehci_device(repo);
-
-   if (result) {
-   pr_debug(%s:%d ps3_setup_ehci_device failed\n,
-   __func__, __LINE__);
-   }
-
-   result = ps3_setup_ohci_device(repo);
-
-   if (result) {
-   pr_debug(%s:%d ps3_setup_ohci_device failed\n,
-   __func__, __LINE__);
-   }
-   break;
case PS3_DEV_TYPE_STOR_DISK:
result = ps3_setup_storage_dev(repo, PS3_MATCH_ID_STOR_DISK);
 
@@ -572,6 +545,48 @@ static int ps3_register_repository_devic
return result;
 }
 
+/**
+ * ps3_setup_static_device - Setup a static device from the repository
+ */
+
+static int __init ps3_setup_static_device(const struct ps3_repository_device 
*repo)
+{
+   int result;
+
+   switch (repo-dev_type) {
+   case PS3_DEV_TYPE_SB_GELIC:
+   result = ps3_setup_gelic_device(repo);
+   if (result) {
+   pr_debug(%s:%d ps3_setup_gelic_device failed\n,
+   __func__, __LINE__);
+   }
+   break;
+   case PS3_DEV_TYPE_SB_USB:
+
+   /* Each USB device has both an EHCI and an OHCI HC */
+
+   result = ps3_setup_ehci_device(repo);
+
+   if (result) {
+   pr_debug(%s:%d ps3_setup_ehci_device failed\n,
+   __func__, __LINE__);
+   }
+
+   result = ps3_setup_ohci_device(repo);
+
+   if (result) {
+   pr_debug(%s:%d ps3_setup_ohci_device failed\n,
+   __func__, __LINE__);
+   }
+   break;
+
+   default:
+   return ps3_setup_dynamic_device(repo);
+   }
+
+   return result;
+}
+
 static void ps3_find_and_add_device(u64 bus_id, u64 dev_id)
 {
struct ps3_repository_device repo;
@@ -601,7 +616,7 @@ found:
pr_debug(%s:%u: device %lu:%lu found after %u retries\n,
 __func__, __LINE__, bus_id, dev_id, retries);
 
-   ps3_register_repository_device(repo);
+   ps3_setup_dynamic_device(repo);
return;
 }
 
@@ -905,8 +920,7 @@ static int __init ps3_register_devices(v
 
ps3_register_graphics_devices();
 
-   ps3_repository_find_devices(PS3_BUS_TYPE_SB,
-   ps3_register_repository_device);
+   ps3_repository_find_devices(PS3_BUS_TYPE_SB, ps3_setup_static_device);
 
ps3_register_sound_devices();
 


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCHv2 2/3] ep8248e: Reference SMC parameter RAM base in the device tree.

2008-03-28 Thread Scott Wood

Laurent Pinchart wrote:
Locating the end of the muram isn't as straightforward as it could be. As the 
current code already uses the beginning of the muram to store the BDs and 
data buffers, should I really bother locating the end or can I store the SMC 
parameter ram at the beginning as well ?


Maybe, but the end would be safer.  What's the problem with finding the 
end?  Even the end of the first reg resource would be OK.


If I'm not mistaken, once the SMC parameter ram gets relocated to the 
beginning/end of the muram, the boot loader preallocated space can be 
reclaimed and can be added to the muram in the device tree like I did in my 
previous patch. Is that correct ?


Yes.

-Scott
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 2/2 v4] Add DIU platform code for MPC8610HPCD

2008-03-28 Thread Scott Wood

York Sun wrote:

+   np = of_find_compatible_node(NULL, NULL, fsl,fpga-pixis);
+   if (np) {
+   of_address_to_resource(np, 0, r);
+   of_node_put(np);
+   pixis_bdcfg0 = ioremap(r.start + 0x0008, sizeof(u8));
+   if (!pixis_bdcfg0) {
+   printk(KERN_ERR Err: can't map FPGA cfg register!\n);
+   return;
+   }
+   pixis_arch = ioremap(r.start + 0x0001, sizeof(u8));
+   if (!pixis_arch) {
+   printk(KERN_ERR Err: can't map FPGA arch register!\n);
+   return;
+   }


Just of_iomap() the whole resource, rather than doing it a byte at a time.


+int __init preallocate_diu_videomemory(void)
+{
+   pr_debug(diu_size=%lu\n, diu_ops.diu_size);
+
+   diu_ops.diu_mem = __alloc_bootmem(diu_ops.diu_size, 8, 0);
+   if (!diu_ops.diu_mem) {
+   printk(KERN_ERR fsl-diu: cannot allocate %lu bytes\n,
+   diu_ops.diu_size);
+   return -ENOMEM;
+   }
+
+   printk(KERN_INFO %s: diu_mem=%p\n, __func__, diu_ops.diu_mem);


The pr_debug line is more useful information than the KERN_INFO line...

-Scott
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 1/2 v4] Driver for Freescale 8610 and 5121 DIU

2008-03-28 Thread Anton Vorontsov
On Fri, Mar 28, 2008 at 12:30:29PM -0500, Scott Wood wrote:
 York Sun wrote:
 +static int fsl_diu_ioctl(struct fb_info *info, unsigned int cmd,
 +   unsigned long arg)
 +{
 +struct mfb_info *mfbi = info-par;
 +struct diu_ad *ad = mfbi-ad;
 +struct mfb_chroma_key ck;
 +unsigned char global_alpha;
 +struct aoi_display_offset aoi_d;
 +__u32 pix_fmt;
 +
 +switch (cmd) {
 +case MFB_SET_PIXFMT:
 +if (!arg)
 +return -EINVAL;
 +if (copy_from_user(pix_fmt, (void __user *)arg,
 +sizeof(pix_fmt)))
 
 OK, you fixed the cast here...

Maybe better would be to define buf at the top of this function as
void __user *buf = (void __user *)arg;, i.e. just once?

 
 +return -EFAULT;
 +ad-pix_fmt = pix_fmt;
 +pr_debug(Set pixel format to 0x%08x\n, ad-pix_fmt);
 +break;
 +case MFB_GET_PIXFMT:
 +if (!arg)
 +return -EINVAL;

This if (!arg) appears to be everywhere except default: label, maybe
this could be placed on top too?

 +pix_fmt = ad-pix_fmt;
 +if (copy_to_user((void *)arg, pix_fmt, sizeof(pix_fmt)))
 +return -EFAULT;
 +pr_debug(get pixel format 0x%08x\n, ad-pix_fmt);
 +break;
 +case MFB_SET_AOID:
 +if (!arg)
 +return -EINVAL;
 +if (copy_from_user(aoi_d, (void *)arg, sizeof(aoi_d)))
 +return -EFAULT;
 
 ...but not anywhere else.  All user pointers should have a __user 
 annotation.

-- 
Anton Vorontsov
email: [EMAIL PROTECTED]
irc://irc.freenode.net/bd2
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCHv2 2/3] ep8248e: Reference SMC parameter RAM base in the device tree.

2008-03-28 Thread Laurent Pinchart
On Friday 28 March 2008 18:11, Scott Wood wrote:
 Laurent Pinchart wrote:
  Locating the end of the muram isn't as straightforward as it could be. As
  the current code already uses the beginning of the muram to store the BDs
  and data buffers, should I really bother locating the end or can I store
  the SMC parameter ram at the beginning as well ?
 
 Maybe, but the end would be safer.  What's the problem with finding the 
 end?

That requires manual parsing of all the cells in the reg property. The 
device-tree API doesn't provide a way to get the length of a property, so 
I'll have to use a big enough pre-allocated buffer. I'm also not sure if 
resources are guaranteed to be sorted in increasing order.

This doesn't make finding the end of the muram really difficult. I was just 
wondering if the increased code complexity was worth it, especially seeing 
how the cpm_serial code in the boot wrapper seem quite unstable.

I'm not familiar with the boot wrapper code so I'm sometimes not very 
confident in my assumptions, but isn't the handling of the virtual-reg 
property in cpm_console_init broken ?

void *reg_virt[2];

...

n = getprop(devp, virtual-reg, reg_virt, sizeof(reg_virt));
if (n  (int)sizeof(reg_virt)) {
for (n = 0; n  2; n++) {
if (!dt_xlate_reg(devp, n, reg_phys, NULL))
return -1;

reg_virt[n] = (void *)reg_phys;
}
}

if (is_smc)
smc = reg_virt[0];
else
scc = reg_virt[0];

param = reg_virt[1];

If I'm not mistaken, getprop will return the address and size of the first 
resource and not the addresses of the first two resources. What is 
virtual-reg used for ? To report the virtual address without requiring a 
device tree walk ? Does it provide any information that dt_xlate_reg can't 
find ?

 Even the end of the first reg resource would be OK. 

If I use the end of the first resource, can I assume it spans 0x - 0x8000 
to set the default tx BD address in Kconfig ?

  If I'm not mistaken, once the SMC parameter ram gets relocated to the 
  beginning/end of the muram, the boot loader preallocated space can be 
  reclaimed and can be added to the muram in the device tree like I did in
  my previous patch. Is that correct ?
 
 Yes.

-- 
Laurent Pinchart
CSE Semaphore Belgium

Chaussée de Bruxelles, 732A
B-1410 Waterloo
Belgium

T +32 (2) 387 42 59
F +32 (2) 387 42 75


pgpHOVwIw7v9s.pgp
Description: PGP signature
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [PATCHv2 2/3] ep8248e: Reference SMC parameter RAM base in the device tree.

2008-03-28 Thread Scott Wood

Laurent Pinchart wrote:

On Friday 28 March 2008 18:11, Scott Wood wrote:

Laurent Pinchart wrote:

Locating the end of the muram isn't as straightforward as it
could be. As the current code already uses the beginning of the
muram to store the BDs and data buffers, should I really bother
locating the end or can I store the SMC parameter ram at the
beginning as well ?

Maybe, but the end would be safer.  What's the problem with finding
the end?


That requires manual parsing of all the cells in the reg property.
The device-tree API doesn't provide a way to get the length of a
property,


Sure it does.  Do a getprop with an insufficiently large buffer, and it
tells you how much you really need. :-)


so I'll have to use a big enough pre-allocated buffer. I'm also not
sure if resources are guaranteed to be sorted in increasing order.


Ah, good point.


This doesn't make finding the end of the muram really difficult. I
was just wondering if the increased code complexity was worth it,
especially seeing how the cpm_serial code in the boot wrapper seem
quite unstable.


Unstable in what way?


I'm not familiar with the boot wrapper code so I'm sometimes not very
 confident in my assumptions, but isn't the handling of the
virtual-reg property in cpm_console_init broken ?


Not as far as I can see.


If I'm not mistaken, getprop will return the address and size of the
first resource and not the addresses of the first two resources.


No, it'll get as much of the virtual-reg property as will fit in the 
buffer.  There's no size in virtual-reg.



What is virtual-reg used for ? To report the virtual address without
requiring a device tree walk ? Does it provide any information that
dt_xlate_reg can't find ?


Yes, it tells you the virtual address when it's not an identity mapping. 
 It's not currently used on CPM platforms, but might be used down the 
road with a QE device on 85xx.



Even the end of the first reg resource would be OK.


If I use the end of the first resource, can I assume it spans 0x
- 0x8000 to set the default tx BD address in Kconfig ?


No, especially seeing as it doesn't on any existing boards. :-)

You could set the default to just before 0x2000 with board-specific 
exceptions, though.


-Scott

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 1/2 v4] Driver for Freescale 8610 and 5121 DIU

2008-03-28 Thread Timur Tabi
Scott Wood wrote:

 ...but not anywhere else.  All user pointers should have a __user 
 annotation.

Even in a typecast?

-- 
Timur Tabi
Linux kernel developer at Freescale
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 1/2 v4] Driver for Freescale 8610 and 5121 DIU

2008-03-28 Thread Scott Wood

Timur Tabi wrote:

Scott Wood wrote:

...but not anywhere else.  All user pointers should have a __user 
annotation.


Even in a typecast?


Yes.  Otherwise, as far as sparse sees, you're passing a kernel pointer 
to something expecting a user pointer.


-Scott
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 1/2 v4] Driver for Freescale 8610 and 5121 DIU

2008-03-28 Thread York Sun
On Fri, 2008-03-28 at 20:48 +0300, Anton Vorontsov wrote:
  +  if (copy_from_user(pix_fmt, (void __user *)arg,
  +  sizeof(pix_fmt)))
  
  OK, you fixed the cast here...
 
 Maybe better would be to define buf at the top of this function as
 void __user *buf = (void __user *)arg;, i.e. just once?

I think it is a good idea.

 
  
  +  return -EFAULT;
  +  ad-pix_fmt = pix_fmt;
  +  pr_debug(Set pixel format to 0x%08x\n, ad-pix_fmt);
  +  break;
  +  case MFB_GET_PIXFMT:
  +  if (!arg)
  +  return -EINVAL;
 
 This if (!arg) appears to be everywhere except default: label, maybe
 this could be placed on top too?
Will do that, too.

York

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] [POWERPC] Move phys_addr_t definition into asm/types.h

2008-03-28 Thread Kumar Gala
Moved phys_addr_t out of mmu-*.h and into asm/types.h so we can use it in
places that before would have caused recursive includes.

For example to use phys_addr_t in asm/page.h we would have included
asm/mmu.h which would have possibly included asm/mmu-hash64.h which
includes asm/page.h.  Wh recursive include.

Signed-off-by: Kumar Gala [EMAIL PROTECTED]
---
 include/asm-powerpc/mmu-40x.h   |2 --
 include/asm-powerpc/mmu-44x.h   |2 --
 include/asm-powerpc/mmu-8xx.h   |2 --
 include/asm-powerpc/mmu-fsl-booke.h |6 --
 include/asm-powerpc/mmu-hash32.h|2 --
 include/asm-powerpc/mmu-hash64.h|3 ---
 include/asm-powerpc/types.h |7 +++
 7 files changed, 7 insertions(+), 17 deletions(-)

diff --git a/include/asm-powerpc/mmu-40x.h b/include/asm-powerpc/mmu-40x.h
index 7d37f77..3d10867 100644
--- a/include/asm-powerpc/mmu-40x.h
+++ b/include/asm-powerpc/mmu-40x.h
@@ -53,8 +53,6 @@

 #ifndef __ASSEMBLY__

-typedef unsigned long phys_addr_t;
-
 typedef struct {
unsigned long id;
unsigned long vdso_base;
diff --git a/include/asm-powerpc/mmu-44x.h b/include/asm-powerpc/mmu-44x.h
index 62772ae..c8b02d9 100644
--- a/include/asm-powerpc/mmu-44x.h
+++ b/include/asm-powerpc/mmu-44x.h
@@ -53,8 +53,6 @@

 #ifndef __ASSEMBLY__

-typedef unsigned long long phys_addr_t;
-
 typedef struct {
unsigned long id;
unsigned long vdso_base;
diff --git a/include/asm-powerpc/mmu-8xx.h b/include/asm-powerpc/mmu-8xx.h
index 952bd88..9db877e 100644
--- a/include/asm-powerpc/mmu-8xx.h
+++ b/include/asm-powerpc/mmu-8xx.h
@@ -136,8 +136,6 @@
 #define SPRN_M_TW  799

 #ifndef __ASSEMBLY__
-typedef unsigned long phys_addr_t;
-
 typedef struct {
unsigned long id;
unsigned long vdso_base;
diff --git a/include/asm-powerpc/mmu-fsl-booke.h 
b/include/asm-powerpc/mmu-fsl-booke.h
index 3758000..925d93c 100644
--- a/include/asm-powerpc/mmu-fsl-booke.h
+++ b/include/asm-powerpc/mmu-fsl-booke.h
@@ -73,12 +73,6 @@

 #ifndef __ASSEMBLY__

-#ifndef CONFIG_PHYS_64BIT
-typedef unsigned long phys_addr_t;
-#else
-typedef unsigned long long phys_addr_t;
-#endif
-
 typedef struct {
unsigned long id;
unsigned long vdso_base;
diff --git a/include/asm-powerpc/mmu-hash32.h b/include/asm-powerpc/mmu-hash32.h
index 4bd735b..6e21ca6 100644
--- a/include/asm-powerpc/mmu-hash32.h
+++ b/include/asm-powerpc/mmu-hash32.h
@@ -84,8 +84,6 @@ typedef struct {
unsigned long vdso_base;
 } mm_context_t;

-typedef unsigned long phys_addr_t;
-
 #endif /* !__ASSEMBLY__ */

 #endif /* _ASM_POWERPC_MMU_HASH32_H_ */
diff --git a/include/asm-powerpc/mmu-hash64.h b/include/asm-powerpc/mmu-hash64.h
index 2864fa3..0dff767 100644
--- a/include/asm-powerpc/mmu-hash64.h
+++ b/include/asm-powerpc/mmu-hash64.h
@@ -469,9 +469,6 @@ static inline unsigned long get_vsid(unsigned long context, 
unsigned long ea,
 VSID_MODULUS_256M)
 #define KERNEL_VSID(ea)VSID_SCRAMBLE(GET_ESID(ea))

-/* Physical address used by some IO functions */
-typedef unsigned long phys_addr_t;
-
 #endif /* __ASSEMBLY__ */

 #endif /* _ASM_POWERPC_MMU_HASH64_H_ */
diff --git a/include/asm-powerpc/types.h b/include/asm-powerpc/types.h
index 903fd19..020db52 100644
--- a/include/asm-powerpc/types.h
+++ b/include/asm-powerpc/types.h
@@ -50,6 +50,13 @@ typedef struct {
__u32 u[4];
 } __attribute__((aligned(16))) __vector128;

+/* Physical address used by some IO functions */
+#ifndef CONFIG_PHYS_64BIT
+typedef unsigned long phys_addr_t;
+#else
+typedef unsigned long long phys_addr_t;
+#endif
+
 #endif /* __ASSEMBLY__ */

 #ifdef __KERNEL__
-- 
1.5.4.1

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] mtd/nand/fsl_elbc_nand: workaround for hangs on MPC837X

2008-03-28 Thread Anton Vorontsov
Using current driver on the MPC837X CPUs elbc hangs during nand write.
Reading last byte helps though (thanks to Scott Wood for the idea).

Signed-off-by: Anton Vorontsov [EMAIL PROTECTED]
---
 drivers/mtd/nand/fsl_elbc_nand.c |   12 +++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c
index 378b7aa..be4c05d 100644
--- a/drivers/mtd/nand/fsl_elbc_nand.c
+++ b/drivers/mtd/nand/fsl_elbc_nand.c
@@ -480,7 +480,7 @@ static void fsl_elbc_write_buf(struct mtd_info *mtd, const 
u8 *buf, int len)
struct fsl_elbc_ctrl *ctrl = priv-ctrl;
unsigned int bufsize = mtd-writesize + mtd-oobsize;
 
-   if (len  0) {
+   if (len = 0) {
dev_err(ctrl-dev, write_buf of %d bytes, len);
ctrl-status = 0;
return;
@@ -495,6 +495,16 @@ static void fsl_elbc_write_buf(struct mtd_info *mtd, const 
u8 *buf, int len)
}
 
memcpy_toio(ctrl-addr[ctrl-index], buf, len);
+#ifdef CONFIG_PPC_MPC837x
+   /*
+* This is workaround for the weird elbc hangs on the MPC837X CPUs,
+* Scott Wood says: ...perhaps difference in how long it takes a
+* write to make it through the localbus compared to a write to IMMR
+* is causing problems, and sync isn't helping for some reason.
+* Reading back the last byte helps though.
+*/
+   in_8(ctrl-addr[ctrl-index] + len - 1);
+#endif
ctrl-index += len;
 }
 
-- 
1.5.2.2
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] mtd/nand/fsl_elbc_nand: workaround for hangs on MPC837X

2008-03-28 Thread Scott Wood

Anton Vorontsov wrote:

@@ -495,6 +495,16 @@ static void fsl_elbc_write_buf(struct mtd_info *mtd, const 
u8 *buf, int len)
}
 
 	memcpy_toio(ctrl-addr[ctrl-index], buf, len);

+#ifdef CONFIG_PPC_MPC837x
+   /*
+* This is workaround for the weird elbc hangs on the MPC837X CPUs,
+* Scott Wood says: ...perhaps difference in how long it takes a
+* write to make it through the localbus compared to a write to IMMR
+* is causing problems, and sync isn't helping for some reason.
+* Reading back the last byte helps though.
+*/
+   in_8(ctrl-addr[ctrl-index] + len - 1);
+#endif


Let's do it regardless of chip -- odds are the issue exists on all 
implementations, and it's just a function of what frequencies things are 
running at.


-Scott
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] mtd/nand/fsl_elbc_nand: workaround for hangs during nand write [was: Re: [PATCH] mtd/nand/fsl_elbc_nand: workaround for hangs on MPC837X]

2008-03-28 Thread Anton Vorontsov
On Fri, Mar 28, 2008 at 01:53:57PM -0500, Scott Wood wrote:
 Anton Vorontsov wrote:
 @@ -495,6 +495,16 @@ static void fsl_elbc_write_buf(struct mtd_info *mtd, 
 const u8 *buf, int len)
  }
  
  memcpy_toio(ctrl-addr[ctrl-index], buf, len);
 +#ifdef CONFIG_PPC_MPC837x
 +/*
 + * This is workaround for the weird elbc hangs on the MPC837X CPUs,
 + * Scott Wood says: ...perhaps difference in how long it takes a
 + * write to make it through the localbus compared to a write to IMMR
 + * is causing problems, and sync isn't helping for some reason.
 + * Reading back the last byte helps though.
 + */
 +in_8(ctrl-addr[ctrl-index] + len - 1);
 +#endif
 
 Let's do it regardless of chip -- odds are the issue exists on all 
 implementations, and it's just a function of what frequencies things are 
 running at.

Ok.

- - - -
From: Anton Vorontsov [EMAIL PROTECTED]
Subject: mtd/nand/fsl_elbc_nand: workaround for hangs during nand write

Using current driver elbc sometimes hangs during nand write. Reading back
last byte helps though (thanks to Scott Wood for the idea).

Signed-off-by: Anton Vorontsov [EMAIL PROTECTED]
---
 drivers/mtd/nand/fsl_elbc_nand.c |   11 ++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c
index 378b7aa..2f4ce2a 100644
--- a/drivers/mtd/nand/fsl_elbc_nand.c
+++ b/drivers/mtd/nand/fsl_elbc_nand.c
@@ -480,7 +480,7 @@ static void fsl_elbc_write_buf(struct mtd_info *mtd, const 
u8 *buf, int len)
struct fsl_elbc_ctrl *ctrl = priv-ctrl;
unsigned int bufsize = mtd-writesize + mtd-oobsize;
 
-   if (len  0) {
+   if (len = 0) {
dev_err(ctrl-dev, write_buf of %d bytes, len);
ctrl-status = 0;
return;
@@ -495,6 +495,15 @@ static void fsl_elbc_write_buf(struct mtd_info *mtd, const 
u8 *buf, int len)
}
 
memcpy_toio(ctrl-addr[ctrl-index], buf, len);
+   /*
+* This is workaround for the weird elbc hangs during nand write,
+* Scott Wood says: ...perhaps difference in how long it takes a
+* write to make it through the localbus compared to a write to IMMR
+* is causing problems, and sync isn't helping for some reason.
+* Reading back the last byte helps though.
+*/
+   in_8(ctrl-addr[ctrl-index] + len - 1);
+
ctrl-index += len;
 }
 
-- 
1.5.2.2

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] mtd/nand/fsl_elbc_nand: workaround for hangs during nand write [was: Re: [PATCH] mtd/nand/fsl_elbc_nand: workaround for hangs on MPC837X]

2008-03-28 Thread Scott Wood

Anton Vorontsov wrote:

From: Anton Vorontsov [EMAIL PROTECTED]
Subject: mtd/nand/fsl_elbc_nand: workaround for hangs during nand write

Using current driver elbc sometimes hangs during nand write. Reading back
last byte helps though (thanks to Scott Wood for the idea).

Signed-off-by: Anton Vorontsov [EMAIL PROTECTED]


Acked-by: Scott Wood [EMAIL PROTECTED]

-Scott
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 1/3] mpc83xx: fix usb phy_type in mpc837x rdb device trees

2008-03-28 Thread Kumar Gala


On Mar 28, 2008, at 11:44 AM, Anton Vorontsov wrote:

On Fri, Mar 28, 2008 at 10:51:25AM -0500, Kim Phillips wrote:

the mpc837x rdb board uses low pin count interfaces (ULPI) to connect
to the USB PHY.


I've sent this fix two weeks ago...

http://ozlabs.org/pipermail/linuxppc-dev/2008-March/052926.html


Signed-off-by: Kim Phillips [EMAIL PROTECTED]


I'll apply Anton's version and add a signed-off-by Kim.

- k

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 1/3] mpc83xx: fix usb phy_type in mpc837x rdb device trees

2008-03-28 Thread Kim Phillips
On Fri, 28 Mar 2008 14:37:51 -0500
Kumar Gala [EMAIL PROTECTED] wrote:

 
 On Mar 28, 2008, at 11:44 AM, Anton Vorontsov wrote:
  On Fri, Mar 28, 2008 at 10:51:25AM -0500, Kim Phillips wrote:
  the mpc837x rdb board uses low pin count interfaces (ULPI) to connect
  to the USB PHY.
 
  I've sent this fix two weeks ago...
 
  http://ozlabs.org/pipermail/linuxppc-dev/2008-March/052926.html
 
  Signed-off-by: Kim Phillips [EMAIL PROTECTED]
 
 I'll apply Anton's version and add a signed-off-by Kim.

agreed, thanks!

Kim
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 15/18] ide: remove broken/dangerous HDIO_[UNREGISTER, SCAN]_HWIF ioctls

2008-03-28 Thread Mark Lord

Sergei Shtylyov wrote:

Bartlomiej Zolnierkiewicz wrote:


hdparm explicitely marks HDIO_[UNREGISTER,SCAN]_HWIF ioctls as DANGEROUS
and given the number of bugs we can assume that there are no real users:

..

There is the odd user of these, actually.

But the most recent to email me (a few weeks ago),
reported that the SCAN function was no longer working on his kernel.

I'll remove the -R and -U flags completely from hdparm-8.7.

Cheers
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] powerpc: add kernel parameter to set l3cr for MPC745x

2008-03-28 Thread Robert Brose
Sorry for the resend, the list software stripped my text attachment.

Old-world powermacs don't set L2CR or L3CR on processor upgrade cards.
This simple patch allows the setting of L3CR via a kernel parameter
(like the existing kernel parameter to set L2CR).

This is the first time I've posted a patch, please excuse me if I've
broken protocol or done this improperly in any way.

Signed-off-by: Robert Brose [EMAIL PROTECTED]

--- linux-2.6.24/arch/powerpc/kernel/setup_32.c.orig2008-03-10 
11:24:16.566354597 -0500
+++ linux-2.6.24/arch/powerpc/kernel/setup_32.c 2008-03-10 11:22:22.711626305 
-0500
@@ -172,6 +172,18 @@ int __init ppc_setup_l2cr(char *str)
 }
 __setup(l2cr=, ppc_setup_l2cr);
 
+/* Checks l3cr= command-line option */
+int __init ppc_setup_l3cr(char *str)
+{
+   if (cpu_has_feature(CPU_FTR_L3CR)) {
+   unsigned long val = simple_strtoul(str, NULL, 0);
+   printk(KERN_INFO l3cr set to %lx\n, val);
+   _set_L3CR(val); /* and enable it */
+   }
+   return 1;
+}
+__setup(l3cr=, ppc_setup_l3cr);
+
 #ifdef CONFIG_GENERIC_NVRAM
 
 /* Generic nvram hooks used by drivers/char/gen_nvram.c */

--- linux-2.6.24/Documentation/kernel-parameters.txt.orig   2008-03-25 
12:30:09.688082305 -0500
+++ linux-2.6.24/Documentation/kernel-parameters.txt2008-03-25 
12:30:29.816083202 -0500
@@ -877,6 +877,8 @@ and is between 256 and 4096 characters. 
 
l2cr=   [PPC]
 
+   l3cr=   [PPC]
+
lapic   [X86-32,APIC] Enable the local APIC even if BIOS
disabled it.
 
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] [POWERPC] 85xx: Add support for relocatble kernel (and booting at non-zero)

2008-03-28 Thread Kumar Gala
Added support to allow an 85xx kernel to be run from a non-zero physical
address (useful for cooperative asymmetric multiprocessing situations) and
kdump.  The support can either be at compile time or runtime
(CONFIG_RELOCATABLE).

Currently we are limited to running at a physical address that is module
256M.  This is due to how we map TLBs to cover lowmem and should be fixed
up to allow 64M or maybe even 16M alignment in the future.

All the magic for this support is accomplished by proper initializating
of the kernel memory subsystem properly and ARCH_PFN_OFFSET.

Signed-off-by: Kumar Gala [EMAIL PROTECTED]
---
 arch/powerpc/Kconfig |   69 -
 arch/powerpc/boot/Makefile   |4 +-
 arch/powerpc/kernel/head_fsl_booke.S |   11 +
 arch/powerpc/kernel/prom.c   |4 ++
 arch/powerpc/kernel/setup_64.c   |2 +-
 arch/powerpc/mm/init_32.c|4 +-
 arch/powerpc/mm/init_64.c|3 +-
 arch/powerpc/mm/mem.c|5 +-
 include/asm-powerpc/kdump.h  |5 --
 include/asm-powerpc/page.h   |   43 +---
 include/asm-powerpc/page_32.h|4 ++
 include/asm-powerpc/pgtable-ppc32.h  |5 +--
 12 files changed, 133 insertions(+), 26 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 4d9ced2..42c22f7 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -619,21 +619,76 @@ config LOWMEM_SIZE
hex Maximum low memory size (in bytes) if LOWMEM_SIZE_BOOL
default 0x3000

+config RELOCATABLE
+   bool Build a relocatable kernel (EXPERIMENTAL)
+   depends on EXPERIMENTAL  ADVANCED_OPTIONS  FLATMEM  FSL_BOOKE
+   help
+ This builds a kernel image that is capable of running at the
+ location the kernel is loaded at (some alignment restrictions may
+ exist).
+
+ One use is for the kexec on panic case where the recovery kernel
+ must live at a different physical address than the primary
+ kernel.
+
+ Note: If CONFIG_RELOCATABLE=y, then the kernel runs from the address
+ it has been loaded at and the compile time physical addresses
+ CONFIG_PHYSICAL_START is ignored.  However CONFIG_PHYSICAL_START
+ setting can still be useful to bootwrappers that need to know the
+ load location of the kernel (eg. u-boot/mkimage).
+
+config PAGE_OFFSET_BOOL
+   bool Set custom page offset address
+   depends on ADVANCED_OPTIONS
+   help
+ This option allows you to set the kernel virtual address at which
+ the kernel will map low memory.  This can be useful in optimizing
+ the virtual memory layout of the system.
+
+ Say N here unless you know what you are doing.
+
+config PAGE_OFFSET
+   hex Virtual address of memory base if PAGE_OFFSET_BOOL
+   default 0xc000
+
 config KERNEL_START_BOOL
bool Set custom kernel base address
depends on ADVANCED_OPTIONS
help
  This option allows you to set the kernel virtual address at which
- the kernel will map low memory (the kernel image will be linked at
- this address).  This can be useful in optimizing the virtual memory
- layout of the system.
+ the kernel will be loaded.  Normally this should match PAGE_OFFSET
+ however there are times (like kdump) that one might not want them
+ to be the same.

  Say N here unless you know what you are doing.

 config KERNEL_START
hex Virtual address of kernel base if KERNEL_START_BOOL
+   default PAGE_OFFSET if PAGE_OFFSET_BOOL
+   default 0xc200 if CRASH_DUMP
default 0xc000

+config PHYSICAL_START_BOOL
+   bool Set physical address where the kernel is loaded
+   depends on ADVANCED_OPTIONS  FLATMEM  FSL_BOOKE
+   help
+ This gives the physical address where the kernel is loaded.
+
+ Say N here unless you know what you are doing.
+
+config PHYSICAL_START
+   hex Physical address where the kernel is loaded if PHYSICAL_START_BOOL
+   default 0x0200 if PPC_STD_MMU  CRASH_DUMP
+   default 0x
+
+config PHYSICAL_ALIGN
+   hex
+   default 0x1000 if FSL_BOOKE
+   help
+ This value puts the alignment restrictions on physical address
+ where kernel is loaded and run from. Kernel is compiled for an
+ address which meets above alignment restriction.
+
 config TASK_SIZE_BOOL
bool Set custom user task size
depends on ADVANCED_OPTIONS
@@ -680,9 +735,17 @@ config PIN_TLB
 endmenu

 if PPC64
+config PAGE_OFFSET
+   hex
+   default 0xc000
 config KERNEL_START
hex
+   default 0xc200 if CRASH_DUMP
default 0xc000
+config PHYSICAL_START
+   hex
+   default 0x0200 if CRASH_DUMP
+   default 0x
 endif

 source net/Kconfig
diff 

[patch 02/24] ppc: replace remaining __FUNCTION__ occurrences

2008-03-28 Thread akpm
From: Harvey Harrison [EMAIL PROTECTED]

__FUNCTION__ is gcc-specific, use __func__

Signed-off-by: Harvey Harrison [EMAIL PROTECTED]
Cc: Paul Mackerras [EMAIL PROTECTED]
Cc: Benjamin Herrenschmidt [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 arch/ppc/8xx_io/fec.c   |4 ++--
 arch/ppc/platforms/radstone_ppc7d.c |8 
 2 files changed, 6 insertions(+), 6 deletions(-)

diff -puN arch/ppc/8xx_io/fec.c~ppc-replace-remaining-__function__-occurences 
arch/ppc/8xx_io/fec.c
--- a/arch/ppc/8xx_io/fec.c~ppc-replace-remaining-__function__-occurences
+++ a/arch/ppc/8xx_io/fec.c
@@ -520,7 +520,7 @@ fec_enet_interrupt(int irq, void * dev_i
 #ifdef CONFIG_USE_MDIO
fec_enet_mii(dev);
 #else
-printk(%s[%d] %s: unexpected FEC_ENET_MII event\n, 
__FILE__,__LINE__,__FUNCTION__);
+printk(%s[%d] %s: unexpected FEC_ENET_MII event\n, __FILE__, __LINE__, 
__func__);
 #endif /* CONFIG_USE_MDIO */
}
 
@@ -1441,7 +1441,7 @@ irqreturn_t mii_link_interrupt(int irq, 
fecp-fec_ecntrl = ecntrl;  /* restore old settings */
}
 #else
-printk(%s[%d] %s: unexpected Link interrupt\n, 
__FILE__,__LINE__,__FUNCTION__);
+printk(%s[%d] %s: unexpected Link interrupt\n, __FILE__, __LINE__, __func__);
 #endif /* CONFIG_USE_MDIO */
 
 #ifndef CONFIG_RPXCLASSIC
diff -puN 
arch/ppc/platforms/radstone_ppc7d.c~ppc-replace-remaining-__function__-occurences
 arch/ppc/platforms/radstone_ppc7d.c
--- 
a/arch/ppc/platforms/radstone_ppc7d.c~ppc-replace-remaining-__function__-occurences
+++ a/arch/ppc/platforms/radstone_ppc7d.c
@@ -512,7 +512,7 @@ static void __init ppc7d_init_irq(void)
 {
int irq;
 
-   pr_debug(%s\n, __FUNCTION__);
+   pr_debug(%s\n, __func__);
i8259_init(0, 0);
mv64360_init_irq();
 
@@ -569,7 +569,7 @@ static int __init ppc7d_map_irq(struct p
};
const long min_idsel = 10, max_idsel = 14, irqs_per_slot = 4;
 
-   pr_debug(%s: %04x/%04x/%x: idsel=%hx pin=%hu\n, __FUNCTION__,
+   pr_debug(%s: %04x/%04x/%x: idsel=%hx pin=%hu\n, __func__,
 dev-vendor, dev-device, PCI_FUNC(dev-devfn), idsel, pin);
 
return PCI_IRQ_TABLE_LOOKUP;
@@ -1300,7 +1300,7 @@ static void ppc7d_init2(void)
u32 data;
u8 data8;
 
-   pr_debug(%s: enter\n, __FUNCTION__);
+   pr_debug(%s: enter\n, __func__);
 
/* Wait for debugger? */
if (ppc7d_wait_debugger) {
@@ -1333,7 +1333,7 @@ static void ppc7d_init2(void)
 ppc_md.set_rtc_time = ppc7d_set_rtc_time;
 ppc_md.get_rtc_time = ppc7d_get_rtc_time;
 
-   pr_debug(%s: exit\n, __FUNCTION__);
+   pr_debug(%s: exit\n, __func__);
 }
 
 /* Called from machine_init(), early, before any of the __init functions
_
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[patch 14/24] rapidio: add RapidIO node probing into MPC86xx_HPCN board id table

2008-03-28 Thread akpm
From: Zhang Wei [EMAIL PROTECTED]

Signed-off-by: Zhang Wei [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |1 +
 1 file changed, 1 insertion(+)

diff -puN 
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c~rapidio-add-rapidio-node-probing-into-mpc86xx_hpcn-board-id-table
 arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
--- 
a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c~rapidio-add-rapidio-node-probing-into-mpc86xx_hpcn-board-id-table
+++ a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -215,6 +215,7 @@ mpc86xx_time_init(void)
 
 static __initdata struct of_device_id of_bus_ids[] = {
{ .compatible = simple-bus, },
+   { .compatible = fsl,rapidio-delta, },
{},
 };
 
_
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[patch 13/24] rapidio: add RapidIO node into MPC8641HPCN dts file

2008-03-28 Thread akpm
From: Zhang Wei [EMAIL PROTECTED]

Signed-off-by: Zhang Wei [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 arch/powerpc/boot/dts/mpc8641_hpcn.dts |   12 
 1 file changed, 12 insertions(+)

diff -puN 
arch/powerpc/boot/dts/mpc8641_hpcn.dts~rapidio-add-rapidio-node-into-mpc8641hpcn-dts-file
 arch/powerpc/boot/dts/mpc8641_hpcn.dts
--- 
a/arch/powerpc/boot/dts/mpc8641_hpcn.dts~rapidio-add-rapidio-node-into-mpc8641hpcn-dts-file
+++ a/arch/powerpc/boot/dts/mpc8641_hpcn.dts
@@ -26,6 +26,7 @@
serial1 = serial1;
pci0 = pci0;
pci1 = pci1;
+   rapidio0 = rapidio0;
};
 
cpus {
@@ -500,4 +501,15 @@
  0x0 0x0010;
};
};
+   rapidio0: [EMAIL PROTECTED] {
+   #address-cells = 2;
+   #size-cells = 2;
+   compatible = fsl,rapidio-delta;
+   reg = 0xf80c 0x2;
+   ranges = 0 0 0xc000 0 0x2000;
+   interrupt-parent = mpic;
+   /* err_irq bell_outb_irq bell_inb_irq
+   msg1_tx_irq msg1_rx_irq msg2_tx_irq msg2_rx_irq */
+   interrupts = 48 2 49 2 50 2 53 2 54 2 55 2 56 2;
+   };
 };
_
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[patch 16/24] rapidio: add RapidIO connection info print out and re-training for break connection

2008-03-28 Thread akpm
From: Zhang Wei [EMAIL PROTECTED]

Signed-off-by: Zhang Wei [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 arch/powerpc/sysdev/fsl_rio.c |   71 
 1 file changed, 71 insertions(+)

diff -puN 
arch/powerpc/sysdev/fsl_rio.c~rapidio-add-rapidio-connection-info-print-out-and-re-training-for-break-connection
 arch/powerpc/sysdev/fsl_rio.c
--- 
a/arch/powerpc/sysdev/fsl_rio.c~rapidio-add-rapidio-connection-info-print-out-and-re-training-for-break-connection
+++ a/arch/powerpc/sysdev/fsl_rio.c
@@ -942,6 +942,48 @@ static int fsl_rio_get_cmdline(char *s)
 
 __setup(riohdid=, fsl_rio_get_cmdline);
 
+static inline void fsl_rio_info(struct device *dev, u32 ccsr)
+{
+   const char *str;
+   if (ccsr  1) {
+   /* Serial phy */
+   switch (ccsr  30) {
+   case 0:
+   str = 1;
+   break;
+   case 1:
+   str = 4;
+   break;
+   default:
+   str = Unknown;
+   break;;
+   }
+   dev_info(dev, Hardware port width: %s\n, str);
+
+   switch ((ccsr  27)  7) {
+   case 0:
+   str = Single-lane 0;
+   break;
+   case 1:
+   str = Single-lane 2;
+   break;
+   case 2:
+   str = Four-lane;
+   break;
+   default:
+   str = Unknown;
+   break;
+   }
+   dev_info(dev, Training connection status: %s\n, str);
+   } else {
+   /* Parallel phy */
+   if (!(ccsr  0x8000))
+   dev_info(dev, Output port operating in 8-bit mode\n);
+   if (!(ccsr  0x0800))
+   dev_info(dev, Input port operating in 8-bit mode\n);
+   }
+}
+
 /**
  * fsl_rio_setup - Setup MPC85xx RapidIO interface
  * @fsl_rio_setup - Setup Freescale PowerPC RapidIO interface
@@ -1055,6 +1097,35 @@ int fsl_rio_setup(struct of_device *dev)
(port-phy_type == RIO_PHY_PARALLEL) ? parallel :
((port-phy_type == RIO_PHY_SERIAL) ? serial :
 unknown));
+   /* Checking the port training status */
+   if (in_be32((priv-regs_win + RIO_ESCSR))  1) {
+   dev_err(dev-dev, Port is not ready. 
+  Try to restart connection...\n);
+   switch (port-phy_type) {
+   case RIO_PHY_SERIAL:
+   /* Disable ports */
+   out_be32(priv-regs_win + RIO_CCSR, 0);
+   /* Set 1x lane */
+   setbits32(priv-regs_win + RIO_CCSR, 0x0200);
+   /* Enable ports */
+   setbits32(priv-regs_win + RIO_CCSR, 0x0060);
+   break;
+   case RIO_PHY_PARALLEL:
+   /* Disable ports */
+   out_be32(priv-regs_win + RIO_CCSR, 0x2200);
+   /* Enable ports */
+   out_be32(priv-regs_win + RIO_CCSR, 0x4400);
+   break;
+   }
+   msleep(100);
+   if (in_be32((priv-regs_win + RIO_ESCSR))  1) {
+   dev_err(dev-dev, Port restart failed.\n);
+   rc = -ENOLINK;
+   goto err;
+   }
+   dev_info(dev-dev, Port restart success!\n);
+   }
+   fsl_rio_info(dev-dev, ccsr);
 
port-sys_size = (in_be32((priv-regs_win + RIO_PEF_CAR))
 RIO_PEF_CTLS)  4;
_
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[patch 15/24] rapidio: add serial RapidIO controller support, which includes MPC8548, MPC8641

2008-03-28 Thread akpm
From: Zhang Wei [EMAIL PROTECTED]

Signed-off-by: Zhang Wei [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 arch/powerpc/sysdev/fsl_rio.c |   75 +++-
 include/linux/rio.h   |6 ++
 2 files changed, 70 insertions(+), 11 deletions(-)

diff -puN 
arch/powerpc/sysdev/fsl_rio.c~rapidio-add-serial-rapidio-controller-support-which-includes-mpc8548-mpc8641
 arch/powerpc/sysdev/fsl_rio.c
--- 
a/arch/powerpc/sysdev/fsl_rio.c~rapidio-add-serial-rapidio-controller-support-which-includes-mpc8548-mpc8641
+++ a/arch/powerpc/sysdev/fsl_rio.c
@@ -21,6 +21,7 @@
 #include linux/rio.h
 #include linux/rio_drv.h
 #include linux/of_platform.h
+#include linux/delay.h
 
 #include asm/io.h
 
@@ -30,7 +31,12 @@
 #define IRQ_RIO_RX(m)  (((struct rio_priv *)(m-priv))-rxirq)
 
 #define RIO_ATMU_REGS_OFFSET   0x10c00
-#define RIO_MSG_REGS_OFFSET0x11000
+#define RIO_P_MSG_REGS_OFFSET  0x11000
+#define RIO_S_MSG_REGS_OFFSET  0x13000
+#define RIO_ESCSR  0x158
+#define RIO_CCSR   0x15c
+#define RIO_ISR_AACR   0x10120
+#define RIO_ISR_AACR_AA0x1 /* Accept All ID */
 #define RIO_MAINT_WIN_SIZE 0x40
 #define RIO_DBELL_WIN_SIZE 0x1000
 
@@ -69,7 +75,7 @@
 
 struct rio_atmu_regs {
u32 rowtar;
-   u32 pad1;
+   u32 rowtear;
u32 rowbar;
u32 pad2;
u32 rowar;
@@ -95,7 +101,15 @@ struct rio_msg_regs {
u32 ifqdpar;
u32 pad6;
u32 ifqepar;
-   u32 pad7[250];
+   u32 pad7[226];
+   u32 odmr;
+   u32 odsr;
+   u32 res0[4];
+   u32 oddpr;
+   u32 oddatr;
+   u32 res1[3];
+   u32 odretcr;
+   u32 res2[12];
u32 dmr;
u32 dsr;
u32 pad8;
@@ -175,8 +189,22 @@ static int fsl_rio_doorbell_send(struct 
struct rio_priv *priv = mport-priv;
pr_debug(fsl_doorbell_send: index %d destid %4.4x data %4.4x\n,
 index, destid, data);
-   out_be32(priv-dbell_atmu_regs-rowtar, destid  22);
-   out_be16(priv-dbell_win, data);
+   switch (mport-phy_type) {
+   case RIO_PHY_PARALLEL:
+   out_be32(priv-dbell_atmu_regs-rowtar, destid  22);
+   out_be16(priv-dbell_win, data);
+   break;
+   case RIO_PHY_SERIAL:
+   /* In the serial version silicons, such as MPC8548, MPC8641,
+* below operations is must be.
+*/
+   out_be32(priv-msg_regs-odmr, 0x);
+   out_be32(priv-msg_regs-odretcr, 0x0004);
+   out_be32(priv-msg_regs-oddpr, destid  16);
+   out_be32(priv-msg_regs-oddatr, data);
+   out_be32(priv-msg_regs-odmr, 0x0001);
+   break;
+   }
 
return 0;
 }
@@ -342,11 +370,22 @@ rio_hw_add_outb_message(struct rio_mport
memset(priv-msg_tx_ring.virt_buffer[priv-msg_tx_ring.tx_slot]
+ len, 0, RIO_MAX_MSG_SIZE - len);
 
-   /* Set mbox field for message */
-   desc-dport = mbox  0x3;
+   switch (mport-phy_type) {
+   case RIO_PHY_PARALLEL:
+   /* Set mbox field for message */
+   desc-dport = mbox  0x3;
 
-   /* Enable EOMI interrupt, set priority, and set destid */
-   desc-dattr = 0x2800 | (rdev-destid  2);
+   /* Enable EOMI interrupt, set priority, and set destid */
+   desc-dattr = 0x2800 | (rdev-destid  2);
+   break;
+   case RIO_PHY_SERIAL:
+   /* Set mbox field for message, and set destid */
+   desc-dport = (rdev-destid  16) | (mbox  0x3);
+
+   /* Enable EOMI interrupt and priority */
+   desc-dattr = 0x2800;
+   break;
+   }
 
/* Set transfer size aligned to next power of 2 (in double words) */
desc-dwcnt = is_power_of_2(len) ? len : 1  get_bitmask_order(len);
@@ -920,6 +959,7 @@ int fsl_rio_setup(struct of_device *dev)
const u32 *dt_range, *cell;
struct resource regs;
int rlen;
+   u32 ccsr;
u64 law_start, law_size;
int paw, aw, sw;
 
@@ -1008,6 +1048,14 @@ int fsl_rio_setup(struct of_device *dev)
 
priv-regs_win = ioremap(regs.start, regs.end - regs.start + 1);
 
+   /* Probe the master port phy type */
+   ccsr = in_be32(priv-regs_win + RIO_CCSR);
+   port-phy_type = (ccsr  1) ? RIO_PHY_SERIAL : RIO_PHY_PARALLEL;
+   dev_info(dev-dev, RapidIO PHY type: %s\n,
+   (port-phy_type == RIO_PHY_PARALLEL) ? parallel :
+   ((port-phy_type == RIO_PHY_SERIAL) ? serial :
+unknown));
+
port-sys_size = (in_be32((priv-regs_win + RIO_PEF_CAR))
 RIO_PEF_CTLS)  4;
dev_info(dev-dev, RapidIO Common Transport System size: %d\n,
@@ -1017,8 +1065,13 @@ int fsl_rio_setup(struct of_device *dev)

[patch 12/24] rapidio: change the kernel configurated RapidIO system size to auto-probing

2008-03-28 Thread akpm
From: Zhang Wei [EMAIL PROTECTED]

The RapidIO system size will auto probe in RIO setup.  The route table and
rionet_active in rionet.c are changed to be allocated dynamically according
the system size.

Signed-off-by: Zhang Wei [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 arch/powerpc/sysdev/fsl_rio.c |6 +++
 drivers/net/rionet.c  |   16 -
 drivers/rapidio/Kconfig   |8 
 drivers/rapidio/rio-scan.c|   55 ++--
 drivers/rapidio/rio-sysfs.c   |3 +
 drivers/rapidio/rio.c |2 -
 drivers/rapidio/rio.h |9 +
 include/linux/rio.h   |   14 
 8 files changed, 71 insertions(+), 42 deletions(-)

diff -puN 
arch/powerpc/sysdev/fsl_rio.c~rapidio-change-the-kernel-configurated-rapidio-system-size-to-auto-probing
 arch/powerpc/sysdev/fsl_rio.c
--- 
a/arch/powerpc/sysdev/fsl_rio.c~rapidio-change-the-kernel-configurated-rapidio-system-size-to-auto-probing
+++ a/arch/powerpc/sysdev/fsl_rio.c
@@ -1007,6 +1007,12 @@ int fsl_rio_setup(struct of_device *dev)
rio_register_mport(port);
 
priv-regs_win = ioremap(regs.start, regs.end - regs.start + 1);
+
+   port-sys_size = (in_be32((priv-regs_win + RIO_PEF_CAR))
+RIO_PEF_CTLS)  4;
+   dev_info(dev-dev, RapidIO Common Transport System size: %d\n,
+   port-sys_size ? 65536 : 256);
+
priv-atmu_regs = (struct rio_atmu_regs *)(priv-regs_win
+ RIO_ATMU_REGS_OFFSET);
priv-maint_atmu_regs = priv-atmu_regs + 1;
diff -puN 
drivers/net/rionet.c~rapidio-change-the-kernel-configurated-rapidio-system-size-to-auto-probing
 drivers/net/rionet.c
--- 
a/drivers/net/rionet.c~rapidio-change-the-kernel-configurated-rapidio-system-size-to-auto-probing
+++ a/drivers/net/rionet.c
@@ -77,7 +77,7 @@ static int rionet_capable = 1;
  * could be made into a hash table to save memory depending
  * on system trade-offs.
  */
-static struct rio_dev *rionet_active[RIO_MAX_ROUTE_ENTRIES];
+static struct rio_dev **rionet_active;
 
 #define is_rionet_capable(pef, src_ops, dst_ops)   \
((pef  RIO_PEF_INB_MBOX) \
@@ -195,7 +195,8 @@ static int rionet_start_xmit(struct sk_b
}
 
if (eth-h_dest[0]  0x01) {
-   for (i = 0; i  RIO_MAX_ROUTE_ENTRIES; i++)
+   for (i = 0; i  RIO_MAX_ROUTE_ENTRIES(rnet-mport-sys_size);
+   i++)
if (rionet_active[i])
rionet_queue_tx_msg(skb, ndev,
rionet_active[i]);
@@ -385,6 +386,8 @@ static void rionet_remove(struct rio_dev
struct net_device *ndev = NULL;
struct rionet_peer *peer, *tmp;
 
+   free_pages((unsigned long)rionet_active, rdev-net-hport-sys_size ?
+   __ilog2(sizeof(void *)) + 4 : 0);
unregister_netdev(ndev);
kfree(ndev);
 
@@ -443,6 +446,15 @@ static int rionet_setup_netdev(struct ri
goto out;
}
 
+   rionet_active = (struct rio_dev **)__get_free_pages(GFP_KERNEL,
+   mport-sys_size ? __ilog2(sizeof(void *)) + 4 : 0);
+   if (!rionet_active) {
+   rc = -ENOMEM;
+   goto out;
+   }
+   memset((void *)rionet_active, 0, sizeof(void *) *
+   RIO_MAX_ROUTE_ENTRIES(mport-sys_size));
+
/* Set up private area */
rnet = (struct rionet_private *)ndev-priv;
rnet-mport = mport;
diff -puN 
drivers/rapidio/Kconfig~rapidio-change-the-kernel-configurated-rapidio-system-size-to-auto-probing
 drivers/rapidio/Kconfig
--- 
a/drivers/rapidio/Kconfig~rapidio-change-the-kernel-configurated-rapidio-system-size-to-auto-probing
+++ a/drivers/rapidio/Kconfig
@@ -1,14 +1,6 @@
 #
 # RapidIO configuration
 #
-config RAPIDIO_8_BIT_TRANSPORT
-   bool 8-bit transport addressing
-   depends on RAPIDIO
-   ---help---
- By default, the kernel assumes a 16-bit addressed RapidIO
- network. By selecting this option, the kernel will support
- an 8-bit addressed network.
-
 config RAPIDIO_DISC_TIMEOUT
int Discovery timeout duration (seconds)
depends on RAPIDIO
diff -puN 
drivers/rapidio/rio-scan.c~rapidio-change-the-kernel-configurated-rapidio-system-size-to-auto-probing
 drivers/rapidio/rio-scan.c
--- 
a/drivers/rapidio/rio-scan.c~rapidio-change-the-kernel-configurated-rapidio-system-size-to-auto-probing
+++ a/drivers/rapidio/rio-scan.c
@@ -73,7 +73,7 @@ static u16 rio_get_device_id(struct rio_
 
rio_mport_read_config_32(port, destid, hopcount, RIO_DID_CSR, result);
 
-   return RIO_GET_DID(result);
+   return RIO_GET_DID(port-sys_size, result);
 }
 
 /**
@@ -88,7 +88,7 @@ static u16 rio_get_device_id(struct rio_
 static void rio_set_device_id(struct 

[patch 03/24] drivers/block/viodasd.c: Use FIELD_SIZEOF

2008-03-28 Thread akpm
From: Julia Lawall [EMAIL PROTECTED]

Robert P.J. Day proposed to use the macro FIELD_SIZEOF in replace of code
that matches its definition.

The modification was made using the following semantic patch
(http://www.emn.fr/x-info/coccinelle/)

// smpl
@haskernel@
@@

#include linux/kernel.h

@depends on haskernel@
type t;
identifier f;
@@

- (sizeof(((t*)0)-f))
+ FIELD_SIZEOF(t, f)

@depends on haskernel@
type t;
identifier f;
@@

- sizeof(((t*)0)-f)
+ FIELD_SIZEOF(t, f)
// /smpl

Signed-off-by: Julia Lawall [EMAIL PROTECTED]
Cc: Jens Axboe [EMAIL PROTECTED]
Cc: Benjamin Herrenschmidt [EMAIL PROTECTED]
Cc: Paul Mackerras [EMAIL PROTECTED]
Acked-by: Stephen Rothwell [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/block/viodasd.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/block/viodasd.c~drivers-block-viodasdc-use-field_sizeof 
drivers/block/viodasd.c
--- a/drivers/block/viodasd.c~drivers-block-viodasdc-use-field_sizeof
+++ a/drivers/block/viodasd.c
@@ -69,7 +69,7 @@ MODULE_LICENSE(GPL);
 enum {
PARTITION_SHIFT = 3,
MAX_DISKNO = HVMAXARCHITECTEDVIRTUALDISKS,
-   MAX_DISK_NAME = sizeof(((struct gendisk *)0)-disk_name)
+   MAX_DISK_NAME = FIELD_SIZEOF(struct gendisk, disk_name)
 };
 
 static DEFINE_SPINLOCK(viodasd_spinlock);
_
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[patch 05/24] ppc: remove redundant display of free swap space in show_mem()

2008-03-28 Thread akpm
From: Johannes Weiner [EMAIL PROTECTED]

show_mem() has no need to print the amount of free swap space manually because
show_free_areas() does this already and is called by the former.

The two outputs only differ in text formatting:

  printk(Free swap  = %lukB\n, ...);
  printk(Free swap:   %6ldkB\n, ...);

Signed-off-by: Johannes Weiner [EMAIL PROTECTED]
Cc: Paul Mackerras [EMAIL PROTECTED]
Cc: Benjamin Herrenschmidt [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 arch/ppc/mm/init.c |1 -
 1 file changed, 1 deletion(-)

diff -puN 
arch/ppc/mm/init.c~ppc-remove-redundant-display-of-free-swap-space-in-show_mem 
arch/ppc/mm/init.c
--- 
a/arch/ppc/mm/init.c~ppc-remove-redundant-display-of-free-swap-space-in-show_mem
+++ a/arch/ppc/mm/init.c
@@ -109,7 +109,6 @@ void show_mem(void)
 
printk(Mem-info:\n);
show_free_areas();
-   printk(Free swap:   %6ldkB\n, nr_swap_pages(PAGE_SHIFT-10));
i = max_mapnr;
while (i--  0) {
total++;
_
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[patch 04/24] powerpc: remove redundant display of free swap space in show_mem()

2008-03-28 Thread akpm
From: Johannes Weiner [EMAIL PROTECTED]

show_mem() has no need to print the amount of free swap space manually because
show_free_areas() does this already and is called by the former.

The two outputs only differ in text formatting:

  printk(Free swap  = %lukB\n, ...);
  printk(Free swap:   %6ldkB\n, ...);

Signed-off-by: Johannes Weiner [EMAIL PROTECTED]
Cc: Paul Mackerras [EMAIL PROTECTED]
Cc: Benjamin Herrenschmidt [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 arch/powerpc/mm/mem.c |1 -
 1 file changed, 1 deletion(-)

diff -puN 
arch/powerpc/mm/mem.c~powerpc-remove-redundant-display-of-free-swap-space-in-show_mem
 arch/powerpc/mm/mem.c
--- 
a/arch/powerpc/mm/mem.c~powerpc-remove-redundant-display-of-free-swap-space-in-show_mem
+++ a/arch/powerpc/mm/mem.c
@@ -175,7 +175,6 @@ void show_mem(void)
 
printk(Mem-info:\n);
show_free_areas();
-   printk(Free swap:   %6ldkB\n, nr_swap_pages(PAGE_SHIFT-10));
for_each_online_pgdat(pgdat) {
unsigned long flags;
pgdat_resize_lock(pgdat, flags);
_
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[patch 22/24] rapidio: change RapidIO doorbell source and target ID field to 16-bit

2008-03-28 Thread akpm
From: Zhang Wei [EMAIL PROTECTED]

Change RapidIO doorbell source and target ID field to 16-bit for
support large system size, which max rio devid is 65535.

Signed-off-by: Zhang Wei [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 arch/powerpc/sysdev/fsl_rio.c |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff -puN 
arch/powerpc/sysdev/fsl_rio.c~rapidio-change-rapidio-doorbell-source-and-target-id-field-to-16-bit
 arch/powerpc/sysdev/fsl_rio.c
--- 
a/arch/powerpc/sysdev/fsl_rio.c~rapidio-change-rapidio-doorbell-source-and-target-id-field-to-16-bit
+++ a/arch/powerpc/sysdev/fsl_rio.c
@@ -75,13 +75,13 @@
 #define DOORBELL_DSR_TE0x0080
 #define DOORBELL_DSR_QFI   0x0010
 #define DOORBELL_DSR_DIQI  0x0001
-#define DOORBELL_TID_OFFSET0x03
-#define DOORBELL_SID_OFFSET0x05
+#define DOORBELL_TID_OFFSET0x02
+#define DOORBELL_SID_OFFSET0x04
 #define DOORBELL_INFO_OFFSET   0x06
 
 #define DOORBELL_MESSAGE_SIZE  0x08
-#define DBELL_SID(x)   (*(u8 *)(x + DOORBELL_SID_OFFSET))
-#define DBELL_TID(x)   (*(u8 *)(x + DOORBELL_TID_OFFSET))
+#define DBELL_SID(x)   (*(u16 *)(x + DOORBELL_SID_OFFSET))
+#define DBELL_TID(x)   (*(u16 *)(x + DOORBELL_TID_OFFSET))
 #define DBELL_INF(x)   (*(u16 *)(x + DOORBELL_INFO_OFFSET))
 
 struct rio_atmu_regs {
_
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[patch 08/24] rapidio: add RapidIO option to kernel configuration

2008-03-28 Thread akpm
From: Zhang Wei [EMAIL PROTECTED]

Signed-off-by: Zhang Wei [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 arch/powerpc/Kconfig|   13 +
 arch/powerpc/platforms/86xx/Kconfig |1 +
 2 files changed, 14 insertions(+)

diff -puN 
arch/powerpc/Kconfig~rapidio-add-rapidio-option-to-kernel-configuration 
arch/powerpc/Kconfig
--- a/arch/powerpc/Kconfig~rapidio-add-rapidio-option-to-kernel-configuration
+++ a/arch/powerpc/Kconfig
@@ -571,6 +571,19 @@ source drivers/pcmcia/Kconfig
 
 source drivers/pci/hotplug/Kconfig
 
+config HAS_RAPIDIO
+   bool
+   default n
+
+config RAPIDIO
+   bool RapidIO support
+   depends on HAS_RAPIDIO
+   help
+ If you say Y here, the kernel will include drivers and
+ infrastructure code to support RapidIO interconnect devices.
+
+source drivers/rapidio/Kconfig
+
 endmenu
 
 menu Advanced setup
diff -puN 
arch/powerpc/platforms/86xx/Kconfig~rapidio-add-rapidio-option-to-kernel-configuration
 arch/powerpc/platforms/86xx/Kconfig
--- 
a/arch/powerpc/platforms/86xx/Kconfig~rapidio-add-rapidio-option-to-kernel-configuration
+++ a/arch/powerpc/platforms/86xx/Kconfig
@@ -8,6 +8,7 @@ config MPC8641_HPCN
select PPC_I8259
select DEFAULT_UIMAGE
select FSL_ULI1575
+   select HAS_RAPIDIO
help
  This option enables support for the MPC8641 HPCN board.
 
_
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[patch 09/24] rapidio: move include/asm-ppc/rio.h to include/asm-powerpc/rio.h

2008-03-28 Thread akpm
From: Zhang Wei [EMAIL PROTECTED]

Signed-off-by: Zhang Wei [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 include/asm-powerpc/rio.h |   18 ++
 include/asm-ppc/rio.h |   18 --
 2 files changed, 18 insertions(+), 18 deletions(-)

diff -puN /dev/null include/asm-powerpc/rio.h
--- /dev/null
+++ a/include/asm-powerpc/rio.h
@@ -0,0 +1,18 @@
+/*
+ * RapidIO architecture support
+ *
+ * Copyright 2005 MontaVista Software, Inc.
+ * Matt Porter [EMAIL PROTECTED]
+ *
+ * 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, or (at your
+ * option) any later version.
+ */
+
+#ifndef ASM_PPC_RIO_H
+#define ASM_PPC_RIO_H
+
+extern void platform_rio_init(void);
+
+#endif /* ASM_PPC_RIO_H */
diff -puN 
include/asm-ppc/rio.h~rapidio-move-include-asm-ppc-rioh-to-include-asm-powerpc-rioh
 /dev/null
--- a/include/asm-ppc/rio.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * RapidIO architecture support
- *
- * Copyright 2005 MontaVista Software, Inc.
- * Matt Porter [EMAIL PROTECTED]
- *
- * 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, or (at your
- * option) any later version.
- */
-
-#ifndef ASM_PPC_RIO_H
-#define ASM_PPC_RIO_H
-
-extern void platform_rio_init(void);
-
-#endif /* ASM_PPC_RIO_H */
_
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[patch 19/24] rapidio: add FSL RapidIO controller memory ops functions

2008-03-28 Thread akpm
From: Zhang Wei [EMAIL PROTECTED]

Add FSL RapidIO controller (MPC85xx, MPC86xx) memory operation functions,
which include map inbound/outbound window and unmap incound/outbound window.

Signed-off-by: Zhang Wei [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 arch/powerpc/sysdev/fsl_rio.c |  204 
 1 file changed, 204 insertions(+)

diff -puN 
arch/powerpc/sysdev/fsl_rio.c~rapidio-add-fsl-rapidio-controller-memory-ops-functions
 arch/powerpc/sysdev/fsl_rio.c
--- 
a/arch/powerpc/sysdev/fsl_rio.c~rapidio-add-fsl-rapidio-controller-memory-ops-functions
+++ a/arch/powerpc/sysdev/fsl_rio.c
@@ -30,6 +30,8 @@
 #define IRQ_RIO_TX(m)  (((struct rio_priv *)(m-priv))-txirq)
 #define IRQ_RIO_RX(m)  (((struct rio_priv *)(m-priv))-rxirq)
 
+#define IS_64BIT_RES ((sizeof(resource_size_t) == 8) ? 1 : 0)
+
 #define RIO_ATMU_REGS_OFFSET   0x10c00
 #define RIO_P_MSG_REGS_OFFSET  0x11000
 #define RIO_S_MSG_REGS_OFFSET  0x13000
@@ -39,6 +41,15 @@
 #define RIO_ISR_AACR_AA0x1 /* Accept All ID */
 #define RIO_MAINT_WIN_SIZE 0x40
 #define RIO_DBELL_WIN_SIZE 0x1000
+#define RIO_MAX_INB_ATMU   4
+#define RIO_MAX_OUTB_ATMU  8
+#define RIO_INB_ATMU_REGS_OFFSET   0x10de0
+#define RIO_ATMU_EN_MASK   0x8000
+
+#define RIO_NREAD  0x4
+#define RIO_NWRITE 0x4
+#define RIO_NWRITE_R   0x5
+#define RIO_NREAD_R0x5
 
 #define RIO_MSG_OMR_MUI0x0002
 #define RIO_MSG_OSR_TE 0x0080
@@ -82,6 +93,15 @@ struct rio_atmu_regs {
u32 pad3[3];
 };
 
+struct rio_inb_atmu_regs {
+   u32 riwtar;
+   u32 pad1;
+   u32 riwbar;
+   u32 pad2;
+   u32 riwar;
+   u32 pad3[3];
+};
+
 struct rio_msg_regs {
u32 omr;
u32 osr;
@@ -334,6 +354,182 @@ fsl_rio_config_write(struct rio_mport *m
 }
 
 /**
+ * fsl_rio_map_inb_mem -- Mapping inbound memory region.
+ * @lstart: Local memory space start address.
+ * @rstart: RapidIO space start address.
+ * @size: The mapping region size.
+ * @flags: Flags for mapping. 0 for using default flags.
+ *
+ * Return: 0 -- Success.
+ *
+ * This function will create the inbound mapping
+ * from rstart to lstart.
+ */
+static int fsl_rio_map_inb_mem(struct rio_mport *mport, resource_size_t lstart,
+   resource_size_t rstart, resource_size_t size, u32 flags)
+{
+   int i;
+   struct rio_priv *priv = mport-priv;
+   struct rio_inb_atmu_regs __iomem *inbatmu = (struct rio_inb_atmu_regs *)
+   (priv-regs_win + RIO_INB_ATMU_REGS_OFFSET) - 1;
+   int size_ffs;
+   resource_size_t align;
+
+   if (flags == 0)
+   flags = (RIO_NREAD_R  4) | RIO_NWRITE_R;
+
+   align = (size  0x1000) ? 0x1000 : 1  (__ilog2(size - 1) + 1);
+
+   /* Align the size */
+   if ((lstart + size)  (_ALIGN_DOWN(lstart, align) + align)) {
+   size_ffs = __ffs(_ALIGN_DOWN(lstart + size - 1, align));
+   size = 1  (size_ffs + (((_ALIGN_DOWN(lstart, 1  size_ffs) +
+   (1  size_ffs))  (lstart + size)) ? 1 : 0));
+   } else
+   size = align;
+
+   if ((lstart  (size - 1)) != (rstart  (size - 1))) {
+   dev_err(mport-dev, The local address 0x%x can not be aligned 
+   to the same size 0x%x with the RapidIO space 
+   address 0x%x!\n, lstart, size, rstart);
+   return -EINVAL;
+   }
+
+   /* Search for free inbound ATMU */
+   for (i = 1;
+   (i = RIO_MAX_INB_ATMU)  (inbatmu-riwar  RIO_ATMU_EN_MASK);
+   i++, inbatmu--)
+   ;
+
+   if (i  RIO_MAX_INB_ATMU) {
+   dev_err(mport-dev, No free inbound ATMU!\n);
+   return -EBUSY;
+   }
+   out_be32(inbatmu-riwtar, ((IS_64BIT_RES ? (lstart  32)
+0xf : 0)  20) | ((lstart  12)  0xf));
+   out_be32(inbatmu-riwbar, ((IS_64BIT_RES ? (rstart  32)
+0x3 : 0)  20) | ((rstart  12)  0xf));
+   out_be32(inbatmu-riwar, 0x8000 | (0xf  20)
+   | ((flags  0xff)  12)
+   | (__ilog2(size) - 1));
+   return 0;
+}
+
+/**
+ * fsl_rio_map_outb_mem -- Mapping outbound memory region.
+ * @lstart: Local memory space start address.
+ * @rstart: RapidIO space start address.
+ * @size: The mapping region size.
+ * @tid: The target RapidIO device id.
+ * @flags: Flags for mapping. 0 for using default flags.
+ *
+ * Return: 0 -- Success.
+ *
+ * This function will create the outbound mapping
+ * from lstart to rstart.
+ */
+static int fsl_rio_map_outb_mem(struct rio_mport *mport, resource_size_t 
lstart,
+   resource_size_t rstart, resource_size_t size,
+   u16 tid, u32 flags)
+{
+   int i;
+   struct rio_priv *priv = mport-priv;
+   struct 

[patch 20/24] rapidio: add the RapidIO master port maintance and doorbell window to space resources

2008-03-28 Thread akpm
From: Zhang Wei [EMAIL PROTECTED]

Add the RapidIO master port maintance and doorbell IO windows to RIO space
resources.

Signed-off-by: Zhang Wei [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 arch/powerpc/sysdev/fsl_rio.c |   26 +-
 include/linux/rio.h   |1 +
 2 files changed, 22 insertions(+), 5 deletions(-)

diff -puN 
arch/powerpc/sysdev/fsl_rio.c~rapidio-add-the-rapidio-master-port-maintance-and-doorbell-window-to-space-resources
 arch/powerpc/sysdev/fsl_rio.c
--- 
a/arch/powerpc/sysdev/fsl_rio.c~rapidio-add-the-rapidio-master-port-maintance-and-doorbell-window-to-space-resources
+++ a/arch/powerpc/sysdev/fsl_rio.c
@@ -192,6 +192,8 @@ struct rio_priv {
int bellirq;
int txirq;
int rxirq;
+   struct resource maint_res;
+   struct resource dbell_res;
 };
 
 /**
@@ -1362,15 +1364,29 @@ int fsl_rio_setup(struct of_device *dev)
out_be32((priv-regs_win + RIO_ISR_AACR), RIO_ISR_AACR_AA);
 
/* Configure maintenance transaction window */
-   out_be32(priv-maint_atmu_regs-rowbar, 0x000c);
-   out_be32(priv-maint_atmu_regs-rowar, 0x80077015);
+   rio_init_io_res(priv-maint_res, law_start, RIO_MAINT_WIN_SIZE,
+   maint_win, RIO_RESOURCE_MAINT);
+   rc = rio_request_io_region(port, priv-maint_res);
+   if (rc) {
+   dev_err(dev-dev, request maint window error!\n);
+   goto err;
+   }
+   out_be32(priv-maint_atmu_regs-rowbar, (law_start  12)  0xff);
+   out_be32(priv-maint_atmu_regs-rowar, 0x80077000
+   | (__ilog2(RIO_MAINT_WIN_SIZE) - 1));
 
priv-maint_win = ioremap(law_start, RIO_MAINT_WIN_SIZE);
 
/* Configure outbound doorbell window */
-   out_be32(priv-dbell_atmu_regs-rowbar, 0x000c0400);
-   out_be32(priv-dbell_atmu_regs-rowar, 0x8004200b);
-   fsl_rio_doorbell_init(port);
+   rio_init_io_res(priv-dbell_res, law_start + RIO_MAINT_WIN_SIZE,
+   RIO_DBELL_WIN_SIZE, dbell_win, RIO_RESOURCE_DOORBELL);
+   out_be32(priv-dbell_atmu_regs-rowbar, (priv-dbell_res.start  12)
+0xff);
+   out_be32(priv-dbell_atmu_regs-rowar, 0x80042000
+   | (__ilog2(RIO_DBELL_WIN_SIZE) - 1));
+   rc = fsl_rio_doorbell_init(port);
+   if (rc)
+   goto err;
 
return 0;
 err:
diff -puN 
include/linux/rio.h~rapidio-add-the-rapidio-master-port-maintance-and-doorbell-window-to-space-resources
 include/linux/rio.h
--- 
a/include/linux/rio.h~rapidio-add-the-rapidio-master-port-maintance-and-doorbell-window-to-space-resources
+++ a/include/linux/rio.h
@@ -257,6 +257,7 @@ struct rio_ops {
 #define RIO_RESOURCE_MEM   0x0100
 #define RIO_RESOURCE_DOORBELL  0x0200
 #define RIO_RESOURCE_MAILBOX   0x0400
+#define RIO_RESOURCE_MAINT 0x0800
 
 #define RIO_RESOURCE_CACHEABLE 0x0001
 #define RIO_RESOURCE_PCI   0x0002
_
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[patch 07/24] rapidio: change RIO function mpc85xx_ to fsl_

2008-03-28 Thread akpm
From: Zhang Wei [EMAIL PROTECTED]

The driver is also fit for Freescale MPC8641 processor.

Signed-off-by: Zhang Wei [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 arch/powerpc/sysdev/fsl_rio.c |   80 
 1 file changed, 40 insertions(+), 40 deletions(-)

diff -puN 
arch/powerpc/sysdev/fsl_rio.c~rapidio-change-rio-function-mpc85xx_-to-fsl_ 
arch/powerpc/sysdev/fsl_rio.c
--- a/arch/powerpc/sysdev/fsl_rio.c~rapidio-change-rio-function-mpc85xx_-to-fsl_
+++ a/arch/powerpc/sysdev/fsl_rio.c
@@ -1,5 +1,5 @@
 /*
- * MPC85xx RapidIO support
+ * Freescale MPC85xx/MPC86xx RapidIO support
  *
  * Copyright 2005 MontaVista Software, Inc.
  * Matt Porter [EMAIL PROTECTED]
@@ -145,7 +145,7 @@ static struct rio_msg_rx_ring {
 } msg_rx_ring;
 
 /**
- * mpc85xx_rio_doorbell_send - Send a MPC85xx doorbell message
+ * fsl_rio_doorbell_send - Send a MPC85xx doorbell message
  * @index: ID of RapidIO interface
  * @destid: Destination ID of target device
  * @data: 16-bit info field of RapidIO doorbell message
@@ -153,9 +153,9 @@ static struct rio_msg_rx_ring {
  * Sends a MPC85xx doorbell message. Returns %0 on success or
  * %-EINVAL on failure.
  */
-static int mpc85xx_rio_doorbell_send(int index, u16 destid, u16 data)
+static int fsl_rio_doorbell_send(int index, u16 destid, u16 data)
 {
-   pr_debug(mpc85xx_doorbell_send: index %d destid %4.4x data %4.4x\n,
+   pr_debug(fsl_doorbell_send: index %d destid %4.4x data %4.4x\n,
 index, destid, data);
out_be32((void *)dbell_atmu_regs-rowtar, destid  22);
out_be16((void *)(dbell_win), data);
@@ -164,7 +164,7 @@ static int mpc85xx_rio_doorbell_send(int
 }
 
 /**
- * mpc85xx_local_config_read - Generate a MPC85xx local config space read
+ * fsl_local_config_read - Generate a MPC85xx local config space read
  * @index: ID of RapdiIO interface
  * @offset: Offset into configuration space
  * @len: Length (in bytes) of the maintenance transaction
@@ -173,9 +173,9 @@ static int mpc85xx_rio_doorbell_send(int
  * Generates a MPC85xx local configuration space read. Returns %0 on
  * success or %-EINVAL on failure.
  */
-static int mpc85xx_local_config_read(int index, u32 offset, int len, u32 * 
data)
+static int fsl_local_config_read(int index, u32 offset, int len, u32 *data)
 {
-   pr_debug(mpc85xx_local_config_read: index %d offset %8.8x\n, index,
+   pr_debug(fsl_local_config_read: index %d offset %8.8x\n, index,
 offset);
*data = in_be32((void *)(regs_win + offset));
 
@@ -183,7 +183,7 @@ static int mpc85xx_local_config_read(int
 }
 
 /**
- * mpc85xx_local_config_write - Generate a MPC85xx local config space write
+ * fsl_local_config_write - Generate a MPC85xx local config space write
  * @index: ID of RapdiIO interface
  * @offset: Offset into configuration space
  * @len: Length (in bytes) of the maintenance transaction
@@ -192,10 +192,10 @@ static int mpc85xx_local_config_read(int
  * Generates a MPC85xx local configuration space write. Returns %0 on
  * success or %-EINVAL on failure.
  */
-static int mpc85xx_local_config_write(int index, u32 offset, int len, u32 data)
+static int fsl_local_config_write(int index, u32 offset, int len, u32 data)
 {
pr_debug
-   (mpc85xx_local_config_write: index %d offset %8.8x data %8.8x\n,
+   (fsl_local_config_write: index %d offset %8.8x data %8.8x\n,
 index, offset, data);
out_be32((void *)(regs_win + offset), data);
 
@@ -203,7 +203,7 @@ static int mpc85xx_local_config_write(in
 }
 
 /**
- * mpc85xx_rio_config_read - Generate a MPC85xx read maintenance transaction
+ * fsl_rio_config_read - Generate a MPC85xx read maintenance transaction
  * @index: ID of RapdiIO interface
  * @destid: Destination ID of transaction
  * @hopcount: Number of hops to target device
@@ -215,13 +215,13 @@ static int mpc85xx_local_config_write(in
  * success or %-EINVAL on failure.
  */
 static int
-mpc85xx_rio_config_read(int index, u16 destid, u8 hopcount, u32 offset, int 
len,
+fsl_rio_config_read(int index, u16 destid, u8 hopcount, u32 offset, int len,
u32 * val)
 {
u8 *data;
 
pr_debug
-   (mpc85xx_rio_config_read: index %d destid %d hopcount %d offset 
%8.8x len %d\n,
+   (fsl_rio_config_read: index %d destid %d hopcount %d offset %8.8x 
len %d\n,
 index, destid, hopcount, offset, len);
out_be32((void *)maint_atmu_regs-rowtar,
 (destid  22) | (hopcount  12) | ((offset  ~0x3)  9));
@@ -243,7 +243,7 @@ mpc85xx_rio_config_read(int index, u16 d
 }
 
 /**
- * mpc85xx_rio_config_write - Generate a MPC85xx write maintenance transaction
+ * fsl_rio_config_write - Generate a MPC85xx write maintenance transaction
  * @index: ID of RapdiIO interface
  * @destid: Destination ID of transaction
  * @hopcount: Number of hops to target device
@@ -255,12 +255,12 @@ mpc85xx_rio_config_read(int index, u16 d
  * success 

[patch 21/24] rapidio: add RapidIO proc fs for memory mapping debugging

2008-03-28 Thread akpm
From: Zhang Wei [EMAIL PROTECTED]

Get RapidIO space resource by catting /proc/riores.

Signed-off-by: Zhang Wei [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/rapidio/Kconfig |8 ++
 drivers/rapidio/rio.c   |  121 ++
 2 files changed, 129 insertions(+)

diff -puN 
drivers/rapidio/Kconfig~rapidio-add-rapidio-proc-fs-for-memory-mapping-debugging
 drivers/rapidio/Kconfig
--- 
a/drivers/rapidio/Kconfig~rapidio-add-rapidio-proc-fs-for-memory-mapping-debugging
+++ a/drivers/rapidio/Kconfig
@@ -9,4 +9,12 @@ config RAPIDIO_DISC_TIMEOUT
  Amount of time a discovery node waits for a host to complete
  enumeration before giving up.
 
+config RAPIDIO_PROC_FS
+   bool I/O and Memory resource debug
+   depends on RAPIDIO  PROC_FS
+   default y
+   ---help---
+ Enable this option, it will create a /proc/riores node for
+ monitoring the RapidIO I/O and Memory resource.
+
 source drivers/rapidio/sallocator/Kconfig
diff -puN 
drivers/rapidio/rio.c~rapidio-add-rapidio-proc-fs-for-memory-mapping-debugging 
drivers/rapidio/rio.c
--- 
a/drivers/rapidio/rio.c~rapidio-add-rapidio-proc-fs-for-memory-mapping-debugging
+++ a/drivers/rapidio/rio.c
@@ -31,6 +31,9 @@
 #include linux/spinlock.h
 #include linux/slab.h
 #include linux/interrupt.h
+#include linux/seq_file.h
+#include linux/fs.h
+#include linux/proc_fs.h
 #include linux/dma-mapping.h
 #include linux/hardirq.h
 
@@ -872,3 +875,121 @@ EXPORT_SYMBOL_GPL(rio_request_inb_mbox);
 EXPORT_SYMBOL_GPL(rio_release_inb_mbox);
 EXPORT_SYMBOL_GPL(rio_request_outb_mbox);
 EXPORT_SYMBOL_GPL(rio_release_outb_mbox);
+
+#ifdef CONFIG_RAPIDIO_PROC_FS
+enum { MAX_IORES_LEVEL = 5 };
+
+struct riors {
+   struct rio_mport *mp;
+   int res;
+   struct resource *p;
+} riomres;
+
+static void *r_next(struct seq_file *m, void *v, loff_t *pos)
+{
+   struct resource *p = v;
+   struct riors *rs = m-private;
+
+   (*pos)++;
+   if (p-child)
+   return p-child;
+   while (!p-sibling  p-parent)
+   p = p-parent;
+   if (p-sibling)
+   return p-sibling;
+   else {
+   rs-res++;
+   if (rs-res = RIO_MAX_MPORT_RESOURCES) {
+   rs-mp = list_entry(rs-mp-node.next, struct rio_mport,
+   node);
+   rs-res = 0;
+   if (rs-mp-node == rio_mports)
+   return NULL;
+   }
+   seq_printf(m, %2d: , rs-res);
+   rs-p = rs-mp-riores[rs-res];
+   p = rs-p;
+
+   return p;
+   }
+}
+
+static void *r_start(struct seq_file *m, loff_t *pos)
+{
+   struct riors *rs = m-private;
+   struct resource *p;
+
+   if (*pos) {
+   *pos = 0;
+   return NULL;
+   }
+
+   rs-mp = list_entry(rio_mports.next, struct rio_mport, node);
+   rs-res = -1;
+   rs-p = rs-mp-iores;
+   p = rs-p;
+
+   seq_printf(m, IO: );
+
+   return p;
+}
+
+static void r_stop(struct seq_file *m, void *v)
+{
+}
+
+static int r_show(struct seq_file *m, void *v)
+{
+   struct riors *rs = m-private;
+   struct resource *root = rs-p;
+   struct resource *r = v, *p;
+   int width = root-end  0x1 ? 4 : 8;
+   int depth;
+
+   for (depth = 0, p = r; p-parent  depth  MAX_IORES_LEVEL; depth++,
+   p = p-parent)
+   if (p == root)
+   break;
+   seq_printf(m, %*s%0*llx-%0*llx : %s\n,
+   depth * 2, ,
+   width, (unsigned long long) r-start,
+   width, (unsigned long long) r-end,
+   r-name ? r-name : BAD);
+   return 0;
+}
+
+static const struct seq_operations resource_op = {
+   .start  = r_start,
+   .next   = r_next,
+   .stop   = r_stop,
+   .show   = r_show,
+};
+
+static int riores_open(struct inode *inode, struct file *file)
+{
+   int res = seq_open(file, resource_op);
+   if (!res) {
+   struct seq_file *m = file-private_data;
+   m-private = riomres;
+   }
+   return res;
+}
+
+static const struct file_operations proc_riores_operations = {
+   .open   = riores_open,
+   .read   = seq_read,
+   .llseek = seq_lseek,
+   .release= seq_release,
+};
+
+static int __init rioresources_init(void)
+{
+   struct proc_dir_entry *entry;
+
+   entry = create_proc_entry(riores, 0, NULL);
+   if (entry)
+   entry-proc_fops = proc_riores_operations;
+   return 0;
+}
+__initcall(rioresources_init);
+#endif
_
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[patch 23/24] rapidio: add the memory mapping support in rionet driver

2008-03-28 Thread akpm
From: Zhang Wei [EMAIL PROTECTED]

The user can select memory mapping mode or message mode in CONFIG.  It is also
an example to how-to use memory mapping driver for RapidIO.

Signed-off-by: Zhang Wei [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/net/Kconfig  |   10 +
 drivers/net/rionet.c |  324 +
 2 files changed, 334 insertions(+)

diff -puN 
drivers/net/Kconfig~rapidio-add-the-memory-mapping-support-in-rionet-driver 
drivers/net/Kconfig
--- 
a/drivers/net/Kconfig~rapidio-add-the-memory-mapping-support-in-rionet-driver
+++ a/drivers/net/Kconfig
@@ -2719,6 +2719,16 @@ config RIONET_RX_SIZE
depends on RIONET
default 128
 
+config RIONET_MEMMAP
+   bool Use memory map instead of message
+   depends on RIONET
+   default n
+
+config RIONET_DMA
+   bool Use DMA for memory mapping data transfer
+   depends on RIONET_MEMMAP  FSL_DMA
+   default y
+
 config FDDI
bool FDDI driver support
depends on (PCI || EISA || TC)
diff -puN 
drivers/net/rionet.c~rapidio-add-the-memory-mapping-support-in-rionet-driver 
drivers/net/rionet.c
--- 
a/drivers/net/rionet.c~rapidio-add-the-memory-mapping-support-in-rionet-driver
+++ a/drivers/net/rionet.c
@@ -1,6 +1,13 @@
 /*
  * rionet - Ethernet driver over RapidIO messaging services
  *
+ * Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.
+ * Author: Zhang Wei, [EMAIL PROTECTED], Jun 2007
+ *
+ * Changelog:
+ * Jun 2007 Zhang Wei [EMAIL PROTECTED]
+ * - Added the support to RapidIO memory driver. 2007.
+ *
  * Copyright 2005 MontaVista Software, Inc.
  * Matt Porter [EMAIL PROTECTED]
  *
@@ -8,6 +15,7 @@
  * under  the terms of  the GNU General  Public License as published by the
  * Free Software Foundation;  either version 2 of the  License, or (at your
  * option) any later version.
+ *
  */
 
 #include linux/module.h
@@ -23,6 +31,7 @@
 #include linux/skbuff.h
 #include linux/crc32.h
 #include linux/ethtool.h
+#include linux/dmaengine.h
 
 #define DRV_NAMErionet
 #define DRV_VERSION 0.2
@@ -40,13 +49,47 @@ MODULE_LICENSE(GPL);
 NETIF_MSG_TX_ERR)
 
 #define RIONET_DOORBELL_JOIN   0x1000
+#ifdef CONFIG_RIONET_MEMMAP
+#define RIONET_DOORBELL_SEND   0x1001
+#define RIONET_DOORBELL_LEAVE  0x1002
+#else
 #define RIONET_DOORBELL_LEAVE  0x1001
+#endif
 
 #define RIONET_MAILBOX 0
 
 #define RIONET_TX_RING_SIZECONFIG_RIONET_TX_SIZE
 #define RIONET_RX_RING_SIZECONFIG_RIONET_RX_SIZE
 
+#define ERR(fmt, arg...) \
+   printk(KERN_ERR ERROR %s - %s:  fmt,  __FILE__, __func__, ## arg)
+
+#ifdef CONFIG_RIONET_MEMMAP
+/* Definitions for rionet memory map driver */
+#define RIONET_DRVID   0x101
+#define RIONET_MAX_SK_DATA_SIZE0x1000
+#define RIONET_TX_RX_BUFF_SIZE (0x1000 * (128 + 128))
+#define RIONET_QUEUE_NEXT(x)   (((x)  127) ? ((x) + 1) : 0)
+#define RIONET_QUEUE_INC(x)(x = RIONET_QUEUE_NEXT(x))
+
+struct sk_data {
+   u8  data[0x1000];
+};
+
+#define RIONET_SKDATA_EN   0x8000
+struct rionet_tx_rx_buff {
+   int enqueue;/* enqueue point */
+   int dequeue;/* dequeue point */
+   u32 size[128];  /* size[i] is skdata[i] size
+* the most high bit [31] is
+* enable bit. The
+* max size is 4096.
+*/
+   u8  rev1[3576];
+   struct sk_data  skdata[128];/* all size are 0x1000 * 128 */
+};
+#endif /* CONFIG_RIONET_MEMMAP */
+
 static LIST_HEAD(rionet_peers);
 
 struct rionet_private {
@@ -60,6 +103,18 @@ struct rionet_private {
spinlock_t lock;
spinlock_t tx_lock;
u32 msg_enable;
+#ifdef CONFIG_RIONET_MEMMAP
+   struct rionet_tx_rx_buff *rxbuff;
+   struct rionet_tx_rx_buff __iomem *txbuff;
+   struct rio_mem *rxmem;
+   struct rio_mem *txmem;
+#ifdef CONFIG_RIONET_DMA
+   struct dma_chan *txdmachan;
+   struct dma_chan *rxdmachan;
+   struct dma_client rio_dma_client;
+   spinlock_t rio_dma_event_lock;
+#endif
+#endif
 };
 
 struct rionet_peer {
@@ -90,6 +145,7 @@ static struct rio_dev **rionet_active;
 #define RIONET_MAC_MATCH(x)(*(u32 *)x == 0x00010001)
 #define RIONET_GET_DESTID(x)   (*(u16 *)(x + 4))
 
+#ifndef CONFIG_RIONET_MEMMAP
 static int rionet_rx_clean(struct net_device *ndev)
 {
int i;
@@ -108,9 +164,11 @@ static int rionet_rx_clean(struct net_de
 
rnet-rx_skb[i]-data = data;
skb_put(rnet-rx_skb[i], RIO_MAX_MSG_SIZE);
+   rnet-rx_skb[i]-dev = ndev;
rnet-rx_skb[i]-protocol =
eth_type_trans(rnet-rx_skb[i], ndev);
error = netif_rx(rnet-rx_skb[i]);
+   rnet-rx_skb[i] = 

[patch 11/24] rapidio: add OF-tree support to RapidIO controller driver

2008-03-28 Thread akpm
From: Zhang Wei [EMAIL PROTECTED]

Signed-off-by: Zhang Wei [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 arch/powerpc/kernel/Makefile  |1 
 arch/powerpc/kernel/rio.c |   52 ---
 arch/powerpc/sysdev/fsl_rio.c |  110 +---
 arch/powerpc/sysdev/fsl_rio.h |   20 -
 4 files changed, 102 insertions(+), 81 deletions(-)

diff -puN 
arch/powerpc/kernel/Makefile~rapidio-add-of-tree-support-to-rapidio-controller-driver
 arch/powerpc/kernel/Makefile
--- 
a/arch/powerpc/kernel/Makefile~rapidio-add-of-tree-support-to-rapidio-controller-driver
+++ a/arch/powerpc/kernel/Makefile
@@ -72,7 +72,6 @@ pci64-$(CONFIG_PPC64) += pci_dn.o isa-b
 obj-$(CONFIG_PCI)  += pci_$(CONFIG_WORD_SIZE).o $(pci64-y) \
   pci-common.o
 obj-$(CONFIG_PCI_MSI)  += msi.o
-obj-$(CONFIG_RAPIDIO)  += rio.o
 obj-$(CONFIG_KEXEC)+= machine_kexec.o crash.o \
   machine_kexec_$(CONFIG_WORD_SIZE).o
 obj-$(CONFIG_AUDIT)+= audit.o
diff -puN 
arch/powerpc/kernel/rio.c~rapidio-add-of-tree-support-to-rapidio-controller-driver
 /dev/null
--- a/arch/powerpc/kernel/rio.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * RapidIO PPC32 support
- *
- * Copyright 2005 MontaVista Software, Inc.
- * Matt Porter [EMAIL PROTECTED]
- *
- * 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, or (at your
- * option) any later version.
- */
-
-#include linux/init.h
-#include linux/kernel.h
-#include linux/rio.h
-
-#include asm/rio.h
-
-/**
- * platform_rio_init - Do platform specific RIO init
- *
- * Any platform specific initialization of RapdIO
- * hardware is done here as well as registration
- * of any active master ports in the system.
- */
-void __attribute__ ((weak))
-platform_rio_init(void)
-{
-   printk(KERN_WARNING RIO: No platform_rio_init() present\n);
-}
-
-/**
- * ppc_rio_init - Do PPC32 RIO init
- *
- * Calls platform-specific RIO init code and then calls
- * rio_init_mports() to initialize any master ports that
- * have been registered with the RIO subsystem.
- */
-static int __init ppc_rio_init(void)
-{
-   printk(KERN_INFO RIO: RapidIO init\n);
-
-   /* Platform specific initialization */
-   platform_rio_init();
-
-   /* Enumerate all registered ports */
-   rio_init_mports();
-
-   return 0;
-}
-
-subsys_initcall(ppc_rio_init);
diff -puN 
arch/powerpc/sysdev/fsl_rio.c~rapidio-add-of-tree-support-to-rapidio-controller-driver
 arch/powerpc/sysdev/fsl_rio.c
--- 
a/arch/powerpc/sysdev/fsl_rio.c~rapidio-add-of-tree-support-to-rapidio-controller-driver
+++ a/arch/powerpc/sysdev/fsl_rio.c
@@ -20,6 +20,7 @@
 #include linux/interrupt.h
 #include linux/rio.h
 #include linux/rio_drv.h
+#include linux/of_platform.h
 
 #include asm/io.h
 
@@ -28,7 +29,6 @@
 #define IRQ_RIO_TX(m)  (((struct rio_priv *)(m-priv))-txirq)
 #define IRQ_RIO_RX(m)  (((struct rio_priv *)(m-priv))-rxirq)
 
-#define RIO_REGS_BASE  (CCSRBAR + 0xc)
 #define RIO_ATMU_REGS_OFFSET   0x10c00
 #define RIO_MSG_REGS_OFFSET0x11000
 #define RIO_MAINT_WIN_SIZE 0x40
@@ -905,19 +905,66 @@ __setup(riohdid=, fsl_rio_get_cmdline)
 
 /**
  * fsl_rio_setup - Setup MPC85xx RapidIO interface
- * @law_start: Starting physical address of RapidIO LAW
- * @law_size: Size of RapidIO LAW
+ * @fsl_rio_setup - Setup Freescale PowerPC RapidIO interface
  *
  * Initializes MPC85xx RapidIO hardware interface, configures
  * master port with system-specific info, and registers the
  * master port with the RapidIO subsystem.
  */
-void fsl_rio_setup(int law_start, int law_size)
+int fsl_rio_setup(struct of_device *dev)
 {
struct rio_ops *ops;
struct rio_mport *port;
-   struct rio_priv *priv = NULL;
-   int rc;
+   struct rio_priv *priv;
+   int rc = 0;
+   const u32 *dt_range, *cell;
+   struct resource regs;
+   int rlen;
+   u64 law_start, law_size;
+   int paw, aw, sw;
+
+   if (!dev-node) {
+   dev_err(dev-dev, Device OF-Node is NULL);
+   return -EFAULT;
+   }
+
+   rc = of_address_to_resource(dev-node, 0, regs);
+   if (rc) {
+   dev_err(dev-dev, Can't get %s property 'reg'\n,
+   dev-node-full_name);
+   return -EFAULT;
+   }
+   dev_info(dev-dev, Of-device full name %s\n, dev-node-full_name);
+   dev_info(dev-dev, Regs start 0x%08x size 0x%08x\n,  regs.start,
+   regs.end - regs.start + 1);
+
+   dt_range = of_get_property(dev-node, ranges, rlen);
+   if (!dt_range) {
+   dev_err(dev-dev, Can't get %s property 'ranges'\n,
+   dev-node-full_name);
+  

[patch 18/24] rapidio: add RapidIO space allocation bitmap arithmetic

2008-03-28 Thread akpm
From: Zhang Wei [EMAIL PROTECTED]

The bitmap is the simplest RapidIO space allocation arithmetic.  It uses the
fixed size space for each RapidIO device in the inter-connection network.

Signed-off-by: Zhang Wei [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 arch/powerpc/sysdev/fsl_rio.c   |   11 
 drivers/rapidio/Kconfig |2 
 drivers/rapidio/Makefile|1 
 drivers/rapidio/rio.c   |1 
 drivers/rapidio/sallocator/Kconfig  |9 
 drivers/rapidio/sallocator/Makefile |   12 
 drivers/rapidio/sallocator/bitmap.c |  384 ++
 include/linux/rio.h |6 
 8 files changed, 425 insertions(+), 1 deletion(-)

diff -puN 
arch/powerpc/sysdev/fsl_rio.c~rapidio-add-rapidio-space-allocation-bitmap-arithmetic
 arch/powerpc/sysdev/fsl_rio.c
--- 
a/arch/powerpc/sysdev/fsl_rio.c~rapidio-add-rapidio-space-allocation-bitmap-arithmetic
+++ a/arch/powerpc/sysdev/fsl_rio.c
@@ -920,6 +920,17 @@ static int fsl_rio_doorbell_init(struct 
return rc;
 }
 
+u32 rio_get_mport_id(struct rio_mport *mport)
+{
+   u32 mport_id;
+
+   rio_local_read_config_32(mport, 0x60, mport_id);
+   mport_id = mport-sys_size ? (mport_id  0x) :
+   ((mport_id  16)  0xff);
+   return mport_id;
+
+}
+
 static char *cmdline = NULL;
 
 static int fsl_rio_get_hdid(int index)
diff -puN 
drivers/rapidio/Kconfig~rapidio-add-rapidio-space-allocation-bitmap-arithmetic 
drivers/rapidio/Kconfig
--- 
a/drivers/rapidio/Kconfig~rapidio-add-rapidio-space-allocation-bitmap-arithmetic
+++ a/drivers/rapidio/Kconfig
@@ -8,3 +8,5 @@ config RAPIDIO_DISC_TIMEOUT
---help---
  Amount of time a discovery node waits for a host to complete
  enumeration before giving up.
+
+source drivers/rapidio/sallocator/Kconfig
diff -puN 
drivers/rapidio/Makefile~rapidio-add-rapidio-space-allocation-bitmap-arithmetic 
drivers/rapidio/Makefile
--- 
a/drivers/rapidio/Makefile~rapidio-add-rapidio-space-allocation-bitmap-arithmetic
+++ a/drivers/rapidio/Makefile
@@ -4,3 +4,4 @@
 obj-y += rio.o rio-access.o rio-driver.o rio-scan.o rio-sysfs.o
 
 obj-$(CONFIG_RAPIDIO)  += switches/
+obj-$(CONFIG_RAPIDIO)  += sallocator/
diff -puN 
drivers/rapidio/rio.c~rapidio-add-rapidio-space-allocation-bitmap-arithmetic 
drivers/rapidio/rio.c
--- 
a/drivers/rapidio/rio.c~rapidio-add-rapidio-space-allocation-bitmap-arithmetic
+++ a/drivers/rapidio/rio.c
@@ -849,6 +849,7 @@ int rio_init_mports(void)
rio_enum_mport(port);
else
rio_disc_mport(port);
+   rio_space_init(port);
}
 
   out:
diff -puN /dev/null drivers/rapidio/sallocator/Kconfig
--- /dev/null
+++ a/drivers/rapidio/sallocator/Kconfig
@@ -0,0 +1,9 @@
+choice
+   prompt Default RapidIO Space Allocator
+   depends on RAPIDIO
+   default RIO_SA_DEFAULT_BITMAP
+
+   config RIO_SA_DEFAULT_BITMAP
+   bool Bitmap
+
+endchoice
diff -puN /dev/null drivers/rapidio/sallocator/Makefile
--- /dev/null
+++ a/drivers/rapidio/sallocator/Makefile
@@ -0,0 +1,12 @@
+#
+# Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.
+#
+# Author: Zhang Wei, [EMAIL PROTECTED], Jun 2007
+#
+# This 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, or
+# (at your option) any later version.
+#
+
+obj-$(CONFIG_RIO_SA_DEFAULT_BITMAP) += bitmap.o
diff -puN /dev/null drivers/rapidio/sallocator/bitmap.c
--- /dev/null
+++ a/drivers/rapidio/sallocator/bitmap.c
@@ -0,0 +1,384 @@
+/*
+ * Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.
+ * Author: Zhang Wei, [EMAIL PROTECTED], Jun 2007
+ *
+ * Description:
+ * RapidIO space allocator bitmap arithmetic.
+ *
+ * The Bitmap allocator make the whole RapidIO device have the same fixed
+ * inbound memory window. And on the top of each device inbound window,
+ * there is a sect0 area, which will use for recording the individual
+ * driver owned memory space in device.
+ *
+ * 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, or (at your
+ * option) any later version.
+ *
+ */
+
+#include linux/types.h
+#include linux/kernel.h
+
+#include linux/delay.h
+#include linux/init.h
+#include linux/rio.h
+#include linux/rio_drv.h
+#include linux/rio_ids.h
+#include linux/rio_regs.h
+#include linux/module.h
+#include linux/spinlock.h
+#include linux/slab.h
+#include linux/seq_file.h
+#include linux/fs.h
+#include linux/proc_fs.h
+#include linux/dma-mapping.h
+
+#include ../rio.h
+
+#undef DEBUG
+
+#define RIO_SBLOCK_SIZE4096
+
+#define ERR(fmt, arg...) \
+   printk(KERN_ERR ERROR %s - %s:  

[patch 10/24] rapidio: add RapidIO multi mport support

2008-03-28 Thread akpm
From: Zhang Wei [EMAIL PROTECTED]

The original RapidIO driver suppose there is only one mpc85xx RIO controller
in system.  So, some data structures are defined as mpc85xx_rio global, such
as 'regs_win', 'dbell_ring', 'msg_tx_ring'.  Now, I changed them to mport's
private members.  And you can define multi RIO OF-nodes in dts file for multi
RapidIO controller in one processor, such as PCI/PCI-Ex host controllers in
Freescale's silicon.  And the mport operation function declaration should be
changed to know which RapidIO controller is target.

Signed-off-by: Zhang Wei [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 arch/powerpc/sysdev/fsl_rio.c |  393 +---
 drivers/rapidio/rio-access.c  |   10 
 include/linux/rio.h   |   18 -
 3 files changed, 237 insertions(+), 184 deletions(-)

diff -puN arch/powerpc/sysdev/fsl_rio.c~rapidio-add-rapidio-multi-mport-support 
arch/powerpc/sysdev/fsl_rio.c
--- a/arch/powerpc/sysdev/fsl_rio.c~rapidio-add-rapidio-multi-mport-support
+++ a/arch/powerpc/sysdev/fsl_rio.c
@@ -1,6 +1,9 @@
 /*
  * Freescale MPC85xx/MPC86xx RapidIO support
  *
+ * Copyright (C) 2007, 2008 Freescale Semiconductor, Inc.
+ * Zhang Wei [EMAIL PROTECTED]
+ *
  * Copyright 2005 MontaVista Software, Inc.
  * Matt Porter [EMAIL PROTECTED]
  *
@@ -20,6 +23,11 @@
 
 #include asm/io.h
 
+/* RapidIO definition irq, which read from OF-tree */
+#define IRQ_RIO_BELL(m)(((struct rio_priv 
*)(m-priv))-bellirq)
+#define IRQ_RIO_TX(m)  (((struct rio_priv *)(m-priv))-txirq)
+#define IRQ_RIO_RX(m)  (((struct rio_priv *)(m-priv))-rxirq)
+
 #define RIO_REGS_BASE  (CCSRBAR + 0xc)
 #define RIO_ATMU_REGS_OFFSET   0x10c00
 #define RIO_MSG_REGS_OFFSET0x11000
@@ -112,20 +120,12 @@ struct rio_tx_desc {
u32 res4;
 };
 
-static u32 regs_win;
-static struct rio_atmu_regs *atmu_regs;
-static struct rio_atmu_regs *maint_atmu_regs;
-static struct rio_atmu_regs *dbell_atmu_regs;
-static u32 dbell_win;
-static u32 maint_win;
-static struct rio_msg_regs *msg_regs;
-
-static struct rio_dbell_ring {
+struct rio_dbell_ring {
void *virt;
dma_addr_t phys;
-} dbell_ring;
+};
 
-static struct rio_msg_tx_ring {
+struct rio_msg_tx_ring {
void *virt;
dma_addr_t phys;
void *virt_buffer[RIO_MAX_TX_RING_SIZE];
@@ -133,16 +133,32 @@ static struct rio_msg_tx_ring {
int tx_slot;
int size;
void *dev_id;
-} msg_tx_ring;
+};
 
-static struct rio_msg_rx_ring {
+struct rio_msg_rx_ring {
void *virt;
dma_addr_t phys;
void *virt_buffer[RIO_MAX_RX_RING_SIZE];
int rx_slot;
int size;
void *dev_id;
-} msg_rx_ring;
+};
+
+struct rio_priv {
+   void __iomem *regs_win;
+   struct rio_atmu_regs __iomem *atmu_regs;
+   struct rio_atmu_regs __iomem *maint_atmu_regs;
+   struct rio_atmu_regs __iomem *dbell_atmu_regs;
+   void __iomem *dbell_win;
+   void __iomem *maint_win;
+   struct rio_msg_regs __iomem *msg_regs;
+   struct rio_dbell_ring dbell_ring;
+   struct rio_msg_tx_ring msg_tx_ring;
+   struct rio_msg_rx_ring msg_rx_ring;
+   int bellirq;
+   int txirq;
+   int rxirq;
+};
 
 /**
  * fsl_rio_doorbell_send - Send a MPC85xx doorbell message
@@ -153,12 +169,14 @@ static struct rio_msg_rx_ring {
  * Sends a MPC85xx doorbell message. Returns %0 on success or
  * %-EINVAL on failure.
  */
-static int fsl_rio_doorbell_send(int index, u16 destid, u16 data)
+static int fsl_rio_doorbell_send(struct rio_mport *mport,
+   int index, u16 destid, u16 data)
 {
+   struct rio_priv *priv = mport-priv;
pr_debug(fsl_doorbell_send: index %d destid %4.4x data %4.4x\n,
 index, destid, data);
-   out_be32((void *)dbell_atmu_regs-rowtar, destid  22);
-   out_be16((void *)(dbell_win), data);
+   out_be32(priv-dbell_atmu_regs-rowtar, destid  22);
+   out_be16(priv-dbell_win, data);
 
return 0;
 }
@@ -173,11 +191,13 @@ static int fsl_rio_doorbell_send(int ind
  * Generates a MPC85xx local configuration space read. Returns %0 on
  * success or %-EINVAL on failure.
  */
-static int fsl_local_config_read(int index, u32 offset, int len, u32 *data)
+static int fsl_local_config_read(struct rio_mport *mport,
+   int index, u32 offset, int len, u32 *data)
 {
+   struct rio_priv *priv = mport-priv;
pr_debug(fsl_local_config_read: index %d offset %8.8x\n, index,
 offset);
-   *data = in_be32((void *)(regs_win + offset));
+   *data = in_be32(priv-regs_win + offset);
 
return 0;
 }
@@ -192,12 +212,14 @@ static int fsl_local_config_read(int ind
  * Generates a MPC85xx local configuration space write. Returns %0 on
  * success or %-EINVAL on failure.
  */
-static int fsl_local_config_write(int index, u32 offset, int len, u32 data)
+static int fsl_local_config_write(struct 

[patch 24/24] rapidio: fix docbook references

2008-03-28 Thread akpm
From: Randy Dunlap [EMAIL PROTECTED]

Fix rapidio docbook (file was removed) and fix header file kernel-doc.

Signed-off-by: Randy Dunlap [EMAIL PROTECTED]
Acked-by: Zhang Wei [EMAIL PROTECTED]
Cc: Matt Porter [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 Documentation/DocBook/rapidio.tmpl |1 -
 include/linux/rio.h|4 ++--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff -puN Documentation/DocBook/rapidio.tmpl~rapidio-fix-docbook-references 
Documentation/DocBook/rapidio.tmpl
--- a/Documentation/DocBook/rapidio.tmpl~rapidio-fix-docbook-references
+++ a/Documentation/DocBook/rapidio.tmpl
@@ -133,7 +133,6 @@
 !Idrivers/rapidio/rio-sysfs.c
  /sect1
  sect1 id=PPC32_supporttitlePPC32 support/title
-!Iarch/powerpc/kernel/rio.c
 !Earch/powerpc/sysdev/fsl_rio.c
 !Iarch/powerpc/sysdev/fsl_rio.c
  /sect1
diff -puN include/linux/rio.h~rapidio-fix-docbook-references include/linux/rio.h
--- a/include/linux/rio.h~rapidio-fix-docbook-references
+++ a/include/linux/rio.h
@@ -327,7 +327,7 @@ struct rio_route_ops {
 };
 
 /**
- * Struct for RIO memory definition.
+ * struct rio_mem - struct for RIO memory definition.
  * @node: Node in list of memories
  * @virt: The virtual address for mapped memory accessing.
  * @owner: The owner id of this memory.
@@ -346,7 +346,7 @@ struct rio_mem {
 };
 
 /**
- * Struct for RIO memory definition.
+ * struct rio_mem_ops - Struct for RIO memory operations definition.
  * @map_inb: The function for mapping inbound memory window.
  * @map_outb: The function for mapping outbound memory window.
  * @unmap_inb: The function for unmapping inbound memory window.
_
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[patch 06/24] lmb: add lmb_alloc_nid()

2008-03-28 Thread akpm
From: David Miller [EMAIL PROTECTED]

A variant of lmb_alloc() that tries to allocate memory on a specified NUMA
node 'nid' but falls back to normal lmb_alloc() if that fails.

The caller provides a 'nid_range' function pointer which assists the
allocator.  It is given args 'start', 'end', and pointer to integer
'this_nid'.

It places at 'this_nid' the NUMA node id that corresponds to 'start', and
returns the end address within 'start' to 'end' at which memory assosciated
with 'nid' ends.

This callback allows a platform to use lmb_alloc_nid() in just about any
context, even ones in which early_pfn_to_nid() might not be working yet.



This function will be used by the NUMA setup code on sparc64, and also it can
be used by powerpc, replacing it's hand crafted careful_allocation()
function in arch/powerpc/mm/numa.c

If x86 ever converts its NUMA support over to using the LMB helpers, it can
use this too as it has something entirely similar.

Signed-off-by: David S. Miller [EMAIL PROTECTED]
Cc: Paul Mackerras [EMAIL PROTECTED]
Cc: Benjamin Herrenschmidt [EMAIL PROTECTED]
Cc: Thomas Gleixner [EMAIL PROTECTED]
Cc: Ingo Molnar [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 include/linux/lmb.h |2 
 lib/lmb.c   |   86 +-
 2 files changed, 78 insertions(+), 10 deletions(-)

diff -puN include/linux/lmb.h~lmb-add-lmb_alloc_nid include/linux/lmb.h
--- a/include/linux/lmb.h~lmb-add-lmb_alloc_nid
+++ a/include/linux/lmb.h
@@ -42,6 +42,8 @@ extern void __init lmb_init(void);
 extern void __init lmb_analyze(void);
 extern long __init lmb_add(u64 base, u64 size);
 extern long __init lmb_reserve(u64 base, u64 size);
+extern u64 __init lmb_alloc_nid(u64 size, u64 align, int nid,
+   u64 (*nid_range)(u64, u64, int *));
 extern u64 __init lmb_alloc(u64 size, u64 align);
 extern u64 __init lmb_alloc_base(u64 size,
u64, u64 max_addr);
diff -puN lib/lmb.c~lmb-add-lmb_alloc_nid lib/lmb.c
--- a/lib/lmb.c~lmb-add-lmb_alloc_nid
+++ a/lib/lmb.c
@@ -232,6 +232,82 @@ long __init lmb_overlaps_region(struct l
return (i  rgn-cnt) ? i : -1;
 }
 
+static u64 lmb_align_down(u64 addr, u64 size)
+{
+   return addr  ~(size - 1);
+}
+
+static u64 lmb_align_up(u64 addr, u64 size)
+{
+   return (addr + (size - 1))  ~(size - 1);
+}
+
+static u64 __init lmb_alloc_nid_unreserved(u64 start, u64 end,
+  u64 size, u64 align)
+{
+   u64 base;
+   long j;
+
+   base = lmb_align_down((end - size), align);
+   while (start = base 
+  ((j = lmb_overlaps_region(lmb.reserved, base, size)) = 0))
+   base = lmb_align_down(lmb.reserved.region[j].base - size,
+ align);
+
+   if (base != 0  start = base) {
+   if (lmb_add_region(lmb.reserved, base,
+  lmb_align_up(size, align))  0)
+   base = ~(u64)0;
+   return base;
+   }
+
+   return ~(u64)0;
+}
+
+static u64 __init lmb_alloc_nid_region(struct lmb_property *mp,
+  u64 (*nid_range)(u64, u64, int *),
+  u64 size, u64 align, int nid)
+{
+   u64 start, end;
+
+   start = mp-base;
+   end = start + mp-size;
+
+   start = lmb_align_up(start, align);
+   while (start  end) {
+   u64 this_end;
+   int this_nid;
+
+   this_end = nid_range(start, end, this_nid);
+   if (this_nid == nid) {
+   u64 ret = lmb_alloc_nid_unreserved(start, this_end,
+  size, align);
+   if (ret != ~(u64)0)
+   return ret;
+   }
+   start = this_end;
+   }
+
+   return ~(u64)0;
+}
+
+u64 __init lmb_alloc_nid(u64 size, u64 align, int nid,
+u64 (*nid_range)(u64 start, u64 end, int *nid))
+{
+   struct lmb_region *mem = lmb.memory;
+   int i;
+
+   for (i = 0; i  mem-cnt; i++) {
+   u64 ret = lmb_alloc_nid_region(mem-region[i],
+  nid_range,
+  size, align, nid);
+   if (ret != ~(u64)0)
+   return ret;
+   }
+
+   return lmb_alloc(size, align);
+}
+
 u64 __init lmb_alloc(u64 size, u64 align)
 {
return lmb_alloc_base(size, align, LMB_ALLOC_ANYWHERE);
@@ -250,16 +326,6 @@ u64 __init lmb_alloc_base(u64 size, u64 
return alloc;
 }
 
-static u64 lmb_align_down(u64 addr, u64 size)
-{
-   return addr  ~(size - 1);
-}
-
-static u64 lmb_align_up(u64 addr, u64 size)
-{
-   return (addr + (size - 1))  ~(size - 1);
-}
-
 u64 __init __lmb_alloc_base(u64 size, u64 align, u64 max_addr)
 {
long i, j;
_

Re: [patch 6/6] PS3: Gelic network driver Wake-on-LAN support

2008-03-28 Thread Jeff Garzik

Geoff Levand wrote:

From: Masakazu Mokuno [EMAIL PROTECTED]

Add Wake-on-LAN support to the PS3 Gelic network driver.
Other OS WOL support was introduced in PS3 system firmware
2.20.

Signed-off-by: Masakazu Mokuno [EMAIL PROTECTED]
Signed-off-by: Geoff Levand [EMAIL PROTECTED]
---
 drivers/net/ps3_gelic_net.c |   81 
 drivers/net/ps3_gelic_net.h |   20 ++
 2 files changed, 101 insertions(+)


ACK


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: Please pull powerpc.git merge branch

2008-03-28 Thread Bartlomiej Sieka

Paul Mackerras wrote:

Linus,

I have added another commit to the powerpc.git merge branch, so when
you do:

git pull \
git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc.git merge

you'll get a fix for a bug where the hardware data breakpoint would
sometimes fail to trigger on powerpc, if multiple threads put a
breakpoint on the same address.  The bug has been around for a while
and Michael Ellerman just found the cause and posted a fix.


Hello Paul,

What about http://patchwork.ozlabs.org/linuxppc/patch?id=17525 ? I don't
see it in the merge branch of your repository, and it would be nice to
get it upstream as it fixes boot problems on some MPC5200-based boards.

Regards,
Bartlomiej
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


badness in gfar_timeout

2008-03-28 Thread Philippe De Muyter
Hi everybody,

When connected to a 10Mbit/Half hub, my mpc8540 board quickly falls in an
endless NETDEV WATCHDOG: eth0: transmit timed out loop.  This has not
yet happened here when connected to a 100Mbit/Full switch.  Problem
seems to be twofold, because the gfar_timeout does not fix the problem, but
causes another one with a 'badness' message.  I am not familiar with
that, so does someone have a fix for either the timeout either the badness
problem. or at least an explanation for the 'badness' problem.

When that happens, network becomes and remains broken, but other processes
keep working.

Below is a short excerpt of the endless kernel log.

Philippe

[ cut here ]
Badness at c0041604 [verbose debug info unavailable]
NIP: c0041604 LR: c0193b5c CTR: c0194894
REGS: c035fd00 TRAP: 0700   Not tainted  (2.6.25-rc6)
MSR: 00029000 EE,ME  CR: 24002028  XER: 
TASK = c0340490[0] 'swapper' THREAD: c035e000
GPR00: 0001 c035fdb0 c0340490 0029 cf86c000 0001 10e0 00c3
GPR08: cf86c360 c035e000 d101a000 fffa 1670  0fff1500 
GPR16: 0080  007fff00 007ffec0 00200200 c0373cc8 c0373ac8 c03738c8
GPR24: c03736c8 c035e000 c035fe28 c034 d101a000 00029000 0029 cf86c360
NIP [c0041604] free_irq+0x28/0x124
LR [c0193b5c] stop_gfar+0xdc/0xe0
Call Trace:
[c035fdb0] [c034] 0xc034 (unreliable)
[c035fdd0] [c0193b5c] stop_gfar+0xdc/0xe0
[c035fdf0] [c01948ec] gfar_timeout+0x58/0x64
[c035fe00] [c0204c98] dev_watchdog+0x110/0x118
[c035fe20] [c0024b44] run_timer_softirq+0x15c/0x1c0
[c035fe70] [c0020390] __do_softirq+0x74/0xe0
[c035fe90] [c0004510] do_softirq+0x54/0x58
[c035fea0] [c0020240] irq_exit+0x48/0x58
[c035feb0] [c000b010] timer_interrupt+0xa8/0x10c
[c035fed0] [c000e37c] ret_from_except+0x0/0x18
[c035ff90] [c0007854] cpu_idle+0xbc/0xcc
[c035ffb0] [c0284050] 0xc0284050
[c035ffc0] [c03209c8] start_kernel+0x224/0x2a4
[c035fff0] [c3a0] skpinv+0x2d0/0x30c
Instruction dump:
9003 4e800020 9421ffe0 7c0802a6 bfa10014 54290024 90010024 7c7e1b78
8009000c 5400012e 7cd0 54000ffe 0f00 2b8301ff 419d0074 546b1838
NETDEV WATCHDOG: eth0: transmit timed out
[ cut here ]
Badness at c0041604 [verbose debug info unavailable]
NIP: c0041604 LR: c0193b5c CTR: c0194894
REGS: c035fd00 TRAP: 0700   Not tainted  (2.6.25-rc6)
MSR: 00029000 EE,ME  CR: 24002028  XER: 
TASK = c0340490[0] 'swapper' THREAD: c035e000
GPR00: 0001 c035fdb0 c0340490 0029 cf86c000 0001 10e0 00c3
GPR08: cf86c360 c035e000 d101a000 fffa 1710  0fff1500 
GPR16: 0080  007fff00 007ffec0 00200200 c0373cc8 c0373ac8 c03738c8
GPR24: c03736c8 c035e000 c035fe28 c034 d101a000 00029000 0029 cf86c360
NIP [c0041604] free_irq+0x28/0x124
LR [c0193b5c] stop_gfar+0xdc/0xe0
Call Trace:
[c035fdb0] [c034] 0xc034 (unreliable)
[c035fdd0] [c0193b5c] stop_gfar+0xdc/0xe0
[c035fdf0] [c01948ec] gfar_timeout+0x58/0x64
[c035fe00] [c0204c98] dev_watchdog+0x110/0x118
[c035fe20] [c0024b44] run_timer_softirq+0x15c/0x1c0
[c035fe70] [c0020390] __do_softirq+0x74/0xe0
[c035fe90] [c0004510] do_softirq+0x54/0x58
[c035fea0] [c0020240] irq_exit+0x48/0x58
[c035feb0] [c000b010] timer_interrupt+0xa8/0x10c
[c035fed0] [c000e37c] ret_from_except+0x0/0x18
[c035ff90] [c0007854] cpu_idle+0xbc/0xcc
[c035ffb0] [c0284050] 0xc0284050
[c035ffc0] [c03209c8] start_kernel+0x224/0x2a4
[c035fff0] [c3a0] skpinv+0x2d0/0x30c
Instruction dump:
9003 4e800020 9421ffe0 7c0802a6 bfa10014 54290024 90010024 7c7e1b78
8009000c 5400012e 7cd0 54000ffe 0f00 2b8301ff 419d0074 546b1838
INIT:NETDEV WATCHDOG: eth0: transmit timed out
[ cut here ]
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 0/9] powerpc: mv64x60 and prpmc2800 DTS cleanups

2008-03-28 Thread Dale Farnsworth
This series of patches again attempts to clean up and document
the Marvell MV64x60 device tree.  It supersedes Mark Greer's
series posted on 11 December 2007.  See:
http://ozlabs.org/pipermail/linuxppc-dev/2007-December/047986.html
I think I've addressed all comments on that patch series, but I'm
open to further comments. :)

These apply on the powerpc-next branch, and I'd like to get them
into 2.6.26.

Thanks,
-Dale
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 1/9] [POWERPC] mv64x60: change FDT compatible prefix to mrvl

2008-03-28 Thread Dale Farnsworth
From: Dale Farnsworth [EMAIL PROTECTED]

Follow the convention that compatible names are prefixed by the
vendor's stock ticker symbol.  For Marvell Technology Group Ltd.,
that's MRVL.

Signed-off-by: Dale Farnsworth [EMAIL PROTECTED]
Acked-by: Mark A. Greer [EMAIL PROTECTED]

Index: linux-2.6/arch/powerpc/boot/dts/prpmc2800.dts
===
--- linux-2.6.orig/arch/powerpc/boot/dts/prpmc2800.dts
+++ linux-2.6/arch/powerpc/boot/dts/prpmc2800.dts
@@ -44,7 +44,7 @@
#address-cells = 1;
#size-cells = 1;
model = mv64360;  /* Default */
-   compatible = marvell,mv64x60;
+   compatible = mrvl,mv64x60;
clock-frequency = 7f28155;/* 133.33 MHz */
reg = f100 0001;
virtual-reg = f100;
@@ -72,7 +72,7 @@
#address-cells = 1;
#size-cells = 0;
device_type = mdio;
-   compatible = marvell,mv64x60-mdio;
+   compatible = mrvl,mv64x60-mdio;
[EMAIL PROTECTED] {
device_type = ethernet-phy;
compatible = broadcom,bcm5421;
@@ -93,7 +93,7 @@
reg = 2000 2000;
eth0 {
device_type = network;
-   compatible = marvell,mv64x60-eth;
+   compatible = mrvl,mv64x60-eth;
block-index = 0;
interrupts = 20;
interrupt-parent = /mv64x60/pic;
@@ -102,7 +102,7 @@
};
eth1 {
device_type = network;
-   compatible = marvell,mv64x60-eth;
+   compatible = mrvl,mv64x60-eth;
block-index = 1;
interrupts = 21;
interrupt-parent = /mv64x60/pic;
@@ -113,7 +113,7 @@
 
[EMAIL PROTECTED] {
device_type = dma;
-   compatible = marvell,mv64x60-sdma;
+   compatible = mrvl,mv64x60-sdma;
reg = 4000 c18;
virtual-reg = f1004000;
interrupt-base = 0;
@@ -123,7 +123,7 @@
 
[EMAIL PROTECTED] {
device_type = dma;
-   compatible = marvell,mv64x60-sdma;
+   compatible = mrvl,mv64x60-sdma;
reg = 6000 c18;
virtual-reg = f1006000;
interrupt-base = 0;
@@ -132,7 +132,7 @@
};
 
[EMAIL PROTECTED] {
-   compatible = marvell,mv64x60-brg;
+   compatible = mrvl,mv64x60-brg;
reg = b200 8;
clock-src = 8;
clock-frequency = 7ed6b40;
@@ -141,7 +141,7 @@
};
 
[EMAIL PROTECTED] {
-   compatible = marvell,mv64x60-brg;
+   compatible = mrvl,mv64x60-brg;
reg = b208 8;
clock-src = 8;
clock-frequency = 7ed6b40;
@@ -164,7 +164,7 @@
 
[EMAIL PROTECTED] {
device_type = serial;
-   compatible = marvell,mpsc;
+   compatible = mrvl,mpsc;
reg = 8000 38;
virtual-reg = f1008000;
sdma = /mv64x60/[EMAIL PROTECTED];
@@ -184,7 +184,7 @@
 
[EMAIL PROTECTED] {
device_type = serial;
-   compatible = marvell,mpsc;
+   compatible = mrvl,mpsc;
reg = 9000 38;
virtual-reg = f1009000;
sdma = /mv64x60/[EMAIL PROTECTED];
@@ -203,14 +203,14 @@
};
 
[EMAIL PROTECTED] { /* watchdog timer */
-   compatible = marvell,mv64x60-wdt;
+   compatible = mrvl,mv64x60-wdt;
reg = b410 8;
timeout = a;  /* wdt timeout in seconds */
};
 
[EMAIL PROTECTED] {
device_type = i2c;
-   compatible = marvell,mv64x60-i2c;
+   compatible = mrvl,mv64x60-i2c;
reg = c000 20;
virtual-reg = f100c000;
freq_m = 8;
@@ -224,18 +224,18 @@
pic {
#interrupt-cells = 1;
   

[PATCH 2/9] [POWERPC] prpmc2800: convert DTS to v1 and add labels

2008-03-28 Thread Dale Farnsworth
From: Mark A. Greer [EMAIL PROTECTED]

Update the prpmc2800 DTS file to version 1 and add labels.
I verified that there was no change in the resulting dtb file.

Signed-off-by: Mark A. Greer [EMAIL PROTECTED]
Signed-off-by: Dale Farnsworth [EMAIL PROTECTED]

Index: linux-2.6/arch/powerpc/boot/dts/prpmc2800.dts
===
--- linux-2.6.orig/arch/powerpc/boot/dts/prpmc2800.dts
+++ linux-2.6/arch/powerpc/boot/dts/prpmc2800.dts
@@ -11,6 +11,8 @@
  * if it can determine the exact PrPMC type.
  */
 
+/dts-v1/;
+
 / {
#address-cells = 1;
#size-cells = 1;
@@ -25,19 +27,19 @@
PowerPC,7447 {
device_type = cpu;
reg = 0;
-   clock-frequency = 2bb0b140;   /* Default (733 MHz) */
-   bus-frequency = 7f28155;  /* 133.33 MHz */
-   timebase-frequency = 1fca055; /* 33.33 MHz */
-   i-cache-line-size = 20;
-   d-cache-line-size = 20;
-   i-cache-size = 8000;
-   d-cache-size = 8000;
+   clock-frequency = 73300;  /* Default */
+   bus-frequency = 1;
+   timebase-frequency = ;
+   i-cache-line-size = 32;
+   d-cache-line-size = 32;
+   i-cache-size = 32768;
+   d-cache-size = 32768;
};
};
 
memory {
device_type = memory;
-   reg =  2000;  /* Default (512MB) */
+   reg = 0x0 0x2000; /* Default (512MB) */
};
 
[EMAIL PROTECTED] { /* Marvell Discovery */
@@ -45,26 +47,26 @@
#size-cells = 1;
model = mv64360;  /* Default */
compatible = mrvl,mv64x60;
-   clock-frequency = 7f28155;/* 133.33 MHz */
-   reg = f100 0001;
-   virtual-reg = f100;
-   ranges = 8800 8800 0100/* PCI 0 I/O Space */
- 8000 8000 0800/* PCI 0 MEM Space */
- a000 a000 0400/* User FLASH */
-  f100 0001/* Bridge's regs */
- f200 f200 0004;  /* Integrated SRAM */
+   clock-frequency = 1;
+   reg = 0xf100 0x1;
+   virtual-reg = 0xf100;
+   ranges = 0x8800 0x8800 0x100 /* PCI 0 I/O Space */
+ 0x8000 0x8000 0x800 /* PCI 0 MEM Space */
+ 0xa000 0xa000 0x400 /* User FLASH */
+ 0x 0xf100 0x001 /* Bridge's regs */
+ 0xf200 0xf200 0x004;/* Integrated SRAM */
 
[EMAIL PROTECTED] {
device_type = rom;
compatible = direct-mapped;
-   reg = a000 400; /* Default (64MB) */
+   reg = 0xa000 0x400; /* Default (64MB) */
probe-type = CFI;
bank-width = 4;
-   partitions =  0010 /* RO */
- 0010 00040001 /* RW */
- 0014 0040 /* RO */
- 0054 039c /* RO */
- 03f0 0010; /* RO */
+   partitions = 0x 0x0010 /* RO */
+ 0x0010 0x00040001 /* RW */
+ 0x0014 0x0040 /* RO */
+ 0x0054 0x039c /* RO */
+ 0x03f0 0x0010; /* RO */
partition-names = FW Image A, FW Config Data, 
Kernel Image, Filesystem, FW Image B;
};
 
@@ -73,170 +75,170 @@
#size-cells = 0;
device_type = mdio;
compatible = mrvl,mv64x60-mdio;
-   [EMAIL PROTECTED] {
+   PHY0: [EMAIL PROTECTED] {
device_type = ethernet-phy;
compatible = broadcom,bcm5421;
-   interrupts = 4c;  /* GPP 12 */
-   interrupt-parent = /mv64x60/pic;
+   interrupts = 76;  /* GPP 12 */
+   interrupt-parent = PIC;
reg = 1;
};
-   [EMAIL PROTECTED] {
+   PHY1: [EMAIL PROTECTED] 

[PATCH 3/9] [POWERPC] prpmc2800: fix frequencies in prpmc2800.dts

2008-03-28 Thread Dale Farnsworth
From: Dale Farnsworth [EMAIL PROTECTED]

After the conversion to dts v1 format, seeing the frequencies
in decimal made it obvious that some of them had been
incorrectly truncated.  This fixes them.  Note that the PCI
frequency comes from a different source and is documented
as 66MHz, so it was left at 6600.

Signed-off-by: Dale Farnsworth [EMAIL PROTECTED]
Acked-by: Mark A. Greer [EMAIL PROTECTED]

Index: linux-2.6/arch/powerpc/boot/dts/prpmc2800.dts
===
--- linux-2.6.orig/arch/powerpc/boot/dts/prpmc2800.dts
+++ linux-2.6/arch/powerpc/boot/dts/prpmc2800.dts
@@ -27,7 +27,7 @@
PowerPC,7447 {
device_type = cpu;
reg = 0;
-   clock-frequency = 73300;  /* Default */
+   clock-frequency = 7;  /* Default */
bus-frequency = 1;
timebase-frequency = ;
i-cache-line-size = 32;
@@ -137,7 +137,7 @@
compatible = mrvl,mv64x60-brg;
reg = 0xb200 0x8;
clock-src = 8;
-   clock-frequency = 13300;
+   clock-frequency = 1;
current-speed = 9600;
bcr = 0;
};
@@ -146,7 +146,7 @@
compatible = mrvl,mv64x60-brg;
reg = 0xb208 0x8;
clock-src = 8;
-   clock-frequency = 13300;
+   clock-frequency = 1;
current-speed = 9600;
bcr = 0;
};
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 4/9] [POWERPC] mv64x60: Fix FDT compatible names: mv64x60 = mv64360

2008-03-28 Thread Dale Farnsworth
From: Mark A. Greer [EMAIL PROTECTED]

Compatible names should refer to a specific version of the hardware,
without wildcards.  Change each instance of mv64x60 to mv64360, which
is the oldest version we currently support.

Signed-off-by: Mark A. Greer [EMAIL PROTECTED]
Signed-off-by: Dale Farnsworth [EMAIL PROTECTED]

Index: linux-2.6/arch/powerpc/boot/dts/prpmc2800.dts
===
--- linux-2.6.orig/arch/powerpc/boot/dts/prpmc2800.dts
+++ linux-2.6/arch/powerpc/boot/dts/prpmc2800.dts
@@ -46,7 +46,7 @@
#address-cells = 1;
#size-cells = 1;
model = mv64360;  /* Default */
-   compatible = mrvl,mv64x60;
+   compatible = mrvl,mv64360;
clock-frequency = 1;
reg = 0xf100 0x1;
virtual-reg = 0xf100;
@@ -74,7 +74,7 @@
#address-cells = 1;
#size-cells = 0;
device_type = mdio;
-   compatible = mrvl,mv64x60-mdio;
+   compatible = mrvl,mv64360-mdio;
PHY0: [EMAIL PROTECTED] {
device_type = ethernet-phy;
compatible = broadcom,bcm5421;
@@ -95,7 +95,7 @@
reg = 0x2000 0x2000;
eth0 {
device_type = network;
-   compatible = mrvl,mv64x60-eth;
+   compatible = mrvl,mv64360-eth;
block-index = 0;
interrupts = 32;
interrupt-parent = PIC;
@@ -104,7 +104,7 @@
};
eth1 {
device_type = network;
-   compatible = mrvl,mv64x60-eth;
+   compatible = mrvl,mv64360-eth;
block-index = 1;
interrupts = 33;
interrupt-parent = PIC;
@@ -115,7 +115,7 @@
 
SDMA0: [EMAIL PROTECTED] {
device_type = dma;
-   compatible = mrvl,mv64x60-sdma;
+   compatible = mrvl,mv64360-sdma;
reg = 0x4000 0xc18;
virtual-reg = 0xf1004000;
interrupt-base = 0;
@@ -125,7 +125,7 @@
 
SDMA1: [EMAIL PROTECTED] {
device_type = dma;
-   compatible = mrvl,mv64x60-sdma;
+   compatible = mrvl,mv64360-sdma;
reg = 0x6000 0xc18;
virtual-reg = 0xf1006000;
interrupt-base = 0;
@@ -134,7 +134,7 @@
};
 
BRG0: [EMAIL PROTECTED] {
-   compatible = mrvl,mv64x60-brg;
+   compatible = mrvl,mv64360-brg;
reg = 0xb200 0x8;
clock-src = 8;
clock-frequency = 1;
@@ -143,7 +143,7 @@
};
 
BRG1: [EMAIL PROTECTED] {
-   compatible = mrvl,mv64x60-brg;
+   compatible = mrvl,mv64360-brg;
reg = 0xb208 0x8;
clock-src = 8;
clock-frequency = 1;
@@ -166,7 +166,7 @@
 
MPSC0: [EMAIL PROTECTED] {
device_type = serial;
-   compatible = mrvl,mpsc;
+   compatible = mrvl,mv64360-mpsc;
reg = 0x8000 0x38;
virtual-reg = 0xf1008000;
sdma = SDMA0;
@@ -186,7 +186,7 @@
 
MPSC1: [EMAIL PROTECTED] {
device_type = serial;
-   compatible = mrvl,mpsc;
+   compatible = mrvl,mv64360-mpsc;
reg = 0x9000 0x38;
virtual-reg = 0xf1009000;
sdma = SDMA1;
@@ -205,14 +205,14 @@
};
 
[EMAIL PROTECTED] { /* watchdog timer */
-   compatible = mrvl,mv64x60-wdt;
+   compatible = mrvl,mv64360-wdt;
reg = 0xb410 0x8;
timeout = 10; /* wdt timeout in seconds */
};
 
[EMAIL PROTECTED] {
device_type = i2c;
-   compatible = mrvl,mv64x60-i2c;
+   compatible = mrvl,mv64360-i2c;
reg = 0xc000 0x20;
virtual-reg = 0xf100c000;
freq_m = 8;
@@ -226,18 +226,18 @@
PIC: pic {

Re: [PATCH 1/9] [POWERPC] mv64x60: change FDT compatible prefix to mrvl

2008-03-28 Thread Grant Likely
On Fri, Mar 28, 2008 at 5:42 PM, Dale Farnsworth [EMAIL PROTECTED] wrote:
 From: Dale Farnsworth [EMAIL PROTECTED]

  Follow the convention that compatible names are prefixed by the
  vendor's stock ticker symbol.  For Marvell Technology Group Ltd.,
  that's MRVL.

  Signed-off-by: Dale Farnsworth [EMAIL PROTECTED]
  Acked-by: Mark A. Greer [EMAIL PROTECTED]

Are there any boards in the wild using the old string?  If so are
does changing this string risk complicating upgrades to a new kernel
version?

g.


-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 5/9] [POWERPC] mv64x60: remove device tree absolute path references

2008-03-28 Thread Dale Farnsworth
From: Dale Farnsworth [EMAIL PROTECTED]

Replace several device node absolute path lookups in the mv64x60
bootwrapper code with lookups by compatible or device_type
properties.

Signed-off-by: Dale Farnsworth [EMAIL PROTECTED]
Acked-by: Mark A. Greer [EMAIL PROTECTED]

--- a/arch/powerpc/boot/mv64x60.c
+++ b/arch/powerpc/boot/mv64x60.c
@@ -535,7 +535,7 @@ u8 *mv64x60_get_bridge_pbase(void)
u32 v[2];
void *devp;
 
-   devp = finddevice(/mv64x60);
+   devp = find_node_by_compatible(NULL, mrvl,mv64360);
if (devp == NULL)
goto err_out;
if (getprop(devp, reg, v, sizeof(v)) != sizeof(v))
@@ -553,7 +553,7 @@ u8 *mv64x60_get_bridge_base(void)
u32 v;
void *devp;
 
-   devp = finddevice(/mv64x60);
+   devp = find_node_by_compatible(NULL, mrvl,mv64360);
if (devp == NULL)
goto err_out;
if (getprop(devp, virtual-reg, v, sizeof(v)) != sizeof(v))
diff --git a/arch/powerpc/boot/mv64x60_i2c.c b/arch/powerpc/boot/mv64x60_i2c.c
index d085377..a69cd7a 100644
--- a/arch/powerpc/boot/mv64x60_i2c.c
+++ b/arch/powerpc/boot/mv64x60_i2c.c
@@ -185,7 +185,7 @@ int mv64x60_i2c_open(void)
u32 v;
void *devp;
 
-   devp = finddevice(/mv64x60/i2c);
+   devp = find_node_by_compatible(NULL, mrvl,mv64360-i2c);
if (devp == NULL)
goto err_out;
if (getprop(devp, virtual-reg, v, sizeof(v)) != sizeof(v))
diff --git a/arch/powerpc/boot/prpmc2800.c b/arch/powerpc/boot/prpmc2800.c
index 05c3245..f74b2cf 100644
--- a/arch/powerpc/boot/prpmc2800.c
+++ b/arch/powerpc/boot/prpmc2800.c
@@ -344,20 +344,20 @@ static void prpmc2800_bridge_setup(u32 mem_size)
acc_bits);
 
/* Get the cpu - pci i/o  mem mappings from the device tree */
-   devp = finddevice(/mv64x60/[EMAIL PROTECTED]);
+   devp = find_node_by_compatible(NULL, mrvl,mv64360-pci);
if (devp == NULL)
-   fatal(Error: Missing /mv64x60/[EMAIL PROTECTED]
+   fatal(Error: Missing mrvl,mv64360-pci
 device tree node\n\r);
 
rc = getprop(devp, ranges, v, sizeof(v));
if (rc != sizeof(v))
-   fatal(Error: Can't find /mv64x60/[EMAIL PROTECTED]/ranges
+   fatal(Error: Can't find mrvl,mv64360-pci ranges
 property\n\r);
 
/* Get the cpu - pci i/o  mem mappings from the device tree */
-   devp = finddevice(/mv64x60);
+   devp = find_node_by_compatible(NULL, mrvl,mv64360);
if (devp == NULL)
-   fatal(Error: Missing /mv64x60 device tree node\n\r);
+   fatal(Error: Missing mrvl,mv64360 device tree node\n\r);
 
enables = in_le32((u32 *)(bridge_base + MV64x60_CPU_BAR_ENABLE));
enables |= 0x0007fe00; /* Disable all cpu-pci windows */
@@ -429,9 +429,9 @@ static void prpmc2800_fixups(void)
setprop(devp, model, model, l);
 
/* Set /cpus/PowerPC,7447/clock-frequency */
-   devp = finddevice(/cpus/PowerPC,7447);
+   devp = find_node_by_prop_value_str(NULL, device_type, cpu);
if (devp == NULL)
-   fatal(Error: Missing proper /cpus device tree node\n\r);
+   fatal(Error: Missing proper cpu device tree node\n\r);
v[0] = bip-core_speed;
setprop(devp, clock-frequency, v[0], sizeof(v[0]));
 
@@ -443,16 +443,17 @@ static void prpmc2800_fixups(void)
v[1] = bip-mem_size;
setprop(devp, reg, v, sizeof(v));
 
-   /* Update /mv64x60/model, if this is a mv64362 */
+   /* Update model, if this is a mv64362 */
if (bip-bridge_type == BRIDGE_TYPE_MV64362) {
-   devp = finddevice(/mv64x60);
+   devp = find_node_by_compatible(NULL, mrvl,mv64360);
if (devp == NULL)
-   fatal(Error: Missing /mv64x60 device tree node\n\r);
+   fatal(Error: Missing mrvl,mv64360
+device tree node\n\r);
setprop(devp, model, mv64362, strlen(mv64362) + 1);
}
 
/* Set User FLASH size */
-   devp = finddevice(/mv64x60/[EMAIL PROTECTED]);
+   devp = find_node_by_compatible(NULL, direct-mapped);
if (devp == NULL)
fatal(Error: Missing User FLASH device tree node\n\r);
rc = getprop(devp, reg, v, sizeof(v));
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 6/9] [POWERPC] prpmc2800: clean up dts properties

2008-03-28 Thread Dale Farnsworth
From: Mark A. Greer [EMAIL PROTECTED]

Remove several unused (or software config only) properties.
Rename marvel node to soc.  Technically, it's not an SOC,
but its organization is the same as an SOC.  Also, rename the
block-index property to cell-index to conform to current
practice.

Signed-off-by: Mark A. Greer [EMAIL PROTECTED]
Signed-off-by: Dale Farnsworth [EMAIL PROTECTED]

Index: linux-2.6/arch/powerpc/boot/dts/prpmc2800.dts
===
--- linux-2.6.orig/arch/powerpc/boot/dts/prpmc2800.dts
+++ linux-2.6/arch/powerpc/boot/dts/prpmc2800.dts
@@ -42,7 +42,7 @@
reg = 0x0 0x2000; /* Default (512MB) */
};
 
-   [EMAIL PROTECTED] { /* Marvell Discovery */
+   [EMAIL PROTECTED] { /* Marvell Discovery */
#address-cells = 1;
#size-cells = 1;
model = mv64360;  /* Default */
@@ -114,21 +114,17 @@
};
 
SDMA0: [EMAIL PROTECTED] {
-   device_type = dma;
compatible = mrvl,mv64360-sdma;
reg = 0x4000 0xc18;
virtual-reg = 0xf1004000;
-   interrupt-base = 0;
interrupts = 36;
interrupt-parent = PIC;
};
 
SDMA1: [EMAIL PROTECTED] {
-   device_type = dma;
compatible = mrvl,mv64360-sdma;
reg = 0x6000 0xc18;
virtual-reg = 0xf1006000;
-   interrupt-base = 0;
interrupts = 38;
interrupt-parent = PIC;
};
@@ -139,7 +135,6 @@
clock-src = 8;
clock-frequency = 1;
current-speed = 9600;
-   bcr = 0;
};
 
BRG1: [EMAIL PROTECTED] {
@@ -148,7 +143,6 @@
clock-src = 8;
clock-frequency = 1;
current-speed = 9600;
-   bcr = 0;
};
 
CUNIT: [EMAIL PROTECTED] {
@@ -174,12 +168,7 @@
cunit = CUNIT;
mpscrouting = MPSCROUTING;
mpscintr = MPSCINTR;
-   block-index = 0;
-   max_idle = 40;
-   chr_1 = 0;
-   chr_2 = 0;
-   chr_10 = 3;
-   mpcr = 0;
+   cell-index = 0;
interrupts = 40;
interrupt-parent = PIC;
};
@@ -194,12 +183,7 @@
cunit = CUNIT;
mpscrouting = MPSCROUTING;
mpscintr = MPSCINTR;
-   block-index = 1;
-   max_idle = 40;
-   chr_1 = 0;
-   chr_2 = 0;
-   chr_10 = 3;
-   mpcr = 0;
+   cell-index = 1;
interrupts = 42;
interrupt-parent = PIC;
};
@@ -207,7 +191,6 @@
[EMAIL PROTECTED] { /* watchdog timer */
compatible = mrvl,mv64360-wdt;
reg = 0xb410 0x8;
-   timeout = 10; /* wdt timeout in seconds */
};
 
[EMAIL PROTECTED] {
@@ -215,10 +198,6 @@
compatible = mrvl,mv64360-i2c;
reg = 0xc000 0x20;
virtual-reg = 0xf100c000;
-   freq_m = 8;
-   freq_n = 3;
-   timeout = 1000;   /* 1000 = 1 second */
-   retries = 1;
interrupts = 37;
interrupt-parent = PIC;
};
Index: linux-2.6/arch/powerpc/boot/mpsc.c
===
--- linux-2.6.orig/arch/powerpc/boot/mpsc.c
+++ linux-2.6/arch/powerpc/boot/mpsc.c
@@ -141,7 +141,7 @@ int mpsc_console_init(void *devp, struct
if (mpscintr_base == NULL)
goto err_out;
 
-   n = getprop(devp, block-index, v, sizeof(v));
+   n = getprop(devp, cell-index, v, sizeof(v));
if (n != sizeof(v))
goto err_out;
reg_set = (int)v;
Index: linux-2.6/arch/powerpc/sysdev/mv64x60_dev.c
===
--- linux-2.6.orig/arch/powerpc/sysdev/mv64x60_dev.c
+++ linux-2.6/arch/powerpc/sysdev/mv64x60_dev.c
@@ -127,7 +127,7 @@ static int __init mv64x60_mpsc_device_se
if (err)
return err;
 
-   prop = of_get_property(np, 

[PATCH 7/9] [POWERPC] mv643xx_eth: prepare to support multiple silicon blocks

2008-03-28 Thread Dale Farnsworth
From: Dale Farnsworth [EMAIL PROTECTED]

The mv643xx_eth driver is being modified to support multiple instances
of the ethernet silicon block on the same platform.  Each block contains
a single register bank containing the registers for up to three ports
interleaved within that bank.  This patch updates the PowerPC OF to
platform_device glue code to support multiple silicon blocks, each
with up to three ethernet ports.  The main difference is that we now
allow multiple mv64x60_shared platform_devices to be registered and
we provide each port platform_device with a pointer to its associated
shared platform_device.  The pointer will not be used until the
mv643xx_eth driver changes are committed.

Signed-off-by: Dale Farnsworth [EMAIL PROTECTED]
Acked-by: Mark Greer [EMAIL PROTECTED]

Index: linux-2.6/arch/powerpc/boot/dts/prpmc2800.dts
===
--- linux-2.6.orig/arch/powerpc/boot/dts/prpmc2800.dts
+++ linux-2.6/arch/powerpc/boot/dts/prpmc2800.dts
@@ -91,21 +91,24 @@
};
};
 
-   [EMAIL PROTECTED] {
+   [EMAIL PROTECTED] {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = mrvl,mv64360-eth-group;
reg = 0x2000 0x2000;
-   eth0 {
+   [EMAIL PROTECTED] {
device_type = network;
compatible = mrvl,mv64360-eth;
-   block-index = 0;
+   reg = 0;
interrupts = 32;
interrupt-parent = PIC;
phy = PHY0;
local-mac-address = [ 00 00 00 00 00 00 ];
};
-   eth1 {
+   [EMAIL PROTECTED] {
device_type = network;
compatible = mrvl,mv64360-eth;
-   block-index = 1;
+   reg = 1;
interrupts = 33;
interrupt-parent = PIC;
phy = PHY1;
Index: linux-2.6/arch/powerpc/sysdev/mv64x60_dev.c
===
--- linux-2.6.orig/arch/powerpc/sysdev/mv64x60_dev.c
+++ linux-2.6/arch/powerpc/sysdev/mv64x60_dev.c
@@ -206,30 +206,24 @@ error:
 /*
  * Create mv64x60_eth platform devices
  */
-static int __init eth_register_shared_pdev(struct device_node *np)
+static struct platform_device * __init mv64x60_eth_register_shared_pdev(
+   struct device_node *np, int id)
 {
struct platform_device *pdev;
struct resource r[1];
int err;
 
-   np = of_get_parent(np);
-   if (!np)
-   return -ENODEV;
-
err = of_address_to_resource(np, 0, r[0]);
-   of_node_put(np);
if (err)
-   return err;
+   return ERR_PTR(err);
 
-   pdev = platform_device_register_simple(MV643XX_ETH_SHARED_NAME, 0,
+   pdev = platform_device_register_simple(MV643XX_ETH_SHARED_NAME, id,
   r, 1);
-   if (IS_ERR(pdev))
-   return PTR_ERR(pdev);
-
-   return 0;
+   return pdev;
 }
 
-static int __init mv64x60_eth_device_setup(struct device_node *np, int id)
+static int __init mv64x60_eth_device_setup(struct device_node *np, int id,
+  struct platform_device *shared_pdev)
 {
struct resource r[1];
struct mv643xx_eth_platform_data pdata;
@@ -240,16 +234,12 @@ static int __init mv64x60_eth_device_set
const phandle *ph;
int err;
 
-   /* only register the shared platform device the first time through */
-   if (id == 0  (err = eth_register_shared_pdev(np)))
-   return err;
-
memset(r, 0, sizeof(r));
of_irq_to_resource(np, 0, r[0]);
 
memset(pdata, 0, sizeof(pdata));
 
-   prop = of_get_property(np, block-index, NULL);
+   prop = of_get_property(np, reg, NULL);
if (!prop)
return -ENODEV;
pdata.port_number = *prop;
@@ -302,7 +292,7 @@ static int __init mv64x60_eth_device_set
 
of_node_put(phy);
 
-   pdev = platform_device_alloc(MV643XX_ETH_NAME, pdata.port_number);
+   pdev = platform_device_alloc(MV643XX_ETH_NAME, id);
if (!pdev)
return -ENOMEM;
 
@@ -437,8 +427,9 @@ error:
 
 static int __init mv64x60_device_setup(void)
 {
-   struct device_node *np = NULL;
-   int id;
+   struct device_node *np, *np2;
+   struct platform_device *pdev;
+   int id, id2;
int err;
 
id = 0;
@@ -447,9 +438,24 @@ static int __init mv64x60_device_setup(v
 

[PATCH 8/9] [POWERPC] Document the mv64x60 device tree bindings

2008-03-28 Thread Dale Farnsworth
From: Dale Farnsworth [EMAIL PROTECTED]

Add the device tree bindings for the Marvell mv64x60 series of
system controller chips in booting-without-of.text.

Signed-off-by: Dale Farnsworth [EMAIL PROTECTED]
Acked-by: Mark A. Greer [EMAIL PROTECTED]

Index: linux-2.6/Documentation/powerpc/booting-without-of.txt
===
--- linux-2.6.orig/Documentation/powerpc/booting-without-of.txt
+++ linux-2.6/Documentation/powerpc/booting-without-of.txt
@@ -57,7 +57,8 @@ Table of Contents
   n) 4xx/Axon EMAC ethernet nodes
   o) Xilinx IP cores
   p) Freescale Synchronous Serial Interface
- q) USB EHCI controllers
+  q) USB EHCI controllers
+  r) Marvell Discovery mv64[345]6x System Controller chips
 
   VII - Specifying interrupt information for devices
 1) interrupts property
@@ -2817,6 +2818,471 @@ platforms are moved over to use the flat
   };
 
 
+r) Marvell Discovery mv64[345]6x System Controller chips.
+
+Note that while the Marvell mv64[345]60 series of system controller
+chips are not true system-on-a-chip processors, they essentially
+contain the peripheral portion of an SOC and the device tree takes
+the same form, and we will document them here as if they were an SOC.
+Compatible string values are prefixed with the string mrvl,,
+which is the stock ticker symbol for Marvell Technology Group Ltd.
+
+An SOC node describes the Marvell chip as described in section III.5.f
+above.
+
+Example Marvell Discovery mv64360 SOC node:
+
+   [EMAIL PROTECTED] { /* Marvell Discovery */
+   #address-cells = 1;
+   #size-cells = 1;
+   model = mv64360;  /* Default */
+   compatible = mrvl,mv64360;
+   clock-frequency = 1;
+   reg = 0xf100 0x1;
+   virtual-reg = 0xf100;
+   ranges = 0x8800 0x8800 0x100 /* PCI 0 I/O Space */
+   0x8000 0x8000 0x800 /* PCI 0 MEM Space */
+   0xa000 0xa000 0x400 /* User FLASH */
+   0x 0xf100 0x001 /* Bridge's regs */
+   0xf200 0xf200 0x004;/* Integrated SRAM */
+   }
+
+  
+  1. Marvell Discovery MDIO bus
+
+  The MDIO is a bus to which the PHY devices are connected.  For each
+  device that exists on this bus, a child node should be created.  See
+  the definition of the PHY node below for an example of how to define
+  a PHY.
+
+  Required properties:
+- #address-cells : Should be 1
+- #size-cells : Should be 0
+- device_type : Should be mdio
+- compatible : Should be mrvl,mv64360-mdio
+
+  Example:
+
+   mdio {
+   #address-cells = 1;
+   #size-cells = 0;
+   device_type = mdio;
+   compatible = mrvl,mv64360-mdio;
+
+   [EMAIL PROTECTED] {
+   ..
+   };
+   };
+
+
+  2.  Marvell Discovery ethernet controller
+  
+  The Discover ethernet controller is described with two levels
+  of nodes.  The first level describes an ethernet silicon block
+  and the second level describes up to 3 ethernet nodes within
+  that block.  The reason for the multiple levels is that the
+  registers for the node are interleaved within a single set
+  of registers.  The ethernet-block level describes the
+  shared register set, and the ethernet nodes describe ethernet
+  port-specific properties.
+
+  Ethernet block node
+
+  Required properties:
+- #address-cells : 1
+   - #size-cells : 0
+   - compatible : mrvl,mv64360-eth-block
+   - reg : Offset and length of the register set for this block
+   
+  Example Discovery Ethernet block node:
+   [EMAIL PROTECTED] {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = mrvl,mv64360-eth-block;
+   reg = 0x2000 0x2000;
+   [EMAIL PROTECTED] {
+   ...
+   };
+   };
+
+  Ethernet port node
+
+  Required properties:
+- device_type : Should be network.
+   - compatible : Should be mrvl,mv64360-eth.
+   - reg : Should be 0, 1, or 2, according to which registers
+ within the silicon block the device uses.
+   - interrupts : a where a is the interrupt number for the port.
+   - interrupt-parent : the phandle for the interrupt controller
+ that services interrupts for this device.
+   - phy : the phandle for the PHY connected to this ethernet
+ controller.
+   - local-mac-address : 6 bytes, MAC address
+
+  Example Discovery Ethernet port node:
+   [EMAIL PROTECTED] {
+   device_type = network;
+   compatible 

[PATCH 9/9] [POWERPC] prpmc2800 needs a dtbImage

2008-03-28 Thread Dale Farnsworth
From: Dale Farnsworth [EMAIL PROTECTED]

The prpmc2800 platform requires a zImage formatted file with an
embedded dtb file.  Rename the requested boot image file to
dtbImage.prpmc2800.

Signed-off-by: Dale Farnsworth [EMAIL PROTECTED]
Acked-by: Mark A. Greer [EMAIL PROTECTED]

--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -192,7 +192,7 @@ image-$(CONFIG_PPC_CHRP)+= zImage.chrp
 image-$(CONFIG_PPC_EFIKA)  += zImage.chrp
 image-$(CONFIG_PPC_PMAC)   += zImage.pmac
 image-$(CONFIG_PPC_HOLLY)  += zImage.holly
-image-$(CONFIG_PPC_PRPMC2800)  += zImage.prpmc2800
+image-$(CONFIG_PPC_PRPMC2800)  += dtbImage.prpmc2800
 image-$(CONFIG_PPC_ISERIES)+= zImage.iseries
 image-$(CONFIG_DEFAULT_UIMAGE) += uImage
 
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 9/9] [POWERPC] prpmc2800 needs a dtbImage

2008-03-28 Thread Grant Likely
On Fri, Mar 28, 2008 at 5:52 PM, Dale Farnsworth [EMAIL PROTECTED] wrote:
 From: Dale Farnsworth [EMAIL PROTECTED]

  The prpmc2800 platform requires a zImage formatted file with an
  embedded dtb file.  Rename the requested boot image file to
  dtbImage.prpmc2800.

  Signed-off-by: Dale Farnsworth [EMAIL PROTECTED]
  Acked-by: Mark A. Greer [EMAIL PROTECTED]

Acked-by: Grant Likely [EMAIL PROTECTED]


  --- a/arch/powerpc/boot/Makefile
  +++ b/arch/powerpc/boot/Makefile
  @@ -192,7 +192,7 @@ image-$(CONFIG_PPC_CHRP)+= zImage.chrp
   image-$(CONFIG_PPC_EFIKA)  += zImage.chrp
   image-$(CONFIG_PPC_PMAC)   += zImage.pmac
   image-$(CONFIG_PPC_HOLLY)  += zImage.holly
  -image-$(CONFIG_PPC_PRPMC2800)  += zImage.prpmc2800
  +image-$(CONFIG_PPC_PRPMC2800)  += dtbImage.prpmc2800
   image-$(CONFIG_PPC_ISERIES)+= zImage.iseries
   image-$(CONFIG_DEFAULT_UIMAGE) += uImage

  ___
  Linuxppc-dev mailing list
  Linuxppc-dev@ozlabs.org
  https://ozlabs.org/mailman/listinfo/linuxppc-dev




-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 1/9] [POWERPC] mv64x60: change FDT compatible prefix to mrvl

2008-03-28 Thread Dale Farnsworth
On Fri, Mar 28, 2008 at 05:47:25PM -0600, Grant Likely wrote:
 On Fri, Mar 28, 2008 at 5:42 PM, Dale Farnsworth [EMAIL PROTECTED] wrote:
  From: Dale Farnsworth [EMAIL PROTECTED]
 
   Follow the convention that compatible names are prefixed by the
   vendor's stock ticker symbol.  For Marvell Technology Group Ltd.,
   that's MRVL.
 
   Signed-off-by: Dale Farnsworth [EMAIL PROTECTED]
   Acked-by: Mark A. Greer [EMAIL PROTECTED]
 
 Are there any boards in the wild using the old string?  If so are
 does changing this string risk complicating upgrades to a new kernel
 version?

I don't think this complicates things much, since all these boards boot
a dtbImage, with an embedded dtb file built from the kernel source.
So the dts and code don't have much opportunity to get out of sync.

-Dale
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 1/9] [POWERPC] mv64x60: change FDT compatible prefix to mrvl

2008-03-28 Thread Grant Likely
On Fri, Mar 28, 2008 at 6:00 PM, Dale Farnsworth [EMAIL PROTECTED] wrote:
 On Fri, Mar 28, 2008 at 05:47:25PM -0600, Grant Likely wrote:
   On Fri, Mar 28, 2008 at 5:42 PM, Dale Farnsworth [EMAIL PROTECTED] wrote:
From: Dale Farnsworth [EMAIL PROTECTED]
   
 Follow the convention that compatible names are prefixed by the
 vendor's stock ticker symbol.  For Marvell Technology Group Ltd.,
 that's MRVL.
   
 Signed-off-by: Dale Farnsworth [EMAIL PROTECTED]
 Acked-by: Mark A. Greer [EMAIL PROTECTED]
  
   Are there any boards in the wild using the old string?  If so are
   does changing this string risk complicating upgrades to a new kernel
   version?

  I don't think this complicates things much, since all these boards boot
  a dtbImage, with an embedded dtb file built from the kernel source.
  So the dts and code don't have much opportunity to get out of sync.

Cool; then looks good to me!  :-)

Acked-by: Grant Likely [EMAIL PROTECTED]


-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] Make pasemi_mac.c depend on PPC_PASEMI to prevent link errors

2008-03-28 Thread Jeff Garzik

Michael Ellerman wrote:

drivers/net/pasemi_mac.c is enabled by CONFIG_PASEMI_MAC, which depends on
PPC64  PCI. However pasemi_mac.c uses several routines that are only
built when PPC_PASEMI is selected. This can lead to an unbuildable config:

 ERROR: .pasemi_dma_start_chan [drivers/net/pasemi_mac.ko] undefined!

So make CONFIG_PASEMI_MAC depend on PPC_PASEMI instead of PPC64.

Signed-off-by: Michael Ellerman [EMAIL PROTECTED]
---
 drivers/net/Kconfig |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)



Jeff, pending Olof's ack, this would be nice for 25, but is obviously
not super important.

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index fe7b5ec..3a0b20a 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -2635,7 +2635,7 @@ config NIU
 
 config PASEMI_MAC

tristate PA Semi 1/10Gbit MAC
-   depends on PPC64  PCI
+   depends on PPC_PASEMI  PCI
select PHYLIB


applied


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] ibm_newemac: emac_tx_csum typo fix

2008-03-28 Thread Jeff Garzik

Valentine Barshak wrote:

Move the  skb-ip_summed == CHECKSUM_PARTIAL part out of
emac_has_feature parameters.

Signed-off-by: Valentine Barshak [EMAIL PROTECTED]
---
 drivers/net/ibm_newemac/core.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff -pruN linux-2.6.orig/drivers/net/ibm_newemac/core.c 
linux-2.6/drivers/net/ibm_newemac/core.c
--- linux-2.6.orig/drivers/net/ibm_newemac/core.c   2008-02-21 
16:45:36.0 +0300
+++ linux-2.6/drivers/net/ibm_newemac/core.c2008-02-22 19:55:29.0 
+0300
@@ -1235,8 +1235,8 @@ static int emac_close(struct net_device 
 static inline u16 emac_tx_csum(struct emac_instance *dev,

   struct sk_buff *skb)
 {
-   if (emac_has_feature(dev, EMAC_FTR_HAS_TAH 
-skb-ip_summed == CHECKSUM_PARTIAL)) {
+   if (emac_has_feature(dev, EMAC_FTR_HAS_TAH) 
+   (skb-ip_summed == CHECKSUM_PARTIAL)) {
++dev-stats.tx_packets_csum;
return EMAC_TX_CTRL_TAH_CSUM;


applied



___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 2/2 v2] pasemi_mac: Netpoll support

2008-03-28 Thread Jeff Garzik

Olof Johansson wrote:

Add netpoll support to allow use of netconsole.

Signed-off-by: Nate Case [EMAIL PROTECTED]

Signed-off-by: Olof Johansson [EMAIL PROTECTED]

---
Changed the interrupt handler arguments as found by Valentine. Will push
through powerpc.git with Jeff's ACKs (that were already given).


-Olof


ACK


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 1/2] ibm_newemac: PowerPC 440GX EMAC PHY clock workaround

2008-03-28 Thread Jeff Garzik

Valentine Barshak wrote:

The PowerPC 440GX Taishan board fails to reset EMAC3 (reset timeout error)
if there's no link. Because of that it fails to find PHY chip. The older 
ibm_emac
driver had a workaround for that: the EMAC_CLK_INTERNAL/EMAC_CLK_EXTERNAL 
macros,
which toggle the Ethernet Clock Select bit in the SDR0_MFR register. This patch
does the same for ibm,emac-440gx compatible chips. The workaround forces
clock on -all- EMACs, so we select clock under global emac_phy_map_lock.

Signed-off-by: Valentine Barshak [EMAIL PROTECTED]
---
 drivers/net/ibm_newemac/core.c |   16 +++-
 drivers/net/ibm_newemac/core.h |8 ++--
 2 files changed, 21 insertions(+), 3 deletions(-)


is this for 2.6.25-rc?


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] vma_map: use proper pointer types

2008-03-28 Thread Al Viro

Signed-off-by: Al Viro [EMAIL PROTECTED]
---
 arch/powerpc/oprofile/cell/vma_map.c |   37 ++---
 1 files changed, 16 insertions(+), 21 deletions(-)

diff --git a/arch/powerpc/oprofile/cell/vma_map.c 
b/arch/powerpc/oprofile/cell/vma_map.c
index 76ec1d1..9a93217 100644
--- a/arch/powerpc/oprofile/cell/vma_map.c
+++ b/arch/powerpc/oprofile/cell/vma_map.c
@@ -92,7 +92,7 @@ vma_map_add(struct vma_to_fileoffset_map *map, unsigned int 
vma,
  * A pointer to the first vma_map in the generated list
  * of vma_maps is returned.  */
 struct vma_to_fileoffset_map *create_vma_map(const struct spu *aSpu,
-unsigned long spu_elf_start)
+unsigned long __spu_elf_start)
 {
static const unsigned char expected[EI_PAD] = {
[EI_MAG0] = ELFMAG0,
@@ -107,9 +107,11 @@ struct vma_to_fileoffset_map *create_vma_map(const struct 
spu *aSpu,
 
int grd_val;
struct vma_to_fileoffset_map *map = NULL;
+   void __user *spu_elf_start = (void __user *)__spu_elf_start;
struct spu_overlay_info ovly;
unsigned int overlay_tbl_offset = -1;
-   unsigned long phdr_start, shdr_start;
+   Elf32_Phdr __user *phdr_start;
+   Elf32_Shdr __user *shdr_start;
Elf32_Ehdr ehdr;
Elf32_Phdr phdr;
Elf32_Shdr shdr, shdr_str;
@@ -121,12 +123,12 @@ struct vma_to_fileoffset_map *create_vma_map(const struct 
spu *aSpu,
unsigned int ovly_buf_table_sym = 0;
unsigned int ovly_table_end_sym = 0;
unsigned int ovly_buf_table_end_sym = 0;
-   unsigned long ovly_table;
+   struct spu_overlay_info __user *ovly_table;
unsigned int n_ovlys;
 
/* Get and validate ELF header.  */
 
-   if (copy_from_user(ehdr, (void *) spu_elf_start, sizeof (ehdr)))
+   if (copy_from_user(ehdr, spu_elf_start, sizeof (ehdr)))
goto fail;
 
if (memcmp(ehdr.e_ident, expected, EI_PAD) != 0) {
@@ -152,9 +154,7 @@ struct vma_to_fileoffset_map *create_vma_map(const struct 
spu *aSpu,
 
/* Traverse program headers.  */
for (i = 0; i  ehdr.e_phnum; i++) {
-   if (copy_from_user(phdr,
-  (void *) (phdr_start + i * sizeof(phdr)),
-  sizeof(phdr)))
+   if (copy_from_user(phdr, phdr_start + i, sizeof(phdr)))
goto fail;
 
if (phdr.p_type != PT_LOAD)
@@ -171,9 +171,7 @@ struct vma_to_fileoffset_map *create_vma_map(const struct 
spu *aSpu,
pr_debug(SPU_PROF: Created non-overlay maps\n);
/* Traverse section table and search for overlay-related symbols.  */
for (i = 0; i  ehdr.e_shnum; i++) {
-   if (copy_from_user(shdr,
-  (void *) (shdr_start + i * sizeof(shdr)),
-  sizeof(shdr)))
+   if (copy_from_user(shdr, shdr_start + i, sizeof(shdr)))
goto fail;
 
if (shdr.sh_type != SHT_SYMTAB)
@@ -182,8 +180,7 @@ struct vma_to_fileoffset_map *create_vma_map(const struct 
spu *aSpu,
continue;
 
if (copy_from_user(shdr_str,
-  (void *) (shdr_start + shdr.sh_link *
-sizeof(shdr)),
+  shdr_start + shdr.sh_link,
   sizeof(shdr)))
goto fail;
 
@@ -191,15 +188,15 @@ struct vma_to_fileoffset_map *create_vma_map(const struct 
spu *aSpu,
goto fail;;
 
for (j = 0; j  shdr.sh_size / sizeof (sym); j++) {
-   if (copy_from_user(sym, (void *) (spu_elf_start +
-  shdr.sh_offset + j *
-  sizeof (sym)),
+   if (copy_from_user(sym, spu_elf_start +
+shdr.sh_offset +
+j * sizeof (sym),
   sizeof (sym)))
goto fail;
 
-   if (copy_from_user(name, (void *)
-  (spu_elf_start + shdr_str.sh_offset +
-   sym.st_name),
+   if (copy_from_user(name, 
+  spu_elf_start + shdr_str.sh_offset +
+  sym.st_name,
   20))
goto fail;
 
@@ -245,9 +242,7 @@ struct vma_to_fileoffset_map *create_vma_map(const struct 
spu *aSpu,
 
/* Traverse overlay table.  */
for (i = 0; i  n_ovlys; i++) {
-   if (copy_from_user(ovly, (void *)
- 

[PATCH] powerpc/pseries/xcis: ansify

2008-03-28 Thread Al Viro

Signed-off-by: Al Viro [EMAIL PROTECTED]
---
 arch/powerpc/platforms/pseries/xics.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/xics.c 
b/arch/powerpc/platforms/pseries/xics.c
index ca52b58..a977f20 100644
--- a/arch/powerpc/platforms/pseries/xics.c
+++ b/arch/powerpc/platforms/pseries/xics.c
@@ -763,7 +763,7 @@ void xics_request_IPIs(void)
 }
 #endif /* CONFIG_SMP */
 
-void xics_teardown_cpu()
+void xics_teardown_cpu(void)
 {
int cpu = smp_processor_id();
 
-- 
1.5.3.GIT


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 1/2] ibm_newemac: PowerPC 440GX EMAC PHY clock workaround

2008-03-28 Thread Josh Boyer
On Fri, 28 Mar 2008 22:18:25 -0400
Jeff Garzik [EMAIL PROTECTED] wrote:

 Valentine Barshak wrote:
  The PowerPC 440GX Taishan board fails to reset EMAC3 (reset timeout error)
  if there's no link. Because of that it fails to find PHY chip. The older 
  ibm_emac
  driver had a workaround for that: the EMAC_CLK_INTERNAL/EMAC_CLK_EXTERNAL 
  macros,
  which toggle the Ethernet Clock Select bit in the SDR0_MFR register. This 
  patch
  does the same for ibm,emac-440gx compatible chips. The workaround forces
  clock on -all- EMACs, so we select clock under global emac_phy_map_lock.
  
  Signed-off-by: Valentine Barshak [EMAIL PROTECTED]
  ---
   drivers/net/ibm_newemac/core.c |   16 +++-
   drivers/net/ibm_newemac/core.h |8 ++--
   2 files changed, 21 insertions(+), 3 deletions(-)
 
 is this for 2.6.25-rc?

No.  This, and patch 2/2, are for 2.6.26 and depend on a patch in my
tree.  These are the two Ben asked about going through the powerpc tree
but naturally we wanted an Ack from you first.

thx,
josh 
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 1/2] ibm_newemac: PowerPC 440GX EMAC PHY clock workaround

2008-03-28 Thread Benjamin Herrenschmidt

On Fri, 2008-03-28 at 22:18 -0400, Jeff Garzik wrote:
 Valentine Barshak wrote:
  The PowerPC 440GX Taishan board fails to reset EMAC3 (reset timeout error)
  if there's no link. Because of that it fails to find PHY chip. The older 
  ibm_emac
  driver had a workaround for that: the EMAC_CLK_INTERNAL/EMAC_CLK_EXTERNAL 
  macros,
  which toggle the Ethernet Clock Select bit in the SDR0_MFR register. This 
  patch
  does the same for ibm,emac-440gx compatible chips. The workaround forces
  clock on -all- EMACs, so we select clock under global emac_phy_map_lock.
  
  Signed-off-by: Valentine Barshak [EMAIL PROTECTED]
  ---
   drivers/net/ibm_newemac/core.c |   16 +++-
   drivers/net/ibm_newemac/core.h |8 ++--
   2 files changed, 21 insertions(+), 3 deletions(-)
 
 is this for 2.6.25-rc?

Nah, too late imho.

Ben.


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev