Re: [PATCH] OMAP3EVM:FIX: Reset the SMSC911x Ethernet controller in board_init

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jan 24, 2011 at 20:11,  <hvaibhav@xxxxxx> wrote:
> From: Vaibhav Hiremath <hvaibhav@xxxxxx>
>

Thanks for the patch.  I guess this problem was initially reported by Kevin.
So you may consider adding his Reported-by.

> With addition of HWMOD support to GPIO, the Ethernet controller

%s/HWMOD/hwmod

> goes undetected for OMAP35xEVM. So explicitely assert the reset signal to

%s/explicitely/explicitly

> Ethernet controller smsc911x -
>
>        - GPIO7 (>=RevG version of EVM's)
>        - GPIO64 (<=RevD version of EVM's)
>
> I have tested this patch on RevG version of EVM with ES3.1 Si.
> This patch is based on intial version from Charulatha V.

Please add the link for reference. Also please add my SOB if you find
it relevant.

>
> Signed-off-by: Vaibhav Hiremath <hvaibhav@xxxxxx>
> ---
> NOTE: I have not been able to test it on older version of EVM's.
>
>  arch/arm/mach-omap2/board-omap3evm.c |   27 ++++++++++++++++++++++++++-
>  1 files changed, 26 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
> index 212d88c..336c012 100644
> --- a/arch/arm/mach-omap2/board-omap3evm.c
> +++ b/arch/arm/mach-omap2/board-omap3evm.c
> @@ -124,10 +124,15 @@ static struct platform_device omap3evm_smsc911x_device = {
>
>  static inline void __init omap3evm_init_smsc911x(void)
>  {
> -       int eth_cs;
> +       int eth_cs, eth_rst;
>        struct clk *l3ck;
>        unsigned int rate;
>
> +       if (get_omap3_evm_rev() == OMAP3EVM_BOARD_GEN_1)
> +               eth_rst = 64;

Please define macros and use them.

> +       else
> +               eth_rst = 7;

Ditto

> +
>        eth_cs = OMAP3EVM_SMSC911X_CS;
>
>        l3ck = clk_get(NULL, "l3_ck");
> @@ -136,6 +141,22 @@ static inline void __init omap3evm_init_smsc911x(void)
>        else
>                rate = clk_get_rate(l3ck);
>
> +       /* Configure ethernet controller reset gpio */
> +       if (cpu_is_omap3430()) {

cpu_is_omap3430() is not required, as this board init would not be
called otherwise.

> +               if (gpio_request(eth_rst, "SMSC911x gpio") < 0) {
> +                       pr_err(KERN_ERR "Failed to request GPIO7 for smsc911x\n");
> +                       return;
> +               }
> +
> +               gpio_direction_output(eth_rst, 1);

Check for the return value

> +               /* reset pulse to ethernet controller*/
> +               usleep_range(150, 220);
> +               gpio_set_value(eth_rst, 0);
> +               usleep_range(150, 220);
> +               gpio_set_value(eth_rst, 1);
> +               usleep_range(1, 2);
> +       }
> +
>        if (gpio_request(OMAP3EVM_ETHR_GPIO_IRQ, "SMSC911x irq") < 0) {
>                printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n",
>                        OMAP3EVM_ETHR_GPIO_IRQ);
> @@ -703,6 +724,10 @@ static struct omap_board_mux omap35x_board_mux[] __initdata = {
>        OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
>                                OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW |
>                                OMAP_PIN_OFF_WAKEUPENABLE),
> +       OMAP3_MUX(SYS_BOOT5, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
> +                               OMAP_PIN_OFF_NONE),
> +       OMAP3_MUX(GPMC_WAIT2, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
> +                               OMAP_PIN_OFF_NONE),
>        { .reg_offset = OMAP_MUX_TERMINATOR },
>  };
>
> --
> 1.6.2.4
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux