* Re: How to port PReP to arch/powerpc?
From: Josh Boyer @ 2007-08-22 16:26 UTC (permalink / raw)
To: Olof Johansson; +Cc: Meelis Roos, linuxppc-dev
In-Reply-To: <20070822152716.GL16830@lixom.net>
On Wed, 22 Aug 2007 10:27:16 -0500
Olof Johansson <olof@lixom.net> wrote:
> On Wed, Aug 22, 2007 at 11:19:34AM -0500, Linas Vepstas wrote:
> > On Wed, Aug 22, 2007 at 07:29:56AM -0500, Josh Boyer wrote:
> > >
> > > David Gibson and Rob Landley had a quite interesting discussion about
> > > PReP last night on IRC.
> >
> > ?? Where? I scrolled back on #ppc64 on freenode, and see no such
> > conversation.
>
> It was on #mklinux
Right. There's actually quite a bit discussed in #mklinux about
various merge port stuff. And cars.
josh
^ permalink raw reply
* Re: How to port PReP to arch/powerpc?
From: Linas Vepstas @ 2007-08-22 16:19 UTC (permalink / raw)
To: Josh Boyer; +Cc: Meelis Roos, linuxppc-dev
In-Reply-To: <20070822072956.56b7df46@vader.jdub.homelinux.org>
On Wed, Aug 22, 2007 at 07:29:56AM -0500, Josh Boyer wrote:
>
> David Gibson and Rob Landley had a quite interesting discussion about
> PReP last night on IRC.
?? Where? I scrolled back on #ppc64 on freenode, and see no such
conversation.
--linas
^ permalink raw reply
* Re: asm-ppc header issues when building ARCH=powerpc
From: Scott Wood @ 2007-08-22 16:01 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev@ozlabs.org list, Paul Mackerras, David Gibson
In-Reply-To: <75EDD900-3B5E-4D08-9311-13B6510EDE6E@kernel.crashing.org>
On Wed, Aug 22, 2007 at 10:19:21AM -0500, Kumar Gala wrote:
> ./drivers/mtd/maps/tqm834x.c:#include <asm/ppcboot.h>
> ./drivers/mtd/maps/pq2fads.c:#include <asm/ppcboot.h>
These use the bd_t, and thus will only work on arch/ppc. On
arch/powerpc, we can use the device tree to specify the mapping.
-Scott
^ permalink raw reply
* Re: Kerenel crashes every other Boot..
From: Wolfgang Reissnegger @ 2007-08-22 15:36 UTC (permalink / raw)
To: ravi.rao; +Cc: linuxppc-embedded
In-Reply-To: <OFB4F00B2A.B7C79F45-ON8525733F.00547516-8525733F.0054E4E5@teal.com>
Hi Ravi,
my first guess would be that there is a problem with your RAM. Could be
the RAM timing or just a bad RAM chip.
Try to run the image on another board, see if it works there. If not you
can check the RAM timing. Given that you have a custom board there could
be some design issues.
Where are you loading the image from? Maybe there is a problem in
transferring the image into RAM so the image download corrupts the data?
Cheers,
Wolfgang
ravi.rao@rflelect.com wrote:
>
> Hi,
> Some times it crashes and many times it comes back with an error as
> Junk in compressed Image..
> Below is the screen dump..
> **************** When it does not work **************************
> BOOT MONITOR:
> .. eth driver not initialized. command aborted
> .. Invoking Linux PPC Kernel Loader at 0xfe800000
> .. Boot Parms: 0x3f72314, Flags: 0x1014, Verbose: 0x3
>
> loaded at: FE800000 FEA16124
> relocated to: 00400000 00616124
> board data at: 03F72314 03F72510
> relocated to: 00613000 006131FC
> zimage at: 00404EDC 0061289C
> avail ram: 00617000 04000000
>
> Linux/PPC load: console=ttyS0,9600 ip=dhcp root=nfs
> Uncompressing Linux...done.
> Now booting the kernel
> Linux version 2.6.21 (root@localhost.localdomain) (gcc version 4.1.0
> 20060304 (TimeSys 4.1.0-3)) #27 Wed Aug 22 10:10:4
> 2 EDT 2007
> MAC 0: 00:50:cc:0c:e2:30
> MAC 1: 00:50:c2:0c:e2:31
> 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: console=ttyS0,9600 root=/dev/rd/0
> ip=10.2.254.33:10.2.1.1:10.2.0.1:255.255.0.0:unknown:eth0
> PID hash table entries: 256 (order: 8, 1024 bytes)
> Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
> Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
> Memory: 61952k available (1188k kernel code, 280k data, 1504k init, 0k
> highmem)
> Mount-cache hash table entries: 512
> Kernel panic - not syncing: junk in compressed archive
> Rebooting in 180 seconds..
>
> ******************** When it works **************************
> BOOT MONITOR:
> .. eth driver not initialized. command aborted
> .. Invoking Linux PPC Kernel Loader at 0xfe800000
> .. Boot Parms: 0x3f72314, Flags: 0x1014, Verbose: 0x3
>
> loaded at: FE800000 FEA16124
> relocated to: 00400000 00616124
> board data at: 03F72314 03F72510
> relocated to: 00613000 006131FC
> zimage at: 00404EDC 0061289C
> avail ram: 00617000 04000000
>
> Linux/PPC load: console=ttyS0,9600 ip=dhcp root=nfs
> Uncompressing Linux...done.
> Now booting the kernel
> Linux version 2.6.21 (root@localhost.localdomain) (gcc version 4.1.0
> 20060304 (TimeSys 4.1.0-3)) #27 Wed Aug 22 10:10:4
> 2 EDT 2007
> MAC 0: 00:50:cc:0c:e2:30
> MAC 1: 00:50:c2:0c:e2:31
> 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: console=ttyS0,9600 root=/dev/rd/0
> ip=10.2.254.33:10.2.1.1:10.2.0.1:255.255.0.0:unknown:eth0
> PID hash table entries: 256 (order: 8, 1024 bytes)
> Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
> Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
> Memory: 61952k available (1188k kernel code, 280k data, 1504k init, 0k
> highmem)
> Mount-cache hash table entries: 512
> JFFS2 version 2.2. (NAND) (C) 2001-2006 Red Hat, Inc.
> io scheduler noop registered
> io scheduler anticipatory registered
> io scheduler deadline registered
> io scheduler cfq registered (default)
> Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled
> serial8250: ttyS0 at MMIO 0x0 (irq = 0) is a 16550A
> serial8250: ttyS1 at MMIO 0x0 (irq = 1) is a 16550A
> RAMDISK driver initialized: 1 RAM disks of 16384K size 1024 blocksize
> loop: loaded (max 8 devices)
> i2c /dev entries driver
> IBM IIC driver v2.1
> ibm-iic0: using standard (100 kHz) mode
> Freeing unused kernel memory: 1504k init
> serial console detected. Disabling virtual terminals.
> init started: BusyBox v0.60.2 (2003.04.29-11:32+0000) multi-call binary
> Bummer, could not run '/etc/init.d/rcS': No such file or directory
>
> Please press Enter to activate this console.
> sh-2.05#
>
> Ravishankar Govindarao
> RFL Electronics Inc.
> E-mail : _Ravi.Rao@rflelect.com_ <mailto:Ravi.Rao@rflelect.com>
> Voice: 973.334.3100 Ext. 233
> Fax: 973.334.3863
>
>
>
>
> _CONFIDENTIALITY NOTE_
>
> This e-mail, including any attachments, may contain confidential and/or
> legally privileged information. The Information is intended only for
> the use of the individual or entity named on this e-mail . If you are
> not the intended recipient, you are hereby notified that any disclosure,
> copying, distribution, or the taking of any action in reliance on the
> contents of this transmitted Information is strictly prohibited.
> Further, if you are not the intended recipient, please notify us by
> return e-mail and delete the Information promptly.
>
>
>
>
>
>
>
>
> *Wolfgang Reissnegger <wolfgang.reissnegger@xilinx.com>*
>
> 08/22/2007 11:15 AM
>
>
> To
> ravi.rao@rflelect.com
> cc
> linuxppc-embedded@ozlabs.org
> Subject
> Re: Kerenel crashes every other Boot..
>
>
>
>
>
>
>
>
> Hi Ravi,
>
> you need to provide more information, for example, where does the kernel
> crash, any serial console output that you see when it crashes, etc.
>
> Cheers,
> Wolfgang
>
>
> ravi.rao@rflelect.com wrote:
>>
>> Hi All,
>> I have a PPC 405EP custom target. I based most of my software on the
>> EP405 Taihu reference and now I am able to load the 2.6.21 kernel and
>> with a minimum initramfs I also get the busy box prompt. I see a strange
>> poblem it fails(linux crashes) every other boot. Can any one please tell
>> me what may be happening ???
>> Thanks,
>> Ravishankar Govindarao
>> RFL Electronics Inc.
>> E-mail : _Ravi.Rao@rflelect.com_ <mailto:Ravi.Rao@rflelect.com>
>> Voice: 973.334.3100 Ext. 233
>> Fax: 973.334.3863
>>
>>
>>
>>
>> _CONFIDENTIALITY NOTE_
>>
>> This e-mail, including any attachments, may contain confidential and/or
>> legally privileged information. The Information is intended only for
>> the use of the individual or entity named on this e-mail . If you are
>> not the intended recipient, you are hereby notified that any disclosure,
>> copying, distribution, or the taking of any action in reliance on the
>> contents of this transmitted Information is strictly prohibited.
>> Further, if you are not the intended recipient, please notify us by
>> return e-mail and delete the Information promptly.
>>
>>
>>
>>
>>
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Linuxppc-embedded mailing list
>> Linuxppc-embedded@ozlabs.org
>> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>
>
^ permalink raw reply
* Re: Kerenel crashes every other Boot..
From: ravi.rao @ 2007-08-22 15:28 UTC (permalink / raw)
To: wolfgang.reissnegger; +Cc: linuxppc-embedded
In-Reply-To: <20070822151523.AF7A910A0071@mail78-dub.bigfish.com>
[-- Attachment #1: Type: text/plain, Size: 6140 bytes --]
Hi,
Some times it crashes and many times it comes back with an error as Junk
in compressed Image..
Below is the screen dump..
**************** When it does not work **************************
BOOT MONITOR:
.. eth driver not initialized. command aborted
.. Invoking Linux PPC Kernel Loader at 0xfe800000
.. Boot Parms: 0x3f72314, Flags: 0x1014, Verbose: 0x3
loaded at: FE800000 FEA16124
relocated to: 00400000 00616124
board data at: 03F72314 03F72510
relocated to: 00613000 006131FC
zimage at: 00404EDC 0061289C
avail ram: 00617000 04000000
Linux/PPC load: console=ttyS0,9600 ip=dhcp root=nfs
Uncompressing Linux...done.
Now booting the kernel
Linux version 2.6.21 (root@localhost.localdomain) (gcc version 4.1.0
20060304 (TimeSys 4.1.0-3)) #27 Wed Aug 22 10:10:4
2 EDT 2007
MAC 0: 00:50:cc:0c:e2:30
MAC 1: 00:50:c2:0c:e2:31
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: console=ttyS0,9600 root=/dev/rd/0
ip=10.2.254.33:10.2.1.1:10.2.0.1:255.255.0.0:unknown:eth0
PID hash table entries: 256 (order: 8, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 61952k available (1188k kernel code, 280k data, 1504k init, 0k
highmem)
Mount-cache hash table entries: 512
Kernel panic - not syncing: junk in compressed archive
Rebooting in 180 seconds..
******************** When it works **************************
BOOT MONITOR:
.. eth driver not initialized. command aborted
.. Invoking Linux PPC Kernel Loader at 0xfe800000
.. Boot Parms: 0x3f72314, Flags: 0x1014, Verbose: 0x3
loaded at: FE800000 FEA16124
relocated to: 00400000 00616124
board data at: 03F72314 03F72510
relocated to: 00613000 006131FC
zimage at: 00404EDC 0061289C
avail ram: 00617000 04000000
Linux/PPC load: console=ttyS0,9600 ip=dhcp root=nfs
Uncompressing Linux...done.
Now booting the kernel
Linux version 2.6.21 (root@localhost.localdomain) (gcc version 4.1.0
20060304 (TimeSys 4.1.0-3)) #27 Wed Aug 22 10:10:4
2 EDT 2007
MAC 0: 00:50:cc:0c:e2:30
MAC 1: 00:50:c2:0c:e2:31
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: console=ttyS0,9600 root=/dev/rd/0
ip=10.2.254.33:10.2.1.1:10.2.0.1:255.255.0.0:unknown:eth0
PID hash table entries: 256 (order: 8, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 61952k available (1188k kernel code, 280k data, 1504k init, 0k
highmem)
Mount-cache hash table entries: 512
JFFS2 version 2.2. (NAND) (C) 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled
serial8250: ttyS0 at MMIO 0x0 (irq = 0) is a 16550A
serial8250: ttyS1 at MMIO 0x0 (irq = 1) is a 16550A
RAMDISK driver initialized: 1 RAM disks of 16384K size 1024 blocksize
loop: loaded (max 8 devices)
i2c /dev entries driver
IBM IIC driver v2.1
ibm-iic0: using standard (100 kHz) mode
Freeing unused kernel memory: 1504k init
serial console detected. Disabling virtual terminals.
init started: BusyBox v0.60.2 (2003.04.29-11:32+0000) multi-call binary
Bummer, could not run '/etc/init.d/rcS': No such file or directory
Please press Enter to activate this console.
sh-2.05#
Ravishankar Govindarao
RFL Electronics Inc.
E-mail : Ravi.Rao@rflelect.com
Voice: 973.334.3100 Ext. 233
Fax: 973.334.3863
CONFIDENTIALITY NOTE
This e-mail, including any attachments, may contain confidential and/or
legally privileged information. The Information is intended only for the
use of the individual or entity named on this e-mail . If you are not the
intended recipient, you are hereby notified that any disclosure, copying,
distribution, or the taking of any action in reliance on the contents of
this transmitted Information is strictly prohibited. Further, if you are
not the intended recipient, please notify us by return e-mail and delete
the Information promptly.
Wolfgang Reissnegger <wolfgang.reissnegger@xilinx.com>
08/22/2007 11:15 AM
To
ravi.rao@rflelect.com
cc
linuxppc-embedded@ozlabs.org
Subject
Re: Kerenel crashes every other Boot..
Hi Ravi,
you need to provide more information, for example, where does the kernel
crash, any serial console output that you see when it crashes, etc.
Cheers,
Wolfgang
ravi.rao@rflelect.com wrote:
>
> Hi All,
> I have a PPC 405EP custom target. I based most of my software on the
> EP405 Taihu reference and now I am able to load the 2.6.21 kernel and
> with a minimum initramfs I also get the busy box prompt. I see a strange
> poblem it fails(linux crashes) every other boot. Can any one please tell
> me what may be happening ???
> Thanks,
> Ravishankar Govindarao
> RFL Electronics Inc.
> E-mail : _Ravi.Rao@rflelect.com_ <mailto:Ravi.Rao@rflelect.com>
> Voice: 973.334.3100 Ext. 233
> Fax: 973.334.3863
>
>
>
>
> _CONFIDENTIALITY NOTE_
>
> This e-mail, including any attachments, may contain confidential and/or
> legally privileged information. The Information is intended only for
> the use of the individual or entity named on this e-mail . If you are
> not the intended recipient, you are hereby notified that any disclosure,
> copying, distribution, or the taking of any action in reliance on the
> contents of this transmitted Information is strictly prohibited.
> Further, if you are not the intended recipient, please notify us by
> return e-mail and delete the Information promptly.
>
>
>
>
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
[-- Attachment #2: Type: text/html, Size: 11504 bytes --]
^ permalink raw reply
* Re: How to port PReP to arch/powerpc?
From: Olof Johansson @ 2007-08-22 15:27 UTC (permalink / raw)
To: Linas Vepstas; +Cc: linuxppc-dev, Meelis Roos
In-Reply-To: <20070822161934.GU4261@austin.ibm.com>
On Wed, Aug 22, 2007 at 11:19:34AM -0500, Linas Vepstas wrote:
> On Wed, Aug 22, 2007 at 07:29:56AM -0500, Josh Boyer wrote:
> >
> > David Gibson and Rob Landley had a quite interesting discussion about
> > PReP last night on IRC.
>
> ?? Where? I scrolled back on #ppc64 on freenode, and see no such
> conversation.
It was on #mklinux
-Olof
^ permalink raw reply
* asm-ppc header issues when building ARCH=powerpc
From: Kumar Gala @ 2007-08-22 15:19 UTC (permalink / raw)
To: linuxppc-dev@ozlabs.org list; +Cc: Paul Mackerras, David Gibson
Guys,
I was wondering if I could get your help with looking at the
following lists and determining if we have an issue or not related
the following files:
Getting some classification on these would be good. Possibly
classifications, doesn't build in ARCH=powerpc, remove include, real
issue, etc.
- k
./include/asm-powerpc/irq.h:#include <asm/mpc83xx.h> - protected by !
CONFIG_PPC_MERGE
./drivers/ide/ppc/mpc8xx.c:#include <asm/residual.h>
./drivers/mtd/maps/tqm834x.c:#include <asm/ppcboot.h>
./drivers/mtd/maps/pq2fads.c:#include <asm/ppcboot.h>
./drivers/i2c/busses/i2c-ibm_iic.c:#include <asm/ibm4xx.h>
./drivers/mtd/maps/walnut.c:#include <asm/ibm4xx.h>
./include/asm-powerpc/irq.h:#include <asm/ibm4xx.h> - protected by !
CONFIG_PPC_MERGE
./drivers/mtd/maps/ebony.c:#include <asm/ibm44x.h>
./drivers/mtd/maps/ocotea.c:#include <asm/ibm44x.h>
./drivers/mtd/nand/ndfc.c:#include <asm/ibm44x.h>
./include/asm-powerpc/irq.h:#include <asm/ibm44x.h> - protected by !
CONFIG_PPC_MERGE
./drivers/i2c/busses/i2c-ibm_iic.c:#include <asm/ocp.h>
./drivers/net/ucc_geth_mii.c:#include <asm/ocp.h> - just bogus, needs
removal
./drivers/net/ibm_emac/ibm_emac_core.c:#include <asm/ocp.h>
./drivers/net/ibm_emac/ibm_emac_core.h:#include <asm/ocp.h>
./drivers/net/ibm_emac/ibm_emac_tah.h:#include <asm/ocp.h>
./drivers/net/ibm_emac/ibm_emac_phy.c:#include <asm/ocp.h>
./drivers/net/ibm_emac/ibm_emac_mal.c:#include <asm/ocp.h>
./drivers/net/ibm_emac/ibm_emac_zmii.h:#include <asm/ocp.h>
./drivers/macintosh/adb-iop.c:#include <asm/bootinfo.h>
./drivers/char/vme_scc.c:#include <asm/bootinfo.h>
./drivers/char/serial167.c:#include <asm/bootinfo.h>
./drivers/serial/dz.c:#include <asm/bootinfo.h>
./drivers/mtd/devices/ms02-nv.c:#include <asm/bootinfo.h>
./drivers/net/macsonic.c:#include <asm/bootinfo.h>
./drivers/net/jazzsonic.c:#include <asm/bootinfo.h>
./drivers/video/pmag-aa-fb.c:#include <asm/bootinfo.h>
./drivers/video/maxinefb.c:#include <asm/bootinfo.h>
./drivers/video/logo/logo.c:#include <asm/bootinfo.h>
./drivers/video/valkyriefb.c:#include <asm/bootinfo.h>
./drivers/video/macfb.c:#include <asm/bootinfo.h>
^ permalink raw reply
* Re: Kerenel crashes every other Boot..
From: Wolfgang Reissnegger @ 2007-08-22 15:15 UTC (permalink / raw)
To: ravi.rao; +Cc: linuxppc-embedded
In-Reply-To: <OF486D59BE.E9F90F84-ON8525733F.005162F2-8525733F.0051B481@rflelect.com>
Hi Ravi,
you need to provide more information, for example, where does the kernel
crash, any serial console output that you see when it crashes, etc.
Cheers,
Wolfgang
ravi.rao@rflelect.com wrote:
>
> Hi All,
> I have a PPC 405EP custom target. I based most of my software on the
> EP405 Taihu reference and now I am able to load the 2.6.21 kernel and
> with a minimum initramfs I also get the busy box prompt. I see a strange
> poblem it fails(linux crashes) every other boot. Can any one please tell
> me what may be happening ???
> Thanks,
> Ravishankar Govindarao
> RFL Electronics Inc.
> E-mail : _Ravi.Rao@rflelect.com_ <mailto:Ravi.Rao@rflelect.com>
> Voice: 973.334.3100 Ext. 233
> Fax: 973.334.3863
>
>
>
>
> _CONFIDENTIALITY NOTE_
>
> This e-mail, including any attachments, may contain confidential and/or
> legally privileged information. The Information is intended only for
> the use of the individual or entity named on this e-mail . If you are
> not the intended recipient, you are hereby notified that any disclosure,
> copying, distribution, or the taking of any action in reliance on the
> contents of this transmitted Information is strictly prohibited.
> Further, if you are not the intended recipient, please notify us by
> return e-mail and delete the Information promptly.
>
>
>
>
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
^ permalink raw reply
* Re: [PATCH v6 0/2] SPI support for fsl_soc and mpc832x_rdb
From: Anton Vorontsov @ 2007-08-22 15:13 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <1968F4E2-90F9-46A2-ADC2-DEF28F22CCEA@kernel.crashing.org>
On Wed, Aug 22, 2007 at 10:01:13AM -0500, Kumar Gala wrote:
>
> On Aug 22, 2007, at 9:54 AM, Anton Vorontsov wrote:
>
>> On Wed, Aug 22, 2007 at 09:22:47AM -0500, Kumar Gala wrote:
>>>
>>> On Aug 21, 2007, at 10:27 AM, Anton Vorontsov wrote:
>>>
>>>> On Tue, Aug 21, 2007 at 05:45:37PM +0400, Anton Vorontsov wrote:
>>>>> Hi all,
>>>>>
>>>>> Thanks for the previous reviews, this is v4 against Linus' tree,
>>>>> as of today.
>>>>
>>>> Okay, here is brand-new, shiny v5. Today and only today it comes
>>>> without section mismatch warnings, don't miss your chance. Get it
>>>> free of charge! ;-)
>>>
>>> This looks good, have some minor cleanup nits.
>>
>> Much thanks, fixed.
>
> np. Do you know what effect the modalias being wrong has on current
> functionality?
No effect in the `kernel oops' meanings, nothing too bad will happen.
But personally I vote for spidev stub to stay. This way I (and anybody
else) can actually test SPI (and MMC) even without mmc_spi driver, i.e.
using Documentation/spi/spidev_test.c (already in Linus' tree).
> and when mmc_spi gets added?
Let's hope in v2.6.24. IIRC it's already in -mm for some time, and it's
pretty mature already, thanks to David Brownell.
> - k
Thanks,
--
Anton Vorontsov
email: cbou@mail.ru
backup email: ya-cbou@yandex.ru
irc://irc.freenode.net/bd2
^ permalink raw reply
* [Fwd: Re: [PATCH 3/3] Add support for xupv2p and ml410 boards.]
From: Wolfgang Reissnegger @ 2007-08-22 15:12 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 0 bytes --]
[-- Attachment #2: Re: [PATCH 3/3] Add support for xupv2p and ml410 boards. --]
[-- Type: message/rfc822, Size: 1308 bytes --]
From: Wolfgang Reissnegger <wolfgang.reissnegger@xilinx.com>
To: Robert Woodworth <rwoodworth@securics.com>
Subject: Re: [PATCH 3/3] Add support for xupv2p and ml410 boards.
Date: Tue, 21 Aug 2007 20:59:05 -0700
Message-ID: <46CBB489.3080700@xilinx.com>
Robert Woodworth wrote:
> Should the xparameters????.h file *really* be included in the tree?
>
> This file is completely board/EDK/ISE/synthesis specific. I'd rather
> it not be included and have people copy theirs from EDK. Or as I have
> done, sym-link it from my EDK project.
>
> Woody.
The purpose of the included xparameter.h files is to provide a
configuration for the default reference designs. They are useful if you
want to compile a kernel without building a system with the EDK first.
As Grant pointed out, for custom designs you'd need to generate your own
xparameter.h file.
Wolfgang
^ permalink raw reply
* [PATCH] [10/10] pasemi_mac: Clean TX ring in poll
From: Olof Johansson @ 2007-08-22 14:13 UTC (permalink / raw)
To: jgarzik; +Cc: netdev, linuxppc-dev
In-Reply-To: <20070817205413.548020000@lixom.net>
Unfortunately there's no timeout for how long a packet can sit on
the TX ring after completion before an interrupt is generated, and
we want to have a threshold that's larger than one packet per interrupt.
So we have to have a timer that occasionally cleans the TX ring even
though there hasn't been an interrupt. Instead of setting up a dedicated
timer for this, just clean it in the NAPI poll routine instead.
Signed-off-by: Olof Johansson <olof@lixom.net>
---
I know I got this rejected last time it was submitted, but no answers with
suggestions on how to handle it better. I'm all ears if there's a better
way. (I noticed that Intel's new ixgbe driver does the same thing).
Index: mainline/drivers/net/pasemi_mac.c
===================================================================
--- mainline.orig/drivers/net/pasemi_mac.c
+++ mainline/drivers/net/pasemi_mac.c
@@ -1086,6 +1086,7 @@ static int pasemi_mac_poll(struct net_de
int pkts, limit = min(*budget, dev->quota);
struct pasemi_mac *mac = netdev_priv(dev);
+ pasemi_mac_clean_tx(mac);
pkts = pasemi_mac_clean_rx(mac, limit);
dev->quota -= pkts;
--
^ permalink raw reply
* [PATCH] [09/10] pasemi_mac: Fix RX checksum flags
From: Olof Johansson @ 2007-08-22 14:13 UTC (permalink / raw)
To: jgarzik; +Cc: netdev, linuxppc-dev
In-Reply-To: <20070817205413.548020000@lixom.net>
RX side flag to use is CHECKSUM_UNNECESSARY, not CHECKSUM_COMPLETE.
Signed-off-by: Olof Johansson <olof@lixom.net>
Index: mainline/drivers/net/pasemi_mac.c
===================================================================
--- mainline.orig/drivers/net/pasemi_mac.c
+++ mainline/drivers/net/pasemi_mac.c
@@ -534,7 +534,7 @@ static int pasemi_mac_clean_rx(struct pa
skb_put(skb, len);
if (likely((macrx & XCT_MACRX_HTY_M) == XCT_MACRX_HTY_IPV4_OK)) {
- skb->ip_summed = CHECKSUM_COMPLETE;
+ skb->ip_summed = CHECKSUM_UNNECESSARY;
skb->csum = (macrx & XCT_MACRX_CSUM_M) >>
XCT_MACRX_CSUM_S;
} else
--
^ permalink raw reply
* [PATCH] [08/10] pasemi_mac: Fix TX ring wrap checking
From: Olof Johansson @ 2007-08-22 14:13 UTC (permalink / raw)
To: jgarzik; +Cc: netdev, linuxppc-dev
In-Reply-To: <20070817205413.548020000@lixom.net>
The old logic didn't detect full (tx) ring cases properly, causing
overruns and general badness. Clean it up a bit and abstract out the
ring size checks, always making sure to leave 1 slot open.
Signed-off-by: Olof Johansson <olof@lixom.net>
Index: mainline/drivers/net/pasemi_mac.c
===================================================================
--- mainline.orig/drivers/net/pasemi_mac.c
+++ mainline/drivers/net/pasemi_mac.c
@@ -69,6 +69,10 @@
#define RX_DESC_INFO(mac, num) ((mac)->rx->desc_info[(num) & (RX_RING_SIZE-1)])
#define RX_BUFF(mac, num) ((mac)->rx->buffers[(num) & (RX_RING_SIZE-1)])
+#define RING_USED(ring) (((ring)->next_to_fill - (ring)->next_to_clean) \
+ & ((ring)->size - 1))
+#define RING_AVAIL(ring) ((ring->size) - RING_USED(ring))
+
#define BUF_SIZE 1646 /* 1500 MTU + ETH_HLEN + VLAN_HLEN + 2 64B cachelines */
MODULE_LICENSE("GPL");
@@ -184,6 +188,7 @@ static int pasemi_mac_setup_rx_resources
spin_lock_init(&ring->lock);
+ ring->size = RX_RING_SIZE;
ring->desc_info = kzalloc(sizeof(struct pasemi_mac_buffer) *
RX_RING_SIZE, GFP_KERNEL);
@@ -263,6 +268,7 @@ static int pasemi_mac_setup_tx_resources
spin_lock_init(&ring->lock);
+ ring->size = TX_RING_SIZE;
ring->desc_info = kzalloc(sizeof(struct pasemi_mac_buffer) *
TX_RING_SIZE, GFP_KERNEL);
if (!ring->desc_info)
@@ -291,7 +297,7 @@ static int pasemi_mac_setup_tx_resources
PAS_DMA_TXCHAN_CFG_UP |
PAS_DMA_TXCHAN_CFG_WT(2));
- ring->next_to_use = 0;
+ ring->next_to_fill = 0;
ring->next_to_clean = 0;
snprintf(ring->irq_name, sizeof(ring->irq_name),
@@ -386,9 +392,7 @@ static void pasemi_mac_replenish_rx_ring
int start = mac->rx->next_to_fill;
unsigned int limit, count;
- limit = (mac->rx->next_to_clean + RX_RING_SIZE -
- mac->rx->next_to_fill) & (RX_RING_SIZE - 1);
-
+ limit = RING_AVAIL(mac->rx);
/* Check to see if we're doing first-time setup */
if (unlikely(mac->rx->next_to_clean == 0 && mac->rx->next_to_fill == 0))
limit = RX_RING_SIZE;
@@ -572,7 +576,7 @@ restart:
spin_lock_irqsave(&mac->tx->lock, flags);
start = mac->tx->next_to_clean;
- limit = min(mac->tx->next_to_use, start+32);
+ limit = min(mac->tx->next_to_fill, start+32);
count = 0;
@@ -1013,14 +1017,13 @@ static int pasemi_mac_start_tx(struct sk
spin_lock_irqsave(&txring->lock, flags);
- if (txring->next_to_clean - txring->next_to_use == TX_RING_SIZE) {
+ if (RING_AVAIL(txring) <= 1) {
spin_unlock_irqrestore(&txring->lock, flags);
pasemi_mac_clean_tx(mac);
pasemi_mac_restart_tx_intr(mac);
spin_lock_irqsave(&txring->lock, flags);
- if (txring->next_to_clean - txring->next_to_use ==
- TX_RING_SIZE) {
+ if (RING_AVAIL(txring) <= 1) {
/* Still no room -- stop the queue and wait for tx
* intr when there's room.
*/
@@ -1029,15 +1032,15 @@ static int pasemi_mac_start_tx(struct sk
}
}
- dp = &TX_DESC(mac, txring->next_to_use);
- info = &TX_DESC_INFO(mac, txring->next_to_use);
+ dp = &TX_DESC(mac, txring->next_to_fill);
+ info = &TX_DESC_INFO(mac, txring->next_to_fill);
dp->mactx = mactx;
dp->ptr = ptr;
info->dma = map;
info->skb = skb;
- txring->next_to_use++;
+ txring->next_to_fill++;
mac->stats.tx_packets++;
mac->stats.tx_bytes += skb->len;
Index: mainline/drivers/net/pasemi_mac.h
===================================================================
--- mainline.orig/drivers/net/pasemi_mac.h
+++ mainline/drivers/net/pasemi_mac.h
@@ -31,7 +31,7 @@ struct pasemi_mac_txring {
struct pas_dma_xct_descr *desc;
dma_addr_t dma;
unsigned int size;
- unsigned int next_to_use;
+ unsigned int next_to_fill;
unsigned int next_to_clean;
struct pasemi_mac_buffer *desc_info;
char irq_name[10]; /* "eth%d tx" */
--
^ permalink raw reply
* [PATCH] [07/10] pasemi_mac: Enable LLTX
From: Olof Johansson @ 2007-08-22 14:13 UTC (permalink / raw)
To: jgarzik; +Cc: netdev, linuxppc-dev
In-Reply-To: <20070817205413.548020000@lixom.net>
Enable LLTX on pasemi_mac: we're already doing sufficient locking
in the driver to enable it.
Signed-off-by: Olof Johansson <olof@lixom.net>
Index: mainline/drivers/net/pasemi_mac.c
===================================================================
--- mainline.orig/drivers/net/pasemi_mac.c
+++ mainline/drivers/net/pasemi_mac.c
@@ -1235,7 +1235,7 @@ pasemi_mac_probe(struct pci_dev *pdev, c
dev->set_multicast_list = pasemi_mac_set_rx_mode;
dev->weight = 64;
dev->poll = pasemi_mac_poll;
- dev->features = NETIF_F_HW_CSUM;
+ dev->features = NETIF_F_HW_CSUM | NETIF_F_LLTX;
err = pasemi_mac_map_regs(mac);
if (err)
--
^ permalink raw reply
* [PATCH] [06/10] pasemi_mac: Batch up TX buffer frees
From: Olof Johansson @ 2007-08-22 14:13 UTC (permalink / raw)
To: jgarzik; +Cc: netdev, linuxppc-dev
In-Reply-To: <20070817205413.548020000@lixom.net>
Postpone pci unmap and skb free of the transmitted buffers to outside of
the tx ring lock, batching them up 32 at a time.
Also increase the count threshold to 128.
Signed-off-by: Olof Johansson <olof@lixom.net>
Index: mainline/drivers/net/pasemi_mac.c
===================================================================
--- mainline.orig/drivers/net/pasemi_mac.c
+++ mainline/drivers/net/pasemi_mac.c
@@ -561,37 +561,56 @@ static int pasemi_mac_clean_tx(struct pa
int i;
struct pasemi_mac_buffer *info;
struct pas_dma_xct_descr *dp;
- int start, count;
+ unsigned int start, count, limit;
+ unsigned int total_count;
int flags;
+ struct sk_buff *skbs[32];
+ dma_addr_t dmas[32];
+ total_count = 0;
+restart:
spin_lock_irqsave(&mac->tx->lock, flags);
start = mac->tx->next_to_clean;
+ limit = min(mac->tx->next_to_use, start+32);
+
count = 0;
- for (i = start; i < mac->tx->next_to_use; i++) {
+ for (i = start; i < limit; i++) {
dp = &TX_DESC(mac, i);
+
if (unlikely(dp->mactx & XCT_MACTX_O))
+ /* Not yet transmitted */
break;
- count++;
-
info = &TX_DESC_INFO(mac, i);
-
- pci_unmap_single(mac->dma_pdev, info->dma,
- info->skb->len, PCI_DMA_TODEVICE);
- dev_kfree_skb_irq(info->skb);
+ skbs[count] = info->skb;
+ dmas[count] = info->dma;
info->skb = NULL;
info->dma = 0;
dp->mactx = 0;
dp->ptr = 0;
+
+ count++;
}
mac->tx->next_to_clean += count;
spin_unlock_irqrestore(&mac->tx->lock, flags);
netif_wake_queue(mac->netdev);
- return count;
+ for (i = 0; i < count; i++) {
+ pci_unmap_single(mac->dma_pdev, dmas[i],
+ skbs[i]->len, PCI_DMA_TODEVICE);
+ dev_kfree_skb_irq(skbs[i]);
+ }
+
+ total_count += count;
+
+ /* If the batch was full, try to clean more */
+ if (count == 32)
+ goto restart;
+
+ return total_count;
}
@@ -787,7 +806,7 @@ static int pasemi_mac_open(struct net_de
PAS_IOB_DMA_RXCH_CFG_CNTTH(0));
write_iob_reg(mac, PAS_IOB_DMA_TXCH_CFG(mac->dma_txch),
- PAS_IOB_DMA_TXCH_CFG_CNTTH(32));
+ PAS_IOB_DMA_TXCH_CFG_CNTTH(128));
/* Clear out any residual packet count state from firmware */
pasemi_mac_restart_rx_intr(mac);
--
^ permalink raw reply
* [PATCH] [05/10] pasemi_mac: RX performance tweaks
From: Olof Johansson @ 2007-08-22 14:12 UTC (permalink / raw)
To: jgarzik; +Cc: netdev, linuxppc-dev
In-Reply-To: <20070817205413.548020000@lixom.net>
Various RX performance tweaks, do some explicit prefetching of packet
data, etc.
Signed-off-by: Olof Johansson <olof@lixom.net>
Index: mainline/drivers/net/pasemi_mac.c
===================================================================
--- mainline.orig/drivers/net/pasemi_mac.c
+++ mainline/drivers/net/pasemi_mac.c
@@ -481,6 +481,7 @@ static int pasemi_mac_clean_rx(struct pa
rmb();
dp = &RX_DESC(mac, n);
+ prefetchw(dp);
macrx = dp->macrx;
if (!(macrx & XCT_MACRX_O))
@@ -502,8 +503,10 @@ static int pasemi_mac_clean_rx(struct pa
if (info->dma == dma)
break;
}
+ prefetchw(info);
skb = info->skb;
+ prefetchw(skb);
info->dma = 0;
pci_unmap_single(mac->dma_pdev, dma, skb->len,
@@ -526,9 +529,7 @@ static int pasemi_mac_clean_rx(struct pa
skb_put(skb, len);
- skb->protocol = eth_type_trans(skb, mac->netdev);
-
- if ((macrx & XCT_MACRX_HTY_M) == XCT_MACRX_HTY_IPV4_OK) {
+ if (likely((macrx & XCT_MACRX_HTY_M) == XCT_MACRX_HTY_IPV4_OK)) {
skb->ip_summed = CHECKSUM_COMPLETE;
skb->csum = (macrx & XCT_MACRX_CSUM_M) >>
XCT_MACRX_CSUM_S;
@@ -538,6 +539,7 @@ static int pasemi_mac_clean_rx(struct pa
mac->stats.rx_bytes += len;
mac->stats.rx_packets++;
+ skb->protocol = eth_type_trans(skb, mac->netdev);
netif_receive_skb(skb);
dp->ptr = 0;
@@ -569,7 +571,7 @@ static int pasemi_mac_clean_tx(struct pa
for (i = start; i < mac->tx->next_to_use; i++) {
dp = &TX_DESC(mac, i);
- if (!dp || (dp->mactx & XCT_MACTX_O))
+ if (unlikely(dp->mactx & XCT_MACTX_O))
break;
count++;
@@ -957,7 +959,7 @@ static int pasemi_mac_start_tx(struct sk
struct pasemi_mac_txring *txring;
struct pasemi_mac_buffer *info;
struct pas_dma_xct_descr *dp;
- u64 dflags;
+ u64 dflags, mactx, ptr;
dma_addr_t map;
int flags;
@@ -985,6 +987,9 @@ static int pasemi_mac_start_tx(struct sk
if (dma_mapping_error(map))
return NETDEV_TX_BUSY;
+ mactx = dflags | XCT_MACTX_LLEN(skb->len);
+ ptr = XCT_PTR_LEN(skb->len) | XCT_PTR_ADDR(map);
+
txring = mac->tx;
spin_lock_irqsave(&txring->lock, flags);
@@ -1005,12 +1010,11 @@ static int pasemi_mac_start_tx(struct sk
}
}
-
dp = &TX_DESC(mac, txring->next_to_use);
info = &TX_DESC_INFO(mac, txring->next_to_use);
- dp->mactx = dflags | XCT_MACTX_LLEN(skb->len);
- dp->ptr = XCT_PTR_LEN(skb->len) | XCT_PTR_ADDR(map);
+ dp->mactx = mactx;
+ dp->ptr = ptr;
info->dma = map;
info->skb = skb;
--
^ permalink raw reply
* [PATCH] [04/10] pasemi_mac: Fix memcpy amount for short receives
From: Olof Johansson @ 2007-08-22 14:12 UTC (permalink / raw)
To: jgarzik; +Cc: netdev, linuxppc-dev
In-Reply-To: <20070817205413.548020000@lixom.net>
Fix up memcpy for short receives.
Signed-off-by: Olof Johansson <olof@lixom.net>
Index: mainline/drivers/net/pasemi_mac.c
===================================================================
--- mainline.orig/drivers/net/pasemi_mac.c
+++ mainline/drivers/net/pasemi_mac.c
@@ -516,9 +516,7 @@ static int pasemi_mac_clean_rx(struct pa
netdev_alloc_skb(mac->netdev, len + NET_IP_ALIGN);
if (new_skb) {
skb_reserve(new_skb, NET_IP_ALIGN);
- memcpy(new_skb->data - NET_IP_ALIGN,
- skb->data - NET_IP_ALIGN,
- len + NET_IP_ALIGN);
+ memcpy(new_skb->data, skb->data, len);
/* save the skb in buffer_info as good */
skb = new_skb;
}
--
^ permalink raw reply
* [PATCH] [03/10] pasemi_mac: Enable L2 caching of packet headers
From: Olof Johansson @ 2007-08-22 14:12 UTC (permalink / raw)
To: jgarzik; +Cc: netdev, linuxppc-dev
In-Reply-To: <20070817205413.548020000@lixom.net>
Enable settings to target l2 for the first few cachelines of the packet, since
we'll access them to get to the various headers.
Signed-off-by: Olof Johansson <olof@lixom.net>
Index: mainline/drivers/net/pasemi_mac.c
===================================================================
--- mainline.orig/drivers/net/pasemi_mac.c
+++ mainline/drivers/net/pasemi_mac.c
@@ -216,7 +216,7 @@ static int pasemi_mac_setup_rx_resources
PAS_DMA_RXCHAN_BASEU_SIZ(RX_RING_SIZE >> 2));
write_dma_reg(mac, PAS_DMA_RXCHAN_CFG(chan_id),
- PAS_DMA_RXCHAN_CFG_HBU(1));
+ PAS_DMA_RXCHAN_CFG_HBU(2));
write_dma_reg(mac, PAS_DMA_RXINT_BASEL(mac->dma_if),
PAS_DMA_RXINT_BASEL_BRBL(__pa(ring->buffers)));
@@ -225,6 +225,9 @@ static int pasemi_mac_setup_rx_resources
PAS_DMA_RXINT_BASEU_BRBH(__pa(ring->buffers) >> 32) |
PAS_DMA_RXINT_BASEU_SIZ(RX_RING_SIZE >> 3));
+ write_dma_reg(mac, PAS_DMA_RXINT_CFG(mac->dma_if),
+ PAS_DMA_RXINT_CFG_DHL(2));
+
ring->next_to_fill = 0;
ring->next_to_clean = 0;
Index: mainline/drivers/net/pasemi_mac.h
===================================================================
--- mainline.orig/drivers/net/pasemi_mac.h
+++ mainline/drivers/net/pasemi_mac.h
@@ -218,6 +218,14 @@ enum {
#define PAS_DMA_RXINT_RCMDSTA_ACT 0x00010000
#define PAS_DMA_RXINT_RCMDSTA_DROPS_M 0xfffe0000
#define PAS_DMA_RXINT_RCMDSTA_DROPS_S 17
+#define PAS_DMA_RXINT_CFG(i) (0x204+(i)*_PAS_DMA_RXINT_STRIDE)
+#define PAS_DMA_RXINT_CFG_DHL_M 0x07000000
+#define PAS_DMA_RXINT_CFG_DHL_S 24
+#define PAS_DMA_RXINT_CFG_DHL(x) (((x) << PAS_DMA_RXINT_CFG_DHL_S) & \
+ PAS_DMA_RXINT_CFG_DHL_M)
+#define PAS_DMA_RXINT_CFG_WIF 0x00000002
+#define PAS_DMA_RXINT_CFG_WIL 0x00000001
+
#define PAS_DMA_RXINT_INCR(i) (0x210+(i)*_PAS_DMA_RXINT_STRIDE)
#define PAS_DMA_RXINT_INCR_INCR_M 0x0000ffff
#define PAS_DMA_RXINT_INCR_INCR_S 0
--
^ permalink raw reply
* [PATCH] [02/10] pasemi_mac: Stop using the pci config space accessors for register read/writes
From: Olof Johansson @ 2007-08-22 14:12 UTC (permalink / raw)
To: jgarzik; +Cc: netdev, linuxppc-dev
In-Reply-To: <20070817205413.548020000@lixom.net>
Move away from using the pci config access functions for simple register
access. Our device has all of the registers in the config space (hey,
from the hardware point of view it looks reasonable :-), so we need to
somehow get to it. Newer firmwares have it in the device tree such that
we can just get it and ioremap it there (in case it ever moves in future
products). For now, provide a hardcoded fallback for older firmwares.
Signed-off-by: Olof Johansson <olof@lixom.net>
Index: mainline/drivers/net/pasemi_mac.c
===================================================================
--- mainline.orig/drivers/net/pasemi_mac.c
+++ mainline/drivers/net/pasemi_mac.c
@@ -81,46 +81,47 @@ MODULE_PARM_DESC(debug, "PA Semi MAC bit
static struct pasdma_status *dma_status;
-static unsigned int read_iob_reg(struct pasemi_mac *mac, unsigned int reg)
+static inline unsigned int read_iob_reg(struct pasemi_mac *mac, unsigned int reg)
{
unsigned int val;
- pci_read_config_dword(mac->iob_pdev, reg, &val);
+ val = in_le32(mac->iob_regs+reg);
+
return val;
}
-static void write_iob_reg(struct pasemi_mac *mac, unsigned int reg,
+static inline void write_iob_reg(struct pasemi_mac *mac, unsigned int reg,
unsigned int val)
{
- pci_write_config_dword(mac->iob_pdev, reg, val);
+ out_le32(mac->iob_regs+reg, val);
}
-static unsigned int read_mac_reg(struct pasemi_mac *mac, unsigned int reg)
+static inline unsigned int read_mac_reg(struct pasemi_mac *mac, unsigned int reg)
{
unsigned int val;
- pci_read_config_dword(mac->pdev, reg, &val);
+ val = in_le32(mac->regs+reg);
return val;
}
-static void write_mac_reg(struct pasemi_mac *mac, unsigned int reg,
+static inline void write_mac_reg(struct pasemi_mac *mac, unsigned int reg,
unsigned int val)
{
- pci_write_config_dword(mac->pdev, reg, val);
+ out_le32(mac->regs+reg, val);
}
-static unsigned int read_dma_reg(struct pasemi_mac *mac, unsigned int reg)
+static inline unsigned int read_dma_reg(struct pasemi_mac *mac, unsigned int reg)
{
unsigned int val;
- pci_read_config_dword(mac->dma_pdev, reg, &val);
+ val = in_le32(mac->dma_regs+reg);
return val;
}
-static void write_dma_reg(struct pasemi_mac *mac, unsigned int reg,
+static inline void write_dma_reg(struct pasemi_mac *mac, unsigned int reg,
unsigned int val)
{
- pci_write_config_dword(mac->dma_pdev, reg, val);
+ out_le32(mac->dma_regs+reg, val);
}
static int pasemi_get_mac_addr(struct pasemi_mac *mac)
@@ -585,7 +586,6 @@ static int pasemi_mac_clean_tx(struct pa
}
mac->tx->next_to_clean += count;
spin_unlock_irqrestore(&mac->tx->lock, flags);
-
netif_wake_queue(mac->netdev);
return count;
@@ -1076,6 +1076,73 @@ static int pasemi_mac_poll(struct net_de
}
}
+static inline void __iomem * __devinit map_onedev(struct pci_dev *p, int index)
+{
+ struct device_node *dn;
+ void __iomem *ret;
+
+ dn = pci_device_to_OF_node(p);
+ if (!dn)
+ goto fallback;
+
+ ret = of_iomap(dn, index);
+ if (!ret)
+ goto fallback;
+
+ return ret;
+fallback:
+ /* This is hardcoded and ugly, but we have some firmware versions
+ * who don't provide the register space in the device tree. Luckily
+ * they are at well-known locations so we can just do the math here.
+ */
+ return ioremap(0xe0000000 + (p->devfn << 12), 0x2000);
+}
+
+static int __devinit pasemi_mac_map_regs(struct pasemi_mac *mac)
+{
+ struct resource res;
+ struct device_node *dn;
+ int err;
+
+ mac->dma_pdev = pci_get_device(PCI_VENDOR_ID_PASEMI, 0xa007, NULL);
+ if (!mac->dma_pdev) {
+ dev_err(&mac->pdev->dev, "Can't find DMA Controller\n");
+ return -ENODEV;
+ }
+
+ mac->iob_pdev = pci_get_device(PCI_VENDOR_ID_PASEMI, 0xa001, NULL);
+ if (!mac->iob_pdev) {
+ dev_err(&mac->pdev->dev, "Can't find I/O Bridge\n");
+ return -ENODEV;
+ }
+
+ mac->regs = map_onedev(mac->pdev, 0);
+ mac->dma_regs = map_onedev(mac->dma_pdev, 0);
+ mac->iob_regs = map_onedev(mac->iob_pdev, 0);
+
+ if (!mac->regs || !mac->dma_regs || !mac->iob_regs) {
+ dev_err(&mac->pdev->dev, "Can't map registers\n");
+ return -ENODEV;
+ }
+
+ /* The dma status structure is located in the I/O bridge, and
+ * is cache coherent.
+ */
+ if (!dma_status) {
+ dn = pci_device_to_OF_node(mac->iob_pdev);
+ if (dn)
+ err = of_address_to_resource(dn, 1, &res);
+ if (!dn || err) {
+ /* Fallback for old firmware */
+ res.start = 0xfd800000;
+ res.end = res.start + 0x1000;
+ }
+ dma_status = __ioremap(res.start, res.end-res.start, 0);
+ }
+
+ return 0;
+}
+
static int __devinit
pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{
@@ -1104,21 +1171,6 @@ pasemi_mac_probe(struct pci_dev *pdev, c
mac->pdev = pdev;
mac->netdev = dev;
- mac->dma_pdev = pci_get_device(PCI_VENDOR_ID_PASEMI, 0xa007, NULL);
-
- if (!mac->dma_pdev) {
- dev_err(&pdev->dev, "Can't find DMA Controller\n");
- err = -ENODEV;
- goto out_free_netdev;
- }
-
- mac->iob_pdev = pci_get_device(PCI_VENDOR_ID_PASEMI, 0xa001, NULL);
-
- if (!mac->iob_pdev) {
- dev_err(&pdev->dev, "Can't find I/O Bridge\n");
- err = -ENODEV;
- goto out_put_dma_pdev;
- }
/* These should come out of the device tree eventually */
mac->dma_txch = index;
@@ -1161,12 +1213,9 @@ pasemi_mac_probe(struct pci_dev *pdev, c
dev->poll = pasemi_mac_poll;
dev->features = NETIF_F_HW_CSUM;
- /* The dma status structure is located in the I/O bridge, and
- * is cache coherent.
- */
- if (!dma_status)
- /* XXXOJN This should come from the device tree */
- dma_status = __ioremap(0xfd800000, 0x1000, 0);
+ err = pasemi_mac_map_regs(mac);
+ if (err)
+ goto out;
mac->rx_status = &dma_status->rx_sta[mac->dma_rxch];
mac->tx_status = &dma_status->tx_sta[mac->dma_txch];
@@ -1193,10 +1242,17 @@ pasemi_mac_probe(struct pci_dev *pdev, c
return err;
out:
- pci_dev_put(mac->iob_pdev);
-out_put_dma_pdev:
- pci_dev_put(mac->dma_pdev);
-out_free_netdev:
+ if (mac->iob_pdev)
+ pci_dev_put(mac->iob_pdev);
+ if (mac->dma_pdev)
+ pci_dev_put(mac->dma_pdev);
+ if (mac->dma_regs)
+ iounmap(mac->dma_regs);
+ if (mac->iob_regs)
+ iounmap(mac->iob_regs);
+ if (mac->regs)
+ iounmap(mac->regs);
+
free_netdev(dev);
out_disable_device:
pci_disable_device(pdev);
@@ -1220,6 +1276,10 @@ static void __devexit pasemi_mac_remove(
pci_dev_put(mac->dma_pdev);
pci_dev_put(mac->iob_pdev);
+ iounmap(mac->regs);
+ iounmap(mac->dma_regs);
+ iounmap(mac->iob_regs);
+
pci_set_drvdata(pdev, NULL);
free_netdev(netdev);
}
Index: mainline/drivers/net/pasemi_mac.h
===================================================================
--- mainline.orig/drivers/net/pasemi_mac.h
+++ mainline/drivers/net/pasemi_mac.h
@@ -52,6 +52,9 @@ struct pasemi_mac_rxring {
struct pasemi_mac {
struct net_device *netdev;
+ void __iomem *regs;
+ void __iomem *dma_regs;
+ void __iomem *iob_regs;
struct pci_dev *pdev;
struct pci_dev *dma_pdev;
struct pci_dev *iob_pdev;
--
^ permalink raw reply
* [PATCH] [01/10] pasemi_mac: Abstract out register access
From: Olof Johansson @ 2007-08-22 14:12 UTC (permalink / raw)
To: jgarzik; +Cc: netdev, linuxppc-dev
In-Reply-To: <20070817205413.548020000@lixom.net>
Abstract out the PCI config read/write accesses into reg read/write ones,
still calling the pci accessors on the back end.
Signed-off-by: Olof Johansson <olof@lixom.net>
Index: mainline/drivers/net/pasemi_mac.c
===================================================================
--- mainline.orig/drivers/net/pasemi_mac.c
+++ mainline/drivers/net/pasemi_mac.c
@@ -81,6 +81,48 @@ MODULE_PARM_DESC(debug, "PA Semi MAC bit
static struct pasdma_status *dma_status;
+static unsigned int read_iob_reg(struct pasemi_mac *mac, unsigned int reg)
+{
+ unsigned int val;
+
+ pci_read_config_dword(mac->iob_pdev, reg, &val);
+ return val;
+}
+
+static void write_iob_reg(struct pasemi_mac *mac, unsigned int reg,
+ unsigned int val)
+{
+ pci_write_config_dword(mac->iob_pdev, reg, val);
+}
+
+static unsigned int read_mac_reg(struct pasemi_mac *mac, unsigned int reg)
+{
+ unsigned int val;
+
+ pci_read_config_dword(mac->pdev, reg, &val);
+ return val;
+}
+
+static void write_mac_reg(struct pasemi_mac *mac, unsigned int reg,
+ unsigned int val)
+{
+ pci_write_config_dword(mac->pdev, reg, val);
+}
+
+static unsigned int read_dma_reg(struct pasemi_mac *mac, unsigned int reg)
+{
+ unsigned int val;
+
+ pci_read_config_dword(mac->dma_pdev, reg, &val);
+ return val;
+}
+
+static void write_dma_reg(struct pasemi_mac *mac, unsigned int reg,
+ unsigned int val)
+{
+ pci_write_config_dword(mac->dma_pdev, reg, val);
+}
+
static int pasemi_get_mac_addr(struct pasemi_mac *mac)
{
struct pci_dev *pdev = mac->pdev;
@@ -166,22 +208,21 @@ static int pasemi_mac_setup_rx_resources
memset(ring->buffers, 0, RX_RING_SIZE * sizeof(u64));
- pci_write_config_dword(mac->dma_pdev, PAS_DMA_RXCHAN_BASEL(chan_id),
- PAS_DMA_RXCHAN_BASEL_BRBL(ring->dma));
+ write_dma_reg(mac, PAS_DMA_RXCHAN_BASEL(chan_id), PAS_DMA_RXCHAN_BASEL_BRBL(ring->dma));
+
+ write_dma_reg(mac, PAS_DMA_RXCHAN_BASEU(chan_id),
+ PAS_DMA_RXCHAN_BASEU_BRBH(ring->dma >> 32) |
+ PAS_DMA_RXCHAN_BASEU_SIZ(RX_RING_SIZE >> 2));
+
+ write_dma_reg(mac, PAS_DMA_RXCHAN_CFG(chan_id),
+ PAS_DMA_RXCHAN_CFG_HBU(1));
- pci_write_config_dword(mac->dma_pdev, PAS_DMA_RXCHAN_BASEU(chan_id),
- PAS_DMA_RXCHAN_BASEU_BRBH(ring->dma >> 32) |
- PAS_DMA_RXCHAN_BASEU_SIZ(RX_RING_SIZE >> 2));
-
- pci_write_config_dword(mac->dma_pdev, PAS_DMA_RXCHAN_CFG(chan_id),
- PAS_DMA_RXCHAN_CFG_HBU(1));
-
- pci_write_config_dword(mac->dma_pdev, PAS_DMA_RXINT_BASEL(mac->dma_if),
- PAS_DMA_RXINT_BASEL_BRBL(__pa(ring->buffers)));
-
- pci_write_config_dword(mac->dma_pdev, PAS_DMA_RXINT_BASEU(mac->dma_if),
- PAS_DMA_RXINT_BASEU_BRBH(__pa(ring->buffers) >> 32) |
- PAS_DMA_RXINT_BASEU_SIZ(RX_RING_SIZE >> 3));
+ write_dma_reg(mac, PAS_DMA_RXINT_BASEL(mac->dma_if),
+ PAS_DMA_RXINT_BASEL_BRBL(__pa(ring->buffers)));
+
+ write_dma_reg(mac, PAS_DMA_RXINT_BASEU(mac->dma_if),
+ PAS_DMA_RXINT_BASEU_BRBH(__pa(ring->buffers) >> 32) |
+ PAS_DMA_RXINT_BASEU_SIZ(RX_RING_SIZE >> 3));
ring->next_to_fill = 0;
ring->next_to_clean = 0;
@@ -233,18 +274,18 @@ static int pasemi_mac_setup_tx_resources
memset(ring->desc, 0, TX_RING_SIZE * sizeof(struct pas_dma_xct_descr));
- pci_write_config_dword(mac->dma_pdev, PAS_DMA_TXCHAN_BASEL(chan_id),
- PAS_DMA_TXCHAN_BASEL_BRBL(ring->dma));
+ write_dma_reg(mac, PAS_DMA_TXCHAN_BASEL(chan_id),
+ PAS_DMA_TXCHAN_BASEL_BRBL(ring->dma));
val = PAS_DMA_TXCHAN_BASEU_BRBH(ring->dma >> 32);
val |= PAS_DMA_TXCHAN_BASEU_SIZ(TX_RING_SIZE >> 2);
- pci_write_config_dword(mac->dma_pdev, PAS_DMA_TXCHAN_BASEU(chan_id), val);
+ write_dma_reg(mac, PAS_DMA_TXCHAN_BASEU(chan_id), val);
- pci_write_config_dword(mac->dma_pdev, PAS_DMA_TXCHAN_CFG(chan_id),
- PAS_DMA_TXCHAN_CFG_TY_IFACE |
- PAS_DMA_TXCHAN_CFG_TATTR(mac->dma_if) |
- PAS_DMA_TXCHAN_CFG_UP |
- PAS_DMA_TXCHAN_CFG_WT(2));
+ write_dma_reg(mac, PAS_DMA_TXCHAN_CFG(chan_id),
+ PAS_DMA_TXCHAN_CFG_TY_IFACE |
+ PAS_DMA_TXCHAN_CFG_TATTR(mac->dma_if) |
+ PAS_DMA_TXCHAN_CFG_UP |
+ PAS_DMA_TXCHAN_CFG_WT(2));
ring->next_to_use = 0;
ring->next_to_clean = 0;
@@ -383,12 +424,8 @@ static void pasemi_mac_replenish_rx_ring
wmb();
- pci_write_config_dword(mac->dma_pdev,
- PAS_DMA_RXCHAN_INCR(mac->dma_rxch),
- limit - count);
- pci_write_config_dword(mac->dma_pdev,
- PAS_DMA_RXINT_INCR(mac->dma_if),
- limit - count);
+ write_dma_reg(mac, PAS_DMA_RXCHAN_INCR(mac->dma_rxch), limit - count);
+ write_dma_reg(mac, PAS_DMA_RXINT_INCR(mac->dma_if), limit - count);
mac->rx->next_to_fill += limit - count;
}
@@ -404,9 +441,7 @@ static void pasemi_mac_restart_rx_intr(s
reg = PAS_IOB_DMA_RXCH_RESET_PCNT(pcnt) | PAS_IOB_DMA_RXCH_RESET_PINTC;
- pci_write_config_dword(mac->iob_pdev,
- PAS_IOB_DMA_RXCH_RESET(mac->dma_rxch),
- reg);
+ write_iob_reg(mac, PAS_IOB_DMA_RXCH_RESET(mac->dma_rxch), reg);
}
static void pasemi_mac_restart_tx_intr(struct pasemi_mac *mac)
@@ -418,8 +453,7 @@ static void pasemi_mac_restart_tx_intr(s
reg = PAS_IOB_DMA_TXCH_RESET_PCNT(pcnt) | PAS_IOB_DMA_TXCH_RESET_PINTC;
- pci_write_config_dword(mac->iob_pdev,
- PAS_IOB_DMA_TXCH_RESET(mac->dma_txch), reg);
+ write_iob_reg(mac, PAS_IOB_DMA_TXCH_RESET(mac->dma_txch), reg);
}
@@ -574,8 +608,6 @@ static irqreturn_t pasemi_mac_rx_intr(in
* all others.
*/
- pci_read_config_dword(mac->dma_pdev, PAS_DMA_RXINT_RCMDSTA(mac->dma_if), ®);
-
reg = 0;
if (*mac->rx_status & PAS_STATUS_SOFT)
reg |= PAS_IOB_DMA_RXCH_RESET_SINTC;
@@ -586,9 +618,7 @@ static irqreturn_t pasemi_mac_rx_intr(in
netif_rx_schedule(dev);
- pci_write_config_dword(mac->iob_pdev,
- PAS_IOB_DMA_RXCH_RESET(mac->dma_rxch), reg);
-
+ write_iob_reg(mac, PAS_IOB_DMA_RXCH_RESET(mac->dma_rxch), reg);
return IRQ_HANDLED;
}
@@ -613,9 +643,7 @@ static irqreturn_t pasemi_mac_tx_intr(in
if (*mac->tx_status & PAS_STATUS_ERROR)
reg |= PAS_IOB_DMA_TXCH_RESET_DINTC;
- pci_write_config_dword(mac->iob_pdev,
- PAS_IOB_DMA_TXCH_RESET(mac->dma_txch),
- reg);
+ write_iob_reg(mac, PAS_IOB_DMA_TXCH_RESET(mac->dma_txch), reg);
return IRQ_HANDLED;
}
@@ -641,7 +669,7 @@ static void pasemi_adjust_link(struct ne
} else
netif_carrier_on(dev);
- pci_read_config_dword(mac->pdev, PAS_MAC_CFG_PCFG, &flags);
+ flags = read_mac_reg(mac, PAS_MAC_CFG_PCFG);
new_flags = flags & ~(PAS_MAC_CFG_PCFG_HD | PAS_MAC_CFG_PCFG_SPD_M |
PAS_MAC_CFG_PCFG_TSR_M);
@@ -673,7 +701,7 @@ static void pasemi_adjust_link(struct ne
mac->link = mac->phydev->link;
if (new_flags != flags)
- pci_write_config_dword(mac->pdev, PAS_MAC_CFG_PCFG, new_flags);
+ write_mac_reg(mac, PAS_MAC_CFG_PCFG, new_flags);
if (msg && netif_msg_link(mac))
printk(KERN_INFO "%s: Link is up at %d Mbps, %s duplex.\n",
@@ -736,39 +764,37 @@ static int pasemi_mac_open(struct net_de
int ret;
/* enable rx section */
- pci_write_config_dword(mac->dma_pdev, PAS_DMA_COM_RXCMD,
- PAS_DMA_COM_RXCMD_EN);
+ write_dma_reg(mac, PAS_DMA_COM_RXCMD, PAS_DMA_COM_RXCMD_EN);
/* enable tx section */
- pci_write_config_dword(mac->dma_pdev, PAS_DMA_COM_TXCMD,
- PAS_DMA_COM_TXCMD_EN);
+ write_dma_reg(mac, PAS_DMA_COM_TXCMD, PAS_DMA_COM_TXCMD_EN);
flags = PAS_MAC_CFG_TXP_FCE | PAS_MAC_CFG_TXP_FPC(3) |
PAS_MAC_CFG_TXP_SL(3) | PAS_MAC_CFG_TXP_COB(0xf) |
PAS_MAC_CFG_TXP_TIFT(8) | PAS_MAC_CFG_TXP_TIFG(12);
- pci_write_config_dword(mac->pdev, PAS_MAC_CFG_TXP, flags);
+ write_mac_reg(mac, PAS_MAC_CFG_TXP, flags);
flags = PAS_MAC_CFG_PCFG_S1 | PAS_MAC_CFG_PCFG_PE |
PAS_MAC_CFG_PCFG_PR | PAS_MAC_CFG_PCFG_CE;
flags |= PAS_MAC_CFG_PCFG_TSR_1G | PAS_MAC_CFG_PCFG_SPD_1G;
- pci_write_config_dword(mac->iob_pdev, PAS_IOB_DMA_RXCH_CFG(mac->dma_rxch),
- PAS_IOB_DMA_RXCH_CFG_CNTTH(0));
+ write_iob_reg(mac, PAS_IOB_DMA_RXCH_CFG(mac->dma_rxch),
+ PAS_IOB_DMA_RXCH_CFG_CNTTH(0));
- pci_write_config_dword(mac->iob_pdev, PAS_IOB_DMA_TXCH_CFG(mac->dma_txch),
- PAS_IOB_DMA_TXCH_CFG_CNTTH(32));
+ write_iob_reg(mac, PAS_IOB_DMA_TXCH_CFG(mac->dma_txch),
+ PAS_IOB_DMA_TXCH_CFG_CNTTH(32));
/* Clear out any residual packet count state from firmware */
pasemi_mac_restart_rx_intr(mac);
pasemi_mac_restart_tx_intr(mac);
/* 0xffffff is max value, about 16ms */
- pci_write_config_dword(mac->iob_pdev, PAS_IOB_DMA_COM_TIMEOUTCFG,
- PAS_IOB_DMA_COM_TIMEOUTCFG_TCNT(0xffffff));
+ write_iob_reg(mac, PAS_IOB_DMA_COM_TIMEOUTCFG,
+ PAS_IOB_DMA_COM_TIMEOUTCFG_TCNT(0xffffff));
- pci_write_config_dword(mac->pdev, PAS_MAC_CFG_PCFG, flags);
+ write_mac_reg(mac, PAS_MAC_CFG_PCFG, flags);
ret = pasemi_mac_setup_rx_resources(dev);
if (ret)
@@ -778,25 +804,22 @@ static int pasemi_mac_open(struct net_de
if (ret)
goto out_tx_resources;
- pci_write_config_dword(mac->pdev, PAS_MAC_IPC_CHNL,
- PAS_MAC_IPC_CHNL_DCHNO(mac->dma_rxch) |
- PAS_MAC_IPC_CHNL_BCH(mac->dma_rxch));
+ write_mac_reg(mac, PAS_MAC_IPC_CHNL,
+ PAS_MAC_IPC_CHNL_DCHNO(mac->dma_rxch) |
+ PAS_MAC_IPC_CHNL_BCH(mac->dma_rxch));
/* enable rx if */
- pci_write_config_dword(mac->dma_pdev,
- PAS_DMA_RXINT_RCMDSTA(mac->dma_if),
- PAS_DMA_RXINT_RCMDSTA_EN);
+ write_dma_reg(mac, PAS_DMA_RXINT_RCMDSTA(mac->dma_if),
+ PAS_DMA_RXINT_RCMDSTA_EN);
/* enable rx channel */
- pci_write_config_dword(mac->dma_pdev,
- PAS_DMA_RXCHAN_CCMDSTA(mac->dma_rxch),
- PAS_DMA_RXCHAN_CCMDSTA_EN |
- PAS_DMA_RXCHAN_CCMDSTA_DU);
+ write_dma_reg(mac, PAS_DMA_RXCHAN_CCMDSTA(mac->dma_rxch),
+ PAS_DMA_RXCHAN_CCMDSTA_EN |
+ PAS_DMA_RXCHAN_CCMDSTA_DU);
/* enable tx channel */
- pci_write_config_dword(mac->dma_pdev,
- PAS_DMA_TXCHAN_TCMDSTA(mac->dma_txch),
- PAS_DMA_TXCHAN_TCMDSTA_EN);
+ write_dma_reg(mac, PAS_DMA_TXCHAN_TCMDSTA(mac->dma_txch),
+ PAS_DMA_TXCHAN_TCMDSTA_EN);
pasemi_mac_replenish_rx_ring(dev);
@@ -875,20 +898,12 @@ static int pasemi_mac_close(struct net_d
pasemi_mac_clean_rx(mac, RX_RING_SIZE);
/* Disable interface */
- pci_write_config_dword(mac->dma_pdev,
- PAS_DMA_TXCHAN_TCMDSTA(mac->dma_txch),
- PAS_DMA_TXCHAN_TCMDSTA_ST);
- pci_write_config_dword(mac->dma_pdev,
- PAS_DMA_RXINT_RCMDSTA(mac->dma_if),
- PAS_DMA_RXINT_RCMDSTA_ST);
- pci_write_config_dword(mac->dma_pdev,
- PAS_DMA_RXCHAN_CCMDSTA(mac->dma_rxch),
- PAS_DMA_RXCHAN_CCMDSTA_ST);
+ write_dma_reg(mac, PAS_DMA_TXCHAN_TCMDSTA(mac->dma_txch), PAS_DMA_TXCHAN_TCMDSTA_ST);
+ write_dma_reg(mac, PAS_DMA_RXINT_RCMDSTA(mac->dma_if), PAS_DMA_RXINT_RCMDSTA_ST);
+ write_dma_reg(mac, PAS_DMA_RXCHAN_CCMDSTA(mac->dma_rxch), PAS_DMA_RXCHAN_CCMDSTA_ST);
for (retries = 0; retries < MAX_RETRIES; retries++) {
- pci_read_config_dword(mac->dma_pdev,
- PAS_DMA_TXCHAN_TCMDSTA(mac->dma_txch),
- &stat);
+ stat = read_dma_reg(mac, PAS_DMA_TXCHAN_TCMDSTA(mac->dma_txch));
if (!(stat & PAS_DMA_TXCHAN_TCMDSTA_ACT))
break;
cond_resched();
@@ -898,9 +913,7 @@ static int pasemi_mac_close(struct net_d
dev_err(&mac->dma_pdev->dev, "Failed to stop tx channel\n");
for (retries = 0; retries < MAX_RETRIES; retries++) {
- pci_read_config_dword(mac->dma_pdev,
- PAS_DMA_RXCHAN_CCMDSTA(mac->dma_rxch),
- &stat);
+ stat = read_dma_reg(mac, PAS_DMA_RXCHAN_CCMDSTA(mac->dma_rxch));
if (!(stat & PAS_DMA_RXCHAN_CCMDSTA_ACT))
break;
cond_resched();
@@ -910,9 +923,7 @@ static int pasemi_mac_close(struct net_d
dev_err(&mac->dma_pdev->dev, "Failed to stop rx channel\n");
for (retries = 0; retries < MAX_RETRIES; retries++) {
- pci_read_config_dword(mac->dma_pdev,
- PAS_DMA_RXINT_RCMDSTA(mac->dma_if),
- &stat);
+ stat = read_dma_reg(mac, PAS_DMA_RXINT_RCMDSTA(mac->dma_if));
if (!(stat & PAS_DMA_RXINT_RCMDSTA_ACT))
break;
cond_resched();
@@ -925,12 +936,9 @@ static int pasemi_mac_close(struct net_d
* stopping, since you can't disable when active.
*/
- pci_write_config_dword(mac->dma_pdev,
- PAS_DMA_TXCHAN_TCMDSTA(mac->dma_txch), 0);
- pci_write_config_dword(mac->dma_pdev,
- PAS_DMA_RXCHAN_CCMDSTA(mac->dma_rxch), 0);
- pci_write_config_dword(mac->dma_pdev,
- PAS_DMA_RXINT_RCMDSTA(mac->dma_if), 0);
+ write_dma_reg(mac, PAS_DMA_TXCHAN_TCMDSTA(mac->dma_txch), 0);
+ write_dma_reg(mac, PAS_DMA_RXCHAN_CCMDSTA(mac->dma_rxch), 0);
+ write_dma_reg(mac, PAS_DMA_RXINT_RCMDSTA(mac->dma_if), 0);
free_irq(mac->tx_irq, dev);
free_irq(mac->rx_irq, dev);
@@ -1011,8 +1019,7 @@ static int pasemi_mac_start_tx(struct sk
spin_unlock_irqrestore(&txring->lock, flags);
- pci_write_config_dword(mac->dma_pdev,
- PAS_DMA_TXCHAN_INCR(mac->dma_txch), 1);
+ write_dma_reg(mac, PAS_DMA_TXCHAN_INCR(mac->dma_txch), 1);
return NETDEV_TX_OK;
@@ -1035,7 +1042,7 @@ static void pasemi_mac_set_rx_mode(struc
struct pasemi_mac *mac = netdev_priv(dev);
unsigned int flags;
- pci_read_config_dword(mac->pdev, PAS_MAC_CFG_PCFG, &flags);
+ flags = read_mac_reg(mac, PAS_MAC_CFG_PCFG);
/* Set promiscuous */
if (dev->flags & IFF_PROMISC)
@@ -1043,7 +1050,7 @@ static void pasemi_mac_set_rx_mode(struc
else
flags &= ~PAS_MAC_CFG_PCFG_PR;
- pci_write_config_dword(mac->pdev, PAS_MAC_CFG_PCFG, flags);
+ write_mac_reg(mac, PAS_MAC_CFG_PCFG, flags);
}
--
^ permalink raw reply
* [PATCH] [00/10] pasemi_mac patches for 2.6.24
From: Olof Johansson @ 2007-08-22 14:12 UTC (permalink / raw)
To: jgarzik; +Cc: netdev, linuxppc-dev
Hi,
pasemi_mac patches for 2.6.24:
01/10: pasemi_mac: Abstract out register access
02/10: pasemi_mac: Stop using the pci config space accessors for register read/writes
03/10: pasemi_mac: Enable L2 caching of packet headers
04/10: pasemi_mac: Fix memcpy amount for short receives
05/10: pasemi_mac: RX performance tweaks
06/10: pasemi_mac: Batch up TX buffer frees
07/10: pasemi_mac: Enable LLTX
08/10: pasemi_mac: Fix TX ring wrap checking
09/10: pasemi_mac: Fix RX checksum flags
10/10: pasemi_mac: Clean TX ring in poll
Thanks,
Olof
--
^ permalink raw reply
* Re: [PATCH v6 0/2] SPI support for fsl_soc and mpc832x_rdb
From: Kumar Gala @ 2007-08-22 15:01 UTC (permalink / raw)
To: avorontsov; +Cc: linuxppc-dev
In-Reply-To: <20070822145415.GA22595@localhost.localdomain>
On Aug 22, 2007, at 9:54 AM, Anton Vorontsov wrote:
> On Wed, Aug 22, 2007 at 09:22:47AM -0500, Kumar Gala wrote:
>>
>> On Aug 21, 2007, at 10:27 AM, Anton Vorontsov wrote:
>>
>>> On Tue, Aug 21, 2007 at 05:45:37PM +0400, Anton Vorontsov wrote:
>>>> Hi all,
>>>>
>>>> Thanks for the previous reviews, this is v4 against Linus' tree,
>>>> as of today.
>>>
>>> Okay, here is brand-new, shiny v5. Today and only today it comes
>>> without section mismatch warnings, don't miss your chance. Get it
>>> free of charge! ;-)
>>
>> This looks good, have some minor cleanup nits.
>
> Much thanks, fixed.
np. Do you know what effect the modalias being wrong has on current
functionality? and when mmc_spi gets added?
- k
^ permalink raw reply
* Re: Patches added to powerpc.git for-2.6.24 branch
From: Kumar Gala @ 2007-08-22 14:59 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev@ozlabs.org list
In-Reply-To: <653AD812-D186-4876-BF52-F3A5D887B82E@kernel.crashing.org>
On Aug 22, 2007, at 8:25 AM, Kumar Gala wrote:
> How do we want to handle the include cleanup I've got.
>
> I know you'd like some way of showing it complete. Any ideas?
So I did the following:
1. generate a file listing of asm-powerpc vs asm-ppc and diff them to
find all files in asm-ppc not in asm-powerpc (after my patches)
2. count the number of references using the following grep:
grep -r asm/ppcboot.h . | grep -v arch/ppc | grep -v include/asm-ppc
| grep -v arch/[a-o,q-z] | grep -v include/asm-[a-o,q-z] | wc -l
I get the following results:
0: asm/amigappc.h
0: asm/gg2.h
0: asm/gt64260_defs.h
0: asm/gt64260.h
0: asm/harrier.h
0: asm/hawk_defs.h
0: asm/hawk.h
0: asm/ibm403.h
0: asm/ibm405.h
0: asm/ibm_ocp.h
0: asm/ibm_ocp_pci.h
0: asm/immap_85xx.h
0: asm/m8260_pci.h
0: asm/md.h
0: asm/mk48t59.h
0: asm/mpc10x.h
0: asm/mpc8260_pci9.h
0: asm/mv64x60_defs.h
0: asm/mv64x60.h
0: asm/ocp_ids.h
0: asm/open_pic.h
0: asm/pc_serial.h
0: asm/pnp.h
0: asm/ppc4xx_dma.h
0: asm/ppc4xx_pic.h
0: asm/ppc_sys.h
0: asm/prep_nvram.h
0: asm/raven.h
0: asm/rio.h
0: asm/todc.h
1: asm/amipcmcia.h
1: asm/mpc83xx.h
1: asm/residual.h
1: asm/zorro.h
2: asm/amigayle.h
2: asm/ppcboot.h
3: asm/ibm4xx.h
4: asm/ibm44x.h
4: asm/traps.h
8: asm/ocp.h
12: asm/bootinfo.h
29: asm/amigaints.h
32: asm/amigahw.h
I think we can all agree that the amiga*.h, zorro.h and traps.h can
be ignored since they have to do with amiga/apus support.
I'll take a look at the following and see what's going on:
1: asm/mpc83xx.h
1: asm/residual.h
2: asm/ppcboot.h
3: asm/ibm4xx.h
4: asm/ibm44x.h
8: asm/ocp.h
12: asm/bootinfo.h
- k
^ permalink raw reply
* [PATCH v6 2/2] [POWERPC] MPC832x_RDB: update dts to use SPI1 in QE, register mmc_spi stub
From: Anton Vorontsov @ 2007-08-22 14:57 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <20070822145415.GA22595@localhost.localdomain>
mmc_spi already tested to work. When it will hit mainline
the only change that will be needed is replacing "spidev"
with "mmc_spi".
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
arch/powerpc/boot/dts/mpc832x_rdb.dts | 2 +-
arch/powerpc/platforms/83xx/mpc832x_rdb.c | 50 +++++++++++++++++++++++++++++
2 files changed, 51 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts b/arch/powerpc/boot/dts/mpc832x_rdb.dts
index e9c332f..1ac0025 100644
--- a/arch/powerpc/boot/dts/mpc832x_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts
@@ -211,7 +211,7 @@
reg = <4c0 40>;
interrupts = <2>;
interrupt-parent = <&qeic>;
- mode = "cpu";
+ mode = "cpu-qe";
};
spi@500 {
diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
index e021b08..305ec7d 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
@@ -15,6 +15,7 @@
*/
#include <linux/pci.h>
+#include <linux/spi/spi.h>
#include <asm/of_platform.h>
#include <asm/time.h>
@@ -22,6 +23,7 @@
#include <asm/udbg.h>
#include <asm/qe.h>
#include <asm/qe_ic.h>
+#include <sysdev/fsl_soc.h>
#include "mpc83xx.h"
@@ -32,6 +34,54 @@
#define DBG(fmt...)
#endif
+extern int par_io_data_set(u8 port, u8 pin, u8 val);
+extern int par_io_config_pin(u8 port, u8 pin, int dir, int open_drain,
+ int assignment, int has_irq);
+
+static void mpc83xx_spi_activate_cs(u8 cs, u8 polarity)
+{
+ pr_debug("%s %d %d\n", __func__, cs, polarity);
+ par_io_data_set(3, 13, polarity);
+}
+
+static void mpc83xx_spi_deactivate_cs(u8 cs, u8 polarity)
+{
+ pr_debug("%s %d %d\n", __func__, cs, polarity);
+ par_io_data_set(3, 13, !polarity);
+}
+
+static struct spi_board_info mpc832x_spi_boardinfo = {
+ .bus_num = 0x4c0,
+ .chip_select = 0,
+ .max_speed_hz = 50000000,
+ /*
+ * XXX: This is spidev (spi in userspace) stub, should
+ * be replaced by "mmc_spi" when mmc_spi will hit mainline.
+ */
+ .modalias = "spidev",
+};
+
+static int __init mpc832x_spi_init(void)
+{
+ if (!machine_is(mpc832x_rdb))
+ return 0;
+
+ par_io_config_pin(3, 0, 3, 0, 1, 0); /* SPI1 MOSI, I/O */
+ par_io_config_pin(3, 1, 3, 0, 1, 0); /* SPI1 MISO, I/O */
+ par_io_config_pin(3, 2, 3, 0, 1, 0); /* SPI1 CLK, I/O */
+ par_io_config_pin(3, 3, 2, 0, 1, 0); /* SPI1 SEL, I */
+
+ par_io_config_pin(3, 13, 1, 0, 0, 0); /* !SD_CS, O */
+ par_io_config_pin(3, 14, 2, 0, 0, 0); /* SD_INSERT, I */
+ par_io_config_pin(3, 15, 2, 0, 0, 0); /* SD_PROTECT,I */
+
+ return fsl_spi_init(&mpc832x_spi_boardinfo, 1,
+ mpc83xx_spi_activate_cs,
+ mpc83xx_spi_deactivate_cs);
+}
+
+device_initcall(mpc832x_spi_init);
+
/* ************************************************************************
*
* Setup the architecture
--
1.5.0.6
^ permalink raw reply related
* [PATCH v6 1/2] [POWERPC] fsl_soc: add support for fsl_spi
From: Anton Vorontsov @ 2007-08-22 14:57 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <20070822145415.GA22595@localhost.localdomain>
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
arch/powerpc/sysdev/fsl_soc.c | 81 +++++++++++++++++++++++++++++++++++++++++
arch/powerpc/sysdev/fsl_soc.h | 7 ++++
2 files changed, 88 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index 1cf29c9..473b45b 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -24,6 +24,7 @@
#include <linux/platform_device.h>
#include <linux/of_platform.h>
#include <linux/phy.h>
+#include <linux/spi/spi.h>
#include <linux/fsl_devices.h>
#include <linux/fs_enet_pd.h>
#include <linux/fs_uart_pd.h>
@@ -1187,3 +1188,83 @@ err:
arch_initcall(cpm_smc_uart_of_init);
#endif /* CONFIG_8xx */
+
+int __init fsl_spi_init(struct spi_board_info *board_infos,
+ unsigned int num_board_infos,
+ void (*activate_cs)(u8 cs, u8 polarity),
+ void (*deactivate_cs)(u8 cs, u8 polarity))
+{
+ struct device_node *np;
+ unsigned int i;
+ u32 sysclk;
+
+ np = of_find_node_by_type(NULL, "qe");
+ if (!np)
+ return -ENODEV;
+
+ sysclk = *(u32 *)of_get_property(np, "bus-frequency", NULL);
+
+ for (np = NULL, i = 1;
+ (np = of_find_compatible_node(np, "spi", "fsl_spi")) != NULL;
+ i++) {
+ int ret = 0;
+ unsigned int j;
+ const char *mode;
+ struct resource res[2];
+ struct platform_device *pdev;
+ struct fsl_spi_platform_data pdata = {
+ .activate_cs = activate_cs,
+ .deactivate_cs = deactivate_cs,
+ };
+
+ memset(res, 0, sizeof(res));
+
+ mode = of_get_property(np, "mode", NULL);
+ pdata.sysclk = sysclk;
+ pdata.bus_num = *(u32 *)of_get_property(np, "reg", NULL);
+
+ for (j = 0; j < num_board_infos; j++) {
+ if (board_infos[j].bus_num == pdata.bus_num)
+ pdata.max_chipselect++;
+ }
+
+ if (!pdata.max_chipselect)
+ goto err;
+
+ if (!strcmp(mode, "cpu-qe"))
+ pdata.qe_mode = 1;
+
+ ret = of_address_to_resource(np, 0, &res[0]);
+ if (ret)
+ goto err;
+
+ ret = of_irq_to_resource(np, 0, &res[1]);
+ if (ret == NO_IRQ)
+ goto err;
+
+ pdev = platform_device_alloc("mpc83xx_spi", i);
+ if (!pdev)
+ goto err;
+
+ ret = platform_device_add_data(pdev, &pdata, sizeof(pdata));
+ if (ret)
+ goto unreg;
+
+ ret = platform_device_add_resources(pdev, res,
+ ARRAY_SIZE(res));
+ if (ret)
+ goto unreg;
+
+ ret = platform_device_register(pdev);
+ if (ret)
+ goto unreg;
+
+ continue;
+unreg:
+ platform_device_del(pdev);
+err:
+ continue;
+ }
+
+ return spi_register_board_info(board_infos, num_board_infos);
+}
diff --git a/arch/powerpc/sysdev/fsl_soc.h b/arch/powerpc/sysdev/fsl_soc.h
index 04e145b..618d91d 100644
--- a/arch/powerpc/sysdev/fsl_soc.h
+++ b/arch/powerpc/sysdev/fsl_soc.h
@@ -8,5 +8,12 @@ extern phys_addr_t get_immrbase(void);
extern u32 get_brgfreq(void);
extern u32 get_baudrate(void);
+struct spi_board_info;
+
+extern int fsl_spi_init(struct spi_board_info *board_infos,
+ unsigned int num_board_infos,
+ void (*activate_cs)(u8 cs, u8 polarity),
+ void (*deactivate_cs)(u8 cs, u8 polarity));
+
#endif
#endif
--
1.5.0.6
^ permalink raw reply related
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