* [U-Boot] [PATCH 3/4] Armada100: Enable 88E3015 PHY support for GplugD
@ 2011-07-18 9:41 Ajay Bhargav
2011-07-18 19:27 ` Prafulla Wadaskar
0 siblings, 1 reply; 6+ messages in thread
From: Ajay Bhargav @ 2011-07-18 9:41 UTC (permalink / raw)
To: u-boot
This patch adds support for 88E3015 PHY for Marvell GplugD board.
Signed-off-by: Ajay Bhargav <ajay.bhargav@einfochips.com>
---
board/Marvell/gplugd/gplugd.c | 35 +++++++++++++++++++++++++++++++++++
include/configs/gplugd.h | 14 ++++++++++++++
2 files changed, 49 insertions(+), 0 deletions(-)
diff --git a/board/Marvell/gplugd/gplugd.c b/board/Marvell/gplugd/gplugd.c
index dc7d89d..347a689 100644
--- a/board/Marvell/gplugd/gplugd.c
+++ b/board/Marvell/gplugd/gplugd.c
@@ -32,6 +32,8 @@
#include <mvmfp.h>
#include <asm/arch/mfp.h>
#include <asm/arch/armada100.h>
+#include <asm/gpio.h>
+#include <miiphy.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -49,6 +51,7 @@ int board_early_init_f(void)
};
/* configure MFP's */
mfp_config(mfp_cfg);
+
return 0;
}
@@ -58,5 +61,37 @@ int board_init(void)
gd->bd->bi_arch_number = MACH_TYPE_SHEEVAD;
/* adress of boot parameters */
gd->bd->bi_boot_params = armd1_sdram_base(0) + 0x100;
+ /* Assert PHY_RST# */
+ gpio_direction_output(CONFIG_SYS_GPIO_PHY_RST, GPIO_CLR);
+ udelay(10);
+ /* Deassert PHY_RST# */
+ gpio_set_value(CONFIG_SYS_GPIO_PHY_RST, GPIO_SET);
return 0;
}
+
+#ifdef CONFIG_RESET_PHY_R
+/* Configure and initialize PHY chip 88E3015 */
+void reset_phy(void)
+{
+ u16 phy_adr;
+ const char *name = "armd-fec0";
+
+ if (miiphy_set_current_dev(name))
+ return;
+
+ /* command to read PHY dev address */
+ if (miiphy_read(name, 0xff, 0xff, (u16 *) &phy_adr)) {
+ printf("Err..%s could not read PHY dev address\n",
+ __func__);
+ return;
+ }
+
+ /* Set Ethernet LED in TX blink mode */
+ miiphy_write(name, phy_adr, PHY_LED_MAN_REG, 0x00);
+ miiphy_write(name, phy_adr, PHY_LED_PAR_SEL_REG, PHY_LED_VAL);
+
+ /* reset the phy */
+ miiphy_reset(name, phy_adr);
+ printf("88E3015 Initialized on %s\n", name);
+}
+#endif /* CONFIG_RESET_PHY_R */
diff --git a/include/configs/gplugd.h b/include/configs/gplugd.h
index cc14f49..412c959 100644
--- a/include/configs/gplugd.h
+++ b/include/configs/gplugd.h
@@ -65,6 +65,20 @@
#undef CONFIG_CMD_NET
#undef CONFIG_CMD_NFS
+/* GPIO Support */
+#define CONFIG_ARMADA100_GPIO
+
+/* PHY configuration */
+#define CONFIG_MII
+#define CONFIG_CMD_MII
+#define CONFIG_RESET_PHY_R
+/* 88E3015 register definition */
+#define PHY_LED_PAR_SEL_REG 22
+#define PHY_LED_MAN_REG 25
+#define PHY_LED_VAL 0x5b /* LINK LED1, ACT LED2 */
+/* GPIO Configuration for PHY */
+#define CONFIG_SYS_GPIO_PHY_RST 104 /* GPIO104 */
+
/*
* mv-common.h should be defined after CMD configs since it used them
* to enable certain macros
--
1.7.0.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH 3/4] Armada100: Enable 88E3015 PHY support for GplugD
2011-07-18 9:41 [U-Boot] [PATCH 3/4] Armada100: Enable 88E3015 PHY support for GplugD Ajay Bhargav
@ 2011-07-18 19:27 ` Prafulla Wadaskar
2011-07-19 4:10 ` Ajay Bhargav
0 siblings, 1 reply; 6+ messages in thread
From: Prafulla Wadaskar @ 2011-07-18 19:27 UTC (permalink / raw)
To: u-boot
> -----Original Message-----
> From: Ajay Bhargav [mailto:ajay.bhargav at einfochips.com]
> Sent: Monday, July 18, 2011 3:12 PM
> To: Prafulla Wadaskar
> Cc: u-boot at lists.denx.de; Ajay Bhargav
> Subject: [PATCH 3/4] Armada100: Enable 88E3015 PHY support for GplugD
>
> This patch adds support for 88E3015 PHY for Marvell GplugD board.
>
> Signed-off-by: Ajay Bhargav <ajay.bhargav@einfochips.com>
> ---
> board/Marvell/gplugd/gplugd.c | 35
> +++++++++++++++++++++++++++++++++++
> include/configs/gplugd.h | 14 ++++++++++++++
> 2 files changed, 49 insertions(+), 0 deletions(-)
>
> diff --git a/board/Marvell/gplugd/gplugd.c
> b/board/Marvell/gplugd/gplugd.c
> index dc7d89d..347a689 100644
> --- a/board/Marvell/gplugd/gplugd.c
> +++ b/board/Marvell/gplugd/gplugd.c
> @@ -32,6 +32,8 @@
> #include <mvmfp.h>
> #include <asm/arch/mfp.h>
> #include <asm/arch/armada100.h>
> +#include <asm/gpio.h>
> +#include <miiphy.h>
>
> DECLARE_GLOBAL_DATA_PTR;
>
> @@ -49,6 +51,7 @@ int board_early_init_f(void)
> };
> /* configure MFP's */
> mfp_config(mfp_cfg);
> +
Remove this unwanted commit line
> return 0;
> }
>
> @@ -58,5 +61,37 @@ int board_init(void)
> gd->bd->bi_arch_number = MACH_TYPE_SHEEVAD;
> /* adress of boot parameters */
> gd->bd->bi_boot_params = armd1_sdram_base(0) + 0x100;
> + /* Assert PHY_RST# */
> + gpio_direction_output(CONFIG_SYS_GPIO_PHY_RST, GPIO_CLR);
> + udelay(10);
> + /* Deassert PHY_RST# */
> + gpio_set_value(CONFIG_SYS_GPIO_PHY_RST, GPIO_SET);
May you please comment why do you need to set this GPIO?
> return 0;
> }
> +
> +#ifdef CONFIG_RESET_PHY_R
> +/* Configure and initialize PHY chip 88E3015 */
> +void reset_phy(void)
> +{
> + u16 phy_adr;
> + const char *name = "armd-fec0";
> +
> + if (miiphy_set_current_dev(name))
> + return;
> +
> + /* command to read PHY dev address */
> + if (miiphy_read(name, 0xff, 0xff, (u16 *) &phy_adr)) {
> + printf("Err..%s could not read PHY dev address\n",
> + __func__);
> + return;
> + }
> +
> + /* Set Ethernet LED in TX blink mode */
> + miiphy_write(name, phy_adr, PHY_LED_MAN_REG, 0x00);
> + miiphy_write(name, phy_adr, PHY_LED_PAR_SEL_REG, PHY_LED_VAL);
> +
> + /* reset the phy */
> + miiphy_reset(name, phy_adr);
> + printf("88E3015 Initialized on %s\n", name);
> +}
> +#endif /* CONFIG_RESET_PHY_R */
> diff --git a/include/configs/gplugd.h b/include/configs/gplugd.h
> index cc14f49..412c959 100644
> --- a/include/configs/gplugd.h
> +++ b/include/configs/gplugd.h
> @@ -65,6 +65,20 @@
> #undef CONFIG_CMD_NET
> #undef CONFIG_CMD_NFS
>
> +/* GPIO Support */
> +#define CONFIG_ARMADA100_GPIO
> +
> +/* PHY configuration */
This below configuration should be within #ifdef CONFIG_CMD_NET
Or more it to asm/arch/config.h (recommended)
> +#define CONFIG_MII
> +#define CONFIG_CMD_MII
> +#define CONFIG_RESET_PHY_R
> +/* 88E3015 register definition */
> +#define PHY_LED_PAR_SEL_REG 22
> +#define PHY_LED_MAN_REG 25
> +#define PHY_LED_VAL 0x5b /* LINK LED1, ACT LED2 */
> +/* GPIO Configuration for PHY */
> +#define CONFIG_SYS_GPIO_PHY_RST 104 /* GPIO104 */
> +
> /*
> * mv-common.h should be defined after CMD configs since it used them
> * to enable certain macros
Regards..
Prafulla . .
> --
> 1.7.0.4
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH 3/4] Armada100: Enable 88E3015 PHY support for GplugD
2011-07-18 19:27 ` Prafulla Wadaskar
@ 2011-07-19 4:10 ` Ajay Bhargav
2011-07-19 8:23 ` Albert ARIBAUD
2011-07-19 17:52 ` Prafulla Wadaskar
0 siblings, 2 replies; 6+ messages in thread
From: Ajay Bhargav @ 2011-07-19 4:10 UTC (permalink / raw)
To: u-boot
----- "Prafulla Wadaskar" <prafulla@marvell.com> wrote:
> > -----Original Message-----
> > From: Ajay Bhargav [mailto:ajay.bhargav at einfochips.com]
> > Sent: Monday, July 18, 2011 3:12 PM
> > To: Prafulla Wadaskar
> > Cc: u-boot at lists.denx.de; Ajay Bhargav
> > Subject: [PATCH 3/4] Armada100: Enable 88E3015 PHY support for
> GplugD
> >
> > This patch adds support for 88E3015 PHY for Marvell GplugD board.
> >
> > Signed-off-by: Ajay Bhargav <ajay.bhargav@einfochips.com>
> > ---
> > board/Marvell/gplugd/gplugd.c | 35
> > +++++++++++++++++++++++++++++++++++
> > include/configs/gplugd.h | 14 ++++++++++++++
> > 2 files changed, 49 insertions(+), 0 deletions(-)
> >
> > diff --git a/board/Marvell/gplugd/gplugd.c
> > b/board/Marvell/gplugd/gplugd.c
> > index dc7d89d..347a689 100644
> > --- a/board/Marvell/gplugd/gplugd.c
> > +++ b/board/Marvell/gplugd/gplugd.c
> > @@ -32,6 +32,8 @@
> > #include <mvmfp.h>
> > #include <asm/arch/mfp.h>
> > #include <asm/arch/armada100.h>
> > +#include <asm/gpio.h>
> > +#include <miiphy.h>
> >
> > DECLARE_GLOBAL_DATA_PTR;
> >
> > @@ -49,6 +51,7 @@ int board_early_init_f(void)
> > };
> > /* configure MFP's */
> > mfp_config(mfp_cfg);
> > +
>
> Remove this unwanted commit line
Okay..
>
> > return 0;
> > }
> >
> > @@ -58,5 +61,37 @@ int board_init(void)
> > gd->bd->bi_arch_number = MACH_TYPE_SHEEVAD;
> > /* adress of boot parameters */
> > gd->bd->bi_boot_params = armd1_sdram_base(0) + 0x100;
> > + /* Assert PHY_RST# */
> > + gpio_direction_output(CONFIG_SYS_GPIO_PHY_RST, GPIO_CLR);
> > + udelay(10);
> > + /* Deassert PHY_RST# */
> > + gpio_set_value(CONFIG_SYS_GPIO_PHY_RST, GPIO_SET);
>
> May you please comment why do you need to set this GPIO?
GPIO 104 is connected to reset pin of 88E3015 PHY. and a reset is
required before initializing PHY chip.
Regards,
Ajay Bhargav
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH 3/4] Armada100: Enable 88E3015 PHY support for GplugD
2011-07-19 8:23 ` Albert ARIBAUD
@ 2011-07-19 8:16 ` Ajay Bhargav
0 siblings, 0 replies; 6+ messages in thread
From: Ajay Bhargav @ 2011-07-19 8:16 UTC (permalink / raw)
To: u-boot
Hi Albert,
> I believe Prafulla would like this comment to appear in the code --
> anyway, *I* would like it to. :)
Got it.. will add that :)
Regards,
Ajay Bhargav
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH 3/4] Armada100: Enable 88E3015 PHY support for GplugD
2011-07-19 4:10 ` Ajay Bhargav
@ 2011-07-19 8:23 ` Albert ARIBAUD
2011-07-19 8:16 ` Ajay Bhargav
2011-07-19 17:52 ` Prafulla Wadaskar
1 sibling, 1 reply; 6+ messages in thread
From: Albert ARIBAUD @ 2011-07-19 8:23 UTC (permalink / raw)
To: u-boot
Hi Ajay,
Le 19/07/2011 06:10, Ajay Bhargav a ?crit :
>>> + gpio_set_value(CONFIG_SYS_GPIO_PHY_RST, GPIO_SET);
>>
>> May you please comment why do you need to set this GPIO?
>
> GPIO 104 is connected to reset pin of 88E3015 PHY. and a reset is
> required before initializing PHY chip.
I believe Prafulla would like this comment to appear in the code --
anyway, *I* would like it to. :)
> Regards,
> Ajay Bhargav
Amicalement,
--
Albert.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH 3/4] Armada100: Enable 88E3015 PHY support for GplugD
2011-07-19 4:10 ` Ajay Bhargav
2011-07-19 8:23 ` Albert ARIBAUD
@ 2011-07-19 17:52 ` Prafulla Wadaskar
1 sibling, 0 replies; 6+ messages in thread
From: Prafulla Wadaskar @ 2011-07-19 17:52 UTC (permalink / raw)
To: u-boot
> -----Original Message-----
> From: Ajay Bhargav [mailto:ajay.bhargav at einfochips.com]
> Sent: Tuesday, July 19, 2011 9:41 AM
> To: Prafulla Wadaskar
> Cc: u-boot at lists.denx.de; Ashish Karkare; Prabhanjan Sarnaik
> Subject: Re: [PATCH 3/4] Armada100: Enable 88E3015 PHY support for
> GplugD
>
>
> ----- "Prafulla Wadaskar" <prafulla@marvell.com> wrote:
>
> > > -----Original Message-----
> > > From: Ajay Bhargav [mailto:ajay.bhargav at einfochips.com]
> > > Sent: Monday, July 18, 2011 3:12 PM
> > > To: Prafulla Wadaskar
> > > Cc: u-boot at lists.denx.de; Ajay Bhargav
> > > Subject: [PATCH 3/4] Armada100: Enable 88E3015 PHY support for
> > GplugD
> > >
> > > This patch adds support for 88E3015 PHY for Marvell GplugD board.
> > >
> > > Signed-off-by: Ajay Bhargav <ajay.bhargav@einfochips.com>
> > > ---
> > > board/Marvell/gplugd/gplugd.c | 35
> > > +++++++++++++++++++++++++++++++++++
> > > include/configs/gplugd.h | 14 ++++++++++++++
> > > 2 files changed, 49 insertions(+), 0 deletions(-)
> > >
> > > diff --git a/board/Marvell/gplugd/gplugd.c
> > > b/board/Marvell/gplugd/gplugd.c
> > > index dc7d89d..347a689 100644
> > > --- a/board/Marvell/gplugd/gplugd.c
> > > +++ b/board/Marvell/gplugd/gplugd.c
> > > @@ -32,6 +32,8 @@
> > > #include <mvmfp.h>
> > > #include <asm/arch/mfp.h>
> > > #include <asm/arch/armada100.h>
> > > +#include <asm/gpio.h>
> > > +#include <miiphy.h>
> > >
> > > DECLARE_GLOBAL_DATA_PTR;
> > >
> > > @@ -49,6 +51,7 @@ int board_early_init_f(void)
> > > };
> > > /* configure MFP's */
> > > mfp_config(mfp_cfg);
> > > +
> >
> > Remove this unwanted commit line
>
> Okay..
>
> >
> > > return 0;
> > > }
> > >
> > > @@ -58,5 +61,37 @@ int board_init(void)
> > > gd->bd->bi_arch_number = MACH_TYPE_SHEEVAD;
> > > /* adress of boot parameters */
> > > gd->bd->bi_boot_params = armd1_sdram_base(0) + 0x100;
> > > + /* Assert PHY_RST# */
> > > + gpio_direction_output(CONFIG_SYS_GPIO_PHY_RST, GPIO_CLR);
> > > + udelay(10);
> > > + /* Deassert PHY_RST# */
> > > + gpio_set_value(CONFIG_SYS_GPIO_PHY_RST, GPIO_SET);
> >
> > May you please comment why do you need to set this GPIO?
>
> GPIO 104 is connected to reset pin of 88E3015 PHY. and a reset is
> required before initializing PHY chip.
So, good to put this as code comment :-)
Regards..
Prafulla . .
>
> Regards,
> Ajay Bhargav
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-07-19 17:52 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-18 9:41 [U-Boot] [PATCH 3/4] Armada100: Enable 88E3015 PHY support for GplugD Ajay Bhargav
2011-07-18 19:27 ` Prafulla Wadaskar
2011-07-19 4:10 ` Ajay Bhargav
2011-07-19 8:23 ` Albert ARIBAUD
2011-07-19 8:16 ` Ajay Bhargav
2011-07-19 17:52 ` Prafulla Wadaskar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox