Re: [U-Boot] [PATCH v5 6/9] kbuild: add include linux/kconfig.h in config.h

2017-01-27 Thread Masahiro Yamada
2017-01-28 9:29 GMT+09:00 Tom Rini :
> On Sat, Jan 28, 2017 at 05:36:33AM +0900, Masahiro Yamada wrote:
>> 2017-01-27 19:00 GMT+09:00 Patrick Delaunay :
>> > From: Patrick Delaunay 
>> >
>> > Allow to use define CONFIG_IS_ENABLED
>> > in include/config_fallbacks.h
>> >
>> > Signed-off-by: Patrick Delaunay 
>> > Signed-off-by: Patrick Delaunay 
>>
>> This patch is unneeded.
>>
>> include/linux/kconfig.h is forcibly included
>> from all source files.
>>
>> See
>>
>> UBOOTINCLUDE:= \
>> -Iinclude \
>> $(if $(KBUILD_SRC), -I$(srctree)/include) \
>> -I$(srctree)/arch/$(ARCH)/include \
>> -include $(srctree)/include/linux/kconfig.h
>
> This patch is needed for HOSTCC:
>   HOSTCC  tools/atmel_pmecc_params
>   In file included from include/config.h:9:0,
>  from ../tools/atmel_pmecc_params.c:16:   
>   ../include/config_fallbacks.h:58:23: error: missing binary operator 
> before token "("
>  #if (CONFIG_IS_ENABLED(PARTITION_UUIDS) || \
>^
> scripts/Makefile.host:99: recipe for target 'tools/atmel_pmecc_params' failed
> make[2]: *** [tools/atmel_pmecc_params] Error 1
> /home2/trini/u-boot/u-boot/Makefile:1217: recipe for target 'tools' failed




OK, I see.   Thanks for explaining this.


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


Re: [U-Boot] [PATCH 1/2][v3] board: freescale: ls1012a: Enable secure DDR on LS1012A platforms

2017-01-27 Thread york sun
On 01/26/2017 08:09 PM, Prabhakar Kushwaha wrote:
> PPA binary needs to be relocated on secure DDR, hence marking out
> a portion of DDR as secure if CONFIG_SYS_MEM_RESERVE_SECURE flag
> is set
>
> Signed-off-by: Hou Zhiqiang 
> Signed-off-by: Abhimanyu Saini 
> Signed-off-by: Prabhakar Kushwaha 
> ---
> Changes for v2: Sending as it is
> Changes for v3: Rebased top of the tree



> diff --git a/board/freescale/ls1012aqds/ls1012aqds.c 
> b/board/freescale/ls1012aqds/ls1012aqds.c
> index 88fb4ce..704019e 100644
> --- a/board/freescale/ls1012aqds/ls1012aqds.c
> +++ b/board/freescale/ls1012aqds/ls1012aqds.c
> @@ -21,6 +21,7 @@
>  #include 
>  #include 
>  #include 
> +#include "../../../arch/arm/include/asm/global_data.h"
>

What's going on here? Why do you need this?

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


Re: [U-Boot] [PATCHv5 15/17] armv8: ls2080a: Enable PCIe in defconfigs

2017-01-27 Thread Scott Wood
On Tue, 2016-12-13 at 14:54 +0800, Zhiqiang Hou wrote:
> From: Minghuan Lian 
> 
> The patch enables PCIe in ls2080a defconfigs and
> removes unused PCIe related macro defines.
> 
> Signed-off-by: Minghuan Lian 
> Signed-off-by: Hou Zhiqiang 
> ---
> V5:
>  - No change

As of this patch, PCIe ethernet stopped working in Linux (4.10-rc2) on
ls2080ardb.  The e1000e does get probed, but no interrupts are ever seen.

-Scott

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


Re: [U-Boot] [RFC PATCH 00/11] extend FIT loading support (plus Pine64/ATF support)

2017-01-27 Thread André Przywara
On 27/01/17 21:29, Simon Glass wrote:

Hi Simon,

> On 19 January 2017 at 18:53, Andre Przywara  wrote:
>> Currently the FIT format is not used to its full potential in the SPL:
>> It only loads the first image from the /images node and appends the
>> proper FDT.
>> Some boards and platforms would benefit from loading more images before
>> starting U-Boot proper, notably Allwinner A64 and ARMv8 Rockchip boards,
>> which use an ARM Trusted Firmware (ATF) image to be executed before U-Boot.
>>
>> This series tries to solve this in a board agnostic and generic way:
>> We extend the SPL FIT loading scheme to allow loading multiple images.
>> So apart from loading the image which is referenced by the "firmware"
>> property in the respective configuration node and placing the DTB right
>> behind it, we iterate over all strings in the "loadable" property.
>> Each image referenced there will be loaded to its specified load address.
>> The entry point U-Boot eventually branches to will be taken from the
>> first image to explicitly provide the "entry" property, or, if none
>> of them does so, from the load address of the "firmware" image.
>> This keeps the scheme compatible with the FIT images our Makefile creates
>> automatically at the moment.
>>
>> Apart from the already mentioned ATF scenario this opens up more usage
>> scenarios, of which the commit message of patch 04/11 lists some.
>>
>> The first three patches rework the SPL FIT support to be more flexible
>> and to allow easier usage in the fourth patch, which introduces the
>> multiple-image loading facility.
>> The remaining patches enable that support for the Pine64 board to make
>> its SPL support finally useful and to demonstrate usage of this scheme:
>> patches 5-7 extend the usable SPL size by about 4 KB to allow AArch64
>> compilation of the SPL with FIT support enabled. Patch 8 implements the
>> board selector routine, which selects either the Pine64 or Pine64+ DTB
>> depending on the detected DRAM size. Patch 9 enables SPL FIT support in
>> the Pine64 defconfig.
>> To demonstrate the usage, patch 10 provides a FIT source file, which
>> loads and executes ATF before the U-Boot proper. Users are expected to
>> compile this with "mkimage -f boards/sunxi/pine64_atf.its -E pine64.itb",
>> then write the resulting file behind the SPL on an SD card (or any other
>> U-Boot supported boot media, for that matter).
>> Patch 11 then adds FIT support to the sunxi SPL SPI loading routine,
>> which allows to load ATF on boards with SPI flash as well.
>>
>> Questions:
>> 1) Is this scheme the right one (usage of "firmware" and "loadables",
>>determination of entry point)? Shall we make use of the "setup"
>>property?
> 
> Seems reasonable to me.
> 
>> 2) Shall we extend mkimage to allow supplying "loadable" files on the
>>command line, which would allow to build the .itb file automatically?
> 
> Yes.

I was thinking about this a bit more, as Andrew pointed out before it
may become hairy to add tons of options to mkimage.
I came up with a simple shell script, mostly using here documents
(cat << _EOF) to generate the .its file on the fly, adding all DTs given
on the command line. It's pretty easy, yet readable and adaptable. So
each platform could provide one, if needed, and could hard code things
like ATF in here.

>> 3) Is providing the .its source file for a (family of) boards the right
>>way?
> 
> Where needed (i.e. the mkimage command line is not trivial)
> 
>> 4) Does this break any boards which already use SPL FIT loading?
> 
> Probably not, but I'm sure it would be spotted if so.
> 
>>
>> And for the Pine64 part:
>> 5) Is extending the usable SPL size like in patch 5-7 acceptable?
>>
>> I have a more generic solution for the .dtb selection in mind: Based on
>> some patch from Siarhei we store the .dtb filename in the SPL header and
>> select the .dtb from the FIT image by simply matching the name. This would
>> allow _one_ build supporting multiple boards. The actual board name would
>> need to written into the SPL header or could be copied from there when
>> updating the image.
>> I can provide the patches once we agreed upon this series.
>>
>> Please let me know what you think!
> 
> I think it is a nice piece of work. You might want to make the new
> feature optional if it saves code space.
> 
> FIT is preferable to a raw binary image. There is also binman which
> can create binary images with things placed as you wish, but it's best
> to use FIT where you can.

Yeah, in this case it is not so much about placing, but more about
flexibility, so FIT is really nice here.
I am also looking at a firmware update tool atm, having FIT would allow
to update single components only - for instance just the .dtb.

> A few more things:
> 
> - Can you make sure that your new node structure is clearly documented
> (with an example) in doc/uImage.FIT/ ?

Yes, sure.

> - Can you add a pytest for sandbox_spl, which verifies that 

Re: [U-Boot] [RFC PATCH 01/11] SPL: FIT: refactor FDT loading

2017-01-27 Thread André Przywara
On 27/01/17 21:29, Simon Glass wrote:
> Hi Andre,
> 
> On 19 January 2017 at 18:53, Andre Przywara  wrote:
>>
>> Currently the SPL FIT loader uses the spl_fit_select_fdt() function to
>> find the offset to the right DTB within the FIT image.
>> For this it iterates over all subnodes of the /configuration node in
>> the FIT tree and compares all "description" strings therein using a
>> board specific matching function.
>> If that finds a match, it uses the string in the "fdt" property of that
>> subnode to locate the matching subnode in the /images node, which points
>> to the DTB data.
>> Now this works very well, but is quite specific to cover this particular
>> use case. To open up the door for a more generic usage, let's split this
>> function into:
>> 1) a function that just returns the node offset for the matching
>>configuration node (spl_fit_find_config_node())
>> 2) a function that returns the image data any given property in a given
>>configuration node points to, additionally using a given index into
>>a possbile list of strings (spl_fit_select_index())
>> This allows us to replace the specific function above by asking for the
>> image the _first string of the "fdt" property_ in the matching
>> configuration subnode points to.
>>
>> This patch introduces no functional changes, it just refactors the code
>> to allow reusing it later.
>>
>> (diff is overly clever here and produces a hard-to-read patch, so I
>> recommend to throw a look at the result instead).
>>
>> Signed-off-by: Andre Przywara 
>> ---
>>  common/spl/spl_fit.c | 82 
>> 
>>  1 file changed, 51 insertions(+), 31 deletions(-)
>>
> 
> Reviewed-by: Simon Glass 

Thanks a lot!

> 
> Please check below.



>> diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
>> index aae556f..c4e2f02 100644
>> --- a/common/spl/spl_fit.c
>> +++ b/common/spl/spl_fit.c
>> @@ -22,13 +22,11 @@ static ulong fdt_getprop_u32(const void *fdt, int node, 
>> const char *prop)
>> return fdt32_to_cpu(*cell);
>>  }
>>
>> -static int spl_fit_select_fdt(const void *fdt, int images, int *fdt_offsetp)
>> +static int spl_fit_find_config_node(const void *fdt)
>>  {
>> -   const char *name, *fdt_name;
>> -   int conf, node, fdt_node;
>> -   int len;
>> +   const char *name;
>> +   int conf, node, len;
>>
>> -   *fdt_offsetp = 0;
>> conf = fdt_path_offset(fdt, FIT_CONFS_PATH);
>> if (conf < 0) {
>> debug("%s: Cannot find /configurations node: %d\n", __func__,
>> @@ -50,39 +48,60 @@ static int spl_fit_select_fdt(const void *fdt, int 
>> images, int *fdt_offsetp)
>> continue;
>>
>> debug("Selecting config '%s'", name);
>> -   fdt_name = fdt_getprop(fdt, node, FIT_FDT_PROP, );
>> -   if (!fdt_name) {
>> -   debug("%s: Cannot find fdt name property: %d\n",
>> - __func__, len);
>> -   return -EINVAL;
>> -   }
>>
>> -   debug(", fdt '%s'\n", fdt_name);
>> -   fdt_node = fdt_subnode_offset(fdt, images, fdt_name);
>> -   if (fdt_node < 0) {
>> -   debug("%s: Cannot find fdt node '%s': %d\n",
>> - __func__, fdt_name, fdt_node);
>> -   return -EINVAL;
>> +   return node;
>> +   }
>> +
>> +   return -1;
>> +}
>> +
>> +static int spl_fit_select_index(const void *fit, int images, int *offsetp,
>> +   const char *type, int index)
>> +{
>> +   const char *name, *img_name;
>> +   int node, conf_node;
>> +   int len, i;
>> +
>> +   *offsetp = 0;
>> +   conf_node = spl_fit_find_config_node(fit);
>> +   if (conf_node < 0) {
>> +#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>> +   printf("No matching DT out of these options:\n");
>> +   for (node = fdt_first_subnode(fit, conf_node);
>> +node >= 0;
>> +node = fdt_next_subnode(fit, node)) {
>> +   name = fdt_getprop(fit, node, "description", );
>> +   printf("   %s\n", name);
>> }
>> +#endif
>> +   return -ENOENT;
>> +   }
>>
>> -   *fdt_offsetp = fdt_getprop_u32(fdt, fdt_node, "data-offset");
>> -   len = fdt_getprop_u32(fdt, fdt_node, "data-size");
>> -   debug("FIT: Selected '%s'\n", name);
>> +   img_name = fdt_getprop(fit, conf_node, type, );
>> +   if (!img_name) {
>> +   debug("cannot find property '%s': %d\n", type, len);
>> +   return -EINVAL;
>> +   }
>>
>> -   return len;
>> +   for (i = 0; i < index; i++) {
>> +   img_name = strchr(img_name, '\0') + 1;
> 
> Don't you need to check against strchr() 

Re: [U-Boot] [PATCH v5 6/9] kbuild: add include linux/kconfig.h in config.h

2017-01-27 Thread Tom Rini
On Sat, Jan 28, 2017 at 05:36:33AM +0900, Masahiro Yamada wrote:
> 2017-01-27 19:00 GMT+09:00 Patrick Delaunay :
> > From: Patrick Delaunay 
> >
> > Allow to use define CONFIG_IS_ENABLED
> > in include/config_fallbacks.h
> >
> > Signed-off-by: Patrick Delaunay 
> > Signed-off-by: Patrick Delaunay 
> 
> This patch is unneeded.
> 
> include/linux/kconfig.h is forcibly included
> from all source files.
> 
> See
> 
> UBOOTINCLUDE:= \
> -Iinclude \
> $(if $(KBUILD_SRC), -I$(srctree)/include) \
> -I$(srctree)/arch/$(ARCH)/include \
> -include $(srctree)/include/linux/kconfig.h

This patch is needed for HOSTCC:
  HOSTCC  tools/atmel_pmecc_params  
In file included from include/config.h:9:0,
 from ../tools/atmel_pmecc_params.c:16: 
../include/config_fallbacks.h:58:23: error: missing binary operator 
before token "("
 #if (CONFIG_IS_ENABLED(PARTITION_UUIDS) || \
   ^
scripts/Makefile.host:99: recipe for target 'tools/atmel_pmecc_params' failed
make[2]: *** [tools/atmel_pmecc_params] Error 1
/home2/trini/u-boot/u-boot/Makefile:1217: recipe for target 'tools' failed

-- 
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 v7] BOARD: MCCMON6: Provide support for iMX6q based mccmon6 board

2017-01-27 Thread Tom Rini
On Fri, Jan 27, 2017 at 11:16:29PM +0100, Lukasz Majewski wrote:

> This patch provides u-boot support for Liebherr (LWN) mccmon6 board.
> 
> Signed-off-by: Lukasz Majewski 
> Reviewed-by: Stefano Babic 
> 

Reviewed-by: Tom Rini 

-- 
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] drivers: net: fsl-mc: Fixup MAC addresses in DPC

2017-01-27 Thread york sun
On 01/26/2017 05:05 AM, Prabhakar Kushwaha wrote:
>
>> -Original Message-
>> From: Bogdan Purcareata [mailto:bogdan.purcare...@nxp.com]
>> Sent: Thursday, January 11, 2017 9:35 AM
>> To: u-boot@lists.denx.de
>> Cc: Bogdan Purcareata 
>> Subject: [PATCH] drivers: net: fsl-mc: Fixup MAC addresses in DPC
>>
>> Fixup port_mac_address property in MC DPC with values from the u-boot
>> environment. Since u-boot already reads the environment MAC addresses
>> when probing the PHYs, use these values.
>>
>> The u-boot environment MAC addresses take precedence over any eventual
>> ones defined in the DPC, except for the case where they are randomly
>> assigned (no u-boot env value declared for port).
>>
>> The patch assumes the "/board_info/ports/" node is present in the DPC.
>>
>> Signed-off-by: Bogdan Purcareata 
>
> Reviewed-by: Prabhakar Kushwaha 
>

Prabhakar,

I don't know how you replied with your comment. But your email client 
changed the message ID so patchwork couldn't match it.

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


Re: [U-Boot] [PATCH 2/5][v5] arch: powerpc: update the IFC IP input clock

2017-01-27 Thread york sun
On 01/24/2017 02:34 AM, Prabhakar Kushwaha wrote:
> IFC IP clock is always a constant divisor of platform clock
> pre-defined per SoC. Clock control register (CCR) used in
> current implementation governs IFC IP output clock.
>
> So update IFC IP clock to be defined as per predefined clock
> divisor of platform clock.
>
> Signed-off-by: Prabhakar Kushwaha 
> ---
> Changes for v2: Split the patch in 2 patch set
> Changes for v3: Rebased on top of u-boot commit
> Changes for v4: fix compilation error
> Changes for v5: Adding FSL_IFC as dependency
>
>  README   |  3 +++
>  arch/powerpc/cpu/mpc85xx/Kconfig | 16 
>  arch/powerpc/cpu/mpc85xx/speed.c | 10 ++
>  3 files changed, 21 insertions(+), 8 deletions(-)
>
> diff --git a/README b/README
> index a95348a..9fda381 100644
> --- a/README
> +++ b/README
> @@ -504,6 +504,9 @@ The following options need to be configured:
>   CONFIG_SYS_FSL_IFC_LE
>   Defines the IFC controller register space as Little Endian
>
> + CONFIG_SYS_FSL_IFC_CLK_DIV
> + Defines divider of platform clock(clock input to IFC 
> controller).
> +
>   CONFIG_SYS_FSL_PBL_PBI
>   It enables addition of RCW (Power on reset configuration) in 
> built image.
>   Please refer doc/README.pblimage for more details
> diff --git a/arch/powerpc/cpu/mpc85xx/Kconfig 
> b/arch/powerpc/cpu/mpc85xx/Kconfig
> index c67b6b0..8c6503d 100644
> --- a/arch/powerpc/cpu/mpc85xx/Kconfig
> +++ b/arch/powerpc/cpu/mpc85xx/Kconfig
> @@ -1265,6 +1265,22 @@ config SYS_PPC_E500_DEBUG_TLB
>  symbol should be set to the TLB1 entry to be used for this
>  purpose. If unsure, do not change.
>
> +config SYS_FSL_IFC_CLK_DIV
> + int "Divider of platform clock"
> + depends on FSL_IFC
> + default 2 ifARCH_B4420  || \
> + ARCH_B4860  || \
> + ARCH_T1024  || \
> + ARCH_T1023  || \
> + ARCH_T1040  || \
> + ARCH_T1042  || \
> + ARCH_T4160  || \
> + ARCH_T4240
> + default 1
> + help
> + Defines divider of platform clock(clock input to
> + IFC controller).
> +
>  source "board/freescale/b4860qds/Kconfig"
>  source "board/freescale/bsc9131rdb/Kconfig"
>  source "board/freescale/bsc9132qds/Kconfig"
> diff --git a/arch/powerpc/cpu/mpc85xx/speed.c 
> b/arch/powerpc/cpu/mpc85xx/speed.c
> index fcf5d92..adba092 100644
> --- a/arch/powerpc/cpu/mpc85xx/speed.c
> +++ b/arch/powerpc/cpu/mpc85xx/speed.c
> @@ -27,10 +27,6 @@ DECLARE_GLOBAL_DATA_PTR;
>  void get_sys_info(sys_info_t *sys_info)
>  {
>   volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
> -#ifdef CONFIG_FSL_IFC
> - struct fsl_ifc ifc_regs = {(void *)CONFIG_SYS_IFC_ADDR, (void *)NULL};
> - u32 ccr;
> -#endif
>  #ifdef CONFIG_FSL_CORENET
>   volatile ccsr_clk_t *clk = (void *)(CONFIG_SYS_FSL_CORENET_CLK_ADDR);
>   unsigned int cpu;
> @@ -640,10 +636,8 @@ void get_sys_info(sys_info_t *sys_info)
>  #endif
>
>  #if defined(CONFIG_FSL_IFC)
> - ccr = ifc_in32(_regs.gregs->ifc_ccr);
> - ccr = ((ccr & IFC_CCR_CLK_DIV_MASK) >> IFC_CCR_CLK_DIV_SHIFT) + 1;
> -
> - sys_info->freq_localbus = sys_info->freq_systembus / ccr;
> + sys_info->freq_localbus = sys_info->freq_systembus /
> + CONFIG_SYS_FSL_IFC_CLK_DIV;
>  #endif
>  }
>
>

After this change, sys_info->freq_localbus holds the input clock of 
local bus, instead of output clock previously. It should be noted in the 
commit message. Same comment goes to patch 3/5.

York

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


[U-Boot] [PATCH v7] BOARD: MCCMON6: Provide support for iMX6q based mccmon6 board

2017-01-27 Thread Lukasz Majewski
This patch provides u-boot support for Liebherr (LWN) mccmon6 board.

Signed-off-by: Lukasz Majewski 
Reviewed-by: Stefano Babic 

---
Changes for v7:
- Remove "wandboard" leftovers

Changes for v6:
- mccmon6_{nor|sd}_defconfigs created by using make savedefconfig

Changes for v5:
- Remove network configuration data from envs
- Clean up the envs - remove duplicated env variables

Changes for v4:
- Update board/liebherr/mccmon6/MAINTAINERS entry to quiet buildman warnings

Changes for v3:
- Define CONFIG_SYS_UBOOT_START to load u-boot image from NOR to correct address
  (so the SPL: NOR: Add CONFIG_SPL_NOR_COPY_ENTIRE_IMAGE define to enable whole 
image copy from NOR
  can be dropped)
- Update author information

Changes for v2:
- Provide space after "quiet" console boot parameter to not pollute next
  parameters
---
This patch applies on mainline u-boot:
SHA1: cf4128e53caa4f7b0a6586fc3f10690d5c05db31
---
 arch/arm/cpu/armv7/mx6/Kconfig   |   5 +
 board/liebherr/mccmon6/Kconfig   |  12 +
 board/liebherr/mccmon6/MAINTAINERS   |   7 +
 board/liebherr/mccmon6/Makefile  |   8 +
 board/liebherr/mccmon6/mccmon6.c | 490 +++
 board/liebherr/mccmon6/mon6_imximage_nor.cfg |   9 +
 board/liebherr/mccmon6/mon6_imximage_sd.cfg  |   9 +
 board/liebherr/mccmon6/spl.c | 317 +
 configs/mccmon6_nor_defconfig|  33 ++
 configs/mccmon6_sd_defconfig |  34 ++
 include/configs/mccmon6.h| 321 ++
 11 files changed, 1245 insertions(+)
 create mode 100644 board/liebherr/mccmon6/Kconfig
 create mode 100644 board/liebherr/mccmon6/MAINTAINERS
 create mode 100644 board/liebherr/mccmon6/Makefile
 create mode 100644 board/liebherr/mccmon6/mccmon6.c
 create mode 100644 board/liebherr/mccmon6/mon6_imximage_nor.cfg
 create mode 100644 board/liebherr/mccmon6/mon6_imximage_sd.cfg
 create mode 100644 board/liebherr/mccmon6/spl.c
 create mode 100644 configs/mccmon6_nor_defconfig
 create mode 100644 configs/mccmon6_sd_defconfig
 create mode 100644 include/configs/mccmon6.h

diff --git a/arch/arm/cpu/armv7/mx6/Kconfig b/arch/arm/cpu/armv7/mx6/Kconfig
index 3b04091..6dae850 100644
--- a/arch/arm/cpu/armv7/mx6/Kconfig
+++ b/arch/arm/cpu/armv7/mx6/Kconfig
@@ -125,6 +125,10 @@ config TARGET_KOSAGI_NOVENA
select BOARD_LATE_INIT
select SUPPORT_SPL
 
+config TARGET_MCCMON6
+   bool "mccmon6"
+   select SUPPORT_SPL
+
 config TARGET_MX6CUBOXI
bool "Solid-run mx6 boards"
select BOARD_LATE_INIT
@@ -361,6 +365,7 @@ source "board/phytec/pcm058/Kconfig"
 source "board/gateworks/gw_ventana/Kconfig"
 source "board/kosagi/novena/Kconfig"
 source "board/samtec/vining_2000/Kconfig"
+source "board/liebherr/mccmon6/Kconfig"
 source "board/seco/Kconfig"
 source "board/solidrun/mx6cuboxi/Kconfig"
 source "board/technexion/pico-imx6ul/Kconfig"
diff --git a/board/liebherr/mccmon6/Kconfig b/board/liebherr/mccmon6/Kconfig
new file mode 100644
index 000..4cc7fc2
--- /dev/null
+++ b/board/liebherr/mccmon6/Kconfig
@@ -0,0 +1,12 @@
+if TARGET_MCCMON6
+
+config SYS_BOARD
+   default "mccmon6"
+
+config SYS_VENDOR
+   default "liebherr"
+
+config SYS_CONFIG_NAME
+   default "mccmon6"
+
+endif
diff --git a/board/liebherr/mccmon6/MAINTAINERS 
b/board/liebherr/mccmon6/MAINTAINERS
new file mode 100644
index 000..c9c7183
--- /dev/null
+++ b/board/liebherr/mccmon6/MAINTAINERS
@@ -0,0 +1,7 @@
+MCCMON6 BOARD
+M: Lukasz Majewski 
+S: Maintained
+F: board/liebherr/mccmon6/
+F: include/configs/mccmon6.h
+F: configs/mccmon6_nor_defconfig
+F: configs/mccmon6_sd_defconfig
diff --git a/board/liebherr/mccmon6/Makefile b/board/liebherr/mccmon6/Makefile
new file mode 100644
index 000..e37baf8
--- /dev/null
+++ b/board/liebherr/mccmon6/Makefile
@@ -0,0 +1,8 @@
+#
+# (C) Copyright 2016-2017
+# Lukasz Majewski, DENX Software Engineering, lu...@denx.de
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+obj-y  := mccmon6.o spl.o
diff --git a/board/liebherr/mccmon6/mccmon6.c b/board/liebherr/mccmon6/mccmon6.c
new file mode 100644
index 000..eb5eae4
--- /dev/null
+++ b/board/liebherr/mccmon6/mccmon6.c
@@ -0,0 +1,490 @@
+/*
+ * Copyright (C) 2016-2017
+ * Lukasz Majewski, DENX Software Engineering, lu...@denx.de
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#define UART_PAD_CTRL  (PAD_CTL_PUS_100K_UP |  \
+   PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | \
+   PAD_CTL_SRE_FAST  | PAD_CTL_HYS)
+
+#define USDHC_PAD_CTRL (PAD_CTL_PUS_47K_UP |   \
+   PAD_CTL_SPEED_LOW | PAD_CTL_DSE_80ohm | 

[U-Boot] [PATCH 03/16] ARM: uniphier: detect RAM size by decoding HW register instead of DT

2017-01-27 Thread Masahiro Yamada
U-Boot needs to set up available memory area(s) in dram_init() and
dram_init_banksize().  It is platform-dependent how to detect the
memory banks.  Currently, UniPhier adopts the memory banks _alleged_
by DT.  This is based on the assumption that users bind a correct DT
in their build process.

Come to think of it, the DRAM controller has already been set up
before U-Boot is entered (because U-Boot runs on DRAM).  So, the
DRAM controller setup register seems a more reliable source of any
information about DRAM stuff.  The DRAM banks are initialized by
preliminary firmware (SPL, ARM Trusted Firmware BL2, or whatever),
so this means the source of the reliability is shifted from Device
Tree to such early-stage firmware.  However, if the DRAM controller
is wrongly configured, the system will crash.  If your system is
running, the DRAM setup register is very likely to provide the
correct DRAM mapping.

Decode the SG_MEMCONF register to get the available DRAM banks.
The dram_init() and dram_init_banksize() need similar decoding.
It would be nice if dram_init_banksize() could reuse the outcome
of dram_init(), but global variables are unavailable at this stage
because the .bss section is available only after the relocation.
As a result, SG_MEMCONF must be checked twice, but a new helper
uniphier_memconf_decode() will help to avoid code duplication.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-uniphier/dram_init.c | 250 ++---
 arch/arm/mach-uniphier/init.h  |   1 +
 include/configs/uniphier.h |   2 +-
 3 files changed, 204 insertions(+), 49 deletions(-)

diff --git a/arch/arm/mach-uniphier/dram_init.c 
b/arch/arm/mach-uniphier/dram_init.c
index 2cf5f36..43fe6a5 100644
--- a/arch/arm/mach-uniphier/dram_init.c
+++ b/arch/arm/mach-uniphier/dram_init.c
@@ -5,83 +5,237 @@
  */
 
 #include 
-#include 
 #include 
 #include 
+#include 
 
 #include "init.h"
+#include "sg-regs.h"
 #include "soc-info.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static const void *get_memory_reg_prop(const void *fdt, int *lenp)
+struct uniphier_memif_data {
+   unsigned int soc_id;
+   unsigned long sparse_ch1_base;
+   int have_ch2;
+};
+
+static const struct uniphier_memif_data uniphier_memif_data[] = {
+   {
+   .soc_id = UNIPHIER_SLD3_ID,
+   .sparse_ch1_base = 0xc000,
+   /*
+* In fact, SLD3 has DRAM ch2, but the memory regions for ch1
+* and ch2 overlap, and host cannot get access to them at the
+* same time.  Hide the ch2 from U-Boot.
+*/
+   },
+   {
+   .soc_id = UNIPHIER_LD4_ID,
+   .sparse_ch1_base = 0xc000,
+   },
+   {
+   .soc_id = UNIPHIER_PRO4_ID,
+   .sparse_ch1_base = 0xa000,
+   },
+   {
+   .soc_id = UNIPHIER_SLD8_ID,
+   .sparse_ch1_base = 0xc000,
+   },
+   {
+   .soc_id = UNIPHIER_PRO5_ID,
+   .sparse_ch1_base = 0xc000,
+   },
+   {
+   .soc_id = UNIPHIER_PXS2_ID,
+   .sparse_ch1_base = 0xc000,
+   .have_ch2 = 1,
+   },
+   {
+   .soc_id = UNIPHIER_LD6B_ID,
+   .sparse_ch1_base = 0xc000,
+   .have_ch2 = 1,
+   },
+   {
+   .soc_id = UNIPHIER_LD11_ID,
+   .sparse_ch1_base = 0xc000,
+   },
+   {
+   .soc_id = UNIPHIER_LD20_ID,
+   .sparse_ch1_base = 0xc000,
+   .have_ch2 = 1,
+   },
+   {
+   .soc_id = UNIPHIER_PXS3_ID,
+   .sparse_ch1_base = 0xc000,
+   .have_ch2 = 1,
+   },
+};
+UNIPHIER_DEFINE_SOCDATA_FUNC(uniphier_get_memif_data, uniphier_memif_data)
+
+static int uniphier_memconf_decode(struct uniphier_dram_ch *dram_ch)
 {
-   int offset;
+   const struct uniphier_memif_data *data;
+   unsigned long size;
+   u32 val;
 
-   offset = fdt_path_offset(fdt, "/memory");
-   if (offset < 0)
-   return NULL;
+   data = uniphier_get_memif_data();
+   if (!data) {
+   pr_err("unsupported SoC\n");
+   return -EINVAL;
+   }
 
-   return fdt_getprop(fdt, offset, "reg", lenp);
-}
+   val = readl(SG_MEMCONF);
 
-int dram_init(void)
-{
-   const void *fdt = gd->fdt_blob;
-   const fdt32_t *val;
-   int ac, sc, len;
-
-   ac = fdt_address_cells(fdt, 0);
-   sc = fdt_size_cells(fdt, 0);
-   if (ac < 0 || sc < 1 || sc > 2) {
-   printf("invalid address/size cells\n");
+   /* set up ch0 */
+   dram_ch[0].base = CONFIG_SYS_SDRAM_BASE;
+
+   switch (val & SG_MEMCONF_CH0_SZ_MASK) {
+   case SG_MEMCONF_CH0_SZ_64M:
+   size = SZ_64M;
+   break;
+   case SG_MEMCONF_CH0_SZ_128M:
+   size = SZ_128M;
+   

[U-Boot] [PATCH 06/16] ARM: uniphier: clean up UMC init for PXs2 SoC

2017-01-27 Thread Masahiro Yamada
Just cosmetic changes:
  - Rename prefix DMPHY_ to MPHY_ for consistency
  - Move UMC parameters below for complete decouple of PHY and UMC
  - Remove redundant whitespaces

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-uniphier/dram/cmd_ddrmphy.c  |  50 +++---
 arch/arm/mach-uniphier/dram/ddrmphy-regs.h | 262 ++---
 arch/arm/mach-uniphier/dram/umc-pxs2.c | 253 ++--
 3 files changed, 283 insertions(+), 282 deletions(-)

diff --git a/arch/arm/mach-uniphier/dram/cmd_ddrmphy.c 
b/arch/arm/mach-uniphier/dram/cmd_ddrmphy.c
index 47cee6f..4e66162 100644
--- a/arch/arm/mach-uniphier/dram/cmd_ddrmphy.c
+++ b/arch/arm/mach-uniphier/dram/cmd_ddrmphy.c
@@ -55,13 +55,13 @@ static void dump_loop(void (*callback)(void __iomem *))
nr_ch = get_nr_ch();
 
for (ch = 0; ch < nr_ch; ch++) {
-   dx_base = get_phy_base(ch) + DMPHY_DX_BASE;
+   dx_base = get_phy_base(ch) + MPHY_DX_BASE;
nr_dx = get_nr_datx8(ch);
 
for (dx = 0; dx < nr_dx; dx++) {
printf("CH%dDX%d:", ch, dx);
(*callback)(dx_base);
-   dx_base += DMPHY_DX_STRIDE;
+   dx_base += MPHY_DX_STRIDE;
printf("\n");
}
}
@@ -79,25 +79,25 @@ static void zq_dump(void)
nr_ch = get_nr_ch();
 
for (ch = 0; ch < nr_ch; ch++) {
-   zq_base = get_phy_base(ch) + DMPHY_ZQ_BASE;
+   zq_base = get_phy_base(ch) + MPHY_ZQ_BASE;
nr_zq = 3;
 
for (zq = 0; zq < nr_zq; zq++) {
printf("CH%dZQ%d:", ch, zq);
 
-   dr = readl(zq_base + DMPHY_ZQ_DR);
+   dr = readl(zq_base + MPHY_ZQ_DR);
for (i = 0; i < 4; i++) {
printf(FS PRINTF_FORMAT, dr & 0x7f);
dr >>= 7;
}
 
-   pr = readl(zq_base + DMPHY_ZQ_PR);
+   pr = readl(zq_base + MPHY_ZQ_PR);
for (i = 0; i < 2; i++) {
printf(FS PRINTF_FORMAT, pr & 0xf);
pr >>= 4;
}
 
-   zq_base += DMPHY_ZQ_STRIDE;
+   zq_base += MPHY_ZQ_STRIDE;
printf("\n");
}
}
@@ -105,12 +105,12 @@ static void zq_dump(void)
 
 static void __wbdl_dump(void __iomem *dx_base)
 {
-   print_bdl(dx_base + DMPHY_DX_BDLR0, 4);
-   print_bdl(dx_base + DMPHY_DX_BDLR1, 4);
-   print_bdl(dx_base + DMPHY_DX_BDLR2, 2);
+   print_bdl(dx_base + MPHY_DX_BDLR0, 4);
+   print_bdl(dx_base + MPHY_DX_BDLR1, 4);
+   print_bdl(dx_base + MPHY_DX_BDLR2, 2);
 
printf(FS "(+" PRINTF_FORMAT ")",
-  readl(dx_base + DMPHY_DX_LCDLR1) & 0xff);
+  readl(dx_base + MPHY_DX_LCDLR1) & 0xff);
 }
 
 static void wbdl_dump(void)
@@ -123,15 +123,15 @@ static void wbdl_dump(void)
 
 static void __rbdl_dump(void __iomem *dx_base)
 {
-   print_bdl(dx_base + DMPHY_DX_BDLR3, 4);
-   print_bdl(dx_base + DMPHY_DX_BDLR4, 4);
-   print_bdl(dx_base + DMPHY_DX_BDLR5, 1);
+   print_bdl(dx_base + MPHY_DX_BDLR3, 4);
+   print_bdl(dx_base + MPHY_DX_BDLR4, 4);
+   print_bdl(dx_base + MPHY_DX_BDLR5, 1);
 
printf(FS "(+" PRINTF_FORMAT ")",
-  (readl(dx_base + DMPHY_DX_LCDLR1) >> 8) & 0xff);
+  (readl(dx_base + MPHY_DX_LCDLR1) >> 8) & 0xff);
 
printf(FS "(+" PRINTF_FORMAT ")",
-  (readl(dx_base + DMPHY_DX_LCDLR1) >> 16) & 0xff);
+  (readl(dx_base + MPHY_DX_LCDLR1) >> 16) & 0xff);
 }
 
 static void rbdl_dump(void)
@@ -145,8 +145,8 @@ static void rbdl_dump(void)
 static void __wld_dump(void __iomem *dx_base)
 {
int rank;
-   u32 lcdlr0 = readl(dx_base + DMPHY_DX_LCDLR0);
-   u32 gtr = readl(dx_base + DMPHY_DX_GTR);
+   u32 lcdlr0 = readl(dx_base + MPHY_DX_LCDLR0);
+   u32 gtr = readl(dx_base + MPHY_DX_GTR);
 
for (rank = 0; rank < 4; rank++) {
u32 wld = (lcdlr0 >> (8 * rank)) & 0xff; /* Delay */
@@ -168,8 +168,8 @@ static void wld_dump(void)
 static void __dqsgd_dump(void __iomem *dx_base)
 {
int rank;
-   u32 lcdlr2 = readl(dx_base + DMPHY_DX_LCDLR2);
-   u32 gtr = readl(dx_base + DMPHY_DX_GTR);
+   u32 lcdlr2 = readl(dx_base + MPHY_DX_LCDLR2);
+   u32 gtr = readl(dx_base + MPHY_DX_GTR);
 
for (rank = 0; rank < 4; rank++) {
u32 dqsgd = (lcdlr2 >> (8 * rank)) & 0xff; /* Delay */
@@ -190,7 +190,7 @@ static void dqsgd_dump(void)
 static void __mdl_dump(void __iomem *dx_base)
 {
int i;
-   u32 mdl = readl(dx_base + DMPHY_DX_MDLR);
+   u32 mdl = readl(dx_base + MPHY_DX_MDLR);
 
for (i = 0; i < 3; i++)

[U-Boot] [PATCH 05/16] ARM: uniphier: refactor cmd_ddrphy

2017-01-27 Thread Masahiro Yamada
It seems more readable to use arrays to get SoC specific parameters
instead of the crappy switch statement.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-uniphier/dram/cmd_ddrphy.c | 156 ---
 1 file changed, 83 insertions(+), 73 deletions(-)

diff --git a/arch/arm/mach-uniphier/dram/cmd_ddrphy.c 
b/arch/arm/mach-uniphier/dram/cmd_ddrphy.c
index d6d9db3..26b35f6 100644
--- a/arch/arm/mach-uniphier/dram/cmd_ddrphy.c
+++ b/arch/arm/mach-uniphier/dram/cmd_ddrphy.c
@@ -24,35 +24,53 @@
 
 #define ptr_to_uint(p) ((unsigned int)(unsigned long)(p))
 
-struct phy_param {
-   resource_size_t base;
-   unsigned int nr_dx;
+#define UNIPHIER_MAX_NR_DDRPHY 4
+
+struct uniphier_ddrphy_param {
+   unsigned int soc_id;
+   unsigned int nr_phy;
+   struct {
+   resource_size_t base;
+   unsigned int nr_dx;
+   } phy[UNIPHIER_MAX_NR_DDRPHY];
 };
 
-static const struct phy_param uniphier_ld4_phy_param[] = {
-   { .base = 0x5bc01000, .nr_dx = 2, },
-   { .base = 0x5be01000, .nr_dx = 2, },
-   { /* sentinel */ }
-};
-
-static const struct phy_param uniphier_pro4_phy_param[] = {
-   { .base = 0x5bc01000, .nr_dx = 2, },
-   { .base = 0x5bc02000, .nr_dx = 2, },
-   { .base = 0x5be01000, .nr_dx = 2, },
-   { .base = 0x5be02000, .nr_dx = 2, },
-   { /* sentinel */ }
-};
-
-static const struct phy_param uniphier_sld8_phy_param[] = {
-   { .base = 0x5bc01000, .nr_dx = 2, },
-   { .base = 0x5be01000, .nr_dx = 2, },
-   { /* sentinel */ }
-};
-
-static const struct phy_param uniphier_ld11_phy_param[] = {
-   { .base = 0x5bc01000, .nr_dx = 4, },
-   { /* sentinel */ }
+static const struct uniphier_ddrphy_param uniphier_ddrphy_param[] = {
+   {
+   .soc_id = UNIPHIER_LD4_ID,
+   .nr_phy = 2,
+   .phy = {
+   { .base = 0x5bc01000, .nr_dx = 2, },
+   { .base = 0x5be01000, .nr_dx = 2, },
+   },
+   },
+   {
+   .soc_id = UNIPHIER_PRO4_ID,
+   .nr_phy = 4,
+   .phy = {
+   { .base = 0x5bc01000, .nr_dx = 2, },
+   { .base = 0x5bc02000, .nr_dx = 2, },
+   { .base = 0x5be01000, .nr_dx = 2, },
+   { .base = 0x5be02000, .nr_dx = 2, },
+   },
+   },
+   {
+   .soc_id = UNIPHIER_SLD8_ID,
+   .nr_phy = 2,
+   .phy = {
+   { .base = 0x5bc01000, .nr_dx = 2, },
+   { .base = 0x5be01000, .nr_dx = 2, },
+   },
+   },
+   {
+   .soc_id = UNIPHIER_LD11_ID,
+   .nr_phy = 1,
+   .phy = {
+   { .base = 0x5bc01000, .nr_dx = 4, },
+   },
+   },
 };
+UNIPHIER_DEFINE_SOCDATA_FUNC(uniphier_get_ddrphy_param, uniphier_ddrphy_param)
 
 static void print_bdl(void __iomem *reg, int n)
 {
@@ -63,18 +81,18 @@ static void print_bdl(void __iomem *reg, int n)
printf(FS PRINTF_FORMAT, (val >> i * 6) & 0x3f);
 }
 
-static void dump_loop(const struct phy_param *phy_param,
+static void dump_loop(const struct uniphier_ddrphy_param *param,
  void (*callback)(void __iomem *))
 {
void __iomem *phy_base, *dx_base;
-   int p, dx;
+   int phy, dx;
 
-   for (p = 0; phy_param->base; phy_param++, p++) {
-   phy_base = ioremap(phy_param->base, SZ_4K);
+   for (phy = 0; phy < param->nr_phy; phy++) {
+   phy_base = ioremap(param->phy[phy].base, SZ_4K);
dx_base = phy_base + PHY_DX_BASE;
 
-   for (dx = 0; dx < phy_param->nr_dx; dx++) {
-   printf("PHY%dDX%d:", p, dx);
+   for (dx = 0; dx < param->phy[phy].nr_dx; dx++) {
+   printf("PHY%dDX%d:", phy, dx);
(*callback)(dx_base);
dx_base += PHY_DX_STRIDE;
printf("\n");
@@ -93,12 +111,12 @@ static void __wbdl_dump(void __iomem *dx_base)
   readl(dx_base + PHY_DX_LCDLR1) & 0xff);
 }
 
-static void wbdl_dump(const struct phy_param *phy_param)
+static void wbdl_dump(const struct uniphier_ddrphy_param *param)
 {
printf("\n--- Write Bit Delay Line ---\n");
printf("   DQ0  DQ1  DQ2  DQ3  DQ4  DQ5  DQ6  DQ7   DM  DQS  
(WDQD)\n");
 
-   dump_loop(phy_param, &__wbdl_dump);
+   dump_loop(param, &__wbdl_dump);
 }
 
 static void __rbdl_dump(void __iomem *dx_base)
@@ -110,12 +128,12 @@ static void __rbdl_dump(void __iomem *dx_base)
   (readl(dx_base + PHY_DX_LCDLR1) >> 8) & 0xff);
 }
 
-static void rbdl_dump(const struct phy_param *phy_param)
+static void rbdl_dump(const struct uniphier_ddrphy_param *param)
 {
printf("\n--- Read Bit Delay Line ---\n");
printf("   DQ0  DQ1  DQ2  DQ3 

[U-Boot] [PATCH 16/16] i2c: uniphier-f: use readl_poll_timeout() to poll registers

2017-01-27 Thread Masahiro Yamada
The readl_poll_timeout() is a useful helper to poll registers
and error out if the condition is not met.

Signed-off-by: Masahiro Yamada 
---

 drivers/i2c/i2c-uniphier-f.c | 34 ++
 1 file changed, 10 insertions(+), 24 deletions(-)

diff --git a/drivers/i2c/i2c-uniphier-f.c b/drivers/i2c/i2c-uniphier-f.c
index e212c13..9f0df59 100644
--- a/drivers/i2c/i2c-uniphier-f.c
+++ b/drivers/i2c/i2c-uniphier-f.c
@@ -9,6 +9,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -69,26 +70,14 @@ struct uniphier_fi2c_dev {
unsigned long timeout;  /* time out (us) */
 };
 
-static int poll_status(u32 __iomem *reg, u32 flag)
-{
-   int wait = 100; /* 1 sec is long enough */
-
-   while (readl(reg) & flag) {
-   if (wait-- < 0)
-   return -EREMOTEIO;
-   udelay(1);
-   }
-
-   return 0;
-}
-
 static int reset_bus(struct uniphier_fi2c_regs __iomem *regs)
 {
+   u32 val;
int ret;
 
/* bus forcible reset */
writel(I2C_RST_RST, >rst);
-   ret = poll_status(>rst, I2C_RST_RST);
+   ret = readl_poll_timeout(>rst, val, !(val & I2C_RST_RST), 1);
if (ret < 0)
debug("error: fail to reset I2C controller\n");
 
@@ -97,9 +86,10 @@ static int reset_bus(struct uniphier_fi2c_regs __iomem *regs)
 
 static int check_device_busy(struct uniphier_fi2c_regs __iomem *regs)
 {
+   u32 val;
int ret;
 
-   ret = poll_status(>sr, I2C_SR_DB);
+   ret = readl_poll_timeout(>sr, val, !(val & I2C_SR_DB), 100);
if (ret < 0) {
debug("error: device busy too long. reset...\n");
ret = reset_bus(regs);
@@ -138,15 +128,11 @@ static int wait_for_irq(struct uniphier_fi2c_dev *dev, 
u32 flags,
bool *stop)
 {
u32 irq;
-   unsigned long wait = dev->timeout;
-   int ret = -EREMOTEIO;
-
-   do {
-   udelay(1);
-   irq = readl(>regs->intr);
-   } while (!(irq & flags) && wait--);
+   int ret;
 
-   if (wait < 0) {
+   ret = readl_poll_timeout(>regs->intr, irq, irq & flags,
+dev->timeout);
+   if (ret < 0) {
debug("error: time out\n");
return ret;
}
@@ -172,7 +158,7 @@ static int issue_stop(struct uniphier_fi2c_dev *dev, int 
old_ret)
debug("stop condition\n");
writel(I2C_CR_MST | I2C_CR_STO, >regs->cr);
 
-   ret = poll_status(>regs->sr, I2C_SR_DB);
+   ret = check_device_busy(dev->regs);
if (ret < 0)
debug("error: device busy after operation\n");
 
-- 
2.7.4

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


[U-Boot] [PATCH 11/16] ARM: uniphier: set initrd_high environment to skip initrd relocation

2017-01-27 Thread Masahiro Yamada
The boot_ramdisk_high() checks the environment "initrd_high" and,
if it is set to (ulong)-1, skip the initrd relocation.  This is
useful for faster booting when we know the initrd is already located
within the reach of the kernel.

Change "norboot" to copy images in order to make it work without
depending on the automatic relocation.

Signed-off-by: Masahiro Yamada 
---

 include/configs/uniphier.h | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/include/configs/uniphier.h b/include/configs/uniphier.h
index b6dc76e..0ffd507 100644
--- a/include/configs/uniphier.h
+++ b/include/configs/uniphier.h
@@ -203,8 +203,12 @@
"norboot=setexpr kernel_addr_nor $nor_base + $kernel_addr && " \
"setexpr kernel_size_div4 $kernel_size / 4 && " \
"cp $kernel_addr_nor $kernel_addr_load $kernel_size_div4 && " \
-   "setexpr ramdisk_addr_r $nor_base + $ramdisk_addr &&" \
-   "setexpr fdt_addr_r $nor_base + $fdt_addr &&" \
+   "setexpr ramdisk_addr_nor $nor_base + $ramdisk_addr && " \
+   "setexpr ramdisk_size_div4 $ramdisk_size / 4 && " \
+   "cp $ramdisk_addr_nor $ramdisk_addr_r $ramdisk_size_div4 && " \
+   "setexpr fdt_addr_nor $nor_base + $fdt_addr && " \
+   "setexpr fdt_size_div4 $fdt_size / 4 && " \
+   "cp $fdt_addr_nor $fdt_addr_r $fdt_size_div4 && " \
"run boot_common\0" \
"nandboot=nand read $kernel_addr_load $kernel_addr $kernel_size && " \
"nand read $ramdisk_addr_r $ramdisk_addr $ramdisk_size &&" \
@@ -223,6 +227,7 @@
 #defineCONFIG_EXTRA_ENV_SETTINGS   \
"netdev=eth0\0" \
"verify=n\0"\
+   "initrd_high=0x\0"  \
"nor_base=0x4200\0" \
"sramupdate=setexpr tmp_addr $nor_base + 0x5 &&"\
"tftpboot $tmp_addr u-boot-spl.bin &&"  \
-- 
2.7.4

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


[U-Boot] [PATCH 09/16] ARM: uniphier: collect SPL CONFIG symbols to the bottom of header

2017-01-27 Thread Masahiro Yamada
For clarification, move CONFIG symbols that affect SPL building
into a single place.  Drop #ifdef CONFIG_SPL ... #endif since it is
harmless to define CONFIG_SPL_... during U-Boot proper building.

Signed-off-by: Masahiro Yamada 
---

 include/configs/uniphier.h | 11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/include/configs/uniphier.h b/include/configs/uniphier.h
index ef5b019..94d87c3 100644
--- a/include/configs/uniphier.h
+++ b/include/configs/uniphier.h
@@ -98,7 +98,6 @@
 #define CONFIG_SYS_TIMER_RATE  100
 #endif
 
-
 #define CONFIG_SYS_MAX_NAND_DEVICE 1
 #define CONFIG_SYS_NAND_MAX_CHIPS  2
 #define CONFIG_SYS_NAND_ONFI_DETECTION
@@ -241,6 +240,11 @@
 /* for LD20; the last 64 byte is used for dynamic DDR PHY training */
 #define CONFIG_SYS_MEM_TOP_HIDE64
 
+#define CONFIG_PANIC_HANG
+
+#define CONFIG_SYS_INIT_SP_ADDR(CONFIG_SYS_TEXT_BASE)
+
+/* only for SPL */
 #if defined(CONFIG_ARM64)
 #define CONFIG_SPL_TEXT_BASE   0x3000
 #elif defined(CONFIG_ARCH_UNIPHIER_SLD3) || \
@@ -258,9 +262,6 @@
 #else
 #define CONFIG_SPL_STACK   (0x0010)
 #endif
-#define CONFIG_SYS_INIT_SP_ADDR(CONFIG_SYS_TEXT_BASE)
-
-#define CONFIG_PANIC_HANG
 
 #define CONFIG_SPL_FRAMEWORK
 #ifdef CONFIG_ARM64
@@ -274,7 +275,6 @@
 /* subtract sizeof(struct image_header) */
 #define CONFIG_SYS_UBOOT_BASE  (0x6 - 0x40)
 
-#ifdef CONFIG_SPL
 #define CONFIG_SPL_TARGET  "u-boot-with-spl.bin"
 #define CONFIG_SPL_MAX_FOOTPRINT   0x1
 #define CONFIG_SPL_MAX_SIZE0x1
@@ -284,6 +284,5 @@
 #define CONFIG_SPL_BSS_START_ADDR  0x30016000
 #endif
 #define CONFIG_SPL_BSS_MAX_SIZE0x2000
-#endif
 
 #endif /* __CONFIG_UNIPHIER_COMMON_H__ */
-- 
2.7.4

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


[U-Boot] [PATCH 10/16] ARM: uniphier: use Image.gz instead Image for booting ARM64 Linux

2017-01-27 Thread Masahiro Yamada
The ARM64 Linux raw image now amounts to 15MB and it is getting
bigger and bigger.  Using Image.gz saves about 8MB.  The cost of
unzip is smaller than what we get by saving the kernel loading
from non-volatile devices.

The ARM32 Linux still uses zImage, a self-decompressor image,
so it should not be affected.

Signed-off-by: Masahiro Yamada 
---

 include/configs/uniphier.h | 36 ++--
 1 file changed, 22 insertions(+), 14 deletions(-)

diff --git a/include/configs/uniphier.h b/include/configs/uniphier.h
index 94d87c3..b6dc76e 100644
--- a/include/configs/uniphier.h
+++ b/include/configs/uniphier.h
@@ -15,6 +15,10 @@
 
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS  10
 
+#ifdef CONFIG_ARM64
+#define CONFIG_CMD_UNZIP
+#endif
+
 /*---
  * MMU and Cache Setting
  *--*/
@@ -167,46 +171,50 @@
"__nfsboot=run tftpboot\0"
 #else
 #ifdef CONFIG_ARM64
-#define CONFIG_BOOTFILE"Image"
+#define CONFIG_BOOTFILE"Image.gz"
 #define LINUXBOOT_CMD  "booti"
+#define KERNEL_ADDR_LOAD   "kernel_addr_load=0x8420\0"
 #define KERNEL_ADDR_R  "kernel_addr_r=0x8008\0"
-#define KERNEL_SIZE"kernel_size=0x00c0\0"
-#define RAMDISK_ADDR   "ramdisk_addr=0x00e0\0"
 #else
 #define CONFIG_BOOTFILE"zImage"
 #define LINUXBOOT_CMD  "bootz"
+#define KERNEL_ADDR_LOAD   "kernel_addr_load=0x80208000\0"
 #define KERNEL_ADDR_R  "kernel_addr_r=0x80208000\0"
-#define KERNEL_SIZE"kernel_size=0x0080\0"
-#define RAMDISK_ADDR   "ramdisk_addr=0x00a0\0"
 #endif
 #define LINUXBOOT_ENV_SETTINGS \
"fdt_addr=0x0010\0" \
"fdt_addr_r=0x8410\0" \
"fdt_size=0x8000\0" \
"kernel_addr=0x0020\0" \
+   KERNEL_ADDR_LOAD \
KERNEL_ADDR_R \
-   KERNEL_SIZE \
-   RAMDISK_ADDR \
+   "kernel_size=0x0080\0" \
+   "ramdisk_addr=0x00a0\0" \
"ramdisk_addr_r=0x84a0\0" \
"ramdisk_size=0x0060\0" \
"ramdisk_file=rootfs.cpio.uboot\0" \
-   "boot_common=setexpr bootm_low $kernel_addr_r '&' fe00 &&" \
+   "boot_common=setexpr bootm_low $kernel_addr_r '&' fe00 && " \
+   "if test $kernel_addr_load = $kernel_addr_r; then " \
+   "true; " \
+   "else " \
+   "unzip $kernel_addr_load $kernel_addr_r; " \
+   "fi && " \
LINUXBOOT_CMD " $kernel_addr_r $ramdisk_addr_r $fdt_addr_r\0" \
-   "norboot=setexpr kernel_addr $nor_base + $kernel_addr &&" \
-   "setexpr kernel_size $kernel_size / 4 &&" \
-   "cp $kernel_addr $kernel_addr_r $kernel_size &&" \
+   "norboot=setexpr kernel_addr_nor $nor_base + $kernel_addr && " \
+   "setexpr kernel_size_div4 $kernel_size / 4 && " \
+   "cp $kernel_addr_nor $kernel_addr_load $kernel_size_div4 && " \
"setexpr ramdisk_addr_r $nor_base + $ramdisk_addr &&" \
"setexpr fdt_addr_r $nor_base + $fdt_addr &&" \
"run boot_common\0" \
-   "nandboot=nand read $kernel_addr_r $kernel_addr $kernel_size &&" \
+   "nandboot=nand read $kernel_addr_load $kernel_addr $kernel_size && " \
"nand read $ramdisk_addr_r $ramdisk_addr $ramdisk_size &&" \
"nand read $fdt_addr_r $fdt_addr $fdt_size &&" \
"run boot_common\0" \
-   "tftpboot=tftpboot $kernel_addr_r $bootfile &&" \
+   "tftpboot=tftpboot $kernel_addr_load $bootfile && " \
"tftpboot $ramdisk_addr_r $ramdisk_file &&" \
"tftpboot $fdt_addr_r $fdt_file &&" \
"run boot_common\0" \
-   "__nfsboot=tftpboot $kernel_addr_r $bootfile &&" \
+   "__nfsboot=tftpboot $kernel_addr_load $bootfile && " \
"tftpboot $fdt_addr_r $fdt_file &&" \
"setenv ramdisk_addr_r - &&" \
"run boot_common\0"
-- 
2.7.4

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


[U-Boot] [PATCH 07/16] ARM: uniphier: refactor cmd_ddrmphy

2017-01-27 Thread Masahiro Yamada
Make it look like cmd_ddrphy.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-uniphier/dram/cmd_ddrmphy.c | 192 +-
 1 file changed, 110 insertions(+), 82 deletions(-)

diff --git a/arch/arm/mach-uniphier/dram/cmd_ddrmphy.c 
b/arch/arm/mach-uniphier/dram/cmd_ddrmphy.c
index 4e66162..5ca0a65 100644
--- a/arch/arm/mach-uniphier/dram/cmd_ddrmphy.c
+++ b/arch/arm/mach-uniphier/dram/cmd_ddrmphy.c
@@ -6,8 +6,9 @@
 
 #include 
 #include 
+#include 
 
-#include "../init.h"
+#include "../soc-info.h"
 #include "ddrmphy-regs.h"
 
 /* Select either decimal or hexadecimal */
@@ -19,24 +20,41 @@
 /* field separator */
 #define FS "   "
 
-static void __iomem *get_phy_base(int ch)
-{
-   return (void __iomem *)(0x5b83 + ch * 0x0020);
-}
-
-static int get_nr_ch(void)
-{
-   const struct uniphier_board_data *bd = uniphier_get_board_param();
-
-   return bd->dram_ch[2].size ? 3 : 2;
-}
-
-static int get_nr_datx8(int ch)
-{
-   const struct uniphier_board_data *bd = uniphier_get_board_param();
-
-   return bd->dram_ch[ch].width / 8;
-}
+#define ptr_to_uint(p) ((unsigned int)(unsigned long)(p))
+
+#define UNIPHIER_MAX_NR_DDRMPHY3
+
+struct uniphier_ddrmphy_param {
+   unsigned int soc_id;
+   unsigned int nr_phy;
+   struct {
+   resource_size_t base;
+   unsigned int nr_zq;
+   unsigned int nr_dx;
+   } phy[UNIPHIER_MAX_NR_DDRMPHY];
+};
+
+static const struct uniphier_ddrmphy_param uniphier_ddrmphy_param[] = {
+   {
+   .soc_id = UNIPHIER_PXS2_ID,
+   .nr_phy = 3,
+   .phy = {
+   { .base = 0x5b83, .nr_zq = 3, .nr_dx = 4, },
+   { .base = 0x5ba3, .nr_zq = 3, .nr_dx = 4, },
+   { .base = 0x5bc3, .nr_zq = 2, .nr_dx = 2, },
+   },
+   },
+   {
+   .soc_id = UNIPHIER_LD6B_ID,
+   .nr_phy = 3,
+   .phy = {
+   { .base = 0x5b83, .nr_zq = 3, .nr_dx = 4, },
+   { .base = 0x5ba3, .nr_zq = 3, .nr_dx = 4, },
+   { .base = 0x5bc3, .nr_zq = 2, .nr_dx = 2, },
+   },
+   },
+};
+UNIPHIER_DEFINE_SOCDATA_FUNC(uniphier_get_ddrmphy_param, 
uniphier_ddrmphy_param)
 
 static void print_bdl(void __iomem *reg, int n)
 {
@@ -47,59 +65,60 @@ static void print_bdl(void __iomem *reg, int n)
printf(FS PRINTF_FORMAT, (val >> i * 8) & 0x1f);
 }
 
-static void dump_loop(void (*callback)(void __iomem *))
+static void dump_loop(const struct uniphier_ddrmphy_param *param,
+ void (*callback)(void __iomem *))
 {
-   int ch, dx, nr_ch, nr_dx;
-   void __iomem *dx_base;
-
-   nr_ch = get_nr_ch();
+   void __iomem *phy_base, *dx_base;
+   int phy, dx;
 
-   for (ch = 0; ch < nr_ch; ch++) {
-   dx_base = get_phy_base(ch) + MPHY_DX_BASE;
-   nr_dx = get_nr_datx8(ch);
+   for (phy = 0; phy < param->nr_phy; phy++) {
+   phy_base = ioremap(param->phy[phy].base, SZ_4K);
+   dx_base = phy_base + MPHY_DX_BASE;
 
-   for (dx = 0; dx < nr_dx; dx++) {
-   printf("CH%dDX%d:", ch, dx);
+   for (dx = 0; dx < param->phy[phy].nr_dx; dx++) {
+   printf("PHY%dDX%d:", phy, dx);
(*callback)(dx_base);
dx_base += MPHY_DX_STRIDE;
printf("\n");
}
+
+   iounmap(phy_base);
}
 }
 
-static void zq_dump(void)
+static void zq_dump(const struct uniphier_ddrmphy_param *param)
 {
-   int ch, zq, nr_ch, nr_zq, i;
-   void __iomem *zq_base;
-   u32 dr, pr;
+   void __iomem *phy_base, *zq_base;
+   u32 val;
+   int phy, zq, i;
 
printf("\n--- Impedance Data ---\n");
-   printf(" ZPD  ZPU  OPD  OPU  ZDV  ODV\n");
+   printf("   ZPD  ZPU  OPD  OPU  ZDV  ODV\n");
 
-   nr_ch = get_nr_ch();
+   for (phy = 0; phy < param->nr_phy; phy++) {
+   phy_base = ioremap(param->phy[phy].base, SZ_4K);
+   zq_base = phy_base + MPHY_ZQ_BASE;
 
-   for (ch = 0; ch < nr_ch; ch++) {
-   zq_base = get_phy_base(ch) + MPHY_ZQ_BASE;
-   nr_zq = 3;
+   for (zq = 0; zq < param->phy[phy].nr_zq; zq++) {
+   printf("PHY%dZQ%d:", phy, zq);
 
-   for (zq = 0; zq < nr_zq; zq++) {
-   printf("CH%dZQ%d:", ch, zq);
-
-   dr = readl(zq_base + MPHY_ZQ_DR);
+   val = readl(zq_base + MPHY_ZQ_DR);
for (i = 0; i < 4; i++) {
-   printf(FS PRINTF_FORMAT, dr & 0x7f);
-   dr >>= 7;
+   printf(FS PRINTF_FORMAT, val & 0x7f);
+

[U-Boot] [PATCH 12/16] ARM: uniphier: change the offset to environment storage area

2017-01-27 Thread Masahiro Yamada
When ARM Trusted Firmware is used, bl1.bin + fip.bin exceeds 512KB,
so the boot image and the current environment area will overlap.
Move the environment storage to 1MB offset.

Signed-off-by: Masahiro Yamada 
---

 include/configs/uniphier.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/configs/uniphier.h b/include/configs/uniphier.h
index 0ffd507..a53d2e3 100644
--- a/include/configs/uniphier.h
+++ b/include/configs/uniphier.h
@@ -80,7 +80,7 @@
 /* #define CONFIG_ENV_IS_NOWHERE */
 /* #define CONFIG_ENV_IS_IN_NAND */
 #define CONFIG_ENV_IS_IN_MMC
-#define CONFIG_ENV_OFFSET  0x8
+#define CONFIG_ENV_OFFSET  0x10
 #define CONFIG_ENV_SIZE0x2000
 /* #define CONFIG_ENV_OFFSET_REDUND(CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE) */
 
-- 
2.7.4

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


[U-Boot] [PATCH 15/16] i2c: uniphier(-f): remove unneeded #include

2017-01-27 Thread Masahiro Yamada
This include is unnecessary for low-level drivers.

Signed-off-by: Masahiro Yamada 
---

 drivers/i2c/i2c-uniphier-f.c | 1 -
 drivers/i2c/i2c-uniphier.c   | 1 -
 2 files changed, 2 deletions(-)

diff --git a/drivers/i2c/i2c-uniphier-f.c b/drivers/i2c/i2c-uniphier-f.c
index 8bfa916..e212c13 100644
--- a/drivers/i2c/i2c-uniphier-f.c
+++ b/drivers/i2c/i2c-uniphier-f.c
@@ -12,7 +12,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
diff --git a/drivers/i2c/i2c-uniphier.c b/drivers/i2c/i2c-uniphier.c
index f391f11..73575e9 100644
--- a/drivers/i2c/i2c-uniphier.c
+++ b/drivers/i2c/i2c-uniphier.c
@@ -12,7 +12,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
-- 
2.7.4

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


[U-Boot] [PATCH 04/16] ARM: uniphier: use gd->bd->bi_dram for memory reserve on LD20 SoC

2017-01-27 Thread Masahiro Yamada
For LD20 SoC, the last 64 byte of each DRAM bank is used for the
dynamic training of DRAM PHY.  The regions must be reserved in DT to
prevent the kernel from using them.  Now gd->bd->bi_dram reflects
the actual memory banks.  Just use it instead of getting access to
the board parameters.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-uniphier/dram_init.c | 13 +++--
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-uniphier/dram_init.c 
b/arch/arm/mach-uniphier/dram_init.c
index 43fe6a5..e55e1f8 100644
--- a/arch/arm/mach-uniphier/dram_init.c
+++ b/arch/arm/mach-uniphier/dram_init.c
@@ -246,22 +246,15 @@ void dram_init_banksize(void)
  */
 int ft_board_setup(void *fdt, bd_t *bd)
 {
-   const struct uniphier_board_data *param;
unsigned long rsv_addr;
const unsigned long rsv_size = 64;
-   int ch, ret;
+   int i, ret;
 
if (uniphier_get_soc_id() != UNIPHIER_LD20_ID)
return 0;
 
-   param = uniphier_get_board_param();
-   if (!param) {
-   printf("failed to get board parameter\n");
-   return -ENODEV;
-   }
-
-   for (ch = 0; ch < param->dram_nr_ch; ch++) {
-   rsv_addr = param->dram_ch[ch].base + param->dram_ch[ch].size;
+   for (i = 0; i < ARRAY_SIZE(gd->bd->bi_dram); i++) {
+   rsv_addr = gd->bd->bi_dram[i].start + gd->bd->bi_dram[i].size;
rsv_addr -= rsv_size;
 
ret = fdt_add_mem_rsv(fdt, rsv_addr, rsv_size);
-- 
2.7.4

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


[U-Boot] [PATCH 13/16] ARM: uniphier: change CONFIG_SPL_PAD_TO to 128KB

2017-01-27 Thread Masahiro Yamada
The Boot ROM supports authentication feature to prevent malformed
software from being run on products.  The signature is added at the
tail of the second stage loader (= SPL in U-boot terminology).

The size of the second stage loader was 64KB, and it was consistent
across SoCs.  The situation changed when LD20 SoC appeared; it loads
80KB second stage loader, and it is the only exception.

Currently, CONFIG_SPL_PAD_TO is set to 64KB and U-Boot proper is
loaded from the 64KB offset of non-volatile devices.  This means the
signature of LD20 SoC (located at 80KB offset) corrupts the U-Boot
proper image.

Let's move the U-Boot proper image to 128KB offset.  It uses 48KB
for nothing but padding, and we could actually locate the U-Boot
proper at 80KB offset.  However, the power of 2 generally seems a
better choice for the offset address.

Signed-off-by: Masahiro Yamada 
---

 common/spl/Kconfig |  3 +--
 include/configs/uniphier.h | 20 +---
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index b1aa148..b2ba492 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -86,9 +86,8 @@ config SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR
depends on SPL && SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
default 0x50 if ARCH_SUNXI
default 0x75 if ARCH_DAVINCI
-   default 0x80 if ARCH_UNIPHIER
default 0x8a if ARCH_MX6
-   default 0x100 if ARCH_ROCKCHIP
+   default 0x100 if ARCH_ROCKCHIP || ARCH_UNIPHIER
default 0x140 if ARCH_MVEBU
default 0x200 if ARCH_SOCFPGA || ARCH_AT91
default 0x300 if ARCH_ZYNQ || ARCH_KEYSTONE || OMAP34XX || OMAP44XX || \
diff --git a/include/configs/uniphier.h b/include/configs/uniphier.h
index a53d2e3..a8a1849 100644
--- a/include/configs/uniphier.h
+++ b/include/configs/uniphier.h
@@ -231,19 +231,19 @@
"nor_base=0x4200\0" \
"sramupdate=setexpr tmp_addr $nor_base + 0x5 &&"\
"tftpboot $tmp_addr u-boot-spl.bin &&"  \
-   "setexpr tmp_addr $nor_base + 0x6 &&"   \
+   "setexpr tmp_addr $nor_base + 0x7 && " \
"tftpboot $tmp_addr u-boot.bin\0"   \
"emmcupdate=mmcsetn &&" \
"mmc partconf $mmc_first_dev 0 1 1 &&"  \
"tftpboot u-boot-spl.bin &&"\
-   "mmc write $loadaddr 0 80 &&"   \
+   "mmc write $loadaddr 0 100 && " \
"tftpboot u-boot.bin &&"\
-   "mmc write $loadaddr 80 780\0"  \
+   "mmc write $loadaddr 100 700\0" \
"nandupdate=nand erase 0 0x0010 &&" \
"tftpboot u-boot-spl.bin &&"\
-   "nand write $loadaddr 0 0x0001 &&"  \
+   "nand write $loadaddr 0 0x0002 && " \
"tftpboot u-boot.bin &&"\
-   "nand write $loadaddr 0x0001 0x000f\0"  \
+   "nand write $loadaddr 0x0002 0x000e\0" \
LINUXBOOT_ENV_SETTINGS
 
 #define CONFIG_SYS_BOOTMAPSZ   0x2000
@@ -283,14 +283,18 @@
 
 #define CONFIG_SPL_BOARD_INIT
 
-#define CONFIG_SYS_NAND_U_BOOT_OFFS0x1
+#define CONFIG_SYS_NAND_U_BOOT_OFFS0x2
 
 /* subtract sizeof(struct image_header) */
-#define CONFIG_SYS_UBOOT_BASE  (0x6 - 0x40)
+#define CONFIG_SYS_UBOOT_BASE  (0x7 - 0x40)
 
 #define CONFIG_SPL_TARGET  "u-boot-with-spl.bin"
 #define CONFIG_SPL_MAX_FOOTPRINT   0x1
+#if defined(CONFIG_ARCH_UNIPHIER_LD20)
+#define CONFIG_SPL_MAX_SIZE0x14000
+#else
 #define CONFIG_SPL_MAX_SIZE0x1
+#endif
 #if defined(CONFIG_ARCH_UNIPHIER_LD11)
 #define CONFIG_SPL_BSS_START_ADDR  0x30012000
 #elif defined(CONFIG_ARCH_UNIPHIER_LD20)
@@ -298,4 +302,6 @@
 #endif
 #define CONFIG_SPL_BSS_MAX_SIZE0x2000
 
+#define CONFIG_SPL_PAD_TO  0x2
+
 #endif /* __CONFIG_UNIPHIER_COMMON_H__ */
-- 
2.7.4

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


[U-Boot] [PATCH 08/16] ARM: uniphier: compile board data only for SPL

2017-01-27 Thread Masahiro Yamada
Now U-Boot proper need not get the uniphier_boards array.  Compile
it only for SPL.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-uniphier/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-uniphier/Makefile b/arch/arm/mach-uniphier/Makefile
index abfdccc..166b41f 100644
--- a/arch/arm/mach-uniphier/Makefile
+++ b/arch/arm/mach-uniphier/Makefile
@@ -4,6 +4,7 @@
 
 ifdef CONFIG_SPL_BUILD
 
+obj-y += boards.o
 obj-y += spl_board_init.o
 obj-y += memconf.o
 obj-y += bcu/
@@ -21,7 +22,6 @@ obj-y += pinctrl-glue.o
 
 endif
 
-obj-y += boards.o
 obj-y += soc-info.o
 obj-y += boot-mode/
 obj-y += clk/
-- 
2.7.4

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


[U-Boot] [PATCH 01/16] clk: uniphier: fix compatible strings for Pro5, PXs2, LD20 SD clock

2017-01-27 Thread Masahiro Yamada
I missed to update them when DT files were resynced with Linux.

Signed-off-by: Masahiro Yamada 
---

 drivers/clk/uniphier/clk-uniphier-core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/clk/uniphier/clk-uniphier-core.c 
b/drivers/clk/uniphier/clk-uniphier-core.c
index 8ad0242..bcb2d2e 100644
--- a/drivers/clk/uniphier/clk-uniphier-core.c
+++ b/drivers/clk/uniphier/clk-uniphier-core.c
@@ -163,11 +163,11 @@ static const struct udevice_id uniphier_clk_match[] = {
.data = (ulong)_mio_clk_data,
},
{
-   .compatible = "socionext,uniphier-pro5-mio-clock",
+   .compatible = "socionext,uniphier-pro5-sd-clock",
.data = (ulong)_mio_clk_data,
},
{
-   .compatible = "socionext,uniphier-pxs2-mio-clock",
+   .compatible = "socionext,uniphier-pxs2-sd-clock",
.data = (ulong)_mio_clk_data,
},
{
@@ -175,7 +175,7 @@ static const struct udevice_id uniphier_clk_match[] = {
.data = (ulong)_mio_clk_data,
},
{
-   .compatible = "socionext,uniphier-ld20-mio-clock",
+   .compatible = "socionext,uniphier-ld20-sd-clock",
.data = (ulong)_mio_clk_data,
},
{ /* sentinel */ }
-- 
2.7.4

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


[U-Boot] [PATCH 14/16] ARM: uniphier: make update commands more flexible for ATF

2017-01-27 Thread Masahiro Yamada
Currently, SPL (u-boot-spl.bin) and U-Boot (u-boot.bin) are stored
in non-volatile devices, and some environments are defined to update
the images easily.

When ARM Trusted Firmware is fully used, SPL is not used.  U-Boot
proper is contained as BL33 into FIP (Firmware Image Package), which
is standard container used by ATF.  Allow to use it.

Signed-off-by: Masahiro Yamada 
---

 include/configs/uniphier.h | 24 ++--
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/include/configs/uniphier.h b/include/configs/uniphier.h
index a8a1849..da7639f 100644
--- a/include/configs/uniphier.h
+++ b/include/configs/uniphier.h
@@ -147,6 +147,17 @@
 
 #define CONFIG_CMDLINE_EDITING /* add command line history */
 
+#if defined(CONFIG_ARM64) && !defined(CONFIG_ARMV8_MULTIENTRY)
+/* ARM Trusted Firmware */
+#define BOOT_IMAGES \
+   "second_image=bl1.bin\0" \
+   "third_image=fip.bin\0"
+#else
+#define BOOT_IMAGES \
+   "second_image=u-boot-spl.bin\0" \
+   "third_image=u-boot.bin\0"
+#endif
+
 #define CONFIG_BOOTCOMMAND "run $bootmode"
 
 #define CONFIG_ROOTPATH"/nfs/root/path"
@@ -230,20 +241,21 @@
"initrd_high=0x\0"  \
"nor_base=0x4200\0" \
"sramupdate=setexpr tmp_addr $nor_base + 0x5 &&"\
-   "tftpboot $tmp_addr u-boot-spl.bin &&"  \
+   "tftpboot $tmp_addr $second_image && " \
"setexpr tmp_addr $nor_base + 0x7 && " \
-   "tftpboot $tmp_addr u-boot.bin\0"   \
+   "tftpboot $tmp_addr $third_image\0" \
"emmcupdate=mmcsetn &&" \
"mmc partconf $mmc_first_dev 0 1 1 &&"  \
-   "tftpboot u-boot-spl.bin &&"\
+   "tftpboot $second_image && " \
"mmc write $loadaddr 0 100 && " \
-   "tftpboot u-boot.bin &&"\
+   "tftpboot $third_image && " \
"mmc write $loadaddr 100 700\0" \
"nandupdate=nand erase 0 0x0010 &&" \
-   "tftpboot u-boot-spl.bin &&"\
+   "tftpboot $second_image && " \
"nand write $loadaddr 0 0x0002 && " \
-   "tftpboot u-boot.bin &&"\
+   "tftpboot $third_image && " \
"nand write $loadaddr 0x0002 0x000e\0" \
+   BOOT_IMAGES \
LINUXBOOT_ENV_SETTINGS
 
 #define CONFIG_SYS_BOOTMAPSZ   0x2000
-- 
2.7.4

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


[U-Boot] [PATCH 00/16] ARM: uniphier: UniPhier SoC updates for v2017.03 (3rd round)

2017-01-27 Thread Masahiro Yamada
  - Fix clk driver
  - Optimize DRAM init code for LD20 SoC
  - Get DRAM information from more reliable source
  - Clean up SoC init code
  - Allow to use Image.gz for booting ARM64 Linux
  - Tidy up environments to use with ATF
  - Clean up I2C drivers



Masahiro Yamada (16):
  clk: uniphier: fix compatible strings for Pro5, PXs2, LD20 SD clock
  ARM: uniphier: shrink arrays of DDR-PHY parameters for LD20 SoC
  ARM: uniphier: detect RAM size by decoding HW register instead of DT
  ARM: uniphier: use gd->bd->bi_dram for memory reserve on LD20 SoC
  ARM: uniphier: refactor cmd_ddrphy
  ARM: uniphier: clean up UMC init for PXs2 SoC
  ARM: uniphier: refactor cmd_ddrmphy
  ARM: uniphier: compile board data only for SPL
  ARM: uniphier: collect SPL CONFIG symbols to the bottom of header
  ARM: uniphier: use Image.gz instead Image for booting ARM64 Linux
  ARM: uniphier: set initrd_high environment to skip initrd relocation
  ARM: uniphier: change the offset to environment storage area
  ARM: uniphier: change CONFIG_SPL_PAD_TO to 128KB
  ARM: uniphier: make update commands more flexible for ATF
  i2c: uniphier(-f): remove unneeded #include 
  i2c: uniphier-f: use readl_poll_timeout() to poll registers

 arch/arm/mach-uniphier/Makefile|   2 +-
 arch/arm/mach-uniphier/dram/cmd_ddrmphy.c  | 234 ++---
 arch/arm/mach-uniphier/dram/cmd_ddrphy.c   | 156 +
 arch/arm/mach-uniphier/dram/ddrmphy-regs.h | 262 ++--
 arch/arm/mach-uniphier/dram/umc-ld20.c | 254 +---
 arch/arm/mach-uniphier/dram/umc-pxs2.c | 253 +--
 arch/arm/mach-uniphier/dram_init.c | 263 ++---
 arch/arm/mach-uniphier/init.h  |   1 +
 common/spl/Kconfig |   3 +-
 drivers/clk/uniphier/clk-uniphier-core.c   |   6 +-
 drivers/i2c/i2c-uniphier-f.c   |  35 ++--
 drivers/i2c/i2c-uniphier.c |   1 -
 include/configs/uniphier.h | 104 
 13 files changed, 839 insertions(+), 735 deletions(-)

-- 
2.7.4

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


[U-Boot] [PATCH 02/16] ARM: uniphier: shrink arrays of DDR-PHY parameters for LD20 SoC

2017-01-27 Thread Masahiro Yamada
The two arrays ddrphy_{op,ip}_dq_shift_val, occupy more than 3.8 KB
memory footprint, which is significant in SPL.

There are PHY parameters for 5 boards, but they are actually not
board specific, but SoC specific.  After all, we just need to have
2 patterns, for LD20 and LD21.  Also, the shift values are small
enough to become "short" type instead of "int".  This change will
save about 3 KB memory footprint.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-uniphier/dram/umc-ld20.c | 254 ++---
 1 file changed, 79 insertions(+), 175 deletions(-)

diff --git a/arch/arm/mach-uniphier/dram/umc-ld20.c 
b/arch/arm/mach-uniphier/dram/umc-ld20.c
index 61f62ae..157b915 100644
--- a/arch/arm/mach-uniphier/dram/umc-ld20.c
+++ b/arch/arm/mach-uniphier/dram/umc-ld20.c
@@ -1,7 +1,7 @@
 /*
- * Copyright (C) 2016 Socionext Inc.
+ * Copyright (C) 2016-2017 Socionext Inc.
  *
- * based on commit 1f6feb76e7f9753f51955444e422486521f9b3a3 of Diag
+ * based on commit e732175d0b0dbc2a3855cb8ac791c538666b6fd4 of Diag
  *
  * SPDX-License-Identifier:GPL-2.0+
  */
@@ -77,191 +77,95 @@ static const u32 ddrphy_scl_gate_timing[DRAM_CH_NR] = {
0x0140, 0x0180, 0x0140
 };
 
-static const int ddrphy_op_dq_shift_val[DRAM_BOARD_NR][DRAM_CH_NR][32] = {
-   { /* LD20 reference */
-   {
-   2, 1, 0, 1, 2, 1, 1, 1,
-   2, 1, 1, 2, 1, 1, 1, 1,
-   1, 2, 1, 1, 1, 2, 1, 1,
-   2, 2, 0, 1, 1, 2, 2, 1,
-   },
-   {
-   1, 1, 0, 1, 2, 2, 1, 1,
-   1, 1, 1, 1, 1, 1, 1, 1,
-   1, 1, 0, 0, 1, 1, 0, 0,
-   0, 1, 1, 1, 2, 1, 2, 1,
-   },
-   {
-   2, 2, 0, 2, 1, 1, 2, 1,
-   1, 1, 0, 1, 1, -1, 1, 1,
-   2, 2, 2, 2, 1, 1, 1, 1,
-   1, 1, 1, 0, 2, 2, 1, 2,
-   },
+static const short ddrphy_op_dq_shift_val_ld20[DRAM_CH_NR][32] = {
+   {
+   2, 1, 0, 1, 2, 1, 1, 1,
+   2, 1, 1, 2, 1, 1, 1, 1,
+   1, 2, 1, 1, 1, 2, 1, 1,
+   2, 2, 0, 1, 1, 2, 2, 1,
},
-   { /* LD20 TV */
-   {
-   2, 1, 0, 1, 2, 1, 1, 1,
-   2, 1, 1, 2, 1, 1, 1, 1,
-   1, 2, 1, 1, 1, 2, 1, 1,
-   2, 2, 0, 1, 1, 2, 2, 1,
-   },
-   {
-   1, 1, 0, 1, 2, 2, 1, 1,
-   1, 1, 1, 1, 1, 1, 1, 1,
-   1, 1, 0, 0, 1, 1, 0, 0,
-   0, 1, 1, 1, 2, 1, 2, 1,
-   },
-   {
-   2, 2, 0, 2, 1, 1, 2, 1,
-   1, 1, 0, 1, 1, -1, 1, 1,
-   2, 2, 2, 2, 1, 1, 1, 1,
-   1, 1, 1, 0, 2, 2, 1, 2,
-   },
+   {
+   1, 1, 0, 1, 2, 2, 1, 1,
+   1, 1, 1, 1, 1, 1, 1, 1,
+   1, 1, 0, 0, 1, 1, 0, 0,
+   0, 1, 1, 1, 2, 1, 2, 1,
},
-   { /* LD20 TV C1 */
-   {
-   2, 1, 0, 1, 2, 1, 1, 1,
-   2, 1, 1, 2, 1, 1, 1, 1,
-   1, 2, 1, 1, 1, 2, 1, 1,
-   2, 2, 0, 1, 1, 2, 2, 1,
-   },
-   {
-   1, 1, 0, 1, 2, 2, 1, 1,
-   1, 1, 1, 1, 1, 1, 1, 1,
-   1, 1, 0, 0, 1, 1, 0, 0,
-   0, 1, 1, 1, 2, 1, 2, 1,
-   },
-   {
-   2, 2, 0, 2, 1, 1, 2, 1,
-   1, 1, 0, 1, 1, -1, 1, 1,
-   2, 2, 2, 2, 1, 1, 1, 1,
-   1, 1, 1, 0, 2, 2, 1, 2,
-   },
+   {
+   2, 2, 0, 2, 1, 1, 2, 1,
+   1, 1, 0, 1, 1, -1, 1, 1,
+   2, 2, 2, 2, 1, 1, 1, 1,
+   1, 1, 1, 0, 2, 2, 1, 2,
},
-   { /* LD21 reference */
-   {
-   1, 1, 0, 1, 1, 1, 1, 1,
-   1, 0, 0, 0, 1, 1, 0, 2,
-   1, 1, 0, 0, 1, 1, 1, 1,
-   1, 0, 0, 0, 1, 0, 0, 1,
-   },
-   {   1, 0, 2, 1, 1, 1, 1, 0,
-   1, 0, 0, 1, 0, 1, 0, 0,
-   1, 0, 1, 0, 1, 1, 1, 0,
-   1, 1, 1, 1, 0, 1, 0, 0,
-   },
-   /* No CH2 */
+};
+
+static const short ddrphy_op_dq_shift_val_ld21[DRAM_CH_NR][32] = {
+   {
+   1, 1, 0, 1, 1, 1, 1, 1,
+   1, 0, 0, 0, 1, 1, 0, 2,
+   1, 1, 0, 0, 1, 1, 1, 1,
+   1, 0, 0, 0, 1, 0, 0, 1,
},
-   { /* LD21 TV */
-   {
-   1, 1, 0, 1, 1, 1, 1, 1,
-   1, 0, 0, 0, 1, 1, 0, 2,
-   

Re: [U-Boot] [PATCH 1/2] Enable ROCKCHIP_SPL_BACK_TO_BROM for firefly-rk3288 board

2017-01-27 Thread Simon Glass
Hi Romain,

On 21 January 2017 at 00:51, Romain Perier  wrote:
> Hi,
>
>
> Le 21/01/2017 à 04:51, Simon Glass a écrit :
>> On 17 January 2017 at 02:32, Romain Perier  
>> wrote:
>>> Like the rock2, this board has been tested with back to brom feature.
>>> This commits adjusts environment offset regarding if back_to_brom is
>>> enabled or not and uses this feature by default.
>>>
>>> Signed-off-by: Romain Perier 
>>> ---
>>>  configs/firefly-rk3288_defconfig | 2 ++
>>>  include/configs/firefly-rk3288.h | 9 +
>>>  2 files changed, 11 insertions(+)
>> We need at least one board that does not use this option. Also,
>> doesn't this mean that we need to change how the image is written to
>> the board?
>>
>> Should we use binman to create a suitable image?
>>
>> Regards,
>> Simon
> Why do you want at least one board without this option ? for testing
> that it's still working without back_to_brom ? That's weird because all
> rk3288-based board has the same limitations regarding the SPL, no ?

Yes, but remember this is a non-standard booting mechanism, and one
that I hope we can move away from in future. Also firefly does not
*need* this mechanism. If we don't have one board that uses the
standard mechanism then it might stop working.

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


Re: [U-Boot] [PATCH] Revert "armv8: release slave cores from CPU_RELEASE_ADDR"

2017-01-27 Thread Simon Glass
On 20 January 2017 at 02:30, Masahiro Yamada
 wrote:
>
> This reverts commit 8c36e99f211104fd7dcbf0669a35a47ce5e154f5.
>
> There is misunderstanding in commit 8c36e99f2111 ("armv8: release
> slave cores from CPU_RELEASE_ADDR").  How to bring the slave cores
> into U-Boot proper is platform-specific.  So, it should be cared
> in SoC/board files instead of common/spl/spl.c.  As you see SPL
> is the acronym of Secondary Program Loader, there is generally
> something that runs before SPL (the First one is usually Boot ROM).
>
> How to wake up slave cores from the Boot ROM is really SoC specific.
> So, the intention for the spin table support is to bring the slave
> cores into U-Boot proper in an SoC specific manner.  (this must be
> done after relocation.  see below.)
>
> If you bring the slaves into SPL, it is SoC own code responsibility
> to transfer them to U-Boot proper.  The Spin Table defines the
> interface between a boot-loader and Linux kernel.  It is unrelated
> to the interface between SPL and U-Boot proper.
>
> One more thing is missing in the commit; spl_image->entry_point
> points to the entry address of U-Boot *before* relocation.  U-Boot
> relocates itself between board_init_f() and board_init_r().  This
> means the master CPU sees the different copy of the spin code than
> the slave CPUs enter.  The spin_table_update_dt() protects the code
> *after* relocation.  As a result, the slave CPUs spin in unprotected
> code, which leads to unstable behavior.
>
> Signed-off-by: Masahiro Yamada 
> ---
>
>  common/spl/spl.c | 8 
>  1 file changed, 8 deletions(-)

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


Re: [U-Boot] [RFC PATCH 00/11] extend FIT loading support (plus Pine64/ATF support)

2017-01-27 Thread Simon Glass
Hi Andre,

On 19 January 2017 at 18:53, Andre Przywara  wrote:
> Currently the FIT format is not used to its full potential in the SPL:
> It only loads the first image from the /images node and appends the
> proper FDT.
> Some boards and platforms would benefit from loading more images before
> starting U-Boot proper, notably Allwinner A64 and ARMv8 Rockchip boards,
> which use an ARM Trusted Firmware (ATF) image to be executed before U-Boot.
>
> This series tries to solve this in a board agnostic and generic way:
> We extend the SPL FIT loading scheme to allow loading multiple images.
> So apart from loading the image which is referenced by the "firmware"
> property in the respective configuration node and placing the DTB right
> behind it, we iterate over all strings in the "loadable" property.
> Each image referenced there will be loaded to its specified load address.
> The entry point U-Boot eventually branches to will be taken from the
> first image to explicitly provide the "entry" property, or, if none
> of them does so, from the load address of the "firmware" image.
> This keeps the scheme compatible with the FIT images our Makefile creates
> automatically at the moment.
>
> Apart from the already mentioned ATF scenario this opens up more usage
> scenarios, of which the commit message of patch 04/11 lists some.
>
> The first three patches rework the SPL FIT support to be more flexible
> and to allow easier usage in the fourth patch, which introduces the
> multiple-image loading facility.
> The remaining patches enable that support for the Pine64 board to make
> its SPL support finally useful and to demonstrate usage of this scheme:
> patches 5-7 extend the usable SPL size by about 4 KB to allow AArch64
> compilation of the SPL with FIT support enabled. Patch 8 implements the
> board selector routine, which selects either the Pine64 or Pine64+ DTB
> depending on the detected DRAM size. Patch 9 enables SPL FIT support in
> the Pine64 defconfig.
> To demonstrate the usage, patch 10 provides a FIT source file, which
> loads and executes ATF before the U-Boot proper. Users are expected to
> compile this with "mkimage -f boards/sunxi/pine64_atf.its -E pine64.itb",
> then write the resulting file behind the SPL on an SD card (or any other
> U-Boot supported boot media, for that matter).
> Patch 11 then adds FIT support to the sunxi SPL SPI loading routine,
> which allows to load ATF on boards with SPI flash as well.
>
> Questions:
> 1) Is this scheme the right one (usage of "firmware" and "loadables",
>determination of entry point)? Shall we make use of the "setup"
>property?

Seems reasonable to me.

> 2) Shall we extend mkimage to allow supplying "loadable" files on the
>command line, which would allow to build the .itb file automatically?

Yes.

> 3) Is providing the .its source file for a (family of) boards the right
>way?

Where needed (i.e. the mkimage command line is not trivial)

> 4) Does this break any boards which already use SPL FIT loading?

Probably not, but I'm sure it would be spotted if so.

>
> And for the Pine64 part:
> 5) Is extending the usable SPL size like in patch 5-7 acceptable?
>
> I have a more generic solution for the .dtb selection in mind: Based on
> some patch from Siarhei we store the .dtb filename in the SPL header and
> select the .dtb from the FIT image by simply matching the name. This would
> allow _one_ build supporting multiple boards. The actual board name would
> need to written into the SPL header or could be copied from there when
> updating the image.
> I can provide the patches once we agreed upon this series.
>
> Please let me know what you think!

I think it is a nice piece of work. You might want to make the new
feature optional if it saves code space.

FIT is preferable to a raw binary image. There is also binman which
can create binary images with things placed as you wish, but it's best
to use FIT where you can.

A few more things:

- Can you make sure that your new node structure is clearly documented
(with an example) in doc/uImage.FIT/ ?
- Can you add a pytest for sandbox_spl, which verifies that everything
is loaded correctly? As an alternative I suppose you could adjust
test-fit.py (which should move to pytest)

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


Re: [U-Boot] [RFC PATCH 02/11] SPL: FIT: rework U-Boot image loading

2017-01-27 Thread Simon Glass
On 19 January 2017 at 18:53, Andre Przywara  wrote:
> Currently the SPL FIT loader always looks only for the first image in
> the /images node a FIT tree, which it loads and later executes.
>
> Generalize this by looking for a "firmware" property in the matched
> configuration subnode, or, if that does not exist, for the first string
> in the "loadables" property. Then using the string in that property,
> load the image of that name from the /images node.
> This still loads only one image at the moment, but refactors the code to
> allow extending this in a following patch.
> To simplify later re-usage, we also generalize the spl_fit_select_index()
> function to not return the image location, but just the node offset.
>
> Signed-off-by: Andre Przywara 
> ---
>  common/spl/spl_fit.c | 34 --
>  1 file changed, 20 insertions(+), 14 deletions(-)

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


Re: [U-Boot] [RFC PATCH 01/11] SPL: FIT: refactor FDT loading

2017-01-27 Thread Simon Glass
Hi Andre,

On 19 January 2017 at 18:53, Andre Przywara  wrote:
>
> Currently the SPL FIT loader uses the spl_fit_select_fdt() function to
> find the offset to the right DTB within the FIT image.
> For this it iterates over all subnodes of the /configuration node in
> the FIT tree and compares all "description" strings therein using a
> board specific matching function.
> If that finds a match, it uses the string in the "fdt" property of that
> subnode to locate the matching subnode in the /images node, which points
> to the DTB data.
> Now this works very well, but is quite specific to cover this particular
> use case. To open up the door for a more generic usage, let's split this
> function into:
> 1) a function that just returns the node offset for the matching
>configuration node (spl_fit_find_config_node())
> 2) a function that returns the image data any given property in a given
>configuration node points to, additionally using a given index into
>a possbile list of strings (spl_fit_select_index())
> This allows us to replace the specific function above by asking for the
> image the _first string of the "fdt" property_ in the matching
> configuration subnode points to.
>
> This patch introduces no functional changes, it just refactors the code
> to allow reusing it later.
>
> (diff is overly clever here and produces a hard-to-read patch, so I
> recommend to throw a look at the result instead).
>
> Signed-off-by: Andre Przywara 
> ---
>  common/spl/spl_fit.c | 82 
> 
>  1 file changed, 51 insertions(+), 31 deletions(-)
>

Reviewed-by: Simon Glass 

Please check below.

> diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
> index aae556f..c4e2f02 100644
> --- a/common/spl/spl_fit.c
> +++ b/common/spl/spl_fit.c
> @@ -22,13 +22,11 @@ static ulong fdt_getprop_u32(const void *fdt, int node, 
> const char *prop)
> return fdt32_to_cpu(*cell);
>  }
>
> -static int spl_fit_select_fdt(const void *fdt, int images, int *fdt_offsetp)
> +static int spl_fit_find_config_node(const void *fdt)
>  {
> -   const char *name, *fdt_name;
> -   int conf, node, fdt_node;
> -   int len;
> +   const char *name;
> +   int conf, node, len;
>
> -   *fdt_offsetp = 0;
> conf = fdt_path_offset(fdt, FIT_CONFS_PATH);
> if (conf < 0) {
> debug("%s: Cannot find /configurations node: %d\n", __func__,
> @@ -50,39 +48,60 @@ static int spl_fit_select_fdt(const void *fdt, int 
> images, int *fdt_offsetp)
> continue;
>
> debug("Selecting config '%s'", name);
> -   fdt_name = fdt_getprop(fdt, node, FIT_FDT_PROP, );
> -   if (!fdt_name) {
> -   debug("%s: Cannot find fdt name property: %d\n",
> - __func__, len);
> -   return -EINVAL;
> -   }
>
> -   debug(", fdt '%s'\n", fdt_name);
> -   fdt_node = fdt_subnode_offset(fdt, images, fdt_name);
> -   if (fdt_node < 0) {
> -   debug("%s: Cannot find fdt node '%s': %d\n",
> - __func__, fdt_name, fdt_node);
> -   return -EINVAL;
> +   return node;
> +   }
> +
> +   return -1;
> +}
> +
> +static int spl_fit_select_index(const void *fit, int images, int *offsetp,
> +   const char *type, int index)
> +{
> +   const char *name, *img_name;
> +   int node, conf_node;
> +   int len, i;
> +
> +   *offsetp = 0;
> +   conf_node = spl_fit_find_config_node(fit);
> +   if (conf_node < 0) {
> +#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
> +   printf("No matching DT out of these options:\n");
> +   for (node = fdt_first_subnode(fit, conf_node);
> +node >= 0;
> +node = fdt_next_subnode(fit, node)) {
> +   name = fdt_getprop(fit, node, "description", );
> +   printf("   %s\n", name);
> }
> +#endif
> +   return -ENOENT;
> +   }
>
> -   *fdt_offsetp = fdt_getprop_u32(fdt, fdt_node, "data-offset");
> -   len = fdt_getprop_u32(fdt, fdt_node, "data-size");
> -   debug("FIT: Selected '%s'\n", name);
> +   img_name = fdt_getprop(fit, conf_node, type, );
> +   if (!img_name) {
> +   debug("cannot find property '%s': %d\n", type, len);
> +   return -EINVAL;
> +   }
>
> -   return len;
> +   for (i = 0; i < index; i++) {
> +   img_name = strchr(img_name, '\0') + 1;

Don't you need to check against strchr() returning NULL?

> +   if (*img_name == '\0') {
> +   debug("no string for index %d\n", index);
> +   return -E2BIG;
> +   }
>  

Re: [U-Boot] [PATCH] net: designware: fix for use with current Linux device tree for Meson GX

2017-01-27 Thread Joe Hershberger
On Fri, Jan 27, 2017 at 2:25 PM, Heiner Kallweit  wrote:
> In Uboot for Meson GX the compatible string in meson-gxbb.dtsi so far is:
> compatible = "amlogic,meson6-dwmac", "snps,dwmac";
>
> On Linux in the same dt file it's
> compatible = "amlogic,meson-gx-dwmac", "amlogic,meson-gxbb-dwmac", 
> "snps,dwmac";
>
> To avoid breaking ethernet with the next DT synch from Linux to Uboot
> (planned as prerequisite for adding Meson GX MMC driver to Uboot) add
> "amlogic,meson-gx-dwmac" to the compatibility list in the designware
> driver.
>
> Signed-off-by: Heiner Kallweit 

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


[U-Boot] [PATCH v3 2/3] mmc: meson: add MMC driver for Meson GX (S905)

2017-01-27 Thread Heiner Kallweit
This driver implements MMC support on Meson GX (S905) based systems.
It's based on Carlo Caione's work, changes:
- BLK support added
- general refactoring

Signed-off-by: Carlo Caione 
Signed-off-by: Andreas Färber 
Signed-off-by: Heiner Kallweit 
---
v2:
- addressed review comments
- general refactoring
v3:
- remove config symbol MMC_MESON_GX_SD_PORT
---
 arch/arm/include/asm/arch-meson/sd_emmc.h |  89 +
 drivers/mmc/Kconfig   |   6 +
 drivers/mmc/Makefile  |   1 +
 drivers/mmc/meson_gx_mmc.c| 291 ++
 include/configs/meson-gxbb-common.h   |   4 +
 5 files changed, 391 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-meson/sd_emmc.h
 create mode 100644 drivers/mmc/meson_gx_mmc.c

diff --git a/arch/arm/include/asm/arch-meson/sd_emmc.h 
b/arch/arm/include/asm/arch-meson/sd_emmc.h
new file mode 100644
index 000..25dbf60
--- /dev/null
+++ b/arch/arm/include/asm/arch-meson/sd_emmc.h
@@ -0,0 +1,89 @@
+/*
+ * (C) Copyright 2017 Carlo Caione 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef __SD_EMMC_H__
+#define __SD_EMMC_H__
+
+#include 
+
+#define SDIO_PORT_A0
+#define SDIO_PORT_B1
+#define SDIO_PORT_C2
+
+#define SD_EMMC_CLKSRC_24M 2400/* 24 MHz */
+#define SD_EMMC_CLKSRC_DIV210  /* 1 GHz */
+
+#define MESON_SD_EMMC_CLOCK0x00
+#define   CLK_MAX_DIV  63
+#define   CLK_SRC_24M  (0 << 6)
+#define   CLK_SRC_DIV2 (1 << 6)
+#define   CLK_CO_PHASE_000 (0 << 8)
+#define   CLK_CO_PHASE_090 (1 << 8)
+#define   CLK_CO_PHASE_180 (2 << 8)
+#define   CLK_CO_PHASE_270 (3 << 8)
+#define   CLK_TX_PHASE_000 (0 << 10)
+#define   CLK_TX_PHASE_090 (1 << 10)
+#define   CLK_TX_PHASE_180 (2 << 10)
+#define   CLK_TX_PHASE_270 (3 << 10)
+#define   CLK_ALWAYS_ONBIT(24)
+
+#define MESON_SD_EMMC_CFG  0x44
+#define   CFG_BUS_WIDTH_MASK   GENMASK(1, 0)
+#define   CFG_BUS_WIDTH_1  0
+#define   CFG_BUS_WIDTH_4  1
+#define   CFG_BUS_WIDTH_8  2
+#define   CFG_BL_LEN_MASK  GENMASK(7, 4)
+#define   CFG_BL_LEN_SHIFT 4
+#define   CFG_BL_LEN_512   (9 << 4)
+#define   CFG_RESP_TIMEOUT_MASKGENMASK(11, 8)
+#define   CFG_RESP_TIMEOUT_256 (8 << 8)
+#define   CFG_RC_CC_MASK   GENMASK(15, 12)
+#define   CFG_RC_CC_16 (4 << 12)
+#define   CFG_SDCLK_ALWAYS_ON  BIT(18)
+#define   CFG_AUTO_CLK BIT(23)
+
+#define MESON_SD_EMMC_STATUS   0x48
+#define   STATUS_MASK  GENMASK(15, 0)
+#define   STATUS_ERR_MASK  GENMASK(12, 0)
+#define   STATUS_RXD_ERR_MASK  GENMASK(7, 0)
+#define   STATUS_TXD_ERR   BIT(8)
+#define   STATUS_DESC_ERR  BIT(9)
+#define   STATUS_RESP_ERR  BIT(10)
+#define   STATUS_RESP_TIMEOUT  BIT(11)
+#define   STATUS_DESC_TIMEOUT  BIT(12)
+#define   STATUS_END_OF_CHAIN  BIT(13)
+
+#define MESON_SD_EMMC_IRQ_EN   0x4c
+
+#define MESON_SD_EMMC_CMD_CFG  0x50
+#define   CMD_CFG_LENGTH_MASK  GENMASK(8, 0)
+#define   CMD_CFG_BLOCK_MODE   BIT(9)
+#define   CMD_CFG_R1B  BIT(10)
+#define   CMD_CFG_END_OF_CHAIN BIT(11)
+#define   CMD_CFG_TIMEOUT_4S   (12 << 12)
+#define   CMD_CFG_NO_RESP  BIT(16)
+#define   CMD_CFG_DATA_IO  BIT(18)
+#define   CMD_CFG_DATA_WR  BIT(19)
+#define   CMD_CFG_RESP_NOCRC   BIT(20)
+#define   CMD_CFG_RESP_128 BIT(21)
+#define   CMD_CFG_CMD_INDEX_SHIFT  24
+#define   CMD_CFG_OWNERBIT(31)
+
+#define MESON_SD_EMMC_CMD_ARG  0x54
+#define MESON_SD_EMMC_CMD_DAT  0x58
+#define MESON_SD_EMMC_CMD_RSP  0x5c
+#define MESON_SD_EMMC_CMD_RSP1 0x60
+#define MESON_SD_EMMC_CMD_RSP2 0x64
+#define MESON_SD_EMMC_CMD_RSP3 0x68
+
+struct meson_mmc_platdata {
+   struct mmc_config cfg;
+   struct mmc mmc;
+   void *regbase;
+   void *w_buf;
+};
+
+#endif
diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig
index 147e52d..ffae684 100644
--- a/drivers/mmc/Kconfig
+++ b/drivers/mmc/Kconfig
@@ -168,6 +168,12 @@ config ZYNQ_SDHCI
help
  Support for Arasan SDHCI host controller on Zynq/ZynqMP ARM SoCs 
platform
 
+config MMC_MESON_GX
+   bool "Meson GX EMMC controller support"
+   depends on DM_MMC && BLK && DM_MMC_OPS && ARCH_MESON
+   help
+ Support for EMMC host controller on Meson GX ARM SoCs platform (S905)
+
 config ROCKCHIP_SDHCI
bool "Arasan SDHCI controller 

[U-Boot] [PATCH v3 3/3] odroid-c2: enable new Meson GX MMC driver in board defconfig

2017-01-27 Thread Heiner Kallweit
Enable new Meson GX MMC driver in Odroid C2 defconfig.

Signed-off-by: Heiner Kallweit 
---
v2:
- move GXBB_PINMUX definition from patch 3 to this one
v3:
- remove pinmux configuration in board init and use
  pinctrl driver instead
---
 configs/odroid-c2_defconfig | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/configs/odroid-c2_defconfig b/configs/odroid-c2_defconfig
index 119ab07..824dd6c 100644
--- a/configs/odroid-c2_defconfig
+++ b/configs/odroid-c2_defconfig
@@ -3,7 +3,9 @@ CONFIG_ARCH_MESON=y
 CONFIG_MESON_GXBB=y
 CONFIG_TARGET_ODROID_C2=y
 CONFIG_IDENT_STRING=" odroid-c2"
-# CONFIG_MMC is not set
+CONFIG_MMC=y
+CONFIG_DM_MMC=y
+CONFIG_MMC_MESON_GX=y
 CONFIG_DEFAULT_DEVICE_TREE="meson-gxbb-odroidc2"
 # CONFIG_DISPLAY_CPUINFO is not set
 # CONFIG_DISPLAY_BOARDINFO is not set
@@ -14,6 +16,7 @@ CONFIG_HUSH_PARSER=y
 # CONFIG_CMD_LOADS is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_MMC=y
 CONFIG_OF_CONTROL=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM_ETH=y
-- 
2.11.0


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


[U-Boot] [PATCH v3 1/3] mmc: meson: update Meson GXBB / Odroid-C2 DT with latest Linux version

2017-01-27 Thread Heiner Kallweit
As a prerequisite for adding a Meson GX MMC driver update the
Meson GXBB / Odroid-C2 device tree in Uboot with the latest
version from Linux.

Signed-off-by: Heiner Kallweit 
---
 arch/arm/dts/meson-gx.dtsi  | 447 
 arch/arm/dts/meson-gxbb-odroidc2.dts| 147 ++-
 arch/arm/dts/meson-gxbb.dtsi| 718 
 include/dt-bindings/clock/gxbb-aoclkc.h |  66 +++
 include/dt-bindings/clock/gxbb-clkc.h   |  34 ++
 include/dt-bindings/reset/gxbb-aoclkc.h |  66 +++
 6 files changed, 1203 insertions(+), 275 deletions(-)
 create mode 100644 arch/arm/dts/meson-gx.dtsi
 create mode 100644 include/dt-bindings/clock/gxbb-aoclkc.h
 create mode 100644 include/dt-bindings/clock/gxbb-clkc.h
 create mode 100644 include/dt-bindings/reset/gxbb-aoclkc.h

diff --git a/arch/arm/dts/meson-gx.dtsi b/arch/arm/dts/meson-gx.dtsi
new file mode 100644
index 000..c129100
--- /dev/null
+++ b/arch/arm/dts/meson-gx.dtsi
@@ -0,0 +1,447 @@
+/*
+ * Copyright (c) 2016 Andreas Färber
+ *
+ * Copyright (c) 2016 BayLibre, SAS.
+ * Author: Neil Armstrong 
+ *
+ * Copyright (c) 2016 Endless Computers, Inc.
+ * Author: Carlo Caione 
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This library 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.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include 
+#include 
+#include 
+
+/ {
+   interrupt-parent = <>;
+   #address-cells = <2>;
+   #size-cells = <2>;
+
+   reserved-memory {
+   #address-cells = <2>;
+   #size-cells = <2>;
+   ranges;
+
+   /* 16 MiB reserved for Hardware ROM Firmware */
+   hwrom_reserved: hwrom@0 {
+   reg = <0x0 0x0 0x0 0x100>;
+   no-map;
+   };
+
+   /* 2 MiB reserved for ARM Trusted Firmware (BL31) */
+   secmon_reserved: secmon@1000 {
+   reg = <0x0 0x1000 0x0 0x20>;
+   no-map;
+   };
+   };
+
+   cpus {
+   #address-cells = <0x2>;
+   #size-cells = <0x0>;
+
+   cpu0: cpu@0 {
+   device_type = "cpu";
+   compatible = "arm,cortex-a53", "arm,armv8";
+   reg = <0x0 0x0>;
+   enable-method = "psci";
+   next-level-cache = <>;
+   clocks = <_dvfs 0>;
+   };
+
+   cpu1: cpu@1 {
+   device_type = "cpu";
+   compatible = "arm,cortex-a53", "arm,armv8";
+   reg = <0x0 0x1>;
+   enable-method = "psci";
+   next-level-cache = <>;
+   clocks = <_dvfs 0>;
+   };
+
+   cpu2: cpu@2 {
+   device_type = "cpu";
+   compatible = "arm,cortex-a53", "arm,armv8";
+   reg = <0x0 0x2>;
+   enable-method = "psci";
+   next-level-cache 

Re: [U-Boot] [PATCH 2/2][v3] armv8: ls1012a: Add support of PPA

2017-01-27 Thread york sun
On 01/26/2017 08:09 PM, Prabhakar Kushwaha wrote:
> The PPA implements PSCI which requires for power managment.
>
> Added support of PPA for LS1012AQDS, LS1012ARDB and LS1012AFRDM.
>
> Signed-off-by: Hou Zhiqiang 
> Signed-off-by: Abhimanyu Saini 
> Signed-off-by: Prabhakar Kushwaha 
> ---
> Changes for v2: Enabled FSL_LS_PPA
> Changes for v3: Rebased and updated as per latest PPA code
>
>  board/freescale/ls1012afrdm/ls1012afrdm.c | 6 ++
>  board/freescale/ls1012aqds/ls1012aqds.c   | 7 +++
>  board/freescale/ls1012ardb/ls1012ardb.c   | 6 ++
>  configs/ls1012afrdm_qspi_defconfig| 1 +
>  configs/ls1012aqds_qspi_defconfig | 1 +
>  configs/ls1012ardb_qspi_defconfig | 1 +
>  6 files changed, 22 insertions(+)
>
> diff --git a/board/freescale/ls1012afrdm/ls1012afrdm.c 
> b/board/freescale/ls1012afrdm/ls1012afrdm.c
> index c2432c3..789cae2 100644
> --- a/board/freescale/ls1012afrdm/ls1012afrdm.c
> +++ b/board/freescale/ls1012afrdm/ls1012afrdm.c
> @@ -9,6 +9,9 @@
>  #include 
>  #include 
>  #include 
> +#ifdef CONFIG_FSL_LS_PPA
> +#include 
> +#endif

Do you really need #ifdef here?

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


Re: [U-Boot] [PATCH v5 6/9] kbuild: add include linux/kconfig.h in config.h

2017-01-27 Thread Masahiro Yamada
2017-01-27 19:00 GMT+09:00 Patrick Delaunay :
> From: Patrick Delaunay 
>
> Allow to use define CONFIG_IS_ENABLED
> in include/config_fallbacks.h
>
> Signed-off-by: Patrick Delaunay 
> Signed-off-by: Patrick Delaunay 

This patch is unneeded.

include/linux/kconfig.h is forcibly included
from all source files.

See

UBOOTINCLUDE:= \
-Iinclude \
$(if $(KBUILD_SRC), -I$(srctree)/include) \
-I$(srctree)/arch/$(ARCH)/include \
-include $(srctree)/include/linux/kconfig.h






>
> Changes in v5: None
> Changes in v4: None
> Changes in v3: None
> Changes in v2: None
>
>  scripts/Makefile.autoconf | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/scripts/Makefile.autoconf b/scripts/Makefile.autoconf
> index 2f85eb9..2a967ff 100644
> --- a/scripts/Makefile.autoconf
> +++ b/scripts/Makefile.autoconf
> @@ -110,6 +110,7 @@ define filechk_config_h
> echo \#include \;  \
> echo \#include \; \
> echo \#include \;\
> +   echo \#include \; \
> echo \#include \;)
>  endef
>
> --
> 1.9.1
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot



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


[U-Boot] [PATCH] net: designware: fix for use with current Linux device tree for Meson GX

2017-01-27 Thread Heiner Kallweit
In Uboot for Meson GX the compatible string in meson-gxbb.dtsi so far is:
compatible = "amlogic,meson6-dwmac", "snps,dwmac";

On Linux in the same dt file it's
compatible = "amlogic,meson-gx-dwmac", "amlogic,meson-gxbb-dwmac", "snps,dwmac";

To avoid breaking ethernet with the next DT synch from Linux to Uboot
(planned as prerequisite for adding Meson GX MMC driver to Uboot) add
"amlogic,meson-gx-dwmac" to the compatibility list in the designware
driver.

Signed-off-by: Heiner Kallweit 
---
 drivers/net/designware.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/designware.c b/drivers/net/designware.c
index f242fc6..d519b87 100644
--- a/drivers/net/designware.c
+++ b/drivers/net/designware.c
@@ -763,6 +763,7 @@ static const struct udevice_id designware_eth_ids[] = {
{ .compatible = "allwinner,sun7i-a20-gmac" },
{ .compatible = "altr,socfpga-stmmac" },
{ .compatible = "amlogic,meson6-dwmac" },
+   { .compatible = "amlogic,meson-gx-dwmac" },
{ }
 };
 
-- 
2.11.0

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


Re: [U-Boot] [PATCH v4 6/16] mtd: ubi: Select RBTREE option from MTD_UBI Kconfig entry

2017-01-27 Thread Maxime Ripard
On Thu, Jan 26, 2017 at 12:58:56PM +0100, Jagan Teki wrote:
> On Mon, Jan 23, 2017 at 2:46 PM, Maxime Ripard
>  wrote:
> > From: Boris Brezillon 
> >
> > Expose the RBTREE feature through Kconfig and select this option from the
> > MTD_UBI option.
> >
> > Signed-off-by: Boris Brezillon 
> > Signed-off-by: Maxime Ripard 
> > ---
> >  drivers/mtd/ubi/Kconfig | 1 +
> >  lib/Kconfig | 3 +++
> >  2 files changed, 4 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/mtd/ubi/Kconfig b/drivers/mtd/ubi/Kconfig
> > index 0c82395317ab..cb9ba78681ed 100644
> > --- a/drivers/mtd/ubi/Kconfig
> > +++ b/drivers/mtd/ubi/Kconfig
> > @@ -3,6 +3,7 @@ menu "UBI support"
> >  config MTD_UBI
> > bool "Enable UBI - Unsorted block images"
> > select CRC32
> > +   select RBTREE if ARCH_SUNXI
> 
> Better to define Kconfig for RBTREE at lib/ and make default there if
> required, this would easy for understanding directory specific Kconfig
> defines as well as showing some help text about RBTREE.

I'm not sure why we'd need to make it a default. This is not optional,
and disabling it will result in a breakage in the UBI code.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


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


Re: [U-Boot] [PATCH v4 4/16] common: Move environment choice to Kconfig

2017-01-27 Thread Maxime Ripard
Hi Jagan,

On Thu, Jan 26, 2017 at 12:49:49PM +0100, Jagan Teki wrote:
> On Mon, Jan 23, 2017 at 2:46 PM, Maxime Ripard
>  wrote:
> > The environment location is something that might change per board
> > (depending on what storage options are availaible there) or depending on
> > the user choice (when we have several options).
> >
> > Instead of hardcoding it in our configuration header, create a Kconfig
> > choice with the options we use for now, and the symbols that depend on it.
> >
> > Once done, also remove the irrelevant sunxi defines.
> >
> > Signed-off-by: Maxime Ripard 
> > Reviewed-by: Tom Rini 
> > ---
> >  common/Kconfig | 69 +++-
> >  include/configs/sunxi-common.h | 14 +--
> >  include/environment.h  |  2 +-
> >  3 files changed, 74 insertions(+), 11 deletions(-)
> >
> > diff --git a/common/Kconfig b/common/Kconfig
> > index a04ee1084fed..e8c88f4ee258 100644
> > --- a/common/Kconfig
> > +++ b/common/Kconfig
> > @@ -158,6 +158,75 @@ config SPI_BOOT
> >
> >  endmenu
> >
> > +menu "Environment"
> > +
> > +if ARCH_SUNXI
> 
> Why we need this arch specific on common, since all these ENV_* are
> common for all?

Precisely because it's common for all. Otherwise we'll get warnings
about the symbol being defined multiple times.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


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


Re: [U-Boot] [PATCH v5 0/9] disk: convert to Kconfig

2017-01-27 Thread Tom Rini
On Fri, Jan 27, 2017 at 11:00:34AM +0100, Patrick Delaunay wrote:

> move all CONFIG used in disk to Kconfig:
>   CONFIG_PARTITIONS
>   CONFIG_MAC_PARTITION
>   CONFIG_DOS_PARTITION
>   CONFIG_ISO_PARTITION
>   CONFIG_AMIGA_PARTITION
>   CONFIG_EFI_PARTITION
>   CONFIG_PARTITION_UUIDS
>   CONFIG_PARTITION_TYPE_GUID
> 
> 
> move disk to Kconfig as proposed by Simon Glass in thread
> [Resend RFC PATCH v1 1/3] add support of GPT partitioning over MTD
> 
> created one patch per partition after review of version 4 by Tom Rini
> 
> NB: I need to create _SPL_ config because for some platform activated
>list of supported partition type is not the same between SPL
>and U-Boot, that allow size reduction for SPL build
>(previously CONFIG are under compilation flag CONFIG_SPL_BUILD in .h)
> 
> I compile this patch on v2017.1 without issue linked to this code
> and after correction in patch v5 it is size neutral for
> the boards (on 1230 boards compiled on my side)

On top of tree I found just a few places where things weren't quite
right (and possibly due to being vs top of tree not v2017.01) but we're
now quite in the realm of things I'll fix-up.  The only "big" change is
that to make sure we get the CONFIG_PARTITION_UUIDS stuff right in all
cases I'm migrating CMD_PART and CMD_GPT.  Thanks once again for your
efforts here!

-- 
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 v2 03/15] imx: Use IMX6_BMODE_* macros instead of numericals

2017-01-27 Thread Jagan Teki
On Fri, Jan 27, 2017 at 7:10 PM, Eric Nelson  wrote:
> Hi Jagan,
>
> On 01/27/2017 10:54 AM, Jagan Teki wrote:
>> On Fri, Jan 27, 2017 at 6:29 PM, Eric Nelson  wrote:
>>> Hi Jagan,
>>>
>>> On 01/27/2017 10:21 AM, Jagan Teki wrote:
 On Fri, Jan 27, 2017 at 4:18 PM, Eric Nelson  wrote:
> Hi Jagan,
>
> Love this patch! This was long overdue.
>
> On 01/27/2017 07:12 AM, Jagan Teki wrote:
>> Use meaningful meacros IMX6_BMODE_*, instead of numerical
>> number in boot mode detection code.
>
> s/meacros/macros/
>
>>>
>>> 
>>>
>> diff --git a/arch/arm/include/asm/imx-common/sys_proto.h 
>> b/arch/arm/include/asm/imx-common/sys_proto.h
>> index 99e3869..d0cf3f1 100644
>> --- a/arch/arm/include/asm/imx-common/sys_proto.h
>> +++ b/arch/arm/include/asm/imx-common/sys_proto.h
>> @@ -42,6 +42,40 @@
>>  #ifdef CONFIG_MX6
>>  #define IMX6_SRC_GPR10_BMODE BIT(28)
>>
>> +#define IMX6_BMODE_MASK  GENMASK(7, 0)
>
> This is a number (4), not a mask:

 This is 0xff not 4
>>>
>>> I was referring to IMX6_BMODE_SHIFT.
>>
>> Sorry, I thought you replied on in-line to my messages and I'm trying
>> to use bitops for possible vlaue BIT(2) make the value 4 (1 << 2)
>>
>
> Methinks you tries too hard!
>
> Bitops don't help when you're referring to a bit **position**, only
> when referring to a mask.

OK, will fix.

>
>>>
  - switch ((reg & 0x00FF) >> 4) {
  + switch ((reg & IMX6_BMODE_MASK) >> IMX6_BMODE_SHIFT) {

>> +#define  IMX6_BMODE_SHIFTBIT(2)
>> +#define IMX6_BMODE_EMI_MASK  BIT(3)
>
> Ditto (number, not mask):

 The reason for calling this as mask as the reg value is and'ing to
 mask value of 8 (which is last 0 and 1 bits)
  - if ((reg & 0x0008) >> 3)
  + switch ((reg & IMX6_BMODE_EMI_MASK) >> 
 IMX6_BMODE_EMI_SHIFT) {

>>>
>>> Again, I'm referring to the _SHIFT macro below:
>>
>> Same comment as above.
>>
>>>
>> +#define IMX6_BMODE_EMI_SHIFT GENMASK(1, 0)
>
> Since there's also a "serial download mode", I'd prefer that these
> say "SERIAL_NOR" to avoid confusion.

 Since serial here is also denoting I2C better to have SERIAL and we
 can use 'serial download' as SERIAL_DOWNLOAD or something similar.

>>>
>>> I2C is also serial ROM or serial NOR.
>>>
>>> BMODE_SERIAL just seems to have multiple meanings.
>>
>> SERIAL_ROM may be better because SERIAL_NOR look spi-nor flash.
>>
>
> Okay by me.
>
>>>
>
>> +#define IMX6_BMODE_SERIAL_MASK   GENMASK(26, 24)
>> +#define IMX6_BMODE_SERIAL_SHIFT  GENMASK(4, 3)
>> +
>
> I'd prefer macros for these because they'd show the
> values directly, making a comparison with the RM
> easier.

 But these macro's making bit functioning smooth.

>>>
>>> My comment here was referring to the use of enums for
>>> imx6_bmode, imx6_bmode_emi, and imx6_bmode_serial.
>>>
>>> If you use macros, it's easier to see that, for instance
>>> IMX6_BMODE_EMMC == 7
>>
>> May be this is true with imx6_bmode but the rest have serial in
>> nature, but again enum make code compile time retain and good for for
>> code readable instead of assigning values unlike macro.s
>>
>
> If these were likely to be used more widely, I might agree, but
> opinions vary.
>
> My main thought is that having the numbers handy would make
> it easier to compare against the reference manual (which I haven't)
> or even the constants you just replaced (which I also haven't done).

Ok, then I will assign the values directly for imx6_bmode.

thanks!
-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 03/15] imx: Use IMX6_BMODE_* macros instead of numericals

2017-01-27 Thread Eric Nelson
Hi Jagan,

On 01/27/2017 10:54 AM, Jagan Teki wrote:
> On Fri, Jan 27, 2017 at 6:29 PM, Eric Nelson  wrote:
>> Hi Jagan,
>>
>> On 01/27/2017 10:21 AM, Jagan Teki wrote:
>>> On Fri, Jan 27, 2017 at 4:18 PM, Eric Nelson  wrote:
 Hi Jagan,

 Love this patch! This was long overdue.

 On 01/27/2017 07:12 AM, Jagan Teki wrote:
> Use meaningful meacros IMX6_BMODE_*, instead of numerical
> number in boot mode detection code.

 s/meacros/macros/

>>
>> 
>>
> diff --git a/arch/arm/include/asm/imx-common/sys_proto.h 
> b/arch/arm/include/asm/imx-common/sys_proto.h
> index 99e3869..d0cf3f1 100644
> --- a/arch/arm/include/asm/imx-common/sys_proto.h
> +++ b/arch/arm/include/asm/imx-common/sys_proto.h
> @@ -42,6 +42,40 @@
>  #ifdef CONFIG_MX6
>  #define IMX6_SRC_GPR10_BMODE BIT(28)
>
> +#define IMX6_BMODE_MASK  GENMASK(7, 0)

 This is a number (4), not a mask:
>>>
>>> This is 0xff not 4
>>
>> I was referring to IMX6_BMODE_SHIFT.
> 
> Sorry, I thought you replied on in-line to my messages and I'm trying
> to use bitops for possible vlaue BIT(2) make the value 4 (1 << 2)
> 

Methinks you tries too hard!

Bitops don't help when you're referring to a bit **position**, only
when referring to a mask.

>>
>>>  - switch ((reg & 0x00FF) >> 4) {
>>>  + switch ((reg & IMX6_BMODE_MASK) >> IMX6_BMODE_SHIFT) {
>>>
> +#define  IMX6_BMODE_SHIFTBIT(2)
> +#define IMX6_BMODE_EMI_MASK  BIT(3)

 Ditto (number, not mask):
>>>
>>> The reason for calling this as mask as the reg value is and'ing to
>>> mask value of 8 (which is last 0 and 1 bits)
>>>  - if ((reg & 0x0008) >> 3)
>>>  + switch ((reg & IMX6_BMODE_EMI_MASK) >> IMX6_BMODE_EMI_SHIFT) 
>>> {
>>>
>>
>> Again, I'm referring to the _SHIFT macro below:
> 
> Same comment as above.
> 
>>
> +#define IMX6_BMODE_EMI_SHIFT GENMASK(1, 0)

 Since there's also a "serial download mode", I'd prefer that these
 say "SERIAL_NOR" to avoid confusion.
>>>
>>> Since serial here is also denoting I2C better to have SERIAL and we
>>> can use 'serial download' as SERIAL_DOWNLOAD or something similar.
>>>
>>
>> I2C is also serial ROM or serial NOR.
>>
>> BMODE_SERIAL just seems to have multiple meanings.
> 
> SERIAL_ROM may be better because SERIAL_NOR look spi-nor flash.
> 

Okay by me.

>>

> +#define IMX6_BMODE_SERIAL_MASK   GENMASK(26, 24)
> +#define IMX6_BMODE_SERIAL_SHIFT  GENMASK(4, 3)
> +

 I'd prefer macros for these because they'd show the
 values directly, making a comparison with the RM
 easier.
>>>
>>> But these macro's making bit functioning smooth.
>>>
>>
>> My comment here was referring to the use of enums for
>> imx6_bmode, imx6_bmode_emi, and imx6_bmode_serial.
>>
>> If you use macros, it's easier to see that, for instance
>> IMX6_BMODE_EMMC == 7
> 
> May be this is true with imx6_bmode but the rest have serial in
> nature, but again enum make code compile time retain and good for for
> code readable instead of assigning values unlike macro.s
> 

If these were likely to be used more widely, I might agree, but
opinions vary.

My main thought is that having the numbers handy would make
it easier to compare against the reference manual (which I haven't)
or even the constants you just replaced (which I also haven't done).

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


Re: [U-Boot] sf: Remove spansion_s25fss_disable_4KB_erase

2017-01-27 Thread Jagan Teki
On Mon, Jan 23, 2017 at 8:05 PM, york sun  wrote:
> On 12/12/2016 09:32 PM, Yao Yuan wrote:
>> Hi Jagan,
>>
>>
>>
>> Do you have any comments?
>>
>>
>>
>> Thanks for your work and you know it’s important for QSPI with S25FS512S.
>>
>>
>>
>> It seems S25FS512S can’t support the SECT_4K, right?
>>
>> And it better to retain the disable_4kb, but we can add a flag in dts to
>> select whether enable it.
>>
>>
>
> Jagan,
>
> This is blocking me from using the board with this specific flash chip.
> Can you take a look? By reverting this single commit 116e005c, my board
> works again.

I will try to work on this.

thanks!
-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 03/15] imx: Use IMX6_BMODE_* macros instead of numericals

2017-01-27 Thread Jagan Teki
On Fri, Jan 27, 2017 at 6:29 PM, Eric Nelson  wrote:
> Hi Jagan,
>
> On 01/27/2017 10:21 AM, Jagan Teki wrote:
>> On Fri, Jan 27, 2017 at 4:18 PM, Eric Nelson  wrote:
>>> Hi Jagan,
>>>
>>> Love this patch! This was long overdue.
>>>
>>> On 01/27/2017 07:12 AM, Jagan Teki wrote:
 Use meaningful meacros IMX6_BMODE_*, instead of numerical
 number in boot mode detection code.
>>>
>>> s/meacros/macros/
>>>
>
> 
>
 diff --git a/arch/arm/include/asm/imx-common/sys_proto.h 
 b/arch/arm/include/asm/imx-common/sys_proto.h
 index 99e3869..d0cf3f1 100644
 --- a/arch/arm/include/asm/imx-common/sys_proto.h
 +++ b/arch/arm/include/asm/imx-common/sys_proto.h
 @@ -42,6 +42,40 @@
  #ifdef CONFIG_MX6
  #define IMX6_SRC_GPR10_BMODE BIT(28)

 +#define IMX6_BMODE_MASK  GENMASK(7, 0)
>>>
>>> This is a number (4), not a mask:
>>
>> This is 0xff not 4
>
> I was referring to IMX6_BMODE_SHIFT.

Sorry, I thought you replied on in-line to my messages and I'm trying
to use bitops for possible vlaue BIT(2) make the value 4 (1 << 2)

>
>>  - switch ((reg & 0x00FF) >> 4) {
>>  + switch ((reg & IMX6_BMODE_MASK) >> IMX6_BMODE_SHIFT) {
>>
 +#define  IMX6_BMODE_SHIFTBIT(2)
 +#define IMX6_BMODE_EMI_MASK  BIT(3)
>>>
>>> Ditto (number, not mask):
>>
>> The reason for calling this as mask as the reg value is and'ing to
>> mask value of 8 (which is last 0 and 1 bits)
>>  - if ((reg & 0x0008) >> 3)
>>  + switch ((reg & IMX6_BMODE_EMI_MASK) >> IMX6_BMODE_EMI_SHIFT) {
>>
>
> Again, I'm referring to the _SHIFT macro below:

Same comment as above.

>
 +#define IMX6_BMODE_EMI_SHIFT GENMASK(1, 0)
>>>
>>> Since there's also a "serial download mode", I'd prefer that these
>>> say "SERIAL_NOR" to avoid confusion.
>>
>> Since serial here is also denoting I2C better to have SERIAL and we
>> can use 'serial download' as SERIAL_DOWNLOAD or something similar.
>>
>
> I2C is also serial ROM or serial NOR.
>
> BMODE_SERIAL just seems to have multiple meanings.

SERIAL_ROM may be better because SERIAL_NOR look spi-nor flash.

>
>>>
 +#define IMX6_BMODE_SERIAL_MASK   GENMASK(26, 24)
 +#define IMX6_BMODE_SERIAL_SHIFT  GENMASK(4, 3)
 +
>>>
>>> I'd prefer macros for these because they'd show the
>>> values directly, making a comparison with the RM
>>> easier.
>>
>> But these macro's making bit functioning smooth.
>>
>
> My comment here was referring to the use of enums for
> imx6_bmode, imx6_bmode_emi, and imx6_bmode_serial.
>
> If you use macros, it's easier to see that, for instance
> IMX6_BMODE_EMMC == 7

May be this is true with imx6_bmode but the rest have serial in
nature, but again enum make code compile time retain and good for for
code readable instead of assigning values unlike macro.s

>
>> thanks!
>>
>
> No. Thank you for the patch. This was pretty contorted previously.

:)

thanks!
-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] armv8: ls1046a: Enable workaround for erratum A-008336

2017-01-27 Thread York Sun
Erratum A-008336 applies to LS1046A per latest SoC document.

Signed-off-by: York Sun 
CC: Shengzhou Liu 
---

 arch/arm/cpu/armv8/fsl-layerscape/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/Kconfig 
b/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
index ba411e2..2caeee7 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
+++ b/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
@@ -30,6 +30,7 @@ config ARCH_LS1046A
select SYS_FSL_DDR
select SYS_FSL_DDR_BE
select SYS_FSL_DDR_VER_50
+   select SYS_FSL_ERRATUM_A008336
select SYS_FSL_ERRATUM_A008511
select SYS_FSL_ERRATUM_A009801
select SYS_FSL_ERRATUM_A009803
-- 
2.7.4

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


Re: [U-Boot] [PATCH 2/3] armv8: fsl-lsch3: Update VID support

2017-01-27 Thread york sun
On 01/18/2017 09:43 PM, Priyanka Jain wrote:
> VID support in NXP layerscape Chassis-3 (lsch3) compilant SoCs like
> LS2088A, LS2080A differs from existing logic.
> -VDD voltage array is different
> -Registers are different
> -VDD calculation logic is different
>
> Add new function adjust_vdd() for LSCH3 compliant SoCs
>
> Signed-off-by: Priyanka Jain 
> Signed-off-by: Arpit Goel 
> ---
>  .../include/asm/arch-fsl-layerscape/immap_lsch3.h  |4 +-
>  board/freescale/common/vid.c   |  174 
> ++--
>  2 files changed, 164 insertions(+), 14 deletions(-)
>
> diff --git a/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch3.h 
> b/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch3.h
> index 38a6d03..fc4d33b 100644
> --- a/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch3.h
> +++ b/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch3.h
> @@ -187,9 +187,9 @@ struct ccsr_gur {
>   u32 gpporcr3;
>   u32 gpporcr4;
>   u8  res_030[0x60-0x30];
> -#define FSL_CHASSIS3_DCFG_FUSESR_VID_SHIFT   25
> +#define FSL_CHASSIS3_DCFG_FUSESR_VID_SHIFT   2
>  #define FSL_CHASSIS3_DCFG_FUSESR_VID_MASK0x1F
> -#define FSL_CHASSIS3_DCFG_FUSESR_ALTVID_SHIFT20
> +#define FSL_CHASSIS3_DCFG_FUSESR_ALTVID_SHIFT7
>  #define FSL_CHASSIS3_DCFG_FUSESR_ALTVID_MASK 0x1F


Priyanka,

You changed the fuse register offset and fuse position in this and 
previous patch of this set. What's going on? I presume you have verified 
it on LS2080ARDB. How did it work before? Do we have two fuse status 
registers?

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


Re: [U-Boot] [PATCH v2 03/15] imx: Use IMX6_BMODE_* macros instead of numericals

2017-01-27 Thread Eric Nelson
Hi Jagan,

On 01/27/2017 10:21 AM, Jagan Teki wrote:
> On Fri, Jan 27, 2017 at 4:18 PM, Eric Nelson  wrote:
>> Hi Jagan,
>>
>> Love this patch! This was long overdue.
>>
>> On 01/27/2017 07:12 AM, Jagan Teki wrote:
>>> Use meaningful meacros IMX6_BMODE_*, instead of numerical
>>> number in boot mode detection code.
>>
>> s/meacros/macros/
>>



>>> diff --git a/arch/arm/include/asm/imx-common/sys_proto.h 
>>> b/arch/arm/include/asm/imx-common/sys_proto.h
>>> index 99e3869..d0cf3f1 100644
>>> --- a/arch/arm/include/asm/imx-common/sys_proto.h
>>> +++ b/arch/arm/include/asm/imx-common/sys_proto.h
>>> @@ -42,6 +42,40 @@
>>>  #ifdef CONFIG_MX6
>>>  #define IMX6_SRC_GPR10_BMODE BIT(28)
>>>
>>> +#define IMX6_BMODE_MASK  GENMASK(7, 0)
>>
>> This is a number (4), not a mask:
> 
> This is 0xff not 4

I was referring to IMX6_BMODE_SHIFT.

>  - switch ((reg & 0x00FF) >> 4) {
>  + switch ((reg & IMX6_BMODE_MASK) >> IMX6_BMODE_SHIFT) {
> 
>>> +#define  IMX6_BMODE_SHIFTBIT(2)
>>> +#define IMX6_BMODE_EMI_MASK  BIT(3)
>>
>> Ditto (number, not mask):
> 
> The reason for calling this as mask as the reg value is and'ing to
> mask value of 8 (which is last 0 and 1 bits)
>  - if ((reg & 0x0008) >> 3)
>  + switch ((reg & IMX6_BMODE_EMI_MASK) >> IMX6_BMODE_EMI_SHIFT) {
> 

Again, I'm referring to the _SHIFT macro below:

>>> +#define IMX6_BMODE_EMI_SHIFT GENMASK(1, 0)
>>
>> Since there's also a "serial download mode", I'd prefer that these
>> say "SERIAL_NOR" to avoid confusion.
> 
> Since serial here is also denoting I2C better to have SERIAL and we
> can use 'serial download' as SERIAL_DOWNLOAD or something similar.
> 

I2C is also serial ROM or serial NOR.

BMODE_SERIAL just seems to have multiple meanings.

>>
>>> +#define IMX6_BMODE_SERIAL_MASK   GENMASK(26, 24)
>>> +#define IMX6_BMODE_SERIAL_SHIFT  GENMASK(4, 3)
>>> +
>>
>> I'd prefer macros for these because they'd show the
>> values directly, making a comparison with the RM
>> easier.
> 
> But these macro's making bit functioning smooth.
> 

My comment here was referring to the use of enums for
imx6_bmode, imx6_bmode_emi, and imx6_bmode_serial.

If you use macros, it's easier to see that, for instance
IMX6_BMODE_EMMC == 7

> thanks!
> 

No. Thank you for the patch. This was pretty contorted previously.

Regards,


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


Re: [U-Boot] [PATCH] LS1021ATWR: Modify u-boot size for sd secureboot

2017-01-27 Thread york sun
"Secure boot" is a two-word phrase, not one word.

On 01/20/2017 01:35 AM, Vinitha Pillai-B57223 wrote:
> From: Vinitha Pillai 
>
> Raw uboot image is used in place of FIT image in secure boot.
> The maximum allocated size of raw u-boot bin is 1MB in memory map.
> Hence , CONFIG_SYS_MONITOR_LEN has been modified to 1 MB.
> The bootscript  (BS_ADDR) and its header (BS_HDR_ADDR) offset on MMC have 
> also been modified to accommodate the increase in uboot size.

Please wrap back at or before 70 characters. Avoid putting extra white 
space in the message.

>
> Signed-off-by: Vinitha Pillai-B57223 

Sumit,

This change seems harmless. However I don't have the images setup for 
testing. Please review this patch as the secure boot maintainer.

York

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


Re: [U-Boot] [PATCH v2 03/15] imx: Use IMX6_BMODE_* macros instead of numericals

2017-01-27 Thread Jagan Teki
On Fri, Jan 27, 2017 at 4:18 PM, Eric Nelson  wrote:
> Hi Jagan,
>
> Love this patch! This was long overdue.
>
> On 01/27/2017 07:12 AM, Jagan Teki wrote:
>> Use meaningful meacros IMX6_BMODE_*, instead of numerical
>> number in boot mode detection code.
>
> s/meacros/macros/
>
>>
>> Cc: Stefano Babic 
>> Cc: Tim Harvey 
>> Signed-off-by: Jagan Teki 
>> ---
>>  arch/arm/imx-common/spl.c   | 39 
>> ++---
>>  arch/arm/include/asm/imx-common/sys_proto.h | 34 +
>>  2 files changed, 58 insertions(+), 15 deletions(-)
>>
>> diff --git a/arch/arm/imx-common/spl.c b/arch/arm/imx-common/spl.c
>> index fc3704b..38789b2 100644
>> --- a/arch/arm/imx-common/spl.c
>> +++ b/arch/arm/imx-common/spl.c
>> @@ -30,39 +30,48 @@ u32 spl_boot_device(void)
>>   if bmode >> 24) & 0x03)  == 0x01) || /* Serial Downloader */
>>   (imx6_is_bmode_from_gpr9() && (reg == 1)))
>>   return BOOT_DEVICE_UART;
>> +
>>   /* BOOT_CFG1[7:4] - see IMX6DQRM Table 8-8 */
>> - switch ((reg & 0x00FF) >> 4) {
>> + switch ((reg & IMX6_BMODE_MASK) >> IMX6_BMODE_SHIFT) {
>>/* EIM: See 8.5.1, Table 8-9 */
>> - case 0x0:
>> + case IMX6_BMODE_EMI:
>>   /* BOOT_CFG1[3]: NOR/OneNAND Selection */
>> - if ((reg & 0x0008) >> 3)
>> + switch ((reg & IMX6_BMODE_EMI_MASK) >> IMX6_BMODE_EMI_SHIFT) {
>> + case IMX6_BMODE_ONENAND:
>>   return BOOT_DEVICE_ONENAND;
>> - else
>> + case IMX6_BMODE_NOR:
>>   return BOOT_DEVICE_NOR;
>> - break;
>> + }
>>   /* SATA: See 8.5.4, Table 8-20 */
>> - case 0x2:
>> + case IMX6_BMODE_SATA:
>>   return BOOT_DEVICE_SATA;
>>   /* Serial ROM: See 8.5.5.1, Table 8-22 */
>> - case 0x3:
>> + case IMX6_BMODE_SERIAL:
>>   /* BOOT_CFG4[2:0] */
>> - switch ((reg & 0x0700) >> 24) {
>> - case 0x0 ... 0x4:
>> + switch ((reg & IMX6_BMODE_SERIAL_MASK) >>
>> + IMX6_BMODE_SERIAL_SHIFT) {
>> + case IMX6_BMODE_ECSPI1:
>> + case IMX6_BMODE_ECSPI2:
>> + case IMX6_BMODE_ECSPI3:
>> + case IMX6_BMODE_ECSPI4:
>> + case IMX6_BMODE_ECSPI5:
>>   return BOOT_DEVICE_SPI;
>> - case 0x5 ... 0x7:
>> + case IMX6_BMODE_I2C1:
>> + case IMX6_BMODE_I2C2:
>> + case IMX6_BMODE_I2C3:
>>   return BOOT_DEVICE_I2C;
>>   }
>>   break;
>>   /* SD/eSD: 8.5.3, Table 8-15  */
>> - case 0x4:
>> - case 0x5:
>> + case IMX6_BMODE_SD:
>> + case IMX6_BMODE_ESD:
>>   return BOOT_DEVICE_MMC1;
>>   /* MMC/eMMC: 8.5.3 */
>> - case 0x6:
>> - case 0x7:
>> + case IMX6_BMODE_MMC:
>> + case IMX6_BMODE_EMMC:
>>   return BOOT_DEVICE_MMC1;
>>   /* NAND Flash: 8.5.2, Table 8-10 */
>> - case 0x8:
>> + case IMX6_BMODE_NAND:
>>   return BOOT_DEVICE_NAND;
>>   }
>>   return BOOT_DEVICE_NONE;
>> diff --git a/arch/arm/include/asm/imx-common/sys_proto.h 
>> b/arch/arm/include/asm/imx-common/sys_proto.h
>> index 99e3869..d0cf3f1 100644
>> --- a/arch/arm/include/asm/imx-common/sys_proto.h
>> +++ b/arch/arm/include/asm/imx-common/sys_proto.h
>> @@ -42,6 +42,40 @@
>>  #ifdef CONFIG_MX6
>>  #define IMX6_SRC_GPR10_BMODE BIT(28)
>>
>> +#define IMX6_BMODE_MASK  GENMASK(7, 0)
>
> This is a number (4), not a mask:

This is 0xff not 4
 - switch ((reg & 0x00FF) >> 4) {
 + switch ((reg & IMX6_BMODE_MASK) >> IMX6_BMODE_SHIFT) {

>> +#define  IMX6_BMODE_SHIFTBIT(2)
>> +#define IMX6_BMODE_EMI_MASK  BIT(3)
>
> Ditto (number, not mask):

The reason for calling this as mask as the reg value is and'ing to
mask value of 8 (which is last 0 and 1 bits)
 - if ((reg & 0x0008) >> 3)
 + switch ((reg & IMX6_BMODE_EMI_MASK) >> IMX6_BMODE_EMI_SHIFT) {

>> +#define IMX6_BMODE_EMI_SHIFT GENMASK(1, 0)
>
> Since there's also a "serial download mode", I'd prefer that these
> say "SERIAL_NOR" to avoid confusion.

Since serial here is also denoting I2C better to have SERIAL and we
can use 'serial download' as SERIAL_DOWNLOAD or something similar.

>
>> +#define IMX6_BMODE_SERIAL_MASK   GENMASK(26, 24)
>> +#define IMX6_BMODE_SERIAL_SHIFT  GENMASK(4, 3)
>> +
>
> I'd prefer macros for these because they'd show the
> values directly, making a comparison with the RM
> easier.

But these macro's making bit functioning smooth.

thanks!
-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
___
U-Boot mailing list

Re: [U-Boot] [PATCH v4 2/3] spl: Remove overwrite of relocated malloc limit

2017-01-27 Thread Tom Rini
On Fri, Jan 27, 2017 at 10:39:19AM -0600, Andrew F. Davis wrote:

> spl_init on some boards is called after stack and heap relocation, on
> some platforms spl_relocate_stack_gd is called to handle setting the
> limit to its value CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN when simple
> SPL malloc is enabled during relocation. spl_init should then not
> re-assign the old pre-relocation limit when this is defined.
> 
> Signed-off-by: Andrew F. Davis 

Reviewed-by: Tom Rini 

-- 
Tom


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


Re: [U-Boot] [PATCH v4 1/3] malloc_simple: Add debug statements to memalign_simple

2017-01-27 Thread Tom Rini
On Fri, Jan 27, 2017 at 10:39:18AM -0600, Andrew F. Davis wrote:

> Add debug statements to memalign_simple to match malloc_simple.
> 
> Signed-off-by: Andrew F. Davis 

Reviewed-by: Tom Rini 

-- 
Tom


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


[U-Boot] [PATCH v4 0/3] Add a config for AM335x High Security EVM

2017-01-27 Thread Andrew F. Davis
Hello all,

This series is [0] and [1] together due to a dependency. Both are
modified as suggested in the comments. 

Thanks,
Andrew

[0]: https://patchwork.ozlabs.org/patch/713945/
[1]: https://patchwork.ozlabs.org/patch/715820/

Changes from v3:
 - Reworked v2 as per Tom's comments

Andrew F. Davis (3):
  malloc_simple: Add debug statements to memalign_simple
  spl: Remove overwrite of relocated malloc limit
  defconfig: Add a config for AM335x High Security EVM

 MAINTAINERS |  1 +
 common/malloc_simple.c  |  6 +++-
 common/spl/spl.c|  7 -
 configs/am335x_hs_evm_defconfig | 62 +
 4 files changed, 74 insertions(+), 2 deletions(-)
 create mode 100644 configs/am335x_hs_evm_defconfig

-- 
2.11.0

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


[U-Boot] [PATCH v4 1/3] malloc_simple: Add debug statements to memalign_simple

2017-01-27 Thread Andrew F. Davis
Add debug statements to memalign_simple to match malloc_simple.

Signed-off-by: Andrew F. Davis 
---
 common/malloc_simple.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/common/malloc_simple.c b/common/malloc_simple.c
index 0f6bcbcc71..611400265b 100644
--- a/common/malloc_simple.c
+++ b/common/malloc_simple.c
@@ -39,10 +39,14 @@ void *memalign_simple(size_t align, size_t bytes)
 
addr = ALIGN(gd->malloc_base + gd->malloc_ptr, align);
new_ptr = addr + bytes - gd->malloc_base;
-   if (new_ptr > gd->malloc_limit)
+   if (new_ptr > gd->malloc_limit) {
+   debug("space exhausted\n");
return NULL;
+   }
+
ptr = map_sysmem(addr, bytes);
gd->malloc_ptr = ALIGN(new_ptr, sizeof(new_ptr));
+   debug("%lx\n", (ulong)ptr);
 
return ptr;
 }
-- 
2.11.0

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


[U-Boot] [PATCH v4 3/3] defconfig: Add a config for AM335x High Security EVM

2017-01-27 Thread Andrew F. Davis
Add a new defconfig file for the AM335x High Security EVM. This config
is specific for the case of memory device booting. Memory device booting
is handled separatly from peripheral booting on HS devices as the load
address changes.

This defconfig is the same as for the non-secure part, except for:
CONFIG_TI_SECURE_DEVICE option set to 'y'
CONFIG_ISW_ENTRY_ADDR updated for secure images.
CONFIG_FIT_IMAGE_POST_PROCESS option set to 'y'
CONFIG_SPL_FIT_IMAGE_POST_PROCESS option set to 'y'
CONFIG_USE_TINY_PRINTF option set to 'y' to reduce SPL size
CONFIG_SPL_SYS_MALLOC_SIMPLE set to 'y' to reduce SPL size

Signed-off-by: Andrew F. Davis 
Reviewed-by: Tom Rini 
---
 MAINTAINERS |  1 +
 configs/am335x_hs_evm_defconfig | 62 +
 2 files changed, 63 insertions(+)
 create mode 100644 configs/am335x_hs_evm_defconfig

diff --git a/MAINTAINERS b/MAINTAINERS
index 0e05c0ecff..eaa2c3bbb8 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -441,6 +441,7 @@ F:  arch/arm/mach-omap2/omap5/sec_entry_cpu1.S
 F: arch/arm/mach-omap2/omap5/sec-fxns.c
 F: arch/arm/mach-omap2/sec-common.c
 F: arch/arm/mach-omap2/config_secure.mk
+F: configs/am335x_hs_evm_defconfig
 F: configs/am43xx_hs_evm_defconfig
 F: configs/am57xx_hs_evm_defconfig
 F: configs/dra7xx_hs_evm_defconfig
diff --git a/configs/am335x_hs_evm_defconfig b/configs/am335x_hs_evm_defconfig
new file mode 100644
index 00..d6224bcdfb
--- /dev/null
+++ b/configs/am335x_hs_evm_defconfig
@@ -0,0 +1,62 @@
+CONFIG_ARM=y
+CONFIG_AM33XX=y
+CONFIG_TI_SECURE_DEVICE=y
+# CONFIG_SPL_EXT_SUPPORT is not set
+# CONFIG_SPL_NAND_SUPPORT is not set
+CONFIG_TARGET_AM335X_EVM=y
+CONFIG_ISW_ENTRY_ADDR=0x40300350
+CONFIG_SPL_STACK_R_ADDR=0x8200
+# CONFIG_SPL_YMODEM_SUPPORT is not set
+CONFIG_DEFAULT_DEVICE_TREE="am335x-evm"
+CONFIG_DISTRO_DEFAULTS=y
+CONFIG_FIT=y
+CONFIG_SYS_EXTRA_OPTIONS="NAND"
+CONFIG_SPL_LOAD_FIT=y
+CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y
+CONFIG_FIT_IMAGE_POST_PROCESS=y
+CONFIG_SYS_CONSOLE_INFO_QUIET=y
+CONFIG_VERSION_VARIABLE=y
+CONFIG_SPL=y
+CONFIG_SPL_SYS_MALLOC_SIMPLE=y
+CONFIG_SPL_STACK_R=y
+CONFIG_SPL_MTD_SUPPORT=y
+# CONFIG_CMD_IMLS is not set
+CONFIG_CMD_ASKENV=y
+# CONFIG_CMD_FLASH is not set
+CONFIG_CMD_MMC=y
+CONFIG_CMD_SF=y
+CONFIG_CMD_SPI=y
+CONFIG_CMD_I2C=y
+CONFIG_CMD_USB=y
+CONFIG_CMD_DFU=y
+CONFIG_CMD_GPIO=y
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_EXT4_WRITE=y
+CONFIG_OF_CONTROL=y
+CONFIG_OF_LIST="am335x-evm"
+# CONFIG_BLK is not set
+CONFIG_DFU_MMC=y
+CONFIG_DFU_NAND=y
+CONFIG_DFU_RAM=y
+CONFIG_DM_I2C=y
+CONFIG_DM_MMC=y
+# CONFIG_DM_MMC_OPS is not set
+CONFIG_MMC_OMAP_HS=y
+CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_WINBOND=y
+CONFIG_DM_ETH=y
+CONFIG_SYS_NS16550=y
+CONFIG_TIMER=y
+CONFIG_OMAP_TIMER=y
+CONFIG_USB=y
+CONFIG_USB_MUSB_HOST=y
+CONFIG_USB_MUSB_GADGET=y
+CONFIG_USB_STORAGE=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
+CONFIG_G_DNL_VENDOR_NUM=0x0451
+CONFIG_G_DNL_PRODUCT_NUM=0xd022
+CONFIG_USE_TINY_PRINTF=y
+CONFIG_RSA=y
+CONFIG_SPL_OF_LIBFDT=y
-- 
2.11.0

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


[U-Boot] [PATCH v4 2/3] spl: Remove overwrite of relocated malloc limit

2017-01-27 Thread Andrew F. Davis
spl_init on some boards is called after stack and heap relocation, on
some platforms spl_relocate_stack_gd is called to handle setting the
limit to its value CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN when simple
SPL malloc is enabled during relocation. spl_init should then not
re-assign the old pre-relocation limit when this is defined.

Signed-off-by: Andrew F. Davis 
---
 common/spl/spl.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/common/spl/spl.c b/common/spl/spl.c
index 462c3a2b97..a3808a988b 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -183,7 +183,12 @@ int spl_init(void)
int ret;
 
debug("spl_init()\n");
-#if defined(CONFIG_SYS_MALLOC_F_LEN)
+/*
+ * with CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN we set malloc_base and
+ * malloc_limit in spl_relocate_stack_gd
+ */
+#if defined(CONFIG_SYS_MALLOC_F_LEN) && \
+   !defined(CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN)
 #ifdef CONFIG_MALLOC_F_ADDR
gd->malloc_base = CONFIG_MALLOC_F_ADDR;
 #endif
-- 
2.11.0

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


Re: [U-Boot] [PATCH] bcm2835_wdt: support for the BCM2835/2836 watchdog

2017-01-27 Thread Brüns , Stefan
On Freitag, 27. Januar 2017 10:59:05 CET Paolo Pisati wrote:
> Signed-off-by: Paolo Pisati 
> ---
>  arch/arm/mach-bcm283x/reset.c  | 21 ++---
>  board/raspberrypi/rpi/rpi.c|  4 
>  drivers/watchdog/Makefile  |  1 +
>  drivers/watchdog/bcm2835_wdt.c | 34 ++
>  include/configs/rpi.h  |  3 +++
>  scripts/config_whitelist.txt   |  1 +
>  6 files changed, 61 insertions(+), 3 deletions(-)
>  create mode 100644 drivers/watchdog/bcm2835_wdt.c
> 
> diff --git a/arch/arm/mach-bcm283x/reset.c b/arch/arm/mach-bcm283x/reset.c
> index 685815c..b62cb8a 100644
> --- a/arch/arm/mach-bcm283x/reset.c
> +++ b/arch/arm/mach-bcm283x/reset.c
> @@ -21,18 +21,33 @@
>   */
>  #define BCM2835_WDOG_RSTS_RASPBERRYPI_HALT   0x555
> 
> +/* max ticks timeout */
> +#define BCM2835_WDOG_MAX_TIMEOUT 0x000f
> +
> +#ifdef CONFIG_BCM2835_WDT
> +extern void hw_watchdog_disable(void);
> +#else
> +void hw_watchdog_disable(void) {}
> +#endif
> +
>  __efi_runtime_data struct bcm2835_wdog_regs *wdog_regs =
>   (struct bcm2835_wdog_regs *)BCM2835_WDOG_PHYSADDR;
> 
> -void __efi_runtime reset_cpu(ulong addr)
> +void __efi_runtime reset_cpu(ulong ticks)
>  {
> - uint32_t rstc;
> + uint32_t rstc, timeout;
> +
> + if (ticks == 0) {
> + hw_watchdog_disable();
> + timeout = RESET_TIMEOUT;

This is wrong. The efi runtime reset function calls this as reset_cpu(0), and 
then tries to call hw_watchdog_disable, which is not marked as __efi_runtime.

Actually, I can see no reason the watchdog setup piggybacks on the reset_cpu 
funtion.

> + } else
> + timeout = ticks & BCM2835_WDOG_MAX_TIMEOUT;
> 
>   rstc = readl(_regs->rstc);
>   rstc &= ~BCM2835_WDOG_RSTC_WRCFG_MASK;
>   rstc |= BCM2835_WDOG_RSTC_WRCFG_FULL_RESET;
> 
> - writel(BCM2835_WDOG_PASSWORD | RESET_TIMEOUT, _regs->wdog);
> + writel(BCM2835_WDOG_PASSWORD | timeout, _regs->wdog);
>   writel(BCM2835_WDOG_PASSWORD | rstc, _regs->rstc);
>  }
> 
> diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
> index 22e87a2..106e518 100644
> --- a/board/raspberrypi/rpi/rpi.c
> +++ b/board/raspberrypi/rpi/rpi.c
[...]
> --- a/scripts/config_whitelist.txt
> +++ b/scripts/config_whitelist.txt
> @@ -294,6 +294,7 @@ CONFIG_BCH_CONST_M
>  CONFIG_BCH_CONST_PARAMS
>  CONFIG_BCH_CONST_T
>  CONFIG_BCM2835_GPIO
> +CONFIG_BCM2835_WDT
>  CONFIG_BCM283X_MU_SERIAL
>  CONFIG_BCM_SF2_ETH
>  CONFIG_BCM_SF2_ETH_DEFAULT_PORT

I think the rule is no new CONFIG_xxx options, but appropriate options in 
KConfig.

Kind regards,

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


Re: [U-Boot] [PATCH v4 2/9] arm: imx6ul: Add Engicam Is.IoT MX6UL Starter Kit initial support

2017-01-27 Thread Jagan Teki
n Fri, Jan 27, 2017 at 1:38 PM, Stefano Babic  wrote:
> Hi Jagan,
>
> On 27/01/2017 09:54, Jagan Teki wrote:
>> From: Jagan Teki 
>>
>> Boot from MMC:
>> -
>> U-Boot SPL 2017.01-rc2-gba3c151-dirty (Jan 02 2017 - 16:59:33)
>> Trying to boot from MMC1
>>
>> U-Boot 2017.01-rc2-gba3c151-dirty (Jan 02 2017 - 16:59:33 +0100)
>>
>> CPU:   Freescale i.MX6UL rev1.1 528 MHz (running at 396 MHz)
>> CPU:   Industrial temperature grade (-40C to 105C) at 33C
>> Reset cause: POR
>> Model: Engicam Is.IoT MX6UL Starterkit
>> DRAM:  512 MiB
>> MMC:   FSL_SDHC: 0
>> *** Warning - bad CRC, using default environment
>>
>> In:serial
>> Out:   serial
>> Err:   serial
>> Net:   CPU Net Initialization Failed
>> No ethernet found.
>> Hit any key to stop autoboot:  0
>> isiotmx6ul>
>>
>> Cc: Stefano Babic 
>> Cc: Matteo Lisi 
>> Cc: Michael Trimarchi 
>> Signed-off-by: Jagan Teki 
>> ---
>>  arch/arm/cpu/armv7/mx6/Kconfig|  11 ++
>>  arch/arm/dts/Makefile |   3 +-
>>  arch/arm/dts/imx6ul-isiot-mmc.dts |  50 +++
>>  arch/arm/dts/imx6ul-isiot.dtsi|  92 +
>>  board/engicam/isiotmx6ul/Kconfig  |  12 ++
>>  board/engicam/isiotmx6ul/MAINTAINERS  |   6 +
>>  board/engicam/isiotmx6ul/Makefile |   6 +
>>  board/engicam/isiotmx6ul/README   |  28 
>>  board/engicam/isiotmx6ul/isiotmx6ul.c | 247 
>> ++
>>  configs/imx6ul_isiot_mmc_defconfig|  36 +
>>  include/configs/imx6ul_isiot.h| 142 +++
>>  11 files changed, 632 insertions(+), 1 deletion(-)
>>  create mode 100644 arch/arm/dts/imx6ul-isiot-mmc.dts
>>  create mode 100644 arch/arm/dts/imx6ul-isiot.dtsi
>>  create mode 100644 board/engicam/isiotmx6ul/Kconfig
>>  create mode 100644 board/engicam/isiotmx6ul/MAINTAINERS
>>  create mode 100644 board/engicam/isiotmx6ul/Makefile
>>  create mode 100644 board/engicam/isiotmx6ul/README
>>  create mode 100644 board/engicam/isiotmx6ul/isiotmx6ul.c
>>  create mode 100644 configs/imx6ul_isiot_mmc_defconfig
>>  create mode 100644 include/configs/imx6ul_isiot.h
>>
>> diff --git a/arch/arm/cpu/armv7/mx6/Kconfig b/arch/arm/cpu/armv7/mx6/Kconfig
>> index c646966..72780d7 100644
>> --- a/arch/arm/cpu/armv7/mx6/Kconfig
>> +++ b/arch/arm/cpu/armv7/mx6/Kconfig
>> @@ -205,6 +205,16 @@ config TARGET_MX6UL_GEAM
>>   select DM_THERMAL
>>   select SUPPORT_SPL
>>
>> +config TARGET_MX6UL_ISIOT
>> + bool "Support Engicam Is.IoT MX6UL"
>> + select MX6UL
>> + select OF_CONTROL
>> + select DM
>> + select DM_GPIO
>> + select DM_MMC
>> + select DM_THERMAL
>> + select SUPPORT_SPL
>> +
>>  config TARGET_MX6ULL_14X14_EVK
>>   bool "Support mx6ull_14x14_evk"
>>   select MX6ULL
>> @@ -313,6 +323,7 @@ source "board/embest/mx6boards/Kconfig"
>>  source "board/engicam/geam6ul/Kconfig"
>>  source "board/engicam/icorem6/Kconfig"
>>  source "board/engicam/icorem6_rqs/Kconfig"
>> +source "board/engicam/isiotmx6ul/Kconfig"
>>  source "board/freescale/mx6qarm2/Kconfig"
>>  source "board/freescale/mx6qsabreauto/Kconfig"
>>  source "board/freescale/mx6sabresd/Kconfig"
>> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
>> index 6a7924e..e83308c 100644
>> --- a/arch/arm/dts/Makefile
>> +++ b/arch/arm/dts/Makefile
>> @@ -313,7 +313,8 @@ dtb-$(CONFIG_MX6) += imx6ull-14x14-evk.dtb \
>>   imx6dl-icore-rqs.dtb \
>>   imx6q-icore.dtb \
>>   imx6q-icore-rqs.dtb \
>> - imx6ul-geam-kit.dtb
>> + imx6ul-geam-kit.dtb \
>> + imx6ul-isiot-mmc.dtb
>>
>>  dtb-$(CONFIG_MX7) += imx7-colibri.dtb
>>
>> diff --git a/arch/arm/dts/imx6ul-isiot-mmc.dts 
>> b/arch/arm/dts/imx6ul-isiot-mmc.dts
>> new file mode 100644
>> index 000..bb5086a
>> --- /dev/null
>> +++ b/arch/arm/dts/imx6ul-isiot-mmc.dts
>> @@ -0,0 +1,50 @@
>> +/*
>> + * Copyright (C) 2016 Amarula Solutions B.V.
>> + * Copyright (C) 2016 Engicam S.r.l.
>> + *
>> + * This file is dual-licensed: you can use it either under the terms
>> + * of the GPL or the X11 license, at your option. Note that this dual
>> + * licensing only applies to this file, and not this project as a
>> + * whole.
>> + *
>
>
> I have seen that a lot of files slipped into mainline, and I have myself
> not paid enough attention befeore (see your imx6ul-geam-kit.dts for
> example).
>
> But we moved some years ago to SPDX-License-Identifier. Other DTS files
> are using this as well without copying the whole license. Could you do
> this here, too ? It would be also nice if you plan to fix this for all
> Engicam's boards, thanks !

Yes for boards, I will prepare patch.

For devicetress, since the base dtsi files copied from Linux, we keep
the license as it is. I am not sure all other dts(i) files use the
SPDX-License-Identifier. example imx6sll-evk, imx6ull-14x14-evk and
all sunxi .


>
>> +
>> +/dts-v1/;
>> +
>> +#include 

Re: [U-Boot] [RFC PATCH 0/3] ARM: imx: mx6: Add plugin support for SPL

2017-01-27 Thread Otavio Salvador
On Fri, Jan 27, 2017 at 12:56 PM, Fabio Estevam  wrote:
> On Fri, Jan 20, 2017 at 3:40 PM, Tim Harvey  wrote:
>> The SRC_SBMR register reflects the BOOT MODE pins of the chip
>> (strapping) but the reference manual defines SRC_GPR9 and
>> SRC_GPR10[28] as reserved and I don't recall the reasoning for using
>> these for the boot mode. Can you provide some documentation that we
>> can put in the code? I'm thinking there is something else missing from
>> this function that should be able to determine that the serial
>> downloader was used in my case and return BOOT_DEVICE_UART
>> appropriately.
>
> I could also not found any documentation about SRC_GPR9 and SRC_GPR10[28].

I think the BootROM is the ultimate resource here. Did you look
internally for its source?

-- 
Otavio Salvador O.S. Systems
http://www.ossystems.com.brhttp://code.ossystems.com.br
Mobile: +55 (53) 9981-7854Mobile: +1 (347) 903-9750
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 03/15] imx: Use IMX6_BMODE_* macros instead of numericals

2017-01-27 Thread Eric Nelson
Hi Jagan,

Love this patch! This was long overdue.

On 01/27/2017 07:12 AM, Jagan Teki wrote:
> Use meaningful meacros IMX6_BMODE_*, instead of numerical
> number in boot mode detection code.

s/meacros/macros/

> 
> Cc: Stefano Babic 
> Cc: Tim Harvey 
> Signed-off-by: Jagan Teki 
> ---
>  arch/arm/imx-common/spl.c   | 39 
> ++---
>  arch/arm/include/asm/imx-common/sys_proto.h | 34 +
>  2 files changed, 58 insertions(+), 15 deletions(-)
> 
> diff --git a/arch/arm/imx-common/spl.c b/arch/arm/imx-common/spl.c
> index fc3704b..38789b2 100644
> --- a/arch/arm/imx-common/spl.c
> +++ b/arch/arm/imx-common/spl.c
> @@ -30,39 +30,48 @@ u32 spl_boot_device(void)
>   if bmode >> 24) & 0x03)  == 0x01) || /* Serial Downloader */
>   (imx6_is_bmode_from_gpr9() && (reg == 1)))
>   return BOOT_DEVICE_UART;
> +
>   /* BOOT_CFG1[7:4] - see IMX6DQRM Table 8-8 */
> - switch ((reg & 0x00FF) >> 4) {
> + switch ((reg & IMX6_BMODE_MASK) >> IMX6_BMODE_SHIFT) {
>/* EIM: See 8.5.1, Table 8-9 */
> - case 0x0:
> + case IMX6_BMODE_EMI:
>   /* BOOT_CFG1[3]: NOR/OneNAND Selection */
> - if ((reg & 0x0008) >> 3)
> + switch ((reg & IMX6_BMODE_EMI_MASK) >> IMX6_BMODE_EMI_SHIFT) {
> + case IMX6_BMODE_ONENAND:
>   return BOOT_DEVICE_ONENAND;
> - else
> + case IMX6_BMODE_NOR:
>   return BOOT_DEVICE_NOR;
> - break;
> + }
>   /* SATA: See 8.5.4, Table 8-20 */
> - case 0x2:
> + case IMX6_BMODE_SATA:
>   return BOOT_DEVICE_SATA;
>   /* Serial ROM: See 8.5.5.1, Table 8-22 */
> - case 0x3:
> + case IMX6_BMODE_SERIAL:
>   /* BOOT_CFG4[2:0] */
> - switch ((reg & 0x0700) >> 24) {
> - case 0x0 ... 0x4:
> + switch ((reg & IMX6_BMODE_SERIAL_MASK) >>
> + IMX6_BMODE_SERIAL_SHIFT) {
> + case IMX6_BMODE_ECSPI1:
> + case IMX6_BMODE_ECSPI2:
> + case IMX6_BMODE_ECSPI3:
> + case IMX6_BMODE_ECSPI4:
> + case IMX6_BMODE_ECSPI5:
>   return BOOT_DEVICE_SPI;
> - case 0x5 ... 0x7:
> + case IMX6_BMODE_I2C1:
> + case IMX6_BMODE_I2C2:
> + case IMX6_BMODE_I2C3:
>   return BOOT_DEVICE_I2C;
>   }
>   break;
>   /* SD/eSD: 8.5.3, Table 8-15  */
> - case 0x4:
> - case 0x5:
> + case IMX6_BMODE_SD:
> + case IMX6_BMODE_ESD:
>   return BOOT_DEVICE_MMC1;
>   /* MMC/eMMC: 8.5.3 */
> - case 0x6:
> - case 0x7:
> + case IMX6_BMODE_MMC:
> + case IMX6_BMODE_EMMC:
>   return BOOT_DEVICE_MMC1;
>   /* NAND Flash: 8.5.2, Table 8-10 */
> - case 0x8:
> + case IMX6_BMODE_NAND:
>   return BOOT_DEVICE_NAND;
>   }
>   return BOOT_DEVICE_NONE;
> diff --git a/arch/arm/include/asm/imx-common/sys_proto.h 
> b/arch/arm/include/asm/imx-common/sys_proto.h
> index 99e3869..d0cf3f1 100644
> --- a/arch/arm/include/asm/imx-common/sys_proto.h
> +++ b/arch/arm/include/asm/imx-common/sys_proto.h
> @@ -42,6 +42,40 @@
>  #ifdef CONFIG_MX6
>  #define IMX6_SRC_GPR10_BMODE BIT(28)
>  
> +#define IMX6_BMODE_MASK  GENMASK(7, 0)

This is a number (4), not a mask:
> +#define  IMX6_BMODE_SHIFTBIT(2)
> +#define IMX6_BMODE_EMI_MASK  BIT(3)

Ditto (number, not mask):
> +#define IMX6_BMODE_EMI_SHIFT GENMASK(1, 0)

Since there's also a "serial download mode", I'd prefer that these
say "SERIAL_NOR" to avoid confusion.

> +#define IMX6_BMODE_SERIAL_MASK   GENMASK(26, 24)
> +#define IMX6_BMODE_SERIAL_SHIFT  GENMASK(4, 3)
> +

I'd prefer macros for these because they'd show the
values directly, making a comparison with the RM
easier.

> +enum imx6_bmode_serial {
> + IMX6_BMODE_ECSPI1,
> + IMX6_BMODE_ECSPI2,
> + IMX6_BMODE_ECSPI3,
> + IMX6_BMODE_ECSPI4,
> + IMX6_BMODE_ECSPI5,
> + IMX6_BMODE_I2C1,
> + IMX6_BMODE_I2C2,
> + IMX6_BMODE_I2C3,
> +};
> +
> +enum imx6_bmode_emi {
> + IMX6_BMODE_ONENAND,
> + IMX6_BMODE_NOR,
> +};
> +
> +enum imx6_bmode {
> + IMX6_BMODE_EMI,

Especially when doing things like this:

> + IMX6_BMODE_SATA = 0x2,
> + IMX6_BMODE_SERIAL,
> + IMX6_BMODE_SD,
> + IMX6_BMODE_ESD,
> + IMX6_BMODE_MMC,
> + IMX6_BMODE_EMMC,
> + IMX6_BMODE_NAND,
> +};
> +
>  static inline u8 imx6_is_bmode_from_gpr9(void)
>  {
>   struct src *psrc = (struct src *)SRC_BASE_ADDR;
> 

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


Re: [U-Boot] [PATCH] cros_ec: i2c: Add support for version 3 of the EC protocol

2017-01-27 Thread Moritz Fischer
Hi Simon,

On Thu, Jan 26, 2017 at 3:23 PM, Simon Glass  wrote:

> Unfortunately due to travel I'm not going to be able to try this
> out/review it for two more weeks.

No problem, I'm travelling too at the moment.

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


Re: [U-Boot] [RFC PATCH 0/3] ARM: imx: mx6: Add plugin support for SPL

2017-01-27 Thread Fabio Estevam
Hi Tim,

On Fri, Jan 20, 2017 at 3:40 PM, Tim Harvey  wrote:

> The SRC_SBMR register reflects the BOOT MODE pins of the chip
> (strapping) but the reference manual defines SRC_GPR9 and
> SRC_GPR10[28] as reserved and I don't recall the reasoning for using
> these for the boot mode. Can you provide some documentation that we
> can put in the code? I'm thinking there is something else missing from
> this function that should be able to determine that the serial
> downloader was used in my case and return BOOT_DEVICE_UART
> appropriately.

I could also not found any documentation about SRC_GPR9 and SRC_GPR10[28].

I also find it confusing that we use such undocumented registers in
U-Boot for determining the boot mode.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 6/7] ARM: k2g: setup PRU ethernet MAC addresses

2017-01-27 Thread Tom Rini
On Fri, Jan 27, 2017 at 10:58:41AM +0200, Roger Quadros wrote:
> 
> On 26/01/17 19:41, Tom Rini wrote:
> > On Thu, Jan 26, 2017 at 03:07:28PM +0200, Roger Quadros wrote:
> > 
> >> PRU ethernet MAC address range is present in the
> >> board EEPROM. Parse it and setup eth?addr
> >> environment variables.
> > [snip]
> >> +#ifdef CONFIG_BOARD_LATE_INIT
> >> +int board_late_init(void)
> >> +{
> >> +  __maybe_unused int rc;
> >> +
> >> +#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_TI_I2C_BOARD_DETECT)
> > 
> > Just move the #if up to include 'int rc' and we don't need to declare it
> > __maybe_unused then.
> 
> OK.
> > 
> > [snip]
> >> +/* Board Detection EEPROM */
> >> +#define CONFIG_EEPROM_BUS_ADDRESS 0
> >> +#define CONFIG_EEPROM_CHIP_ADDRESS0x50
> > 
> > Only dra7xx and am57xx use these CONFIG options currently, please
> > migrate them to Kconfig instead of adding another board, thanks!
> > 
> 
> I didn't get this part. In this patch board_k2g.c is using those macros.
> Are you suggesting to move this to Kconfig instead of putting them
> in the board headers?

Correct, move them to Kconfig (and migrate the other two boards).
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 v4 5/9] arm: dts: imx6ul-isiot: Add FEC node

2017-01-27 Thread Stefano Babic
On 27/01/2017 09:54, Jagan Teki wrote:
> From: Jagan Teki 
> 
> Add FEC node for Engicam Is.IoT MX6UL module.
> 
> Cc: Stefano Babic 
> Cc: Matteo Lisi 
> Cc: Michael Trimarchi 
> Signed-off-by: Jagan Teki 
> ---
>  arch/arm/dts/imx6ul-isiot.dtsi | 22 ++
>  1 file changed, 22 insertions(+)
> 
> diff --git a/arch/arm/dts/imx6ul-isiot.dtsi b/arch/arm/dts/imx6ul-isiot.dtsi
> index 1a474ca..346079a 100644
> --- a/arch/arm/dts/imx6ul-isiot.dtsi
> +++ b/arch/arm/dts/imx6ul-isiot.dtsi
> @@ -56,6 +56,13 @@
>   };
>  };
>  
> + {
> + pinctrl-names = "default";
> + pinctrl-0 = <_enet1>;
> + phy-mode = "rmii";
> + status = "okay";
> +};
> +
>   {
>   clock-frequency = <10>;
>   pinctrl-names = "default";
> @@ -86,6 +93,21 @@
>  };
>  
>   {
> + pinctrl_enet1: enet1grp {
> + fsl,pins = <
> + MX6UL_PAD_ENET2_RX_DATA0__ENET1_MDIO0x1b0b0
> + MX6UL_PAD_ENET2_RX_DATA1__ENET1_MDC 0x1b0b0
> + MX6UL_PAD_ENET1_RX_EN__ENET1_RX_EN  0x1b0b0
> + MX6UL_PAD_ENET1_RX_DATA0__ENET1_RDATA00 0x1b0b0
> + MX6UL_PAD_ENET1_RX_DATA1__ENET1_RDATA01 0x1b0b0
> + MX6UL_PAD_ENET1_TX_EN__ENET1_TX_EN  0x1b0b0
> + MX6UL_PAD_ENET1_TX_DATA0__ENET1_TDATA00 0x1b0b0
> + MX6UL_PAD_ENET1_TX_DATA1__ENET1_TDATA01 0x1b0b0
> + MX6UL_PAD_ENET1_TX_CLK__ENET1_REF_CLK1  0x4001b031
> + MX6UL_PAD_ENET2_RX_EN__GPIO2_IO10   0x1b0b0
> + >;
> + };
> +
>   pinctrl_i2c1: i2c1grp {
>   fsl,pins = <
>   MX6UL_PAD_UART4_TX_DATA__I2C1_SCL 0x4001b8b0
> 
Reviewed-by: Stefano Babic 

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
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 v4 4/9] imx6: isiotmx6ul: Add I2C support

2017-01-27 Thread Stefano Babic
On 27/01/2017 09:54, Jagan Teki wrote:
> From: Jagan Teki 
> 
> Add I2C support for Engicam Is.IoT MX6UL module.
> 
> isiotmx6ul> i2c bus
> Bus 0:  i2c@021a
> Bus 1:  i2c@021a4000
> isiotmx6ul> i2c dev 0
> Setting bus to 0
> isiotmx6ul> i2c dev
> Current bus is 0
> isiotmx6ul> i2c speed 10
> Setting bus speed to 10 Hz
> isiotmx6ul> i2c probe
> Valid chip addresses: 00 2C 44 78
> isiotmx6ul> i2c md 2C 0xff
> 00ff: 00 00 00 00 0f f0 01 64 ff ff 00 00 00 00 00 00...d
> 
> Cc: Stefano Babic 
> Cc: Matteo Lisi 
> Cc: Michael Trimarchi 
> Signed-off-by: Jagan Teki 
> ---
>  arch/arm/cpu/armv7/mx6/Kconfig | 1 +
>  configs/imx6ul_isiot_mmc_defconfig | 2 ++
>  2 files changed, 3 insertions(+)
> 
> diff --git a/arch/arm/cpu/armv7/mx6/Kconfig b/arch/arm/cpu/armv7/mx6/Kconfig
> index 72780d7..b81e18c 100644
> --- a/arch/arm/cpu/armv7/mx6/Kconfig
> +++ b/arch/arm/cpu/armv7/mx6/Kconfig
> @@ -211,6 +211,7 @@ config TARGET_MX6UL_ISIOT
>   select OF_CONTROL
>   select DM
>   select DM_GPIO
> + select DM_I2C
>   select DM_MMC
>   select DM_THERMAL
>   select SUPPORT_SPL
> diff --git a/configs/imx6ul_isiot_mmc_defconfig 
> b/configs/imx6ul_isiot_mmc_defconfig
> index 66eb59f..7a7be23 100644
> --- a/configs/imx6ul_isiot_mmc_defconfig
> +++ b/configs/imx6ul_isiot_mmc_defconfig
> @@ -21,6 +21,7 @@ CONFIG_SYS_PROMPT="isiotmx6ul> "
>  # CONFIG_CMD_IMLS is not set
>  CONFIG_CMD_MEMTEST=y
>  CONFIG_CMD_MMC=y
> +CONFIG_CMD_I2C=y
>  CONFIG_CMD_GPIO=y
>  CONFIG_CMD_CACHE=y
>  CONFIG_CMD_EXT2=y
> @@ -29,6 +30,7 @@ CONFIG_CMD_EXT4_WRITE=y
>  CONFIG_CMD_FAT=y
>  CONFIG_CMD_FS_GENERIC=y
>  # CONFIG_BLK is not set
> +CONFIG_SYS_I2C_MXC=y
>  # CONFIG_DM_MMC_OPS is not set
>  CONFIG_PINCTRL=y
>  CONFIG_PINCTRL_IMX6=y
> 

Reviewed-by: Stefano Babic 

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
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] [PATCH v2 13/15] i.MX6Q: icorem6_rqs: Add modeboot env via board_late_init

2017-01-27 Thread Jagan Teki
From: Jagan Teki 

Add runtime, modeboot env which is setting mmcboot based
on the bootdevice so-that conditional macros for MMC via
CONFIG_BOOTCOMMAND should be avoided in config files.

Cc: Stefano Babic 
Cc: Matteo Lisi 
Cc: Michael Trimarchi 
Signed-off-by: Jagan Teki 
---
 board/engicam/icorem6_rqs/icorem6_rqs.c | 18 ++
 configs/imx6dl_icore_rqs_mmc_defconfig  |  1 +
 configs/imx6q_icore_rqs_mmc_defconfig   |  1 +
 include/configs/imx6qdl_icore_rqs.h | 32 
 4 files changed, 36 insertions(+), 16 deletions(-)

diff --git a/board/engicam/icorem6_rqs/icorem6_rqs.c 
b/board/engicam/icorem6_rqs/icorem6_rqs.c
index 66cf487..4bb43d1 100644
--- a/board/engicam/icorem6_rqs/icorem6_rqs.c
+++ b/board/engicam/icorem6_rqs/icorem6_rqs.c
@@ -45,6 +45,24 @@ int board_init(void)
return 0;
 }
 
+int board_late_init(void)
+{
+   switch ((imx6_src_get_boot_mode() & IMX6_BMODE_MASK) >>
+   IMX6_BMODE_SHIFT) {
+   case IMX6_BMODE_SD:
+   case IMX6_BMODE_ESD:
+   case IMX6_BMODE_MMC:
+   case IMX6_BMODE_EMMC:
+   setenv("modeboot", "mmcboot");
+   break;
+   default:
+   setenv("modeboot", "");
+   break;
+   }
+
+   return 0;
+}
+
 int dram_init(void)
 {
gd->ram_size = imx_ddr_size();
diff --git a/configs/imx6dl_icore_rqs_mmc_defconfig 
b/configs/imx6dl_icore_rqs_mmc_defconfig
index 3b10e99..b15fcb2 100644
--- a/configs/imx6dl_icore_rqs_mmc_defconfig
+++ b/configs/imx6dl_icore_rqs_mmc_defconfig
@@ -38,3 +38,4 @@ CONFIG_FEC_MXC=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX6=y
 CONFIG_MXC_UART=y
+CONFIG_BOARD_LATE_INIT=y
diff --git a/configs/imx6q_icore_rqs_mmc_defconfig 
b/configs/imx6q_icore_rqs_mmc_defconfig
index 8df4ef0..987fdf7 100644
--- a/configs/imx6q_icore_rqs_mmc_defconfig
+++ b/configs/imx6q_icore_rqs_mmc_defconfig
@@ -38,3 +38,4 @@ CONFIG_FEC_MXC=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX6=y
 CONFIG_MXC_UART=y
+CONFIG_BOARD_LATE_INIT=y
diff --git a/include/configs/imx6qdl_icore_rqs.h 
b/include/configs/imx6qdl_icore_rqs.h
index cd94c5f..c62c1d4 100644
--- a/include/configs/imx6qdl_icore_rqs.h
+++ b/include/configs/imx6qdl_icore_rqs.h
@@ -56,8 +56,7 @@
"fitboot=echo Booting FIT image from mmc ...; " \
"run mmcargs; " \
"bootm ${loadaddr}\0" \
-   "mmcboot=echo Booting from mmc ...; " \
-   "run mmcargs; " \
+   "_mmcboot=run mmcargs; " \
"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
"if run loadfdt; then " \
"bootm ${loadaddr} - ${fdt_addr}; " \
@@ -70,23 +69,24 @@
"fi; " \
"else " \
"bootm; " \
-   "fi\0"
-
-#define CONFIG_BOOTCOMMAND \
-   "mmc dev ${mmcdev};" \
-   "if mmc rescan; then " \
-   "if run loadbootscript; then " \
-   "run bootscript; " \
-   "else " \
-   "if run loadfit; then " \
-   "run fitboot; " \
+   "fi\0" \
+   "mmcboot=echo Booting from mmc ...; " \
+   "mmc dev ${mmcdev};" \
+   "if mmc rescan; then " \
+   "if run loadbootscript; then " \
+   "run bootscript; " \
"else " \
-   "if run loadimage; then " \
-   "run mmcboot; " \
+   "if run loadfit; then " \
+   "run fitboot; " \
+   "else " \
+   "if run loadimage; then " \
+   "run _mmcboot; " \
+   "fi; " \
"fi; " \
"fi; " \
-   "fi; " \
-   "fi"
+   "fi\0"
+
+#define CONFIG_BOOTCOMMAND "run $modeboot"
 
 /* Miscellaneous configurable options */
 #define CONFIG_SYS_MEMTEST_START   0x8000
-- 
1.9.1

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


[U-Boot] [PATCH v2 15/15] i.MX6Q: isiot: Switch the mmc env based on devno

2017-01-27 Thread Jagan Teki
From: Jagan Teki 

Add board_mmc_get_env_dev

Switch the mmc env based on the mmc devno, instead of separately
defining a config item in include/configs using board_mmc_get_env_dev
- devno 0: sd/esd
- devno 1: mmc/emmc

Cc: Stefano Babic 
Cc: Matteo Lisi 
Cc: Michael Trimarchi 
Signed-off-by: Jagan Teki 
---
 board/engicam/icorem6_rqs/icorem6_rqs.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/board/engicam/icorem6_rqs/icorem6_rqs.c 
b/board/engicam/icorem6_rqs/icorem6_rqs.c
index f289e91..d2f9309 100644
--- a/board/engicam/icorem6_rqs/icorem6_rqs.c
+++ b/board/engicam/icorem6_rqs/icorem6_rqs.c
@@ -47,6 +47,12 @@ int board_init(void)
 }
 
 #ifdef CONFIG_ENV_IS_IN_MMC
+int board_mmc_get_env_dev(int devno)
+{
+   /* dev 0 for SD/eSD, dev 1 for MMC/eMMC */
+   return (devno == 3) ? 1 : 0;
+}
+
 static void mmc_late_init(void)
 {
char cmd[32];
-- 
1.9.1

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


[U-Boot] [PATCH v2 12/15] imx6: icorem6_rqs: Add eMMC boot support

2017-01-27 Thread Jagan Teki
From: Jagan Teki 

Boot from eMMC:
--
U-Boot SPL 2017.01-00318-g8e243f8 (Jan 26 2017 - 11:53:21)
Trying to boot from MMC2

U-Boot 2017.01-00318-g8e243f8 (Jan 26 2017 - 11:53:21 +0100)

CPU:   Freescale i.MX6D rev1.2 at 792 MHz
Reset cause: POR
Model: Engicam i.CoreM6 Quad/Dual RQS Starter Kit
DRAM:  512 MiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
*** Warning - bad CRC, using default environment

In:serial
Out:   serial
Err:   serial
switch to partitions #0, OK
mmc1(part 0) is current device
Net:   No ethernet found.
Hit any key to stop autoboot:  0
Booting from mmc ...
switch to partitions #0, OK
mmc1(part 0) is current device

Cc: Stefano Babic 
Cc: Matteo Lisi 
Cc: Michael Trimarchi 
Signed-off-by: Jagan Teki 
---
 board/engicam/icorem6_rqs/icorem6_rqs.c | 24 ++--
 include/configs/imx6qdl_icore_rqs.h |  2 +-
 2 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/board/engicam/icorem6_rqs/icorem6_rqs.c 
b/board/engicam/icorem6_rqs/icorem6_rqs.c
index e3c520f..66cf487 100644
--- a/board/engicam/icorem6_rqs/icorem6_rqs.c
+++ b/board/engicam/icorem6_rqs/icorem6_rqs.c
@@ -77,8 +77,22 @@ static iomux_v3_cfg_t const usdhc3_pads[] = {
IOMUX_PADS(PAD_SD3_DAT3__SD3_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
 };
 
-struct fsl_esdhc_cfg usdhc_cfg[1] = {
+static iomux_v3_cfg_t const usdhc4_pads[] = {
+   IOMUX_PADS(PAD_SD4_CLK__SD4_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
+IOMUX_PADS(PAD_SD4_CMD__SD4_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
+IOMUX_PADS(PAD_SD4_DAT0__SD4_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
+IOMUX_PADS(PAD_SD4_DAT1__SD4_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
+IOMUX_PADS(PAD_SD4_DAT2__SD4_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
+IOMUX_PADS(PAD_SD4_DAT3__SD4_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
+IOMUX_PADS(PAD_SD4_DAT4__SD4_DATA4 | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
+IOMUX_PADS(PAD_SD4_DAT5__SD4_DATA5 | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
+IOMUX_PADS(PAD_SD4_DAT6__SD4_DATA6 | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
+IOMUX_PADS(PAD_SD4_DAT7__SD4_DATA7 | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
+};
+
+struct fsl_esdhc_cfg usdhc_cfg[2] = {
{USDHC3_BASE_ADDR, 1, 4},
+   {USDHC4_BASE_ADDR, 1, 8},
 };
 
 int board_mmc_getcd(struct mmc *mmc)
@@ -88,6 +102,7 @@ int board_mmc_getcd(struct mmc *mmc)
 
switch (cfg->esdhc_base) {
case USDHC3_BASE_ADDR:
+   case USDHC4_BASE_ADDR:
ret = 1;
break;
}
@@ -102,7 +117,8 @@ int board_mmc_init(bd_t *bis)
/*
* According to the board_mmc_init() the following map is done:
* (U-boot device node)(Physical Port)
-   * mmc0  USDHC3
+   * mmc0  USDHC3
+   * mmc1  USDHC4
*/
for (i = 0; i < CONFIG_SYS_FSL_USDHC_NUM; i++) {
switch (i) {
@@ -110,6 +126,10 @@ int board_mmc_init(bd_t *bis)
SETUP_IOMUX_PADS(usdhc3_pads);
usdhc_cfg[i].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK);
break;
+   case 1:
+   SETUP_IOMUX_PADS(usdhc4_pads);
+   usdhc_cfg[i].sdhc_clk = mxc_get_clock(MXC_ESDHC4_CLK);
+   break;
default:
printf("Warning - USDHC%d controller not supporting\n",
   i + 1);
diff --git a/include/configs/imx6qdl_icore_rqs.h 
b/include/configs/imx6qdl_icore_rqs.h
index 6f7195d..cd94c5f 100644
--- a/include/configs/imx6qdl_icore_rqs.h
+++ b/include/configs/imx6qdl_icore_rqs.h
@@ -124,7 +124,7 @@
 /* MMC */
 #ifdef CONFIG_FSL_USDHC
 # define CONFIG_SYS_MMC_ENV_DEV0
-# define CONFIG_SYS_FSL_USDHC_NUM  1
+# define CONFIG_SYS_FSL_USDHC_NUM  2
 # define CONFIG_SYS_FSL_ESDHC_ADDR 0
 #endif
 
-- 
1.9.1

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


[U-Boot] [PATCH v2 14/15] i.MX6Q: icorem6_rqs: Add mmc_late_init

2017-01-27 Thread Jagan Teki
From: Jagan Teki 

Let the runtime code can set the mmcdev and mmcroot based
on the devno using mmc_get_env_dev instead of defining
separately in build-time configs using mmc_late_init func.

Cc: Stefano Babic 
Cc: Matteo Lisi 
Cc: Michael Trimarchi 
Signed-off-by: Jagan Teki 
---
 board/engicam/icorem6_rqs/icorem6_rqs.c | 22 ++
 include/configs/imx6qdl_icore_rqs.h |  2 --
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/board/engicam/icorem6_rqs/icorem6_rqs.c 
b/board/engicam/icorem6_rqs/icorem6_rqs.c
index 4bb43d1..f289e91 100644
--- a/board/engicam/icorem6_rqs/icorem6_rqs.c
+++ b/board/engicam/icorem6_rqs/icorem6_rqs.c
@@ -7,6 +7,7 @@
  */
 
 #include 
+#include 
 
 #include 
 #include 
@@ -45,6 +46,24 @@ int board_init(void)
return 0;
 }
 
+#ifdef CONFIG_ENV_IS_IN_MMC
+static void mmc_late_init(void)
+{
+   char cmd[32];
+   char mmcblk[32];
+   u32 dev_no = mmc_get_env_dev();
+
+   setenv_ulong("mmcdev", dev_no);
+
+   /* Set mmcblk env */
+   sprintf(mmcblk, "/dev/mmcblk%dp2 rootwait rw", dev_no);
+   setenv("mmcroot", mmcblk);
+
+   sprintf(cmd, "mmc dev %d", dev_no);
+   run_command(cmd, 0);
+}
+#endif
+
 int board_late_init(void)
 {
switch ((imx6_src_get_boot_mode() & IMX6_BMODE_MASK) >>
@@ -53,6 +72,9 @@ int board_late_init(void)
case IMX6_BMODE_ESD:
case IMX6_BMODE_MMC:
case IMX6_BMODE_EMMC:
+#ifdef CONFIG_ENV_IS_IN_MMC
+   mmc_late_init();
+#endif
setenv("modeboot", "mmcboot");
break;
default:
diff --git a/include/configs/imx6qdl_icore_rqs.h 
b/include/configs/imx6qdl_icore_rqs.h
index c62c1d4..3358320 100644
--- a/include/configs/imx6qdl_icore_rqs.h
+++ b/include/configs/imx6qdl_icore_rqs.h
@@ -40,9 +40,7 @@
"fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
"fdt_addr=0x1800\0" \
"boot_fdt=try\0" \
-   "mmcdev=0\0" \
"mmcpart=1\0" \
-   "mmcroot=/dev/mmcblk0p2 rootwait rw\0" \
"mmcautodetect=yes\0" \
"mmcargs=setenv bootargs console=${console},${baudrate} " \
"root=${mmcroot}\0" \
-- 
1.9.1

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


[U-Boot] [PATCH v2 11/15] imx6: icorem6_rqs: Update SPL board boot order for eMMC

2017-01-27 Thread Jagan Teki
SPL mmc device index is get based on the boot device, like
- BOOT_DEVICE_MMC1 for mmc device 0
- BOOT_DEVICE_MMC2 for mmc device 1

Currently BOOT_DEVICE_MMC1 is setting both SD/eSD and MMC/eMMC
boot devices in i.MX, So u-boot is loading from mmc device 0 even
"if the board booting from SD/eSD or MMC/eMMC"

So, this patch set BOOT_DEVICE_MMC2 for MMC/eMMC so for MMC/eMMC
the u-boot is loading from mmc device 1 and the board file need to
take care if the board have different mmc device order intialization.

Cc: Stefano Babic 
Cc: Matteo Lisi 
Cc: Michael Trimarchi 
Signed-off-by: Jagan Teki 
---
 board/engicam/icorem6_rqs/icorem6_rqs.c | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/board/engicam/icorem6_rqs/icorem6_rqs.c 
b/board/engicam/icorem6_rqs/icorem6_rqs.c
index 2769177..e3c520f 100644
--- a/board/engicam/icorem6_rqs/icorem6_rqs.c
+++ b/board/engicam/icorem6_rqs/icorem6_rqs.c
@@ -125,6 +125,32 @@ int board_mmc_init(bd_t *bis)
 
return 0;
 }
+
+#ifdef CONFIG_ENV_IS_IN_MMC
+void board_boot_order(u32 *spl_boot_list)
+{
+   u32 bmode = imx6_src_get_boot_mode();
+   u8 boot_dev = BOOT_DEVICE_MMC1;
+
+   switch ((bmode & IMX6_BMODE_MASK) >> IMX6_BMODE_SHIFT) {
+   case IMX6_BMODE_SD:
+   case IMX6_BMODE_ESD:
+   /* SD/eSD - BOOT_DEVICE_MMC1 */
+   break;
+   case IMX6_BMODE_MMC:
+   case IMX6_BMODE_EMMC:
+   /* MMC/eMMC */
+   boot_dev = BOOT_DEVICE_MMC2;
+   break;
+   default:
+   /* Default - BOOT_DEVICE_MMC1 */
+   printf("Wrong board boot order\n");
+   break;
+   }
+
+   spl_boot_list[0] = boot_dev;
+}
+#endif
 #endif
 
 /*
-- 
1.9.1

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


[U-Boot] [PATCH v2 10/15] arm: dts: imx6qdl-icore-rqs: Add eMMC node

2017-01-27 Thread Jagan Teki
Add usdhc4 node, which is eMMC for Engicam i.CoreM6 RQS modules.

eMMC Log:

icorem6qdl-rqs> mmc dev 1
switch to partitions #0, OK
mmc1(part 0) is current device
icorem6qdl-rqs> mmcinfo
Device: FSL_SDHC
Manufacturer ID: fe
OEM: 14e
Name: MMC04
Tran Speed: 5200
Rd Block Len: 512
MMC version 4.4.1
High Capacity: Yes
Capacity: 3.5 GiB
Bus Width: 4-bit
Erase Group Size: 512 KiB
HC WP Group Size: 4 MiB
User Capacity: 3.5 GiB
Boot Capacity: 16 MiB ENH
RPMB Capacity: 128 KiB ENH

Cc: Stefano Babic 
Cc: Matteo Lisi 
Cc: Michael Trimarchi 
Signed-off-by: Jagan Teki 
---
 arch/arm/dts/imx6qdl-icore-rqs.dtsi | 22 ++
 1 file changed, 22 insertions(+)

diff --git a/arch/arm/dts/imx6qdl-icore-rqs.dtsi 
b/arch/arm/dts/imx6qdl-icore-rqs.dtsi
index 750229b..8b9d5b4 100644
--- a/arch/arm/dts/imx6qdl-icore-rqs.dtsi
+++ b/arch/arm/dts/imx6qdl-icore-rqs.dtsi
@@ -107,6 +107,13 @@
status = "okay";
 };
 
+ {
+   pinctrl-names = "default";
+   pinctrl-0 = <_usdhc4>;
+   no-1-8-v;
+   status = "okay";
+};
+
  {
pinctrl_enet: enetgrp {
fsl,pins = <
@@ -167,4 +174,19 @@
MX6QDL_PAD_SD3_DAT3__SD3_DATA3 0x17070
>;
};
+
+   pinctrl_usdhc4: usdhc4grp {
+   fsl,pins = <
+   MX6QDL_PAD_SD4_CMD__SD4_CMD0x17070
+   MX6QDL_PAD_SD4_CLK__SD4_CLK0x10070
+   MX6QDL_PAD_SD4_DAT0__SD4_DATA0 0x17070
+   MX6QDL_PAD_SD4_DAT1__SD4_DATA1 0x17070
+   MX6QDL_PAD_SD4_DAT2__SD4_DATA2 0x17070
+   MX6QDL_PAD_SD4_DAT3__SD4_DATA3 0x17070
+   MX6QDL_PAD_SD4_DAT4__SD4_DATA4 0x17070
+   MX6QDL_PAD_SD4_DAT5__SD4_DATA5 0x17070
+   MX6QDL_PAD_SD4_DAT6__SD4_DATA6 0x17070
+   MX6QDL_PAD_SD4_DAT7__SD4_DATA7 0x17070
+   >;
+   };
 };
-- 
1.9.1

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


[U-Boot] [PATCH v2 08/15] i.MX6UL: isiot: Add mmc_late_init

2017-01-27 Thread Jagan Teki
From: Jagan Teki 

Let the runtime code can set the mmcdev and mmcroot based
on the devno using mmc_get_env_dev instead of defining
separately in build-time configs using mmc_late_init func.

Cc: Stefano Babic 
Cc: Matteo Lisi 
Cc: Michael Trimarchi 
Signed-off-by: Jagan Teki 
---
 board/engicam/isiotmx6ul/isiotmx6ul.c | 22 ++
 include/configs/imx6ul_isiot.h|  2 --
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/board/engicam/isiotmx6ul/isiotmx6ul.c 
b/board/engicam/isiotmx6ul/isiotmx6ul.c
index 3fc5bca..920d317 100644
--- a/board/engicam/isiotmx6ul/isiotmx6ul.c
+++ b/board/engicam/isiotmx6ul/isiotmx6ul.c
@@ -7,6 +7,7 @@
  */
 
 #include 
+#include 
 
 #include 
 #include 
@@ -103,6 +104,24 @@ static void setup_gpmi_nand(void)
 }
 #endif /* CONFIG_NAND_MXS */
 
+#ifdef CONFIG_ENV_IS_IN_MMC
+static void mmc_late_init(void)
+{
+   char cmd[32];
+   char mmcblk[32];
+   u32 dev_no = mmc_get_env_dev();
+
+   setenv_ulong("mmcdev", dev_no);
+
+   /* Set mmcblk env */
+   sprintf(mmcblk, "/dev/mmcblk%dp2 rootwait rw", dev_no);
+   setenv("mmcroot", mmcblk);
+
+   sprintf(cmd, "mmc dev %d", dev_no);
+   run_command(cmd, 0);
+}
+#endif
+
 int board_late_init(void)
 {
switch ((imx6_src_get_boot_mode() & IMX6_BMODE_MASK) >>
@@ -111,6 +130,9 @@ int board_late_init(void)
case IMX6_BMODE_ESD:
case IMX6_BMODE_MMC:
case IMX6_BMODE_EMMC:
+#ifdef CONFIG_ENV_IS_IN_MMC
+   mmc_late_init();
+#endif
setenv("modeboot", "mmcboot");
break;
case IMX6_BMODE_NAND:
diff --git a/include/configs/imx6ul_isiot.h b/include/configs/imx6ul_isiot.h
index 7258fed..4009648 100644
--- a/include/configs/imx6ul_isiot.h
+++ b/include/configs/imx6ul_isiot.h
@@ -45,9 +45,7 @@
"fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
"fdt_addr=0x8780\0" \
"boot_fdt=try\0" \
-   "mmcdev=0\0" \
"mmcpart=1\0" \
-   "mmcroot=/dev/mmcblk0p2 rootwait rw\0" \
"nandroot=ubi0:rootfs rootfstype=ubifs\0" \
"mmcautodetect=yes\0" \
"mmcargs=setenv bootargs console=${console},${baudrate} " \
-- 
1.9.1

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


[U-Boot] [PATCH v2 09/15] i.MX6UL: isiot: Switch the mmc env based on devno

2017-01-27 Thread Jagan Teki
From: Jagan Teki 

Add board_mmc_get_env_dev

Switch the mmc env based on the mmc devno, instead of separately
defining a config item in include/configs using board_mmc_get_env_dev
- devno 0: sd/esd
- devno 1: mmc/emmc

Cc: Stefano Babic 
Cc: Matteo Lisi 
Cc: Michael Trimarchi 
Signed-off-by: Jagan Teki 
---
 board/engicam/isiotmx6ul/isiotmx6ul.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/board/engicam/isiotmx6ul/isiotmx6ul.c 
b/board/engicam/isiotmx6ul/isiotmx6ul.c
index 920d317..df432a1 100644
--- a/board/engicam/isiotmx6ul/isiotmx6ul.c
+++ b/board/engicam/isiotmx6ul/isiotmx6ul.c
@@ -105,6 +105,12 @@ static void setup_gpmi_nand(void)
 #endif /* CONFIG_NAND_MXS */
 
 #ifdef CONFIG_ENV_IS_IN_MMC
+int board_mmc_get_env_dev(int devno)
+{
+   /* dev 0 for SD/eSD, dev 1 for MMC/eMMC */
+   return (devno == 0) ? 0 : 1;
+}
+
 static void mmc_late_init(void)
 {
char cmd[32];
-- 
1.9.1

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


[U-Boot] [PATCH v2 06/15] i.MX6UL: isiot: Add eMMC boot support

2017-01-27 Thread Jagan Teki
From: Jagan Teki 

Boot from eMMC:
--
U-Boot SPL 2017.01-00314-gd0cd9cd-dirty (Jan 25 2017 - 13:25:27)
Trying to boot from MMC2

U-Boot 2017.01-00314-gd0cd9cd-dirty (Jan 25 2017 - 13:25:27 +0100)

CPU:   Freescale i.MX6UL rev1.1 528 MHz (running at 396 MHz)
CPU:   Industrial temperature grade (-40C to 105C) at 36C
Reset cause: POR
Model: Engicam Is.IoT MX6UL eMMC Starterkit
DRAM:  512 MiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
*** Warning - bad CRC, using default environment

In:serial
Out:   serial
Err:   serial
switch to partitions #0, OK
mmc1(part 0) is current device

Cc: Stefano Babic 
Cc: Matteo Lisi 
Cc: Michael Trimarchi 
Signed-off-by: Jagan Teki 
---
 arch/arm/dts/Makefile |  1 +
 arch/arm/dts/imx6ul-isiot-emmc.dts| 77 +++
 board/engicam/isiotmx6ul/MAINTAINERS  |  1 +
 board/engicam/isiotmx6ul/isiotmx6ul.c | 26 +++-
 configs/imx6ul_isiot_emmc_defconfig   | 39 ++
 include/configs/imx6ul_isiot.h|  2 +-
 6 files changed, 144 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/dts/imx6ul-isiot-emmc.dts
 create mode 100644 configs/imx6ul_isiot_emmc_defconfig

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 09e3bdb..cde7f41 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -314,6 +314,7 @@ dtb-$(CONFIG_MX6) += imx6ull-14x14-evk.dtb \
imx6q-icore.dtb \
imx6q-icore-rqs.dtb \
imx6ul-geam-kit.dtb \
+   imx6ul-isiot-emmc.dtb \
imx6ul-isiot-mmc.dtb \
imx6ul-isiot-nand.dtb
 
diff --git a/arch/arm/dts/imx6ul-isiot-emmc.dts 
b/arch/arm/dts/imx6ul-isiot-emmc.dts
new file mode 100644
index 000..677de96
--- /dev/null
+++ b/arch/arm/dts/imx6ul-isiot-emmc.dts
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2016 Amarula Solutions B.V.
+ * Copyright (C) 2016 Engicam S.r.l.
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This file is distributed in the hope that it will be useful
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * Or, alternatively
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+
+#include "imx6ul-isiot.dtsi"
+
+/ {
+   model = "Engicam Is.IoT MX6UL eMMC Starterkit";
+   compatible = "engicam,imx6ul-isiot", "fsl,imx6ul";
+};
+
+ {
+   pinctrl-names = "default";
+   pinctrl-0 = <_usdhc2>;
+   cd-gpios = < 5 GPIO_ACTIVE_LOW>;
+   bus-width = <8>;
+   no-1-8-v;
+   status = "okay";
+};
+
+ {
+   pinctrl_usdhc2: usdhc2grp {
+   fsl,pins = <
+   MX6UL_PAD_NAND_RE_B__USDHC2_CLK  0x17070
+   MX6UL_PAD_NAND_WE_B__USDHC2_CMD  0x10070
+   MX6UL_PAD_NAND_DATA00__USDHC2_DATA0  0x17070
+   MX6UL_PAD_NAND_DATA01__USDHC2_DATA1  0x17070
+   MX6UL_PAD_NAND_DATA02__USDHC2_DATA2  0x17070
+   MX6UL_PAD_NAND_DATA03__USDHC2_DATA3  0x17070
+   MX6UL_PAD_NAND_DATA04__USDHC2_DATA4  0x17070
+   MX6UL_PAD_NAND_DATA05__USDHC2_DATA5  0x17070
+   MX6UL_PAD_NAND_DATA06__USDHC2_DATA6  0x17070
+   MX6UL_PAD_NAND_DATA07__USDHC2_DATA7  0x17070
+  

[U-Boot] [PATCH v2 07/15] i.MX6UL: isiot: Add modeboot env via board_late_init

2017-01-27 Thread Jagan Teki
From: Jagan Teki 

Add runtime, modeboot env which is setting mmcboot, or
nandboot based on the bootdevice so-that conditional
macros b/w MMC and NAND for CONFIG_BOOTCOMMAND should
be avoided in config files.

Cc: Stefano Babic 
Cc: Matteo Lisi 
Cc: Michael Trimarchi 
Signed-off-by: Jagan Teki 
---
 board/engicam/isiotmx6ul/isiotmx6ul.c | 21 
 configs/imx6ul_isiot_emmc_defconfig   |  1 +
 configs/imx6ul_isiot_mmc_defconfig|  1 +
 configs/imx6ul_isiot_nand_defconfig   |  1 +
 include/configs/imx6ul_isiot.h| 36 ---
 5 files changed, 40 insertions(+), 20 deletions(-)

diff --git a/board/engicam/isiotmx6ul/isiotmx6ul.c 
b/board/engicam/isiotmx6ul/isiotmx6ul.c
index 17c19e0..3fc5bca 100644
--- a/board/engicam/isiotmx6ul/isiotmx6ul.c
+++ b/board/engicam/isiotmx6ul/isiotmx6ul.c
@@ -103,6 +103,27 @@ static void setup_gpmi_nand(void)
 }
 #endif /* CONFIG_NAND_MXS */
 
+int board_late_init(void)
+{
+   switch ((imx6_src_get_boot_mode() & IMX6_BMODE_MASK) >>
+   IMX6_BMODE_SHIFT) {
+   case IMX6_BMODE_SD:
+   case IMX6_BMODE_ESD:
+   case IMX6_BMODE_MMC:
+   case IMX6_BMODE_EMMC:
+   setenv("modeboot", "mmcboot");
+   break;
+   case IMX6_BMODE_NAND:
+   setenv("modeboot", "nandboot");
+   break;
+   default:
+   setenv("modeboot", "");
+   break;
+   }
+
+   return 0;
+}
+
 int board_init(void)
 {
/* Address of boot parameters */
diff --git a/configs/imx6ul_isiot_emmc_defconfig 
b/configs/imx6ul_isiot_emmc_defconfig
index 94fe808..4c3664f 100644
--- a/configs/imx6ul_isiot_emmc_defconfig
+++ b/configs/imx6ul_isiot_emmc_defconfig
@@ -37,3 +37,4 @@ CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX6=y
 CONFIG_MXC_UART=y
 CONFIG_IMX_THERMAL=y
+CONFIG_BOARD_LATE_INIT=y
diff --git a/configs/imx6ul_isiot_mmc_defconfig 
b/configs/imx6ul_isiot_mmc_defconfig
index 8ecdd8e..ea2d378 100644
--- a/configs/imx6ul_isiot_mmc_defconfig
+++ b/configs/imx6ul_isiot_mmc_defconfig
@@ -39,3 +39,4 @@ CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX6=y
 CONFIG_MXC_UART=y
 CONFIG_IMX_THERMAL=y
+CONFIG_BOARD_LATE_INIT=y
diff --git a/configs/imx6ul_isiot_nand_defconfig 
b/configs/imx6ul_isiot_nand_defconfig
index 6f1a054..f02a2ac 100644
--- a/configs/imx6ul_isiot_nand_defconfig
+++ b/configs/imx6ul_isiot_nand_defconfig
@@ -40,3 +40,4 @@ CONFIG_PINCTRL_IMX6=y
 CONFIG_SYS_I2C_MXC=y
 CONFIG_MXC_UART=y
 CONFIG_IMX_THERMAL=y
+CONFIG_BOARD_LATE_INIT=y
diff --git a/include/configs/imx6ul_isiot.h b/include/configs/imx6ul_isiot.h
index 1b0e436..7258fed 100644
--- a/include/configs/imx6ul_isiot.h
+++ b/include/configs/imx6ul_isiot.h
@@ -64,8 +64,7 @@
"fitboot=echo Booting FIT image from mmc ...; " \
"run mmcargs; " \
"bootm ${loadaddr}\0" \
-   "mmcboot=echo Booting from mmc ...; " \
-   "run mmcargs; " \
+   "_mmcboot=run mmcargs; " \
"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
"if run loadfdt; then " \
"bootm ${loadaddr} - ${fdt_addr}; " \
@@ -79,6 +78,20 @@
"else " \
"bootm; " \
"fi\0" \
+   "mmcboot=echo Booting from mmc ...; " \
+   "if mmc rescan; then " \
+   "if run loadbootscript; then " \
+   "run bootscript; " \
+   "else " \
+   "if run loadfit; then " \
+   "run fitboot; " \
+   "else " \
+   "if run loadimage; then " \
+   "run _mmcboot; " \
+   "fi; " \
+   "fi; " \
+   "fi; " \
+   "fi\0" \
"nandboot=echo Booting from nand ...; " \
"if mtdparts; then " \
"echo Starting nand boot ...; " \
@@ -90,24 +103,7 @@
"nand read ${fdt_addr} dtb 0x10; " \
"bootm ${loadaddr} - ${fdt_addr}\0"
 
-#ifdef CONFIG_NAND_MXS
-# define CONFIG_BOOTCOMMAND"run nandboot"
-#else
-# define CONFIG_BOOTCOMMAND \
-   "if mmc rescan; then " \
-   "if run loadbootscript; then " \
-   "run bootscript; " \
-   "else " \
-   "if run loadfit; then " \
-   "run fitboot; " \
-   "else " \
-   "if run loadimage; then " \
-   "run mmcboot; " \
-   "fi; " \
-   "fi; " \
-   "fi; " \
-   "fi"
-#endif

[U-Boot] [PATCH v2 05/15] imx6: isiotmx6ul: Update SPL board boot order for eMMC

2017-01-27 Thread Jagan Teki
From: Jagan Teki 

SPL mmc device index is get based on the boot device, like
- BOOT_DEVICE_MMC1 for mmc device 0
- BOOT_DEVICE_MMC2 for mmc device 1

Currently BOOT_DEVICE_MMC1 is setting both SD/eSD and MMC/eMMC
boot devices in i.MX, So u-boot is loading from mmc device 0 even
"if the board booting from SD/eSD or MMC/eMMC"

So, this patch set BOOT_DEVICE_MMC2 for MMC/eMMC so for MMC/eMMC
the u-boot is loading from mmc device 1 and the board file need to
take care if the board have different mmc device order intialization.

Cc: Stefano Babic 
Cc: Matteo Lisi 
Cc: Michael Trimarchi 
Signed-off-by: Jagan Teki 
---
 board/engicam/isiotmx6ul/isiotmx6ul.c | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/board/engicam/isiotmx6ul/isiotmx6ul.c 
b/board/engicam/isiotmx6ul/isiotmx6ul.c
index ae3465f..6b84f02 100644
--- a/board/engicam/isiotmx6ul/isiotmx6ul.c
+++ b/board/engicam/isiotmx6ul/isiotmx6ul.c
@@ -205,6 +205,32 @@ int board_mmc_init(bd_t *bis)
 
return 0;
 }
+
+#ifdef CONFIG_ENV_IS_IN_MMC
+void board_boot_order(u32 *spl_boot_list)
+{
+   u32 bmode = imx6_src_get_boot_mode();
+   u8 boot_dev = BOOT_DEVICE_MMC1;
+
+   switch ((bmode & IMX6_BMODE_MASK) >> IMX6_BMODE_SHIFT) {
+   case IMX6_BMODE_SD:
+   case IMX6_BMODE_ESD:
+   /* SD/eSD - BOOT_DEVICE_MMC1 */
+   break;
+   case IMX6_BMODE_MMC:
+   case IMX6_BMODE_EMMC:
+   /* MMC/eMMC */
+   boot_dev = BOOT_DEVICE_MMC2;
+   break;
+   default:
+   /* Default - BOOT_DEVICE_MMC1 */
+   printf("Wrong board boot order\n");
+   break;
+   }
+
+   spl_boot_list[0] = boot_dev;
+}
+#endif
 #endif /* CONFIG_FSL_ESDHC */
 
 static struct mx6ul_iomux_grp_regs mx6_grp_ioregs = {
-- 
1.9.1

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


[U-Boot] [PATCH v2 04/15] imx6: Add src_base structure define macro

2017-01-27 Thread Jagan Teki
Instead of initializing 'struct src' to SRC_BASE_ADDR on
every function better to have global define macro.

Cc: Stefano Babic 
Signed-off-by: Jagan Teki 
---
 arch/arm/imx-common/init.c  | 6 ++
 arch/arm/imx-common/spl.c   | 3 +--
 arch/arm/include/asm/arch-mx6/imx-regs.h| 2 ++
 arch/arm/include/asm/imx-common/sys_proto.h | 4 +---
 4 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/arch/arm/imx-common/init.c b/arch/arm/imx-common/init.c
index 036ebb2..5b4f828 100644
--- a/arch/arm/imx-common/init.c
+++ b/arch/arm/imx-common/init.c
@@ -119,11 +119,9 @@ void boot_mode_apply(unsigned cfg_val)
 #if defined(CONFIG_MX6)
 u32 imx6_src_get_boot_mode(void)
 {
-   struct src *psrc = (struct src *)SRC_BASE_ADDR;
-
if (imx6_is_bmode_from_gpr9())
-   return readl(>gpr9);
+   return readl(_base->gpr9);
else
-   return readl(>sbmr1);
+   return readl(_base->sbmr1);
 }
 #endif
diff --git a/arch/arm/imx-common/spl.c b/arch/arm/imx-common/spl.c
index 38789b2..4d73a67 100644
--- a/arch/arm/imx-common/spl.c
+++ b/arch/arm/imx-common/spl.c
@@ -19,8 +19,7 @@
 /* determine boot device from SRC_SBMR1 (BOOT_CFG[4:1]) or SRC_GPR9 register */
 u32 spl_boot_device(void)
 {
-   struct src *psrc = (struct src *)SRC_BASE_ADDR;
-   unsigned int bmode = readl(>sbmr2);
+   unsigned int bmode = readl(_base->sbmr2);
u32 reg = imx6_src_get_boot_mode();
 
/*
diff --git a/arch/arm/include/asm/arch-mx6/imx-regs.h 
b/arch/arm/include/asm/arch-mx6/imx-regs.h
index 6727c56..646013d 100644
--- a/arch/arm/include/asm/arch-mx6/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx6/imx-regs.h
@@ -473,6 +473,8 @@ struct src {
u32 gpr10;
 };
 
+#define src_base ((struct src *)SRC_BASE_ADDR)
+
 #define SRC_SCR_M4_ENABLE_OFFSET22
 #define SRC_SCR_M4_ENABLE_MASK  (1 << 22)
 #define SRC_SCR_M4C_NON_SCLR_RST_OFFSET 4
diff --git a/arch/arm/include/asm/imx-common/sys_proto.h 
b/arch/arm/include/asm/imx-common/sys_proto.h
index d0cf3f1..d149c9f 100644
--- a/arch/arm/include/asm/imx-common/sys_proto.h
+++ b/arch/arm/include/asm/imx-common/sys_proto.h
@@ -78,9 +78,7 @@ enum imx6_bmode {
 
 static inline u8 imx6_is_bmode_from_gpr9(void)
 {
-   struct src *psrc = (struct src *)SRC_BASE_ADDR;
-
-   return readl(>gpr10) & IMX6_SRC_GPR10_BMODE;
+   return readl(_base->gpr10) & IMX6_SRC_GPR10_BMODE;
 }
 
 u32 imx6_src_get_boot_mode(void);
-- 
1.9.1

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


[U-Boot] [PATCH v2 02/15] imx: spl: Update NAND bootmode detection bit

2017-01-27 Thread Jagan Teki
BOOT_CFG1[7:4] the NAND boot mode selection is done
only when BOOT_CFG1[7] is 1 hence update the NAND
boot mode detection bit case. This information available
on Table 8-11. NAND Boot eFUSE Descriptions, from IMX6DQRM.

Cc: Stefano Babic 
Cc: Tim Harvey 
Signed-off-by: Jagan Teki 
---
 arch/arm/imx-common/spl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/imx-common/spl.c b/arch/arm/imx-common/spl.c
index a7f9705..fc3704b 100644
--- a/arch/arm/imx-common/spl.c
+++ b/arch/arm/imx-common/spl.c
@@ -61,8 +61,8 @@ u32 spl_boot_device(void)
case 0x6:
case 0x7:
return BOOT_DEVICE_MMC1;
-   /* NAND Flash: 8.5.2 */
-   case 0x8 ... 0xf:
+   /* NAND Flash: 8.5.2, Table 8-10 */
+   case 0x8:
return BOOT_DEVICE_NAND;
}
return BOOT_DEVICE_NONE;
-- 
1.9.1

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


[U-Boot] [PATCH v2 03/15] imx: Use IMX6_BMODE_* macros instead of numericals

2017-01-27 Thread Jagan Teki
Use meaningful meacros IMX6_BMODE_*, instead of numerical
number in boot mode detection code.

Cc: Stefano Babic 
Cc: Tim Harvey 
Signed-off-by: Jagan Teki 
---
 arch/arm/imx-common/spl.c   | 39 ++---
 arch/arm/include/asm/imx-common/sys_proto.h | 34 +
 2 files changed, 58 insertions(+), 15 deletions(-)

diff --git a/arch/arm/imx-common/spl.c b/arch/arm/imx-common/spl.c
index fc3704b..38789b2 100644
--- a/arch/arm/imx-common/spl.c
+++ b/arch/arm/imx-common/spl.c
@@ -30,39 +30,48 @@ u32 spl_boot_device(void)
if bmode >> 24) & 0x03)  == 0x01) || /* Serial Downloader */
(imx6_is_bmode_from_gpr9() && (reg == 1)))
return BOOT_DEVICE_UART;
+
/* BOOT_CFG1[7:4] - see IMX6DQRM Table 8-8 */
-   switch ((reg & 0x00FF) >> 4) {
+   switch ((reg & IMX6_BMODE_MASK) >> IMX6_BMODE_SHIFT) {
 /* EIM: See 8.5.1, Table 8-9 */
-   case 0x0:
+   case IMX6_BMODE_EMI:
/* BOOT_CFG1[3]: NOR/OneNAND Selection */
-   if ((reg & 0x0008) >> 3)
+   switch ((reg & IMX6_BMODE_EMI_MASK) >> IMX6_BMODE_EMI_SHIFT) {
+   case IMX6_BMODE_ONENAND:
return BOOT_DEVICE_ONENAND;
-   else
+   case IMX6_BMODE_NOR:
return BOOT_DEVICE_NOR;
-   break;
+   }
/* SATA: See 8.5.4, Table 8-20 */
-   case 0x2:
+   case IMX6_BMODE_SATA:
return BOOT_DEVICE_SATA;
/* Serial ROM: See 8.5.5.1, Table 8-22 */
-   case 0x3:
+   case IMX6_BMODE_SERIAL:
/* BOOT_CFG4[2:0] */
-   switch ((reg & 0x0700) >> 24) {
-   case 0x0 ... 0x4:
+   switch ((reg & IMX6_BMODE_SERIAL_MASK) >>
+   IMX6_BMODE_SERIAL_SHIFT) {
+   case IMX6_BMODE_ECSPI1:
+   case IMX6_BMODE_ECSPI2:
+   case IMX6_BMODE_ECSPI3:
+   case IMX6_BMODE_ECSPI4:
+   case IMX6_BMODE_ECSPI5:
return BOOT_DEVICE_SPI;
-   case 0x5 ... 0x7:
+   case IMX6_BMODE_I2C1:
+   case IMX6_BMODE_I2C2:
+   case IMX6_BMODE_I2C3:
return BOOT_DEVICE_I2C;
}
break;
/* SD/eSD: 8.5.3, Table 8-15  */
-   case 0x4:
-   case 0x5:
+   case IMX6_BMODE_SD:
+   case IMX6_BMODE_ESD:
return BOOT_DEVICE_MMC1;
/* MMC/eMMC: 8.5.3 */
-   case 0x6:
-   case 0x7:
+   case IMX6_BMODE_MMC:
+   case IMX6_BMODE_EMMC:
return BOOT_DEVICE_MMC1;
/* NAND Flash: 8.5.2, Table 8-10 */
-   case 0x8:
+   case IMX6_BMODE_NAND:
return BOOT_DEVICE_NAND;
}
return BOOT_DEVICE_NONE;
diff --git a/arch/arm/include/asm/imx-common/sys_proto.h 
b/arch/arm/include/asm/imx-common/sys_proto.h
index 99e3869..d0cf3f1 100644
--- a/arch/arm/include/asm/imx-common/sys_proto.h
+++ b/arch/arm/include/asm/imx-common/sys_proto.h
@@ -42,6 +42,40 @@
 #ifdef CONFIG_MX6
 #define IMX6_SRC_GPR10_BMODE   BIT(28)
 
+#define IMX6_BMODE_MASKGENMASK(7, 0)
+#defineIMX6_BMODE_SHIFTBIT(2)
+#define IMX6_BMODE_EMI_MASKBIT(3)
+#define IMX6_BMODE_EMI_SHIFT   GENMASK(1, 0)
+#define IMX6_BMODE_SERIAL_MASK GENMASK(26, 24)
+#define IMX6_BMODE_SERIAL_SHIFTGENMASK(4, 3)
+
+enum imx6_bmode_serial {
+   IMX6_BMODE_ECSPI1,
+   IMX6_BMODE_ECSPI2,
+   IMX6_BMODE_ECSPI3,
+   IMX6_BMODE_ECSPI4,
+   IMX6_BMODE_ECSPI5,
+   IMX6_BMODE_I2C1,
+   IMX6_BMODE_I2C2,
+   IMX6_BMODE_I2C3,
+};
+
+enum imx6_bmode_emi {
+   IMX6_BMODE_ONENAND,
+   IMX6_BMODE_NOR,
+};
+
+enum imx6_bmode {
+   IMX6_BMODE_EMI,
+   IMX6_BMODE_SATA = 0x2,
+   IMX6_BMODE_SERIAL,
+   IMX6_BMODE_SD,
+   IMX6_BMODE_ESD,
+   IMX6_BMODE_MMC,
+   IMX6_BMODE_EMMC,
+   IMX6_BMODE_NAND,
+};
+
 static inline u8 imx6_is_bmode_from_gpr9(void)
 {
struct src *psrc = (struct src *)SRC_BASE_ADDR;
-- 
1.9.1

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


[U-Boot] [PATCH v2 01/15] imx6: Add imx6_src_get_boot_mode

2017-01-27 Thread Jagan Teki
For i.MX6, the bootmode determine code is part of spl_boot_device,
but there is might be a possibility for other part the code need to
check the desired boot mode for adding new functionalities like
modeboot env variable, or changing boot order etc.

So introduced imx6_src_get_boot_mode which actually reading the
boot mode register for desired modes.

More cleanup will be add in future patches.

Cc: Stefano Babic 
Cc: Tim Harvey 
Cc: Matteo Lisi 
Cc: Michael Trimarchi 
Signed-off-by: Jagan Teki 
---
 arch/arm/imx-common/init.c  | 12 
 arch/arm/imx-common/spl.c   |  6 +++---
 arch/arm/include/asm/imx-common/sys_proto.h | 14 ++
 3 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/arch/arm/imx-common/init.c b/arch/arm/imx-common/init.c
index e5dbd93..036ebb2 100644
--- a/arch/arm/imx-common/init.c
+++ b/arch/arm/imx-common/init.c
@@ -115,3 +115,15 @@ void boot_mode_apply(unsigned cfg_val)
writel(reg, >gpr10);
 }
 #endif
+
+#if defined(CONFIG_MX6)
+u32 imx6_src_get_boot_mode(void)
+{
+   struct src *psrc = (struct src *)SRC_BASE_ADDR;
+
+   if (imx6_is_bmode_from_gpr9())
+   return readl(>gpr9);
+   else
+   return readl(>sbmr1);
+}
+#endif
diff --git a/arch/arm/imx-common/spl.c b/arch/arm/imx-common/spl.c
index 60c4adf..a7f9705 100644
--- a/arch/arm/imx-common/spl.c
+++ b/arch/arm/imx-common/spl.c
@@ -10,6 +10,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -19,16 +20,15 @@
 u32 spl_boot_device(void)
 {
struct src *psrc = (struct src *)SRC_BASE_ADDR;
-   unsigned int gpr10_boot = readl(>gpr10) & (1 << 28);
-   unsigned reg = gpr10_boot ? readl(>gpr9) : readl(>sbmr1);
unsigned int bmode = readl(>sbmr2);
+   u32 reg = imx6_src_get_boot_mode();
 
/*
 * Check for BMODE if serial downloader is enabled
 * BOOT_MODE - see IMX6DQRM Table 8-1
 */
if bmode >> 24) & 0x03)  == 0x01) || /* Serial Downloader */
-   (gpr10_boot && (reg == 1)))
+   (imx6_is_bmode_from_gpr9() && (reg == 1)))
return BOOT_DEVICE_UART;
/* BOOT_CFG1[7:4] - see IMX6DQRM Table 8-8 */
switch ((reg & 0x00FF) >> 4) {
diff --git a/arch/arm/include/asm/imx-common/sys_proto.h 
b/arch/arm/include/asm/imx-common/sys_proto.h
index 539d34b..99e3869 100644
--- a/arch/arm/include/asm/imx-common/sys_proto.h
+++ b/arch/arm/include/asm/imx-common/sys_proto.h
@@ -8,6 +8,7 @@
 #ifndef _SYS_PROTO_H_
 #define _SYS_PROTO_H_
 
+#include 
 #include 
 #include 
 #include "../arch-imx/cpu.h"
@@ -38,6 +39,19 @@
 #define is_mx6ull() (is_cpu_type(MXC_CPU_MX6ULL))
 #define is_mx6sll() (is_cpu_type(MXC_CPU_MX6SLL))
 
+#ifdef CONFIG_MX6
+#define IMX6_SRC_GPR10_BMODE   BIT(28)
+
+static inline u8 imx6_is_bmode_from_gpr9(void)
+{
+   struct src *psrc = (struct src *)SRC_BASE_ADDR;
+
+   return readl(>gpr10) & IMX6_SRC_GPR10_BMODE;
+}
+
+u32 imx6_src_get_boot_mode(void);
+#endif /* CONFIG_MX6 */
+
 u32 get_nr_cpus(void);
 u32 get_cpu_rev(void);
 u32 get_cpu_speed_grade_hz(void);
-- 
1.9.1

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


[U-Boot] [PATC v2 00/15] imx6: Engicam i.CoreM6/Is.IoT eMMC boot support

2017-01-27 Thread Jagan Teki
From: Jagan Teki 

This series support boot from eMMC on Engicam i.CoreM6 QDL/Is.IoT boards.

Changes for v2:
- Rebase on master
- Add Is.IoT eMMC boot patches
- Add few mmc env patches on board

Jagan Teki (15):
  imx6: Add imx6_src_get_boot_mode
  imx: spl: Update NAND bootmode detection bit
  imx: Use IMX6_BMODE_* macros instead of numericals
  imx6: Add src_base structure define macro
  imx6: isiotmx6ul: Update SPL board boot order for eMMC
  i.MX6UL: isiot: Add eMMC boot support
  i.MX6UL: isiot: Add modeboot env via board_late_init
  i.MX6UL: isiot: Add mmc_late_init
  i.MX6UL: isiot: Switch the mmc env based on devno
  arm: dts: imx6qdl-icore-rqs: Add eMMC node
  imx6: icorem6_rqs: Update SPL board boot order for eMMC
  imx6: icorem6_rqs: Add eMMC boot support
  i.MX6Q: icorem6_rqs: Add modeboot env via board_late_init
  i.MX6Q: icorem6_rqs: Add mmc_late_init
  i.MX6Q: isiot: Switch the mmc env based on devno

 arch/arm/dts/Makefile   |   1 +
 arch/arm/dts/imx6qdl-icore-rqs.dtsi |  22 ++
 arch/arm/dts/imx6ul-isiot-emmc.dts  |  77 +
 arch/arm/imx-common/init.c  |  10 +++
 arch/arm/imx-common/spl.c   |  50 --
 arch/arm/include/asm/arch-mx6/imx-regs.h|   2 +
 arch/arm/include/asm/imx-common/sys_proto.h |  46 +
 board/engicam/icorem6_rqs/icorem6_rqs.c |  96 +-
 board/engicam/isiotmx6ul/MAINTAINERS|   1 +
 board/engicam/isiotmx6ul/isiotmx6ul.c   | 101 +++-
 configs/imx6dl_icore_rqs_mmc_defconfig  |   1 +
 configs/imx6q_icore_rqs_mmc_defconfig   |   1 +
 configs/imx6ul_isiot_emmc_defconfig |  40 +++
 configs/imx6ul_isiot_mmc_defconfig  |   1 +
 configs/imx6ul_isiot_nand_defconfig |   1 +
 include/configs/imx6qdl_icore_rqs.h |  36 +-
 include/configs/imx6ul_isiot.h  |  40 +--
 17 files changed, 460 insertions(+), 66 deletions(-)
 create mode 100644 arch/arm/dts/imx6ul-isiot-emmc.dts
 create mode 100644 configs/imx6ul_isiot_emmc_defconfig

-- 
1.9.1

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


[U-Boot] [PATCH] bcm2835_wdt: support for the BCM2835/2836 watchdog

2017-01-27 Thread Paolo Pisati
Signed-off-by: Paolo Pisati 
---
 arch/arm/mach-bcm283x/reset.c  | 21 ++---
 board/raspberrypi/rpi/rpi.c|  4 
 drivers/watchdog/Makefile  |  1 +
 drivers/watchdog/bcm2835_wdt.c | 34 ++
 include/configs/rpi.h  |  3 +++
 scripts/config_whitelist.txt   |  1 +
 6 files changed, 61 insertions(+), 3 deletions(-)
 create mode 100644 drivers/watchdog/bcm2835_wdt.c

diff --git a/arch/arm/mach-bcm283x/reset.c b/arch/arm/mach-bcm283x/reset.c
index 685815c..b62cb8a 100644
--- a/arch/arm/mach-bcm283x/reset.c
+++ b/arch/arm/mach-bcm283x/reset.c
@@ -21,18 +21,33 @@
  */
 #define BCM2835_WDOG_RSTS_RASPBERRYPI_HALT 0x555
 
+/* max ticks timeout */
+#define BCM2835_WDOG_MAX_TIMEOUT   0x000f
+
+#ifdef CONFIG_BCM2835_WDT
+extern void hw_watchdog_disable(void);
+#else
+void hw_watchdog_disable(void) {}
+#endif
+
 __efi_runtime_data struct bcm2835_wdog_regs *wdog_regs =
(struct bcm2835_wdog_regs *)BCM2835_WDOG_PHYSADDR;
 
-void __efi_runtime reset_cpu(ulong addr)
+void __efi_runtime reset_cpu(ulong ticks)
 {
-   uint32_t rstc;
+   uint32_t rstc, timeout;
+
+   if (ticks == 0) {
+   hw_watchdog_disable();
+   timeout = RESET_TIMEOUT;
+   } else
+   timeout = ticks & BCM2835_WDOG_MAX_TIMEOUT;
 
rstc = readl(_regs->rstc);
rstc &= ~BCM2835_WDOG_RSTC_WRCFG_MASK;
rstc |= BCM2835_WDOG_RSTC_WRCFG_FULL_RESET;
 
-   writel(BCM2835_WDOG_PASSWORD | RESET_TIMEOUT, _regs->wdog);
+   writel(BCM2835_WDOG_PASSWORD | timeout, _regs->wdog);
writel(BCM2835_WDOG_PASSWORD | rstc, _regs->rstc);
 }
 
diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
index 22e87a2..106e518 100644
--- a/board/raspberrypi/rpi/rpi.c
+++ b/board/raspberrypi/rpi/rpi.c
@@ -22,6 +22,7 @@
 #ifdef CONFIG_ARM64
 #include 
 #endif
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -478,6 +479,9 @@ static void rpi_disable_inactive_uart(void)
 
 int board_init(void)
 {
+#ifdef CONFIG_HW_WATCHDOG
+   hw_watchdog_init();
+#endif
 #ifndef CONFIG_PL01X_SERIAL
rpi_disable_inactive_uart();
 #endif
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index a007ae8..3b328ec 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -15,3 +15,4 @@ obj-$(CONFIG_XILINX_TB_WATCHDOG) += xilinx_tb_wdt.o
 obj-$(CONFIG_BFIN_WATCHDOG)  += bfin_wdt.o
 obj-$(CONFIG_OMAP_WATCHDOG) += omap_wdt.o
 obj-$(CONFIG_DESIGNWARE_WATCHDOG) += designware_wdt.o
+obj-$(CONFIG_BCM2835_WDT)   += bcm2835_wdt.o
diff --git a/drivers/watchdog/bcm2835_wdt.c b/drivers/watchdog/bcm2835_wdt.c
new file mode 100644
index 000..c76b164
--- /dev/null
+++ b/drivers/watchdog/bcm2835_wdt.c
@@ -0,0 +1,34 @@
+/*
+ * Watchdog driver for Broadcom BCM2835
+ *
+ * Copyright (C) 2017 Paolo Pisati 
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#include 
+#include 
+#include 
+
+#define SECS_TO_WDOG_TICKS(x) ((x) << 16)
+#define MAX_TIMEOUT   0xf /* ~15s */
+
+bool enabled = true;
+
+extern void reset_cpu(ulong ticks);
+
+void hw_watchdog_reset(void)
+{
+   if (enabled)
+   reset_cpu(SECS_TO_WDOG_TICKS(MAX_TIMEOUT));
+}
+
+void hw_watchdog_init(void)
+{
+   hw_watchdog_reset();
+}
+
+void hw_watchdog_disable(void)
+{
+   enabled = false;
+}
diff --git a/include/configs/rpi.h b/include/configs/rpi.h
index 883634a..ff057b7 100644
--- a/include/configs/rpi.h
+++ b/include/configs/rpi.h
@@ -107,6 +107,9 @@
 #define CONFIG_CONS_INDEX  0
 #define CONFIG_BAUDRATE115200
 
+/* Watchdog support */
+#define CONFIG_BCM2835_WDT
+
 /* Console configuration */
 #define CONFIG_SYS_CBSIZE  1024
 #define CONFIG_SYS_PBSIZE  (CONFIG_SYS_CBSIZE +\
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 00ee3f1..eb6cb8a 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -294,6 +294,7 @@ CONFIG_BCH_CONST_M
 CONFIG_BCH_CONST_PARAMS
 CONFIG_BCH_CONST_T
 CONFIG_BCM2835_GPIO
+CONFIG_BCM2835_WDT
 CONFIG_BCM283X_MU_SERIAL
 CONFIG_BCM_SF2_ETH
 CONFIG_BCM_SF2_ETH_DEFAULT_PORT
-- 
2.7.4

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


[U-Boot] [PATCH v5 7/9] disk: convert CONFIG_EFI_PARTITION to Kconfig

2017-01-27 Thread Patrick Delaunay
From: Patrick Delaunay 

Signed-off-by: Patrick Delaunay 
Signed-off-by: Patrick Delaunay 
---

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

 cmd/zfs.c   |  2 +-
 common/fb_mmc.c |  2 +-
 configs/A10-OLinuXino-Lime_defconfig|  1 +
 configs/A10s-OLinuXino-M_defconfig  |  1 +
 configs/A13-OLinuXinoM_defconfig|  1 +
 configs/A20-OLinuXino-Lime_defconfig|  1 +
 configs/A20-OLinuXino_MICRO_defconfig   |  1 +
 configs/A20-Olimex-SOM-EVB_defconfig|  1 +
 configs/A33-OLinuXino_defconfig |  1 +
 configs/Ainol_AW1_defconfig |  1 +
 configs/Ampe_A76_defconfig  |  1 +
 configs/Auxtek-T003_defconfig   |  1 +
 configs/Auxtek-T004_defconfig   |  1 +
 configs/Bananapi_defconfig  |  1 +
 configs/Bananapro_defconfig |  1 +
 configs/CHIP_defconfig  |  1 +
 configs/CSQ_CS908_defconfig |  1 +
 configs/Chuwi_V7_CW0825_defconfig   |  1 +
 configs/Colombus_defconfig  |  1 +
 configs/Cubieboard2_defconfig   |  1 +
 configs/Cubieboard4_defconfig   |  1 +
 configs/Cubieboard_defconfig|  1 +
 configs/Cubietruck_plus_defconfig   |  1 +
 configs/Empire_electronix_d709_defconfig|  1 +
 configs/Empire_electronix_m712_defconfig|  1 +
 configs/Hummingbird_A31_defconfig   |  1 +
 configs/Hyundai_A7HD_defconfig  |  1 +
 configs/Itead_Ibox_A20_defconfig|  1 +
 configs/Lamobo_R1_defconfig |  1 +
 configs/Linksprite_pcDuino3_Nano_defconfig  |  1 +
 configs/Linksprite_pcDuino3_defconfig   |  1 +
 configs/Linksprite_pcDuino_defconfig|  1 +
 configs/MK808C_defconfig|  1 +
 configs/MSI_Primo73_defconfig   |  1 +
 configs/MSI_Primo81_defconfig   |  1 +
 configs/Marsboard_A10_defconfig |  1 +
 configs/Mele_A1000G_quad_defconfig  |  1 +
 configs/Mele_A1000_defconfig|  1 +
 configs/Mele_I7_defconfig   |  1 +
 configs/Mele_M3_defconfig   |  1 +
 configs/Mele_M5_defconfig   |  1 +
 configs/Mele_M9_defconfig   |  1 +
 configs/Merrii_A80_Optimus_defconfig|  1 +
 configs/Mini-X_defconfig|  1 +
 configs/Nintendo_NES_Classic_Edition_defconfig  |  1 +
 configs/Orangepi_defconfig  |  1 +
 configs/Orangepi_mini_defconfig |  1 +
 configs/Sinlinx_SinA31s_defconfig   |  1 +
 configs/Sinovoip_BPI_M2_defconfig   |  1 +
 configs/Sinovoip_BPI_M3_defconfig   |  1 +
 configs/UTOO_P66_defconfig  |  1 +
 configs/Wexler_TAB7200_defconfig|  1 +
 configs/Wits_Pro_A20_DKT_defconfig  |  1 +
 configs/Wobo_i5_defconfig   |  1 +
 configs/Yones_Toptech_BD1078_defconfig  |  1 +
 configs/Yones_Toptech_BS1078_V2_defconfig   |  1 +
 configs/am335x_baltos_defconfig |  1 +
 configs/am335x_igep0033_defconfig   |  1 +
 configs/am335x_shc_defconfig|  1 +
 configs/am335x_shc_ict_defconfig|  1 +
 configs/am335x_shc_netboot_defconfig|  1 +
 configs/am335x_shc_prompt_defconfig |  1 +
 configs/am335x_shc_sdboot_defconfig |  1 +
 configs/am335x_shc_sdboot_prompt_defconfig  |  1 +
 configs/am43xx_evm_defconfig|  1 +
 configs/am43xx_evm_ethboot_defconfig|  1 +
 configs/am43xx_evm_qspiboot_defconfig   |  1 +
 configs/am43xx_evm_usbhost_boot_defconfig   |  1 +
 configs/am43xx_hs_evm_defconfig |  1 +
 configs/am57xx_evm_defconfig|  1 +
 configs/am57xx_evm_nodt_defconfig   |  1 +
 configs/am57xx_hs_evm_defconfig |  1 +
 configs/apalis_t30_defconfig|  1 +
 configs/ba10_tv_box_defconfig   |  1 +
 

[U-Boot] [PATCH] bcm2835: wdt: support for the bcm2835/2836 wdt

2017-01-27 Thread Paolo Pisati
[resend with swarren in cc:]

The following patch add support for the watchdog built into the
bcm2835/2836 chips, using the max timeout (~15s).

By default the watchdog is compiled in, but disabled.
To enable it, apply the following patch:

--- a/include/configs/rpi.h
+++ b/include/configs/rpi.h
@@ -109,6 +109,7 @@

 /* Watchdog support */
 #define CONFIG_BCM2835_WDT
+#define CONFIG_HW_WATCHDOG

 /* Console configuration */
 #define CONFIG_SYS_CBSIZE  1024
--
2.7.4

Tested on my RaspberryPi2.

Paolo Pisati (1):
  bcm2835_wdt: support for the BCM2835/2836 watchdog

 arch/arm/mach-bcm283x/reset.c  | 21 ++---
 board/raspberrypi/rpi/rpi.c|  4 
 drivers/watchdog/Makefile  |  1 +
 drivers/watchdog/bcm2835_wdt.c | 34 ++
 include/configs/rpi.h  |  3 +++
 scripts/config_whitelist.txt   |  1 +
 6 files changed, 61 insertions(+), 3 deletions(-)
 create mode 100644 drivers/watchdog/bcm2835_wdt.c

-- 
2.7.4

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


[U-Boot] [PATCH] bcm2835_wdt: support for the BCM2835/2836 watchdog

2017-01-27 Thread Paolo Pisati
Signed-off-by: Paolo Pisati 
---
 arch/arm/mach-bcm283x/reset.c  | 21 ++---
 board/raspberrypi/rpi/rpi.c|  4 
 drivers/watchdog/Makefile  |  1 +
 drivers/watchdog/bcm2835_wdt.c | 34 ++
 include/configs/rpi.h  |  3 +++
 scripts/config_whitelist.txt   |  1 +
 6 files changed, 61 insertions(+), 3 deletions(-)
 create mode 100644 drivers/watchdog/bcm2835_wdt.c

diff --git a/arch/arm/mach-bcm283x/reset.c b/arch/arm/mach-bcm283x/reset.c
index 685815c..b62cb8a 100644
--- a/arch/arm/mach-bcm283x/reset.c
+++ b/arch/arm/mach-bcm283x/reset.c
@@ -21,18 +21,33 @@
  */
 #define BCM2835_WDOG_RSTS_RASPBERRYPI_HALT 0x555
 
+/* max ticks timeout */
+#define BCM2835_WDOG_MAX_TIMEOUT   0x000f
+
+#ifdef CONFIG_BCM2835_WDT
+extern void hw_watchdog_disable(void);
+#else
+void hw_watchdog_disable(void) {}
+#endif
+
 __efi_runtime_data struct bcm2835_wdog_regs *wdog_regs =
(struct bcm2835_wdog_regs *)BCM2835_WDOG_PHYSADDR;
 
-void __efi_runtime reset_cpu(ulong addr)
+void __efi_runtime reset_cpu(ulong ticks)
 {
-   uint32_t rstc;
+   uint32_t rstc, timeout;
+
+   if (ticks == 0) {
+   hw_watchdog_disable();
+   timeout = RESET_TIMEOUT;
+   } else
+   timeout = ticks & BCM2835_WDOG_MAX_TIMEOUT;
 
rstc = readl(_regs->rstc);
rstc &= ~BCM2835_WDOG_RSTC_WRCFG_MASK;
rstc |= BCM2835_WDOG_RSTC_WRCFG_FULL_RESET;
 
-   writel(BCM2835_WDOG_PASSWORD | RESET_TIMEOUT, _regs->wdog);
+   writel(BCM2835_WDOG_PASSWORD | timeout, _regs->wdog);
writel(BCM2835_WDOG_PASSWORD | rstc, _regs->rstc);
 }
 
diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
index 22e87a2..106e518 100644
--- a/board/raspberrypi/rpi/rpi.c
+++ b/board/raspberrypi/rpi/rpi.c
@@ -22,6 +22,7 @@
 #ifdef CONFIG_ARM64
 #include 
 #endif
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -478,6 +479,9 @@ static void rpi_disable_inactive_uart(void)
 
 int board_init(void)
 {
+#ifdef CONFIG_HW_WATCHDOG
+   hw_watchdog_init();
+#endif
 #ifndef CONFIG_PL01X_SERIAL
rpi_disable_inactive_uart();
 #endif
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index a007ae8..3b328ec 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -15,3 +15,4 @@ obj-$(CONFIG_XILINX_TB_WATCHDOG) += xilinx_tb_wdt.o
 obj-$(CONFIG_BFIN_WATCHDOG)  += bfin_wdt.o
 obj-$(CONFIG_OMAP_WATCHDOG) += omap_wdt.o
 obj-$(CONFIG_DESIGNWARE_WATCHDOG) += designware_wdt.o
+obj-$(CONFIG_BCM2835_WDT)   += bcm2835_wdt.o
diff --git a/drivers/watchdog/bcm2835_wdt.c b/drivers/watchdog/bcm2835_wdt.c
new file mode 100644
index 000..c76b164
--- /dev/null
+++ b/drivers/watchdog/bcm2835_wdt.c
@@ -0,0 +1,34 @@
+/*
+ * Watchdog driver for Broadcom BCM2835
+ *
+ * Copyright (C) 2017 Paolo Pisati 
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#include 
+#include 
+#include 
+
+#define SECS_TO_WDOG_TICKS(x) ((x) << 16)
+#define MAX_TIMEOUT   0xf /* ~15s */
+
+bool enabled = true;
+
+extern void reset_cpu(ulong ticks);
+
+void hw_watchdog_reset(void)
+{
+   if (enabled)
+   reset_cpu(SECS_TO_WDOG_TICKS(MAX_TIMEOUT));
+}
+
+void hw_watchdog_init(void)
+{
+   hw_watchdog_reset();
+}
+
+void hw_watchdog_disable(void)
+{
+   enabled = false;
+}
diff --git a/include/configs/rpi.h b/include/configs/rpi.h
index 45d8824..c34c84b 100644
--- a/include/configs/rpi.h
+++ b/include/configs/rpi.h
@@ -107,6 +107,9 @@
 #define CONFIG_CONS_INDEX  0
 #define CONFIG_BAUDRATE115200
 
+/* Watchdog support */
+#define CONFIG_BCM2835_WDT
+
 /* Console configuration */
 #define CONFIG_SYS_CBSIZE  1024
 #define CONFIG_SYS_PBSIZE  (CONFIG_SYS_CBSIZE +\
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 00ee3f1..eb6cb8a 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -294,6 +294,7 @@ CONFIG_BCH_CONST_M
 CONFIG_BCH_CONST_PARAMS
 CONFIG_BCH_CONST_T
 CONFIG_BCM2835_GPIO
+CONFIG_BCM2835_WDT
 CONFIG_BCM283X_MU_SERIAL
 CONFIG_BCM_SF2_ETH
 CONFIG_BCM_SF2_ETH_DEFAULT_PORT
-- 
2.7.4

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


[U-Boot] [PATCH] bcm2835: wdt: support for the bcm2835/2836 wdt

2017-01-27 Thread Paolo Pisati
The following patch add support for the watchdog built into the
bcm2835/2836 chips, using the max timeout (~15s).

By default the watchdog is compiled in, but disabled.
To enable it, apply the following patch:

--- a/include/configs/rpi.h
+++ b/include/configs/rpi.h
@@ -109,6 +109,7 @@
 
 /* Watchdog support */
 #define CONFIG_BCM2835_WDT
+#define CONFIG_HW_WATCHDOG
 
 /* Console configuration */
 #define CONFIG_SYS_CBSIZE  1024
-- 
2.7.4

Tested on my RaspberryPi2.

Paolo Pisati (1):
  bcm2835_wdt: support for the BCM2835/2836 watchdog

 arch/arm/mach-bcm283x/reset.c  | 21 ++---
 board/raspberrypi/rpi/rpi.c|  4 
 drivers/watchdog/Makefile  |  1 +
 drivers/watchdog/bcm2835_wdt.c | 34 ++
 include/configs/rpi.h  |  3 +++
 scripts/config_whitelist.txt   |  1 +
 6 files changed, 61 insertions(+), 3 deletions(-)
 create mode 100644 drivers/watchdog/bcm2835_wdt.c

-- 
2.7.4

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


Re: [U-Boot] [PATCH v4 2/9] arm: imx6ul: Add Engicam Is.IoT MX6UL Starter Kit initial support

2017-01-27 Thread Stefano Babic
Hi Jagan,

On 27/01/2017 09:54, Jagan Teki wrote:
> From: Jagan Teki 
> 
> Boot from MMC:
> -
> U-Boot SPL 2017.01-rc2-gba3c151-dirty (Jan 02 2017 - 16:59:33)
> Trying to boot from MMC1
> 
> U-Boot 2017.01-rc2-gba3c151-dirty (Jan 02 2017 - 16:59:33 +0100)
> 
> CPU:   Freescale i.MX6UL rev1.1 528 MHz (running at 396 MHz)
> CPU:   Industrial temperature grade (-40C to 105C) at 33C
> Reset cause: POR
> Model: Engicam Is.IoT MX6UL Starterkit
> DRAM:  512 MiB
> MMC:   FSL_SDHC: 0
> *** Warning - bad CRC, using default environment
> 
> In:serial
> Out:   serial
> Err:   serial
> Net:   CPU Net Initialization Failed
> No ethernet found.
> Hit any key to stop autoboot:  0
> isiotmx6ul>
> 
> Cc: Stefano Babic 
> Cc: Matteo Lisi 
> Cc: Michael Trimarchi 
> Signed-off-by: Jagan Teki 
> ---
>  arch/arm/cpu/armv7/mx6/Kconfig|  11 ++
>  arch/arm/dts/Makefile |   3 +-
>  arch/arm/dts/imx6ul-isiot-mmc.dts |  50 +++
>  arch/arm/dts/imx6ul-isiot.dtsi|  92 +
>  board/engicam/isiotmx6ul/Kconfig  |  12 ++
>  board/engicam/isiotmx6ul/MAINTAINERS  |   6 +
>  board/engicam/isiotmx6ul/Makefile |   6 +
>  board/engicam/isiotmx6ul/README   |  28 
>  board/engicam/isiotmx6ul/isiotmx6ul.c | 247 
> ++
>  configs/imx6ul_isiot_mmc_defconfig|  36 +
>  include/configs/imx6ul_isiot.h| 142 +++
>  11 files changed, 632 insertions(+), 1 deletion(-)
>  create mode 100644 arch/arm/dts/imx6ul-isiot-mmc.dts
>  create mode 100644 arch/arm/dts/imx6ul-isiot.dtsi
>  create mode 100644 board/engicam/isiotmx6ul/Kconfig
>  create mode 100644 board/engicam/isiotmx6ul/MAINTAINERS
>  create mode 100644 board/engicam/isiotmx6ul/Makefile
>  create mode 100644 board/engicam/isiotmx6ul/README
>  create mode 100644 board/engicam/isiotmx6ul/isiotmx6ul.c
>  create mode 100644 configs/imx6ul_isiot_mmc_defconfig
>  create mode 100644 include/configs/imx6ul_isiot.h
> 
> diff --git a/arch/arm/cpu/armv7/mx6/Kconfig b/arch/arm/cpu/armv7/mx6/Kconfig
> index c646966..72780d7 100644
> --- a/arch/arm/cpu/armv7/mx6/Kconfig
> +++ b/arch/arm/cpu/armv7/mx6/Kconfig
> @@ -205,6 +205,16 @@ config TARGET_MX6UL_GEAM
>   select DM_THERMAL
>   select SUPPORT_SPL
>  
> +config TARGET_MX6UL_ISIOT
> + bool "Support Engicam Is.IoT MX6UL"
> + select MX6UL
> + select OF_CONTROL
> + select DM
> + select DM_GPIO
> + select DM_MMC
> + select DM_THERMAL
> + select SUPPORT_SPL
> +
>  config TARGET_MX6ULL_14X14_EVK
>   bool "Support mx6ull_14x14_evk"
>   select MX6ULL
> @@ -313,6 +323,7 @@ source "board/embest/mx6boards/Kconfig"
>  source "board/engicam/geam6ul/Kconfig"
>  source "board/engicam/icorem6/Kconfig"
>  source "board/engicam/icorem6_rqs/Kconfig"
> +source "board/engicam/isiotmx6ul/Kconfig"
>  source "board/freescale/mx6qarm2/Kconfig"
>  source "board/freescale/mx6qsabreauto/Kconfig"
>  source "board/freescale/mx6sabresd/Kconfig"
> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> index 6a7924e..e83308c 100644
> --- a/arch/arm/dts/Makefile
> +++ b/arch/arm/dts/Makefile
> @@ -313,7 +313,8 @@ dtb-$(CONFIG_MX6) += imx6ull-14x14-evk.dtb \
>   imx6dl-icore-rqs.dtb \
>   imx6q-icore.dtb \
>   imx6q-icore-rqs.dtb \
> - imx6ul-geam-kit.dtb
> + imx6ul-geam-kit.dtb \
> + imx6ul-isiot-mmc.dtb
>  
>  dtb-$(CONFIG_MX7) += imx7-colibri.dtb
>  
> diff --git a/arch/arm/dts/imx6ul-isiot-mmc.dts 
> b/arch/arm/dts/imx6ul-isiot-mmc.dts
> new file mode 100644
> index 000..bb5086a
> --- /dev/null
> +++ b/arch/arm/dts/imx6ul-isiot-mmc.dts
> @@ -0,0 +1,50 @@
> +/*
> + * Copyright (C) 2016 Amarula Solutions B.V.
> + * Copyright (C) 2016 Engicam S.r.l.
> + *
> + * This file is dual-licensed: you can use it either under the terms
> + * of the GPL or the X11 license, at your option. Note that this dual
> + * licensing only applies to this file, and not this project as a
> + * whole.
> + *


I have seen that a lot of files slipped into mainline, and I have myself
not paid enough attention befeore (see your imx6ul-geam-kit.dts for
example).

But we moved some years ago to SPDX-License-Identifier. Other DTS files
are using this as well without copying the whole license. Could you do
this here, too ? It would be also nice if you plan to fix this for all
Engicam's boards, thanks !

> +
> +/dts-v1/;
> +
> +#include "imx6ul-isiot.dtsi"
> +
> +/ {
> + model = "Engicam Is.IoT MX6UL MMC Starterkit";
> + compatible = "engicam,imx6ul-isiot", "fsl,imx6ul";
> +};
> diff --git a/arch/arm/dts/imx6ul-isiot.dtsi b/arch/arm/dts/imx6ul-isiot.dtsi
> new file mode 100644
> index 000..6108a1a
> --- /dev/null
> +++ b/arch/arm/dts/imx6ul-isiot.dtsi
> @@ -0,0 +1,92 @@
> +/*
> + * Copyright (C) 2016 Amarula Solutions B.V.
> + * Copyright (C) 2016 Engicam S.r.l.

Ditto.


> 

Re: [U-Boot] [PATCH v4 1/9] configs: imx6: Don't define USDHC2_BASE_ADDR

2017-01-27 Thread Stefano Babic
On 27/01/2017 09:54, Jagan Teki wrote:
> From: Jagan Teki 
> 
> USDHC base address will assigned by SPL using fsl_esdhc_initialize
> and u-boot with devicetree, hence no remove base address assignment
> in config files.
> 
> Cc: Stefano Babic 
> Cc: Matteo Lisi 
> Cc: Michael Trimarchi 
> Signed-off-by: Jagan Teki 
> ---
>  include/configs/imx6qdl_icore.h | 2 +-
>  include/configs/imx6ul_geam.h   | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/configs/imx6qdl_icore.h b/include/configs/imx6qdl_icore.h
> index eb83d23..5a28b15 100644
> --- a/include/configs/imx6qdl_icore.h
> +++ b/include/configs/imx6qdl_icore.h
> @@ -147,7 +147,7 @@
>  #ifdef CONFIG_FSL_USDHC
>  # define CONFIG_SYS_MMC_ENV_DEV  0
>  # define CONFIG_SYS_FSL_USDHC_NUM1
> -# define CONFIG_SYS_FSL_ESDHC_ADDR   USDHC2_BASE_ADDR
> +# define CONFIG_SYS_FSL_ESDHC_ADDR   0
>  #endif
>  
>  /* NAND */
> diff --git a/include/configs/imx6ul_geam.h b/include/configs/imx6ul_geam.h
> index 23fa3ee..8bffacd 100644
> --- a/include/configs/imx6ul_geam.h
> +++ b/include/configs/imx6ul_geam.h
> @@ -145,7 +145,7 @@
>  #ifdef CONFIG_FSL_USDHC
>  # define CONFIG_SYS_MMC_ENV_DEV  0
>  # define CONFIG_SYS_FSL_USDHC_NUM1
> -# define CONFIG_SYS_FSL_ESDHC_ADDR   USDHC2_BASE_ADDR
> +# define CONFIG_SYS_FSL_ESDHC_ADDR   0
>  #endif
>  
>  /* NAND */
> 

Reviewed-by: Stefano Babic 

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
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 5/7] board: ti: am57xx-idk: Auto detect LCD Panel

2017-01-27 Thread menon.nisha...@gmail.com
On Fri, Jan 27, 2017 at 2:54 AM, Roger Quadros  wrote:
> On 26/01/17 19:33, menon.nisha...@gmail.com wrote:
>> [...]
>>
>>
>>> diff --git a/include/configs/ti_omap5_common.h 
>>> b/include/configs/ti_omap5_common.h
>>> index 6de19c2..1fa2f82 100644
>>> --- a/include/configs/ti_omap5_common.h
>>> +++ b/include/configs/ti_omap5_common.h
>>> @@ -91,16 +91,22 @@
>>> "setenv fdtfile am57xx-beagle-x15.dtb; fi;" \
>>> "if test $board_name = beagle_x15_revb1; then " \
>>> "setenv fdtfile am57xx-beagle-x15-revb1.dtb; fi;" \
>>> -   "if test $board_name = am572x_idk; then " \
>>> -   "setenv fdtfile am572x-idk.dtb; fi;" \
>>> "if test $board_name = am57xx_evm; then " \
>>> "setenv fdtfile am57xx-beagle-x15.dtb; fi;" \
>>> "if test $board_name = am57xx_evm_reva3; then " \
>>> "setenv fdtfile am57xx-beagle-x15.dtb; fi;" \
>>> +   "if test $board_name = am572x_idk && test $idk_lcd = no; 
>>> then " \
>>> +   "setenv fdtfile am572x-idk.dtb; fi;" \
>>> +   "if test $board_name = am572x_idk && test $idk_lcd = 
>>> osd101t2045; then " \
>>> +   "setenv fdtfile am572x-idk-lcd-osd.dtb; fi;" \
>>> +   "if test $board_name = am572x_idk && test $idk_lcd = 
>>> osd101t2587; then " \
>>> +   "setenv fdtfile am572x-idk-lcd-osd101t2587.dtb; 
>>> fi;" \
>>> "if test $board_name = am571x_idk && test $idk_lcd = no; 
>>> then " \
>>> "setenv fdtfile am571x-idk.dtb; fi;" \
>>> "if test $board_name = am571x_idk && test $idk_lcd = 
>>> osd101t2045; then " \
>>> "setenv fdtfile am571x-idk-lcd-osd.dtb; fi;" \
>>> +   "if test $board_name = am571x_idk && test $idk_lcd = 
>>> osd101t2587; then " \
>>> +   "setenv fdtfile am571x-idk-lcd-osd101t2587.dtb; 
>>> fi;" \
>>
>>
>> please drop the fdt selection from your patches. upstream will be
>> using dt overlay for these variations. rest of the detection code is
>> ok to go.
>>
>
> OK.
> Just to clarify, dt overlay code will use the idk_lcd variable to patch the 
> DT right?

That'd make sense.

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


[U-Boot] [PATCH v5 9/9] disk: convert CONFIG_PARTITION_TYPE_GUID to Kconfig

2017-01-27 Thread Patrick Delaunay
From: Patrick Delaunay 

Signed-off-by: Patrick Delaunay 
Signed-off-by: Patrick Delaunay 
---

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

 disk/Kconfig | 8 
 scripts/config_whitelist.txt | 1 -
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/disk/Kconfig b/disk/Kconfig
index 268fb83..16ff52d 100644
--- a/disk/Kconfig
+++ b/disk/Kconfig
@@ -97,4 +97,12 @@ config SPL_PARTITION_UUIDS
depends on SPL && PARTITIONS
default y if SPL_EFI_PARTITION
 
+config PARTITION_TYPE_GUID
+   bool "Enable support of GUID for partition type"
+   depends on PARTITIONS
+   depends on EFI_PARTITION
+   help
+ Activate the configuration of GUID type
+ for EFI partition
+
 endmenu
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 53d89f4..e85e75d 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -3328,7 +3328,6 @@ CONFIG_PALMAS_SMPS7_FPWM
 CONFIG_PALMAS_USB_SS_PWR
 CONFIG_PANIC_HANG
 CONFIG_PARAVIRT
-CONFIG_PARTITION_TYPE_GUID
 CONFIG_PATA_BFIN
 CONFIG_PATI
 CONFIG_PB1000
-- 
1.9.1

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


[U-Boot] [PATCH v5 8/9] disk: convert CONFIG_PARTITION_UUIDS to Kconfig

2017-01-27 Thread Patrick Delaunay
From: Patrick Delaunay 

Signed-off-by: Patrick Delaunay 
Signed-off-by: Patrick Delaunay 
---

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

 cmd/gpt.c|  2 +-
 cmd/part.c   |  2 +-
 configs/A13-OLinuXino_defconfig  |  1 +
 configs/A20-OLinuXino-Lime2_defconfig|  1 +
 configs/Cubietruck_defconfig |  1 +
 configs/Sinlinx_SinA33_defconfig |  1 +
 configs/am3517_evm_defconfig |  2 ++
 configs/bcm11130_defconfig   |  1 +
 configs/bcm11130_nand_defconfig  |  1 +
 configs/bcm23550_w1d_defconfig   |  1 +
 configs/bcm28155_ap_defconfig|  1 +
 configs/bcm28155_w1d_defconfig   |  1 +
 configs/chromebit_mickey_defconfig   |  1 +
 configs/chromebook_jerry_defconfig   |  1 +
 configs/chromebook_minnie_defconfig  |  1 +
 configs/clearfog_defconfig   |  2 ++
 configs/d2net_v2_defconfig   |  1 +
 configs/db-88f6820-amc_defconfig |  2 ++
 configs/db-88f6820-gp_defconfig  |  2 ++
 configs/db-mv784mp-gp_defconfig  |  2 ++
 configs/duovero_defconfig|  1 +
 configs/evb-rk3036_defconfig |  1 +
 configs/evb-rk3288_defconfig |  1 +
 configs/fennec-rk3288_defconfig  |  1 +
 configs/firefly-rk3288_defconfig |  1 +
 configs/gurnard_defconfig|  1 +
 configs/highbank_defconfig   |  1 +
 configs/inetspace_v2_defconfig   |  1 +
 configs/kylin-rk3036_defconfig   |  1 +
 configs/ls2080a_emu_defconfig|  1 +
 configs/ls2080a_simu_defconfig   |  1 +
 configs/ls2080aqds_SECURE_BOOT_defconfig |  1 +
 configs/ls2080aqds_defconfig |  1 +
 configs/ls2080aqds_nand_defconfig|  1 +
 configs/ls2080aqds_qspi_defconfig|  1 +
 configs/lschlv2_defconfig|  1 +
 configs/lsxhl_defconfig  |  1 +
 configs/miniarm-rk3288_defconfig |  1 +
 configs/mx35pdk_defconfig|  1 +
 configs/mx6cuboxi_defconfig  |  1 +
 configs/nas220_defconfig |  1 +
 configs/net2big_v2_defconfig |  1 +
 configs/netspace_lite_v2_defconfig   |  1 +
 configs/netspace_max_v2_defconfig|  1 +
 configs/netspace_mini_v2_defconfig   |  1 +
 configs/netspace_v2_defconfig|  1 +
 configs/novena_defconfig |  1 +
 configs/odroid-c2_defconfig  |  1 +
 configs/omap3_evm_defconfig  |  2 ++
 configs/parrot_r16_defconfig |  1 +
 configs/pcm058_defconfig |  2 ++
 configs/popmetal-rk3288_defconfig|  1 +
 configs/rock2_defconfig  |  1 +
 configs/sandbox_defconfig|  1 +
 configs/sandbox_spl_defconfig|  1 +
 configs/theadorable_debug_defconfig  |  2 ++
 configs/theadorable_defconfig|  2 ++
 configs/vexpress_aemv8a_dram_defconfig   |  1 +
 configs/vexpress_aemv8a_juno_defconfig   |  1 +
 configs/vexpress_aemv8a_semi_defconfig   |  1 +
 configs/warp7_defconfig  |  1 +
 configs/warp7_secure_defconfig   |  1 +
 configs/woodburn_defconfig   |  1 +
 configs/woodburn_sd_defconfig|  2 ++
 disk/Kconfig | 13 +
 disk/part.c  |  8 
 disk/part_dos.c  |  6 +++---
 disk/part_efi.c  |  6 +++---
 fs/fat/fat.c |  2 +-
 include/config_distro_bootcmd.h  |  1 -
 include/config_fallbacks.h   |  2 +-
 include/configs/am335x_evm.h |  1 -
 include/configs/am335x_sl50.h|  1 -
 include/configs/am3517_evm.h |  1 -
 include/configs/baltos.h |  2 --
 include/configs/bav335x.h|  1 -
 include/configs/dragonboard410c.h|  1 -
 include/configs/exynos-common.h  |  1 -
 include/configs/kc1.h|  1 -
 include/configs/mvebu_armada-8k.h|  1 -
 include/configs/mvebu_db-88f3720.h   |  1 -
 include/configs/pic32mzdask.h|  1 -
 include/configs/rk3036_common.h  |  1 -
 include/configs/rk3288_common.h  |  1 -
 include/configs/rockchip-common.h|  1 -
 include/configs/rpi.h|  1 -
 include/configs/s5p_goni.h   |  1 -
 include/configs/sandbox.h|  1 -
 include/configs/snapper9g45.h|  1 -
 include/configs/sniper.h |  1 -
 include/configs/tbs2910.h|  1 -
 include/configs/tegra-common-post.h  |  3 ---
 include/configs/tegra-common.h   |  1 -
 include/configs/ti_armv7_common.h|  1 -
 include/configs/vinco.h  |  1 -
 include/configs/warp7.h 

[U-Boot] [PATCH v5 2/9] disk: convert CONFIG_MAC_PARTITION to Kconfig

2017-01-27 Thread Patrick Delaunay
From: Patrick Delaunay 

Signed-off-by: Patrick Delaunay 
Signed-off-by: Patrick Delaunay 
---

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

 configs/CPCI4052_defconfig  |  1 +
 configs/M5253DEMO_defconfig |  1 +
 configs/M5253EVBE_defconfig |  1 +
 configs/MIP405T_defconfig   |  1 +
 configs/MIP405_defconfig|  1 +
 configs/MiniFAP_defconfig   |  1 +
 configs/O2D300_defconfig|  1 +
 configs/O2DNT2_RAMBOOT_defconfig|  1 +
 configs/O2DNT2_defconfig|  1 +
 configs/O2D_defconfig   |  1 +
 configs/O2I_defconfig   |  1 +
 configs/O2MNT_O2M110_defconfig  |  1 +
 configs/O2MNT_O2M112_defconfig  |  1 +
 configs/O2MNT_O2M113_defconfig  |  1 +
 configs/O2MNT_defconfig |  1 +
 configs/O3DNT_defconfig |  1 +
 configs/PIP405_defconfig|  1 +
 configs/PLU405_defconfig|  1 +
 configs/PMC440_defconfig|  1 +
 configs/TQM5200S_HIGHBOOT_defconfig |  1 +
 configs/TQM5200S_defconfig  |  1 +
 configs/TQM5200_B_HIGHBOOT_defconfig|  1 +
 configs/TQM5200_B_defconfig |  1 +
 configs/TQM5200_STK100_defconfig|  1 +
 configs/TQM5200_defconfig   |  1 +
 configs/TQM823L_LCD_defconfig   |  1 +
 configs/TQM823L_defconfig   |  1 +
 configs/TQM823M_defconfig   |  1 +
 configs/TQM850L_defconfig   |  1 +
 configs/TQM850M_defconfig   |  1 +
 configs/TQM855L_defconfig   |  1 +
 configs/TQM855M_defconfig   |  1 +
 configs/TQM860L_defconfig   |  1 +
 configs/TQM860M_defconfig   |  1 +
 configs/TQM862L_defconfig   |  1 +
 configs/TQM862M_defconfig   |  1 +
 configs/TQM866M_defconfig   |  1 +
 configs/TQM885D_defconfig   |  1 +
 configs/TTTech_defconfig|  1 +
 configs/a4m072_defconfig|  1 +
 configs/acadia_defconfig|  1 +
 configs/arches_defconfig|  1 +
 configs/bamboo_defconfig|  1 +
 configs/bayleybay_defconfig |  1 +
 configs/cam5200_defconfig   |  1 +
 configs/cam5200_niosflash_defconfig |  1 +
 configs/canyonlands_defconfig   |  1 +
 configs/charon_defconfig|  1 +
 configs/chromebook_link_defconfig   |  1 +
 configs/chromebook_samus_defconfig  |  1 +
 configs/chromebox_panther_defconfig |  1 +
 configs/cm5200_defconfig|  1 +
 configs/conga-qeval20-qa3-e3845-internal-uart_defconfig |  1 +
 configs/conga-qeval20-qa3-e3845_defconfig   |  1 +
 configs/coreboot-x86_defconfig  |  1 +
 configs/cougarcanyon2_defconfig |  1 +
 configs/crownbay_defconfig  |  1 +
 configs/dbau1000_defconfig  |  1 +
 configs/dbau1100_defconfig  |  1 +
 configs/dbau1500_defconfig  |  1 +
 configs/devconcenter_defconfig  |  1 +
 configs/dfi-bt700-q7x-151_defconfig |  1 +
 configs/efi-x86_defconfig   |  1 +
 configs/fo300_defconfig |  1 +
 configs/galileo_defconfig   |  1 +
 configs/glacier_defconfig   |  1 +
 configs/glacier_ramboot_defconfig   |  1 +
 configs/inka4x0_defconfig   |  1 +
 configs/intip_defconfig |  1 +
 configs/jupiter_defconfig   |  1 +
 configs/lwmon5_defconfig|  1 +
 configs/minnowmax_defconfig |  1 +
 configs/mpc5121ads_defconfig|  1 +
 configs/mpc5121ads_rev2_defconfig   |  1 +
 

[U-Boot] [PATCH v5 6/9] kbuild: add include linux/kconfig.h in config.h

2017-01-27 Thread Patrick Delaunay
From: Patrick Delaunay 

Allow to use define CONFIG_IS_ENABLED
in include/config_fallbacks.h

Signed-off-by: Patrick Delaunay 
Signed-off-by: Patrick Delaunay 
---

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

 scripts/Makefile.autoconf | 1 +
 1 file changed, 1 insertion(+)

diff --git a/scripts/Makefile.autoconf b/scripts/Makefile.autoconf
index 2f85eb9..2a967ff 100644
--- a/scripts/Makefile.autoconf
+++ b/scripts/Makefile.autoconf
@@ -110,6 +110,7 @@ define filechk_config_h
echo \#include \;  \
echo \#include \; \
echo \#include \;\
+   echo \#include \; \
echo \#include \;)
 endef
 
-- 
1.9.1

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


[U-Boot] [PATCH v5 5/9] disk: convert CONFIG_AMIGA_PARTITION to Kconfig

2017-01-27 Thread Patrick Delaunay
From: Patrick Delaunay 

Signed-off-by: Patrick Delaunay 
Signed-off-by: Patrick Delaunay 
---

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

 disk/Kconfig | 12 
 disk/Makefile|  2 +-
 disk/part.c  |  2 +-
 include/configs/sandbox.h|  1 -
 scripts/config_whitelist.txt |  1 -
 5 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/disk/Kconfig b/disk/Kconfig
index 1400b26..8adf59e 100644
--- a/disk/Kconfig
+++ b/disk/Kconfig
@@ -56,4 +56,16 @@ config SPL_ISO_PARTITION
depends on SPL && PARTITIONS
default y if ISO_PARTITION
 
+config AMIGA_PARTITION
+   bool "Enable AMIGA partition table"
+   depends on PARTITIONS
+   help
+ Say Y here if you would like to use device under U-Boot which
+ were partitioned under AmigaOS.
+
+config SPL_AMIGA_PARTITION
+   bool "Enable AMIGA partition table for SPL"
+   depends on SPL && PARTITIONS
+   default y if AMIGA_PARTITION
+
 endmenu
diff --git a/disk/Makefile b/disk/Makefile
index 95d286b..aa6ee45 100644
--- a/disk/Makefile
+++ b/disk/Makefile
@@ -11,5 +11,5 @@ obj-$(CONFIG_PARTITIONS)  += part.o
 obj-$(CONFIG_$(SPL_)MAC_PARTITION)   += part_mac.o
 obj-$(CONFIG_$(SPL_)DOS_PARTITION)   += part_dos.o
 obj-$(CONFIG_$(SPL_)ISO_PARTITION)   += part_iso.o
-obj-$(CONFIG_AMIGA_PARTITION) += part_amiga.o
+obj-$(CONFIG_$(SPL_)AMIGA_PARTITION) += part_amiga.o
 obj-$(CONFIG_EFI_PARTITION)   += part_efi.o
diff --git a/disk/part.c b/disk/part.c
index 4731ae9..ad38164 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -237,7 +237,7 @@ static void print_part_header(const char *type, struct 
blk_desc *dev_desc)
 #if CONFIG_IS_ENABLED(MAC_PARTITION) || \
CONFIG_IS_ENABLED(DOS_PARTITION) || \
CONFIG_IS_ENABLED(ISO_PARTITION) || \
-   defined(CONFIG_AMIGA_PARTITION) || \
+   CONFIG_IS_ENABLED(AMIGA_PARTITION) || \
defined(CONFIG_EFI_PARTITION)
puts ("\nPartition Map for ");
switch (dev_desc->if_type) {
diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h
index 09502b2..30b2ff1 100644
--- a/include/configs/sandbox.h
+++ b/include/configs/sandbox.h
@@ -49,7 +49,6 @@
 
 #define CONFIG_CMD_GPT
 #define CONFIG_PARTITION_UUIDS
-#define CONFIG_AMIGA_PARTITION
 #define CONFIG_EFI_PARTITION
 
 /*
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 0fb83cc..59e055d 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -93,7 +93,6 @@ CONFIG_AMCC_DEF_ENV_PPC
 CONFIG_AMCC_DEF_ENV_PPC_OLD
 CONFIG_AMCC_DEF_ENV_ROOTPATH
 CONFIG_AMCORE
-CONFIG_AMIGA_PARTITION
 CONFIG_ANDES_PCU
 CONFIG_ANDES_PCU_BASE
 CONFIG_AP325RXA
-- 
1.9.1

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


[U-Boot] [PATCH v5 1/9] disk: convert CONFIG_PARTITIONS to Kconfig

2017-01-27 Thread Patrick Delaunay

Signed-off-by: Patrick Delaunay 
Signed-off-by: Patrick Delaunay 
---

Changes in v5:
- split the initial commit for each parameter to check
  that each modification is size neutral
- add SPL config for PARTITION_UUIDS (deactivated in some SPL)
- solve issue with CONFIG_LIB_UUID in include/config_fallbacks.h
  => CONFIG_IS_ENABLED need to be used
 to have size neutral patch
- recompute all defconfig and check that patches are size neutral

Changes in v4:
- rebase on v2017.01
- correct many issue in defconfig update
  (missing some "is not set")
- check with buildman that the patch is size neutral

Changes in v3:
change Kconfig to reduce impact in platform defconfig
after Tom Rini review
- default y for all SPL config
- MAC DOS ISO and EFI enable by default for some platforms
- DOS enable with command FAT or USB storage

Changes in v2:
- solve compilation issue for config_fallback.h
  (CONFIG_IS_ENABLED unknown)
- rebase on master branch
- default y for DOS partition as proposed by Tom Rini
- removed not related changes in defconfig files

 Kconfig  |  2 ++
 disk/Kconfig | 22 ++
 include/config_defaults.h|  1 -
 scripts/config_whitelist.txt |  1 -
 4 files changed, 24 insertions(+), 2 deletions(-)
 create mode 100644 disk/Kconfig

diff --git a/Kconfig b/Kconfig
index a44ac91..de1dcb9 100644
--- a/Kconfig
+++ b/Kconfig
@@ -313,6 +313,8 @@ source "common/Kconfig"
 
 source "cmd/Kconfig"
 
+source "disk/Kconfig"
+
 source "dts/Kconfig"
 
 source "net/Kconfig"
diff --git a/disk/Kconfig b/disk/Kconfig
new file mode 100644
index 000..966553c
--- /dev/null
+++ b/disk/Kconfig
@@ -0,0 +1,22 @@
+
+menu "Partition Types"
+
+config PARTITIONS
+   bool "Enable Partition Labels (disklabels) support"
+   default y
+   help
+ Partition Labels (disklabels) Supported:
+ Zero or more of the following:
+ - CONFIG_MAC_PARTITION   Apple's MacOS partition table.
+ - CONFIG_DOS_PARTITION   MS Dos partition table, traditional on the
+  Intel architecture, USB sticks, etc.
+ - CONFIG_ISO_PARTITION   ISO partition table, used on CDROM etc.
+ - CONFIG_EFI_PARTITION   GPT partition table, common when EFI is the
+  bootloader.  Note 2TB partition limit; see
+  disk/part_efi.c
+ - CONFIG_MTD_PARTITIONS  Memory Technology Device partition table.
+ If IDE or SCSI support is enabled (CONFIG_CMD_IDE or CONFIG_SCSI)
+ you must configure support for at least one non-MTD partition type
+ as well.
+
+endmenu
diff --git a/include/config_defaults.h b/include/config_defaults.h
index ad08c1d..7ef928b 100644
--- a/include/config_defaults.h
+++ b/include/config_defaults.h
@@ -18,6 +18,5 @@
 
 #define CONFIG_GZIP 1
 #define CONFIG_ZLIB 1
-#define CONFIG_PARTITIONS 1
 
 #endif
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 00ee3f1..16849f1 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -,7 +,6 @@ CONFIG_PALMAS_SMPS7_FPWM
 CONFIG_PALMAS_USB_SS_PWR
 CONFIG_PANIC_HANG
 CONFIG_PARAVIRT
-CONFIG_PARTITIONS
 CONFIG_PARTITION_TYPE_GUID
 CONFIG_PARTITION_UUIDS
 CONFIG_PATA_BFIN
-- 
1.9.1

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


[U-Boot] [PATCH v5 0/9] disk: convert to Kconfig

2017-01-27 Thread Patrick Delaunay

move all CONFIG used in disk to Kconfig:
  CONFIG_PARTITIONS
  CONFIG_MAC_PARTITION
  CONFIG_DOS_PARTITION
  CONFIG_ISO_PARTITION
  CONFIG_AMIGA_PARTITION
  CONFIG_EFI_PARTITION
  CONFIG_PARTITION_UUIDS
  CONFIG_PARTITION_TYPE_GUID


move disk to Kconfig as proposed by Simon Glass in thread
[Resend RFC PATCH v1 1/3] add support of GPT partitioning over MTD

created one patch per partition after review of version 4 by Tom Rini

NB: I need to create _SPL_ config because for some platform activated
   list of supported partition type is not the same between SPL
   and U-Boot, that allow size reduction for SPL build
   (previously CONFIG are under compilation flag CONFIG_SPL_BUILD in .h)

I compile this patch on v2017.1 without issue linked to this code
and after correction in patch v5 it is size neutral for
the boards (on 1230 boards compiled on my side)

Changes in v5:
- split the initial commit for each parameter to check
  that each modification is size neutral
- add SPL config for PARTITION_UUIDS (deactivated in some SPL)
- solve issue with CONFIG_LIB_UUID in include/config_fallbacks.h
  => CONFIG_IS_ENABLED need to be used
 to have size neutral patch
- recompute all defconfig and check that patches are size neutral

Changes in v4:
- rebase on v2017.01
- correct many issue in defconfig update
  (missing some "is not set")
- check with buildman that the patch is size neutral

Changes in v3:
change Kconfig to reduce impact in platform defconfig
after Tom Rini review
- default y for all SPL config
- MAC DOS ISO and EFI enable by default for some platforms
- DOS enable with command FAT or USB storage

Changes in v2:
- solve compilation issue for config_fallback.h
  (CONFIG_IS_ENABLED unknown)
- rebase on master branch
- default y for DOS partition as proposed by Tom Rini
- removed not related changes in defconfig files

Patrick Delaunay (9):
  disk: convert CONFIG_PARTITIONS to Kconfig
  disk: convert CONFIG_MAC_PARTITION to Kconfig
  disk: convert CONFIG_DOS_PARTITION to Kconfig
  disk: convert CONFIG_ISO_PARTITION to Kconfig
  disk: convert CONFIG_AMIGA_PARTITION to Kconfig
  kbuild: add include linux/kconfig.h in config.h
  disk: convert CONFIG_EFI_PARTITION to Kconfig
  disk: convert CONFIG_PARTITION_UUIDS to Kconfig
  disk: convert CONFIG_PARTITION_TYPE_GUID to Kconfig

 Kconfig|   2 +
 arch/arm/include/asm/arch-ls102xa/config.h |   1 -
 cmd/bootefi.c  |   4 +-
 cmd/gpt.c  |   2 +-
 cmd/part.c |   2 +-
 cmd/reiser.c   |   2 +-
 cmd/zfs.c  |   2 +-
 common/fb_mmc.c|   4 +-
 configs/A10-OLinuXino-Lime_defconfig   |   3 +
 configs/A10s-OLinuXino-M_defconfig |   3 +
 configs/A13-OLinuXinoM_defconfig   |   3 +
 configs/A13-OLinuXino_defconfig|   3 +
 configs/A20-OLinuXino-Lime2_defconfig  |   3 +
 configs/A20-OLinuXino-Lime_defconfig   |   3 +
 configs/A20-OLinuXino_MICRO_defconfig  |   3 +
 configs/A20-Olimex-SOM-EVB_defconfig   |   3 +
 configs/A33-OLinuXino_defconfig|   3 +
 configs/Ainol_AW1_defconfig|   3 +
 configs/Ampe_A76_defconfig |   3 +
 configs/Auxtek-T003_defconfig  |   3 +
 configs/Auxtek-T004_defconfig  |   3 +
 configs/Bananapi_defconfig |   3 +
 configs/Bananapro_defconfig|   3 +
 configs/C29XPCIE_NAND_defconfig|   1 +
 configs/C29XPCIE_NOR_SECBOOT_defconfig |   1 +
 configs/C29XPCIE_SPIFLASH_SECBOOT_defconfig|   1 +
 configs/C29XPCIE_SPIFLASH_defconfig|   1 +
 configs/C29XPCIE_defconfig |   1 +
 configs/CHIP_defconfig |   3 +
 configs/CPCI4052_defconfig |   1 +
 configs/CSQ_CS908_defconfig|   3 +
 configs/Chuwi_V7_CW0825_defconfig  |   3 +
 configs/Colombus_defconfig |   3 +
 configs/Cubieboard2_defconfig  |   3 +
 configs/Cubieboard4_defconfig  |   3 +
 configs/Cubieboard_defconfig   |   3 +
 configs/Cubietruck_defconfig   |   3 +
 configs/Cubietruck_plus_defconfig  |   3 +
 configs/Empire_electronix_d709_defconfig   |   3 +
 configs/Empire_electronix_m712_defconfig   |   3 +
 configs/Hummingbird_A31_defconfig  |   3 +
 configs/Hyundai_A7HD_defconfig |   3 +
 

Re: [U-Boot] [PATCH] ARM: imx6ul: Move liteSOM source to SoC directory

2017-01-27 Thread Stefano Babic
On 25/01/2017 10:31, Marcin Niestroj wrote:
> Moving arch/arm/mach-litesom/ to arch/arm/cpu/armv7/mx6/ was requested
> in [1] during discussion of chiliSOM support patches.
> 
> [1] http://lists.denx.de/pipermail/u-boot/2017-January/279137.html
> 
> Suggested-by: Tom Rini 
> Signed-off-by: Marcin Niestroj 
> ---
>  arch/arm/Kconfig | 2 --
>  arch/arm/Makefile| 1 -
>  arch/arm/cpu/armv7/mx6/Kconfig   | 9 
> -
>  arch/arm/cpu/armv7/mx6/Makefile  | 1 +
>  arch/arm/{mach-litesom => cpu/armv7/mx6}/litesom.c   | 0
>  .../include/mach => include/asm/arch-mx6}/litesom.h  | 4 ++--
>  arch/arm/mach-litesom/Kconfig| 6 --
>  arch/arm/mach-litesom/Makefile   | 6 --
>  board/grinn/liteboard/board.c| 2 +-
>  9 files changed, 12 insertions(+), 19 deletions(-)
>  rename arch/arm/{mach-litesom => cpu/armv7/mx6}/litesom.c (100%)
>  rename arch/arm/{mach-litesom/include/mach => 
> include/asm/arch-mx6}/litesom.h (68%)
>  delete mode 100644 arch/arm/mach-litesom/Kconfig
>  delete mode 100644 arch/arm/mach-litesom/Makefile
> 
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 30f0925308..b96a86ef85 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -989,8 +989,6 @@ source "arch/arm/mach-keystone/Kconfig"
>  
>  source "arch/arm/mach-kirkwood/Kconfig"
>  
> -source "arch/arm/mach-litesom/Kconfig"
> -
>  source "arch/arm/mach-mvebu/Kconfig"
>  
>  source "arch/arm/cpu/armv7/ls102xa/Kconfig"
> diff --git a/arch/arm/Makefile b/arch/arm/Makefile
> index 4b8bf80c40..9c6834b332 100644
> --- a/arch/arm/Makefile
> +++ b/arch/arm/Makefile
> @@ -58,7 +58,6 @@ machine-$(CONFIG_ARCH_HIGHBANK) += highbank
>  machine-$(CONFIG_ARCH_KEYSTONE)  += keystone
>  # TODO: rename CONFIG_KIRKWOOD -> CONFIG_ARCH_KIRKWOOD
>  machine-$(CONFIG_KIRKWOOD)   += kirkwood
> -machine-$(CONFIG_LITESOM)+= litesom
>  machine-$(CONFIG_ARCH_MESON) += meson
>  machine-$(CONFIG_ARCH_MVEBU) += mvebu
>  # TODO: rename CONFIG_TEGRA -> CONFIG_ARCH_TEGRA
> diff --git a/arch/arm/cpu/armv7/mx6/Kconfig b/arch/arm/cpu/armv7/mx6/Kconfig
> index b8dc5c8df6..1ee96cc125 100644
> --- a/arch/arm/cpu/armv7/mx6/Kconfig
> +++ b/arch/arm/cpu/armv7/mx6/Kconfig
> @@ -35,6 +35,13 @@ config MX6UL
>   select ROM_UNIFIED_SECTIONS
>   bool
>  
> +config MX6UL_LITESOM
> + bool
> + select MX6UL
> + select DM
> + select DM_THERMAL
> + select SUPPORT_SPL
> +
>  config MX6ULL
>   bool
>   select MX6UL
> @@ -244,7 +251,7 @@ config TARGET_PICO_IMX6UL
>  config TARGET_LITEBOARD
>   bool "Grinn liteBoard (i.MX6UL)"
>   select BOARD_LATE_INIT
> - select LITESOM
> + select MX6UL_LITESOM
>  
>  config TARGET_PLATINUM_PICON
>   bool "platinum-picon"
> diff --git a/arch/arm/cpu/armv7/mx6/Makefile b/arch/arm/cpu/armv7/mx6/Makefile
> index 8af191d660..024f7031ad 100644
> --- a/arch/arm/cpu/armv7/mx6/Makefile
> +++ b/arch/arm/cpu/armv7/mx6/Makefile
> @@ -10,3 +10,4 @@
>  obj-y:= soc.o clock.o
>  obj-$(CONFIG_SPL_BUILD)   += ddr.o
>  obj-$(CONFIG_MP) += mp.o
> +obj-$(CONFIG_MX6UL_LITESOM)  += litesom.o
> diff --git a/arch/arm/mach-litesom/litesom.c 
> b/arch/arm/cpu/armv7/mx6/litesom.c
> similarity index 100%
> rename from arch/arm/mach-litesom/litesom.c
> rename to arch/arm/cpu/armv7/mx6/litesom.c
> diff --git a/arch/arm/mach-litesom/include/mach/litesom.h 
> b/arch/arm/include/asm/arch-mx6/litesom.h
> similarity index 68%
> rename from arch/arm/mach-litesom/include/mach/litesom.h
> rename to arch/arm/include/asm/arch-mx6/litesom.h
> index 6833949ae8..656b96aca9 100644
> --- a/arch/arm/mach-litesom/include/mach/litesom.h
> +++ b/arch/arm/include/asm/arch-mx6/litesom.h
> @@ -4,8 +4,8 @@
>   * SPDX-License-Identifier:  GPL-2.0+
>   */
>  
> -#ifndef __ARCH_ARM_MACH_LITESOM_SOM_H__
> -#define __ARCH_ARM_MACH_LITESOM_SOM_H__
> +#ifndef __ARCH_ARM_MX6UL_LITESOM_H__
> +#define __ARCH_ARM_MX6UL_LITESOM_H__
>  
>  int litesom_mmc_init(bd_t *bis);
>  
> diff --git a/arch/arm/mach-litesom/Kconfig b/arch/arm/mach-litesom/Kconfig
> deleted file mode 100644
> index 9b7f36d7ba..00
> --- a/arch/arm/mach-litesom/Kconfig
> +++ /dev/null
> @@ -1,6 +0,0 @@
> -config LITESOM
> - bool
> - select MX6UL
> - select DM
> - select DM_THERMAL
> - select SUPPORT_SPL
> diff --git a/arch/arm/mach-litesom/Makefile b/arch/arm/mach-litesom/Makefile
> deleted file mode 100644
> index b15eb64793..00
> --- a/arch/arm/mach-litesom/Makefile
> +++ /dev/null
> @@ -1,6 +0,0 @@
> -# (C) Copyright 2016 Grinn
> -#
> -# SPDX-License-Identifier:   GPL-2.0+
> -#
> -
> -obj-y  := litesom.o
> diff --git 

Re: [U-Boot] [PATCH 3/3] udoo_neo: Remove ramdiskaddr environment variable

2017-01-27 Thread Stefano Babic
On 10/01/2017 19:32, Breno Lima wrote:
> Remove unused ramdiskaddr environment variable.
> 
> Suggested-by: Andreas Färber 
> Signed-off-by: Breno Lima 
> ---
>  include/configs/udoo_neo.h | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/include/configs/udoo_neo.h b/include/configs/udoo_neo.h
> index a7d1eac..8d67ff3 100644
> --- a/include/configs/udoo_neo.h
> +++ b/include/configs/udoo_neo.h
> @@ -54,7 +54,6 @@
>   "kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \
>   "pxefile_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \
>   "ramdisk_addr_r=0x8300\0" \
> - "ramdiskaddr=0x8300\0" \
>   "scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \
>   BOOTENV
>  
> 

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
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 2/3] udoo_neo: Remove trailing semicolon and space

2017-01-27 Thread Stefano Babic
On 10/01/2017 19:32, Breno Lima wrote:
> Remove the trailing semicolon and space.
> It's not necessary to have it on the last condition.
> 
> Suggested-by: Andreas Färber 
> Signed-off-by: Breno Lima 
> ---
>  include/configs/udoo_neo.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/configs/udoo_neo.h b/include/configs/udoo_neo.h
> index f1e1c93..a7d1eac 100644
> --- a/include/configs/udoo_neo.h
> +++ b/include/configs/udoo_neo.h
> @@ -50,7 +50,7 @@
>   "if test $board_name = EXTENDED; then " \
>   "setenv fdtfile imx6sx-udoo-neo-extended.dtb; fi; " \
>   "if test $fdtfile = UNDEFINED; then " \
> - "echo WARNING: Could not determine dtb to use; fi; \0" \
> + "echo WARNING: Could not determine dtb to use; fi\0" \
>   "kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \
>   "pxefile_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \
>   "ramdisk_addr_r=0x8300\0" \
> 

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
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


  1   2   >