Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Pete Popov <ppopov@embeddedalley.com>
To: Matej Kupljen <matej.kupljen@ultra.si>
Cc: "'linux-mips@linux-mips.org'" <linux-mips@linux-mips.org>
Subject: Re: smc91x support
Date: Thu, 10 Nov 2005 07:29:45 -0800	[thread overview]
Message-ID: <1131636585.4890.14.camel@localhost.localdomain> (raw)
In-Reply-To: <1131634331.18165.30.camel@localhost.localdomain>

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

On Thu, 2005-11-10 at 15:52 +0100, Matej Kupljen wrote:
> Hi
> 
> On 21st september Peter Popov modified:
> arch/mips/au1000/common/platform.c
> 
> With the log message:
> smc91x platform support; requires patch to smc91x.h which was sent
>         upstream.
> 
> Any news about this?
> What is the patch required for smc91x.h?

I have to check with Nicolas Pitre.

Meanwhile I've attached the patch here.

> I also added support for smc91x.h to enable it on the DBAU1200,
> but as I wrote in another mail, I get bad performance.

So do I. That part is just a low performance part plus the bus settings
on the db1200 are set for the slowest part on the local bus. Depending
on which peripherals you use on the local bus, you may be able to change
the settings and get better performance from the Ethernet. Jordan may
have more hints about this.

Pete

> I enabled the debug mode and I now I see that I get a lot of 
> overruns, like:
> ...
> [4294761.172000] eth0: RX overrun (EPH_ST 0x0001)
> [4294761.190000] eth0: RX overrun (EPH_ST 0x0001)
> [4294761.198000] eth0: RX overrun (EPH_ST 0x0001)
> ...
> 
> Is there any solution to this?
> Maybe to use DDMA?
> 
> BR,
> Matej
> 
> 

[-- Attachment #2: smc91x_au1x.patch --]
[-- Type: text/x-patch, Size: 1897 bytes --]

diff -Naur --exclude=CVS linux-2.6-orig/drivers/net/Kconfig linux-2.6-dev/drivers/net/Kconfig
--- linux-2.6-orig/drivers/net/Kconfig	2005-09-15 08:45:33.000000000 -0700
+++ linux-2.6-dev/drivers/net/Kconfig	2005-09-21 11:40:13.000000000 -0700
@@ -800,7 +800,7 @@
 	tristate "SMC 91C9x/91C1xxx support"
 	select CRC32
 	select MII
-	depends on NET_ETHERNET && (ARM || REDWOOD_5 || REDWOOD_6 || M32R || SUPERH)
+	depends on NET_ETHERNET && (ARM || REDWOOD_5 || REDWOOD_6 || M32R || SUPERH || SOC_AU1X00)
 	help
 	  This is a driver for SMC's 91x series of Ethernet chipsets,
 	  including the SMC91C94 and the SMC91C111. Say Y if you want it
diff -Naur --exclude=CVS linux-2.6-orig/drivers/net/smc91x.h linux-2.6-dev/drivers/net/smc91x.h
--- linux-2.6-orig/drivers/net/smc91x.h	2005-09-15 08:45:41.000000000 -0700
+++ linux-2.6-dev/drivers/net/smc91x.h	2005-09-21 11:42:49.000000000 -0700
@@ -289,6 +289,38 @@
 #define RPC_LSA_DEFAULT		RPC_LED_TX_RX
 #define RPC_LSB_DEFAULT		RPC_LED_100_10
 
+#elif defined(CONFIG_SOC_AU1X00)
+
+#include <au1xxx.h>
+
+/* We can only do 16-bit reads and writes in the static memory space. */
+#define SMC_CAN_USE_8BIT	0
+#define SMC_CAN_USE_16BIT	1
+#define SMC_CAN_USE_32BIT	0
+#define SMC_IO_SHIFT		0
+#define SMC_NOWAIT		1
+
+#define SMC_inw(a, r)		au_readw((unsigned long)((a) + (r)))
+#define SMC_insw(a, r, p, l)	\
+	do {	\
+		unsigned long _a = (unsigned long)((a) + (r)); \
+		int _l = (l); \
+		u16 *_p = (u16 *)(p); \
+		while (_l-- > 0) \
+			*_p++ = au_readw(_a); \
+	} while(0)
+#define SMC_outw(v, a, r)	au_writew(v, (unsigned long)((a) + (r)))
+#define SMC_outsw(a, r, p, l)	\
+	do {	\
+		unsigned long _a = (unsigned long)((a) + (r)); \
+		int _l = (l); \
+		const u16 *_p = (const u16 *)(p); \
+		while (_l-- > 0) \
+			au_writew(*_p++ , _a); \
+	} while(0)
+
+#define set_irq_type(irq, type) do {} while (0)
+
 #else
 
 #define SMC_CAN_USE_8BIT	1

  parent reply	other threads:[~2005-11-10 15:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-10 14:52 smc91x support Matej Kupljen
2005-11-10 15:15 ` Atsushi Nemoto
2005-11-10 15:37   ` Pantelis Antoniou
2005-11-10 17:44     ` Matej Kupljen
2005-11-11  1:36       ` Atsushi Nemoto
2005-11-10 15:29 ` Pete Popov [this message]
2005-11-10 17:52   ` Matej Kupljen
2005-11-10 17:56     ` Peter Popov
2006-01-04 21:23   ` Matej Kupljen
2006-01-05  2:42     ` Pete Popov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1131636585.4890.14.camel@localhost.localdomain \
    --to=ppopov@embeddedalley.com \
    --cc=linux-mips@linux-mips.org \
    --cc=matej.kupljen@ultra.si \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox