On Mon, Jul 28, 2014 at 09:38:41AM +0530, Lokesh Vutla wrote:

> DRA7 evm REV G and later boards uses a vtt regulator for DDR3 termination
> and this is controlled by gpio7_11. Configuring gpio7_11.
> The pad A22(offset 0x3b4) is used by gpio7_11 on REV G and later boards,
> and left unused on previous boards, so enabling this gpio for all the
> boards, as it is unaffected.

NAK.

> diff --git a/arch/arm/cpu/armv7/omap-common/emif-common.c 
> b/arch/arm/cpu/armv7/omap-common/emif-common.c
> index 71c0cc8..74ebf41 100644
> --- a/arch/arm/cpu/armv7/omap-common/emif-common.c
> +++ b/arch/arm/cpu/armv7/omap-common/emif-common.c
> @@ -1307,6 +1307,10 @@ static void do_bug0039_workaround(u32 base)
>       __raw_writel(clkctrl,  (*prcm)->cm_memif_clkstctrl);
>  }
>  
> +void __weak ddr_regulator_enable(void)
> +{
> +}
> +
>  /*
>   * SDRAM initialization:
>   * SDRAM initialization has two parts:
> @@ -1342,6 +1346,8 @@ void sdram_init(void)
>                       bypass_dpll((*prcm)->cm_clkmode_dpll_core);
>               else if (sdram_type == EMIF_SDRAM_TYPE_DDR3)
>                       writel(CM_DLL_CTRL_NO_OVERRIDE, (*prcm)->cm_dll_ctrl);
> +
> +             ddr_regulator_enable();
>       }
>  
>       if (!in_sdram)

Please add CONFIG_BOARD_EARLY_INIT_F to the config file and a matching
board_early_init_f().

[snip]
> diff --git a/board/ti/dra7xx/evm.c b/board/ti/dra7xx/evm.c
> index 7f19655..ededa1f 100644
> --- a/board/ti/dra7xx/evm.c
> +++ b/board/ti/dra7xx/evm.c
> @@ -16,6 +16,7 @@
>  #include <asm/arch/sys_proto.h>
>  #include <asm/arch/mmc_host_def.h>
>  #include <asm/arch/sata.h>
> +#include <asm/arch/gpio.h>
>  #include <environment.h>
>  
>  #include "mux_data.h"
> @@ -267,3 +268,23 @@ int board_eth_init(bd_t *bis)
>       return ret;
>  }
>  #endif
> +
> +/* VTT regulator enable */
> +void ddr_regulator_enable(void)
> +{
> +     u32 temp;
> +
> +     /* Do not enable VTT for DRA722 */
> +     if (omap_revision() == DRA722_ES1_0)
> +             return;
> +
> +     /* enable module */
> +     writel(GPIO_CTRL_ENABLEMODULE, OMAP54XX_GPIO7_BASE + OMAP_GPIO_CTRL);
> +
> +     /*enable output for GPIO7_11*/
> +     writel(GPIO_SETDATAOUT(11), OMAP54XX_GPIO7_BASE + OMAP_GPIO_SETDATAOUT);
> +     temp = readl(OMAP54XX_GPIO7_BASE + OMAP_GPIO_OE);
> +     temp = temp & ~(GPIO_OE_ENABLE(11));
> +     writel(temp, OMAP54XX_GPIO7_BASE + OMAP_GPIO_OE);
> +     writel(GPIO_DATAOUT(11), OMAP54XX_GPIO7_BASE + OMAP_GPIO_DATAOUT);

All of this should be using the normal gpio_ functions.  See am335x
where we also have to the same thing for a board (except we shim it into
sdram_init since that's per board, unlike dra7).

-- 
Tom

Attachment: signature.asc
Description: Digital signature

_______________________________________________
U-Boot mailing list
[email protected]
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to