Re: [U-Boot] [PATCH] armv8: fsl: Enable USB only when SYSCLK is 100 MHz

2016-10-08 Thread york sun
On 10/03/2016 03:55 AM, Sriram Dash wrote:
> SYSCLK is used as a reference clock for USB. When the USB controller
> is used, SYSCLK must meet the additional requirement of 100 MHz.
>
> Signed-off-by: Sriram Dash 
> ---


Applied to fsl-qoriq master, awaiting upstream. Thanks.

York

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


Re: [U-Boot] [PATCH 1/2] armv8: ls1043: Enable CONFIG_DM_USB in defconfigs

2016-10-08 Thread york sun
On 09/29/2016 10:37 PM, Sriram Dash wrote:
> Enables driver model flag CONFIG_DM_USB for LS1043A
> platform defconfigs.
>
> Signed-off-by: Sriram Dash 
> ---


Applied to fsl-qoriq master, awaiting upstream. Thanks.

York

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


Re: [U-Boot] dra7xx: config: cleanup: moved to kconfig for CONFIG_SPL_ENV_SUPPORT

2016-10-08 Thread Tom Rini
On Mon, Sep 26, 2016 at 06:20:33PM +0530, B, Ravi wrote:

> removing CONFIG_SPL_ENV_SUPPORT defined in header files
> due to moved to kconfig option for CONFIG_SPL_ENV_SUPPORT
> 
> Signed-off-by: Ravi Babu 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH 2/2] armv8: ls1043: Add USB node in dts for ls1043

2016-10-08 Thread york sun
On 09/29/2016 10:37 PM, Sriram Dash wrote:
> Add the USB node for LS1043 in dts.
>
> Signed-off-by: Sriram Dash 
> ---


Applied to fsl-qoriq master, awaiting upstream. Thanks.

York

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


Re: [U-Boot] [PATCH v2] fsl_sfp : Modify macros as per changes in SFP v3.4

2016-10-08 Thread york sun
On 09/06/2016 11:47 PM, Sumit Garg wrote:
> SFP v3.4 supports 8 keys in SRK table which leads to corresponding
> changes in OSPR key revocation field. So modify OSPR_KEY_REVOC_XXX
> macros accordingly.
>
> Signed-off-by: Sumit Garg 
> ---
>
> Changes in v2:
> Corrected commit message. Also removed whitspace changes in this patch.
>


Applied to fsl-qoriq master, awaiting upstream. Thanks.

York

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


Re: [U-Boot] [PATCH 2/2] armv8: fsl-lsch2: enable snoopable sata read and write

2016-10-08 Thread york sun
On 08/08/2016 12:18 AM, yuantian.t...@nxp.com wrote:
> From: Tang Yuantian 
>
> By default the SATA IP on the ls1043a/ls1046a SoCs does not generating
> coherent/snoopable transactions.  This patch enable it in the SCFG_SNPCNFGCR
> register along with sata axicc register.
> In addition, the dma-coherent property must be set on the SATA controller
> nodes.
>
> Signed-off-by: Tang Yuantian 
> ---


Applied to fsl-qoriq master, awaiting upstream. Thanks.

York

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


[U-Boot] [PATCH] common: env: add kconfig entry for env storage

2016-10-08 Thread Peng Fan
Add Kconfig entry for ENV storage

Signed-off-by: Peng Fan 
Cc: Simon Glass 
Cc: Heiko Schocher 
Cc: Tom Rini 
Cc: Masahiro Yamada 
Cc: Stefan Roese 
Cc: Siva Durga Prasad Paladugu 
Cc: Francois Retief 
---
 common/Kconfig | 73 ++
 1 file changed, 73 insertions(+)

diff --git a/common/Kconfig b/common/Kconfig
index c69c141..a630924 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -158,6 +158,79 @@ config SPI_BOOT
 
 endmenu
 
+menu "ENV storage media"
+
+config ENV_IS_IN_DATAFLASH
+   bool "env stored in dataflash"
+   help
+ env stored in dataflash
+
+config ENV_IS_IN_EEPROM
+   bool "env stored in eeprom"
+   help
+ env stored in eeprom
+
+config ENV_IS_EMBEDDED
+   bool "env is embedded"
+   help
+ env is embedded
+
+config ENV_IS_IN_FLASH
+   bool "env stored in flash"
+   help
+ env stored in flash
+
+config ENV_IS_IN_MMC
+   bool "env stored in sd/mmc card"
+   help
+ env stored in sd/mmc card
+
+config ENV_IS_IN_NAND
+   bool "env stored in nand flash"
+   help
+ env stored in nand flash
+
+config ENV_IS_IN_NVRAM
+   bool "env stored in nvram"
+   help
+ env stored in nvram
+
+config ENV_IS_IN_ONENAND
+   bool "env stored in onenand"
+   help
+ env stored in onenand
+
+config ENV_IS_IN_SATA
+   bool "env stored in sata"
+   help
+ env stored in sata
+
+config ENV_IS_IN_SPI_FLASH
+   bool "env stored in spi flash"
+   help
+ env stored in spi flash
+
+config ENV_IS_IN_FAT
+   bool "env stored in a fat file"
+   help
+ env stored in a fat file
+
+config ENV_IS_IN_UBI
+   bool "env stored in a ubi file"
+   help
+ env stored in a ubi file
+
+config ENV_IS_IN_REMOTE
+   bool "env stored in remote"
+   help
+ env stored in remote
+
+config ENV_IS_NOWHERE
+   bool "env is nowhere"
+   help
+ env is nowhere
+endmenu
+
 config BOOTDELAY
int "delay in seconds before automatically booting"
default 2
-- 
2.6.2

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


Re: [U-Boot] arm: Add return value argument to longjmp

2016-10-08 Thread Tom Rini
On Tue, Sep 27, 2016 at 09:30:32AM +0200, Alexander Graf wrote:

> The normal longjmp command allows for a caller to pass the return value
> of the setjmp() invocation. This patch adds that semantic to the arm
> implementation of it and adjusts the efi_loader call respectively.
> 
> Signed-off-by: Alexander Graf 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH V3 4/8] imx-common: inctroude USE_IMXIMG_PLUGIN Kconfig

2016-10-08 Thread Peng Fan
On Sun, Oct 09, 2016 at 07:45:41AM +0200, Eric Nelson wrote:
>Hi Peng,
>
>Note the typo in the subject header.

Thanks.

>
>On 10/08/2016 08:58 AM, Peng Fan wrote:
>> Introduce USE_IMXIMG_PLUGIN Kconfig
>> 
>> Signed-off-by: Peng Fan 
>> Cc: Stefano Babic 
>> Reviewed-by: Tom Rini 
>> ---
>> 
>> V3:
>>  None
>> 
>> V2:
>>  New
>> 
>>  arch/arm/imx-common/Kconfig | 7 +++
>>  1 file changed, 7 insertions(+)
>> 
>> diff --git a/arch/arm/imx-common/Kconfig b/arch/arm/imx-common/Kconfig
>> index 1b7da5a..85eac57 100644
>> --- a/arch/arm/imx-common/Kconfig
>> +++ b/arch/arm/imx-common/Kconfig
>> @@ -17,3 +17,10 @@ config IMX_BOOTAUX
>>  depends on ARCH_MX7 || ARCH_MX6
>>  help
>>bootaux [addr] to boot auxiliary core.
>> +
>> +config USE_IMXIMG_PLUGIN
>> +bool "Using imximage plugin code"
>
>s/Using/Use/

Will fix this in V4.

>
>> +depends on ARCH_MX7 || ARCH_MX6
>> +help
>> +  i.MX6/7 supports DCD and Plugin. Enable this configuration
>> +  to use Plugin, otherwise DCD will be used.
>> 
>
>MX5x also supports plugins, right?

Yeah. I do not have the hardware to test, so not add ARCH_MX5.
If later, someone can test ARCH_MX5, then he/she could add the support.

>
>Also, the alternative isn't really DCD is it? Most (all) of the boards
>using SPL now are using the essentially empty config file
>in arch/arm/imx-common/spl_sd.cfg.

The help msg is just to tell use plugin or DCD. spl_sd.cfg surely
can have DCD DATA lines or not :)

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


Re: [U-Boot] dra7x: dfu: qspi: increase the qspi spl partition to 256K

2016-10-08 Thread Tom Rini
On Mon, Sep 26, 2016 at 06:21:13PM +0530, B, Ravi wrote:

> The SPL size for dra7x platform increased beyond 64K,
> increasing the size to 256K to cater for future enhancement.
> 
> Signed-off-by: Ravi Babu 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, 2/3] ARM: keystone: rename clk_get_rate() to ks_clk_get_rate()

2016-10-08 Thread Tom Rini
On Mon, Sep 26, 2016 at 08:45:26PM +0900, Masahiro Yamada wrote:

> The KeyStone platform has its own clk_get_rate() but its prototype
> is different from that of the common-clk (clk-uclass) framework.
> 
> Prefix the KeyStone specific implementation with ks_ in order to
> avoid name-space conflict.
> 
> Signed-off-by: Masahiro Yamada 
> Reviewed-by: Simon Glass 
> Acked-by: Lokesh Vutla 
> Reviewed-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, 2/5] kbuild: move no_new_adhoc_configs_check to "all" target command

2016-10-08 Thread Tom Rini
On Mon, Sep 26, 2016 at 01:04:59PM +0900, Masahiro Yamada wrote:

> I am going to move the build rule of u-boot.cfg.  Before that,
> no_new_adhoc_configs_check must be tweaked to not depend on it.
> 
> The ad-hoc option check can be done at the end of build, along
> with other checks.
> 
> Signed-off-by: Masahiro Yamada 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, 2/2] board: ti: dra7xx: complex definitions should be protected with parentheses

2016-10-08 Thread Tom Rini
On Tue, Sep 27, 2016 at 01:01:42PM +0530, Mugunthan V N wrote:

> As a standard practice complex definitions should be protected
> with parentheses, as it might fail when used in a complex if
> statements.
> 
> Signed-off-by: Mugunthan V N 
> Reviewed-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


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


[U-Boot] [PATCH V3 1/8] tools: imximage: add plugin support

2016-10-08 Thread Peng Fan
Add plugin support for imximage.

Define CONFIG_USE_IMXIMG_PLUGIN in defconfig to enable using plugin.

Signed-off-by: Peng Fan 
Cc: Stefano Babic 
Cc: Eric Nelson 
Cc: Ye Li 
Reviewed-by: Tom Rini 
---

V3:
 Fix compile error.

V2:
 Drop the CONFIG_USE_PLUGIN, make plugin always support in imximage.

 tools/imximage.c | 282 +++
 tools/imximage.h |   7 +-
 2 files changed, 229 insertions(+), 60 deletions(-)

diff --git a/tools/imximage.c b/tools/imximage.c
index 092d550..7fa601e 100644
--- a/tools/imximage.c
+++ b/tools/imximage.c
@@ -27,6 +27,7 @@ static table_entry_t imximage_cmds[] = {
{CMD_CHECK_BITS_CLR,"CHECK_BITS_CLR",   "Reg Check bits clr", },
{CMD_CSF,   "CSF",   "Command Sequence File", },
{CMD_IMAGE_VERSION, "IMAGE_VERSION","image version",  },
+   {CMD_PLUGIN,"PLUGIN",   "file plugin_addr",  },
{-1,"", "",   },
 };
 
@@ -80,6 +81,9 @@ static uint32_t imximage_ivt_offset = UNDEFINED;
 static uint32_t imximage_csf_size = UNDEFINED;
 /* Initial Load Region Size */
 static uint32_t imximage_init_loadsize;
+static uint32_t imximage_iram_free_start;
+static uint32_t imximage_plugin_size;
+static uint32_t plugin_image;
 
 static set_dcd_val_t set_dcd_val;
 static set_dcd_param_t set_dcd_param;
@@ -118,7 +122,11 @@ static uint32_t detect_imximage_version(struct imx_header 
*imx_hdr)
 
/* Try to detect V2 */
if ((fhdr_v2->header.tag == IVT_HEADER_TAG) &&
-   (hdr_v2->dcd_table.header.tag == DCD_HEADER_TAG))
+   (hdr_v2->data.dcd_table.header.tag == DCD_HEADER_TAG))
+   return IMXIMAGE_V2;
+
+   if ((fhdr_v2->header.tag == IVT_HEADER_TAG) &&
+   hdr_v2->boot_data.plugin)
return IMXIMAGE_V2;
 
return IMXIMAGE_VER_INVALID;
@@ -165,7 +173,7 @@ static struct dcd_v2_cmd *gd_last_cmd;
 static void set_dcd_param_v2(struct imx_header *imxhdr, uint32_t dcd_len,
int32_t cmd)
 {
-   dcd_v2_t *dcd_v2 = &imxhdr->header.hdr_v2.dcd_table;
+   dcd_v2_t *dcd_v2 = &imxhdr->header.hdr_v2.data.dcd_table;
struct dcd_v2_cmd *d = gd_last_cmd;
struct dcd_v2_cmd *d2;
int len;
@@ -261,21 +269,23 @@ static void set_dcd_rst_v1(struct imx_header *imxhdr, 
uint32_t dcd_len,
 static void set_dcd_rst_v2(struct imx_header *imxhdr, uint32_t dcd_len,
char *name, int lineno)
 {
-   dcd_v2_t *dcd_v2 = &imxhdr->header.hdr_v2.dcd_table;
-   struct dcd_v2_cmd *d = gd_last_cmd;
-   int len;
-
-   if (!d)
-   d = &dcd_v2->dcd_cmd;
-   len = be16_to_cpu(d->write_dcd_command.length);
-   if (len > 4)
-   d = (struct dcd_v2_cmd *)(((char *)d) + len);
-
-   len = (char *)d - (char *)&dcd_v2->header;
-
-   dcd_v2->header.tag = DCD_HEADER_TAG;
-   dcd_v2->header.length = cpu_to_be16(len);
-   dcd_v2->header.version = DCD_VERSION;
+   if (!imxhdr->header.hdr_v2.boot_data.plugin) {
+   dcd_v2_t *dcd_v2 = &imxhdr->header.hdr_v2.data.dcd_table;
+   struct dcd_v2_cmd *d = gd_last_cmd;
+   int len;
+
+   if (!d)
+   d = &dcd_v2->dcd_cmd;
+   len = be16_to_cpu(d->write_dcd_command.length);
+   if (len > 4)
+   d = (struct dcd_v2_cmd *)(((char *)d) + len);
+
+   len = (char *)d - (char *)&dcd_v2->header;
+
+   dcd_v2->header.tag = DCD_HEADER_TAG;
+   dcd_v2->header.length = cpu_to_be16(len);
+   dcd_v2->header.version = DCD_VERSION;
+   }
 }
 
 static void set_imx_hdr_v1(struct imx_header *imxhdr, uint32_t dcd_len,
@@ -317,24 +327,93 @@ static void set_imx_hdr_v2(struct imx_header *imxhdr, 
uint32_t dcd_len,
fhdr_v2->header.length = cpu_to_be16(sizeof(flash_header_v2_t));
fhdr_v2->header.version = IVT_VERSION; /* 0x40 */
 
-   fhdr_v2->entry = entry_point;
-   fhdr_v2->reserved1 = fhdr_v2->reserved2 = 0;
-   hdr_base = entry_point - imximage_init_loadsize +
-   flash_offset;
-   fhdr_v2->self = hdr_base;
-   if (dcd_len > 0)
-   fhdr_v2->dcd_ptr = hdr_base
-   + offsetof(imx_header_v2_t, dcd_table);
-   else
+   if (!hdr_v2->boot_data.plugin) {
+   fhdr_v2->entry = entry_point;
+   fhdr_v2->reserved1 = 0;
+   fhdr_v2->reserved1 = 0;
+   hdr_base = entry_point - imximage_init_loadsize +
+   flash_offset;
+   fhdr_v2->self = hdr_base;
+   if (dcd_len > 0)
+   fhdr_v2->dcd_ptr = hdr_base +
+   offsetof(imx_header_v2_t, data);
+   else
+   fhdr_v2->dcd_ptr = 0;
+   fhdr_v2->boot_data_ptr = h

Re: [U-Boot] [U-Boot, 3/3] Revert "ns16650: Make sure we have CONFIG_CLK set before using infrastructure"

2016-10-08 Thread Tom Rini
On Mon, Sep 26, 2016 at 08:45:27PM +0900, Masahiro Yamada wrote:

> This reverts commit 82f5279b0cd99a9163d34cfe926d0316d9dc0d37.
> 
> The build failure of k2*evm boards was fixed in a different way by
> the previous commit.  It is nasty to patch generic drivers around
> with #ifdef CONFIG_CLK just for the KeyStone's matter.
> 
> Signed-off-by: Masahiro Yamada 
> Reviewed-by: Simon Glass 
> Reviewed-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH V3 1/8] tools: imximage: add plugin support

2016-10-08 Thread Peng Fan
Hi Eric,
On Sun, Oct 09, 2016 at 07:42:34AM +0200, Eric Nelson wrote:
>Hi Peng,
>
>On 10/09/2016 04:20 AM, Peng Fan wrote:
>> On Sat, Oct 08, 2016 at 05:26:18PM +0200, Eric Nelson wrote:
>>> On 10/08/2016 08:58 AM, Peng Fan wrote:
>
>
>
>>>
>>>From what I can tell, there's no reason that you can't have multiple
>>> plugins, and the use of these variables isn't really needed.
>> 
>> I try to follow, are you talking about chained plugin images?
>> Now we only support two IVT headers when using plugin.
>> The first IVT header is for the plugin image, the second ivt header is for
>> uboot image.
>> 
>
>I understand, though the API seems to allow it (chained plugins)
>and I have a suspicion that the code would be cleaner without
>the union.
>
>That said, I don't have a use case in mind.
>
>>>
 +static uint32_t imximage_iram_free_start;
 +static uint32_t imximage_plugin_size;
 +static uint32_t plugin_image;
  
  static set_dcd_val_t set_dcd_val;
  static set_dcd_param_t set_dcd_param;
 @@ -118,7 +122,11 @@ static uint32_t detect_imximage_version(struct 
 imx_header *imx_hdr)
  
/* Try to detect V2 */
if ((fhdr_v2->header.tag == IVT_HEADER_TAG) &&
 -  (hdr_v2->dcd_table.header.tag == DCD_HEADER_TAG))
 +  (hdr_v2->data.dcd_table.header.tag == DCD_HEADER_TAG))
 +  return IMXIMAGE_V2;
 +
 +  if ((fhdr_v2->header.tag == IVT_HEADER_TAG) &&
 +  hdr_v2->boot_data.plugin)
return IMXIMAGE_V2;
  
return IMXIMAGE_VER_INVALID;
 @@ -165,7 +173,7 @@ static struct dcd_v2_cmd *gd_last_cmd;
  static void set_dcd_param_v2(struct imx_header *imxhdr, uint32_t dcd_len,
int32_t cmd)
  {
>>>
>>> I also don't understand why the choice to make the union
>>> with either a DCD table or a plugin.
>> 
>> Confirmed with ROM team. DCD and plugin are exclusive,
>> 
>> You can not have both at the same time.
>>
>
>That's too bad, since porting from DCD-style to SPL can be
>useful (as Fabio has seen trying to keep some boards up-to-date).

I saw the patches.
If using plugin, there is no need to use DCD.

all the things in DCD can be done in plugin code.

>
>If we get SPL-as-plugin working, then this would form a
>dividing line where you need to get rid of the DCD altogether.
>
>What about the CSF test? Your patches say that CSF and plugins
>are also not supported.

CSF is supported  and code in nxp community. But that piece code is not included
in the nxp released uboot.

https://community.nxp.com/docs/DOC-332725

>
>>>
>>> We should be able to have both, and this doesn't make
>>> the code any easier.
>>>
 -  dcd_v2_t *dcd_v2 = &imxhdr->header.hdr_v2.dcd_table;
 +  dcd_v2_t *dcd_v2 = &imxhdr->header.hdr_v2.data.dcd_table;
struct dcd_v2_cmd *d = gd_last_cmd;
struct dcd_v2_cmd *d2;
int len;
 @@ -261,21 +269,23 @@ static void set_dcd_rst_v1(struct imx_header 
 *imxhdr, uint32_t dcd_len,
  static void set_dcd_rst_v2(struct imx_header *imxhdr, uint32_t dcd_len,
char *name, int lineno)
  {
 -  dcd_v2_t *dcd_v2 = &imxhdr->header.hdr_v2.dcd_table;
 -  struct dcd_v2_cmd *d = gd_last_cmd;
 -  int len;
 -
 -  if (!d)
 -  d = &dcd_v2->dcd_cmd;
 -  len = be16_to_cpu(d->write_dcd_command.length);
 -  if (len > 4)
 -  d = (struct dcd_v2_cmd *)(((char *)d) + len);
 -
 -  len = (char *)d - (char *)&dcd_v2->header;
 -
 -  dcd_v2->header.tag = DCD_HEADER_TAG;
 -  dcd_v2->header.length = cpu_to_be16(len);
 -  dcd_v2->header.version = DCD_VERSION;
 +  if (!imxhdr->header.hdr_v2.boot_data.plugin) {
 +  dcd_v2_t *dcd_v2 = &imxhdr->header.hdr_v2.data.dcd_table;
 +  struct dcd_v2_cmd *d = gd_last_cmd;
 +  int len;
 +
 +  if (!d)
 +  d = &dcd_v2->dcd_cmd;
 +  len = be16_to_cpu(d->write_dcd_command.length);
 +  if (len > 4)
 +  d = (struct dcd_v2_cmd *)(((char *)d) + len);
 +
 +  len = (char *)d - (char *)&dcd_v2->header;
 +
 +  dcd_v2->header.tag = DCD_HEADER_TAG;
 +  dcd_v2->header.length = cpu_to_be16(len);
 +  dcd_v2->header.version = DCD_VERSION;
 +  }
  }
  
  static void set_imx_hdr_v1(struct imx_header *imxhdr, uint32_t dcd_len,
 @@ -317,24 +327,93 @@ static void set_imx_hdr_v2(struct imx_header 
 *imxhdr, uint32_t dcd_len,
fhdr_v2->header.length = cpu_to_be16(sizeof(flash_header_v2_t));
fhdr_v2->header.version = IVT_VERSION; /* 0x40 */
  
>>>
>>> It seems that the reason for a lot of this special-purpose code is to add
>>> support for the entry address.
>>>
>>> If mkimage is invoked with an entrypoint from the command-line:
>>>
>>> ~/$ ./tools/mkimage -n my.cfg -T imximage -e 0xentrypoint u-boot.img
>>> u-boot.imx
>>>
>>> 

Re: [U-Boot] [U-Boot, 1/3] ARM: keystone: remove declaration of unused functions

2016-10-08 Thread Tom Rini
On Mon, Sep 26, 2016 at 08:45:25PM +0900, Masahiro Yamada wrote:

> These two functions are neither defined nor referenced.
> 
> Signed-off-by: Masahiro Yamada 
> Acked-by: Lokesh Vutla 
> Reviewed-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] env: tool: add command line option to input lockfile path

2016-10-08 Thread Tom Rini
On Mon, Sep 26, 2016 at 06:24:08PM +0530, B, Ravi wrote:

> The default lockname is set to /var/lock. This limits the
> usage of this application where OS uses different lockfile
> location parameter.
> For example, In case of android, the default lock
> path location is /data.
> Hence by providing the command line option to input lockfile
> path will be useful to reuse the tool across multiple
> operating system.
> 
> usage: ./fw_printenv -l 
> 
> Signed-off-by: Ravi Babu 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH 1/1]: filesystems : add "file exists" cmd

2016-10-08 Thread Sergey Kubushyn

On Sat, 8 Oct 2016, Sergey Kubushyn wrote:


On Sat, 8 Oct 2016, Tom Rini wrote:


 On Wed, Oct 05, 2016 at 12:38:01PM -0700, Sergey Kubushyn wrote:

>  This adds "file exists" commands to generic FS as well as to FAT, EXT4,
>  and UBIFS. Also adds "file size" command to UBIFS.
> 
>  The return value for "file exists" commands is REVERSED i.e. they

>  return 1 if file exists and 0 otherwise. This is a deliberate decision
>  because those commands are supposed to be used almost exclusively in
>  scripts and TRUE value is _not_ zero while FALSE is zero.
> 
>  As of now the only way to check for a file existence is to attempt a

>  read on that file (aka load.) That works but it makes an unnecessary
>  read, overwrites memory at destination address if file not a zero
>  length one, and outputs unnecessary messages to the console in any
>  case.
> 
>  Checking file existence in scripts is a valuable feature that allows

>  the higher level software (e.g. Linux) to interact with U-Boot by
>  creating some semaphore files and rebooting. We do use it quite
>  extensively for system setup at manufacturing time and for other
>  purposes (e.g. our Android "recovery" is implemented this way.)
> 
>  Signed-off-by: Sergey Kubushyn 


 Can you please do this in at least two patches?  file size to ubi should
 be its own patch.  Also:


Sure, will do later today.


>  +int do_ext4_file_exists(cmd_tbl_t *cmdtp, int flag, int argc,
>  + char *const argv[])
>  +{
>  + int ret;
>  +
>  + ret = do_file_exists(cmdtp, flag, argc, argv, FS_TYPE_EXT);
>  + +   if (ret == 0) return 1;
>  + if (ret == 1) return 0;
>  + return ret;
>  +}

 I can only assume this hasn't been compile tested in a while, and you
 should simplify the code into a single if/else and a comment on what we
 want/mean.  Thanks!


The problem is do_file_exists() can return not just 0 if file exists or
1 if it doesn't but also a negative value for "I don't know" i.e. when
e.g. FS mount failed.

I don't know if those return codes are somehow processed further up (too
much time to dig everything to the bare metal) so I decided to return
that value as-is if it happened. Sure it could be done like e.g.

return (ret == 0);

even without any if-elses and it is probably the proper way to do it but
I fell victim of perfectionism :))

Will re-do it with the above construction and split in 2 parts. Will also
send it with git send-email so it won't end up garbled.


OK, please disregard this patch altogether. I somehow missed "test -e"
command that has been implemented something like 2 years ago and that
command makes this entire patch unnecessary.

I will rewrite my scripts with "test -e" before submitting new boards.

---
**
*  KSI@homeKOI8 Net  < >  The impossible we do immediately.  *
*  Las Vegas   NV, USA   < >  Miracles require 24-hour notice.   *
**
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-Boot, 1/5] check-config: fix wrong comment about how to build whitelist

2016-10-08 Thread Tom Rini
On Mon, Sep 26, 2016 at 01:04:58PM +0900, Masahiro Yamada wrote:

> The command suggested in this comment block is wrong; it would not
> rip off CONFIG options that had already been converted to Kconfig.
> 
> Instead, we should use the scripts/build-whitelist.sh tool.
> 
> Signed-off-by: Masahiro Yamada 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, v1] spl: saveenv: adding saveenv support in SPL

2016-10-08 Thread Tom Rini
On Wed, Sep 28, 2016 at 02:46:18PM +0530, B, Ravi wrote:

> By default saveenv option is not supported for SPL. This patch
> enable the support for save environment variable for SPL build.
> 
> Enable save environment support in SPL after setenv. By default
> the saveenv option is not provided in SPL, but some boards need
> this support in 'Falcon' boot, where SPL need to boot from
> different images based on environment variable set by OS. For
> example OS may set "reboot_image" environment variable to
> "recovery" inorder to boot recovery image by SPL. The SPL read
> "reboot_image" and act accordingly and change the reboot_image
> to default mode using setenv and save the environemnt.
> 
> Signed-off-by: Ravi Babu 
> Reviewed-by: Simon Glass 
> 
> 
> change in v1:
>   - dropped SUPPORT, use CONFIG_SPL_SAVEENV
>   - updates the comments in mmc_private.h

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH] armv8/fsl-lsch2: Implement workaround for PIN MUX erratum A010539

2016-10-08 Thread york sun
On 09/28/2016 09:55 PM, Zhiqiang Hou wrote:
> From: Hou Zhiqiang 
>
> Pin mux logic has 2 options in priority order, one is through RCW_SRC
> and then through RCW_Fields. In case of QSPI booting, RCW_SRC logic takes
> the priority for SPI pads and do not allow RCW_BASE and SPI_EXT to control
> the SPI muxing. But actually those are DSPI controller's pads instead of
> QSPI controller's, so this workaround allows RCW fields SPI_BASE and SPI_EXT
> to control relevant pads muxing.
>
> Signed-off-by: Hou Zhiqiang 
> ---


Applied to fsl-qoriq master, awaiting upstream. Thanks.

York

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


Re: [U-Boot] [PATCH] armv8: fsl-layerscape: Fix "cpu status" command

2016-10-08 Thread york sun
On 09/13/2016 12:40 PM, york sun wrote:
> The core position is not continuous for some SoCs. For example,
> valid cores may present at position 0, 1, 4, 5, 8, 9, etc. Some
> registers (including boot release register) only count existing
> cores. Current implementation of cpu_mask() complies with the
> continuous numbering. However, command "cpu status" queries the
> spin table with actual core position. Add functions to calculate
> core position from core number, to correctly calculate offsets.
>
> Tested on LS2080ARDB and LS1043ARDB.
>
> Signed-off-by: York Sun 
> ---
>


Applied to fsl-qoriq master, awaiting upstream.

York

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


Re: [U-Boot] [PATCH V3 4/8] imx-common: inctroude USE_IMXIMG_PLUGIN Kconfig

2016-10-08 Thread Eric Nelson
Hi Peng,

Note the typo in the subject header.

On 10/08/2016 08:58 AM, Peng Fan wrote:
> Introduce USE_IMXIMG_PLUGIN Kconfig
> 
> Signed-off-by: Peng Fan 
> Cc: Stefano Babic 
> Reviewed-by: Tom Rini 
> ---
> 
> V3:
>  None
> 
> V2:
>  New
> 
>  arch/arm/imx-common/Kconfig | 7 +++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/arch/arm/imx-common/Kconfig b/arch/arm/imx-common/Kconfig
> index 1b7da5a..85eac57 100644
> --- a/arch/arm/imx-common/Kconfig
> +++ b/arch/arm/imx-common/Kconfig
> @@ -17,3 +17,10 @@ config IMX_BOOTAUX
>   depends on ARCH_MX7 || ARCH_MX6
>   help
> bootaux [addr] to boot auxiliary core.
> +
> +config USE_IMXIMG_PLUGIN
> + bool "Using imximage plugin code"

s/Using/Use/

> + depends on ARCH_MX7 || ARCH_MX6
> + help
> +   i.MX6/7 supports DCD and Plugin. Enable this configuration
> +   to use Plugin, otherwise DCD will be used.
> 

MX5x also supports plugins, right?

Also, the alternative isn't really DCD is it? Most (all) of the boards
using SPL now are using the essentially empty config file
in arch/arm/imx-common/spl_sd.cfg.


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


Re: [U-Boot] [PATCH V3 1/8] tools: imximage: add plugin support

2016-10-08 Thread Eric Nelson
Hi Peng,

On 10/09/2016 04:20 AM, Peng Fan wrote:
> On Sat, Oct 08, 2016 at 05:26:18PM +0200, Eric Nelson wrote:
>> On 10/08/2016 08:58 AM, Peng Fan wrote:



>>
>>From what I can tell, there's no reason that you can't have multiple
>> plugins, and the use of these variables isn't really needed.
> 
> I try to follow, are you talking about chained plugin images?
> Now we only support two IVT headers when using plugin.
> The first IVT header is for the plugin image, the second ivt header is for
> uboot image.
> 

I understand, though the API seems to allow it (chained plugins)
and I have a suspicion that the code would be cleaner without
the union.

That said, I don't have a use case in mind.

>>
>>> +static uint32_t imximage_iram_free_start;
>>> +static uint32_t imximage_plugin_size;
>>> +static uint32_t plugin_image;
>>>  
>>>  static set_dcd_val_t set_dcd_val;
>>>  static set_dcd_param_t set_dcd_param;
>>> @@ -118,7 +122,11 @@ static uint32_t detect_imximage_version(struct 
>>> imx_header *imx_hdr)
>>>  
>>> /* Try to detect V2 */
>>> if ((fhdr_v2->header.tag == IVT_HEADER_TAG) &&
>>> -   (hdr_v2->dcd_table.header.tag == DCD_HEADER_TAG))
>>> +   (hdr_v2->data.dcd_table.header.tag == DCD_HEADER_TAG))
>>> +   return IMXIMAGE_V2;
>>> +
>>> +   if ((fhdr_v2->header.tag == IVT_HEADER_TAG) &&
>>> +   hdr_v2->boot_data.plugin)
>>> return IMXIMAGE_V2;
>>>  
>>> return IMXIMAGE_VER_INVALID;
>>> @@ -165,7 +173,7 @@ static struct dcd_v2_cmd *gd_last_cmd;
>>>  static void set_dcd_param_v2(struct imx_header *imxhdr, uint32_t dcd_len,
>>> int32_t cmd)
>>>  {
>>
>> I also don't understand why the choice to make the union
>> with either a DCD table or a plugin.
> 
> Confirmed with ROM team. DCD and plugin are exclusive,
> 
> You can not have both at the same time.
>

That's too bad, since porting from DCD-style to SPL can be
useful (as Fabio has seen trying to keep some boards up-to-date).

If we get SPL-as-plugin working, then this would form a
dividing line where you need to get rid of the DCD altogether.

What about the CSF test? Your patches say that CSF and plugins
are also not supported.

>>
>> We should be able to have both, and this doesn't make
>> the code any easier.
>>
>>> -   dcd_v2_t *dcd_v2 = &imxhdr->header.hdr_v2.dcd_table;
>>> +   dcd_v2_t *dcd_v2 = &imxhdr->header.hdr_v2.data.dcd_table;
>>> struct dcd_v2_cmd *d = gd_last_cmd;
>>> struct dcd_v2_cmd *d2;
>>> int len;
>>> @@ -261,21 +269,23 @@ static void set_dcd_rst_v1(struct imx_header *imxhdr, 
>>> uint32_t dcd_len,
>>>  static void set_dcd_rst_v2(struct imx_header *imxhdr, uint32_t dcd_len,
>>> char *name, int lineno)
>>>  {
>>> -   dcd_v2_t *dcd_v2 = &imxhdr->header.hdr_v2.dcd_table;
>>> -   struct dcd_v2_cmd *d = gd_last_cmd;
>>> -   int len;
>>> -
>>> -   if (!d)
>>> -   d = &dcd_v2->dcd_cmd;
>>> -   len = be16_to_cpu(d->write_dcd_command.length);
>>> -   if (len > 4)
>>> -   d = (struct dcd_v2_cmd *)(((char *)d) + len);
>>> -
>>> -   len = (char *)d - (char *)&dcd_v2->header;
>>> -
>>> -   dcd_v2->header.tag = DCD_HEADER_TAG;
>>> -   dcd_v2->header.length = cpu_to_be16(len);
>>> -   dcd_v2->header.version = DCD_VERSION;
>>> +   if (!imxhdr->header.hdr_v2.boot_data.plugin) {
>>> +   dcd_v2_t *dcd_v2 = &imxhdr->header.hdr_v2.data.dcd_table;
>>> +   struct dcd_v2_cmd *d = gd_last_cmd;
>>> +   int len;
>>> +
>>> +   if (!d)
>>> +   d = &dcd_v2->dcd_cmd;
>>> +   len = be16_to_cpu(d->write_dcd_command.length);
>>> +   if (len > 4)
>>> +   d = (struct dcd_v2_cmd *)(((char *)d) + len);
>>> +
>>> +   len = (char *)d - (char *)&dcd_v2->header;
>>> +
>>> +   dcd_v2->header.tag = DCD_HEADER_TAG;
>>> +   dcd_v2->header.length = cpu_to_be16(len);
>>> +   dcd_v2->header.version = DCD_VERSION;
>>> +   }
>>>  }
>>>  
>>>  static void set_imx_hdr_v1(struct imx_header *imxhdr, uint32_t dcd_len,
>>> @@ -317,24 +327,93 @@ static void set_imx_hdr_v2(struct imx_header *imxhdr, 
>>> uint32_t dcd_len,
>>> fhdr_v2->header.length = cpu_to_be16(sizeof(flash_header_v2_t));
>>> fhdr_v2->header.version = IVT_VERSION; /* 0x40 */
>>>  
>>
>> It seems that the reason for a lot of this special-purpose code is to add
>> support for the entry address.
>>
>> If mkimage is invoked with an entrypoint from the command-line:
>>
>> ~/$ ./tools/mkimage -n my.cfg -T imximage -e 0xentrypoint u-boot.img
>> u-boot.imx
>>
>> This entry point is normally placed into the header, but if we have a
>> plugin in the .cfg file like this:
>>
>> ~/$ grep PLUGIN my.cfg
>> PLUGIN path/to/board/plugin.bin 0x00907000
>>
>> Then we need to use the plugin's address instead of the command
>> line address, and use the command-line address for the file which
>> follows.
> 
> There are two IVT headers when using plugin, the 0x907000 is for the first IVT
> header, 

Re: [U-Boot] [U-Boot, RFC, v1] common/console.c: ensure GD_FLG_SILENT is set or cleared

2016-10-08 Thread Tom Rini
On Fri, Sep 23, 2016 at 03:59:43PM +1200, Chris Packham wrote:

> When CONFIG_SILENT_CONSOLE is defined and the default environment has
> silent=1 it is not possible for a user to make the console un-silent if
> the environment is not available when console_init_f() is called (for
> example because the environment is in SPI).
> 
> Add a new helper function console_update_silent() and call it from both
> console_init_f() and console_init_r().
> 
> Signed-off-by: Chris Packham 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, v2] vexpress: disable cci ace slave ports when booting in non-sec/hyp mode

2016-10-08 Thread Tom Rini
On Fri, Sep 23, 2016 at 05:38:39PM +0100, Sudeep Holla wrote:

> Commit f225d39d3093 ("vexpress: Check TC2 firmware support before defaulting
> to nonsec booting") added support to check if the firmware on TC2  is
> configured appropriately before booting in nonsec/hyp mode.
> 
> However when booting in non-secure/hyp mode, CCI control must be done in
> secure firmware and can't  be done in non-secure/hyp mode. In order to
> ensure that, this patch disables the cci slave port inteface so that it
> is not accessed at all.
> 
> Cc: Jon Medhurst 
> Acked-by: Marc Zyngier 
> Signed-off-by: Sudeep Holla 
> Acked-by: Jon Medhurst 
> Tested-by: Jon Medhurst 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH V3 1/8] tools: imximage: add plugin support

2016-10-08 Thread Peng Fan
On Sat, Oct 08, 2016 at 05:26:18PM +0200, Eric Nelson wrote:
>Hi Peng,
>
>I'm sorry for taking so long to go though this.
>
>On 10/08/2016 08:58 AM, Peng Fan wrote:
>> Add plugin support for imximage.
>> 
>
>This CONFIG setting doesn't actually affect mkimage or imximage:

Yeah. The host tool always support plugin code now. But need to define
CONFIG_USE_IMXIMG_PLUGIN to compile plugin.S.

>
>> Define CONFIG_USE_IMXIMG_PLUGIN in defconfig to enable using plugin.
>> 
>> Signed-off-by: Peng Fan 
>> Cc: Stefano Babic 
>> Cc: Eric Nelson 
>> Cc: Ye Li 
>> Reviewed-by: Tom Rini 
>> ---
>> 
>> V3:
>>  Fix compile error.
>> 
>> V2:
>>  Drop the CONFIG_USE_PLUGIN, make plugin always support in imximage.
>> 
>>  tools/imximage.c | 282 
>> +++
>>  tools/imximage.h |   7 +-
>>  2 files changed, 229 insertions(+), 60 deletions(-)
>> 
>> diff --git a/tools/imximage.c b/tools/imximage.c
>> index 092d550..7fa601e 100644
>> --- a/tools/imximage.c
>> +++ b/tools/imximage.c
>> @@ -27,6 +27,7 @@ static table_entry_t imximage_cmds[] = {
>>  {CMD_CHECK_BITS_CLR,"CHECK_BITS_CLR",   "Reg Check bits clr", },
>>  {CMD_CSF,   "CSF",   "Command Sequence File", },
>>  {CMD_IMAGE_VERSION, "IMAGE_VERSION","image version",  },
>> +{CMD_PLUGIN,"PLUGIN",   "file plugin_addr",  },
>>  {-1,"", "",   },
>>  };
>>  
>> @@ -80,6 +81,9 @@ static uint32_t imximage_ivt_offset = UNDEFINED;
>>  static uint32_t imximage_csf_size = UNDEFINED;
>>  /* Initial Load Region Size */
>>  static uint32_t imximage_init_loadsize;
>
>These seem very limiting.
>
>From what I can tell, there's no reason that you can't have multiple
>plugins, and the use of these variables isn't really needed.

I try to follow, are you talking about chained plugin images?
Now we only support two IVT headers when using plugin.
The first IVT header is for the plugin image, the second ivt header is for
uboot image.

>
>> +static uint32_t imximage_iram_free_start;
>> +static uint32_t imximage_plugin_size;
>> +static uint32_t plugin_image;
>>  
>>  static set_dcd_val_t set_dcd_val;
>>  static set_dcd_param_t set_dcd_param;
>> @@ -118,7 +122,11 @@ static uint32_t detect_imximage_version(struct 
>> imx_header *imx_hdr)
>>  
>>  /* Try to detect V2 */
>>  if ((fhdr_v2->header.tag == IVT_HEADER_TAG) &&
>> -(hdr_v2->dcd_table.header.tag == DCD_HEADER_TAG))
>> +(hdr_v2->data.dcd_table.header.tag == DCD_HEADER_TAG))
>> +return IMXIMAGE_V2;
>> +
>> +if ((fhdr_v2->header.tag == IVT_HEADER_TAG) &&
>> +hdr_v2->boot_data.plugin)
>>  return IMXIMAGE_V2;
>>  
>>  return IMXIMAGE_VER_INVALID;
>> @@ -165,7 +173,7 @@ static struct dcd_v2_cmd *gd_last_cmd;
>>  static void set_dcd_param_v2(struct imx_header *imxhdr, uint32_t dcd_len,
>>  int32_t cmd)
>>  {
>
>I also don't understand why the choice to make the union
>with either a DCD table or a plugin.

Confirmed with ROM team. DCD and plugin are exclusive,

You can not have both at the same time.

>
>We should be able to have both, and this doesn't make
>the code any easier.
>
>> -dcd_v2_t *dcd_v2 = &imxhdr->header.hdr_v2.dcd_table;
>> +dcd_v2_t *dcd_v2 = &imxhdr->header.hdr_v2.data.dcd_table;
>>  struct dcd_v2_cmd *d = gd_last_cmd;
>>  struct dcd_v2_cmd *d2;
>>  int len;
>> @@ -261,21 +269,23 @@ static void set_dcd_rst_v1(struct imx_header *imxhdr, 
>> uint32_t dcd_len,
>>  static void set_dcd_rst_v2(struct imx_header *imxhdr, uint32_t dcd_len,
>>  char *name, int lineno)
>>  {
>> -dcd_v2_t *dcd_v2 = &imxhdr->header.hdr_v2.dcd_table;
>> -struct dcd_v2_cmd *d = gd_last_cmd;
>> -int len;
>> -
>> -if (!d)
>> -d = &dcd_v2->dcd_cmd;
>> -len = be16_to_cpu(d->write_dcd_command.length);
>> -if (len > 4)
>> -d = (struct dcd_v2_cmd *)(((char *)d) + len);
>> -
>> -len = (char *)d - (char *)&dcd_v2->header;
>> -
>> -dcd_v2->header.tag = DCD_HEADER_TAG;
>> -dcd_v2->header.length = cpu_to_be16(len);
>> -dcd_v2->header.version = DCD_VERSION;
>> +if (!imxhdr->header.hdr_v2.boot_data.plugin) {
>> +dcd_v2_t *dcd_v2 = &imxhdr->header.hdr_v2.data.dcd_table;
>> +struct dcd_v2_cmd *d = gd_last_cmd;
>> +int len;
>> +
>> +if (!d)
>> +d = &dcd_v2->dcd_cmd;
>> +len = be16_to_cpu(d->write_dcd_command.length);
>> +if (len > 4)
>> +d = (struct dcd_v2_cmd *)(((char *)d) + len);
>> +
>> +len = (char *)d - (char *)&dcd_v2->header;
>> +
>> +dcd_v2->header.tag = DCD_HEADER_TAG;
>> +dcd_v2->header.length = cpu_to_be16(len);
>> +dcd_v2->header.version = DCD_VERSION;
>> +}
>>  }
>>  
>>  static void set_imx_hdr_v1(struct imx_header *imx

Re: [U-Boot] [PATCH 1/1]: environment in eMMC boot partition

2016-10-08 Thread Sergey Kubushyn

On Sat, 8 Oct 2016, Tom Rini wrote:


On Wed, Oct 05, 2016 at 01:28:07PM -0700, Sergey Kubushyn wrote:


This allows to place U-Boot environment into eMMC boot partition thus
saving space on user partition for the OS (or whatever.) When booting
off of eMMC many (all?) MCUs can use dedicated boot0/boot1 partitions
to boot so U-Boot (or SPL) is written to one (or both) such partitions.
When such boot configuration is used it makes sense to place environment
in the same partition where the U-Boot itself is so the entire user
partition is available for the OS.

It might be not well polished yet but it is a simple patch that can be
reworked later.

It uses 4 Kconfig variables right now which probably belong to the board
Kconfig. Those are:

CONFIG_ENV_IN_EMMC_BOOT -- tells that environment is in eMMC boot
 partition if defined

CONFIG_EMMC_ENV_PART -- tells which boot partition environment should be
 stored in (either 1 or 2)

CONFIG_EMMC_BOOT_PART -- which boot partition will be used by eMMC to
 read U-Boot/SPL binary for boot protocol (either 1 or 2.) That can be
 different from the environment partition

CONFIG_EMMC_BOOT_ACK -- tells that eMMC should provide boot ACKs if
 defined

Here is an excerpt from actual board Kconfig:


I think what's missing is that in the other cases where we do
environment in the eMMC boot partitions we don't need the boot ack part.
Can you see if the existing hooks work, when you add in something for
boot ack?


Eh, I _DO_ use existing hook. And one of the parameters passed to that
hook is boot ack (drivers/mmc/mmc_boot.c, line 101):

=== Cut ===
int mmc_set_part_conf(struct mmc *mmc, u8 ack, u8 part_num, u8 access)
=== Cut ===

I could've just set it to 0 unconditionally but there might be some board
configs that might require it to be enabled so I made it configurable.

And I don't think we have any boards with environment in boot partition
because there is simply no support for this in common/enc_mmc.c. Remember,
eMMC boot partition and a partition on eMMC you boot off of are totally
orthogonal :) Boot partitions (there are 2 of those and one user partition
on eMMC) are special. You have to explicitely switch to a boot partition
to access it. When U-Boot is started eMMC boot partition it had been read
off (if the system boots off of boot partition using special boot protocol)
is long gone and what U-Boot sees is _USER_ partition. One can create
up to 4 GP partitions on eMMC but those are _DIFFERENT_ partitions and
they all reside in _USER_ partition i.e. GP partitions just subdivide the
single _USER_ partition into up to 4 parts.

When you boot off of an eMMC boot partition U-Boot binary is written into
boot partition so no part of visible _USER_ partition is taken, not a
single byte. That means that only one 512-byte block of the user partition
is reserved (MBR/partition table) so one can start a primary DOS partition
on eMMC at block 1 and use the entire space up to the last block for that
partition. However there is still U-Boot environment that one has to put
somewhere. Although it is possible to put it into user partition starting
first DOS (or GP) partition at e.g. block 160 or so and using that gap
between MBR and start of the first partition for environment it is not a
right thing to do. This way we are wasting some otherwise useable eMMC
storage space while still have plenty of unused space in 2 boot partitions.

If we put U-Boot in a boot partition it is logical to put its environment
in the same partition, isn't it? This is even more logical knowing the
fact it would save us some storage space for the OS filesystem...

But anyway, please hold off -- that patch won't apply because the alpine
email client "beautifies" text-only emails for some moronic reasons by
adding trailing whitespace to _SOME_ lines on mail _SEND_ thus screwing up
the patch. I will re-send that patch using git send-email that seems to
work correctly in a couple of hours. I will format it to follow official
rules and add proper CCs before re-sending.

Did you get that nand-bootupdate patch I re-sent yesterday with git
send-email? Did it work if you got it? It's been done against u-boot-imx.

---
**
*  KSI@homeKOI8 Net  < >  The impossible we do immediately.  *
*  Las Vegas   NV, USA   < >  Miracles require 24-hour notice.   *
**
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/1]: environment in eMMC boot partition

2016-10-08 Thread Sergey Kubushyn

On Sat, 8 Oct 2016, Tom Rini wrote:


On Sat, Oct 08, 2016 at 03:41:50PM -0700, Sergey Kubushyn wrote:

On Sat, 8 Oct 2016, Tom Rini wrote:


On Wed, Oct 05, 2016 at 01:28:07PM -0700, Sergey Kubushyn wrote:


This allows to place U-Boot environment into eMMC boot partition thus
saving space on user partition for the OS (or whatever.) When booting
off of eMMC many (all?) MCUs can use dedicated boot0/boot1 partitions
to boot so U-Boot (or SPL) is written to one (or both) such partitions.
When such boot configuration is used it makes sense to place environment
in the same partition where the U-Boot itself is so the entire user
partition is available for the OS.

It might be not well polished yet but it is a simple patch that can be
reworked later.

It uses 4 Kconfig variables right now which probably belong to the board
Kconfig. Those are:

CONFIG_ENV_IN_EMMC_BOOT -- tells that environment is in eMMC boot
partition if defined

CONFIG_EMMC_ENV_PART -- tells which boot partition environment should be
stored in (either 1 or 2)

CONFIG_EMMC_BOOT_PART -- which boot partition will be used by eMMC to
read U-Boot/SPL binary for boot protocol (either 1 or 2.) That can be
different from the environment partition

CONFIG_EMMC_BOOT_ACK -- tells that eMMC should provide boot ACKs if
defined

Here is an excerpt from actual board Kconfig:


I think what's missing is that in the other cases where we do
environment in the eMMC boot partitions we don't need the boot ack part.
Can you see if the existing hooks work, when you add in something for
boot ack?


Eh, I _DO_ use existing hook. And one of the parameters passed to that
hook is boot ack (drivers/mmc/mmc_boot.c, line 101):

=== Cut ===
int mmc_set_part_conf(struct mmc *mmc, u8 ack, u8 part_num, u8 access)
=== Cut ===

I could've just set it to 0 unconditionally but there might be some board
configs that might require it to be enabled so I made it configurable.

And I don't think we have any boards with environment in boot partition
because there is simply no support for this in common/enc_mmc.c. Remember,


I've put environment on the boot partitions on the eMMC on Beaglebone
black for a number of years.  See include/configs/am335x_evm.h:
#elif defined(CONFIG_EMMC_BOOT)
#define CONFIG_ENV_IS_IN_MMC
#define CONFIG_SYS_MMC_ENV_DEV  1
#define CONFIG_SYS_MMC_ENV_PART 2
#define CONFIG_ENV_OFFSET   0x0
#define CONFIG_ENV_OFFSET_REDUND(CONFIG_ENV_OFFSET +
CONFIG_ENV_SIZE)
#define CONFIG_SYS_REDUNDAND_ENVIRONMENT

Now, I fully accept that it's not working in your case and there must be
something further needed.


That's all nice but it is not like it boots off of eMMC special boot
partition and environment is actually NOT in eMMC boot partition...

eMMC is special -- it has 2 additional boot partitions that are HIDDEN
on normal use and only used for special boot protocol that is only
implemented in SOME SoCs. Regular MMC card has only one hardware part
that is same as eMMC user partition. Actually there is yet another one
in eMMC called RPMB but that one is totally special and not a storage
partition at all. Linux shows up at least 3 partitions on eMMC that are
usually named /dev/block/mmcblkXboot[0,1] and /dev/block/mmcblkXpY so
boot partitions can be accessed as regular block devices. They are made
read-only by default so one has to set a partition R/W before it can be
written to.

Older SoCs can not take advantage of those boot partitions -- they treat
eMMC as a regular MMC device with only one partition and it works just
fine, just advanced eMMC features are wasted. i.MX6 boots off of eMMC
boot partition if available and there are special boot configuration
switches for this -- you can select the boot proto bus width, boot ACK,
and some other parameters. It is OK to waste those resources if SoC does
not support those -- there is no other choice anyway -- but if they ARE
supported why wouldn't we use those?

eMMC boot partitions are _NOT_ in eMMC address space by default -- all
address space corresponds to USER partition. In order to access a boot
(or RPMB) partition one has to issue a special mmc command writing to
extended command register, EXT_CSD[179] that allows to switch to a boot
partition. When you switched to a boot partition user partition becomes
unavailable i.e. the entire address space corresponds to that boot
partition you switched to and is looks like the only one available on
that eMMC device.

There are special compile-time config variables in U-Boot for including
boot and RPMB partition access (CONFIG_SUPPORT_EMMC_BOOT and
CONFIG_SUPPORT_EMMC_RPMB respectively) that add corresponding commands
and access methods to regular "mmc" command (cmd/mmc.c line 742 and
other places.) It is eMMC-specific, regular MMC devices do _NOT_ have
those features.

BTW, U-Boot list server ran out of space so it won't show up in regular
list posts until the space issue is fixed...

---
***

Re: [U-Boot] [PATCH 1/1]: filesystems : add "file exists" cmd

2016-10-08 Thread Sergey Kubushyn

On Sat, 8 Oct 2016, Tom Rini wrote:


On Wed, Oct 05, 2016 at 12:38:01PM -0700, Sergey Kubushyn wrote:


This adds "file exists" commands to generic FS as well as to FAT, EXT4,
and UBIFS. Also adds "file size" command to UBIFS.

The return value for "file exists" commands is REVERSED i.e. they
return 1 if file exists and 0 otherwise. This is a deliberate decision
because those commands are supposed to be used almost exclusively in
scripts and TRUE value is _not_ zero while FALSE is zero.

As of now the only way to check for a file existence is to attempt a
read on that file (aka load.) That works but it makes an unnecessary
read, overwrites memory at destination address if file not a zero
length one, and outputs unnecessary messages to the console in any
case.

Checking file existence in scripts is a valuable feature that allows
the higher level software (e.g. Linux) to interact with U-Boot by
creating some semaphore files and rebooting. We do use it quite
extensively for system setup at manufacturing time and for other
purposes (e.g. our Android "recovery" is implemented this way.)

Signed-off-by: Sergey Kubushyn 


Can you please do this in at least two patches?  file size to ubi should
be its own patch.  Also:


Sure, will do later today.


+int do_ext4_file_exists(cmd_tbl_t *cmdtp, int flag, int argc,
+   char *const argv[])
+{
+   int ret;
+
+   ret = do_file_exists(cmdtp, flag, argc, argv, FS_TYPE_EXT);
+ + if (ret == 0) return 1;
+   if (ret == 1) return 0;
+   return ret;
+}


I can only assume this hasn't been compile tested in a while, and you
should simplify the code into a single if/else and a comment on what we
want/mean.  Thanks!


The problem is do_file_exists() can return not just 0 if file exists or
1 if it doesn't but also a negative value for "I don't know" i.e. when
e.g. FS mount failed.

I don't know if those return codes are somehow processed further up (too
much time to dig everything to the bare metal) so I decided to return
that value as-is if it happened. Sure it could be done like e.g.

return (ret == 0);

even without any if-elses and it is probably the proper way to do it but
I fell victim of perfectionism :))

Will re-do it with the above construction and split in 2 parts. Will also
send it with git send-email so it won't end up garbled.

---
**
*  KSI@homeKOI8 Net  < >  The impossible we do immediately.  *
*  Las Vegas   NV, USA   < >  Miracles require 24-hour notice.   *
**
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V3 8/8] imx: mx6ull_14x14_evk: add plugin defconfig

2016-10-08 Thread Peng Fan
Add defconfig file to use plugin code.

Signed-off-by: Peng Fan 
Cc: Stefano Babic 
---

V3:
 None

V2:
 New

 configs/mx6ull_14x14_evk_plugin_defconfig | 31 +++
 1 file changed, 31 insertions(+)
 create mode 100644 configs/mx6ull_14x14_evk_plugin_defconfig

diff --git a/configs/mx6ull_14x14_evk_plugin_defconfig 
b/configs/mx6ull_14x14_evk_plugin_defconfig
new file mode 100644
index 000..ff15c8e
--- /dev/null
+++ b/configs/mx6ull_14x14_evk_plugin_defconfig
@@ -0,0 +1,31 @@
+CONFIG_ARM=y
+CONFIG_ARCH_MX6=y
+CONFIG_TARGET_MX6ULL_14X14_EVK=y
+CONFIG_USE_IMXIMG_PLUGIN=y
+CONFIG_DEFAULT_DEVICE_TREE="imx6ull-14x14-evk"
+CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6ullevk/imximage.cfg"
+CONFIG_BOOTDELAY=3
+CONFIG_HUSH_PARSER=y
+CONFIG_CMD_BOOTZ=y
+# CONFIG_CMD_IMLS is not set
+CONFIG_CMD_MEMTEST=y
+CONFIG_CMD_MMC=y
+CONFIG_CMD_I2C=y
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_CACHE=y
+CONFIG_CMD_EXT2=y
+CONFIG_CMD_EXT4=y
+CONFIG_CMD_EXT4_WRITE=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_FS_GENERIC=y
+CONFIG_OF_CONTROL=y
+CONFIG_DM_GPIO=y
+CONFIG_DM_74X164=y
+CONFIG_DM_I2C=y
+CONFIG_DM_MMC=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_IMX6=y
+CONFIG_DM_REGULATOR=y
+CONFIG_DM_SPI=y
-- 
2.6.2

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


[U-Boot] [PATCH V3 4/8] imx-common: inctroude USE_IMXIMG_PLUGIN Kconfig

2016-10-08 Thread Peng Fan
Introduce USE_IMXIMG_PLUGIN Kconfig

Signed-off-by: Peng Fan 
Cc: Stefano Babic 
Reviewed-by: Tom Rini 
---

V3:
 None

V2:
 New

 arch/arm/imx-common/Kconfig | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/imx-common/Kconfig b/arch/arm/imx-common/Kconfig
index 1b7da5a..85eac57 100644
--- a/arch/arm/imx-common/Kconfig
+++ b/arch/arm/imx-common/Kconfig
@@ -17,3 +17,10 @@ config IMX_BOOTAUX
depends on ARCH_MX7 || ARCH_MX6
help
  bootaux [addr] to boot auxiliary core.
+
+config USE_IMXIMG_PLUGIN
+   bool "Using imximage plugin code"
+   depends on ARCH_MX7 || ARCH_MX6
+   help
+ i.MX6/7 supports DCD and Plugin. Enable this configuration
+ to use Plugin, otherwise DCD will be used.
-- 
2.6.2

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


Re: [U-Boot] [PATCH 1/1]: environment in eMMC boot partition

2016-10-08 Thread Tom Rini
On Sat, Oct 08, 2016 at 03:41:50PM -0700, Sergey Kubushyn wrote:

> Did you get that nand-bootupdate patch I re-sent yesterday with git
> send-email? Did it work if you got it? It's been done against u-boot-imx.

Yes, but I've not had a chance to look at it (and none of my imx boards
have NAND, just SD/MMC and SATA).

-- 
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 1/1]: filesystems : add "file exists" cmd

2016-10-08 Thread Tom Rini
On Wed, Oct 05, 2016 at 12:38:01PM -0700, Sergey Kubushyn wrote:

> This adds "file exists" commands to generic FS as well as to FAT, EXT4,
> and UBIFS. Also adds "file size" command to UBIFS.
> 
> The return value for "file exists" commands is REVERSED i.e. they
> return 1 if file exists and 0 otherwise. This is a deliberate decision
> because those commands are supposed to be used almost exclusively in
> scripts and TRUE value is _not_ zero while FALSE is zero.
> 
> As of now the only way to check for a file existence is to attempt a
> read on that file (aka load.) That works but it makes an unnecessary
> read, overwrites memory at destination address if file not a zero
> length one, and outputs unnecessary messages to the console in any
> case.
> 
> Checking file existence in scripts is a valuable feature that allows
> the higher level software (e.g. Linux) to interact with U-Boot by
> creating some semaphore files and rebooting. We do use it quite
> extensively for system setup at manufacturing time and for other
> purposes (e.g. our Android "recovery" is implemented this way.)
> 
> Signed-off-by: Sergey Kubushyn 

Can you please do this in at least two patches?  file size to ubi should
be its own patch.  Also:

> +int do_ext4_file_exists(cmd_tbl_t *cmdtp, int flag, int argc,
> + char *const argv[])
> +{
> + int ret;
> +
> + ret = do_file_exists(cmdtp, flag, argc, argv, FS_TYPE_EXT);
> + +   if (ret == 0) return 1;
> + if (ret == 1) return 0;
> + return ret;
> +}

I can only assume this hasn't been compile tested in a while, and you
should simplify the code into a single if/else and a comment on what we
want/mean.  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 1/1]: environment in eMMC boot partition

2016-10-08 Thread Tom Rini
On Sat, Oct 08, 2016 at 03:41:50PM -0700, Sergey Kubushyn wrote:
> On Sat, 8 Oct 2016, Tom Rini wrote:
> 
> >On Wed, Oct 05, 2016 at 01:28:07PM -0700, Sergey Kubushyn wrote:
> >
> >>This allows to place U-Boot environment into eMMC boot partition thus
> >>saving space on user partition for the OS (or whatever.) When booting
> >>off of eMMC many (all?) MCUs can use dedicated boot0/boot1 partitions
> >>to boot so U-Boot (or SPL) is written to one (or both) such partitions.
> >>When such boot configuration is used it makes sense to place environment
> >>in the same partition where the U-Boot itself is so the entire user
> >>partition is available for the OS.
> >>
> >>It might be not well polished yet but it is a simple patch that can be
> >>reworked later.
> >>
> >>It uses 4 Kconfig variables right now which probably belong to the board
> >>Kconfig. Those are:
> >>
> >>CONFIG_ENV_IN_EMMC_BOOT -- tells that environment is in eMMC boot
> >> partition if defined
> >>
> >>CONFIG_EMMC_ENV_PART -- tells which boot partition environment should be
> >> stored in (either 1 or 2)
> >>
> >>CONFIG_EMMC_BOOT_PART -- which boot partition will be used by eMMC to
> >> read U-Boot/SPL binary for boot protocol (either 1 or 2.) That can be
> >> different from the environment partition
> >>
> >>CONFIG_EMMC_BOOT_ACK -- tells that eMMC should provide boot ACKs if
> >> defined
> >>
> >>Here is an excerpt from actual board Kconfig:
> >
> >I think what's missing is that in the other cases where we do
> >environment in the eMMC boot partitions we don't need the boot ack part.
> >Can you see if the existing hooks work, when you add in something for
> >boot ack?
> 
> Eh, I _DO_ use existing hook. And one of the parameters passed to that
> hook is boot ack (drivers/mmc/mmc_boot.c, line 101):
> 
> === Cut ===
> int mmc_set_part_conf(struct mmc *mmc, u8 ack, u8 part_num, u8 access)
> === Cut ===
> 
> I could've just set it to 0 unconditionally but there might be some board
> configs that might require it to be enabled so I made it configurable.
> 
> And I don't think we have any boards with environment in boot partition
> because there is simply no support for this in common/enc_mmc.c. Remember,

I've put environment on the boot partitions on the eMMC on Beaglebone
black for a number of years.  See include/configs/am335x_evm.h:
#elif defined(CONFIG_EMMC_BOOT)
#define CONFIG_ENV_IS_IN_MMC
#define CONFIG_SYS_MMC_ENV_DEV  1
#define CONFIG_SYS_MMC_ENV_PART 2
#define CONFIG_ENV_OFFSET   0x0
#define CONFIG_ENV_OFFSET_REDUND(CONFIG_ENV_OFFSET +
CONFIG_ENV_SIZE)
#define CONFIG_SYS_REDUNDAND_ENVIRONMENT

Now, I fully accept that it's not working in your case and there must be
something further needed.

-- 
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] board: ls1012afrdm: overwrite CONFIG_EXTRA_ENV_SETTINGS

2016-10-08 Thread york sun
On 10/07/2016 05:00 AM, Pratiyush Srivastava wrote:
> LS1012AFRDM has 512MB of DDR.
> So update Kernel load address as 0x9600 instead of default
> 0xa000.
>
> Signed-off-by: Prabhakar Kushwaha 
> Signed-off-by: Pratiyush Mohan Srivastava 
> ---
> Changes for v4: Incorporated York's Comments
>   - Removed hwconfig variable
>
> Changes for v3:
>   - Rebased v2 patch to master
>   - Removed "initrd_high=0x\0"
>   - Removed console variable "console=ttyAMA0,115200n8\0"
>
> Changes for v2: Incorporated York's comments
>   - Removed ramdisk_addr, ramdisk_size
>   - Updated UART baud-rate.
>


Applied to fsl-qoriq master, awaiting upstream. Thanks.

York

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


Re: [U-Boot] [PATCH][v3] armv8: ls1012a: Updating CONFIG_EXTRA_ENV_SETTINGS

2016-10-08 Thread york sun
On 10/07/2016 04:59 AM, Pratiyush Srivastava wrote:
> Remove ramdisk_addr, ramdisk_size and update UART baud-rate.
>
> Signed-off-by: Prabhakar Kushwaha 
> Signed-off-by: Pratiyush Mohan Srivastava 
> ---
> Changes for v3 :Incorporated York's comments
>   - Removed hwconfig variable
>
> Changes for v2 :
>   - Removed "initrd_high=0x\0"
>   - Removed console variable
>

Applied to fsl-qoriq master, awaiting upstream. Thanks.

York

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


Re: [U-Boot] [PATCH v2] spi: fsl_qspi: Preserve endianness of QSPI MCR

2016-10-08 Thread york sun
On 10/06/2016 02:38 PM, York Sun wrote:
> The endianness can be changed by RCW + PBI sequence. It may have
> other than power on reset value.
>
> Signed-off-by: York Sun 
> CC: Yuan Yao 
> CC: Peng Fan 
> CC: Alison Wang 
> ---
> Change log
>  v2: Fix variable name in spi_setup_slave
>


Applied to fsl-qoriq master, awaiting upstream.

York

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


[U-Boot] [PATCH v2] Add support for eMMC environment in boot partition

2016-10-08 Thread Sergey Kubushyn
This allows to place U-Boot environment into eMMC boot partition thus
saving space on user partition for the OS (or whatever.) When booting
off of eMMC many (all?) MCUs can use dedicated boot0/boot1 partitions
to boot so U-Boot (or SPL) is written to one (or both) such partitions.
When such boot configuration is used it makes sense to place environment
in the same partition where the U-Boot itself is so the entire user
partition is available for the OS.

It might be not well polished yet but it is a simple patch that can be
reworked later.

It uses 4 Kconfig variables right now which probably belong to the board
Kconfig. Those are:

CONFIG_ENV_IN_EMMC_BOOT -- tells that environment is in eMMC boot
 partition if defined

CONFIG_EMMC_ENV_PART -- tells which boot partition environment should be
 stored in (either 1 or 2)

CONFIG_EMMC_BOOT_PART -- which boot partition will be used by eMMC to
 read U-Boot/SPL binary for boot protocol (either 1 or 2.) That can be
 different from the environment partition

CONFIG_EMMC_BOOT_ACK -- tells that eMMC should provide boot ACKs if
 defined

Here is an excerpt from actual board Kconfig:

=== Cut ===
config ENV_IN_EMMC_BOOT
bool "Environment is in eMMC boot partition"
default y

config EMMC_ENV_PART
hex "eMMC boot partition used for environment (1 or 2)"
default 1

config EMMC_BOOT_PART
hex "eMMC boot partition the board boots off of (1 or 2)"
default 1

config EMMC_BOOT_ACK
bool "Enable ACKs from eMMC when booting off of boot partition"
default n
=== Cut ===

Signed-off-by: Sergey Kubushyn 
Cc: Tom Rini 
Cc: Pantelis Antoniou 
---
 common/env_mmc.c | 50 ++
 1 file changed, 50 insertions(+)

diff --git a/common/env_mmc.c b/common/env_mmc.c
index 16f6a17..3b2477c 100644
--- a/common/env_mmc.c
+++ b/common/env_mmc.c
@@ -68,6 +68,45 @@ int env_init(void)
return 0;
 }
 
+#ifdef CONFIG_ENV_IN_EMMC_BOOT
+__weak u8 mmc_get_env_part(struct mmc *mmc)
+{
+   return CONFIG_EMMC_ENV_PART;
+}
+
+__weak u8 mmc_get_boot_part(struct mmc *mmc)
+{
+   return CONFIG_EMMC_BOOT_PART;
+}
+
+__weak u8 mmc_get_boot_ack(struct mmc *mmc)
+{
+#ifdef CONFIG_EMMC_BOOT_ACK
+   return 1;
+#else
+   return 0;
+#endif
+}
+
+static int mmc_set_env_part(struct mmc *mmc)
+{
+   int ret = 0;
+   u8 boot_part = 0;
+   u8 boot_ack = 0;
+   u8 env_part = 0;
+
+   boot_part = mmc_get_boot_part(mmc);
+   boot_ack = mmc_get_boot_ack(mmc);
+   env_part = mmc_get_env_part(mmc);
+
+   ret = mmc_set_part_conf(mmc, boot_ack, boot_part, env_part);
+
+   if (ret)
+   puts("MMC switch to boot partition failed\n");
+
+   return ret;
+}
+#else
 #ifdef CONFIG_SYS_MMC_ENV_PART
 __weak uint mmc_get_env_part(struct mmc *mmc)
 {
@@ -96,6 +135,7 @@ static int mmc_set_env_part(struct mmc *mmc)
 #else
 static inline int mmc_set_env_part(struct mmc *mmc) {return 0; };
 #endif
+#endif
 
 static const char *init_mmc_for_env(struct mmc *mmc)
 {
@@ -113,6 +153,15 @@ static const char *init_mmc_for_env(struct mmc *mmc)
 
 static void fini_mmc_for_env(struct mmc *mmc)
 {
+#ifdef CONFIG_ENV_IN_EMMC_BOOT
+   u8 boot_part = 0;
+   u8 boot_ack = 0;
+
+   boot_part = mmc_get_boot_part(mmc);
+   boot_ack = mmc_get_boot_ack(mmc);
+
+   mmc_set_part_conf(mmc, boot_ack, boot_part, 0);
+#else
 #ifdef CONFIG_SYS_MMC_ENV_PART
int dev = mmc_get_env_dev();
 
@@ -121,6 +170,7 @@ static void fini_mmc_for_env(struct mmc *mmc)
 #endif
blk_select_hwpart_devnum(IF_TYPE_MMC, dev, env_mmc_orig_hwpart);
 #endif
+#endif
 }
 
 #ifdef CONFIG_CMD_SAVEENV
-- 
2.5.5

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


Re: [U-Boot] [PATCH] armv7: LS1021a: enable i-cache in start.S

2016-10-08 Thread york sun
On 09/13/2016 08:48 PM, Xiaoliang Yang wrote:
> Delete CONFIG_SKIP_LOWLEVEL_INIT define in ls1021atwr.h and
> ls1021aqds.h can let it run cpu_init_cp15 to enable i-cache. First
> stage of u-boot can run faster after that. There is a description
> about skip lowlevel init in board/freescale/ls1021atwr/README.
>
> Signed-off-by: Xiaoliang Yang 
> ---

Applied to fsl-qoriq master, awaiting upstream. Thanks.

York

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


Re: [U-Boot] arm: dra7xx: Move fastboot options to defconfig

2016-10-08 Thread Tom Rini
On Thu, Sep 22, 2016 at 09:52:07PM +0300, Semen Protsenko wrote:

> Now that fastboot options are available in Kconfig, we can migrate them
> from DRA7 header to corresponding DRA7 defconfigs.
> 
> Signed-off-by: Sam Protsenko 
> Reviewed-by: Lokesh Vutla 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot,v3,1/3] ARM: AM437X: Add Silicon ID support

2016-10-08 Thread Tom Rini
On Tue, Oct 04, 2016 at 09:34:50AM +0530, Lokesh Vutla wrote:

> Add silicon ID code for AM437x silicon. This can be used to print
> the cpu info using CONFIG_DISPLAY_CPUINFO.
> Also printing "CPU :" along with cpu name in order to be consistent
> with other OMAP platforms.
> 
> Reviewed-by: Tom Rini 
> Signed-off-by: Lokesh Vutla 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH 1/1]: environment in eMMC boot partition

2016-10-08 Thread Tom Rini
On Wed, Oct 05, 2016 at 01:28:07PM -0700, Sergey Kubushyn wrote:

> This allows to place U-Boot environment into eMMC boot partition thus
> saving space on user partition for the OS (or whatever.) When booting
> off of eMMC many (all?) MCUs can use dedicated boot0/boot1 partitions
> to boot so U-Boot (or SPL) is written to one (or both) such partitions.
> When such boot configuration is used it makes sense to place environment
> in the same partition where the U-Boot itself is so the entire user
> partition is available for the OS.
> 
> It might be not well polished yet but it is a simple patch that can be
> reworked later.
> 
> It uses 4 Kconfig variables right now which probably belong to the board
> Kconfig. Those are:
> 
> CONFIG_ENV_IN_EMMC_BOOT -- tells that environment is in eMMC boot
>  partition if defined
> 
> CONFIG_EMMC_ENV_PART -- tells which boot partition environment should be
>  stored in (either 1 or 2)
> 
> CONFIG_EMMC_BOOT_PART -- which boot partition will be used by eMMC to
>  read U-Boot/SPL binary for boot protocol (either 1 or 2.) That can be
>  different from the environment partition
> 
> CONFIG_EMMC_BOOT_ACK -- tells that eMMC should provide boot ACKs if
>  defined
> 
> Here is an excerpt from actual board Kconfig:

I think what's missing is that in the other cases where we do
environment in the eMMC boot partitions we don't need the boot ack part.
Can you see if the existing hooks work, when you add in something for
boot ack?

-- 
Tom


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


Re: [U-Boot] [U-Boot,1/2] ARM: dts: dra72: add rev C evm support

2016-10-08 Thread Tom Rini
On Tue, Sep 27, 2016 at 01:01:41PM +0530, Mugunthan V N wrote:

> Add DTS support for dra72 evm Rev C which has the following
> changes
> * Two ethernet ports now instead of the single one in rev B.
> * DP83867 ethernet phy instead of DP838865.
> 
> Cc: Vignesh R 
> Signed-off-by: Mugunthan V N 
> Reviewed-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, 3/5] kbuild: make dependencies in scripts/Makefile.autoconf more readable

2016-10-08 Thread Tom Rini
On Mon, Sep 26, 2016 at 01:05:00PM +0900, Masahiro Yamada wrote:

> I do not remember why I wrote the code like this, but let's make it
> a bit more readable.
> 
> Signed-off-by: Masahiro Yamada 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, 4/5] kbuild: generate u-boot.cfg as a byproduct of include/autoconf.mk

2016-10-08 Thread Tom Rini
On Mon, Sep 26, 2016 at 01:05:01PM +0900, Masahiro Yamada wrote:

> Our build system still parses ad-hoc CONFIG options in header files
> and generates include/autoconf.mk so that Makefiles can reference
> them.  This gimmick was introduced in the pre-Kconfig days and will
> be kept until Kconfig migration is completed.
> 
> The include/autoconf.mk is generated like follows:
> 
>   [1] Preprocess include/common.h with -DDO_DEPS_ONLY and
>   retrieve macros into include/autoconf.mk.tmp
>   [2] Reformat include/autoconf.mk.dep into include/autoconf.mk
>   with tools/scripts/define2mk.sed script
>   [3] Remove include/autoconf.mk.tmp
> 
> Here, include/autoconf.mk.tmp is similar to u-boot.cfg, which is
> also generated by preprocessing include/config.h with -DDO_DEPS_ONLY.
> In other words, there is much overlap among include/autoconf.mk and
> u-boot.cfg build rules.
> 
> So, the idea is to split the build rule of include/autoconf.mk
> into two stages.  The first preprocesses headers into u-boot.cfg.
> The second parses the u-boot.cfg into include/autoconf.mk.  The
> build rules of u-boot.cfg in Makefile and spl/Makefile will be gone.
> 
> Signed-off-by: Masahiro Yamada 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PULL] Please pull u-boot-imx

2016-10-08 Thread Tom Rini
On Fri, Oct 07, 2016 at 05:38:01PM +0200, Stefano Babic wrote:

> Hi Tom,
> 
> please pull from u-boot-imx, thanks !
> 
> The following changes since commit 53fec162061811a73c7dab3207f8fdb2343ae289:
> 
>   Prepare v2016.11-rc1 (2016-10-03 09:28:13 -0400)
> 
> are available in the git repository at:
> 
>   git://www.denx.de/git/u-boot-imx.git master
> 
> for you to fetch changes up to 3dddc793e0114eb7dfc68b98a4316644d4031fcb:
> 
>   board: ge: bx50v3: Pass video bootargs for b850v3 (2016-10-07 16:32:28
> +0200)
> 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH] arm: ls102xa: Remove reduplicate definition for Generic Timer frequency

