From: Joe Hamman <joe.hamman@embeddedspecialties.com>
To: galak@kernel.crashing.org
Cc: linuxppc-embedded@ozlabs.org
Subject: [PATCH] [UPDATED] tsec: Allow Ten Bit Interface to be configurable
Date: Mon, 13 Aug 2007 17:37:49 -0500 [thread overview]
Message-ID: <1187044669.10295.4.camel@server> (raw)
Allow the address of the Ten Bit Interface (TBI) to be changed in the
event of a conflict with another device.
Signed-off by: Joe Hamman <joe.hamman@embeddedspecialties.com>
---
Please ignore the last patch - I missed a cut & paste error on the range
that my testing didn't catch.
---
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 81ef81c..b4813d9 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -2276,6 +2276,14 @@ config GFAR_NAPI
bool "NAPI Support"
depends on GIANFAR
+config GFAR_TBIPA_VALUE
+ hex "Ten Bit Interface Port Address Value"
+ depends on GIANFAR
+ range 0 0x1f
+ default "0x1f"
+ help
+ Select an address that does not conflict with other addresses on the board.
+
config UCC_GETH
tristate "Freescale QE Gigabit Ethernet"
depends on QUICC_ENGINE
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index f926905..91ae0d3 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -490,15 +490,15 @@ static void gfar_configure_serdes(struct net_device *dev)
/* Initialise TBI i/f to communicate with serdes (lynx phy) */
/* Single clk mode, mii mode off(for aerdes communication) */
- gfar_local_mdio_write(regs, TBIPA_VALUE, MII_TBICON, TBICON_CLK_SELECT);
+ gfar_local_mdio_write(regs, CONFIG_GFAR_TBIPA_VALUE, MII_TBICON, TBICON_CLK_SELECT);
/* Supported pause and full-duplex, no half-duplex */
- gfar_local_mdio_write(regs, TBIPA_VALUE, MII_ADVERTISE,
+ gfar_local_mdio_write(regs, CONFIG_GFAR_TBIPA_VALUE, MII_ADVERTISE,
ADVERTISE_1000XFULL | ADVERTISE_1000XPAUSE |
ADVERTISE_1000XPSE_ASYM);
/* ANEG enable, restart ANEG, full duplex mode, speed[1] set */
- gfar_local_mdio_write(regs, TBIPA_VALUE, MII_BMCR, BMCR_ANENABLE |
+ gfar_local_mdio_write(regs, CONFIG_GFAR_TBIPA_VALUE, MII_BMCR, BMCR_ANENABLE |
BMCR_ANRESTART | BMCR_FULLDPLX | BMCR_SPEED1000);
}
@@ -547,7 +547,7 @@ static void init_registers(struct net_device *dev)
gfar_write(&priv->regs->minflr, MINFLR_INIT_SETTINGS);
/* Assign the TBI an address which won't conflict with the PHYs */
- gfar_write(&priv->regs->tbipa, TBIPA_VALUE);
+ gfar_write(&priv->regs->tbipa, CONFIG_GFAR_TBIPA_VALUE);
}
diff --git a/drivers/net/gianfar.h b/drivers/net/gianfar.h
index d8e779c..0fd1c02 100644
--- a/drivers/net/gianfar.h
+++ b/drivers/net/gianfar.h
@@ -131,7 +131,6 @@ extern const char gfar_driver_version[];
#define DEFAULT_RXCOUNT 16
#define DEFAULT_RXTIME 4
-#define TBIPA_VALUE 0x1f
#define MIIMCFG_INIT_VALUE 0x00000007
#define MIIMCFG_RESET 0x80000000
#define MIIMIND_BUSY 0x00000001
next reply other threads:[~2007-08-13 22:57 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-13 22:37 Joe Hamman [this message]
2007-08-14 3:09 ` [PATCH] [UPDATED] tsec: Allow Ten Bit Interface to be configurable Kumar Gala
2007-08-14 3:29 ` Joe Hamman
2007-08-14 12:47 ` Joe Hamman
2007-08-14 16:04 ` Andy Fleming
2007-08-14 16:16 ` Scott Wood
2007-08-14 16:50 ` Joe Hamman
2007-08-14 18:00 ` Scott Wood
2007-08-14 20:37 ` Andy Fleming
2007-08-14 21:01 ` Joe Hamman
2007-08-14 21:29 ` Andy Fleming
2007-08-14 21:41 ` Joe Hamman
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=1187044669.10295.4.camel@server \
--to=joe.hamman@embeddedspecialties.com \
--cc=galak@kernel.crashing.org \
--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;
as well as URLs for NNTP newsgroup(s).