All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 3/3] Armada100: Enable 88E3015 PHY support for GplugD
Date: Wed, 24 Aug 2011 18:26:03 +0200	[thread overview]
Message-ID: <201108241826.03756.marek.vasut@gmail.com> (raw)
In-Reply-To: <1314191240-30938-3-git-send-email-ajay.bhargav@einfochips.com>

On Wednesday, August 24, 2011 03:07:20 PM Ajay Bhargav wrote:
> 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
> 
>  board/Marvell/gplugd/gplugd.c |   33 ++++++++++++++++++++++++++++++++-
>  include/configs/gplugd.h      |   14 ++++++++++++++
>  2 files changed, 46 insertions(+), 1 deletions(-)
> 
> diff --git a/board/Marvell/gplugd/gplugd.c b/board/Marvell/gplugd/gplugd.c
> index 4cd4086..bf3cdb4 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,5 +104,29 @@ int board_eth_init(bd_t *bis)
> 
>  	return armada100_fec_register();
>  }
> -#endif /* CONFIG_ARMADA100_FEC */
> +#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)) {

Do you need the cast there ?

> +		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);

Maybe debug() ?

> +}
> +#endif /* CONFIG_RESET_PHY_R */
> +#endif /* CONFIG_ARMADA100_FEC */
> diff --git a/include/configs/gplugd.h b/include/configs/gplugd.h
> index f3b94d8..b63ffd5 100644
> --- a/include/configs/gplugd.h
> +++ b/include/configs/gplugd.h
> @@ -80,6 +80,20 @@
>  #define CONFIG_ROOTPATH				"/tftpboot"
>  #define CONFIG_SYS_IMG_NAME			"uImage"
> 
> +/* 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

Cheers

      reply	other threads:[~2011-08-24 16:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-24 13:07 [U-Boot] [PATCH v2 3/3] Armada100: Enable 88E3015 PHY support for GplugD Ajay Bhargav
2011-08-24 16:26 ` Marek Vasut [this message]

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=201108241826.03756.marek.vasut@gmail.com \
    --to=marek.vasut@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 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.