Re: [U-Boot] [PATCH] config.mk: Delete unnecessary code

2013-08-27 Thread Masahiro Yamada
Hello, Tom.

I noticed this patch does not apply to the current u-boot/master
because commit 3aa29de0 modified the same part.
(BTW, I think CONFIG_TPL_PAD_TO is not necessary either and should be deleted.)

Should I need to post version 2 which is rebased on the current master?
(if my patch deserves that, of course.)

Or are you going to resolve the conflict?

The conflict dons not seem so comprecated.


Best Regards
Masahiro Yamada




On Wed, 31 Jul 2013 13:16:11 +0900
Masahiro Yamada  wrote:

> Currently no makefiles set the following variables:
> 
> CONFIG_SPL_TEXT_BASE
> CONFIG_UBOOT_PAD_TO
> CONFIG_RESET_VECTOR_ADDRESS
> 
> For all targets which use above macros
> they are set in header files (include/configs/*.h),
> so we do not need to set them as CPPFLAGS.
> 
> Signed-off-by: Masahiro Yamada 
> ---
>  config.mk | 12 
>  1 file changed, 12 deletions(-)
> 
> diff --git a/config.mk b/config.mk
> index b16fad8..240b6df 100644
> --- a/config.mk
> +++ b/config.mk
> @@ -206,18 +206,10 @@ ifneq ($(CONFIG_SYS_TEXT_BASE),)
>  CPPFLAGS += -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE)
>  endif
>  
> -ifneq ($(CONFIG_SPL_TEXT_BASE),)
> -CPPFLAGS += -DCONFIG_SPL_TEXT_BASE=$(CONFIG_SPL_TEXT_BASE)
> -endif
> -
>  ifneq ($(CONFIG_SPL_PAD_TO),)
>  CPPFLAGS += -DCONFIG_SPL_PAD_TO=$(CONFIG_SPL_PAD_TO)
>  endif
>  
> -ifneq ($(CONFIG_UBOOT_PAD_TO),)
> -CPPFLAGS += -DCONFIG_UBOOT_PAD_TO=$(CONFIG_UBOOT_PAD_TO)
> -endif
> -
>  ifeq ($(CONFIG_SPL_BUILD),y)
>  CPPFLAGS += -DCONFIG_SPL_BUILD
>  endif
> @@ -230,10 +222,6 @@ Please undefined CONFIG_SYS_GENERIC_BOARD in your board 
> config file)
>  endif
>  endif
>  
> -ifneq ($(RESET_VECTOR_ADDRESS),)
> -CPPFLAGS += -DRESET_VECTOR_ADDRESS=$(RESET_VECTOR_ADDRESS)
> -endif
> -
>  ifneq ($(OBJTREE),$(SRCTREE))
>  CPPFLAGS += -I$(OBJTREE)/include2 -I$(OBJTREE)/include
>  endif
> -- 
> 1.8.1.2

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] arm: zynq: Fix timer loadaddress

2013-08-27 Thread Michal Simek
Reload address was written to the counter register
instead of load register.
The problem happens when timer expires but never
reload to ~0UL (it is downcount timer).

Reported-by: Stephen MacMahon 
Signed-off-by: Michal Simek 

---
 arch/arm/cpu/armv7/zynq/timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/cpu/armv7/zynq/timer.c b/arch/arm/cpu/armv7/zynq/timer.c
index 0133565..3b8d949 100644
--- a/arch/arm/cpu/armv7/zynq/timer.c
+++ b/arch/arm/cpu/armv7/zynq/timer.c
@@ -57,7 +57,7 @@ int timer_init(void)
SCUTIMER_CONTROL_ENABLE_MASK;

/* Load the timer counter register */
-   writel(0x, &timer_base->counter);
+   writel(0x, &timer_base->load);

/*
 * Start the A9Timer device
--
1.8.2.3



pgpLYohucoxaH.pgp
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 6/6 V2] Sound: MAX98095: Support I2S0 channel

2013-08-27 Thread Minkyu Kang
On 04/08/13 15:44, Dani Krishna Mohan wrote:
> This patch modifies the MAX98095 audio codec to support
>  I2S0 channel in codec slave mode.
> 
> Signed-off-by: Dani Krishna Mohan 
> ---
> changes in V2:
>   - New patch added to V2
>  drivers/sound/max98095.c |   29 +++--
>  1 file changed, 11 insertions(+), 18 deletions(-)
> 

ditto.
Please do not replacing.
Please adds support i2s0.

Thanks,
Minkyu Kang.

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/6 V2] Sound: I2S: Replacing I2S1 with I2S0 channel.

2013-08-27 Thread Minkyu Kang
On 04/08/13 15:44, Dani Krishna Mohan wrote:
> This patch makes required changes to make use
> of I2S0 channel instead of I2S1 channel on exynos5250.
> 
> Signed-off-by: Dani Krishna Mohan 
> ---
> changes in V2:
>   - None
>  arch/arm/include/asm/arch-exynos/i2s-regs.h |6 ++
>  drivers/sound/samsung-i2s.c |   16 ++--
>  2 files changed, 16 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/arm/include/asm/arch-exynos/i2s-regs.h 
> b/arch/arm/include/asm/arch-exynos/i2s-regs.h
> index 613b9b7..4a4a7a0 100644
> --- a/arch/arm/include/asm/arch-exynos/i2s-regs.h
> +++ b/arch/arm/include/asm/arch-exynos/i2s-regs.h
> @@ -8,10 +8,12 @@
>  #ifndef __I2S_REGS_H__
>  #define __I2S_REGS_H__
>  
> +#define CON_RESET(1 << 31)
>  #define CON_TXFIFO_FULL  (1 << 8)
>  #define CON_TXCH_PAUSE   (1 << 4)
>  #define CON_ACTIVE   (1 << 0)
>  
> +#define MOD_OP_CLK   (3 << 30)
>  #define MOD_BLCP_SHIFT   24
>  #define MOD_BLCP_16BIT   (0 << MOD_BLCP_SHIFT)
>  #define MOD_BLCP_8BIT(1 << MOD_BLCP_SHIFT)
> @@ -24,6 +26,7 @@
>  #define MOD_BLC_MASK (3 << 13)
>  
>  #define MOD_SLAVE(1 << 11)
> +#define MOD_RCLKSRC  (0 << 10)
>  #define MOD_MASK (3 << 8)
>  #define MOD_LR_LLOW  (0 << 7)
>  #define MOD_LR_RLOW  (1 << 7)
> @@ -47,4 +50,7 @@
>  #define FIC_TXFLUSH  (1 << 15)
>  #define FIC_RXFLUSH  (1 << 7)
>  
> +#define PSREN(1 << 15)
> +#define PSVAL(3 << 8)
> +
>  #endif /* __I2S_REGS_H__ */
> diff --git a/drivers/sound/samsung-i2s.c b/drivers/sound/samsung-i2s.c
> index 49921e5..8e8a2bc 100644
> --- a/drivers/sound/samsung-i2s.c
> +++ b/drivers/sound/samsung-i2s.c
> @@ -303,21 +303,25 @@ int i2s_tx_init(struct i2stx_info *pi2s_tx)
>   (struct i2s_reg *)pi2s_tx->base_address;
>  
>   /* Initialize GPIO for I2s */
> - exynos_pinmux_config(PERIPH_ID_I2S1, 0);
> + exynos_pinmux_config(PERIPH_ID_I2S0, 0);

please don't replacing.
please adds support i2c0.

>  
>   /* Set EPLL Clock */
> - ret = set_epll_clk(pi2s_tx->audio_pll_clk);
> + ret = set_epll_clk(pi2s_tx->samplingrate * pi2s_tx->rfs * 4);
>   if (ret != 0) {
>   debug("%s: epll clock set rate falied\n", __func__);
>   return -1;
>   }
>  
> - /* Select Clk Source for Audio1 */
> + /* Select Clk Source for Audio0 */
>   set_i2s_clk_source();
>  
> - /* Set Prescaler to get MCLK */
> - set_i2s_clk_prescaler(pi2s_tx->audio_pll_clk,
> - (pi2s_tx->samplingrate * (pi2s_tx->rfs)));
> + /*Reset the i2s module */
> + writel(CON_RESET, &i2s_reg->con);
> +
> + writel(MOD_OP_CLK | MOD_RCLKSRC, &i2s_reg->mod);
> +
> + /* set i2s prescaler */
> + writel(PSREN | PSVAL, &i2s_reg->psr);
>  
>   /* Configure I2s format */
>   ret = i2s_set_fmt(i2s_reg, (SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
> 

Thanks,
Minkyu Kang.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/6 V2] ARM: Change from I2S1 to I2S0 for audio on SMDK5250

2013-08-27 Thread Minkyu Kang
On 04/08/13 15:44, Dani Krishna Mohan wrote:
> This patch makes the necessary changes for making use of
> I2S0 channel instead of I2S1 channel on smdk board. This
> changes are done to maintain the uniformity to use I2S0 channel.
> 
> Signed-off-by: Dani Krishna Mohan 
> ---
> changes in V2:
>   - None
>  arch/arm/cpu/armv7/exynos/clock.c |   13 +
>  arch/arm/cpu/armv7/exynos/pinmux.c|   15 +--
>  arch/arm/include/asm/arch-exynos/clock.h  |8 +---
>  arch/arm/include/asm/arch-exynos/cpu.h|2 ++
>  arch/arm/include/asm/arch-exynos/periph.h |1 +
>  5 files changed, 30 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/arm/cpu/armv7/exynos/clock.c 
> b/arch/arm/cpu/armv7/exynos/clock.c
> index 0cb1a61..2a1b681 100644
> --- a/arch/arm/cpu/armv7/exynos/clock.c
> +++ b/arch/arm/cpu/armv7/exynos/clock.c
> @@ -282,6 +282,9 @@ static unsigned long exynos5_get_periph_rate(int 
> peripheral)
>   src = readl(&clk->src_peric0);
>   div = readl(&clk->div_peric3);
>   break;
> + case PERIPH_ID_I2S0:
> + src = readl(&clk->src_mau);
> + div = readl(&clk->div_mau);
>   case PERIPH_ID_SPI0:
>   case PERIPH_ID_SPI1:
>   src = readl(&clk->src_peric1);
> @@ -1151,8 +1154,10 @@ void exynos5_set_i2s_clk_source(void)
>   struct exynos5_clock *clk =
>   (struct exynos5_clock *)samsung_get_base_clock();
>  
> - clrsetbits_le32(&clk->src_peric1, AUDIO1_SEL_MASK,

you should support audio1 also.
please do not replace, support both of them.

> + setbits_le32(&clk->src_top2, CLK_SRC_MOUT_EPLL);
> + clrsetbits_le32(&clk->src_mau, AUDIO_SEL_MASK,
>   (CLK_SRC_SCLK_EPLL));
> + setbits_le32(EXYNOS_AUDSS, CLKMUX_ASS);

Don't access base address directly.

>  }
>  
>  int exynos5_set_i2s_clk_prescaler(unsigned int src_frq,
> @@ -1169,13 +1174,13 @@ int exynos5_set_i2s_clk_prescaler(unsigned int 
> src_frq,
>   }
>  
>   div = (src_frq / dst_frq);
> - if (div > AUDIO_1_RATIO_MASK) {
> + if (div > AUDIO_RATIO_MASK) {
>   debug("%s: Frequency ratio is out of range\n", __func__);
>   debug("src frq = %d des frq = %d ", src_frq, dst_frq);
>   return -1;
>   }
> - clrsetbits_le32(&clk->div_peric4, AUDIO_1_RATIO_MASK,
> - (div & AUDIO_1_RATIO_MASK));
> + clrsetbits_le32(&clk->div_mau, AUDIO_RATIO_MASK,
> + (div & AUDIO_RATIO_MASK));

ditto.
please support both of them.

>   return 0;
>  }
>  
> diff --git a/arch/arm/cpu/armv7/exynos/pinmux.c 
> b/arch/arm/cpu/armv7/exynos/pinmux.c
> index 1b05ebf..59f445a 100644
> --- a/arch/arm/cpu/armv7/exynos/pinmux.c
> +++ b/arch/arm/cpu/armv7/exynos/pinmux.c
> @@ -221,9 +221,19 @@ static void exynos5_i2s_config(int peripheral)
>   int i;
>   struct exynos5_gpio_part1 *gpio1 =
>   (struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();
> + struct exynos5_gpio_part4 *gpio4 =
> + (struct exynos5_gpio_part4 *)samsung_get_base_gpio_part4();
>  
> - for (i = 0; i < 5; i++)
> - s5p_gpio_cfg_pin(&gpio1->b0, i, GPIO_FUNC(0x02));
> + switch (peripheral) {
> + case PERIPH_ID_I2S0:
> + for (i = 0; i < 5; i++)
> + s5p_gpio_cfg_pin(&gpio4->z, i, GPIO_FUNC(0x02));
> + break;
> + case PERIPH_ID_I2S1:
> + for (i = 0; i < 5; i++)
> + s5p_gpio_cfg_pin(&gpio1->b0, i, GPIO_FUNC(0x02));
> + break;
> + }
>  }
>  
>  void exynos5_spi_config(int peripheral)
> @@ -296,6 +306,7 @@ static int exynos5_pinmux_config(int peripheral, int 
> flags)
>   case PERIPH_ID_I2C7:
>   exynos5_i2c_config(peripheral, flags);
>   break;
> + case PERIPH_ID_I2S0:
>   case PERIPH_ID_I2S1:
>   exynos5_i2s_config(peripheral);
>   break;
> diff --git a/arch/arm/include/asm/arch-exynos/clock.h 
> b/arch/arm/include/asm/arch-exynos/clock.h
> index 2b97b9a..d55424e 100644
> --- a/arch/arm/include/asm/arch-exynos/clock.h
> +++ b/arch/arm/include/asm/arch-exynos/clock.h
> @@ -873,11 +873,13 @@ struct set_epll_con_val {
>  #define EXYNOS5_EPLLCON0_LOCKED_SHIFT29  /* EPLL Locked bit 
> position*/
>  #define TIMEOUT_EPLL_LOCK1000
>  
> -#define AUDIO_0_RATIO_MASK   0x0f
> -#define AUDIO_1_RATIO_MASK   0x0f
> +#define AUDIO_RATIO_MASK 0x0f
> +
> +#define AUDIO_SEL_MASK   0xf
>  
> -#define AUDIO1_SEL_MASK  0xf
>  #define CLK_SRC_SCLK_EPLL0x7
> +#define CLK_SRC_MOUT_EPLL(1<<12)
> +#define CLKMUX_ASS   (1<<0)

Please add prefix AUDIO.

>  
>  /* CON0 bit-fields */
>  #define EPLL_CON0_MDIV_MASK  0x1ff
> diff --git a/arch/arm/include/asm/arch-exynos/cpu.h 
> b/arch/arm/include/asm/arch-exynos/cpu.h
> index cb924

Re: [U-Boot] [PATCH 1/6 V2] Sound: WM8994: Support I2S0 channel

2013-08-27 Thread Minkyu Kang
Dear Dani Krishna Mohan,

On 04/08/13 15:44, Dani Krishna Mohan wrote:
> This patch modifies the WM8994 codec to support I2S0 channel
> in codec slave mode
> 
> Signed-off-by: Dani Krishna Mohan 
> ---
> changes in V2:
>   - None
>  drivers/sound/sound.c|2 +-
>  drivers/sound/wm8994.c   |   95 
> +++---
>  drivers/sound/wm8994_registers.h |   77 --
>  3 files changed, 81 insertions(+), 93 deletions(-)
> 

I think, we can support both of AIF1 and AIF2.
Why don't you add AIF1 features instead of replacing.

> diff --git a/drivers/sound/sound.c b/drivers/sound/sound.c
> index 6fcc75d..47879a4 100644
> --- a/drivers/sound/sound.c
> +++ b/drivers/sound/sound.c
> @@ -130,7 +130,7 @@ static int codec_init(const void *blob, struct i2stx_info 
> *pi2s_tx)
>  #endif
>   if (!strcmp(codectype, "wm8994")) {
>   /* Check the codec type and initialise the same */
> - ret = wm8994_init(blob, WM8994_AIF2,
> + ret = wm8994_init(blob, WM8994_AIF1,
>   pi2s_tx->samplingrate,
>   (pi2s_tx->samplingrate * (pi2s_tx->rfs)),
>   pi2s_tx->bitspersample, pi2s_tx->channels);
> diff --git a/drivers/sound/wm8994.c b/drivers/sound/wm8994.c
> index 37e354c..57c8f8d 100644
> --- a/drivers/sound/wm8994.c
> +++ b/drivers/sound/wm8994.c
> @@ -477,9 +477,9 @@ static int configure_aif_clock(struct wm8994_priv 
> *wm8994, int aif)
>   reg1);
>  
>   ret |= wm8994_update_bits(WM8994_CLOCKING_1,
> - WM8994_SYSCLK_SRC | WM8994_AIF2DSPCLK_ENA_MASK |
> + WM8994_SYSCLK_SRC | WM8994_AIF1DSPCLK_ENA_MASK |
>   WM8994_SYSDSPCLK_ENA_MASK, WM8994_SYSCLK_SRC |
> - WM8994_AIF2DSPCLK_ENA | WM8994_SYSDSPCLK_ENA);
> + WM8994_AIF1DSPCLK_ENA | WM8994_SYSDSPCLK_ENA);
>  
>   if (ret < 0) {
>   debug("%s: codec register access error\n", __func__);
> @@ -536,7 +536,7 @@ static int wm8994_set_sysclk(struct wm8994_priv *wm8994, 
> int aif_id,
>   break;
>   if (i == ARRAY_SIZE(opclk_divs)) {
>   debug("%s frequency divisor not found\n",
> - __func__);
> +   __func__);
>   return -1;
>   }
>   ret = wm8994_update_bits(WM8994_CLOCKING_2,
> @@ -565,28 +565,17 @@ static int wm8994_set_sysclk(struct wm8994_priv 
> *wm8994, int aif_id,
>  }
>  
>  /*
> - * Initializes Volume for AIF2 to HP path
> + * Initializes Volume for AIF1 to HP path
>   *
>   * @returns -1 for error  and 0 Success.
>   *
>   */
> -static int wm8994_init_volume_aif2_dac1(void)
> +static int wm8994_init_volume_aif1_dac1(void)
>  {
> - int ret;
> -
> - /* Unmute AIF2DAC */
> - ret = wm8994_update_bits(WM8994_AIF2_DAC_FILTERS_1,
> - WM8994_AIF2DAC_MUTE_MASK, 0);
> -
> -
> - ret |= wm8994_update_bits(WM8994_AIF2_DAC_LEFT_VOLUME,
> - WM8994_AIF2DAC_VU_MASK | WM8994_AIF2DACL_VOL_MASK,
> - WM8994_AIF2DAC_VU | 0xff);
> -
> - ret |= wm8994_update_bits(WM8994_AIF2_DAC_RIGHT_VOLUME,
> - WM8994_AIF2DAC_VU_MASK | WM8994_AIF2DACR_VOL_MASK,
> - WM8994_AIF2DAC_VU | 0xff);
> + int ret = 0;
>  
> + /* unmute AIF1DAC1 */
> + ret |= wm8994_i2c_write(WM8994_AIF1_DAC_FILTERS_1, 0x);
>  
>   ret |= wm8994_update_bits(WM8994_DAC1_LEFT_VOLUME,
>   WM8994_DAC1_VU_MASK | WM8994_DAC1L_VOL_MASK |
> @@ -661,12 +650,19 @@ static int wm8994_device_init(struct wm8994_priv 
> *wm8994)
>   ret |= wm8994_update_bits(WM8994_POWER_MANAGEMENT_1,
>   WM8994_HPOUT1R_ENA_MASK, WM8994_HPOUT1R_ENA);
>  
> - /* Power enable for AIF2 and DAC1 */
> - ret |= wm8994_update_bits(WM8994_POWER_MANAGEMENT_5,
> - WM8994_AIF2DACL_ENA_MASK | WM8994_AIF2DACR_ENA_MASK |
> - WM8994_DAC1L_ENA_MASK | WM8994_DAC1R_ENA_MASK,
> - WM8994_AIF2DACL_ENA | WM8994_AIF2DACR_ENA | WM8994_DAC1L_ENA |
> - WM8994_DAC1R_ENA);
> +
> + ret |= wm8994_i2c_write(WM8994_POWER_MANAGEMENT_2, WM8994_TSHUT_ENA
> + | WM8994_MIXINL_ENA | WM8994_MIXINR_ENA
> + | WM8994_IN2L_ENA | WM8994_IN2R_ENA);
> +
> + ret |= wm8994_i2c_write(WM8994_POWER_MANAGEMENT_4, WM8994_ADCL_ENA
> + | WM8994_ADCR_ENA | WM8994_AIF1ADC1R_ENA
> + | WM8994_AIF1ADC1L_ENA);
> +
> + /* Power enable for AIF1 and DAC1 */
> + ret |= wm8994_i2c_write(WM8994_POWER_MANAGEMENT_5, WM8994_AIF1DACL_ENA
> + | WM8994_AIF1DACR_ENA | WM8994_DAC1L_ENA
> + | WM8994_DAC1R_ENA);
>  
>   /* Head P

Re: [U-Boot] [U-boot] zImage_dtb status

2013-08-27 Thread TigerLiu
Hi, Rini:
>Yes, but appended dtb is something (some) kernel developers suggest not
>relying on.  But you don't need to append, for uImage or zImage, just
>pass ${loadaddr} - ${fdt_addr}
Got it!
Thanks a lot!

Best wishes,
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] CONFIG: EXYNOS5: Replace misnomer SMDK5250 with EXYNOS5250 and update Makefiles

2013-08-27 Thread Minkyu Kang
On 25/07/13 21:58, Inderpal Singh wrote:
> From: Chander Kashyap 
> 
> Update the Makefiles so that all boards can use the same spl generation tool
> 
> Signed-off-by: Inderpal Singh 
> Acked-by: Simon Glass 
> ---
>  changes in v2:
>   - Rebased to latest u-boot-samsung master branch
> 
>  Makefile|2 +-
>  include/configs/exynos5250-dt.h |2 +-
>  tools/Makefile  |4 ++--
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 4218226..51b02cd 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -829,7 +829,7 @@ clean:
>  $(obj)tools/gdb/{astest,gdbcont,gdbsend}   \
>  $(obj)tools/gen_eth_addr$(obj)tools/img2srec   \
>  $(obj)tools/mk{env,}image   $(obj)tools/mpc86x_clk \
> -$(obj)tools/mk{smdk5250,}spl   \
> +$(obj)tools/mk{$(BOARD),}spl   \
>  $(obj)tools/mxsboot\
>  $(obj)tools/ncb $(obj)tools/ubsha1 \
>  $(obj)tools/kernel-doc/docproc \
> diff --git a/include/configs/exynos5250-dt.h b/include/configs/exynos5250-dt.h
> index 582c584..332a579 100644
> --- a/include/configs/exynos5250-dt.h
> +++ b/include/configs/exynos5250-dt.h
> @@ -29,7 +29,7 @@
>  #define CONFIG_SAMSUNG   /* in a SAMSUNG core */
>  #define CONFIG_S5P   /* S5P Family */
>  #define CONFIG_EXYNOS5   /* which is in a Exynos5 Family 
> */
> -#define CONFIG_SMDK5250  /* which is in a SMDK5250 */
> +#define CONFIG_EXYNOS5250
>  
>  #include /* get chip and board defs */
>  
> diff --git a/tools/Makefile b/tools/Makefile
> index 46159b2..519b239 100644
> --- a/tools/Makefile
> +++ b/tools/Makefile
> @@ -68,7 +68,7 @@ BIN_FILES-$(CONFIG_CMD_LOADS) += img2srec$(SFX)
>  BIN_FILES-$(CONFIG_XWAY_SWAP_BYTES) += xway-swap-bytes$(SFX)
>  BIN_FILES-y += mkenvimage$(SFX)
>  BIN_FILES-y += mkimage$(SFX)
> -BIN_FILES-$(CONFIG_SMDK5250) += mksmdk5250spl$(SFX)
> +BIN_FILES-$(CONFIG_EXYNOS5250) += mk$(BOARD)spl$(SFX)
>  BIN_FILES-$(CONFIG_MX23) += mxsboot$(SFX)
>  BIN_FILES-$(CONFIG_MX28) += mxsboot$(SFX)
>  BIN_FILES-$(CONFIG_NETCONSOLE) += ncb$(SFX)
> @@ -103,7 +103,7 @@ NOPED_OBJ_FILES-y += image-host.o
>  NOPED_OBJ_FILES-y += omapimage.o
>  NOPED_OBJ_FILES-y += mkenvimage.o
>  NOPED_OBJ_FILES-y += mkimage.o
> -OBJ_FILES-$(CONFIG_SMDK5250) += mkexynosspl.o
> +OBJ_FILES-$(CONFIG_EXYNOS5250) += mkexynosspl.o
>  OBJ_FILES-$(CONFIG_MX23) += mxsboot.o
>  OBJ_FILES-$(CONFIG_MX28) += mxsboot.o
>  OBJ_FILES-$(CONFIG_NETCONSOLE) += ncb.o
> 

applied to u-boot-samsung.

Thanks,
Minkyu Kang.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2 v2] arm: goni: remove config.mk file

2013-08-27 Thread Minkyu Kang
On 06/08/13 20:57, Minkyu Kang wrote:
> Since config.mk is deprecated, remove this file,
> and move CONFIG_SYS_TEXT_BASE define to config file.
> 
> Signed-off-by: Minkyu Kang 
> ---
> changes for v2:
>   rebased.
> 
>  board/samsung/goni/config.mk |   18 --
>  include/configs/s5p_goni.h   |3 +++
>  2 files changed, 3 insertions(+), 18 deletions(-)
>  delete mode 100644 board/samsung/goni/config.mk
> 
> diff --git a/board/samsung/goni/config.mk b/board/samsung/goni/config.mk
> deleted file mode 100644
> index e1cadbc..000
> --- a/board/samsung/goni/config.mk
> +++ /dev/null
> @@ -1,18 +0,0 @@
> -#
> -# Copyright (C) 2010 Samsung Electronics
> -# Kyungmin Park 
> -#
> -# SPDX-License-Identifier:   GPL-2.0+
> -#
> -
> -# On S5PC100 we use the 128 MiB OneDRAM bank at
> -#
> -# 0x3000 to 0x3500 (80MiB)
> -# 0x3800 to 0x4000 (128MiB)
> -#
> -# On S5PC110 we use the 128 MiB OneDRAM bank at
> -#
> -# 0x3000 to 0x3500 (80MiB)
> -# 0x4000 to 0x5000 (256MiB)
> -#
> -CONFIG_SYS_TEXT_BASE = 0x3480
> diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h
> index d0fafd7..c303244 100644
> --- a/include/configs/s5p_goni.h
> +++ b/include/configs/s5p_goni.h
> @@ -29,6 +29,9 @@
>  /* DRAM Base */
>  #define CONFIG_SYS_SDRAM_BASE0x3000
>  
> +/* Text Base */
> +#define CONFIG_SYS_TEXT_BASE 0x3480
> +
>  #define CONFIG_SETUP_MEMORY_TAGS
>  #define CONFIG_CMDLINE_TAG
>  #define CONFIG_INITRD_TAG
> 

applied to u-boot-samsung.

Minkyu Kang.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2 v2] arm: smdkc100: remove config.mk file

2013-08-27 Thread Minkyu Kang
On 06/08/13 20:57, Minkyu Kang wrote:
> Since config.mk is deprecated, remove this file,
> and move CONFIG_SYS_TEXT_BASE define to config file.
> 
> Signed-off-by: Minkyu Kang 
> Cc: Wolfgang Denk 
> ---
> changes for v2:
>   rebased.
> 
>  board/samsung/smdkc100/config.mk |   16 
>  include/configs/smdkc100.h   |3 +++
>  2 files changed, 3 insertions(+), 16 deletions(-)
>  delete mode 100644 board/samsung/smdkc100/config.mk
> 
> diff --git a/board/samsung/smdkc100/config.mk 
> b/board/samsung/smdkc100/config.mk
> deleted file mode 100644
> index 3a08bb1..000
> --- a/board/samsung/smdkc100/config.mk
> +++ /dev/null
> @@ -1,16 +0,0 @@
> -#
> -# Copyright (C) 2008 # Samsung Elecgtronics
> -# Kyungmin Park 
> -#
> -
> -# On S5PC100 we use the 128 MiB OneDRAM bank at
> -#
> -# 0x3000 to 0x3500 (80MiB)
> -# 0x3800 to 0x4000 (128MiB)
> -#
> -# On S5PC110 we use the 128 MiB OneDRAM bank at
> -#
> -# 0x3000 to 0x3500 (80MiB)
> -# 0x4000 to 0x4800 (128MiB)
> -#
> -CONFIG_SYS_TEXT_BASE = 0x3480
> diff --git a/include/configs/smdkc100.h b/include/configs/smdkc100.h
> index a572e62..507a5d3 100644
> --- a/include/configs/smdkc100.h
> +++ b/include/configs/smdkc100.h
> @@ -34,6 +34,9 @@
>  /* DRAM Base */
>  #define CONFIG_SYS_SDRAM_BASE0x3000
>  
> +/* Text Base */
> +#define CONFIG_SYS_TEXT_BASE 0x3480
> +
>  #define CONFIG_SETUP_MEMORY_TAGS
>  #define CONFIG_CMDLINE_TAG
>  #define CONFIG_INITRD_TAG
> 

applied to u-boot-samsung.

Minkyu Kang.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] fw_env: add redundand env support for MTD_ABSENT

2013-08-27 Thread Luka Perkov
Hi Oliver,

On Tue, Aug 27, 2013 at 07:35:57PM +0200, Oliver Metz wrote:
> But I'm unsure how to comment the changes in fw_env.config since redundant
> env description is already in the comment at the top.
> 
> Is something like this enough?
> 
> diff --git a/tools/env/fw_env.config b/tools/env/fw_env.config
> index 90e499d..fcaab55 100644
> --- a/tools/env/fw_env.config
> +++ b/tools/env/fw_env.config
> @@ -20,3 +20,4 @@
>  
>  # Block device example
>  #/dev/mmcblk0  0xc 0x2
> +#/dev/mmcblk0  0xe 0x2

I'd say it's unnecessary...

Luka
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 3/3 V2] ARM: mxs: Fix NAND FCB flashing

2013-08-27 Thread Marek Vasut
Fix the method of flashing FCB blocks into NAND. The new env
writes all four FCB blocks and also does not scrub such a big
part of the NAND. This fixed complains about busted NAND blocks
in Linux.

Signed-off-by: Marek Vasut 
Cc: Fabio Estevam 
Cc: Stefano Babic 
---
 include/configs/m28evk.h  |   23 +--
 include/configs/mx28evk.h |   23 +--
 2 files changed, 42 insertions(+), 4 deletions(-)

V2: Write the whole stride (64 pages) in the FCB case, not only one page.

diff --git a/include/configs/m28evk.h b/include/configs/m28evk.h
index eba8759..6e1ecbe 100644
--- a/include/configs/m28evk.h
+++ b/include/configs/m28evk.h
@@ -170,11 +170,30 @@
"nand info ; "  \
"setexpr fcb_sz ${update_nand_stride} * ${update_nand_count};" \
"setexpr update_nand_fcb ${fcb_sz} * ${nand_writesize}\0" \
+   "update_nand_write_fcb="\
+   "setenv i ${update_nand_count} ; "  \
+   "setenv update_nand_offset 0x0 ; "  \
+   "setexpr update_nand_step " \
+   "${update_nand_stride} * ${nand_writesize} ; "  \
+   "while test ${i} -gt 0 ; do "   \
+   "echo ${update_nand_offset} ; " \
+   "nand scrub -y ${update_nand_offset} "  \
+   "${nand_erasesize} ; "  \
+   "nand write.raw ${loadaddr} "   \
+   "${update_nand_offset} "\
+   "${update_nand_stride} ; "  \
+   "setexpr i ${i} - 1 ; " \
+   "setexpr update_nand_offset "   \
+   "${update_nand_offset} + "  \
+   "${update_nand_step} ; "\
+   "done ; "   \
+   "setenv i ; "   \
+   "setenv update_nand_offset ; "  \
+   "setenv update_nand_step\0" \
"update_nand_full=" /* Update FCB, DBBT and FW */   \
"if tftp ${update_nand_full_filename} ; then "  \
"run update_nand_get_fcb_size ; "   \
-   "nand scrub -y 0x0 ${filesize} ; "  \
-   "nand write.raw ${loadaddr} 0x0 ${fcb_sz} ; "   \
+   "run update_nand_write_fcb ; "  \
"setexpr update_off ${loadaddr} + ${update_nand_fcb} ; " \
"setexpr update_sz ${filesize} - ${update_nand_fcb} ; " \
"nand write ${update_off} ${update_nand_fcb} ${update_sz} ; " \
diff --git a/include/configs/mx28evk.h b/include/configs/mx28evk.h
index 07f88ca..e2324d6 100644
--- a/include/configs/mx28evk.h
+++ b/include/configs/mx28evk.h
@@ -172,11 +172,30 @@
"nand info ; " \
"setexpr fcb_sz ${update_nand_stride} * ${update_nand_count};" \
"setexpr update_nand_fcb ${fcb_sz} * ${nand_writesize}\0" \
+   "update_nand_write_fcb="\
+   "setenv i ${update_nand_count} ; "  \
+   "setenv update_nand_offset 0x0 ; "  \
+   "setexpr update_nand_step " \
+   "${update_nand_stride} * ${nand_writesize} ; "  \
+   "while test ${i} -gt 0 ; do "   \
+   "echo ${update_nand_offset} ; " \
+   "nand scrub -y ${update_nand_offset} "  \
+   "${nand_erasesize} ; "  \
+   "nand write.raw ${loadaddr} "   \
+   "${update_nand_offset} "\
+   "${update_nand_stride} ; "  \
+   "setexpr i ${i} - 1 ; " \
+   "setexpr update_nand_offset "   \
+   "${update_nand_offset} + "  \
+   "${update_nand_step} ; "\
+   "done ; "   \
+   "setenv i ; "   \
+   "setenv update_nand_offset ; "  \
+   "setenv update_nand_step\0" \
"update_nand_full=" /* Update FCB, DBBT and FW */ \

[U-Boot] [PATCH 3/3] ARM: mxs: Fix NAND FCB flashing

2013-08-27 Thread Marek Vasut
Fix the method of flashing FCB blocks into NAND. The new env
writes all four FCB blocks and also does not scrub such a big
part of the NAND. This fixed complains about busted NAND blocks
in Linux.

Signed-off-by: Marek Vasut 
Cc: Fabio Estevam 
Cc: Stefano Babic 
---
 include/configs/m28evk.h  |   22 --
 include/configs/mx28evk.h |   22 --
 2 files changed, 40 insertions(+), 4 deletions(-)

diff --git a/include/configs/m28evk.h b/include/configs/m28evk.h
index eba8759..8a0587c 100644
--- a/include/configs/m28evk.h
+++ b/include/configs/m28evk.h
@@ -170,11 +170,29 @@
"nand info ; "  \
"setexpr fcb_sz ${update_nand_stride} * ${update_nand_count};" \
"setexpr update_nand_fcb ${fcb_sz} * ${nand_writesize}\0" \
+   "update_nand_write_fcb="\
+   "setenv i ${update_nand_count} ; "  \
+   "setenv update_nand_offset 0x0 ; "  \
+   "setexpr update_nand_step " \
+   "${update_nand_stride} * ${nand_writesize} ; "  \
+   "while test ${i} -gt 0 ; do "   \
+   "echo ${update_nand_offset} ; " \
+   "nand scrub -y ${update_nand_offset} "  \
+   "${nand_erasesize} ; "  \
+   "nand write.raw ${loadaddr} "   \
+   "${update_nand_offset} 0x1 ; "  \
+   "setexpr i ${i} - 1 ; " \
+   "setexpr update_nand_offset "   \
+   "${update_nand_offset} + "  \
+   "${update_nand_step} ; "\
+   "done ; "   \
+   "setenv i ; "   \
+   "setenv update_nand_offset ; "  \
+   "setenv update_nand_step\0" \
"update_nand_full=" /* Update FCB, DBBT and FW */   \
"if tftp ${update_nand_full_filename} ; then "  \
"run update_nand_get_fcb_size ; "   \
-   "nand scrub -y 0x0 ${filesize} ; "  \
-   "nand write.raw ${loadaddr} 0x0 ${fcb_sz} ; "   \
+   "run update_nand_write_fcb ; "  \
"setexpr update_off ${loadaddr} + ${update_nand_fcb} ; " \
"setexpr update_sz ${filesize} - ${update_nand_fcb} ; " \
"nand write ${update_off} ${update_nand_fcb} ${update_sz} ; " \
diff --git a/include/configs/mx28evk.h b/include/configs/mx28evk.h
index 07f88ca..b0ae031 100644
--- a/include/configs/mx28evk.h
+++ b/include/configs/mx28evk.h
@@ -172,11 +172,29 @@
"nand info ; " \
"setexpr fcb_sz ${update_nand_stride} * ${update_nand_count};" \
"setexpr update_nand_fcb ${fcb_sz} * ${nand_writesize}\0" \
+   "update_nand_write_fcb="\
+   "setenv i ${update_nand_count} ; "  \
+   "setenv update_nand_offset 0x0 ; "  \
+   "setexpr update_nand_step " \
+   "${update_nand_stride} * ${nand_writesize} ; "  \
+   "while test ${i} -gt 0 ; do "   \
+   "echo ${update_nand_offset} ; " \
+   "nand scrub -y ${update_nand_offset} "  \
+   "${nand_erasesize} ; "  \
+   "nand write.raw ${loadaddr} "   \
+   "${update_nand_offset} 0x1 ; "  \
+   "setexpr i ${i} - 1 ; " \
+   "setexpr update_nand_offset "   \
+   "${update_nand_offset} + "  \
+   "${update_nand_step} ; "\
+   "done ; "   \
+   "setenv i ; "   \
+   "setenv update_nand_offset ; "  \
+   "setenv update_nand_step\0" \
"update_nand_full=" /* Update FCB, DBBT and FW */ \
"if tftp ${update_nand_full_filename} ; then " \
"run update_nand_get_fcb_size ; " \
-   "nand scrub -y 0x0 ${filesize} ; " \
-   "nand write.raw ${loadaddr} 0x0 ${fcb_sz} ; " \
+  

[U-Boot] [PATCH] mail: Fix email address

2013-08-27 Thread Marek Vasut
Fix my email address.

Signed-off-by: Marek Vasut 
Cc: Tom Rini 
---
 doc/git-mailrc |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/git-mailrc b/doc/git-mailrc
index e3a47c4..1d5eec6 100644
--- a/doc/git-mailrc
+++ b/doc/git-mailrc
@@ -22,7 +22,7 @@ alias jasonjin   Jason Jin 
 alias jhersh Joe Hershberger 
 alias kimphill   Kim Phillips 
 alias macpaulMacpaul Lin 
-alias marex  Marek Vasut 
+alias marex  Marek Vasut 
 alias monstr Michal Simek 
 alias prafulla   Prafulla Wadaskar 
 alias prom   Minkyu Kang 
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/3] tools: mxsboot: Mark the FCB pages as valid

2013-08-27 Thread Marek Vasut
Without this marker, Linux will complain that the NAND pages with
FCB are invalid.

Signed-off-by: Marek Vasut 
Cc: Fabio Estevam 
Cc: Stefano Babic 
---
 tools/mxsboot.c |   10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/tools/mxsboot.c b/tools/mxsboot.c
index 1060cbf..90b2173 100644
--- a/tools/mxsboot.c
+++ b/tools/mxsboot.c
@@ -379,7 +379,7 @@ static uint8_t *mx28_nand_fcb_block(struct mx28_nand_fcb 
*fcb)
return block;
 }
 
-static int mx28_nand_write_fcb(struct mx28_nand_fcb *fcb, char *buf)
+static int mx28_nand_write_fcb(struct mx28_nand_fcb *fcb, uint8_t *buf)
 {
uint32_t offset;
uint8_t *fcbblock;
@@ -393,13 +393,15 @@ static int mx28_nand_write_fcb(struct mx28_nand_fcb *fcb, 
char *buf)
for (i = 0; i < STRIDE_PAGES * STRIDE_COUNT; i += STRIDE_PAGES) {
offset = i * nand_writesize;
memcpy(buf + offset, fcbblock, nand_writesize + nand_oobsize);
+   /* Mark the NAND page is OK. */
+   buf[offset + nand_writesize] = 0xff;
}
 
free(fcbblock);
return ret;
 }
 
-static int mx28_nand_write_dbbt(struct mx28_nand_dbbt *dbbt, char *buf)
+static int mx28_nand_write_dbbt(struct mx28_nand_dbbt *dbbt, uint8_t *buf)
 {
uint32_t offset;
int i = STRIDE_PAGES * STRIDE_COUNT;
@@ -413,7 +415,7 @@ static int mx28_nand_write_dbbt(struct mx28_nand_dbbt 
*dbbt, char *buf)
 }
 
 static int mx28_nand_write_firmware(struct mx28_nand_fcb *fcb, int infd,
-   char *buf)
+   uint8_t *buf)
 {
int ret;
off_t size;
@@ -462,7 +464,7 @@ static int mx28_create_nand_image(int infd, int outfd)
struct mx28_nand_fcb *fcb;
struct mx28_nand_dbbt *dbbt;
int ret = -1;
-   char *buf;
+   uint8_t *buf;
int size;
ssize_t wr_size;
 
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/3] tools: mxsboot: Staticize functions

2013-08-27 Thread Marek Vasut
Make remaining non-static functions static and the same for vars.

Signed-off-by: Marek Vasut 
Cc: Fabio Estevam 
Cc: Stefano Babic 
---
 tools/mxsboot.c |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/mxsboot.c b/tools/mxsboot.c
index 3d9cc10..1060cbf 100644
--- a/tools/mxsboot.c
+++ b/tools/mxsboot.c
@@ -28,14 +28,14 @@
  *
  * TWEAK this if you have different kind of NAND chip.
  */
-uint32_t nand_writesize = 2048;
-uint32_t nand_oobsize = 64;
-uint32_t nand_erasesize = 128 * 1024;
+static uint32_t nand_writesize = 2048;
+static uint32_t nand_oobsize = 64;
+static uint32_t nand_erasesize = 128 * 1024;
 
 /*
  * Sector on which the SigmaTel boot partition (0x53) starts.
  */
-uint32_t sd_sector = 2048;
+static uint32_t sd_sector = 2048;
 
 /*
  * Each of the U-Boot bootstreams is at maximum 1MB big.
@@ -434,7 +434,7 @@ static int mx28_nand_write_firmware(struct mx28_nand_fcb 
*fcb, int infd,
return 0;
 }
 
-void usage(void)
+static void usage(void)
 {
printf(
"Usage: mxsboot [ops]   \n"
@@ -575,7 +575,7 @@ err0:
return ret;
 }
 
-int parse_ops(int argc, char **argv)
+static int parse_ops(int argc, char **argv)
 {
int i;
int tmp;
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] usb: new board-specific USB init interface

2013-08-27 Thread Marek Vasut
Dear Mateusz Zalega,

> On 08/22/13 21:37, Marek Vasut wrote:
> > Dear Mateusz Zalega,
> > 
> > The EHCI supports multi-bus thing (passing the controller *), will
> > this be viable to pass in this case too, so the busses can be inited
> > selectively in host/gadget functions?
>  
>  Hello, Marek.
>  I need more context. Could you show me the part of code in which you'd
>  like to pass/use additional arguments?
> >>> 
> >>> Please grep the 'controller' pointer that is passed to various
> >>> functions at least in the EHCI case. It would be nice to pass that to
> >>> the init functions too, no?
> >> 
> >> It may be possible, but note that board_usb_init() is not used solely by
> >> EHCI code (please grep or cscope function calls). In order to do that,
> >> we would need to devise some generic interface.
> >> 
> >> Is it worth the time? Are there targets that would benefit from this
> >> change?
> > 
> > In case you want to separatelly init one port for USB peripheral mode and
> > one for Host mode, yes.
> 
> We could add another argument: "int controller_index" (or maybe "const
> char* controller_id"), which would correspond to node names or aliases
> defined in devicetree source files (ie. see: tegra30.dtsi).

Device tree is completely ortogonal to this. See how "int usb_lowlevel_init(int 
index, void **controller)" is declared. Pass something similar, index at least. 
Also pass the mode in which the controller should operate.

> List of
> available controllers would be accesible via ie. "usb list" command.
> Implementations of board_usb_init() would lookup applicable hardware in
> gd_t.

DT is not present on all platforms, so you _MUST_ handle the non-DT case too.

> We would need to find a way to differentiate between these controllers
> in cases when it would be expected from u-boot to automatically
> initialize devices it needs. It looks easy in case of ehci-tegra.c.
> 
> Devicetree-agnostic boards would have their own "usb list"
> implementation, and those of them that can't initialize their
> controllers selectively would be left the way they are with just one
> additional, unused board_usb_init() argument.

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] fw_env: add redundand env support for MTD_ABSENT

2013-08-27 Thread Oliver Metz
Robert P. J. Day schrieb am 26.08.2013 16:25:

> On Sun, 25 Aug 2013, Oliver Metz wrote:
> 
>> Signed-off-by: Oliver Metz 
>> ---
>>  tools/env/fw_env.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
>> index 44607b1..65be5f3 100644
>> --- a/tools/env/fw_env.c
>> +++ b/tools/env/fw_env.c
>> @@ -1136,6 +1136,9 @@ int fw_env_open(void)
>>  } else if (DEVTYPE(dev_current) == MTD_UBIVOLUME &&
>> DEVTYPE(!dev_current) == MTD_UBIVOLUME) {
>>  environment.flag_scheme = FLAG_INCREMENTAL;
>> +} else if (DEVTYPE(dev_current) == MTD_ABSENT &&
>> +   DEVTYPE(!dev_current) == MTD_ABSENT) {
>> +environment.flag_scheme = FLAG_INCREMENTAL;
>>  } else {
>>  fprintf (stderr, "Incompatible flash types!\n");
>>  return -1;
> 
>  pedantically, it's "redundant", not "redundand". and it might be
> useful to add some commentary in the sample fw_env.config file that
> explains this new feature, as the patch is clearly not adding any
> documentation.
> 
> rday
> 
I will send a new version of the patches with the typo fixed.

But I'm unsure how to comment the changes in fw_env.config since redundant
env description is already in the comment at the top.

Is something like this enough?

diff --git a/tools/env/fw_env.config b/tools/env/fw_env.config
index 90e499d..fcaab55 100644
--- a/tools/env/fw_env.config
+++ b/tools/env/fw_env.config
@@ -20,3 +20,4 @@
 
 # Block device example
 #/dev/mmcblk0  0xc 0x2
+#/dev/mmcblk0  0xe 0x2


--
Oliver

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v5 3/3] apf27: add FPGA support for the apf27 board

2013-08-27 Thread Philippe Reynes
Signed-off-by: Philippe Reynes 
Signed-off-by: Eric Jarrige 
---
 board/armadeus/apf27/Makefile |3 +
 board/armadeus/apf27/apf27.c  |5 +
 board/armadeus/apf27/fpga.c   |  223 +
 board/armadeus/apf27/fpga.h   |   25 +
 include/configs/apf27.h   |   14 +++
 5 files changed, 270 insertions(+), 0 deletions(-)
 create mode 100644 board/armadeus/apf27/fpga.c
 create mode 100644 board/armadeus/apf27/fpga.h

diff --git a/board/armadeus/apf27/Makefile b/board/armadeus/apf27/Makefile
index ec0cb03..5fcda6e 100644
--- a/board/armadeus/apf27/Makefile
+++ b/board/armadeus/apf27/Makefile
@@ -13,6 +13,9 @@ LIB   = $(obj)lib$(BOARD).o
 
 COBJS  := apf27.o
 SOBJS  := lowlevel_init.o
+ifdef CONFIG_FPGA
+COBJS  += fpga.o
+endif
 
 SRCS   := $(COBJS:.o=.c) $(SOBJS:.o=.S)
 OBJS   := $(addprefix $(obj),$(COBJS))
diff --git a/board/armadeus/apf27/apf27.c b/board/armadeus/apf27/apf27.c
index 98c51a7..cd08bf4 100644
--- a/board/armadeus/apf27/apf27.c
+++ b/board/armadeus/apf27/apf27.c
@@ -19,6 +19,7 @@
 #include 
 #include "apf27.h"
 #include "crc.h"
+#include "fpga.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -181,6 +182,10 @@ int board_init(void)
apf27_setup_port();
apf27_iomux_init();
apf27_devices_init();
+#if defined(CONFIG_FPGA)
+   APF27_init_fpga();
+#endif
+
 
return 0;
 }
diff --git a/board/armadeus/apf27/fpga.c b/board/armadeus/apf27/fpga.c
new file mode 100644
index 000..df2ddc2
--- /dev/null
+++ b/board/armadeus/apf27/fpga.c
@@ -0,0 +1,223 @@
+/*
+ * (C) Copyright 2002-2013
+ * Eric Jarrige 
+ *
+ * based on the files by
+ * Rich Ireland, Enterasys Networks, rirel...@enterasys.com
+ * and
+ * Keith Outwater, keith_outwa...@mvis.com
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "fpga.h"
+#include 
+#include "apf27.h"
+
+/*
+ * Note that these are pointers to code that is in Flash.  They will be
+ * relocated at runtime.
+ * Spartan2 code is used to download our Spartan 3 :) code is compatible.
+ * Just take care about the file size
+ */
+Xilinx_Spartan3_Slave_Parallel_fns fpga_fns = {
+   fpga_pre_fn,
+   fpga_pgm_fn,
+   fpga_init_fn,
+   NULL,
+   fpga_done_fn,
+   fpga_clk_fn,
+   fpga_cs_fn,
+   fpga_wr_fn,
+   fpga_rdata_fn,
+   fpga_wdata_fn,
+   fpga_busy_fn,
+   fpga_abort_fn,
+   fpga_post_fn,
+};
+
+Xilinx_desc fpga[CONFIG_FPGA_COUNT] = {
+   {Xilinx_Spartan3,
+slave_parallel,
+1196128l/8,
+(void *)&fpga_fns,
+0}
+};
+
+/*
+ * Initialize GPIO port B before download
+ */
+int fpga_pre_fn(int cookie)
+{
+   /* Initialize GPIO pins */
+   gpio_set_value(ACFG_FPGA_PWR, 1);
+   imx_gpio_mode(ACFG_FPGA_INIT | GPIO_IN | GPIO_PUEN | GPIO_GPIO);
+   imx_gpio_mode(ACFG_FPGA_DONE | GPIO_IN | GPIO_PUEN | GPIO_GPIO);
+   imx_gpio_mode(ACFG_FPGA_PRG | GPIO_OUT | GPIO_PUEN | GPIO_GPIO);
+   imx_gpio_mode(ACFG_FPGA_CLK | GPIO_OUT | GPIO_PUEN | GPIO_GPIO);
+   imx_gpio_mode(ACFG_FPGA_RW | GPIO_OUT | GPIO_PUEN | GPIO_GPIO);
+   imx_gpio_mode(ACFG_FPGA_CS | GPIO_OUT | GPIO_PUEN | GPIO_GPIO);
+   imx_gpio_mode(ACFG_FPGA_SUSPEND|GPIO_OUT|GPIO_PUEN|GPIO_GPIO);
+   gpio_set_value(ACFG_FPGA_RESET, 1);
+   imx_gpio_mode(ACFG_FPGA_RESET | GPIO_OUT | GPIO_PUEN | GPIO_GPIO);
+   imx_gpio_mode(ACFG_FPGA_PWR | GPIO_OUT | GPIO_PUEN | GPIO_GPIO);
+   gpio_set_value(ACFG_FPGA_PRG, 1);
+   gpio_set_value(ACFG_FPGA_CLK, 1);
+   gpio_set_value(ACFG_FPGA_RW, 1);
+   gpio_set_value(ACFG_FPGA_CS, 1);
+   gpio_set_value(ACFG_FPGA_SUSPEND, 0);
+   gpio_set_value(ACFG_FPGA_PWR, 0);
+   udelay(3); /*wait until supply started*/
+
+   return cookie;
+}
+
+/*
+ * Set the FPGA's active-low program line to the specified level
+ */
+int fpga_pgm_fn(int assert, int flush, int cookie)
+{
+   debug("%s:%d: FPGA PROGRAM %s", __func__, __LINE__,
+ assert ? "high" : "low");
+   gpio_set_value(ACFG_FPGA_PRG, !assert);
+   return assert;
+}
+
+/*
+ * Set the FPGA's active-high clock line to the specified level
+ */
+int fpga_clk_fn(int assert_clk, int flush, int cookie)
+{
+   debug("%s:%d: FPGA CLOCK %s", __func__, __LINE__,
+ assert_clk ? "high" : "low");
+   gpio_set_value(ACFG_FPGA_CLK, !assert_clk);
+   return assert_clk;
+}
+
+/*
+ * Test the state of the active-low FPGA INIT line.  Return 1 on INIT
+ * asserted (low).
+ */
+int fpga_init_fn(int cookie)
+{
+   int value;
+   debug("%s:%d: INIT check... ", __func__, __LINE__);
+   value = gpio_get_value(ACFG_FPGA_INIT);
+   /* printf("init value read %x",value); */
+#ifdef CONFIG_SYS_FPGA_IS_PROTO
+   return value;
+#else
+   return !value;
+#endif
+}
+
+/*
+ * Test the state of the active-high FPGA DONE pin
+ */
+int fpga_done_fn(int cookie)
+{
+   debug("%s:%d: DONE check... %s", __func__, __LINE__

[U-Boot] [PATCH v5 1/3] mx27: add missing constant for mx27

2013-08-27 Thread Philippe Reynes
Add some missing constant (chip select, ...)

Signed-off-by: Philippe Reynes 
Signed-off-by: Eric Jarrige 
---
 arch/arm/cpu/arm926ejs/mx27/asm-offsets.c |5 +
 arch/arm/include/asm/arch-mx27/imx-regs.h |6 +-
 2 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/mx27/asm-offsets.c 
b/arch/arm/cpu/arm926ejs/mx27/asm-offsets.c
index 8db2a67..629b727 100644
--- a/arch/arm/cpu/arm926ejs/mx27/asm-offsets.c
+++ b/arch/arm/cpu/arm926ejs/mx27/asm-offsets.c
@@ -38,5 +38,10 @@ int main(void)
DEFINE(ESDCFG1_ROF, offsetof(struct esdramc_regs, esdcfg1));
DEFINE(ESDMISC_ROF, offsetof(struct esdramc_regs, esdmisc));
 
+   DEFINE(GPCR, IMX_SYSTEM_CTL_BASE +
+   offsetof(struct system_control_regs, gpcr));
+   DEFINE(FMCR, IMX_SYSTEM_CTL_BASE +
+   offsetof(struct system_control_regs, fmcr));
+
return 0;
 }
diff --git a/arch/arm/include/asm/arch-mx27/imx-regs.h 
b/arch/arm/include/asm/arch-mx27/imx-regs.h
index a27145b..92c847e 100644
--- a/arch/arm/include/asm/arch-mx27/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx27/imx-regs.h
@@ -169,7 +169,7 @@ struct iim_regs {
struct fuse_bank {
u32 fuse_regs[0x20];
u32 fuse_rsvd[0xe0];
-   } bank[1];
+   } bank[2];
 };
 
 struct fuse_bank0_regs {
@@ -209,9 +209,13 @@ struct fuse_bank0_regs {
 #define IIM_BASE_ADDR  IMX_IIM_BASE
 #define IMX_FEC_BASE   (0x2b000 + IMX_IO_BASE)
 
+#define IMX_NFC_BASE   (0xD800)
 #define IMX_ESD_BASE   (0xD8001000)
 #define IMX_WEIM_BASE  (0xD8002000)
 
+#define NFC_BASE_ADDR  IMX_NFC_BASE
+
+
 /* FMCR System Control bit definition*/
 #define UART4_RXD_CTL  (1 << 25)
 #define UART4_RTS_CTL  (1 << 24)
-- 
1.7.4.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v5 2/3] apf27: add support for the armadeus APF27 board

2013-08-27 Thread Philippe Reynes
Signed-off-by: Philippe Reynes 
Signed-off-by: Eric Jarrige 
Signed-off-by: Nicolas Colombain 
---
 MAINTAINERS  |5 +
 board/armadeus/apf27/Makefile|   30 ++
 board/armadeus/apf27/apf27.c |  252 +
 board/armadeus/apf27/apf27.h |  489 ++
 board/armadeus/apf27/lowlevel_init.S |  168 
 boards.cfg   |1 +
 include/configs/apf27.h  |  374 ++
 7 files changed, 1319 insertions(+), 0 deletions(-)
 create mode 100644 board/armadeus/apf27/Makefile
 create mode 100644 board/armadeus/apf27/apf27.c
 create mode 100644 board/armadeus/apf27/apf27.h
 create mode 100644 board/armadeus/apf27/lowlevel_init.S
 create mode 100644 include/configs/apf27.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 0a900dc..abf8380 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -716,6 +716,11 @@ Ilko Iliev 
PM9263  AT91SAM9263
PM9G45  ARM926EJS (AT91SAM9G45 SoC)
 
+Eric Jarrige 
+Philippe Reynes 
+
+   apf27   ARM926EJS (i.MX27 SoC)
+
 Michael Jones 
 
omap3_mvblx ARM ARMV7 (OMAP3xx SoC)
diff --git a/board/armadeus/apf27/Makefile b/board/armadeus/apf27/Makefile
new file mode 100644
index 000..ec0cb03
--- /dev/null
+++ b/board/armadeus/apf27/Makefile
@@ -0,0 +1,30 @@
+#
+# (C) Copyright 2000-2004
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+# (C) Copyright 2012-2013
+# Eric Jarrige 
+#
+# SPDX-License-Identifier:GPL-2.0+
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS  := apf27.o
+SOBJS  := lowlevel_init.o
+
+SRCS   := $(COBJS:.o=.c) $(SOBJS:.o=.S)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(call cmd_link_o_target, $(OBJS) $(SOBJS))
+
+#
+
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/armadeus/apf27/apf27.c b/board/armadeus/apf27/apf27.c
new file mode 100644
index 000..98c51a7
--- /dev/null
+++ b/board/armadeus/apf27/apf27.c
@@ -0,0 +1,252 @@
+/*
+ * Copyright (C) 2008-2013 Eric Jarrige 
+ *
+ * based on the files by
+ * Sascha Hauer, Pengutronix
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "apf27.h"
+#include "crc.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/*
+ * Fuse bank 1 row 8 is "reserved for future use" and therefore available for
+ * customer use. The APF27 board uses this fuse to store the board revision:
+ * 0: initial board revision
+ * 1: first revision - Presence of the second RAM chip on the board is blown in
+ * fuse bank 1 row 9  bit 0 - No hardware change
+ * N: to be defined
+ */
+static u32 get_board_rev(void)
+{
+   struct iim_regs *iim = (struct iim_regs *)IMX_IIM_BASE;
+
+   return readl(&iim->bank[1].fuse_regs[8]);
+}
+
+/*
+ * Fuse bank 1 row 9 is "reserved for future use" and therefore available for
+ * customer use. The APF27 board revision 1 uses the bit 0 to permanently store
+ * the presence of the second RAM chip
+ * 0: AFP27 with 1 RAM of 64 MiB
+ * 1: AFP27 with 2 RAM chips of 64 MiB each (128MB)
+ */
+static int get_num_ram_bank(void)
+{
+   struct iim_regs *iim = (struct iim_regs *)IMX_IIM_BASE;
+   int nr_dram_banks = 1;
+
+   if ((get_board_rev() > 0) && (CONFIG_NR_DRAM_BANKS > 1))
+   nr_dram_banks += readl(&iim->bank[1].fuse_regs[9]) & 0x01;
+   else
+   nr_dram_banks = CONFIG_NR_DRAM_POPULATED;
+
+   return nr_dram_banks;
+}
+
+static void apf27_port_init(int port, u32 gpio_dr, u32 ocr1, u32 ocr2,
+   u32 iconfa1, u32 iconfa2, u32 iconfb1, u32 iconfb2,
+   u32 icr1, u32 icr2, u32 imr, u32 gpio_dir, u32 gpr,
+   u32 puen, u32 gius)
+{
+   struct gpio_port_regs *regs = (struct gpio_port_regs *)IMX_GPIO_BASE;
+
+   writel(gpio_dr,   ®s->port[port].gpio_dr);
+   writel(ocr1,  ®s->port[port].ocr1);
+   writel(ocr2,  ®s->port[port].ocr2);
+   writel(iconfa1,   ®s->port[port].iconfa1);
+   writel(iconfa2,   ®s->port[port].iconfa2);
+   writel(iconfb1,   ®s->port[port].iconfb1);
+   writel(iconfb2,   ®s->port[port].iconfb2);
+   writel(icr1,  ®s->port[port].icr1);
+   writel(icr2,  ®s->port[port].icr2);
+   writel(imr,   ®s->port[port].imr);
+   writel(gpio_dir,  ®s->port[port].gpio_dir);
+   writel(gpr,   ®s->port[port].gpr);
+   writel(puen,  ®s->port[port].puen);
+   writel(gius,  ®s->port[port].gius);
+}
+
+#define APF27_PORT_INIT(n) apf27_port_init(PORT##n, ACFG_DR_##n##_VAL,   \
+   ACFG_OCR1_##n##_VAL, ACFG_OCR2_##n##_VAL, ACF

[U-Boot] [PATCH v5 0/3] apf27: add support of armadeus apf27

2013-08-27 Thread Philippe Reynes
Difference between v5 and v4:
- use spl framework
- use script
- use SPDX-License-Identifier
- use u-boot-with-spl.bin (instead of u-boot-nand.bin)
- fix some comments format issue

Difference between v4 and v3:
- use standard start.S
- use part to know u-boot offset
- fix some comments format issue

Difference between v3 and v2:
- rebase on imx branch
- merge support and spl patch
- clean code of apf27_gpio_init
- clean code of start.S

Difference between v1 and v2:
- use spl instead of nand_spl
- use gpio api
- remove use of useless CONFIG_SYS
- remove use of config.mk
- remove dead code

Philippe Reynes (3):
  mx27: add missing constant for mx27
  apf27: add support for the armadeus APF27 board
  apf27: add FPGA support for the apf27 board

 MAINTAINERS   |5 +
 arch/arm/cpu/arm926ejs/mx27/asm-offsets.c |5 +
 arch/arm/include/asm/arch-mx27/imx-regs.h |6 +-
 board/armadeus/apf27/Makefile |   33 ++
 board/armadeus/apf27/apf27.c  |  257 +++
 board/armadeus/apf27/apf27.h  |  489 +
 board/armadeus/apf27/fpga.c   |  223 +
 board/armadeus/apf27/fpga.h   |   25 ++
 board/armadeus/apf27/lowlevel_init.S  |  168 ++
 boards.cfg|1 +
 include/configs/apf27.h   |  388 +++
 11 files changed, 1599 insertions(+), 1 deletions(-)
 create mode 100644 board/armadeus/apf27/Makefile
 create mode 100644 board/armadeus/apf27/apf27.c
 create mode 100644 board/armadeus/apf27/apf27.h
 create mode 100644 board/armadeus/apf27/fpga.c
 create mode 100644 board/armadeus/apf27/fpga.h
 create mode 100644 board/armadeus/apf27/lowlevel_init.S
 create mode 100644 include/configs/apf27.h

-- 
1.7.4.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v5 0/4] arm64 patch

2013-08-27 Thread Ian Campbell
On Sat, 2013-08-24 at 09:06 +0800, feng...@phytium.com.cn wrote:
> From: David Feng 

Hi David,

I don't suppose you have a convenient git tree do you?

Thanks,
Ian.


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Albert/Tom -- could we get patch applied or some feedback (was Re: [PATCH v6 1/1] socfpga: Adding configuration for development kit)

2013-08-27 Thread Chin Liang See
Hi guys,

Wonder any updates on this? We plan to send the new patches only once
these existing patches are accepted. Appreciate for your helps again.

Chin Liang



On Thu, 2013-08-22 at 13:05 +0200, ZY - pavel wrote:
> Hi!
> 
> > Albert, Tom this patch has been here for a week, without any
> > comments. As far as I can tell, it is pretty much perfect. Can we get
> > any comments on it, or (better), get it applied?
> 
> Another week passed, and nothing happens. Is there just slow holiday
> time, or are we doing something wrong?
> 
> Thanks,
>   Pavel
> 
> > If you excuse one extra newline at end of file,
> > [PATCH v6 1/1] socfpga: Creating driver for Reset Manager
> > is in good shape too, and applying it would be nice.
> > 
> > Thanks,
> > Pavel
> > 
> > 



___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/1] console: usb: kbd: To fix slow TFTP booting

2013-08-27 Thread Stephen Warren
On 08/26/2013 01:51 PM, Marek Vasut wrote:
> Dear Jim Lin,
> 
>> TFTP booting is slow when a USB keyboard is installed and
>> stdin has usbkbd added.
>> This fix is to change Ctrl-C polling for USB keyboard to every second
>> when NET transfer is running.
>> My previous patch is expected to be put into usb_kbd_testc(). But it went
>> into usb_kbd_getc() after applied.
>> This patch is to put change in correct place.
> 
> Applied, thanks!

For the record, I tested u-boot-usb/master commit c95e2b9 "console: usb:
kbd: To fix slow TFTP booting", and it works for me, and solve the issue
that this patch was trying to solve. Thanks.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] usb: new board-specific USB init interface

2013-08-27 Thread Mateusz Zalega
On 08/21/13 10:33, Mateusz Zalega wrote:
> This commit unifies board-specific USB initialization implementations
> under one symbol (usb_board_init), declaration of which is available in
> usb.h.
> 
> Signed-off-by: Mateusz Zalega 
> Signed-off-by: Kyungmin Park 
> Reviewed-by: Lukasz Majewski 
> Cc: Minkyu Kang 
> Cc: Marek Vasut 
> Cc: Tom Warren 
> Cc: Albert Aribaud 
> 
> ---
> Changes since RFC (v1):
> - NVIDIA Tegra doesn't postpone its USB init anymore
> - board_usb_init()'s sole argument name was shortened
> - networking code comment style (/* blurb...) dropped
> - squashed RFC changes so that patch won't break bisect
> 
> v2 changes:
> - commit message fixup

ICMP Echo Request

It's already been a week, any comments?

-- 
Mateusz Zalega
Samsung R&D Institute Poland
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v4 5/7] tools: add padding of data image file for imximage

2013-08-27 Thread Stefano Babic
Implement function vrec_header to be able to pad the final
data image file according the what has been calculated for
boot_data.length.

Signed-off-by: Stefano Babic 

---
Changes in v4:
- fix crash when imximage_init_loadsize is not set
Found during regression tests with boards ima3-mx53 and m53evk (Stefano Babic)

Changes in v3:
- uses stat instead of open / fstat / close (Marek Vasut)

Changes in v2: None

 tools/imximage.c |   88 --
 1 file changed, 85 insertions(+), 3 deletions(-)

diff --git a/tools/imximage.c b/tools/imximage.c
index 2b4909e..26460bf 100644
--- a/tools/imximage.c
+++ b/tools/imximage.c
@@ -365,6 +365,13 @@ static void parse_cfg_cmd(struct imx_header *imxhdr, 
int32_t cmd, char *token,
name, lineno, token);
exit(EXIT_FAILURE);
}
+
+   /*
+* The SOC loads from the storage starting at address 0
+* then ensures that the load size contains the offset
+*/
+   if (imximage_init_loadsize < imximage_ivt_offset)
+   imximage_init_loadsize = imximage_ivt_offset;
if (unlikely(cmd_ver_first != 1))
cmd_ver_first = 0;
break;
@@ -439,7 +446,8 @@ static uint32_t parse_cfg_file(struct imx_header *imxhdr, 
char *name)
exit(EXIT_FAILURE);
}
 
-   /* Very simple parsing, line starting with # are comments
+   /*
+* Very simple parsing, line starting with # are comments
 * and are dropped
 */
while ((getline(&line, &len, fd)) > 0) {
@@ -571,18 +579,92 @@ int imximage_check_params(struct mkimage_params *params)
(params->xflag) || !(strlen(params->imagename));
 }
 
+static int imximage_generate(struct mkimage_params *params,
+   struct image_type_params *tparams)
+{
+   struct imx_header *imxhdr;
+   size_t alloc_len;
+   struct stat sbuf;
+   char *datafile = params->datafile;
+   uint32_t pad_len;
+
+   memset(&imximage_header, 0, sizeof(imximage_header));
+
+   /*
+* In order to not change the old imx cfg file
+* by adding VERSION command into it, here need
+* set up function ptr group to V1 by default.
+*/
+   imximage_version = IMXIMAGE_V1;
+   /* Be able to detect if the cfg file has no BOOT_FROM tag */
+   imximage_ivt_offset = FLASH_OFFSET_UNDEFINED;
+   imximage_csf_size = 0;
+   set_hdr_func(imxhdr);
+
+   /* Parse dcd configuration file */
+   parse_cfg_file(&imximage_header, params->imagename);
+
+   /* TODO: check i.MX image V1 handling, for now use 'old' style */
+   if (imximage_version == IMXIMAGE_V1) {
+   alloc_len = 4096;
+   } else {
+   if (imximage_init_loadsize < imximage_ivt_offset +
+   sizeof(imx_header_v2_t))
+   imximage_init_loadsize = imximage_ivt_offset +
+   sizeof(imx_header_v2_t);
+   alloc_len = imximage_init_loadsize - imximage_ivt_offset;
+   }
+
+   if (alloc_len < sizeof(struct imx_header)) {
+   fprintf(stderr, "%s: header error\n",
+   params->cmdname);
+   exit(EXIT_FAILURE);
+   }
+
+   imxhdr = malloc(alloc_len);
+
+   if (!imxhdr) {
+   fprintf(stderr, "%s: malloc return failure: %s\n",
+   params->cmdname, strerror(errno));
+   exit(EXIT_FAILURE);
+   }
+
+   memset(imxhdr, 0, alloc_len);
+
+   tparams->header_size = alloc_len;
+   tparams->hdr = imxhdr;
+
+   /* determine data image file length */
+
+   if (stat(datafile, &sbuf) < 0) {
+   fprintf(stderr, "%s: Can't stat %s: %s\n",
+   params->cmdname, datafile, strerror(errno));
+   exit(EXIT_FAILURE);
+   }
+
+   pad_len = ROUND(sbuf.st_size, 4096) - sbuf.st_size;
+
+   /* TODO: check i.MX image V1 handling, for now use 'old' style */
+   if (imximage_version == IMXIMAGE_V1)
+   return 0;
+   else
+   return pad_len;
+}
+
+
 /*
  * imximage parameters
  */
 static struct image_type_params imximage_params = {
.name   = "Freescale i.MX Boot Image support",
-   .header_size= sizeof(struct imx_header),
-   .hdr= (void *)&imximage_header,
+   .header_size= 0,
+   .hdr= NULL,
.check_image_type = imximage_check_image_types,
.verify_header  = imximage_verify_header,
.print_header   = imximage_print_header,
.set_header = imximage_set_header,
.check_params   = imximage_check_params,
+   .vrec_header= imximage_generate,
 };
 
 void init_imx_image_type(void)
-- 
1.7.9.5

___

Re: [U-Boot] SPL boot on iMX6

2013-08-27 Thread Eric Nelson


Hi Tapani,

On 08/26/2013 09:07 PM, Tapani Utriainen wrote:
> On Mon, 26 Aug 2013 15:33:56 +0200
> Stefano Babic  wrote:
>
>> Hi Tapani,
>>
>>>
>>> The macros I refer to is the MX6_PAD_ ones. The semantics of them 
depends on

>>> the target cpu. See arch/arm/include/asm/arch-mx6/mx6-pins.h
>>
>> Ok - these files are not thought to be used in the same binary, we have
>> to change something, taking into account we should remain compatible
>> without breaking the currently supported boards.
>>
>> Let's start with some proposals.
>
> Yes, this is the productive approach.
>
>> Maybe you have already introduced a
>> CONFIG_ switch, because at the moment only one SOC per image is
>> supported, and one of MX6Q, MX6DL must be set. We have also the same
>> issue with -ddr files (mx6q-ddr and mx6dl-ddr). Let's say we add a
>> CONFIG_MX6_MULTI to support all SocS at the same time.
>>
>> Then we could change the file you mention adding a suffix to each pin.
>> For example, in mx6q_pins.h we could add something like this:
>>
>> #ifdef CONFIG_MX6_MULTI
>> #define PAD_SUFFIX _6Q
>> #else
>> #define PAD_SUFFIX
>> #endif
>>
>> And we add the macro to each pin, such as
>> enum {
>>  MX6_PAD_SD2_DAT1__USDHC2_DAT1##PAD_SUFFIX
>>
>> In this way we could have different names only if we support multiple
>> SOCs. We need then some accessors to get the right pin, something like
>> mx6_pin(soc_type, pin_name), that returns the right configuration. Of
>> course, this is a very first draft, and someone else can start with
>> different proposals.
>>
>
> Your suggestion is similar to what I would first think of, but you do
> the extra kludging to make it work with the current syntax. My
> approach would be to introduce new namings in parallel to the current
> ones (similar, if not the same, as the linux kernel uses) until most
> imx6 boards have been cleaned to use the new namings (which might
> take a while).
>

No matter how we implement this, there are some pre-requisites.

I believe we're all in agreement that we should be able to express
a pad value in one place which defines the use of a particular pad
on a particular board.

We need some cleanup to get there though.
For example, pad CSI0_DAT13 has this option in mx6q_pins.h:

MX6_PAD_CSI0_DAT13__PCIE_CTRL_MUX_17

but this value in mx6dl_pins.h
MX6_PAD_CSI0_DAT13__PCIE_CTRL_DIAG_STATUS_BUS_MUX_17

I'm created sorted lists of pad names for dual-quad and solo
processors for easy comparison:
http://linode.boundarydevices.com/imx6quad-pad-names.txt
http://linode.boundarydevices.com/imx6solo-pad-names.txt

Most of the differences are simply name changes, with an extra
underscore in one versus the other.

Some of them are functional differences though (e.g. SATA isn't
present on solo). No matter how the pad names get changed, these
should be easy to identify in the resulting code.

> For the accessor macro, our experiences from the Wandboard kernel
> have been very positive with the following:
>
> To set the above mentioned pad, the board file does:
>
> IMX6_SETUP_PAD( SD2_DAT1__USDHC2_DAT1 );
>
> where the macro IMX6_SETUP_PAD is defined as:
>
> #define IMX6_SETUP_PAD(p) \
> if (cpu_is_mx6q()) \
> mxc_iomux_v3_setup_pad(MX6Q_PAD_##p);\
> else \
> mxc_iomux_v3_setup_pad(MX6DL_PAD_##p)
>

Please, no!

You'd never write code like this by hand, and putting it behind a
macro doesn't make it better. It just hides the ugliness.

Regards,


Eric
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] omap5: Correct include order, drop CONFIG_SYS_PROMPT define

2013-08-27 Thread Tom Rini
With the new include structure for TI platforms, we need to not define
our own CONFIG_SYS_PROMPT and also need to include
 much sooner, so do both of these.  Also drop
the unused CONFIG_NET_MULTI

Signed-off-by: Tom Rini 
---
 include/configs/omap5_uevm.h |7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/include/configs/omap5_uevm.h b/include/configs/omap5_uevm.h
index 0bba84b..3c4249b 100644
--- a/include/configs/omap5_uevm.h
+++ b/include/configs/omap5_uevm.h
@@ -17,6 +17,8 @@
"uuid_disk=${uuid_gpt_disk};" \
"name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}"
 
+#include 
+
 #define CONFIG_CONS_INDEX  3
 #define CONFIG_SYS_NS16550_COM3UART3_BASE
 #define CONFIG_BAUDRATE115200
@@ -53,7 +55,6 @@
 #define CONFIG_OMAP_EHCI_PHY3_RESET_GPIO 79
 
 /* Enabled commands */
-#define CONFIG_NET_MULTI
 #define CONFIG_CMD_DHCP/* DHCP Support */
 #define CONFIG_CMD_NET /* bootp, tftpboot, rarpboot*/
 #define CONFIG_CMD_NFS /* NFS support  */
@@ -62,11 +63,7 @@
 #define CONFIG_USB_HOST_ETHER
 #define CONFIG_USB_ETHER_SMSC95XX
 
-#define CONFIG_SYS_PROMPT  "OMAP5432 uEVM # "
-
 #define CONSOLEDEV "ttyO2"
 #define CONFIG_OMAP_PLATFORM_RESET_TIME_MAX_USEC   16296
 
-#include 
-
 #endif /* __CONFIG_OMAP5_EVM_H */
-- 
1.7.9.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V2] spi: mxs: Configure chipselect after block reset

2013-08-27 Thread Jagan Teki

On 27-08-2013 15:04, Marek Vasut wrote:

Dear Jagan Teki,


Hi

On Tue, Aug 27, 2013 at 2:51 PM, Marek Vasut  wrote:

Dear Jagan Teki,


Hi,

On Tue, Aug 27, 2013 at 2:35 PM, Marek Vasut  wrote:

Dear Stefano Babic,


On 26/08/2013 17:45, Marek Vasut wrote:

The chipselect must be written into the CTRL0 register after the
SSP block is reset, otherwise the block will always use ChipSelect
#0.

Signed-off-by: Marek Vasut 
Cc: Fabio Estevam 
Cc: Jagannadha Sutradharudu Teki 
Cc: Otavio Salvador 
Cc: Stefano Babic 
---

  drivers/spi/mxs_spi.c |   12 +++-
  1 file changed, 3 insertions(+), 9 deletions(-)

V2: Clean up a warning that "ssp_regs" are not used

diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c
index 3cf7142..2b9f395 100644
--- a/drivers/spi/mxs_spi.c
+++ b/drivers/spi/mxs_spi.c
@@ -56,8 +56,6 @@ struct spi_slave *spi_setup_slave(unsigned int
bus, unsigned int cs,

   unsigned int max_hz, unsigned int
   mode)

  {

 struct mxs_spi_slave *mxs_slave;

-   struct mxs_ssp_regs *ssp_regs;
-   int reg;

 if (!spi_cs_is_valid(bus, cs)) {

 printf("mxs_spi: invalid bus %d / chip select %d\n",
 bus, cs);

@@ -74,13 +72,7 @@ struct spi_slave *spi_setup_slave(unsigned int
bus, unsigned int cs,

 mxs_slave->max_khz = max_hz / 1000;
 mxs_slave->mode = mode;
 mxs_slave->regs = mxs_ssp_regs_by_bus(bus);

-   ssp_regs = mxs_slave->regs;

-   reg = readl(&ssp_regs->hw_ssp_ctrl0);
-   reg &= ~(MXS_SSP_CHIPSELECT_MASK);
-   reg |= cs << MXS_SSP_CHIPSELECT_SHIFT;
-
-   writel(reg, &ssp_regs->hw_ssp_ctrl0);

 return &mxs_slave->slave;

  err_init:
@@ -102,7 +94,9 @@ int spi_claim_bus(struct spi_slave *slave)

 mxs_reset_block(&ssp_regs->hw_ssp_ctrl0_reg);

-   writel(SSP_CTRL0_BUS_WIDTH_ONE_BIT, &ssp_regs->hw_ssp_ctrl0);
+   writel((slave->cs << MXS_SSP_CHIPSELECT_SHIFT) |
+  SSP_CTRL0_BUS_WIDTH_ONE_BIT,
+  &ssp_regs->hw_ssp_ctrl0);

 reg = SSP_CTRL1_SSP_MODE_SPI |
 SSP_CTRL1_WORD_LENGTH_EIGHT_BITS; reg |= (mxs_slave->mode &
 SPI_CPOL) ? SSP_CTRL1_POLARITY : 0;


Acked-by: Stefano Babic 


Can we push this via IMX tree ?


I have a simple concern about commit head msg.
spi: mxs:
spi: mxs_spi:

I preferred the second one as rest are follow the same, just for
unification. Please send the v2, if your OK. then I will push it on my
tree.


Can you fix that before pushing? I am fine either way.


OK, sure I will do that.


Thanks a lot!

Best regards,
Marek Vasut



Applied to u-boot-spi/master

--
Thanks,
Jagan.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4] cmd_sf: let "sf update" preserve the final part of the last sector

2013-08-27 Thread Jagan Teki

On 27-08-2013 19:22, Jagannadha Sutradharudu Teki wrote:

From: Gerlando Falauto 

Since "sf update" erases the last block as a whole, but only rewrites
the meaningful initial part of it, the rest would be left erased,
potentially erasing meaningful information.
So, as a safety measure, have it rewrite the original content.

Signed-off-by: Gerlando Falauto 
Cc: Valentin Longchamp 
Cc: Holger Brunck 
Acked-by: Simon Glass 
Signed-off-by: Jagannadha Sutradharudu Teki 
---
Changes for v4:
- Rebase to current tree
- Fix one checkpatch warning

  common/cmd_sf.c | 13 -
  1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/common/cmd_sf.c b/common/cmd_sf.c
index 4af0f0a..3f60979 100644
--- a/common/cmd_sf.c
+++ b/common/cmd_sf.c
@@ -152,8 +152,10 @@ static const char *spi_flash_update_block(struct spi_flash 
*flash, u32 offset,
  {
debug("offset=%#x, sector_size=%#x, len=%#zx\n",
  offset, flash->sector_size, len);
-   if (spi_flash_read(flash, offset, len, cmp_buf))
+   /* Read the entire sector so to allow for rewriting */
+   if (spi_flash_read(flash, offset, flash->sector_size, cmp_buf))
return "read";
+   /* Compare only what is meaningful (len) */
if (memcmp(cmp_buf, buf, len) == 0) {
debug("Skip region %x size %zx: no change\n",
  offset, len);
@@ -163,8 +165,17 @@ static const char *spi_flash_update_block(struct spi_flash 
*flash, u32 offset,
/* Erase the entire sector */
if (spi_flash_erase(flash, offset, flash->sector_size))
return "erase";
+   /* Write the initial part of the block from the source */
if (spi_flash_write(flash, offset, len, buf))
return "write";
+   /* If it's a partial sector, rewrite the existing part */
+   if (len != flash->sector_size) {
+   /* Rewrite the original data to the end of the sector */
+   if (spi_flash_write(flash, offset + len,
+   flash->sector_size - len, &cmp_buf[len]))
+   return "write";
+   }
+
return NULL;
  }



Applied to u-boot-spi/master

--
Thanks,
Jagan.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v4] cmd_sf: let "sf update" preserve the final part of the last sector

2013-08-27 Thread Jagannadha Sutradharudu Teki
From: Gerlando Falauto 

Since "sf update" erases the last block as a whole, but only rewrites
the meaningful initial part of it, the rest would be left erased,
potentially erasing meaningful information.
So, as a safety measure, have it rewrite the original content.

Signed-off-by: Gerlando Falauto 
Cc: Valentin Longchamp 
Cc: Holger Brunck 
Acked-by: Simon Glass 
Signed-off-by: Jagannadha Sutradharudu Teki 
---
Changes for v4:
- Rebase to current tree
- Fix one checkpatch warning

 common/cmd_sf.c | 13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/common/cmd_sf.c b/common/cmd_sf.c
index 4af0f0a..3f60979 100644
--- a/common/cmd_sf.c
+++ b/common/cmd_sf.c
@@ -152,8 +152,10 @@ static const char *spi_flash_update_block(struct spi_flash 
*flash, u32 offset,
 {
debug("offset=%#x, sector_size=%#x, len=%#zx\n",
  offset, flash->sector_size, len);
-   if (spi_flash_read(flash, offset, len, cmp_buf))
+   /* Read the entire sector so to allow for rewriting */
+   if (spi_flash_read(flash, offset, flash->sector_size, cmp_buf))
return "read";
+   /* Compare only what is meaningful (len) */
if (memcmp(cmp_buf, buf, len) == 0) {
debug("Skip region %x size %zx: no change\n",
  offset, len);
@@ -163,8 +165,17 @@ static const char *spi_flash_update_block(struct spi_flash 
*flash, u32 offset,
/* Erase the entire sector */
if (spi_flash_erase(flash, offset, flash->sector_size))
return "erase";
+   /* Write the initial part of the block from the source */
if (spi_flash_write(flash, offset, len, buf))
return "write";
+   /* If it's a partial sector, rewrite the existing part */
+   if (len != flash->sector_size) {
+   /* Rewrite the original data to the end of the sector */
+   if (spi_flash_write(flash, offset + len,
+   flash->sector_size - len, &cmp_buf[len]))
+   return "write";
+   }
+
return NULL;
 }
 
-- 
1.8.3


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] usb: gadget: Fix data aborts during USB ethernet boot

2013-08-27 Thread Marek Vasut
Dear Joel Fernandes,

> As seen on GCC 4.6 Linaro compiler, control_req buffer is not aligned
> on 4 byte boundaray causing data aborts in eth_setup -> conf_buf
> during dhcp boot over usb_ether. Fix the issue my aligning control_req
> buffer to 4-byte boundary.
> 
> Tested on am335x_evm platform (beaglebone).
> Applies on 2013.10-rc1 branch.
> 
> Cc: Tom Rini 
> Signed-off-by: Joel Fernandes 

Please keep me in the CC next time.

> ---
>  drivers/usb/gadget/ether.c |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
> index 579893c..251d7b2 100644
> --- a/drivers/usb/gadget/ether.c
> +++ b/drivers/usb/gadget/ether.c
> @@ -849,7 +849,7 @@ static struct usb_gadget_strings  stringtab = {
>  };
> 
>  /*
> */ -static u8 control_req[USB_BUFSIZ];
> +static u8 control_req[USB_BUFSIZ] __attribute__ ((aligned(4)));

Please make this cacheline aligned, so we get rid of bounce buffering of the 
requests on stupid hardware.

>  #if defined(CONFIG_USB_ETH_CDC) || defined(CONFIG_USB_ETH_RNDIS)
>  static u8 status_req[STATUS_BYTECOUNT] __attribute__ ((aligned(4)));

This could also use fixing, but the STATUS_BYTECOUNT would need to be 
up-aligned 
as well then. Some DEFINE_CACHE_ALIGN_BUFFER might help in both cases here.

>  #endif

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PULL] u-boot-usb/master

2013-08-27 Thread Marek Vasut
The following changes since commit 2b26201a2aef0b310b7c04702b0dba5dea493f77:

  env_nand.c: support falling back to redundant env when writing (2013-08-22 
17:49:47 -0500)

are available in the git repository at:

  git://git.denx.de/u-boot-usb.git master

for you to fetch changes up to c95e2b9eaeadc0f985030ffa0638278acc2d8727:

  console: usb: kbd: To fix slow TFTP booting (2013-08-26 21:56:35 +0200)


Dan Murphy (7):
  omap5: uevm: Change the board name to correct name
  ARM: OMAP5: USB: Add OMAP5 common USB EHCI information
  ARM: OMAP: USB: Fix linker error when ULPI is not defined
  ARM: OMAP5-uevm: Add USB ehci support for the uEVM
  ARM: OMAP5-uevm: Add USB MAC ethernet address
  USB: usb-hub: Add a weak function for resetting devices
  ARM: OMAP5-uevm: Add usb device reset API

Fabio Estevam (2):
  usb: ehci-mx5: Remove unneeded write to cscmr1 register
  usb: ehci-mx5: Use 'bool' instead of 'unsigned char'

Heiko Schocher (1):
  dfu, nand, ubi: add partubi alt settings for updating ubi partition

Jim Lin (3):
  NET: Add net_busy_flag if CONFIG_USB_KEYBOARD is defined
  console: usb: kbd: To improve TFTP booting performance
  console: usb: kbd: To fix slow TFTP booting

Julius Werner (1):
  usb: Use well-known descriptor sizes when parsing configuration

Lukasz Majewski (2):
  usb:dfu:g_dnl: Change number of exported configurations at composite 
gadget
  usb:dfu:g_dnl: Refactoring the string definition code for g_dnl driver

 arch/arm/cpu/armv7/mx5/clock.c  |   10 +-
 arch/arm/include/asm/arch-mx5/clock.h   |6 +++---
 arch/arm/include/asm/arch-omap5/clock.h |   17 +
 arch/arm/include/asm/arch-omap5/ehci.h  |   43 
+++
 arch/arm/include/asm/ehci-omap.h|2 ++
 board/ti/omap5_uevm/evm.c   |   96 
+++-
 board/ti/omap5_uevm/mux_data.h  |4 +++-
 common/usb.c|   87 
+++
 common/usb_hub.c|   26 --
 common/usb_kbd.c|   15 +++
 drivers/dfu/dfu_nand.c  |   38 
--
 drivers/usb/gadget/g_dnl.c  |   17 +++--
 drivers/usb/host/ehci-mx5.c |   15 +++
 drivers/usb/host/ehci-omap.c|   33 
+++--
 include/configs/omap5_uevm.h|   24 
 include/dfu.h   |2 ++
 net/net.c   |   11 +++
 17 files changed, 388 insertions(+), 58 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-omap5/ehci.h
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Fix problems in chip select selection in imx23, 28 spi code

2013-08-27 Thread Jagan Teki
On Tue, Aug 27, 2013 at 2:40 PM, Jagan Teki  wrote:
> Hi,
>
> On Tue, Aug 27, 2013 at 4:11 AM, Asok Subramanian  wrote:
>>  Fix problems in chip select selection in imx23,28 spi code
>>
>> The spi function code for imx23,28 currently does not work for chip select
>> other than 0.
>> This is because the register HW_SSP_CTRL0 is first  reset and the code does
>> not load the CS bits
>> again into HW_SSP_CTRL0 after the reset. The proposed fix reloads the CS
>> bits after the reset.
>>
>> Signed-off-by: Asok Subramanian 
>> ---
>>  drivers/spi/mxs_spi.c |4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c
>> index 3cf7142..15681dc 100644
>> --- a/drivers/spi/mxs_spi.c
>> +++ b/drivers/spi/mxs_spi.c
>> @@ -32,6 +32,7 @@ struct mxs_spi_slave {
>>  uint32_tmax_khz;
>>  uint32_tmode;
>>  struct mxs_ssp_regs*regs;
>> +unsigned intcs;
>>  };
>>
>>  static inline struct mxs_spi_slave *to_mxs_slave(struct spi_slave *slave)
>> @@ -74,6 +75,7 @@ struct spi_slave *spi_setup_slave(unsigned int bus,
>> unsigned int cs,
>>  mxs_slave->max_khz = max_hz / 1000;
>>  mxs_slave->mode = mode;
>>  mxs_slave->regs = mxs_ssp_regs_by_bus(bus);
>> +mxs_slave->cs = cs;
>>  ssp_regs = mxs_slave->regs;
>>
>>  reg = readl(&ssp_regs->hw_ssp_ctrl0);
>> @@ -102,7 +104,7 @@ int spi_claim_bus(struct spi_slave *slave)
>>
>>  mxs_reset_block(&ssp_regs->hw_ssp_ctrl0_reg);
>>
>> -writel(SSP_CTRL0_BUS_WIDTH_ONE_BIT, &ssp_regs->hw_ssp_ctrl0);
>> +writel(SSP_CTRL0_BUS_WIDTH_ONE_BIT | (mxs_slave->cs) <<
>> MXS_SSP_CHIPSELECT_SHIFT, &ssp_regs->hw_ssp_ctrl0);
>>
>>  reg = SSP_CTRL1_SSP_MODE_SPI | SSP_CTRL1_WORD_LENGTH_EIGHT_BITS;
>>  reg |= (mxs_slave->mode & SPI_CPOL) ? SSP_CTRL1_POLARITY : 0;
>> --
>> 1.7.9.5
>
> Please use the proper commit head.
> Fix problems in chip select selection in imx23,28 spi code
> spi: mxs_spi: 

And also please fix the check-patch errors:

ERROR: Unrecognized email address: 'Asok Subramanian '
#18:
Signed-off-by: Asok Subramanian 

ERROR: patch seems to be corrupt (line wrapped?)
#29: FILE: drivers/spi/mxs_spi.c:31:
 uint32_tmax_khz;

WARNING: line over 80 characters
#49: FILE: drivers/spi/mxs_spi.c:104:
+writel(SSP_CTRL0_BUS_WIDTH_ONE_BIT | (mxs_slave->cs) <<
MXS_SSP_CHIPSELECT_SHIFT, &ssp_regs->hw_ssp_ctrl0);

total: 2 errors, 1 warnings, 22 lines checked


--
Thanks,
Jagan.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] confused about set/test of EMMC_BOOT-related config settings

2013-08-27 Thread Tom Rini
On Wed, Aug 21, 2013 at 11:25:43AM -0400, Robert P. J. Day wrote:
> 
>   perusing cmd_mmc.c, ran across test for CONFIG_SUPPORT_EMMC_BOOT
> with which i was unfamiliar so i did a grep to see where it was having
> an effect and got this:
> 
> $ grep -r EMMC_BOOT *
> arch/arm/cpu/armv7/exynos/spl_boot.c:#ifdef CONFIG_SUPPORT_EMMC_BOOT
> arch/arm/cpu/armv7/exynos/spl_boot.c:#ifdef CONFIG_SUPPORT_EMMC_BOOT
> boards.cfg:am335x_boneblack arm armv7   am335x
>   ti am33xx  am335x_evm:SERIAL1,CONS_INDEX=1,EMMC_BOOT
> common/cmd_mmc.c:#ifdef CONFIG_SUPPORT_EMMC_BOOT
> common/cmd_mmc.c:#ifdef CONFIG_SUPPORT_EMMC_BOOT
> common/cmd_mmc.c:#endif /* CONFIG_SUPPORT_EMMC_BOOT */
> common/cmd_mmc.c:#ifdef CONFIG_SUPPORT_EMMC_BOOT
> drivers/mmc/mmc.c:#ifdef CONFIG_SUPPORT_EMMC_BOOT
> include/configs/am335x_evm.h:#elif defined(CONFIG_EMMC_BOOT)
> include/configs/exynos5250-dt.h:#define CONFIG_SUPPORT_EMMC_BOOT
> $
> 
>   confused because in the midst of all that, i see a reference in
> am335x_evm.h to CONFIG_EMMC_BOOT rather than CONFIG_SUPPORT_EMMC_BOOT.
> is that deliberate? i haven't dug further to see what that option
> represents, but that difference just looks odd. thoughts?

For am335x CONFIG_EMMC_BOOT is like CONFIG_SPI_BOOT, CONFIG_NOR_BOOT,
etc, of making an otherwise generic config support booting (and assuming
env is on) a particular medium.  CONFIG_SUPPORT_EMMC_BOOT is I believe
about supporting additional features of the eMMC "boot" partitions which
I believe either aren't enforced on the beaglebone black (nor omap5
uEVM) or aren't in the driver (I forget what I figured out a while ago
playing with the kernel as well).

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] U-Boot mini-summit at ELCE 2013 in Edinburgh - call for participation!

2013-08-27 Thread Jagan Teki
On Tue, Aug 27, 2013 at 5:46 PM, Tom Rini  wrote:
> On Tue, Aug 27, 2013 at 11:39:50AM +0200, Michal Simek wrote:
>> Hi,
>>
>> >> Hi fellow U-Boot developers,
>> >>
>> >> people meeting us at our booth at the Embedded World trade show in
>> >> N??rnberg this year may already have heard rumours about it but now it is
>> >> official - there will be an U-Boot mini-summit at the Emdedd Linux
>> >> Conference Europe in Edinburgh, UK [1].
>> >>
>> >> Thanks to the wonderful people at the Linux Foundation, we will have
>> >> some space in the afternoon of thursday 24th that we can use to present
>> >> and discuss topics of interest for the immediate future of the project.
>> >>
>> >> Currently we believe that it makes sense to plan for 4-5 short talks in
>> >> the range of 20-30 minutes with following Q&A.  The audience will very
>> >> likely be "tech level" and the presentations are thus allowed to have
>> >> "indecent technical content" :)
>> >>
>> >> Of course everybody is invited to suggest a presentation, but an
>> >> informal poll turned up these topics of interest:
>> >>
>> >> - Driver model
>> >> - Kconfig
>> >> - Patman tutorial
>> >> - U-Boot configuration through device tree
>> >> - Falcon boot for everybody
>> >> - DFU
>> >> - Android fastboot
>> >>
>> >> The organization of the mini-summit is up to our discretion and thus
>> >> somewhat less formal than the "regular" ELCE tracks, but we would like
>> >> to encourage people to also submit U-Boot related talks through the
>> >> regular CFP[2] if they are of wide interest.
>> >>
>> >> Having agreed on our schedule, we will be able to get it included in the
>> >> official conference schedule and thus hopefully get a broader
>> >> visibility.  To make this work we should finalize our schedule around
>> >> the end of the official CFP which is July 21st, but of course the
>> >> sooner, the better.
>> >>
>> >> Please inform us if you would like to attend in order to get an idea
>> >> of the expected presence.  If neccessary we will have to look for a
>> >> larger place early on.
>> >>
>> >> Next to the official program I'm sure that we will be able to find a
>> >> place in the evening to taste local culinary specialities (in solid and
>> >> liquid form), so be sure to book your return flight no sooner than
>> >> friday evening ;)
>> >>
>> >> Thanks
>> >>   Detlev
>> >>
>> >> [1] 
>> >> http://events.linuxfoundation.org/events/embedded-linux-conference-europe
>> >> [2] 
>> >> http://events.linuxfoundation.org/events/embedded-linux-conference-europe/cfp
>> >
>> > The deadline for the CFP has expired - did any of you actually submit
>> > a presentation?
>> >
>> > In any case, if you intend do give a presentation, could you please
>> > ASAP send a short summary (title and abstract) to at least Tom,
>> > Detlev and me, optionally also to the mailing list (recommended) ?
>> >
>> >
>> > FYI: DENX will be present with the following engineers: Anatolij
>> > Gustschin, Detlev Zundel, Gerhard Sittig, Heiko Schocher, Marek Vasut,
>> > Pavel Machek, Stefan Roese, Stefano Babic, and myself.  We will arrive
>> > on Wednesday afternoon.  Anatolij, Heiko, Stefan and me will depart on
>> > Friday, the rest on Saturday.  We wil stay at the Hilton Edinburgh
>> > Grosvenor hotel, Grosvenor Street.
>>
>> I should be there too. Will be there any specific room available for
>> u-boot mini summit?
>
> Yes, I do believe so.
>
>> I don't have any specific presentation but I am interested in
>> SPL for Microblaze and ARM Zynq platforms, device-tree U-Boot initialisation
>> and maybe others.
>
> Sounds good.  I'm not sure how the organization side of the summit is
> being setup, but I imagine we'll be able to talk about those things.

Is there any link for about discussed topics with covered speakers, if
yes please pass.

--
Thanks,
Jagan.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] SPL boot on iMX6

2013-08-27 Thread Stefano Babic
Hi Tapani,

On 27/08/2013 06:07, Tapani Utriainen wrote:

> Your suggestion is similar to what I would first think of, but you do
> the extra kludging to make it work with the current syntax. My approach
> would be to introduce new namings in parallel to the current ones
> (similar, if not the same, as the linux kernel uses) until most imx6
> boards have been cleaned to use the new namings (which might take a while).

We will see when you post patches. My concern is that very often old
code remains unchanged and nobody takes care of it. If there is no
compatibility approach, we should try to clean up all boards.

Can you also take a look at the Troy's patches, mentioned by Eric ?

> 
> For the accessor macro, our experiences from the Wandboard kernel have been
> very positive with the following:
> 
> To set the above mentioned pad, the board file does:
> 
>   IMX6_SETUP_PAD( SD2_DAT1__USDHC2_DAT1 );
> 
> where the macro IMX6_SETUP_PAD is defined as:
> 
> #define IMX6_SETUP_PAD(p) \
>   if (cpu_is_mx6q()) \
>   mxc_iomux_v3_setup_pad(MX6Q_PAD_##p);\
>   else \
>   mxc_iomux_v3_setup_pad(MX6DL_PAD_##p)
> 

Sure, I thought something like that, too.

> 
> Of course the syntax can be different. One experience is that this 
> de-clutters 
> the board file (compared with having arrays and arrays of padconf 
> definitions).

It is interesting how much the footprint increases.

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] SPL boot on iMX6

2013-08-27 Thread Stefano Babic
Hi Eric,

On 26/08/2013 16:23, Eric Nelson wrote:
> 
> Functionally, we still need table(s) for any image which supports either
> variant so the proper set of pads are configured.
> 
> See this for an example
> http://lists.denx.de/pipermail/u-boot/2012-October/136394.html
> 

Ok - what I meant is to avoid to convert the static definitions (enums)
in the header in a sort of tables. I agree that using tables in the
board code is needed and makes the code more readable using
imx_iomux_v3_setup_multiple_pads().

> The construct used in that patch set was to define FOR_DL_SOLO,
> then include the pad file.
> #ifdef CONFIG_MX6Q
> #include "pads.h"
> #endif
> #if defined(CONFIG_MX6DL) || defined(CONFIG_MX6S)
> #define FOR_DL_SOLO
> #include "pads.h"
> #endif
> 
> Troy's implementation used a naming convention of mx6q_X
> and mx6dl_solo_X such that a board supporting both would have
> variables
> 
> static iomux_v3_cfg_t mx6q_usdhc3_pads = ...
> 
> followed by
> 
> static iomux_v3_cfg_t mx6dl_solo_usdhc3_pads = ...
> 

ok, this is a solution. Let's wait for next Tapani's patch and when we
start the discussion ;-)

