All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v6 3/3] Armada100: Enable 88E3015 PHY support for GplugD
@ 2011-09-08 10:42 Ajay Bhargav
  2011-09-13 12:54 ` Prafulla Wadaskar
  0 siblings, 1 reply; 4+ messages in thread
From: Ajay Bhargav @ 2011-09-08 10:42 UTC (permalink / raw)
  To: u-boot

This patch adds support for 88E3015 PHY for Marvell GplugD board.
This patch depends on series of patch which adds support for Marvell
GuruPlug-Display.

Signed-off-by: Ajay Bhargav <ajay.bhargav@einfochips.com>
---
Changes for v2:
	- Not changed
Changes for v3:
	- code cleanup; removed unwated cast
Changes for v4:
	- Not changed
Changes for v5:
	- Coding style cleanup
Changes for v6:
	- Not changed

 board/Marvell/gplugd/gplugd.c |   33 +++++++++++++++++++++++++++++++++
 include/configs/gplugd.h      |   14 ++++++++++++++
 2 files changed, 47 insertions(+), 0 deletions(-)

diff --git a/board/Marvell/gplugd/gplugd.c b/board/Marvell/gplugd/gplugd.c
index 8560b3f..b4f7f81 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>
 
 #ifdef CONFIG_ARMADA100_FEC
 #include <net.h>
@@ -83,6 +85,11 @@ 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_LOW);
+	udelay(10);
+	/* Deassert PHY_RST# */
+	gpio_set_value(CONFIG_SYS_GPIO_PHY_RST, GPIO_HIGH);
 	return 0;
 }
 
@@ -97,4 +104,30 @@ int board_eth_init(bd_t *bis)
 
 	return armada100_fec_register(ARMD1_FEC_BASE);
 }
+
+#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, &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);
+	debug("88E3015 Initialized on %s\n", name);
+}
+#endif /* CONFIG_RESET_PHY_R */
 #endif /* CONFIG_ARMADA100_FEC */
diff --git a/include/configs/gplugd.h b/include/configs/gplugd.h
index 3ad2de5..5f72163 100644
--- a/include/configs/gplugd.h
+++ b/include/configs/gplugd.h
@@ -77,6 +77,20 @@
 #define CONFIG_BOOTP_DHCP_REQUEST_DELAY		50000
 #endif /* CONFIG_CMD_NET */
 
+/* GPIO Support */
+#define CONFIG_MARVELL_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] 4+ messages in thread

* [U-Boot] [PATCH v6 3/3] Armada100: Enable 88E3015 PHY support for GplugD
  2011-09-08 10:42 [U-Boot] [PATCH v6 3/3] Armada100: Enable 88E3015 PHY support for GplugD Ajay Bhargav
@ 2011-09-13 12:54 ` Prafulla Wadaskar
  2011-09-13 13:21   ` Marek Vasut
  0 siblings, 1 reply; 4+ messages in thread
From: Prafulla Wadaskar @ 2011-09-13 12:54 UTC (permalink / raw)
  To: u-boot



> -----Original Message-----
> From: Ajay Bhargav [mailto:ajay.bhargav at einfochips.com]
> Sent: Thursday, September 08, 2011 4:13 PM
> To: Prafulla Wadaskar
> Cc: u-boot at lists.denx.de; vapier at gentoo.org; marek.vasut at gmail.com; Ajay
> Bhargav
> Subject: [PATCH v6 3/3] Armada100: Enable 88E3015 PHY support for GplugD
> 
> This patch adds support for 88E3015 PHY for Marvell GplugD board.
> This patch depends on series of patch which adds support for Marvell
> GuruPlug-Display.
> 
> Signed-off-by: Ajay Bhargav <ajay.bhargav@einfochips.com>
> ---
> Changes for v2:
> 	- Not changed
> Changes for v3:
> 	- code cleanup; removed unwated cast
> Changes for v4:
> 	- Not changed
> Changes for v5:
> 	- Coding style cleanup
> Changes for v6:
> 	- Not changed
> 


Applied to u-boot-marvell.git next branch

Regards..
Prafulla . .

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

* [U-Boot] [PATCH v6 3/3] Armada100: Enable 88E3015 PHY support for GplugD
  2011-09-13 13:21   ` Marek Vasut
@ 2011-09-13 13:18     ` Ajay Bhargav
  0 siblings, 0 replies; 4+ messages in thread
From: Ajay Bhargav @ 2011-09-13 13:18 UTC (permalink / raw)
  To: u-boot


----- "Marek Vasut" <marek.vasut@gmail.com> wrote:

> On Tuesday, September 13, 2011 02:54:15 PM Prafulla Wadaskar wrote:
> > > -----Original Message-----
> > > From: Ajay Bhargav [mailto:ajay.bhargav at einfochips.com]
> > > Sent: Thursday, September 08, 2011 4:13 PM
> > > To: Prafulla Wadaskar
> > > Cc: u-boot at lists.denx.de; vapier at gentoo.org;
> marek.vasut at gmail.com; Ajay
> > > Bhargav
> > > Subject: [PATCH v6 3/3] Armada100: Enable 88E3015 PHY support for
> GplugD
> > > 
> > > This patch adds support for 88E3015 PHY for Marvell GplugD board.
> > > This patch depends on series of patch which adds support for
> Marvell
> > > GuruPlug-Display.
> > > 
> > > Signed-off-by: Ajay Bhargav <ajay.bhargav@einfochips.com>
> > > ---
> > > 
> > > Changes for v2:
> > > 	- Not changed
> > > 
> > > Changes for v3:
> > > 	- code cleanup; removed unwated cast
> > > 
> > > Changes for v4:
> > > 	- Not changed
> > > 
> > > Changes for v5:
> > > 	- Coding style cleanup
> > > 
> > > Changes for v6:
> > > 	- Not changed
> > 
> > Applied to u-boot-marvell.git next branch
> 
> I have a good feeling about these drivers, cheers!
> 

Thanks for your support Marek :)

Regards,
Ajay Bhargav

> > 
> > Regards..
> > Prafulla . .

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

* [U-Boot] [PATCH v6 3/3] Armada100: Enable 88E3015 PHY support for GplugD
  2011-09-13 12:54 ` Prafulla Wadaskar
@ 2011-09-13 13:21   ` Marek Vasut
  2011-09-13 13:18     ` Ajay Bhargav
  0 siblings, 1 reply; 4+ messages in thread
From: Marek Vasut @ 2011-09-13 13:21 UTC (permalink / raw)
  To: u-boot

On Tuesday, September 13, 2011 02:54:15 PM Prafulla Wadaskar wrote:
> > -----Original Message-----
> > From: Ajay Bhargav [mailto:ajay.bhargav at einfochips.com]
> > Sent: Thursday, September 08, 2011 4:13 PM
> > To: Prafulla Wadaskar
> > Cc: u-boot at lists.denx.de; vapier at gentoo.org; marek.vasut at gmail.com; Ajay
> > Bhargav
> > Subject: [PATCH v6 3/3] Armada100: Enable 88E3015 PHY support for GplugD
> > 
> > This patch adds support for 88E3015 PHY for Marvell GplugD board.
> > This patch depends on series of patch which adds support for Marvell
> > GuruPlug-Display.
> > 
> > Signed-off-by: Ajay Bhargav <ajay.bhargav@einfochips.com>
> > ---
> > 
> > Changes for v2:
> > 	- Not changed
> > 
> > Changes for v3:
> > 	- code cleanup; removed unwated cast
> > 
> > Changes for v4:
> > 	- Not changed
> > 
> > Changes for v5:
> > 	- Coding style cleanup
> > 
> > Changes for v6:
> > 	- Not changed
> 
> Applied to u-boot-marvell.git next branch

I have a good feeling about these drivers, cheers!

> 
> Regards..
> Prafulla . .

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

end of thread, other threads:[~2011-09-13 13:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-08 10:42 [U-Boot] [PATCH v6 3/3] Armada100: Enable 88E3015 PHY support for GplugD Ajay Bhargav
2011-09-13 12:54 ` Prafulla Wadaskar
2011-09-13 13:21   ` Marek Vasut
2011-09-13 13:18     ` Ajay Bhargav

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.