LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* RE: [PATCH] ucc_geth: Add 8 bytes to max TX frame for VLANs
From: Li Yang @ 2008-03-28  2:54 UTC (permalink / raw)
  To: joakim.tjernlund; +Cc: Netdev, Linuxppc-Embedded@Ozlabs.Org
In-Reply-To: <1206621833.7589.286.camel@gentoo-jocke.transmode.se>

> > Hi Jocke,
> >=20
> > QUICC engine supports dynamic maximum frame length.  If you are not=20
> > expecting to receive only tagged frames, I recommend to use this=20
> > feature by setting dynamicMaxFrameLength and=20
> dynamicMinFrameLength in=20
> > ug_info instead of increasing the MaxLength for both tagged=20
> and untagged frames.
> > See the following part from the reference manual.
> >=20
> > The MFLR entry in the Global Parameter RAM defines the=20
> length of the=20
> > largest frame, excluding Q TAG but including FCS, that is=20
> still valid.=20
> > When REMODER[DXE]=3D1, a tagged frame that has length equals
> > MaxLength+4 considered valid, and a non tagged frame that has length
> > equals MaxLength is the longest
> > that is still considered valid. When REMODER[DXE]=3D0, any=20
> frame longer=20
> > than MaxLength consider erroneous frame.
> > For systems with only tagged frames, set REMODER[DXE]=3D0 and set=20
> > MaxLength =3D Max LLC size+4.
> >=20
> > - Leo
>=20
> Interesting, that should also work although QinQ will not. I=20
> will have a closer look but I still don't see how my orginal=20
> patch would harm anything. One could add my patch on top but=20
> with only 4 bytes extra.

Hi,

The increase of max packet length may cause a waste of QE internal
buffer for every packet.  Furthermore it affects the hardware statistics
of jumbo packets.

- Leo

^ permalink raw reply

* Re: [PATCH] fsldma: The MPC8377MDS board device tree node for fsldma driver
From: Olof Johansson @ 2008-03-28  4:31 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev, Dan Williams, Andrew Morton, Linux Kernel
In-Reply-To: <9D668111-9774-4D45-944E-3C3C0EE47A09@kernel.crashing.org>

On Thu, Mar 27, 2008 at 09:23:54PM -0500, Kumar Gala wrote:

>> I think this patch should probably go through the powerpc tree, or
>> -mm.  I'll pick up the ones that touch either drivers/dma or
>> crypto/async_tx.

It's a good idea to cc all fsldma patches to linuxppc-dev when they're
posted too, none of them have been so they have been missing review from
the powerpc crowd that didn't catch them on lkml.


-Olof

^ permalink raw reply

* Re: [PATCH] [POWERPC] Remove CONFIG_PCI_LEGACY from some configs
From: Stephen Rothwell @ 2008-03-28  5:14 UTC (permalink / raw)
  To: Kumar Gala; +Cc: ppc-dev, paulus
In-Reply-To: <6B9965AF-F6B7-427E-B1D9-68CBB7540372@kernel.crashing.org>

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

Hi Kumar,

On Thu, 27 Mar 2008 07:45:06 -0500 Kumar Gala <galak@kernel.crashing.org> wrote:
>
> On Mar 27, 2008, at 12:36 AM, Stephen Rothwell wrote:
> > This will remove some build warnings and doesn't stop us building any
> > drivers that we were building previously with these configs.
> >
> > Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> 
> Doesn't this hide issues on the defconfigs most often built for PPC?

Not sure what you mean.  It removes some deprecated interfaces from the
builds for those configs.  The only things that use those interfaces are
drivers that none of those configs built.  People can still reenable
CONFIG_PCI_LEGACY on powerpc if they want to (and allmodconfig and
allyesconfig will do that).

So, the net effect is some less warnings in our builds.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply

* Booting the board using NFS on AMCC PPC 405EP
From: zechao wang @ 2008-03-28  7:13 UTC (permalink / raw)
  To: linuxppc devel

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

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=200000
ethaddr=00:01:02:03:04:87
bootargs=console=ttyS0,115200
cleanenv=protect off fffa0000 fffbffff;erase fffa0000 fffbffff
upuboot=tftp 100000 u-boot.bin;protect off fffc0000 ffffffff;era fffc0000 ffffffff;cp.b 100000 fffc0000 40000
burnKernel=tftp 200000 uImage;nand erase 0 200000;nand write.jffs2 ${fileaddr} 0 ${filesize}
burnInitrd=tftp 200000 uInitrd;nand erase 200000 80000;nand write.jffs2 ${fileaddr} 200000 ${filesize}
burnCramfs=tftp 200000 cramfs.img;nand erase 280000 1580000;nand write.jffs2 ${fileaddr} 280000 ${filesize}
burnJffs2=tftp 200000 jffs2.img;nand erase 1800000 500000;nand write.jffs2 ${fileaddr} 1800000 ${filesize}
burnFirmware=run burnKernel;run burnInitrd;run burnCramfs;run burnJffs2
flashboot=setenv bootargs console=ttyS0,115200;nand read.jffs2 200000 0 200000;nand read.jffs2 400000 200000 80000;bootm 200000 400000
ethact=VT6122
bootcmd=run nfs_boot
bootdelay=10
filesize=10930b
fileaddr=100000
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: 0x200000
Loading: #################################################################
         #################################################################
         #################################################################
         ##################