Best regards,
Stefano

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-boot] zImage_dtb status

2013-08-27 Thread Tom Rini
On Mon, Aug 26, 2013 at 06:12:45PM +0800, tiger...@viatech.com.cn wrote:

> Hi, experts:
> 
> Currently, linux kernel could compile zImage with appending dtb binary.
> 
>  
> 
> Uboot has supported bootz command.
> 
> So, could bootz be used to boot zImage_dtb image?
> 
> Has anybody test succefully?

Yes, but appended dtb is something (some) kernel developers suggest not
relying on.  But you don't need to append, for uImage or zImage, just
pass ${loadaddr} - ${fdt_addr}

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] U-Boot mini-summit at ELCE 2013 in Edinburgh - call for participation!

2013-08-27 Thread Tom Rini
On Tue, Aug 27, 2013 at 11:39:50AM +0200, Michal Simek wrote:
> Hi,
> 
> >> Hi fellow U-Boot developers,
> >>
> >> people meeting us at our booth at the Embedded World trade show in
> >> N??rnberg this year may already have heard rumours about it but now it is
> >> official - there will be an U-Boot mini-summit at the Emdedd Linux
> >> Conference Europe in Edinburgh, UK [1].
> >>
> >> Thanks to the wonderful people at the Linux Foundation, we will have
> >> some space in the afternoon of thursday 24th that we can use to present
> >> and discuss topics of interest for the immediate future of the project.
> >>
> >> Currently we believe that it makes sense to plan for 4-5 short talks in
> >> the range of 20-30 minutes with following Q&A.  The audience will very
> >> likely be "tech level" and the presentations are thus allowed to have
> >> "indecent technical content" :)
> >>
> >> Of course everybody is invited to suggest a presentation, but an
> >> informal poll turned up these topics of interest:
> >>
> >> - Driver model
> >> - Kconfig
> >> - Patman tutorial
> >> - U-Boot configuration through device tree
> >> - Falcon boot for everybody
> >> - DFU
> >> - Android fastboot
> >>
> >> The organization of the mini-summit is up to our discretion and thus
> >> somewhat less formal than the "regular" ELCE tracks, but we would like
> >> to encourage people to also submit U-Boot related talks through the
> >> regular CFP[2] if they are of wide interest.
> >>
> >> Having agreed on our schedule, we will be able to get it included in the
> >> official conference schedule and thus hopefully get a broader
> >> visibility.  To make this work we should finalize our schedule around
> >> the end of the official CFP which is July 21st, but of course the
> >> sooner, the better.
> >>
> >> Please inform us if you would like to attend in order to get an idea
> >> of the expected presence.  If neccessary we will have to look for a
> >> larger place early on.
> >>
> >> Next to the official program I'm sure that we will be able to find a
> >> place in the evening to taste local culinary specialities (in solid and
> >> liquid form), so be sure to book your return flight no sooner than
> >> friday evening ;)
> >>
> >> Thanks
> >>   Detlev
> >>
> >> [1] 
> >> http://events.linuxfoundation.org/events/embedded-linux-conference-europe
> >> [2] 
> >> http://events.linuxfoundation.org/events/embedded-linux-conference-europe/cfp
> > 
> > The deadline for the CFP has expired - did any of you actually submit
> > a presentation?
> > 
> > In any case, if you intend do give a presentation, could you please
> > ASAP send a short summary (title and abstract) to at least Tom,
> > Detlev and me, optionally also to the mailing list (recommended) ?
> > 
> > 
> > FYI: DENX will be present with the following engineers: Anatolij
> > Gustschin, Detlev Zundel, Gerhard Sittig, Heiko Schocher, Marek Vasut,
> > Pavel Machek, Stefan Roese, Stefano Babic, and myself.  We will arrive
> > on Wednesday afternoon.  Anatolij, Heiko, Stefan and me will depart on
> > Friday, the rest on Saturday.  We wil stay at the Hilton Edinburgh
> > Grosvenor hotel, Grosvenor Street.
> 
> I should be there too. Will be there any specific room available for
> u-boot mini summit?

Yes, I do believe so.

> I don't have any specific presentation but I am interested in
> SPL for Microblaze and ARM Zynq platforms, device-tree U-Boot initialisation
> and maybe others.

Sounds good.  I'm not sure how the organization side of the summit is
being setup, but I imagine we'll be able to talk about those things.

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 2/8] ARM: add secure monitor handler to switch to non-secure state

2013-08-27 Thread Tom Rini
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 08/27/2013 05:51 AM, Andre Przywara wrote:
> On 08/27/2013 02:23 AM, Masahiro Yamada wrote:
>> Hello Andre,
>> 
>>> +/* the vector table for secure state */ +_monitor_vectors: +
>>> .word 0/* reset */ +.word 0 /* undef */ +adr pc,
>>> _secure_monitor +.word 0 +.word 0 +.word 0 +
>>> .word 0 +.word 0 +.word 0/* pad */
>> 
>> Could you explain why the last line is needed?
> 
> I guess I cannot explain because it's probably not needed ;-) I
> copied this from somewhere else and accidentally this padding
> somehow sneaked in (from the actual addresses array, where the
> start vector was missing and thus the array ended at 7 * 4 bytes)
> 
> Do we need another version or is a follow-up patch sufficient? I'd
> like to avoid another review round for the sake of the reviewers.

Lets do a follow-up and Albert can squash it if desired.

- -- 
Tom
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJSHJdtAAoJENk4IS6UOR1WDgcP/1Rz+1U/La9brudy9OyjeVqT
FYdWMtFr/TGELkoaUX/saY/MZoIPBpCO4iW8y5UvQJ3cQAm5WqgPK4/ku3wcbYC6
yaVC91fQ9UQEqzmUBCRGZAGwJuZ+JiElP/9wmqEi7RvnQTYimRYkEpm+XgxRkuX0
l3HH5QLyTO8CbQ4FKm8XeE0JeMfpNqPflMo5oDNMVlWC7a4VXMP49uIGoYt6emPp
d7US4neOZRgL0ANiC/WoV807otl+llFRgZ0zqM7A60th+jJ2YqJIyZlp6QnL2r+Z
YDLlKSvwBliYlmdFWFxxfUoe+4qK27HrOA39PP/Cj5ocQCoEzIRZFTXhlV3AeB9L
CEhXgImSs0BS4AxN7CPdaJLdDGalphthkHOuGP66m+Xb9k7v6gmdNhphusX01FhC
UUgRRKVUT02dS+51tMRxk1wdy805eI6zo34hmvS2SmWWuxAM1kCQhphUl+Ib1ew6
H7V+XoDdOp+iQzABB86TL8J8KtoUgiVA81NqQsvbiW4pR5rUoxBhTTXEYOnZyMYA
qypDCyYepuQCLtz5kxxe0b1Y4tmZsNKtnVuMA55LtPVLHqX1uJ/vXXHBTsO3rGG3
Rz3BTq0o9GVYBg6YLJh496qD8kzqOfnhpu3U+5Fc10H0ldlDcs8YhLU+hzVD+nLD
dDuxa9OzgPsEK/Wc1mWg
=5MkM
-END PGP SIGNATURE-
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/3] cmd_ubi: add write.part command, to write a volume in multiple parts

2013-08-27 Thread Stefan Roese
On 20.08.2013 11:55, Paul Burton wrote:
> Thanks, I'll fix the style issues and send v2 soon.

Yes, please do.

Thanks,
Stefan

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] ppc4xx: Fix GPIO handling in lwmon5 and lcd4_lwmon5 BSP

2013-08-27 Thread Stefan Roese
LCD4 needs a slightly different GPIO configuration than the
original LWMON5 variant. GPIO49 needs to be configured to a
default output value of 0 (permanent voltage supply).

Additionally lcd4 also needs to enable the LSB transmitter.

Signed-off-by: Stefan Roese 
---
 board/lwmon5/lwmon5.c|  3 +++
 include/configs/lwmon5.h | 10 +-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/board/lwmon5/lwmon5.c b/board/lwmon5/lwmon5.c
index 4e4a594..e9aa0b7 100644
--- a/board/lwmon5/lwmon5.c
+++ b/board/lwmon5/lwmon5.c
@@ -527,6 +527,9 @@ void spl_board_init(void)
 */
board_early_init_f();
 
+   /* enable the LSB transmitter */
+   gpio_write_bit(CONFIG_SYS_GPIO_LSB_ENABLE, 1);
+
/*
 * Clear resets
 */
diff --git a/include/configs/lwmon5.h b/include/configs/lwmon5.h
index 8f5eb95..96f3ba5 100644
--- a/include/configs/lwmon5.h
+++ b/include/configs/lwmon5.h
@@ -565,6 +565,7 @@
 #define CONFIG_SYS_GPIO_PHY1_RST   12
 #define CONFIG_SYS_GPIO_FLASH_WP   14
 #define CONFIG_SYS_GPIO_PHY0_RST   22
+#define CONFIG_SYS_GPIO_PERM_VOLT_FEED 49
 #define CONFIG_SYS_GPIO_DSPIC_READY51
 #define CONFIG_SYS_GPIO_CAN_ENABLE 53
 #define CONFIG_SYS_GPIO_LSB_ENABLE 54
@@ -577,6 +578,13 @@
 #define CONFIG_SYS_GPIO_SYSMON_STATUS  62
 #define CONFIG_SYS_GPIO_WATCHDOG   63
 
+/* On LCD4, GPIO49 has to be configured to 0 instead of 1 */
+#ifdef CONFIG_LCD4_LWMON5
+#define GPIO49_VAL 0
+#else
+#define GPIO49_VAL 1
+#endif
+
 /*
  * PPC440 GPIO Configuration
  */
@@ -635,7 +643,7 @@
 {GPIO1_BASE, GPIO_IN , GPIO_ALT1, GPIO_OUT_0}, /* GPIO46 UIC_IRQ(7)
DMA_REQ(0)  */  \
 {GPIO1_BASE, GPIO_IN , GPIO_ALT1, GPIO_OUT_0}, /* GPIO47 UIC_IRQ(8)
DMA_ACK(0)  */  \
 {GPIO1_BASE, GPIO_IN , GPIO_ALT1, GPIO_OUT_0}, /* GPIO48 UIC_IRQ(9)
DMA_EOT/TC(0)   */  \
-{GPIO1_BASE, GPIO_OUT, GPIO_SEL , GPIO_OUT_1}, /* GPIO49  Unselect via 
TraceSelect Bit */  \
+{GPIO1_BASE, GPIO_OUT, GPIO_SEL , GPIO49_VAL}, /* GPIO49  Unselect via 
TraceSelect Bit */  \
 {GPIO1_BASE, GPIO_IN,  GPIO_SEL , GPIO_OUT_0}, /* GPIO50  Unselect via 
TraceSelect Bit */  \
 {GPIO1_BASE, GPIO_IN , GPIO_SEL , GPIO_OUT_0}, /* GPIO51  Unselect via 
TraceSelect Bit */  \
 {GPIO1_BASE, GPIO_IN , GPIO_SEL , GPIO_OUT_0}, /* GPIO52  Unselect via 
TraceSelect Bit */  \
-- 
1.8.3.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] ARM: mxs: Receive r0 and r1 passed from BootROM

2013-08-27 Thread Marek Vasut
Make sure value in register r0 and r1 is preserved and passed to
the board_init_ll() and mxs_common_spl_init() where it can be
processed further. The value in r0 can be configured during the
BootStream generation to arbitary value, r1 contains pointer to
return value from CALL'd function.

This patch also clears the value in r0 before returning to BootROM
to make sure the BootROM is not confused by this value.

Finally, this patch cleans up some comments in the start.S file.

Signed-off-by: Marek Vasut 
Cc: Fabio Estevam 
Cc: Stefano Babic 
---
 arch/arm/cpu/arm926ejs/mxs/spl_boot.c |5 +--
 arch/arm/cpu/arm926ejs/mxs/start.S|   50 +
 arch/arm/include/asm/arch-mxs/sys_proto.h |5 +--
 board/bluegiga/apx4devkit/spl_boot.c  |4 +--
 board/creative/xfi3/spl_boot.c|4 +--
 board/denx/m28evk/spl_boot.c  |4 +--
 board/freescale/mx23evk/spl_boot.c|4 +--
 board/freescale/mx28evk/iomux.c   |4 +--
 board/olimex/mx23_olinuxino/spl_boot.c|4 +--
 board/sandisk/sansa_fuze_plus/spl_boot.c  |4 +--
 board/schulercontrol/sc_sps_1/spl_boot.c  |4 +--
 11 files changed, 52 insertions(+), 40 deletions(-)

NOTE: This can be nicely used for loading Linux using BootROM
  directly from the SPL.

diff --git a/arch/arm/cpu/arm926ejs/mxs/spl_boot.c 
b/arch/arm/cpu/arm926ejs/mxs/spl_boot.c
index 0392afd..68c30af 100644
--- a/arch/arm/cpu/arm926ejs/mxs/spl_boot.c
+++ b/arch/arm/cpu/arm926ejs/mxs/spl_boot.c
@@ -102,8 +102,9 @@ static uint8_t mxs_get_bootmode_index(void)
return i;
 }
 