2016-10-08 Thread york sun
On 10/07/2016 07:21 PM, Alison Wang wrote:
> Hi, York,
>
>> On 09/23/2016 01:15 AM, Alison Wang wrote:
>>> GENERIC_TIMER_CLK and CONFIG_TIMER_CLK_FREQ are both used to define
>>> Generic Timer frequency. It is reduplicate. This patch will remove
>>> GENERIC_TIMER_CLK macro.
>>>
>>> Signed-off-by: Alison Wang 
>>> ---
>>>  arch/arm/cpu/armv7/ls102xa/psci.S  | 2 +-
>>> arch/arm/cpu/armv7/ls102xa/timer.c | 2 +-
>>>  include/configs/ls1021aqds.h   | 5 -
>>>  include/configs/ls1021atwr.h   | 5 -
>>>  4 files changed, 2 insertions(+), 12 deletions(-)
>>>
>>> diff --git a/arch/arm/cpu/armv7/ls102xa/psci.S
>>> b/arch/arm/cpu/armv7/ls102xa/psci.S
>>> index 8f38680..9efb6d8 100644
>>> --- a/arch/arm/cpu/armv7/ls102xa/psci.S
>>> +++ b/arch/arm/cpu/armv7/ls102xa/psci.S
>>> @@ -36,7 +36,7 @@
>>>
>>> .align  5
>>>
>>> -#defineONE_MS  (GENERIC_TIMER_CLK / 1000)
>>> +#defineONE_MS  (CONFIG_TIMER_CLK_FREQ / 1000)
>>>  #defineRESET_WAIT  (30 * ONE_MS)
>>>
>>
>> Alison,
>>
>> Can you use GENERIC_TIMER_CLK? Recent change in U-Boot doesn't favor
>> using CONFIG_* macros.
> [Alison Wang] If GENERIC_TIMER_CLK is used and CONFIG_TIMER_CLK_FREQ is 
> removed,
> I need to modify the generic codes which use CONFIG_TIMER_CLK_FREQ in
> arch/arm/cpu/armv7/nonsec_virt.S. Some other platforms may be affected. So I
> remove GENERIC_TIMER_CLK in v1.
>
> What's your idea?
>

If it is too much change, then keep your current patch. We will come 
back to these CONFIG_* macros later anyway.

York

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


Re: [U-Boot] [U-Boot, PATCHv2] scripts: Add script to extract default environment

2016-10-08 Thread Tom Rini
On Sat, Sep 17, 2016 at 06:57:39AM +0200, Lukasz Majewski wrote:

> This script looks for env_common.o object file and extracts from it default
> u-boot environment, which is afterwards printed on standard output.
> 
> Usage example:
> get_default_envs.sh > u-boot-env-default.txt
> 
> The generated text file can be used as input for mkenvimage.
> 
> Signed-off-by: Lukasz Majewski 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] cmd: Make CMD_USB_MASS_STORAGE visible only with USB_GADGET and default y

2016-10-08 Thread Tom Rini
On Mon, Sep 19, 2016 at 12:40:12PM -0400, Tom Rini wrote:

> In order for CMD_USB_MASS_STORAGE to be useful we must have USB_GADGET
> enabled, so only show this option when USB_GADGET is set.  In addition,
> expand the help text so it's clearer what this does and given the
> overall utility of this command, make it enabled by default.
> 
> Signed-off-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] ARM: Add register defines for am33xx ePWM registers

2016-10-08 Thread Tom Rini
On Fri, Sep 16, 2016 at 10:21:39AM +, tomas.me...@vaisala.com wrote:

> Register definitions needed for configuring the
> ePWM module.
> 
> Signed-off-by: Tomas Melin 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] doc: typo fix addess -> address

2016-10-08 Thread Tom Rini
On Wed, Sep 14, 2016 at 09:54:53PM +0200, Jelle van der Waa wrote:

> Signed-off-by: Jelle van der Waa 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, 5/6] ARM: Introduce function to switch to hypervisor mode

2016-10-08 Thread Tom Rini
On Wed, Sep 14, 2016 at 10:43:32AM +0530, Keerthy wrote:

> On some of the SoCs one cannot enable hypervisor mode directly from the
> u-boot because the ROM code puts the chip to supervisor mode after it
> jumps to boot loader. Hence introduce a weak function which can be
> overridden based on the SoC type and switch to hypervisor mode in a
> custom way.
> 
> Cc: beagleboard-...@googlegroups.com
> Signed-off-by: Keerthy 
> Reviewed-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, 4/6] configs: dra7xx_evm_defconfig: Enable LPAE mode

2016-10-08 Thread Tom Rini
On Wed, Sep 14, 2016 at 10:43:31AM +0530, Keerthy wrote:

> Enable Linear Physical Address Extension mode which is a
> prerequisite for hypervisor mode.
> 
> Signed-off-by: Keerthy 
> Reviewed-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, 6/6] ARM: OMAP5+: Override switch_to_hypervisor function

2016-10-08 Thread Tom Rini
On Wed, Sep 14, 2016 at 10:43:33AM +0530, Keerthy wrote:

> Override the switch_to_hypervisor function to switch cpu to hypervisor
> mode using the available ROM code hook early in the boot phase before
> the boot loader checks for HYP mode.
> 
> Based on the work done by Jonathan Bergsagel jbergsa...@ti.com.
> 
> Cc: beagleboard-...@googlegroups.com
> Signed-off-by: Keerthy 
> Reviewed-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, 3/6] configs: am57xx_evm_defconfig: Enable LPAE mode

2016-10-08 Thread Tom Rini
On Wed, Sep 14, 2016 at 10:43:30AM +0530, Keerthy wrote:

> Enable Linear Physical Address Extension mode which is a
> prerequisite for hypervisor mode.
> 
> Signed-off-by: Keerthy 
> Reviewed-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, 1/6] omap: Remove hardcoding of mmu section shift to 20

2016-10-08 Thread Tom Rini
On Wed, Sep 14, 2016 at 10:43:28AM +0530, Keerthy wrote:

> As of now the mmu section shift is hardcoded to 20 but with LPAE
> coming into picture this can be different. Hence replacing 20 with
> MMU_SECTION_SHIFT macro.
> 
> Signed-off-by: Keerthy 
> Reviewed-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, 2/6] omap: Set appropriate cache configuration for LPAE and non-LAPE cases

2016-10-08 Thread Tom Rini
On Wed, Sep 14, 2016 at 10:43:29AM +0530, Keerthy wrote:

> Cache configuration methods is different for LPAE and non-LPAE cases.
> Hence the bits and the interpretaion is different for two cases.
> In case of non-LPAE mode short descriptor format is used and we need
> to set Cache and Buffer bits.
> 
> In the case of LPAE the cache configuration happens via MAIR0 lookup.
> 
> Signed-off-by: Keerthy 
> Reviewed-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] cmd/onenand.c: block align warning

2016-10-08 Thread Tom Rini
On Tue, Sep 13, 2016 at 07:40:00AM +0200, Ladislav Michl wrote:

> An attempt to write non block aligned data fails silently, add warning and
> set result.
> 
> Signed-off-by: Ladislav Michl 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] PWM: Correct misspellings of "module" in context of PWM

2016-10-08 Thread Tom Rini
On Tue, Sep 13, 2016 at 08:35:18AM -0400, Robert P. J. Day wrote:

> Signed-off-by: Robert P. J. Day 
> Acked-by: Heiko Schocher 
> 
> diff --git a/README b/README
> index f41a6af..30076bc 100644

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, v2] ARM64: Add support for some of atomic64 operations

2016-10-08 Thread Tom Rini
On Tue, Sep 13, 2016 at 08:40:58AM +0200, Adam Oleksy wrote:

> These functions are needed in UBI/UBIFS on ZynqMP platform (ARM64).
> 
> Signed-off-by: Adam Oleksy 
> Cc: Albert Aribaud 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] search.h: Numerous grammatical fixes, comment updates

2016-10-08 Thread Tom Rini
On Fri, Sep 09, 2016 at 06:22:10AM -0400, Robert P. J. Day wrote:

> Tweaks (no functional changes) to include/search.h, including:
> 
>  * use standard multiple inclusion check
>  * fix spelling mistakes
>  * have comments match actual names in function prototypes
>  * remove obsolete reference to "do_apply"
>  * replace "hashing table" with "hash table"
> 
> Signed-off-by: Robert P. J. Day 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] ARM: Respect CONFIG_SPL_STACK define in lowlevel_init.S

2016-10-08 Thread Tom Rini
On Mon, Sep 05, 2016 at 06:36:10AM +0300, Siarhei Siamashka wrote:

> The SPL and U-Boot proper may use different initial stack
> locations, which are configured via CONFIG_SPL_STACK and
> CONFIG_SYS_INIT_SP_ADDR defines. The lowlevel_init.S
> code needs to handle this in the same way as crt0.S
> 
> Without this fix, setting the U-Boot stack location to some
> place, which is not safely accessible by the SPL (such as
> the DRAM), causes a very early SPL deadlock.
> 
> Signed-off-by: Siarhei Siamashka 
> Reviewed-by: Tom Rini 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] ARMv8/sec-firmware: fix a compile error

2016-10-08 Thread Tom Rini
On Tue, Sep 06, 2016 at 02:23:07PM +0800, Zhiqiang Hou wrote:

> From: Hou Zhiqiang 
> 
> When enabled sec firmware framework, but lack of definition of
> the marco SEC_FIRMWARE_FIT_IMAGE, SEC_FIRMEWARE_FIT_CNF_NAME
> and SEC_FIRMWARE_TARGET_EL, there will be some build errors,
> so give a default definition.
> 
> Signed-off-by: Hou Zhiqiang 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] Various, accumulated typos collected from around the tree.

2016-10-08 Thread Tom Rini
On Wed, Sep 07, 2016 at 02:27:59PM -0400, Robert P. J. Day wrote:

> Fix various misspellings of:
> 
>  * deprecated
>  * partition
>  * preceding,preceded
>  * preparation
>  * its versus it's
>  * export
>  * existing
>  * scenario
>  * redundant
>  * remaining
>  * value
>  * architecture
> 
> Signed-off-by: Robert P. J. Day 
> Reviewed-by: Jagan Teki 
> Reviewed-by: Stefan Roese 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] Suspected Spam: Do not open attachements![PATCH 4/6] tools/env: flash_write_buf: enforce offset to be start of environment

2016-10-08 Thread Tom Rini
On Mon, Aug 29, 2016 at 11:17:00PM +0200, Andreas Fenkart wrote:

> This allows to take advantage of the environment being block aligned.
> This is not a new constraint. Writes always start at the begin of the
> environment, since the header with CRC/length as there.
> Every environment modification requires updating the header
> 
> Signed-off-by: Andreas Fenkart 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, 1/6] tools/env: factor out environment_end function

2016-10-08 Thread Tom Rini
On Mon, Aug 29, 2016 at 11:16:57PM +0200, Andreas Fenkart wrote:

> instead of adhoc computation of the environment end,
> use a function with a proper name
> 
> Signed-off-by: Andreas Fenkart 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, 3/6] tools/env: lookup dev_type directly from flash_read_buf/flash_write_buf

2016-10-08 Thread Tom Rini
On Mon, Aug 29, 2016 at 11:16:59PM +0200, Andreas Fenkart wrote:

> flash_write_buf already looks up size/offset/#sector from struct
> envdev_s. It can look up mtd_type as well. Same applies to
> flash_read_buf. Makes the interface simpler
> 
> Signed-off-by: Andreas Fenkart 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, 2/6] tools/env: pass bad block offset by value

2016-10-08 Thread Tom Rini
On Mon, Aug 29, 2016 at 11:16:58PM +0200, Andreas Fenkart wrote:

> the offset is not modified by linux ioctl call
> see mtd_ioctl{drivers/mtd/mtdchar.c}
> Makes the interface less ambiguous, since the caller can
> now exclude a modification of blockstart
> 
> Signed-off-by: Andreas Fenkart 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] gunzip: cache-align write buffer memory

2016-10-08 Thread Tom Rini
On Mon, Aug 29, 2016 at 05:10:36PM +0200, Clemens Gruber wrote:

> When using gzwrite to eMMC on an i.MX6Q board, the following warning
> occurs repeatedly:
> CACHE: Misaligned operation at range [4fd63318, 4fe63318]
> 
> This patch cache-aligns the memory allocation for the gzwrite writebuf,
> therefore avoiding the misaligned dcache flush and the warning from
> check_cache_range.
> 
> Signed-off-by: Clemens Gruber 
> Reviewed-by: Eric Nelson 
> Reviewed-by: Stefan Agner 

Applied to u-boot/master, thanks!

-- 
Tom


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


[U-Boot] [PATCH V3 2/8] imx: mx6: Add plugin support

2016-10-08 Thread Peng Fan
Add mx6_plugin.S which calls boot rom setup function, generate the second ivt,
and jump back to boot rom.

Signed-off-by: Peng Fan 
Signed-off-by: Ye Li 
Signed-off-by: Utkarsh Gupta 
Reviewed-by: Tom Rini 
Acked-by: Utkarsh Gupta 
---

V3:
 None

V2:
 None

 arch/arm/include/asm/arch-mx6/mx6_plugin.S | 159 +
 1 file changed, 159 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-mx6/mx6_plugin.S

diff --git a/arch/arm/include/asm/arch-mx6/mx6_plugin.S 
b/arch/arm/include/asm/arch-mx6/mx6_plugin.S
new file mode 100644
index 000..b7d1b20
--- /dev/null
+++ b/arch/arm/include/asm/arch-mx6/mx6_plugin.S
@@ -0,0 +1,159 @@
+/*
+ * Copyright (C) 2016 Freescale Semiconductor, Inc.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+
+#ifdef CONFIG_ROM_UNIFIED_SECTIONS
+#define ROM_API_TABLE_BASE_ADDR_LEGACY 0x180
+#define ROM_VERSION_OFFSET 0x80
+#else
+#define ROM_API_TABLE_BASE_ADDR_LEGACY 0xC0
+#define ROM_VERSION_OFFSET 0x48
+#endif
+#define ROM_API_TABLE_BASE_ADDR_MX6DQ_TO15 0xC4
+#define ROM_API_TABLE_BASE_ADDR_MX6DL_TO12 0xC4
+#define ROM_API_HWCNFG_SETUP_OFFSET0x08
+#define ROM_VERSION_TO10   0x10
+#define ROM_VERSION_TO12   0x12
+#define ROM_VERSION_TO15   0x15
+
+plugin_start:
+
+   push{r0-r4, lr}
+
+   imx6_ddr_setting
+   imx6_clock_gating
+   imx6_qos_setting
+
+/*
+ * The following is to fill in those arguments for this ROM function
+ * pu_irom_hwcnfg_setup(void **start, size_t *bytes, const void *boot_data)
+ * This function is used to copy data from the storage media into DDR.
+ * start - Initial (possibly partial) image load address on entry.
+ * Final image load address on exit.
+ * bytes - Initial (possibly partial) image size on entry.
+ * Final image size on exit.
+ * boot_data - Initial @ref ivt Boot Data load address.
+ */
+   adr r0, boot_data2
+   adr r1, image_len2
+   adr r2, boot_data2
+
+#ifdef CONFIG_NOR_BOOT
+#ifdef CONFIG_MX6SX
+   ldr r3, =ROM_VERSION_OFFSET
+   ldr r4, [r3]
+   cmp r4, #ROM_VERSION_TO10
+   bgt before_calling_rom___pu_irom_hwcnfg_setup
+   ldr r3, =0x00900b00
+   ldr r4, =0x5000
+   str r4, [r3, #0x5c]
+#else
+   ldr r3, =0x00900800
+   ldr r4, =0x0800
+   str r4, [r3, #0xc0]
+#endif
+#endif
+
+/*
+ * check the _pu_irom_api_table for the address
+ */
+before_calling_rom___pu_irom_hwcnfg_setup:
+   ldr r3, =ROM_VERSION_OFFSET
+   ldr r4, [r3]
+#if defined(CONFIG_MX6SOLO) || defined(CONFIG_MX6DL)
+   ldr r3, =ROM_VERSION_TO12
+   cmp r4, r3
+   ldrge r3, =ROM_API_TABLE_BASE_ADDR_MX6DL_TO12
+   ldrlt r3, =ROM_API_TABLE_BASE_ADDR_LEGACY
+#elif defined(CONFIG_MX6Q)
+   ldr r3, =ROM_VERSION_TO15
+   cmp r4, r3
+   ldrge r3, =ROM_API_TABLE_BASE_ADDR_MX6DQ_TO15
+   ldrlt r3, =ROM_API_TABLE_BASE_ADDR_LEGACY
+#else
+   ldr r3, =ROM_API_TABLE_BASE_ADDR_LEGACY
+#endif
+   ldr r4, [r3, #ROM_API_HWCNFG_SETUP_OFFSET]
+   blx r4
+after_calling_rom___pu_irom_hwcnfg_setup:
+
+/*
+ * ROM_API_HWCNFG_SETUP function enables MMU & Caches.
+ * Thus disable MMU & Caches.
+ */
+
+   mrc p15, 0, r0, c1, c0, 0   /* read CP15 register 1 into r0*/
+   andsr0, r0, #0x1/* check if MMU is enabled */
+   beq mmu_disable_notreq  /* exit if MMU is already disabled */
+
+   /* Disable caches, MMU */
+   mrc p15, 0, r0, c1, c0, 0   /* read CP15 register 1 into r0 */
+   bic r0, r0, #(1 << 2)   /* disable D Cache */
+   bic r0, r0, #0x1/* clear bit 0 ; MMU off */
+
+   bic r0, r0, #(0x1 << 11)/* disable Z, branch prediction */
+   bic r0, r0, #(0x1 << 1) /* disable A, Strict alignment */
+   /* check enabled. */
+   mcr p15, 0, r0, c1, c0, 0   /* write CP15 register 1 */
+   mov r0, r0
+   mov r0, r0
+   mov r0, r0
+   mov r0, r0
+
+mmu_disable_notreq:
+NOP
+
+/* To return to ROM from plugin, we need to fill in these argument.
+ * Here is what need to do:
+ * Need to construct the paramters for this function before return to ROM:
+ * plugin_download(void **start, size_t *bytes, UINT32 *ivt_offset)
+ */
+   pop {r0-r4, lr}
+   push {r5}
+   ldr r5, boot_data2
+   str r5, [r0]
+   ldr r5, image_len2
+   str r5, [r1]
+   ldr r5, second_ivt_offset
+   str r5, [r2]
+   mov r0, #1
+   pop {r5}
+
+   /* return back to ROM code */
+   bx lr
+
+/* make the following data right in the end of the output*/
+.ltorg
+
+#if (defined(CONFIG_NOR_BOOT) || defined(CONFIG_QSPI_BOOT))
+#define FLASH_OFFSET 0x1000
+#else
+#define FLASH_OFFSET 0x400
+#endif
+
+/*
+ * second_ivt_offset is the offset from the "second_ivt_header" to
+ * "image_copy_start", which inv

Re: [U-Boot] [PATCH V3 1/8] tools: imximage: add plugin support

2016-10-08 Thread Eric Nelson
Hi Peng,

I'm sorry for taking so long to go though this.

On 10/08/2016 08:58 AM, Peng Fan wrote:
> Add plugin support for imximage.
> 

This CONFIG setting doesn't actually affect mkimage or imximage:

> Define CONFIG_USE_IMXIMG_PLUGIN in defconfig to enable using plugin.
> 
> Signed-off-by: Peng Fan 
> Cc: Stefano Babic 
> Cc: Eric Nelson 
> Cc: Ye Li 
> Reviewed-by: Tom Rini 
> ---
> 
> V3:
>  Fix compile error.
> 
> V2:
>  Drop the CONFIG_USE_PLUGIN, make plugin always support in imximage.
> 
>  tools/imximage.c | 282 
> +++
>  tools/imximage.h |   7 +-
>  2 files changed, 229 insertions(+), 60 deletions(-)
> 
> diff --git a/tools/imximage.c b/tools/imximage.c
> index 092d550..7fa601e 100644
> --- a/tools/imximage.c
> +++ b/tools/imximage.c
> @@ -27,6 +27,7 @@ static table_entry_t imximage_cmds[] = {
>   {CMD_CHECK_BITS_CLR,"CHECK_BITS_CLR",   "Reg Check bits clr", },
>   {CMD_CSF,   "CSF",   "Command Sequence File", },
>   {CMD_IMAGE_VERSION, "IMAGE_VERSION","image version",  },
> + {CMD_PLUGIN,"PLUGIN",   "file plugin_addr",  },
>   {-1,"", "",   },
>  };
>  
> @@ -80,6 +81,9 @@ static uint32_t imximage_ivt_offset = UNDEFINED;
>  static uint32_t imximage_csf_size = UNDEFINED;
>  /* Initial Load Region Size */
>  static uint32_t imximage_init_loadsize;

These seem very limiting.

>From what I can tell, there's no reason that you can't have multiple
plugins, and the use of these variables isn't really needed.

> +static uint32_t imximage_iram_free_start;
> +static uint32_t imximage_plugin_size;
> +static uint32_t plugin_image;
>  
>  static set_dcd_val_t set_dcd_val;
>  static set_dcd_param_t set_dcd_param;
> @@ -118,7 +122,11 @@ static uint32_t detect_imximage_version(struct 
> imx_header *imx_hdr)
>  
>   /* Try to detect V2 */
>   if ((fhdr_v2->header.tag == IVT_HEADER_TAG) &&
> - (hdr_v2->dcd_table.header.tag == DCD_HEADER_TAG))
> + (hdr_v2->data.dcd_table.header.tag == DCD_HEADER_TAG))
> + return IMXIMAGE_V2;
> +
> + if ((fhdr_v2->header.tag == IVT_HEADER_TAG) &&
> + hdr_v2->boot_data.plugin)
>   return IMXIMAGE_V2;
>  
>   return IMXIMAGE_VER_INVALID;
> @@ -165,7 +173,7 @@ static struct dcd_v2_cmd *gd_last_cmd;
>  static void set_dcd_param_v2(struct imx_header *imxhdr, uint32_t dcd_len,
>   int32_t cmd)
>  {

I also don't understand why the choice to make the union
with either a DCD table or a plugin.

We should be able to have both, and this doesn't make
the code any easier.

> - dcd_v2_t *dcd_v2 = &imxhdr->header.hdr_v2.dcd_table;
> + dcd_v2_t *dcd_v2 = &imxhdr->header.hdr_v2.data.dcd_table;
>   struct dcd_v2_cmd *d = gd_last_cmd;
>   struct dcd_v2_cmd *d2;
>   int len;
> @@ -261,21 +269,23 @@ static void set_dcd_rst_v1(struct imx_header *imxhdr, 
> uint32_t dcd_len,
>  static void set_dcd_rst_v2(struct imx_header *imxhdr, uint32_t dcd_len,
>   char *name, int lineno)
>  {
> - dcd_v2_t *dcd_v2 = &imxhdr->header.hdr_v2.dcd_table;
> - struct dcd_v2_cmd *d = gd_last_cmd;
> - int len;
> -
> - if (!d)
> - d = &dcd_v2->dcd_cmd;
> - len = be16_to_cpu(d->write_dcd_command.length);
> - if (len > 4)
> - d = (struct dcd_v2_cmd *)(((char *)d) + len);
> -
> - len = (char *)d - (char *)&dcd_v2->header;
> -
> - dcd_v2->header.tag = DCD_HEADER_TAG;
> - dcd_v2->header.length = cpu_to_be16(len);
> - dcd_v2->header.version = DCD_VERSION;
> + if (!imxhdr->header.hdr_v2.boot_data.plugin) {
> + dcd_v2_t *dcd_v2 = &imxhdr->header.hdr_v2.data.dcd_table;
> + struct dcd_v2_cmd *d = gd_last_cmd;
> + int len;
> +
> + if (!d)
> + d = &dcd_v2->dcd_cmd;
> + len = be16_to_cpu(d->write_dcd_command.length);
> + if (len > 4)
> + d = (struct dcd_v2_cmd *)(((char *)d) + len);
> +
> + len = (char *)d - (char *)&dcd_v2->header;
> +
> + dcd_v2->header.tag = DCD_HEADER_TAG;
> + dcd_v2->header.length = cpu_to_be16(len);
> + dcd_v2->header.version = DCD_VERSION;
> + }
>  }
>  
>  static void set_imx_hdr_v1(struct imx_header *imxhdr, uint32_t dcd_len,
> @@ -317,24 +327,93 @@ static void set_imx_hdr_v2(struct imx_header *imxhdr, 
> uint32_t dcd_len,
>   fhdr_v2->header.length = cpu_to_be16(sizeof(flash_header_v2_t));
>   fhdr_v2->header.version = IVT_VERSION; /* 0x40 */
>  

It seems that the reason for a lot of this special-purpose code is to add
support for the entry address.

If mkimage is invoked with an entrypoint from the command-line:

~/$ ./tools/mkimage -n my.cfg -T imximage -e 0xentrypoint u-boot.img
u-boot.imx

This entry point is normally placed into the header, bu

Re: [U-Boot] [RFC PATCH] bootm: fix ramdisk relocation

2016-10-08 Thread Tom Rini
On Thu, Oct 06, 2016 at 11:08:55PM +0200, Cédric Le Goater wrote:

> We are working on bringing to mainline a set of changes adding support
> for the Aspeed SoC and we have a couple of work around we are trying
> to elimitate first. This is one of them. The ramdisk is not relocated
> and Linux fails to boot. The current port does not use a device tree
> (yet) so that might be the most obvious culprit.
> 
> Thanks
> 
> Signed-off-by: Cédric Le Goater 

I suspect that you want to have bootm_size set in your environment so
that all relocations happen within that value and will remain visible to
the kernel.

-- 
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 V3 5/8] imx-common: compile plugin code

2016-10-08 Thread Peng Fan
If CONFIG_USE_IMXIMG_PLUGIN is selected, plugin.bin will be
generated under board/$(BOARDDIR)/.

Signed-off-by: Peng Fan 
Cc: Stefano Babic 
Reviewed-by: Tom Rini 
---

V3:
 None

V2:
  New. Make this common to all i.MX6/7, but not duplicated in board makefile.

 arch/arm/imx-common/Makefile | 29 +++--
 1 file changed, 23 insertions(+), 6 deletions(-)

diff --git a/arch/arm/imx-common/Makefile b/arch/arm/imx-common/Makefile
index d34a784..1873185 100644
--- a/arch/arm/imx-common/Makefile
+++ b/arch/arm/imx-common/Makefile
@@ -38,6 +38,23 @@ obj-$(CONFIG_CMD_BMODE) += cmd_bmode.o
 obj-$(CONFIG_CMD_HDMIDETECT) += cmd_hdmidet.o
 obj-$(CONFIG_CMD_DEKBLOB) += cmd_dek.o
 
+PLUGIN = board/$(BOARDDIR)/plugin
+
+ifeq ($(CONFIG_USE_IMXIMG_PLUGIN),y)
+
+$(PLUGIN).o: $(PLUGIN).S FORCE
+   $(Q)mkdir -p $(dir $@)
+   $(call if_changed_dep,as_o_S)
+
+$(PLUGIN).bin: $(PLUGIN).o FORCE
+   $(Q)mkdir -p $(dir $@)
+   $(OBJCOPY) -O binary --gap-fill 0xff $< $@
+else
+
+$(PLUGIN).bin:
+
+endif
+
 quiet_cmd_cpp_cfg = CFGS$@
   cmd_cpp_cfg = $(CPP) $(cpp_flags) -x c -o $@ $<
 
@@ -47,24 +64,24 @@ $(IMX_CONFIG): %.cfgtmp: % FORCE
$(Q)mkdir -p $(dir $@)
$(call if_changed_dep,cpp_cfg)
 
-MKIMAGEFLAGS_u-boot.imx = -n $(filter-out $< $(PHONY),$^) -T imximage \
+MKIMAGEFLAGS_u-boot.imx = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) -T 
imximage \
-e $(CONFIG_SYS_TEXT_BASE)
 
-u-boot.imx: u-boot.bin $(IMX_CONFIG) FORCE
+u-boot.imx: u-boot.bin $(IMX_CONFIG) $(PLUGIN).bin FORCE
$(call if_changed,mkimage)
 
 ifeq ($(CONFIG_OF_SEPARATE),y)
-MKIMAGEFLAGS_u-boot-dtb.imx = -n $(filter-out $< $(PHONY),$^) -T imximage \
+MKIMAGEFLAGS_u-boot-dtb.imx = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) -T 
imximage \
-e $(CONFIG_SYS_TEXT_BASE)
 
-u-boot-dtb.imx: u-boot-dtb.bin $(IMX_CONFIG) FORCE
+u-boot-dtb.imx: u-boot-dtb.bin $(IMX_CONFIG) $(PLUGIN).bin FORCE
$(call if_changed,mkimage)
 endif
 
-MKIMAGEFLAGS_SPL = -n $(filter-out $< $(PHONY),$^) -T imximage \
+MKIMAGEFLAGS_SPL = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) -T imximage \
-e $(CONFIG_SPL_TEXT_BASE)
 
-SPL: spl/u-boot-spl.bin $(IMX_CONFIG) FORCE
+SPL: spl/u-boot-spl.bin $(IMX_CONFIG) $(PLUGIN).bin FORCE
$(call if_changed,mkimage)
 
 MKIMAGEFLAGS_u-boot.uim = -A arm -O U-Boot -a $(CONFIG_SYS_TEXT_BASE) \
-- 
2.6.2

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


[U-Boot] [PATCH] arm: psci: save and restore registers from r4 to r12

2016-10-08 Thread Chenhui Zhao
Save and restore core registers from r4 to r12 so that PSCI code won't
break their value.

Signed-off-by: Chenhui Zhao 
Signed-off-by: Alison Wang 
Signed-off-by: Abhimanyu Saini 
---
 arch/arm/cpu/armv7/psci.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/cpu/armv7/psci.S b/arch/arm/cpu/armv7/psci.S
index 6a36208..746297c 100644
--- a/arch/arm/cpu/armv7/psci.S
+++ b/arch/arm/cpu/armv7/psci.S
@@ -152,7 +152,7 @@ _psci_table:
.word   0
 
 _smc_psci:
-   push{r4-r7,lr}
+   push{r4-r12,lr}
 
@ Switch to secure
mrc p15, 0, r7, c1, c1, 0
@@ -175,7 +175,7 @@ _smc_psci:
@ Switch back to non-secure
 2: mcr p15, 0, r7, c1, c1, 0
 
-   pop {r4-r7, lr}
+   pop {r4-r12, lr}
movspc, lr  @ Return to the kernel
 
 @ Requires dense and single-cluster CPU ID space
-- 
1.9.1

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


[U-Boot] [PATCH v7 21/21] imx6: icorem6: Add default mtd nand partition table

2016-10-08 Thread Jagan Teki
From: Jagan Teki 

icorem6qdl> mtdparts

device nand0 , # parts = 6
0: spl 0x0020  0x  0
1: uboot   0x0020  0x0020  0
2: env 0x0010  0x0040  0
3: kernel  0x0040  0x0050  0
4: dtb 0x0010  0x0090  0
5: rootfs  0x1f60  0x00a0  0

Cc: Stefano Babic 
Cc: Peng Fan 
Cc: Matteo Lisi 
Cc: Michael Trimarchi 
Signed-off-by: Jagan Teki 
---
 include/configs/imx6qdl_icore.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/configs/imx6qdl_icore.h b/include/configs/imx6qdl_icore.h
index 6e33ec3..f8a1263 100644
--- a/include/configs/imx6qdl_icore.h
+++ b/include/configs/imx6qdl_icore.h
@@ -129,6 +129,8 @@
 # define CONFIG_CMD_MTDPARTS
 # define CONFIG_MTD_PARTITIONS
 # define MTDIDS_DEFAULT"nand0=nand"
+# define MTDPARTS_DEFAULT  "mtdparts=nand:2m(spl),2m(uboot)," \
+   "1m(env),4m(kernel),1m(dtb),-(rootfs)"
 
 # define CONFIG_APBH_DMA
 # define CONFIG_APBH_DMA_BURST
-- 
2.7.4

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


[U-Boot] [PATCH v7 17/21] arm: imx6q: Add devicetree support for Engicam i.CoreM6 Quad/Dual

2016-10-08 Thread Jagan Teki
From: Jagan Teki 

i.CoreM6 Quad/Dual modules are system on module solutions
manufactured by Engicam with following characteristics:
CPU   NXP i.MX6 DQ, 800MHz
RAM   1GB, 32, 64 bit, DDR3-800/1066
NAND  SLC,512MB
Power supply  Single 5V
MAX LCD RES   FULLHD

and more info at
http://www.engicam.com/en/products/embedded/som/sodimm/i-core-m6s-dl-d-q

Cc: Peng Fan 
Cc: Stefano Babic 
Cc: Fabio Estevam 
Cc: Matteo Lisi 
Cc: Michael Trimarchi 
Signed-off-by: Jagan Teki 
---
 arch/arm/dts/Makefile|  3 ++-
 arch/arm/dts/imx6q-icore.dts | 59 
 board/engicam/icorem6/README |  9 ++-
 3 files changed, 69 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/dts/imx6q-icore.dts

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 1994fc8..ad69a2c 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -282,7 +282,8 @@ dtb-$(CONFIG_VF610) += vf500-colibri.dtb \
bk4r1.dtb
 
 dtb-$(CONFIG_MX6) += imx6ull-14x14-evk.dtb \
-   imx6dl-icore.dtb
+   imx6dl-icore.dtb \
+   imx6q-icore.dtb
 
 dtb-$(CONFIG_MX7) += imx7-colibri.dtb
 
diff --git a/arch/arm/dts/imx6q-icore.dts b/arch/arm/dts/imx6q-icore.dts
new file mode 100644
index 000..025f543
--- /dev/null
+++ b/arch/arm/dts/imx6q-icore.dts
@@ -0,0 +1,59 @@
+/*
+ * 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 "imx6q.dtsi"
+#include "imx6qdl-icore.dtsi"
+
+/ {
+   model = "Engicam i.CoreM6 Quad/Dual Starter Kit";
+   compatible = "engicam,imx6-icore", "fsl,imx6q";
+};
+
+&can1 {
+   status = "okay";
+};
+
+&can2 {
+   status = "okay";
+};
diff --git a/board/engicam/icorem6/README b/board/engicam/icorem6/README
index c264a94..12d1e21 100644
--- a/board/engicam/icorem6/README
+++ b/board/engicam/icorem6/README
@@ -1,12 +1,19 @@
 How to use U-Boot on Engicam i.CoreM6 DualLite/Solo and Quad/Dual Starter Kit:
 -
 
-- Build U-Boot for Engicam i.CoreM6 QDL:
+- Configure U-Boot for Engicam i.CoreM6 QDL:
 
 $ make mrproper
 $ make icorem6qdl_mmc_defconfig
+
+- Build for i.CoreM6 DualLite/Solo
+
 $ make
 
+- Build for i.CoreM6 Quad/Dual
+
+$ make DEVICE_TREE=imx6q-icore
+
 This will generate the SPL image called SPL and the u-boot-dtb.img.
 
 - Flash the SPL image into the micro SD card:
-- 
2.7.4

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


[U-Boot] [PATCH v7 18/21] mtd: nand: Kconfig: Add NAND_MXS entry

2016-10-08 Thread Jagan Teki
From: Jagan Teki 

Added kconfig for NAND_MXS driver.

Cc: Scott Wood 
Cc: Simon Glass 
Cc: Fabio Estevam 
Cc: Stefano Babic 
Cc: Peng Fan 
Cc: Matteo Lisi 
Cc: Michael Trimarchi 
Signed-off-by: Jagan Teki 
---
 drivers/mtd/nand/Kconfig | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
index 5ce7d6d..df154bf 100644
--- a/drivers/mtd/nand/Kconfig
+++ b/drivers/mtd/nand/Kconfig
@@ -80,6 +80,13 @@ config NAND_ARASAN
  controller. This uses the hardware ECC for read and
  write operations.
 
+config NAND_MXS
+   bool "MXS NAND support"
+   depends on MX6
+   help
+ This enables NAND driver for the NAND flash controller on the
+ MXS processors.
+
 comment "Generic NAND options"
 
 # Enhance depends when converting drivers to Kconfig which use this config
-- 
2.7.4

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


[U-Boot] [PATCH v7 20/21] imx6: icorem6: Enable MTD device support

2016-10-08 Thread Jagan Teki
From: Jagan Teki 

Enable MTD device, partition and command support.

Cc: Stefano Babic 
Cc: Peng Fan 
Cc: Matteo Lisi 
Cc: Michael Trimarchi 
Signed-off-by: Jagan Teki 
---
 include/configs/imx6qdl_icore.h | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/include/configs/imx6qdl_icore.h b/include/configs/imx6qdl_icore.h
index cd3aa43..6e33ec3 100644
--- a/include/configs/imx6qdl_icore.h
+++ b/include/configs/imx6qdl_icore.h
@@ -124,6 +124,12 @@
 # define CONFIG_SYS_NAND_U_BOOT_START  CONFIG_SYS_TEXT_BASE
 # define CONFIG_SYS_NAND_U_BOOT_OFFS   0x20
 
+/* MTD device */
+# define CONFIG_MTD_DEVICE
+# define CONFIG_CMD_MTDPARTS
+# define CONFIG_MTD_PARTITIONS
+# define MTDIDS_DEFAULT"nand0=nand"
+
 # define CONFIG_APBH_DMA
 # define CONFIG_APBH_DMA_BURST
 # define CONFIG_APBH_DMA_BURST8
-- 
2.7.4

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


[U-Boot] [PATCH v7 19/21] imx6: icorem6: Add NAND support

2016-10-08 Thread Jagan Teki
From: Jagan Teki 

Add NAND support for Engicam i.CoreM6 qdl board.

Boot Log:


U-Boot SPL 2016.09-rc2-30755-gd3dc581-dirty (Sep 28 2016 - 23:00:43)
Trying to boot from NAND
NAND : 512 MiB

U-Boot 2016.09-rc2-30755-gd3dc581-dirty (Sep 28 2016 - 23:00:43 +0530)

CPU:   Freescale i.MX6SOLO rev1.3 at 792MHz
CPU:   Industrial temperature grade (-40C to 105C) at 55C
Reset cause: WDOG
Model: Engicam i.CoreM6 DualLite/Solo Starter Kit
DRAM:  256 MiB
NAND:  512 MiB
MMC:   FSL_SDHC: 0
In:serial
Out:   serial
Err:   serial
Net:   FEC [PRIME]
Hit any key to stop autoboot:  0
icorem6qdl>

Cc: Scott Wood 
Cc: Stefano Babic 
Cc: Peng Fan 
Cc: Matteo Lisi 
Cc: Michael Trimarchi 
Signed-off-by: Jagan Teki 
---
 board/engicam/icorem6/icorem6.c  | 63 
 configs/imx6qdl_icore_nand_defconfig | 37 +
 include/configs/imx6qdl_icore.h  | 25 +-
 3 files changed, 124 insertions(+), 1 deletion(-)
 create mode 100644 configs/imx6qdl_icore_nand_defconfig

diff --git a/board/engicam/icorem6/icorem6.c b/board/engicam/icorem6/icorem6.c
index a370c8b..c152007 100644
--- a/board/engicam/icorem6/icorem6.c
+++ b/board/engicam/icorem6/icorem6.c
@@ -101,6 +101,66 @@ int board_eth_init(bd_t *bis)
 }
 #endif
 
+#ifdef CONFIG_NAND_MXS
+
+#define GPMI_PAD_CTRL0 (PAD_CTL_PKE | PAD_CTL_PUE | PAD_CTL_PUS_100K_UP)
+#define GPMI_PAD_CTRL1 (PAD_CTL_DSE_40ohm | PAD_CTL_SPEED_MED | \
+   PAD_CTL_SRE_FAST)
+#define GPMI_PAD_CTRL2 (GPMI_PAD_CTRL0 | GPMI_PAD_CTRL1)
+
+iomux_v3_cfg_t gpmi_pads[] = {
+   IOMUX_PADS(PAD_NANDF_CLE__NAND_CLE  | MUX_PAD_CTRL(GPMI_PAD_CTRL2)),
+   IOMUX_PADS(PAD_NANDF_ALE__NAND_ALE  | MUX_PAD_CTRL(GPMI_PAD_CTRL2)),
+   IOMUX_PADS(PAD_NANDF_WP_B__NAND_WP_B| MUX_PAD_CTRL(GPMI_PAD_CTRL2)),
+   IOMUX_PADS(PAD_NANDF_RB0__NAND_READY_B  | MUX_PAD_CTRL(GPMI_PAD_CTRL0)),
+   IOMUX_PADS(PAD_NANDF_CS0__NAND_CE0_B| MUX_PAD_CTRL(GPMI_PAD_CTRL2)),
+   IOMUX_PADS(PAD_SD4_CMD__NAND_RE_B   | MUX_PAD_CTRL(GPMI_PAD_CTRL2)),
+   IOMUX_PADS(PAD_SD4_CLK__NAND_WE_B   | MUX_PAD_CTRL(GPMI_PAD_CTRL2)),
+   IOMUX_PADS(PAD_NANDF_D0__NAND_DATA00| MUX_PAD_CTRL(GPMI_PAD_CTRL2)),
+   IOMUX_PADS(PAD_NANDF_D1__NAND_DATA01| MUX_PAD_CTRL(GPMI_PAD_CTRL2)),
+   IOMUX_PADS(PAD_NANDF_D2__NAND_DATA02| MUX_PAD_CTRL(GPMI_PAD_CTRL2)),
+   IOMUX_PADS(PAD_NANDF_D3__NAND_DATA03| MUX_PAD_CTRL(GPMI_PAD_CTRL2)),
+   IOMUX_PADS(PAD_NANDF_D4__NAND_DATA04| MUX_PAD_CTRL(GPMI_PAD_CTRL2)),
+   IOMUX_PADS(PAD_NANDF_D5__NAND_DATA05| MUX_PAD_CTRL(GPMI_PAD_CTRL2)),
+   IOMUX_PADS(PAD_NANDF_D6__NAND_DATA06| MUX_PAD_CTRL(GPMI_PAD_CTRL2)),
+   IOMUX_PADS(PAD_NANDF_D7__NAND_DATA07| MUX_PAD_CTRL(GPMI_PAD_CTRL2)),
+};
+
+static void setup_gpmi_nand(void)
+{
+   struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
+
+   /* config gpmi nand iomux */
+   SETUP_IOMUX_PADS(gpmi_pads);
+
+   /* gate ENFC_CLK_ROOT clock first,before clk source switch */
+   clrbits_le32(&mxc_ccm->CCGR2, MXC_CCM_CCGR2_IOMUX_IPT_CLK_IO_MASK);
+
+   /* config gpmi and bch clock to 100 MHz */
+   clrsetbits_le32(&mxc_ccm->cs2cdr,
+   MXC_CCM_CS2CDR_ENFC_CLK_PODF_MASK |
+   MXC_CCM_CS2CDR_ENFC_CLK_PRED_MASK |
+   MXC_CCM_CS2CDR_ENFC_CLK_SEL_MASK,
+   MXC_CCM_CS2CDR_ENFC_CLK_PODF(0) |
+   MXC_CCM_CS2CDR_ENFC_CLK_PRED(3) |
+   MXC_CCM_CS2CDR_ENFC_CLK_SEL(3));
+
+   /* enable ENFC_CLK_ROOT clock */
+   setbits_le32(&mxc_ccm->CCGR2, MXC_CCM_CCGR2_IOMUX_IPT_CLK_IO_MASK);
+
+   /* enable gpmi and bch clock gating */
+   setbits_le32(&mxc_ccm->CCGR4,
+MXC_CCM_CCGR4_RAWNAND_U_BCH_INPUT_APB_MASK |
+MXC_CCM_CCGR4_RAWNAND_U_GPMI_BCH_INPUT_BCH_MASK |
+MXC_CCM_CCGR4_RAWNAND_U_GPMI_BCH_INPUT_GPMI_IO_MASK |
+MXC_CCM_CCGR4_RAWNAND_U_GPMI_INPUT_APB_MASK |
+MXC_CCM_CCGR4_PL301_MX6QPER1_BCH_OFFSET);
+
+   /* enable apbh clock gating */
+   setbits_le32(&mxc_ccm->CCGR0, MXC_CCM_CCGR0_APBHDMA_MASK);
+}
+#endif
+
 int board_early_init_f(void)
 {
SETUP_IOMUX_PADS(uart4_pads);
@@ -113,6 +173,9 @@ int board_init(void)
/* Address of boot parameters */
gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
 
+#ifdef CONFIG_NAND_MXS
+   setup_gpmi_nand();
+#endif
return 0;
 }
 
diff --git a/configs/imx6qdl_icore_nand_defconfig 
b/configs/imx6qdl_icore_nand_defconfig
new file mode 100644
index 000..8ac3099
--- /dev/null
+++ b/configs/imx6qdl_icore_nand_defconfig
@@ -0,0 +1,37 @@
+CONFIG_ARM=y
+CONFIG_ARCH_MX6=y
+CONFIG_TARGET_MX6Q_ICORE=y
+CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,ENV_IS_IN_NAND"
+CONFIG_DEFAULT_FDT_FILE="imx6dl-icore.dtb"
+CONFIG_DEFAULT_DEVICE_TREE="imx6dl-icore"
+CONFIG_SYS_PROM

[U-Boot] [PATCH v7 13/21] imx6q: icorem6: Enable pinctrl driver

2016-10-08 Thread Jagan Teki
From: Jagan Teki 

Enable imx6 pinctrl driver support for i.CoreM6.

Cc: Peng Fan 
Cc: Stefano Babic 
Cc: Fabio Estevam 
Cc: Matteo Lisi 
Cc: Michael Trimarchi 
Signed-off-by: Jagan Teki 
---
 configs/imx6qdl_icore_mmc_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configs/imx6qdl_icore_mmc_defconfig 
b/configs/imx6qdl_icore_mmc_defconfig
index 6786daf..221ea7e 100644
--- a/configs/imx6qdl_icore_mmc_defconfig
+++ b/configs/imx6qdl_icore_mmc_defconfig
@@ -30,6 +30,8 @@ CONFIG_FEC_MXC=y
 CONFIG_MXC_UART=y
 CONFIG_NETDEVICES=y
 CONFIG_IMX_THERMAL=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_IMX6=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
-- 
2.7.4

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


[U-Boot] [PATCH v7 15/21] arm: dts: Add devicetree for i.MX6Q

2016-10-08 Thread Jagan Teki
From: Jagan Teki 

Add i.MX6Q dtsi support from Linux.

Here is the last commit:
"ARM: dts: add gpio-ranges property to iMX GPIO controllers"
(sha1: bb728d662bed0fe91b152550e640cb3f6caa972c)

Cc: Peng Fan 
Cc: Stefano Babic 
Cc: Fabio Estevam 
Cc: Matteo Lisi 
Cc: Michael Trimarchi 
Signed-off-by: Jagan Teki 
---
 arch/arm/dts/imx6q.dtsi | 300 
 1 file changed, 300 insertions(+)
 create mode 100644 arch/arm/dts/imx6q.dtsi