done
Bytes transferred = 1086219 (10930b hex)
Checking ...
Check1. Check2. ## Booting image at 00200000 ...
   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: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
Linux version 2.6.19.2 (zwang@wzc) (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. <source@mvista.com>)
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
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":
0x00000000-0x00020000 : "reserved"
0x00020000-0x00040000 : "env"
0x00040000-0x00080000 : "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 100003/2 on 192.168.1.142
eth0: Link autonegation speed 100M bps full duplex
TD structure errror TDindex=0
portmap: server 192.168.1.142 not responding, timed out
Root-NFS: Unable to get nfsd port number from server, using default
Looking up port of RPC 100005/1 on 192.168.1.142
portmap: server 192.168.1.142 not responding, timed out
Root-NFS: Unable to get mountd port number from server, using default
mount: server 192.168.1.142 not responding, timed out
Root-NFS: Server returned error -5 while mounting /opt/eldk/ppc_4xx
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "nfs" or unknown-block(2,0)
Please append a correct "root=" boot option
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
 <0>Rebooting in 1 seconds..<NULL>
System Halted
---------------------------------------------------------

Could anyone give me some advice ? Thank you very much.



       
---------------------------------
 雅虎邮箱,您的终生邮箱!

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

^ permalink raw reply

* Re: Patch: FW:Xilinx: BSP: Updated ML405 to match hardware used fortesting
From: Guillaume Dargaud @ 2008-03-28 10:40 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <fa686aa40803260601j6e7f507fpe4d31c7c462fce5e@mail.gmail.com>

>>  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=1226&id=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/

^ permalink raw reply

* Re: OF compatible MTD platform RAM driver ?
From: Sergei Shtylyov @ 2008-03-28 12:31 UTC (permalink / raw)
  To: David Gibson; +Cc: ben, linux-mtd, linuxppc-dev
In-Reply-To: <20080328000711.GC16141@localhost.localdomain>

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

^ permalink raw reply

* Re: Patch: FW:Xilinx: BSP: Updated ML405 to match hardware usedfortesting
From: Guillaume Dargaud @ 2008-03-28 12:35 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <066b01c890c0$17d9a800$ad289e86@LPSC0173W>

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/

^ permalink raw reply

* Please pull powerpc.git merge branch
From: Paul Mackerras @ 2008-03-28 12:35 UTC (permalink / raw)
  To: torvalds; +Cc: linuxppc-dev, akpm, linux-kernel

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 <michael@ellerman.id.au>
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 <jan.kratochvil@redhat.com>
    Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
    Signed-off-by: Paul Mackerras <paulus@samba.org>

commit 5c29934de29ddd7ecd913d83cad28e872f2e8c78
Author: Olof Johansson <olof@lixom.net>
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 <olof@lixom.net>

^ permalink raw reply

* Re: Missing patch for MPC5200B register definitions?
From: Matt Sealey @ 2008-03-28 12:36 UTC (permalink / raw)
  To: Grant Likely; +Cc: ppc-dev
In-Reply-To: <fa686aa40803270627r5c83f373kf5055a9c44d37300@mail.gmail.com>


Grant Likely wrote:
> On Wed, Mar 26, 2008 at 10:15 AM, Matt Sealey <matt@genesi-usa.com> 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 <matt@genesi-usa.com>
Genesi, Manager, Developer Relations

^ permalink raw reply

* Re: Booting the board using NFS on AMCC PPC 405EP
From: Stefan Roese @ 2008-03-28 13:28 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: zechao wang
In-Reply-To: <413023.21903.qm@web15205.mail.cnb.yahoo.com>

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: 0x200000
> Loading: #################################################################
>          #################################################################
>          #################################################################
>          ##################
> done
> Bytes transferred = 1086219 (10930b hex)
> Checking ...
> Check1. Check2. ## Booting image at 00200000 ...
>    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: 00000000
>    Entry Point:  00000000
>    Verifying Checksum ... OK
>    Uncompressing Kernel Image ... OK
> Linux version 2.6.19.2 (zwang@wzc) (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. <source@mvista.com>)
> 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":
> 0x00000000-0x00020000 : "reserved"
> 0x00020000-0x00040000 : "env"
> 0x00040000-0x00080000 : "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 100003/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: office@denx.de
=====================================================================

^ permalink raw reply

* Re: [PATCHv2 2/3] ep8248e: Reference SMC parameter RAM base in the device tree.
From: Laurent Pinchart @ 2008-03-28 13:58 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev
In-Reply-To: <20080327153952.GC18728@ld0162-tx32.am.freescale.net>

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

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 
> > 0x0000 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

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply

* Re: [PATCHv2 2/3] ep8248e: Reference SMC parameter RAM base in the device tree.
From: Laurent Pinchart @ 2008-03-28 14:06 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Scott Wood
In-Reply-To: <200803281458.56766.laurentp@cse-semaphore.com>

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

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 
> > > 0x0000 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

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply

* Re: MPC8641D PCI-Express problem
From: marco.stornelli @ 2008-03-28 15:15 UTC (permalink / raw)
  To: Kumar Gala; +Cc: LinuxPPC-Embedded
In-Reply-To: <D06A33A2-7DE7-4E00-9AA0-1C11EE7D4375@kernel.crashing.org>

>
> On Mar 25, 2008, at 8:03 AM, Marco Stornelli wrote:
>> Kumar Gala ha scritto:
>>> On Mar 25, 2008, at 3:02 AM, Marco Stornelli wrote:
>>>> Hi,
>>>>
>>>> do you remember my problem with the pci-express? I have an
>>>> mpc8641d_hpcn (rev. 2.0) board connected via pci-express with the
>>>> Xilinx ML555 evaluation board. I'm using the 2.6.24 kernel. I'm
>>>> observing this strange behavior:
>>>>
>>>> 1) I turn on the board and I stop the U-boot
>>>> 2) I load the FPGA microcode
>>>> 3) I start the system
>>>> 4) I load the driver module and I read a version register in the
>>>> FPGA
>>>> 5) The system crashes with a "machine check exception: transfer
>>>> error ack signal"
>>>> 6) reboot
>>>> 7) same procedure (without load the FPGA again)
>>>> 8) now I can read the registers!
>>>>
>>>> If I repeat the procedure again it doesn't work anymore. I think
>>>> it's a problem with pci-express controller. Have you got any
>>>> suggestions?
>>>>
>>>> Thanks.
>>> Where are you loading the FPGA microcode (linux, u-boot)?  Also, is
>>> the FPGA the only device connected over PCIe?
>>> - k
>> I load the FPGA with JTAG and with a Xilinx program without a
>> specific linux driver or u-boot. Yes, it is the only device
>> connected over PCIe.
>
> The issue may be related to the PCIe link training.  Are you able to
> access the FPGA in u-boot?  Can you try reseting the PCIe controller
> after you've loaded up the FPGA (see u-boot code in drivers/pci/
> fsl_pci_init.c and look for CONFIG_FSL_PCIE_RESET)
>
> - k
>

Ok I can try but I'm using the U-Boot 1.3.0 provided by Freescale with the
board, so I have to change the firmware, updating the U-Boot to the
version 1.3.2 to use CONFIG_FSL_PCIE_RESET. However, I've had the same
idea, but I check (with a warning) this case in the kernel function
fsl_check_pcie_link() (where the kernel check the value of LTSSM) but I've
never seen the warning during the start-up.

^ permalink raw reply

* Re: [PATCHv2 2/3] ep8248e: Reference SMC parameter RAM base in the device tree.
From: Scott Wood @ 2008-03-28 15:22 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linuxppc-dev
In-Reply-To: <200803281506.58988.laurentp@cse-semaphore.com>

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

^ permalink raw reply

* [PATCH 1/3] mpc83xx: fix usb phy_type in mpc837x rdb device trees
From: Kim Phillips @ 2008-03-28 15:51 UTC (permalink / raw)
  To: linuxppc-dev, Kumar Gala

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

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
---
 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";
 		};
 
 		mdio@24520 {
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";
 		};
 
 		mdio@24520 {
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";
 		};
 
 		mdio@24520 {
-- 
1.5.4.4.481.g5075

^ permalink raw reply related

* [PATCH 2/3] mpc83xx: enable usb in 837x rdb and 83xx defconfigs
From: Kim Phillips @ 2008-03-28 15:51 UTC (permalink / raw)
  To: linuxppc-dev, Kumar Gala

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
---
 arch/powerpc/configs/mpc837x_rdb_defconfig |   24 +++++++++++++++++++++++-
 arch/powerpc/configs/mpc83xx_defconfig     |   24 +++++++++++++++++++++++-
 2 files changed, 46 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/configs/mpc837x_rdb_defconfig b/arch/powerpc/configs/mpc837x_rdb_defconfig
index 44093a0..a633176 100644
--- a/arch/powerpc/configs/mpc837x_rdb_defconfig
+++ b/arch/powerpc/configs/mpc837x_rdb_defconfig
@@ -684,7 +684,29 @@ CONFIG_USB_SUPPORT=y
 CONFIG_USB_ARCH_HAS_HCD=y
 # CONFIG_USB_ARCH_HAS_OHCI is not set
 CONFIG_USB_ARCH_HAS_EHCI=y
-# CONFIG_USB is not set
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
+
+#
+# Miscellaneous USB options
+#
+# CONFIG_USB_DEVICEFS is not set
+CONFIG_USB_DEVICE_CLASS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG is not set
+
+#
+# USB Host Controller Drivers
+#
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_ROOT_HUB_TT=y
+# CONFIG_USB_EHCI_TT_NEWSCHED is not set
+CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_EHCI_HCD_PPC_OF=y
+# CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
 
 #
 # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
diff --git a/arch/powerpc/configs/mpc83xx_defconfig b/arch/powerpc/configs/mpc83xx_defconfig
index 1f6cf68..029d2da 100644
--- a/arch/powerpc/configs/mpc83xx_defconfig
+++ b/arch/powerpc/configs/mpc83xx_defconfig
@@ -690,7 +690,29 @@ CONFIG_USB_SUPPORT=y
 CONFIG_USB_ARCH_HAS_HCD=y
 # CONFIG_USB_ARCH_HAS_OHCI is not set
 CONFIG_USB_ARCH_HAS_EHCI=y
-# CONFIG_USB is not set
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
+
+#
+# Miscellaneous USB options
+#
+# CONFIG_USB_DEVICEFS is not set
+CONFIG_USB_DEVICE_CLASS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG is not set
+
+#
+# USB Host Controller Drivers
+#
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_ROOT_HUB_TT=y
+# CONFIG_USB_EHCI_TT_NEWSCHED is not set
+CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_EHCI_HCD_PPC_OF=y
+# CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
 
 #
 # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
-- 
1.5.4.4.481.g5075

^ permalink raw reply related

* [PATCH 3/3] sata_fsl: reduce compatibility to fsl,pq-sata
From: Kim Phillips @ 2008-03-28 15:51 UTC (permalink / raw)
  To: linuxppc-dev, Kumar Gala; +Cc: linux-ide, jgarzik

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

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Cc: Jeff Garzik <jgarzik@pobox.com>
---
 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 @@
 		};
 
 		sata@18000 {
-			compatible = "fsl,mpc8379-sata";
+			compatible = "fsl,mpc8379-sata", "fsl,pq-sata";
 			reg = <0x18000 0x1000>;
 			interrupts = <44 0x8>;
 			interrupt-parent = <&ipic>;
 		};
 
 		sata@19000 {
-			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 @@
 		};
 
 		sata@18000 {
-			compatible = "fsl,mpc8379-sata";
+			compatible = "fsl,mpc8379-sata", "fsl,pq-sata";
 			reg = <0x18000 0x1000>;
 			interrupts = <44 0x8>;
 			interrupt-parent = <&ipic>;
 		};
 
 		sata@19000 {
-			compatible = "fsl,mpc8379-sata";
+			compatible = "fsl,mpc8379-sata", "fsl,pq-sata";
 			reg = <0x19000 0x1000>;
 			interrupts = <45 0x8>;
 			interrupt-parent = <&ipic>;
 		};
 
 		sata@1a000 {
-			compatible = "fsl,mpc8379-sata";
+			compatible = "fsl,mpc8379-sata", "fsl,pq-sata";
 			reg = <0x1a000 0x1000>;
 			interrupts = <46 0x8>;
 			interrupt-parent = <&ipic>;
 		};
 
 		sata@1b000 {
-			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

^ permalink raw reply related

* Re: [PATCH 3/3] sata_fsl: reduce compatibility to fsl,pq-sata
From: Kumar Gala @ 2008-03-28 16:01 UTC (permalink / raw)
  To: Kim Phillips; +Cc: linuxppc-dev, jgarzik, linux-ide
In-Reply-To: <20080328105133.43eb4fb1.kim.phillips@freescale.com>


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 <kim.phillips@freescale.com>
> Cc: Jeff Garzik <jgarzik@pobox.com>
> ---

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

- k

^ permalink raw reply

* RE: Patch: FW:Xilinx: BSP: Updated ML405 to match hardwareusedfortesting
From: Stephen Neuendorffer @ 2008-03-28 16:06 UTC (permalink / raw)
  To: Guillaume Dargaud, linuxppc-dev
In-Reply-To: <068401c890d0$294e3e10$ad289e86@LPSC0173W>



> -----Original Message-----
> From: =
linuxppc-dev-bounces+stephen.neuendorffer=3Dxilinx.com@ozlabs.org
[mailto:linuxppc-dev-
> bounces+stephen.neuendorffer=3Dxilinx.com@ozlabs.org] On Behalf Of
Guillaume Dargaud
> Sent: Friday, March 28, 2008 5:35 AM
> To: linuxppc-dev@ozlabs.org
> Subject: Re: Patch: FW:Xilinx: BSP: Updated ML405 to match
hardwareusedfortesting
>=20
> 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

This should work.

> - copy all the files from the BSP into the (Xilinx) kernel tree
> - directly generate the BSP into the (Xilinx) kernel tree

Neither of these will work.

> 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

Did you check out the head of the tree?

> Two more things:
>=20
> $ make ARCH=3Dppc ml405_defconfig
> cp  .config
> cp: missing destination file operand after `.config'
> Try `cp --help' for more information.
> make: *** [ml405_defconfig] Error 1

I'd suggest starting over with a fresh tree.
1) Copy the xparameters file, overwriting the appropriate xparameters
file in the git tree.
2) make ARCH=3Dppc ml405_defconfig
3) make ARCH=3Dppc all

> 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.

I know Grant has been having problems with the secretlab git server
recently.

Steve

^ permalink raw reply

* [PATCH] powerpc: move_device_tree() should be __init
From: Geert Uytterhoeven @ 2008-03-28 16:07 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: Linux/PPC Development

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1564 bytes --]

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 <Geert.Uytterhoeven@sonycom.com>
---
 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:   Geert.Uytterhoeven@sonycom.com
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

^ permalink raw reply

* [PATCH] powerpc: arch_add_memory() cannot be __devinit
From: Geert Uytterhoeven @ 2008-03-28 16:10 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: Linux/PPC Development

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1443 bytes --]

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 <Geert.Uytterhoeven@sonycom.com>
---
 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:   Geert.Uytterhoeven@sonycom.com
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

^ permalink raw reply

* video driver problems on set top box board
From: BAK @ 2008-03-28 16:12 UTC (permalink / raw)
  To: linuxppc-embedded


I am working ST set top box board and I need help to resolve some problems.
if you 're working on set top box or you have experience with them these are
more detailed informations:

I am using a set top box board : STB442 based on STi7109 chip. I use STAPI
(drivers provided by ST) with STlinux kernell. I have some problems with a
module (named mme_host) which must be inserted with arguments (insmod
mme_host.ko transport0=<arguments_to_be_used>). This operation causes the
following error :
insmod: error inserting '/home/bakhaled/modules/mme/mme_host.ko': -1
Operation not permitted
I tried to insert the module without arguments (insmod mme_host.ko) and
this was successful. But when I try to run a test program for video ,
after inserting that mme module without arguments, the system crash down.
(don't execute console commands).
Has any one experienced this type of problems?
Have you any solutions ?
-- 
View this message in context: http://www.nabble.com/video-driver-problems-on-set-top-box-board-tp16352982p16352982.html
Sent from the linuxppc-embedded mailing list archive at Nabble.com.

^ permalink raw reply

* [PATCH 5/5] [RFC][PPC] Use DCR for arch ppc, and enable MMIO and NATIVE for virtex.
From: Stephen Neuendorffer @ 2008-03-28 16:23 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <1206721429-18276-4-git-send-email-stephen.neuendorffer@xilinx.com>

Generally speaking, I'm not sure about the validity of this patch.  In
particular:

1) I'm not sure what architecture code relies on including
dcr support through ibm4xx.h.

2) I'm not sure how temporary the ifdef in
arch/powerpc/sysdev/Makefile really is.  Is it still needed or not?

However, this appears to work at least for the Virtex systems I've
tried.  In any event, I don't expect this to actually be sent to
mainline, since it's ARCH=ppc related, at least not in this form.

Unfortunately, the framebuffer driver won't work under ARCH=ppc
without this patch.
---
 arch/powerpc/sysdev/Makefile   |    2 --
 arch/ppc/Kconfig               |    6 +++++-
 arch/ppc/platforms/4xx/Kconfig |    2 ++
 include/asm-ppc/ibm4xx.h       |    1 -
 4 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile
index 15f3e85..c85525b 100644
--- a/arch/powerpc/sysdev/Makefile
+++ b/arch/powerpc/sysdev/Makefile
@@ -35,10 +35,8 @@ endif
 endif
 
 # Temporary hack until we have migrated to asm-powerpc
-ifeq ($(ARCH),powerpc)
 obj-$(CONFIG_CPM)		+= cpm_common.o
 obj-$(CONFIG_CPM2)		+= cpm2.o cpm2_pic.o
 obj-$(CONFIG_PPC_DCR)		+= dcr.o
 obj-$(CONFIG_8xx)		+= mpc8xx_pic.o cpm1.o
 obj-$(CONFIG_UCODE_PATCH)	+= micropatch.o
-endif
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig
index abc877f..81d6748 100644
--- a/arch/ppc/Kconfig
+++ b/arch/ppc/Kconfig
@@ -116,9 +116,13 @@ config PPC_DCR_NATIVE
 	bool
 	default n
 
+config PPC_DCR_MMIO
+	bool
+	default n
+
 config PPC_DCR
 	bool
-	depends on PPC_DCR_NATIVE
+	depends on PPC_DCR_NATIVE || PPC_DCR_MMIO
 	default y
 
 config PTE_64BIT
diff --git a/arch/ppc/platforms/4xx/Kconfig b/arch/ppc/platforms/4xx/Kconfig
index 76551b6..0430fc2 100644
--- a/arch/ppc/platforms/4xx/Kconfig
+++ b/arch/ppc/platforms/4xx/Kconfig
@@ -228,6 +228,8 @@ config XILINX_VIRTEX_4_FX
 
 config XILINX_VIRTEX
 	bool
+	select PPC_DCR_NATIVE
+	select PPC_DCR_MMIO
 
 config STB03xxx
 	bool
diff --git a/include/asm-ppc/ibm4xx.h b/include/asm-ppc/ibm4xx.h
index ed6891a..053a86b 100644
--- a/include/asm-ppc/ibm4xx.h
+++ b/include/asm-ppc/ibm4xx.h
@@ -15,7 +15,6 @@
 #define __ASM_IBM4XX_H__
 
 #include <asm/types.h>
-#include <asm/dcr.h>
 
 #ifdef CONFIG_40x
 
-- 
1.5.3.4-dirty

^ permalink raw reply related

* [PATCH 1/5] [v2][POWERPC] refactor dcr code
From: Stephen Neuendorffer @ 2008-03-28 16:23 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <1206401313-1625-1-git-send-email-stephen.neuendorffer@xilinx.com>

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 <stephen.neuendorffer@xilinx.com>
---
 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 * ret.stride;
 	return ret;
 }
-EXPORT_SYMBOL_GPL(dcr_map);
+EXPORT_SYMBOL_GPL(dcr_map_mmio);
 
-void dcr_unmap(dcr_host_t host, unsigned int dcr_c)
+void dcr_unmap_mmio(dcr_host_mmio_t host, unsigned int dcr_c)
 {
-	dcr_host_t h = host;
+	dcr_host_mmio_t h = host;
 
 	if (h.token == NULL)
 		return;
@@ -136,7 +199,11 @@ void dcr_unmap(dcr_host_t host, unsigned int dcr_c)
 	iounmap(h.token);
 	h.token = NULL;
 }
-EXPORT_SYMBOL_GPL(dcr_unmap);
-#else	/* defined(CONFIG_PPC_DCR_NATIVE) */
+EXPORT_SYMBOL_GPL(dcr_unmap_mmio);
+
+#endif /* defined(CONFIG_PPC_DCR_MMIO) */
+
+#ifdef CONFIG_PPC_DCR_NATIVE
 DEFINE_SPINLOCK(dcr_ind_lock);
-#endif	/* !defined(CONFIG_PPC_DCR_NATIVE) */
+#endif	/* defined(CONFIG_PPC_DCR_NATIVE) */
+
diff --git a/include/asm-powerpc/dcr-generic.h b/include/asm-powerpc/dcr-generic.h
new file mode 100644
index 0000000..0ee74fb
--- /dev/null
+++ b/include/asm-powerpc/dcr-generic.h
@@ -0,0 +1,49 @@
+/*
+ * (c) Copyright 2006 Benjamin Herrenschmidt, IBM Corp.
+ *                    <benh@kernel.crashing.org>
+ *
+ *   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.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+ *   the GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program;  if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef _ASM_POWERPC_DCR_GENERIC_H
+#define _ASM_POWERPC_DCR_GENERIC_H
+#ifdef __KERNEL__
+#ifndef __ASSEMBLY__
+
+enum host_type_t {MMIO, NATIVE, INVALID};
+
+typedef struct {
+	enum host_type_t type;
+	union {
+		dcr_host_mmio_t mmio;
+		dcr_host_native_t native;
+	} host;
+} dcr_host_t;
+
+extern bool dcr_map_ok_generic(dcr_host_t host);
+
+extern dcr_host_t dcr_map_generic(struct device_node *dev, unsigned int dcr_n,
+			  unsigned int dcr_c);
+extern void dcr_unmap_generic(dcr_host_t host, unsigned int dcr_c);
+
+extern u32 dcr_read_generic(dcr_host_t host, unsigned int dcr_n);
+
+extern void dcr_write_generic(dcr_host_t host, unsigned int dcr_n, u32 value);
+
+#endif /* __ASSEMBLY__ */
+#endif /* __KERNEL__ */
+#endif /* _ASM_POWERPC_DCR_GENERIC_H */
+
+
diff --git a/include/asm-powerpc/dcr-mmio.h b/include/asm-powerpc/dcr-mmio.h
index 08532ff..acd491d 100644
--- a/include/asm-powerpc/dcr-mmio.h
+++ b/include/asm-powerpc/dcr-mmio.h
@@ -27,20 +27,26 @@ typedef struct {
 	void __iomem *token;
 	unsigned int stride;
 	unsigned int base;
-} dcr_host_t;
+} dcr_host_mmio_t;
 
-#define DCR_MAP_OK(host)	((host).token != NULL)
+static inline bool dcr_map_ok_mmio(dcr_host_mmio_t host)
+{
+	return host.token != NULL;
+}
 
-extern dcr_host_t dcr_map(struct device_node *dev, unsigned int dcr_n,
-			  unsigned int dcr_c);
-extern void dcr_unmap(dcr_host_t host, unsigned int dcr_c);
+extern dcr_host_mmio_t dcr_map_mmio(struct device_node *dev,
+				    unsigned int dcr_n,
+				    unsigned int dcr_c);
+extern void dcr_unmap_mmio(dcr_host_mmio_t host, unsigned int dcr_c);
 
-static inline u32 dcr_read(dcr_host_t host, unsigned int dcr_n)
+static inline u32 dcr_read_mmio(dcr_host_mmio_t host, unsigned int dcr_n)
 {
 	return in_be32(host.token + ((host.base + dcr_n) * host.stride));
 }
 
-static inline void dcr_write(dcr_host_t host, unsigned int dcr_n, u32 value)
+static inline void dcr_write_mmio(dcr_host_mmio_t host,
+				  unsigned int dcr_n,
+				  u32 value)
 {
 	out_be32(host.token + ((host.base + dcr_n) * host.stride), value);
 }
diff --git a/include/asm-powerpc/dcr-native.h b/include/asm-powerpc/dcr-native.h
index be6c879..67832e5 100644
--- a/include/asm-powerpc/dcr-native.h
+++ b/include/asm-powerpc/dcr-native.h
@@ -26,14 +26,18 @@
 
 typedef struct {
 	unsigned int base;
-} dcr_host_t;
+} dcr_host_native_t;
 
-#define DCR_MAP_OK(host)	(1)
+static inline bool dcr_map_ok_native(dcr_host_native_t host)
+{
+	return 1;
+}
 