-void mxs_common_spl_init(const iomux_cfg_t *iomux_setup,
-   const unsigned int iomux_size)
+void mxs_common_spl_init(const uint32_t arg, const uint32_t *resptr,
+const iomux_cfg_t *iomux_setup,
+const unsigned int iomux_size)
 {
struct mxs_spl_data *data = (struct mxs_spl_data *)
((CONFIG_SYS_TEXT_BASE - sizeof(struct mxs_spl_data)) & ~0xf);
diff --git a/arch/arm/cpu/arm926ejs/mxs/start.S 
b/arch/arm/cpu/arm926ejs/mxs/start.S
index 94b2b3f..3e454ae 100644
--- a/arch/arm/cpu/arm926ejs/mxs/start.S
+++ b/arch/arm/cpu/arm926ejs/mxs/start.S
@@ -152,39 +152,49 @@ _reset:
/*
 * Store all registers on old stack pointer, this will allow us later to
 * return to the BootROM and let the BootROM load U-Boot into RAM.
+*
+* WARNING: Register r0 and r1 are used by the BootROM to pass data
+*  to the called code. Register r0 will contain arbitrary
+*  data that are set in the BootStream. In case this code
+*  was started with CALL instruction, register r1 will contain
+*  pointer to the return value this function can then set.
+*  The code below MUST NOT CHANGE register r0 and r1 !
 */
push{r0-r12,r14}
 
-   /* save control register c1 */
-   mrc p15, 0, r0, c1, c0, 0
-   push{r0}
+   /* Save control register c1 */
+   mrc p15, 0, r2, c1, c0, 0
+   push{r2}
 
-   /*
-* set the cpu to SVC32 mode and store old CPSR register content
-*/
-   mrs r0,cpsr
-   push{r0}
-   bic r0,r0,#0x1f
-   orr r0,r0,#0xd3
-   msr cpsr,r0
+   /* Set the cpu to SVC32 mode and store old CPSR register content. */
+   mrs r2, cpsr
+   push{r2}
+   bic r2, r2, #0x1f
+   orr r2, r2, #0xd3
+   msr cpsr, r2
 
bl  board_init_ll
 
+   /* Restore BootROM's CPU mode (especially FIQ). */
+   pop {r2}
+   msr cpsr,r2
+
/*
-* restore bootrom's cpu mode (especially FIQ)
+* Restore c1 register. Especially set exception vector location
+* back to BootROM space which is required by bootrom for USB boot.
 */
-   pop {r0}
-   msr cpsr,r0
+   pop {r2}
+   mcr p15, 0, r2, c1, c0, 0
+
+   pop {r0-r12,r14}
 
/*
-* restore c1 register
-* (especially set exception vector location back to
-* bootrom space which is required by bootrom for USB boot)
+* In case this code was started by the CALL instruction, the register
+* r0 is examined by the BootROM after this code returns. The value in
+* r0 must be set to 0 to indicate successful return.
 */
-   pop {r0}
-   mcr p15, 0, r0, c1, c0, 0
+   mov r0, #0
 
-   pop {r0-r12,r14}
bx  lr
 
 _hang:
diff --git a/arch/arm/include/asm/arch-mxs/sys_proto.h 
b/arch/arm/include/asm/arch-mxs/sys_proto.h
index 1038592..43c7dd6 100644
--- a/arch/arm/include/asm/arch-mxs/sys_proto.h
+++ b/arch/arm/include/asm/arch-mxs/sys_proto.h
@@ -28,8 +28,9 @@ int mxsmmc_initialize(bd_t *bis, int id, int (*wp)(int), int 
(*cd)(int));
 #include 
 #endif
 
-void mxs_common_spl_init(const 

[U-Boot] GPIO mapping as interrupt, interrupt handler in bootloader

2013-08-27 Thread simhavcs
HI,

How to map the gpio as interrupt and write the interrupt handler for it in
bootloader? We have mapped the ethernet phy interrupt to gpio of the cpu, we
need to handle this interrupt for the link detection. We are using MIPS
architecture

I had tried using the polling method, by keeping in for(;;) reading the phy
registers. But the process hangs there itself.

Regards,
Vinay



--
View this message in context: 
http://u-boot.10912.n7.nabble.com/GPIO-mapping-as-interrupt-interrupt-handler-in-bootloader-tp162036.html
Sent from the U-Boot mailing list archive at Nabble.com.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 2/8] ARM: add secure monitor handler to switch to non-secure state

2013-08-27 Thread Andre Przywara

On 08/27/2013 02:23 AM, Masahiro Yamada wrote:

Hello Andre,


+/* the vector table for secure state */
+_monitor_vectors:
+   .word 0 /* reset */
+   .word 0 /* undef */
+   adr pc, _secure_monitor
+   .word 0
+   .word 0
+   .word 0
+   .word 0
+   .word 0
+   .word 0 /* pad */


Could you explain why the last line is needed?


I guess I cannot explain because it's probably not needed ;-)
I copied this from somewhere else and accidentally this padding somehow 
sneaked in (from the actual addresses array, where the start vector was 
missing and thus the array ended at 7 * 4 bytes)


Do we need another version or is a follow-up patch sufficient?
I'd like to avoid another review round for the sake of the reviewers.

Thanks for spotting this,
Andre.

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] U-Boot mini-summit at ELCE 2013 in Edinburgh - call for participation!

2013-08-27 Thread Michal Simek
Hi,

>> Hi fellow U-Boot developers,
>>
>> people meeting us at our booth at the Embedded World trade show in
>> Nürnberg this year may already have heard rumours about it but now it is
>> official - there will be an U-Boot mini-summit at the Emdedd Linux
>> Conference Europe in Edinburgh, UK [1].
>>
>> Thanks to the wonderful people at the Linux Foundation, we will have
>> some space in the afternoon of thursday 24th that we can use to present
>> and discuss topics of interest for the immediate future of the project.
>>
>> Currently we believe that it makes sense to plan for 4-5 short talks in
>> the range of 20-30 minutes with following Q&A.  The audience will very
>> likely be "tech level" and the presentations are thus allowed to have
>> "indecent technical content" :)
>>
>> Of course everybody is invited to suggest a presentation, but an
>> informal poll turned up these topics of interest:
>>
>> - Driver model
>> - Kconfig
>> - Patman tutorial
>> - U-Boot configuration through device tree
>> - Falcon boot for everybody
>> - DFU
>> - Android fastboot
>>
>> The organization of the mini-summit is up to our discretion and thus
>> somewhat less formal than the "regular" ELCE tracks, but we would like
>> to encourage people to also submit U-Boot related talks through the
>> regular CFP[2] if they are of wide interest.
>>
>> Having agreed on our schedule, we will be able to get it included in the
>> official conference schedule and thus hopefully get a broader
>> visibility.  To make this work we should finalize our schedule around
>> the end of the official CFP which is July 21st, but of course the
>> sooner, the better.
>>
>> Please inform us if you would like to attend in order to get an idea
>> of the expected presence.  If neccessary we will have to look for a
>> larger place early on.
>>
>> Next to the official program I'm sure that we will be able to find a
>> place in the evening to taste local culinary specialities (in solid and
>> liquid form), so be sure to book your return flight no sooner than
>> friday evening ;)
>>
>> Thanks
>>   Detlev
>>
>> [1] http://events.linuxfoundation.org/events/embedded-linux-conference-europe
>> [2] 
>> http://events.linuxfoundation.org/events/embedded-linux-conference-europe/cfp
> 
> The deadline for the CFP has expired - did any of you actually submit
> a presentation?
> 
> In any case, if you intend do give a presentation, could you please
> ASAP send a short summary (title and abstract) to at least Tom,
> Detlev and me, optionally also to the mailing list (recommended) ?
> 
> 
> FYI: DENX will be present with the following engineers: Anatolij
> Gustschin, Detlev Zundel, Gerhard Sittig, Heiko Schocher, Marek Vasut,
> Pavel Machek, Stefan Roese, Stefano Babic, and myself.  We will arrive
> on Wednesday afternoon.  Anatolij, Heiko, Stefan and me will depart on
> Friday, the rest on Saturday.  We wil stay at the Hilton Edinburgh
> Grosvenor hotel, Grosvenor Street.

I should be there too. Will be there any specific room available for u-boot 
mini summit?

I don't have any specific presentation but I am interested in
SPL for Microblaze and ARM Zynq platforms, device-tree U-Boot initialisation
and maybe others.

Thanks,
Michal

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform




signature.asc
Description: OpenPGP digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] U-Boot mini-summit at ELCE 2013 in Edinburgh - call for participation!

2013-08-27 Thread Jagan Teki
On Tue, Aug 27, 2013 at 1:13 AM, Scott Wood  wrote:
> On Thu, 2013-08-08 at 11:24 +0200, Wolfgang Denk wrote:
>> Hello all,
>>
>> I think we should bring the upcoming U-Boot mini-summit in Edinburgh
>> back to attention - it's still more than two months, so no reason to
>> panic yet, but as we all know, time flies like an arrow...
>>
>> In message  Detlev Zundel wrote:
>>
>> > Hi fellow U-Boot developers,
>> >
>> > people meeting us at our booth at the Embedded World trade show in
>> > Nürnberg this year may already have heard rumours about it but now it is
>> > official - there will be an U-Boot mini-summit at the Emdedd Linux
>> > Conference Europe in Edinburgh, UK [1].
>> >
>> > Thanks to the wonderful people at the Linux Foundation, we will have
>> > some space in the afternoon of thursday 24th that we can use to present
>> > and discuss topics of interest for the immediate future of the project.
>> >
>> > Currently we believe that it makes sense to plan for 4-5 short talks in
>> > the range of 20-30 minutes with following Q&A.  The audience will very
>> > likely be "tech level" and the presentations are thus allowed to have
>> > "indecent technical content" :)
>> >
>> > Of course everybody is invited to suggest a presentation, but an
>> > informal poll turned up these topics of interest:
>> >
>> > - Driver model
>> > - Kconfig
>> > - Patman tutorial
>> > - U-Boot configuration through device tree
>> > - Falcon boot for everybody
>> > - DFU
>> > - Android fastboot
>> >
>> > The organization of the mini-summit is up to our discretion and thus
>> > somewhat less formal than the "regular" ELCE tracks, but we would like
>> > to encourage people to also submit U-Boot related talks through the
>> > regular CFP[2] if they are of wide interest.
>> >
>> > Having agreed on our schedule, we will be able to get it included in the
>> > official conference schedule and thus hopefully get a broader
>> > visibility.  To make this work we should finalize our schedule around
>> > the end of the official CFP which is July 21st, but of course the
>> > sooner, the better.
>> >
>> > Please inform us if you would like to attend in order to get an idea
>> > of the expected presence.  If neccessary we will have to look for a
>> > larger place early on.
>

Was all topics covered by a respective developer(speaker) are finalized?
Can any one point out the details for these, if possible.

--
Thanks,
Jagan.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V2] spi: mxs: Configure chipselect after block reset

2013-08-27 Thread Marek Vasut
Dear Jagan Teki,

> Hi
> 
> On Tue, Aug 27, 2013 at 2:51 PM, Marek Vasut  wrote:
> > Dear Jagan Teki,
> > 
> >> Hi,
> >> 
> >> On Tue, Aug 27, 2013 at 2:35 PM, Marek Vasut  wrote:
> >> > Dear Stefano Babic,
> >> > 
> >> >> On 26/08/2013 17:45, Marek Vasut wrote:
> >> >> > The chipselect must be written into the CTRL0 register after the
> >> >> > SSP block is reset, otherwise the block will always use ChipSelect
> >> >> > #0.
> >> >> > 
> >> >> > Signed-off-by: Marek Vasut 
> >> >> > Cc: Fabio Estevam 
> >> >> > Cc: Jagannadha Sutradharudu Teki 
> >> >> > Cc: Otavio Salvador 
> >> >> > Cc: Stefano Babic 
> >> >> > ---
> >> >> > 
> >> >> >  drivers/spi/mxs_spi.c |   12 +++-
> >> >> >  1 file changed, 3 insertions(+), 9 deletions(-)
> >> >> > 
> >> >> > V2: Clean up a warning that "ssp_regs" are not used
> >> >> > 
> >> >> > diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c
> >> >> > index 3cf7142..2b9f395 100644
> >> >> > --- a/drivers/spi/mxs_spi.c
> >> >> > +++ b/drivers/spi/mxs_spi.c
> >> >> > @@ -56,8 +56,6 @@ struct spi_slave *spi_setup_slave(unsigned int
> >> >> > bus, unsigned int cs,
> >> >> > 
> >> >> >   unsigned int max_hz, unsigned int
> >> >> >   mode)
> >> >> >  
> >> >> >  {
> >> >> >  
> >> >> > struct mxs_spi_slave *mxs_slave;
> >> >> > 
> >> >> > -   struct mxs_ssp_regs *ssp_regs;
> >> >> > -   int reg;
> >> >> > 
> >> >> > if (!spi_cs_is_valid(bus, cs)) {
> >> >> > 
> >> >> > printf("mxs_spi: invalid bus %d / chip select %d\n",
> >> >> > bus, cs);
> >> >> > 
> >> >> > @@ -74,13 +72,7 @@ struct spi_slave *spi_setup_slave(unsigned int
> >> >> > bus, unsigned int cs,
> >> >> > 
> >> >> > mxs_slave->max_khz = max_hz / 1000;
> >> >> > mxs_slave->mode = mode;
> >> >> > mxs_slave->regs = mxs_ssp_regs_by_bus(bus);
> >> >> > 
> >> >> > -   ssp_regs = mxs_slave->regs;
> >> >> > 
> >> >> > -   reg = readl(&ssp_regs->hw_ssp_ctrl0);
> >> >> > -   reg &= ~(MXS_SSP_CHIPSELECT_MASK);
> >> >> > -   reg |= cs << MXS_SSP_CHIPSELECT_SHIFT;
> >> >> > -
> >> >> > -   writel(reg, &ssp_regs->hw_ssp_ctrl0);
> >> >> > 
> >> >> > return &mxs_slave->slave;
> >> >> >  
> >> >> >  err_init:
> >> >> > @@ -102,7 +94,9 @@ int spi_claim_bus(struct spi_slave *slave)
> >> >> > 
> >> >> > mxs_reset_block(&ssp_regs->hw_ssp_ctrl0_reg);
> >> >> > 
> >> >> > -   writel(SSP_CTRL0_BUS_WIDTH_ONE_BIT, &ssp_regs->hw_ssp_ctrl0);
> >> >> > +   writel((slave->cs << MXS_SSP_CHIPSELECT_SHIFT) |
> >> >> > +  SSP_CTRL0_BUS_WIDTH_ONE_BIT,
> >> >> > +  &ssp_regs->hw_ssp_ctrl0);
> >> >> > 
> >> >> > reg = SSP_CTRL1_SSP_MODE_SPI |
> >> >> > SSP_CTRL1_WORD_LENGTH_EIGHT_BITS; reg |= (mxs_slave->mode &
> >> >> > SPI_CPOL) ? SSP_CTRL1_POLARITY : 0;
> >> >> 
> >> >> Acked-by: Stefano Babic 
> >> > 
> >> > Can we push this via IMX tree ?
> >> 
> >> I have a simple concern about commit head msg.
> >> spi: mxs:
> >> spi: mxs_spi:
> >> 
> >> I preferred the second one as rest are follow the same, just for
> >> unification. Please send the v2, if your OK. then I will push it on my
> >> tree.
> > 
> > Can you fix that before pushing? I am fine either way.
> 
> OK, sure I will do that.

Thanks a lot!

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V2] spi: mxs: Configure chipselect after block reset

2013-08-27 Thread Jagan Teki
Hi

On Tue, Aug 27, 2013 at 2:51 PM, Marek Vasut  wrote:
> Dear Jagan Teki,
>
>> Hi,
>>
>> On Tue, Aug 27, 2013 at 2:35 PM, Marek Vasut  wrote:
>> > Dear Stefano Babic,
>> >
>> >> On 26/08/2013 17:45, Marek Vasut wrote:
>> >> > The chipselect must be written into the CTRL0 register after the SSP
>> >> > block is reset, otherwise the block will always use ChipSelect #0.
>> >> >
>> >> > Signed-off-by: Marek Vasut 
>> >> > Cc: Fabio Estevam 
>> >> > Cc: Jagannadha Sutradharudu Teki 
>> >> > Cc: Otavio Salvador 
>> >> > Cc: Stefano Babic 
>> >> > ---
>> >> >
>> >> >  drivers/spi/mxs_spi.c |   12 +++-
>> >> >  1 file changed, 3 insertions(+), 9 deletions(-)
>> >> >
>> >> > V2: Clean up a warning that "ssp_regs" are not used
>> >> >
>> >> > diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c
>> >> > index 3cf7142..2b9f395 100644
>> >> > --- a/drivers/spi/mxs_spi.c
>> >> > +++ b/drivers/spi/mxs_spi.c
>> >> > @@ -56,8 +56,6 @@ struct spi_slave *spi_setup_slave(unsigned int bus,
>> >> > unsigned int cs,
>> >> >
>> >> >   unsigned int max_hz, unsigned int mode)
>> >> >
>> >> >  {
>> >> >
>> >> > struct mxs_spi_slave *mxs_slave;
>> >> >
>> >> > -   struct mxs_ssp_regs *ssp_regs;
>> >> > -   int reg;
>> >> >
>> >> > if (!spi_cs_is_valid(bus, cs)) {
>> >> >
>> >> > printf("mxs_spi: invalid bus %d / chip select %d\n", bus,
>> >> > cs);
>> >> >
>> >> > @@ -74,13 +72,7 @@ struct spi_slave *spi_setup_slave(unsigned int bus,
>> >> > unsigned int cs,
>> >> >
>> >> > mxs_slave->max_khz = max_hz / 1000;
>> >> > mxs_slave->mode = mode;
>> >> > mxs_slave->regs = mxs_ssp_regs_by_bus(bus);
>> >> >
>> >> > -   ssp_regs = mxs_slave->regs;
>> >> >
>> >> > -   reg = readl(&ssp_regs->hw_ssp_ctrl0);
>> >> > -   reg &= ~(MXS_SSP_CHIPSELECT_MASK);
>> >> > -   reg |= cs << MXS_SSP_CHIPSELECT_SHIFT;
>> >> > -
>> >> > -   writel(reg, &ssp_regs->hw_ssp_ctrl0);
>> >> >
>> >> > return &mxs_slave->slave;
>> >> >
>> >> >  err_init:
>> >> > @@ -102,7 +94,9 @@ int spi_claim_bus(struct spi_slave *slave)
>> >> >
>> >> > mxs_reset_block(&ssp_regs->hw_ssp_ctrl0_reg);
>> >> >
>> >> > -   writel(SSP_CTRL0_BUS_WIDTH_ONE_BIT, &ssp_regs->hw_ssp_ctrl0);
>> >> > +   writel((slave->cs << MXS_SSP_CHIPSELECT_SHIFT) |
>> >> > +  SSP_CTRL0_BUS_WIDTH_ONE_BIT,
>> >> > +  &ssp_regs->hw_ssp_ctrl0);
>> >> >
>> >> > reg = SSP_CTRL1_SSP_MODE_SPI | SSP_CTRL1_WORD_LENGTH_EIGHT_BITS;
>> >> > reg |= (mxs_slave->mode & SPI_CPOL) ? SSP_CTRL1_POLARITY : 0;
>> >>
>> >> Acked-by: Stefano Babic 
>> >
>> > Can we push this via IMX tree ?
>>
>> I have a simple concern about commit head msg.
>> spi: mxs:
>> spi: mxs_spi:
>>
>> I preferred the second one as rest are follow the same, just for
>> unification. Please send the v2, if your OK. then I will push it on my
>> tree.
>
> Can you fix that before pushing? I am fine either way.

OK, sure I will do that.

--
Thanks,
Jagan.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V2] spi: mxs: Configure chipselect after block reset

2013-08-27 Thread Marek Vasut
Dear Jagan Teki,

> Hi,
> 
> On Tue, Aug 27, 2013 at 2:35 PM, Marek Vasut  wrote:
> > Dear Stefano Babic,
> > 
> >> On 26/08/2013 17:45, Marek Vasut wrote:
> >> > The chipselect must be written into the CTRL0 register after the SSP
> >> > block is reset, otherwise the block will always use ChipSelect #0.
> >> > 
> >> > Signed-off-by: Marek Vasut 
> >> > Cc: Fabio Estevam 
> >> > Cc: Jagannadha Sutradharudu Teki 
> >> > Cc: Otavio Salvador 
> >> > Cc: Stefano Babic 
> >> > ---
> >> > 
> >> >  drivers/spi/mxs_spi.c |   12 +++-
> >> >  1 file changed, 3 insertions(+), 9 deletions(-)
> >> > 
> >> > V2: Clean up a warning that "ssp_regs" are not used
> >> > 
> >> > diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c
> >> > index 3cf7142..2b9f395 100644
> >> > --- a/drivers/spi/mxs_spi.c
> >> > +++ b/drivers/spi/mxs_spi.c
> >> > @@ -56,8 +56,6 @@ struct spi_slave *spi_setup_slave(unsigned int bus,
> >> > unsigned int cs,
> >> > 
> >> >   unsigned int max_hz, unsigned int mode)
> >> >  
> >> >  {
> >> >  
> >> > struct mxs_spi_slave *mxs_slave;
> >> > 
> >> > -   struct mxs_ssp_regs *ssp_regs;
> >> > -   int reg;
> >> > 
> >> > if (!spi_cs_is_valid(bus, cs)) {
> >> > 
> >> > printf("mxs_spi: invalid bus %d / chip select %d\n", bus,
> >> > cs);
> >> > 
> >> > @@ -74,13 +72,7 @@ struct spi_slave *spi_setup_slave(unsigned int bus,
> >> > unsigned int cs,
> >> > 
> >> > mxs_slave->max_khz = max_hz / 1000;
> >> > mxs_slave->mode = mode;
> >> > mxs_slave->regs = mxs_ssp_regs_by_bus(bus);
> >> > 
> >> > -   ssp_regs = mxs_slave->regs;
> >> > 
> >> > -   reg = readl(&ssp_regs->hw_ssp_ctrl0);
> >> > -   reg &= ~(MXS_SSP_CHIPSELECT_MASK);
> >> > -   reg |= cs << MXS_SSP_CHIPSELECT_SHIFT;
> >> > -
> >> > -   writel(reg, &ssp_regs->hw_ssp_ctrl0);
> >> > 
> >> > return &mxs_slave->slave;
> >> >  
> >> >  err_init:
> >> > @@ -102,7 +94,9 @@ int spi_claim_bus(struct spi_slave *slave)
> >> > 
> >> > mxs_reset_block(&ssp_regs->hw_ssp_ctrl0_reg);
> >> > 
> >> > -   writel(SSP_CTRL0_BUS_WIDTH_ONE_BIT, &ssp_regs->hw_ssp_ctrl0);
> >> > +   writel((slave->cs << MXS_SSP_CHIPSELECT_SHIFT) |
> >> > +  SSP_CTRL0_BUS_WIDTH_ONE_BIT,
> >> > +  &ssp_regs->hw_ssp_ctrl0);
> >> > 
> >> > reg = SSP_CTRL1_SSP_MODE_SPI | SSP_CTRL1_WORD_LENGTH_EIGHT_BITS;
> >> > reg |= (mxs_slave->mode & SPI_CPOL) ? SSP_CTRL1_POLARITY : 0;
> >> 
> >> Acked-by: Stefano Babic 
> > 
> > Can we push this via IMX tree ?
> 
> I have a simple concern about commit head msg.
> spi: mxs:
> spi: mxs_spi:
> 
> I preferred the second one as rest are follow the same, just for
> unification. Please send the v2, if your OK. then I will push it on my
> tree.

Can you fix that before pushing? I am fine either way.

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [Uboot][PATCH] drivers: spi: macronix: Add MX66L51235L data

2013-08-27 Thread Jagan Teki
Hi

On Tue, Aug 27, 2013 at 11:15 AM, Sourav Poddar  wrote:
> Add support for macronix "MX66L51235L" flash device.
>
> Signed-off-by: Sourav Poddar 
> ---
>  drivers/mtd/spi/macronix.c |5 +
>  1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mtd/spi/macronix.c b/drivers/mtd/spi/macronix.c
> index 70435eb..5a528c3 100644
> --- a/drivers/mtd/spi/macronix.c
> +++ b/drivers/mtd/spi/macronix.c
> @@ -61,6 +61,11 @@ static const struct macronix_spi_flash_params 
> macronix_spi_flash_table[] = {
> .nr_blocks = 256,
> .name = "MX25L12855E",
> },
> +   {
> +   .idcode = 0x201a,
> +   .nr_blocks = 512,
> +   .name = "MX66L51235L",
> +   },
>  };
>

Can you check the similar patch
http://patchwork.ozlabs.org/patch/262928/

Please confirm about nr_blocks?
Also have u tested with latest spi_flash code, since ur part is 64MB
must require a BAR to access entire memory.?
http://patchwork.ozlabs.org/patch/262929/

Let me know for any concerns.

--
Thanks,
Jagan.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V2] spi: mxs: Configure chipselect after block reset

2013-08-27 Thread Jagan Teki
On Tue, Aug 27, 2013 at 2:40 PM, Stefano Babic  wrote:
> On 27/08/2013 11:05, Marek Vasut wrote:
>> Dear Stefano Babic,
>>
>>> On 26/08/2013 17:45, Marek Vasut wrote:
 The chipselect must be written into the CTRL0 register after the SSP
 block is reset, otherwise the block will always use ChipSelect #0.

 Signed-off-by: Marek Vasut 
 Cc: Fabio Estevam 
 Cc: Jagannadha Sutradharudu Teki 
 Cc: Otavio Salvador 
 Cc: Stefano Babic 
 ---

  drivers/spi/mxs_spi.c |   12 +++-
  1 file changed, 3 insertions(+), 9 deletions(-)

 V2: Clean up a warning that "ssp_regs" are not used

 diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c
 index 3cf7142..2b9f395 100644
 --- a/drivers/spi/mxs_spi.c
 +++ b/drivers/spi/mxs_spi.c
 @@ -56,8 +56,6 @@ struct spi_slave *spi_setup_slave(unsigned int bus,
 unsigned int cs,

   unsigned int max_hz, unsigned int mode)

  {

 struct mxs_spi_slave *mxs_slave;

 -   struct mxs_ssp_regs *ssp_regs;
 -   int reg;

 if (!spi_cs_is_valid(bus, cs)) {

 printf("mxs_spi: invalid bus %d / chip select %d\n", bus, cs);

 @@ -74,13 +72,7 @@ struct spi_slave *spi_setup_slave(unsigned int bus,
 unsigned int cs,

 mxs_slave->max_khz = max_hz / 1000;
 mxs_slave->mode = mode;
 mxs_slave->regs = mxs_ssp_regs_by_bus(bus);

 -   ssp_regs = mxs_slave->regs;

 -   reg = readl(&ssp_regs->hw_ssp_ctrl0);
 -   reg &= ~(MXS_SSP_CHIPSELECT_MASK);
 -   reg |= cs << MXS_SSP_CHIPSELECT_SHIFT;
 -
 -   writel(reg, &ssp_regs->hw_ssp_ctrl0);

 return &mxs_slave->slave;

  err_init:
 @@ -102,7 +94,9 @@ int spi_claim_bus(struct spi_slave *slave)

 mxs_reset_block(&ssp_regs->hw_ssp_ctrl0_reg);

 -   writel(SSP_CTRL0_BUS_WIDTH_ONE_BIT, &ssp_regs->hw_ssp_ctrl0);
 +   writel((slave->cs << MXS_SSP_CHIPSELECT_SHIFT) |
 +  SSP_CTRL0_BUS_WIDTH_ONE_BIT,
 +  &ssp_regs->hw_ssp_ctrl0);

 reg = SSP_CTRL1_SSP_MODE_SPI | SSP_CTRL1_WORD_LENGTH_EIGHT_BITS;
 reg |= (mxs_slave->mode & SPI_CPOL) ? SSP_CTRL1_POLARITY : 0;
>>>
>>> Acked-by: Stefano Babic 
>>
>> Can we push this via IMX tree ?
>
> Maybe, but correctly this should be push via u-boot-spi.

Yes, I sent a comment regarding commit head msg.
Will push it on my repo once i got the response.

--
Thanks,
Jagan.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Fix problems in chip select selection in imx23, 28 spi code

2013-08-27 Thread Jagan Teki
Hi,

On Tue, Aug 27, 2013 at 4:11 AM, Asok Subramanian  wrote:
>  Fix problems in chip select selection in imx23,28 spi code
>
> The spi function code for imx23,28 currently does not work for chip select
> other than 0.
> This is because the register HW_SSP_CTRL0 is first  reset and the code does
> not load the CS bits
> again into HW_SSP_CTRL0 after the reset. The proposed fix reloads the CS
> bits after the reset.
>
> Signed-off-by: Asok Subramanian 
> ---
>  drivers/spi/mxs_spi.c |4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c
> index 3cf7142..15681dc 100644
> --- a/drivers/spi/mxs_spi.c
> +++ b/drivers/spi/mxs_spi.c
> @@ -32,6 +32,7 @@ struct mxs_spi_slave {
>  uint32_tmax_khz;
>  uint32_tmode;
>  struct mxs_ssp_regs*regs;
> +unsigned intcs;
>  };
>
>  static inline struct mxs_spi_slave *to_mxs_slave(struct spi_slave *slave)
> @@ -74,6 +75,7 @@ struct spi_slave *spi_setup_slave(unsigned int bus,
> unsigned int cs,
>  mxs_slave->max_khz = max_hz / 1000;
>  mxs_slave->mode = mode;
>  mxs_slave->regs = mxs_ssp_regs_by_bus(bus);
> +mxs_slave->cs = cs;
>  ssp_regs = mxs_slave->regs;
>
>  reg = readl(&ssp_regs->hw_ssp_ctrl0);
> @@ -102,7 +104,7 @@ int spi_claim_bus(struct spi_slave *slave)
>
>  mxs_reset_block(&ssp_regs->hw_ssp_ctrl0_reg);
>
> -writel(SSP_CTRL0_BUS_WIDTH_ONE_BIT, &ssp_regs->hw_ssp_ctrl0);
> +writel(SSP_CTRL0_BUS_WIDTH_ONE_BIT | (mxs_slave->cs) <<
> MXS_SSP_CHIPSELECT_SHIFT, &ssp_regs->hw_ssp_ctrl0);
>
>  reg = SSP_CTRL1_SSP_MODE_SPI | SSP_CTRL1_WORD_LENGTH_EIGHT_BITS;
>  reg |= (mxs_slave->mode & SPI_CPOL) ? SSP_CTRL1_POLARITY : 0;
> --
> 1.7.9.5

Please use the proper commit head.
Fix problems in chip select selection in imx23,28 spi code
spi: mxs_spi: 

--
Thanks,
Jagan.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V2] spi: mxs: Configure chipselect after block reset

2013-08-27 Thread Jagan Teki
Hi,

On Tue, Aug 27, 2013 at 2:35 PM, Marek Vasut  wrote:
> Dear Stefano Babic,
>
>> On 26/08/2013 17:45, Marek Vasut wrote:
>> > The chipselect must be written into the CTRL0 register after the SSP
>> > block is reset, otherwise the block will always use ChipSelect #0.
>> >
>> > Signed-off-by: Marek Vasut 
>> > Cc: Fabio Estevam 
>> > Cc: Jagannadha Sutradharudu Teki 
>> > Cc: Otavio Salvador 
>> > Cc: Stefano Babic 
>> > ---
>> >
>> >  drivers/spi/mxs_spi.c |   12 +++-
>> >  1 file changed, 3 insertions(+), 9 deletions(-)
>> >
>> > V2: Clean up a warning that "ssp_regs" are not used
>> >
>> > diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c
>> > index 3cf7142..2b9f395 100644
>> > --- a/drivers/spi/mxs_spi.c
>> > +++ b/drivers/spi/mxs_spi.c
>> > @@ -56,8 +56,6 @@ struct spi_slave *spi_setup_slave(unsigned int bus,
>> > unsigned int cs,
>> >
>> >   unsigned int max_hz, unsigned int mode)
>> >
>> >  {
>> >
>> > struct mxs_spi_slave *mxs_slave;
>> >
>> > -   struct mxs_ssp_regs *ssp_regs;
>> > -   int reg;
>> >
>> > if (!spi_cs_is_valid(bus, cs)) {
>> >
>> > printf("mxs_spi: invalid bus %d / chip select %d\n", bus, cs);
>> >
>> > @@ -74,13 +72,7 @@ struct spi_slave *spi_setup_slave(unsigned int bus,
>> > unsigned int cs,
>> >
>> > mxs_slave->max_khz = max_hz / 1000;
>> > mxs_slave->mode = mode;
>> > mxs_slave->regs = mxs_ssp_regs_by_bus(bus);
>> >
>> > -   ssp_regs = mxs_slave->regs;
>> >
>> > -   reg = readl(&ssp_regs->hw_ssp_ctrl0);
>> > -   reg &= ~(MXS_SSP_CHIPSELECT_MASK);
>> > -   reg |= cs << MXS_SSP_CHIPSELECT_SHIFT;
>> > -
>> > -   writel(reg, &ssp_regs->hw_ssp_ctrl0);
>> >
>> > return &mxs_slave->slave;
>> >
>> >  err_init:
>> > @@ -102,7 +94,9 @@ int spi_claim_bus(struct spi_slave *slave)
>> >
>> > mxs_reset_block(&ssp_regs->hw_ssp_ctrl0_reg);
>> >
>> > -   writel(SSP_CTRL0_BUS_WIDTH_ONE_BIT, &ssp_regs->hw_ssp_ctrl0);
>> > +   writel((slave->cs << MXS_SSP_CHIPSELECT_SHIFT) |
>> > +  SSP_CTRL0_BUS_WIDTH_ONE_BIT,
>> > +  &ssp_regs->hw_ssp_ctrl0);
>> >
>> > reg = SSP_CTRL1_SSP_MODE_SPI | SSP_CTRL1_WORD_LENGTH_EIGHT_BITS;
>> > reg |= (mxs_slave->mode & SPI_CPOL) ? SSP_CTRL1_POLARITY : 0;
>>
>> Acked-by: Stefano Babic 
>
> Can we push this via IMX tree ?

I have a simple concern about commit head msg.
spi: mxs:
spi: mxs_spi:

I preferred the second one as rest are follow the same, just for unification.
Please send the v2, if your OK. then I will push it on my tree.

--
Thanks,
Jagan.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V2] spi: mxs: Configure chipselect after block reset

2013-08-27 Thread Stefano Babic
On 27/08/2013 11:05, Marek Vasut wrote:
> Dear Stefano Babic,
> 
>> On 26/08/2013 17:45, Marek Vasut wrote:
>>> The chipselect must be written into the CTRL0 register after the SSP
>>> block is reset, otherwise the block will always use ChipSelect #0.
>>>
>>> Signed-off-by: Marek Vasut 
>>> Cc: Fabio Estevam 
>>> Cc: Jagannadha Sutradharudu Teki 
>>> Cc: Otavio Salvador 
>>> Cc: Stefano Babic 
>>> ---
>>>
>>>  drivers/spi/mxs_spi.c |   12 +++-
>>>  1 file changed, 3 insertions(+), 9 deletions(-)
>>>
>>> V2: Clean up a warning that "ssp_regs" are not used
>>>
>>> diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c
>>> index 3cf7142..2b9f395 100644
>>> --- a/drivers/spi/mxs_spi.c
>>> +++ b/drivers/spi/mxs_spi.c
>>> @@ -56,8 +56,6 @@ struct spi_slave *spi_setup_slave(unsigned int bus,
>>> unsigned int cs,
>>>
>>>   unsigned int max_hz, unsigned int mode)
>>>  
>>>  {
>>>  
>>> struct mxs_spi_slave *mxs_slave;
>>>
>>> -   struct mxs_ssp_regs *ssp_regs;
>>> -   int reg;
>>>
>>> if (!spi_cs_is_valid(bus, cs)) {
>>> 
>>> printf("mxs_spi: invalid bus %d / chip select %d\n", bus, cs);
>>>
>>> @@ -74,13 +72,7 @@ struct spi_slave *spi_setup_slave(unsigned int bus,
>>> unsigned int cs,
>>>
>>> mxs_slave->max_khz = max_hz / 1000;
>>> mxs_slave->mode = mode;
>>> mxs_slave->regs = mxs_ssp_regs_by_bus(bus);
>>>
>>> -   ssp_regs = mxs_slave->regs;
>>>
>>> -   reg = readl(&ssp_regs->hw_ssp_ctrl0);
>>> -   reg &= ~(MXS_SSP_CHIPSELECT_MASK);
>>> -   reg |= cs << MXS_SSP_CHIPSELECT_SHIFT;
>>> -
>>> -   writel(reg, &ssp_regs->hw_ssp_ctrl0);
>>>
>>> return &mxs_slave->slave;
>>>  
>>>  err_init:
>>> @@ -102,7 +94,9 @@ int spi_claim_bus(struct spi_slave *slave)
>>>
>>> mxs_reset_block(&ssp_regs->hw_ssp_ctrl0_reg);
>>>
>>> -   writel(SSP_CTRL0_BUS_WIDTH_ONE_BIT, &ssp_regs->hw_ssp_ctrl0);
>>> +   writel((slave->cs << MXS_SSP_CHIPSELECT_SHIFT) |
>>> +  SSP_CTRL0_BUS_WIDTH_ONE_BIT,
>>> +  &ssp_regs->hw_ssp_ctrl0);
>>>
>>> reg = SSP_CTRL1_SSP_MODE_SPI | SSP_CTRL1_WORD_LENGTH_EIGHT_BITS;
>>> reg |= (mxs_slave->mode & SPI_CPOL) ? SSP_CTRL1_POLARITY : 0;
>>
>> Acked-by: Stefano Babic 
> 
> Can we push this via IMX tree ?

Maybe, but correctly this should be push via u-boot-spi.

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V2] spi: mxs: Configure chipselect after block reset

2013-08-27 Thread Marek Vasut
Dear Stefano Babic,

> On 26/08/2013 17:45, Marek Vasut wrote:
> > The chipselect must be written into the CTRL0 register after the SSP
> > block is reset, otherwise the block will always use ChipSelect #0.
> > 
> > Signed-off-by: Marek Vasut 
> > Cc: Fabio Estevam 
> > Cc: Jagannadha Sutradharudu Teki 
> > Cc: Otavio Salvador 
> > Cc: Stefano Babic 
> > ---
> > 
> >  drivers/spi/mxs_spi.c |   12 +++-
> >  1 file changed, 3 insertions(+), 9 deletions(-)
> > 
> > V2: Clean up a warning that "ssp_regs" are not used
> > 
> > diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c
> > index 3cf7142..2b9f395 100644
> > --- a/drivers/spi/mxs_spi.c
> > +++ b/drivers/spi/mxs_spi.c
> > @@ -56,8 +56,6 @@ struct spi_slave *spi_setup_slave(unsigned int bus,
> > unsigned int cs,
> > 
> >   unsigned int max_hz, unsigned int mode)
> >  
> >  {
> >  
> > struct mxs_spi_slave *mxs_slave;
> > 
> > -   struct mxs_ssp_regs *ssp_regs;
> > -   int reg;
> > 
> > if (!spi_cs_is_valid(bus, cs)) {
> > 
> > printf("mxs_spi: invalid bus %d / chip select %d\n", bus, cs);
> > 
> > @@ -74,13 +72,7 @@ struct spi_slave *spi_setup_slave(unsigned int bus,
> > unsigned int cs,
> > 
> > mxs_slave->max_khz = max_hz / 1000;
> > mxs_slave->mode = mode;
> > mxs_slave->regs = mxs_ssp_regs_by_bus(bus);
> > 
> > -   ssp_regs = mxs_slave->regs;
> > 
> > -   reg = readl(&ssp_regs->hw_ssp_ctrl0);
> > -   reg &= ~(MXS_SSP_CHIPSELECT_MASK);
> > -   reg |= cs << MXS_SSP_CHIPSELECT_SHIFT;
> > -
> > -   writel(reg, &ssp_regs->hw_ssp_ctrl0);
> > 
> > return &mxs_slave->slave;
> >  
> >  err_init:
> > @@ -102,7 +94,9 @@ int spi_claim_bus(struct spi_slave *slave)
> > 
> > mxs_reset_block(&ssp_regs->hw_ssp_ctrl0_reg);
> > 
> > -   writel(SSP_CTRL0_BUS_WIDTH_ONE_BIT, &ssp_regs->hw_ssp_ctrl0);
> > +   writel((slave->cs << MXS_SSP_CHIPSELECT_SHIFT) |
> > +  SSP_CTRL0_BUS_WIDTH_ONE_BIT,
> > +  &ssp_regs->hw_ssp_ctrl0);
> > 
> > reg = SSP_CTRL1_SSP_MODE_SPI | SSP_CTRL1_WORD_LENGTH_EIGHT_BITS;
> > reg |= (mxs_slave->mode & SPI_CPOL) ? SSP_CTRL1_POLARITY : 0;
> 
> Acked-by: Stefano Babic 

Can we push this via IMX tree ?

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot