Re: [U-Boot] [PATCH v2] mx35 iomux: correct offsets of IOMUX registers

2013-04-09 Thread Stefano Babic
On 10/04/2013 00:44, Philip Paeps wrote:
> This makes mxc_iomux_set_input() work correctly.  Previously, the
> incorrect offset of IOMUXSW_INPUT_CTL caused mxc_iomux_set_input()
> to write to the wrong register, possibly resulting in unexpected
> behaviour.
> 
> Signed-off-by: Philip Paeps 
> ---

Hi Philip,

> Changes in v2:
>  - While here, also correct the offset of the last pad control
>register.  This is mostly cosmetic.
> 
>  arch/arm/cpu/arm1136/mx35/iomux.c |4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/cpu/arm1136/mx35/iomux.c 
> b/arch/arm/cpu/arm1136/mx35/iomux.c
> index a302575..698909e 100644
> --- a/arch/arm/cpu/arm1136/mx35/iomux.c
> +++ b/arch/arm/cpu/arm1136/mx35/iomux.c
> @@ -34,8 +34,8 @@ enum iomux_reg_addr {
>   IOMUXSW_MUX_CTL = IOMUXC_BASE_ADDR + 4, /* MUX control */
>   IOMUXSW_MUX_END = IOMUXC_BASE_ADDR + 0x324, /* last MUX control */
>   IOMUXSW_PAD_CTL = IOMUXC_BASE_ADDR + 0x328, /* Pad control */
> - IOMUXSW_PAD_END = IOMUXC_BASE_ADDR + 0x794, /* last Pad control */
> - IOMUXSW_INPUT_CTL = IOMUXC_BASE_ADDR + 0x7AC,   /* input select */
> + IOMUXSW_PAD_END = IOMUXC_BASE_ADDR + 0x7A4, /* last Pad control */
> + IOMUXSW_INPUT_CTL = IOMUXC_BASE_ADDR + 0x7A8,   /* input select */
>   IOMUXSW_INPUT_END = IOMUXC_BASE_ADDR + 0x9F4,   /* last input select */
>  };

You're right, offset were wrong.

Acked-by: Stefano Babic 

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] mx31pdk: Remove watchdog support

2013-04-09 Thread Stefano Babic
On 09/04/2013 21:03, Fabio Estevam wrote:
> The conversion of mx31pdk to SPL NAND fixed the boot issue, but we start 
> seeing 
> resets in loop, which prevents us from reaching the U-boot prompt.
> 
> Until the proper fix can be identified, disable watchdog, so that mx31pdk
> can be functional again.
> 
> Signed-off-by: Fabio Estevam 
> ---

Hi Fabio,

>  include/configs/mx31pdk.h |2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/include/configs/mx31pdk.h b/include/configs/mx31pdk.h
> index 34e4295..da894c4 100644
> --- a/include/configs/mx31pdk.h
> +++ b/include/configs/mx31pdk.h
> @@ -60,8 +60,6 @@
>  
>  #define CONFIG_MXC_UART
>  #define CONFIG_MXC_UART_BASE UART1_BASE
> -#define CONFIG_HW_WATCHDOG
> -#define CONFIG_IMX_WATCHDOG
>  #define CONFIG_MXC_GPIO
>  
>  #define CONFIG_HARD_SPI
> 

Benoit's patchset will flow into the release - then this one should also
be merged.

Acked-by: Stefano Babic 

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 V8 4/9] EXYNOS5: DWMMC: Added FDT support for DWMMC

2013-04-09 Thread Amarendra Reddy
Hi Jaehoon,

Please find my responses below.

Thanks & Regards
Amarendra Reddy

On 9 April 2013 16:23, Jaehoon Chung  wrote:

> On 04/03/2013 11:08 PM, Amar wrote:
> > This patch adds FDT support for DWMMC, by reading the DWMMC node data
> > from the device tree and initialising DWMMC channels as per data
> > obtained from the node.
> >
> > Signed-off-by: Vivek Gautam 
> > Signed-off-by: Amar 
> > Acked-by: Simon Glass 
> > ---
> > Changes since V1:
> >   1)Updated code to have same signature for the function
> >   exynos_dwmci_init() for both FDT and non-FDT versions.
> >   2)Updated code to pass device_id parameter to the function
> >   exynos5_mmc_set_clk_div() instead of index.
> >   3)Updated code to decode the value of "samsung,width" from FDT.
> >   4)Channel index is computed instead of getting from FDT.
> >
> > Changes since V2:
> >   1)Updation of commit message and resubmition of proper patch set.
> >
> > Changes since V3:
> >   1)Replaced the new function exynos5_mmc_set_clk_div() with the
> >   existing function set_mmc_clk(). set_mmc_clk() will do the purpose.
> >   2)Computation of FSYS block clock divisor (pre-ratio) is added.
> >
> > Changes since V4:
> >   1)Replaced "unsigned int exynos_dwmmc_init(int index, int
> bus_width)" with
> >   int exynos_dwmci_add_port(int, u32, inth, u32)
> >   i)exynos_dwmmc_add_port() will be used by non-FDT boards.
> >   ii)In FDT case, exynos_dwmmc_init(const void *blob) will
> use
> >   exynos_dwmmc_add_port() for every channel enabled in
> device node.
> >   2)Changed the computation method of mmc clock divisor.
> >   3)Updated exynos_dwmmc_init() to compute the 'clksel_val' within
> the function.
> >
> > Changes since V5:
> >   1)Updated in response to review comments and changed the mmc clock
> value
> >   from 50MHz to 52MHz.
> >
> > Changes since V6:
> >   No change.
> >
> > Changes since V7:
> >   No change.
> >
> >  arch/arm/include/asm/arch-exynos/dwmmc.h |  11 +--
> >  drivers/mmc/exynos_dw_mmc.c  | 127
> ---
> >  include/dwmmc.h  |   3 +
> >  3 files changed, 124 insertions(+), 17 deletions(-)
> >
> > diff --git a/arch/arm/include/asm/arch-exynos/dwmmc.h
> b/arch/arm/include/asm/arch-exynos/dwmmc.h
> > index 8acdf9b..3b147b8 100644
> > --- a/arch/arm/include/asm/arch-exynos/dwmmc.h
> > +++ b/arch/arm/include/asm/arch-exynos/dwmmc.h
> > @@ -27,10 +27,7 @@
> >  #define DWMCI_SET_DRV_CLK(x) ((x) << 16)
> >  #define DWMCI_SET_DIV_RATIO(x)   ((x) << 24)
> >
> > -int exynos_dwmci_init(u32 regbase, int bus_width, int index);
> > -
> > -static inline unsigned int exynos_dwmmc_init(int index, int bus_width)
> > -{
> > - unsigned int base = samsung_get_base_mmc() + (0x1 * index);
> > - return exynos_dwmci_init(base, bus_width, index);
> > -}
> > +#ifdef CONFIG_OF_CONTROL
> > +int exynos_dwmmc_init(const void *blob);
> > +#endif
> > +int exynos_dwmci_add_port(int index, u32 regbase, int bus_width, u32
> clksel);
> > diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c
> > index 72a31b7..4238dd9 100644
> > --- a/drivers/mmc/exynos_dw_mmc.c
> > +++ b/drivers/mmc/exynos_dw_mmc.c
> > @@ -19,39 +19,146 @@
> >   */
> >
> >  #include 
> > -#include 
> >  #include 
> > +#include 
> > +#include 
> > +#include 
> >  #include 
> >  #include 
> > +#include 
> >
> > -static char *EXYNOS_NAME = "EXYNOS DWMMC";
> > +#define  DWMMC_MAX_CH_NUM4
> > +#define  DWMMC_MAX_FREQ  5200
> > +#define  DWMMC_MIN_FREQ  40
> > +#define  DWMMC_MMC0_CLKSEL_VAL   0x03030001
> > +#define  DWMMC_MMC2_CLKSEL_VAL   0x03020001
> I known that CLKSEL's value is SoC specific.
> All exynos series are working fine? I didn't think so.
>
> Best Regards,
> Jaehoon Chung
>

The above values of CLKSEL work fine for Exynos5 (5250 & 5410) and is
tested.

The above CLKSEL values donot hold good for Exynos4 series. Exynos4 has
"Mobile Storage Host" with only one port.
But this file 'drivers/mmc/exynos_dw_mmc.c' is specific to Exynos5 series
and gets compiled only when CONFIG_EXYNOS_DWMMC is defined.

>
> > +/*
> > + * Function used as callback function to initialise the
> > + * CLKSEL register for every mmc channel.
> > + */
> >  static void exynos_dwmci_clksel(struct dwmci_host *host)
> >  {
> > - u32 val;
> > - val = DWMCI_SET_SAMPLE_CLK(DWMCI_SHIFT_0) |
> > - DWMCI_SET_DRV_CLK(DWMCI_SHIFT_0) | DWMCI_SET_DIV_RATIO(0);
> > + dwmci_writel(host, DWMCI_CLKSEL, host->clksel_val);
> > +}
> >
> > - dwmci_writel(host, DWMCI_CLKSEL, val);
> > +unsigned int exynos_dwmci_get_clk(int dev_index)
> > +{
> > + return get_mmc_clk(dev_index);
> >  }
> >
> > -int exynos_dwmci_init(u32 regbase, int bus_width, int index)
> > +/*
> > + * This function adds the mmc channel to be registered with mmc cor

Re: [U-Boot] [PATCH v2] spi: mxc_spi: Set master mode for all channels

2013-04-09 Thread Stefano Babic
On 10/04/2013 01:06, Fabio Estevam wrote:
> From: Fabio Estevam 
> 
> The glitch in the SPI clock line, which commit 3cea335c34 (spi: mxc_spi: Fix 
> spi
> clock glitch durant reset) solved, is back now and itwas re-introduced by 
> commit d36b39bf0d (spi: mxc_spi: Fix ECSPI reset handling).
> 
> Actually the glitch is happening due to always toggling between slave mode
> and master mode by configuring the CHANNEL_MODE bits in this reset function.
> 
> Since the spi driver only supports master mode, set the mode for all channels 
> always to master mode in order to have a stable, "glitch-free" SPI clock line.
> 
> Signed-off-by: Fabio Estevam 
> ---

Hi Fabio,


> Changes since v1:
> - Introduce MXC_CSPICTRL_MODE_MASK definition
> - Remove additional read of reg_ctrl
> 
>  arch/arm/include/asm/arch-mx5/imx-regs.h |1 +
>  arch/arm/include/asm/arch-mx6/imx-regs.h |1 +
>  drivers/spi/mxc_spi.c|   17 +
>  3 files changed, 11 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/arm/include/asm/arch-mx5/imx-regs.h 
> b/arch/arm/include/asm/arch-mx5/imx-regs.h
> index 249d15a..a71cc13 100644
> --- a/arch/arm/include/asm/arch-mx5/imx-regs.h
> +++ b/arch/arm/include/asm/arch-mx5/imx-regs.h
> @@ -230,6 +230,7 @@
>  #define MXC_CSPICTRL_EN  (1 << 0)
>  #define MXC_CSPICTRL_MODE(1 << 1)
>  #define MXC_CSPICTRL_XCH (1 << 2)
> +#define MXC_CSPICTRL_MODE_MASK   (0xf << 4)
>  #define MXC_CSPICTRL_CHIPSELECT(x)   (((x) & 0x3) << 12)
>  #define MXC_CSPICTRL_BITCOUNT(x) (((x) & 0xfff) << 20)
>  #define MXC_CSPICTRL_PREDIV(x)   (((x) & 0xF) << 12)
> diff --git a/arch/arm/include/asm/arch-mx6/imx-regs.h 
> b/arch/arm/include/asm/arch-mx6/imx-regs.h
> index eaa7439..d79ab2f 100644
> --- a/arch/arm/include/asm/arch-mx6/imx-regs.h
> +++ b/arch/arm/include/asm/arch-mx6/imx-regs.h
> @@ -346,6 +346,7 @@ struct cspi_regs {
>  #define MXC_CSPICTRL_EN  (1 << 0)
>  #define MXC_CSPICTRL_MODE(1 << 1)
>  #define MXC_CSPICTRL_XCH (1 << 2)
> +#define MXC_CSPICTRL_MODE_MASK (0xf << 4)
>  #define MXC_CSPICTRL_CHIPSELECT(x)   (((x) & 0x3) << 12)
>  #define MXC_CSPICTRL_BITCOUNT(x) (((x) & 0xfff) << 20)
>  #define MXC_CSPICTRL_PREDIV(x)   (((x) & 0xF) << 12)
> diff --git a/drivers/spi/mxc_spi.c b/drivers/spi/mxc_spi.c
> index 4c19e0b..20419e6 100644
> --- a/drivers/spi/mxc_spi.c
> +++ b/drivers/spi/mxc_spi.c
> @@ -137,11 +137,15 @@ static s32 spi_cfg_mxc(struct mxc_spi_slave *mxcs, 
> unsigned int cs,
>   return -1;
>   }
>  
> - /* Reset spi */
> - reg_write(®s->ctrl, 0);
> - reg_write(®s->ctrl, MXC_CSPICTRL_EN);
> -
> - reg_ctrl = reg_read(®s->ctrl);
> + /*
> +  * Reset SPI and set all CSs to master mode, if toggling
> +  * between slave and master mode we might see a glitch
> +  * on the clock line
> +  */
> + reg_ctrl = MXC_CSPICTRL_MODE_MASK;
> + reg_write(®s->ctrl, reg_ctrl);
> + reg_ctrl |=  MXC_CSPICTRL_EN;
> + reg_write(®s->ctrl, reg_ctrl);

I am afraid you are breaking MX3x / MX25 because you add
MXC_CSPICTRL_MODE_MASK only to MX5 / MX6.

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] zmodem ?

2013-04-09 Thread Stefano Babic
On 09/04/2013 21:06, Brad Walker wrote:
> I am curious to know about the status of support for zmodem.
> 
> I've looked through the mail archives and it seems as though ymodem is
> supported. But, zmodem is currently not.
> 
> Also, there is a kermit mode that is supported.
> 
> Is my understanding correct?

Yes, it is

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 3/3] mx6sl: Add initial support for mx6slevk board

2013-04-09 Thread Stefano Babic
On 06/04/2013 18:40, Fabio Estevam wrote:
> Hi Dirk,
> 
> On Sat, Apr 6, 2013 at 1:30 PM, Dirk Behme  wrote:
> 
>> ... but saving power over the whole (kernel) runtime. I might be wrong, but
>> to my understanding the kernel doesn't *disable* unneeded clocks?
>>
>> So it's up to the bootloader to enable only the peripherals (clocks) really
>> needed for booting. And then it's up to the kernel's driver init functions
>> to enable the needed clocks for the subsystem once it's needed.
>>
>> But as I won't use this board I won't care about the power consumption here.
>> If you think it's fine for the use cases of this board to enable all clocks
>> by default, then this shouldn't stop applying this patch.
> 
> Ok, understood. I will go through each one of the CCM registers and
> check what clocks can be turned off.
> 
> This may take some time though as it needs proper testing.
> 
> I suggest that we keep the current clock settings as is, so that the
> board support can reach U-boot, then later I can submit a patch for
> turning off the unneeded clocks.

+1

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


[U-Boot] which version of uboot support ARM A7

2013-04-09 Thread Li, Hai
Hi all,

Does anybody know which version of uboot support ARM A7? And where I can get 
the ARM A7 patch for 
u-boot-2013.04-rc2.tar.bz2?
 Thanks!

Best Wishes
Hai Li

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


Re: [U-Boot] [PATCH 1/5][v2] powerpc/mpc85xx:No NOR boot, do not compile IFC errata A003399

2013-04-09 Thread Prabhakar Kushwaha

On 04/10/2013 05:11 AM, Scott Wood wrote:

On 04/08/2013 11:56:25 PM, Prabhakar Kushwaha wrote:

On 04/09/2013 06:09 AM, Scott Wood wrote:

On 04/05/2013 09:28:14 PM, Prabhakar Kushwaha wrote:

On 04/06/2013 02:03 AM, Scott Wood wrote:

On 03/22/2013 02:07:48 AM, Prabhakar Kushwaha wrote:
IFC errata A003399 is valid for IFC NOR boot i.e.if no on-board 
NOR flash or

no NOR boot, do not compile its workaround.

Signed-off-by: Prabhakar Kushwaha 
---
 Based upon git://git.denx.de/u-boot.git branch master
 Changes for v2:
 - Add CONFIG_A003399_NOR_WORKAROUND for errata workaround
- Add CONFIG_A003399_NOR_WORKAROUND in README

 README|4 
 arch/powerpc/cpu/mpc85xx/cpu_init_early.c |9 ++---
 arch/powerpc/cpu/mpc8xxx/fsl_ifc.c|2 +-
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/README b/README
index 7f2506a..c4ad69d 100644
--- a/README
+++ b/README
@@ -414,6 +414,10 @@ The following options need to be configured:
 See Freescale App Note 4493 for more information about
 this erratum.

+CONFIG_A003399_NOR_WORKAROUND
+Enables a workaround for IFC erratum A003399. It is only
+requred during NOR boot.
+
 CONFIG_SYS_FSL_CORENET_SNOOPVEC_COREONLY

 This is the value to write into CCSR offset 0x18600
diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init_early.c 
b/arch/powerpc/cpu/mpc85xx/cpu_init_early.c

index dacfdd1..3a4bfc5 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
@@ -25,7 +25,8 @@

 DECLARE_GLOBAL_DATA_PTR;

-#if defined(CONFIG_SYS_FSL_ERRATUM_IFC_A003399) && 
!defined(CONFIG_SYS_RAMBOOT)

+#if defined(CONFIG_SYS_FSL_ERRATUM_IFC_A003399)\
+&& defined(CONFIG_A003399_NOR_WORKAROUND)


Why would CONFIG_A003399_NOR_WORKAROUND be enabled if 
CONFIG_SYS_FSL_ERRATUM_IFC_A003399 isn't?



originally i tried the same but it did not work. As P1010RDB.h does 
not include config_mpc85xx.h.   Only arch/powerpc/cpu/mpc85xx/*.c 
files includes both P1010RDB.h and config_mpc85xx.h


Can you add #include  in P1010RDB.h near the top, but 
after the symbols that config_mpc85xx.h depends on (which I think is 
just CONFIG_P1010)?

I need to add config_mpc85xx.h here.

 #define CONFIG_MPC85xx
 #define CONFIG_FSL_IFC /* Enable IFC Support */
 #define CONFIG_SYS_HAS_SERDES  /* common SERDES init code */
+#include "../../arch/powerpc/include/asm/config_mpc85xx.h"

I tried just after CONFIG_P1010 but it is giving compilation error.


What error?



