From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] 83xx, uec: adjust enet_interface settings on the fly.
Date: Tue, 19 Jan 2010 09:42:57 +0100 [thread overview]
Message-ID: <4B557091.7030800@denx.de> (raw)
In-Reply-To: <2acbd3e41001182249x5cd1ede8u14d62aa7f758ef19@mail.gmail.com>
Hello Andy,
Andy Fleming wrote:
> On Thu, Jan 7, 2010 at 2:01 AM, Heiko Schocher <hs@denx.de> wrote:
>> If using UCC as Ethernet Controller and type = FAST_ETH, it was
>> not possible to switch between 10 and 100 MBit interfaces. This
>> patch adds this for following interfaces:
>>
>> 10_MII
>> 10_RMII
>> 10_RGMII
>> 100_MII
>> 100_RMII
>> 100_RGMII
>>
>> Signed-off-by: Heiko Schocher <hs@denx.de>
>> ---
>> drivers/qe/uec.c | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> 1 files changed, 73 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/qe/uec.c b/drivers/qe/uec.c
>> index db95ada..9851cc4 100644
>> --- a/drivers/qe/uec.c
>> +++ b/drivers/qe/uec.c
>> @@ -65,6 +65,22 @@ static uec_info_t uec_info[] = {
>>
>> #define MAXCONTROLLERS (8)
>>
>> +static char *enet_interface_name[] = {
>> + "10_MII",
>> + "10_RMII",
>> + "10_RGMII",
>> + "100_MII",
>> + "100_RMII",
>> + "100_RGMII",
>> + "1000_GMII",
>> + "1000_RGMII",
>> + "1000_RGMII_ID",
>> + "1000_RGMII_RXID",
>> + "1000_TBI",
>> + "1000_RTBI",
>> + "1000_SGMII"
>> +};
>> +
>> static struct eth_device *devlist[MAXCONTROLLERS];
>>
>> u16 phy_read (struct uec_mii_info *mii_info, u16 regnum);
>> @@ -497,6 +513,60 @@ bus_fail:
>> return err;
>> }
>>
>> +static void adjust_fast_enet_interface(int speed, struct eth_device *dev)
>> +{
>> + uec_private_t *uec = (uec_private_t *)dev->priv;
>> + uec_t *uec_regs;
>> + int change = 0;
>> +
>> + extern void change_phy_interface_mode(struct eth_device *dev,
>> + enet_interface_e mode);
>> + uec_regs = uec->uec_regs;
>> +
>> + switch (speed) {
>> + case 100:
>> + switch (uec->uec_info->enet_interface) {
>> + case ENET_10_MII:
>> + case ENET_10_RMII:
>> + case ENET_10_RGMII:
>
>
> I know you aren't responsible for this design choice, but I'd love it
> if we stopped this sort of thing. There's no sensible reason to unite
> speed and interface type into one variable. They are, in fact, two
> nearly-independent variables. If they directly corresponded to some
Yes, you are right! That would be the right way ...
> register value, it might make sense, but really they encourage a
> rigidity of thought about a concept which is much more fluid. The
> speed will vary based on the link partner. The interface is usually
> hardwired by the board designer, and at most, modifiable at boot time
> by DIP switches.
Yep, I try to prepare such a patch, which splits this variable in
two (If others have no objections).
Thanks.
bye
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
next prev parent reply other threads:[~2010-01-19 8:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-07 8:01 [U-Boot] 83xx, uec: adjust enet_interface settings on the fly Heiko Schocher
2010-01-08 0:59 ` Kim Phillips
2010-01-08 3:11 ` Liu Dave-R63238
2010-01-08 7:37 ` Heiko Schocher
2010-01-08 7:52 ` Liu Dave-R63238
2010-01-08 8:12 ` Heiko Schocher
2010-01-08 8:14 ` Liu Dave-R63238
2010-01-19 6:49 ` Andy Fleming
2010-01-19 8:42 ` Heiko Schocher [this message]
2010-01-20 8:04 ` [U-Boot] 83xx, uec: split enet_interface in two variables, was: " Heiko Schocher
2010-02-01 5:25 ` Ben Warren
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=4B557091.7030800@denx.de \
--to=hs@denx.de \
--cc=u-boot@lists.denx.de \
/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