-#define dcr_map(dev, dcr_n, dcr_c)	((dcr_host_t){ .base = (dcr_n) })
-#define dcr_unmap(host, dcr_c)		do {} while (0)
-#define dcr_read(host, dcr_n)		mfdcr(dcr_n + host.base)
-#define dcr_write(host, dcr_n, value)	mtdcr(dcr_n + host.base, value)
+#define dcr_map_native(dev, dcr_n, dcr_c) \
+	((dcr_host_native_t){ .base = (dcr_n) })
+#define dcr_unmap_native(host, dcr_c)		do {} while (0)
+#define dcr_read_native(host, dcr_n)		mfdcr(dcr_n + host.base)
+#define dcr_write_native(host, dcr_n, value)	mtdcr(dcr_n + host.base, value)
 
 /* Device Control Registers */
 void __mtdcr(int reg, unsigned int val);
diff --git a/include/asm-powerpc/dcr.h b/include/asm-powerpc/dcr.h
index 9338d50..6b86322 100644
--- a/include/asm-powerpc/dcr.h
+++ b/include/asm-powerpc/dcr.h
@@ -20,14 +20,47 @@
 #ifndef _ASM_POWERPC_DCR_H
 #define _ASM_POWERPC_DCR_H
 #ifdef __KERNEL__
+#ifndef __ASSEMBLY__
 #ifdef CONFIG_PPC_DCR
 
 #ifdef CONFIG_PPC_DCR_NATIVE
 #include <asm/dcr-native.h>
-#else
+#endif
+
+#ifdef CONFIG_PPC_DCR_MMIO
 #include <asm/dcr-mmio.h>
 #endif
 
+#if defined(CONFIG_PPC_DCR_NATIVE) && defined(CONFIG_PPC_DCR_MMIO)
+
+#include <asm/dcr-generic.h>
+
+#define DCR_MAP_OK(host)	dcr_map_ok_generic(host)
+#define dcr_map(dev, dcr_n, dcr_c) dcr_map_generic(dev, dcr_n, dcr_c)
+#define dcr_unmap(host, dcr_c) dcr_unmap_generic(host, dcr_c)
+#define dcr_read(host, dcr_n) dcr_read_generic(host, dcr_n)
+#define dcr_write(host, dcr_n, value) dcr_write_generic(host, dcr_n, value)
+
+#else
+
+#ifdef CONFIG_PPC_DCR_NATIVE
+typedef dcr_host_native_t dcr_host_t;
+#define DCR_MAP_OK(host)	dcr_map_ok_native(host)
+#define dcr_map(dev, dcr_n, dcr_c) dcr_map_native(dev, dcr_n, dcr_c)
+#define dcr_unmap(host, dcr_c) dcr_unmap_native(host, dcr_c)
+#define dcr_read(host, dcr_n) dcr_read_native(host, dcr_n)
+#define dcr_write(host, dcr_n, value) dcr_write_native(host, dcr_n, value)
+#else
+typedef dcr_host_mmio_t dcr_host_t;
+#define DCR_MAP_OK(host)	dcr_map_ok_mmio(host)
+#define dcr_map(dev, dcr_n, dcr_c) dcr_map_mmio(dev, dcr_n, dcr_c)
+#define dcr_unmap(host, dcr_c) dcr_unmap_mmio(host, dcr_c)
+#define dcr_read(host, dcr_n) dcr_read_mmio(host, dcr_n)
+#define dcr_write(host, dcr_n, value) dcr_write_mmio(host, dcr_n, value)
+#endif
+
+#endif /* defined(CONFIG_PPC_DCR_NATIVE) && defined(CONFIG_PPC_DCR_MMIO) */
+
 /*
  * On CONFIG_PPC_MERGE, we have additional helpers to read the DCR
  * base from the device-tree
@@ -41,5 +74,6 @@ extern unsigned int dcr_resource_len(struct device_node *np,
 #endif /* CONFIG_PPC_MERGE */
 
 #endif /* CONFIG_PPC_DCR */
+#endif /* __ASSEMBLY__ */
 #endif /* __KERNEL__ */
 #endif /* _ASM_POWERPC_DCR_H */
-- 
1.5.3.4-dirty

^ permalink raw reply related

* [PATCH 3/5] [POWERPC] explicit dcr support
From: Stephen Neuendorffer @ 2008-03-28 16:23 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <1206721429-18276-2-git-send-email-stephen.neuendorffer@xilinx.com>

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 <stephen.neuendorffer@xilinx.com>
---
 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)
 {
 	dcr_host_mmio_t h = host;
diff --git a/include/asm-powerpc/dcr-generic.h b/include/asm-powerpc/dcr-generic.h
index 0ee74fb..8032795 100644
--- a/include/asm-powerpc/dcr-generic.h
+++ b/include/asm-powerpc/dcr-generic.h
@@ -34,8 +34,10 @@ typedef struct {
 
 extern bool dcr_map_ok_generic(dcr_host_t host);
 
+#ifdef CONFIG_OF
 extern dcr_host_t dcr_map_generic(struct device_node *dev, unsigned int dcr_n,
 			  unsigned int dcr_c);
+#endif
 extern void dcr_unmap_generic(dcr_host_t host, unsigned int dcr_c);
 
 extern u32 dcr_read_generic(dcr_host_t host, unsigned int dcr_n);
diff --git a/include/asm-powerpc/dcr-mmio.h b/include/asm-powerpc/dcr-mmio.h
index acd491d..b12d291 100644
--- a/include/asm-powerpc/dcr-mmio.h
+++ b/include/asm-powerpc/dcr-mmio.h
@@ -34,9 +34,18 @@ static inline bool dcr_map_ok_mmio(dcr_host_mmio_t host)
 	return host.token != NULL;
 }
 
+extern 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);
+
+
+#ifdef CONFIG_OF
 extern dcr_host_mmio_t dcr_map_mmio(struct device_node *dev,
 				    unsigned int dcr_n,
 				    unsigned int dcr_c);
+#endif
+
 extern void dcr_unmap_mmio(dcr_host_mmio_t host, unsigned int dcr_c);
 
 static inline u32 dcr_read_mmio(dcr_host_mmio_t host, unsigned int dcr_n)
@@ -51,9 +60,11 @@ static inline void dcr_write_mmio(dcr_host_mmio_t host,
 	out_be32(host.token + ((host.base + dcr_n) * host.stride), value);
 }
 
+#ifdef CONFIG_OF
 extern u64 of_translate_dcr_address(struct device_node *dev,
 				    unsigned int dcr_n,
 				    unsigned int *stride);
+#endif
 
 #endif /* __KERNEL__ */
 #endif /* _ASM_POWERPC_DCR_MMIO_H */
diff --git a/include/asm-powerpc/dcr-native.h b/include/asm-powerpc/dcr-native.h
index 67832e5..9b3e255 100644
--- a/include/asm-powerpc/dcr-native.h
+++ b/include/asm-powerpc/dcr-native.h
@@ -33,6 +33,14 @@ static inline bool dcr_map_ok_native(dcr_host_native_t host)
 	return 1;
 }
 
+static inline
+dcr_host_native_t dcr_map_native_literal_native(unsigned int dcr_n)
+{
+	dcr_host_native_t host;
+	host.base = dcr_n;
+	return host;
+}
+
 #define dcr_map_native(dev, dcr_n, dcr_c) \
 	((dcr_host_native_t){ .base = (dcr_n) })
 #define dcr_unmap_native(host, dcr_c)		do {} while (0)
diff --git a/include/asm-powerpc/dcr.h b/include/asm-powerpc/dcr.h
index 6b86322..dfd1c24 100644
--- a/include/asm-powerpc/dcr.h
+++ b/include/asm-powerpc/dcr.h
@@ -35,6 +35,27 @@
 
 #include <asm/dcr-generic.h>
 
+static inline
+dcr_host_t dcr_map_mmio_literal(resource_size_t mmio_start,
+				unsigned int stride,
+				unsigned int dcr_n,
+				unsigned int dcr_c)
+{
+	dcr_host_t host;
+	host.type = MMIO;
+	host.host.mmio =
+		dcr_map_mmio_literal_mmio(mmio_start, stride, dcr_n, dcr_c);
+	return host;
+}
+static inline
+dcr_host_t dcr_map_native_literal(unsigned int dcr_n)
+{
+	dcr_host_t host;
+	host.type = NATIVE;
+	host.host.native = dcr_map_native_literal_native(dcr_n);
+	return host;
+}
+
 #define DCR_MAP_OK(host)	dcr_map_ok_generic(host)
 #define dcr_map(dev, dcr_n, dcr_c) dcr_map_generic(dev, dcr_n, dcr_c)
 #define dcr_unmap(host, dcr_c) dcr_unmap_generic(host, dcr_c)
@@ -45,6 +66,7 @@
 
 #ifdef CONFIG_PPC_DCR_NATIVE
 typedef dcr_host_native_t dcr_host_t;
+#define dcr_map_native_literal(dcr_n) dcr_map_native_literal_native(dcr_n)
 #define DCR_MAP_OK(host)	dcr_map_ok_native(host)
 #define dcr_map(dev, dcr_n, dcr_c) dcr_map_native(dev, dcr_n, dcr_c)
 #define dcr_unmap(host, dcr_c) dcr_unmap_native(host, dcr_c)
@@ -52,6 +74,8 @@ typedef dcr_host_native_t dcr_host_t;
 #define dcr_write(host, dcr_n, value) dcr_write_native(host, dcr_n, value)
 #else
 typedef dcr_host_mmio_t dcr_host_t;
+#define dcr_map_mmio_literal(mmio_start, stride, dcr_n, dcr_c) \
+	dcr_map_mmio_literal_mmio(mmio_start, stride, dcr_n, dcr_c)
 #define DCR_MAP_OK(host)	dcr_map_ok_mmio(host)
 #define dcr_map(dev, dcr_n, dcr_c) dcr_map_mmio(dev, dcr_n, dcr_c)
 #define dcr_unmap(host, dcr_c) dcr_unmap_mmio(host, dcr_c)
-- 
1.5.3.4-dirty

^ permalink raw reply related


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