diff --git a/arch/arm/dts/imx6q.dtsi b/arch/arm/dts/imx6q.dtsi
new file mode 100644
index 000..c30c836
--- /dev/null
+++ b/arch/arm/dts/imx6q.dtsi
@@ -0,0 +1,300 @@
+
+/*
+ * Copyright 2013 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include 
+#include "imx6q-pinfunc.h"
+#include "imx6qdl.dtsi"
+
+/ {
+   aliases {
+   ipu1 = &ipu2;
+   spi4 = &ecspi5;
+   };
+
+   cpus {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   cpu0: cpu@0 {
+   compatible = "arm,cortex-a9";
+   device_type = "cpu";
+   reg = <0>;
+   next-level-cache = <&L2>;
+   operating-points = <
+   /* kHzuV */
+   120 1275000
+   996000  125
+   852000  125
+   792000  1175000
+   396000  975000
+   >;
+   fsl,soc-operating-points = <
+   /* ARM kHz  SOC-PU uV */
+   120 1275000
+   996000  125
+   852000  125
+   792000  1175000
+   396000  1175000
+   >;
+   clock-latency = <61036>; /* two CLK32 periods */
+   clocks = <&clks IMX6QDL_CLK_ARM>,
+<&clks IMX6QDL_CLK_PLL2_PFD2_396M>,
+<&clks IMX6QDL_CLK_STEP>,
+<&clks IMX6QDL_CLK_PLL1_SW>,
+<&clks IMX6QDL_CLK_PLL1_SYS>;
+   clock-names = "arm", "pll2_pfd2_396m", "step",
+ "pll1_sw", "pll1_sys";
+   arm-supply = <®_arm>;
+   pu-supply = <®_pu>;
+   soc-supply = <®_soc>;
+   };
+
+   cpu@1 {
+   compatible = "arm,cortex-a9";
+   device_type = "cpu";
+   reg = <1>;
+   next-level-cache = <&L2>;
+   };
+
+   cpu@2 {
+   compatible = "arm,cortex-a9";
+   device_type = "cpu";
+   reg = <2>;
+   next-level-cache = <&L2>;
+   };
+
+   cpu@3 {
+   compatible = "arm,cortex-a9";
+   device_type = "cpu";
+   reg = <3>;
+   next-level-cache = <&L2>;
+   };
+   };
+
+   soc {
+   ocram: sram@0090 {
+   compatible = "mmio-sram";
+   reg = <0x0090 0x4>;
+   clocks = <&clks IMX6QDL_CLK_OCRAM>;
+   };
+
+   aips-bus@0200 { /* AIPS1 */
+   spba-bus@0200 {
+   ecspi5: ecspi@02018000 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   compatible = "fsl,imx6q-ecspi", 
"fsl,imx51-ecspi";
+   reg = <0x02018000 0x4000>;
+   interrupts = <0 35 IRQ_TYPE_LEVEL_HIGH>;
+   clocks = <&clks IMX6Q_CLK_ECSPI5>,
+<&clks IMX6Q_CLK_ECSPI5>;
+   clock-names = "ipg", "per";
+   dmas = <&sdma 11 7 1>, <&sdma 12 7 2>;
+   dma-names = "rx", "tx";
+   status = "disabled";
+   };
+   };
+
+   iomuxc: iomuxc@020e {
+   compatible = "fsl,imx6q-iomuxc";
+   };
+   };
+
+   sata: sata@0220 {
+   compatible = "fsl,imx6q-ahci";
+   reg = <0

[U-Boot] [PATCH v7 16/21] arm: dts: imx6q: Add pinctrl defines

2016-10-08 Thread Jagan Teki
From: Jagan Teki 

Add imx6q pinctrl defines support from Linux.

Here is the last commit:
"ARM: dts: imx: pinfunc: add MX6QDL_PAD_GPIO_6__ENET_IRQ"
(sha1: d8c765e0d1ddbd5032c2491c82cc9660c2f0e7f2)

Cc: Peng Fan 
Cc: Stefano Babic 
Cc: Fabio Estevam 
Cc: Matteo Lisi 
Cc: Michael Trimarchi 
Signed-off-by: Jagan Teki 
---
 arch/arm/dts/imx6q-pinfunc.h | 1047 ++
 1 file changed, 1047 insertions(+)
 create mode 100644 arch/arm/dts/imx6q-pinfunc.h

diff --git a/arch/arm/dts/imx6q-pinfunc.h b/arch/arm/dts/imx6q-pinfunc.h
new file mode 100644
index 000..9fc6120
--- /dev/null
+++ b/arch/arm/dts/imx6q-pinfunc.h
@@ -0,0 +1,1047 @@
+/*
+ * Copyright 2013 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#ifndef __DTS_IMX6Q_PINFUNC_H
+#define __DTS_IMX6Q_PINFUNC_H
+
+/*
+ * The pin function ID is a tuple of
+ * 
+ */
+#define MX6QDL_PAD_SD2_DAT1__SD2_DATA1  0x04c 0x360 0x000 0x0 0x0
+#define MX6QDL_PAD_SD2_DAT1__ECSPI5_SS0 0x04c 0x360 0x834 0x1 0x0
+#define MX6QDL_PAD_SD2_DAT1__EIM_CS2_B  0x04c 0x360 0x000 0x2 0x0
+#define MX6QDL_PAD_SD2_DAT1__AUD4_TXFS  0x04c 0x360 0x7c8 0x3 0x0
+#define MX6QDL_PAD_SD2_DAT1__KEY_COL7   0x04c 0x360 0x8f0 0x4 0x0
+#define MX6QDL_PAD_SD2_DAT1__GPIO1_IO14 0x04c 0x360 0x000 0x5 0x0
+#define MX6QDL_PAD_SD2_DAT2__SD2_DATA2  0x050 0x364 0x000 0x0 0x0
+#define MX6QDL_PAD_SD2_DAT2__ECSPI5_SS1 0x050 0x364 0x838 0x1 0x0
+#define MX6QDL_PAD_SD2_DAT2__EIM_CS3_B  0x050 0x364 0x000 0x2 0x0
+#define MX6QDL_PAD_SD2_DAT2__AUD4_TXD   0x050 0x364 0x7b8 0x3 0x0
+#define MX6QDL_PAD_SD2_DAT2__KEY_ROW6   0x050 0x364 0x8f8 0x4 0x0
+#define MX6QDL_PAD_SD2_DAT2__GPIO1_IO13 0x050 0x364 0x000 0x5 0x0
+#define MX6QDL_PAD_SD2_DAT0__SD2_DATA0  0x054 0x368 0x000 0x0 0x0
+#define MX6QDL_PAD_SD2_DAT0__ECSPI5_MISO0x054 0x368 0x82c 0x1 0x0
+#define MX6QDL_PAD_SD2_DAT0__AUD4_RXD   0x054 0x368 0x7b4 0x3 0x0
+#define MX6QDL_PAD_SD2_DAT0__KEY_ROW7   0x054 0x368 0x8fc 0x4 0x0
+#define MX6QDL_PAD_SD2_DAT0__GPIO1_IO15 0x054 0x368 0x000 0x5 0x0
+#define MX6QDL_PAD_SD2_DAT0__DCIC2_OUT  0x054 0x368 0x000 0x6 0x0
+#define MX6QDL_PAD_RGMII_TXC__USB_H2_DATA   0x058 0x36c 0x000 0x0 0x0
+#define MX6QDL_PAD_RGMII_TXC__RGMII_TXC 0x058 0x36c 0x000 0x1 0x0
+#define MX6QDL_PAD_RGMII_TXC__SPDIF_EXT_CLK 0x058 0x36c 0x918 0x2 0x0
+#define MX6QDL_PAD_RGMII_TXC__GPIO6_IO190x058 0x36c 0x000 0x5 0x0
+#define MX6QDL_PAD_RGMII_TXC__XTALOSC_REF_CLK_24M   0x058 0x36c 0x000 0x7 0x0
+#define MX6QDL_PAD_RGMII_TD0__HSI_TX_READY  0x05c 0x370 0x000 0x0 0x0
+#define MX6QDL_PAD_RGMII_TD0__RGMII_TD0 0x05c 0x370 0x000 0x1 0x0
+#define MX6QDL_PAD_RGMII_TD0__GPIO6_IO200x05c 0x370 0x000 0x5 0x0
+#define MX6QDL_PAD_RGMII_TD1__HSI_RX_FLAG   0x060 0x374 0x000 0x0 0x0
+#define MX6QDL_PAD_RGMII_TD1__RGMII_TD1 0x060 0x374 0x000 0x1 0x0
+#define MX6QDL_PAD_RGMII_TD1__GPIO6_IO210x060 0x374 0x000 0x5 0x0
+#define MX6QDL_PAD_RGMII_TD2__HSI_RX_DATA   0x064 0x378 0x000 0x0 0x0
+#define MX6QDL_PAD_RGMII_TD2__RGMII_TD2 0x064 0x378 0x000 0x1 0x0
+#define MX6QDL_PAD_RGMII_TD2__GPIO6_IO220x064 0x378 0x000 0x5 0x0
+#define MX6QDL_PAD_RGMII_TD3__HSI_RX_WAKE   0x068 0x37c 0x000 0x0 0x0
+#define MX6QDL_PAD_RGMII_TD3__RGMII_TD3 0x068 0x37c 0x000 0x1 0x0
+#define MX6QDL_PAD_RGMII_TD3__GPIO6_IO230x068 0x37c 0x000 0x5 0x0
+#define MX6QDL_PAD_RGMII_RX_CTL__USB_H3_DATA0x06c 0x380 0x000 0x0 0x0
+#define MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL   0x06c 0x380 0x858 0x1 0x0
+#define MX6QDL_PAD_RGMII_RX_CTL__GPIO6_IO24 0x06c 0x380 0x000 0x5 0x0
+#define MX6QDL_PAD_RGMII_RD0__HSI_RX_READY  0x070 0x384 0x000 0x0 0x0
+#define MX6QDL_PAD_RGMII_RD0__RGMII_RD0 0x070 0x384 0x848 0x1 0x0
+#define MX6QDL_PAD_RGMII_RD0__GPIO6_IO250x070 0x384 0x000 0x5 0x0
+#define MX6QDL_PAD_RGMII_TX_CTL__USB_H2_STROBE  0x074 0x388 0x000 0x0 0x0
+#define MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL   0x074 0x388 0x000 0x1 0x0
+#define MX6QDL_PAD_RGMII_TX_CTL__GPIO6_IO26 0x074 0x388 0x000 0x5 0x0
+#define MX6QDL_PAD_RGMII_TX_CTL__ENET_REF_CLK   0x074 0x388 0x83c 0x7 0x0
+#define MX6QDL_PAD_RGMII_RD1__HSI_TX_FLAG   0x078 0x38c 0x000 0x0 0x0
+#define MX6QDL_PAD_RGMII_RD1__RGMII_RD1 0x078 0x38c 0x84c 0x1 0x0
+#define MX6QDL_PAD_RGMII_RD1__GPIO6_IO270x078 0x38c 0x000 0x5 0x0
+#define MX6QDL_PAD_RGMII_RD2__HSI_TX_DATA   0x07c 0x390 0x000 0x0 0x0
+#define MX6QDL_PAD_RGMII_RD2__RGMII_RD2 0x07c 0x390 0x850 0x1 0x0
+#

[U-Boot] [PATCH v7 14/21] engicam: icorem6: Add DM_GPIO, DM_MMC support

2016-10-08 Thread Jagan Teki
From: Jagan Teki 

Add DM_GPIO, DM_MMC support for u-boot and disable for SPL.

Cc: Peng Fan 
Cc: Stefano Babic 
Cc: Fabio Estevam 
Cc: Matteo Lisi 
Cc: Michael Trimarchi 
Signed-off-by: Jagan Teki 
---
 arch/arm/cpu/armv7/mx6/Kconfig  |   2 +
 board/engicam/icorem6/icorem6.c | 142 
 include/configs/imx6qdl_icore.h |   4 ++
 3 files changed, 78 insertions(+), 70 deletions(-)

diff --git a/arch/arm/cpu/armv7/mx6/Kconfig b/arch/arm/cpu/armv7/mx6/Kconfig
index e2431a8..762a581 100644
--- a/arch/arm/cpu/armv7/mx6/Kconfig
+++ b/arch/arm/cpu/armv7/mx6/Kconfig
@@ -100,6 +100,8 @@ config TARGET_MX6Q_ICORE
select MX6QDL
select OF_CONTROL
select DM
+   select DM_GPIO
+   select DM_MMC
select DM_THERMAL
select SUPPORT_SPL
 
diff --git a/board/engicam/icorem6/icorem6.c b/board/engicam/icorem6/icorem6.c
index a23cb7e..a370c8b 100644
--- a/board/engicam/icorem6/icorem6.c
+++ b/board/engicam/icorem6/icorem6.c
@@ -7,8 +7,6 @@
  */
 
 #include 
-#include 
-#include 
 #include 
 #include 
 
@@ -29,10 +27,6 @@ DECLARE_GLOBAL_DATA_PTR;
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_PKE | PAD_CTL_PUE | \
-   PAD_CTL_PUS_22K_UP  | PAD_CTL_SPEED_LOW |   \
-   PAD_CTL_DSE_80ohm   | PAD_CTL_SRE_FAST  | PAD_CTL_HYS)
-
 #define ENET_PAD_CTRL  (PAD_CTL_PKE | PAD_CTL_PUE |\
PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED   | \
PAD_CTL_DSE_40ohm   | PAD_CTL_HYS)
@@ -55,70 +49,6 @@ static iomux_v3_cfg_t const enet_pads[] = {
IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | MUX_PAD_CTRL(NO_PAD_CTRL)),
 };
 
-static iomux_v3_cfg_t const usdhc1_pads[] = {
-   IOMUX_PADS(PAD_SD1_CLK__SD1_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
-   IOMUX_PADS(PAD_SD1_CMD__SD1_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
-   IOMUX_PADS(PAD_SD1_DAT0__SD1_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
-   IOMUX_PADS(PAD_SD1_DAT1__SD1_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
-   IOMUX_PADS(PAD_SD1_DAT2__SD1_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
-   IOMUX_PADS(PAD_SD1_DAT3__SD1_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
-   IOMUX_PADS(PAD_GPIO_1__GPIO1_IO01 | MUX_PAD_CTRL(NO_PAD_CTRL)),/* CD */
-};
-
-#ifdef CONFIG_FSL_ESDHC
-#define USDHC1_CD_GPIO IMX_GPIO_NR(1, 1)
-
-struct fsl_esdhc_cfg usdhc_cfg[1] = {
-   {USDHC1_BASE_ADDR, 0, 4},
-};
-
-int board_mmc_getcd(struct mmc *mmc)
-{
-   struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
-   int ret = 0;
-
-   switch (cfg->esdhc_base) {
-   case USDHC1_BASE_ADDR:
-   ret = !gpio_get_value(USDHC1_CD_GPIO);
-   break;
-   }
-
-   return ret;
-}
-
-int board_mmc_init(bd_t *bis)
-{
-   int i, ret;
-
-   /*
-   * According to the board_mmc_init() the following map is done:
-   * (U-boot device node)(Physical Port)
-   * mmc0  USDHC1
-   */
-   for (i = 0; i < CONFIG_SYS_FSL_USDHC_NUM; i++) {
-   switch (i) {
-   case 0:
-   SETUP_IOMUX_PADS(usdhc1_pads);
-   gpio_direction_input(USDHC1_CD_GPIO);
-   usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK);
-   break;
-   default:
-   printf("Warning - USDHC%d controller not supporting\n",
-  i + 1);
-   return 0;
-   }
-
-   ret = fsl_esdhc_initialize(bis, &usdhc_cfg[i]);
-   if (ret) {
-   printf("Warning: failed to initialize mmc dev %d\n", i);
-   return ret;
-   }
-   }
-
-   return 0;
-}
-#endif
-
 #ifdef CONFIG_FEC_MXC
 #define ENET_PHY_RST   IMX_GPIO_NR(7, 12)
 static int setup_fec(void)
@@ -200,6 +130,78 @@ int dram_init(void)
 #include 
 #include 
 
+/* MMC board initialization is needed till adding DM support in SPL */
+#if defined(CONFIG_FSL_ESDHC) && !defined(CONFIG_DM_MMC)
+#include 
+#include 
+
+#define USDHC_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | \
+   PAD_CTL_PUS_22K_UP  | PAD_CTL_SPEED_LOW |   \
+   PAD_CTL_DSE_80ohm   | PAD_CTL_SRE_FAST  | PAD_CTL_HYS)
+
+static iomux_v3_cfg_t const usdhc1_pads[] = {
+   IOMUX_PADS(PAD_SD1_CLK__SD1_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
+   IOMUX_PADS(PAD_SD1_CMD__SD1_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
+   IOMUX_PADS(PAD_SD1_DAT0__SD1_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
+   IOMUX_PADS(PAD_SD1_DAT1__SD1_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
+   IOMUX_PADS(PAD_SD1_DAT2__SD1_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
+   IOMUX_PADS(PAD_SD1_DAT3__SD1_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
+   IOMUX_PADS(PAD_GPIO_1__GPIO1_IO01 | MUX_PAD_CTRL(NO_PAD_CTRL)),/* CD */
+};
+
+#define USDHC1_CD_GPIO IMX_GPIO_NR

[U-Boot] [PATCH V3 3/8] imx: mx7: Add plugin support

2016-10-08 Thread Peng Fan
Add mx7_plugin.S which calls boot rom setup function, generate the second ivt,
and jump back to boot rom.

Signed-off-by: Peng Fan 
Signed-off-by: Ye Li 
Cc: Stefano Babic 
Reviewed-by: Tom Rini 
---

V3:
 None

V2:
 None

 arch/arm/include/asm/arch-mx7/mx7_plugin.S | 111 +
 1 file changed, 111 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-mx7/mx7_plugin.S

diff --git a/arch/arm/include/asm/arch-mx7/mx7_plugin.S 
b/arch/arm/include/asm/arch-mx7/mx7_plugin.S
new file mode 100644
index 000..41336b4
--- /dev/null
+++ b/arch/arm/include/asm/arch-mx7/mx7_plugin.S
@@ -0,0 +1,111 @@
+/*
+ * Copyright (C) 2016 Freescale Semiconductor, Inc.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+
+#define ROM_API_TABLE_BASE_ADDR_LEGACY 0x180
+#define ROM_VERSION_OFFSET 0x80
+#define ROM_API_HWCNFG_SETUP_OFFSET0x08
+
+plugin_start:
+
+   push{r0-r4, lr}
+
+   imx7_ddr_setting
+   imx7_clock_gating
+   imx7_qos_setting
+
+/*
+ * Check if we are in USB serial download mode and immediately return to ROM
+ * Need to check USB CTRL clock firstly, then check the USBx_nASYNCLISTADDR
+ */
+   ldr r0, =0x30384680
+   ldr r1, [r0]
+   cmp r1, #0
+   beq normal_boot
+
+   ldr r0, =0x30B10158
+   ldr r1, [r0]
+   cmp r1, #0
+   beq normal_boot
+
+   pop {r0-r4, lr}
+   bx lr
+
+normal_boot:
+
+/*
+ * The following is to fill in those arguments for this ROM function
+ * pu_irom_hwcnfg_setup(void **start, size_t *bytes, const void *boot_data)
+ * This function is used to copy data from the storage media into DDR.
+ * start - Initial (possibly partial) image load address on entry.
+ * Final image load address on exit.
+ * bytes - Initial (possibly partial) image size on entry.
+ * Final image size on exit.
+ * boot_data - Initial @ref ivt Boot Data load address.
+ */
+   adr r0, boot_data2
+   adr r1, image_len2
+   adr r2, boot_data2
+
+/*
+ * check the _pu_irom_api_table for the address
+ */
+before_calling_rom___pu_irom_hwcnfg_setup:
+   ldr r3, =ROM_VERSION_OFFSET
+   ldr r4, [r3]
+   ldr r3, =ROM_API_TABLE_BASE_ADDR_LEGACY
+   ldr r4, [r3, #ROM_API_HWCNFG_SETUP_OFFSET]
+   blx r4
+after_calling_rom___pu_irom_hwcnfg_setup:
+
+
+/* To return to ROM from plugin, we need to fill in these argument.
+ * Here is what need to do:
+ * Need to construct the paramters for this function before return to ROM:
+ * plugin_download(void **start, size_t *bytes, UINT32 *ivt_offset)
+ */
+   pop {r0-r4, lr}
+   push {r5}
+   ldr r5, boot_data2
+   str r5, [r0]
+   ldr r5, image_len2
+   str r5, [r1]
+   ldr r5, second_ivt_offset
+   str r5, [r2]
+   mov r0, #1
+   pop {r5}
+
+   /* return back to ROM code */
+   bx lr
+
+/* make the following data right in the end of the output*/
+.ltorg
+
+#define FLASH_OFFSET 0x400
+
+/*
+ * second_ivt_offset is the offset from the "second_ivt_header" to
+ * "image_copy_start", which involves FLASH_OFFSET, plus the first
+ * ivt_header, the plugin code size itself recorded by "ivt2_header"
+ */
+
+second_ivt_offset:  .long (ivt2_header + 0x2C + FLASH_OFFSET)
+
+/*
+ * The following is the second IVT header plus the second boot data
+ */
+ivt2_header:.long 0x0
+app2_code_jump_v:   .long 0x0
+reserv3:.long 0x0
+dcd2_ptr:   .long 0x0
+boot_data2_ptr: .long 0x0
+self_ptr2:  .long 0x0
+app_code_csf2:  .long 0x0
+reserv4:.long 0x0
+boot_data2: .long 0x0
+image_len2: .long 0x0
+plugin2:.long 0x0
-- 
2.6.2

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


[U-Boot] [PATCH v7 12/21] arm: imx6q: Add devicetree support for Engicam i.CoreM6 DualLite/Solo

2016-10-08 Thread Jagan Teki
From: Jagan Teki 

i.CoreM6 DualLite/Solo modules are system on module solutions
manufactured by Engicam with following characteristics:
CPU   NXP i.MX6 DL, 800MHz
RAM   1GB, 32, 64 bit, DDR3-800/1066
NAND  SLC,512MB
Power supply  Single 5V
MAX LCD RES   FULLHD

and more info at
http://www.engicam.com/en/products/embedded/som/sodimm/i-core-m6s-dl-d-q

Cc: Peng Fan 
Cc: Stefano Babic 
Cc: Fabio Estevam 
Cc: Matteo Lisi 
Cc: Michael Trimarchi 
Signed-off-by: Jagan Teki 
---
 arch/arm/cpu/armv7/mx6/Kconfig  |   1 +
 arch/arm/dts/Makefile   |   3 +-
 arch/arm/dts/imx6dl-icore.dts   |  59 +++
 arch/arm/dts/imx6qdl-icore.dtsi | 196 
 board/engicam/icorem6/README|   6 +-
 configs/imx6qdl_icore_mmc_defconfig |   1 +
 6 files changed, 262 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm/dts/imx6dl-icore.dts
 create mode 100644 arch/arm/dts/imx6qdl-icore.dtsi

diff --git a/arch/arm/cpu/armv7/mx6/Kconfig b/arch/arm/cpu/armv7/mx6/Kconfig
index 5d549bd..e2431a8 100644
--- a/arch/arm/cpu/armv7/mx6/Kconfig
+++ b/arch/arm/cpu/armv7/mx6/Kconfig
@@ -98,6 +98,7 @@ config TARGET_MX6QARM2
 config TARGET_MX6Q_ICORE
bool "Support Engicam i.Core"
select MX6QDL
+   select OF_CONTROL
select DM
select DM_THERMAL
select SUPPORT_SPL
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 532527d..1994fc8 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -281,7 +281,8 @@ dtb-$(CONFIG_VF610) += vf500-colibri.dtb \
pcm052.dtb \
bk4r1.dtb
 
-dtb-$(CONFIG_MX6) += imx6ull-14x14-evk.dtb
+dtb-$(CONFIG_MX6) += imx6ull-14x14-evk.dtb \
+   imx6dl-icore.dtb
 
 dtb-$(CONFIG_MX7) += imx7-colibri.dtb
 
diff --git a/arch/arm/dts/imx6dl-icore.dts b/arch/arm/dts/imx6dl-icore.dts
new file mode 100644
index 000..aec332c
--- /dev/null
+++ b/arch/arm/dts/imx6dl-icore.dts
@@ -0,0 +1,59 @@
+/*
+ * 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 "imx6dl.dtsi"
+#include "imx6qdl-icore.dtsi"
+
+/ {
+   model = "Engicam i.CoreM6 DualLite/Solo Starter Kit";
+   compatible = "engicam,imx6-icore", "fsl,imx6dl";
+};
+
+&can1 {
+   status = "okay";
+};
+
+&can2 {
+   status = "okay";
+};
diff --git a/arch/arm/dts/imx6qdl-icore.dtsi b/arch/arm/dts/imx6qdl-icore.dtsi
new file mode 100644
index 000..f424cd5
--- /dev/null
+++ b/arch/arm/dts/imx6qdl-icore.dtsi
@@ -0,0 +1,196 @@
+/*
+ * 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 b

[U-Boot] [PATCH v7 11/21] dt-bindings: clock: imx6qdl: Add clock defines

2016-10-08 Thread Jagan Teki
From: Jagan Teki 

Add imx6qdl clock header defines support from Linux.

"clk: imx: Add clock support for imx6qp"
(sha1: ee36027427c769b0b9e5e205fe43aced93d6aa66)

Cc: Peng Fan 
Cc: Stefano Babic 
Cc: Fabio Estevam 
Cc: Matteo Lisi 
Cc: Michael Trimarchi 
Signed-off-by: Jagan Teki 
---
 include/dt-bindings/clock/imx6qdl-clock.h | 274 ++
 1 file changed, 274 insertions(+)
 create mode 100644 include/dt-bindings/clock/imx6qdl-clock.h

diff --git a/include/dt-bindings/clock/imx6qdl-clock.h 
b/include/dt-bindings/clock/imx6qdl-clock.h
new file mode 100644
index 000..2905033
--- /dev/null
+++ b/include/dt-bindings/clock/imx6qdl-clock.h
@@ -0,0 +1,274 @@
+/*
+ * Copyright 2014 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __DT_BINDINGS_CLOCK_IMX6QDL_H
+#define __DT_BINDINGS_CLOCK_IMX6QDL_H
+
+#define IMX6QDL_CLK_DUMMY  0
+#define IMX6QDL_CLK_CKIL   1
+#define IMX6QDL_CLK_CKIH   2
+#define IMX6QDL_CLK_OSC3
+#define IMX6QDL_CLK_PLL2_PFD0_352M 4
+#define IMX6QDL_CLK_PLL2_PFD1_594M 5
+#define IMX6QDL_CLK_PLL2_PFD2_396M 6
+#define IMX6QDL_CLK_PLL3_PFD0_720M 7
+#define IMX6QDL_CLK_PLL3_PFD1_540M 8
+#define IMX6QDL_CLK_PLL3_PFD2_508M 9
+#define IMX6QDL_CLK_PLL3_PFD3_454M 10
+#define IMX6QDL_CLK_PLL2_198M  11
+#define IMX6QDL_CLK_PLL3_120M  12
+#define IMX6QDL_CLK_PLL3_80M   13
+#define IMX6QDL_CLK_PLL3_60M   14
+#define IMX6QDL_CLK_TWD15
+#define IMX6QDL_CLK_STEP   16
+#define IMX6QDL_CLK_PLL1_SW17
+#define IMX6QDL_CLK_PERIPH_PRE 18
+#define IMX6QDL_CLK_PERIPH2_PRE19
+#define IMX6QDL_CLK_PERIPH_CLK2_SEL20
+#define IMX6QDL_CLK_PERIPH2_CLK2_SEL   21
+#define IMX6QDL_CLK_AXI_SEL22
+#define IMX6QDL_CLK_ESAI_SEL   23
+#define IMX6QDL_CLK_ASRC_SEL   24
+#define IMX6QDL_CLK_SPDIF_SEL  25
+#define IMX6QDL_CLK_GPU2D_AXI  26
+#define IMX6QDL_CLK_GPU3D_AXI  27
+#define IMX6QDL_CLK_GPU2D_CORE_SEL 28
+#define IMX6QDL_CLK_GPU3D_CORE_SEL 29
+#define IMX6QDL_CLK_GPU3D_SHADER_SEL   30
+#define IMX6QDL_CLK_IPU1_SEL   31
+#define IMX6QDL_CLK_IPU2_SEL   32
+#define IMX6QDL_CLK_LDB_DI0_SEL33
+#define IMX6QDL_CLK_LDB_DI1_SEL34
+#define IMX6QDL_CLK_IPU1_DI0_PRE_SEL   35
+#define IMX6QDL_CLK_IPU1_DI1_PRE_SEL   36
+#define IMX6QDL_CLK_IPU2_DI0_PRE_SEL   37
+#define IMX6QDL_CLK_IPU2_DI1_PRE_SEL   38
+#define IMX6QDL_CLK_IPU1_DI0_SEL   39
+#define IMX6QDL_CLK_IPU1_DI1_SEL   40
+#define IMX6QDL_CLK_IPU2_DI0_SEL   41
+#define IMX6QDL_CLK_IPU2_DI1_SEL   42
+#define IMX6QDL_CLK_HSI_TX_SEL 43
+#define IMX6QDL_CLK_PCIE_AXI_SEL   44
+#define IMX6QDL_CLK_SSI1_SEL   45
+#define IMX6QDL_CLK_SSI2_SEL   46
+#define IMX6QDL_CLK_SSI3_SEL   47
+#define IMX6QDL_CLK_USDHC1_SEL 48
+#define IMX6QDL_CLK_USDHC2_SEL 49
+#define IMX6QDL_CLK_USDHC3_SEL 50
+#define IMX6QDL_CLK_USDHC4_SEL 51
+#define IMX6QDL_CLK_ENFC_SEL   52
+#define IMX6QDL_CLK_EIM_SEL53
+#define IMX6QDL_CLK_EIM_SLOW_SEL   54
+#define IMX6QDL_CLK_VDO_AXI_SEL55
+#define IMX6QDL_CLK_VPU_AXI_SEL56
+#define IMX6QDL_CLK_CKO1_SEL   57
+#define IMX6QDL_CLK_PERIPH 58
+#define IMX6QDL_CLK_PERIPH259
+#define IMX6QDL_CLK_PERIPH_CLK260
+#define IMX6QDL_CLK_PERIPH2_CLK2   61
+#define IMX6QDL_CLK_IPG62
+#define IMX6QDL_CLK_IPG_PER63
+#define IMX6QDL_CLK_ESAI_PRED  64
+#define IMX6QDL_CLK_ESAI_PODF  65
+#define IMX6QDL_CLK_ASRC_PRED  66
+#define IMX6QDL_CLK_ASRC_PODF  67
+#define IMX6QDL_CLK_SPDIF_PRED 68
+#define IMX6QDL_CLK_SPDIF_PODF 69
+#define IMX6QDL_CLK_CAN_ROOT   70
+#define IMX6QDL_CLK_ECSPI_ROOT 71
+#define IMX6QDL_CLK_GPU2D_CORE_PODF72
+#define IMX6QDL_CLK_GPU3D_CORE_PODF73
+#define IMX6QDL_CLK_GPU3D_SHADER   74
+#define IMX6QDL_CLK_IPU1_PODF  75
+#define IMX6QDL_CLK_IPU2_PODF

[U-Boot] [PATCH v7 10/21] arm: dts: imx6dl: Add pinctrl defines

2016-10-08 Thread Jagan Teki
From: Jagan Teki 

Add imx6dl pinctrl defines support from Linux.

Here is the last commit:
"ARM: dts: imx: pinfunc: add MX6QDL_PAD_GPIO_6__ENET_IRQ"
(sha1: d8c765e0d1ddbd5032c2491c82cc9660c2f0e7f2)

Cc: Peng Fan 
Cc: Stefano Babic 
Cc: Fabio Estevam 
Cc: Matteo Lisi 
Cc: Michael Trimarchi 
Signed-off-by: Jagan Teki 
---
 arch/arm/dts/imx6dl-pinfunc.h | 1091 +
 1 file changed, 1091 insertions(+)
 create mode 100644 arch/arm/dts/imx6dl-pinfunc.h

diff --git a/arch/arm/dts/imx6dl-pinfunc.h b/arch/arm/dts/imx6dl-pinfunc.h
new file mode 100644
index 000..0ead323
--- /dev/null
+++ b/arch/arm/dts/imx6dl-pinfunc.h
@@ -0,0 +1,1091 @@
+/*
+ * Copyright 2013 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#ifndef __DTS_IMX6DL_PINFUNC_H
+#define __DTS_IMX6DL_PINFUNC_H
+
+/*
+ * The pin function ID is a tuple of
+ * 
+ */
+#define MX6QDL_PAD_CSI0_DAT10__IPU1_CSI0_DATA10 0x04c 0x360 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT10__AUD3_RXC 0x04c 0x360 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT10__ECSPI2_MISO  0x04c 0x360 0x7f8 0x2 0x0
+#define MX6QDL_PAD_CSI0_DAT10__UART1_TX_DATA0x04c 0x360 0x000 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT10__UART1_RX_DATA0x04c 0x360 0x8fc 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT10__GPIO5_IO28   0x04c 0x360 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT10__ARM_TRACE07  0x04c 0x360 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DAT11__IPU1_CSI0_DATA11 0x050 0x364 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT11__AUD3_RXFS0x050 0x364 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT11__ECSPI2_SS0   0x050 0x364 0x800 0x2 0x0
+#define MX6QDL_PAD_CSI0_DAT11__UART1_RX_DATA0x050 0x364 0x8fc 0x3 0x1
+#define MX6QDL_PAD_CSI0_DAT11__UART1_TX_DATA0x050 0x364 0x000 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT11__GPIO5_IO29   0x050 0x364 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT11__ARM_TRACE08  0x050 0x364 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DAT12__IPU1_CSI0_DATA12 0x054 0x368 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT12__EIM_DATA08   0x054 0x368 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT12__UART4_TX_DATA0x054 0x368 0x000 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT12__UART4_RX_DATA0x054 0x368 0x914 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT12__GPIO5_IO30   0x054 0x368 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT12__ARM_TRACE09  0x054 0x368 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DAT13__IPU1_CSI0_DATA13 0x058 0x36c 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT13__EIM_DATA09   0x058 0x36c 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT13__UART4_RX_DATA0x058 0x36c 0x914 0x3 0x1
+#define MX6QDL_PAD_CSI0_DAT13__UART4_TX_DATA0x058 0x36c 0x000 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT13__GPIO5_IO31   0x058 0x36c 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT13__ARM_TRACE10  0x058 0x36c 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DAT14__IPU1_CSI0_DATA14 0x05c 0x370 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT14__EIM_DATA10   0x05c 0x370 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT14__UART5_TX_DATA0x05c 0x370 0x000 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT14__UART5_RX_DATA0x05c 0x370 0x91c 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT14__GPIO6_IO00   0x05c 0x370 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT14__ARM_TRACE11  0x05c 0x370 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DAT15__IPU1_CSI0_DATA15 0x060 0x374 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT15__EIM_DATA11   0x060 0x374 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT15__UART5_RX_DATA0x060 0x374 0x91c 0x3 0x1
+#define MX6QDL_PAD_CSI0_DAT15__UART5_TX_DATA0x060 0x374 0x000 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT15__GPIO6_IO01   0x060 0x374 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT15__ARM_TRACE12  0x060 0x374 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DAT16__IPU1_CSI0_DATA16 0x064 0x378 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT16__EIM_DATA12   0x064 0x378 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT16__UART4_RTS_B  0x064 0x378 0x910 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT16__UART4_CTS_B  0x064 0x378 0x000 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT16__GPIO6_IO02   0x064 0x378 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT16__ARM_TRACE13  0x064 0x378 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DAT17__IPU1_CSI0_DATA17 0x068 0x37c 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT17__EIM_DATA13   0x068 0x37c 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT17__UART4_CTS_B  0x068 0x37c 0x000 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT17__UART4_RTS_B  0x068 0x37c 0x910 0x3 0x1
+#define MX6QDL_PAD_CSI0_DAT17__GPIO6_IO03   0x068 0x37c 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT17__ARM_TRACE14  0x068 0x37c 0x000 0x7

[U-Boot] [PATCH v7 08/21] arm: dts: Add devicetree for i.MX6DL

2016-10-08 Thread Jagan Teki
From: Jagan Teki 

Add i.MX6DL dtsi support from Linux.

Here is the last commit:
"ARM: dts: add gpio-ranges property to iMX GPIO controllers"
(sha1: bb728d662bed0fe91b152550e640cb3f6caa972c)

Cc: Peng Fan 
Cc: Stefano Babic 
Cc: Fabio Estevam 
Cc: Matteo Lisi 
Cc: Michael Trimarchi 
Signed-off-by: Jagan Teki 
---
 arch/arm/dts/imx6dl.dtsi | 133 +++
 1 file changed, 133 insertions(+)
 create mode 100644 arch/arm/dts/imx6dl.dtsi

diff --git a/arch/arm/dts/imx6dl.dtsi b/arch/arm/dts/imx6dl.dtsi
new file mode 100644
index 000..9a4c22c
--- /dev/null
+++ b/arch/arm/dts/imx6dl.dtsi
@@ -0,0 +1,133 @@
+
+/*
+ * Copyright 2013 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include 
+#include "imx6dl-pinfunc.h"
+#include "imx6qdl.dtsi"
+
+/ {
+   aliases {
+   i2c3 = &i2c4;
+   };
+
+   cpus {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   cpu@0 {
+   compatible = "arm,cortex-a9";
+   device_type = "cpu";
+   reg = <0>;
+   next-level-cache = <&L2>;
+   operating-points = <
+   /* kHzuV */
+   996000  125
+   792000  1175000
+   396000  115
+   >;
+   fsl,soc-operating-points = <
+   /* ARM kHz  SOC-PU uV */
+   996000  1175000
+   792000  1175000
+   396000  1175000
+   >;
+   clock-latency = <61036>; /* two CLK32 periods */
+   clocks = <&clks IMX6QDL_CLK_ARM>,
+<&clks IMX6QDL_CLK_PLL2_PFD2_396M>,
+<&clks IMX6QDL_CLK_STEP>,
+<&clks IMX6QDL_CLK_PLL1_SW>,
+<&clks IMX6QDL_CLK_PLL1_SYS>;
+   clock-names = "arm", "pll2_pfd2_396m", "step",
+ "pll1_sw", "pll1_sys";
+   arm-supply = <®_arm>;
+   pu-supply = <®_pu>;
+   soc-supply = <®_soc>;
+   };
+
+   cpu@1 {
+   compatible = "arm,cortex-a9";
+   device_type = "cpu";
+   reg = <1>;
+   next-level-cache = <&L2>;
+   };
+   };
+
+   soc {
+   ocram: sram@0090 {
+   compatible = "mmio-sram";
+   reg = <0x0090 0x2>;
+   clocks = <&clks IMX6QDL_CLK_OCRAM>;
+   };
+
+   aips1: aips-bus@0200 {
+   iomuxc: iomuxc@020e {
+   compatible = "fsl,imx6dl-iomuxc";
+   };
+
+   pxp: pxp@020f {
+   reg = <0x020f 0x4000>;
+   interrupts = <0 98 IRQ_TYPE_LEVEL_HIGH>;
+   };
+
+   epdc: epdc@020f4000 {
+   reg = <0x020f4000 0x4000>;
+   interrupts = <0 97 IRQ_TYPE_LEVEL_HIGH>;
+   };
+
+   lcdif: lcdif@020f8000 {
+   reg = <0x020f8000 0x4000>;
+   interrupts = <0 39 IRQ_TYPE_LEVEL_HIGH>;
+   };
+   };
+
+   aips2: aips-bus@0210 {
+   i2c4: i2c@021f8000 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   compatible = "fsl,imx6q-i2c", "fsl,imx21-i2c";
+   reg = <0x021f8000 0x4000>;
+   interrupts = <0 35 IRQ_TYPE_LEVEL_HIGH>;
+   clocks = <&clks IMX6DL_CLK_I2C4>;
+   status = "disabled";
+   };
+   };
+   };
+
+   display-subsystem {
+   compatible = "fsl,imx-display-subsystem";
+   ports = <&ipu1_di0>, <&ipu1_di1>;
+   };
+
+   gpu-subsystem {
+   compatible = "fsl,imx-gpu-subsystem";
+   cores = <&gpu_2d>, <&gpu_3d>;
+   };
+};
+
+&gpt {
+   compatible = "fsl,imx6dl-gpt";
+};
+
+&hdmi {
+   compatible = "fsl,imx6dl-hdmi";
+};
+
+&ldb {
+   clocks = <&clks IMX6QDL_CLK_LDB_DI0_SEL>, <&clks 
IMX6QDL_CLK_LDB_DI1_SEL>,
+<&clks IMX6QDL_CLK_IPU1_DI0_SEL>, <&clks 
IMX6QD

[U-Boot] [PATCH v7 09/21] arm: dts: Add devicetree for i.MX6DQL

2016-10-08 Thread Jagan Teki
From: Jagan Teki 

Add i.MX6DQL dtsi support from Linux.

Here is the last commit:
"ARM: dts: imx6qdl: Fix SPDIF regression"
(sha1: f065e9e4addd75c21bb976bb2558648bf4f61de6)

Cc: Peng Fan 
Cc: Stefano Babic 
Cc: Fabio Estevam 
Cc: Matteo Lisi 
Cc: Michael Trimarchi 
Signed-off-by: Jagan Teki 
---
 arch/arm/dts/imx6qdl.dtsi | 1281 +
 1 file changed, 1281 insertions(+)
 create mode 100644 arch/arm/dts/imx6qdl.dtsi

diff --git a/arch/arm/dts/imx6qdl.dtsi b/arch/arm/dts/imx6qdl.dtsi
new file mode 100644
index 000..b13b0b2
--- /dev/null
+++ b/arch/arm/dts/imx6qdl.dtsi
@@ -0,0 +1,1281 @@
+/*
+ * Copyright 2011 Freescale Semiconductor, Inc.
+ * Copyright 2011 Linaro Ltd.
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#include 
+#include 
+
+#include "skeleton.dtsi"
+
+/ {
+   aliases {
+   ethernet0 = &fec;
+   can0 = &can1;
+   can1 = &can2;
+   gpio0 = &gpio1;
+   gpio1 = &gpio2;
+   gpio2 = &gpio3;
+   gpio3 = &gpio4;
+   gpio4 = &gpio5;
+   gpio5 = &gpio6;
+   gpio6 = &gpio7;
+   i2c0 = &i2c1;
+   i2c1 = &i2c2;
+   i2c2 = &i2c3;
+   ipu0 = &ipu1;
+   mmc0 = &usdhc1;
+   mmc1 = &usdhc2;
+   mmc2 = &usdhc3;
+   mmc3 = &usdhc4;
+   serial0 = &uart1;
+   serial1 = &uart2;
+   serial2 = &uart3;
+   serial3 = &uart4;
+   serial4 = &uart5;
+   spi0 = &ecspi1;
+   spi1 = &ecspi2;
+   spi2 = &ecspi3;
+   spi3 = &ecspi4;
+   usbphy0 = &usbphy1;
+   usbphy1 = &usbphy2;
+   };
+
+   clocks {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   ckil {
+   compatible = "fsl,imx-ckil", "fixed-clock";
+   #clock-cells = <0>;
+   clock-frequency = <32768>;
+   };
+
+   ckih1 {
+   compatible = "fsl,imx-ckih1", "fixed-clock";
+   #clock-cells = <0>;
+   clock-frequency = <0>;
+   };
+
+   osc {
+   compatible = "fsl,imx-osc", "fixed-clock";
+   #clock-cells = <0>;
+   clock-frequency = <2400>;
+   };
+   };
+
+   soc {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   compatible = "simple-bus";
+   interrupt-parent = <&gpc>;
+   ranges;
+
+   dma_apbh: dma-apbh@0011 {
+   compatible = "fsl,imx6q-dma-apbh", "fsl,imx28-dma-apbh";
+   reg = <0x0011 0x2000>;
+   interrupts = <0 13 IRQ_TYPE_LEVEL_HIGH>,
+<0 13 IRQ_TYPE_LEVEL_HIGH>,
+<0 13 IRQ_TYPE_LEVEL_HIGH>,
+<0 13 IRQ_TYPE_LEVEL_HIGH>;
+   interrupt-names = "gpmi0", "gpmi1", "gpmi2", "gpmi3";
+   #dma-cells = <1>;
+   dma-channels = <4>;
+   clocks = <&clks IMX6QDL_CLK_APBH_DMA>;
+   };
+
+   gpmi: gpmi-nand@00112000 {
+   compatible = "fsl,imx6q-gpmi-nand";
+   #address-cells = <1>;
+   #size-cells = <1>;
+   reg = <0x00112000 0x2000>, <0x00114000 0x2000>;
+   reg-names = "gpmi-nand", "bch";
+   interrupts = <0 15 IRQ_TYPE_LEVEL_HIGH>;
+   interrupt-names = "bch";
+   clocks = <&clks IMX6QDL_CLK_GPMI_IO>,
+<&clks IMX6QDL_CLK_GPMI_APB>,
+<&clks IMX6QDL_CLK_GPMI_BCH>,
+<&clks IMX6QDL_CLK_GPMI_BCH_APB>,
+<&clks IMX6QDL_CLK_PER1_BCH>;
+   clock-names = "gpmi_io", "gpmi_apb", "gpmi_bch",
+ "gpmi_bch_apb", "per1_bch";
+   dmas = <&dma_apbh 0>;
+   dma-names = "rx-tx";
+   status = "disabled";
+   };
+
+   hdmi: hdmi@012 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   reg = <0x0012 0x9000>;
+   interrupts = <0 115 0x04>;
+   gpr = <&gpr>;
+   clock

[U-Boot] [PATCH v7 04/21] arm: imx: Add Engicam i.CoreM6 QDL Starter Kit initial support

2016-10-08 Thread Jagan Teki
From: Jagan Teki 

Boot Log for i.CoreM6 DualLite/Solo Starter Kit:
---

U-Boot SPL 2016.09-rc2-30739-gd1fa290 (Sep 17 2016 - 00:37:46)
Trying to boot from MMC1

U-Boot 2016.09-rc2-30739-gd1fa290 (Sep 17 2016 - 00:37:46 +0530)

CPU:   Freescale i.MX6SOLO rev1.3 at 792MHz
CPU:   Industrial temperature grade (-40C to 105C) at 31C
Reset cause: POR
DRAM:  256 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
switch to partitions #0, OK
mmc0 is current device
switch to partitions #0, OK
mmc0 is current device
reading boot.scr
** Unable to read file boot.scr **
reading zImage
6741808 bytes read in 341 ms (18.9 MiB/s)
Booting from mmc ...
reading imx6dl-icore.dtb
30600 bytes read in 19 ms (1.5 MiB/s)
   Booting using the fdt blob at 0x1800
   Using Device Tree in place at 1800, end 1800a787

Starting kernel ...

[0.00] Booting Linux on physical CPU 0x0

Boot Log for i.CoreM6 Quad/Dual Starter Kit:


U-Boot SPL 2016.09-rc2-30739-gd1fa290 (Sep 17 2016 - 00:37:46)
Trying to boot from MMC1

U-Boot 2016.09-rc2-30739-gd1fa290 (Sep 17 2016 - 00:37:46 +0530)

CPU:   Freescale i.MX6Q rev1.2 at 792MHz
CPU:   Industrial temperature grade (-40C to 105C) at 28C
Reset cause: POR
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
icorem6qdl>

Cc: Stefano Babic 
Cc: Fabio Estevam 
Cc: Matteo Lisi 
Cc: Michael Trimarchi 
Acked-by: Peng Fan 
Signed-off-by: Jagan Teki 
---
 arch/arm/cpu/armv7/mx6/Kconfig  |   8 +
 arch/arm/include/asm/imx-common/sys_proto.h |   2 +
 board/engicam/icorem6/Kconfig   |  12 +
 board/engicam/icorem6/MAINTAINERS   |   6 +
 board/engicam/icorem6/Makefile  |   6 +
 board/engicam/icorem6/README|  31 +++
 board/engicam/icorem6/icorem6.c | 400 
 configs/imx6qdl_icore_mmc_defconfig |  35 +++
 include/configs/imx6qdl_icore.h | 120 +
 9 files changed, 620 insertions(+)
 create mode 100644 board/engicam/icorem6/Kconfig
 create mode 100644 board/engicam/icorem6/MAINTAINERS
 create mode 100644 board/engicam/icorem6/Makefile
 create mode 100644 board/engicam/icorem6/README
 create mode 100644 board/engicam/icorem6/icorem6.c
 create mode 100644 configs/imx6qdl_icore_mmc_defconfig
 create mode 100644 include/configs/imx6qdl_icore.h

diff --git a/arch/arm/cpu/armv7/mx6/Kconfig b/arch/arm/cpu/armv7/mx6/Kconfig
index d851b26..5d549bd 100644
--- a/arch/arm/cpu/armv7/mx6/Kconfig
+++ b/arch/arm/cpu/armv7/mx6/Kconfig
@@ -95,6 +95,13 @@ config TARGET_MX6CUBOXI
 config TARGET_MX6QARM2
bool "mx6qarm2"
 
+config TARGET_MX6Q_ICORE
+   bool "Support Engicam i.Core"
+   select MX6QDL
+   select DM
+   select DM_THERMAL
+   select SUPPORT_SPL
+
 config TARGET_MX6QSABREAUTO
bool "mx6qsabreauto"
select DM
@@ -225,6 +232,7 @@ source "board/compulab/cm_fx6/Kconfig"
 source "board/congatec/cgtqmx6eval/Kconfig"
 source "board/el/el6x/Kconfig"
 source "board/embest/mx6boards/Kconfig"
+source "board/engicam/icorem6/Kconfig"
 source "board/freescale/mx6qarm2/Kconfig"
 source "board/freescale/mx6qsabreauto/Kconfig"
 source "board/freescale/mx6sabresd/Kconfig"
diff --git a/arch/arm/include/asm/imx-common/sys_proto.h 
b/arch/arm/include/asm/imx-common/sys_proto.h
index 6ace8bb..005435a 100644
--- a/arch/arm/include/asm/imx-common/sys_proto.h
+++ b/arch/arm/include/asm/imx-common/sys_proto.h
@@ -30,8 +30,10 @@
 #define is_mx6dqp() (is_cpu_type(MXC_CPU_MX6QP) || is_cpu_type(MXC_CPU_MX6DP))
 #define is_mx6dq() (is_cpu_type(MXC_CPU_MX6Q) || is_cpu_type(MXC_CPU_MX6D))
 #define is_mx6sdl() (is_cpu_type(MXC_CPU_MX6SOLO) || 
is_cpu_type(MXC_CPU_MX6DL))
+#define is_mx6dl() (is_cpu_type(MXC_CPU_MX6DL))
 #define is_mx6sx() (is_cpu_type(MXC_CPU_MX6SX))
 #define is_mx6sl() (is_cpu_type(MXC_CPU_MX6SL))
+#define is_mx6solo() (is_cpu_type(MXC_CPU_MX6SOLO))
 #define is_mx6ul() (is_cpu_type(MXC_CPU_MX6UL))
 #define is_mx6ull() (is_cpu_type(MXC_CPU_MX6ULL))
 
diff --git a/board/engicam/icorem6/Kconfig b/board/engicam/icorem6/Kconfig
new file mode 100644
index 000..6d62f0e
--- /dev/null
+++ b/board/engicam/icorem6/Kconfig
@@ -0,0 +1,12 @@
+if TARGET_MX6Q_ICORE
+
+config SYS_BOARD
+   default "icorem6"
+
+config SYS_VENDOR
+   default "engicam"
+
+config SYS_CONFIG_NAME
+   default "imx6qdl_icore"
+
+endif
diff --git a/board/engicam/icorem6/MAINTAINERS 
b/board/engicam/icorem6/MAINTAINERS
new file mode 100644
index 000..3e06c6b
--- /dev/null
+++ b/board/engicam/icorem6/MAINTAINERS
@@ -0,0 +1,6 @@
+ICOREM6QDL BOARD
+M: Jagan Teki 
+S: Maintained
+F: bo

[U-Boot] [PATCH v7 07/21] imx: s/docs\/README.imximage/doc\/README.imximage/g

2016-10-08 Thread Jagan Teki
From: Jagan Teki 

Fixed typo for doc/README.imximage on respective imximage.cfg files.

Cc: Tom Rini 
Cc: Stefano Babic 
Cc: Fabio Estevam 
Acked-by: Peng Fan 
Signed-off-by: Jagan Teki 
---
 board/barco/titanium/imximage.cfg   | 2 +-
 board/ccv/xpress/imximage.cfg   | 2 +-
 board/denx/m53evk/imximage.cfg  | 2 +-
 board/freescale/mx6sabresd/mx6dlsabresd.cfg | 2 +-
 board/freescale/mx6slevk/imximage.cfg   | 2 +-
 board/freescale/mx6ullevk/imximage.cfg  | 2 +-
 board/freescale/mx7dsabresd/imximage.cfg| 2 +-
 board/freescale/s32v234evb/s32v234evb.cfg   | 2 +-
 board/freescale/vf610twr/imximage.cfg   | 2 +-
 board/phytec/pcm052/imximage.cfg| 2 +-
 board/technexion/pico-imx6ul/imximage.cfg   | 2 +-
 board/toradex/colibri_imx7/imximage.cfg | 2 +-
 board/toradex/colibri_vf/imximage.cfg   | 2 +-
 board/warp/imximage.cfg | 2 +-
 board/warp7/imximage.cfg| 2 +-
 15 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/board/barco/titanium/imximage.cfg 
b/board/barco/titanium/imximage.cfg
index 7219256..4fb6982 100644
--- a/board/barco/titanium/imximage.cfg
+++ b/board/barco/titanium/imximage.cfg
@@ -7,7 +7,7 @@
  *
  * SPDX-License-Identifier:GPL-2.0+
  *
- * Refer docs/README.imxmage for more details about how-to configure
+ * Refer doc/README.imximage for more details about how-to configure
  * and create imximage boot image
  *
  * The syntax is taken as close as possible with the kwbimage
diff --git a/board/ccv/xpress/imximage.cfg b/board/ccv/xpress/imximage.cfg
index 92167c9..d98bc36 100644
--- a/board/ccv/xpress/imximage.cfg
+++ b/board/ccv/xpress/imximage.cfg
@@ -3,7 +3,7 @@
  *
  * SPDX-License-Identifier:GPL-2.0+
  *
- * Refer docs/README.imxmage for more details about how-to configure
+ * Refer doc/README.imximage for more details about how-to configure
  * and create imximage boot image
  *
  * The syntax is taken as close as possible with the kwbimage
diff --git a/board/denx/m53evk/imximage.cfg b/board/denx/m53evk/imximage.cfg
index 4cd002c..c0e2602 100644
--- a/board/denx/m53evk/imximage.cfg
+++ b/board/denx/m53evk/imximage.cfg
@@ -4,7 +4,7 @@
  *
  * SPDX-License-Identifier:GPL-2.0+
  *
- * Refer docs/README.imxmage for more details about how-to configure
+ * Refer doc/README.imximage for more details about how-to configure
  * and create imximage boot image
  *
  * The syntax is taken as close as possible with the kwbimage
diff --git a/board/freescale/mx6sabresd/mx6dlsabresd.cfg 
b/board/freescale/mx6sabresd/mx6dlsabresd.cfg
index f35f22e..be9f87f 100644
--- a/board/freescale/mx6sabresd/mx6dlsabresd.cfg
+++ b/board/freescale/mx6sabresd/mx6dlsabresd.cfg
@@ -3,7 +3,7 @@
  *
  * SPDX-License-Identifier:GPL-2.0+
  *
- * Refer docs/README.imxmage for more details about how-to configure
+ * Refer doc/README.imximage for more details about how-to configure
  * and create imximage boot image
  *
  * The syntax is taken as close as possible with the kwbimage
diff --git a/board/freescale/mx6slevk/imximage.cfg 
b/board/freescale/mx6slevk/imximage.cfg
index c77bbde..024de9c 100644
--- a/board/freescale/mx6slevk/imximage.cfg
+++ b/board/freescale/mx6slevk/imximage.cfg
@@ -3,7 +3,7 @@
  *
  * SPDX-License-Identifier:GPL-2.0+
  *
- * Refer docs/README.imxmage for more details about how-to configure
+ * Refer doc/README.imximage for more details about how-to configure
  * and create imximage boot image
  *
  * The syntax is taken as close as possible with the kwbimage
diff --git a/board/freescale/mx6ullevk/imximage.cfg 
b/board/freescale/mx6ullevk/imximage.cfg
index 4604b62..3ae4912 100644
--- a/board/freescale/mx6ullevk/imximage.cfg
+++ b/board/freescale/mx6ullevk/imximage.cfg
@@ -3,7 +3,7 @@
  *
  * SPDX-License-Identifier:GPL-2.0+
  *
- * Refer docs/README.imxmage for more details about how-to configure
+ * Refer doc/README.imximage for more details about how-to configure
  * and create imximage boot image
  *
  * The syntax is taken as close as possible with the kwbimage
diff --git a/board/freescale/mx7dsabresd/imximage.cfg 
b/board/freescale/mx7dsabresd/imximage.cfg
index 76574ff..c2b3a8c 100644
--- a/board/freescale/mx7dsabresd/imximage.cfg
+++ b/board/freescale/mx7dsabresd/imximage.cfg
@@ -3,7 +3,7 @@
  *
  * SPDX-License-Identifier:GPL-2.0+
  *
- * Refer docs/README.imxmage for more details about how-to configure
+ * Refer doc/README.imximage for more details about how-to configure
  * and create imximage boot image
  *
  * The syntax is taken as close as possible with the kwbimage
diff --git a/board/freescale/s32v234evb/s32v234evb.cfg 
b/board/freescale/s32v234evb/s32v234evb.cfg
index 6017a40..6449ef2 100644
--- a/board/freescale/s32v234evb/s32v234evb.cfg
+++ b/board/freescale/s32v234evb/s32v234evb.cfg
@@ -5,7 +5,7 @@
  */
 
 /*
- * Refer docs/README.imxmage for more details about how-to configure
+ * Refer doc/README.imximage for more details about how-to configure

[U-Boot] [PATCH v7 06/21] imx6: icorem6: Add ENET support

2016-10-08 Thread Jagan Teki
From: Jagan Teki 

Add enet support for engicam icorem6 qdl starter kit.
- Add pinmux settings
- Add board_eth_init

TFTP log:

Net:   FEC [PRIME]
Hit any key to stop autoboot:  0
icorem6qdl> tftpboot {fdt_addr} imx6dl-icore.dtb
Using FEC device
TFTP from server 192.168.2.96; our IP address is 192.168.2.75
Filename 'imx6dl-icore.dtb'.
Load address: 0x0
Loading: ##
 1.3 MiB/s
done
Bytes transferred = 28976 (7130 hex)
CACHE: Misaligned operation at range [, 7130]
icorem6qdl>

Cc: Joe Hershberger 
Cc: Peng Fan 
Cc: Stefano Babic 
Cc: Fabio Estevam 
Cc: Matteo Lisi 
Cc: Michael Trimarchi 
Signed-off-by: Jagan Teki 
Acked-by: Joe Hershberger 
---
 board/engicam/icorem6/icorem6.c | 72 +
 configs/imx6qdl_icore_mmc_defconfig |  4 +++
 include/configs/imx6qdl_icore.h | 12 +++
 3 files changed, 88 insertions(+)

diff --git a/board/engicam/icorem6/icorem6.c b/board/engicam/icorem6/icorem6.c
index 1856972..a23cb7e 100644
--- a/board/engicam/icorem6/icorem6.c
+++ b/board/engicam/icorem6/icorem6.c
@@ -9,12 +9,15 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -30,11 +33,28 @@ DECLARE_GLOBAL_DATA_PTR;
PAD_CTL_PUS_22K_UP  | PAD_CTL_SPEED_LOW |   \
PAD_CTL_DSE_80ohm   | PAD_CTL_SRE_FAST  | PAD_CTL_HYS)
 
+#define ENET_PAD_CTRL  (PAD_CTL_PKE | PAD_CTL_PUE |\
+   PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED   | \
+   PAD_CTL_DSE_40ohm   | PAD_CTL_HYS)
+
 static iomux_v3_cfg_t const uart4_pads[] = {
IOMUX_PADS(PAD_KEY_COL0__UART4_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL)),
IOMUX_PADS(PAD_KEY_ROW0__UART4_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL)),
 };
 
+static iomux_v3_cfg_t const enet_pads[] = {
+   IOMUX_PADS(PAD_ENET_CRS_DV__ENET_RX_EN | MUX_PAD_CTRL(ENET_PAD_CTRL)),
+   IOMUX_PADS(PAD_GPIO_16__ENET_REF_CLK | MUX_PAD_CTRL(ENET_PAD_CTRL | 
PAD_CTL_SRE_FAST)),
+   IOMUX_PADS(PAD_ENET_TX_EN__ENET_TX_EN | MUX_PAD_CTRL(ENET_PAD_CTRL)),
+   IOMUX_PADS(PAD_ENET_RXD1__ENET_RX_DATA1 | MUX_PAD_CTRL(ENET_PAD_CTRL)),
+   IOMUX_PADS(PAD_ENET_RXD0__ENET_RX_DATA0 | MUX_PAD_CTRL(ENET_PAD_CTRL)),
+   IOMUX_PADS(PAD_ENET_TXD1__ENET_TX_DATA1 | MUX_PAD_CTRL(ENET_PAD_CTRL)),
+   IOMUX_PADS(PAD_ENET_TXD0__ENET_TX_DATA0 | MUX_PAD_CTRL(ENET_PAD_CTRL)),
+   IOMUX_PADS(PAD_ENET_MDC__ENET_MDC | MUX_PAD_CTRL(ENET_PAD_CTRL)),
+   IOMUX_PADS(PAD_ENET_MDIO__ENET_MDIO | MUX_PAD_CTRL(ENET_PAD_CTRL)),
+   IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | MUX_PAD_CTRL(NO_PAD_CTRL)),
+};
+
 static iomux_v3_cfg_t const usdhc1_pads[] = {
IOMUX_PADS(PAD_SD1_CLK__SD1_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
IOMUX_PADS(PAD_SD1_CMD__SD1_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
@@ -99,6 +119,58 @@ int board_mmc_init(bd_t *bis)
 }
 #endif
 
+#ifdef CONFIG_FEC_MXC
+#define ENET_PHY_RST   IMX_GPIO_NR(7, 12)
+static int setup_fec(void)
+{
+   struct mxc_ccm_reg *ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
+   struct anatop_regs *anatop = (struct anatop_regs *)ANATOP_BASE_ADDR;
+   s32 timeout = 10;
+   u32 reg = 0;
+   int ret;
+
+   /* Enable fec clock */
+   setbits_le32(&ccm->CCGR1, MXC_CCM_CCGR1_ENET_MASK);
+
+   /* use 50MHz */
+   ret = enable_fec_anatop_clock(0, ENET_50MHZ);
+   if (ret)
+   return ret;
+
+   /* Enable PLLs */
+   reg = readl(&anatop->pll_enet);
+   reg &= ~BM_ANADIG_PLL_SYS_POWERDOWN;
+   writel(reg, &anatop->pll_enet);
+   reg = readl(&anatop->pll_enet);
+   reg |= BM_ANADIG_PLL_SYS_ENABLE;
+   while (timeout--) {
+   if (readl(&anatop->pll_enet) & BM_ANADIG_PLL_SYS_LOCK)
+   break;
+   }
+   if (timeout <= 0)
+   return -EIO;
+   reg &= ~BM_ANADIG_PLL_SYS_BYPASS;
+   writel(reg, &anatop->pll_enet);
+
+   /* reset the phy */
+   gpio_direction_output(ENET_PHY_RST, 0);
+   udelay(1);
+   gpio_set_value(ENET_PHY_RST, 1);
+
+   return 0;
+}
+
+int board_eth_init(bd_t *bis)
+{
+   int ret;
+
+   SETUP_IOMUX_PADS(enet_pads);
+   setup_fec();
+
+   return ret = cpu_eth_init(bis);
+}
+#endif
+
 int board_early_init_f(void)
 {
SETUP_IOMUX_PADS(uart4_pads);
diff --git a/configs/imx6qdl_icore_mmc_defconfig 
b/configs/imx6qdl_icore_mmc_defconfig
index ced6b10..c2c2fe8 100644
--- a/configs/imx6qdl_icore_mmc_defconfig
+++ b/configs/imx6qdl_icore_mmc_defconfig
@@ -14,6 +14,8 @@ CONFIG_SYS_MAXARGS=32
 # CONFIG_CMD_IMLS is not set
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GPIO=y
+CONFIG_CMD_MII=y
+CONFIG_CMD_PING=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_CACHE=y
@@ -23,7 +25,9 @@ CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_OF_LIBFDT=y
+CONFIG_FEC_MXC=y
 CONFIG_MXC_UART=y
+CONFIG_NETDEVICES=y
 CONFIG_IMX_THERMAL=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_SPL

[U-Boot] [PATCH v7 03/21] config: Move CONFIG_DEFAULT_FDT_FILE to defconfigs

2016-10-08 Thread Jagan Teki
From: Jagan Teki 

- Add DEFAULT_FDT_FILE kconfig entry
- Move CONFIG_DEFAULT_FDT_FILE from include/configs to defconfigs

Cc: Tom Rini 
Cc: Simon Glass 
Cc: Michael Trimarchi 
Signed-off-by: Jagan Teki 
---
 common/Kconfig   | 5 +
 configs/dms-ba16-1g_defconfig| 1 +
 configs/dms-ba16_defconfig   | 1 +
 configs/ge_b450v3_defconfig  | 1 +
 configs/ge_b650v3_defconfig  | 1 +
 configs/ge_b850v3_defconfig  | 1 +
 configs/mx25pdk_defconfig| 1 +
 configs/mx53ard_defconfig| 1 +
 configs/pico-imx6ul_defconfig| 1 +
 configs/tqma6q_mba6_mmc_defconfig| 1 +
 configs/tqma6q_mba6_spi_defconfig| 1 +
 configs/tqma6s_mba6_mmc_defconfig| 1 +
 configs/tqma6s_mba6_spi_defconfig| 1 +
 configs/tqma6s_wru4_mmc_defconfig| 1 +
 configs/zc5202_defconfig | 1 +
 configs/zc5601_defconfig | 1 +
 include/configs/advantech_dms-ba16.h | 1 -
 include/configs/ge_bx50v3.h  | 4 
 include/configs/mx25pdk.h| 2 --
 include/configs/mx53ard.h| 2 --
 include/configs/pico-imx6ul.h| 2 --
 include/configs/tqma6_mba6.h | 6 --
 include/configs/tqma6_wru4.h | 2 --
 include/configs/zc5202.h | 2 --
 include/configs/zc5601.h | 2 --
 25 files changed, 20 insertions(+), 23 deletions(-)

diff --git a/common/Kconfig b/common/Kconfig
index c69c141..9cbcbd4 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -203,6 +203,11 @@ config IDENT_STRING
help
  This options adds the board specific name to u-boot version.
 
+config DEFAULT_FDT_FILE
+   string "Default fdt file"
+   help
+ This option is used to set the default fdt file to boot OS.
+
 config SYS_NO_FLASH
bool "Disable support for parallel NOR flash"
default n
diff --git a/configs/dms-ba16-1g_defconfig b/configs/dms-ba16-1g_defconfig
index db5adcf..8e26837 100644
--- a/configs/dms-ba16-1g_defconfig
+++ b/configs/dms-ba16-1g_defconfig
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_ARCH_MX6=y
 CONFIG_TARGET_ADVANTECH_DMS_BA16=y
+CONFIG_DEFAULT_FDT_FILE="imx6q-dms-ba16.dtb"
 CONFIG_SYS_DDR_1G=y
 CONFIG_BOOTDELAY=1
 CONFIG_HUSH_PARSER=y
diff --git a/configs/dms-ba16_defconfig b/configs/dms-ba16_defconfig
index e36f3dc..fec0a1c 100644
--- a/configs/dms-ba16_defconfig
+++ b/configs/dms-ba16_defconfig
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_ARCH_MX6=y
 CONFIG_TARGET_ADVANTECH_DMS_BA16=y
+CONFIG_DEFAULT_FDT_FILE="imx6q-dms-ba16.dtb"
 CONFIG_BOOTDELAY=1
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
diff --git a/configs/ge_b450v3_defconfig b/configs/ge_b450v3_defconfig
index 8577167..4a5322d 100644
--- a/configs/ge_b450v3_defconfig
+++ b/configs/ge_b450v3_defconfig
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_ARCH_MX6=y
 CONFIG_TARGET_GE_B450V3=y
+CONFIG_DEFAULT_FDT_FILE="/boot/imx6q-b450v3.dtb"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_BOOTDELAY=1
 CONFIG_HUSH_PARSER=y
diff --git a/configs/ge_b650v3_defconfig b/configs/ge_b650v3_defconfig
index c5f391e..ecf4449 100644
--- a/configs/ge_b650v3_defconfig
+++ b/configs/ge_b650v3_defconfig
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_ARCH_MX6=y
 CONFIG_TARGET_GE_B650V3=y
+CONFIG_DEFAULT_FDT_FILE="/boot/imx6q-b650v3.dtb"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_BOOTDELAY=1
 CONFIG_HUSH_PARSER=y
diff --git a/configs/ge_b850v3_defconfig b/configs/ge_b850v3_defconfig
index 2c5aa05..004c9d0 100644
--- a/configs/ge_b850v3_defconfig
+++ b/configs/ge_b850v3_defconfig
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_ARCH_MX6=y
 CONFIG_TARGET_GE_B850V3=y
+CONFIG_DEFAULT_FDT_FILE="/boot/imx6q-b850v3.dtb"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_BOOTDELAY=1
 CONFIG_HUSH_PARSER=y
diff --git a/configs/mx25pdk_defconfig b/configs/mx25pdk_defconfig
index b4afb05..c3ab7c2 100644
--- a/configs/mx25pdk_defconfig
+++ b/configs/mx25pdk_defconfig
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_TARGET_MX25PDK=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx25pdk/imximage.cfg"
+CONFIG_DEFAULT_FDT_FILE="imx25-pdk.dtb"
 CONFIG_BOOTDELAY=1
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
diff --git a/configs/mx53ard_defconfig b/configs/mx53ard_defconfig
index 7a62c2b..fe0f106 100644
--- a/configs/mx53ard_defconfig
+++ b/configs/mx53ard_defconfig
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_TARGET_MX53ARD=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx53ard/imximage_dd3.cfg"
+CONFIG_DEFAULT_FDT_FILE="imx53-ard.dtb"
 CONFIG_BOOTDELAY=3
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
diff --git a/configs/pico-imx6ul_defconfig b/configs/pico-imx6ul_defconfig
index 1aaf868..dba67bb 100644
--- a/configs/pico-imx6ul_defconfig
+++ b/configs/pico-imx6ul_defconfig
@@ -2,6 +2,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_MX6=y
 CONFIG_TARGET_PICO_IMX6UL=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/technexion/pico-imx6ul/imximage.cfg"
+CONFIG_DEFAULT_FDT_FILE="imx6ul-pico-hobbit.dtb"
 CONFIG_BOOTDELAY=3
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
diff --git a/config

[U-Boot] [PATCH v7 05/21] net: Kconfig: Add FEC_MXC entry

2016-10-08 Thread Jagan Teki
From: Jagan Teki 

Added kconfig for FEC_MXC driver.

Cc: Joe Hershberger 
Cc: Simon Glass 
Cc: Fabio Estevam 
Cc: Stefano Babic 
Cc: Peng Fan 
Cc: Matteo Lisi 
Cc: Michael Trimarchi 
Signed-off-by: Jagan Teki 
---
 drivers/net/Kconfig | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 302c005..7b9961d 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -129,6 +129,13 @@ config ETHOC
help
  This MAC is present in OpenRISC and Xtensa XTFPGA boards.
 
+config FEC_MXC
+   bool "FEC Ethernet controller"
+   depends on MX6
+   help
+ This driver supports the 10/100 Fast Ethernet controller for
+ NXP i.MX processors.
+
 config MVPP2
bool "Marvell Armada 375 network interface support"
depends on ARMADA_375
-- 
2.7.4

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


[U-Boot] [PATCH v7 00/21] imx6: Add Engicam i.CoreM6 QDL support

2016-10-08 Thread Jagan Teki
From: Jagan Teki 

This series supports Engicam i.CoreM6 QDL modules on top of u-boot-imx/master
and test on the respective starter kits as well.

Tested both MMC and NAND boot.

Changes for v7:
- Add patch to CONFIG_DEFAULT_FDT_FILE to defconfigs
- Rebase on u-boot-imx/master

Changes for v6:
- Rebase to u-boot-imx/master
- Move few SPL configs to defconfigs

Changes for v5:
- Add NAND support

Changes for v4:
- Add 'net: Kconfig: Add FEC_MXC entry' patch
- Updated ENV configs along with comments
- Restructured configs for more readability
- Add CONFIG_ENV_OVERWRITE
- Rename icorem6qdl_defconfig with icorem6qdl_mmc_defconfig

Changes for v3:
- Remove "v2 01/17 imx: iomux-v3: Fix build error with snvs base" patch
- Remove 'default n' on Kconfig DEFAULT_FDT_FILE patch
- Add minimal devicetree support for Engicam i.CoreM6 QDL
- Add is_mx6dl()
- Add is_mx6solo()
- Use is_mx6dq()
- Add last commit sha1 and header in pull devicetree files from Linux

Changes for v2:
- Make static to local iomux structure in board file
- Corrected rowaddr in mx6_ddr3_cfg
- Used imx_ddr_size
- Add FEC support and tested the same
- Add DM_GPIO, DM_MMC support
- Add pinctrl support
- Add devicetree support

Jagan Teki (21):
  serial: Kconfig: Add MXC_UART entry
  thermal: Kconfig: Add IMX_THERMAL entry
  config: Move CONFIG_DEFAULT_FDT_FILE to defconfigs
  arm: imx: Add Engicam i.CoreM6 QDL Starter Kit initial support
  net: Kconfig: Add FEC_MXC entry
  imx6: icorem6: Add ENET support
  imx: s/docs\/README.imximage/doc\/README.imximage/g
  arm: dts: Add devicetree for i.MX6DL
  arm: dts: Add devicetree for i.MX6DQL
  arm: dts: imx6dl: Add pinctrl defines
  dt-bindings: clock: imx6qdl: Add clock defines
  arm: imx6q: Add devicetree support for Engicam i.CoreM6 DualLite/Solo
  imx6q: icorem6: Enable pinctrl driver
  engicam: icorem6: Add DM_GPIO, DM_MMC support
  arm: dts: Add devicetree for i.MX6Q
  arm: dts: imx6q: Add pinctrl defines
  arm: imx6q: Add devicetree support for Engicam i.CoreM6 Quad/Dual
  mtd: nand: Kconfig: Add NAND_MXS entry
  imx6: icorem6: Add NAND support
  imx6: icorem6: Enable MTD device support
  imx6: icorem6: Add default mtd nand partition table

 arch/arm/cpu/armv7/mx6/Kconfig  |   11 +
 arch/arm/dts/Makefile   |4 +-
 arch/arm/dts/imx6dl-icore.dts   |   59 ++
 arch/arm/dts/imx6dl-pinfunc.h   | 1091 +++
 arch/arm/dts/imx6dl.dtsi|  133 +++
 arch/arm/dts/imx6q-icore.dts|   59 ++
 arch/arm/dts/imx6q-pinfunc.h| 1047 ++
 arch/arm/dts/imx6q.dtsi |  300 +++
 arch/arm/dts/imx6qdl-icore.dtsi |  196 
 arch/arm/dts/imx6qdl.dtsi   | 1281 +++
 arch/arm/include/asm/imx-common/sys_proto.h |2 +
 board/barco/titanium/imximage.cfg   |2 +-
 board/ccv/xpress/imximage.cfg   |2 +-
 board/denx/m53evk/imximage.cfg  |2 +-
 board/engicam/icorem6/Kconfig   |   12 +
 board/engicam/icorem6/MAINTAINERS   |6 +
 board/engicam/icorem6/Makefile  |6 +
 board/engicam/icorem6/README|   38 +
 board/engicam/icorem6/icorem6.c |  537 +++
 board/freescale/mx6sabresd/mx6dlsabresd.cfg |2 +-
 board/freescale/mx6slevk/imximage.cfg   |2 +-
 board/freescale/mx6ullevk/imximage.cfg  |2 +-
 board/freescale/mx7dsabresd/imximage.cfg|2 +-
 board/freescale/s32v234evb/s32v234evb.cfg   |2 +-
 board/freescale/vf610twr/imximage.cfg   |2 +-
 board/phytec/pcm052/imximage.cfg|2 +-
 board/technexion/pico-imx6ul/imximage.cfg   |2 +-
 board/toradex/colibri_imx7/imximage.cfg |2 +-
 board/toradex/colibri_vf/imximage.cfg   |2 +-
 board/warp/imximage.cfg |2 +-
 board/warp7/imximage.cfg|2 +-
 common/Kconfig  |5 +
 configs/dms-ba16-1g_defconfig   |1 +
 configs/dms-ba16_defconfig  |1 +
 configs/ge_b450v3_defconfig |1 +
 configs/ge_b650v3_defconfig |1 +
 configs/ge_b850v3_defconfig |1 +
 configs/imx6qdl_icore_mmc_defconfig |   42 +
 configs/imx6qdl_icore_nand_defconfig|   37 +
 configs/mx25pdk_defconfig   |1 +
 configs/mx53ard_defconfig   |1 +
 configs/pico-imx6ul_defconfig   |1 +
 configs/tqma6q_mba6_mmc_defconfig   |1 +
 configs/tqma6q_mba6_spi_defconfig   |1 +
 configs/tqma6s_mba6_mmc_defconfig   |1 +
 configs/tqma6s_mba6_spi_defconfig   |1 +
 configs/tqma6s_wru4_mmc_defcon

[U-Boot] [PATCH v7 02/21] thermal: Kconfig: Add IMX_THERMAL entry

2016-10-08 Thread Jagan Teki
From: Jagan Teki 

Added kconfig for IMX_THERMAL driver.

Cc: Simon Glass 
Cc: Fabio Estevam 
Cc: Stefano Babic 
Cc: Peng Fan 
Cc: Matteo Lisi 
Cc: Michael Trimarchi 
Signed-off-by: Jagan Teki 
---
 drivers/thermal/Kconfig | 13 +
 1 file changed, 13 insertions(+)

diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig
index 8e22ea7..f0ffbb3 100644
--- a/drivers/thermal/Kconfig
+++ b/drivers/thermal/Kconfig
@@ -5,3 +5,16 @@ config DM_THERMAL
  temperature sensors to permit warnings, speed throttling or even
  automatic power-off when the temperature gets too high or low. Other
  devices may be discrete but connected on a suitable bus.
+
+if DM_THERMAL
+
+config IMX_THERMAL
+   bool "Temperature sensor driver for Freescale i.MX SoCs"
+   depends on MX6
+   help
+ Support for Temperature Monitor (TEMPMON) found on Freescale i.MX 
SoCs.
+  It supports one critical trip point and one passive trip point.  The
+  cpufreq is used as the cooling device to throttle CPUs when the
+  passive trip is crossed.
+
+endif # if DM_THERMAL
-- 
2.7.4

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


[U-Boot] [PATCH v7 01/21] serial: Kconfig: Add MXC_UART entry

2016-10-08 Thread Jagan Teki
From: Jagan Teki 

Added kconfig for MXC_UART driver.

Cc: Simon Glass 
Cc: Fabio Estevam 
Cc: Stefano Babic 
Cc: Peng Fan 
Cc: Matteo Lisi 
Cc: Michael Trimarchi 
Signed-off-by: Jagan Teki 
---
 drivers/serial/Kconfig | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index 541cf2e..317d158 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -309,6 +309,13 @@ config MVEBU_A3700_UART
  Choose this option to add support for UART driver on the Marvell
  Armada 3700 SoC. The base address is configured via DT.
 
+config MXC_UART
+   bool "IMX serial port support"
+   depends on MX6
+   help
+ If you have a machine based on a Motorola IMX CPU you
+ can enable its onboard serial port by enabling this option.
+
 config PIC32_SERIAL
bool "Support for Microchip PIC32 on-chip UART"
depends on DM_SERIAL && MACH_PIC32
-- 
2.7.4

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


Re: [U-Boot] Unable to boot from QSPI (u-boot 2016.11-rc1)

2016-10-08 Thread Jagan Teki
On Fri, Oct 7, 2016 at 6:42 AM, Teoh Choon Zone
 wrote:
> Hi,
>
> Can you elaborate more on which file or function to look at? I am quite new
> to u-boot.

Try to boot with other boot sources(mmc or other) and 'sf probe' the
flash on u-boot. this make sure no issue on with SPI controller or
flash. otherwise need to check with cadence_spi_xfer.

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


  1   2   >