make[1]: Entering directory 
`/home/b32579/Workspace/MERGE/OPENSRC/U-BOOT/u-boot'
/opt/freescale/usr/local/gcc-4.5.55-eglibc-2.11.55/powerpc-linux-gnu/bin/powerpc-linux-gnu-gcc 
-DDO_DEPS_ONLY \
-g  -Os   -fpic -mrelocatable -ffunction-sections 
-fdata-sections -meabi -D__KERNEL__ -DCONFIG_SYS_TEXT_BASE=0x1100 
-I/home/b32579/Workspace/MERGE/OPENSRC/U-BOOT/u-boot/include 
-fno-builtin -ffreestanding -nostdinc -isystem 
/opt/freescale/usr/local/gcc-4.5.55-eglibc-2.11.55/powerpc-linux-gnu/lib/gcc/powerpc-linux-gnu/4.5.1/include 
-pipe  -DCONFIG_PPC -D__powerpc__ -ffixed-r2 -Wa,-me500 -msoft-float 
-mno-string  -mno-spe -Wall -Wstrict-prototypes -fno-stack-protector 
-Wno-format-nonliteral -Wno-format-security\

-o lib/asm-offsets.s lib/asm-offsets.c -c -S
In file included from 
/home/b32579/Workspace/MERGE/OPENSRC/U-BOOT/u-boot/include/common.h:174:0,

 from lib/asm-offsets.c:18:
/home/b32579/Workspace/MERGE/OPENSRC/U-BOOT/u-boot/include/asm/global_data.h:98:21: 
error: 'CONFIG_SYS_NUM_TLBCAMS' undeclared here (not in a function)

make[1]: *** [lib/asm-offsets.s] Error 1

because of these defines in config_mpc85xx.h
#if defined(CONFIG_E500MC)
#define CONFIG_SYS_NUM_TLBCAMS64
#elif defined(CONFIG_E500)
#define CONFIG_SYS_NUM_TLBCAMS16
#endif



Just to mention, I need to provide relative path in order to compile.


What specifically did you try and what error did it produce?


I did not try anything.
I was just doubting on having relative path.
is it acceptable or not?  As we are moving from dynamic header 
inclusions to more fixed inclusion.




I will still suggest to keep original patch, As header file location 
may change over period of time then config file needs to be updated 
again.


No, this has been a repeated problem (not having access to 
config_mpc85xx.h in the board config file) and I'd like to see it fixed 

oh.. I was not aware of this point.

Regards,
Prabhakar



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


[U-Boot] DWMMC / DWMCI question

2013-04-09 Thread TigerLiu
Hi, experts:
What is the abbreviation of DWMMC / DWMCI?
I could not google any doc introducing them!
Are they the new types of EMMC device?

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


Re: [U-Boot] [PATCH v2 3/4] smdk5250, snow: fix CONFIG_SPL_MAX_SIZE semantics

2013-04-09 Thread Minkyu Kang
On 10/04/13 08:14, Albert ARIBAUD wrote:
> CONFIG_SPL_MAX_SIZE wrongly included BSS size.
> Split 14K max size between 10K image (text,rodata,data)
> and 4K BSS based on sizes reported for current build:
> 
>text  data bss
>4136   904   0
> 
> Signed-off-by: Albert ARIBAUD 
> ---
> Changes in v2:
> - fixed spacing in commit summary
> 
>  board/samsung/smdk5250/smdk5250-uboot-spl.lds |2 +-
>  include/configs/exynos5250-dt.h   |3 ++-
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/board/samsung/smdk5250/smdk5250-uboot-spl.lds 
> b/board/samsung/smdk5250/smdk5250-uboot-spl.lds
> index 4c8baaa..208e626 100644
> --- a/board/samsung/smdk5250/smdk5250-uboot-spl.lds
> +++ b/board/samsung/smdk5250/smdk5250-uboot-spl.lds
> @@ -26,7 +26,7 @@
>   */
>  
>  MEMORY { .sram : ORIGIN = CONFIG_SPL_TEXT_BASE, \
> - LENGTH = CONFIG_SPL_MAX_SIZE }
> + LENGTH = (CONFIG_SPL_MAX_SIZE + CONFIG_SPL_BSS_MAX_SIZE) }
>  
>  OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
>  OUTPUT_ARCH(arm)
> diff --git a/include/configs/exynos5250-dt.h b/include/configs/exynos5250-dt.h
> index 496a194..372b0b4 100644
> --- a/include/configs/exynos5250-dt.h
> +++ b/include/configs/exynos5250-dt.h
> @@ -141,7 +141,8 @@
>  /* specific .lds file */
>  #define CONFIG_SPL_LDSCRIPT  "board/samsung/smdk5250/smdk5250-uboot-spl.lds"
>  #define CONFIG_SPL_TEXT_BASE 0x02023400
> -#define CONFIG_SPL_MAX_SIZE  (14 * 1024)
> +#define CONFIG_SPL_MAX_SIZE  (10 * 1024)
> +#define CONFIG_SPL_BSS_MAX_SIZE  (4 * 1024)
>  
>  #define CONFIG_BOOTCOMMAND   "mmc read 40007000 451 2000; bootm 40007000"
>  
> 

Acked-by: Minkyu Kang 

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


Re: [U-Boot] bootm does not work if netconsole is enabled

2013-04-09 Thread Joe Hershberger
Hi Michael,

I just tested this on my Zynq target and it worked.  However, you make
a good point that it is possible for there to be more traces after the
eth_halt call.  I can't imagine the stack would like that in all
situations (since eth_init() will not be called again by netconsole).
I think the solution to this is probably to disable netconsole somehow
before the eth_halt command, so subsequent prints do not try to use
Ethernet again.  However, most of the things you might switch to are
conditional, such as a nulldev or silent.  Any thoughts on how you
would like to see it solved?

Cheers,
-Joe


On Tue, Apr 9, 2013 at 5:21 PM, Michael Walle  wrote:
>
> Hi Joe, Hi Tom,
>
> If i have the netconsole enabled i cannot boot linux using the bootm command.
> This bug exists at least in 2013.01.01 and 2013.04-rc2 :/
>
>
> Here is the output of the serial console of a successful startup:
>
> ## Booting kernel from Legacy Image at 0010 ...
>Image Name:   Linux-3.8.0-rc1-4-g270c0a0-d
>Image Type:   ARM Linux Kernel Image (uncompressed)
>Data Size:2799632 Bytes = 2.7 MiB
>Load Address: 8000
>Entry Point:  8000
>Verifying Checksum ... OK
> ## Loading init Ramdisk from Legacy Image at 0080 ...
>Image Name:
>Image Type:   ARM Linux RAMDisk Image (uncompressed)
>Data Size:636966 Bytes = 622 KiB
>Load Address: 
>Entry Point:  
>Verifying Checksum ... OK
> ## Flattened Device Tree blob at 0070
>Booting using the fdt blob at 0x0070
>Loading Kernel Image ... OK
> OK
>Loading Ramdisk to 03aad000, end 03b48826 ... OK
>Loading Device Tree to 03aa8000, end 03aacedd ... OK
>
> Starting kernel ...
>
> [.. more linux kernel output ..]
>
>
> If the netconsole is enabled, eg. "stdin = stdout = stderr = nc", i see only
> the following output on the netconsole and then nothing more happens:
>
> ## Booting kernel from Legacy Image at 0010 ...
>Image Name:   Linux-3.8.0-rc1-4-g270c0a0-d
>Image Type:   ARM Linux Kernel Image (uncompressed)
>Data Size:2799632 Bytes = 2.7 MiB
>Load Address: 8000
>Entry Point:  8000
>Verifying Checksum ... OK
> ## Loading init Ramdisk from Legacy Image at 0080 ...
>Image Name:
>Image Type:   ARM Linux RAMDisk Image (uncompressed)
>Data Size:636966 Bytes = 622 KiB
>Load Address: 
>Entry Point:  
>Verifying Checksum ... OK
> ## Flattened Device Tree blob at 0070
>Booting using the fdt blob at 0x0070
>
>
> I've tracked this down to the eth_halt() call in cmd_bootm.c:647. What is the
> purpose of this call? I guess the NIC should be shut down prior to booting
> linux. OTOH, there are still messages printed after this call, and i suppose
> the netconsole tries to bring the network back up. If i remove this call,
> everything works as expected.
> Anyway, i can definitely say, that the linux kernel is not starting. Eg. it is
> not only the output that stops working.
>
> FYI, i'm using the mvgbe driver.
>
> Let me know if i can do some more debugging or provide more information.
> Hopefully this will be fixed in 2013.04 :)
>
> --
> Michael
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [v3] command/cache: Add flush command

2013-04-09 Thread Scott Wood

On 04/09/2013 12:45:31 PM, Wolfgang Denk wrote:

Dear Scott,

In message <1365449512.28843.10@snotra> you wrote:
> I think the terminology is just fine.  It's not just invalidating  
the

> icache (flushing and invalidating are the same thing for cache lines
> which are not modified -- or are incapable of being modified).  It's
> flushing the region out of *all* caches.

There is a well-defined difference between flushing and invalidating a
cache, and I don't intend to go into hair-splitting mode here just to
follow your path which would lead me to where I d not want to go.


If that means you have some other reason for objecting that you *do*  
want to go into, could you elaborate?


I do agree that flush is not a good name for what we do on the data  
side for PPC, given that we use dcbst and not dcbf.



> > See above.  In such a case "icache" and "dcache" can just call the
> > same underlying code.
>
> And then we end up having to do the flush twice, if the user follows
> the "first flush dcache, then flush icache" instructions.  That's  
not

> an ideal interface.

OK, this is indeed a good argument.  But is this really the case?
When looking at the current code of flash_cache() for PPC, it seems
actually easy to split:

 28 void flush_cache(ulong start_addr, ulong size)
 29 {
 30 #ifndef CONFIG_5xx
 31 ulong addr, start, end;
 32
 33 start = start_addr & ~(CONFIG_SYS_CACHELINE_SIZE - 1);
 34 end = start_addr + size - 1;
 35
 36 for (addr = start; (addr <= end) && (addr >= start);
 37 addr += CONFIG_SYS_CACHELINE_SIZE) {
 38 asm volatile("dcbst 0,%0" : : "r" (addr) :  
"memory");

 39 WATCHDOG_RESET();
 40 }
 41 /* wait for all dcbst to complete on bus */
 42 asm volatile("sync" : : : "memory");
 43
 44 for (addr = start; (addr <= end) && (addr >= start);
 45 addr += CONFIG_SYS_CACHELINE_SIZE) {
 46 asm volatile("icbi 0,%0" : : "r" (addr) :  
"memory");

 47 WATCHDOG_RESET();
 48 }
 49 asm volatile("sync" : : : "memory");
 50 /* flush prefetch queue */
 51 asm volatile("isync" : : : "memory");
 52 #endif
 53 }

would go into the "icache" command.
Lines 36..42 would go into the "dcache" command, while lines 44..51

So far this code appears to work fine.  What am I missing?


This is just one implementation of flush_cache().  Here are all of them:

arch/sparc/lib/cache.c:void flush_cache(ulong start_addr, ulong size)
arch/openrisc/cpu/cache.c:void flush_cache(unsigned long addr, unsigned  
long size)

arch/powerpc/lib/cache.c:void flush_cache(ulong start_addr, ulong size)
arch/nds32/lib/cache.c:void flush_cache(unsigned long addr, unsigned  
long size)

arch/m68k/lib/cache.c:void flush_cache(ulong start_addr, ulong size)
arch/sh/cpu/sh4/cpu.c:void flush_cache (unsigned long addr, unsigned  
long size)
arch/sh/cpu/sh2/cpu.c:void flush_cache(unsigned long addr, unsigned  
long size)
arch/sh/cpu/sh3/cpu.c:void flush_cache(unsigned long addr, unsigned  
long size)

arch/microblaze/cpu/cache.c:void flush_cache (ulong addr, ulong size)
arch/arm/cpu/arm1136/cpu.c:void flush_cache(unsigned long start,  
unsigned long size)
arch/arm/cpu/arm1136/cpu.c:void flush_cache(unsigned long start,  
unsigned long size)
arch/arm/cpu/arm926ejs/cache.c:void flush_cache(unsigned long start,  
unsigned long size)
arch/arm/cpu/arm926ejs/cache.c:void flush_cache(unsigned long start,  
unsigned long size)
arch/blackfin/lib/cache.c:void flush_cache(unsigned long addr, unsigned  
long size)
arch/mips/cpu/mips64/cpu.c:void flush_cache(ulong start_addr, ulong  
size)
arch/mips/cpu/mips32/cpu.c:void flush_cache(ulong start_addr, ulong  
size)
arch/mips/cpu/xburst/cpu.c:void flush_cache(ulong start_addr, ulong  
size)


This is what we're trying to expose as a command.  If you want it split  
into icache and dcache, it needs to be rewritten for every architecture  
(or else we'd need to limit the command to only running on certain  
architectures), and not all of them are as easily splittable.  What is  
the actual need for splitting it?  The semantics we're trying to expose  
as a command are the same as this function is meant to implement,  
regardless of the choice of name.  Those semantics are "make the data  
we just wrote to this range visible to instruction fetches".


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


[U-Boot] [PATCH] Do not call board_early_init_f() twice

2013-04-09 Thread Vadim Bendebury
Apparently due to a missed rebase conflict resolution
board_early_init_f() is included twice in the list of initialization
functions.

Leave only the first occurrence.
   . built and boot an Exynos 5250 target

Signed-off-by: Vadim Bendebury 
---
 common/board_f.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/common/board_f.c b/common/board_f.c
index 29b49c3..7698891 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -788,9 +788,6 @@ static init_fnc_t init_sequence_f[] = {
/* TODO: can we rename this to timer_init()? */
init_timebase,
 #endif
-#if defined(CONFIG_BOARD_EARLY_INIT_F)
-   board_early_init_f,
-#endif
 #ifdef CONFIG_ARM
timer_init, /* initialize timer */
 #endif
-- 
1.8.1.3

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


Re: [U-Boot] [PATCH 1/5][v2] powerpc/mpc85xx:No NOR boot, do not compile IFC errata A003399

2013-04-09 Thread Scott Wood

On 04/08/2013 11:56:25 PM, Prabhakar Kushwaha wrote:

On 04/09/2013 06:09 AM, Scott Wood wrote:

On 04/05/2013 09:28:14 PM, Prabhakar Kushwaha wrote:

On 04/06/2013 02:03 AM, Scott Wood wrote:

On 03/22/2013 02:07:48 AM, Prabhakar Kushwaha wrote:
IFC errata A003399 is valid for IFC NOR boot i.e.if no on-board  
NOR flash or

no NOR boot, do not compile its workaround.

Signed-off-by: Prabhakar Kushwaha 
---
 Based upon git://git.denx.de/u-boot.git branch master
 Changes for v2:
 - Add CONFIG_A003399_NOR_WORKAROUND for errata workaround
- Add CONFIG_A003399_NOR_WORKAROUND in README

 README|4 
 arch/powerpc/cpu/mpc85xx/cpu_init_early.c |9 ++---
 arch/powerpc/cpu/mpc8xxx/fsl_ifc.c|2 +-
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/README b/README
index 7f2506a..c4ad69d 100644
--- a/README
+++ b/README
@@ -414,6 +414,10 @@ The following options need to be configured:
 See Freescale App Note 4493 for more information about
 this erratum.

+CONFIG_A003399_NOR_WORKAROUND
+Enables a workaround for IFC erratum A003399. It is only
+requred during NOR boot.
+
 CONFIG_SYS_FSL_CORENET_SNOOPVEC_COREONLY

 This is the value to write into CCSR offset 0x18600
diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init_early.c  
b/arch/powerpc/cpu/mpc85xx/cpu_init_early.c

index dacfdd1..3a4bfc5 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
@@ -25,7 +25,8 @@

 DECLARE_GLOBAL_DATA_PTR;

-#if defined(CONFIG_SYS_FSL_ERRATUM_IFC_A003399) &&  
!defined(CONFIG_SYS_RAMBOOT)

+#if defined(CONFIG_SYS_FSL_ERRATUM_IFC_A003399)\
+&& defined(CONFIG_A003399_NOR_WORKAROUND)


Why would CONFIG_A003399_NOR_WORKAROUND be enabled if  
CONFIG_SYS_FSL_ERRATUM_IFC_A003399 isn't?



originally i tried the same but it did not work. As P1010RDB.h does  
not include config_mpc85xx.h.   Only arch/powerpc/cpu/mpc85xx/*.c  
files includes both P1010RDB.h and config_mpc85xx.h


Can you add #include  in P1010RDB.h near the top, but  
after the symbols that config_mpc85xx.h depends on (which I think is  
just CONFIG_P1010)?

I need to add config_mpc85xx.h here.

 #define CONFIG_MPC85xx
 #define CONFIG_FSL_IFC /* Enable IFC Support */
 #define CONFIG_SYS_HAS_SERDES  /* common SERDES init code */
+#include "../../arch/powerpc/include/asm/config_mpc85xx.h"

I tried just after CONFIG_P1010 but it is giving compilation error.


What error?


Just to mention, I need to provide relative path in order to compile.


What specifically did you try and what error did it produce?

I will still suggest to keep original patch, As header file location  
may change over period of time then config file needs to be updated  
again.


No, this has been a repeated problem (not having access to  
config_mpc85xx.h in the board config file) and I'd like to see it fixed.


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


[U-Boot] [PATCH v2] mx35 iomux: correct offsets of IOMUX registers

2013-04-09 Thread Philip Paeps
This makes mxc_iomux_set_input() work correctly.  Previously, the
incorrect offset of IOMUXSW_INPUT_CTL caused mxc_iomux_set_input()
to write to the wrong register, possibly resulting in unexpected
behaviour.

Signed-off-by: Philip Paeps 
---
Changes in v2:
 - While here, also correct the offset of the last pad control
   register.  This is mostly cosmetic.

 arch/arm/cpu/arm1136/mx35/iomux.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/cpu/arm1136/mx35/iomux.c 
b/arch/arm/cpu/arm1136/mx35/iomux.c
index a302575..698909e 100644
--- a/arch/arm/cpu/arm1136/mx35/iomux.c
+++ b/arch/arm/cpu/arm1136/mx35/iomux.c
@@ -34,8 +34,8 @@ enum iomux_reg_addr {
IOMUXSW_MUX_CTL = IOMUXC_BASE_ADDR + 4, /* MUX control */
IOMUXSW_MUX_END = IOMUXC_BASE_ADDR + 0x324, /* last MUX control */
IOMUXSW_PAD_CTL = IOMUXC_BASE_ADDR + 0x328, /* Pad control */
-   IOMUXSW_PAD_END = IOMUXC_BASE_ADDR + 0x794, /* last Pad control */
-   IOMUXSW_INPUT_CTL = IOMUXC_BASE_ADDR + 0x7AC,   /* input select */
+   IOMUXSW_PAD_END = IOMUXC_BASE_ADDR + 0x7A4, /* last Pad control */
+   IOMUXSW_INPUT_CTL = IOMUXC_BASE_ADDR + 0x7A8,   /* input select */
IOMUXSW_INPUT_END = IOMUXC_BASE_ADDR + 0x9F4,   /* last input select */
 };
 
-- 
1.7.2.5

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


[U-Boot] [PATCH] mx35 iomux: correct offset of IOMUXSW_INPUT_CTL register

2013-04-09 Thread Philip Paeps
This makes mxc_iomux_set_input() work as expected.

Signed-off-by: Philip Paeps 
---
 arch/arm/cpu/arm1136/mx35/iomux.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/cpu/arm1136/mx35/iomux.c 
b/arch/arm/cpu/arm1136/mx35/iomux.c
index a302575..d6f4ced 100644
--- a/arch/arm/cpu/arm1136/mx35/iomux.c
+++ b/arch/arm/cpu/arm1136/mx35/iomux.c
@@ -35,7 +35,7 @@ enum iomux_reg_addr {
IOMUXSW_MUX_END = IOMUXC_BASE_ADDR + 0x324, /* last MUX control */
IOMUXSW_PAD_CTL = IOMUXC_BASE_ADDR + 0x328, /* Pad control */
IOMUXSW_PAD_END = IOMUXC_BASE_ADDR + 0x794, /* last Pad control */
-   IOMUXSW_INPUT_CTL = IOMUXC_BASE_ADDR + 0x7AC,   /* input select */
+   IOMUXSW_INPUT_CTL = IOMUXC_BASE_ADDR + 0x7A8,   /* input select */
IOMUXSW_INPUT_END = IOMUXC_BASE_ADDR + 0x9F4,   /* last input select */
 };
 
-- 
1.7.2.5

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


[U-Boot] zmodem ?

2013-04-09 Thread Brad Walker
I am curious to know about the status of support for zmodem.

I've looked through the mail archives and it seems as though ymodem is
supported. But, zmodem is currently not.

Also, there is a kermit mode that is supported.

Is my understanding correct?

Thanks.

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


[U-Boot] [PATCH v2 4/4] ARM: fix CONFIG_SPL_MAX_SIZE semantics

2013-04-09 Thread Albert ARIBAUD
Remove SPL-related ASSERT() in arch/arm/cpu/u-boot.lds
as this file is never used for SPL builds.

Rewrite the ASSERT() in arch/arm/cpu/u-boot-spl.lds
to separately test image (text,data,rodata...) size
and BSS size each against its own max.

Also, output section mmutable is not used in SPL builds.
Remove it.

Finally, update README regarding the (now homogeneous)
semantics of the CONFIG_SPL_MAX_SIZE and
CONFIG_SPL_BSS_MAX_SIZE macros.

Signed-off-by: Albert ARIBAUD 
Reported-by: Benoît Thébaudeau 
---
Changes in v2:
- removed mmutable in SPL linker file

 README  |   17 +++--
 arch/arm/cpu/u-boot-spl.lds |   19 ---
 arch/arm/cpu/u-boot.lds |4 
 3 files changed, 23 insertions(+), 17 deletions(-)

diff --git a/README b/README
index 5c5cd18..f31ded0 100644
--- a/README
+++ b/README
@@ -2776,7 +2776,14 @@ FIT uImage format:
LDSCRIPT for linking the SPL binary.
 
CONFIG_SPL_MAX_SIZE
-   Maximum binary size (text, data and rodata) of the SPL binary.
+   Maximum size for the image (sum of the text, data, rodata
+   and linker lists sections) of the SPL executable.
+   When defined, linker checks that the actual image size does
+   not exceed it.
+   The total amount of memory used by the SPL when running is
+   equal CONFIG_SPL_MAX_SIZE, plus CONFIG_SPL_BSS_MAX_SIZE if
+   it exists.
+   Note: image and BSS are disjoint for some targets.
 
CONFIG_SPL_TEXT_BASE
TEXT_BASE for linking the SPL binary.
@@ -2789,7 +2796,13 @@ FIT uImage format:
Link address for the BSS within the SPL binary.
 
CONFIG_SPL_BSS_MAX_SIZE
-   Maximum binary size of the BSS section of the SPL binary.
+   Maximum size of the BSS section of the SPL executable.
+   When defined, linker checks that the actual BSS size does
+   not exceed it.
+   The total amount of memory used by the SPL when running is
+   equal CONFIG_SPL_MAX_SIZE, plus CONFIG_SPL_BSS_MAX_SIZE if
+   it exists.
+   Note: image and BSS are disjoint for some targets.
 
CONFIG_SPL_STACK
Adress of the start of the stack SPL will use
diff --git a/arch/arm/cpu/u-boot-spl.lds b/arch/arm/cpu/u-boot-spl.lds
index 3c0d99c..2e86de4 100644
--- a/arch/arm/cpu/u-boot-spl.lds
+++ b/arch/arm/cpu/u-boot-spl.lds
@@ -65,15 +65,6 @@ SECTIONS
 
_end = .;
 
-   /*
-* Deprecated: this MMU section is used by pxa at present but
-* should not be used by new boards/CPUs.
-*/
-   . = ALIGN(4096);
-   .mmutable : {
-   *(.mmutable)
-   }
-
.bss __rel_dyn_start (OVERLAY) : {
__bss_start = .;
*(.bss*)
@@ -88,6 +79,12 @@ SECTIONS
/DISCARD/ : { *(.gnu*) }
 }
 
-#if defined(CONFIG_SPL_TEXT_BASE) && defined(CONFIG_SPL_MAX_SIZE)
-ASSERT(__bss_end < (CONFIG_SPL_TEXT_BASE + CONFIG_SPL_MAX_SIZE), "SPL image 
too big");
+#if defined(CONFIG_SPL_MAX_SIZE)
+ASSERT(__image_copy_end - __image_copy_start < (CONFIG_SPL_MAX_SIZE), \
+   "SPL image too big");
+#endif
+
+#if defined(CONFIG_SPL_BSS_MAX_SIZE)
+ASSERT(__bss_end - __bss_start < (CONFIG_SPL_BSS MAX_SIZE), \
+   "SPL image BSS too big");
 #endif
diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds
index 3a1083d..7bbc4f5 100644
--- a/arch/arm/cpu/u-boot.lds
+++ b/arch/arm/cpu/u-boot.lds
@@ -101,7 +101,3 @@ SECTIONS
/DISCARD/ : { *(.interp*) }
/DISCARD/ : { *(.gnu*) }
 }
-
-#if defined(CONFIG_SPL_TEXT_BASE) && defined(CONFIG_SPL_MAX_SIZE)
-ASSERT(__bss_end < (CONFIG_SPL_TEXT_BASE + CONFIG_SPL_MAX_SIZE), "SPL image 
too big");
-#endif
-- 
1.7.10.4

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


[U-Boot] [PATCH v2 3/4] smdk5250, snow: fix CONFIG_SPL_MAX_SIZE semantics

2013-04-09 Thread Albert ARIBAUD
CONFIG_SPL_MAX_SIZE wrongly included BSS size.
Split 14K max size between 10K image (text,rodata,data)
and 4K BSS based on sizes reported for current build:

   textdata bss
   4136 904   0

Signed-off-by: Albert ARIBAUD 
---
Changes in v2:
- fixed spacing in commit summary

 board/samsung/smdk5250/smdk5250-uboot-spl.lds |2 +-
 include/configs/exynos5250-dt.h   |3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/board/samsung/smdk5250/smdk5250-uboot-spl.lds 
b/board/samsung/smdk5250/smdk5250-uboot-spl.lds
index 4c8baaa..208e626 100644
--- a/board/samsung/smdk5250/smdk5250-uboot-spl.lds
+++ b/board/samsung/smdk5250/smdk5250-uboot-spl.lds
@@ -26,7 +26,7 @@
  */
 
 MEMORY { .sram : ORIGIN = CONFIG_SPL_TEXT_BASE, \
-   LENGTH = CONFIG_SPL_MAX_SIZE }
+   LENGTH = (CONFIG_SPL_MAX_SIZE + CONFIG_SPL_BSS_MAX_SIZE) }
 
 OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
 OUTPUT_ARCH(arm)
diff --git a/include/configs/exynos5250-dt.h b/include/configs/exynos5250-dt.h
index 496a194..372b0b4 100644
--- a/include/configs/exynos5250-dt.h
+++ b/include/configs/exynos5250-dt.h
@@ -141,7 +141,8 @@
 /* specific .lds file */
 #define CONFIG_SPL_LDSCRIPT"board/samsung/smdk5250/smdk5250-uboot-spl.lds"
 #define CONFIG_SPL_TEXT_BASE   0x02023400
-#define CONFIG_SPL_MAX_SIZE(14 * 1024)
+#define CONFIG_SPL_MAX_SIZE(10 * 1024)
+#define CONFIG_SPL_BSS_MAX_SIZE(4 * 1024)
 
 #define CONFIG_BOOTCOMMAND "mmc read 40007000 451 2000; bootm 40007000"
 
-- 
1.7.10.4

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


[U-Boot] [PATCH v2 2/4] da850evm, da850_am18xxevm: fix CONFIG_SPL_MAX_SIZE semantics

2013-04-09 Thread Albert ARIBAUD
CONFIG_SPL_MAX_SIZE wrongly included BSS size.
Split 32K max size between 24K image (text,rodata,data)
and 8K BSS based on sizes reported for current build:

   textdata bss
  156761316 108

Signed-off-by: Albert ARIBAUD 
---
Changes in v2:
- fixed commit summary typoes

 board/davinci/da8xxevm/u-boot-spl-da850evm.lds |2 +-
 include/configs/da850evm.h |4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/board/davinci/da8xxevm/u-boot-spl-da850evm.lds 
b/board/davinci/da8xxevm/u-boot-spl-da850evm.lds
index bc34fb5..d7edeb2 100644
--- a/board/davinci/da8xxevm/u-boot-spl-da850evm.lds
+++ b/board/davinci/da8xxevm/u-boot-spl-da850evm.lds
@@ -25,7 +25,7 @@
  */
 
 MEMORY { .sram : ORIGIN = CONFIG_SPL_TEXT_BASE,\
-   LENGTH = CONFIG_SPL_MAX_SIZE }
+   LENGTH = (CONFIG_SPL_MAX_SIZE + CONFIG_SPL_BSS_MAX_SIZE) }
 
 OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
 OUTPUT_ARCH(arm)
diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
index 99b4de7..e15c86e 100644
--- a/include/configs/da850evm.h
+++ b/include/configs/da850evm.h
@@ -399,7 +399,9 @@
 #define CONFIG_SPL_LDSCRIPT"board/$(BOARDDIR)/u-boot-spl-da850evm.lds"
 #define CONFIG_SPL_STACK   0x8001ff00
 #define CONFIG_SPL_TEXT_BASE   0x8000
-#define CONFIG_SPL_MAX_SIZE32768
+/* SPL max size is 24K -- but --pad-to requires a single decimal number */
+#define CONFIG_SPL_MAX_SIZE24576
+#define CONFIG_SPL_BSS_MAX_SIZE(8*1024)
 #endif
 
 /* Load U-Boot Image From MMC */
-- 
1.7.10.4

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


[U-Boot] [PATCH v2 0/4] Homogeneize semantics of CONFIG_SPL_MAX_SIZE

2013-04-09 Thread Albert ARIBAUD
CONFIG_SPL_MAX_SIZE and CONFIG_SPL_BSS_MAX_SIZE did not have constant
semantics across all of U-boot. This patch series aims at fixing this by
splitting the maximum size into separate image (code + data + rodata +
linker list) size on the one hand, and BSS size on the other hand.

Changes in v2:
- brought back total size to 12K
- fixed commit summary typoes
- fixed spacing in commit summary
- removed mmutable in SPL linker file

Albert ARIBAUD (4):
  cam_enc_4xx: fix CONFIG_SPL_MAX_SIZE semantics
  da850evm, da850_am18xxevm: fix CONFIG_SPL_MAX_SIZE semantics
  smdk5250, snow: fix CONFIG_SPL_MAX_SIZE semantics
  ARM: fix CONFIG_SPL_MAX_SIZE semantics

 README |   17 +++--
 arch/arm/cpu/u-boot-spl.lds|   19 ---
 arch/arm/cpu/u-boot.lds|4 
 board/ait/cam_enc_4xx/u-boot-spl.lds   |2 +-
 board/davinci/da8xxevm/u-boot-spl-da850evm.lds |2 +-
 board/samsung/smdk5250/smdk5250-uboot-spl.lds  |2 +-
 include/configs/cam_enc_4xx.h  |4 +++-
 include/configs/da850evm.h |4 +++-
 include/configs/exynos5250-dt.h|3 ++-
 9 files changed, 34 insertions(+), 23 deletions(-)

-- 
1.7.10.4

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


[U-Boot] [PATCH v2 1/4] cam_enc_4xx: fix CONFIG_SPL_MAX_SIZE semantics

2013-04-09 Thread Albert ARIBAUD
CONFIG_SPL_MAX_SIZE wrongly included BSS size.
Split 12K max size between 10K image (text,rodata,data)
and 2K BSS based on sizes reported for current build:

   textdata bss
   9073 840 500

Signed-off-by: Albert ARIBAUD 
---
Changes in v2:
- brought back total size to 12K

 board/ait/cam_enc_4xx/u-boot-spl.lds |2 +-
 include/configs/cam_enc_4xx.h|4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/board/ait/cam_enc_4xx/u-boot-spl.lds 
b/board/ait/cam_enc_4xx/u-boot-spl.lds
index dd9d52d..25625dc 100644
--- a/board/ait/cam_enc_4xx/u-boot-spl.lds
+++ b/board/ait/cam_enc_4xx/u-boot-spl.lds
@@ -25,7 +25,7 @@
  */
 
 MEMORY { .sram : ORIGIN = CONFIG_SPL_TEXT_BASE,\
-   LENGTH = CONFIG_SPL_MAX_SIZE }
+   LENGTH = (CONFIG_SPL_MAX_SIZE + CONFIG_SPL_BSS_MAX_SIZE) }
 
 OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
 OUTPUT_ARCH(arm)
diff --git a/include/configs/cam_enc_4xx.h b/include/configs/cam_enc_4xx.h
index 56528dd..b73b72c 100644
--- a/include/configs/cam_enc_4xx.h
+++ b/include/configs/cam_enc_4xx.h
@@ -230,7 +230,9 @@
 #define CONFIG_SPL_STACK   (0x0001 + 0x7f00)
 
 #define CONFIG_SPL_TEXT_BASE   0x0020 /*CONFIG_SYS_SRAM_START*/
-#define CONFIG_SPL_MAX_SIZE12320
+/* SPL total size is 12K -- but --pad-to requires a single decimal number */
+#define CONFIG_SPL_MAX_SIZE10240
+#define CONFIG_SPL_BSS_MAX_SIZE(2*1024)
 
 #ifndef CONFIG_SPL_BUILD
 #define CONFIG_SYS_TEXT_BASE   0x8108
-- 
1.7.10.4

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


[U-Boot] [PATCH v2] spi: mxc_spi: Set master mode for all channels

2013-04-09 Thread Fabio Estevam
From: Fabio Estevam 

The glitch in the SPI clock line, which commit 3cea335c34 (spi: mxc_spi: Fix spi
clock glitch durant reset) solved, is back now and itwas re-introduced by 
commit d36b39bf0d (spi: mxc_spi: Fix ECSPI reset handling).

Actually the glitch is happening due to always toggling between slave mode
and master mode by configuring the CHANNEL_MODE bits in this reset function.

Since the spi driver only supports master mode, set the mode for all channels 
always to master mode in order to have a stable, "glitch-free" SPI clock line.

Signed-off-by: Fabio Estevam 
---
Changes since v1:
- Introduce MXC_CSPICTRL_MODE_MASK definition
- Remove additional read of reg_ctrl

 arch/arm/include/asm/arch-mx5/imx-regs.h |1 +
 arch/arm/include/asm/arch-mx6/imx-regs.h |1 +
 drivers/spi/mxc_spi.c|   17 +
 3 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/arch/arm/include/asm/arch-mx5/imx-regs.h 
b/arch/arm/include/asm/arch-mx5/imx-regs.h
index 249d15a..a71cc13 100644
--- a/arch/arm/include/asm/arch-mx5/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx5/imx-regs.h
@@ -230,6 +230,7 @@
 #define MXC_CSPICTRL_EN(1 << 0)
 #define MXC_CSPICTRL_MODE  (1 << 1)
 #define MXC_CSPICTRL_XCH   (1 << 2)
+#define MXC_CSPICTRL_MODE_MASK (0xf << 4)
 #define MXC_CSPICTRL_CHIPSELECT(x) (((x) & 0x3) << 12)
 #define MXC_CSPICTRL_BITCOUNT(x)   (((x) & 0xfff) << 20)
 #define MXC_CSPICTRL_PREDIV(x) (((x) & 0xF) << 12)
diff --git a/arch/arm/include/asm/arch-mx6/imx-regs.h 
b/arch/arm/include/asm/arch-mx6/imx-regs.h
index eaa7439..d79ab2f 100644
--- a/arch/arm/include/asm/arch-mx6/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx6/imx-regs.h
@@ -346,6 +346,7 @@ struct cspi_regs {
 #define MXC_CSPICTRL_EN(1 << 0)
 #define MXC_CSPICTRL_MODE  (1 << 1)
 #define MXC_CSPICTRL_XCH   (1 << 2)
+#define MXC_CSPICTRL_MODE_MASK (0xf << 4)
 #define MXC_CSPICTRL_CHIPSELECT(x) (((x) & 0x3) << 12)
 #define MXC_CSPICTRL_BITCOUNT(x)   (((x) & 0xfff) << 20)
 #define MXC_CSPICTRL_PREDIV(x) (((x) & 0xF) << 12)
diff --git a/drivers/spi/mxc_spi.c b/drivers/spi/mxc_spi.c
index 4c19e0b..20419e6 100644
--- a/drivers/spi/mxc_spi.c
+++ b/drivers/spi/mxc_spi.c
@@ -137,11 +137,15 @@ static s32 spi_cfg_mxc(struct mxc_spi_slave *mxcs, 
unsigned int cs,
return -1;
}
 
-   /* Reset spi */
-   reg_write(®s->ctrl, 0);
-   reg_write(®s->ctrl, MXC_CSPICTRL_EN);
-
-   reg_ctrl = reg_read(®s->ctrl);
+   /*
+* Reset SPI and set all CSs to master mode, if toggling
+* between slave and master mode we might see a glitch
+* on the clock line
+*/
+   reg_ctrl = MXC_CSPICTRL_MODE_MASK;
+   reg_write(®s->ctrl, reg_ctrl);
+   reg_ctrl |=  MXC_CSPICTRL_EN;
+   reg_write(®s->ctrl, reg_ctrl);
 
/*
 * The following computation is taken directly from Freescale's code.
@@ -174,9 +178,6 @@ static s32 spi_cfg_mxc(struct mxc_spi_slave *mxcs, unsigned 
int cs,
reg_ctrl = (reg_ctrl & ~MXC_CSPICTRL_POSTDIV(0x0F)) |
MXC_CSPICTRL_POSTDIV(post_div);
 
-   /* always set to master mode */
-   reg_ctrl |= 1 << (cs + 4);
-
/* We need to disable SPI before changing registers */
reg_ctrl &= ~MXC_CSPICTRL_EN;
 
-- 
1.7.9.5

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


[U-Boot] bootm does not work if netconsole is enabled

2013-04-09 Thread Michael Walle

Hi Joe, Hi Tom,

If i have the netconsole enabled i cannot boot linux using the bootm command. 
This bug exists at least in 2013.01.01 and 2013.04-rc2 :/


Here is the output of the serial console of a successful startup:

## Booting kernel from Legacy Image at 0010 ...
   Image Name:   Linux-3.8.0-rc1-4-g270c0a0-d
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:2799632 Bytes = 2.7 MiB
   Load Address: 8000
   Entry Point:  8000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 0080 ...
   Image Name:   
   Image Type:   ARM Linux RAMDisk Image (uncompressed)
   Data Size:636966 Bytes = 622 KiB
   Load Address: 
   Entry Point:  
   Verifying Checksum ... OK
## Flattened Device Tree blob at 0070
   Booting using the fdt blob at 0x0070
   Loading Kernel Image ... OK
OK
   Loading Ramdisk to 03aad000, end 03b48826 ... OK
   Loading Device Tree to 03aa8000, end 03aacedd ... OK

Starting kernel ...

[.. more linux kernel output ..]


If the netconsole is enabled, eg. "stdin = stdout = stderr = nc", i see only 
the following output on the netconsole and then nothing more happens:

## Booting kernel from Legacy Image at 0010 ...
   Image Name:   Linux-3.8.0-rc1-4-g270c0a0-d
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:2799632 Bytes = 2.7 MiB
   Load Address: 8000
   Entry Point:  8000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 0080 ...
   Image Name:   
   Image Type:   ARM Linux RAMDisk Image (uncompressed)
   Data Size:636966 Bytes = 622 KiB
   Load Address: 
   Entry Point:  
   Verifying Checksum ... OK
## Flattened Device Tree blob at 0070
   Booting using the fdt blob at 0x0070


I've tracked this down to the eth_halt() call in cmd_bootm.c:647. What is the 
purpose of this call? I guess the NIC should be shut down prior to booting 
linux. OTOH, there are still messages printed after this call, and i suppose 
the netconsole tries to bring the network back up. If i remove this call, 
everything works as expected.
Anyway, i can definitely say, that the linux kernel is not starting. Eg. it is 
not only the output that stops working.

FYI, i'm using the mvgbe driver.

Let me know if i can do some more debugging or provide more information. 
Hopefully this will be fixed in 2013.04 :)

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


Re: [U-Boot] [PATCH 2/5][v2] powerpc/mpc85xx: new SPL support for IFC NAND

2013-04-09 Thread Scott Wood

On 04/09/2013 12:04:18 AM, Prabhakar Kushwaha wrote:

On 04/09/2013 06:25 AM, Scott Wood wrote:

On 04/05/2013 09:38:32 PM, Prabhakar Kushwaha wrote:

On 04/06/2013 02:10 AM, Scott Wood wrote:

On 03/22/2013 02:08:05 AM, Prabhakar Kushwaha wrote:
diff --git a/board/freescale/common/Makefile  
b/board/freescale/common/Makefile

index 75725b4..a4d521c 100644
--- a/board/freescale/common/Makefile
+++ b/board/freescale/common/Makefile
@@ -29,6 +29,15 @@ endif

 LIB= $(obj)libfreescale.o

+MINIMAL=
+
+ifdef CONFIG_SPL_BUILD
+ifdef CONFIG_SPL_INIT_MINIMAL
+MINIMAL=y
+endif
+endif
+
+ifndef MINIMAL
 COBJS-$(CONFIG_FSL_CADMUS)+= cadmus.o
 COBJS-$(CONFIG_FSL_VIA)+= cds_via.o
 COBJS-$(CONFIG_FMAN_ENET)+= fman.o
@@ -62,6 +71,7 @@ SUBLIB-$(CONFIG_P3041DS)+=  
p_corenet/libp_corenet.o

 SUBLIB-$(CONFIG_P4080DS)+= p_corenet/libp_corenet.o
 SUBLIB-$(CONFIG_P5020DS)+= p_corenet/libp_corenet.o
 SUBLIB-$(CONFIG_P5040DS)+= p_corenet/libp_corenet.o
+endif

 SRCS:= $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
 OBJS:= $(addprefix $(obj),$(COBJS-y))


If this is needed to avoid pulling in any files from this  
directory, why did p1_p2_rdb_pc not need this?  Is there a  
particular file that is failing to build or failing to get  
optimized away


I cannot avoid this directory :(.
because new SPL compile this directory even after undef QIXIS  
defines


#ifndef CONFIG_SPL_BUILD
#define CONFIG_FSL_QIXIS
#endif


Yeah, the makefiles never see CONFIG_SPL_BUILD -- it only works for  
C code.


The P1022 SPL patch just does this in the makefile:

+ifndef CONFIG_SPL_BUILD
 COBJS-$(CONFIG_FSL_NGPIXIS)+= ngpixis.o
+endif

...which is less intrusive.  We can revisit it if we end up actually  
needing pixis/qixis inside an SP


Only putting qixis.c in ifndef CONFIG_SPI_BUILD may not work for  
9132QDS. following change is also required i.e. to put  
CONFIG_ID_EEPROM in ifndef CONFIG_SPI_BUILD


+ifndef CONFIG_SPL_BUILD
 COBJS-$(CONFIG_FSL_QIXIS)+= qixis.o
-COBJS-$(CONFIG_PQ_MDS_PIB)+= pq-mds-pib.o
 COBJS-$(CONFIG_ID_EEPROM)+= sys_eeprom.o
+endif
+COBJS-$(CONFIG_PQ_MDS_PIB)+= pq-mds-pib.o

It will be good to have original patch which do not compile any file  
for SPL. if any file needs to be compiled for SPL, it can be added in  
ifdef MINIMAL.


OK.

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


[U-Boot] [PATCH 5/5] omap5912-osk: Fix get_timer() and CONFIG_SYS_HZ

2013-04-09 Thread Jon Hunter
The function get_timer() should return time in ms and CONFIG_SYS_HZ
should be set to 1000 by default. Fix both of these items.

Signed-off-by: Jon Hunter 
---
 arch/arm/cpu/arm926ejs/omap/timer.c |   15 ---
 include/configs/omap5912osk.h   |2 +-
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/omap/timer.c 
b/arch/arm/cpu/arm926ejs/omap/timer.c
index 34ec7b2..16530b0 100644
--- a/arch/arm/cpu/arm926ejs/omap/timer.c
+++ b/arch/arm/cpu/arm926ejs/omap/timer.c
@@ -36,11 +36,14 @@
  */
 
 #include 
+#include 
 
-#define TIMER_LOAD_VAL 0x
+#define TIMER_CLOCK(CONFIG_SYS_CLK_FREQ / (2 << CONFIG_SYS_PTV))
+#define TIMER_LOAD_VAL 0x
 
 /* macro to read the 32 bit timer */
-#define READ_TIMER (*(volatile ulong *)(CONFIG_SYS_TIMERBASE+8))
+#define READ_TIMER readl(CONFIG_SYS_TIMERBASE+8) \
+   / (TIMER_CLOCK / CONFIG_SYS_HZ)
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -114,7 +117,8 @@ ulong get_timer_masked (void)
 * (TLV-now) amount of time after passing though -1
 * nts = new "advancing time stamp"...it could also roll and 
cause problems.
 */
-   timestamp += lastdec + TIMER_LOAD_VAL - now;
+   timestamp += lastdec + (TIMER_LOAD_VAL / (TIMER_CLOCK /
+   CONFIG_SYS_HZ)) - now;
}
lastdec = now;
 
@@ -160,8 +164,5 @@ unsigned long long get_ticks(void)
  */
 ulong get_tbclk (void)
 {
-   ulong tbclk;
-
-   tbclk = CONFIG_SYS_HZ;
-   return tbclk;
+   return CONFIG_SYS_HZ;
 }
diff --git a/include/configs/omap5912osk.h b/include/configs/omap5912osk.h
index 3276a50..c5797a2 100644
--- a/include/configs/omap5912osk.h
+++ b/include/configs/omap5912osk.h
@@ -134,7 +134,7 @@
  */
 #define CONFIG_SYS_TIMERBASE   0xFFFEC500  /* use timer 1 */
 #define CONFIG_SYS_PTV 7   /* 2^(PTV+1), divide by 256 */
-#define CONFIG_SYS_HZ  ((CONFIG_SYS_CLK_FREQ)/(2 << CONFIG_SYS_PTV))
+#define CONFIG_SYS_HZ  1000
 
 /*---
  * Physical Memory Map
-- 
1.7.10.4

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


[U-Boot] [PATCH 4/5] omap5912-osk: Increase flash partition for u-boot

2013-04-09 Thread Jon Hunter
The current u-boot binary needs more than 128KB of flash space and so
move the u-boot environment from an offset of 128KB to 256KB in flash
to ensure the enviroment does not overlap with u-boot.

Signed-off-by: Jon Hunter 
---
 include/configs/omap5912osk.h |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/configs/omap5912osk.h b/include/configs/omap5912osk.h
index 558e933..3276a50 100644
--- a/include/configs/omap5912osk.h
+++ b/include/configs/omap5912osk.h
@@ -178,10 +178,10 @@
  */
 #define CONFIG_ENV_IS_IN_FLASH 1
 /* addr of environment */
-#define CONFIG_ENV_ADDR(CONFIG_SYS_FLASH_BASE + 0x02)
+#define CONFIG_ENV_ADDR(CONFIG_SYS_FLASH_BASE + CONFIG_ENV_OFFSET)
 
-#define CONFIG_ENV_SIZE0x2 /* Total Size of Environment Sector */
-#define CONFIG_ENV_OFFSET  0x2 /* environment starts here  */
+#define CONFIG_ENV_SIZE0x2 /* Total Size of Environment 
Sector */
+#define CONFIG_ENV_OFFSET  0x4 /* environment starts here  */
 
 #define CONFIG_SYS_SDRAM_BASE  PHYS_SDRAM_1
 #define CONFIG_SYS_INIT_RAM_ADDRPHYS_SRAM
-- 
1.7.10.4

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


[U-Boot] [PATCH 3/5] omap5912-osk: Fix device initialisation

2013-04-09 Thread Jon Hunter
In the current u-boot, the device pin multiplexing and clock
initialisation needs to be early during the boot process and before
board_init() is called. U-boot is currently crashing on this board
because this is not being done early enough. Therefore, add a s_init()
function for the omap5912-osk board to do this.

Also fix the stack pointer so that it is pointing to the end of the
internal RAM and not the beginning as this was also causing the device
to crash.

Signed-off-by: Jon Hunter 
---
 board/ti/omap5912osk/lowlevel_init.S |   20 
 board/ti/omap5912osk/omap5912osk.c   |   12 
 include/configs/omap5912osk.h|7 +--
 3 files changed, 33 insertions(+), 6 deletions(-)

diff --git a/board/ti/omap5912osk/lowlevel_init.S 
b/board/ti/omap5912osk/lowlevel_init.S
index e60161e..ca7361e 100644
--- a/board/ti/omap5912osk/lowlevel_init.S
+++ b/board/ti/omap5912osk/lowlevel_init.S
@@ -306,6 +306,23 @@ common_tc:
ldr r1, VAL_MPU_CNTL_TIMER
str r1, [r0]
 
+   /*
+* Setup a temporary stack
+*/
+   ldr sp, SRAM_STACK
+   bic sp, sp, #7 /* 8-byte alignment for ABI compliance */
+
+   /*
+* Save the old lr(passed in ip) and the current lr to stack
+*/
+   push{ip, lr}
+
+   /*
+* go setup pll, mux, memory
+*/
+   bl  s_init
+   pop {ip, pc}
+
/* back to arch calling code */
mov pc, lr
 
@@ -470,6 +487,9 @@ VAL_ARM_IDLECT2:
 VAL_ARM_IDLECT3:
.word 0x0015
 
+SRAM_STACK:
+   .word CONFIG_SYS_INIT_SP_ADDR
+
 /* command values */
 .equ CMD_SDRAM_NOP, 0x
 .equ CMD_SDRAM_PRECHARGE,   0x0001
diff --git a/board/ti/omap5912osk/omap5912osk.c 
b/board/ti/omap5912osk/omap5912osk.c
index 9e91c5e..9514071 100644
--- a/board/ti/omap5912osk/omap5912osk.c
+++ b/board/ti/omap5912osk/omap5912osk.c
@@ -66,6 +66,14 @@ int board_init (void)
/* adress of boot parameters */
gd->bd->bi_boot_params = 0x1100;
 
+   flash__init();
+   ether__init();
+
+   return 0;
+}
+
+void s_init(void)
+{
/* Configure MUX settings */
set_muxconf_regs ();
peripheral_power_enable ();
@@ -75,10 +83,6 @@ int board_init (void)
  *  ... rkw ...
  */
icache_enable ();
-
-   flash__init ();
-   ether__init ();
-   return 0;
 }
 
 /**
diff --git a/include/configs/omap5912osk.h b/include/configs/omap5912osk.h
index 40ca9bb..558e933 100644
--- a/include/configs/omap5912osk.h
+++ b/include/configs/omap5912osk.h
@@ -183,7 +183,10 @@
 #define CONFIG_ENV_SIZE0x2 /* Total Size of Environment Sector */
 #define CONFIG_ENV_OFFSET  0x2 /* environment starts here  */
 
-#define CONFIG_SYS_SDRAM_BASE  PHYS_SDRAM_1
-#define CONFIG_SYS_INIT_SP_ADDR PHYS_SRAM
+#define CONFIG_SYS_SDRAM_BASE  PHYS_SDRAM_1
+#define CONFIG_SYS_INIT_RAM_ADDRPHYS_SRAM
+#define CONFIG_SYS_INIT_RAM_SIZE(250 * 1024)
+#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
+CONFIG_SYS_INIT_RAM_SIZE)
 
 #endif /* __CONFIG_H */
-- 
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/5] omap5912-osk: Fix booting from NOR flash

2013-04-09 Thread Jon Hunter
The omap5912-osk board is using a RAM based address as the linker
location for code. This is causing several problems when attempting
to run the latest u-boot code base on this board from flash. Update
the default linker location for code to be in NOR flash at address
0x.

The omap5912-osk board only has 32MB of RAM and so fix the comment
in the omap5912-osk config.mk file as well.

Signed-off-by: Jon Hunter 
---
 board/ti/omap5912osk/config.mk |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/board/ti/omap5912osk/config.mk b/board/ti/omap5912osk/config.mk
index 0ed7d8a..5b8d952 100644
--- a/board/ti/omap5912osk/config.mk
+++ b/board/ti/omap5912osk/config.mk
@@ -14,17 +14,17 @@
 # TI OSK board with OMAP5912 (ARM925EJS) cpu
 # see http://www.ti.com/ for more information on Texas Instruments
 #
-# OSK has 1 bank of 256 MB SDRAM
+# OSK has 1 bank of 32 MB SDRAM
 # Physical Address:
-# 1000' to 2000'
+# 1000' to 1200'
 #
 #
 # Linux-Kernel is expected to be at 1000'8000, entry 1000'8000
 # (mem base + reserved)
 #
-# we load ourself to 1108'
+# When running from RAM use address 1108', otherwise when
+# booting from NOR flash link to address '.
 #
-#
-
 
-CONFIG_SYS_TEXT_BASE = 0x1108
+CONFIG_SYS_TEXT_BASE = 0x
+#CONFIG_SYS_TEXT_BASE = 0x1108
-- 
1.7.10.4

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


[U-Boot] [PATCH 0/5] omap5912-osk: Fix u-boot support for board

2013-04-09 Thread Jon Hunter
Currently, u-boot support for the omap5912-osk board is broken and
u-boot is not booting when program into flash. Fix u-boot support
for this board.

Jon Hunter (5):
  omap5912-osk: Fix DRAM initialisation
  omap5912-osk: Fix booting from NOR flash
  omap5912-osk: Fix device initialisation
  omap5912-osk: Increase flash partition for u-boot
  omap5912-osk: Fix get_timer() and CONFIG_SYS_HZ

 arch/arm/cpu/arm926ejs/omap/timer.c  |   15 ---
 board/ti/omap5912osk/config.mk   |   12 ++--
 board/ti/omap5912osk/lowlevel_init.S |   20 
 board/ti/omap5912osk/omap5912osk.c   |   23 ---
 include/configs/omap5912osk.h|   15 +--
 5 files changed, 59 insertions(+), 26 deletions(-)

-- 
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/5] omap5912-osk: Fix DRAM initialisation

2013-04-09 Thread Jon Hunter
The size of the DRAM for the omap5912-osk board is getting setup in the
dram_init() function. However, for the current u-boot release this is
too late and needs to be done in dram_init_banksize(). Therefore, add
a dram_init_banksize() function for the omap5912-osk board and setup the
DRAM size there.

Signed-off-by: Jon Hunter 
---
 board/ti/omap5912osk/omap5912osk.c |   11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/board/ti/omap5912osk/omap5912osk.c 
b/board/ti/omap5912osk/omap5912osk.c
index fac683a..9e91c5e 100644
--- a/board/ti/omap5912osk/omap5912osk.c
+++ b/board/ti/omap5912osk/omap5912osk.c
@@ -128,14 +128,19 @@ void ether__init (void)
  Routine:
  Description:
 **/
-int dram_init (void)
+int dram_init(void)
 {
-   gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
-   gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
+   gd->ram_size = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE);
 
return 0;
 }
 
+void dram_init_banksize(void)
+{
+   gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
+   gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
+}
+
 /**
  Routine: set_muxconf_regs
  Description: Setting up the configuration Mux registers
-- 
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 v11 18/30] nand: mxc: Switch NAND SPL to generic SPL

2013-04-09 Thread Benoît Thébaudeau
On Tuesday, April 9, 2013 10:57:04 PM, Benoît Thébaudeau wrote:
> Hi Albert,
> 
> On Tuesday, April 9, 2013 10:17:04 PM, Albert ARIBAUD wrote:
> > Hi Benoît,
> > 
> > On Tue,  9 Apr 2013 21:48:47 +0200, Benoît Thébaudeau
> >  wrote:
> > 
> > > This also fixes support for mx31pdk and tx25, which had been broken by
> > > commit
> > > e05e5de7fae5bec79617e113916dac6631251156.
> > > 
> > > Signed-off-by: Benoît Thébaudeau 
> > > Acked-by: Scott Wood 
> > > Tested-by: Fabio Estevam 
> > > ---
> > > Changes in v11:
> > >  - mx31pdk: Rename u-boot-nand.bin to u-boot-with-spl.bin (new target
> > >  binary
> > >name) in prg_uboot command.
> > >  - mx31pdk: Enlarge CONFIG_SYS_NAND_U_BOOT_SIZE from 0x32000 to 0x3f800
> > >  (which
> > >corresponds to the size allocated for this purpose in NAND Flash) in
> > >order to
> > >leave enough room whatever the toolchain used.
> > >  - mx31pdk: Set back CONFIG_SPL_TEXT_BASE and CONFIG_SYS_TEXT_BASE by
> > >  0x0010
> > >because the original U-Boot at CONFIG_SYS_TEXT_BASE was overlapping
> > >the
> > >global data being written prior to relocation by
> > >arch/arm/lib/board.c:board_init_f().
> > 
> > I gather this patch is exactly what finally worked for Fabio's mx31?
> 
> Correct, apart from the file renaming in prg_uboot, which has no influence
> here.

And with:
http://patchwork.ozlabs.org/patch/235173/

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


Re: [U-Boot] [PATCH v11 18/30] nand: mxc: Switch NAND SPL to generic SPL

2013-04-09 Thread Benoît Thébaudeau
Hi Albert,

On Tuesday, April 9, 2013 10:17:04 PM, Albert ARIBAUD wrote:
> Hi Benoît,
> 
> On Tue,  9 Apr 2013 21:48:47 +0200, Benoît Thébaudeau
>  wrote:
> 
> > This also fixes support for mx31pdk and tx25, which had been broken by
> > commit
> > e05e5de7fae5bec79617e113916dac6631251156.
> > 
> > Signed-off-by: Benoît Thébaudeau 
> > Acked-by: Scott Wood 
> > Tested-by: Fabio Estevam 
> > ---
> > Changes in v11:
> >  - mx31pdk: Rename u-boot-nand.bin to u-boot-with-spl.bin (new target
> >  binary
> >name) in prg_uboot command.
> >  - mx31pdk: Enlarge CONFIG_SYS_NAND_U_BOOT_SIZE from 0x32000 to 0x3f800
> >  (which
> >corresponds to the size allocated for this purpose in NAND Flash) in
> >order to
> >leave enough room whatever the toolchain used.
> >  - mx31pdk: Set back CONFIG_SPL_TEXT_BASE and CONFIG_SYS_TEXT_BASE by
> >  0x0010
> >because the original U-Boot at CONFIG_SYS_TEXT_BASE was overlapping the
> >global data being written prior to relocation by
> >arch/arm/lib/board.c:board_init_f().
> 
> I gather this patch is exactly what finally worked for Fabio's mx31?

Correct, apart from the file renaming in prg_uboot, which has no influence here.

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


Re: [U-Boot] [PATCH v11 18/30] nand: mxc: Switch NAND SPL to generic SPL

2013-04-09 Thread Albert ARIBAUD
Hi Benoît,

On Tue,  9 Apr 2013 21:48:47 +0200, Benoît Thébaudeau
 wrote:

> This also fixes support for mx31pdk and tx25, which had been broken by commit
> e05e5de7fae5bec79617e113916dac6631251156.
> 
> Signed-off-by: Benoît Thébaudeau 
> Acked-by: Scott Wood 
> Tested-by: Fabio Estevam 
> ---
> Changes in v11:
>  - mx31pdk: Rename u-boot-nand.bin to u-boot-with-spl.bin (new target binary
>name) in prg_uboot command.
>  - mx31pdk: Enlarge CONFIG_SYS_NAND_U_BOOT_SIZE from 0x32000 to 0x3f800 (which
>corresponds to the size allocated for this purpose in NAND Flash) in order 
> to
>leave enough room whatever the toolchain used.
>  - mx31pdk: Set back CONFIG_SPL_TEXT_BASE and CONFIG_SYS_TEXT_BASE by 
> 0x0010
>because the original U-Boot at CONFIG_SYS_TEXT_BASE was overlapping the
>global data being written prior to relocation by
>arch/arm/lib/board.c:board_init_f().

I gather this patch is exactly what finally worked for Fabio's mx31?

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


Re: [U-Boot] Patman / buildman pull request

2013-04-09 Thread Tom Rini
On Mon, Apr 08, 2013 at 03:26:43PM -0700, Simon Glass wrote:

> Hi Tom,
> 
> On Mon, Apr 8, 2013 at 9:54 AM, Tom Rini  wrote:
> > On Thu, Apr 04, 2013 at 02:28:26PM -0700, Simon Glass wrote:
> >
> >> Hi Tom,
> >>
> >> I have brought in the patman changes for this release and also some
> >> changes that I consider to be bug fixes. For now I have left out these
> >> patches:
> >>
> >> http://patchwork.ozlabs.org/patch/231570/
> >> http://patchwork.ozlabs.org/patch/231572/
> >> http://patchwork.ozlabs.org/patch/231575/
> >>
> >> however they do improve the operation of patman, so if you are OK with
> >> it I would quiet like to bring in the last two at least.
> >
> > Go ahead and bring in all 3.  I keep trying to convince my
> > more-kernel-than-u-boot coworkers to give patman a spin in kernel-land
> > since they're 2 managing 2-3 N part series by hand.
> 
> OK, here is a pull request for the next 3, plus one bug fix that I
> missed last time. This is http://patchwork.ozlabs.org/patch/224458/,
> which for some reason doesn't show up in my TODO.
> 
> 
> The following changes since commit f140b5863b258120f5412ea86733f70c87837ee9:
> 
>   Merge branch 'patman' of git://git.denx.de/u-boot-x86 (2013-04-08
> 12:03:22 -0400)
> 
> are available in the git repository at:
> 
> 
>   git://git.denx.de/u-boot-x86.git patman
> 
> for you to fetch changes up to 645b271a6039e79b368f027a5624dc0820441733:
> 
>   patman: Add Series-process-log tag to sort/uniq change logs
> (2013-04-08 15:21:22 -0700)
> 
> 
> Doug Anderson (1):
>   patman: Don't barf if the word 'commit' starts a line
> 
> Simon Glass (3):
>   patman: Provide option to ignore bad aliases
>   patman: Add -a option to refrain from test-applying the patches
>   patman: Add Series-process-log tag to sort/uniq change logs
> 
>  tools/patman/README |  9 -
>  tools/patman/gitutil.py | 65
> +++--
>  tools/patman/patchstream.py |  4 ++--
>  tools/patman/patman.py  | 20 ++--
>  tools/patman/series.py  | 19 ++-
>  5 files changed, 85 insertions(+), 32 deletions(-)

Also applied to u-boot/master, thanks!

-- 
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 v11 01/30] mtd: nand: Introduce CONFIG_SYS_NAND_BUSWIDTH_16BIT

2013-04-09 Thread Benoît Thébaudeau
On Tuesday, April 9, 2013 9:48:30 PM, Benoît Thébaudeau wrote:
> From: Fabio Estevam 
> 
> Introduce CONFIG_SYS_NAND_BUSWIDTH_16BIT option so that other NAND controller
> drivers could use it when a 16-bit NAND is deployed.
> 
> drivers/mtd/nand/ndfc has CONFIG_SYS_NDFC_16BIT, so just rename it, so that
> other NAND drivers could reuse the same symbol.
> 
> Signed-off-by: Fabio Estevam 
> Acked-by: Scott Wood 
> Reviewed-by: Benoît Thébaudeau 
> ---
> Changes in v11: None
> Changes in v10: None
> Changes in v9: None
> Changes in v8:
>  - New patch.
> 
> Changes in v7: None
> Changes in v6: None
> Changes in v5: None
> Changes in v4: None
> Changes in v3: None
> Changes in v2: None
> 
>  README  |9 ++---
>  drivers/mtd/nand/ndfc.c |4 ++--
>  2 files changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/README b/README
> index 5c5cd18..e9c3145 100644
> --- a/README
> +++ b/README
> @@ -3755,9 +3755,12 @@ Low Level (hardware related) configuration options:
>  - CONFIG_SYS_SRIOn_MEM_SIZE:
>   Size of SRIO port 'n' memory region
>  
> -- CONFIG_SYS_NDFC_16
> - Defined to tell the NDFC that the NAND chip is using a
> - 16 bit bus.
> +- CONFIG_SYS_NAND_BUSWIDTH_16BIT
> + Defined to tell the NAND controller that the NAND chip is using
> + a 16 bit bus.
> + Not all NAND drivers use this symbol.
> + Example of driver that uses it:
> + - drivers/mtd/nand/ndfc.c
>  
>  - CONFIG_SYS_NDFC_EBC0_CFG
>   Sets the EBC0_CFG register for the NDFC. If not defined
> diff --git a/drivers/mtd/nand/ndfc.c b/drivers/mtd/nand/ndfc.c
> index 6ebbb5e..213d2c9 100644
> --- a/drivers/mtd/nand/ndfc.c
> +++ b/drivers/mtd/nand/ndfc.c
> @@ -156,7 +156,7 @@ static uint8_t ndfc_read_byte(struct mtd_info *mtd)
>  
>   struct nand_chip *chip = mtd->priv;
>  
> -#ifdef CONFIG_SYS_NDFC_16BIT
> +#ifdef CONFIG_SYS_NAND_BUSWIDTH_16BIT
>   return (uint8_t) readw(chip->IO_ADDR_R);
>  #else
>   return readb(chip->IO_ADDR_R);
> @@ -218,7 +218,7 @@ int board_nand_init(struct nand_chip *nand)
>   nand->ecc.bytes = 3;
>   nand->select_chip = ndfc_select_chip;
>  
> -#ifdef CONFIG_SYS_NDFC_16BIT
> +#ifdef CONFIG_SYS_NAND_BUSWIDTH_16BIT
>   nand->options |= NAND_BUSWIDTH_16;
>  #endif
>  
> --
> 1.7.10.4
> 
> 

Git bundle for v11 here:
http://dl.free.fr/lWM6s9zmk

The changes in v11 are limited to 18/30 (mx31pdk.h).

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


Re: [U-Boot] [PATCH] mx28evk: add trimffs to nand command

2013-04-09 Thread Fabio Estevam
Hi Eric,

On Tue, Apr 9, 2013 at 4:21 PM, Eric Bénard  wrote:
>
> that's the second time you ask this but mx28evk_nand.h doesn't exist,
> even in u-boot-imx tree, and you are the developer who added nand
> support to mx28evk in commit
> ab461be65dbfe3e2fa45f7cd836faa99663be5bb ;-)

Right, mx28_evk.h only existed in my first version of the patch, and
then the patch I submitted handles both ENV_IS_NAND and ENV_IS_MMC
with the same config file.

Sorry for the confusion :-)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v11 25/30] arm: Remove support for smdk6400

2013-04-09 Thread Benoît Thébaudeau
The migration of boards from Makefile to boards.cfg was due for v2012.03, but
smdk6400 did not follow, and it does not build, so move it to scrapyard. It will
still be possible to restore it from the Git history before fixing it.

Signed-off-by: Benoît Thébaudeau 
---
Changes in v11: None
Changes in v10:
 - Rebase on current u-boot-arm/master.

Changes in v9:
 - Rebase following upstream changes on doc/README.scrapyard.

Changes in v8:
 - New patch.

Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 MAINTAINERS|4 -
 Makefile   |   17 --
 arch/arm/include/asm/mach-types.h  |   13 --
 board/samsung/smdk6400/.gitignore  |5 -
 board/samsung/smdk6400/Makefile|   48 -
 board/samsung/smdk6400/config.mk   |   30 ---
 board/samsung/smdk6400/lowlevel_init.S |  323 
 board/samsung/smdk6400/smdk6400.c  |  134 
 board/samsung/smdk6400/smdk6400_nand_spl.c |   36 
 board/samsung/smdk6400/u-boot-nand.lds |   90 
 doc/README.scrapyard   |1 +
 include/configs/smdk6400.h |  296 -
 nand_spl/board/samsung/smdk6400/Makefile   |  117 --
 nand_spl/board/samsung/smdk6400/config.mk  |   40 
 nand_spl/board/samsung/smdk6400/u-boot.lds |   82 ---
 15 files changed, 1 insertion(+), 1235 deletions(-)
 delete mode 100644 board/samsung/smdk6400/.gitignore
 delete mode 100644 board/samsung/smdk6400/Makefile
 delete mode 100644 board/samsung/smdk6400/config.mk
 delete mode 100644 board/samsung/smdk6400/lowlevel_init.S
 delete mode 100644 board/samsung/smdk6400/smdk6400.c
 delete mode 100644 board/samsung/smdk6400/smdk6400_nand_spl.c
 delete mode 100644 board/samsung/smdk6400/u-boot-nand.lds
 delete mode 100644 include/configs/smdk6400.h
 delete mode 100644 nand_spl/board/samsung/smdk6400/Makefile
 delete mode 100644 nand_spl/board/samsung/smdk6400/config.mk
 delete mode 100644 nand_spl/board/samsung/smdk6400/u-boot.lds

diff --git a/MAINTAINERS b/MAINTAINERS
index e131f80..bbab5fe 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1030,10 +1030,6 @@ Vladimir Zapolskiy 
 
devkit3250  lpc32xx
 
-Zhong Hongbo 
-
-   SMDK6400ARM1176 (S3C6400 SoC)
-
 Nobuhiro Iwamatsu 
 Tetsuyuki Kobayashi 
 
diff --git a/Makefile b/Makefile
index df03974..e0f2c86 100644
--- a/Makefile
+++ b/Makefile
@@ -784,23 +784,6 @@ lcname = $(shell echo $(1) | sed -e 
's/\(.*\)_config/\L\1/')
 ucname = $(shell echo $(1) | sed -e 's/\(.*\)_config/\U\1/')
 
 #
-## ARM1176 Systems
-#
-smdk6400_noUSB_config  \
-smdk6400_config:   unconfig
-   @mkdir -p $(obj)include $(obj)board/samsung/smdk6400
-   @mkdir -p $(obj)nand_spl/board/samsung/smdk6400
-   @echo "#define CONFIG_NAND_U_BOOT" > $(obj)include/config.h
-   @echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk
-   @if [ -z "$(findstring smdk6400_noUSB_config,$@)" ]; then   
\
-   echo "RAM_TEXT = 0x57e0" >> 
$(obj)board/samsung/smdk6400/config.tmp;\
-   else
\
-   echo "RAM_TEXT = 0xc7e0" >> 
$(obj)board/samsung/smdk6400/config.tmp;\
-   fi
-   @$(MKCONFIG) smdk6400 arm arm1176 smdk6400 samsung s3c64xx
-   @echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk
-
-#
 #
 
 clean:
diff --git a/arch/arm/include/asm/mach-types.h 
b/arch/arm/include/asm/mach-types.h
index a676b6d..440b041 100644
--- a/arch/arm/include/asm/mach-types.h
+++ b/arch/arm/include/asm/mach-types.h
@@ -223,7 +223,6 @@ extern unsigned int __machine_arch_type;
 #define MACH_TYPE_MIOA701  1257
 #define MACH_TYPE_ARMADILLO5X0 1260
 #define MACH_TYPE_CC9P9360JS   1264
-#define MACH_TYPE_SMDK6400 1270
 #define MACH_TYPE_NOKIA_N800   1271
 #define MACH_TYPE_EP80219  1281
 #define MACH_TYPE_GORAMO_MLR   1292
@@ -3640,18 +3639,6 @@ extern unsigned int __machine_arch_type;
 # define machine_is_cc9p9360js()   (0)
 #endif
 
-#ifdef CONFIG_MACH_SMDK6400
-# ifdef machine_arch_type
-#  undef machine_arch_type
-#  define machine_arch_type__machine_arch_type
-# else
-#  define machine_arch_typeMACH_TYPE_SMDK6400
-# endif
-# define machine_is_smdk6400() (machine_arch_type == MACH_TYPE_SMDK6400)
-#else
-# define machine_is_smdk6400() (0)
-#endif
-
 #ifdef CONFIG_MACH_NOKIA_N800
 # ifdef machine_arch_type
 #  undef machine_arch_type
diff --git a/board/samsung/smdk6400/.gitignore 
b

[U-Boot] [PATCH v11 26/30] Revert "mkconfig: start deprecating Makefile config targets"

2013-04-09 Thread Benoît Thébaudeau
This reverts commit 1285a2808a254f3d1a809c1a541f0c0f746e03d7 since the migration
of boards from Makefile to boards.cfg is now complete.

Signed-off-by: Benoît Thébaudeau 
---
Changes in v11: None
Changes in v10: None
Changes in v9: None
Changes in v8:
 - New patch.

Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 doc/feature-removal-schedule.txt |   16 
 mkconfig |9 -
 2 files changed, 25 deletions(-)

diff --git a/doc/feature-removal-schedule.txt b/doc/feature-removal-schedule.txt
index 58db440..ce72861 100644
--- a/doc/feature-removal-schedule.txt
+++ b/doc/feature-removal-schedule.txt
@@ -51,22 +51,6 @@ Who: Andy Fleming  and driver 
maintainers
 
 ---
 
-What:  boards with xxx_config targets in top level Makefile
-When:  Release v2012.03
-
-Why:   We have a boards.cfg file which the vast majority of boards have
-   converted over to.  Boards that still manually run mkconfig in the
-   top level Makefile are either dead, or the maintainer doesn't care,
-   or they are doing something weird/wrong that should be fixed in a
-   different way, or they need to extend boards.cfg syntax (unlikely).
-
-   In any case, if no one cares about these boards to figure out how
-   to make boards.cfg work, then we'll just punt them.
-
-Who:   Mike Frysinger 
-

-
 What:  GPL cleanup
 When:  August 2009
 Why:   Over time, a couple of files have sneaked in into the U-Boot
diff --git a/mkconfig b/mkconfig
index 7c9aa74..73f852e 100755
--- a/mkconfig
+++ b/mkconfig
@@ -29,15 +29,6 @@ if [ \( $# -eq 2 \) -a \( "$1" = "-A" \) ] ; then
set ${line}
# add default board name if needed
[ $# = 3 ] && set ${line} ${1}
-elif [ "${MAKEFLAGS+set}${MAKELEVEL+set}" = "setset" ] ; then
-   # only warn when using a config target in the Makefile
-   cat <<-EOF
-
-   warning: Please migrate to boards.cfg.  Failure to do so will
-mean removal of your board in the next release.
-
-   EOF
-   sleep 5
 fi
 
 while [ $# -gt 0 ] ; do
-- 
1.7.10.4

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


[U-Boot] [PATCH v11 30/30] arm: Make all linker scripts compatible with per-symbol sections

2013-04-09 Thread Benoît Thébaudeau
Let all ARM linker scripts handle properly -ffunction-sections
and -fdata-sections. This will be useful for future changes in order to create
symbol-specific sections in common .S files.

Signed-off-by: Benoît Thébaudeau 
---
Changes in v11: None
Changes in v10:
 - Rebase on current u-boot-arm/master.

Changes in v9:
 - Reword following the removal of "arm: Remove duplicated start.S code".

Changes in v8:
 - New patch.

Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/arm/cpu/arm1136/u-boot-spl.lds|2 +-
 arch/arm/cpu/arm920t/ep93xx/u-boot.lds |   10 +-
 arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds  |6 +++---
 arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds|6 +++---
 arch/arm/cpu/armv7/omap-common/u-boot-spl.lds  |2 +-
 arch/arm/cpu/armv7/socfpga/u-boot-spl.lds  |2 +-
 board/ait/cam_enc_4xx/u-boot-spl.lds   |2 +-
 board/davinci/da8xxevm/u-boot-spl-da850evm.lds |2 +-
 board/davinci/da8xxevm/u-boot-spl-hawk.lds |8 
 board/freescale/mx31ads/u-boot.lds |   18 +-
 board/samsung/smdk5250/smdk5250-uboot-spl.lds  |2 +-
 board/vpac270/u-boot-spl.lds   |4 ++--
 12 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/arch/arm/cpu/arm1136/u-boot-spl.lds 
b/arch/arm/cpu/arm1136/u-boot-spl.lds
index b09b4eb..8296e5d 100644
--- a/arch/arm/cpu/arm1136/u-boot-spl.lds
+++ b/arch/arm/cpu/arm1136/u-boot-spl.lds
@@ -38,7 +38,7 @@ SECTIONS
.text  :
{
__start = .;
- arch/arm/cpu/arm1136/start.o  (.text)
+ arch/arm/cpu/arm1136/start.o  (.text*)
  *(.text*)
} >.sram
 
diff --git a/arch/arm/cpu/arm920t/ep93xx/u-boot.lds 
b/arch/arm/cpu/arm920t/ep93xx/u-boot.lds
index d0b1ada..cf55bf7 100644
--- a/arch/arm/cpu/arm920t/ep93xx/u-boot.lds
+++ b/arch/arm/cpu/arm920t/ep93xx/u-boot.lds
@@ -31,18 +31,18 @@ SECTIONS
. = ALIGN(4);
.text  :
{
- arch/arm/cpu/arm920t/start.o  (.text)
+ arch/arm/cpu/arm920t/start.o  (.text*)
/* the EP93xx expects to find the pattern 'CRUS' at 0x1000 */
  . = 0x1000;
  LONG(0x53555243)
- *(.text)
+ *(.text*)
}
 
. = ALIGN(4);
-   .rodata : { *(.rodata) }
+   .rodata : { *(.rodata*) }
 
. = ALIGN(4);
-   .data : { *(.data) }
+   .data : { *(.data*) }
 
. = ALIGN(4);
.got : { *(.got) }
@@ -59,7 +59,7 @@ SECTIONS
__image_copy_end = .;
 
__bss_start = .;
-   .bss : { *(.bss) }
+   .bss : { *(.bss*) }
__bss_end = .;
 
_end = .;
diff --git a/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds 
b/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds
index 67b204e..673c725 100644
--- a/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds
+++ b/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds
@@ -37,8 +37,8 @@ SECTIONS
. = ALIGN(4);
.text   :
{
-   arch/arm/cpu/arm926ejs/mxs/start.o  (.text)
-   *(.text)
+   arch/arm/cpu/arm926ejs/mxs/start.o  (.text*)
+   *(.text*)
}
 
. = ALIGN(4);
@@ -46,7 +46,7 @@ SECTIONS
 
. = ALIGN(4);
.data : {
-   *(.data)
+   *(.data*)
}
 
. = ALIGN(4);
diff --git a/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds 
b/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds
index 7405917..967a135 100644
--- a/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds
+++ b/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds
@@ -37,8 +37,8 @@ SECTIONS
. = ALIGN(4);
.text   :
{
-   arch/arm/cpu/arm926ejs/spear/start.o(.text)
-   *(.text)
+   arch/arm/cpu/arm926ejs/spear/start.o(.text*)
+   *(.text*)
}
 
. = ALIGN(4);
@@ -46,7 +46,7 @@ SECTIONS
 
. = ALIGN(4);
.data : {
-   *(.data)
+   *(.data*)
}
 
. = ALIGN(4);
diff --git a/arch/arm/cpu/armv7/omap-common/u-boot-spl.lds 
b/arch/arm/cpu/armv7/omap-common/u-boot-spl.lds
index efae381..bd218c0 100644
--- a/arch/arm/cpu/armv7/omap-common/u-boot-spl.lds
+++ b/arch/arm/cpu/armv7/omap-common/u-boot-spl.lds
@@ -38,7 +38,7 @@ SECTIONS
.text  :
{
__start = .;
-   arch/arm/cpu/armv7/start.o  (.text)
+   arch/arm/cpu/armv7/start.o  (.text*)
*(.text*)
} >.sram
 
diff --git a/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds 
b/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds
index 79cc93c..15f8c01 100644
--- a/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds
+++ b/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds
@@ -27,7 +27,7 @@ SECTIONS
. = ALIGN(4);
.text   :
{
-   arch/arm/cpu/armv7/start.o  (.text)
+   arch/arm/cpu/armv7/start.o  (.text*)
*(

[U-Boot] [PATCH v11 29/30] arm1176: Remove unused MMU setup from start.S

2013-04-09 Thread Benoît Thébaudeau
Following the removal of the smdk6400 board, the MMU setup code in
arm1176/start.S becomes unused, so remove it. It will still be possible to
restore it later from the Git history if necessary, in which case it should be
moved out of the relocate_code() function.

Signed-off-by: Benoît Thébaudeau 
---
Changes in v11: None
Changes in v10: None
Changes in v9:
 - Do not use "scrapyard" in patch description because this is reserved to refer
   to the board scrapyard file.

Changes in v8:
 - New patch.

Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/arm/cpu/arm1176/start.S |   91 +-
 1 file changed, 1 insertion(+), 90 deletions(-)

diff --git a/arch/arm/cpu/arm1176/start.S b/arch/arm/cpu/arm1176/start.S
index a7cf728..1fc1da0 100644
--- a/arch/arm/cpu/arm1176/start.S
+++ b/arch/arm/cpu/arm1176/start.S
@@ -33,11 +33,8 @@
 #include 
 #include 
 #include 
-#ifdef CONFIG_ENABLE_MMU
-#include 
-#endif
 
-#if !defined(CONFIG_ENABLE_MMU) && !defined(CONFIG_SYS_PHY_UBOOT_BASE)
+#ifndef CONFIG_SYS_PHY_UBOOT_BASE
 #define CONFIG_SYS_PHY_UBOOT_BASE  CONFIG_SYS_UBOOT_BASE
 #endif
 
@@ -105,14 +102,6 @@ _TEXT_BASE:
 #endif
 
 /*
- * Below variable is very important because we use MMU in U-Boot.
- * Without it, we cannot run code correctly before MMU is ON.
- * by scsuh.
- */
-_TEXT_PHY_BASE:
-   .word   CONFIG_SYS_PHY_UBOOT_BASE
-
-/*
  * These are defined in the board-specific linker script.
  * Subtracting _start from them lets the linker put their
  * relative position in the executable instead of leaving
@@ -298,44 +287,6 @@ fixnext:
blo fixloop
 #endif
 
-#ifdef CONFIG_ENABLE_MMU
-enable_mmu:
-   /* enable domain access */
-   ldr r5, =0x
-   mcr p15, 0, r5, c3, c0, 0   /* load domain access register */
-
-   /* Set the TTB register */
-   ldr r0, _mmu_table_base
-   ldr r1, =CONFIG_SYS_PHY_UBOOT_BASE
-   ldr r2, =0xfff0
-   bic r0, r0, r2
-   orr r1, r0, r1
-   mcr p15, 0, r1, c2, c0, 0
-
-   /* Enable the MMU */
-   mrc p15, 0, r0, c1, c0, 0
-   orr r0, r0, #1  /* Set CR_M to enable MMU */
-
-   /* Prepare to enable the MMU */
-   adr r1, skip_hw_init
-   and r1, r1, #0x3fc
-   ldr r2, _TEXT_BASE
-   ldr r3, =0xfff0
-   and r2, r2, r3
-   orr r2, r2, r1
-   b   mmu_enable
-
-   .align 5
-   /* Run in a single cache-line */
-mmu_enable:
-
-   mcr p15, 0, r0, c1, c0, 0
-   nop
-   nop
-   mov pc, r2
-skip_hw_init:
-#endif
-
 relocate_done:
 
bx  lr
@@ -347,11 +298,6 @@ _rel_dyn_end_ofs:
 _dynsym_start_ofs:
.word __dynsym_start - _start
 
-#ifdef CONFIG_ENABLE_MMU
-_mmu_table_base:
-   .word mmu_table
-#endif
-
.globl  c_runtime_cpu_setup
 c_runtime_cpu_setup:
 
@@ -359,41 +305,6 @@ c_runtime_cpu_setup:
 
 #ifndef CONFIG_SPL_BUILD
 /*
- * we assume that cache operation is done before. (eg. cleanup_before_linux())
- * actually, we don't need to do anything about cache if not use d-cache in
- * U-Boot. So, in this function we clean only MMU. by scsuh
- *
- * voidtheLastJump(void *kernel, int arch_num, uint boot_params);
- */
-#ifdef CONFIG_ENABLE_MMU
-   .globl theLastJump
-theLastJump:
-   mov r9, r0
-   ldr r3, =0xfff0
-   ldr r4, _TEXT_PHY_BASE
-   adr r5, phy_last_jump
-   bic r5, r5, r3
-   orr r5, r5, r4
-   mov pc, r5
-phy_last_jump:
-   /*
-* disable MMU stuff
-*/
-   mrc p15, 0, r0, c1, c0, 0
-   bic r0, r0, #0x2300 /* clear bits 13, 9:8 (--V- --RS) */
-   bic r0, r0, #0x0087 /* clear bits 7, 2:0 (B--- -CAM) */
-   orr r0, r0, #0x0002 /* set bit 2 (A) Align */
-   orr r0, r0, #0x1000 /* set bit 12 (I) I-Cache */
-   mcr p15, 0, r0, c1, c0, 0
-
-   mcr p15, 0, r0, c8, c7, 0   /* flush v4 TLB */
-
-   mov r0, #0
-   mov pc, r9
-#endif
-
-
-/*
  *
  *
  * Interrupt handling
-- 
1.7.10.4

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


[U-Boot] [PATCH v11 28/30] arm: Remove deprecated and now unused NAND SPL

2013-04-09 Thread Benoît Thébaudeau
Signed-off-by: Benoît Thébaudeau 
---
Changes in v11: None
Changes in v10: None
Changes in v9: None
Changes in v8:
 - New patch.

Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/arm/config.mk   |2 --
 arch/arm/cpu/arm1176/start.S |   12 
 arch/arm/lib/crt0.S  |   16 ++--
 3 files changed, 6 insertions(+), 24 deletions(-)

diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index e7839be..461899e 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -87,9 +87,7 @@ endif
 endif
 
 # needed for relocation
-ifndef CONFIG_NAND_SPL
 LDFLAGS_u-boot += -pie
-endif
 
 #
 # FIXME: binutils versions < 2.22 have a bug in the assembler where
diff --git a/arch/arm/cpu/arm1176/start.S b/arch/arm/cpu/arm1176/start.S
index 5654c19..a7cf728 100644
--- a/arch/arm/cpu/arm1176/start.S
+++ b/arch/arm/cpu/arm1176/start.S
@@ -51,7 +51,7 @@
 
 .globl _start
 _start: b  reset
-#ifndef CONFIG_NAND_SPL
+#ifndef CONFIG_SPL_BUILD
ldr pc, _undefined_instruction
ldr pc, _software_interrupt
ldr pc, _prefetch_abort
@@ -98,15 +98,11 @@ _end_vect:
 
 .globl _TEXT_BASE
 _TEXT_BASE:
-#ifdef CONFIG_NAND_SPL /* deprecated, use instead CONFIG_SPL_BUILD */
-   .word   CONFIG_SYS_TEXT_BASE
-#else
 #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
.word   CONFIG_SPL_TEXT_BASE
 #else
.word   CONFIG_SYS_TEXT_BASE
 #endif
-#endif
 
 /*
  * Below variable is very important because we use MMU in U-Boot.
@@ -176,7 +172,7 @@ cpu_init_crit:
 * When booting from NAND - it has definitely been a reset, so, no need
 * to flush caches and disable the MMU
 */
-#ifndef CONFIG_NAND_SPL
+#ifndef CONFIG_SPL_BUILD
/*
 * flush v4 I/D caches
 */
@@ -361,7 +357,7 @@ c_runtime_cpu_setup:
 
mov pc, lr
 
-#ifndef CONFIG_NAND_SPL
+#ifndef CONFIG_SPL_BUILD
 /*
  * we assume that cache operation is done before. (eg. cleanup_before_linux())
  * actually, we don't need to do anything about cache if not use d-cache in
@@ -539,4 +535,4 @@ fiq:
get_bad_stack
bad_save_user_regs
bl  do_fiq
-#endif /* CONFIG_NAND_SPL */
+#endif /* CONFIG_SPL_BUILD */
diff --git a/arch/arm/lib/crt0.S b/arch/arm/lib/crt0.S
index fa25319..a9657d1 100644
--- a/arch/arm/lib/crt0.S
+++ b/arch/arm/lib/crt0.S
@@ -64,7 +64,7 @@
  *have some work left to do at this point regarding memory, so
  *call c_runtime_cpu_setup.
  *
- * 6. Branch to either nand_boot() or board_init_r().
+ * 6. Branch to board_init_r().
  */
 
 /*
@@ -77,10 +77,7 @@ ENTRY(_main)
  * Set up initial C runtime environment and call board_init_f(0).
  */
 
-#if defined(CONFIG_NAND_SPL)
-   /* deprecated, use instead CONFIG_SPL_BUILD */
-   ldr sp, =(CONFIG_SYS_INIT_SP_ADDR)
-#elif defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_STACK)
+#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_STACK)
ldr sp, =(CONFIG_SPL_STACK)
 #else
ldr sp, =(CONFIG_SYS_INIT_SP_ADDR)
@@ -129,21 +126,12 @@ clbss_l:cmp   r0, r1  /* while not at 
end of BSS */
bl coloured_LED_init
bl red_led_on
 
-#if defined(CONFIG_NAND_SPL)
-
-   /* call _nand_boot() */
-   ldr pc, =nand_boot
-
-#else
-
/* call board_init_r(gd_t *id, ulong dest_addr) */
mov r0, r8  /* gd_t */
ldr r1, [r8, #GD_RELOCADDR] /* dest_addr */
/* call board_init_r */
ldr pc, =board_init_r   /* this is auto-relocated! */
 
-#endif
-
/* we should not return here. */
 
 #endif
-- 
1.7.10.4

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


[U-Boot] [PATCH v11 18/30] nand: mxc: Switch NAND SPL to generic SPL

2013-04-09 Thread Benoît Thébaudeau
This also fixes support for mx31pdk and tx25, which had been broken by commit
e05e5de7fae5bec79617e113916dac6631251156.

Signed-off-by: Benoît Thébaudeau 
Acked-by: Scott Wood 
Tested-by: Fabio Estevam 
---
Changes in v11:
 - mx31pdk: Rename u-boot-nand.bin to u-boot-with-spl.bin (new target binary
   name) in prg_uboot command.
 - mx31pdk: Enlarge CONFIG_SYS_NAND_U_BOOT_SIZE from 0x32000 to 0x3f800 (which
   corresponds to the size allocated for this purpose in NAND Flash) in order to
   leave enough room whatever the toolchain used.
 - mx31pdk: Set back CONFIG_SPL_TEXT_BASE and CONFIG_SYS_TEXT_BASE by 0x0010
   because the original U-Boot at CONFIG_SYS_TEXT_BASE was overlapping the
   global data being written prior to relocation by
   arch/arm/lib/board.c:board_init_f().

Changes in v10:
 - Rebase on current u-boot-arm/master, especially following commits 3ebd1cb and
   65cdd64, which make it necessary to change CONFIG_SPL_LDSCRIPT to
   "arch/$(ARCH)/cpu/u-boot-spl.lds" for mx31pdk.h and tx25.h.

Changes in v9: None
Changes in v8:
 - Update doc/README.arm-relocation.
 - Drop useless line feed at end of inline asm.
 - Set CONFIG_SYS_NAND_U_BOOT_OFFS to CONFIG_SPL_PAD_TO instead of
   CONFIG_SPL_MAX_SIZE (this is a cosmetic change since they now have the same
   value).
 - Enlarge CONFIG_SYS_NAND_U_BOOT_SIZE from 0x3 to 0x32000 to let u-boot.bin
   fit in for mx31pdk.

Changes in v7: None
Changes in v6:
 - Automate 'u-boot.imx' and 'SPL' make targets for all imx processors.
 - Move board_init_f() to .c.
 - Get rid of board SPL linker scripts.
 - Define CONFIG_SYS_NAND_U_BOOT_OFFS as CONFIG_SPL_MAX_SIZE rather than
   duplicating the constant value.
 - Define CONFIG_SYS_NAND_U_BOOT_DST as CONFIG_SYS_TEXT_BASE rather than
   duplicating the constant value.
 - Pass 0 as the 1st argument to relocate_code() since it's unused.
 - Fix stack pointers.
 - Rebase on latest u-boot-imx/master.
 - Move unrelated changes to separate patches.

Changes in v5:
 - Remove spaces between function name and open parenthesis.
 - Fix mx31pdk and tx25 Makefile-s and SPL linker scripts.
 - Remove the useless definition of CONFIG_SPL_LDSCRIPT.
 - Fix the call to nand_boot().

Changes in v4:
 - New patch.

Changes in v3: None
Changes in v2: None

 arch/arm/cpu/arm926ejs/start.S |3 +-
 board/freescale/mx31pdk/Makefile   |3 +
 board/freescale/mx31pdk/config.mk  |5 --
 board/freescale/mx31pdk/mx31pdk.c  |8 ++
 board/karo/tx25/Makefile   |4 +-
 board/karo/tx25/config.mk  |5 --
 board/karo/tx25/tx25.c |8 ++
 boards.cfg |2 +-
 doc/README.arm-relocation  |   14 ++--
 drivers/mtd/nand/Makefile  |1 +
 drivers/mtd/nand/mxc_nand.c|   10 +--
 include/fsl_nfc.h => drivers/mtd/nand/mxc_nand.h   |   10 +--
 .../mtd/nand/mxc_nand_spl.c|   26 ++
 include/configs/mx31pdk.h  |   21 +++--
 include/configs/tx25.h |   22 +++--
 nand_spl/board/freescale/mx31pdk/Makefile  |   63 --
 nand_spl/board/freescale/mx31pdk/u-boot.lds|   87 
 nand_spl/board/karo/tx25/Makefile  |   84 ---
 nand_spl/board/karo/tx25/config.mk |1 -
 nand_spl/board/karo/tx25/u-boot.lds|   87 
 20 files changed, 81 insertions(+), 383 deletions(-)
 delete mode 100644 board/freescale/mx31pdk/config.mk
 delete mode 100644 board/karo/tx25/config.mk
 rename include/fsl_nfc.h => drivers/mtd/nand/mxc_nand.h (98%)
 rename nand_spl/nand_boot_fsl_nfc.c => drivers/mtd/nand/mxc_nand_spl.c (92%)
 delete mode 100644 nand_spl/board/freescale/mx31pdk/Makefile
 delete mode 100644 nand_spl/board/freescale/mx31pdk/u-boot.lds
 delete mode 100644 nand_spl/board/karo/tx25/Makefile
 delete mode 100644 nand_spl/board/karo/tx25/config.mk
 delete mode 100644 nand_spl/board/karo/tx25/u-boot.lds

diff --git a/arch/arm/cpu/arm926ejs/start.S b/arch/arm/cpu/arm926ejs/start.S
index 552279f..0a9cf1d 100644
--- a/arch/arm/cpu/arm926ejs/start.S
+++ b/arch/arm/cpu/arm926ejs/start.S
@@ -200,7 +200,6 @@ reset:
 
 
/*--*/
 
-#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_NAND_SPL)
 /*
  * void relocate_code (addr_sp, gd, addr_moni)
  *
@@ -269,6 +268,8 @@ relocate_done:
 
bx  lr
 
+#ifndef CONFIG_SPL_BUILD
+
 _rel_dyn_start_ofs:
.word __rel_dyn_start - _start
 _rel_dyn_end_ofs:
diff --git a/board/freescale/mx31pdk/Makefile b/board/freescale/mx31pdk/Makefile
index 5b7cafd..b910722 100644
--- a/board/freescale/mx31pdk/Makefile
+++ b/board/freescale/mx31pdk/Makefile
@@ -27,6 +27,9 @@ include $(TOPDIR)/config.mk
 
 LIB= $(

[U-Boot] [PATCH v11 23/30] imx: Add u-boot-with-spl.imx make target

2013-04-09 Thread Benoît Thébaudeau
This image combines the SPL with the i.MX header and U-Boot. This is a
convenient way of having a single image to program on some boot devices.

The i.MX header has to be added to the SPL before appending U-Boot, so that the
boot ROM loads only the SPL.

Signed-off-by: Benoît Thébaudeau 
---
Changes in v11: None
Changes in v10: None
Changes in v9: None
Changes in v8:
 - Use CONFIG_SPL_PAD_TO instead of CONFIG_SPL_MAX_SIZE for padding, which
   allows to pad the SPL after adding the i.MX header, which may save time when
   the boot ROM loads the SPL.
 - Add /u-boot-with-spl.imx to .gitignore.

Changes in v7:
 - New patch.

Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 .gitignore   |1 +
 Makefile |5 +
 arch/arm/imx-common/Makefile |6 ++
 3 files changed, 12 insertions(+)

diff --git a/.gitignore b/.gitignore
index bff721e..e42d837 100644
--- a/.gitignore
+++ b/.gitignore
@@ -30,6 +30,7 @@
 /u-boot
 /u-boot.hex
 /u-boot.imx
+/u-boot-with-spl.imx
 /u-boot.map
 /u-boot.srec
 /u-boot.ldr
diff --git a/Makefile b/Makefile
index caca851..e22faa5 100644
--- a/Makefile
+++ b/Makefile
@@ -486,6 +486,10 @@ $(obj)u-boot-with-spl.bin: $(obj)spl/u-boot-spl.bin 
$(obj)u-boot.bin
cat $(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin > $@
rm $(obj)spl/u-boot-spl-pad.bin
 
+$(obj)u-boot-with-spl.imx: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
+   $(MAKE) -C $(SRCTREE)/arch/arm/imx-common \
+   $(OBJTREE)/u-boot-with-spl.imx
+
 $(obj)u-boot.ubl:   $(obj)u-boot-with-spl.bin
$(obj)tools/mkimage -n $(UBL_CONFIG) -T ublimage \
-e $(CONFIG_SYS_TEXT_BASE) -d $< $(obj)u-boot.ubl
@@ -850,6 +854,7 @@ clobber:tidy
@rm -f $(obj)u-boot.kwb
@rm -f $(obj)u-boot.pbl
@rm -f $(obj)u-boot.imx
+   @rm -f $(obj)u-boot-with-spl.imx
@rm -f $(obj)u-boot.ubl
@rm -f $(obj)u-boot.ais
@rm -f $(obj)u-boot.dtb
diff --git a/arch/arm/imx-common/Makefile b/arch/arm/imx-common/Makefile
index 428a57e..f59ae6f 100644
--- a/arch/arm/imx-common/Makefile
+++ b/arch/arm/imx-common/Makefile
@@ -55,6 +55,12 @@ $(OBJTREE)/SPL: $(OBJTREE)/spl/u-boot-spl.bin 
$(OBJTREE)/$(patsubst "%",%,$(CONF
$(OBJTREE)/tools/mkimage -n $(filter-out %.bin,$^) -T imximage \
-e $(CONFIG_SPL_TEXT_BASE) -d $< $@
 
+$(OBJTREE)/u-boot-with-spl.imx: $(OBJTREE)/SPL $(OBJTREE)/u-boot.bin
+   $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(CONFIG_SPL_PAD_TO) \
+   -I binary -O binary $< $(OBJTREE)/spl/u-boot-spl-pad.imx
+   cat $(OBJTREE)/spl/u-boot-spl-pad.imx $(OBJTREE)/u-boot.bin > $@
+   rm $(OBJTREE)/spl/u-boot-spl-pad.imx
+
 
 #
 
-- 
1.7.10.4

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


[U-Boot] [PATCH v11 24/30] imx: Add u-boot-with-nand-spl.imx make target

2013-04-09 Thread Benoît Thébaudeau
This image combines the SPL with the i.MX header, the FCB and U-Boot.

For i.MX25/35/51, the FCB is ignored by the boot ROM, so this image is just
useful because it can be programmed on a NAND Flash page boundary.

For i.MX53, the FCB is required by the boot ROM.

This does not support i.MX6 so far because its FCB is more complicated.

Signed-off-by: Benoît Thébaudeau 
---
Changes in v11: None
Changes in v10: None
Changes in v9: None
Changes in v8:
 - Change the dummy 1024-byte header into a true FCB in order to add support for
   i.MX53.
 - Use CONFIG_SPL_PAD_TO instead of CONFIG_SPL_MAX_SIZE for padding, which
   allows to pad the SPL after adding the i.MX header and the FCB, which may
   save time when the boot ROM loads the SPL.
 - Add /u-boot-with-nand-spl.imx to .gitignore.

Changes in v7:
 - New patch.

Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 .gitignore   |1 +
 Makefile |5 +
 arch/arm/imx-common/Makefile |   11 +++
 3 files changed, 17 insertions(+)

diff --git a/.gitignore b/.gitignore
index e42d837..ed21203 100644
--- a/.gitignore
+++ b/.gitignore
@@ -31,6 +31,7 @@
 /u-boot.hex
 /u-boot.imx
 /u-boot-with-spl.imx
+/u-boot-with-nand-spl.imx
 /u-boot.map
 /u-boot.srec
 /u-boot.ldr
diff --git a/Makefile b/Makefile
index e22faa5..df03974 100644
--- a/Makefile
+++ b/Makefile
@@ -490,6 +490,10 @@ $(obj)u-boot-with-spl.imx: $(obj)spl/u-boot-spl.bin 
$(obj)u-boot.bin
$(MAKE) -C $(SRCTREE)/arch/arm/imx-common \
$(OBJTREE)/u-boot-with-spl.imx
 
+$(obj)u-boot-with-nand-spl.imx: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
+   $(MAKE) -C $(SRCTREE)/arch/arm/imx-common \
+   $(OBJTREE)/u-boot-with-nand-spl.imx
+
 $(obj)u-boot.ubl:   $(obj)u-boot-with-spl.bin
$(obj)tools/mkimage -n $(UBL_CONFIG) -T ublimage \
-e $(CONFIG_SYS_TEXT_BASE) -d $< $(obj)u-boot.ubl
@@ -855,6 +859,7 @@ clobber:tidy
@rm -f $(obj)u-boot.pbl
@rm -f $(obj)u-boot.imx
@rm -f $(obj)u-boot-with-spl.imx
+   @rm -f $(obj)u-boot-with-nand-spl.imx
@rm -f $(obj)u-boot.ubl
@rm -f $(obj)u-boot.ais
@rm -f $(obj)u-boot.dtb
diff --git a/arch/arm/imx-common/Makefile b/arch/arm/imx-common/Makefile
index f59ae6f..44b6822 100644
--- a/arch/arm/imx-common/Makefile
+++ b/arch/arm/imx-common/Makefile
@@ -61,6 +61,17 @@ $(OBJTREE)/u-boot-with-spl.imx: $(OBJTREE)/SPL 
$(OBJTREE)/u-boot.bin
cat $(OBJTREE)/spl/u-boot-spl-pad.imx $(OBJTREE)/u-boot.bin > $@
rm $(OBJTREE)/spl/u-boot-spl-pad.imx
 
+$(OBJTREE)/u-boot-with-nand-spl.imx: $(OBJTREE)/SPL $(OBJTREE)/u-boot.bin
+   (echo -ne '\x00\x00\x00\x00\x46\x43\x42\x20\x01' && \
+   dd bs=1015 count=1 if=/dev/zero 2>/dev/null) | \
+   cat - $< > $(OBJTREE)/spl/u-boot-nand-spl.imx
+   $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(CONFIG_SPL_PAD_TO) \
+   -I binary -O binary $(OBJTREE)/spl/u-boot-nand-spl.imx \
+   $(OBJTREE)/spl/u-boot-nand-spl-pad.imx
+   rm $(OBJTREE)/spl/u-boot-nand-spl.imx
+   cat $(OBJTREE)/spl/u-boot-nand-spl-pad.imx $(OBJTREE)/u-boot.bin > $@
+   rm $(OBJTREE)/spl/u-boot-nand-spl-pad.imx
+
 
 #
 
-- 
1.7.10.4

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


[U-Boot] [PATCH v11 20/30] arm: Remove unused relocate_code() parameters

2013-04-09 Thread Benoît Thébaudeau
Commit e05e5de7fae5bec79617e113916dac6631251156 made the 2 1st parameters of
ARM's relocate_code() useless since it moved the code handling them to crt0.S.
So, drop these parameters.

Signed-off-by: Benoît Thébaudeau 
---
Changes in v11: None
Changes in v10: None
Changes in v9: None
Changes in v8:
 - Update the function prototype in start.S comments.

Changes in v7: None
Changes in v6:
 - New patch.

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/arm/cpu/arm1136/start.S   |6 ++
 arch/arm/cpu/arm1176/start.S   |6 ++
 arch/arm/cpu/arm720t/start.S   |6 ++
 arch/arm/cpu/arm920t/start.S   |6 ++
 arch/arm/cpu/arm925t/start.S   |6 ++
 arch/arm/cpu/arm926ejs/start.S |6 ++
 arch/arm/cpu/arm946es/start.S  |6 ++
 arch/arm/cpu/arm_intcm/start.S |6 ++
 arch/arm/cpu/armv7/start.S |6 ++
 arch/arm/cpu/ixp/start.S   |6 ++
 arch/arm/cpu/pxa/start.S   |6 ++
 arch/arm/cpu/s3c44b0/start.S   |6 ++
 arch/arm/cpu/sa1100/start.S|6 ++
 arch/arm/lib/crt0.S|8 +++-
 board/freescale/mx31pdk/mx31pdk.c  |2 +-
 board/karo/tx25/tx25.c |2 +-
 board/samsung/smdk6400/smdk6400_nand_spl.c |3 +--
 include/common.h   |8 
 18 files changed, 36 insertions(+), 65 deletions(-)

diff --git a/arch/arm/cpu/arm1136/start.S b/arch/arm/cpu/arm1136/start.S
index e36d7d3..ad24b80 100644
--- a/arch/arm/cpu/arm1136/start.S
+++ b/arch/arm/cpu/arm1136/start.S
@@ -174,15 +174,13 @@ next:
 
/*--*/
 
 /*
- * void relocate_code (addr_sp, gd, addr_moni)
+ * void relocate_code(addr_moni)
  *
  * This function relocates the monitor code.
  */
.globl  relocate_code
 relocate_code:
-   mov r4, r0  /* save addr_sp */
-   mov r5, r1  /* save addr of gd */
-   mov r6, r2  /* save addr of destination */
+   mov r6, r0  /* save addr of destination */
 
adr r0, _start
subsr9, r6, r0  /* r9 <- relocation offset */
diff --git a/arch/arm/cpu/arm1176/start.S b/arch/arm/cpu/arm1176/start.S
index 0b570d5..5654c19 100644
--- a/arch/arm/cpu/arm1176/start.S
+++ b/arch/arm/cpu/arm1176/start.S
@@ -241,15 +241,13 @@ skip_tcmdisable:
 
/*--*/
 
 /*
- * void relocate_code (addr_sp, gd, addr_moni)
+ * void relocate_code(addr_moni)
  *
  * This function relocates the monitor code.
  */
.globl  relocate_code
 relocate_code:
-   mov r4, r0  /* save addr_sp */
-   mov r5, r1  /* save addr of gd */
-   mov r6, r2  /* save addr of destination */
+   mov r6, r0  /* save addr of destination */
 
adr r0, _start
subsr9, r6, r0  /* r9 <- relocation offset */
diff --git a/arch/arm/cpu/arm720t/start.S b/arch/arm/cpu/arm720t/start.S
index a640eaa..9facc7e 100644
--- a/arch/arm/cpu/arm720t/start.S
+++ b/arch/arm/cpu/arm720t/start.S
@@ -156,15 +156,13 @@ reset:
 
/*--*/
 
 /*
- * void relocate_code (addr_sp, gd, addr_moni)
+ * void relocate_code(addr_moni)
  *
  * This function relocates the monitor code.
  */
.globl  relocate_code
 relocate_code:
-   mov r4, r0  /* save addr_sp */
-   mov r5, r1  /* save addr of gd */
-   mov r6, r2  /* save addr of destination */
+   mov r6, r0  /* save addr of destination */
 
adr r0, _start
subsr9, r6, r0  /* r9 <- relocation offset */
diff --git a/arch/arm/cpu/arm920t/start.S b/arch/arm/cpu/arm920t/start.S
index 940ce72..6250025 100644
--- a/arch/arm/cpu/arm920t/start.S
+++ b/arch/arm/cpu/arm920t/start.S
@@ -195,15 +195,13 @@ copyex:
 
/*--*/
 
 /*
- * void relocate_code (addr_sp, gd, addr_moni)
+ * void relocate_code(addr_moni)
  *
  * This function relocates the monitor code.
  */
.globl  relocate_code
 relocate_code:
-   mov r4, r0  /* save addr_sp */
-   mov r5, r1  /* save addr of gd */
-   mov r6, r2  /* save addr of destination */
+   mov r6, r0  /* save addr of destination */
 
adr r0, _start
subsr9, r6, r0  /* r9 <- relocation offset */
diff --git a/arch/arm/cpu/arm925t/start.S b/arch/arm/cpu/arm925t/start.S
index ed683b4..021e241 100644
--- a/arch/arm/cpu/arm925t/start.S
+++ b/arch/arm/cpu/arm925t/start.S
@@ -185,15 +185,13 @@ poll1:
 
/*--*/
 
 /*
- * void relocate_code (

[U-Boot] [PATCH v11 17/30] imx: Fix automatic make targets for imx images

2013-04-09 Thread Benoît Thébaudeau
Automatically build the 'u-boot.imx' (i.e. imx header + u-boot.bin) and 'SPL'
(i.e. imx header + u-boot-spl.bin) make targets for all imx processors
supporting this header, so for arm926ejs, arm1136 and armv7. Some combinations
were missing.

At the same time, fix the build of SPL targets not supporting the imx header on
arm1136. For arm1136, the 'SPL' make target was forced to build in all cases if
CONFIG_SPL_BUILD was defined, even for non-imx platforms or imx setups without
an imx header.

Signed-off-by: Benoît Thébaudeau 
---
Changes in v11: None
Changes in v10: None
Changes in v9: None
Changes in v8: None
Changes in v7: None
Changes in v6:
 - New patch, extracted from "nand: mxc: Switch NAND SPL to generic SPL".

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/arm/cpu/arm1136/config.mk   |7 +++
 arch/arm/cpu/arm926ejs/config.mk |8 ++--
 arch/arm/cpu/armv7/config.mk |6 ++
 3 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/arch/arm/cpu/arm1136/config.mk b/arch/arm/cpu/arm1136/config.mk
index 9092d91..797d122 100644
--- a/arch/arm/cpu/arm1136/config.mk
+++ b/arch/arm/cpu/arm1136/config.mk
@@ -31,6 +31,13 @@ PLATFORM_CPPFLAGS += -march=armv5
 # =
 PF_RELFLAGS_SLB_AT := $(call cc-option,-mshort-load-bytes,$(call 
cc-option,-malignment-traps,))
 PLATFORM_RELFLAGS += $(PF_RELFLAGS_SLB_AT)
+
+ifneq ($(CONFIG_IMX_CONFIG),)
+ifdef CONFIG_SPL
 ifdef CONFIG_SPL_BUILD
 ALL-y  += $(OBJTREE)/SPL
 endif
+else
+ALL-y  += $(obj)u-boot.imx
+endif
+endif
diff --git a/arch/arm/cpu/arm926ejs/config.mk b/arch/arm/cpu/arm926ejs/config.mk
index 6a3a1bb..f0e31d1 100644
--- a/arch/arm/cpu/arm926ejs/config.mk
+++ b/arch/arm/cpu/arm926ejs/config.mk
@@ -33,7 +33,11 @@ PF_RELFLAGS_SLB_AT := $(call 
cc-option,-mshort-load-bytes,$(call cc-option,-mali
 PLATFORM_RELFLAGS += $(PF_RELFLAGS_SLB_AT)
 
 ifneq ($(CONFIG_IMX_CONFIG),)
-
+ifdef CONFIG_SPL
+ifdef CONFIG_SPL_BUILD
+ALL-y  += $(OBJTREE)/SPL
+endif
+else
 ALL-y  += $(obj)u-boot.imx
-
+endif
 endif
diff --git a/arch/arm/cpu/armv7/config.mk b/arch/arm/cpu/armv7/config.mk
index 9c3e2f3..56b8053 100644
--- a/arch/arm/cpu/armv7/config.mk
+++ b/arch/arm/cpu/armv7/config.mk
@@ -40,5 +40,11 @@ PF_NO_UNALIGNED := $(call cc-option, -mno-unaligned-access,)
 PLATFORM_NO_UNALIGNED := $(PF_NO_UNALIGNED)
 
 ifneq ($(CONFIG_IMX_CONFIG),)
+ifdef CONFIG_SPL
+ifdef CONFIG_SPL_BUILD
+ALL-y  += $(OBJTREE)/SPL
+endif
+else
 ALL-y  += $(obj)u-boot.imx
 endif
+endif
-- 
1.7.10.4

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


[U-Boot] [PATCH v11 21/30] Makefile: Move SHELL setup to config.mk

2013-04-09 Thread Benoît Thébaudeau
make never uses the SHELL variable from the environment. Instead, it
uses /bin/sh, or the value assigned to the SHELL variable by the Makefile. This
makes the export of the SHELL variable useless for sub-makes (but still useful
for the environment of recipes). However, we want all makes to use the same
shell.

This patch fixes this issue by moving the SHELL variable setup and export to the
top config.mk, so that all Makefile-s including it use the same shell.

Since BASH is used by default, this makes it possible to use things
like 'echo -e ...' in sub-makes, which would otherwise fail e.g. with /bin/sh
symlinked to /bin/dash on Ubuntu.

Signed-off-by: Benoît Thébaudeau 
Reviewed-by: Tom Rini 
---
Changes in v11: None
Changes in v10:
 - Rebase on current u-boot-arm/master.

Changes in v9: None
Changes in v8:
 - New patch.

Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 Makefile  |7 +--
 config.mk |7 +++
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index 8d0e2b8..caca851 100644
--- a/Makefile
+++ b/Makefile
@@ -46,12 +46,7 @@ HOSTARCH := $(shell uname -m | \
 HOSTOS := $(shell uname -s | tr '[:upper:]' '[:lower:]' | \
sed -e 's/\(cygwin\).*/cygwin/')
 
-# Set shell to bash if possible, otherwise fall back to sh
-SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
-   else if [ -x /bin/bash ]; then echo /bin/bash; \
-   else echo sh; fi; fi)
-
-export HOSTARCH HOSTOS SHELL
+export HOSTARCH HOSTOS
 
 # Deal with colliding definitions from tcsh etc.
 VENDOR=
diff --git a/config.mk b/config.mk
index 4e6a19b..1fd109f 100644
--- a/config.mk
+++ b/config.mk
@@ -23,6 +23,13 @@
 
 #
 
+# Set shell to bash if possible, otherwise fall back to sh
+SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
+   else if [ -x /bin/bash ]; then echo /bin/bash; \
+   else echo sh; fi; fi)
+
+export SHELL
+
 ifeq ($(CURDIR),$(SRCTREE))
 dir :=
 else
-- 
1.7.10.4

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


[U-Boot] [PATCH v11 22/30] .gitignore: Add /SPL

2013-04-09 Thread Benoît Thébaudeau
Signed-off-by: Benoît Thébaudeau 
---
Changes in v11: None
Changes in v10: None
Changes in v9: None
Changes in v8:
 - New patch.

Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 .gitignore |1 +
 1 file changed, 1 insertion(+)

diff --git a/.gitignore b/.gitignore
index be09894..bff721e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -25,6 +25,7 @@
 #
 
 /MLO
+/SPL
 /System.map
 /u-boot
 /u-boot.hex
-- 
1.7.10.4

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


[U-Boot] [PATCH v11 06/30] imx: mx53ard: Add support for NAND Flash

2013-04-09 Thread Benoît Thébaudeau
Add support for the Samsung K9LAG08U0M NAND Flash (2-GiB MLC NAND Flash, 2-kiB
pages, 256-kiB blocks, 30-ns R/W cycles, 1 CS) on mx53ard.

eNFC_CLK_ROOT is set up with a cycle time of 37.5 ns (400 MHz / 3 / 5) for this
board, which satisfies the 30-ns NF R/W cycle requirement.

Signed-off-by: Benoît Thébaudeau 
Tested-by: Fabio Estevam 
---
Changes in v11: None
Changes in v10: None
Changes in v9: None
Changes in v8:
 - Fix NFC pad setup using Freescale's.

Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3:
 - New patch.

Changes in v2: None

 board/freescale/mx53ard/mx53ard.c |   66 +
 include/configs/mx53ard.h |   10 ++
 2 files changed, 76 insertions(+)

diff --git a/board/freescale/mx53ard/mx53ard.c 
b/board/freescale/mx53ard/mx53ard.c
index 2fc8570..8d433a3 100644
--- a/board/freescale/mx53ard/mx53ard.c
+++ b/board/freescale/mx53ard/mx53ard.c
@@ -58,6 +58,71 @@ void dram_init_banksize(void)
gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
 }
 
+#ifdef CONFIG_NAND_MXC
+static void setup_iomux_nand(void)
+{
+   u32 i, reg;
+   #define M4IF_GENP_WEIM_MM_MASK  0x0001
+   #define WEIM_GCR2_MUX16_BYP_GRANT_MASK  0x1000
+
+   reg = __raw_readl(M4IF_BASE_ADDR + 0xc);
+   reg &= ~M4IF_GENP_WEIM_MM_MASK;
+   __raw_writel(reg, M4IF_BASE_ADDR + 0xc);
+   for (i = 0x4; i < 0x94; i += 0x18) {
+   reg = __raw_readl(WEIM_BASE_ADDR + i);
+   reg &= ~WEIM_GCR2_MUX16_BYP_GRANT_MASK;
+   __raw_writel(reg, WEIM_BASE_ADDR + i);
+   }
+
+   mxc_request_iomux(MX53_PIN_NANDF_CS0, IOMUX_CONFIG_ALT0);
+   mxc_iomux_set_pad(MX53_PIN_NANDF_CS0, PAD_CTL_DRV_HIGH);
+   mxc_request_iomux(MX53_PIN_NANDF_CS1, IOMUX_CONFIG_ALT0);
+   mxc_iomux_set_pad(MX53_PIN_NANDF_CS1, PAD_CTL_DRV_HIGH);
+   mxc_request_iomux(MX53_PIN_NANDF_RB0, IOMUX_CONFIG_ALT0);
+   mxc_iomux_set_pad(MX53_PIN_NANDF_RB0, PAD_CTL_PKE_ENABLE |
+   PAD_CTL_PUE_PULL | PAD_CTL_100K_PU);
+   mxc_request_iomux(MX53_PIN_NANDF_CLE, IOMUX_CONFIG_ALT0);
+   mxc_iomux_set_pad(MX53_PIN_NANDF_CLE, PAD_CTL_DRV_HIGH);
+   mxc_request_iomux(MX53_PIN_NANDF_ALE, IOMUX_CONFIG_ALT0);
+   mxc_iomux_set_pad(MX53_PIN_NANDF_ALE, PAD_CTL_DRV_HIGH);
+   mxc_request_iomux(MX53_PIN_NANDF_WP_B, IOMUX_CONFIG_ALT0);
+   mxc_iomux_set_pad(MX53_PIN_NANDF_WP_B, PAD_CTL_PKE_ENABLE |
+   PAD_CTL_PUE_PULL | PAD_CTL_100K_PU);
+   mxc_request_iomux(MX53_PIN_NANDF_RE_B, IOMUX_CONFIG_ALT0);
+   mxc_iomux_set_pad(MX53_PIN_NANDF_RE_B, PAD_CTL_DRV_HIGH);
+   mxc_request_iomux(MX53_PIN_NANDF_WE_B, IOMUX_CONFIG_ALT0);
+   mxc_iomux_set_pad(MX53_PIN_NANDF_WE_B, PAD_CTL_DRV_HIGH);
+   mxc_request_iomux(MX53_PIN_EIM_DA0, IOMUX_CONFIG_ALT0);
+   mxc_iomux_set_pad(MX53_PIN_EIM_DA0, PAD_CTL_PKE_ENABLE |
+   PAD_CTL_100K_PU | PAD_CTL_DRV_HIGH);
+   mxc_request_iomux(MX53_PIN_EIM_DA1, IOMUX_CONFIG_ALT0);
+   mxc_iomux_set_pad(MX53_PIN_EIM_DA1, PAD_CTL_PKE_ENABLE |
+   PAD_CTL_100K_PU | PAD_CTL_DRV_HIGH);
+   mxc_request_iomux(MX53_PIN_EIM_DA2, IOMUX_CONFIG_ALT0);
+   mxc_iomux_set_pad(MX53_PIN_EIM_DA2, PAD_CTL_PKE_ENABLE |
+   PAD_CTL_100K_PU | PAD_CTL_DRV_HIGH);
+   mxc_request_iomux(MX53_PIN_EIM_DA3, IOMUX_CONFIG_ALT0);
+   mxc_iomux_set_pad(MX53_PIN_EIM_DA3, PAD_CTL_PKE_ENABLE |
+   PAD_CTL_100K_PU | PAD_CTL_DRV_HIGH);
+   mxc_request_iomux(MX53_PIN_EIM_DA4, IOMUX_CONFIG_ALT0);
+   mxc_iomux_set_pad(MX53_PIN_EIM_DA4, PAD_CTL_PKE_ENABLE |
+   PAD_CTL_100K_PU | PAD_CTL_DRV_HIGH);
+   mxc_request_iomux(MX53_PIN_EIM_DA5, IOMUX_CONFIG_ALT0);
+   mxc_iomux_set_pad(MX53_PIN_EIM_DA5, PAD_CTL_PKE_ENABLE |
+   PAD_CTL_100K_PU | PAD_CTL_DRV_HIGH);
+   mxc_request_iomux(MX53_PIN_EIM_DA6, IOMUX_CONFIG_ALT0);
+   mxc_iomux_set_pad(MX53_PIN_EIM_DA6, PAD_CTL_PKE_ENABLE |
+   PAD_CTL_100K_PU | PAD_CTL_DRV_HIGH);
+   mxc_request_iomux(MX53_PIN_EIM_DA7, IOMUX_CONFIG_ALT0);
+   mxc_iomux_set_pad(MX53_PIN_EIM_DA7, PAD_CTL_PKE_ENABLE |
+   PAD_CTL_100K_PU | PAD_CTL_DRV_HIGH);
+}
+#else
+static void setup_iomux_nand(void)
+{
+}
+#endif
+
 static void setup_iomux_uart(void)
 {
/* UART1 RXD */
@@ -277,6 +342,7 @@ static void weim_cs1_settings(void)
 
 int board_early_init_f(void)
 {
+   setup_iomux_nand();
setup_iomux_uart();
return 0;
 }
diff --git a/include/configs/mx53ard.h b/include/configs/mx53ard.h
index 62cb42b..148f7a2 100644
--- a/include/configs/mx53ard.h
+++ b/include/configs/mx53ard.h
@@ -41,6 +41,16 @@
 #define CONFIG_BOARD_EARLY_INIT_F
 #define 

[U-Boot] [PATCH v11 07/30] nand: mxc: Fix debug trace in mxc_nand_read_oob_syndrome()

2013-04-09 Thread Benoît Thébaudeau
The page number indicated in the debug trace of mxc_nand_read_oob_syndrome() did
not match the page being worked on.

By the way, replace the GCC-specific __FUNCTION__ with __func__.

Signed-off-by: Benoît Thébaudeau 
Acked-by: Scott Wood 
---
Changes in v11: None
Changes in v10: None
Changes in v9: None
Changes in v8: None
Changes in v7: None
Changes in v6: None
Changes in v5:
 - Replace __FUNCTION__ with __func__.

Changes in v4:
 - New patch.

Changes in v3: None
Changes in v2: None

 drivers/mtd/nand/mxc_nand.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index db72cdc..62d6965 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -409,7 +409,7 @@ static int mxc_nand_read_oob_syndrome(struct mtd_info *mtd,
 
MTDDEBUG(MTD_DEBUG_LEVEL0,
"%s: Reading OOB area of page %u to oob %p\n",
-__FUNCTION__, host->page_addr, buf);
+__func__, page, buf);
 
chip->cmdfunc(mtd, NAND_CMD_READOOB, mtd->writesize, page);
for (i = 0; i < chip->ecc.steps; i++) {
-- 
1.7.10.4

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


[U-Boot] [PATCH v11 19/30] arm926ejs: Remove deprecated and now unused NAND SPL

2013-04-09 Thread Benoît Thébaudeau
Signed-off-by: Benoît Thébaudeau 
---
Changes in v11: None
Changes in v10:
 - Rebase on current u-boot-arm/master.

Changes in v9: None
Changes in v8: None
Changes in v7: None
Changes in v6:
 - New patch.

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/arm/cpu/arm926ejs/start.S |   10 --
 1 file changed, 10 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/start.S b/arch/arm/cpu/arm926ejs/start.S
index 0a9cf1d..3c9de3f 100644
--- a/arch/arm/cpu/arm926ejs/start.S
+++ b/arch/arm/cpu/arm926ejs/start.S
@@ -120,15 +120,11 @@ _fiq:
 
 .globl _TEXT_BASE
 _TEXT_BASE:
-#ifdef CONFIG_NAND_SPL /* deprecated, use instead CONFIG_SPL_BUILD */
-   .word   CONFIG_SYS_TEXT_BASE
-#else
 #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
.word   CONFIG_SPL_TEXT_BASE
 #else
.word   CONFIG_SYS_TEXT_BASE
 #endif
-#endif
 
 /*
  * These are defined in the board-specific linker script.
@@ -152,12 +148,6 @@ _bss_end_ofs:
 _end_ofs:
.word _end - _start
 
-#ifdef CONFIG_NAND_U_BOOT
-.globl _end
-_end:
-   .word __bss_end
-#endif
-
 #ifdef CONFIG_USE_IRQ
 /* IRQ stack memory (calculated at run-time) */
 .globl IRQ_STACK_START
-- 
1.7.10.4

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


[U-Boot] [PATCH v11 16/30] Makefile: Change CONFIG_SPL_PAD_TO to image offset

2013-04-09 Thread Benoît Thébaudeau
Change CONFIG_SPL_PAD_TO from a link address to an image offset since this is
more handy and closer to the purpose of this config.

Automatically define CONFIG_SPL_PAD_TO to CONFIG_SPL_MAX_SIZE (or 0 without
CONFIG_SPL_MAX_SIZE).

Test that CONFIG_SPL_PAD_TO >= CONFIG_SPL_MAX_SIZE if CONFIG_SPL_PAD_TO is
non-zero.

Signed-off-by: Benoît Thébaudeau 
---
Changes in v11: None
Changes in v10: None
Changes in v9: None
Changes in v8:
 - Rebase on latest u-boot-imx/master.
 - Use CONFIG_SPL_PAD_TO instead of CONFIG_SPL_MAX_SIZE for u-boot-with-spl.bin
   padding.

Changes in v7:
 - Use u-boot-spl.bin instead of u-boot-spl in order to avoid having to use
   --change-addresses.

Changes in v6:
 - Fix size passed to --pad-to thanks to --change-addresses.

Changes in v5: None
Changes in v4:
 - New patch.

Changes in v3: None
Changes in v2: None

 Makefile  |5 ++---
 README|7 +--
 include/config_fallbacks.h|   16 
 include/configs/MPC8313ERDB.h |2 +-
 4 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index 4ede937..8d0e2b8 100644
--- a/Makefile
+++ b/Makefile
@@ -486,9 +486,8 @@ $(obj)u-boot.dis:   $(obj)u-boot
 
 
 $(obj)u-boot-with-spl.bin: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
-   $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(or $(CONFIG_SPL_PAD_TO),0) \
-   -O binary $(obj)spl/u-boot-spl \
-   $(obj)spl/u-boot-spl-pad.bin
+   $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(CONFIG_SPL_PAD_TO) \
+   -I binary -O binary $< $(obj)spl/u-boot-spl-pad.bin
cat $(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin > $@
rm $(obj)spl/u-boot-spl-pad.bin
 
diff --git a/README b/README
index 9285ddd..6272853 100644
--- a/README
+++ b/README
@@ -2908,8 +2908,11 @@ FIT uImage format:
Support for lib/libgeneric.o in SPL binary
 
CONFIG_SPL_PAD_TO
-   Linker address to which the SPL should be padded before
-   appending the SPL payload.
+   Image offset to which the SPL should be padded before appending
+   the SPL payload. By default, this is defined as
+   CONFIG_SPL_MAX_SIZE, or 0 if CONFIG_SPL_MAX_SIZE is undefined.
+   CONFIG_SPL_PAD_TO must be either 0, meaning to append the SPL
+   payload without any padding, or >= CONFIG_SPL_MAX_SIZE.
 
CONFIG_SPL_TARGET
Final target image containing SPL and payload.  Some SPLs
diff --git a/include/config_fallbacks.h b/include/config_fallbacks.h
index 9298d0e..e59ee96 100644
--- a/include/config_fallbacks.h
+++ b/include/config_fallbacks.h
@@ -9,6 +9,22 @@
 #ifndef __CONFIG_FALLBACKS_H
 #define __CONFIG_FALLBACKS_H
 
+#ifdef CONFIG_SPL
+#ifdef CONFIG_SPL_PAD_TO
+#ifdef CONFIG_SPL_MAX_SIZE
+#if CONFIG_SPL_PAD_TO && CONFIG_SPL_PAD_TO < CONFIG_SPL_MAX_SIZE
+#error CONFIG_SPL_PAD_TO < CONFIG_SPL_MAX_SIZE
+#endif
+#endif
+#else
+#ifdef CONFIG_SPL_MAX_SIZE
+#define CONFIG_SPL_PAD_TO  CONFIG_SPL_MAX_SIZE
+#else
+#define CONFIG_SPL_PAD_TO  0
+#endif
+#endif
+#endif
+
 #ifndef CONFIG_SYS_BAUDRATE_TABLE
 #define CONFIG_SYS_BAUDRATE_TABLE  { 9600, 19200, 38400, 57600, 115200 }
 #endif
diff --git a/include/configs/MPC8313ERDB.h b/include/configs/MPC8313ERDB.h
index 275d4f2..c28dfe0 100644
--- a/include/configs/MPC8313ERDB.h
+++ b/include/configs/MPC8313ERDB.h
@@ -52,7 +52,7 @@
 #define CONFIG_SYS_TEXT_BASE   0x0010 /* CONFIG_SYS_NAND_U_BOOT_DST */
 #define CONFIG_SYS_TEXT_BASE_SPL 0xfff0
 #define CONFIG_SPL_MAX_SIZE(4 * 1024)
-#define CONFIG_SPL_PAD_TO  0xfff04000
+#define CONFIG_SPL_PAD_TO  0x4000
 
 #define CONFIG_SYS_NAND_U_BOOT_SIZE  (512 << 10)
 #define CONFIG_SYS_NAND_U_BOOT_DST   0x0010
-- 
1.7.10.4

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


[U-Boot] [PATCH v11 13/30] arm: relocate_code(): Use __image_copy_end for end of relocation

2013-04-09 Thread Benoît Thébaudeau
Use __image_copy_end instead of __bss_start for the end of the image to
relocate. This is the same as commit 033ca72, but applied to all ARM start.S.

This is a more appropriate symbol naming for an image copy & relocate feature,
and this also saves a useless copy of data put between __image_copy_end and
__bss_start in linker scripts (e.g. relocation information, or MMU
initialization tables used only before jumping to the relocated image).

Signed-off-by: Benoît Thébaudeau 
---
Changes in v11: None
Changes in v10:
 - Rebase on current u-boot-arm/master.

Changes in v9: None
Changes in v8:
 - Fix "space before tab" warning.
 - Give more details in patch description.

Changes in v7: None
Changes in v6:
 - New patch.

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/arm/cpu/arm1136/start.S   |4 ++--
 arch/arm/cpu/arm1176/start.S   |6 +-
 arch/arm/cpu/arm720t/start.S   |6 +-
 arch/arm/cpu/arm920t/ep93xx/u-boot.lds |3 +++
 arch/arm/cpu/arm920t/start.S   |6 +-
 arch/arm/cpu/arm925t/start.S   |6 +-
 arch/arm/cpu/arm926ejs/start.S |6 +-
 arch/arm/cpu/arm946es/start.S  |6 +-
 arch/arm/cpu/arm_intcm/start.S |6 +-
 arch/arm/cpu/armv7/start.S |4 ++--
 arch/arm/cpu/ixp/start.S   |6 +-
 arch/arm/cpu/ixp/u-boot.lds|2 ++
 arch/arm/cpu/pxa/start.S   |6 +-
 arch/arm/cpu/s3c44b0/start.S   |6 +-
 arch/arm/cpu/sa1100/start.S|6 +-
 board/actux1/u-boot.lds|3 +++
 board/actux2/u-boot.lds|3 +++
 board/actux3/u-boot.lds|3 +++
 board/davinci/da8xxevm/u-boot-spl-hawk.lds |1 +
 board/dvlhost/u-boot.lds   |3 +++
 board/samsung/smdk6400/u-boot-nand.lds |4 
 board/vpac270/u-boot-spl.lds   |2 ++
 nand_spl/board/karo/tx25/u-boot.lds|2 ++
 nand_spl/board/samsung/smdk6400/u-boot.lds |2 ++
 24 files changed, 87 insertions(+), 15 deletions(-)

diff --git a/arch/arm/cpu/arm1136/start.S b/arch/arm/cpu/arm1136/start.S
index 67fcc4f..e36d7d3 100644
--- a/arch/arm/cpu/arm1136/start.S
+++ b/arch/arm/cpu/arm1136/start.S
@@ -104,9 +104,9 @@ _TEXT_BASE:
 _bss_start_ofs:
.word __bss_start - _start
 
-.global_image_copy_end_ofs
+.globl _image_copy_end_ofs
 _image_copy_end_ofs:
-   .word   __image_copy_end - _start
+   .word __image_copy_end - _start
 
 .globl _bss_end_ofs
 _bss_end_ofs:
diff --git a/arch/arm/cpu/arm1176/start.S b/arch/arm/cpu/arm1176/start.S
index 17b1277..0b570d5 100644
--- a/arch/arm/cpu/arm1176/start.S
+++ b/arch/arm/cpu/arm1176/start.S
@@ -127,6 +127,10 @@ _TEXT_PHY_BASE:
 _bss_start_ofs:
.word __bss_start - _start
 
+.globl _image_copy_end_ofs
+_image_copy_end_ofs:
+   .word __image_copy_end - _start
+
 .globl _bss_end_ofs
 _bss_end_ofs:
.word __bss_end - _start
@@ -251,7 +255,7 @@ relocate_code:
subsr9, r6, r0  /* r9 <- relocation offset */
beq relocate_done   /* skip relocation */
mov r1, r6  /* r1 <- scratch for copy_loop */
-   ldr r3, _bss_start_ofs
+   ldr r3, _image_copy_end_ofs
add r2, r0, r3  /* r2 <- source end address */
 
 copy_loop:
diff --git a/arch/arm/cpu/arm720t/start.S b/arch/arm/cpu/arm720t/start.S
index 95f4447..a640eaa 100644
--- a/arch/arm/cpu/arm720t/start.S
+++ b/arch/arm/cpu/arm720t/start.S
@@ -101,6 +101,10 @@ _TEXT_BASE:
 _bss_start_ofs:
.word __bss_start - _start
 
+.globl _image_copy_end_ofs
+_image_copy_end_ofs:
+   .word __image_copy_end - _start
+
 .globl _bss_end_ofs
 _bss_end_ofs:
.word __bss_end - _start
@@ -166,7 +170,7 @@ relocate_code:
subsr9, r6, r0  /* r9 <- relocation offset */
beq relocate_done   /* skip relocation */
mov r1, r6  /* r1 <- scratch for copy_loop */
-   ldr r3, _bss_start_ofs
+   ldr r3, _image_copy_end_ofs
add r2, r0, r3  /* r2 <- source end address */
 
 copy_loop:
diff --git a/arch/arm/cpu/arm920t/ep93xx/u-boot.lds 
b/arch/arm/cpu/arm920t/ep93xx/u-boot.lds
index e483820..d0b1ada 100644
--- a/arch/arm/cpu/arm920t/ep93xx/u-boot.lds
+++ b/arch/arm/cpu/arm920t/ep93xx/u-boot.lds
@@ -55,6 +55,9 @@ SECTIONS
}
 
. = ALIGN(4);
+
+   __image_copy_end = .;
+
__bss_start = .;
.bss : { *(.bss) }
__bss_end = .;
diff --git a/arch/arm/cpu/arm920t/start.S b/arch/arm/cpu/arm920t/start.S
index cd8c8db..940ce72 100644
--- a/arch/arm/cpu/arm920t/start.S
+++ b/arch/arm/cpu/arm920t/start.S
@@ -89,6 +89,10 @@ _TEXT_BASE:
 _bss_start_ofs:
.word __bss_start - _start
 
+.globl _image_co

[U-Boot] [PATCH v11 15/30] autoconfig.mk: Make it possible to define configs from other configs

2013-04-09 Thread Benoît Thébaudeau
Give more flexibility to define configs that can be interpreted by make, e.g. to
define fallback values of configs like in the example below.

Before this change, the config lines:
 #define CONFIG_SPL_MAX_SIZE2048
 #define CONFIG_SPL_PAD_TO  CONFIG_SPL_MAX_SIZE
would have been changed in autoconfig.mk into:
 CONFIG_SPL_MAX_SIZE=2048
 CONFIG_SPL_PAD_TO="CONFIG_SPL_MAX_SIZE"

Hence, a make recipe using as an argument to $(OBJCOPY):
 --pad-to=$(CONFIG_SPL_PAD_TO)
would have issued:
 --pad-to="CONFIG_SPL_MAX_SIZE"
which means nothing for $(OBJCOPY) and makes it fail.

Thanks to this change, the config lines above are changed in autoconfig.mk into:
 CONFIG_SPL_MAX_SIZE=2048
 CONFIG_SPL_PAD_TO=$(CONFIG_SPL_MAX_SIZE)

Hence, the make recipe above now issues:
 --pad-to=2048
as expected from the defined config.

Signed-off-by: Benoît Thébaudeau 
Reviewed-by: Tom Rini 
---
Changes in v11: None
Changes in v10: None
Changes in v9:
 - Add detailed patch description.

Changes in v8:
 - New patch.

Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 tools/scripts/define2mk.sed |2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/scripts/define2mk.sed b/tools/scripts/define2mk.sed
index 13e2845..c641edf 100644
--- a/tools/scripts/define2mk.sed
+++ b/tools/scripts/define2mk.sed
@@ -24,6 +24,8 @@
s/="\([0-9][0-9]*\)"/=\1/;
# ... and from hex numbers
s/="\(0[Xx][0-9a-fA-F][0-9a-fA-F]*\)"/=\1/;
+   # ... and from configs defined from other configs
+   s/="\(CONFIG_[A-Za-z0-9_][A-Za-z0-9_]*\)"/=$(\1)/;
# Change '1' and empty values to "y" (not perfect, but
# supports conditional compilation in the makefiles
s/=$/=y/;
-- 
1.7.10.4

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


[U-Boot] [PATCH v11 12/30] arm: relocate_code(): Remove useless relocation offset computation

2013-04-09 Thread Benoît Thébaudeau
Signed-off-by: Benoît Thébaudeau 
---
Changes in v11: None
Changes in v10: None
Changes in v9: None
Changes in v8:
 - Make sure that r9 is initialized in all cases because it may be used after
   relocate_code().

Changes in v7: None
Changes in v6:
 - New patch.

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/arm/cpu/arm1136/start.S   |8 +++-
 arch/arm/cpu/arm1176/start.S   |8 +++-
 arch/arm/cpu/arm720t/start.S   |8 +++-
 arch/arm/cpu/arm920t/start.S   |8 +++-
 arch/arm/cpu/arm925t/start.S   |8 +++-
 arch/arm/cpu/arm926ejs/start.S |9 +++--
 arch/arm/cpu/arm946es/start.S  |8 +++-
 arch/arm/cpu/arm_intcm/start.S |8 +++-
 arch/arm/cpu/armv7/start.S |8 +++-
 arch/arm/cpu/ixp/start.S   |8 +++-
 arch/arm/cpu/pxa/start.S   |8 +++-
 arch/arm/cpu/s3c44b0/start.S   |8 +++-
 arch/arm/cpu/sa1100/start.S|8 +++-
 13 files changed, 39 insertions(+), 66 deletions(-)

diff --git a/arch/arm/cpu/arm1136/start.S b/arch/arm/cpu/arm1136/start.S
index 5225639..67fcc4f 100644
--- a/arch/arm/cpu/arm1136/start.S
+++ b/arch/arm/cpu/arm1136/start.S
@@ -185,16 +185,15 @@ relocate_code:
mov r6, r2  /* save addr of destination */
 
adr r0, _start
-   cmp r0, r6
-   moveq   r9, #0  /* no relocation. relocation offset(r9) = 0 */
+   subsr9, r6, r0  /* r9 <- relocation offset */
beq relocate_done   /* skip relocation */
mov r1, r6  /* r1 <- scratch for copy_loop */
ldr r3, _image_copy_end_ofs
add r2, r0, r3  /* r2 <- source end address */
 
 copy_loop:
-   ldmia   r0!, {r9-r10}   /* copy from source address [r0]*/
-   stmia   r1!, {r9-r10}   /* copy to   target address [r1]*/
+   ldmia   r0!, {r10-r11}  /* copy from source address [r0]*/
+   stmia   r1!, {r10-r11}  /* copy to   target address [r1]*/
cmp r0, r2  /* until source end address [r2]*/
blo copy_loop
 
@@ -203,7 +202,6 @@ copy_loop:
 * fix .rel.dyn relocations
 */
ldr r0, _TEXT_BASE  /* r0 <- Text base */
-   sub r9, r6, r0  /* r9 <- relocation offset */
ldr r10, _dynsym_start_ofs  /* r10 <- sym table ofs */
add r10, r10, r0/* r10 <- sym table in FLASH */
ldr r2, _rel_dyn_start_ofs  /* r2 <- rel dyn start ofs */
diff --git a/arch/arm/cpu/arm1176/start.S b/arch/arm/cpu/arm1176/start.S
index c0698e6..17b1277 100644
--- a/arch/arm/cpu/arm1176/start.S
+++ b/arch/arm/cpu/arm1176/start.S
@@ -248,16 +248,15 @@ relocate_code:
mov r6, r2  /* save addr of destination */
 
adr r0, _start
-   cmp r0, r6
-   moveq   r9, #0  /* no relocation. relocation offset(r9) = 0 */
+   subsr9, r6, r0  /* r9 <- relocation offset */
beq relocate_done   /* skip relocation */
mov r1, r6  /* r1 <- scratch for copy_loop */
ldr r3, _bss_start_ofs
add r2, r0, r3  /* r2 <- source end address */
 
 copy_loop:
-   ldmia   r0!, {r9-r10}   /* copy from source address [r0]*/
-   stmia   r1!, {r9-r10}   /* copy to   target address [r1]*/
+   ldmia   r0!, {r10-r11}  /* copy from source address [r0]*/
+   stmia   r1!, {r10-r11}  /* copy to   target address [r1]*/
cmp r0, r2  /* until source end address [r2]*/
blo copy_loop
 
@@ -266,7 +265,6 @@ copy_loop:
 * fix .rel.dyn relocations
 */
ldr r0, _TEXT_BASE  /* r0 <- Text base */
-   sub r9, r6, r0  /* r9 <- relocation offset */
ldr r10, _dynsym_start_ofs  /* r10 <- sym table ofs */
add r10, r10, r0/* r10 <- sym table in FLASH */
ldr r2, _rel_dyn_start_ofs  /* r2 <- rel dyn start ofs */
diff --git a/arch/arm/cpu/arm720t/start.S b/arch/arm/cpu/arm720t/start.S
index c65af3f..95f4447 100644
--- a/arch/arm/cpu/arm720t/start.S
+++ b/arch/arm/cpu/arm720t/start.S
@@ -163,16 +163,15 @@ relocate_code:
mov r6, r2  /* save addr of destination */
 
adr r0, _start
-   cmp r0, r6
-   moveq   r9, #0  /* no relocation. relocation offset(r9) = 0 */
+   subsr9, r6, r0  /* r9 <- relocation offset */
beq relocate_done   /* skip relocation */
mov r1, r6  /* r1 <- scratch for copy_loop */
ldr r3, _bss_start_ofs
add r2, r0, r3  /* r2 <- source end address */
 
 copy_loop:
-   ldmia   r0!, {r9-r10}   /* copy from source address [r0]*/
-   stmia  

[U-Boot] [PATCH v11 14/30] arm: crt0.S: Remove bogus .globl

2013-04-09 Thread Benoît Thébaudeau
The purpose of .globl is to export symbols for ld, not to declare external
symbols.

By the way, use the ENTRY() and ENDPROC() macros to define functions rather than
using .global directly.

Signed-off-by: Benoît Thébaudeau 
---
Changes in v11: None
Changes in v10:
 - Rebase on current u-boot-arm/master.

Changes in v9: None
Changes in v8:
 - Use ENTRY() and ENDPROC() to define functions.

Changes in v7: None
Changes in v6:
 - New patch.

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/arm/lib/crt0.S |   28 
 1 file changed, 4 insertions(+), 24 deletions(-)

diff --git a/arch/arm/lib/crt0.S b/arch/arm/lib/crt0.S
index 37d9927..1524f7e 100644
--- a/arch/arm/lib/crt0.S
+++ b/arch/arm/lib/crt0.S
@@ -24,6 +24,7 @@
 
 #include 
 #include 
+#include 
 
 /*
  * This file handles the target-independent stages of the U-Boot
@@ -67,33 +68,10 @@
  */
 
 /*
- * declare nand_boot() or board_init_r() to jump to at end of crt0
- */
-
-#if defined(CONFIG_NAND_SPL)
-
-.globl nand_boot
-
-#elif ! defined(CONFIG_SPL_BUILD)
-
-.globl board_init_r
-
-#endif
-
-/*
- * start and end of BSS
- */
-
-.globl __bss_start
-.globl __bss_end
-
-/*
  * entry point of crt0 sequence
  */
 
-.global _main
-
-_main:
+ENTRY(_main)
 
 /*
  * Set up initial C runtime environment and call board_init_f(0).
@@ -171,3 +149,5 @@ clbss_l:cmp r0, r1  /* while not at end of 
BSS */
/* we should not return here. */
 
 #endif
+
+ENDPROC(_main)
-- 
1.7.10.4

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


[U-Boot] [PATCH v11 05/30] imx: mx5: lowlevel_init: Simplify code

2013-04-09 Thread Benoît Thébaudeau
Don't use several instructions to build constant values.

Signed-off-by: Benoît Thébaudeau 
Acked-by: Stefano Babic 
---
Changes in v11: None
Changes in v10: None
Changes in v9: None
Changes in v8: None
Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3:
 - New patch.

Changes in v2: None

 arch/arm/cpu/armv7/mx5/lowlevel_init.S |8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/arch/arm/cpu/armv7/mx5/lowlevel_init.S 
b/arch/arm/cpu/armv7/mx5/lowlevel_init.S
index 6d9396a..dfce0ca 100644
--- a/arch/arm/cpu/armv7/mx5/lowlevel_init.S
+++ b/arch/arm/cpu/armv7/mx5/lowlevel_init.S
@@ -309,8 +309,7 @@ setup_pll_func:
 ldr r0, =CCM_BASE_ADDR
 ldr r1, =0x00015154
 str r1, [r0, #CLKCTL_CBCMR]
-ldr r1, =0x02888945
-orr r1, r1, #(1 << 16)
+ldr r1, =0x02898945
 str r1, [r0, #CLKCTL_CBCDR]
 /* make sure change is effective */
 1:  ldr r1, [r0, #CLKCTL_CDHIPR]
@@ -321,10 +320,7 @@ setup_pll_func:
 
/* Switch peripheral to PLL2 */
ldr r0, =CCM_BASE_ADDR
-   ldr r1, =0x00808145
-   orr r1, r1, #(2 << 10)
-   orr r1, r1, #(0 << 16)
-   orr r1, r1, #(1 << 19)
+   ldr r1, =0x00888945
str r1, [r0, #CLKCTL_CBCDR]
 
ldr r1, =0x00016154
-- 
1.7.10.4

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


[U-Boot] [PATCH v11 10/30] arm: relocate_code() is no longer noreturn

2013-04-09 Thread Benoît Thébaudeau
Commit e05e5de7fae5bec79617e113916dac6631251156 made ARM's relocate_code()
return to its caller, but it did not update its declaration accordingly.

Fixing this function declaration fixes dropped C code following calls to
relocate_code().

Signed-off-by: Benoît Thébaudeau 
---
Changes in v11: None
Changes in v10: None
Changes in v9: None
Changes in v8:
 - Update relocate_code() description in ARM start.S comments.

Changes in v7: None
Changes in v6:
 - New patch, extracted from "nand: mxc: Switch NAND SPL to generic SPL".

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/arm/cpu/arm1136/start.S   |4 +---
 arch/arm/cpu/arm1176/start.S   |4 +---
 arch/arm/cpu/arm720t/start.S   |4 +---
 arch/arm/cpu/arm920t/start.S   |4 +---
 arch/arm/cpu/arm925t/start.S   |4 +---
 arch/arm/cpu/arm926ejs/start.S |4 +---
 arch/arm/cpu/arm946es/start.S  |4 +---
 arch/arm/cpu/arm_intcm/start.S |4 +---
 arch/arm/cpu/armv7/start.S |4 +---
 arch/arm/cpu/ixp/start.S   |4 +---
 arch/arm/cpu/pxa/start.S   |4 +---
 arch/arm/cpu/s3c44b0/start.S   |4 +---
 arch/arm/cpu/sa1100/start.S|4 +---
 include/common.h   |6 +-
 14 files changed, 18 insertions(+), 40 deletions(-)

diff --git a/arch/arm/cpu/arm1136/start.S b/arch/arm/cpu/arm1136/start.S
index 0cd2400..eda4bc0 100644
--- a/arch/arm/cpu/arm1136/start.S
+++ b/arch/arm/cpu/arm1136/start.S
@@ -176,9 +176,7 @@ next:
 /*
  * void relocate_code (addr_sp, gd, addr_moni)
  *
- * This "function" does not return, instead it continues in RAM
- * after relocating the monitor code.
- *
+ * This function relocates the monitor code.
  */
.globl  relocate_code
 relocate_code:
diff --git a/arch/arm/cpu/arm1176/start.S b/arch/arm/cpu/arm1176/start.S
index adc..c0698e6 100644
--- a/arch/arm/cpu/arm1176/start.S
+++ b/arch/arm/cpu/arm1176/start.S
@@ -239,9 +239,7 @@ skip_tcmdisable:
 /*
  * void relocate_code (addr_sp, gd, addr_moni)
  *
- * This "function" does not return, instead it continues in RAM
- * after relocating the monitor code.
- *
+ * This function relocates the monitor code.
  */
.globl  relocate_code
 relocate_code:
diff --git a/arch/arm/cpu/arm720t/start.S b/arch/arm/cpu/arm720t/start.S
index 1e3e5a1..c65af3f 100644
--- a/arch/arm/cpu/arm720t/start.S
+++ b/arch/arm/cpu/arm720t/start.S
@@ -154,9 +154,7 @@ reset:
 /*
  * void relocate_code (addr_sp, gd, addr_moni)
  *
- * This "function" does not return, instead it continues in RAM
- * after relocating the monitor code.
- *
+ * This function relocates the monitor code.
  */
.globl  relocate_code
 relocate_code:
diff --git a/arch/arm/cpu/arm920t/start.S b/arch/arm/cpu/arm920t/start.S
index 8c2c836..2b8b7ad 100644
--- a/arch/arm/cpu/arm920t/start.S
+++ b/arch/arm/cpu/arm920t/start.S
@@ -193,9 +193,7 @@ copyex:
 /*
  * void relocate_code (addr_sp, gd, addr_moni)
  *
- * This "function" does not return, instead it continues in RAM
- * after relocating the monitor code.
- *
+ * This function relocates the monitor code.
  */
.globl  relocate_code
 relocate_code:
diff --git a/arch/arm/cpu/arm925t/start.S b/arch/arm/cpu/arm925t/start.S
index 7f067c0..6920c93 100644
--- a/arch/arm/cpu/arm925t/start.S
+++ b/arch/arm/cpu/arm925t/start.S
@@ -183,9 +183,7 @@ poll1:
 /*
  * void relocate_code (addr_sp, gd, addr_moni)
  *
- * This "function" does not return, instead it continues in RAM
- * after relocating the monitor code.
- *
+ * This function relocates the monitor code.
  */
.globl  relocate_code
 relocate_code:
diff --git a/arch/arm/cpu/arm926ejs/start.S b/arch/arm/cpu/arm926ejs/start.S
index efdff3e..90b4e53 100644
--- a/arch/arm/cpu/arm926ejs/start.S
+++ b/arch/arm/cpu/arm926ejs/start.S
@@ -200,9 +200,7 @@ reset:
 /*
  * void relocate_code (addr_sp, gd, addr_moni)
  *
- * This "function" does not return, instead it continues in RAM
- * after relocating the monitor code.
- *
+ * This function relocates the monitor code.
  */
.globl  relocate_code
 relocate_code:
diff --git a/arch/arm/cpu/arm946es/start.S b/arch/arm/cpu/arm946es/start.S
index 85adc62..84fabf4 100644
--- a/arch/arm/cpu/arm946es/start.S
+++ b/arch/arm/cpu/arm946es/start.S
@@ -158,9 +158,7 @@ reset:
 /*
  * void relocate_code (addr_sp, gd, addr_moni)
  *
- * This "function" does not return, instead it continues in RAM
- * after relocating the monitor code.
- *
+ * This function relocates the monitor code.
  */
.globl  relocate_code
 relocate_code:
diff --git a/arch/arm/cpu/arm_intcm/start.S b/arch/arm/cpu/arm_intcm/start.S
index a69fb17..d0f8a48 100644
--- a/arch/arm/cpu/arm_intcm/start.S
+++ b/arch/arm/cpu/arm_intcm/start.S
@@ -154,9 +154,7 @@ reset:
 /*
  * void relocate_code (addr_sp, gd, addr_moni)
  *
- * This "function" does not return, instead it continues in RAM
- * after relocating the monitor code.
- *
+ * This function relocates the monitor code.
  */
.globl  relocate_code
 relocate_code:

[U-Boot] [PATCH v11 09/30] arm: start.S: Fix _TEXT_BASE for SPL

2013-04-09 Thread Benoît Thébaudeau
_TEXT_BASE must be set to CONFIG_SPL_TEXT_BASE for generic SPL, and to
CONFIG_SYS_TEXT_BASE for non-SPL builds.

Signed-off-by: Benoît Thébaudeau 
Reviewed-by: Tom Rini 
---
Changes in v11: None
Changes in v10: None
Changes in v9: None
Changes in v8:
 - Apply to mxs SPL too.

Changes in v7: None
Changes in v6:
 - New patch.

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/arm/cpu/arm1136/start.S   |4 
 arch/arm/cpu/arm1176/start.S   |8 
 arch/arm/cpu/arm720t/start.S   |2 +-
 arch/arm/cpu/arm920t/start.S   |4 
 arch/arm/cpu/arm925t/start.S   |4 
 arch/arm/cpu/arm926ejs/mxs/start.S |4 
 arch/arm/cpu/arm926ejs/start.S |2 +-
 arch/arm/cpu/arm946es/start.S  |4 
 arch/arm/cpu/arm_intcm/start.S |6 +-
 arch/arm/cpu/armv7/start.S |4 
 arch/arm/cpu/ixp/start.S   |4 
 arch/arm/cpu/pxa/start.S   |2 +-
 arch/arm/cpu/s3c44b0/start.S   |4 
 arch/arm/cpu/sa1100/start.S|4 
 14 files changed, 52 insertions(+), 4 deletions(-)

diff --git a/arch/arm/cpu/arm1136/start.S b/arch/arm/cpu/arm1136/start.S
index eba2324..0cd2400 100644
--- a/arch/arm/cpu/arm1136/start.S
+++ b/arch/arm/cpu/arm1136/start.S
@@ -88,7 +88,11 @@ _end_vect:
 
 .globl _TEXT_BASE
 _TEXT_BASE:
+#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
+   .word   CONFIG_SPL_TEXT_BASE
+#else
.word   CONFIG_SYS_TEXT_BASE
+#endif
 
 /*
  * These are defined in the board-specific linker script.
diff --git a/arch/arm/cpu/arm1176/start.S b/arch/arm/cpu/arm1176/start.S
index 3c291fb..adc 100644
--- a/arch/arm/cpu/arm1176/start.S
+++ b/arch/arm/cpu/arm1176/start.S
@@ -98,7 +98,15 @@ _end_vect:
 
 .globl _TEXT_BASE
 _TEXT_BASE:
+#ifdef CONFIG_NAND_SPL /* deprecated, use instead CONFIG_SPL_BUILD */
.word   CONFIG_SYS_TEXT_BASE
+#else
+#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
+   .word   CONFIG_SPL_TEXT_BASE
+#else
+   .word   CONFIG_SYS_TEXT_BASE
+#endif
+#endif
 
 /*
  * Below variable is very important because we use MMU in U-Boot.
diff --git a/arch/arm/cpu/arm720t/start.S b/arch/arm/cpu/arm720t/start.S
index 43bd6ed..1e3e5a1 100644
--- a/arch/arm/cpu/arm720t/start.S
+++ b/arch/arm/cpu/arm720t/start.S
@@ -85,7 +85,7 @@ _pad: .word 0x12345678 /* now 16*4=64 */
 
 .globl _TEXT_BASE
 _TEXT_BASE:
-#ifdef CONFIG_SPL_BUILD
+#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
.word   CONFIG_SPL_TEXT_BASE
 #else
.word   CONFIG_SYS_TEXT_BASE
diff --git a/arch/arm/cpu/arm920t/start.S b/arch/arm/cpu/arm920t/start.S
index 2864d12..8c2c836 100644
--- a/arch/arm/cpu/arm920t/start.S
+++ b/arch/arm/cpu/arm920t/start.S
@@ -73,7 +73,11 @@ _fiq:.word fiq
 
 .globl _TEXT_BASE
 _TEXT_BASE:
+#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
+   .word   CONFIG_SPL_TEXT_BASE
+#else
.word   CONFIG_SYS_TEXT_BASE
+#endif
 
 /*
  * These are defined in the board-specific linker script.
diff --git a/arch/arm/cpu/arm925t/start.S b/arch/arm/cpu/arm925t/start.S
index 827fee2..7f067c0 100644
--- a/arch/arm/cpu/arm925t/start.S
+++ b/arch/arm/cpu/arm925t/start.S
@@ -79,7 +79,11 @@ _fiq:.word fiq
 
 .globl _TEXT_BASE
 _TEXT_BASE:
+#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
+   .word   CONFIG_SPL_TEXT_BASE
+#else
.word   CONFIG_SYS_TEXT_BASE
+#endif
 
 /*
  * These are defined in the board-specific linker script.
diff --git a/arch/arm/cpu/arm926ejs/mxs/start.S 
b/arch/arm/cpu/arm926ejs/mxs/start.S
index 373e6d8..bf54423 100644
--- a/arch/arm/cpu/arm926ejs/mxs/start.S
+++ b/arch/arm/cpu/arm926ejs/mxs/start.S
@@ -119,7 +119,11 @@ fiq:
 
 .globl _TEXT_BASE
 _TEXT_BASE:
+#ifdef CONFIG_SPL_TEXT_BASE
+   .word   CONFIG_SPL_TEXT_BASE
+#else
.word   CONFIG_SYS_TEXT_BASE
+#endif
 
 /*
  * These are defined in the board-specific linker script.
diff --git a/arch/arm/cpu/arm926ejs/start.S b/arch/arm/cpu/arm926ejs/start.S
index f5d1582..efdff3e 100644
--- a/arch/arm/cpu/arm926ejs/start.S
+++ b/arch/arm/cpu/arm926ejs/start.S
@@ -123,7 +123,7 @@ _TEXT_BASE:
 #ifdef CONFIG_NAND_SPL /* deprecated, use instead CONFIG_SPL_BUILD */
.word   CONFIG_SYS_TEXT_BASE
 #else
-#ifdef CONFIG_SPL_BUILD
+#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
.word   CONFIG_SPL_TEXT_BASE
 #else
.word   CONFIG_SYS_TEXT_BASE
diff --git a/arch/arm/cpu/arm946es/start.S b/arch/arm/cpu/arm946es/start.S
index 9dec35b..85adc62 100644
--- a/arch/arm/cpu/arm946es/start.S
+++ b/arch/arm/cpu/arm946es/start.S
@@ -89,7 +89,11 @@ _vectors_end:
 
 .globl _TEXT_BASE
 _TEXT_BASE:
+#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
+   .word   CONFIG_SPL_TEXT_BASE
+#else
.word   CONFIG_SYS_TEXT_BASE
+#endif
 
 /*
  * These are defined in the board-specific linker script.
diff -

[U-Boot] [PATCH v11 04/30] nand: mxc: Add support for i.MX5

2013-04-09 Thread Benoît Thébaudeau
Signed-off-by: Benoît Thébaudeau 
Acked-by: Scott Wood 
Tested-by: Fabio Estevam 
---
Changes in v11: None
Changes in v10: None
Changes in v9:
 - Drop the now unused SRC register definitions.

Changes in v8:
 - Rebase on Fabio's patches using CONFIG_SYS_NAND_BUSWIDTH_16BIT instead of
   NAND Flash boot config pins to determine NAND Flash bus width.

Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3:
 - Separate code reformatting from behavioral changes.

Changes in v2: None

 drivers/mtd/nand/mxc_nand.c  |  119 ++
 include/fsl_nfc.h|   79 +++-
 nand_spl/nand_boot_fsl_nfc.c |   67 +++-
 3 files changed, 250 insertions(+), 15 deletions(-)

diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index 6ae95d6..db72cdc 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -22,7 +22,8 @@
 #include 
 #include 
 #include 
-#if defined(CONFIG_MX25) || defined(CONFIG_MX27) || defined(CONFIG_MX35)
+#if defined(CONFIG_MX25) || defined(CONFIG_MX27) || defined(CONFIG_MX35) || \
+   defined(CONFIG_MX51) || defined(CONFIG_MX53)
 #include 
 #endif
 #include 
@@ -36,6 +37,9 @@ struct mxc_nand_host {
struct nand_chip*nand;
 
struct fsl_nfc_regs __iomem *regs;
+#ifdef MXC_NFC_V3_2
+   struct fsl_nfc_ip_regs __iomem  *ip_regs;
+#endif
int spare_only;
int status_request;
int pagesize_2k;
@@ -77,7 +81,7 @@ static struct nand_ecclayout nand_hw_eccoob2k = {
.oobfree = { {2, 4}, {11, 11}, {27, 11}, {43, 11}, {59, 5} },
 };
 #endif
-#elif defined(MXC_NFC_V2_1)
+#elif defined(MXC_NFC_V2_1) || defined(MXC_NFC_V3_2)
 #ifndef CONFIG_SYS_NAND_LARGEPAGE
 static struct nand_ecclayout nand_hw_eccoob = {
.eccbytes = 9,
@@ -127,10 +131,17 @@ static void wait_op_done(struct mxc_nand_host *host, int 
max_retries,
uint32_t tmp;
 
while (max_retries-- > 0) {
+#if defined(MXC_NFC_V1) || defined(MXC_NFC_V2_1)
tmp = readnfc(&host->regs->config2);
if (tmp & NFC_V1_V2_CONFIG2_INT) {
tmp &= ~NFC_V1_V2_CONFIG2_INT;
writenfc(tmp, &host->regs->config2);
+#elif defined(MXC_NFC_V3_2)
+   tmp = readnfc(&host->ip_regs->ipc);
+   if (tmp & NFC_V3_IPC_INT) {
+   tmp &= ~NFC_V3_IPC_INT;
+   writenfc(tmp, &host->ip_regs->ipc);
+#endif
break;
}
udelay(1);
@@ -182,7 +193,7 @@ static void send_prog_page(struct mxc_nand_host *host, 
uint8_t buf_id,
if (spare_only)
MTDDEBUG(MTD_DEBUG_LEVEL1, "send_prog_page (%d)\n", spare_only);
 
-   if (is_mxc_nfc_21()) {
+   if (is_mxc_nfc_21() || is_mxc_nfc_32()) {
int i;
/*
 *  The controller copies the 64 bytes of spare data from
@@ -198,11 +209,18 @@ static void send_prog_page(struct mxc_nand_host *host, 
uint8_t buf_id,
}
}
 
+#if defined(MXC_NFC_V1) || defined(MXC_NFC_V2_1)
writenfc(buf_id, &host->regs->buf_addr);
+#elif defined(MXC_NFC_V3_2)
+   uint32_t tmp = readnfc(&host->regs->config1);
+   tmp &= ~NFC_V3_CONFIG1_RBA_MASK;
+   tmp |= NFC_V3_CONFIG1_RBA(buf_id);
+   writenfc(tmp, &host->regs->config1);
+#endif
 
/* Configure spare or page+spare access */
if (!host->pagesize_2k) {
-   uint16_t config1 = readnfc(&host->regs->config1);
+   uint32_t config1 = readnfc(&host->regs->config1);
if (spare_only)
config1 |= NFC_CONFIG1_SP_EN;
else
@@ -225,7 +243,14 @@ static void send_read_page(struct mxc_nand_host *host, 
uint8_t buf_id,
 {
MTDDEBUG(MTD_DEBUG_LEVEL3, "send_read_page (%d)\n", spare_only);
 
+#if defined(MXC_NFC_V1) || defined(MXC_NFC_V2_1)
writenfc(buf_id, &host->regs->buf_addr);
+#elif defined(MXC_NFC_V3_2)
+   uint32_t tmp = readnfc(&host->regs->config1);
+   tmp &= ~NFC_V3_CONFIG1_RBA_MASK;
+   tmp |= NFC_V3_CONFIG1_RBA(buf_id);
+   writenfc(tmp, &host->regs->config1);
+#endif
 
/* Configure spare or page+spare access */
if (!host->pagesize_2k) {
@@ -242,7 +267,7 @@ static void send_read_page(struct mxc_nand_host *host, 
uint8_t buf_id,
/* Wait for operation to complete */
wait_op_done(host, TROP_US_DELAY, spare_only);
 
-   if (is_mxc_nfc_21()) {
+   if (is_mxc_nfc_21() || is_mxc_nfc_32()) {
int i;
 
/*
@@ -262,10 +287,16 @@ static void send_read_page(struct mxc_nand_host *host, 
uint8_t buf_id,
 /* Request the NANDFC to perform a read of the NAND device ID. */
 static void send_read_id(struct mxc_nand_host *host)
 {
-   uint16_t tmp;

[U-Boot] [PATCH v11 11/30] arm1136: Remove redundant relocate_code() return

2013-04-09 Thread Benoît Thébaudeau
Signed-off-by: Benoît Thébaudeau 
---
Changes in v11: None
Changes in v10: None
Changes in v9: None
Changes in v8: None
Changes in v7: None
Changes in v6:
 - New patch, extracted from "nand: mxc: Switch NAND SPL to generic SPL".

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/arm/cpu/arm1136/start.S |2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/arm/cpu/arm1136/start.S b/arch/arm/cpu/arm1136/start.S
index eda4bc0..5225639 100644
--- a/arch/arm/cpu/arm1136/start.S
+++ b/arch/arm/cpu/arm1136/start.S
@@ -237,8 +237,6 @@ fixnext:
add r2, r2, #8  /* each rel.dyn entry is 8 bytes */
cmp r2, r3
blo fixloop
-   bx  lr
-
 #endif
 
 relocate_done:
-- 
1.7.10.4

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


[U-Boot] [PATCH v11 08/30] nand: mxc: Use appropriate page number in syndrome functions

2013-04-09 Thread Benoît Thébaudeau
The syndrome functions should use the page number passed as argument instead of
the page number saved upon NAND_CMD_READ0.

This does not make any difference if the NAND_NO_AUTOINCR option is set, but
otherwise this fixes accesses to the wrong pages.

Signed-off-by: Benoît Thébaudeau 
Acked-by: Scott Wood 
---
Changes in v11: None
Changes in v10: None
Changes in v9: None
Changes in v8: None
Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4:
 - New patch.

Changes in v3: None
Changes in v2: None

 drivers/mtd/nand/mxc_nand.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index 62d6965..29ceab3 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -463,7 +463,7 @@ static int mxc_nand_read_page_raw_syndrome(struct mtd_info 
*mtd,
int n;
 
_mxc_nand_enable_hwecc(mtd, 0);
-   chip->cmdfunc(mtd, NAND_CMD_READ0, 0x00, host->page_addr);
+   chip->cmdfunc(mtd, NAND_CMD_READ0, 0x00, page);
 
for (n = 0, steps = chip->ecc.steps; steps > 0; n++, steps--) {
host->col_addr = n * eccsize;
@@ -507,7 +507,7 @@ static int mxc_nand_read_page_syndrome(struct mtd_info *mtd,
uint8_t *oob = chip->oob_poi;
 
MTDDEBUG(MTD_DEBUG_LEVEL1, "Reading page %u to buf %p oob %p\n",
- host->page_addr, buf, oob);
+ page, buf, oob);
 
/* first read the data area and the available portion of OOB */
for (n = 0; eccsteps; n++, eccsteps--, p += eccsize) {
@@ -545,7 +545,7 @@ static int mxc_nand_read_page_syndrome(struct mtd_info *mtd,
 
/* Then switch ECC off and read the OOB area to get the ECC code */
_mxc_nand_enable_hwecc(mtd, 0);
-   chip->cmdfunc(mtd, NAND_CMD_READOOB, mtd->writesize, host->page_addr);
+   chip->cmdfunc(mtd, NAND_CMD_READOOB, mtd->writesize, page);
eccsteps = chip->ecc.steps;
oob = chip->oob_poi + chip->ecc.prepad;
for (n = 0; eccsteps; n++, eccsteps--, p += eccsize) {
-- 
1.7.10.4

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


[U-Boot] [PATCH v11 03/30] nand: mxc: Prepare to add support for i.MX5

2013-04-09 Thread Benoît Thébaudeau
Add some abstraction to NFC definitions so that some parts of the current code
can also be used for future i.MX5 code.

Clean up a few things by the way.

Signed-off-by: Benoît Thébaudeau 
Acked-by: Scott Wood 
Tested-by: Fabio Estevam 
---
Changes in v11: None
Changes in v10: None
Changes in v9: None
Changes in v8: None
Changes in v7:
 - Fix typo in patch description.

Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3:
 - Separate code reformatting from behavioral changes.

Changes in v2:
 - Fix warning for unused tmp variable in board_nand_init() for NFC V1.

 drivers/mtd/nand/mxc_nand.c  |   92 +-
 include/fsl_nfc.h|   72 -
 nand_spl/nand_boot_fsl_nfc.c |   47 +++--
 3 files changed, 97 insertions(+), 114 deletions(-)

diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index bb475f2..6ae95d6 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -119,7 +119,7 @@ static uint32_t *mxc_nand_memcpy32(uint32_t *dest, uint32_t 
*source, size_t size
 
 /*
  * This function polls the NANDFC to wait for the basic operation to
- * complete by checking the INT bit of config2 register.
+ * complete by checking the INT bit.
  */
 static void wait_op_done(struct mxc_nand_host *host, int max_retries,
uint16_t param)
@@ -127,10 +127,10 @@ static void wait_op_done(struct mxc_nand_host *host, int 
max_retries,
uint32_t tmp;
 
while (max_retries-- > 0) {
-   if (readw(&host->regs->config2) & NFC_INT) {
-   tmp = readw(&host->regs->config2);
-   tmp  &= ~NFC_INT;
-   writew(tmp, &host->regs->config2);
+   tmp = readnfc(&host->regs->config2);
+   if (tmp & NFC_V1_V2_CONFIG2_INT) {
+   tmp &= ~NFC_V1_V2_CONFIG2_INT;
+   writenfc(tmp, &host->regs->config2);
break;
}
udelay(1);
@@ -149,8 +149,8 @@ static void send_cmd(struct mxc_nand_host *host, uint16_t 
cmd)
 {
MTDDEBUG(MTD_DEBUG_LEVEL3, "send_cmd(host, 0x%x)\n", cmd);
 
-   writew(cmd, &host->regs->flash_cmd);
-   writew(NFC_CMD, &host->regs->config2);
+   writenfc(cmd, &host->regs->flash_cmd);
+   writenfc(NFC_CMD, &host->regs->operation);
 
/* Wait for operation to complete */
wait_op_done(host, TROP_US_DELAY, cmd);
@@ -165,8 +165,8 @@ static void send_addr(struct mxc_nand_host *host, uint16_t 
addr)
 {
MTDDEBUG(MTD_DEBUG_LEVEL3, "send_addr(host, 0x%x)\n", addr);
 
-   writew(addr, &host->regs->flash_addr);
-   writew(NFC_ADDR, &host->regs->config2);
+   writenfc(addr, &host->regs->flash_addr);
+   writenfc(NFC_ADDR, &host->regs->operation);
 
/* Wait for operation to complete */
wait_op_done(host, TROP_US_DELAY, addr);
@@ -198,19 +198,19 @@ static void send_prog_page(struct mxc_nand_host *host, 
uint8_t buf_id,
}
}
 
-   writew(buf_id, &host->regs->buf_addr);
+   writenfc(buf_id, &host->regs->buf_addr);
 
/* Configure spare or page+spare access */
if (!host->pagesize_2k) {
-   uint16_t config1 = readw(&host->regs->config1);
+   uint16_t config1 = readnfc(&host->regs->config1);
if (spare_only)
-   config1 |= NFC_SP_EN;
+   config1 |= NFC_CONFIG1_SP_EN;
else
-   config1 &= ~NFC_SP_EN;
-   writew(config1, &host->regs->config1);
+   config1 &= ~NFC_CONFIG1_SP_EN;
+   writenfc(config1, &host->regs->config1);
}
 
-   writew(NFC_INPUT, &host->regs->config2);
+   writenfc(NFC_INPUT, &host->regs->operation);
 
/* Wait for operation to complete */
wait_op_done(host, TROP_US_DELAY, spare_only);
@@ -225,19 +225,19 @@ static void send_read_page(struct mxc_nand_host *host, 
uint8_t buf_id,
 {
MTDDEBUG(MTD_DEBUG_LEVEL3, "send_read_page (%d)\n", spare_only);
 
-   writew(buf_id, &host->regs->buf_addr);
+   writenfc(buf_id, &host->regs->buf_addr);
 
/* Configure spare or page+spare access */
if (!host->pagesize_2k) {
-   uint32_t config1 = readw(&host->regs->config1);
+   uint32_t config1 = readnfc(&host->regs->config1);
if (spare_only)
-   config1 |= NFC_SP_EN;
+   config1 |= NFC_CONFIG1_SP_EN;
else
-   config1 &= ~NFC_SP_EN;
-   writew(config1, &host->regs->config1);
+   config1 &= ~NFC_CONFIG1_SP_EN;
+   writenfc(config1, &host->regs->config1);
}
 
-   writew(NFC_OUTPUT, &host->regs->config2);
+   writenfc(NFC_OUTPUT, &host->regs->operation);
 
/* Wait for ope

[U-Boot] [PATCH v11 01/30] mtd: nand: Introduce CONFIG_SYS_NAND_BUSWIDTH_16BIT

2013-04-09 Thread Benoît Thébaudeau
From: Fabio Estevam 

Introduce CONFIG_SYS_NAND_BUSWIDTH_16BIT option so that other NAND controller
drivers could use it when a 16-bit NAND is deployed.

drivers/mtd/nand/ndfc has CONFIG_SYS_NDFC_16BIT, so just rename it, so that
other NAND drivers could reuse the same symbol.

Signed-off-by: Fabio Estevam 
Acked-by: Scott Wood 
Reviewed-by: Benoît Thébaudeau 
---
Changes in v11: None
Changes in v10: None
Changes in v9: None
Changes in v8:
 - New patch.

Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 README  |9 ++---
 drivers/mtd/nand/ndfc.c |4 ++--
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/README b/README
index 5c5cd18..e9c3145 100644
--- a/README
+++ b/README
@@ -3755,9 +3755,12 @@ Low Level (hardware related) configuration options:
 - CONFIG_SYS_SRIOn_MEM_SIZE:
Size of SRIO port 'n' memory region
 
-- CONFIG_SYS_NDFC_16
-   Defined to tell the NDFC that the NAND chip is using a
-   16 bit bus.
+- CONFIG_SYS_NAND_BUSWIDTH_16BIT
+   Defined to tell the NAND controller that the NAND chip is using
+   a 16 bit bus.
+   Not all NAND drivers use this symbol.
+   Example of driver that uses it:
+   - drivers/mtd/nand/ndfc.c
 
 - CONFIG_SYS_NDFC_EBC0_CFG
Sets the EBC0_CFG register for the NDFC. If not defined
diff --git a/drivers/mtd/nand/ndfc.c b/drivers/mtd/nand/ndfc.c
index 6ebbb5e..213d2c9 100644
--- a/drivers/mtd/nand/ndfc.c
+++ b/drivers/mtd/nand/ndfc.c
@@ -156,7 +156,7 @@ static uint8_t ndfc_read_byte(struct mtd_info *mtd)
 
struct nand_chip *chip = mtd->priv;
 
-#ifdef CONFIG_SYS_NDFC_16BIT
+#ifdef CONFIG_SYS_NAND_BUSWIDTH_16BIT
return (uint8_t) readw(chip->IO_ADDR_R);
 #else
return readb(chip->IO_ADDR_R);
@@ -218,7 +218,7 @@ int board_nand_init(struct nand_chip *nand)
nand->ecc.bytes = 3;
nand->select_chip = ndfc_select_chip;
 
-#ifdef CONFIG_SYS_NDFC_16BIT
+#ifdef CONFIG_SYS_NAND_BUSWIDTH_16BIT
nand->options |= NAND_BUSWIDTH_16;
 #endif
 
-- 
1.7.10.4

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


[U-Boot] [PATCH v11 02/30] mtd: nand: mxc_nand: Fix is_16bit_nand()

2013-04-09 Thread Benoît Thébaudeau
From: Fabio Estevam 

Currently is_16bit_nand() is a per SoC function and it decides the bus nand
width by reading some boot related registers.

This method works when NAND is the boot medium, but does not work if another
boot medium is used. For example: booting from a SD card and then using NAND
to store the environment variables, would lead to the following error:

NAND bus width 16 instead 8 bit
No NAND device found!!!
0 MiB

Use CONFIG_SYS_NAND_BUSWIDTH_16BIT symbol to decide the bus width.

If it is defined in the board file, then consider 16-bit NAND bus-width,
otherwise assume 8-bit NAND is used.

This also aligns with Documentation/devicetree/bindings/mtd/nand.txt, which
states:

nand-bus-width : 8 or 16 bus width if not present 8

Signed-off-by: Fabio Estevam 
Acked-by: Scott Wood 
Reviewed-by: Benoît Thébaudeau 
---
Changes in v11: None
Changes in v10: None
Changes in v9: None
Changes in v8:
 - New patch.

Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 README  |3 ++-
 drivers/mtd/nand/mxc_nand.c |   37 +++--
 2 files changed, 5 insertions(+), 35 deletions(-)

diff --git a/README b/README
index e9c3145..9285ddd 100644
--- a/README
+++ b/README
@@ -3759,8 +3759,9 @@ Low Level (hardware related) configuration options:
Defined to tell the NAND controller that the NAND chip is using
a 16 bit bus.
Not all NAND drivers use this symbol.
-   Example of driver that uses it:
+   Example of drivers that use it:
- drivers/mtd/nand/ndfc.c
+   - drivers/mtd/nand/mxc_nand.c
 
 - CONFIG_SYS_NDFC_EBC0_CFG
Sets the EBC0_CFG register for the NDFC. If not defined
diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index d0ded48..bb475f2 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -98,45 +98,14 @@ static struct nand_ecclayout nand_hw_eccoob2k = {
 #endif
 #endif
 
-#ifdef CONFIG_MX27
 static int is_16bit_nand(void)
 {
-   struct system_control_regs *sc_regs =
-   (struct system_control_regs *)IMX_SYSTEM_CTL_BASE;
-
-   if (readl(&sc_regs->fmcr) & NF_16BIT_SEL)
-   return 1;
-   else
-   return 0;
-}
-#elif defined(CONFIG_MX31)
-static int is_16bit_nand(void)
-{
-   struct clock_control_regs *sc_regs =
-   (struct clock_control_regs *)CCM_BASE;
-
-   if (readl(&sc_regs->rcsr) & CCM_RCSR_NF16B)
-   return 1;
-   else
-   return 0;
-}
-#elif defined(CONFIG_MX25) || defined(CONFIG_MX35)
-static int is_16bit_nand(void)
-{
-   struct ccm_regs *ccm = (struct ccm_regs *)IMX_CCM_BASE;
-
-   if (readl(&ccm->rcsr) & CCM_RCSR_NF_16BIT_SEL)
-   return 1;
-   else
-   return 0;
-}
+#if defined(CONFIG_SYS_NAND_BUSWIDTH_16BIT)
+   return 1;
 #else
-#warning "8/16 bit NAND autodetection not supported"
-static int is_16bit_nand(void)
-{
return 0;
-}
 #endif
+}
 
 static uint32_t *mxc_nand_memcpy32(uint32_t *dest, uint32_t *source, size_t 
size)
 {
-- 
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] mx28evk: add trimffs to nand command

2013-04-09 Thread Eric Bénard
Hi Fabio,

Le Tue, 9 Apr 2013 15:02:44 -0300,
Fabio Estevam  a écrit :

> Eric Bénard wrote:
> > this is usefull when writing an UBI image which contains
> > and UBIFS volume (check README.nand and UBI FAQ for more details)
> > 
> > Signed-off-by: Eric Bénard 
> > ---
> >  include/configs/mx28evk.h | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/include/configs/mx28evk.h b/include/configs/mx28evk.h
> > index d470b47..b22a20b 100644
> > --- a/include/configs/mx28evk.h
> > +++ b/include/configs/mx28evk.h
> > @@ -63,6 +63,7 @@
> >  #define CONFIG_CMD_USB
> >  #define CONFIG_CMD_BOOTZ
> >  #define CONFIG_CMD_NAND
> > +#define CONFIG_CMD_NAND_TRIMFFS
> 
> You should add this into mx28evk_nand.h, available in u-boot.imx tree.

that's the second time you ask this but mx28evk_nand.h doesn't exist,
even in u-boot-imx tree, and you are the developer who added nand
support to mx28evk in commit
ab461be65dbfe3e2fa45f7cd836faa99663be5bb ;-)

Here is a reminder of what you did in that commit : you added the
mx28evk_nand option in boards.cfg which defines ENV_IS_IN_NAND when
mx28evk defines ENV_IS_IN_MMC and both are using the same config which
is include/configs/mx28evk.h :
http://git.denx.de/?p=u-boot/u-boot-imx.git;a=commitdiff;h=ab461be65dbfe3e2fa45f7cd836faa99663be5bb

So this patch is fine against u-boot-imx.

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


[U-Boot] [PATCH v2 2/3] mx6: Add solo-lite variant support

2013-04-09 Thread Fabio Estevam
mx6 solo-lite is another member of the mx6 series. 

For more information about mx6 solo-lite, please visit:
http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=i.MX6SL&nodeId=018rH3ZrDRB24A

Signed-off-by: Fabio Estevam 
---
Changes since v1:
- None

 arch/arm/cpu/armv7/mx6/clock.c |   38 -
 arch/arm/include/asm/arch-mx6/crm_regs.h   |5 +++
 arch/arm/include/asm/arch-mx6/imx-regs.h   |   63 +++-
 arch/arm/include/asm/arch-mx6/mx6-pins.h   |4 ++
 arch/arm/include/asm/arch-mx6/mx6sl_pins.h |   25 +++
 5 files changed, 132 insertions(+), 3 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-mx6/mx6sl_pins.h

diff --git a/arch/arm/cpu/armv7/mx6/clock.c b/arch/arm/cpu/armv7/mx6/clock.c
index a50db70..8cba4fd 100644
--- a/arch/arm/cpu/armv7/mx6/clock.c
+++ b/arch/arm/cpu/armv7/mx6/clock.c
@@ -186,12 +186,16 @@ static u32 get_ipg_per_clk(void)
 static u32 get_uart_clk(void)
 {
u32 reg, uart_podf;
-
+   u32 freq = PLL3_80M;
reg = __raw_readl(&imx_ccm->cscdr1);
+#ifdef CONFIG_MX6SL
+   if (reg & MXC_CCM_CSCDR1_UART_CLK_SEL)
+   freq = MXC_HCLK;
+#endif
reg &= MXC_CCM_CSCDR1_UART_CLK_PODF_MASK;
uart_podf = reg >> MXC_CCM_CSCDR1_UART_CLK_PODF_OFFSET;
 
-   return PLL3_80M / (uart_podf + 1);
+   return freq / (uart_podf + 1);
 }
 
 static u32 get_cspi_clk(void)
@@ -252,6 +256,35 @@ static u32 get_emi_slow_clk(void)
return root_freq / (emi_slow_pof + 1);
 }
 
+#ifdef CONFIG_MX6SL
+static u32 get_mmdc_ch0_clk(void)
+{
+   u32 cbcmr = __raw_readl(&imx_ccm->cbcmr);
+   u32 cbcdr = __raw_readl(&imx_ccm->cbcdr);
+   u32 freq, podf;
+
+   podf = (cbcdr & MXC_CCM_CBCDR_MMDC_CH1_PODF_MASK) \
+   >> MXC_CCM_CBCDR_MMDC_CH1_PODF_OFFSET;
+
+   switch ((cbcmr & MXC_CCM_CBCMR_PRE_PERIPH2_CLK_SEL_MASK) >>
+   MXC_CCM_CBCMR_PRE_PERIPH2_CLK_SEL_OFFSET) {
+   case 0:
+   freq = decode_pll(PLL_BUS, MXC_HCLK);
+   break;
+   case 1:
+   freq = PLL2_PFD2_FREQ;
+   break;
+   case 2:
+   freq = PLL2_PFD0_FREQ;
+   break;
+   case 3:
+   freq = PLL2_PFD2_DIV_FREQ;
+   }
+
+   return freq / (podf + 1);
+
+}
+#else
 static u32 get_mmdc_ch0_clk(void)
 {
u32 cbcdr = __raw_readl(&imx_ccm->cbcdr);
@@ -260,6 +293,7 @@ static u32 get_mmdc_ch0_clk(void)
 
return get_periph_clk() / (mmdc_ch0_podf + 1);
 }
+#endif
 
 static u32 get_usdhc_clk(u32 port)
 {
diff --git a/arch/arm/include/asm/arch-mx6/crm_regs.h 
b/arch/arm/include/asm/arch-mx6/crm_regs.h
index 7676457..b1ed62f 100644
--- a/arch/arm/include/asm/arch-mx6/crm_regs.h
+++ b/arch/arm/include/asm/arch-mx6/crm_regs.h
@@ -244,7 +244,12 @@ struct mxc_ccm_reg {
 #define MXC_CCM_CSCDR1_USBOH3_CLK_PRED_MASK(0x7 << 8)
 #define MXC_CCM_CSCDR1_USBOH3_CLK_PODF_OFFSET  6
 #define MXC_CCM_CSCDR1_USBOH3_CLK_PODF_MASK(0x3 << 6)
+#ifdef CONFIG_MX6SL
+#define MXC_CCM_CSCDR1_UART_CLK_PODF_MASK  0x1F
+#define MXC_CCM_CSCDR1_UART_CLK_SEL(1 << 6)
+#else
 #define MXC_CCM_CSCDR1_UART_CLK_PODF_MASK  0x3F
+#endif
 #define MXC_CCM_CSCDR1_UART_CLK_PODF_OFFSET0
 
 /* Define the bits in register CS1CDR */
diff --git a/arch/arm/include/asm/arch-mx6/imx-regs.h 
b/arch/arm/include/asm/arch-mx6/imx-regs.h
index eaa7439..2d8fe69 100644
--- a/arch/arm/include/asm/arch-mx6/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx6/imx-regs.h
@@ -25,6 +25,13 @@
 
 #define ROMCP_ARB_BASE_ADDR 0x
 #define ROMCP_ARB_END_ADDR  0x000F
+
+#ifdef CONFIG_MX6SL
+#define GPU_2D_ARB_BASE_ADDR0x0220
+#define GPU_2D_ARB_END_ADDR 0x02203FFF
+#define OPENVG_ARB_BASE_ADDR0x02204000
+#define OPENVG_ARB_END_ADDR 0x02207FFF
+#else
 #define CAAM_ARB_BASE_ADDR  0x0010
 #define CAAM_ARB_END_ADDR   0x00103FFF
 #define APBH_DMA_ARB_BASE_ADDR  0x0011
@@ -37,9 +44,14 @@
 #define GPU_2D_ARB_END_ADDR 0x00137FFF
 #define DTCP_ARB_BASE_ADDR  0x00138000
 #define DTCP_ARB_END_ADDR   0x0013BFFF
-
+#endif /* CONFIG_MX6SL */
 /* GPV - PL301 configuration ports */
+#ifdef CONFIG_MX6SL
+#define GPV2_BASE_ADDR  0x00D0
+#else
 #define GPV2_BASE_ADDR 0x0020
+#endif
+
 #define GPV3_BASE_ADDR 0x0030
 #define GPV4_BASE_ADDR 0x0080
 #define IRAM_BASE_ADDR 0x0090
@@ -70,10 +82,17 @@
 #define WEIM_ARB_BASE_ADDR  0x0800
 #define WEIM_ARB_END_ADDR   0x0FFF
 
+#ifdef CONFIG_MX6SL
+#define MMDC0_ARB_BASE_ADDR 0x8000
+#define MMDC0_ARB_END_ADDR  0x
+#define MMDC1_ARB_BASE_ADDR 0xC000
+#define MMDC1_ARB_END_ADDR  0x
+#else

[U-Boot] [PATCH v2 1/3] iomux-v3: Place pad control definitions into common file

2013-04-09 Thread Fabio Estevam
Instead of having the same PAD control definition in each MX6 variant pin file,
place it into a common location.

Signed-off-by: Fabio Estevam 
---
Changes since v2:
- Add missing IOMUX_CONFIG_SION definition
 arch/arm/include/asm/arch-mx6/mx6dl_pins.h |   27 ---
 arch/arm/include/asm/arch-mx6/mx6q_pins.h  |   27 ---
 arch/arm/include/asm/imx-common/iomux-v3.h |   27 ++-
 3 files changed, 26 insertions(+), 55 deletions(-)

diff --git a/arch/arm/include/asm/arch-mx6/mx6dl_pins.h 
b/arch/arm/include/asm/arch-mx6/mx6dl_pins.h
index 9846f1b..0ed12f3 100644
--- a/arch/arm/include/asm/arch-mx6/mx6dl_pins.h
+++ b/arch/arm/include/asm/arch-mx6/mx6dl_pins.h
@@ -22,33 +22,6 @@
 
 #include 
 
-/* Use to set PAD control */
-#define PAD_CTL_HYS(1 << 16)
-#define PAD_CTL_PUS_100K_DOWN  (0 << 14)
-#define PAD_CTL_PUS_47K_UP (1 << 14)
-#define PAD_CTL_PUS_100K_UP(2 << 14)
-#define PAD_CTL_PUS_22K_UP (3 << 14)
-
-#define PAD_CTL_PUE(1 << 13)
-#define PAD_CTL_PKE(1 << 12)
-#define PAD_CTL_ODE(1 << 11)
-#define PAD_CTL_SPEED_LOW  (1 << 6)
-#define PAD_CTL_SPEED_MED  (2 << 6)
-#define PAD_CTL_SPEED_HIGH (3 << 6)
-#define PAD_CTL_DSE_DISABLE(0 << 3)
-#define PAD_CTL_DSE_240ohm (1 << 3)
-#define PAD_CTL_DSE_120ohm (2 << 3)
-#define PAD_CTL_DSE_80ohm  (3 << 3)
-#define PAD_CTL_DSE_60ohm  (4 << 3)
-#define PAD_CTL_DSE_48ohm  (5 << 3)
-#define PAD_CTL_DSE_40ohm  (6 << 3)
-#define PAD_CTL_DSE_34ohm  (7 << 3)
-#define PAD_CTL_SRE_FAST   (1 << 0)
-#define PAD_CTL_SRE_SLOW   (0 << 0)
-
-#define IOMUX_CONFIG_SION 0x10
-#define NO_MUX_I0
-#define NO_PAD_I0
 enum {
MX6_PAD_CSI0_DAT10__UART1_TXD   = IOMUX_PAD(0x0360, 0x004C, 3, 
0x, 0, 0),
MX6_PAD_CSI0_DAT11__UART1_RXD   = IOMUX_PAD(0x0364, 0x0050, 3, 
0x08FC, 1, 0),
diff --git a/arch/arm/include/asm/arch-mx6/mx6q_pins.h 
b/arch/arm/include/asm/arch-mx6/mx6q_pins.h
index 1c1c008..02a40d4 100644
--- a/arch/arm/include/asm/arch-mx6/mx6q_pins.h
+++ b/arch/arm/include/asm/arch-mx6/mx6q_pins.h
@@ -24,33 +24,6 @@
 
 #include 
 
-/* Use to set PAD control */
-#define PAD_CTL_HYS(1 << 16)
-#define PAD_CTL_PUS_100K_DOWN  (0 << 14)
-#define PAD_CTL_PUS_47K_UP (1 << 14)
-#define PAD_CTL_PUS_100K_UP(2 << 14)
-#define PAD_CTL_PUS_22K_UP (3 << 14)
-
-#define PAD_CTL_PUE(1 << 13)
-#define PAD_CTL_PKE(1 << 12)
-#define PAD_CTL_ODE(1 << 11)
-#define PAD_CTL_SPEED_LOW  (1 << 6)
-#define PAD_CTL_SPEED_MED  (2 << 6)
-#define PAD_CTL_SPEED_HIGH (3 << 6)
-#define PAD_CTL_DSE_DISABLE(0 << 3)
-#define PAD_CTL_DSE_240ohm (1 << 3)
-#define PAD_CTL_DSE_120ohm (2 << 3)
-#define PAD_CTL_DSE_80ohm  (3 << 3)
-#define PAD_CTL_DSE_60ohm  (4 << 3)
-#define PAD_CTL_DSE_48ohm  (5 << 3)
-#define PAD_CTL_DSE_40ohm  (6 << 3)
-#define PAD_CTL_DSE_34ohm  (7 << 3)
-#define PAD_CTL_SRE_FAST   (1 << 0)
-#define PAD_CTL_SRE_SLOW   (0 << 0)
-
-#define NO_MUX_I0
-#define NO_PAD_I0
-
 enum {
MX6_PAD_SD2_DAT1__USDHC2_DAT1   = IOMUX_PAD(0x0360, 0x004C, 0, 
0x, 0, 0),
MX6_PAD_SD2_DAT1__ECSPI5_SS0= IOMUX_PAD(0x0360, 0x004C, 1, 
0x0834, 0, 0),
diff --git a/arch/arm/include/asm/imx-common/iomux-v3.h 
b/arch/arm/include/asm/imx-common/iomux-v3.h
index c34bb76..36917c8 100644
--- a/arch/arm/include/asm/imx-common/iomux-v3.h
+++ b/arch/arm/include/asm/imx-common/iomux-v3.h
@@ -95,7 +95,32 @@ typedef u64 iomux_v3_cfg_t;
 #define GPIO_PORTE (4 << GPIO_PORT_SHIFT)
 #define GPIO_PORTF (5 << GPIO_PORT_SHIFT)
 
-#define MUX_CONFIG_SION(0x1 << 4)
+#define PAD_CTL_HYS(1 << 16)
+#define PAD_CTL_PUS_100K_DOWN  (0 << 14)
+#define PAD_CTL_PUS_47K_UP (1 << 14)
+#define PAD_CTL_PUS_100K_UP(2 << 14)
+#define PAD_CTL_PUS_22K_UP (3 << 14)
+
+#define PAD_CTL_PUE(1 << 13)
+#define PAD_CTL_PKE(1 << 12)
+#define PAD_CTL_ODE(1 << 11)
+#define PAD_CTL_SPEED_LOW  (1 << 6)
+#define PAD_CTL_SPEED_MED  (2 << 6)
+#define PAD_CTL_SPEED_HIGH (3 << 6)
+#define PAD_CTL_DSE_DISABLE(0 << 3)
+#define PAD_CTL_DSE_240ohm (1 << 3)
+#define PAD_CTL_DSE_120ohm (2 << 3)
+#define PAD_CTL_DSE_80ohm  (3 << 3)
+#define PAD_CTL_DSE_60ohm  (4 << 3)
+#define PAD_CTL_DSE_48ohm  (5 << 3)
+#define PAD_CTL_DSE_40ohm  (6 << 3)
+#define PAD_CTL_DSE_34ohm  (7 << 3)
+#define PAD_CTL_SRE_FAST   (1 << 0)
+#define PAD_CTL_SRE_SLOW   (0 << 0)
+
+#define IOMUX_CONFIG_SION  0x10
+#define NO_MUX_I   0
+#define NO_PAD_I   0
 
 int imx_iomux_v3_setup_pad(iomux_v3_cfg_t pad);
 int imx_iomux_v3_setup_multiple_pads(iomux_v3_cfg_t const *pad_list,
-- 
1.7.9.5


___

Re: [U-Boot] [PATCH v2 1/3] iomux-v3: Place pad control definitions into common file

2013-04-09 Thread Otavio Salvador
On Tue, Apr 9, 2013 at 3:55 PM, Fabio Estevam
 wrote:
> Instead of having the same PAD control definition in each MX6 variant pin 
> file,
> place it into a common location.
>
> Signed-off-by: Fabio Estevam 

This fixes the build failure.

Acked-by: Otavio Salvador 

--
Otavio Salvador O.S. Systems
E-mail: ota...@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854  http://projetos.ossystems.com.br
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] mx31pdk: Remove watchdog support

2013-04-09 Thread Fabio Estevam
The conversion of mx31pdk to SPL NAND fixed the boot issue, but we start seeing 
resets in loop, which prevents us from reaching the U-boot prompt.

Until the proper fix can be identified, disable watchdog, so that mx31pdk
can be functional again.

Signed-off-by: Fabio Estevam 
---
 include/configs/mx31pdk.h |2 --
 1 file changed, 2 deletions(-)

diff --git a/include/configs/mx31pdk.h b/include/configs/mx31pdk.h
index 34e4295..da894c4 100644
--- a/include/configs/mx31pdk.h
+++ b/include/configs/mx31pdk.h
@@ -60,8 +60,6 @@
 
 #define CONFIG_MXC_UART
 #define CONFIG_MXC_UART_BASE   UART1_BASE
-#define CONFIG_HW_WATCHDOG
-#define CONFIG_IMX_WATCHDOG
 #define CONFIG_MXC_GPIO
 
 #define CONFIG_HARD_SPI
-- 
1.7.9.5


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


[U-Boot] [PATCH v2 3/3] mx6sl: Add initial support for mx6slevk board

2013-04-09 Thread Fabio Estevam
mx6slevk board is a development board from Freescale based on the mx6 solo-lite
processor.

For details about mx6slevk, please refer to:
http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=IMX6SLEVK&parentCode=i.MX6SL&fpsp=1

Signed-off-by: Fabio Estevam 
---
Changes since v1:
- None

 MAINTAINERS   |1 +
 board/freescale/mx6slevk/Makefile |   28 +
 board/freescale/mx6slevk/imximage.cfg |  118 
 board/freescale/mx6slevk/mx6slevk.c   |  102 ++
 boards.cfg|1 +
 include/configs/mx6slevk.h|  189 +
 6 files changed, 439 insertions(+)
 create mode 100644 board/freescale/mx6slevk/Makefile
 create mode 100644 board/freescale/mx6slevk/imximage.cfg
 create mode 100644 board/freescale/mx6slevk/mx6slevk.c
 create mode 100644 include/configs/mx6slevk.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 0f19078..723a316 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -665,6 +665,7 @@ Fabio Estevam 
mx6qsabresd i.MX6Q
mx6qsabreauto   i.MX6Q
wandboard   i.MX6DL/S
+   mx6slevki.MX6SL
 
 Daniel Gorsulowski 
 
diff --git a/board/freescale/mx6slevk/Makefile 
b/board/freescale/mx6slevk/Makefile
new file mode 100644
index 000..43af351
--- /dev/null
+++ b/board/freescale/mx6slevk/Makefile
@@ -0,0 +1,28 @@
+# (C) Copyright 2013 Freescale Semiconductor, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS  := mx6slevk.o
+
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+$(LIB):$(obj).depend $(OBJS)
+   $(call cmd_link_o_target, $(OBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/freescale/mx6slevk/imximage.cfg 
b/board/freescale/mx6slevk/imximage.cfg
new file mode 100644
index 000..df39a16
--- /dev/null
+++ b/board/freescale/mx6slevk/imximage.cfg
@@ -0,0 +1,118 @@
+/*
+ * Copyright (C) 2013 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License or (at your option) any later version.
+ *
+ * Refer docs/README.imxmage for more details about how-to configure
+ * and create imximage boot image
+ *
+ * The syntax is taken as close as possible with the kwbimage
+ */
+
+/* image version */
+
+IMAGE_VERSION 2
+
+/*
+ * Boot Device : one of
+ * spi, sd (the board has no nand neither onenand)
+ */
+
+BOOT_FROM  sd
+
+/*
+ * Device Configuration Data (DCD)
+ *
+ * Each entry must have the format:
+ * Addr-type   AddressValue
+ *
+ * where:
+ * Addr-type register length (1,2 or 4 bytes)
+ * Address   absolute address of the register
+ * value value to be stored in the register
+ */
+DATA 4 0x020c4018 0x00260324
+
+DATA 4 0x020c4068 0x
+DATA 4 0x020c406c 0x
+DATA 4 0x020c4070 0x
+DATA 4 0x020c4074 0x
+DATA 4 0x020c4078 0x
+DATA 4 0x020c407c 0x
+DATA 4 0x020c4080 0x
+
+DATA 4 0x020e0344 0x3030
+DATA 4 0x020e0348 0x3030
+DATA 4 0x020e034c 0x3030
+DATA 4 0x020e0350 0x3030
+DATA 4 0x020e030c 0x0030
+DATA 4 0x020e0310 0x0030
+DATA 4 0x020e0314 0x0030
+DATA 4 0x020e0318 0x0030
+DATA 4 0x020e0300 0x0030
+DATA 4 0x020e031c 0x0030
+DATA 4 0x020e0338 0x0028
+DATA 4 0x020e0320 0x0030
+DATA 4 0x020e032c 0x
+DATA 4 0x020e033c 0x0008
+DATA 4 0x020e0340 0x0008
+DATA 4 0x020e05c4 0x0030
+DATA 4 0x020e05cc 0x0030
+DATA 4 0x020e05d4 0x0030
+DATA 4 0x020e05d8 0x0030
+DATA 4 0x020e05ac 0x0030
+DATA 4 0x020e05c8 0x0030
+DATA 4 0x020e05b0 0x0002
+DATA 4 0x020e05b4 0x
+DATA 4 0x020e05c0 0x0002
+DATA 4 0x020e05d0 0x0008
+
+DATA 4 0x021b001c 0x8000
+DATA 4 0x021b085c 0x1b4700c7
+DATA 4 0x021b0800 0xa1390003
+DATA 4 0x021b0890 0x0030
+DATA 4 0x021b08b8 0x0800
+DATA 4 0x021b081c 0x
+DATA 4 0x021b0820 0x
+DATA 4 0x021b0824 0x
+DATA 4 0x021b0828 0x
+DATA 4 0x021b082c 0xf333
+DATA 4 0x021b0830 0xf333
+DATA 4 0x021b0834 0xf333
+DATA 4 0x021b0838 0xf333
+DATA 4 0x021b0848 0x4241444a
+DATA 4 0x021b0850 0x3030312b
+DATA 4 0x021b083c 0x2000
+DATA 4 0x021b0840 0x
+DATA 4 0x021b08c0 0x24911492
+DATA 4 0x021b08b8 0x0800
+DATA 4 0x021b000c 0x33374133
+DATA 4 0x021b0004 0x00020024
+DATA 4 0x021b0010

Re: [U-Boot] [PATCH v9 18/30] nand: mxc: Switch NAND SPL to generic SPL

2013-04-09 Thread Benoît Thébaudeau
On Tuesday, April 9, 2013 8:35:09 PM, Fabio Estevam wrote:
> On Tue, Apr 9, 2013 at 3:10 PM, Benoît Thébaudeau
>  wrote:
> 
> > These values were very wide, just for testing. It'd be better to adjust
> > them. So
> > can you just try the following, and I'll stop asking for more tests:
> > -#define CONFIG_SPL_TEXT_BASE   0x87ec
> > -#define CONFIG_SYS_TEXT_BASE   0x87f0
> > +#define CONFIG_SPL_TEXT_BASE   0x87dc
> > +#define CONFIG_SYS_TEXT_BASE   0x87e0
> > -#define CONFIG_HW_WATCHDOG
> > -#define CONFIG_IMX_WATCHDOG
> > -#define CONFIG_SYS_NAND_U_BOOT_SIZE0x32000
> > +#define CONFIG_SYS_NAND_U_BOOT_SIZE0x3f800
> 
> These values work fine, thanks.

Thanks for testing and for your patience.

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


Re: [U-Boot] [PATCH v9 18/30] nand: mxc: Switch NAND SPL to generic SPL

2013-04-09 Thread Fabio Estevam
On Tue, Apr 9, 2013 at 3:10 PM, Benoît Thébaudeau
 wrote:

> These values were very wide, just for testing. It'd be better to adjust them. 
> So
> can you just try the following, and I'll stop asking for more tests:
> -#define CONFIG_SPL_TEXT_BASE   0x87ec
> -#define CONFIG_SYS_TEXT_BASE   0x87f0
> +#define CONFIG_SPL_TEXT_BASE   0x87dc
> +#define CONFIG_SYS_TEXT_BASE   0x87e0
> -#define CONFIG_HW_WATCHDOG
> -#define CONFIG_IMX_WATCHDOG
> -#define CONFIG_SYS_NAND_U_BOOT_SIZE0x32000
> +#define CONFIG_SYS_NAND_U_BOOT_SIZE0x3f800

These values work fine, thanks.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/3] iomux-v3: Place pad control definitions into common file

2013-04-09 Thread Otavio Salvador
On Fri, Apr 5, 2013 at 9:55 PM, Fabio Estevam  wrote:
> From: Fabio Estevam 
>
> Instead of having the same PAD control definition in each MX6 variant pin 
> file,
> place it into a common location.
>
> Signed-off-by: Fabio Estevam 

Breaks Wandboard builds...

> ---
>  arch/arm/include/asm/arch-mx6/mx6dl_pins.h |   27 ---
>  arch/arm/include/asm/arch-mx6/mx6q_pins.h  |   27 ---
>  arch/arm/include/asm/imx-common/iomux-v3.h |   26 ++
>  3 files changed, 26 insertions(+), 54 deletions(-)
>
> diff --git a/arch/arm/include/asm/arch-mx6/mx6dl_pins.h 
> b/arch/arm/include/asm/arch-mx6/mx6dl_pins.h
> index 9846f1b..0ed12f3 100644
> --- a/arch/arm/include/asm/arch-mx6/mx6dl_pins.h
> +++ b/arch/arm/include/asm/arch-mx6/mx6dl_pins.h
> @@ -22,33 +22,6 @@
>
>  #include 
>
> -/* Use to set PAD control */
> -#define PAD_CTL_HYS(1 << 16)
> -#define PAD_CTL_PUS_100K_DOWN  (0 << 14)
> -#define PAD_CTL_PUS_47K_UP (1 << 14)
> -#define PAD_CTL_PUS_100K_UP(2 << 14)
> -#define PAD_CTL_PUS_22K_UP (3 << 14)
> -
> -#define PAD_CTL_PUE(1 << 13)
> -#define PAD_CTL_PKE(1 << 12)
> -#define PAD_CTL_ODE(1 << 11)
> -#define PAD_CTL_SPEED_LOW  (1 << 6)
> -#define PAD_CTL_SPEED_MED  (2 << 6)
> -#define PAD_CTL_SPEED_HIGH (3 << 6)
> -#define PAD_CTL_DSE_DISABLE(0 << 3)
> -#define PAD_CTL_DSE_240ohm (1 << 3)
> -#define PAD_CTL_DSE_120ohm (2 << 3)
> -#define PAD_CTL_DSE_80ohm  (3 << 3)
> -#define PAD_CTL_DSE_60ohm  (4 << 3)
> -#define PAD_CTL_DSE_48ohm  (5 << 3)
> -#define PAD_CTL_DSE_40ohm  (6 << 3)
> -#define PAD_CTL_DSE_34ohm  (7 << 3)
> -#define PAD_CTL_SRE_FAST   (1 << 0)
> -#define PAD_CTL_SRE_SLOW   (0 << 0)
> -
> -#define IOMUX_CONFIG_SION 0x10

This has not been defined.

> -#define NO_MUX_I0
> -#define NO_PAD_I0
>  enum {
> MX6_PAD_CSI0_DAT10__UART1_TXD   = IOMUX_PAD(0x0360, 0x004C, 
> 3, 0x, 0, 0),
> MX6_PAD_CSI0_DAT11__UART1_RXD   = IOMUX_PAD(0x0364, 0x0050, 
> 3, 0x08FC, 1, 0),
> diff --git a/arch/arm/include/asm/arch-mx6/mx6q_pins.h 
> b/arch/arm/include/asm/arch-mx6/mx6q_pins.h
> index 1c1c008..02a40d4 100644
> --- a/arch/arm/include/asm/arch-mx6/mx6q_pins.h
> +++ b/arch/arm/include/asm/arch-mx6/mx6q_pins.h
> @@ -24,33 +24,6 @@
>
>  #include 
>
> -/* Use to set PAD control */
> -#define PAD_CTL_HYS(1 << 16)
> -#define PAD_CTL_PUS_100K_DOWN  (0 << 14)
> -#define PAD_CTL_PUS_47K_UP (1 << 14)
> -#define PAD_CTL_PUS_100K_UP(2 << 14)
> -#define PAD_CTL_PUS_22K_UP (3 << 14)
> -
> -#define PAD_CTL_PUE(1 << 13)
> -#define PAD_CTL_PKE(1 << 12)
> -#define PAD_CTL_ODE(1 << 11)
> -#define PAD_CTL_SPEED_LOW  (1 << 6)
> -#define PAD_CTL_SPEED_MED  (2 << 6)
> -#define PAD_CTL_SPEED_HIGH (3 << 6)
> -#define PAD_CTL_DSE_DISABLE(0 << 3)
> -#define PAD_CTL_DSE_240ohm (1 << 3)
> -#define PAD_CTL_DSE_120ohm (2 << 3)
> -#define PAD_CTL_DSE_80ohm  (3 << 3)
> -#define PAD_CTL_DSE_60ohm  (4 << 3)
> -#define PAD_CTL_DSE_48ohm  (5 << 3)
> -#define PAD_CTL_DSE_40ohm  (6 << 3)
> -#define PAD_CTL_DSE_34ohm  (7 << 3)
> -#define PAD_CTL_SRE_FAST   (1 << 0)
> -#define PAD_CTL_SRE_SLOW   (0 << 0)
> -
> -#define NO_MUX_I0
> -#define NO_PAD_I0
> -
>  enum {
> MX6_PAD_SD2_DAT1__USDHC2_DAT1   = IOMUX_PAD(0x0360, 0x004C, 
> 0, 0x, 0, 0),
> MX6_PAD_SD2_DAT1__ECSPI5_SS0= IOMUX_PAD(0x0360, 0x004C, 
> 1, 0x0834, 0, 0),
> diff --git a/arch/arm/include/asm/imx-common/iomux-v3.h 
> b/arch/arm/include/asm/imx-common/iomux-v3.h
> index c34bb76..32126a7 100644
> --- a/arch/arm/include/asm/imx-common/iomux-v3.h
> +++ b/arch/arm/include/asm/imx-common/iomux-v3.h
> @@ -97,6 +97,32 @@ typedef u64 iomux_v3_cfg_t;
>
>  #define MUX_CONFIG_SION(0x1 << 4)
>
> +#define PAD_CTL_HYS(1 << 16)
> +#define PAD_CTL_PUS_100K_DOWN  (0 << 14)
> +#define PAD_CTL_PUS_47K_UP (1 << 14)
> +#define PAD_CTL_PUS_100K_UP(2 << 14)
> +#define PAD_CTL_PUS_22K_UP (3 << 14)
> +
> +#define PAD_CTL_PUE(1 << 13)
> +#define PAD_CTL_PKE(1 << 12)
> +#define PAD_CTL_ODE(1 << 11)
> +#define PAD_CTL_SPEED_LOW  (1 << 6)
> +#define PAD_CTL_SPEED_MED  (2 << 6)
> +#define PAD_CTL_SPEED_HIGH (3 << 6)
> +#define PAD_CTL_DSE_DISABLE(0 << 3)
> +#define PAD_CTL_DSE_240ohm (1 << 3)
> +#define PAD_CTL_DSE_120ohm (2 << 3)
> +#define PAD_CTL_DSE_80ohm  (3 << 3)
> +#define PAD_CTL_DSE_60ohm  (4 << 3)
> +#define PAD_CTL_DSE_48ohm  (5 << 3)
> +#define PAD_CTL_DSE_40ohm  (6 << 3)
> +#define PAD_CTL_DSE_34ohm  (7 << 3)
> +#define PAD_CTL_SRE_FAST   (1 << 0)
> +#define PAD_CTL_SRE_SLOW   (0 << 0)
> +
> +#define NO_MUX_I0
> +#define NO_PAD_I0
> +
>  in

Re: [U-Boot] [PATCH v9 18/30] nand: mxc: Switch NAND SPL to generic SPL

2013-04-09 Thread Benoît Thébaudeau
Hi Fabio,

On Tuesday, April 9, 2013 8:07:31 PM, Fabio Estevam wrote:
> On Tue, Apr 9, 2013 at 2:37 PM, Benoît Thébaudeau
>  wrote:
> 
> > Especially, does it work with only:
> > -#define CONFIG_HW_WATCHDOG
> > -#define CONFIG_IMX_WATCHDOG
> > -#define CONFIG_SYS_NAND_U_BOOT_SIZE0x32000
> > +#define CONFIG_SYS_NAND_U_BOOT_SIZE0x3f800
> 
> No, it hangs in "Net :". Also tried 0x4 and the same hang happens.

OK.

> Maybe we should use the proposed values you proposed earlier?

These values were very wide, just for testing. It'd be better to adjust them. So
can you just try the following, and I'll stop asking for more tests:
-#define CONFIG_SPL_TEXT_BASE   0x87ec
-#define CONFIG_SYS_TEXT_BASE   0x87f0
+#define CONFIG_SPL_TEXT_BASE   0x87dc
+#define CONFIG_SYS_TEXT_BASE   0x87e0
-#define CONFIG_HW_WATCHDOG
-#define CONFIG_IMX_WATCHDOG
-#define CONFIG_SYS_NAND_U_BOOT_SIZE0x32000
+#define CONFIG_SYS_NAND_U_BOOT_SIZE0x3f800
?

> I can handle the watchdog patch separately.

OK.

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


Re: [U-Boot] [PATCH v9 18/30] nand: mxc: Switch NAND SPL to generic SPL

2013-04-09 Thread Fabio Estevam
On Tue, Apr 9, 2013 at 2:37 PM, Benoît Thébaudeau
 wrote:

> Especially, does it work with only:
> -#define CONFIG_HW_WATCHDOG
> -#define CONFIG_IMX_WATCHDOG
> -#define CONFIG_SYS_NAND_U_BOOT_SIZE0x32000
> +#define CONFIG_SYS_NAND_U_BOOT_SIZE0x3f800

No, it hangs in "Net :". Also tried 0x4 and the same hang happens.

Maybe we should use the proposed values you proposed earlier?

I can handle the watchdog patch separately.

Regards,

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


Re: [U-Boot] [v3] command/cache: Add flush command

2013-04-09 Thread Wolfgang Denk
Dear Scott Wood,

In message <1365450620.28843.12@snotra> you wrote:
> >
> I thought you said it was OK to flush more than the user asked for, if  
> the implementation does not have separate icache/dcache flushes?  Why  
> is it fundamentally different if it's a hardware limitation, or a  
> limitation of the software layer whose functionality is being exposed?

I don't get what you are trying to prove.  Can you please point me to
the code (ideally in mainline U-Boot) which would cause problems with
the suggested separation of invalidating the IC and flushing the DC
into subcommands of the "icache" resp. "dcache" commands?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Little known fact about Middle Earth:   The Hobbits had a very sophi-
sticated computer network!   It was a Tolkien Ring...
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/4] ARM: fix CONFIG_SPL_MAX_SIZE semantics

2013-04-09 Thread Benoît Thébaudeau
Hi Albert,

On Tuesday, April 9, 2013 7:43:06 PM, Albert ARIBAUD wrote:
> Hi Benoît,
> 
> On Tue, 9 Apr 2013 16:24:36 +0200 (CEST), Benoît Thébaudeau
>  wrote:
> 
> > Hi Albert,
> > 
> > On Tuesday, April 9, 2013 4:23:58 PM, Albert ARIBAUD wrote:
> > > Hi Benoît,
> > > 
> > > On Mon, 8 Apr 2013 23:43:37 +0200 (CEST), Benoît Thébaudeau
> > >  wrote:
> > > 
> > > > Hi Albert,
> > > 
> > > > > diff --git a/arch/arm/cpu/u-boot-spl.lds
> > > > > b/arch/arm/cpu/u-boot-spl.lds
> > > > > index 3c0d99c..89ef9ce 100644
> > > > > --- a/arch/arm/cpu/u-boot-spl.lds
> > > > > +++ b/arch/arm/cpu/u-boot-spl.lds
> > > > > @@ -88,6 +88,12 @@ SECTIONS
> > > > >   /DISCARD/ : { *(.gnu*) }
> > > > >  }
> > > > >  
> > > > > -#if defined(CONFIG_SPL_TEXT_BASE) && defined(CONFIG_SPL_MAX_SIZE)
> > > > > -ASSERT(__bss_end < (CONFIG_SPL_TEXT_BASE + CONFIG_SPL_MAX_SIZE),
> > > > > "SPL
> > > > > image
> > > > > too big");
> > > > > +#if defined(CONFIG_SPL_MAX_SIZE)
> > > > > +ASSERT(__image_copy_end - __image_copy_start <
> > > > > (CONFIG_SPL_MAX_SIZE), \
> > > > 
> > > > The possible relocation and MMU data is also part of the binary image
> > > > file,
> > > > so
> > > > that would be __bss_start rather than __image_copy_end above, and
> > > > README
> > > > should
> > > > be updated to reflect this.
> > > 
> > > Actually, mmutable is not used in any SPL; it is used only in targets
> > > h2200, lubbock, palmtc, pxa255_idp and xaeniax, none of which use SPL.
> > > I have just confirmed this with a MAKEALL -a arm and a grep on all map
> > > files.
> > > 
> > > This presence of mmutable in u-boot-spl.lds is in fact an overlook
> > > that I missed when I created this file from u-boot.lds. I have just
> > > finished verifying that removing the mmutable section altogether does
> > > not change a single bit to any of the 309 ARM platforms currently built
> > > under MAKEALL -a arm.
> > > 
> > > I'll remove mmutable entries from u-boot-spl.lds in V2.
> > 
> > OK, that's perfect for MMU data, but what about relocation data?
> 
> Relocation data should not exist for SPLs, which do not relocate.
> 
> Unfortunately, most tegra and some exynos have start.S code going
> through the relocation loop even for their SPL; that's cardhu,
> colibri_t20_iris, dalmore, harmony, medcom-wide, origen, paz00, plutux,
> seaboard, smdkv310, tec, trimslice, ventana, and whistler.
> 
> Tegras do it for their arm720t; Exynos' probably do something similar.
> I am not going to try and change some start.S so close in time to
> release. :)
> 
> Fortunately, for all the SPLs that fail building if I remove .rel.dyn
> and .dynsym, these sections are actually empty, i.e. their __end is
> equal to their __image_copy_end. I have manually verified both reloc
> section emptiness and equality of _end and __image_copy_end.
> 
> Therefore I'll leave the ASSERT() as written in V2, and will provide a
> separate patch for fixing the Tegra / Exynos unneeded relocation data
> issue.

That's perfect.

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


Re: [U-Boot] [v3] command/cache: Add flush command

2013-04-09 Thread Wolfgang Denk
Dear Scott,

In message <1365449512.28843.10@snotra> you wrote:
>
> > > Maybe "cache" should be the toplevel command, with "icache" and
> > > "dcache" refactored to be subcommands?  Of course, then you're making
> > > an incompatible interface change.  How much is consistency worth?
> > 
> > I think backward compatibility is mandatory here.  We cannot break
> > existing user scripts.
>
> Sure.  But if the main reason for the icache/dcache split is  
> compatibility, I don't think that should constrict the form of new  
> commands.

Backward compatibility is just the argument for not changing the
existing command interfaces.  I tried to explain why I do not want
to see the flush_cache() combination of functions exposed to end
users.

> I think the terminology is just fine.  It's not just invalidating the  
> icache (flushing and invalidating are the same thing for cache lines  
> which are not modified -- or are incapable of being modified).  It's  
> flushing the region out of *all* caches.

There is a well-defined difference between flushing and invalidating a
cache, and I don't intend to go into hair-splitting mode here just to
follow your path which would lead me to where I d not want to go.

> > See above.  In such a case "icache" and "dcache" can just call the
> > same underlying code.
>
> And then we end up having to do the flush twice, if the user follows  
> the "first flush dcache, then flush icache" instructions.  That's not  
> an ideal interface.

OK, this is indeed a good argument.  But is this really the case?
When looking at the current code of flash_cache() for PPC, it seems
actually easy to split:

 28 void flush_cache(ulong start_addr, ulong size)
 29 {
 30 #ifndef CONFIG_5xx
 31 ulong addr, start, end;
 32
 33 start = start_addr & ~(CONFIG_SYS_CACHELINE_SIZE - 1);
 34 end = start_addr + size - 1;
 35
 36 for (addr = start; (addr <= end) && (addr >= start);
 37 addr += CONFIG_SYS_CACHELINE_SIZE) {
 38 asm volatile("dcbst 0,%0" : : "r" (addr) : "memory");
 39 WATCHDOG_RESET();
 40 }
 41 /* wait for all dcbst to complete on bus */
 42 asm volatile("sync" : : : "memory");
 43
 44 for (addr = start; (addr <= end) && (addr >= start);
 45 addr += CONFIG_SYS_CACHELINE_SIZE) {
 46 asm volatile("icbi 0,%0" : : "r" (addr) : "memory");
 47 WATCHDOG_RESET();
 48 }
 49 asm volatile("sync" : : : "memory");
 50 /* flush prefetch queue */
 51 asm volatile("isync" : : : "memory");
 52 #endif
 53 }

Lines 36..42 would go into the "dcache" command, while lines 44..51
would go into the "icache" command.

So far this code appears to work fine.  What am I missing?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
You don't stop doing things because you get old.  You get old because
you stop doing things.- Rosamunde Pilcher
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/4] ARM: fix CONFIG_SPL_MAX_SIZE semantics

2013-04-09 Thread Albert ARIBAUD
Hi Benoît,

On Tue, 9 Apr 2013 16:24:36 +0200 (CEST), Benoît Thébaudeau
 wrote:

> Hi Albert,
> 
> On Tuesday, April 9, 2013 4:23:58 PM, Albert ARIBAUD wrote:
> > Hi Benoît,
> > 
> > On Mon, 8 Apr 2013 23:43:37 +0200 (CEST), Benoît Thébaudeau
> >  wrote:
> > 
> > > Hi Albert,
> > 
> > > > diff --git a/arch/arm/cpu/u-boot-spl.lds b/arch/arm/cpu/u-boot-spl.lds
> > > > index 3c0d99c..89ef9ce 100644
> > > > --- a/arch/arm/cpu/u-boot-spl.lds
> > > > +++ b/arch/arm/cpu/u-boot-spl.lds
> > > > @@ -88,6 +88,12 @@ SECTIONS
> > > > /DISCARD/ : { *(.gnu*) }
> > > >  }
> > > >  
> > > > -#if defined(CONFIG_SPL_TEXT_BASE) && defined(CONFIG_SPL_MAX_SIZE)
> > > > -ASSERT(__bss_end < (CONFIG_SPL_TEXT_BASE + CONFIG_SPL_MAX_SIZE), "SPL
> > > > image
> > > > too big");
> > > > +#if defined(CONFIG_SPL_MAX_SIZE)
> > > > +ASSERT(__image_copy_end - __image_copy_start < (CONFIG_SPL_MAX_SIZE), \
> > > 
> > > The possible relocation and MMU data is also part of the binary image 
> > > file,
> > > so
> > > that would be __bss_start rather than __image_copy_end above, and README
> > > should
> > > be updated to reflect this.
> > 
> > Actually, mmutable is not used in any SPL; it is used only in targets
> > h2200, lubbock, palmtc, pxa255_idp and xaeniax, none of which use SPL.
> > I have just confirmed this with a MAKEALL -a arm and a grep on all map
> > files.
> > 
> > This presence of mmutable in u-boot-spl.lds is in fact an overlook
> > that I missed when I created this file from u-boot.lds. I have just
> > finished verifying that removing the mmutable section altogether does
> > not change a single bit to any of the 309 ARM platforms currently built
> > under MAKEALL -a arm.
> > 
> > I'll remove mmutable entries from u-boot-spl.lds in V2.
> 
> OK, that's perfect for MMU data, but what about relocation data?

Relocation data should not exist for SPLs, which do not relocate.

Unfortunately, most tegra and some exynos have start.S code going
through the relocation loop even for their SPL; that's cardhu,
colibri_t20_iris, dalmore, harmony, medcom-wide, origen, paz00, plutux,
seaboard, smdkv310, tec, trimslice, ventana, and whistler.

Tegras do it for their arm720t; Exynos' probably do something similar.
I am not going to try and change some start.S so close in time to
release. :)

Fortunately, for all the SPLs that fail building if I remove .rel.dyn
and .dynsym, these sections are actually empty, i.e. their __end is
equal to their __image_copy_end. I have manually verified both reloc
section emptiness and equality of _end and __image_copy_end.

Therefore I'll leave the ASSERT() as written in V2, and will provide a
separate patch for fixing the Tegra / Exynos unneeded relocation data
issue.

> Best regards,
> Benoît

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


Re: [U-Boot] [PATCH v9 18/30] nand: mxc: Switch NAND SPL to generic SPL

2013-04-09 Thread Benoît Thébaudeau
On Tuesday, April 9, 2013 6:56:18 PM, Benoît Thébaudeau wrote:
> Hi Fabio,
> 
> On Tuesday, April 9, 2013 6:40:45 PM, Fabio Estevam wrote:
> > Hi Benoît,
> > 
> > On Tue, Apr 9, 2013 at 11:38 AM, Benoît Thébaudeau
> >  wrote:
> > 
> > > Can you try different values for the following configs in mx31pdk.h?
> > >  - CONFIG_SYS_NAND_U_BOOT_SIZE
> > >  - CONFIG_SPL_TEXT_BASE
> > >  - CONFIG_SYS_TEXT_BASE
> > >  - (CONFIG_ENV_OFFSET)
> > >  - (CONFIG_ENV_OFFSET_REDUND)
> > >
> > > I would try:
> > >  - 0x4 for CONFIG_SYS_NAND_U_BOOT_SIZE
> > >  - 0x8600 for CONFIG_SPL_TEXT_BASE
> > >  - 0x8700 for CONFIG_SYS_TEXT_BASE
> > 
> > Thanks, that did the trick!
> > 
> > With the changes below I am able to get into the U-boot prompt:
> > 
> > diff --git a/include/configs/mx31pdk.h b/include/configs/mx31pdk.h
> > index 8f12825..d82bf65 100644
> > --- a/include/configs/mx31pdk.h
> > +++ b/include/configs/mx31pdk.h
> > @@ -51,8 +51,8 @@
> >  #define CONFIG_SPL_MAX_SIZE2048
> >  #define CONFIG_SPL_NAND_SUPPORT
> > 
> > -#define CONFIG_SPL_TEXT_BASE   0x87ec
> > -#define CONFIG_SYS_TEXT_BASE   0x87f0
> > +#define CONFIG_SPL_TEXT_BASE   0x8600
> > +#define CONFIG_SYS_TEXT_BASE   0x8700
> > 
> >  #ifndef CONFIG_SPL_BUILD
> >  #define CONFIG_SKIP_LOWLEVEL_INIT
> > @@ -69,8 +69,6 @@
> > 
> >  #define CONFIG_MXC_UART
> >  #define CONFIG_MXC_UART_BASE   UART1_BASE
> > -#define CONFIG_HW_WATCHDOG
> > -#define CONFIG_IMX_WATCHDOG
> >  #define CONFIG_MXC_GPIO
> > 
> >  #define CONFIG_HARD_SPI
> > @@ -199,7 +197,7 @@
> > 
> >  /* Start copying real U-boot from the second page */
> >  #define CONFIG_SYS_NAND_U_BOOT_OFFSCONFIG_SPL_PAD_TO
> > -#define CONFIG_SYS_NAND_U_BOOT_SIZE0x32000
> > +#define CONFIG_SYS_NAND_U_BOOT_SIZE0x4
> >  /* Load U-Boot to this address */
> >  #define CONFIG_SYS_NAND_U_BOOT_DST CONFIG_SYS_TEXT_BASE
> >  #define CONFIG_SYS_NAND_U_BOOT_START   CONFIG_SYS_NAND_U_BOOT_DST
> 
> Cool, then we need to determine the minimal change set required for v11, so
> can
> you retry with fewer of those changes to determine which ones are strictly
> necessary (apart from the watchdog removal that we already know is required)?

Especially, does it work with only:
-#define CONFIG_HW_WATCHDOG
-#define CONFIG_IMX_WATCHDOG
-#define CONFIG_SYS_NAND_U_BOOT_SIZE0x32000
+#define CONFIG_SYS_NAND_U_BOOT_SIZE0x3f800
?

> What is the size of u-boot-with-spl.bin without DEBUG?
> 
> Regarding the watchdog removal, it is unrelated to this patch, so do you want
> me
> to add a patch for it in this series, or will you handle it separately? And
> is
> the correct change to remove it as above, or to change its time-out
> somewhere? I
> think that it's probably better if you take care of this separately.

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


Re: [U-Boot] [PATCH] mx28evk: add trimffs to nand command

2013-04-09 Thread Fabio Estevam
Eric Bénard wrote:
> this is usefull when writing an UBI image which contains
> and UBIFS volume (check README.nand and UBI FAQ for more details)
> 
> Signed-off-by: Eric Bénard 
> ---
>  include/configs/mx28evk.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/configs/mx28evk.h b/include/configs/mx28evk.h
> index d470b47..b22a20b 100644
> --- a/include/configs/mx28evk.h
> +++ b/include/configs/mx28evk.h
> @@ -63,6 +63,7 @@
>  #define CONFIG_CMD_USB
>  #define CONFIG_CMD_BOOTZ
>  #define CONFIG_CMD_NAND
> +#define CONFIG_CMD_NAND_TRIMFFS

You should add this into mx28evk_nand.h, available in u-boot.imx tree.


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


Re: [U-Boot] [PATCH] mx28evk: add trimffs to nand command

2013-04-09 Thread Otavio Salvador
On Mon, Apr 8, 2013 at 3:59 PM, Eric Bénard  wrote:
> this is usefull when writing an UBI image which contains
> and UBIFS volume (check README.nand and UBI FAQ for more details)
>
> Signed-off-by: Eric Bénard 

Acked-by: Otavio Salvador 

--
Otavio Salvador O.S. Systems
E-mail: ota...@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854  http://projetos.ossystems.com.br
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v9 18/30] nand: mxc: Switch NAND SPL to generic SPL

2013-04-09 Thread Benoît Thébaudeau
Hi Albert,

On Wednesday, April 3, 2013 10:05:57 AM, Albert ARIBAUD wrote:
> Hi Benoît,
> 
> On Wed, 3 Apr 2013 08:30:12 +0200 (CEST), Benoît Thébaudeau
>  wrote:
> 
> > Hi Albert,
> > 
> > Here is the v10 bundle for those who want to test:
> > http://dl.free.fr/vdXBGExyq
> 
> Thanks, will build-test it ASAP.
> 
> People with ARM (expecially tx25 and mx31pdk) and non-ARM boards please
> run-test it too.

Following Fabio's tests, I will issue a v11 today with a small change in 18/30
limited to mx31pdk.h. Do you want me to do it on top of your "[PATCH] ARM: Fix
__bss_start and __bss_end in linker scripts", or not?

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


Re: [U-Boot] [PATCH 3/8] pxa_lcd: allow L_BIAS line to be unused

2013-04-09 Thread Mike Dunn
On 04/07/2013 10:28 PM, Marek Vasut wrote:
> Dear Mike Dunn,
> 
>> This patch adds a config option CONFIG_SYS_LCD_PXA_NO_L_BIAS, which causes
>> the lcd controller initialization code to leave as an ordinary gpio the
>> line that is typically configured as the lcd L_BIAS alternate function
>> (this is the gpio 77 line).
>>
>> For some reason (I don't have a datasheet), the lcd device on the
>> palmtreo680 board does not use the L_BIAS line.  PalmOS does not configure
>> the gpio 77 line for the L_BIAS alternate function, and if it is
>> configured as such, the lcd does not work.
>>
>> Signed-off-by: Mike Dunn 
> 
> The other option would be to pull the GPIO setup from the driver. That'd be 
> the 
> best.


Well, there's a lot of shared code in pxafb_setup_gpio() that handles pin
configuration for all possible interface widths.

But after looking at this problem some more, I realized that the board-specific
lcd_enable() is called after the pxa driver's initialization, so the board code
can undo the L_BIAS pin configuration.  Not elegant, but better than the ugly
#ifdefs.

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


Re: [U-Boot] [PATCH v9 18/30] nand: mxc: Switch NAND SPL to generic SPL

2013-04-09 Thread Benoît Thébaudeau
Hi Fabio,

On Tuesday, April 9, 2013 6:40:45 PM, Fabio Estevam wrote:
> Hi Benoît,
> 
> On Tue, Apr 9, 2013 at 11:38 AM, Benoît Thébaudeau
>  wrote:
> 
> > Can you try different values for the following configs in mx31pdk.h?
> >  - CONFIG_SYS_NAND_U_BOOT_SIZE
> >  - CONFIG_SPL_TEXT_BASE
> >  - CONFIG_SYS_TEXT_BASE
> >  - (CONFIG_ENV_OFFSET)
> >  - (CONFIG_ENV_OFFSET_REDUND)
> >
> > I would try:
> >  - 0x4 for CONFIG_SYS_NAND_U_BOOT_SIZE
> >  - 0x8600 for CONFIG_SPL_TEXT_BASE
> >  - 0x8700 for CONFIG_SYS_TEXT_BASE
> 
> Thanks, that did the trick!
> 
> With the changes below I am able to get into the U-boot prompt:
> 
> diff --git a/include/configs/mx31pdk.h b/include/configs/mx31pdk.h
> index 8f12825..d82bf65 100644
> --- a/include/configs/mx31pdk.h
> +++ b/include/configs/mx31pdk.h
> @@ -51,8 +51,8 @@
>  #define CONFIG_SPL_MAX_SIZE  2048
>  #define CONFIG_SPL_NAND_SUPPORT
> 
> -#define CONFIG_SPL_TEXT_BASE 0x87ec
> -#define CONFIG_SYS_TEXT_BASE 0x87f0
> +#define CONFIG_SPL_TEXT_BASE 0x8600
> +#define CONFIG_SYS_TEXT_BASE 0x8700
> 
>  #ifndef CONFIG_SPL_BUILD
>  #define CONFIG_SKIP_LOWLEVEL_INIT
> @@ -69,8 +69,6 @@
> 
>  #define CONFIG_MXC_UART
>  #define CONFIG_MXC_UART_BASE UART1_BASE
> -#define CONFIG_HW_WATCHDOG
> -#define CONFIG_IMX_WATCHDOG
>  #define CONFIG_MXC_GPIO
> 
>  #define CONFIG_HARD_SPI
> @@ -199,7 +197,7 @@
> 
>  /* Start copying real U-boot from the second page */
>  #define CONFIG_SYS_NAND_U_BOOT_OFFS  CONFIG_SPL_PAD_TO
> -#define CONFIG_SYS_NAND_U_BOOT_SIZE  0x32000
> +#define CONFIG_SYS_NAND_U_BOOT_SIZE  0x4
>  /* Load U-Boot to this address */
>  #define CONFIG_SYS_NAND_U_BOOT_DST   CONFIG_SYS_TEXT_BASE
>  #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_NAND_U_BOOT_DST

Cool, then we need to determine the minimal change set required for v11, so can
you retry with fewer of those changes to determine which ones are strictly
necessary (apart from the watchdog removal that we already know is required)?

What is the size of u-boot-with-spl.bin without DEBUG?

Regarding the watchdog removal, it is unrelated to this patch, so do you want me
to add a patch for it in this series, or will you handle it separately? And is
the correct change to remove it as above, or to change its time-out somewhere? I
think that it's probably better if you take care of this separately.

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


Re: [U-Boot] [PATCH v9 18/30] nand: mxc: Switch NAND SPL to generic SPL

2013-04-09 Thread Fabio Estevam
Hi Benoît,

On Tue, Apr 9, 2013 at 11:38 AM, Benoît Thébaudeau
 wrote:

> Can you try different values for the following configs in mx31pdk.h?
>  - CONFIG_SYS_NAND_U_BOOT_SIZE
>  - CONFIG_SPL_TEXT_BASE
>  - CONFIG_SYS_TEXT_BASE
>  - (CONFIG_ENV_OFFSET)
>  - (CONFIG_ENV_OFFSET_REDUND)
>
> I would try:
>  - 0x4 for CONFIG_SYS_NAND_U_BOOT_SIZE
>  - 0x8600 for CONFIG_SPL_TEXT_BASE
>  - 0x8700 for CONFIG_SYS_TEXT_BASE

Thanks, that did the trick!

With the changes below I am able to get into the U-boot prompt:

diff --git a/include/configs/mx31pdk.h b/include/configs/mx31pdk.h
index 8f12825..d82bf65 100644
--- a/include/configs/mx31pdk.h
+++ b/include/configs/mx31pdk.h
@@ -51,8 +51,8 @@
 #define CONFIG_SPL_MAX_SIZE2048
 #define CONFIG_SPL_NAND_SUPPORT

-#define CONFIG_SPL_TEXT_BASE   0x87ec
-#define CONFIG_SYS_TEXT_BASE   0x87f0
+#define CONFIG_SPL_TEXT_BASE   0x8600
+#define CONFIG_SYS_TEXT_BASE   0x8700

 #ifndef CONFIG_SPL_BUILD
 #define CONFIG_SKIP_LOWLEVEL_INIT
@@ -69,8 +69,6 @@

 #define CONFIG_MXC_UART
 #define CONFIG_MXC_UART_BASE   UART1_BASE
-#define CONFIG_HW_WATCHDOG
-#define CONFIG_IMX_WATCHDOG
 #define CONFIG_MXC_GPIO

 #define CONFIG_HARD_SPI
@@ -199,7 +197,7 @@

 /* Start copying real U-boot from the second page */
 #define CONFIG_SYS_NAND_U_BOOT_OFFSCONFIG_SPL_PAD_TO
-#define CONFIG_SYS_NAND_U_BOOT_SIZE0x32000
+#define CONFIG_SYS_NAND_U_BOOT_SIZE0x4
 /* Load U-Boot to this address */
 #define CONFIG_SYS_NAND_U_BOOT_DST CONFIG_SYS_TEXT_BASE
 #define CONFIG_SYS_NAND_U_BOOT_START   CONFIG_SYS_NAND_U_BOOT_DST
-- 
1.7.9.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [Patch v2] disk/gpt: Fix GPT partition handling for blocksize != 512

2013-04-09 Thread Egbert Eich
From: Egbert Eich 

Disks beyond 2T in size use blocksizes of 4096 bytes. However a lot of
code in u-boot  still assumes a 512 byte blocksize.
This patch fixes the handling of GPTs.

Signed-off-by: Egbert Eich 
---
Changes for v2:
  - Coding style fixes.

 disk/part_efi.c| 38 ++
 include/common.h   | 11 +--
 include/part.h |  4 
 include/part_efi.h |  2 --
 4 files changed, 35 insertions(+), 20 deletions(-)

diff --git a/disk/part_efi.c b/disk/part_efi.c
index e9987f0..5986589 100644
--- a/disk/part_efi.c
+++ b/disk/part_efi.c
@@ -115,7 +115,7 @@ static inline int is_bootable(gpt_entry *p)
 
 void print_part_efi(block_dev_desc_t * dev_desc)
 {
-   ALLOC_CACHE_ALIGN_BUFFER(gpt_header, gpt_head, 1);
+   ALLOC_CACHE_ALIGN_BUFFER_PAD(gpt_header, gpt_head, 1, dev_desc->blksz);
gpt_entry *gpt_pte = NULL;
int i = 0;
char uuid[37];
@@ -162,7 +162,7 @@ void print_part_efi(block_dev_desc_t * dev_desc)
 int get_partition_info_efi(block_dev_desc_t * dev_desc, int part,
disk_partition_t * info)
 {
-   ALLOC_CACHE_ALIGN_BUFFER(gpt_header, gpt_head, 1);
+   ALLOC_CACHE_ALIGN_BUFFER_PAD(gpt_header, gpt_head, 1, dev_desc->blksz);
gpt_entry *gpt_pte = NULL;
 
/* "part" argument must be at least 1 */
@@ -190,7 +190,7 @@ int get_partition_info_efi(block_dev_desc_t * dev_desc, int 
part,
/* The ending LBA is inclusive, to calculate size, add 1 to it */
info->size = ((u64)le64_to_cpu(gpt_pte[part - 1].ending_lba) + 1)
 - info->start;
-   info->blksz = GPT_BLOCK_SIZE;
+   info->blksz = dev_desc->blksz;
 
sprintf((char *)info->name, "%s",
print_efiname(&gpt_pte[part - 1]));
@@ -210,7 +210,7 @@ int get_partition_info_efi(block_dev_desc_t * dev_desc, int 
part,
 
 int test_part_efi(block_dev_desc_t * dev_desc)
 {
-   ALLOC_CACHE_ALIGN_BUFFER(legacy_mbr, legacymbr, 1);
+   ALLOC_CACHE_ALIGN_BUFFER_PAD(legacy_mbr, legacymbr, 1, dev_desc->blksz);
 
/* Read legacy MBR from block 0 and validate it */
if ((dev_desc->block_read(dev_desc->dev, 0, 1, (ulong *)legacymbr) != 1)
@@ -311,9 +311,8 @@ static int string_uuid(char *uuid, u8 *dst)
 int write_gpt_table(block_dev_desc_t *dev_desc,
gpt_header *gpt_h, gpt_entry *gpt_e)
 {
-   const int pte_blk_num = (gpt_h->num_partition_entries
-   * sizeof(gpt_entry)) / dev_desc->blksz;
-
+   const int pte_blk_cnt = BLOCK_CNT((gpt_h->num_partition_entries
+  * sizeof(gpt_entry)), dev_desc);
u32 calc_crc32;
u64 val;
 
@@ -336,8 +335,8 @@ int write_gpt_table(block_dev_desc_t *dev_desc,
if (dev_desc->block_write(dev_desc->dev, 1, 1, gpt_h) != 1)
goto err;
 
-   if (dev_desc->block_write(dev_desc->dev, 2, pte_blk_num, gpt_e)
-   != pte_blk_num)
+   if (dev_desc->block_write(dev_desc->dev, 2, pte_blk_cnt, gpt_e)
+   != pte_blk_cnt)
goto err;
 
/* recalculate the values for the Second GPT Header */
@@ -352,7 +351,7 @@ int write_gpt_table(block_dev_desc_t *dev_desc,
 
if (dev_desc->block_write(dev_desc->dev,
  le32_to_cpu(gpt_h->last_usable_lba + 1),
- pte_blk_num, gpt_e) != pte_blk_num)
+ pte_blk_cnt, gpt_e) != pte_blk_cnt)
goto err;
 
if (dev_desc->block_write(dev_desc->dev,
@@ -462,13 +461,18 @@ int gpt_restore(block_dev_desc_t *dev_desc, char 
*str_disk_guid,
 {
int ret;
 
-   gpt_header *gpt_h = calloc(1, sizeof(gpt_header));
+   gpt_header *gpt_h = calloc(1, PAD_TO_BLOCKSIZE(sizeof(gpt_header),
+  dev_desc));
+   gpt_entry *gpt_e;
+
if (gpt_h == NULL) {
printf("%s: calloc failed!\n", __func__);
return -1;
}
 
-   gpt_entry *gpt_e = calloc(GPT_ENTRY_NUMBERS, sizeof(gpt_entry));
+   gpt_e = calloc(1, PAD_TO_BLOCKSIZE(GPT_ENTRY_NUMBERS
+  * sizeof(gpt_entry),
+  dev_desc));
if (gpt_e == NULL) {
printf("%s: calloc failed!\n", __func__);
free(gpt_h);
@@ -652,7 +656,7 @@ static int is_gpt_valid(block_dev_desc_t * dev_desc, 
unsigned long long lba,
 static gpt_entry *alloc_read_gpt_entries(block_dev_desc_t * dev_desc,
 gpt_header * pgpt_head)
 {
-   size_t count = 0;
+   size_t count = 0, blk_cnt;
gpt_entry *pte = NULL;
 
if (!dev_desc || !pgpt_head) {
@@ -669,7 +673,8 @@ static gpt_entry *alloc_read_gpt_entries(block_dev_desc_t * 
dev_desc,
 
/* Allocate memory for PTE, remember to FREE */
if (count != 0) {
-   pte = memalign(ARCH_DMA_MINALI

Re: [U-Boot] PPC4XX Custom Board - Failing to read I2C

2013-04-09 Thread Stefan Roese
Greg,

On 08.04.2013 21:54, txcotrader wrote:
> Yes, I am working with a 460SX and a board based off of AMCC Eiger
> (unsupported as of 2010).

460SX is quite untested these days I'm afraid. I don't have such a board
here as well.

> IICx_STS Register settings:
> 04 = MDBF Full = Master data buffer contains data
> 40 = IRQA Active = An IIC interrrupt has been sent to the UIC
> 
> I'm clearing the IIC register early on in my code:
>  mtdcr(UIC0SR, 0x);  /* clear all */
> mtdcr(UIC0ER, 0x);  /* disable all */
> mtdcr(UIC0CR, 0x0005);  /* ATI & UIC1 crit are critical */
> mtdcr(UIC0PR, 0x);  /* per ref-board manual */
> mtdcr(UIC0TR, 0x);  /* per ref-board manual */
> mtdcr(UIC0VR, 0x);  /* int31 highest, base=0x000 */
> mtdcr(UIC0SR, 0x);  /* clear all */
> 
> mtdcr(UIC1SR, 0x);  /* clear all */
> mtdcr(UIC1ER, 0x);  /* disable all */
> mtdcr(UIC1CR, 0x);  /* all non-critical */
> mtdcr(UIC1PR, 0x);  /* per ref-board manual */
> mtdcr(UIC1TR, 0x);  /* per ref-board manual */
> mtdcr(UIC1VR, 0x);  /* int31 highest, base=0x000 */
> mtdcr(UIC1SR, 0x);  /* clear all */

Ughh! This is not IIC (I2C) but UIC released code. So its for the
interrupt controller and not I2C controller. But nevertheless this
should not matter.

> I'm really not sure what to look for at this point, any additional tips you
> might have would be extremely helpful. I truly appreciate your help to this
> point.

As mentioned above I don't have such a board here, so I can't really
test anything. Sorry.

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


[U-Boot] [Patch v2] disk/part_dos: check harder for partition table

2013-04-09 Thread Egbert Eich
From: Egbert Eich 

Devices that used to have a whole disk FAT filesystem but got then
partitioned will most likely still have a FAT or FAT32 signature
in the first sector as this sector does not get overwritten by
a partitioning tool (otherwise the tool would risk to kill the mbr).

The current partition search algorithm will erronously detects such
a device as a raw FAT device.

Instead of looking for the FAT or FAT32 signatures immediately we
use the same algorithm as used by the Linux kernel and first check
for a valid boot indicator flag on each of the 4 partitions.
If the value of this flag is invalid for the first entry we then
do the raw partition check.
If the flag for any higher partition is wrong we assume the device
is neiter a MBR nor PBR device.

Signed-off-by: Egbert Eich 
---
Changes for v2:
   - Coding style fixes.

 disk/part_dos.c | 19 ---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/disk/part_dos.c b/disk/part_dos.c
index 37087a6..ab984cd 100644
--- a/disk/part_dos.c
+++ b/disk/part_dos.c
@@ -74,13 +74,26 @@ static void print_one_part(dos_partition_t *p, int 
ext_part_sector,
 
 static int test_block_type(unsigned char *buffer)
 {
+   int slot;
+   struct dos_partition *p;
+
if((buffer[DOS_PART_MAGIC_OFFSET + 0] != 0x55) ||
(buffer[DOS_PART_MAGIC_OFFSET + 1] != 0xaa) ) {
return (-1);
} /* no DOS Signature at all */
-   if (strncmp((char *)&buffer[DOS_PBR_FSTYPE_OFFSET],"FAT",3)==0 ||
-   strncmp((char *)&buffer[DOS_PBR32_FSTYPE_OFFSET],"FAT32",5)==0) {
-   return DOS_PBR; /* is PBR */
+   p = (struct dos_partition *)&buffer[DOS_PART_TBL_OFFSET];
+   for (slot = 0; slot < 3; slot++) {
+   if (p->boot_ind != 0 && p->boot_ind != 0x80) {
+   if (!slot &&
+   (strncmp((char *)&buffer[DOS_PBR_FSTYPE_OFFSET],
+"FAT", 3) == 0 ||
+strncmp((char *)&buffer[DOS_PBR32_FSTYPE_OFFSET],
+"FAT32", 5) == 0)) {
+   return DOS_PBR; /* is PBR */
+   } else {
+   return -1;
+   }
+   }
}
return DOS_MBR; /* Is MBR */
 }
-- 
1.8.1.4

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


[U-Boot] [PATCH] am335x/ti814x: Correct MMC_BOOT_DEVICES_START/END

2013-04-09 Thread Tom Rini
Given that on TI814x we have MMC1/2 swapped, we also need to swap them
in MMC_BOOT_DEVICES_START/END

Reported-by: Peter Korsgaard 
Signed-off-by: Tom Rini 
---
 arch/arm/include/asm/arch-am33xx/spl.h |5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/include/asm/arch-am33xx/spl.h 
b/arch/arm/include/asm/arch-am33xx/spl.h
index 14a2c7c..4c23b27 100644
--- a/arch/arm/include/asm/arch-am33xx/spl.h
+++ b/arch/arm/include/asm/arch-am33xx/spl.h
@@ -38,6 +38,11 @@
 #define BOOT_DEVICE_CPGMAC 70
 #define BOOT_DEVICE_MMC2_2  0xFF
 
+#ifdef CONFIG_AM33XX
 #define MMC_BOOT_DEVICES_START BOOT_DEVICE_MMC1
 #define MMC_BOOT_DEVICES_END   BOOT_DEVICE_MMC2
+#elif defined(CONFIG_TI814X)
+#define MMC_BOOT_DEVICES_START BOOT_DEVICE_MMC2
+#define MMC_BOOT_DEVICES_END   BOOT_DEVICE_MMC1
+#endif
 #endif
-- 
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 1/3] OMAP3/4/5/AM33xx: Correct logic for checking FAT or RAW MMC

2013-04-09 Thread Tom Rini
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 04/09/2013 10:52 AM, Peter Korsgaard wrote:
>> "Tom" == Tom Rini  writes:
> 
> Tom> In the case of booting from certain peripherals, such as UART,
> we must Tom> not see what the device descriptor says for RAW or FAT
> mode because in Tom> addition to being nonsensical, it leads to a
> hang.  This is why we have Tom> a test currently for the boot mode
> being within range.  The problem Tom> however is that on some
> platforms we get MMC2_2 as the boot mode and not Tom> the defined
> value for MMC2, and in others we get the value for MMC2_2. Tom>
> This is required to fix eMMC booting on omap5_uevm.
> 
> Tom> Tested on am335x_evm (UART, NAND, SD), omap3_beagle (NAND, SD
> on Tom> classic, SD only on xM rev C5) and omap5_uevm (SD, eMMC).
> 
> Tom> Signed-off-by: Tom Rini  Tom> --- Tom>
> arch/arm/cpu/armv7/omap-common/lowlevel_init.S |   10 +++--- 
> Tom>  arch/arm/include/asm/arch-am33xx/spl.h |3 +++ 
> Tom>  arch/arm/include/asm/arch-omap3/spl.h  |3 +++ 
> Tom>  arch/arm/include/asm/arch-omap4/spl.h  |2 ++ Tom>
> arch/arm/include/asm/arch-omap5/spl.h  |2 ++ Tom>  5
> files changed, 17 insertions(+), 3 deletions(-)
> 
> Tom> diff --git a/arch/arm/cpu/armv7/omap-common/lowlevel_init.S
> b/arch/arm/cpu/armv7/omap-common/lowlevel_init.S Tom> index
> b933fe8..90b3c8a 100644 Tom> ---
> a/arch/arm/cpu/armv7/omap-common/lowlevel_init.S Tom> +++
> b/arch/arm/cpu/armv7/omap-common/lowlevel_init.S Tom> @@ -60,10
> +60,14 @@ ENTRY(save_boot_params) Tom>ldr r3, =boot_params Tom>
> strb  r2, [r3, #BOOT_DEVICE_OFFSET]   @ spl_boot_device <- r1
> 
> Tom> -/* boot mode is passed only for devices that can raw/fat
> mode */ Tom> -cmp r2, #BOOT_DEVICE_XIP Tom> + /* Tom> +   
>  * boot
> mode is only valid for device that can be raw or FAT booted. Tom> +
> * in other cases it may be fatal to look.  While platforms differ 
> Tom> + * in the values used for each MMC slot, they are
> contiguous. Tom> + */ Tom> +  cmp r2, #MMC_BOOT_DEVICES_START Tom>
> blt   2f Tom> -   cmp r2, #BOOT_DEVICE_MMC2 Tom> +cmp r2,
> #MMC_BOOT_DEVICES_END Tom>bgt 2f Tom> /* Store the boot mode
> (raw/FAT) in omap_bootmode */ Tom>ldr r2, [r0,
> #DEV_DESC_PTR_OFFSET] @ get the device descriptor ptr Tom> diff
> --git a/arch/arm/include/asm/arch-am33xx/spl.h
> b/arch/arm/include/asm/arch-am33xx/spl.h Tom> index
> f60b086..14a2c7c 100644 Tom> ---
> a/arch/arm/include/asm/arch-am33xx/spl.h Tom> +++
> b/arch/arm/include/asm/arch-am33xx/spl.h Tom> @@ -37,4 +37,7 @@ 
> Tom>  #define BOOT_DEVICE_USBETH  68 Tom>  #define
> BOOT_DEVICE_CPGMAC70 Tom>  #define BOOT_DEVICE_MMC2_2  0xFF 
> Tom> + Tom> +#define MMC_BOOT_DEVICES_START   BOOT_DEVICE_MMC1 Tom>
> +#define MMC_BOOT_DEVICES_END BOOT_DEVICE_MMC2
> 
> Doesn't this break ti814x with the funky inverted mmc1/mmc2?

That's probably true, dang.  I knew OMAP3 also had them swapped,
number-wise but didn't recall until you said this that it doesn't use
that code at all.  I'll V2 this part.  Thanks!

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

iQIcBAEBAgAGBQJRZDY4AAoJENk4IS6UOR1WUBoP/1wPoJ5C0ZCSpEDmm7YFs5b2
XaafK0dIJ/aw7K264vYY8tHBj/ku6mbgNOvfRUL9rxGAPPStESMQynkwF/H7llbd
7GkFlsWpLAgotPnCSwHGqQnApCeUeu0BGCAGvaB8NK0uFlU+D0bsWBdgRe/sML+m
LjF0/2eQmm2rTo8ifkDTvCdldaeyGqUo0amefEvfW2cLMxPlYGWcfPh/MW1X35ib
RnnBUhdVM38XPKmktjSQMQ4IBkLnd2Hu64KFkZl3ejyMPDjr/uOkm+1UawL34IPH
wgSC5Y1+w7HvnxM+D3pre4yrpRSYq+dcg3m9CLb7HcrGFCjLxtTEEcy6DOCF3RG0
aK62JQ0itrXcGCnwMYO6t/w7JlNj/flqCTQW4qU4HJ/ixaICRrg30IePqqcJ0Rj0
69EA4BjgR8JhRZOWRuCkwirz0LQpg7DY43Ioax7EmZ6qjve7/ryEnPxdfSEWTPgr
ZcqhsYCwoc0wkADW894UveUW49qXhQCBR0C1eXbynfbpdWSu0ObHX4ErAH1JP4x/
ihtuMZAoTcpYTM0b/Fg+A9t45QhIZBMRKLWar4h5zFrMGyfIODPUjXLqJRSI6Lef
kTcUZY9Fy837Vok1NlllTMFxGd8Ot5mRgDehvZiZlTjzbRUfPdC212NUQQ/px7C8
7KPGRHhQds5Fsur7bnXJ
=2NME
-END PGP SIGNATURE-
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 7/8] mtd: nand: add driver for diskonchip g4 nand flash

2013-04-09 Thread Mike Dunn
On 04/08/2013 05:59 PM, Scott Wood wrote:
> On 04/08/2013 01:25:01 AM, Marek Vasut wrote:
>> Dear Mike Dunn,
>>
>> > This patch adds a driver for the diskonchip G4 nand flash device.  It is
>> > based on the driver from the linux kernel.
>> >
>> > This also includes a separate SPL driver.  A separate SPL driver is used
>> > because the device operates in a different mode (reliable mode) when
>> > loading a boot image, and also because the storage format of the boot
>> > image is different from normal data (pages are stored redundantly).  The
>> > SPL driver basically mimics how a typical IPL reads data from the device.
>> > The special operating mode and storage format are used to compensate for
>> > the fact that the IPL does not contain the BCH ecc decoding algorithm (due
>> > to size constraints).  Although the u-boot SPL *could* use ecc, it
>> > operates like an IPL for the sake of simplicity and uniformity, since the
>> > IPL and SPL share the task of loading the u-boot image. As a side benefit,
>> > the SPL driver is very small.
>> >
>> > Signed-off-by: Mike Dunn 
>>
>> Try #ifdef U_BOOT instead of #if 0, no?
> 
> Just remove the code that would be hidden by #if 0.  Besides making the U-Boot
> code easier to read, we *want* to get a conflict marker if we try to merge in 
> a
> new upstream version, and those lines were changed in Linux.  This would give 
> us
> an opportunity to see if similar changes are needed to the U-Boot version of 
> the
> code.


OK.


> 
> Another option would be to introduce for_each_set_bit in U-Boot.


This was my first inclination, but it looked like a lot of work across multiple
architectures, so I let it go.

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


Re: [U-Boot] [Patch v2] cmd/gpt: Support gpt command for all devices

2013-04-09 Thread Tom Rini
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 04/09/2013 11:11 AM, Egbert Eich wrote:
> From: Egbert Eich 
> 
> The gpt command was only implemented for mmc devices. There is no 
> reason why this command should not be generalized and be applied 
> all other storage device classes. This change both simplifies the 
> implementation and eliminates a build failure for systems that 
> don't support mmcs.
> 
> Signed-off-by: Egbert Eich  --- Changes for v2: - 
> Coding style cleanup.
> 
> common/cmd_gpt.c | 44 +++-
>  1 file changed, 19 insertions(+), 25 deletions(-)

Reviewed-by: Tom Rini 

Thanks!

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

iQIcBAEBAgAGBQJRZDOLAAoJENk4IS6UOR1WdAwP/jUM63BXUnoe1ZdL40MjjK8W
ML48SoHv14unwjHB3Nr5fl4EGQOGpWN18HB7h/tGVdcZPCu6MaP3VQR+dV9iWDlh
ijwv0b390ojj2Hb9tqOy3VEt+v/jrOJOcfDdgheDkfs/82d6NysJnbxbmfCTbtFv
B68ToxYNKv2LirLz/HC4lUYWLekfwLSgqK+lcwA0WqgylnUuANa05d+VD8LUzPem
bPDzn7dhoMmhaCqfzyRhPCsdT3RREGeFNqQ3rkhmdXZ359Zj7ex2z0oVzzzxbWPy
mes60Hj9l6zRayiR2NQ4eiB31jJWM5EPj2mzKCV/XGIj7C/unecbfbt8JxJlTnUg
gkT8Y1b3vBSf18Zh6GrUBJRcofVbfj3e5hQJ8t36ItQqX8iPJu0lVCXVed8y+67I
u+WCQ6LIZroSYUM+f+U2S2ZPyRMq2gyp9C+P6VPXtQTL6v2qZEezZhsKzlNwKiql
UDZLMK3KafaWY52hXrld5d49fPpaufHS+2CfWR4+2tM2sFgHhXjCuBVwwcL7iJF1
E1gtJF77sFnGk8Dwcb/WGGbqbLw6kc+cMyIMKowLulvluQsbPkl2UWen4YI4Kom2
7+Z4wLVp9MExKAZ7F5ySjkCJ5LwE3VE8COZCzOfNYE4dfun2IPkGHguywGG/udQK
D8YnUvj3CfcACvYC/ZBt
=PcsZ
-END PGP SIGNATURE-
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v9 18/30] nand: mxc: Switch NAND SPL to generic SPL

2013-04-09 Thread Benoît Thébaudeau
On Tuesday, April 9, 2013 5:04:45 PM, Benoît Thébaudeau wrote:
> On Tuesday, April 9, 2013 4:38:23 PM, Benoît Thébaudeau wrote:
> > Hi Fabio,
> > 
> > On Tuesday, April 9, 2013 2:46:21 PM, Fabio Estevam wrote:
> > > On Tue, Apr 9, 2013 at 9:30 AM, Fabio Estevam  wrote:
> > > 
> > > > Just tested v10 on mx31pdk.
> > > >
> > > > As reported in v9 I start to get reboots and never reach the prompt.
> > > >
> > > > Then I disabled watchdog options in mx31pdk.h and I get the following:
> > > >
> > > > U-Boot 2013.04-rc1-14135-gab21c72-dirty (Apr 09 2013 - 09:23:01)
> > > >
> > > > CPU:   Freescale i.MX31 rev 2.0 at 532 MHz.
> > > > Reset cause: POR
> > > > Board: MX31PDK
> > > > DRAM:  128 MiB
> > > > NAND:  256 MiB
> > > > In:serial
> > > > Out:   serial
> > > > Err:   serial
> > > > Net:
> > > >
> > > > (Board hangs here).
> > > >
> > > > When I tested v9 and removed watchdog support I was able to get into
> > > > the U-boot prompt.
> > > 
> > > I just added "#define DEBUG" in arch/arm/lib/board to start debugging
> > > this and for my surprise I can reach the prompt now:
> > > 
> > > U-Boot 2013.04-rc1-14135-gab21c72-dirty (Apr 09 2013 - 09:35:51)
> > > 
> > > U-Boot code: 87F0 -> 87F2C34C  BSS: -> 87F3137C
> > > CPU:   Freescale i.MX31 rev 2.0 at 532 MHz.
> > > Reset cause: POR
> > > Board: MX31PDK
> > > monitor len: 0003137C
> > > ramsize: 0800
> > > TLB table from 87ff to 87ff4000
> > > Top of RAM usable for U-Boot at: 87ff
> > > Reserving 196k for U-Boot at: 87fbe000
> > > Reserving 640k for malloc() at: 87f1e000
> > > Reserving 32 Bytes for Board Info at: 87f1dfe0
> > > Reserving 160 Bytes for Global Data at: 87f1df40
> > > New Stack Pointer is: 87f1df30
> > > RAM Configuration:
> > > Bank #0: 8000 128 MiB
> > > relocation Offset is: 000be000
> > > monitor flash len: 000310F4
> > > Now running in RAM - U-Boot at: 87fbe000
> > > NAND:  256 MiB
> > > In:serial
> > > Out:   serial
> > > Err:   serial
> > > Net:   smc911x-0
> > > Hit any key to stop autoboot:  0
> > > MX31PDK U-Boot >
> > > 
> > > I remember to have added "#define DEBUG" in v9 as well, so looks like
> > > the behavior between v9 and v10 is consistent.
> > > 
> > > Now we need to understand why the prompt is not reached without
> > > ""#define DEBUG".
> > 
> > Can you try different values for the following configs in mx31pdk.h?
> >  - CONFIG_SYS_NAND_U_BOOT_SIZE
> >  - CONFIG_SPL_TEXT_BASE
> >  - CONFIG_SYS_TEXT_BASE
> >  - (CONFIG_ENV_OFFSET)
> >  - (CONFIG_ENV_OFFSET_REDUND)
> > 
> > I would try:
> >  - 0x4 for CONFIG_SYS_NAND_U_BOOT_SIZE
> >  - 0x8600 for CONFIG_SPL_TEXT_BASE
> >  - 0x8700 for CONFIG_SYS_TEXT_BASE
> 
> I have retrieved your previous test trace:
> ---
> U-Boot 2013.01 (Feb 22 2013 - 16:25:48)
> 
> CPU:   Freescale i.MX31 rev 2.0 at 532 MHz.
> Reset cause: POR
> Board: MX31PDK
> DRAM:  128 MiB
> 
> (hangs here).
> ---
> 
> So it does not hang at the same step.
> 
> Can you try to disable CONFIG_CMD_NET or to comment out eth_initialize() in
> arch/arm/lib/board.c? Do you know if something has changed in this function
> recently, or if there is something about it that has not yet been merged in
> the
> arm tree?

gd->bd might also be broken for some reason. Can you print it with and without
DEBUG, right before the call to eth_initialize()?

Also, can you try to apply this patch?
http://patchwork.ozlabs.org/patch/233964/

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


[U-Boot] [Patch v2] cmd/gpt: Support gpt command for all devices

2013-04-09 Thread Egbert Eich
From: Egbert Eich 

The gpt command was only implemented for mmc devices. There is no reason
why this command should not be generalized and be applied all other
storage device classes.
This change both simplifies the implementation and eliminates a
build failure for systems that don't support mmcs.

Signed-off-by: Egbert Eich 
---
Changes for v2:
  - Coding style cleanup.

 common/cmd_gpt.c | 44 +++-
 1 file changed, 19 insertions(+), 25 deletions(-)

diff --git a/common/cmd_gpt.c b/common/cmd_gpt.c
index efd7934..3594dca 100644
--- a/common/cmd_gpt.c
+++ b/common/cmd_gpt.c
@@ -23,7 +23,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -134,7 +133,7 @@ static int set_gpt_info(block_dev_desc_t *dev_desc,
int errno = 0;
uint64_t size_ll, start_ll;
 
-   debug("%s: MMC lba num: 0x%x %d\n", __func__,
+   debug("%s:  lba num: 0x%x %d\n", __func__,
  (unsigned int)dev_desc->lba, (unsigned int)dev_desc->lba);
 
if (str_part == NULL)
@@ -247,25 +246,18 @@ err:
return errno;
 }
 
-static int gpt_mmc_default(int dev, const char *str_part)
+static int gpt_default(block_dev_desc_t *blk_dev_desc, const char *str_part)
 {
int ret;
char *str_disk_guid;
u8 part_count = 0;
disk_partition_t *partitions = NULL;
 
-   struct mmc *mmc = find_mmc_device(dev);
-
-   if (mmc == NULL) {
-   printf("%s: mmc dev %d NOT available\n", __func__, dev);
-   return CMD_RET_FAILURE;
-   }
-
if (!str_part)
return -1;
 
/* fill partitions */
-   ret = set_gpt_info(&mmc->block_dev, str_part,
+   ret = set_gpt_info(blk_dev_desc, str_part,
&str_disk_guid, &partitions, &part_count);
if (ret) {
if (ret == -1)
@@ -278,7 +270,7 @@ static int gpt_mmc_default(int dev, const char *str_part)
}
 
/* save partitions layout to disk */
-   gpt_restore(&mmc->block_dev, str_disk_guid, partitions, part_count);
+   gpt_restore(&blk_dev_desc, str_disk_guid, partitions, part_count);
free(str_disk_guid);
free(partitions);
 
@@ -306,20 +298,22 @@ static int do_gpt(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
 
/* command: 'write' */
if ((strcmp(argv[1], "write") == 0) && (argc == 5)) {
-   /* device: 'mmc' */
-   if (strcmp(argv[2], "mmc") == 0) {
-   /* check if 'dev' is a number */
-   for (pstr = argv[3]; *pstr != '\0'; pstr++)
-   if (!isdigit(*pstr)) {
-   printf("'%s' is not a number\n",
-   argv[3]);
-   return CMD_RET_USAGE;
-   }
-   dev = (int)simple_strtoul(argv[3], NULL, 10);
-   /* write to mmc */
-   if (gpt_mmc_default(dev, argv[4]))
-   return CMD_RET_FAILURE;
+   char *ep;
+   block_dev_desc_t *blk_dev_desc;
+   dev = (int)simple_strtoul(argv[3], NULL, 10);
+   if (*ep) {
+   printf("'%s' is not a number\n", argv[3]);
+   return CMD_RET_USAGE;
}
+   blk_dev_desc = get_dev(argv[2], dev);
+   if (!blk_dev_desc) {
+   printf("%s: %s dev %d NOT available\n",
+  __func__, argv[2], dev);
+   return CMD_RET_FAILURE;
+   }
+
+   if (gpt_default(blk_dev_desc, argv[4]))
+   return CMD_RET_FAILURE;
} else {
return CMD_RET_USAGE;
}
-- 
1.8.1.4

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


Re: [U-Boot] [PATCH v9 18/30] nand: mxc: Switch NAND SPL to generic SPL

2013-04-09 Thread Benoît Thébaudeau
On Tuesday, April 9, 2013 4:38:23 PM, Benoît Thébaudeau wrote:
> Hi Fabio,
> 
> On Tuesday, April 9, 2013 2:46:21 PM, Fabio Estevam wrote:
> > On Tue, Apr 9, 2013 at 9:30 AM, Fabio Estevam  wrote:
> > 
> > > Just tested v10 on mx31pdk.
> > >
> > > As reported in v9 I start to get reboots and never reach the prompt.
> > >
> > > Then I disabled watchdog options in mx31pdk.h and I get the following:
> > >
> > > U-Boot 2013.04-rc1-14135-gab21c72-dirty (Apr 09 2013 - 09:23:01)
> > >
> > > CPU:   Freescale i.MX31 rev 2.0 at 532 MHz.
> > > Reset cause: POR
> > > Board: MX31PDK
> > > DRAM:  128 MiB
> > > NAND:  256 MiB
> > > In:serial
> > > Out:   serial
> > > Err:   serial
> > > Net:
> > >
> > > (Board hangs here).
> > >
> > > When I tested v9 and removed watchdog support I was able to get into
> > > the U-boot prompt.
> > 
> > I just added "#define DEBUG" in arch/arm/lib/board to start debugging
> > this and for my surprise I can reach the prompt now:
> > 
> > U-Boot 2013.04-rc1-14135-gab21c72-dirty (Apr 09 2013 - 09:35:51)
> > 
> > U-Boot code: 87F0 -> 87F2C34C  BSS: -> 87F3137C
> > CPU:   Freescale i.MX31 rev 2.0 at 532 MHz.
> > Reset cause: POR
> > Board: MX31PDK
> > monitor len: 0003137C
> > ramsize: 0800
> > TLB table from 87ff to 87ff4000
> > Top of RAM usable for U-Boot at: 87ff
> > Reserving 196k for U-Boot at: 87fbe000
> > Reserving 640k for malloc() at: 87f1e000
> > Reserving 32 Bytes for Board Info at: 87f1dfe0
> > Reserving 160 Bytes for Global Data at: 87f1df40
> > New Stack Pointer is: 87f1df30
> > RAM Configuration:
> > Bank #0: 8000 128 MiB
> > relocation Offset is: 000be000
> > monitor flash len: 000310F4
> > Now running in RAM - U-Boot at: 87fbe000
> > NAND:  256 MiB
> > In:serial
> > Out:   serial
> > Err:   serial
> > Net:   smc911x-0
> > Hit any key to stop autoboot:  0
> > MX31PDK U-Boot >
> > 
> > I remember to have added "#define DEBUG" in v9 as well, so looks like
> > the behavior between v9 and v10 is consistent.
> > 
> > Now we need to understand why the prompt is not reached without
> > ""#define DEBUG".
> 
> Can you try different values for the following configs in mx31pdk.h?
>  - CONFIG_SYS_NAND_U_BOOT_SIZE
>  - CONFIG_SPL_TEXT_BASE
>  - CONFIG_SYS_TEXT_BASE
>  - (CONFIG_ENV_OFFSET)
>  - (CONFIG_ENV_OFFSET_REDUND)
> 
> I would try:
>  - 0x4 for CONFIG_SYS_NAND_U_BOOT_SIZE
>  - 0x8600 for CONFIG_SPL_TEXT_BASE
>  - 0x8700 for CONFIG_SYS_TEXT_BASE

I have retrieved your previous test trace:
---
U-Boot 2013.01 (Feb 22 2013 - 16:25:48)

CPU:   Freescale i.MX31 rev 2.0 at 532 MHz.
Reset cause: POR
Board: MX31PDK
DRAM:  128 MiB

(hangs here).
---

So it does not hang at the same step.

Can you try to disable CONFIG_CMD_NET or to comment out eth_initialize() in
arch/arm/lib/board.c? Do you know if something has changed in this function
recently, or if there is something about it that has not yet been merged in the
arm tree?

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


Re: [U-Boot] [PATCH 1/3] OMAP3/4/5/AM33xx: Correct logic for checking FAT or RAW MMC

2013-04-09 Thread Peter Korsgaard
> "Tom" == Tom Rini  writes:

 Tom> In the case of booting from certain peripherals, such as UART, we must
 Tom> not see what the device descriptor says for RAW or FAT mode because in
 Tom> addition to being nonsensical, it leads to a hang.  This is why we have
 Tom> a test currently for the boot mode being within range.  The problem
 Tom> however is that on some platforms we get MMC2_2 as the boot mode and not
 Tom> the defined value for MMC2, and in others we get the value for MMC2_2.
 Tom> This is required to fix eMMC booting on omap5_uevm.

 Tom> Tested on am335x_evm (UART, NAND, SD), omap3_beagle (NAND, SD on
 Tom> classic, SD only on xM rev C5) and omap5_uevm (SD, eMMC).

 Tom> Signed-off-by: Tom Rini 
 Tom> ---
 Tom>  arch/arm/cpu/armv7/omap-common/lowlevel_init.S |   10 +++---
 Tom>  arch/arm/include/asm/arch-am33xx/spl.h |3 +++
 Tom>  arch/arm/include/asm/arch-omap3/spl.h  |3 +++
 Tom>  arch/arm/include/asm/arch-omap4/spl.h  |2 ++
 Tom>  arch/arm/include/asm/arch-omap5/spl.h  |2 ++
 Tom>  5 files changed, 17 insertions(+), 3 deletions(-)

 Tom> diff --git a/arch/arm/cpu/armv7/omap-common/lowlevel_init.S 
b/arch/arm/cpu/armv7/omap-common/lowlevel_init.S
 Tom> index b933fe8..90b3c8a 100644
 Tom> --- a/arch/arm/cpu/armv7/omap-common/lowlevel_init.S
 Tom> +++ b/arch/arm/cpu/armv7/omap-common/lowlevel_init.S
 Tom> @@ -60,10 +60,14 @@ ENTRY(save_boot_params)
 Tom>   ldr r3, =boot_params
 Tom>   strbr2, [r3, #BOOT_DEVICE_OFFSET]   @ spl_boot_device <- r1
 
 Tom> - /* boot mode is passed only for devices that can raw/fat mode */
 Tom> - cmp r2, #BOOT_DEVICE_XIP
 Tom> + /*
 Tom> +  * boot mode is only valid for device that can be raw or FAT booted.
 Tom> +  * in other cases it may be fatal to look.  While platforms differ
 Tom> +  * in the values used for each MMC slot, they are contiguous.
 Tom> +  */
 Tom> + cmp r2, #MMC_BOOT_DEVICES_START
 Tom>   blt 2f
 Tom> - cmp r2, #BOOT_DEVICE_MMC2
 Tom> + cmp r2, #MMC_BOOT_DEVICES_END
 Tom>   bgt 2f
 Tom>   /* Store the boot mode (raw/FAT) in omap_bootmode */
 Tom>   ldr r2, [r0, #DEV_DESC_PTR_OFFSET]  @ get the device descriptor ptr
 Tom> diff --git a/arch/arm/include/asm/arch-am33xx/spl.h 
b/arch/arm/include/asm/arch-am33xx/spl.h
 Tom> index f60b086..14a2c7c 100644
 Tom> --- a/arch/arm/include/asm/arch-am33xx/spl.h
 Tom> +++ b/arch/arm/include/asm/arch-am33xx/spl.h
 Tom> @@ -37,4 +37,7 @@
 Tom>  #define BOOT_DEVICE_USBETH   68
 Tom>  #define BOOT_DEVICE_CPGMAC   70
 Tom>  #define BOOT_DEVICE_MMC2_2  0xFF
 Tom> +
 Tom> +#define MMC_BOOT_DEVICES_START   BOOT_DEVICE_MMC1
 Tom> +#define MMC_BOOT_DEVICES_END BOOT_DEVICE_MMC2

Doesn't this break ti814x with the funky inverted mmc1/mmc2?

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


Re: [U-Boot] [PATCH v9 18/30] nand: mxc: Switch NAND SPL to generic SPL

2013-04-09 Thread Benoît Thébaudeau
Hi Fabio,

On Tuesday, April 9, 2013 2:46:21 PM, Fabio Estevam wrote:
> On Tue, Apr 9, 2013 at 9:30 AM, Fabio Estevam  wrote:
> 
> > Just tested v10 on mx31pdk.
> >
> > As reported in v9 I start to get reboots and never reach the prompt.
> >
> > Then I disabled watchdog options in mx31pdk.h and I get the following:
> >
> > U-Boot 2013.04-rc1-14135-gab21c72-dirty (Apr 09 2013 - 09:23:01)
> >
> > CPU:   Freescale i.MX31 rev 2.0 at 532 MHz.
> > Reset cause: POR
> > Board: MX31PDK
> > DRAM:  128 MiB
> > NAND:  256 MiB
> > In:serial
> > Out:   serial
> > Err:   serial
> > Net:
> >
> > (Board hangs here).
> >
> > When I tested v9 and removed watchdog support I was able to get into
> > the U-boot prompt.
> 
> I just added "#define DEBUG" in arch/arm/lib/board to start debugging
> this and for my surprise I can reach the prompt now:
> 
> U-Boot 2013.04-rc1-14135-gab21c72-dirty (Apr 09 2013 - 09:35:51)
> 
> U-Boot code: 87F0 -> 87F2C34C  BSS: -> 87F3137C
> CPU:   Freescale i.MX31 rev 2.0 at 532 MHz.
> Reset cause: POR
> Board: MX31PDK
> monitor len: 0003137C
> ramsize: 0800
> TLB table from 87ff to 87ff4000
> Top of RAM usable for U-Boot at: 87ff
> Reserving 196k for U-Boot at: 87fbe000
> Reserving 640k for malloc() at: 87f1e000
> Reserving 32 Bytes for Board Info at: 87f1dfe0
> Reserving 160 Bytes for Global Data at: 87f1df40
> New Stack Pointer is: 87f1df30
> RAM Configuration:
> Bank #0: 8000 128 MiB
> relocation Offset is: 000be000
> monitor flash len: 000310F4
> Now running in RAM - U-Boot at: 87fbe000
> NAND:  256 MiB
> In:serial
> Out:   serial
> Err:   serial
> Net:   smc911x-0
> Hit any key to stop autoboot:  0
> MX31PDK U-Boot >
> 
> I remember to have added "#define DEBUG" in v9 as well, so looks like
> the behavior between v9 and v10 is consistent.
> 
> Now we need to understand why the prompt is not reached without
> ""#define DEBUG".

Can you try different values for the following configs in mx31pdk.h?
 - CONFIG_SYS_NAND_U_BOOT_SIZE
 - CONFIG_SPL_TEXT_BASE
 - CONFIG_SYS_TEXT_BASE
 - (CONFIG_ENV_OFFSET)
 - (CONFIG_ENV_OFFSET_REDUND)

I would try:
 - 0x4 for CONFIG_SYS_NAND_U_BOOT_SIZE
 - 0x8600 for CONFIG_SPL_TEXT_BASE
 - 0x8700 for CONFIG_SYS_TEXT_BASE

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


  1   2   >