kernel ported from ELDK 3.0 hangs (loops in idled()) on my custom MPC870 Board

2005-06-06 Thread Edward Hong
On 6/4/05, Wolfgang Denk wd at denx.de wrote:
 
 With beginning of init you mean init() in init/main.c, right?
 So gets rest_init() called?
 Did you add a few printk's to start_kernel()?
 How far does it get?
 
Yes. rest_init() got called and executed kernel_thread(init,...) ...
and got into cpu_idle().
  Any suggestions for debugging?
 
 Attach a BDI2000 and start GDB...
 
I have a BDI2000. But I am not sure how to further debug in my
situation since I know the kernel execution was looping inside
idled().

Thank you!

Edward



STP implementation on Linux

2005-06-06 Thread Vijay Padiyar
Hi

I wanted to know whether the Linux 2.6 kernel has an implementation of the
STP protocol, and if so, where can I find the relevant code.

Regards

Vijay Padiyar

http://www.vijaypadiyar.eu.tf



[Fwd: Re: Getting ownership for various boards/platforms configs]

2005-06-06 Thread Wojciech Kromer

-- next part --
An embedded message was scrubbed...
From: Allen Curtis [EMAIL PROTECTED]
Subject: Re: Getting ownership for various boards/platforms configs
Date: Fri, 3 Jun 2005 07:27:41 -0700
Size: 2933
Url: 
http://ozlabs.org/pipermail/linuxppc-embedded/attachments/20050606/e13acbfb/attachment.eml
 


Reseting bootcount from linux

2005-06-06 Thread Tore Martin Hagen
Hi,

I am using a MPC8266ADS-PCI board and u-boot with the
CONFIG_BOOTCOUNT_LIMIT. If i stop u-boot before it starts Linux I can
see that the bootcount variable increments nicely. But if i dump the 
content from flash (dd if=/dev/mtd/1 of=a1out bs=1k) and check the 
content it is always
bootcount=1

So how can I reset the bootcount if it is always 1, or rather where is
the real bootcount stored?

/Tore

**



STP implementation on Linux

2005-06-06 Thread Stefan Nickl
On Mon, 2005-06-06 at 11:10 +0530, Vijay Padiyar wrote:
 Hi
 
 I wanted to know whether the Linux 2.6 kernel has an implementation of the
 STP protocol, and if so, where can I find the relevant code.
 
 Regards
 
 Vijay Padiyar

Spanning tree protocol:
/usr/src/linux/net/bridge/br_stp*

-- 
Stefan Nickl
Kontron Modular Computers





Reseting bootcount from linux

2005-06-06 Thread Wolfgang Denk
Dear Tore,

in message 42A3F015.5020203 at oslo.westerngeco.slb.com you wrote:
 
 I am using a MPC8266ADS-PCI board and u-boot with the
 CONFIG_BOOTCOUNT_LIMIT. If i stop u-boot before it starts Linux I can
 see that the bootcount variable increments nicely. But if i dump the 
 content from flash (dd if=/dev/mtd/1 of=a1out bs=1k) and check the 
 content it is always
 bootcount=1

The environment copy in flash gets  stored  only  when  you  run  the
saveenv  command,  but  bootcount gets updated automagically upon
each boot, so even if you would change the flash contents  this  does
ot matter.

 So how can I reset the bootcount if it is always 1, or rather where is
 the real bootcount stored?

See function bootcount_store() in cpu/mpc8260/commproc.c; see also
include/common.h for the definition of BOOTCOUNT_MAGIC and
include/asm-ppc/cpm_8260.h for CPM_BOOTCOUNT_ADDR.


Please find attached some code (courtesy of Steffen Rumler) that  can
be  used  to  reset  the  boot  counter  under  Linux using the /proc
interface.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
If that makes any sense to you, you have a big problem.
  -- C. Durance, Computer Science 234

-- next part --
A non-text attachment was scrubbed...
Name: ubootBootcountAccess.c
Type: application/octet-stream
Size: 3970 bytes
Desc: ubootBootcountAccess.c
Url : 
http://ozlabs.org/pipermail/linuxppc-embedded/attachments/20050606/ec19d461/attachment.obj
 


Help on the data rate on MPC5200 ethernet

2005-06-06 Thread Minh Nguyen
Use iperf. You can find the source code at http://dast.nlanr.net/Projects/Iperf/

mkt

On 6/5/05, Jarno Manninen jarno.manninen at tut.fi wrote:
 On Sunday 05 June 2005 17:09, xuetao wrote:
 
  I am testing the tcp/ip data communication data rate on MPC5200. The UDP
  data rate is up to 80Mbps and TCP data rate is only 10Mbps? I test the TCP
  data rate with FTP file traslation. Any body know the problem on this?
 
 The mass storage may be the limiting factor here, ofcourse depending on your
 configuration. Anyhow I've found NTTCP test utility usefull for simple
 testing purposes. There's propably some other test suites floating around
 too.
 
 - Jarno
 ___
 Linuxppc-embedded mailing list
 Linuxppc-embedded at ozlabs.org
 https://ozlabs.org/mailman/listinfo/linuxppc-embedded




Subject: PPC8272 - FCC2 transmitter underrun

2005-06-06 Thread Udi Rasiuk
Subject: PPC8272 - FCC2 transmitter underrun

Description: On a board with PPC8272 we get transmitter underrun interrupt 
from the FCC2.

The BD and Buffers are on an external RAM on the 60x.

It looks like getting the READY bit in the current BD with a perfectly good 
Buffer immidiatly brings up the interrupt.

 
 
there are two underrun reasons :

1.
If TxBD[L] (last buffer in the frame) is cleared when the end of the BD is 
reached and the
transmitter moves immediately to the next buffer to begin transmission. Failure 
to provide the
next buffer in time causes a transmit underrun.


2.
If the CPM is heavy loaded and (because of bus latency) the SDMA cannot fill 
the FIFO
from external memory, a transmit underrun occurs.  
 
But i've stepped with an ice and checked both -looked at the L bit and halted 
the cpu right after the setting of the Ready bit.
-- next part --
An HTML attachment was scrubbed...
URL: 
http://ozlabs.org/pipermail/linuxppc-embedded/attachments/20050606/18206aa1/attachment.htm
 


Subject: PPC8272 - FCC2 transmitter underrun

2005-06-06 Thread [EMAIL PROTECTED]

Udi,

You need to switch your Hebrew email program to Left-to-Right mode if you
expect anyone other than Leonardo DaVinci to read your post. ;-)

Roberto Waltman
RFL Electronics Inc.




[PATCH] [1/2] PM support for Ebony

2005-06-06 Thread Geoff Levand
Eugene Surovegin wrote:
 On Fri, Jun 03, 2005 at 04:22:40PM -0700, Geoff Levand wrote:
 
 [snip]
 
 
+ /* save current CPM */
+ cpm_save_er = mfdcr(DCRN_CPC0_ER);
+
+ /* save UIC0 enable registers */
+ uic_save_er = mfdcr(DCRN_UIC_ER(UIC0));
+
+#ifdef USE_ETHER_TO_RESUME
+ mtdcr(DCRN_UIC_ER(UIC0), UIC0_EIR5_BIT|UIC0_UIC1NC_BIT);
+#else
+ /* mask UIC0 interrupts, except External Intr #5 */
+ mtdcr(DCRN_UIC_ER(UIC0), UIC0_EIR5_BIT);
+#endif
 
 
 Why UIC PM code is here and not in ppc4xx_pic.c? I don't think this is 
 the right place to mess with UIC registers.
 

Yes, that is resonable.  Maybe something like ppc4xx_pic_suspend() 
and ppc4xx_pic_resume().

 
 
===
--- linux-2.6.12-bhpm.orig/arch/ppc/platforms/4xx/ibm440gp_sleep.S
 
 2005-06-01 08:52:49.947684744 -0700
 
