public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] [PATCH] PHY: Add support for the M88E1121R Marvell chip.
@ 2008-06-06 13:52 Wolfgang Denk
  2008-06-09  5:10 ` Ben Warren
  2008-06-09  6:31 ` Ben Warren
  0 siblings, 2 replies; 4+ messages in thread
From: Wolfgang Denk @ 2008-06-06 13:52 UTC (permalink / raw)
  To: u-boot

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
@@ -1128,6 +1128,54 @@ struct phy_info phy_info_M88E1111S = {
 			   },
 };
 
+/*
+ *  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);
@@ -1492,6 +1540,7 @@ struct phy_info *phy_info[] = {
 	&phy_info_BCM5464S,
 	&phy_info_M88E1011S,
 	&phy_info_M88E1111S,
+	&phy_info_M88E1121R,
 	&phy_info_M88E1145,
 	&phy_info_M88E1149S,
 	&phy_info_dm9161,
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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot-Users] [PATCH] PHY: Add support for the M88E1121R Marvell chip.
  2008-06-06 13:52 [U-Boot-Users] [PATCH] PHY: Add support for the M88E1121R Marvell chip Wolfgang Denk
@ 2008-06-09  5:10 ` Ben Warren
  2008-06-09  6:09   ` Wolfgang Denk
  2008-06-09  6:31 ` Ben Warren
  1 sibling, 1 reply; 4+ messages in thread
From: Ben Warren @ 2008-06-09  5:10 UTC (permalink / raw)
  To: u-boot

Hi,

Wolfgang Denk wrote:
> 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
> @@ -1128,6 +1128,54 @@ struct phy_info phy_info_M88E1111S = {
>  			   },
>  };
>  
> +/*
> + *  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);
> @@ -1492,6 +1540,7 @@ struct phy_info *phy_info[] = {
>  	&phy_info_BCM5464S,
>  	&phy_info_M88E1011S,
>  	&phy_info_M88E1111S,
> +	&phy_info_M88E1121R,
>  	&phy_info_M88E1145,
>  	&phy_info_M88E1149S,
>  	&phy_info_dm9161,
> 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
>   
This won't apply because to the net repo, I'm guessing because I've 
already applied another patch to driver/net/tsec.c for another Marvell 
PHY (commit 290ef6436838b1cc013bd67e0e0495c9eb3e23c0) and it hasn't made 
it into the main line yet. I see two options:

1. Somebody who knows more about git please tell me how to merge this.
2. Rebase the patch vs. the current net tree.

regards,
Ben

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot-Users] [PATCH] PHY: Add support for the M88E1121R Marvell chip.
  2008-06-09  5:10 ` Ben Warren
@ 2008-06-09  6:09   ` Wolfgang Denk
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Denk @ 2008-06-09  6:09 UTC (permalink / raw)
  To: u-boot

Dear Ben,

in message <484CBB58.90903@qstreams.com> you wrote:
> 
> This won't apply because to the net repo, I'm guessing because I've 
> already applied another patch to driver/net/tsec.c for another Marvell 
> PHY (commit 290ef6436838b1cc013bd67e0e0495c9eb3e23c0) and it hasn't made 
> it into the main line yet. I see two options:
> 
> 1. Somebody who knows more about git please tell me how to merge this.
> 2. Rebase the patch vs. the current net tree.

If you agree with the content of the patch, then please just ACK  it.
I  will  then  first pull the net repo, and after this merge with the
"socrates" branch I have here. I  will  also  resolve  the  resulting
merge conflicts, if any. OK?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
In the beginning, there was nothing, which exploded.
                                - Terry Pratchett, _Lords and Ladies_

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot-Users] [PATCH] PHY: Add support for the M88E1121R Marvell chip.
  2008-06-06 13:52 [U-Boot-Users] [PATCH] PHY: Add support for the M88E1121R Marvell chip Wolfgang Denk
  2008-06-09  5:10 ` Ben Warren
@ 2008-06-09  6:31 ` Ben Warren
  1 sibling, 0 replies; 4+ messages in thread
From: Ben Warren @ 2008-06-09  6:31 UTC (permalink / raw)
  To: u-boot

Wolfgang Denk wrote:
> From: Sergei Poselenov <sposelenov@emcraft.com>
>
> Signed-off-by: Yuri Tikhonov <yur@emcraft.com>
> Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
>   
Acked-by: Ben Warren <biggerbadderben@gmail.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
> @@ -1128,6 +1128,54 @@ struct phy_info phy_info_M88E1111S = {
>  			   },
>  };
>  
> +/*
> + *  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);
> @@ -1492,6 +1540,7 @@ struct phy_info *phy_info[] = {
>  	&phy_info_BCM5464S,
>  	&phy_info_M88E1011S,
>  	&phy_info_M88E1111S,
> +	&phy_info_M88E1121R,
>  	&phy_info_M88E1145,
>  	&phy_info_M88E1149S,
>  	&phy_info_dm9161,
> 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
>   

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-06-09  6:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-06 13:52 [U-Boot-Users] [PATCH] PHY: Add support for the M88E1121R Marvell chip Wolfgang Denk
2008-06-09  5:10 ` Ben Warren
2008-06-09  6:09   ` Wolfgang Denk
2008-06-09  6:31 ` Ben Warren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox