From: Ben Warren <biggerbadderben@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] unassigned-patches/24: [PATCH] PHY: Add support for the M88E1121R Marvell chip.
Date: Mon, 01 Sep 2008 15:00:49 -0700 [thread overview]
Message-ID: <48BC6611.10108@gmail.com> (raw)
In-Reply-To: <m27i9vkh83.fsf@ohwell.denx.de>
Hi Detlev,
Detlev Zundel wrote:
> Hi Ben,
>
>
>> Signed-off-by: Yuri Tikhonov <yur@emcraft.com>
>> Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
>>
>> ---
>> Added to GNATS database as unassigned-patches/24
>>
>>> Responsible: patch-coord
>>> Message-Id: <1218807733-26929-1-git-send-email-dzu@denx.de>
>>> In-Reply-To:
>>> References:
>>> Patch-Date: Fri Aug 15 15:42:08 +0200 2008
>>>
>> ---
>> drivers/net/tsec.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
>> drivers/net/tsec.h | 7 +++++++
>> 2 files changed, 57 insertions(+), 0 deletions(-)
>>
>
> Any comments on this patch?
>
> Thanks
> Detlev
>
>
Hi Detlev,
It looks like this one slipped through the cracks. I've looked through
my e-mails and found one from Wolfgang on 6/8 where he said he'd apply
it, so I acked the patch rather than pulling it myself. For whatever
reason, it didn't make it in.
I've rejigged the patch to apply to TOT, and have applied to the net
repo. Please find the fixed-up patch attached, as applied to
e99e9575bbeba1b7c48e046547cae065ec0071de
[PATCH] PHY: Add support for the M88E1121R Marvell chip.
From: Sergei Poselenov <sposelenov@emcraft.com>
Signed-off-by: Yuri Tikhonov <yur@emcraft.com>
Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
---
drivers/net/tsec.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
drivers/net/tsec.h | 7 +++++++
2 files changed, 56 insertions(+), 0 deletions(-)
diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
index c7af930..565da5c 100644
--- a/drivers/net/tsec.c
+++ b/drivers/net/tsec.c
@@ -1157,6 +1157,54 @@ struct phy_info phy_info_M88E1118 = {
},
};
+/*
+ * Since to access LED register we need do switch the page, we
+ * do LED configuring in the miim_read-like function as follows
+ */
+uint mii_88E1121_set_led (uint mii_reg, struct tsec_private *priv)
+{
+ uint pg;
+
+ /* Switch the page to access the led register */
+ pg = read_phy_reg(priv, MIIM_88E1121_PHY_PAGE);
+ write_phy_reg(priv, MIIM_88E1121_PHY_PAGE, MIIM_88E1121_PHY_LED_PAGE);
+
+ /* Configure leds */
+ write_phy_reg(priv, MIIM_88E1121_PHY_LED_CTRL,
+ MIIM_88E1121_PHY_LED_DEF);
+
+ /* Restore the page pointer */
+ write_phy_reg(priv, MIIM_88E1121_PHY_PAGE, pg);
+ return 0;
+}
+
+struct phy_info phy_info_M88E1121R = {
+ 0x01410cb,
+ "Marvell 88E1121R",
+ 4,
+ (struct phy_cmd[]){ /* config */
+ /* Reset and configure the PHY */
+ {MIIM_CONTROL, MIIM_CONTROL_RESET, NULL},
+ {MIIM_GBIT_CONTROL, MIIM_GBIT_CONTROL_INIT, NULL},
+ {MIIM_ANAR, MIIM_ANAR_INIT, NULL},
+ /* Configure leds */
+ {MIIM_88E1121_PHY_LED_CTRL, miim_read,
+ &mii_88E1121_set_led},
+ {MIIM_CONTROL, MIIM_CONTROL_INIT, &mii_cr_init},
+ {miim_end,}
+ },
+ (struct phy_cmd[]){ /* startup */
+ /* Status is read once to clear old link state */
+ {MIIM_STATUS, miim_read, NULL},
+ {MIIM_STATUS, miim_read, &mii_parse_sr},
+ {MIIM_STATUS, miim_read, &mii_parse_link},
+ {miim_end,}
+ },
+ (struct phy_cmd[]){ /* shutdown */
+ {miim_end,}
+ },
+};
+
static unsigned int m88e1145_setmode(uint mii_reg, struct tsec_private *priv)
{
uint mii_data = read_phy_reg(priv, mii_reg);
@@ -1521,6 +1569,7 @@ struct phy_info *phy_info[] = {
&phy_info_BCM5464S,
&phy_info_M88E1011S,
&phy_info_M88E1111S,
&phy_info_M88E1118,
+ &phy_info_M88E1121R,
&phy_info_M88E1145,
&phy_info_M88E1149S,
diff --git a/drivers/net/tsec.h b/drivers/net/tsec.h
index 6a2338b..fee5934 100644
--- a/drivers/net/tsec.h
+++ b/drivers/net/tsec.h
@@ -184,6 +184,13 @@
#define MIIM_88E1111_PHY_LED_DIRECT 0x4100
#define MIIM_88E1111_PHY_LED_COMBINE 0x411C
+/* 88E1121 PHY LED Control Register */
+#define MIIM_88E1121_PHY_LED_CTRL 16
+#define MIIM_88E1121_PHY_LED_PAGE 3
+#define MIIM_88E1121_PHY_LED_DEF 0x0030
+
+#define MIIM_88E1121_PHY_PAGE 22
+
/* 88E1145 Extended PHY Specific Control Register */
#define MIIM_88E1145_PHY_EXT_CR 20
#define MIIM_M88E1145_RGMII_RX_DELAY 0x0080
--
1.5.4.2
next prev parent reply other threads:[~2008-09-01 22:00 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1218807733-26929-1-git-send-email-dzu@denx.de>
[not found] ` <1218807733-26929-2-git-send-email-dzu@denx.de>
2008-08-15 13:45 ` [U-Boot] unassigned-patches/23: [PATCH] RX 8025 RTC: analyze 12/24-hour mode flag in rtc_get() u-boot at bugs.denx.de
2008-09-01 15:41 ` Detlev Zundel
[not found] ` <1218807733-26929-3-git-send-email-dzu@denx.de>
[not found] ` <1218807733-26929-4-git-send-email-dzu@denx.de>
2008-08-15 13:45 ` [U-Boot] unassigned-patches/22: [PATCH] Removed hardcoded MxMR loop value from upmconfig() for MPC85xx u-boot at bugs.denx.de
[not found] ` <1218807733-26929-5-git-send-email-dzu@denx.de>
2008-08-15 13:45 ` [U-Boot] unassigned-patches/27: [PATCH] 85xx: Socrates: Major code update u-boot at bugs.denx.de
[not found] ` <1218807733-26929-6-git-send-email-dzu@denx.de>
2008-08-15 13:45 ` [U-Boot] unassigned-patches/26: [PATCH] 85xx: socrates: Enable Lime support u-boot at bugs.denx.de
2008-08-15 13:45 ` [U-Boot] unassigned-patches/25: [PATCH] USB EHCI: reset root hub u-boot at bugs.denx.de
2008-09-01 15:41 ` Detlev Zundel
2008-09-01 17:33 ` Markus Klotzbücher
2008-09-04 8:44 ` Markus Klotzbücher
2008-09-04 9:19 ` [U-Boot] [PATCH v2] " Detlev Zundel
2008-09-04 9:44 ` Markus Klotzbücher
2008-09-05 23:25 ` Wolfgang Denk
2008-08-15 13:45 ` [U-Boot] unassigned-patches/24: [PATCH] PHY: Add support for the M88E1121R Marvell chip u-boot at bugs.denx.de
2008-09-01 15:39 ` Detlev Zundel
2008-09-01 22:00 ` Ben Warren [this message]
2008-09-01 22:48 ` Detlev Zundel
2008-09-02 0:34 ` Ben Warren
2008-09-02 8:11 ` Detlev Zundel
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=48BC6611.10108@gmail.com \
--to=biggerbadderben@gmail.com \
--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