+++ linux-2.6.12-bhpm/arch/ppc/platforms/4xx/ibm440gp_sleep.S
 
 2005-06-03 16:15:07.0 -0700
 
 I think it should be in arch/ppc/syslib not in arch/ppc/platforms/4xx.
 

I was thinking the same...

I want to do some cleanup of the debugging code and reformat the text, 
then I'll post a new version with these changes.

-Geoff



[PATCH] [1/2] PM support for Ebony

2005-06-06 Thread Geoff Levand
Eugene Surovegin wrote:
 On Fri, Jun 03, 2005 at 04:22:40PM -0700, Geoff Levand wrote:
 
 [snip]
 
 
+ /* save current CPM */
+ cpm_save_er = mfdcr(DCRN_CPC0_ER);
+
+ /* save UIC0 enable registers */
+ uic_save_er = mfdcr(DCRN_UIC_ER(UIC0));
+
+#ifdef USE_ETHER_TO_RESUME
+ mtdcr(DCRN_UIC_ER(UIC0), UIC0_EIR5_BIT|UIC0_UIC1NC_BIT);
+#else
+ /* mask UIC0 interrupts, except External Intr #5 */
+ mtdcr(DCRN_UIC_ER(UIC0), UIC0_EIR5_BIT);
+#endif
 
 
 Why UIC PM code is here and not in ppc4xx_pic.c? I don't think this is 
 the right place to mess with UIC registers.
 
 [snip]
 
 
===
--- linux-2.6.12-bhpm.orig/arch/ppc/platforms/4xx/ibm440gp_sleep.S
 
 2005-06-01 08:52:49.947684744 -0700
 
+++ linux-2.6.12-bhpm/arch/ppc/platforms/4xx/ibm440gp_sleep.S
 
 2005-06-03 16:15:07.0 -0700
 
 I think it should be in arch/ppc/syslib not in arch/ppc/platforms/4xx.
 

Here's a cleaned-up version.  I moved ibm440gp_sleep.S into syslib 
and put a declaration in ibm440gp_common.h.  I also made two new 
pm suspend/resume routines in ppc4xx_pic.c.

I was thinking to add a static variable in ppc4xx_pic.c to hold the 
state, that way the arch pm code doesn't need to take care of it, 
which will make suspend to disk easier since the value will be 
saved in the system image.  I'm not sure which way to go.  Any 
comments?

-Geoff


* pm-on-ebony.patch 

This patch provides power management support for the IBM PPC440GP Ebony 
Reference Platform.  The main portion of the patch implements the platform 
specific pm_ops structure required by the kernel power management sub-system.  
The current implementation only supports suspend-to-memory (PM_SUSPEND_MEM), 
though unpublished suspend-to-disk work has been started.

This implementation arranges for the U44 switch on the Ebony platform, 
connected to the SMI interrupt handler, to be used as a system resume trigger.

Signed-off-by: Geoff Levand geoffrey.levand at am.sony.com for CELF

--
Index: linux-2.6.12-bhpm/arch/ppc/platforms/4xx/Kconfig
===
--- linux-2.6.12-bhpm.orig/arch/ppc/platforms/4xx/Kconfig   2005-06-06 
09:29:06.0 -0700
+++ linux-2.6.12-bhpm/arch/ppc/platforms/4xx/Kconfig2005-06-06 
09:32:24.0 -0700
@@ -214,10 +214,6 @@
depends on 4xx
default y
 
-config PM
-   bool Power Management support (EXPERIMENTAL)
-   depends on 4xx  EXPERIMENTAL
-
 choice
prompt TTYS0 device and default console
depends on 40x
Index: linux-2.6.12-bhpm/arch/ppc/platforms/4xx/Makefile
===
--- linux-2.6.12-bhpm.orig/arch/ppc/platforms/4xx/Makefile  2005-06-06 
09:29:06.0 -0700
+++ linux-2.6.12-bhpm/arch/ppc/platforms/4xx/Makefile   2005-06-06 
09:32:24.0 -0700
@@ -25,3 +25,6 @@
 obj-$(CONFIG_405EP)+= ibm405ep.o
 obj-$(CONFIG_405GPR)   += ibm405gpr.o
 obj-$(CONFIG_VIRTEX_II_PRO)+= virtex-ii_pro.o
+ifeq ($(CONFIG_PM),y)
+obj-$(CONFIG_EBONY)+= ebony_pm.o
+endif
Index: linux-2.6.12-bhpm/arch/ppc/platforms/4xx/ebony_pm.c
===
--- linux-2.6.12-bhpm.orig/arch/ppc/platforms/4xx/ebony_pm.c2005-06-01 
08:52:49.947684744 -0700
+++ linux-2.6.12-bhpm/arch/ppc/platforms/4xx/ebony_pm.c 2005-06-06 
10:42:42.0 -0700
@@ -0,0 +1,192 @@
+/*
+ * ebony_pm.c - This file contains the PM functions for Ebony.
+ *
+ *  Copyright 2004,2005 Sony Corp.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; version 2 of the License.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include linux/types.h
+#include linux/suspend.h
+#include linux/errno.h
+#include linux/interrupt.h
+#include asm/ibm44x.h
+#include asm/ppc4xx_pic.h
+
+#undef DEBUG
+#undef ENABLE_WAKE_ON_LAN
+
+#define IBM_CPM_ALL (IBM_CPM_IIC0 | IBM_CPM_IIC1 | IBM_CPM_PCI | IBM_CPM_CPU  \
+   | IBM_CPM_DMA | IBM_CPM_BGO | IBM_CPM_BGI | IBM_CPM_EBC | IBM_CPM_EBM \
+   | IBM_CPM_DMC | IBM_CPM_PLB | IBM_CPM_SRAM  |  IBM_CPM_PPM\
+   | IBM_CPM_UIC1 | IBM_CPM_GPIO0 | IBM_CPM_UART0 | IBM_CPM_UART1\
+   | IBM_CPM_UIC0 | IBM_CPM_TMRCLK)
+
+#define UIC0_EIR5_BIT (1(31-28)) /* External Intr 5  == SMI */
+#define UIC0_UIC1NC_BIT (1(31-30))
+
+#if defined(DEBUG)
+#define 

[PATCH] [1/2] PM support for Ebony

2005-06-06 Thread Eugene Surovegin
On Mon, Jun 06, 2005 at 11:05:56AM -0700, Geoff Levand wrote:
 I was thinking to add a static variable in ppc4xx_pic.c to hold the 
 state, that way the arch pm code doesn't need to take care of it, 
 which will make suspend to disk easier since the value will be 
 saved in the system image.  I'm not sure which way to go.  Any 
 comments?

I don't have a problem with having static variables for PM in 
ppc4xx_pic.c. However, why only one for UIC0? What about UIC1? What 
about UIC2 (for 440GX) ?

Also, function, you just added, uses resume_bits are for UIC0, it's 
not clear from the function prototype why just UIC0. Shouldn't it be 
more generic?

Another note, code in ebony_pm_enter doesn't look very Ebony specific, 
maybe it's would be a good idea to move most of it into ibm440gp_sleep.

-- 
Eugene




kernel ported from ELDK 3.0 hangs (loops in idled()) on my custom MPC870 Board

2005-06-06 Thread Randy Vinson
Edward Hong wrote:
 
 Yes. rest_init() got called and executed kernel_thread(init,...) ...
 and got into cpu_idle().

Hi Edward,
   I've seen these symptoms before. The problem was traced to external 
interrupts being disabled (MSR[EE] not set). Without external 
interrupts, there is no decrementer interrupt (at least on 7xx 
processors). Without the decrementer, there in no system clock tick and 
without the clock tick, the scheduler won't run which means that the 
init task won't start. To verify that this is the problem, use mfmsr() 
to get the MSR and print it. I'd suggest that you add something like:

 printk(MSR = %x\n, mfmsr());

to rest_init just before call to cpu_idle. Or you can use:

 if (irqs_disabled()) printk(

if you don't want to decode the MSR yourself.


Randy Vinson



[PATCH] [1/2] PM support for Ebony

2005-06-06 Thread Geoff Levand
Eugene Surovegin wrote:
 On Mon, Jun 06, 2005 at 11:05:56AM -0700, Geoff Levand wrote:
 
I was thinking to add a static variable in ppc4xx_pic.c to hold the 
state, that way the arch pm code doesn't need to take care of it, 
which will make suspend to disk easier since the value will be 
saved in the system image.  I'm not sure which way to go.  Any 
comments?
 
 
 I don't have a problem with having static variables for PM in 
 ppc4xx_pic.c. However, why only one for UIC0? What about UIC1? What 
 about UIC2 (for 440GX) ?
 
 Also, function, you just added, uses resume_bits are for UIC0, it's 
 not clear from the function prototype why just UIC0. Shouldn't it be 
 more generic?

Well, I guess I was originally only interested in waking up from 
things connected to UIC0...  I'll look at the other interrupts. 

 
 Another note, code in ebony_pm_enter doesn't look very Ebony specific, 
 maybe it's would be a good idea to move most of it into ibm440gp_sleep.
 

My thoughts also, but I'll wait until I see BenH's new design before 
deciding what to do.

-Geoff




kernel ported from ELDK 3.0 hangs (loops in idled()) on my custom MPC870 Board

2005-06-06 Thread Edward Hong
On 6/6/05, Randy Vinson rvinson at mvista.com wrote:
 
 Hi Edward,
   I've seen these symptoms before. The problem was traced to external
 interrupts being disabled (MSR[EE] not set). Without external
 interrupts, there is no decrementer interrupt (at least on 7xx
 processors). Without the decrementer, there in no system clock tick and
 without the clock tick, the scheduler won't run which means that the
 init task won't start. To verify that this is the problem, use mfmsr()
 to get the MSR and print it. I'd suggest that you add something like:
 
 printk(MSR = %x\n, mfmsr());

I got  MSR = 9032 just before cpu_idle which means EE (the most
significant bit) was enabled.

Thank you!

Edward



Verify your PayPal Account

2005-06-06 Thread [EMAIL PROTECTED]
An HTML attachment was scrubbed...
URL: 
http://ozlabs.org/pipermail/linuxppc-embedded/attachments/20050606/ef6121ef/attachment.htm
 


[PATCH][4/5] RapidIO support: ppc32

2005-06-06 Thread Matt Porter
Adds PPC32 RIO support.  Init code for the MPC85xx RIO ports
and glue for the STx GP3 board to use it.

Signed-off-by: Matt Porter mporter at kernel.crashing.org

diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig
--- a/arch/ppc/Kconfig
+++ b/arch/ppc/Kconfig
@@ -1177,6 +1177,14 @@ source drivers/pci/Kconfig
 
 source drivers/pcmcia/Kconfig
 
+config RAPIDIO
+   bool RapidIO support if MPC8540 || MPC8560
+   help
+ If you say Y here, the kernel will include drivers and
+ infrastructure code to support RapidIO interconnect devices.
+
+source drivers/rio/Kconfig
+
 endmenu
 
 menu Advanced setup
diff --git a/arch/ppc/configs/stx_gp3_defconfig 
b/arch/ppc/configs/stx_gp3_defconfig
--- a/arch/ppc/configs/stx_gp3_defconfig
+++ b/arch/ppc/configs/stx_gp3_defconfig
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.11-rc2
-# Wed Jan 26 14:32:58 2005
+# Linux kernel version: 2.6.12-rc4
+# Tue May 24 18:11:04 2005
 #
 CONFIG_MMU=y
 CONFIG_GENERIC_HARDIRQS=y
@@ -11,6 +11,7 @@ CONFIG_HAVE_DEC_LOCK=y
 CONFIG_PPC=y
 CONFIG_PPC32=y
 CONFIG_GENERIC_NVRAM=y
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
 
 #
 # Code maturity level options
@@ -18,6 +19,7 @@ CONFIG_GENERIC_NVRAM=y
 CONFIG_EXPERIMENTAL=y
 CONFIG_CLEAN_COMPILE=y
 CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
 
 #
 # General setup
@@ -29,7 +31,6 @@ CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
 # CONFIG_AUDIT is not set
-CONFIG_LOG_BUF_SHIFT=14
 CONFIG_HOTPLUG=y
 CONFIG_KOBJECT_UEVENT=y
 # CONFIG_IKCONFIG is not set
@@ -37,6 +38,9 @@ CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
 # CONFIG_KALLSYMS_ALL is not set
 # CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -46,6 +50,7 @@ CONFIG_CC_ALIGN_LABELS=0
 CONFIG_CC_ALIGN_LOOPS=0
 CONFIG_CC_ALIGN_JUMPS=0
 # CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
 
 #
 # Loadable module support
@@ -69,9 +74,11 @@ CONFIG_KMOD=y
 CONFIG_E500=y
 CONFIG_BOOKE=y
 CONFIG_FSL_BOOKE=y
+# CONFIG_PHYS_64BIT is not set
 # CONFIG_SPE is not set
 CONFIG_MATH_EMULATION=y
 # CONFIG_CPU_FREQ is not set
+# CONFIG_PM is not set
 CONFIG_85xx=y
 CONFIG_PPC_INDIRECT_PCI_BE=y
 
@@ -96,6 +103,7 @@ CONFIG_HIGHMEM=y
 CONFIG_BINFMT_ELF=y
 CONFIG_BINFMT_MISC=m
 # CONFIG_CMDLINE_BOOL is not set
+CONFIG_ISA_DMA_API=y
 
 #
 # Bus options
@@ -104,15 +112,15 @@ CONFIG_PCI=y
 CONFIG_PCI_DOMAINS=y
 # CONFIG_PCI_LEGACY_PROC is not set
 # CONFIG_PCI_NAMES is not set
+# CONFIG_PCI_DEBUG is not set
 
 #
 # PCCARD (PCMCIA/CardBus) support
 #
 # CONFIG_PCCARD is not set
-
-#
-# PC-card bridges
-#
+CONFIG_RAPIDIO=y
+CONFIG_RAPIDIO_8_BIT_TRANSPORT=y
+CONFIG_RAPIDIO_DISC_TIMEOUT=30
 
 #
 # Advanced setup
@@ -152,7 +160,7 @@ CONFIG_PARPORT=m
 CONFIG_PARPORT_PC=m
 # CONFIG_PARPORT_PC_FIFO is not set
 # CONFIG_PARPORT_PC_SUPERIO is not set
-# CONFIG_PARPORT_OTHER is not set
+# CONFIG_PARPORT_GSC is not set
 # CONFIG_PARPORT_1284 is not set
 
 #
@@ -264,7 +272,6 @@ CONFIG_SCSI_CONSTANTS=y
 # CONFIG_SCSI_BUSLOGIC is not set
 # CONFIG_SCSI_DMX3191D is not set
 # CONFIG_SCSI_EATA is not set
-# CONFIG_SCSI_EATA_PIO is not set
 # CONFIG_SCSI_FUTURE_DOMAIN is not set
 # CONFIG_SCSI_GDTH is not set
 # CONFIG_SCSI_IPS is not set
@@ -274,7 +281,6 @@ CONFIG_SCSI_CONSTANTS=y
 # CONFIG_SCSI_IMM is not set
 # CONFIG_SCSI_SYM53C8XX_2 is not set
 # CONFIG_SCSI_IPR is not set
-# CONFIG_SCSI_QLOGIC_ISP is not set
 # CONFIG_SCSI_QLOGIC_FC is not set
 # CONFIG_SCSI_QLOGIC_1280 is not set
 CONFIG_SCSI_QLA2XXX=m
@@ -283,6 +289,7 @@ CONFIG_SCSI_QLA2XXX=m
 # CONFIG_SCSI_QLA2300 is not set
 # CONFIG_SCSI_QLA2322 is not set
 # CONFIG_SCSI_QLA6312 is not set
+# CONFIG_SCSI_LPFC is not set
 # CONFIG_SCSI_DC395x is not set
 # CONFIG_SCSI_DC390T is not set
 # CONFIG_SCSI_NSP32 is not set
@@ -322,7 +329,6 @@ CONFIG_NET=y
 #
 CONFIG_PACKET=y
 # CONFIG_PACKET_MMAP is not set
-# CONFIG_NETLINK_DEV is not set
 CONFIG_UNIX=y
 # CONFIG_NET_KEY is not set
 CONFIG_INET=y
@@ -431,7 +437,7 @@ CONFIG_IP_NF_NAT_FTP=m
 #
 # Network testing
 #
-# CONFIG_NET_PKTGEN is not set
+CONFIG_NET_PKTGEN=y
 # CONFIG_NETPOLL is not set
 # CONFIG_NET_POLL_CONTROLLER is not set
 # CONFIG_HAMRADIO is not set
@@ -499,6 +505,7 @@ CONFIG_GFAR_NAPI=y
 # Wan interfaces
 #
 # CONFIG_WAN is not set
+CONFIG_RIONET=y
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
 # CONFIG_PLIP is not set
@@ -536,20 +543,6 @@ CONFIG_INPUT_EVDEV=m
 # CONFIG_INPUT_EVBUG is not set
 
 #
-# Input I/O drivers
-#
-# CONFIG_GAMEPORT is not set
-CONFIG_SOUND_GAMEPORT=y
-CONFIG_SERIO=y
-CONFIG_SERIO_I8042=y
-CONFIG_SERIO_SERPORT=y
-# CONFIG_SERIO_CT82C710 is not set
-# CONFIG_SERIO_PARKBD is not set
-# CONFIG_SERIO_PCIPS2 is not set
-CONFIG_SERIO_LIBPS2=y
-# CONFIG_SERIO_RAW is not set
-
-#
 # Input Device Drivers
 #
 CONFIG_INPUT_KEYBOARD=y
@@ -567,6 +560,19 @@ CONFIG_MOUSE_PS2=y
 # CONFIG_INPUT_MISC is not set
 
 #
+# Hardware I/O ports
+#

[PATCH][3/5] RapidIO support: core enum

2005-06-06 Thread Matt Porter
Adds RapidIO enumeration/discovery.

The core code implements enumeration/discovery, management of
devices/resources, and interfaces for RIO drivers.

Signed-off-by: Matt Porter mporter at kernel.crashing.org

diff --git a/drivers/rio/rio-scan.c b/drivers/rio/rio-scan.c
new file mode 100644
--- /dev/null
+++ b/drivers/rio/rio-scan.c
@@ -0,0 +1,960 @@
+/*
+ * RapidIO enumeration and discovery support
+ *
+ * Copyright 2005 MontaVista Software, Inc.
+ * Matt Porter mporter at kernel.crashing.org
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+#include linux/config.h
+#include linux/types.h
+#include linux/kernel.h
+
+#include linux/delay.h
+#include linux/init.h
+#include linux/rio.h
+#include linux/rio_drv.h
+#include linux/rio_ids.h
+#include linux/rio_regs.h
+#include linux/module.h
+#include linux/spinlock.h
+#include linux/timer.h
+
+#include rio.h
+
+LIST_HEAD(rio_devices);
+static LIST_HEAD(rio_switches);
+
+#define RIO_ENUM_CMPL_MAGIC0xdeadbeef
+
+static void rio_enum_timeout(unsigned long);
+
+spinlock_t rio_global_list_lock = SPIN_LOCK_UNLOCKED;
+static int next_destid = 0;
+static int next_switchid = 0;
+static int next_net = 0;
+
+static struct timer_list rio_enum_timer =
+TIMER_INITIALIZER(rio_enum_timeout, 0, 0);
+
+static int rio_mport_phys_table[] = {
+   RIO_EFB_PAR_EP_ID,
+   RIO_EFB_PAR_EP_REC_ID,
+   RIO_EFB_SER_EP_ID,
+   RIO_EFB_SER_EP_REC_ID,
+   -1,
+};
+
+static int rio_sport_phys_table[] = {
+   RIO_EFB_PAR_EP_FREE_ID,
+   RIO_EFB_SER_EP_FREE_ID,
+   -1,
+};
+
+extern struct rio_route_ops __start_rio_route_ops[];
+extern struct rio_route_ops __end_rio_route_ops[];
+
+/**
+ * rio_get_device_id - Get the base/extended device id for a device
+ * @port: RIO master port 
+ * @destid: Destination ID of device
+ * @hopcount: Hopcount to device
+ *
+ * Reads the base/extended device id from a device. Returns the
+ * 8/16-bit device ID.
+ */
+static u16 rio_get_device_id(struct rio_mport *port, u16 destid, u8 hopcount)
+{
+   u32 result;
+
+   rio_mport_read_config_32(port, destid, hopcount, RIO_DID_CSR, result);
+
+   return RIO_GET_DID(result);
+}
+
+/**
+ * rio_set_device_id - Set the base/extended device id for a device
+ * @port: RIO master port 
+ * @destid: Destination ID of device
+ * @hopcount: Hopcount to device
+ * @did: Device ID value to be written
+ *
+ * Writes the base/extended device id from a device.
+ */
+static void
+rio_set_device_id(struct rio_mport *port, u16 destid, u8 hopcount, u16 did)
+{
+   rio_mport_write_config_32(port, destid, hopcount, RIO_DID_CSR,
+ RIO_SET_DID(did));
+}
+
+/**
+ * rio_local_set_device_id - Set the base/extended device id for a port
+ * @port: RIO master port 
+ * @did: Device ID value to be written
+ *
+ * Writes the base/extended device id from a device.
+ */
+static void rio_local_set_device_id(struct rio_mport *port, u16 did)
+{
+   rio_local_write_config_32(port, RIO_DID_CSR, RIO_SET_DID(did));
+}
+
+/**
+ * rio_clear_locks- Release all host locks and signal enumeration complete
+ * @port: Master port to issue transaction
+ *
+ * Marks the component tag CSR on each device with the enumeration
+ * complete flag. When complete, it then release the host locks on
+ * each device. Returns 0 on success or %-EINVAL on failure.
+ */
+static int rio_clear_locks(struct rio_mport *port)
+{
+   struct rio_dev *rdev;
+   u32 result;
+   int ret = 0;
+
+   /* Write component tag CSR magic complete value */
+   rio_local_write_config_32(port, RIO_COMPONENT_TAG_CSR,
+ RIO_ENUM_CMPL_MAGIC);
+   list_for_each_entry(rdev, rio_devices, global_list)
+   rio_write_config_32(rdev, RIO_COMPONENT_TAG_CSR,
+   RIO_ENUM_CMPL_MAGIC);
+
+   /* Release host device id locks */
+   rio_local_write_config_32(port, RIO_HOST_DID_LOCK_CSR,
+ port-host_deviceid);
+   rio_local_read_config_32(port, RIO_HOST_DID_LOCK_CSR, result);
+   if ((result  0x) != 0x) {
+   printk(KERN_INFO
+  RIO: badness when releasing host lock on master port, 
result %8.8x\n,
+  result);
+   ret = -EINVAL;
+   }
+   list_for_each_entry(rdev, rio_devices, global_list) {
+   rio_write_config_32(rdev, RIO_HOST_DID_LOCK_CSR,
+   port-host_deviceid);
+   rio_read_config_32(rdev, RIO_HOST_DID_LOCK_CSR, result);
+   if ((result  0x) != 0x) {
+   printk(KERN_INFO
+  RIO: badness when releasing host lock on vid 
%4.4x did %4.4x\n,
+  

[PATCH][2/5] RapidIO support: core includes

2005-06-06 Thread Matt Porter
Add RapidIO core include files.

The core code implements enumeration/discovery, management of
devices/resources, and interfaces for RIO drivers.

Signed-off-by: Matt Porter mporter at kernel.crashing.org

diff --git a/include/linux/rio.h b/include/linux/rio.h
new file mode 100644
--- /dev/null
+++ b/include/linux/rio.h
@@ -0,0 +1,321 @@
+/*
+ * RapidIO interconnect services
+ * (RapidIO Interconnect Specification, http://www.rapidio.org)
+ *
+ * Copyright 2005 MontaVista Software, Inc.
+ * Matt Porter mporter at kernel.crashing.org
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+#ifndef LINUX_RIO_H
+#define LINUX_RIO_H
+
+#ifdef __KERNEL__
+
+#include linux/types.h
+#include linux/config.h
+#include linux/ioport.h
+#include linux/list.h
+#include linux/errno.h
+#include linux/device.h
+#include linux/rio_regs.h
+
+#define RIO_ANY_DESTID 0xff
+#define RIO_NO_HOPCOUNT-1
+
+#define RIO_MAX_MPORT_RESOURCES16
+#define RIO_MAX_DEV_RESOURCES  16
+
+#define RIO_GLOBAL_TABLE   0xff/* Indicates access of a switch's
+  global routing table if it
+  has multiple (or per port)
+  tables */
+
+#define RIO_INVALID_ROUTE  0xff/* Indicates that a route table
+  entry is invalid (no route
+  exists for the device ID) */
+
+#ifdef CONFIG_RAPIDIO_8_BIT_TRANSPORT
+#define RIO_MAX_ROUTE_ENTRIES  (1  8)
+#else
+#define RIO_MAX_ROUTE_ENTRIES  (1  16)
+#endif
+
+#define RIO_MAX_MBOX   4
+#define RIO_MAX_MSG_SIZE   0x1000
+
+/*
+ * Error values that may be returned by RIO functions.
+ */
+#define RIO_SUCCESSFUL 0x00
+#define RIO_BAD_SIZE   0x81
+
+/*
+ * For RIO devices, the region numbers are assigned this way:
+ *
+ * 0   RapidIO outbound doorbells
+ *  1-15   RapidIO memory regions
+ *
+ * For RIO master ports, the region number are assigned this way:
+ *
+ * 0   RapidIO inbound doorbells
+ * 1   RapidIO inbound mailboxes
+ * 1   RapidIO outbound mailboxes
+ */
+#define RIO_DOORBELL_RESOURCE  0
+#define RIO_INB_MBOX_RESOURCE  1
+#define RIO_OUTB_MBOX_RESOURCE 2
+
+extern struct bus_type rio_bus_type;
+extern struct list_head rio_devices;   /* list of all devices */
+
+struct rio_mport;
+
+/**
+ * struct rio_dev - RIO device info
+ * @global_list: Node in list of all RIO devices
+ * @net_list: Node in list of RIO devices in a network
+ * @net: Network this device is a part of
+ * @did: Device ID
+ * @vid: Vendor ID
+ * @device_rev: Device revision
+ * @asm_did: Assembly device ID
+ * @asm_vid: Assembly vendor ID
+ * @asm_rev: Assembly revision
+ * @efptr: Extended feature pointer
+ * @pef: Processing element features
+ * @swpinfo: Switch port info
+ * @src_ops: Source operation capabilities
+ * @dst_ops: Destination operation capabilities
+ * @rswitch: Pointer to struct rio_switch if valid for this device
+ * @driver: Driver claiming this device
+ * @dev: Device model device
+ * @riores: RIO resources this device owns
+ * @destid: Network destination ID
+ */
+struct rio_dev {
+   struct list_head global_list;   /* node in list of all RIO devices */
+   struct list_head net_list;  /* node in per net list */
+   struct rio_net *net;/* RIO net this device resides in */
+   u16 did;
+   u16 vid;
+   u32 device_rev;
+   u16 asm_did;
+   u16 asm_vid;
+   u16 asm_rev;
+   u16 efptr;
+   u32 pef;
+   u32 swpinfo;/* Only used for switches */
+   u32 src_ops;
+   u32 dst_ops;
+   struct rio_switch *rswitch; /* RIO switch info */
+   struct rio_driver *driver;  /* RIO driver claiming this device */
+   struct device dev;  /* LDM device structure */
+   struct resource riores[RIO_MAX_DEV_RESOURCES];
+   u16 destid;
+};
+
+#define rio_dev_g(n) list_entry(n, struct rio_dev, global_list)
+#define rio_dev_f(n) list_entry(n, struct rio_dev, net_list)
+#defineto_rio_dev(n) container_of(n, struct rio_dev, dev)
+
+/**
+ * struct rio_msg - RIO message event
+ * @res: Mailbox resource
+ * @mcback: Message event callback
+ */
+struct rio_msg {
+   struct resource *res;
+   void (*mcback) (struct rio_mport * mport, int mbox, int slot);
+};
+
+/**
+ * struct rio_dbell - RIO doorbell event
+ * @node: Node in list of doorbell events
+ * @res: Doorbell resource
+ * @dinb: Doorbell event callback
+ */
+struct rio_dbell {
+   struct list_head node;
+   struct resource *res;
+   void (*dinb) (struct rio_mport * mport, u16 src, u16 dst, u16 info);
+};
+
+/**
+ * struct rio_mport - 

[PATCH][1/5] RapidIO support: core base

2005-06-06 Thread Matt Porter
[Updated with latest comments]

Adds a RapidIO subsystem to the kernel. RIO is a switched
fabric interconnect used in higher-end embedded applications.
The curious can look at the specs over at http://www.rapidio.org

The core code implements enumeration/discovery, management of
devices/resources, and interfaces for RIO drivers.

There's a lot more to do to take advantages of all the hardware
features. However, this should provide a good base for folks
with RIO hardware to start contributing.

Signed-off-by: Matt Porter mporter at kernel.crashing.org

diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile
--- a/Documentation/DocBook/Makefile
+++ b/Documentation/DocBook/Makefile
@@ -10,7 +10,7 @@ DOCBOOKS := wanbook.xml z8530book.xml mc
kernel-hacking.xml kernel-locking.xml deviceiobook.xml \
procfs-guide.xml writing_usb_driver.xml scsidrivers.xml \
sis900.xml kernel-api.xml journal-api.xml lsm.xml usb.xml \
-   gadget.xml libata.xml mtdnand.xml librs.xml
+   gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml
 
 ###
 # The build process is as follows (targets):
diff --git a/Documentation/DocBook/rapidio.tmpl 
b/Documentation/DocBook/rapidio.tmpl
new file mode 100644
--- /dev/null
+++ b/Documentation/DocBook/rapidio.tmpl
@@ -0,0 +1,160 @@
+?xml version=1.0 encoding=UTF-8?
+!DOCTYPE book PUBLIC -//OASIS//DTD DocBook XML V4.1.2//EN
+http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd; [
+   !ENTITY rapidio SYSTEM rapidio.xml
+   ]
+
+book id=RapidIO-Guide
+ bookinfo
+  titleRapidIO Subsystem Guide/title
+  
+  authorgroup
+   author
+firstnameMatt/firstname
+surnamePorter/surname
+affiliation
+ address
+  emailmporter at kernel.crashing.org/email
+  emailmporter at mvista.com/email
+ /address
+/affiliation
+   /author
+  /authorgroup
+
+  copyright
+   year2005/year
+   holderMontaVista Software, Inc./holder
+  /copyright
+
+  legalnotice
+   para
+ This documentation is free software; you can redistribute
+ it and/or modify it under the terms of the GNU General Public
+ License version 2 as published by the Free Software Foundation.
+   /para
+  
+   para
+ This program is distributed in the hope that it will be
+ useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+   /para
+  
+   para
+ You should have received a copy of the GNU General Public
+ License along with this program; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ MA 02111-1307 USA
+   /para
+  
+   para
+ For more details see the file COPYING in the source
+ distribution of Linux.
+   /para
+  /legalnotice
+ /bookinfo
+
+toc/toc
+
+  chapter id=intro
+  titleIntroduction/title
+  para
+   RapidIO is a high speed switched fabric interconnect with
+   features aimed at the embedded market.  RapidIO provides
+   support for memory-mapped I/O as well as message-based
+   transactions over the switched fabric network. RapidIO has
+   a standardized discovery mechanism not unlike the PCI bus
+   standard that allows simple detection of devices in a
+   network.
+  /para
+  para
+   This documentation is provided for developers intending
+   to support RapidIO on new architectures, write new drivers,
+   or to understand the subsystem internals.
+  /para
+  /chapter
+  
+  chapter id=bugs
+ titleKnown Bugs and Limitations/title
+
+ sect1
+   titleBugs/title
+ paraNone. ;)/para
+ /sect1
+ sect1
+   titleLimitations/title
+ para
+   orderedlist
+ listitemparaAccess/management of RapidIO memory regions is 
not supported/para/listitem
+ listitemparaMultiple host enumeration is not 
supported/para/listitem
+   /orderedlist
+/para
+ /sect1
+  /chapter
+
+  chapter id=drivers
+   titleRapidIO driver interface/title
+   para
+   Drivers are provided a set of calls in order
+   to interface with the subsystem to gather info
+   on devices, request/map memory region resources,
+   and manage mailboxes/doorbells.
+   /para
+   sect1
+   titleFunctions/title
+!Iinclude/linux/rio_drv.h
+!Edrivers/rio/rio-driver.c
+!Edrivers/rio/rio.c
+   /sect1
+  /chapter   
+
+  chapter id=internals
+ titleInternals/title
+
+ para
+ This chapter contains the autogenerated documentation of the RapidIO
+ subsystem.
+ /para
+
+ sect1titleStructures/title
+!Iinclude/linux/rio.h
+ /sect1
+ sect1titleEnumeration and Discovery/title
+!Idrivers/rio/rio-scan.c
+ /sect1
+ sect1titleDriver functionality/title
+!Idrivers/rio/rio.c
+!Idrivers/rio/rio-access.c
+ /sect1
+

[PATCH][5/5] RapidIO support: net driver

2005-06-06 Thread Matt Porter
Adds an Ethernet driver which sends Ethernet packets over the
standard RapidIO messaging. This depends on the core RIO
patch for mailbox/doorbell access.

Signed-off-by: Matt Porter mporter at kernel.crashing.org

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -2185,6 +2185,20 @@ config ISERIES_VETH
tristate iSeries Virtual Ethernet driver support
depends on NETDEVICES  PPC_ISERIES
 
+config RIONET
+   tristate RapidIO Ethernet over messaging driver support
+   depends on NETDEVICES  RAPIDIO
+
+config RIONET_TX_SIZE
+   int Number of outbound queue entries
+   depends on RIONET
+   default 128
+
+config RIONET_RX_SIZE
+   int Number of inbound queue entries
+   depends on RIONET
+   default 128
+
 config FDDI
bool FDDI driver support
depends on NETDEVICES  (PCI || EISA)
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -58,6 +58,7 @@ obj-$(CONFIG_SKFP) += skfp/
 obj-$(CONFIG_VIA_RHINE) += via-rhine.o
 obj-$(CONFIG_VIA_VELOCITY) += via-velocity.o
 obj-$(CONFIG_ADAPTEC_STARFIRE) += starfire.o
+obj-$(CONFIG_RIONET) += rionet.o
 
 #
 # end link order section
diff --git a/drivers/net/rionet.c b/drivers/net/rionet.c
new file mode 100644
--- /dev/null
+++ b/drivers/net/rionet.c
@@ -0,0 +1,597 @@
+/*
+ * rionet - Ethernet driver over RapidIO messaging services
+ *
+ * Copyright 2005 MontaVista Software, Inc.
+ * Matt Porter mporter at kernel.crashing.org
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+#include linux/module.h
+#include linux/kernel.h
+#include linux/dma-mapping.h
+#include linux/delay.h
+#include linux/rio.h
+#include linux/rio_drv.h
+#include linux/rio_ids.h
+
+#include linux/netdevice.h
+#include linux/etherdevice.h
+#include linux/skbuff.h
+#include linux/crc32.h
+#include linux/ethtool.h
+
+#define DRV_NAMErionet
+#define DRV_VERSION 0.1
+#define DRV_AUTHOR  Matt Porter mporter at kernel.crashing.org
+#define DRV_DESCEthernet over RapidIO
+
+MODULE_AUTHOR(DRV_AUTHOR);
+MODULE_DESCRIPTION(DRV_DESC);
+MODULE_LICENSE(GPL);
+
+#define RIONET_DEFAULT_MSGLEVEL0
+#define RIONET_DOORBELL_JOIN   0x1000
+#define RIONET_DOORBELL_LEAVE  0x1001
+
+#define RIONET_MAILBOX 0
+
+#define RIONET_TX_RING_SIZECONFIG_RIONET_TX_SIZE
+#define RIONET_RX_RING_SIZECONFIG_RIONET_RX_SIZE
+
+static LIST_HEAD(rionet_peers);
+
+struct rionet_private {
+   struct rio_mport *mport;
+   struct sk_buff *rx_skb[RIONET_RX_RING_SIZE];
+   struct sk_buff *tx_skb[RIONET_TX_RING_SIZE];
+   struct net_device_stats stats;
+   int rx_slot;
+   int tx_slot;
+   int tx_cnt;
+   int ack_slot;
+   spinlock_t lock;
+   spinlock_t tx_lock;
+   u32 msg_enable;
+};
+
+struct rionet_peer {
+   struct list_head node;
+   struct rio_dev *rdev;
+   struct resource *res;
+};
+
+static int rionet_check = 0;
+static int rionet_capable = 1;
+static struct net_device *sndev = NULL;
+
+/*
+ * This is a fast lookup table for for translating TX
+ * Ethernet packets into a destination RIO device. It
+ * could be made into a hash table to save memory depending
+ * on system trade-offs.
+ */
+static struct rio_dev *rionet_active[RIO_MAX_ROUTE_ENTRIES];
+
+#define is_rionet_capable(pef, src_ops, dst_ops)   \
+   ((pef  RIO_PEF_INB_MBOX) \
+(pef  RIO_PEF_INB_DOORBELL) \
+(src_ops  RIO_SRC_OPS_DOORBELL) \
+(dst_ops  RIO_DST_OPS_DOORBELL))
+#define dev_rionet_capable(dev) \
+   is_rionet_capable(dev-pef, dev-src_ops, dev-dst_ops)
+
+#define RIONET_MAC_MATCH(x)(*(u32 *)x == 0x00010001)
+#define RIONET_GET_DESTID(x)   (*(u16 *)(x + 4))
+
+static struct net_device_stats *rionet_stats(struct net_device *ndev)
+{
+   struct rionet_private *rnet = ndev-priv;
+   return rnet-stats;
+}
+
+static int rionet_rx_clean(struct net_device *ndev)
+{
+   int i;
+   int error = 0;
+   struct rionet_private *rnet = ndev-priv;
+   void *data;
+
+   i = rnet-rx_slot;
+
+   do {
+   if (!rnet-rx_skb[i]) {
+   rnet-stats.rx_dropped++;
+   continue;
+   }
+
+   if (!(data = rio_get_inb_message(rnet-mport, RIONET_MAILBOX)))
+   break;
+
+   rnet-rx_skb[i]-data = data;
+   skb_put(rnet-rx_skb[i], RIO_MAX_MSG_SIZE);
+   rnet-rx_skb[i]-dev = ndev;
+   rnet-rx_skb[i]-protocol =
+   eth_type_trans(rnet-rx_skb[i], ndev);
+   error = 

[PATCH][RIO] -mm: Fix macro indenting

2005-06-06 Thread Matt Porter
Fix up indenting that Lindent fubared.

Signed-off-by: Matt Porter mporter at kernel.crashing.org

commit 87ff3372a005e4cf927b1b62c23e1c2339d46507
tree 16e1d9454a95a4a1e8b9e50dacd218f8e14dfe14
parent 6e9e41d480cf54c69d47df11f5cba696461ebe1a
author Matt Porter mporter at kernel.crashing.org Mon, 06 Jun 2005 09:23:49 
-0700
committer Matt Porter mporter at kernel.crashing.org Mon, 06 Jun 2005 
09:23:49 -0700

 drivers/rio/rio-access.c |   24 
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/rio/rio-access.c b/drivers/rio/rio-access.c
--- a/drivers/rio/rio-access.c
+++ b/drivers/rio/rio-access.c
@@ -77,13 +77,13 @@ int __rio_local_write_config_##size \
 }
 
 RIO_LOP_READ(8, u8, 1)
-RIO_LOP_READ(16, u16, 2)
-RIO_LOP_READ(32, u32, 4)
-RIO_LOP_WRITE(8, u8, 1)
-RIO_LOP_WRITE(16, u16, 2)
-RIO_LOP_WRITE(32, u32, 4)
+RIO_LOP_READ(16, u16, 2)
+RIO_LOP_READ(32, u32, 4)
+RIO_LOP_WRITE(8, u8, 1)
+RIO_LOP_WRITE(16, u16, 2)
+RIO_LOP_WRITE(32, u32, 4)
 
-EXPORT_SYMBOL(__rio_local_read_config_8);
+EXPORT_SYMBOL(__rio_local_read_config_8);
 EXPORT_SYMBOL(__rio_local_read_config_16);
 EXPORT_SYMBOL(__rio_local_read_config_32);
 EXPORT_SYMBOL(__rio_local_write_config_8);
@@ -137,13 +137,13 @@ int rio_mport_write_config_##size \
 }
 
 RIO_OP_READ(8, u8, 1)
-RIO_OP_READ(16, u16, 2)
-RIO_OP_READ(32, u32, 4)
-RIO_OP_WRITE(8, u8, 1)
-RIO_OP_WRITE(16, u16, 2)
-RIO_OP_WRITE(32, u32, 4)
+RIO_OP_READ(16, u16, 2)
+RIO_OP_READ(32, u32, 4)
+RIO_OP_WRITE(8, u8, 1)
+RIO_OP_WRITE(16, u16, 2)
+RIO_OP_WRITE(32, u32, 4)
 
-EXPORT_SYMBOL(rio_mport_read_config_8);
+EXPORT_SYMBOL(rio_mport_read_config_8);
 EXPORT_SYMBOL(rio_mport_read_config_16);
 EXPORT_SYMBOL(rio_mport_read_config_32);
 EXPORT_SYMBOL(rio_mport_write_config_8);





[PATCH][RIO] -mm: sysfs config space fixes

2005-06-06 Thread Matt Porter
Fix sysfs config space access similar to the recent PCI sysfs changes. 

Signed-off-by: Matt Porter mporter at kernel.crashing.org

commit 2a28743938495ab6055db2e29f3e0721bba022cc
tree 09d592a46eff8592327b20c609595eb8b7d5e333
parent d45c2d2fedcafd50a860267ff1d517c3071ab585
author Matt Porter mporter at kernel.crashing.org Mon, 06 Jun 2005 14:50:28 
-0700
committer Matt Porter mporter at kernel.crashing.org Mon, 06 Jun 2005 
14:50:28 -0700

 drivers/rio/rio-sysfs.c |   82 +--
 1 files changed, 58 insertions(+), 24 deletions(-)

diff --git a/drivers/rio/rio-sysfs.c b/drivers/rio/rio-sysfs.c
--- a/drivers/rio/rio-sysfs.c
+++ b/drivers/rio/rio-sysfs.c
@@ -74,10 +74,11 @@ rio_read_config(struct kobject *kobj, ch
to_rio_dev(container_of(kobj, struct device, kobj));
unsigned int size = 0x100;
loff_t init_off = off;
+   u8 *data = (u8 *) buf;
 
/* Several chips lock up trying to read undefined config space */
if (capable(CAP_SYS_ADMIN))
-   size = 0x8;
+   size = 0x20;
 
if (off  size)
return 0;
@@ -88,30 +89,47 @@ rio_read_config(struct kobject *kobj, ch
size = count;
}
 
-   while (off  3) {
-   unsigned char val;
+   if ((off  1)  size) {
+   u8 val;
rio_read_config_8(dev, off, val);
-   buf[off - init_off] = val;
+   data[off - init_off] = val;
off++;
-   if (--size == 0)
-   break;
+   size--;
+   }
+
+   if ((off  3)  size  2) {
+   u16 val;
+   rio_read_config_16(dev, off, val);
+   data[off - init_off] = (val  8)  0xff;
+   data[off - init_off + 1] = val  0xff;
+   off += 2;
+   size -= 2;
}
 
while (size  3) {
-   unsigned int val;
+   u32 val;
rio_read_config_32(dev, off, val);
-   buf[off - init_off] = (val  24)  0xff;
-   buf[off - init_off + 1] = (val  16)  0xff;
-   buf[off - init_off + 2] = (val  8)  0xff;
-   buf[off - init_off + 3] = val  0xff;
+   data[off - init_off] = (val  24)  0xff;
+   data[off - init_off + 1] = (val  16)  0xff;
+   data[off - init_off + 2] = (val  8)  0xff;
+   data[off - init_off + 3] = val  0xff;
off += 4;
size -= 4;
}
 
-   while (size  0) {
-   unsigned char val;
+   if (size = 2) {
+   u16 val;
+   rio_read_config_16(dev, off, val);
+   data[off - init_off] = (val  8)  0xff;
+   data[off - init_off + 1] = val  0xff;
+   off += 2;
+   size -= 2;
+   }
+
+   if (size  0) {
+   u8 val;
rio_read_config_8(dev, off, val);
-   buf[off - init_off] = val;
+   data[off - init_off] = val;
off++;
--size;
}
@@ -126,6 +144,7 @@ rio_write_config(struct kobject *kobj, c
to_rio_dev(container_of(kobj, struct device, kobj));
unsigned int size = count;
loff_t init_off = off;
+   u8 *data = (u8 *) buf;
 
if (off  0x20)
return 0;
@@ -134,25 +153,40 @@ rio_write_config(struct kobject *kobj, c
count = size;
}
 
-   while (off  3) {
-   rio_write_config_8(dev, off, buf[off - init_off]);
+   if ((off  1)  size) {
+   rio_write_config_8(dev, off, data[off - init_off]);
off++;
-   if (--size == 0)
-   break;
+   size--;
+   }
+
+   if ((off  3)  (size  2)) {
+   u16 val = data[off - init_off + 1];
+   val |= (u16) data[off - init_off]  8;
+   rio_write_config_16(dev, off, val);
+   off += 2;
+   size -= 2;
}
 
while (size  3) {
-   unsigned int val = buf[off - init_off + 3];
-   val |= (unsigned int)buf[off - init_off + 2]  8;
-   val |= (unsigned int)buf[off - init_off + 1]  16;
-   val |= (unsigned int)buf[off - init_off]  24;
+   u32 val = data[off - init_off + 3];
+   val |= (u32) data[off - init_off + 2]  8;
+   val |= (u32) data[off - init_off + 1]  16;
+   val |= (u32) data[off - init_off]  24;
rio_write_config_32(dev, off, val);
off += 4;
size -= 4;
}
 
-   while (size  0) {
-   rio_write_config_8(dev, off, buf[off - init_off]);
+   if (size = 2) {
+   u16 val = data[off - init_off + 1];
+   val |= (u16) data[off - init_off]  8;
+   rio_write_config_16(dev, off, val);
+   

[PATCH][RIO] -mm: rionet updates

2005-06-06 Thread Matt Porter
Cleanups, eliminate unused paths, and add LLTX support.

Signed-off-by: Matt Porter mporter at kernel.crashing.org

commit d651f0979ebfb203624159507a2b04ac896844ab
tree c9dffe54b25b6992025f074de1fe9901adc8d6ef
parent 7cfb63a2fce0dbb82507bb6035352df1718624f2
author Matt Porter mporter at kernel.crashing.org Mon, 06 Jun 2005 13:57:52 
-0700
committer Matt Porter mporter at kernel.crashing.org Mon, 06 Jun 2005 
13:57:52 -0700

 drivers/net/rionet.c |   73 --
 1 files changed, 24 insertions(+), 49 deletions(-)

diff --git a/drivers/net/rionet.c b/drivers/net/rionet.c
--- a/drivers/net/rionet.c
+++ b/drivers/net/rionet.c
@@ -42,7 +42,7 @@ MODULE_LICENSE(GPL);
 #define RIONET_TX_RING_SIZECONFIG_RIONET_TX_SIZE
 #define RIONET_RX_RING_SIZECONFIG_RIONET_RX_SIZE
 
-LIST_HEAD(rionet_peers);
+static LIST_HEAD(rionet_peers);
 
 struct rionet_private {
struct rio_mport *mport;
@@ -54,6 +54,7 @@ struct rionet_private {
int tx_cnt;
int ack_slot;
spinlock_t lock;
+   spinlock_t tx_lock;
u32 msg_enable;
 };
 
@@ -112,9 +113,9 @@ static int rionet_rx_clean(struct net_de
 
rnet-rx_skb[i]-data = data;
skb_put(rnet-rx_skb[i], RIO_MAX_MSG_SIZE);
-   rnet-rx_skb[i]-dev = sndev;
+   rnet-rx_skb[i]-dev = ndev;
rnet-rx_skb[i]-protocol =
-   eth_type_trans(rnet-rx_skb[i], sndev);
+   eth_type_trans(rnet-rx_skb[i], ndev);
error = netif_rx(rnet-rx_skb[i]);
 
if (error == NET_RX_DROP) {
@@ -183,13 +184,20 @@ static int rionet_start_xmit(struct sk_b
struct rionet_private *rnet = ndev-priv;
struct ethhdr *eth = (struct ethhdr *)skb-data;
u16 destid;
+   unsigned long flags;
 
-   spin_lock_irq(rnet-lock);
-
+   local_irq_save(flags);
+   if (!spin_trylock(rnet-tx_lock)) {
+   local_irq_restore(flags);
+   return NETDEV_TX_LOCKED;
+   }
+   
if ((rnet-tx_cnt + 1)  RIONET_TX_RING_SIZE) {
netif_stop_queue(ndev);
-   spin_unlock_irq(rnet-lock);
-   return -EBUSY;
+   spin_unlock_irqrestore(rnet-tx_lock, flags);
+   printk(KERN_ERR %s: BUG! Tx Ring full when queue awake!\n,
+  ndev-name);
+   return NETDEV_TX_BUSY;
}
 
if (eth-h_dest[0]  0x01) {
@@ -211,7 +219,7 @@ static int rionet_start_xmit(struct sk_b
rionet_queue_tx_msg(skb, ndev, rionet_active[destid]);
}
 
-   spin_unlock_irq(rnet-lock);
+   spin_unlock_irqrestore(rnet-tx_lock, flags);
 
return 0;
 }
@@ -228,27 +236,6 @@ static int rionet_set_mac_address(struct
return 0;
 }
 
-static int rionet_change_mtu(struct net_device *ndev, int new_mtu)
-{
-   struct rionet_private *rnet = ndev-priv;
-
-   if (netif_msg_drv(rnet))
-   printk(KERN_WARNING
-  %s: rionet_change_mtu(): not implemented\n, DRV_NAME);
-
-   return 0;
-}
-
-static void rionet_set_multicast_list(struct net_device *ndev)
-{
-   struct rionet_private *rnet = ndev-priv;
-
-   if (netif_msg_drv(rnet))
-   printk(KERN_WARNING
-  %s: rionet_set_multicast_list(): not implemented\n,
-  DRV_NAME);
-}
-
 static void rionet_dbell_event(struct rio_mport *mport, u16 sid, u16 tid,
   u16 info)
 {
@@ -358,10 +345,6 @@ static int rionet_open(struct net_device
rnet-tx_cnt = 0;
rnet-ack_slot = 0;
 
-   spin_lock_init(rnet-lock);
-
-   rnet-msg_enable = RIONET_DEFAULT_MSGLEVEL;
-
netif_carrier_on(ndev);
netif_start_queue(ndev);
 
@@ -434,11 +417,6 @@ static void rionet_remove(struct rio_dev
}
 }
 
-static int rionet_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd)
-{
-   return -EOPNOTSUPP;
-}
-
 static void rionet_get_drvinfo(struct net_device *ndev,
   struct ethtool_drvinfo *info)
 {
@@ -464,16 +442,11 @@ static void rionet_set_msglevel(struct n
rnet-msg_enable = value;
 }
 
-static u32 rionet_get_link(struct net_device *ndev)
-{
-   return netif_carrier_ok(ndev);
-}
-
 static struct ethtool_ops rionet_ethtool_ops = {
.get_drvinfo = rionet_get_drvinfo,
.get_msglevel = rionet_get_msglevel,
.set_msglevel = rionet_set_msglevel,
-   .get_link = rionet_get_link,
+   .get_link = ethtool_op_get_link,
 };
 
 static int rionet_setup_netdev(struct rio_mport *mport)
@@ -517,16 +490,18 @@ static int rionet_setup_netdev(struct ri
ndev-hard_start_xmit = rionet_start_xmit;
ndev-stop = rionet_close;
ndev-get_stats = rionet_stats;
-   ndev-change_mtu = rionet_change_mtu;
ndev-set_mac_address = rionet_set_mac_address;
-   ndev-set_multicast_list = rionet_set_multicast_list;
-   

[PATCH] ppc32: add 405EP cpu_spec entry

2005-06-06 Thread Eugene Surovegin
Andrew,

the following patch adds definition for PPC 405EP which was lost 
somehow during 2.4 - 2.6 transition.

Recent change to arch/ppc/kernel/misc.S (Fix incorrect CPU_FTR fixup 
usage for unified caches) triggered this bug and 405EP boards don't 
boot anymore.

Please, consider applying this patch before 2.6.12 release.

Signed-off-by: Eugene Surovegin ebs at ebshome.net

diff --git a/arch/ppc/kernel/cputable.c b/arch/ppc/kernel/cputable.c
--- a/arch/ppc/kernel/cputable.c
+++ b/arch/ppc/kernel/cputable.c
@@ -838,6 +838,17 @@ struct cpu_speccpu_specs[] = {
.icache_bsize   = 32,
.dcache_bsize   = 32,
},
+   {   /* 405EP */
+   .pvr_mask   = 0x,
+   .pvr_value  = 0x5121,
+   .cpu_name   = 405EP,
+   .cpu_features   = CPU_FTR_SPLIT_ID_CACHE |
+   CPU_FTR_USE_TB,
+   .cpu_user_features  = PPC_FEATURE_32 |
+   PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
+   .icache_bsize   = 32,
+   .dcache_bsize   = 32,
+   },
 
 #endif /* CONFIG_40x */
 #ifdef CONFIG_44x




Verify your PayPal Account

2005-06-06 Thread [EMAIL PROTECTED]
An HTML attachment was scrubbed...
URL: 
http://ozlabs.org/pipermail/linuxppc-embedded/attachments/20050606/4f233a07/attachment.htm