From: Wade Farnsworth <wfarnsworth@mvista.com>
To: linuxppc-embedded <linuxppc-embedded@ozlabs.org>
Subject: Re: [PATCH 2/3] IBM EMAC support for the PPC440EP
Date: 26 Jul 2005 09:03:38 -0700 [thread overview]
Message-ID: <1122393818.22059.38.camel@rhino.az.mvista.com> (raw)
In-Reply-To: <1122393448.22059.32.camel@rhino.az.mvista.com>
[-- Attachment #1: Type: text/plain, Size: 124 bytes --]
This adds support to the IBM EMAC ethernet driver for the 440EP.
Signed-off by: Wade Farnsworth <wfarnsworth@mvista.com>
[-- Attachment #2: 440ep-net.patch --]
[-- Type: text/x-patch, Size: 2788 bytes --]
diff -uprN linux-2.6.12/drivers/net/ibm_emac/ibm_emac_phy.c linux-2.6.12-440ep/drivers/net/ibm_emac/ibm_emac_phy.c
--- linux-2.6.12/drivers/net/ibm_emac/ibm_emac_phy.c 2005-06-17 12:48:29.000000000 -0700
+++ linux-2.6.12-440ep/drivers/net/ibm_emac/ibm_emac_phy.c 2005-07-25 11:32:38.000000000 -0700
@@ -24,6 +24,7 @@
#include <linux/mii.h>
#include <linux/ethtool.h>
#include <linux/delay.h>
+#include <linux/vmalloc.h>
#include "ibm_emac_phy.h"
@@ -78,6 +79,45 @@ static int cis8201_init(struct mii_phy *
return 0;
}
+#ifdef CONFIG_BAMBOO
+static int ac104_init(struct mii_phy *phy)
+{
+ /*
+ * SW2 on the Bamboo is used for ethernet configuration and is accessed
+ * via the CONFIG2 register in the FPGA. If the ANEG pin is set,
+ * overwrite the supported features with the settings in SW2.
+ */
+ u8 *config2_addr, config2_val;
+ config2_addr = ioremap64(BAMBOO_FPGA_CONFIG2_REG_ADDR, 0x8);
+ config2_val = * config2_addr;
+ iounmap(config2_addr);
+ if (BAMBOO_AUTONEGOTIATE(config2_val))
+ return 0;
+ phy->def->features = SUPPORTED_TP | SUPPORTED_MII;
+ if (BAMBOO_FORCE_100Mbps(config2_val)) {
+ phy->speed = SPEED_100;
+ if (BAMBOO_FULL_DUPLEX_EN(config2_val)) {
+ phy->def->features |= SUPPORTED_100baseT_Full;
+ phy->duplex = DUPLEX_FULL;
+ } else {
+ phy->def->features |= SUPPORTED_100baseT_Half;
+ phy->duplex = DUPLEX_HALF;
+ }
+ } else {
+ phy->speed = SPEED_10;
+ if (BAMBOO_FULL_DUPLEX_EN(config2_val)) {
+ phy->def->features |= SUPPORTED_10baseT_Full;
+ phy->duplex = DUPLEX_FULL;
+ } else {
+ phy->def->features |= SUPPORTED_10baseT_Half;
+ phy->duplex = DUPLEX_HALF;
+ }
+ }
+
+ return 0;
+}
+#endif
+
static int genmii_setup_aneg(struct mii_phy *phy, u32 advertise)
{
u16 ctl, adv;
@@ -226,6 +266,17 @@ static struct mii_phy_ops cis8201_phy_op
read_link:cis8201_read_link
};
+/* AC104 phy ops */
+static struct mii_phy_ops ac104_phy_ops = {
+#ifdef CONFIG_BAMBOO
+ init:ac104_init,
+#endif
+ setup_aneg:genmii_setup_aneg,
+ setup_forced:genmii_setup_forced,
+ poll_link:genmii_poll_link,
+ read_link:genmii_read_link
+};
+
/* Generic implementation for most 10/100 PHYs */
static struct mii_phy_ops generic_phy_ops = {
setup_aneg:genmii_setup_aneg,
@@ -234,6 +285,15 @@ static struct mii_phy_ops generic_phy_op
read_link:genmii_read_link
};
+static struct mii_phy_def ac104_phy_def = {
+ phy_id:0x00225540,
+ phy_id_mask:0x00fffff0,
+ name:"AC104 Ethernet",
+ features:MII_BASIC_FEATURES,
+ magic_aneg:0,
+ ops:&ac104_phy_ops
+};
+
static struct mii_phy_def cis8201_phy_def = {
phy_id:0x000fc410,
phy_id_mask:0x000ffff0,
@@ -254,6 +314,7 @@ static struct mii_phy_def genmii_phy_def
static struct mii_phy_def *mii_phy_table[] = {
&cis8201_phy_def,
+ &ac104_phy_def,
&genmii_phy_def,
NULL
};
next prev parent reply other threads:[~2005-07-26 16:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-26 15:57 [PATCH 1/3] PPC440EP SoC and Bamboo board support Wade Farnsworth
2005-07-26 16:03 ` Wade Farnsworth [this message]
2005-07-26 16:06 ` [PATCH 3/3] MTD support for the Bamboo board Wade Farnsworth
2005-07-26 16:40 ` Eugene Surovegin
2005-07-26 17:09 ` Wade Farnsworth
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=1122393818.22059.38.camel@rhino.az.mvista.com \
--to=wfarnsworth@mvista.com \
--cc=linuxppc-embedded@ozlabs.org \
/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