* Re: [PATCH] RTAS - adapt procfs interface
From: Nathan Lynch @ 2008-04-01 16:35 UTC (permalink / raw)
To: Jens Osterkamp; +Cc: maxim, linuxppc-dev, Paul Mackerras, cbe-oss-dev
In-Reply-To: <200804011512.20834.jens@de.ibm.com>
Jens Osterkamp wrote:
>
> Handling of the proc_dir_entry->count has being changed in 2.6.24-rc5.
Do you know which commit caused the change?
> After this change the default value for pde->count is 1 and not 0 as it
> was in earlier kernels. Therefore, if we want to check wether our procfs
> file is already opened (already in use), we have to check if pde->count
> is not greater than 2 but not 1.
>
> Signed-off-by: Maxim Shchetynin <maxim@de.ibm.com>
> Signed-off-by: Jens Osterkamp <jens@de.ibm.com>
>
> Index: linux-2.6/arch/powerpc/kernel/rtas_flash.c
> ===================================================================
> --- linux-2.6.orig/arch/powerpc/kernel/rtas_flash.c
> +++ linux-2.6/arch/powerpc/kernel/rtas_flash.c
> @@ -356,7 +356,7 @@ static int rtas_excl_open(struct inode *
>
> /* Enforce exclusive open with use count of PDE */
> spin_lock(&flash_file_open_lock);
> - if (atomic_read(&dp->count) > 1) {
> + if (atomic_read(&dp->count) > 2) {
> spin_unlock(&flash_file_open_lock);
> return -EBUSY;
> }
One could argue that the real problem is using the proc_dir_entry's
reference count to enforce exclusive open.
^ permalink raw reply
* RE: xilinx Ml405 NFS mount problem
From: MingLiu @ 2008-04-01 16:15 UTC (permalink / raw)
To: John Linn, linuxppc-embedded
In-Reply-To: <20080401142910.5BFD038005F@mail141-dub.bigfish.com>
[-- Attachment #1: Type: text/plain, Size: 9819 bytes --]
Dear John,
Thank you for your replying.
>It’s not obvious to me what the problem is as I don’t see any driver failures. Have you >tried using a ramdisk and then seeing if the network is working before using NFS root?
Not yet. I will try it soon. However from the information on the LL_TEMAC, it seems everything is fine and it should work.
>And I’m assuming you have used the NFS root before so you know that it’s good for sure.
>I test on the ML405 with NFS root and haven’t seen this problem, but my setup is a little different. I use DHCP rather than >a static IP, but other than that it’s similar.
Yes. I used NFS before. I can make sure my NFS server works well. Also in principle, static IP should get a same result as DHCP, I think.
>How long has it been since you pulled from the Xilinx Git tree?
I just pulled the Xilinx tree quite recently. I am using a latest kernel.
BR
Ming
And I’m assuming you have used the NFS root before so you know that it’s good for sure.
I test on the ML405 with NFS root and haven’t seen this problem, but my setup is a little different. I use DHCP rather than a static IP, but other than that it’s similar.
I’m assuming that you accidentally got 2 different powerup outputs in the message below as the 1st stops and a 2nd starts in the middle.
How long has it been since you pulled from the Xilinx Git tree?
Thanks,
John
From: linuxppc-embedded-bounces+john.linn=xilinx.com@ozlabs.org [mailto:linuxppc-embedded-bounces+john.linn=xilinx.com@ozlabs.org] On Behalf Of MingLiuSent: Tuesday, April 01, 2008 8:12 AMTo: linuxppc-embedded@ozlabs.orgSubject: xilinx Ml405 NFS mount problem
Dear friends,I am bringing up my kernel from Xilinx git tree. Unfortunately I met someproblem when mounting the root file system. Here is the informationlisted. I will appreciate a lot if someone can help me out of the trouble. Thanks a lot! loaded at: 00400000 0059F19Cboard data at: 0059D120 0059D19Crelocated to: 004050C8 00405144zimage at: 00405F3F 0059C025avail ram: 005A0000 08000000 Linux/PPC load: root=/dev/nfsip=192.168.0.4:192.168.0.3:192.168.0.3:255.255.255.0 rwnfsroot=192.168.0.3:/home/mingliu/ml403_rootfs console=ttyUL0,38400mem=32MUncompressing Linux...done.Now booting the kernelLinux version 2.6.24-rc8-xlnx-g1db182b8-dirty (mingliu@cca01) (gcc version3.4.1) #7 Tue Apr 1 14:55:25 CEST 2008Xilinx Generic PowerPC board support package (Xilinx ML405) (Virtex-4 FX)Zone PFN ranges: DMA 0 -> 8192 Normal 8192 -> 8192 HighMem 8192 -> 8192Movable zone start PFN for each nodeearly_node_map[1] active PFN ranges 0: 0 -> 8192Built 1 zonelists in Zone order, mobility grouping on. Total pages: 8128Kernel command line: root=/dev/nfsip=192.168.0.4:192.168.0.3:192.168.0.3:255.255.255.0 rwnfsroot=192.168.0.3:/home/mingliu/ml403_rootfs console=ttyUL0,38400mem=32MXilinx INTC #0 at 0x81800000 mapped to 0xFDFFF000PID hash table entries: 128 (order: 7, 512 bytes)Console: colour dummy device 80x25Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)Memory: 28884k available (2552k kernel code, 944k data, 84k init, 0k highmem)SLUB: Genslabs=11, HWalign=32, Order=0-1, MinObjects=4, CPUs=1, Nodes=1Mount-cache hash table entries: 512net_namespace: 64 bytesNET: Registered protocol family 16Registering device uartlite:0Fixup MAC address for xilinx_lltemac:0Registering device xilinx_lltemac:0NET: Registered protocol family 2IP route cache hash table entries: 1024 (order: 0, 4096 bytes)TCP established hash table entries: 1024 (order: 1, 8192 bytes)TCP bind hash table entries: 1024 (order: 0, 4096 bytes)TCP: Hash tables configured (established 1024 bind 1024)TCP reno registeredsysctl table check failed: /kernel/l2cr .1.31 Missing strategyCall Trace:[c1c0fe50] [c0008b70] show_stack+0x40/0x194 (unreliable)[c1c0fe90] [c003aed4] set_fail+0x68/0x80[c1c0feb0] [c003b4ec] sysctl_check_table+0x600/0x77c[c1c0fef0] [c003b4d4] sysctl_check_table+0x5e8/0x77c[c1c0ff30] [c002605c] register_sysctl_table+0x64/0xb4[c1c0ff50] [c034579c] register_ppc_htab_sysctl+0x18/0x2c[c1c0ff60] [c034482c] kernel_init+0x94/0x2bc[c1c0fff0] [c0004d58] kernel_thread+0x44/0x60Installing knfsd (copyright (C) 1996 okir@monad.swb.de).fuse init (API version 7.9)io scheduler noop registeredio scheduler anticipatory registeredio scheduler deadline registeredio scheduler cfq registered (default)uartlite.0: ttyUL0 at MMIO 0x84000003 (irq = 3) is a uartliteconsole [ttyUL0] enabledloop: module loadednbd: registered device at major 43xilinx_lltemac xilinx_lltemac.0: MAC address is now 0: a:35: 1: 2: 3xilinx_lltemac xilinx_lltemac.0: XLlTemac: using DMA mode.XLlTemac: Dma base address: phy: 0x84600100, virt: 0xc3008100XLlTemac: buffer descriptor size: 32768 (0x8000)XLlTemac: Allocating DMA descriptors with kmalloc<6>XLlTemac:(buffer_descriptor_init) phy: 0x1d18000, virt: 0xc1d18000, size: 0x8000XTemac: PHY detected at address 7.xilinx_lltemac xilinx_lltemac.0: eth0: Xilinx TEMAC at 0x81C00000 mappedto 0xC3004000, irq=2console [netcon0] enabledLinux version 2.6.24-rc8-xlnx-g1db182b8-dirty (mingliu@cca01) (gcc version3.4.1) #7 Tue Apr 1 14:55:25 CEST 2008Xilinx Generic PowerPC board support package (Xilinx ML405) (Virtex-4 FX)Zone PFN ranges: DMA 0 -> 8192 Normal 8192 -> 8192 HighMem 8192 -> 8192Movable zone start PFN for each nodeearly_node_map[1] active PFN ranges 0: 0 -> 8192Built 1 zonelists in Zone order, mobility grouping on. Total pages: 8128Kernel command line: root=/dev/nfsip=192.168.0.4:192.168.0.3:192.168.0.3:255.255.255.0 rwnfsroot=192.168.0.3:/home/mingliu/ml403_rootfs console=ttyUL0,38400mem=32MXilinx INTC #0 at 0x81800000 mapped to 0xFDFFF000PID hash table entries: 128 (order: 7, 512 bytes)Console: colour dummy device 80x25Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)Memory: 28884k available (2552k kernel code, 944k data, 84k init, 0k highmem)SLUB: Genslabs=11, HWalign=32, Order=0-1, MinObjects=4, CPUs=1, Nodes=1Mount-cache hash table entries: 512net_namespace: 64 bytesNET: Registered protocol family 16Registering device uartlite:0Fixup MAC address for xilinx_lltemac:0Registering device xilinx_lltemac:0NET: Registered protocol family 2IP route cache hash table entries: 1024 (order: 0, 4096 bytes)TCP established hash table entries: 1024 (order: 1, 8192 bytes)TCP bind hash table entries: 1024 (order: 0, 4096 bytes)TCP: Hash tables configured (established 1024 bind 1024)TCP reno registeredsysctl table check failed: /kernel/l2cr .1.31 Missing strategyCall Trace:[c1c0fe50] [c0008b70] show_stack+0x40/0x194 (unreliable)[c1c0fe90] [c003aed4] set_fail+0x68/0x80[c1c0feb0] [c003b4ec] sysctl_check_table+0x600/0x77c[c1c0fef0] [c003b4d4] sysctl_check_table+0x5e8/0x77c[c1c0ff30] [c002605c] register_sysctl_table+0x64/0xb4[c1c0ff50] [c034579c] register_ppc_htab_sysctl+0x18/0x2c[c1c0ff60] [c034482c] kernel_init+0x94/0x2bc[c1c0fff0] [c0004d58] kernel_thread+0x44/0x60Installing knfsd (copyright (C) 1996 okir@monad.swb.de).fuse init (API version 7.9)io scheduler noop registeredio scheduler anticipatory registeredio scheduler deadline registeredio scheduler cfq registered (default)uartlite.0: ttyUL0 at MMIO 0x84000003 (irq = 3) is a uartliteconsole [ttyUL0] enabledloop: module loadednbd: registered device at major 43xilinx_lltemac xilinx_lltemac.0: MAC address is now 0: a:35: 1: 2: 3xilinx_lltemac xilinx_lltemac.0: XLlTemac: using DMA mode.XLlTemac: Dma base address: phy: 0x84600100, virt: 0xc3008100XLlTemac: buffer descriptor size: 32768 (0x8000)XLlTemac: Allocating DMA descriptors with kmalloc<6>XLlTemac:(buffer_descriptor_init) phy: 0x1d18000, virt: 0xc1d18000, size: 0x8000XTemac: PHY detected at address 7.xilinx_lltemac xilinx_lltemac.0: eth0: Xilinx TEMAC at 0x81C00000 mappedto 0xC3004000, irq=2console [netcon0] enablednetconsole: network logging startedGeneric platform RAM MTD, (c) 2004 Simtec Electronicsmice: PS/2 mouse device common for all miceTCP cubic registeredNET: Registered protocol family 1NET: Registered protocol family 17RPC: Registered udp transport module.RPC: Registered tcp transport module.eth0: XLlTemac: Options: 0x3faeth0: XLlTemac: allocating interrupt 0 for dma mode tx.eth0: XLlTemac: allocating interrupt 1 for dma mode rx.eth0: XLlTemac: speed set to 1000Mb/seth0: XLlTemac: Send Threshold = 24, Receive Threshold = 4eth0: XLlTemac: Send Wait bound = 254, Receive Wait bound = 254IP-Config: Complete: device=eth0, addr=192.168.0.4, mask=255.255.255.0, gw=192.168.0.3, host=192.168.0.4, domain=, nis-domain=(none), bootserver=192.168.0.3, rootserver=192.168.0.3, rootpath=Looking up port of RPC 100003/2 on 192.168.0.3rpcbind: server 192.168.0.3 not responding, timed outRoot-NFS: Unable to get nfsd port number from server, using defaultLooking up port of RPC 100005/1 on 192.168.0.3rpcbind: server 192.168.0.3 not responding, timed outRoot-NFS: Unable to get mountd port number from server, using defaultmount: server 192.168.0.3 not responding, timed outRoot-NFS: Server returned error -5 while mounting /home/mingliu/ml403_rootfsVFS: 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; here are the availablepartitions:Kernel panic - not syncing: VFS: Unable to mount root fs onunknown-block(2,0)Rebooting in 180 seconds.. BRMing
Windows Live Writer,支持离线撰写博客内容,随时随地想写就写。 立即使用!
_________________________________________________________________
Windows Live Photo gallery 数码相机的超级伴侣,轻松管理和编辑照片,还能制作全景美图!
http://get.live.cn/product/photo.html
[-- Attachment #2: Type: text/html, Size: 32977 bytes --]
^ permalink raw reply
* Re: Commits added to powerpc.git master/powerpc-next branches
From: Timur Tabi @ 2008-04-01 15:30 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <18418.5519.903340.966932@cargo.ozlabs.ibm.com>
Paul Mackerras wrote:
> I have updated the master and powerpc-next branches of the powerpc.git
> repository with the following commits, including some pulled from Josh
> Boyer and Kumar Gala.
How about this patch?
Enable CONFIG_FORCE_MAX_ZONEORDER for all PowerPC, and make selectable
--
Timur Tabi
Linux kernel developer at Freescale
^ permalink raw reply
* Re: Commits added to powerpc.git master/powerpc-next branches
From: Josh Boyer @ 2008-04-01 15:09 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <fa686aa40804010726h57cf1fc4hb25626b3888770ec@mail.gmail.com>
On Tue, 1 Apr 2008 08:26:17 -0600
"Grant Likely" <grant.likely@secretlab.ca> wrote:
> On Tue, Apr 1, 2008 at 6:05 AM, Josh Boyer <jwboyer@gmail.com> wrote:
> > On Tue, 2008-04-01 at 21:59 +1100, Paul Mackerras wrote:
> > > I have updated the master and powerpc-next branches of the powerpc.git
> > > repository with the following commits, including some pulled from Josh
> > > Boyer and Kumar Gala.
>
> Josh/Paul,
>
> Any thoughts on picking these two up?
>
> http://patchwork.ozlabs.org/linuxppc/patch?person=486&id=17479
> http://patchwork.ozlabs.org/linuxppc/patch?person=486&id=17410
I plan to stick those in my tree today. I didn't include them with the
first batch because those commits had been sitting around for a while
and wanted to get them into Paul' -next branch.
josh
^ permalink raw reply
* RE: xilinx Ml405 NFS mount problem
From: John Linn @ 2008-04-01 14:29 UTC (permalink / raw)
To: MingLiu, linuxppc-embedded
In-Reply-To: <BAY138-W7044A57F2CF37F5DB50F6B2F50@phx.gbl>
[-- Attachment #1: Type: text/plain, Size: 9588 bytes --]
Hi Ming,
It’s not obvious to me what the problem is as I don’t see any driver failures. Have you tried using a ramdisk and then seeing if the network is working before using NFS root?
And I’m assuming you have used the NFS root before so you know that it’s good for sure.
I test on the ML405 with NFS root and haven’t seen this problem, but my setup is a little different. I use DHCP rather than a static IP, but other than that it’s similar.
I’m assuming that you accidentally got 2 different powerup outputs in the message below as the 1st stops and a 2nd starts in the middle.
How long has it been since you pulled from the Xilinx Git tree?
Thanks,
John
________________________________
From: linuxppc-embedded-bounces+john.linn=xilinx.com@ozlabs.org [mailto:linuxppc-embedded-bounces+john.linn=xilinx.com@ozlabs.org] On Behalf Of MingLiu
Sent: Tuesday, April 01, 2008 8:12 AM
To: linuxppc-embedded@ozlabs.org
Subject: xilinx Ml405 NFS mount problem
Dear friends,
I am bringing up my kernel from Xilinx git tree. Unfortunately I met some
problem when mounting the root file system. Here is the information
listed. I will appreciate a lot if someone can help me out of the trouble.
Thanks a lot!
loaded at: 00400000 0059F19C
board data at: 0059D120 0059D19C
relocated to: 004050C8 00405144
zimage at: 00405F3F 0059C025
avail ram: 005A0000 08000000
Linux/PPC load: root=/dev/nfs
ip=192.168.0.4:192.168.0.3:192.168.0.3:255.255.255.0 rw
nfsroot=192.168.0.3:/home/mingliu/ml403_rootfs console=ttyUL0,38400
mem=32M
Uncompressing Linux...done.
Now booting the kernel
Linux version 2.6.24-rc8-xlnx-g1db182b8-dirty (mingliu@cca01) (gcc version
3.4.1) #7 Tue Apr 1 14:55:25 CEST 2008
Xilinx Generic PowerPC board support package (Xilinx ML405) (Virtex-4 FX)
Zone PFN ranges:
DMA 0 -> 8192
Normal 8192 -> 8192
HighMem 8192 -> 8192
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
0: 0 -> 8192
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 8128
Kernel command line: root=/dev/nfs
ip=192.168.0.4:192.168.0.3:192.168.0.3:255.255.255.0 rw
nfsroot=192.168.0.3:/home/mingliu/ml403_rootfs console=ttyUL0,38400
mem=32M
Xilinx INTC #0 at 0x81800000 mapped to 0xFDFFF000
PID hash table entries: 128 (order: 7, 512 bytes)
Console: colour dummy device 80x25
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 28884k available (2552k kernel code, 944k data, 84k init, 0k highmem)
SLUB: Genslabs=11, HWalign=32, Order=0-1, MinObjects=4, CPUs=1, Nodes=1
Mount-cache hash table entries: 512
net_namespace: 64 bytes
NET: Registered protocol family 16
Registering device uartlite:0
Fixup MAC address for xilinx_lltemac:0
Registering device xilinx_lltemac:0
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP reno registered
sysctl table check failed: /kernel/l2cr .1.31 Missing strategy
Call Trace:
[c1c0fe50] [c0008b70] show_stack+0x40/0x194 (unreliable)
[c1c0fe90] [c003aed4] set_fail+0x68/0x80
[c1c0feb0] [c003b4ec] sysctl_check_table+0x600/0x77c
[c1c0fef0] [c003b4d4] sysctl_check_table+0x5e8/0x77c
[c1c0ff30] [c002605c] register_sysctl_table+0x64/0xb4
[c1c0ff50] [c034579c] register_ppc_htab_sysctl+0x18/0x2c
[c1c0ff60] [c034482c] kernel_init+0x94/0x2bc
[c1c0fff0] [c0004d58] kernel_thread+0x44/0x60
Installing knfsd (copyright (C) 1996 okir@monad.swb.de <https://webmail.sys.kth.se/src/compose.php?send_to=okir%40monad.swb.de> ).
fuse init (API version 7.9)
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
uartlite.0: ttyUL0 at MMIO 0x84000003 (irq = 3) is a uartlite
console [ttyUL0] enabled
loop: module loaded
nbd: registered device at major 43
xilinx_lltemac xilinx_lltemac.0: MAC address is now 0: a:35: 1: 2: 3
xilinx_lltemac xilinx_lltemac.0: XLlTemac: using DMA mode.
XLlTemac: Dma base address: phy: 0x84600100, virt: 0xc3008100
XLlTemac: buffer descriptor size: 32768 (0x8000)
XLlTemac: Allocating DMA descriptors with kmalloc<6>XLlTemac:
(buffer_descriptor_init) phy: 0x1d18000, virt: 0xc1d18000, size: 0x8000
XTemac: PHY detected at address 7.
xilinx_lltemac xilinx_lltemac.0: eth0: Xilinx TEMAC at 0x81C00000 mapped
to 0xC3004000, irq=2
console [netcon0] enabled
Linux version 2.6.24-rc8-xlnx-g1db182b8-dirty (mingliu@cca01) (gcc version
3.4.1) #7 Tue Apr 1 14:55:25 CEST 2008
Xilinx Generic PowerPC board support package (Xilinx ML405) (Virtex-4 FX)
Zone PFN ranges:
DMA 0 -> 8192
Normal 8192 -> 8192
HighMem 8192 -> 8192
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
0: 0 -> 8192
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 8128
Kernel command line: root=/dev/nfs
ip=192.168.0.4:192.168.0.3:192.168.0.3:255.255.255.0 rw
nfsroot=192.168.0.3:/home/mingliu/ml403_rootfs console=ttyUL0,38400
mem=32M
Xilinx INTC #0 at 0x81800000 mapped to 0xFDFFF000
PID hash table entries: 128 (order: 7, 512 bytes)
Console: colour dummy device 80x25
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 28884k available (2552k kernel code, 944k data, 84k init, 0k highmem)
SLUB: Genslabs=11, HWalign=32, Order=0-1, MinObjects=4, CPUs=1, Nodes=1
Mount-cache hash table entries: 512
net_namespace: 64 bytes
NET: Registered protocol family 16
Registering device uartlite:0
Fixup MAC address for xilinx_lltemac:0
Registering device xilinx_lltemac:0
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP reno registered
sysctl table check failed: /kernel/l2cr .1.31 Missing strategy
Call Trace:
[c1c0fe50] [c0008b70] show_stack+0x40/0x194 (unreliable)
[c1c0fe90] [c003aed4] set_fail+0x68/0x80
[c1c0feb0] [c003b4ec] sysctl_check_table+0x600/0x77c
[c1c0fef0] [c003b4d4] sysctl_check_table+0x5e8/0x77c
[c1c0ff30] [c002605c] register_sysctl_table+0x64/0xb4
[c1c0ff50] [c034579c] register_ppc_htab_sysctl+0x18/0x2c
[c1c0ff60] [c034482c] kernel_init+0x94/0x2bc
[c1c0fff0] [c0004d58] kernel_thread+0x44/0x60
Installing knfsd (copyright (C) 1996 okir@monad.swb.de <https://webmail.sys.kth.se/src/compose.php?send_to=okir%40monad.swb.de> ).
fuse init (API version 7.9)
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
uartlite.0: ttyUL0 at MMIO 0x84000003 (irq = 3) is a uartlite
console [ttyUL0] enabled
loop: module loaded
nbd: registered device at major 43
xilinx_lltemac xilinx_lltemac.0: MAC address is now 0: a:35: 1: 2: 3
xilinx_lltemac xilinx_lltemac.0: XLlTemac: using DMA mode.
XLlTemac: Dma base address: phy: 0x84600100, virt: 0xc3008100
XLlTemac: buffer descriptor size: 32768 (0x8000)
XLlTemac: Allocating DMA descriptors with kmalloc<6>XLlTemac:
(buffer_descriptor_init) phy: 0x1d18000, virt: 0xc1d18000, size: 0x8000
XTemac: PHY detected at address 7.
xilinx_lltemac xilinx_lltemac.0: eth0: Xilinx TEMAC at 0x81C00000 mapped
to 0xC3004000, irq=2
console [netcon0] enabled
netconsole: network logging started
Generic platform RAM MTD, (c) 2004 Simtec Electronics
mice: PS/2 mouse device common for all mice
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
eth0: XLlTemac: Options: 0x3fa
eth0: XLlTemac: allocating interrupt 0 for dma mode tx.
eth0: XLlTemac: allocating interrupt 1 for dma mode rx.
eth0: XLlTemac: speed set to 1000Mb/s
eth0: XLlTemac: Send Threshold = 24, Receive Threshold = 4
eth0: XLlTemac: Send Wait bound = 254, Receive Wait bound = 254
IP-Config: Complete:
device=eth0, addr=192.168.0.4, mask=255.255.255.0, gw=192.168.0.3,
host=192.168.0.4, domain=, nis-domain=(none),
bootserver=192.168.0.3, rootserver=192.168.0.3, rootpath=
Looking up port of RPC 100003/2 on 192.168.0.3
rpcbind: server 192.168.0.3 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.0.3
rpcbind: server 192.168.0.3 not responding, timed out
Root-NFS: Unable to get mountd port number from server, using default
mount: server 192.168.0.3 not responding, timed out
Root-NFS: Server returned error -5 while mounting /home/mingliu/ml403_rootfs
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; here are the available
partitions:
Kernel panic - not syncing: VFS: Unable to mount root fs on
unknown-block(2,0)
Rebooting in 180 seconds..
BR
Ming
________________________________
Windows Live Writer,支持离线撰写博客内容,随时随地想写就写。 立即使用! <http://get.live.cn/product/writer.html>
[-- Attachment #2: Type: text/html, Size: 38864 bytes --]
^ permalink raw reply
* Re: Commits added to powerpc.git master/powerpc-next branches
From: Grant Likely @ 2008-04-01 14:26 UTC (permalink / raw)
To: Josh Boyer; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <1207051543.12155.91.camel@vader.jdub.homelinux.org>
On Tue, Apr 1, 2008 at 6:05 AM, Josh Boyer <jwboyer@gmail.com> wrote:
> On Tue, 2008-04-01 at 21:59 +1100, Paul Mackerras wrote:
> > I have updated the master and powerpc-next branches of the powerpc.git
> > repository with the following commits, including some pulled from Josh
> > Boyer and Kumar Gala.
Josh/Paul,
Any thoughts on picking these two up?
http://patchwork.ozlabs.org/linuxppc/patch?person=486&id=17479
http://patchwork.ozlabs.org/linuxppc/patch?person=486&id=17410
Thanks,
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
* xilinx Ml405 NFS mount problem
From: MingLiu @ 2008-04-01 14:11 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 8191 bytes --]
Dear friends,I am bringing up my kernel from Xilinx git tree. Unfortunately I met some
problem when mounting the root file system. Here is the information
listed. I will appreciate a lot if someone can help me out of the trouble.
Thanks a lot!
loaded at: 00400000 0059F19C
board data at: 0059D120 0059D19C
relocated to: 004050C8 00405144
zimage at: 00405F3F 0059C025
avail ram: 005A0000 08000000
Linux/PPC load: root=/dev/nfs
ip=192.168.0.4:192.168.0.3:192.168.0.3:255.255.255.0 rw
nfsroot=192.168.0.3:/home/mingliu/ml403_rootfs console=ttyUL0,38400
mem=32M
Uncompressing Linux...done.
Now booting the kernel
Linux version 2.6.24-rc8-xlnx-g1db182b8-dirty (mingliu@cca01) (gcc version
3.4.1) #7 Tue Apr 1 14:55:25 CEST 2008
Xilinx Generic PowerPC board support package (Xilinx ML405) (Virtex-4 FX)
Zone PFN ranges:
DMA 0 -> 8192
Normal 8192 -> 8192
HighMem 8192 -> 8192
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
0: 0 -> 8192
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 8128
Kernel command line: root=/dev/nfs
ip=192.168.0.4:192.168.0.3:192.168.0.3:255.255.255.0 rw
nfsroot=192.168.0.3:/home/mingliu/ml403_rootfs console=ttyUL0,38400
mem=32M
Xilinx INTC #0 at 0x81800000 mapped to 0xFDFFF000
PID hash table entries: 128 (order: 7, 512 bytes)
Console: colour dummy device 80x25
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 28884k available (2552k kernel code, 944k data, 84k init, 0k highmem)
SLUB: Genslabs=11, HWalign=32, Order=0-1, MinObjects=4, CPUs=1, Nodes=1
Mount-cache hash table entries: 512
net_namespace: 64 bytes
NET: Registered protocol family 16
Registering device uartlite:0
Fixup MAC address for xilinx_lltemac:0
Registering device xilinx_lltemac:0
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP reno registered
sysctl table check failed: /kernel/l2cr .1.31 Missing strategy
Call Trace:
[c1c0fe50] [c0008b70] show_stack+0x40/0x194 (unreliable)
[c1c0fe90] [c003aed4] set_fail+0x68/0x80
[c1c0feb0] [c003b4ec] sysctl_check_table+0x600/0x77c
[c1c0fef0] [c003b4d4] sysctl_check_table+0x5e8/0x77c
[c1c0ff30] [c002605c] register_sysctl_table+0x64/0xb4
[c1c0ff50] [c034579c] register_ppc_htab_sysctl+0x18/0x2c
[c1c0ff60] [c034482c] kernel_init+0x94/0x2bc
[c1c0fff0] [c0004d58] kernel_thread+0x44/0x60
Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
fuse init (API version 7.9)
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
uartlite.0: ttyUL0 at MMIO 0x84000003 (irq = 3) is a uartlite
console [ttyUL0] enabled
loop: module loaded
nbd: registered device at major 43
xilinx_lltemac xilinx_lltemac.0: MAC address is now 0: a:35: 1: 2: 3
xilinx_lltemac xilinx_lltemac.0: XLlTemac: using DMA mode.
XLlTemac: Dma base address: phy: 0x84600100, virt: 0xc3008100
XLlTemac: buffer descriptor size: 32768 (0x8000)
XLlTemac: Allocating DMA descriptors with kmalloc<6>XLlTemac:
(buffer_descriptor_init) phy: 0x1d18000, virt: 0xc1d18000, size: 0x8000
XTemac: PHY detected at address 7.
xilinx_lltemac xilinx_lltemac.0: eth0: Xilinx TEMAC at 0x81C00000 mapped
to 0xC3004000, irq=2
console [netcon0] enabled
Linux version 2.6.24-rc8-xlnx-g1db182b8-dirty (mingliu@cca01) (gcc version
3.4.1) #7 Tue Apr 1 14:55:25 CEST 2008
Xilinx Generic PowerPC board support package (Xilinx ML405) (Virtex-4 FX)
Zone PFN ranges:
DMA 0 -> 8192
Normal 8192 -> 8192
HighMem 8192 -> 8192
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
0: 0 -> 8192
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 8128
Kernel command line: root=/dev/nfs
ip=192.168.0.4:192.168.0.3:192.168.0.3:255.255.255.0 rw
nfsroot=192.168.0.3:/home/mingliu/ml403_rootfs console=ttyUL0,38400
mem=32M
Xilinx INTC #0 at 0x81800000 mapped to 0xFDFFF000
PID hash table entries: 128 (order: 7, 512 bytes)
Console: colour dummy device 80x25
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 28884k available (2552k kernel code, 944k data, 84k init, 0k highmem)
SLUB: Genslabs=11, HWalign=32, Order=0-1, MinObjects=4, CPUs=1, Nodes=1
Mount-cache hash table entries: 512
net_namespace: 64 bytes
NET: Registered protocol family 16
Registering device uartlite:0
Fixup MAC address for xilinx_lltemac:0
Registering device xilinx_lltemac:0
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP reno registered
sysctl table check failed: /kernel/l2cr .1.31 Missing strategy
Call Trace:
[c1c0fe50] [c0008b70] show_stack+0x40/0x194 (unreliable)
[c1c0fe90] [c003aed4] set_fail+0x68/0x80
[c1c0feb0] [c003b4ec] sysctl_check_table+0x600/0x77c
[c1c0fef0] [c003b4d4] sysctl_check_table+0x5e8/0x77c
[c1c0ff30] [c002605c] register_sysctl_table+0x64/0xb4
[c1c0ff50] [c034579c] register_ppc_htab_sysctl+0x18/0x2c
[c1c0ff60] [c034482c] kernel_init+0x94/0x2bc
[c1c0fff0] [c0004d58] kernel_thread+0x44/0x60
Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
fuse init (API version 7.9)
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
uartlite.0: ttyUL0 at MMIO 0x84000003 (irq = 3) is a uartlite
console [ttyUL0] enabled
loop: module loaded
nbd: registered device at major 43
xilinx_lltemac xilinx_lltemac.0: MAC address is now 0: a:35: 1: 2: 3
xilinx_lltemac xilinx_lltemac.0: XLlTemac: using DMA mode.
XLlTemac: Dma base address: phy: 0x84600100, virt: 0xc3008100
XLlTemac: buffer descriptor size: 32768 (0x8000)
XLlTemac: Allocating DMA descriptors with kmalloc<6>XLlTemac:
(buffer_descriptor_init) phy: 0x1d18000, virt: 0xc1d18000, size: 0x8000
XTemac: PHY detected at address 7.
xilinx_lltemac xilinx_lltemac.0: eth0: Xilinx TEMAC at 0x81C00000 mapped
to 0xC3004000, irq=2
console [netcon0] enabled
netconsole: network logging started
Generic platform RAM MTD, (c) 2004 Simtec Electronics
mice: PS/2 mouse device common for all mice
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
eth0: XLlTemac: Options: 0x3fa
eth0: XLlTemac: allocating interrupt 0 for dma mode tx.
eth0: XLlTemac: allocating interrupt 1 for dma mode rx.
eth0: XLlTemac: speed set to 1000Mb/s
eth0: XLlTemac: Send Threshold = 24, Receive Threshold = 4
eth0: XLlTemac: Send Wait bound = 254, Receive Wait bound = 254
IP-Config: Complete:
device=eth0, addr=192.168.0.4, mask=255.255.255.0, gw=192.168.0.3,
host=192.168.0.4, domain=, nis-domain=(none),
bootserver=192.168.0.3, rootserver=192.168.0.3, rootpath=
Looking up port of RPC 100003/2 on 192.168.0.3
rpcbind: server 192.168.0.3 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.0.3
rpcbind: server 192.168.0.3 not responding, timed out
Root-NFS: Unable to get mountd port number from server, using default
mount: server 192.168.0.3 not responding, timed out
Root-NFS: Server returned error -5 while mounting /home/mingliu/ml403_rootfs
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; here are the available
partitions:
Kernel panic - not syncing: VFS: Unable to mount root fs on
unknown-block(2,0)
Rebooting in 180 seconds..
BR
Ming
_________________________________________________________________
用手机MSN聊天写邮件看空间,无限沟通,分享精彩!
http://mobile.msn.com.cn/
[-- Attachment #2: Type: text/html, Size: 8675 bytes --]
^ permalink raw reply
* [PATCH] [POWERPC] 4xx: Fix PESDRn_UTLSET1 register setup on 460EX/GT
From: Stefan Roese @ 2008-04-01 13:45 UTC (permalink / raw)
To: linuxppc-dev
The patch fixes a bug, where the PESDRn_UTLSET1 register was setup
wrongly resulting in a non working PCIe port 1. With this fix both
PCIe ports work fine again.
Signed-off-by: Stefan Roese <sr@denx.de>
---
Based upon linux-next repo from 2008-03-31
arch/powerpc/sysdev/ppc4xx_pci.c | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/arch/powerpc/sysdev/ppc4xx_pci.c b/arch/powerpc/sysdev/ppc4xx_pci.c
index 6c925b7..efaf4c4 100644
--- a/arch/powerpc/sysdev/ppc4xx_pci.c
+++ b/arch/powerpc/sysdev/ppc4xx_pci.c
@@ -785,19 +785,17 @@ static int ppc460ex_pciex_init_port_hw(struct ppc4xx_pciex_port *port)
u32 val;
u32 utlset1;
- if (port->endpoint) {
+ if (port->endpoint)
val = PTYPE_LEGACY_ENDPOINT << 20;
- utlset1 = 0x20222222;
- } else {
+ else
val = PTYPE_ROOT_PORT << 20;
- utlset1 = 0x21222222;
- }
if (port->index == 0) {
val |= LNKW_X1 << 12;
+ utlset1 = 0x20000000;
} else {
val |= LNKW_X4 << 12;
- utlset1 |= 0x00101101;
+ utlset1 = 0x20101101;
}
mtdcri(SDR0, port->sdr_base + PESDRn_DLPSET, val);
--
1.5.4.5
^ permalink raw reply related
* Re: [PATCH] Make #include <sysdev/foo.h> work for 64-bit powerpc
From: Kumar Gala @ 2008-04-01 13:18 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: linuxppc-dev
In-Reply-To: <20080401175442.bf0d0c34.sfr@canb.auug.org.au>
On Apr 1, 2008, at 1:54 AM, Stephen Rothwell wrote:
> Hi Michael,
>
> On Tue, 1 Apr 2008 17:39:11 +1100 (EST) Michael Ellerman <michael@ellerman.id.au
> > wrote:
>>
>> We currently have inconsistent settings between 32 & 64-bit which
>> means
>> 32-bit code can #include <sysdev/foo.h> but 64-bit code can't.
>
> Kumar sent a very similar (if not identical) patch earlier today.
I actually sent it several days ago, but reposted as part of the
series of work I was doing. ;)
- k
^ permalink raw reply
* Re: [PATCHv2] powerpc: Describe memory-mapped RAM&ROM chips OF bindings
From: Grant Likely @ 2008-04-01 13:16 UTC (permalink / raw)
To: Laurent Pinchart; +Cc: ben, linuxppc-dev, linux-mtd, David Gibson
In-Reply-To: <200803311839.10519.laurentp@cse-semaphore.com>
On Mon, Mar 31, 2008 at 10:39 AM, Laurent Pinchart
<laurentp@cse-semaphore.com> wrote:
>
> Signed-off-by: Laurent Pinchart <laurentp@cse-semaphore.com>
> ---
> Documentation/powerpc/booting-without-of.txt | 13 ++++++++++++-
> 1 files changed, 12 insertions(+), 1 deletions(-)
>
> diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt
> index 7b4e8a7..3e1963b 100644
> --- a/Documentation/powerpc/booting-without-of.txt
> +++ b/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) Memory-mapped RAM & ROM
>
> VII - Specifying interrupt information for devices
> 1) interrupts property
> @@ -2816,6 +2817,16 @@ platforms are moved over to use the flattened-device-tree model.
> big-endian;
> };
>
> + r) Memory-mapped RAM & ROM
> +
> + Dedicated RAM and ROM chips are often used as storage for temporary or
> + permanent data in embedded devices. Possible usage include non-volatile
> + storage in battery-backed SRAM, semi-permanent storage in dedicated SRAM
> + to preserve data accross reboots and firmware storage in dedicated ROM.
> +
> + - name : should be either "ram" or "rom"
> + - reg : Address range of the RAM/ROM chip
> +
No compatible prop? How does the OS know what the node is to be used for?
Cheers,
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
* [PATCH] RTAS - adapt procfs interface
From: Jens Osterkamp @ 2008-04-01 13:12 UTC (permalink / raw)
To: Paul Mackerras; +Cc: maxim, linuxppc-dev, cbe-oss-dev
Hi,
rtas_flash was broken since 2.6.24-rc5. This patch fixes it.
I think this is a good bugfix candidate for 2.6.25.
Jens
---
From: Maxim Shchetynin <maxim@de.ibm.com>
Handling of the proc_dir_entry->count has being changed in 2.6.24-rc5.
After this change the default value for pde->count is 1 and not 0 as it
was in earlier kernels. Therefore, if we want to check wether our procfs
file is already opened (already in use), we have to check if pde->count
is not greater than 2 but not 1.
Signed-off-by: Maxim Shchetynin <maxim@de.ibm.com>
Signed-off-by: Jens Osterkamp <jens@de.ibm.com>
Index: linux-2.6/arch/powerpc/kernel/rtas_flash.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/rtas_flash.c
+++ linux-2.6/arch/powerpc/kernel/rtas_flash.c
@@ -356,7 +356,7 @@ static int rtas_excl_open(struct inode *
/* Enforce exclusive open with use count of PDE */
spin_lock(&flash_file_open_lock);
- if (atomic_read(&dp->count) > 1) {
+ if (atomic_read(&dp->count) > 2) {
spin_unlock(&flash_file_open_lock);
return -EBUSY;
}
^ permalink raw reply
* Re: [PATCHv2] powerpc: Describe memory-mapped RAM&ROM chips OF bindings
From: Sergei Shtylyov @ 2008-04-01 13:04 UTC (permalink / raw)
To: Laurent Pinchart; +Cc: linuxppc-dev, MTD mailing list, Trent Piepho
In-Reply-To: <200804011439.04905.laurentp@cse-semaphore.com>
Laurent Pinchart wrote:
>>>On Monday 31 March 2008 19:06, Sergei Shtylyov wrote:
>>>>> p) Freescale Synchronous Serial Interface
>>>>>- q) USB EHCI controllers
>>>>>+ q) USB EHCI controllers
>>>>>+ r) Memory-mapped RAM & ROM
>>>> Memory-mapped RA/RO Memory again? Should better drop this. :-)
>>>You're quite picky, aren't you ? :-)
>>>I suppose "Memory-mapped RA & RO" won't be accepted, so what about "Auxiliary
>>>RAM & ROM" ?
>>Direct-mapped?
> Fine with me. Sergei ?
I agree. The only thing that somewhat worries me it that it will have no
"compatible" prop...
WBR, Sergei
^ permalink raw reply
* Re: [PATCHv2] powerpc: Describe memory-mapped RAM&ROM chips OF bindings
From: Laurent Pinchart @ 2008-04-01 12:39 UTC (permalink / raw)
To: Trent Piepho; +Cc: linuxppc-dev, MTD mailing list
In-Reply-To: <Pine.LNX.4.64.0804010217470.3571@t2.domain.actdsltmp>
On Tuesday 01 April 2008 11:18, Trent Piepho wrote:
> On Tue, 1 Apr 2008, Laurent Pinchart wrote:
> > On Monday 31 March 2008 19:06, Sergei Shtylyov wrote:
> >>> p) Freescale Synchronous Serial Interface
> >>> - q) USB EHCI controllers
> >>> + q) USB EHCI controllers
> >>> + r) Memory-mapped RAM & ROM
> >>
> >> Memory-mapped RA/RO Memory again? Should better drop this. :-)
> >
> > You're quite picky, aren't you ? :-)
> >
> > I suppose "Memory-mapped RA & RO" won't be accepted, so what about "Aux=
iliary
> > RAM & ROM" ?
>=20
> Direct-mapped?
=46ine with me. Sergei ?
=2D-=20
Laurent Pinchart
CSE Semaphore Belgium
Chauss=E9e de Bruxelles, 732A
B-1410 Waterloo
Belgium
T +32 (2) 387 42 59
=46 +32 (2) 387 42 75
^ permalink raw reply
* Re: Please pull linux-2.6-mpc52xx.git
From: Bartlomiej Sieka @ 2008-04-01 12:37 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-dev
In-Reply-To: <fa686aa40803251151p457a2295w449222654be4d0d1@mail.gmail.com>
Hi Grant,
Grant Likely wrote:
> On Tue, Mar 25, 2008 at 11:38 AM, Bartlomiej Sieka <tur@semihalf.com> wrote:
>> Grant Likely wrote:
>> > The one part that I have a really strong opinion on is that there
>> > should be a full featured mpc5200 defconfig for build testing. Beyond
>> > that (and if ojn can also be appeased) I can probably be convinced. :-)
>>
>> Hi Grant,
>>
>> How to deal with a situation where I need a particular PHY driver from
>> libphy compiled in the kernel for one of the MPC5200 boards? Adding it
>> to mpc5200_defconfig doesn't seem like a right thing to do.
>
> Why not? mpc5200_defconfig is all about compile and runtime testing
> on many platforms to make sure drivers play well together. I have no
> problem adding more drivers to the mpc5200 defconfig. (In fact, I
> encourage it).
>
>> How to
>> convince you (and appease ojn) to accept a patch that adds a
>> board-specific defconfig that only slightly differs from
>> mpc5200_defconfig? :)
>
> I'm thinking 'optimized' defconfigs should go into a subdirectory.
This requires a change to the top-level Makefile and shepherding this
change upstream. Could we perhaps try to avoid this by having optimized
defconfigs in the form of, for example:
arch/powerpc/configs/tqm5200_opt_defconfig
arch/powerpc/configs/motionpro_opt_defconfig
Or, to signify what is the base defconfig:
arch/powerpc/configs/mpc5200_tqm5200_defconfig
arch/powerpc/configs/mpc5200_motionpro_defconfig
or even:
arch/powerpc/configs/mpc5200_opt_tqm5200_defconfig
arch/powerpc/configs/mpc5200_opt_motionpro_defconfig
Would patch adding an optimized _defconfig along these lines be accepted?
Regards,
Bartlomiej
^ permalink raw reply
* [PATCHv4 4/5] ep8248e: Reference SMC parameter RAM base in the device tree.
From: Laurent Pinchart @ 2008-04-01 12:35 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Scott Wood
In-Reply-To: <200804011433.29841.laurentp@cse-semaphore.com>
[-- Attachment #1: Type: text/plain, Size: 1456 bytes --]
This patch modifies the Embedded Planet EP8248E device tree to reference the
SMC paramater RAM base register instead of the parameter RAM allocated by the
boot loader.
The cpm_uart driver will allocate parameter RAM itself, making the serial port
initialisation independent of the boot loader.
The patch adds the parameter RAM allocated by the boot loader in the CPM muram
node, making it available to the kernel.
Signed-off-by: Laurent Pinchart <laurentp@cse-semaphore.com>
---
arch/powerpc/boot/dts/ep8248e.dts | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/boot/dts/ep8248e.dts b/arch/powerpc/boot/dts/ep8248e.dts
index 5d2fb76..756758f 100644
--- a/arch/powerpc/boot/dts/ep8248e.dts
+++ b/arch/powerpc/boot/dts/ep8248e.dts
@@ -121,8 +121,7 @@
data@0 {
compatible = "fsl,cpm-muram-data";
- reg = <0 0x1100 0x1140
- 0xec0 0x9800 0x800>;
+ reg = <0 0x2000 0x9800 0x800>;
};
};
@@ -138,7 +137,7 @@
device_type = "serial";
compatible = "fsl,mpc8248-smc-uart",
"fsl,cpm2-smc-uart";
- reg = <0x11a80 0x20 0x1100 0x40>;
+ reg = <0x11a80 0x20 0x87fc 2>;
interrupts = <4 8>;
interrupt-parent = <&PIC>;
fsl,cpm-brg = <7>;
--
1.5.0
--
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 related
* [PATCHv4 5/5] cpm2: Reset the CPM when early debugging is not enabled.
From: Laurent Pinchart @ 2008-04-01 12:35 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Scott Wood
In-Reply-To: <200804011433.29841.laurentp@cse-semaphore.com>
[-- Attachment #1: Type: text/plain, Size: 1046 bytes --]
Similarly to what is done for PQ1-based platforms, this patch resets the
PQ2 Communication Processor Module in cpm2_reset() when early debugging is
not enabled. This helps avoiding conflicts when the boot loader configured
the CPM in an unexpected way.
Signed-off-by: Laurent Pinchart <laurentp@cse-semaphore.com>
---
arch/powerpc/sysdev/cpm2.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/sysdev/cpm2.c b/arch/powerpc/sysdev/cpm2.c
index 7be7112..57ed1a4 100644
--- a/arch/powerpc/sysdev/cpm2.c
+++ b/arch/powerpc/sysdev/cpm2.c
@@ -80,6 +80,12 @@ void __init cpm2_reset(void)
/* Tell everyone where the comm processor resides.
*/
cpmp = &cpm2_immr->im_cpm;
+
+#ifndef CONFIG_PPC_EARLY_DEBUG_CPM
+ /* Reset the CPM.
+ */
+ cpm_command(CPM_CR_RST, 0);
+#endif
}
static DEFINE_SPINLOCK(cmd_lock);
--
1.5.0
--
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 related
* [PATCHv4 3/5] cpm-serial: Relocate CPM buffer descriptors and SMC parameter ram.
From: Laurent Pinchart @ 2008-04-01 12:34 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Scott Wood
In-Reply-To: <200804011433.29841.laurentp@cse-semaphore.com>
[-- Attachment #1: Type: text/plain, Size: 5492 bytes --]
This patch relocates the buffer descriptors and the SMC parameter RAM at the
end of the first CPM muram chunk, as described in the device tree. This allows
device trees to stop excluding SMC parameter ram allocated by the boot loader
from the CPM muram node.
Signed-off-by: Laurent Pinchart <laurentp@cse-semaphore.com>
---
arch/powerpc/Kconfig.debug | 2 +-
arch/powerpc/boot/cpm-serial.c | 89 ++++++++++++++++++++++++++++++---------
2 files changed, 69 insertions(+), 22 deletions(-)
diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
index db7cc34..a86d8d8 100644
--- a/arch/powerpc/Kconfig.debug
+++ b/arch/powerpc/Kconfig.debug
@@ -269,7 +269,7 @@ config PPC_EARLY_DEBUG_CPM_ADDR
hex "CPM UART early debug transmit descriptor address"
depends on PPC_EARLY_DEBUG_CPM
default "0xfa202008" if PPC_EP88XC
- default "0xf0000008" if CPM2
+ default "0xf0001ff8" if CPM2
default "0xff002008" if CPM1
help
This specifies the address of the transmit descriptor
diff --git a/arch/powerpc/boot/cpm-serial.c b/arch/powerpc/boot/cpm-serial.c
index 1f6225a..19dc15a 100644
--- a/arch/powerpc/boot/cpm-serial.c
+++ b/arch/powerpc/boot/cpm-serial.c
@@ -11,6 +11,7 @@
#include "types.h"
#include "io.h"
#include "ops.h"
+#include "page.h"
struct cpm_scc {
u32 gsmrl;
@@ -42,6 +43,22 @@ struct cpm_param {
u16 tbase;
u8 rfcr;
u8 tfcr;
+ u16 mrblr;
+ u32 rstate;
+ u8 res1[4];
+ u16 rbptr;
+ u8 res2[6];
+ u32 tstate;
+ u8 res3[4];
+ u16 tbptr;
+ u8 res4[6];
+ u16 maxidl;
+ u16 idlc;
+ u16 brkln;
+ u16 brkec;
+ u16 brkcr;
+ u16 rmask;
+ u8 res5[4];
};
struct cpm_bd {
@@ -54,10 +71,10 @@ static void *cpcr;
static struct cpm_param *param;
static struct cpm_smc *smc;
static struct cpm_scc *scc;
-struct cpm_bd *tbdf, *rbdf;
+static struct cpm_bd *tbdf, *rbdf;
static u32 cpm_cmd;
-static u8 *muram_start;
-static u32 muram_offset;
+static void *cbd_addr;
+static u32 cbd_offset;
static void (*do_cmd)(int op);
static void (*enable_port)(void);
@@ -119,20 +136,25 @@ static int cpm_serial_open(void)
out_8(¶m->rfcr, 0x10);
out_8(¶m->tfcr, 0x10);
-
- rbdf = (struct cpm_bd *)muram_start;
- rbdf->addr = (u8 *)(rbdf + 2);
+ out_be16(¶m->mrblr, 1);
+ out_be16(¶m->maxidl, 0);
+ out_be16(¶m->brkec, 0);
+ out_be16(¶m->brkln, 0);
+ out_be16(¶m->brkcr, 0);
+
+ rbdf = cbd_addr;
+ rbdf->addr = (u8 *)rbdf - 1;
rbdf->sc = 0xa000;
rbdf->len = 1;
tbdf = rbdf + 1;
- tbdf->addr = (u8 *)(rbdf + 2) + 1;
+ tbdf->addr = (u8 *)rbdf - 2;
tbdf->sc = 0x2000;
tbdf->len = 1;
sync();
- out_be16(¶m->rbase, muram_offset);
- out_be16(¶m->tbase, muram_offset + sizeof(struct cpm_bd));
+ out_be16(¶m->rbase, cbd_offset);
+ out_be16(¶m->tbase, cbd_offset + sizeof(struct cpm_bd));
do_cmd(CPM_CMD_INIT_RX_TX);
@@ -175,9 +197,12 @@ static unsigned char cpm_serial_getc(void)
int cpm_console_init(void *devp, struct serial_console_data *scdp)
{
- void *reg_virt[2];
- int is_smc = 0, is_cpm2 = 0, n;
+ void *vreg[2];
+ u32 reg[2];
+ int is_smc = 0, is_cpm2 = 0;
void *parent, *muram;
+ void *muram_addr;
+ unsigned long muram_offset, muram_size;
if (dt_is_compatible(devp, "fsl,cpm1-smc-uart")) {
is_smc = 1;
@@ -201,19 +226,18 @@ int cpm_console_init(void *devp, struct serial_console_data *scdp)
else
do_cmd = cpm1_cmd;
- n = getprop(devp, "fsl,cpm-command", &cpm_cmd, 4);
- if (n < 4)
+ if (getprop(devp, "fsl,cpm-command", &cpm_cmd, 4) < 4)
return -1;
- if (dt_get_virtual_reg(devp, reg_virt, 2) < 2)
+ if (dt_get_virtual_reg(devp, vreg, 2) < 2)
return -1;
if (is_smc)
- smc = reg_virt[0];
+ smc = vreg[0];
else
- scc = reg_virt[0];
+ scc = vreg[0];
- param = reg_virt[1];
+ param = vreg[1];
parent = get_parent(devp);
if (!parent)
@@ -227,17 +251,40 @@ int cpm_console_init(void *devp, struct serial_console_data *scdp)
return -1;
/* For bootwrapper-compatible device trees, we assume that the first
- * entry has at least 18 bytes, and that #address-cells/#data-cells
+ * entry has at least 128 bytes, and that #address-cells/#data-cells
* is one for both parent and child.
*/
- if (dt_get_virtual_reg(muram, (void **)&muram_start, 1) < 1)
+ if (dt_get_virtual_reg(muram, &muram_addr, 1) < 1)
return -1;
- n = getprop(muram, "reg", &muram_offset, 4);
- if (n < 4)
+ if (getprop(muram, "reg", reg, 8) < 8)
return -1;
+ muram_offset = reg[0];
+ muram_size = reg[1];
+
+ /* Store the buffer descriptors at the end of the first muram chunk.
+ * For SMC ports on CPM2-based platforms, relocate the parameter RAM
+ * just before the buffer descriptors.
+ */
+
+ cbd_offset = muram_offset + muram_size - 2 * sizeof(struct cpm_bd);
+
+ if (is_cpm2 && is_smc) {
+ u16 *smc_base = (u16 *)param;
+ u16 pram_offset;
+
+ pram_offset = cbd_offset - 64;
+ pram_offset = _ALIGN_DOWN(pram_offset, 64);
+
+ disable_port();
+ out_be16(smc_base, pram_offset);
+ param = muram_addr - muram_offset + pram_offset;
+ }
+
+ cbd_addr = muram_addr - muram_offset + cbd_offset;
+
scdp->open = cpm_serial_open;
scdp->putc = cpm_serial_putc;
scdp->getc = cpm_serial_getc;
--
1.5.0
--
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 related
* [PATCHv4 2/5] powerpc: Add bootwrapper function to get virtual reg from the device tree.
From: Laurent Pinchart @ 2008-04-01 12:34 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Scott Wood
In-Reply-To: <200804011433.29841.laurentp@cse-semaphore.com>
[-- Attachment #1: Type: text/plain, Size: 5502 bytes --]
This patch adds a new generic device tree processing function that retrieves
virtual reg addresses from the device tree to the bootwrapper code. It also
updates the bootwrapper code to use the new function.
dt_get_virtual_reg() retrieves the virtual reg addresses from the
"virtual-reg" property. If the property can't be found, it uses the "reg"
property and walks the tree to translate it to absolute addresses.
Signed-off-by: Laurent Pinchart <laurentp@cse-semaphore.com>
---
arch/powerpc/boot/cpm-serial.c | 34 ++++++----------------------------
arch/powerpc/boot/devtree.c | 20 ++++++++++++++++++++
arch/powerpc/boot/mpc52xx-psc.c | 9 ++-------
arch/powerpc/boot/ns16550.c | 10 ++--------
arch/powerpc/boot/ops.h | 1 +
5 files changed, 31 insertions(+), 43 deletions(-)
diff --git a/arch/powerpc/boot/cpm-serial.c b/arch/powerpc/boot/cpm-serial.c
index 28296fa..1f6225a 100644
--- a/arch/powerpc/boot/cpm-serial.c
+++ b/arch/powerpc/boot/cpm-serial.c
@@ -177,7 +177,6 @@ int cpm_console_init(void *devp, struct serial_console_data *scdp)
{
void *reg_virt[2];
int is_smc = 0, is_cpm2 = 0, n;
- unsigned long reg_phys;
void *parent, *muram;
if (dt_is_compatible(devp, "fsl,cpm1-smc-uart")) {
@@ -206,15 +205,8 @@ int cpm_console_init(void *devp, struct serial_console_data *scdp)
if (n < 4)
return -1;
- 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, ®_phys, NULL))
- return -1;
-
- reg_virt[n] = (void *)reg_phys;
- }
- }
+ if (dt_get_virtual_reg(devp, reg_virt, 2) < 2)
+ return -1;
if (is_smc)
smc = reg_virt[0];
@@ -227,15 +219,8 @@ int cpm_console_init(void *devp, struct serial_console_data *scdp)
if (!parent)
return -1;
- n = getprop(parent, "virtual-reg", reg_virt, sizeof(reg_virt));
- if (n < (int)sizeof(reg_virt)) {
- if (!dt_xlate_reg(parent, 0, ®_phys, NULL))
- return -1;
-
- reg_virt[0] = (void *)reg_phys;
- }
-
- cpcr = reg_virt[0];
+ if (dt_get_virtual_reg(parent, &cpcr, 1) < 1)
+ return -1;
muram = finddevice("/soc/cpm/muram/data");
if (!muram)
@@ -246,15 +231,8 @@ int cpm_console_init(void *devp, struct serial_console_data *scdp)
* is one for both parent and child.
*/
- n = getprop(muram, "virtual-reg", reg_virt, sizeof(reg_virt));
- if (n < (int)sizeof(reg_virt)) {
- if (!dt_xlate_reg(muram, 0, ®_phys, NULL))
- return -1;
-
- reg_virt[0] = (void *)reg_phys;
- }
-
- muram_start = reg_virt[0];
+ if (dt_get_virtual_reg(muram, (void **)&muram_start, 1) < 1)
+ return -1;
n = getprop(muram, "reg", &muram_offset, 4);
if (n < 4)
diff --git a/arch/powerpc/boot/devtree.c b/arch/powerpc/boot/devtree.c
index 60f561e..5d12336 100644
--- a/arch/powerpc/boot/devtree.c
+++ b/arch/powerpc/boot/devtree.c
@@ -350,3 +350,23 @@ int dt_is_compatible(void *node, const char *compat)
return 0;
}
+
+int dt_get_virtual_reg(void *node, void **addr, int nres)
+{
+ unsigned long xaddr;
+ int n;
+
+ n = getprop(node, "virtual-reg", addr, nres * 4);
+ if (n > 0)
+ return n / 4;
+
+ for (n = 0; n < nres; n++) {
+ if (!dt_xlate_reg(node, n, &xaddr, NULL))
+ break;
+
+ addr[n] = (void *)xaddr;
+ }
+
+ return n;
+}
+
diff --git a/arch/powerpc/boot/mpc52xx-psc.c b/arch/powerpc/boot/mpc52xx-psc.c
index 1074626..d4cb4e4 100644
--- a/arch/powerpc/boot/mpc52xx-psc.c
+++ b/arch/powerpc/boot/mpc52xx-psc.c
@@ -51,14 +51,9 @@ static unsigned char psc_getc(void)
int mpc5200_psc_console_init(void *devp, struct serial_console_data *scdp)
{
- int n;
-
/* Get the base address of the psc registers */
- n = getprop(devp, "virtual-reg", &psc, sizeof(psc));
- if (n != sizeof(psc)) {
- if (!dt_xlate_reg(devp, 0, (void *)&psc, NULL))
- return -1;
- }
+ if (dt_get_virtual_reg(devp, &psc, 1) < 1)
+ return -1;
scdp->open = psc_open;
scdp->putc = psc_putc;
diff --git a/arch/powerpc/boot/ns16550.c b/arch/powerpc/boot/ns16550.c
index f8f1b2f..aef3bdc 100644
--- a/arch/powerpc/boot/ns16550.c
+++ b/arch/powerpc/boot/ns16550.c
@@ -55,15 +55,9 @@ static u8 ns16550_tstc(void)
int ns16550_console_init(void *devp, struct serial_console_data *scdp)
{
int n;
- unsigned long reg_phys;
- n = getprop(devp, "virtual-reg", ®_base, sizeof(reg_base));
- if (n != sizeof(reg_base)) {
- if (!dt_xlate_reg(devp, 0, ®_phys, NULL))
- return -1;
-
- reg_base = (void *)reg_phys;
- }
+ if (dt_get_virtual_reg(devp, (void **)®_base, 1) < 1)
+ return -1;
n = getprop(devp, "reg-shift", ®_shift, sizeof(reg_shift));
if (n != sizeof(reg_shift))
diff --git a/arch/powerpc/boot/ops.h b/arch/powerpc/boot/ops.h
index 4b0544b..321e2f5 100644
--- a/arch/powerpc/boot/ops.h
+++ b/arch/powerpc/boot/ops.h
@@ -95,6 +95,7 @@ int dt_xlate_reg(void *node, int res, unsigned long *addr, unsigned long *size);
int dt_xlate_addr(void *node, u32 *buf, int buflen, unsigned long *xlated_addr);
int dt_is_compatible(void *node, const char *compat);
void dt_get_reg_format(void *node, u32 *naddr, u32 *nsize);
+int dt_get_virtual_reg(void *node, void **addr, int nres);
static inline void *finddevice(const char *name)
{
--
1.5.0
--
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 related
* [PATCHv4 1/5] cpm_uart: Allocate DPRAM memory for SMC ports on CPM2-based platforms.
From: Laurent Pinchart @ 2008-04-01 12:34 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Scott Wood
In-Reply-To: <200804011433.29841.laurentp@cse-semaphore.com>
[-- Attachment #1: Type: text/plain, Size: 5713 bytes --]
This patch allocates parameter RAM for SMC serial ports without relying on
previous initialisation by a boot loader or a wrapper layer.
SMC parameter RAM on CPM2-based platforms can be allocated anywhere in the
general-purpose areas of the dual-port RAM. The current code relies on the
boot loader to allocate a section of general-purpose CPM RAM and gets the
section address from the device tree.
This patch modifies the device tree address usage to reference the SMC
parameter RAM base pointer instead of a pre-allocated RAM section and
allocates memory from the CPM dual-port RAM when initialising the SMC port.
CPM1-based platforms are not affected.
Signed-off-by: Laurent Pinchart <laurentp@cse-semaphore.com>
---
drivers/serial/cpm_uart/cpm_uart.h | 3 ++
drivers/serial/cpm_uart/cpm_uart_core.c | 19 +++++------
drivers/serial/cpm_uart/cpm_uart_cpm1.c | 12 +++++++
drivers/serial/cpm_uart/cpm_uart_cpm2.c | 52 +++++++++++++++++++++++++++++++
4 files changed, 76 insertions(+), 10 deletions(-)
diff --git a/drivers/serial/cpm_uart/cpm_uart.h b/drivers/serial/cpm_uart/cpm_uart.h
index 80a7d60..5334653 100644
--- a/drivers/serial/cpm_uart/cpm_uart.h
+++ b/drivers/serial/cpm_uart/cpm_uart.h
@@ -93,6 +93,9 @@ extern struct uart_cpm_port cpm_uart_ports[UART_NR];
/* these are located in their respective files */
void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd);
+void __iomem *cpm_uart_map_pram(struct uart_cpm_port *port,
+ struct device_node *np);
+void cpm_uart_unmap_pram(struct uart_cpm_port *port, void __iomem *pram);
int cpm_uart_init_portdesc(void);
int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con);
void cpm_uart_freebuf(struct uart_cpm_port *pinfo);
diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c
index 1ea123c..3a44a3f 100644
--- a/drivers/serial/cpm_uart/cpm_uart_core.c
+++ b/drivers/serial/cpm_uart/cpm_uart_core.c
@@ -997,24 +997,23 @@ static int cpm_uart_init_port(struct device_node *np,
if (!mem)
return -ENOMEM;
- pram = of_iomap(np, 1);
- if (!pram) {
- ret = -ENOMEM;
- goto out_mem;
- }
-
if (of_device_is_compatible(np, "fsl,cpm1-scc-uart") ||
of_device_is_compatible(np, "fsl,cpm2-scc-uart")) {
pinfo->sccp = mem;
- pinfo->sccup = pram;
+ pinfo->sccup = pram = cpm_uart_map_pram(pinfo, np);
} else if (of_device_is_compatible(np, "fsl,cpm1-smc-uart") ||
of_device_is_compatible(np, "fsl,cpm2-smc-uart")) {
pinfo->flags |= FLAG_SMC;
pinfo->smcp = mem;
- pinfo->smcup = pram;
+ pinfo->smcup = pram = cpm_uart_map_pram(pinfo, np);
} else {
ret = -ENODEV;
- goto out_pram;
+ goto out_mem;
+ }
+
+ if (!pram) {
+ ret = -ENOMEM;
+ goto out_mem;
}
pinfo->tx_nrfifos = TX_NUM_FIFO;
@@ -1038,7 +1037,7 @@ static int cpm_uart_init_port(struct device_node *np,
return cpm_uart_request_port(&pinfo->port);
out_pram:
- iounmap(pram);
+ cpm_uart_unmap_pram(pinfo, pram);
out_mem:
iounmap(mem);
return ret;
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm1.c b/drivers/serial/cpm_uart/cpm_uart_cpm1.c
index 6ea0366..e692593 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm1.c
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm1.c
@@ -54,6 +54,18 @@ void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd)
{
cpm_command(port->command, cmd);
}
+
+void __iomem *cpm_uart_map_pram(struct uart_cpm_port *port,
+ struct device_node *np)
+{
+ return of_iomap(np, 1);
+}
+
+void cpm_uart_unmap_pram(struct uart_cpm_port *port, void __iomem *pram)
+{
+ iounmap(pram);
+}
+
#else
void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd)
{
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm2.c b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
index 6291094..a4cfb0b 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm2.c
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
@@ -41,6 +41,9 @@
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/fs_pd.h>
+#ifdef CONFIG_PPC_CPM_NEW_BINDING
+#include <asm/prom.h>
+#endif
#include <linux/serial_core.h>
#include <linux/kernel.h>
@@ -54,6 +57,55 @@ void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd)
{
cpm_command(port->command, cmd);
}
+
+void __iomem *cpm_uart_map_pram(struct uart_cpm_port *port,
+ struct device_node *np)
+{
+ void __iomem *pram;
+ unsigned long offset;
+ struct resource res;
+ unsigned long len;
+
+ /* Don't remap parameter RAM if it has already been initialized
+ * during console setup.
+ */
+ if (IS_SMC(port) && port->smcup)
+ return port->smcup;
+ else if (!IS_SMC(port) && port->sccup)
+ return port->sccup;
+
+ if (of_address_to_resource(np, 1, &res))
+ return NULL;
+
+ len = 1 + res.end - res.start;
+ pram = ioremap(res.start, len);
+ if (!pram)
+ return NULL;
+
+ if (!IS_SMC(port))
+ return pram;
+
+ if (len != 2) {
+ printk(KERN_WARNING "cpm_uart[%d]: device tree references "
+ "SMC pram, using boot loader/wrapper pram mapping. "
+ "Please fix your device tree to reference the pram "
+ "base register instead.\n",
+ port->port.line);
+ return pram;
+ }
+
+ offset = cpm_dpalloc(PROFF_SMC_SIZE, 64);
+ out_be16(pram, offset);
+ iounmap(pram);
+ return cpm_muram_addr(offset);
+}
+
+void cpm_uart_unmap_pram(struct uart_cpm_port *port, void __iomem *pram)
+{
+ if (!IS_SMC(port))
+ iounmap(pram);
+}
+
#else
void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd)
{
--
1.5.0
--
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 related
* [PATCHv4 0/5] cpm2: Reset the CPM at startup and fix the cpm_uart driver accordingly.
From: Laurent Pinchart @ 2008-04-01 12:33 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Scott Wood
[-- Attachment #1: Type: text/plain, Size: 584 bytes --]
Hi everybody,
these 5 patches reset the CPM in cpm2_reset() and fix the cpm_uart driver to
initialise SMC ports correctly without relying on any initialisation
performed by the boot loader/wrapper. They update the boot wrapper code and
the EP8248E device tree to match the new SMC registers description.
Patches 2/5, 3/5 and 4/5 (boot wrapper and EP8248E device tree updates)
haven't been tested due to lack of hardware.
--
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: [kvm-ppc-devel] [PATCH] Add idle power save for ppc 4xx
From: Arnd Bergmann @ 2008-04-01 12:14 UTC (permalink / raw)
To: kvm-ppc-devel, jyoung5; +Cc: linuxppc-dev, Hollis Blanchard
In-Reply-To: <1206982322.9165.7.camel@thinkpadL>
On Monday 31 March 2008, Jerone Young wrote:
> >=20
> > > +{
> > > +=A0=A0=A0unsigned long msr_save;
> > > +
> > > +=A0=A0=A0/* set wait state MSR */
> > > +=A0=A0=A0local_irq_enable();
> > > +=A0=A0=A0msr_save =3D mfmsr();
> > > +=A0=A0=A0mtmsr(msr_save|MSR_WE);
> >=20
> > Why don't you |MSR_WE|MSR_EE at the same time?
>=20
> You technically can do this. But the question is do all 4xx cpus use
> MSR_EE to enable interrupts? I can assume they do (from what I know),
> but figured it would be safer to make the local_irq_enable() call.
> I can change it to just set the MSR_EE bit though, since all 4xx cpus
> (as far as I know) use it.
=46or correctness reasons, you actually have to set both EE and WE
simultaneously. Otherwise, an interrupt can come in between the two
mtmsr(), mark some thread as runnable and then go to sleep here
without ever checking need_resched() until the next interrupt,
which may take an indefinite time.
> >=20
> > > +=A0=A0=A0local_irq_disable();
> > > +}
> >=20
> > None of the other power_save() implementations need this. In fact many
> > of them don't even seem to return; they just loop around mtmsr.
>=20
> Sure it can be removed. Though with the comment in the mach_dep
> structure about power_save. It specifically says that interrupts are off
> when it is called. So I was following it here mainly. But I can remove
> the disabling of interrupts, since mtmsr is the only used under
> power_save.
With the current code, it shouldn't matter, because cpu_idle enables
the interrupts right after calling ppc_md->power_save(), but it would
be reasonable to disable the interrupts here anyway, if only to make
the function return with the same state that it was entered.
IMHO, the function should be
void ppc4xx_idle()
{
unsigned long msr_save;
msr_save =3D mfmsr();
/* enter idle mode */
mtmsr(msr_save|MSR_WE|MSR_EE);
/* disable interrupts again */
mtmsr(msr_save);
}
Arnd <><
^ permalink raw reply
* Re: Commits added to powerpc.git master/powerpc-next branches
From: Josh Boyer @ 2008-04-01 12:05 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <18418.5519.903340.966932@cargo.ozlabs.ibm.com>
On Tue, 2008-04-01 at 21:59 +1100, Paul Mackerras wrote:
> I have updated the master and powerpc-next branches of the powerpc.git
> repository with the following commits, including some pulled from Josh
> Boyer and Kumar Gala.
Is there something still wrong with version 3 of this patch?
http://patchwork.ozlabs.org/linuxppc/patch?filter=incoming&id=17516
It would be nice to get that in .26, and Nathan has a patch or two that
depends on it that do some cleanup.
josh
^ permalink raw reply
* Re: [kvm-ppc-devel] [PATCH] Add idle power save for ppc 4xx
From: Josh Boyer @ 2008-04-01 12:03 UTC (permalink / raw)
To: Jimi Xenidis; +Cc: kvm-ppc-devel, linuxppc-dev
In-Reply-To: <11F8A893-409D-4449-9DAB-BF248045E6D9@pobox.com>
On Tue, 2008-04-01 at 08:01 -0400, Jimi Xenidis wrote:
> On Mar 31, 2008, at 11:15 PM, Josh Boyer wrote:
>
> > On Tue, 2008-04-01 at 12:04 +1100, Michael Ellerman wrote:
> >>>>> I'm assuming you pass a dtb to the virtual guest when you start
> >>>>> it up.
> >>>>> Could you define a property in the CPU node there that can be
> >>>>> parsed to
> >>>>> use the power_save function instead of always making it the
> >>>>> default?
> >>>>
> >>>> Actually, you probably don't want this as a property in the device
> >>>> tree. It doesn't describe hardware. A Kconfig option might be
> >>>> warranted though.
> >>>
> >>> I'll go with the Kconfig option.
> >>
> >> Go with a device-tree check. The pseries kernel supports both bare-
> >> metal
> >> and hypervisor in the same kernel image, and it works out which it's
> >> running on by looking at the device-tree. This seems equivalent to
> >> me?
> >
> > After some back and forth on IRC, we decided on that as well. I love
> > being right, then wrong, then right again.
>
> Awesome, can you summarize for the rest of us?
A node or property will be in the device tree that the guests can use to
determine if it's running under a hypervisor or not.
The details are yet to be worked out, so there isn't much more of a
summary yet. There was also some conversation about having an "idle="
kernel parameter similar to the PA-Semi port that would allow toggling
of it as well.
josh
^ permalink raw reply
* Re: [kvm-ppc-devel] [PATCH] Add idle power save for ppc 4xx
From: Jimi Xenidis @ 2008-04-01 12:01 UTC (permalink / raw)
To: Josh Boyer; +Cc: kvm-ppc-devel, linuxppc-dev
In-Reply-To: <1207019732.12155.81.camel@vader.jdub.homelinux.org>
On Mar 31, 2008, at 11:15 PM, Josh Boyer wrote:
> On Tue, 2008-04-01 at 12:04 +1100, Michael Ellerman wrote:
>>>>> I'm assuming you pass a dtb to the virtual guest when you start
>>>>> it up.
>>>>> Could you define a property in the CPU node there that can be
>>>>> parsed to
>>>>> use the power_save function instead of always making it the
>>>>> default?
>>>>
>>>> Actually, you probably don't want this as a property in the device
>>>> tree. It doesn't describe hardware. A Kconfig option might be
>>>> warranted though.
>>>
>>> I'll go with the Kconfig option.
>>
>> Go with a device-tree check. The pseries kernel supports both bare-
>> metal
>> and hypervisor in the same kernel image, and it works out which it's
>> running on by looking at the device-tree. This seems equivalent to
>> me?
>
> After some back and forth on IRC, we decided on that as well. I love
> being right, then wrong, then right again.
Awesome, can you summarize for the rest of us?
-JX
^ permalink raw reply
* Re: [PATCHv3 2/4] cpm-serial: Relocate CPM buffer descriptors and SMC parameter ram.
From: Laurent Pinchart @ 2008-04-01 11:55 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-dev
In-Reply-To: <47F13735.40207@freescale.com>
[-- Attachment #1: Type: text/plain, Size: 3761 bytes --]
On Monday 31 March 2008 21:10, Scott Wood wrote:
> Laurent Pinchart wrote:
> > This patch relocates the buffer descriptors and the SMC parameter RAM at the
> > end of the first CPM muram chunk, as described in the device tree. This allows
> > device trees to stop excluding SMC parameter ram allocated by the boot loader
> > from the CPM muram node.
>
> It's usually a good idea to state that something is untested if that's
> the case. :-)
Sorry. I'll state it clearly next time.
> This patch cannot work as is.
>
> > +static int cpm_get_virtual_address(void *devp, void **addr, int ncells)
> > +{
> > + unsigned long xaddr;
> > + int n;
> > +
> > + n = getprop(devp, "virtual-reg", addr, ncells * sizeof *addr);
> > + if (n < ncells * sizeof *addr) {
>
> You must cast the sizeof to a signed int; otherwise, a negative return
> from getprop will be "bigger" than the unsigned size, and you'll return
> garbage as the address.
>
> > + for (n = 0; n < ncells; n++) {
> > + if (!dt_xlate_reg(devp, n, &xaddr, NULL))
> > + return -1;
> > +
> > + addr[n] = (void*)xaddr;
>
> (void *)
>
> > + }
> > + }
> > +
> > + return ncells;
> > +}
>
> This could be a generic bootwrapper function. It should return the
> number of resources (ncells is a misnomer) actually found, though,
> rather than failing if there are fewer than asked for. Let the caller
> decide if it's fatal.
Ok. I'll move it to devtree.c.
> > @@ -202,63 +243,62 @@ int cpm_console_init(void *devp, struct serial_console_data *scdp)
> > else
> > do_cmd = cpm1_cmd;
> >
> > - n = getprop(devp, "fsl,cpm-command", &cpm_cmd, 4);
> > - if (n < 4)
> > + if (getprop(devp, "fsl,cpm-command", &cpm_cmd, 4) < sizeof cpm_cmd)
> > return -1;
>
> Standard kernel style is sizeof(foo), not sizeof foo.
Ok.
> Plus, if you're going to replace 4 with sizeof(cpm_cmd), do it both
> places. I don't really see the need, though; a cell is always 4 bytes.
Ok, I'll keep 4.
> > - n = getprop(parent, "virtual-reg", reg_virt, sizeof(reg_virt));
> > - if (n < (int)sizeof(reg_virt)) {
> > - if (!dt_xlate_reg(parent, 0, ®_phys, NULL))
> > - return -1;
> > -
> > - reg_virt[0] = (void *)reg_phys;
> > - }
> > -
> > - cpcr = reg_virt[0];
> > + if (cpm_get_virtual_address(devp, &cpcr, 1) < 0)
> > + return -1;
>
> s/devp/parent/
>
> > muram = finddevice("/soc/cpm/muram/data");
> > if (!muram)
> > return -1;
> >
> > /* For bootwrapper-compatible device trees, we assume that the first
> > - * entry has at least 18 bytes, and that #address-cells/#data-cells
> > + * entry has at least 128 bytes, and that #address-cells/#data-cells
> > * is one for both parent and child.
> > */
> >
> > - n = getprop(muram, "virtual-reg", reg_virt, sizeof(reg_virt));
> > - if (n < (int)sizeof(reg_virt)) {
> > - if (!dt_xlate_reg(muram, 0, ®_phys, NULL))
> > - return -1;
> > + if (cpm_get_virtual_address(devp, &muram_addr, 1) < 0)
> > + return -1;
>
> s/devp/muram/
>
> > +
> > + if (getprop(muram, "reg", reg, sizeof reg) < sizeof reg)
> > + return -1;
>
> Should read into array of u32, not void *.
Ok.
> > + if (is_cpm2 && is_smc) {
> > + u16 *smc_base = (u16*)param;
>
> (u16 *)
>
> > + u16 pram_offset;
> >
> > - muram_start = reg_virt[0];
> > + pram_offset = cbd_offset - 64;
> > + pram_offset = _ALIGN_DOWN(pram_offset, 64);
> > + *smc_base = pram_offset;
>
> Use out_be16().
>
> The SMC should be stopped before you do this.
Right.
New patch comming.
--
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
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox