Re: [U-Boot] Cannot boot mx6qsabred with 2019.07-rc2

2019-05-23 Thread Abel Vesa
On 19-05-23 09:59:05, Tom Rini wrote:
> On Thu, May 23, 2019 at 10:49:11AM -0300, Fabio Estevam wrote:
> > Hi Peng,
> > 
> > On Tue, May 21, 2019 at 10:38 PM Peng Fan  wrote:
> > 
> > > > I will send a v2 removing CONFIG_SPL_DM.
> > >
> > > So what is the real direction moving to use SPL driver, non-dm is allowed 
> > > in future?
> > 
> > We are very limited in space when CONFIG_SPL_DM is used on imx6q-sabresd.
> > 
> > With CONFIG_SPL_DM selected the size increase due to the three dtb's
> > is about 8kB.
> > 
> > Even with CONFIG_SPL_DM disabled we ony have 1kB of free space, so I
> > still want to optimize the size further.
> 
> So with CONFIG_SPL_DM we're overflowing by ~7kB?
> 

Well, the mandatory requirements here are as follow (AFAIK):
1. keep one binary for all imx6dl imx6[qp|dl|q]-sabresd
2. have DM support in SPL

So I guess we have to either prioritize the other needed configs and
leave out the one we can do without. That, ofcourse, if we still want
to fit in and we still want one binary for all three sabresd boards.

> > Two options that I want also to remove are:
> > 
> > CONFIG_SPL_FS_EXT4=y
> > CONFIG_SPL_I2C_SUPPORT=y
> > 
> > We are at -rc2 now, and I would really like to have mx6sabresd booting 
> > again.
> > 
> > Please check my v2 series and see if it looks good.
> 
> We certainly want to do something to fix the regression, agreed.
> 
> Looking at the config, can we just use a fake DTB for SPL that works on
> all 3 boards, rather than 3 DTBs?
> 
> -- 
> Tom



> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.denx.de%2Flistinfo%2Fu-bootdata=02%7C01%7Cabel.vesa%40nxp.com%7C54f9085be4bd4b141d4f08d6df86dfe8%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C636942167723464482sdata=%2B%2BpYTLntPp5vMtY0ImlL6FoM2X2m6NEn42HX6KxRz1s%3Dreserved=0
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2 2/2] tools: fit_image: Add the loadable property to configs

2019-03-12 Thread Abel Vesa
When running mkimage with "-f auto", the loadable property
needs to be set in order to allow SPL FIT support to boot.

Signed-off-by: Abel Vesa 
---
 tools/fit_image.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/fit_image.c b/tools/fit_image.c
index 4b62635..3b867e0 100644
--- a/tools/fit_image.c
+++ b/tools/fit_image.c
@@ -298,6 +298,7 @@ static void fit_write_configs(struct image_tool_params 
*params, char *fdt)
typename = genimg_get_type_short_name(params->fit_image_type);
snprintf(str, sizeof(str), "%s-1", typename);
fdt_property_string(fdt, typename, str);
+   fdt_property_string(fdt, FIT_LOADABLE_PROP, str);
 
if (params->fit_ramdisk)
fdt_property_string(fdt, FIT_RAMDISK_PROP,
-- 
2.7.4

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


[U-Boot] [PATCH v2 1/2] common: spl_fit: Default to IH_OS_U_BOOT if FIT_IMAGE_TINY enabled

2019-03-12 Thread Abel Vesa
If FIT_IMAGE_TINY is enabled, spl_fit_image_get_os returns -ENOTSUPP.
In this case, we should default to IH_OS_U_BOOT not to IH_OS_INVALID.

Signed-off-by: Abel Vesa 
---

Changes since v1:
 * added the #if FIT_IMAGE_TINY as suggested by Mark Vasut

 common/spl/spl_fit.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index db43626..c9bfe0c 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -491,6 +491,10 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
 
if (!spl_fit_image_get_os(fit, node, _type))
debug("Loadable is %s\n", genimg_get_os_name(os_type));
+#if CONFIG_IS_ENABLED(FIT_IMAGE_TINY)
+   else
+   os_type = IH_OS_U_BOOT;
+#endif
 
if (os_type == IH_OS_U_BOOT) {
spl_fit_append_fdt(_info, info, sector,
-- 
2.7.4

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


[U-Boot] [PATCH 2/2] tools: fit_image: Add the loadable property to configs

2019-03-11 Thread Abel Vesa
When running mkimage with "-f auto", the loadable property
needs to be set in order to allow SPL FIT support to boot.

Signed-off-by: Abel Vesa 
---
 tools/fit_image.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/fit_image.c b/tools/fit_image.c
index 4b62635..3b867e0 100644
--- a/tools/fit_image.c
+++ b/tools/fit_image.c
@@ -298,6 +298,7 @@ static void fit_write_configs(struct image_tool_params 
*params, char *fdt)
typename = genimg_get_type_short_name(params->fit_image_type);
snprintf(str, sizeof(str), "%s-1", typename);
fdt_property_string(fdt, typename, str);
+   fdt_property_string(fdt, FIT_LOADABLE_PROP, str);
 
if (params->fit_ramdisk)
fdt_property_string(fdt, FIT_RAMDISK_PROP,
-- 
2.7.4

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


[U-Boot] [PATCH 1/2] common: spl_fit: Default to IH_OS_U_BOOT if FIT_IMAGE_TINY enabled

2019-03-11 Thread Abel Vesa
If FIT_IMAGE_TINY is enabled, spl_fit_image_get_os returns -ENOTSUPP.
In this case, we should default to IH_OS_U_BOOT not to IH_OS_INVALID.

Signed-off-by: Abel Vesa 
---
 common/spl/spl_fit.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index db43626..b190612 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -491,6 +491,8 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
 
if (!spl_fit_image_get_os(fit, node, _type))
debug("Loadable is %s\n", genimg_get_os_name(os_type));
+   else
+   os_type = IH_OS_U_BOOT;
 
if (os_type == IH_OS_U_BOOT) {
spl_fit_append_fdt(_info, info, sector,
-- 
2.7.4

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


Re: [U-Boot] [PATCH v2] common: spl_fit: Allow firmware image if no loadables

2019-03-10 Thread Abel Vesa
On 19-03-10 13:02:28, Marek Vasut wrote:
> On 3/10/19 12:42 PM, Abel Vesa wrote:
> > If CONFIG_SPL_OS_BOOT and FIT_IMAGE_TINY are enabled,
> > the os will not be set to anything and therefore will
> > remain as IH_OS_INVALID. What's needed here is to
> > have IH_OS_U_BOOT as default. And since using the
> > mkimage oneline command (that is, no its file), the
> > loadables can't be specified, so we allow firmware
> > as a fallback.
> 
> Wouldn't it make more sense to fix the mkimage ?
> 

OK then, I'll add a new option to mkimage for loadables.

> > Signed-off-by: Abel Vesa 
> > Tested-by: Fabio Estevam 
> > ---
> > 
> > Changes since v1:
> >  * added braces to get rid of the build warning
> > 
> >  common/spl/spl_fit.c | 10 +++---
> >  1 file changed, 7 insertions(+), 3 deletions(-)
> > 
> > diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
> > index db43626..bfcf71a 100644
> > --- a/common/spl/spl_fit.c
> > +++ b/common/spl/spl_fit.c
> > @@ -478,11 +478,15 @@ int spl_load_simple_fit(struct spl_image_info 
> > *spl_image,
> >  
> > /* Now check if there are more images for us to load */
> > for (; ; index++) {
> > -   uint8_t os_type = IH_OS_INVALID;
> > +   uint8_t os_type = IH_OS_U_BOOT;
> 
> Does that mean invalid image type is then always handled as if it was
> U-Boot ? That looks kinda iffy.
> 

Hmm, fair enough. I'll do the fix in mkimage and this change won't be necessary 
then.

> > node = spl_fit_get_image_node(fit, images, "loadables", index);
> > -   if (node < 0)
> > -   break;
> > +   if (node < 0) {
> > +   node = spl_fit_get_image_node(fit, images,
> > + "firmware", index);
> > +   if (node < 0)
> > +   break;
> > +   }
> >  
> > ret = spl_load_fit_image(info, sector, fit, base_offset, node,
> >  _info);
> > 
> 
> 
> -- 
> Best regards,
> Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2] common: spl_fit: Allow firmware image if no loadables

2019-03-10 Thread Abel Vesa
If CONFIG_SPL_OS_BOOT and FIT_IMAGE_TINY are enabled,
the os will not be set to anything and therefore will
remain as IH_OS_INVALID. What's needed here is to
have IH_OS_U_BOOT as default. And since using the
mkimage oneline command (that is, no its file), the
loadables can't be specified, so we allow firmware
as a fallback.

Signed-off-by: Abel Vesa 
Tested-by: Fabio Estevam 
---

Changes since v1:
 * added braces to get rid of the build warning

 common/spl/spl_fit.c | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index db43626..bfcf71a 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -478,11 +478,15 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
 
/* Now check if there are more images for us to load */
for (; ; index++) {
-   uint8_t os_type = IH_OS_INVALID;
+   uint8_t os_type = IH_OS_U_BOOT;
 
node = spl_fit_get_image_node(fit, images, "loadables", index);
-   if (node < 0)
-   break;
+   if (node < 0) {
+   node = spl_fit_get_image_node(fit, images,
+ "firmware", index);
+   if (node < 0)
+   break;
+   }
 
ret = spl_load_fit_image(info, sector, fit, base_offset, node,
 _info);
-- 
2.7.4

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


[U-Boot] [PATCH] common: spl_fit: Allow firmware image if no loadables

2019-03-06 Thread Abel Vesa
If CONFIG_SPL_OS_BOOT and FIT_IMAGE_TINY are enabled,
the os will not be set to anything and therefore will
remain as IH_OS_INVALID. What's needed here is to
have IH_OS_U_BOOT as default. And since using the
mkimage oneline command (that is, no its file), the
loadables can't be specified, so we allow firmware
as a fallback.

Signed-off-by: Abel Vesa 
---
 common/spl/spl_fit.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index db43626..d5aa792 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -478,11 +478,14 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
 
/* Now check if there are more images for us to load */
for (; ; index++) {
-   uint8_t os_type = IH_OS_INVALID;
+   uint8_t os_type = IH_OS_U_BOOT;
 
node = spl_fit_get_image_node(fit, images, "loadables", index);
if (node < 0)
-   break;
+   node = spl_fit_get_image_node(fit, images,
+ "firmware", index);
+   if (node < 0)
+   break;
 
ret = spl_load_fit_image(info, sector, fit, base_offset, node,
 _info);
-- 
2.7.4

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


Re: [U-Boot] [PATCH v4 01/20] common: spl_fit: Fix the spl_fit_image_get_os for FIT_IMAGE_TINY

2019-02-18 Thread Abel Vesa
On 19-02-16 10:23:10, Stefano Babic wrote:
> Hi Abel,
> 
> On 01/02/19 17:40, Abel Vesa wrote:
> > There is not really reducing codesize here since there is only
> > a call. The function is always built in if CONFIG_$(SPL_TPL_)FIT is set.
> > Plus, there was a change in behavior if CONFIG_SPL_OS_BOOT is defined.
> > If CONFIG_FIT_IMAGE_TINY is defined, the spl_fit_image_get_os was
> > returning -ENOTSUPP and then if CONFIG_SPL_OS_BOOT was also
> > defined, the spl_image->os was left set to 0 which in turn
> > was skipping the fdt appending resulting in boot-up failure.
> > 
> 
> Really there is a difference in codesize, even if it looks like a side
> effect. This patch breaks build for sun8i and sun50i due to increased
> size. So I have to drop this patch and I applied the rest of the series
> to u-boot-imx.
> 

Ok then, but the real problem here is the fact that the spl_image->os remains
unset. And, as per the comment from the common/spl/spl_fit.c call site, the
fallback should be setting to IH_OS_U_BOOT. See below.

> Best regards,
> Stefano Babic
> 
> > Fixes: 337bbb6297775e spl: fit: add SPL_FIT_IMAGE_TINY config to reduce 
> > code-size
> > Signed-off-by: Abel Vesa 
> > ---
> >  common/spl/spl_fit.c | 4 
> >  1 file changed, 4 deletions(-)
> > 
> > diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
> > index db43626..a87d02d 100644
> > --- a/common/spl/spl_fit.c
> > +++ b/common/spl/spl_fit.c
> > @@ -333,11 +333,7 @@ static int spl_fit_record_loadable(const void *fit, 
> > int images, int index,
> >  
> >  static int spl_fit_image_get_os(const void *fit, int noffset, uint8_t *os)
> >  {
#if CONFIG_IS_ENABLED(FIT_IMAGE_TINY)

So I guess we can keep as it was before but add the following line here then:
+   *os = IH_OS_U_BOOT;

Let me know if I'm missing something here.

return -ENOTSUPP;
#else
return fit_image_get_os(fit, noffset, os);
#endif
> >  }
> >  
> >  int spl_load_simple_fit(struct spl_image_info *spl_image,
> > 
> 
> -- 
> =
> DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
> =
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v4 00/20] mx6sabre: Add DM and SPL FIT support

2019-02-09 Thread Abel Vesa
On 19-02-04 08:19:23, Tom Rini wrote:
> On Mon, Feb 04, 2019 at 09:03:43AM -0200, Fabio Estevam wrote:
> > On Mon, Feb 4, 2019 at 7:55 AM Abel Vesa  wrote:
> > 
> > > If the SPL size (without the dtb appended) is larger then yes, the build 
> > > fails.
> > > Trouble is if the SPL (without the dtb appended) is, lets say, 63kB and
> > > then the dtb is larger than 1kB. Then there is no mechanism in place to 
> > > check that
> > > and it will just fail to boot without giving any clues why. But this is a 
> > > totally
> > > unrelated problem from this patchset's point of view and I think it 
> > > impacts all
> > > the platforms that support SPL with DM.
> > 
> > Yes, it is unrelated to this series and should be treated separately.
> 
> I also agree.  But, don't we have a mechanism for that?  It sounds like
> some additional targets need to call $(BOARD_SIZE_CHECK) at the end.  Or
> am I missing something?
> 

So, do I need to resend this with all the R-bs ?
> -- 
> Tom

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


Re: [U-Boot] [PATCH v4 00/20] mx6sabre: Add DM and SPL FIT support

2019-02-04 Thread Abel Vesa
On 19-02-04 08:19:23, Tom Rini wrote:
> On Mon, Feb 04, 2019 at 09:03:43AM -0200, Fabio Estevam wrote:
> > On Mon, Feb 4, 2019 at 7:55 AM Abel Vesa  wrote:
> > 
> > > If the SPL size (without the dtb appended) is larger then yes, the build 
> > > fails.
> > > Trouble is if the SPL (without the dtb appended) is, lets say, 63kB and
> > > then the dtb is larger than 1kB. Then there is no mechanism in place to 
> > > check that
> > > and it will just fail to boot without giving any clues why. But this is a 
> > > totally
> > > unrelated problem from this patchset's point of view and I think it 
> > > impacts all
> > > the platforms that support SPL with DM.
> > 
> > Yes, it is unrelated to this series and should be treated separately.
> 
> I also agree.  But, don't we have a mechanism for that?  It sounds like
> some additional targets need to call $(BOARD_SIZE_CHECK) at the end.  Or
> am I missing something?
> 

Hmm, I believe that is true. I haven't looked deeper into it but it seems
that's the thing the SPL is missing.

> -- 
> Tom

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


Re: [U-Boot] [PATCH v4 00/20] mx6sabre: Add DM and SPL FIT support

2019-02-04 Thread Abel Vesa
On 19-02-02 07:50:28, Fabio Estevam wrote:
> Hi Abel,
> 
> On Fri, Feb 1, 2019 at 2:43 PM Abel Vesa  wrote:
> >
> > The third version is here:
> > https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.denx.de%2Fpipermail%2Fu-boot%2F2019-January%2F356903.htmldata=02%7C01%7Cabel.vesa%40nxp.com%7Ca93c33315b5b492ca15308d688f3e275%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C636846978387908349sdata=wQrrLoMyouM5vdUlfXI325wqZYt4tTa5WTRJsgwMEz0%3Dreserved=0
> >
> > So, this time I hope I got it right. Before, I was stupidly trying
> > to put a fit in another fit without a really good reason. To my
> > excuse, that was working even with the spl_image->os set to 0,
> > bug which I (hope) I fixed in the first patch (a new one)
> > of this series.
> 
> I am happy with the entire series.
> 
> One more question: do we get build error when the SPL gets larger than 64kB?

If the SPL size (without the dtb appended) is larger then yes, the build fails.
Trouble is if the SPL (without the dtb appended) is, lets say, 63kB and
then the dtb is larger than 1kB. Then there is no mechanism in place to check 
that
and it will just fail to boot without giving any clues why. But this is a 
totally
unrelated problem from this patchset's point of view and I think it impacts all
the platforms that support SPL with DM.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v4 00/20] mx6sabre: Add DM and SPL FIT support

2019-02-01 Thread Abel Vesa
On 19-02-01 15:13:32, Fabio Estevam wrote:
> Hi Abel,
> 
> On Fri, Feb 1, 2019 at 2:43 PM Abel Vesa  wrote:
> >
> > The third version is here:
> > https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.denx.de%2Fpipermail%2Fu-boot%2F2019-January%2F356903.htmldata=02%7C01%7Cabel.vesa%40nxp.com%7Cc7db2be273394c06098308d688689e41%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C636846380248922351sdata=fhDqNxkE1dq0fGNroGRR%2F0OkmBPRlVBqCefS6GM8kns%3Dreserved=0
> >
> > So, this time I hope I got it right. Before, I was stupidly trying
> > to put a fit in another fit without a really good reason. To my
> > excuse, that was working even with the spl_image->os set to 0,
> > bug which I (hope) I fixed in the first patch (a new one)
> > of this series.
> 
> Thanks for your work on this!
> 
> Just to confirm: with this series all sabresd variants (imx6q, imx6dl,
> imx6qp) boot with the same binary, right?
> 

That is correct.

For mx6sabresd_defconfig, all imx6q_sabresd, imx6qp_sabresd and imx6dl_sabresd
have been tested with the same binary.

And I've tested exactly the same the mx6sabreauto_defconfig with all three SoC
combinations.

> Is there anything known to be not working that used to work before due
> to missing driver model conversion?
> 

I don't know about anything that might not work. As specified in the cover
letter I had to get rid (disable) of EFI, EXT and DOS support in SPL.

> Is Ethernet functional?

I haven't tested the ethernet on all of them, just one of each 
(sabresd/sabreauto).

I'll test them all when I get back at the office tomorrow.

> 
> Thanks
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v4 19/20] board: mx6sabresd: Remove the enet reset gpio handling

2019-02-01 Thread Abel Vesa
Rely on the phy-reset-gpios which is set in imx6qdl-sabresd dtsi
and get rid of the enet reset gpio handling from the board file.

Signed-off-by: Abel Vesa 
---
 board/freescale/mx6sabresd/mx6sabresd.c | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/board/freescale/mx6sabresd/mx6sabresd.c 
b/board/freescale/mx6sabresd/mx6sabresd.c
index 0824a05..385a18e 100644
--- a/board/freescale/mx6sabresd/mx6sabresd.c
+++ b/board/freescale/mx6sabresd/mx6sabresd.c
@@ -94,13 +94,6 @@ static iomux_v3_cfg_t const enet_pads[] = {
 static void setup_iomux_enet(void)
 {
SETUP_IOMUX_PADS(enet_pads);
-
-   /* Reset AR8031 PHY */
-   gpio_request(IMX_GPIO_NR(1, 25), "ENET PHY Reset");
-   gpio_direction_output(IMX_GPIO_NR(1, 25) , 0);
-   mdelay(10);
-   gpio_set_value(IMX_GPIO_NR(1, 25), 1);
-   udelay(100);
 }
 
 static iomux_v3_cfg_t const usdhc2_pads[] = {
-- 
2.7.4

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


[U-Boot] [PATCH v4 01/20] common: spl_fit: Fix the spl_fit_image_get_os for FIT_IMAGE_TINY

2019-02-01 Thread Abel Vesa
There is not really reducing codesize here since there is only
a call. The function is always built in if CONFIG_$(SPL_TPL_)FIT is set.
Plus, there was a change in behavior if CONFIG_SPL_OS_BOOT is defined.
If CONFIG_FIT_IMAGE_TINY is defined, the spl_fit_image_get_os was
returning -ENOTSUPP and then if CONFIG_SPL_OS_BOOT was also
defined, the spl_image->os was left set to 0 which in turn
was skipping the fdt appending resulting in boot-up failure.

Fixes: 337bbb6297775e spl: fit: add SPL_FIT_IMAGE_TINY config to reduce 
code-size
Signed-off-by: Abel Vesa 
---
 common/spl/spl_fit.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index db43626..a87d02d 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -333,11 +333,7 @@ static int spl_fit_record_loadable(const void *fit, int 
images, int index,
 
 static int spl_fit_image_get_os(const void *fit, int noffset, uint8_t *os)
 {
-#if CONFIG_IS_ENABLED(FIT_IMAGE_TINY)
-   return -ENOTSUPP;
-#else
return fit_image_get_os(fit, noffset, os);
-#endif
 }
 
 int spl_load_simple_fit(struct spl_image_info *spl_image,
-- 
2.7.4

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


[U-Boot] [PATCH v4 20/20] configs: mx6sabresd: Reduce SPL size by disabling DOS, EXT and EFI support

2019-02-01 Thread Abel Vesa
With DM and FIT enabled in SPL, there is an sram overflow. By disabling
CONFIG_SPL_DOS_PARTITION, CONFIG_SPL_EXT_SUPPORT and
CONFIG_SPL_EFI_PARTITION, we get to keep the 'one binary to fit all'
for imx6[q|qp|dl] on sabresd since the final SPL image is now under 64KB.

Signed-off-by: Abel Vesa 
---
 configs/mx6sabresd_defconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/configs/mx6sabresd_defconfig b/configs/mx6sabresd_defconfig
index e8fd9b4..27ace02e 100644
--- a/configs/mx6sabresd_defconfig
+++ b/configs/mx6sabresd_defconfig
@@ -22,7 +22,6 @@ CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_BOUNCE_BUFFER=y
 CONFIG_SPL_SEPARATE_BSS=y
 CONFIG_SPL_FIT_IMAGE_TINY=y
-CONFIG_SPL_EXT_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_SPL_USB_HOST_SUPPORT=y
@@ -53,6 +52,8 @@ CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_EFI_PARTITION=y
+# CONFIG_SPL_DOS_PARTITION is not set
+# CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_OF_CONTROL=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="imx6q-sabresd"
-- 
2.7.4

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


[U-Boot] [PATCH v4 02/20] usb: Rename SPL_USB_SUPPORT to SPL_USB_STORAGE

2019-02-01 Thread Abel Vesa
Since there is the SPL_USB_HOST_SUPPORT for enabling USB support in SPL,
makes more sense to rename the SPL_USB_SUPPORT as SPL_USB_STORAGE.
Everything that is not part of the usb storage support in SPL is now
build under SPL_USB_HOST_SUPPORT.

Signed-off-by: Abel Vesa 
Reviewed-by: Tom Rini 
---
 arch/arm/include/asm/arch-am33xx/spl.h| 2 +-
 arch/arm/mach-omap2/boot-common.c | 2 +-
 common/Makefile   | 5 +++--
 common/spl/Kconfig| 4 ++--
 common/spl/Makefile   | 2 +-
 common/spl/spl_usb.c  | 4 
 configs/am43xx_evm_usbhost_boot_defconfig | 2 +-
 configs/am43xx_hs_evm_defconfig   | 2 +-
 8 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/arch/arm/include/asm/arch-am33xx/spl.h 
b/arch/arm/include/asm/arch-am33xx/spl.h
index 0bf8c17..f3910c2 100644
--- a/arch/arm/include/asm/arch-am33xx/spl.h
+++ b/arch/arm/include/asm/arch-am33xx/spl.h
@@ -62,7 +62,7 @@
 #define BOOT_DEVICE_CPGMAC 0x47
 
 #define MMC_BOOT_DEVICES_START BOOT_DEVICE_MMC1
-#ifdef CONFIG_SPL_USB_SUPPORT
+#ifdef CONFIG_SPL_USB_STORAGE
 #define MMC_BOOT_DEVICES_END   BOOT_DEVICE_USB
 #else
 #define MMC_BOOT_DEVICES_END   BOOT_DEVICE_MMC2
diff --git a/arch/arm/mach-omap2/boot-common.c 
b/arch/arm/mach-omap2/boot-common.c
index 2db1922..c8b8ac6 100644
--- a/arch/arm/mach-omap2/boot-common.c
+++ b/arch/arm/mach-omap2/boot-common.c
@@ -93,7 +93,7 @@ void save_omap_boot_params(void)
sys_boot_device = 1;
break;
 #endif
-#if defined(BOOT_DEVICE_USB) && !defined(CONFIG_SPL_USB_SUPPORT)
+#if defined(BOOT_DEVICE_USB) && !defined(CONFIG_SPL_USB_STORAGE)
case BOOT_DEVICE_USB:
sys_boot_device = 1;
break;
diff --git a/common/Makefile b/common/Makefile
index ad390d0..8c92feb 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -75,8 +75,9 @@ obj-$(CONFIG_SPL_NET_SUPPORT) += miiphyutil.o
 obj-$(CONFIG_$(SPL_TPL_)OF_LIBFDT) += fdt_support.o
 
 ifdef CONFIG_SPL_USB_HOST_SUPPORT
-obj-$(CONFIG_SPL_USB_SUPPORT) += usb.o usb_hub.o
-obj-$(CONFIG_USB_STORAGE) += usb_storage.o
+obj-y += usb.o
+obj-y += usb_hub.o
+obj-$(CONFIG_SPL_USB_STORAGE) += usb_storage.o
 else
 obj-$(CONFIG_USB_MUSB_HOST) += usb.o
 endif
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 54b0dc3..8b0627e 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -766,9 +766,9 @@ config SPL_USB_HOST_SUPPORT
  device can be attached. This option enables the drivers in
  drivers/usb/host as part of an SPL build.
 
-config SPL_USB_SUPPORT
+config SPL_USB_STORAGE
bool "Support loading from USB"
-   depends on SPL_USB_HOST_SUPPORT
+   depends on SPL_USB_HOST_SUPPORT && !(BLK && !DM_USB)
help
  Enable support for USB devices in SPL. This allows use of USB
  devices such as hard drives and flash drivers for loading U-Boot.
diff --git a/common/spl/Makefile b/common/spl/Makefile
index 6f8d759..a3980ce 100644
--- a/common/spl/Makefile
+++ b/common/spl/Makefile
@@ -22,7 +22,7 @@ obj-$(CONFIG_$(SPL_TPL_)NET_SUPPORT) += spl_net.o
 obj-$(CONFIG_$(SPL_TPL_)MMC_SUPPORT) += spl_mmc.o
 obj-$(CONFIG_$(SPL_TPL_)ATF) += spl_atf.o
 obj-$(CONFIG_$(SPL_TPL_)OPTEE) += spl_optee.o
-obj-$(CONFIG_$(SPL_TPL_)USB_SUPPORT) += spl_usb.o
+obj-$(CONFIG_$(SPL_TPL_)USB_STORAGE) += spl_usb.o
 obj-$(CONFIG_$(SPL_TPL_)FAT_SUPPORT) += spl_fat.o
 obj-$(CONFIG_$(SPL_TPL_)EXT_SUPPORT) += spl_ext.o
 obj-$(CONFIG_$(SPL_TPL_)SATA_SUPPORT) += spl_sata.o
diff --git a/common/spl/spl_usb.c b/common/spl/spl_usb.c
index c8d8231..e29d579 100644
--- a/common/spl/spl_usb.c
+++ b/common/spl/spl_usb.c
@@ -15,9 +15,7 @@
 #include 
 #include 
 
-#ifdef CONFIG_USB_STORAGE
 static int usb_stor_curr_dev = -1; /* current device */
-#endif
 
 static int spl_usb_load_image(struct spl_image_info *spl_image,
  struct spl_boot_device *bootdev)
@@ -34,13 +32,11 @@ static int spl_usb_load_image(struct spl_image_info 
*spl_image,
return err;
}
 
-#ifdef CONFIG_USB_STORAGE
/* try to recognize storage devices immediately */
usb_stor_curr_dev = usb_stor_scan(1);
stor_dev = blk_get_devnum_by_type(IF_TYPE_USB, usb_stor_curr_dev);
if (!stor_dev)
return -ENODEV;
-#endif
 
debug("boot mode - FAT\n");
 
diff --git a/configs/am43xx_evm_usbhost_boot_defconfig 
b/configs/am43xx_evm_usbhost_boot_defconfig
index 5131f19..5bd919b 100644
--- a/configs/am43xx_evm_usbhost_boot_defconfig
+++ b/configs/am43xx_evm_usbhost_boot_defconfig
@@ -14,7 +14,7 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL_MTD_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_SPL_USB_HOST_SUPPORT=y
-CONFIG_SPL_USB_SUPPORT=y
+CONFIG_SPL_USB_STORAGE=y
 CONFIG_CMD_SPL=y
 CONFIG_CMD_SPL_NAND_OFS=0x0010
 CONFIG_CMD_SPL_WRITE_SIZE=0x4
diff --git a/configs/am43xx_hs_e

[U-Boot] [PATCH v4 04/20] configs: imx6sabreauto: Add DM_MMC support

2019-02-01 Thread Abel Vesa
Add DM_MMC config to imx6sabreauto defconfig.

Signed-off-by: Abel Vesa 
---
 configs/mx6sabreauto_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/mx6sabreauto_defconfig b/configs/mx6sabreauto_defconfig
index 40386c2..a3d63a2 100644
--- a/configs/mx6sabreauto_defconfig
+++ b/configs/mx6sabreauto_defconfig
@@ -44,6 +44,7 @@ CONFIG_ENV_IS_IN_MMC=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_SF=y
+CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_NAND=y
 CONFIG_NAND_MXS=y
-- 
2.7.4

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


[U-Boot] [PATCH v4 11/20] configs: mx6sabreauto: Add SPL FIT and DM support

2019-02-01 Thread Abel Vesa
Enable all the necessary configs for SPL DM and FIT support for
mx6sabreauto.

Signed-off-by: Abel Vesa 
---
 configs/mx6sabreauto_defconfig | 14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/configs/mx6sabreauto_defconfig b/configs/mx6sabreauto_defconfig
index 4bdcbb1..c3843ec 100644
--- a/configs/mx6sabreauto_defconfig
+++ b/configs/mx6sabreauto_defconfig
@@ -11,12 +11,18 @@ CONFIG_SPL=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_NXP_BOARD_REVISION=y
 CONFIG_NR_DRAM_BANKS=1
+# CONFIG_SYS_MALLOC_F is not set
+CONFIG_FIT=y
+CONFIG_SPL_FIT_PRINT=y
+CONFIG_SPL_LOAD_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_BOUNCE_BUFFER=y
+CONFIG_SPL_SEPARATE_BSS=y
+CONFIG_SPL_FIT_IMAGE_TINY=y
 CONFIG_SPL_EXT_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_WATCHDOG_SUPPORT=y
@@ -40,8 +46,15 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
+CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="imx6q-sabreauto"
+CONFIG_OF_LIST="imx6dl-sabreauto imx6q-sabreauto imx6qp-sabreauto"
+CONFIG_MULTI_DTB_FIT=y
+CONFIG_SPL_MULTI_DTB_FIT=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
+CONFIG_SPL_DM=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_SF=y
 CONFIG_DM_MMC=y
@@ -68,4 +81,3 @@ CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
-CONFIG_OF_LIBFDT=y
-- 
2.7.4

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


[U-Boot] [PATCH v4 08/20] board: mx6sabreauto: Add board_fit_config_name_match to support FIT in SPL

2019-02-01 Thread Abel Vesa
This matches one of the following three boards (or fails):
 - imx6q-sabreauto
 - imx6qp-sabreauto
 - imx6dl-sabreauto

Signed-off-by: Abel Vesa 
Reviewed-by: Peng Fan 
---
 board/freescale/mx6sabreauto/mx6sabreauto.c | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/board/freescale/mx6sabreauto/mx6sabreauto.c 
b/board/freescale/mx6sabreauto/mx6sabreauto.c
index c1bef85..c8f1263 100644
--- a/board/freescale/mx6sabreauto/mx6sabreauto.c
+++ b/board/freescale/mx6sabreauto/mx6sabreauto.c
@@ -1097,3 +1097,21 @@ void board_init_f(ulong dummy)
board_init_r(NULL, 0);
 }
 #endif
+
+#ifdef CONFIG_SPL_LOAD_FIT
+int board_fit_config_name_match(const char *name)
+{
+   if (is_mx6dq()) {
+   if (!strcmp(name, "imx6q-sabreauto"))
+   return 0;
+   } else if (is_mx6dqp()) {
+   if (!strcmp(name, "imx6qp-sabreauto"))
+   return 0;
+   } else if (is_mx6dl()) {
+   if (!strcmp(name, "imx6dl-sabreauto"))
+   return 0;
+   }
+
+   return -1;
+}
+#endif
-- 
2.7.4

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


[U-Boot] [PATCH v4 07/20] board: mx6sabresd: Add board_fit_config_name_match to support FIT in SPL

2019-02-01 Thread Abel Vesa
This matches one of the following three boards (or fails):
 - imx6q-sabresd
 - imx6qp-sabresd
 - imx6dl-sabresd

Signed-off-by: Abel Vesa 
Reviewed-by: Peng Fan 
---
 board/freescale/mx6sabresd/mx6sabresd.c | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/board/freescale/mx6sabresd/mx6sabresd.c 
b/board/freescale/mx6sabresd/mx6sabresd.c
index 0183ede..4688095 100644
--- a/board/freescale/mx6sabresd/mx6sabresd.c
+++ b/board/freescale/mx6sabresd/mx6sabresd.c
@@ -1062,3 +1062,21 @@ void board_init_f(ulong dummy)
board_init_r(NULL, 0);
 }
 #endif
+
+#ifdef CONFIG_SPL_LOAD_FIT
+int board_fit_config_name_match(const char *name)
+{
+   if (is_mx6dq()) {
+   if (!strcmp(name, "imx6q-sabresd"))
+   return 0;
+   } else if (is_mx6dqp()) {
+   if (!strcmp(name, "imx6qp-sabresd"))
+   return 0;
+   } else if (is_mx6dl()) {
+   if (!strcmp(name, "imx6dl-sabresd"))
+   return 0;
+   }
+
+   return -1;
+}
+#endif
-- 
2.7.4

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


[U-Boot] [PATCH v4 15/20] configs: mx6sabreauto: Add DM_SPI_FLASH necessary configs

2019-02-01 Thread Abel Vesa
Enable all neceassary configs to support DM_SPI_FLASH on mx6sabreauto.

Signed-off-by: Abel Vesa 
Reviewed-by: Peng Fan 
---
 configs/mx6sabreauto_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configs/mx6sabreauto_defconfig b/configs/mx6sabreauto_defconfig
index 3b37766..bb466fe 100644
--- a/configs/mx6sabreauto_defconfig
+++ b/configs/mx6sabreauto_defconfig
@@ -62,12 +62,14 @@ CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_NAND=y
 CONFIG_NAND_MXS=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
 CONFIG_MII=y
 CONFIG_DM_REGULATOR=y
 CONFIG_SPI=y
+CONFIG_DM_SPI=y
 CONFIG_MXC_SPI=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
-- 
2.7.4

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


[U-Boot] [PATCH v4 10/20] arm: dts: Update all the dts[i] files for imx6[q|qp|dl] sabre[auto|sd]

2019-02-01 Thread Abel Vesa
Update all the dts[i] files for imx6[q|qp|dl] sabre[auto|sd] to the ones
from kernel v4.20 (commit 8fe28cb58bcb2).

Signed-off-by: Abel Vesa 
Acked-by: Peng Fan 
---
 arch/arm/dts/Makefile   |   8 +-
 arch/arm/dts/imx6dl-sabreauto.dts   |  13 +
 arch/arm/dts/imx6dl-sabresd.dts |  18 +
 arch/arm/dts/imx6dl.dtsi| 306 --
 arch/arm/dts/imx6q-sabreauto.dts|  18 +
 arch/arm/dts/imx6q-sabresd.dts  |  23 +
 arch/arm/dts/imx6q.dtsi | 310 --
 arch/arm/dts/imx6qdl-sabreauto.dtsi | 810 
 arch/arm/dts/imx6qdl-sabresd.dtsi   | 741 +
 arch/arm/dts/imx6qdl.dtsi   | 455 +++-
 arch/arm/dts/imx6qp-sabreauto.dts   |  55 +++
 arch/arm/dts/imx6qp-sabresd.dts |  55 +++
 arch/arm/dts/imx6qp.dtsi| 115 +
 13 files changed, 2669 insertions(+), 258 deletions(-)
 create mode 100644 arch/arm/dts/imx6dl-sabreauto.dts
 create mode 100644 arch/arm/dts/imx6dl-sabresd.dts
 create mode 100644 arch/arm/dts/imx6q-sabreauto.dts
 create mode 100644 arch/arm/dts/imx6q-sabresd.dts
 create mode 100644 arch/arm/dts/imx6qdl-sabreauto.dtsi
 create mode 100644 arch/arm/dts/imx6qdl-sabresd.dtsi
 create mode 100644 arch/arm/dts/imx6qp-sabreauto.dts
 create mode 100644 arch/arm/dts/imx6qp-sabresd.dts
 create mode 100644 arch/arm/dts/imx6qp.dtsi

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 46f1d69..e8512af 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -443,7 +443,13 @@ dtb-$(CONFIG_MX6QDL) += \
imx6q-icore.dtb \
imx6q-icore-mipi.dtb \
imx6q-icore-rqs.dtb \
-   imx6q-logicpd.dtb
+   imx6q-logicpd.dtb \
+   imx6q-sabreauto.dtb \
+   imx6q-sabresd.dtb \
+   imx6dl-sabreauto.dtb \
+   imx6dl-sabresd.dtb \
+   imx6qp-sabreauto.dtb \
+   imx6qp-sabresd.dtb
 
 dtb-$(CONFIG_MX6SL) += imx6sl-evk.dtb
 
diff --git a/arch/arm/dts/imx6dl-sabreauto.dts 
b/arch/arm/dts/imx6dl-sabreauto.dts
new file mode 100644
index 000..660d52a
--- /dev/null
+++ b/arch/arm/dts/imx6dl-sabreauto.dts
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// Copyright (C) 2013 Freescale Semiconductor, Inc.
+
+/dts-v1/;
+
+#include "imx6dl.dtsi"
+#include "imx6qdl-sabreauto.dtsi"
+
+/ {
+   model = "Freescale i.MX6 DualLite/Solo SABRE Automotive Board";
+   compatible = "fsl,imx6dl-sabreauto", "fsl,imx6dl";
+};
diff --git a/arch/arm/dts/imx6dl-sabresd.dts b/arch/arm/dts/imx6dl-sabresd.dts
new file mode 100644
index 000..cd6bbf2
--- /dev/null
+++ b/arch/arm/dts/imx6dl-sabresd.dts
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// Copyright (C) 2013 Freescale Semiconductor, Inc.
+
+/dts-v1/;
+
+#include "imx6dl.dtsi"
+#include "imx6qdl-sabresd.dtsi"
+
+/ {
+   model = "Freescale i.MX6 DualLite SABRE Smart Device Board";
+   compatible = "fsl,imx6dl-sabresd", "fsl,imx6dl";
+};
+
+_csi1_from_ipu1_csi1_mux {
+   clock-lanes = <0>;
+   data-lanes = <1 2>;
+};
diff --git a/arch/arm/dts/imx6dl.dtsi b/arch/arm/dts/imx6dl.dtsi
index 9a4c22c..f0607eb 100644
--- a/arch/arm/dts/imx6dl.dtsi
+++ b/arch/arm/dts/imx6dl.dtsi
@@ -1,12 +1,6 @@
-
-/*
- * 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.
- *
- */
+// SPDX-License-Identifier: GPL-2.0
+//
+// Copyright 2013 Freescale Semiconductor, Inc.
 
 #include 
 #include "imx6dl-pinfunc.h"
@@ -39,6 +33,7 @@
396000  1175000
>;
clock-latency = <61036>; /* two CLK32 periods */
+   #cooling-cells = <2>;
clocks = < IMX6QDL_CLK_ARM>,
 < IMX6QDL_CLK_PLL2_PFD2_396M>,
 < IMX6QDL_CLK_STEP>,
@@ -56,39 +51,57 @@
device_type = "cpu";
reg = <1>;
next-level-cache = <>;
+   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

[U-Boot] [PATCH v4 18/20] board: mx6sabresd: Remove non-DM code

2019-02-01 Thread Abel Vesa
Since the mx6sabreauto has DM support, remove the unused non-DM code
from mx6sabresd board file.

Signed-off-by: Abel Vesa 
---
 board/freescale/mx6sabresd/mx6sabresd.c | 50 -
 1 file changed, 50 deletions(-)

diff --git a/board/freescale/mx6sabresd/mx6sabresd.c 
b/board/freescale/mx6sabresd/mx6sabresd.c
index 99002bd..0824a05 100644
--- a/board/freescale/mx6sabresd/mx6sabresd.c
+++ b/board/freescale/mx6sabresd/mx6sabresd.c
@@ -563,63 +563,13 @@ int board_eth_init(bd_t *bis)
 }
 
 #ifdef CONFIG_USB_EHCI_MX6
-#define USB_OTHERREGS_OFFSET   0x800
-#define UCTRL_PWR_POL  (1 << 9)
-
-static iomux_v3_cfg_t const usb_otg_pads[] = {
-   IOMUX_PADS(PAD_EIM_D22__USB_OTG_PWR | MUX_PAD_CTRL(NO_PAD_CTRL)),
-   IOMUX_PADS(PAD_ENET_RX_ER__USB_OTG_ID | MUX_PAD_CTRL(NO_PAD_CTRL)),
-};
-
-static iomux_v3_cfg_t const usb_hc1_pads[] = {
-   IOMUX_PADS(PAD_ENET_TXD1__GPIO1_IO29 | MUX_PAD_CTRL(NO_PAD_CTRL)),
-};
-
 static void setup_usb(void)
 {
-   SETUP_IOMUX_PADS(usb_otg_pads);
-
/*
 * set daisy chain for otg_pin_id on 6q.
 * for 6dl, this bit is reserved
 */
imx_iomux_set_gpr_register(1, 13, 1, 0);
-
-   SETUP_IOMUX_PADS(usb_hc1_pads);
-}
-
-int board_ehci_hcd_init(int port)
-{
-   u32 *usbnc_usb_ctrl;
-
-   if (port > 1)
-   return -EINVAL;
-
-   usbnc_usb_ctrl = (u32 *)(USB_BASE_ADDR + USB_OTHERREGS_OFFSET +
-port * 4);
-
-   setbits_le32(usbnc_usb_ctrl, UCTRL_PWR_POL);
-
-   return 0;
-}
-
-int board_ehci_power(int port, int on)
-{
-   switch (port) {
-   case 0:
-   break;
-   case 1:
-   if (on)
-   gpio_direction_output(IMX_GPIO_NR(1, 29), 1);
-   else
-   gpio_direction_output(IMX_GPIO_NR(1, 29), 0);
-   break;
-   default:
-   printf("MXC USB port %d not yet supported\n", port);
-   return -EINVAL;
-   }
-
-   return 0;
 }
 #endif
 
-- 
2.7.4

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


[U-Boot] [PATCH v4 03/20] usb: ehci-mx6: Make regulator DM_REGULATOR dependent

2019-02-01 Thread Abel Vesa
Do the regulator related work only if the build has the DM_REGULATOR.

Signed-off-by: Abel Vesa 
Reviewed-by: Peng Fan 
---
 drivers/usb/host/ehci-mx6.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/ehci-mx6.c b/drivers/usb/host/ehci-mx6.c
index 1acf08d..9483947 100644
--- a/drivers/usb/host/ehci-mx6.c
+++ b/drivers/usb/host/ehci-mx6.c
@@ -404,6 +404,7 @@ static int mx6_init_after_reset(struct ehci_ctrl *dev)
if (ret)
return ret;
 
+#if CONFIG_IS_ENABLED(DM_REGULATOR)
if (priv->vbus_supply) {
ret = regulator_set_enable(priv->vbus_supply,
   (type == USB_INIT_DEVICE) ?
@@ -413,6 +414,7 @@ static int mx6_init_after_reset(struct ehci_ctrl *dev)
return ret;
}
}
+#endif
 
if (type == USB_INIT_DEVICE)
return 0;
@@ -514,15 +516,17 @@ static int ehci_usb_probe(struct udevice *dev)
priv->portnr = dev->seq;
priv->init_type = type;
 
+#if CONFIG_IS_ENABLED(DM_REGULATOR)
ret = device_get_supply_regulator(dev, "vbus-supply",
  >vbus_supply);
if (ret)
debug("%s: No vbus supply\n", dev->name);
-
+#endif
ret = ehci_mx6_common_init(ehci, priv->portnr);
if (ret)
return ret;
 
+#if CONFIG_IS_ENABLED(DM_REGULATOR)
if (priv->vbus_supply) {
ret = regulator_set_enable(priv->vbus_supply,
   (type == USB_INIT_DEVICE) ?
@@ -532,6 +536,7 @@ static int ehci_usb_probe(struct udevice *dev)
return ret;
}
}
+#endif
 
if (priv->init_type == USB_INIT_HOST) {
setbits_le32(>usbmode, CM_HOST);
-- 
2.7.4

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


[U-Boot] [PATCH v4 13/20] mx6sabreauto: Add DM_GPIO support

2019-02-01 Thread Abel Vesa
Add the DM_GPIO related config for mx6sabreauto.
Also add the gpio request calls.

Signed-off-by: Abel Vesa 
Reviewed-by: Peng Fan 
---
 board/freescale/mx6sabreauto/mx6sabreauto.c | 3 +++
 configs/mx6sabreauto_defconfig  | 1 +
 2 files changed, 4 insertions(+)

diff --git a/board/freescale/mx6sabreauto/mx6sabreauto.c 
b/board/freescale/mx6sabreauto/mx6sabreauto.c
index c8f1263..c7e3e67 100644
--- a/board/freescale/mx6sabreauto/mx6sabreauto.c
+++ b/board/freescale/mx6sabreauto/mx6sabreauto.c
@@ -501,6 +501,7 @@ iomux_v3_cfg_t const backlight_pads[] = {
 
 static void setup_iomux_backlight(void)
 {
+   gpio_request(IMX_GPIO_NR(2, 9), "backlight");
gpio_direction_output(IMX_GPIO_NR(2, 9), 1);
SETUP_IOMUX_PADS(backlight_pads);
 }
@@ -594,6 +595,7 @@ int board_init(void)
else
setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, _i2c_pad_info1);
/* I2C 3 Steer */
+   gpio_request(IMX_GPIO_NR(5, 4), "steer logic");
gpio_direction_output(IMX_GPIO_NR(5, 4), 1);
SETUP_IOMUX_PADS(i2c3_pads);
 #ifndef CONFIG_SYS_FLASH_CFI
@@ -602,6 +604,7 @@ int board_init(void)
else
setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, _i2c_pad_info2);
 #endif
+   gpio_request(IMX_GPIO_NR(1, 15), "expander en");
gpio_direction_output(IMX_GPIO_NR(1, 15), 1);
SETUP_IOMUX_PADS(port_exp);
 
diff --git a/configs/mx6sabreauto_defconfig b/configs/mx6sabreauto_defconfig
index c3843ec..3b37766 100644
--- a/configs/mx6sabreauto_defconfig
+++ b/configs/mx6sabreauto_defconfig
@@ -57,6 +57,7 @@ CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_SPL_DM=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_SF=y
+CONFIG_DM_GPIO=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_NAND=y
-- 
2.7.4

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


[U-Boot] [PATCH v4 17/20] board: mx6sabreauto: Remove the non-DM code

2019-02-01 Thread Abel Vesa
Since the mx6sabreauto has DM support, remove the unused non-DM code
from mx6sabreauto board file.

Signed-off-by: Abel Vesa 
---
 board/freescale/mx6sabreauto/mx6sabreauto.c | 70 -
 1 file changed, 70 deletions(-)

diff --git a/board/freescale/mx6sabreauto/mx6sabreauto.c 
b/board/freescale/mx6sabreauto/mx6sabreauto.c
index c7e3e67..dd72de9 100644
--- a/board/freescale/mx6sabreauto/mx6sabreauto.c
+++ b/board/freescale/mx6sabreauto/mx6sabreauto.c
@@ -159,44 +159,6 @@ static iomux_v3_cfg_t const port_exp[] = {
IOMUX_PADS(PAD_SD2_DAT0__GPIO1_IO15 | MUX_PAD_CTRL(NO_PAD_CTRL)),
 };
 
-/*Define for building port exp gpio, pin starts from 0*/
-#define PORTEXP_IO_NR(chip, pin) \
-   ((chip << 5) + pin)
-
-/*Get the chip addr from a ioexp gpio*/
-#define PORTEXP_IO_TO_CHIP(gpio_nr) \
-   (gpio_nr >> 5)
-
-/*Get the pin number from a ioexp gpio*/
-#define PORTEXP_IO_TO_PIN(gpio_nr) \
-   (gpio_nr & 0x1f)
-
-static int port_exp_direction_output(unsigned gpio, int value)
-{
-   int ret;
-
-   i2c_set_bus_num(2);
-   ret = i2c_probe(PORTEXP_IO_TO_CHIP(gpio));
-   if (ret)
-   return ret;
-
-   ret = pca953x_set_dir(PORTEXP_IO_TO_CHIP(gpio),
-   (1 << PORTEXP_IO_TO_PIN(gpio)),
-   (PCA953X_DIR_OUT << PORTEXP_IO_TO_PIN(gpio)));
-
-   if (ret)
-   return ret;
-
-   ret = pca953x_set_val(PORTEXP_IO_TO_CHIP(gpio),
-   (1 << PORTEXP_IO_TO_PIN(gpio)),
-   (value << PORTEXP_IO_TO_PIN(gpio)));
-
-   if (ret)
-   return ret;
-
-   return 0;
-}
-
 #ifdef CONFIG_MTD_NOR_FLASH
 static iomux_v3_cfg_t const eimnor_pads[] = {
IOMUX_PADS(PAD_EIM_D16__EIM_DATA16  | 
MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL)),
@@ -681,19 +643,10 @@ int checkboard(void)
 }
 
 #ifdef CONFIG_USB_EHCI_MX6
-#define USB_HOST1_PWR PORTEXP_IO_NR(0x32, 7)
-#define USB_OTG_PWR   PORTEXP_IO_NR(0x34, 1)
-
-iomux_v3_cfg_t const usb_otg_pads[] = {
-   IOMUX_PADS(PAD_ENET_RX_ER__USB_OTG_ID | MUX_PAD_CTRL(NO_PAD_CTRL)),
-};
-
 int board_ehci_hcd_init(int port)
 {
switch (port) {
case 0:
-   SETUP_IOMUX_PADS(usb_otg_pads);
-
/*
  * Set daisy chain for otg_pin_id on 6q.
 *  For 6dl, this bit is reserved.
@@ -708,29 +661,6 @@ int board_ehci_hcd_init(int port)
}
return 0;
 }
-
-int board_ehci_power(int port, int on)
-{
-   switch (port) {
-   case 0:
-   if (on)
-   port_exp_direction_output(USB_OTG_PWR, 1);
-   else
-   port_exp_direction_output(USB_OTG_PWR, 0);
-   break;
-   case 1:
-   if (on)
-   port_exp_direction_output(USB_HOST1_PWR, 1);
-   else
-   port_exp_direction_output(USB_HOST1_PWR, 0);
-   break;
-   default:
-   printf("MXC USB port %d not yet supported\n", port);
-   return -EINVAL;
-   }
-
-   return 0;
-}
 #endif
 
 #ifdef CONFIG_SPL_BUILD
-- 
2.7.4

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


[U-Boot] [PATCH v4 16/20] configs: mx6sabresd: Add DM_SPI_FLASH necessary configs

2019-02-01 Thread Abel Vesa
Enable all neceassary configs to support DM_SPI_FLASH on mx6sabresd.

Signed-off-by: Abel Vesa 
Reviewed-by: Peng Fan 
---
 configs/mx6sabresd_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configs/mx6sabresd_defconfig b/configs/mx6sabresd_defconfig
index 4b40dfe..e8fd9b4 100644
--- a/configs/mx6sabresd_defconfig
+++ b/configs/mx6sabresd_defconfig
@@ -71,6 +71,7 @@ CONFIG_FASTBOOT_FLASH_MMC_DEV=2
 CONFIG_DM_GPIO=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
@@ -78,6 +79,7 @@ CONFIG_MII=y
 CONFIG_PCI=y
 CONFIG_DM_REGULATOR=y
 CONFIG_SPI=y
+CONFIG_DM_SPI=y
 CONFIG_MXC_SPI=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
-- 
2.7.4

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


[U-Boot] [PATCH v4 14/20] mx6sabresd: Add DM_GPIO support

2019-02-01 Thread Abel Vesa
Add the DM_GPIO related config for mx6sabresd.
Also add the gpio request calls.

Signed-off-by: Abel Vesa 
Reviewed-by: Peng Fan 
---
 board/freescale/mx6sabresd/mx6sabresd.c | 5 +
 configs/mx6sabresd_defconfig| 1 +
 2 files changed, 6 insertions(+)

diff --git a/board/freescale/mx6sabresd/mx6sabresd.c 
b/board/freescale/mx6sabresd/mx6sabresd.c
index 4688095..99002bd 100644
--- a/board/freescale/mx6sabresd/mx6sabresd.c
+++ b/board/freescale/mx6sabresd/mx6sabresd.c
@@ -96,6 +96,7 @@ static void setup_iomux_enet(void)
SETUP_IOMUX_PADS(enet_pads);
 
/* Reset AR8031 PHY */
+   gpio_request(IMX_GPIO_NR(1, 25), "ENET PHY Reset");
gpio_direction_output(IMX_GPIO_NR(1, 25) , 0);
mdelay(10);
gpio_set_value(IMX_GPIO_NR(1, 25), 1);
@@ -189,6 +190,7 @@ static iomux_v3_cfg_t const bl_pads[] = {
 static void enable_backlight(void)
 {
SETUP_IOMUX_PADS(bl_pads);
+   gpio_request(DISP0_PWR_EN, "Display Power Enable");
gpio_direction_output(DISP0_PWR_EN, 1);
 }
 
@@ -307,11 +309,13 @@ int board_mmc_init(bd_t *bis)
switch (i) {
case 0:
SETUP_IOMUX_PADS(usdhc2_pads);
+   gpio_request(USDHC2_CD_GPIO, "USDHC2 CD");
gpio_direction_input(USDHC2_CD_GPIO);
usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK);
break;
case 1:
SETUP_IOMUX_PADS(usdhc3_pads);
+   gpio_request(USDHC3_CD_GPIO, "USDHC3 CD");
gpio_direction_input(USDHC3_CD_GPIO);
usdhc_cfg[1].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK);
break;
@@ -729,6 +733,7 @@ int checkboard(void)
 #ifdef CONFIG_SPL_OS_BOOT
 int spl_start_uboot(void)
 {
+   gpio_request(KEY_VOL_UP, "KEY Volume UP");
gpio_direction_input(KEY_VOL_UP);
 
/* Only enter in Falcon mode if KEY_VOL_UP is pressed */
diff --git a/configs/mx6sabresd_defconfig b/configs/mx6sabresd_defconfig
index 0e35d6c..4b40dfe 100644
--- a/configs/mx6sabresd_defconfig
+++ b/configs/mx6sabresd_defconfig
@@ -68,6 +68,7 @@ CONFIG_FASTBOOT_BUF_ADDR=0x1200
 CONFIG_FASTBOOT_BUF_SIZE=0x1000
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=2
+CONFIG_DM_GPIO=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_SPI_FLASH=y
-- 
2.7.4

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


[U-Boot] [PATCH v4 09/20] arm: dts: Add all the imx6[q|qp|dl] sabre[auto|sd] u-boot dts[i] files

2019-02-01 Thread Abel Vesa
This allows us to keep the basic dts[i] files up-to-date with
the ones in kernel, but at the same time allowing the u-boot
to add its own properties to the existing nodes.

Signed-off-by: Abel Vesa 
---
 arch/arm/dts/imx6dl-sabreauto-u-boot.dtsi  |  6 ++
 arch/arm/dts/imx6dl-sabresd-u-boot.dtsi|  6 ++
 arch/arm/dts/imx6q-sabreauto-u-boot.dtsi   |  6 ++
 arch/arm/dts/imx6q-sabresd-u-boot.dtsi |  6 ++
 arch/arm/dts/imx6qdl-sabreauto-u-boot.dtsi | 21 +
 arch/arm/dts/imx6qdl-sabresd-u-boot.dtsi   | 14 ++
 arch/arm/dts/imx6qdl-u-boot.dtsi   |  4 ++--
 arch/arm/dts/imx6qp-sabreauto-u-boot.dtsi  |  6 ++
 arch/arm/dts/imx6qp-sabresd-u-boot.dtsi|  6 ++
 9 files changed, 73 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/dts/imx6dl-sabreauto-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6dl-sabresd-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6q-sabreauto-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6q-sabresd-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6qdl-sabreauto-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6qdl-sabresd-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6qp-sabreauto-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6qp-sabresd-u-boot.dtsi

diff --git a/arch/arm/dts/imx6dl-sabreauto-u-boot.dtsi 
b/arch/arm/dts/imx6dl-sabreauto-u-boot.dtsi
new file mode 100644
index 000..d75fcc1
--- /dev/null
+++ b/arch/arm/dts/imx6dl-sabreauto-u-boot.dtsi
@@ -0,0 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 NXP
+ */
+
+#include "imx6qdl-sabreauto-u-boot.dtsi"
diff --git a/arch/arm/dts/imx6dl-sabresd-u-boot.dtsi 
b/arch/arm/dts/imx6dl-sabresd-u-boot.dtsi
new file mode 100644
index 000..e4d7d28
--- /dev/null
+++ b/arch/arm/dts/imx6dl-sabresd-u-boot.dtsi
@@ -0,0 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 NXP
+ */
+
+#include "imx6qdl-sabresd-u-boot.dtsi"
diff --git a/arch/arm/dts/imx6q-sabreauto-u-boot.dtsi 
b/arch/arm/dts/imx6q-sabreauto-u-boot.dtsi
new file mode 100644
index 000..d75fcc1
--- /dev/null
+++ b/arch/arm/dts/imx6q-sabreauto-u-boot.dtsi
@@ -0,0 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 NXP
+ */
+
+#include "imx6qdl-sabreauto-u-boot.dtsi"
diff --git a/arch/arm/dts/imx6q-sabresd-u-boot.dtsi 
b/arch/arm/dts/imx6q-sabresd-u-boot.dtsi
new file mode 100644
index 000..e4d7d28
--- /dev/null
+++ b/arch/arm/dts/imx6q-sabresd-u-boot.dtsi
@@ -0,0 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 NXP
+ */
+
+#include "imx6qdl-sabresd-u-boot.dtsi"
diff --git a/arch/arm/dts/imx6qdl-sabreauto-u-boot.dtsi 
b/arch/arm/dts/imx6qdl-sabreauto-u-boot.dtsi
new file mode 100644
index 000..ea90f40
--- /dev/null
+++ b/arch/arm/dts/imx6qdl-sabreauto-u-boot.dtsi
@@ -0,0 +1,21 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 NXP
+ */
+
+#include "imx6qdl-u-boot.dtsi"
+
+/ {
+   aliases {
+   mmc0 = 
+   };
+};
+
+ {
+   no-1-8-v;
+   u-boot,dm-spl;
+};
+
+_usdhc3 {
+   u-boot,dm-spl;
+};
diff --git a/arch/arm/dts/imx6qdl-sabresd-u-boot.dtsi 
b/arch/arm/dts/imx6qdl-sabresd-u-boot.dtsi
new file mode 100644
index 000..45f02b1
--- /dev/null
+++ b/arch/arm/dts/imx6qdl-sabresd-u-boot.dtsi
@@ -0,0 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 NXP
+ */
+
+#include "imx6qdl-u-boot.dtsi"
+
+ {
+   u-boot,dm-spl;
+};
+
+_usdhc3 {
+   u-boot,dm-spl;
+};
diff --git a/arch/arm/dts/imx6qdl-u-boot.dtsi b/arch/arm/dts/imx6qdl-u-boot.dtsi
index dffc21b..45ae2fa 100644
--- a/arch/arm/dts/imx6qdl-u-boot.dtsi
+++ b/arch/arm/dts/imx6qdl-u-boot.dtsi
@@ -7,11 +7,11 @@
soc {
u-boot,dm-spl;
 
-   aips-bus@0200 {
+   aips-bus@200 {
u-boot,dm-spl;
};
 
-   aips-bus@0210 {
+   aips-bus@210 {
u-boot,dm-spl;
};
};
diff --git a/arch/arm/dts/imx6qp-sabreauto-u-boot.dtsi 
b/arch/arm/dts/imx6qp-sabreauto-u-boot.dtsi
new file mode 100644
index 000..d75fcc1
--- /dev/null
+++ b/arch/arm/dts/imx6qp-sabreauto-u-boot.dtsi
@@ -0,0 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 NXP
+ */
+
+#include "imx6qdl-sabreauto-u-boot.dtsi"
diff --git a/arch/arm/dts/imx6qp-sabresd-u-boot.dtsi 
b/arch/arm/dts/imx6qp-sabresd-u-boot.dtsi
new file mode 100644
index 000..e4d7d28
--- /dev/null
+++ b/arch/arm/dts/imx6qp-sabresd-u-boot.dtsi
@@ -0,0 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 NXP
+ */
+
+#include "imx6qdl-sabresd-u-boot.dtsi"
-- 
2.7.4

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


[U-Boot] [PATCH v4 06/20] mmc: fsl_esdhc: Fix DM_REGULATOR ifdefs for SPL builds

2019-02-01 Thread Abel Vesa
Since the fsl_esdhc will also be used by SPL, make the
preprocessor switches more generic to allow any kind of build.

Signed-off-by: Abel Vesa 
---
 drivers/mmc/fsl_esdhc.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
index 21fa2ab..9e34557 100644
--- a/drivers/mmc/fsl_esdhc.c
+++ b/drivers/mmc/fsl_esdhc.c
@@ -804,7 +804,7 @@ static int esdhc_set_voltage(struct mmc *mmc)
case MMC_SIGNAL_VOLTAGE_330:
if (priv->vs18_enable)
return -EIO;
-#ifdef CONFIG_DM_REGULATOR
+#if CONFIG_IS_ENABLED(DM_REGULATOR)
if (!IS_ERR_OR_NULL(priv->vqmmc_dev)) {
ret = regulator_set_value(priv->vqmmc_dev, 330);
if (ret) {
@@ -823,7 +823,7 @@ static int esdhc_set_voltage(struct mmc *mmc)
 
return -EAGAIN;
case MMC_SIGNAL_VOLTAGE_180:
-#ifdef CONFIG_DM_REGULATOR
+#if CONFIG_IS_ENABLED(DM_REGULATOR)
if (!IS_ERR_OR_NULL(priv->vqmmc_dev)) {
ret = regulator_set_value(priv->vqmmc_dev, 180);
if (ret) {
@@ -1442,7 +1442,7 @@ static int fsl_esdhc_probe(struct udevice *dev)
int node = dev_of_offset(dev);
struct esdhc_soc_data *data =
(struct esdhc_soc_data *)dev_get_driver_data(dev);
-#ifdef CONFIG_DM_REGULATOR
+#if CONFIG_IS_ENABLED(DM_REGULATOR)
struct udevice *vqmmc_dev;
 #endif
fdt_addr_t addr;
@@ -1500,7 +1500,7 @@ static int fsl_esdhc_probe(struct udevice *dev)
 
priv->vs18_enable = 0;
 
-#ifdef CONFIG_DM_REGULATOR
+#if CONFIG_IS_ENABLED(DM_REGULATOR)
/*
 * If emmc I/O has a fixed voltage at 1.8V, this must be provided,
 * otherwise, emmc will work abnormally.
-- 
2.7.4

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


[U-Boot] [PATCH v4 05/20] configs: imx6sabreauto: Add DM_USB support

2019-02-01 Thread Abel Vesa
Add the DM support for USB. For that, DM_REGULATOR is needed.

Signed-off-by: Abel Vesa 
---
 configs/mx6sabreauto_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configs/mx6sabreauto_defconfig b/configs/mx6sabreauto_defconfig
index a3d63a2..4bdcbb1 100644
--- a/configs/mx6sabreauto_defconfig
+++ b/configs/mx6sabreauto_defconfig
@@ -52,9 +52,11 @@ CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
 CONFIG_MII=y
+CONFIG_DM_REGULATOR=y
 CONFIG_SPI=y
 CONFIG_MXC_SPI=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="FSL"
-- 
2.7.4

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


[U-Boot] [PATCH v4 12/20] configs: mx6sabresd: Add SPL FIT and DM support

2019-02-01 Thread Abel Vesa
Enable all the necessary configs for SPL DM and FIT support for
mx6sabresd.

Signed-off-by: Abel Vesa 
---
 configs/mx6sabresd_defconfig | 20 ++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/configs/mx6sabresd_defconfig b/configs/mx6sabresd_defconfig
index 3babfd5..0e35d6c 100644
--- a/configs/mx6sabresd_defconfig
+++ b/configs/mx6sabresd_defconfig
@@ -10,12 +10,18 @@ CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_NR_DRAM_BANKS=1
+# CONFIG_SYS_MALLOC_F is not set
+CONFIG_FIT=y
+CONFIG_SPL_FIT_PRINT=y
+CONFIG_SPL_LOAD_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_BOUNCE_BUFFER=y
+CONFIG_SPL_SEPARATE_BSS=y
+CONFIG_SPL_FIT_IMAGE_TINY=y
 CONFIG_SPL_EXT_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
@@ -47,23 +53,34 @@ CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_EFI_PARTITION=y
+CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="imx6q-sabresd"
+CONFIG_OF_LIST="imx6q-sabresd imx6qp-sabresd imx6dl-sabresd"
+CONFIG_MULTI_DTB_FIT=y
+CONFIG_SPL_MULTI_DTB_FIT=y
+CONFIG_SPL_OF_LIST="imx6dl-sabresd imx6q-sabresd imx6qp-sabresd"
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
+CONFIG_SPL_DM=y
 CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x1200
 CONFIG_FASTBOOT_BUF_SIZE=0x1000
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=2
+CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
 CONFIG_MII=y
 CONFIG_PCI=y
+CONFIG_DM_REGULATOR=y
 CONFIG_SPI=y
 CONFIG_MXC_SPI=y
 CONFIG_USB=y
-CONFIG_USB_STORAGE=y
+CONFIG_DM_USB=y
+# CONFIG_SPL_DM_USB is not set
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="FSL"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0525
@@ -73,4 +90,3 @@ CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
-CONFIG_OF_LIBFDT=y
-- 
2.7.4

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


[U-Boot] [PATCH v4 00/20] mx6sabre: Add DM and SPL FIT support

2019-02-01 Thread Abel Vesa
The third version is here:
https://lists.denx.de/pipermail/u-boot/2019-January/356903.html

So, this time I hope I got it right. Before, I was stupidly trying
to put a fit in another fit without a really good reason. To my
excuse, that was working even with the spl_image->os set to 0,
bug which I (hope) I fixed in the first patch (a new one)
of this series.

Changes since v3:
 * Reduced the SPL size by disabling EXT_SUPPORT, otherwise the
   6qp-sabresd wouldn't boot due to having its dtb last in the fit.
   I forgot to mention in the last version that EFI and DOS SPL support
   also had to be disabled to get the size right.
 * Dropped the fit_spl.its file
 * Dropped the (now) unnecessary updates to the README files. We're
   sticking to the u-boot.img since it's exactly what is needed.
 * Fixed a bug related to FIT_IMAGE_TINY when CONFIG_SPL_OS_BOOT
   is enabled. The short story here is that spl_image->os was
   remaining set to 0. (see first patch in the series for details)


Abel Vesa (20):
  common: spl_fit: Fix the spl_fit_image_get_os for FIT_IMAGE_TINY
  usb: Rename SPL_USB_SUPPORT to SPL_USB_STORAGE
  usb: ehci-mx6: Make regulator DM_REGULATOR dependent
  configs: imx6sabreauto: Add DM_MMC support
  configs: imx6sabreauto: Add DM_USB support
  mmc: fsl_esdhc: Fix DM_REGULATOR ifdefs for SPL builds
  board: mx6sabresd: Add board_fit_config_name_match to support FIT in
SPL
  board: mx6sabreauto: Add board_fit_config_name_match to support FIT in
SPL
  arm: dts: Add all the imx6[q|qp|dl] sabre[auto|sd] u-boot dts[i] files
  arm: dts: Update all the dts[i] files for imx6[q|qp|dl] sabre[auto|sd]
  configs: mx6sabreauto: Add SPL FIT and DM support
  configs: mx6sabresd: Add SPL FIT and DM support
  mx6sabreauto: Add DM_GPIO support
  mx6sabresd: Add DM_GPIO support
  configs: mx6sabreauto: Add DM_SPI_FLASH necessary configs
  configs: mx6sabresd: Add DM_SPI_FLASH necessary configs
  board: mx6sabreauto: Remove the non-DM code
  board: mx6sabresd: Remove non-DM code
  board: mx6sabresd: Remove the enet reset gpio handling
  configs: mx6sabresd: Reduce SPL size by disabling DOS, EXT and EFI
support

 arch/arm/dts/Makefile   |   8 +-
 arch/arm/dts/imx6dl-sabreauto-u-boot.dtsi   |   6 +
 arch/arm/dts/imx6dl-sabreauto.dts   |  13 +
 arch/arm/dts/imx6dl-sabresd-u-boot.dtsi |   6 +
 arch/arm/dts/imx6dl-sabresd.dts |  18 +
 arch/arm/dts/imx6dl.dtsi| 306 ++-
 arch/arm/dts/imx6q-sabreauto-u-boot.dtsi|   6 +
 arch/arm/dts/imx6q-sabreauto.dts|  18 +
 arch/arm/dts/imx6q-sabresd-u-boot.dtsi  |   6 +
 arch/arm/dts/imx6q-sabresd.dts  |  23 +
 arch/arm/dts/imx6q.dtsi | 310 +--
 arch/arm/dts/imx6qdl-sabreauto-u-boot.dtsi  |  21 +
 arch/arm/dts/imx6qdl-sabreauto.dtsi | 810 
 arch/arm/dts/imx6qdl-sabresd-u-boot.dtsi|  14 +
 arch/arm/dts/imx6qdl-sabresd.dtsi   | 741 +
 arch/arm/dts/imx6qdl-u-boot.dtsi|   4 +-
 arch/arm/dts/imx6qdl.dtsi   | 455 +---
 arch/arm/dts/imx6qp-sabreauto-u-boot.dtsi   |   6 +
 arch/arm/dts/imx6qp-sabreauto.dts   |  55 ++
 arch/arm/dts/imx6qp-sabresd-u-boot.dtsi |   6 +
 arch/arm/dts/imx6qp-sabresd.dts |  55 ++
 arch/arm/dts/imx6qp.dtsi| 115 
 arch/arm/include/asm/arch-am33xx/spl.h  |   2 +-
 arch/arm/mach-omap2/boot-common.c   |   2 +-
 board/freescale/mx6sabreauto/mx6sabreauto.c |  91 +---
 board/freescale/mx6sabresd/mx6sabresd.c |  78 +--
 common/Makefile |   5 +-
 common/spl/Kconfig  |   4 +-
 common/spl/Makefile |   2 +-
 common/spl/spl_fit.c|   4 -
 common/spl/spl_usb.c|   4 -
 configs/am43xx_evm_usbhost_boot_defconfig   |   2 +-
 configs/am43xx_hs_evm_defconfig |   2 +-
 configs/mx6sabreauto_defconfig  |  20 +-
 configs/mx6sabresd_defconfig|  26 +-
 drivers/mmc/fsl_esdhc.c |   8 +-
 drivers/usb/host/ehci-mx6.c |   7 +-
 37 files changed, 2847 insertions(+), 412 deletions(-)
 create mode 100644 arch/arm/dts/imx6dl-sabreauto-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6dl-sabreauto.dts
 create mode 100644 arch/arm/dts/imx6dl-sabresd-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6dl-sabresd.dts
 create mode 100644 arch/arm/dts/imx6q-sabreauto-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6q-sabreauto.dts
 create mode 100644 arch/arm/dts/imx6q-sabresd-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6q-sabresd.dts
 create mode 100644 arch/arm/dts/imx6qdl-sabreauto-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6qdl-sabreauto.dtsi
 create mode 100644 arch/arm/dts/imx6qdl-sabresd-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6qdl-sabresd.dtsi
 create mode 100644 arch/a

Re: [U-Boot] [PATCH v3 00/22] mx6sabre: Add DM and SPL FIT support

2019-01-31 Thread Abel Vesa
On 19-01-31 09:41:11, Tom Rini wrote:
> On Thu, Jan 31, 2019 at 12:59:19PM +0000, Abel Vesa wrote:
> > On 19-01-30 13:58:19, Tom Rini wrote:
> > > On Wed, Jan 30, 2019 at 01:39:50PM +, Abel Vesa wrote:
> > > 
> > > > The second version is here:
> > > > https://lists.denx.de/pipermail/u-boot/2019-January/356557.html
> > > > 
> > > > Changes since v2:
> > > >  * Removed the unecessary SYS_MALLOC_F_LEN from both defocnfig
> > > >  * Fixed the copyright for all the *u-boot.dtsi files
> > > 
> > > OK, but you didn't answer why you need to specify your own its file when
> > > the TI examples show how to have mkimage generate this for you, thanks!
> > > 
> > 
> > I might be wrong here but TI is doing this for MLO, which AFAIU, it's for
> > SPL. The fit_spl.its I'm adding here is actually for u-boot proper.
> > 
> > SPL expects descriptions in the configurations and that can't be done
> > without its file, again, AFAIK.
> > 
> > Please let me know what exactly am I missing here.
> 
> The flag to mkimage is not about SPL but rather "create a single
> configurations its file on the fly".  This should also be fine for the
> its file in patch 10/22 (of v2, don't have v3 in front of me in
> patchwork).
> 

Well, I tried something like this (manually):

$ ./tools/mkimage -f auto -C none -A ARM -T standalone -a 0x1780 -e 
0x1780 -d u-boot-fit-dtb.bin -n "U-Boot" u-boot.itb -E

and the output was:

FIT description: Standalone Program image with one or more FDT blobs
  
Created: Thu Jan 31 13:58:01 2019   
  
 Image 0 (standalone-1) 
  
  Description:  U-Boot  
  
  Created:  Thu Jan 31 13:58:01 2019
  
  Type: Standalone Program  
  
  Compression:  uncompressed
  
  Data Size:646400 Bytes = 631.25 KiB = 0.62 MiB
  
  Architecture: ARM 
  
  Load Address: 0x1780  
  
  Entry Point:  0x1780  
  
 Default Configuration: 'conf-1'
  
 Configuration 0 (conf-1)   
  
  Description:  unavailable 
  
  Kernel:   unavailable 
  

And then the SPL complains about the configuration description:

U-Boot SPL 2019.01-00374-gbe79a83 (Jan 31 2019 - 13:56:01 +0200)
Trying to boot from MMC1
fit_find_config_node: Missing FDT description in DTB
No matching DT out of these options:
   Firmware image with one or more FDT blobs
fit_find_config_node: Missing FDT description in DTB
No matching DT out of these options:
   Firmware image with one or more FDT blobs
fit_find_config_node: Missing FDT description in DTB
No matching DT out of these options:
   Firmware image with one or more FDT blobs
mmc_load_image_raw_sector: mmc block read error
spl: no partition table found
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

But with the fit_spl.its file I added I have this and works:

FIT description: Image for u-boot proper (with dtb appended)
Created: Thu Jan 31 13:57:02 2019   
 Image 0 (uboot@1)  
  Description:  U-Boot  
  Created:  Thu Jan 31 13:57:02 2019
  Type: Standalone Program  
  Compression:  uncompressed
  Data Size:646400 Bytes = 631.25 KiB = 0.62 MiB
  Architecture: ARM 
  Load Address: 0x1780  
  Entry Point:  unavailable 
 Default Configuration: 'conf@1'
 Configuration 0 (conf@1)   
  Description:  i.MX armv7  
  Kernel:   unavailable 
  Loadables:uboot@1 

So the differences between this and the one generated with mkimage+flags
are the loadables and the description in the configuration 0.

Can I specify those through flags ?

> -- 
> Tom

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


Re: [U-Boot] [PATCH v3 00/22] mx6sabre: Add DM and SPL FIT support

2019-01-31 Thread Abel Vesa
On 19-01-30 13:58:19, Tom Rini wrote:
> On Wed, Jan 30, 2019 at 01:39:50PM +0000, Abel Vesa wrote:
> 
> > The second version is here:
> > https://lists.denx.de/pipermail/u-boot/2019-January/356557.html
> > 
> > Changes since v2:
> >  * Removed the unecessary SYS_MALLOC_F_LEN from both defocnfig
> >  * Fixed the copyright for all the *u-boot.dtsi files
> 
> OK, but you didn't answer why you need to specify your own its file when
> the TI examples show how to have mkimage generate this for you, thanks!
> 

I might be wrong here but TI is doing this for MLO, which AFAIU, it's for
SPL. The fit_spl.its I'm adding here is actually for u-boot proper.

SPL expects descriptions in the configurations and that can't be done
without its file, again, AFAIK.

Please let me know what exactly am I missing here.

> -- 
> Tom

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


[U-Boot] [PATCH v3 21/22] board: mx6sabreauto: Update README with the SPL DM FIT info

2019-01-30 Thread Abel Vesa
There is a new step now. The need to build the u-boot.itb.
And instead of flashing the .img file, now the .itb file needs
to be flashed.

Signed-off-by: Abel Vesa 
---
 board/freescale/mx6sabreauto/README | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/board/freescale/mx6sabreauto/README 
b/board/freescale/mx6sabreauto/README
index e8c589b..960a7d7 100644
--- a/board/freescale/mx6sabreauto/README
+++ b/board/freescale/mx6sabreauto/README
@@ -8,6 +8,7 @@ In order to build it:
 $ make mx6sabreauto_defconfig
 
 $ make
+$ make u-boot.itb
 
 This will generate the SPL and u-boot.img binaries.
 
@@ -17,7 +18,7 @@ $ sudo dd if=SPL of=/dev/sdX bs=1K seek=1 && sync
 
 - Flash the u-boot.img binary into the SD card:
 
-$ sudo dd if=u-boot.img of=/dev/sdX bs=1K seek=69 && sync
+$ sudo dd if=u-boot.itb of=/dev/sdX bs=1K seek=69 && sync
 
 Booting via Falcon mode
 ---
@@ -31,6 +32,7 @@ In order to build it:
 $ make mx6sabreauto_defconfig
 
 $ make
+$ make u-boot.itb
 
 This will generate the SPL image called SPL and the u-boot.img.
 
@@ -40,7 +42,7 @@ $ sudo dd if=SPL of=/dev/sdb bs=1K seek=1 && sync
 
 - Flash the u-boot.img image into the SD card:
 
-$ sudo dd if=u-boot.img of=/dev/sdb bs=1K seek=69 && sync
+$ sudo dd if=u-boot.itb of=/dev/sdb bs=1K seek=69 && sync
 
 Create a FAT16 boot partition to store uImage and the dtb file, then copy the 
files there:
 
-- 
2.7.4

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


[U-Boot] [PATCH v3 13/22] mx6sabreauto: Add DM_GPIO support

2019-01-30 Thread Abel Vesa
Add the DM_GPIO related config for mx6sabreauto.
Also add the gpio request calls.

Signed-off-by: Abel Vesa 
Reviewed-by: Peng Fan 
---
 board/freescale/mx6sabreauto/mx6sabreauto.c | 3 +++
 configs/mx6sabreauto_defconfig  | 1 +
 2 files changed, 4 insertions(+)

diff --git a/board/freescale/mx6sabreauto/mx6sabreauto.c 
b/board/freescale/mx6sabreauto/mx6sabreauto.c
index c8f1263..c7e3e67 100644
--- a/board/freescale/mx6sabreauto/mx6sabreauto.c
+++ b/board/freescale/mx6sabreauto/mx6sabreauto.c
@@ -501,6 +501,7 @@ iomux_v3_cfg_t const backlight_pads[] = {
 
 static void setup_iomux_backlight(void)
 {
+   gpio_request(IMX_GPIO_NR(2, 9), "backlight");
gpio_direction_output(IMX_GPIO_NR(2, 9), 1);
SETUP_IOMUX_PADS(backlight_pads);
 }
@@ -594,6 +595,7 @@ int board_init(void)
else
setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, _i2c_pad_info1);
/* I2C 3 Steer */
+   gpio_request(IMX_GPIO_NR(5, 4), "steer logic");
gpio_direction_output(IMX_GPIO_NR(5, 4), 1);
SETUP_IOMUX_PADS(i2c3_pads);
 #ifndef CONFIG_SYS_FLASH_CFI
@@ -602,6 +604,7 @@ int board_init(void)
else
setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, _i2c_pad_info2);
 #endif
+   gpio_request(IMX_GPIO_NR(1, 15), "expander en");
gpio_direction_output(IMX_GPIO_NR(1, 15), 1);
SETUP_IOMUX_PADS(port_exp);
 
diff --git a/configs/mx6sabreauto_defconfig b/configs/mx6sabreauto_defconfig
index 6a4d3a4..31e8153 100644
--- a/configs/mx6sabreauto_defconfig
+++ b/configs/mx6sabreauto_defconfig
@@ -58,6 +58,7 @@ CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_SPL_DM=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_SF=y
+CONFIG_DM_GPIO=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_NAND=y
-- 
2.7.4

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


[U-Boot] [PATCH v3 19/22] board: mx6sabresd: Remove the enet reset gpio handling

2019-01-30 Thread Abel Vesa
Rely on the phy-reset-gpios which is set in imx6qdl-sabresd dtsi
and get rid of the enet reset gpio handling from the board file.

Signed-off-by: Abel Vesa 
---
 board/freescale/mx6sabresd/mx6sabresd.c | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/board/freescale/mx6sabresd/mx6sabresd.c 
b/board/freescale/mx6sabresd/mx6sabresd.c
index 0824a05..385a18e 100644
--- a/board/freescale/mx6sabresd/mx6sabresd.c
+++ b/board/freescale/mx6sabresd/mx6sabresd.c
@@ -94,13 +94,6 @@ static iomux_v3_cfg_t const enet_pads[] = {
 static void setup_iomux_enet(void)
 {
SETUP_IOMUX_PADS(enet_pads);
-
-   /* Reset AR8031 PHY */
-   gpio_request(IMX_GPIO_NR(1, 25), "ENET PHY Reset");
-   gpio_direction_output(IMX_GPIO_NR(1, 25) , 0);
-   mdelay(10);
-   gpio_set_value(IMX_GPIO_NR(1, 25), 1);
-   udelay(100);
 }
 
 static iomux_v3_cfg_t const usdhc2_pads[] = {
-- 
2.7.4

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


[U-Boot] [PATCH v3 20/22] configs: mx6sabresd: Reduce size for SPL by disabling SPL_DOS and SPL_EFI

2019-01-30 Thread Abel Vesa
With DM and FIT enabled in SPL, there is an sram overflow.
By disabling CONFIG_SPL_DOS_PARTITION and CONFIG_SPL_EFI_PARTITION,
we get to keep the 'one binary to fit all' for imx6[q|qp|dl]
on sabresd since the final SPL image is now under 64KB.

Signed-off-by: Abel Vesa 
---
 configs/mx6sabresd_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configs/mx6sabresd_defconfig b/configs/mx6sabresd_defconfig
index b26e764..84840fe 100644
--- a/configs/mx6sabresd_defconfig
+++ b/configs/mx6sabresd_defconfig
@@ -54,6 +54,8 @@ CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_EFI_PARTITION=y
+# CONFIG_SPL_DOS_PARTITION is not set
+# CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_OF_CONTROL=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="imx6q-sabresd"
-- 
2.7.4

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


[U-Boot] [PATCH v3 18/22] board: mx6sabresd: Remove non-DM code

2019-01-30 Thread Abel Vesa
Since the mx6sabreauto has DM support, remove the unused non-DM code
from mx6sabresd board file.

Signed-off-by: Abel Vesa 
---
 board/freescale/mx6sabresd/mx6sabresd.c | 50 -
 1 file changed, 50 deletions(-)

diff --git a/board/freescale/mx6sabresd/mx6sabresd.c 
b/board/freescale/mx6sabresd/mx6sabresd.c
index 99002bd..0824a05 100644
--- a/board/freescale/mx6sabresd/mx6sabresd.c
+++ b/board/freescale/mx6sabresd/mx6sabresd.c
@@ -563,63 +563,13 @@ int board_eth_init(bd_t *bis)
 }
 
 #ifdef CONFIG_USB_EHCI_MX6
-#define USB_OTHERREGS_OFFSET   0x800
-#define UCTRL_PWR_POL  (1 << 9)
-
-static iomux_v3_cfg_t const usb_otg_pads[] = {
-   IOMUX_PADS(PAD_EIM_D22__USB_OTG_PWR | MUX_PAD_CTRL(NO_PAD_CTRL)),
-   IOMUX_PADS(PAD_ENET_RX_ER__USB_OTG_ID | MUX_PAD_CTRL(NO_PAD_CTRL)),
-};
-
-static iomux_v3_cfg_t const usb_hc1_pads[] = {
-   IOMUX_PADS(PAD_ENET_TXD1__GPIO1_IO29 | MUX_PAD_CTRL(NO_PAD_CTRL)),
-};
-
 static void setup_usb(void)
 {
-   SETUP_IOMUX_PADS(usb_otg_pads);
-
/*
 * set daisy chain for otg_pin_id on 6q.
 * for 6dl, this bit is reserved
 */
imx_iomux_set_gpr_register(1, 13, 1, 0);
-
-   SETUP_IOMUX_PADS(usb_hc1_pads);
-}
-
-int board_ehci_hcd_init(int port)
-{
-   u32 *usbnc_usb_ctrl;
-
-   if (port > 1)
-   return -EINVAL;
-
-   usbnc_usb_ctrl = (u32 *)(USB_BASE_ADDR + USB_OTHERREGS_OFFSET +
-port * 4);
-
-   setbits_le32(usbnc_usb_ctrl, UCTRL_PWR_POL);
-
-   return 0;
-}
-
-int board_ehci_power(int port, int on)
-{
-   switch (port) {
-   case 0:
-   break;
-   case 1:
-   if (on)
-   gpio_direction_output(IMX_GPIO_NR(1, 29), 1);
-   else
-   gpio_direction_output(IMX_GPIO_NR(1, 29), 0);
-   break;
-   default:
-   printf("MXC USB port %d not yet supported\n", port);
-   return -EINVAL;
-   }
-
-   return 0;
 }
 #endif
 
-- 
2.7.4

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


[U-Boot] [PATCH v3 14/22] mx6sabresd: Add DM_GPIO support

2019-01-30 Thread Abel Vesa
Add the DM_GPIO related config for mx6sabresd.
Also add the gpio request calls.

Signed-off-by: Abel Vesa 
Reviewed-by: Peng Fan 
---
 board/freescale/mx6sabresd/mx6sabresd.c | 5 +
 configs/mx6sabresd_defconfig| 1 +
 2 files changed, 6 insertions(+)

diff --git a/board/freescale/mx6sabresd/mx6sabresd.c 
b/board/freescale/mx6sabresd/mx6sabresd.c
index 4688095..99002bd 100644
--- a/board/freescale/mx6sabresd/mx6sabresd.c
+++ b/board/freescale/mx6sabresd/mx6sabresd.c
@@ -96,6 +96,7 @@ static void setup_iomux_enet(void)
SETUP_IOMUX_PADS(enet_pads);
 
/* Reset AR8031 PHY */
+   gpio_request(IMX_GPIO_NR(1, 25), "ENET PHY Reset");
gpio_direction_output(IMX_GPIO_NR(1, 25) , 0);
mdelay(10);
gpio_set_value(IMX_GPIO_NR(1, 25), 1);
@@ -189,6 +190,7 @@ static iomux_v3_cfg_t const bl_pads[] = {
 static void enable_backlight(void)
 {
SETUP_IOMUX_PADS(bl_pads);
+   gpio_request(DISP0_PWR_EN, "Display Power Enable");
gpio_direction_output(DISP0_PWR_EN, 1);
 }
 
@@ -307,11 +309,13 @@ int board_mmc_init(bd_t *bis)
switch (i) {
case 0:
SETUP_IOMUX_PADS(usdhc2_pads);
+   gpio_request(USDHC2_CD_GPIO, "USDHC2 CD");
gpio_direction_input(USDHC2_CD_GPIO);
usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK);
break;
case 1:
SETUP_IOMUX_PADS(usdhc3_pads);
+   gpio_request(USDHC3_CD_GPIO, "USDHC3 CD");
gpio_direction_input(USDHC3_CD_GPIO);
usdhc_cfg[1].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK);
break;
@@ -729,6 +733,7 @@ int checkboard(void)
 #ifdef CONFIG_SPL_OS_BOOT
 int spl_start_uboot(void)
 {
+   gpio_request(KEY_VOL_UP, "KEY Volume UP");
gpio_direction_input(KEY_VOL_UP);
 
/* Only enter in Falcon mode if KEY_VOL_UP is pressed */
diff --git a/configs/mx6sabresd_defconfig b/configs/mx6sabresd_defconfig
index d5a4365..1f4c5c5 100644
--- a/configs/mx6sabresd_defconfig
+++ b/configs/mx6sabresd_defconfig
@@ -69,6 +69,7 @@ CONFIG_FASTBOOT_BUF_ADDR=0x1200
 CONFIG_FASTBOOT_BUF_SIZE=0x1000
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=2
+CONFIG_DM_GPIO=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_SPI_FLASH=y
-- 
2.7.4

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


[U-Boot] [PATCH v3 22/22] board: mx6sabresd: Update README with the SPL DM FIT info

2019-01-30 Thread Abel Vesa
There is a new step now. The need to build the u-boot.itb.
And instead of flashing the .img file, now the .itb file needs
to be flashed.

Signed-off-by: Abel Vesa 
---
 board/freescale/mx6sabresd/README | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/board/freescale/mx6sabresd/README 
b/board/freescale/mx6sabresd/README
index 4b4df06..9b7f7cd 100644
--- a/board/freescale/mx6sabresd/README
+++ b/board/freescale/mx6sabresd/README
@@ -20,6 +20,7 @@ In order to build it:
 $ make mx6sabresd_defconfig
 
 $ make
+$ make u-boot.itb
 
 This will generate the SPL and u-boot.img binaries.
 
@@ -29,7 +30,7 @@ $ sudo dd if=SPL of=/dev/sdX bs=1K seek=1 && sync
 
 - Flash the u-boot.img binary into the SD card:
 
-$ sudo dd if=u-boot.img of=/dev/sdX bs=1K seek=69 && sync
+$ sudo dd if=u-boot.itb of=/dev/sdX bs=1K seek=69 && sync
 
 
 2. Booting from eMMC
@@ -38,6 +39,7 @@ $ sudo dd if=u-boot.img of=/dev/sdX bs=1K seek=69 && sync
 $ make mx6sabresd_defconfig
 
 $ make
+$ make u-boot.itb
 
 This will generate the SPL and u-boot.img binaries.
 
@@ -54,7 +56,7 @@ Mount the eMMC in the host PC:
 - Flash SPL and u-boot.img binaries into the eMMC:
 
 $ sudo dd if=SPL of=/dev/sdX bs=1K seek=1 && sync
-$ sudo dd if=u-boot.img of=/dev/sdX bs=1K seek=69 && sync
+$ sudo dd if=u-boot.itb of=/dev/sdX bs=1K seek=69 && sync
 
 Set SW6 to eMMC 8-bit boot: 11010110
 
@@ -64,6 +66,7 @@ Set SW6 to eMMC 8-bit boot: 11010110
 
 $ make mx6sabresd_defconfig
 $ make
+$ make u-boot.itb
 
 This will generate the SPL image called SPL and the u-boot.img.
 
@@ -73,7 +76,7 @@ $ sudo dd if=SPL of=/dev/sdX bs=1K seek=1 oflag=sync 
status=none && sync
 
 - Flash the u-boot.img image into the SD card:
 
-$ sudo dd if=u-boot.img of=/dev/sdX bs=1K seek=69 oflag=sync status=none && 
sync
+$ sudo dd if=u-boot.itb of=/dev/sdX bs=1K seek=69 oflag=sync status=none && 
sync
 
 Create a partition for root file system and extract it there:
 
-- 
2.7.4

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


[U-Boot] [PATCH v3 10/22] arm: imx: Add FIT SPL its

2019-01-30 Thread Abel Vesa
Add simple its in order to allow SPL to boot u-boot proper
via FIT table.

Signed-off-by: Abel Vesa 
Reviewed-by: Peng Fan 
---
 arch/arm/mach-imx/mx6/fit_spl.its | 41 +++
 1 file changed, 41 insertions(+)
 create mode 100644 arch/arm/mach-imx/mx6/fit_spl.its

diff --git a/arch/arm/mach-imx/mx6/fit_spl.its 
b/arch/arm/mach-imx/mx6/fit_spl.its
new file mode 100644
index 000..bf3ffee
--- /dev/null
+++ b/arch/arm/mach-imx/mx6/fit_spl.its
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2018 NXP
+ *
+ * Simple U-boot fit source file containing U-Boot (with dtb appended)
+ */
+
+/dts-v1/;
+
+/ {
+   description = "Image for u-boot proper (with dtb appended)";
+   #address-cells = <1>;
+
+   images {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   uboot@1 {
+   reg = <0>;
+   description = "U-Boot";
+   data = /incbin/("../../../../u-boot-fit-dtb.bin");
+   type = "standalone";
+   os = "U-Boot";
+   compression = "none";
+   arch = "arm";
+   load = <0x1780>;
+   };
+   };
+
+   configurations {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   default = "conf@1";
+
+   conf@1 {
+   reg = <0>;
+   description = "i.MX armv7";
+   loadables = "uboot@1";
+   };
+   };
+};
-- 
2.7.4

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


[U-Boot] [PATCH v3 08/22] arm: dts: Add all the imx6[q|qp|dl] sabre[auto|sd] u-boot dts[i] files

2019-01-30 Thread Abel Vesa
This allows us to keep the basic dts[i] files up-to-date with
the ones in kernel, but at the same time allowing the u-boot
to add its own properties to the existing nodes.

Signed-off-by: Abel Vesa 
---
 arch/arm/dts/imx6dl-sabreauto-u-boot.dtsi  |  6 ++
 arch/arm/dts/imx6dl-sabresd-u-boot.dtsi|  6 ++
 arch/arm/dts/imx6q-sabreauto-u-boot.dtsi   |  6 ++
 arch/arm/dts/imx6q-sabresd-u-boot.dtsi |  6 ++
 arch/arm/dts/imx6qdl-sabreauto-u-boot.dtsi | 21 +
 arch/arm/dts/imx6qdl-sabresd-u-boot.dtsi   | 14 ++
 arch/arm/dts/imx6qdl-u-boot.dtsi   |  4 ++--
 arch/arm/dts/imx6qp-sabreauto-u-boot.dtsi  |  6 ++
 arch/arm/dts/imx6qp-sabresd-u-boot.dtsi|  6 ++
 9 files changed, 73 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/dts/imx6dl-sabreauto-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6dl-sabresd-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6q-sabreauto-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6q-sabresd-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6qdl-sabreauto-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6qdl-sabresd-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6qp-sabreauto-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6qp-sabresd-u-boot.dtsi

diff --git a/arch/arm/dts/imx6dl-sabreauto-u-boot.dtsi 
b/arch/arm/dts/imx6dl-sabreauto-u-boot.dtsi
new file mode 100644
index 000..d75fcc1
--- /dev/null
+++ b/arch/arm/dts/imx6dl-sabreauto-u-boot.dtsi
@@ -0,0 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 NXP
+ */
+
+#include "imx6qdl-sabreauto-u-boot.dtsi"
diff --git a/arch/arm/dts/imx6dl-sabresd-u-boot.dtsi 
b/arch/arm/dts/imx6dl-sabresd-u-boot.dtsi
new file mode 100644
index 000..e4d7d28
--- /dev/null
+++ b/arch/arm/dts/imx6dl-sabresd-u-boot.dtsi
@@ -0,0 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 NXP
+ */
+
+#include "imx6qdl-sabresd-u-boot.dtsi"
diff --git a/arch/arm/dts/imx6q-sabreauto-u-boot.dtsi 
b/arch/arm/dts/imx6q-sabreauto-u-boot.dtsi
new file mode 100644
index 000..d75fcc1
--- /dev/null
+++ b/arch/arm/dts/imx6q-sabreauto-u-boot.dtsi
@@ -0,0 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 NXP
+ */
+
+#include "imx6qdl-sabreauto-u-boot.dtsi"
diff --git a/arch/arm/dts/imx6q-sabresd-u-boot.dtsi 
b/arch/arm/dts/imx6q-sabresd-u-boot.dtsi
new file mode 100644
index 000..e4d7d28
--- /dev/null
+++ b/arch/arm/dts/imx6q-sabresd-u-boot.dtsi
@@ -0,0 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 NXP
+ */
+
+#include "imx6qdl-sabresd-u-boot.dtsi"
diff --git a/arch/arm/dts/imx6qdl-sabreauto-u-boot.dtsi 
b/arch/arm/dts/imx6qdl-sabreauto-u-boot.dtsi
new file mode 100644
index 000..ea90f40
--- /dev/null
+++ b/arch/arm/dts/imx6qdl-sabreauto-u-boot.dtsi
@@ -0,0 +1,21 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 NXP
+ */
+
+#include "imx6qdl-u-boot.dtsi"
+
+/ {
+   aliases {
+   mmc0 = 
+   };
+};
+
+ {
+   no-1-8-v;
+   u-boot,dm-spl;
+};
+
+_usdhc3 {
+   u-boot,dm-spl;
+};
diff --git a/arch/arm/dts/imx6qdl-sabresd-u-boot.dtsi 
b/arch/arm/dts/imx6qdl-sabresd-u-boot.dtsi
new file mode 100644
index 000..45f02b1
--- /dev/null
+++ b/arch/arm/dts/imx6qdl-sabresd-u-boot.dtsi
@@ -0,0 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 NXP
+ */
+
+#include "imx6qdl-u-boot.dtsi"
+
+ {
+   u-boot,dm-spl;
+};
+
+_usdhc3 {
+   u-boot,dm-spl;
+};
diff --git a/arch/arm/dts/imx6qdl-u-boot.dtsi b/arch/arm/dts/imx6qdl-u-boot.dtsi
index dffc21b..45ae2fa 100644
--- a/arch/arm/dts/imx6qdl-u-boot.dtsi
+++ b/arch/arm/dts/imx6qdl-u-boot.dtsi
@@ -7,11 +7,11 @@
soc {
u-boot,dm-spl;
 
-   aips-bus@0200 {
+   aips-bus@200 {
u-boot,dm-spl;
};
 
-   aips-bus@0210 {
+   aips-bus@210 {
u-boot,dm-spl;
};
};
diff --git a/arch/arm/dts/imx6qp-sabreauto-u-boot.dtsi 
b/arch/arm/dts/imx6qp-sabreauto-u-boot.dtsi
new file mode 100644
index 000..d75fcc1
--- /dev/null
+++ b/arch/arm/dts/imx6qp-sabreauto-u-boot.dtsi
@@ -0,0 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 NXP
+ */
+
+#include "imx6qdl-sabreauto-u-boot.dtsi"
diff --git a/arch/arm/dts/imx6qp-sabresd-u-boot.dtsi 
b/arch/arm/dts/imx6qp-sabresd-u-boot.dtsi
new file mode 100644
index 000..e4d7d28
--- /dev/null
+++ b/arch/arm/dts/imx6qp-sabresd-u-boot.dtsi
@@ -0,0 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 NXP
+ */
+
+#include "imx6qdl-sabresd-u-boot.dtsi"
-- 
2.7.4

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


[U-Boot] [PATCH v3 11/22] configs: mx6sabreauto: Add SPL FIT and DM support

2019-01-30 Thread Abel Vesa
Enable all the necessary configs for SPL DM and FIT support for
mx6sabreauto.

Signed-off-by: Abel Vesa 
---
 configs/mx6sabreauto_defconfig | 15 ++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/configs/mx6sabreauto_defconfig b/configs/mx6sabreauto_defconfig
index 4bdcbb1..6a4d3a4 100644
--- a/configs/mx6sabreauto_defconfig
+++ b/configs/mx6sabreauto_defconfig
@@ -11,12 +11,19 @@ CONFIG_SPL=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_NXP_BOARD_REVISION=y
 CONFIG_NR_DRAM_BANKS=1
+# CONFIG_SYS_MALLOC_F is not set
+CONFIG_FIT=y
+CONFIG_SPL_FIT_PRINT=y
+CONFIG_SPL_LOAD_FIT=y
+CONFIG_SPL_FIT_SOURCE="arch/arm/mach-imx/mx6/fit_spl.its"
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_BOUNCE_BUFFER=y
+CONFIG_SPL_SEPARATE_BSS=y
+CONFIG_SPL_FIT_IMAGE_TINY=y
 CONFIG_SPL_EXT_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_WATCHDOG_SUPPORT=y
@@ -40,8 +47,15 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
+CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="imx6q-sabreauto"
+CONFIG_OF_LIST="imx6dl-sabreauto imx6q-sabreauto imx6qp-sabreauto"
+CONFIG_MULTI_DTB_FIT=y
+CONFIG_SPL_MULTI_DTB_FIT=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
+CONFIG_SPL_DM=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_SF=y
 CONFIG_DM_MMC=y
@@ -68,4 +82,3 @@ CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
-CONFIG_OF_LIBFDT=y
-- 
2.7.4

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


[U-Boot] [PATCH v3 09/22] arm: dts: Update all the dts[i] files for imx6[q|qp|dl] sabre[auto|sd]

2019-01-30 Thread Abel Vesa
Update all the dts[i] files for imx6[q|qp|dl] sabre[auto|sd] to the ones
from kernel v4.20 (commit 8fe28cb58bcb2).

Signed-off-by: Abel Vesa 
Acked-by: Peng Fan 
---
 arch/arm/dts/Makefile   |   8 +-
 arch/arm/dts/imx6dl-sabreauto.dts   |  13 +
 arch/arm/dts/imx6dl-sabresd.dts |  18 +
 arch/arm/dts/imx6dl.dtsi| 306 --
 arch/arm/dts/imx6q-sabreauto.dts|  18 +
 arch/arm/dts/imx6q-sabresd.dts  |  23 +
 arch/arm/dts/imx6q.dtsi | 310 --
 arch/arm/dts/imx6qdl-sabreauto.dtsi | 810 
 arch/arm/dts/imx6qdl-sabresd.dtsi   | 741 +
 arch/arm/dts/imx6qdl.dtsi   | 455 +++-
 arch/arm/dts/imx6qp-sabreauto.dts   |  55 +++
 arch/arm/dts/imx6qp-sabresd.dts |  55 +++
 arch/arm/dts/imx6qp.dtsi| 115 +
 13 files changed, 2669 insertions(+), 258 deletions(-)
 create mode 100644 arch/arm/dts/imx6dl-sabreauto.dts
 create mode 100644 arch/arm/dts/imx6dl-sabresd.dts
 create mode 100644 arch/arm/dts/imx6q-sabreauto.dts
 create mode 100644 arch/arm/dts/imx6q-sabresd.dts
 create mode 100644 arch/arm/dts/imx6qdl-sabreauto.dtsi
 create mode 100644 arch/arm/dts/imx6qdl-sabresd.dtsi
 create mode 100644 arch/arm/dts/imx6qp-sabreauto.dts
 create mode 100644 arch/arm/dts/imx6qp-sabresd.dts
 create mode 100644 arch/arm/dts/imx6qp.dtsi

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 5c3225b..c18da3d 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -443,7 +443,13 @@ dtb-$(CONFIG_MX6QDL) += \
imx6q-icore.dtb \
imx6q-icore-mipi.dtb \
imx6q-icore-rqs.dtb \
-   imx6q-logicpd.dtb
+   imx6q-logicpd.dtb \
+   imx6q-sabreauto.dtb \
+   imx6q-sabresd.dtb \
+   imx6dl-sabreauto.dtb \
+   imx6dl-sabresd.dtb \
+   imx6qp-sabreauto.dtb \
+   imx6qp-sabresd.dtb
 
 dtb-$(CONFIG_MX6SL) += imx6sl-evk.dtb
 
diff --git a/arch/arm/dts/imx6dl-sabreauto.dts 
b/arch/arm/dts/imx6dl-sabreauto.dts
new file mode 100644
index 000..660d52a
--- /dev/null
+++ b/arch/arm/dts/imx6dl-sabreauto.dts
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// Copyright (C) 2013 Freescale Semiconductor, Inc.
+
+/dts-v1/;
+
+#include "imx6dl.dtsi"
+#include "imx6qdl-sabreauto.dtsi"
+
+/ {
+   model = "Freescale i.MX6 DualLite/Solo SABRE Automotive Board";
+   compatible = "fsl,imx6dl-sabreauto", "fsl,imx6dl";
+};
diff --git a/arch/arm/dts/imx6dl-sabresd.dts b/arch/arm/dts/imx6dl-sabresd.dts
new file mode 100644
index 000..cd6bbf2
--- /dev/null
+++ b/arch/arm/dts/imx6dl-sabresd.dts
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// Copyright (C) 2013 Freescale Semiconductor, Inc.
+
+/dts-v1/;
+
+#include "imx6dl.dtsi"
+#include "imx6qdl-sabresd.dtsi"
+
+/ {
+   model = "Freescale i.MX6 DualLite SABRE Smart Device Board";
+   compatible = "fsl,imx6dl-sabresd", "fsl,imx6dl";
+};
+
+_csi1_from_ipu1_csi1_mux {
+   clock-lanes = <0>;
+   data-lanes = <1 2>;
+};
diff --git a/arch/arm/dts/imx6dl.dtsi b/arch/arm/dts/imx6dl.dtsi
index 9a4c22c..f0607eb 100644
--- a/arch/arm/dts/imx6dl.dtsi
+++ b/arch/arm/dts/imx6dl.dtsi
@@ -1,12 +1,6 @@
-
-/*
- * 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.
- *
- */
+// SPDX-License-Identifier: GPL-2.0
+//
+// Copyright 2013 Freescale Semiconductor, Inc.
 
 #include 
 #include "imx6dl-pinfunc.h"
@@ -39,6 +33,7 @@
396000  1175000
>;
clock-latency = <61036>; /* two CLK32 periods */
+   #cooling-cells = <2>;
clocks = < IMX6QDL_CLK_ARM>,
 < IMX6QDL_CLK_PLL2_PFD2_396M>,
 < IMX6QDL_CLK_STEP>,
@@ -56,39 +51,57 @@
device_type = "cpu";
reg = <1>;
next-level-cache = <>;
+   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

[U-Boot] [PATCH v3 12/22] configs: mx6sabresd: Add SPL FIT and DM support

2019-01-30 Thread Abel Vesa
Enable all the necessary configs for SPL DM and FIT support for
mx6sabresd.

Signed-off-by: Abel Vesa 
---
 configs/mx6sabresd_defconfig | 21 +++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/configs/mx6sabresd_defconfig b/configs/mx6sabresd_defconfig
index 3babfd5..d5a4365 100644
--- a/configs/mx6sabresd_defconfig
+++ b/configs/mx6sabresd_defconfig
@@ -10,12 +10,19 @@ CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_NR_DRAM_BANKS=1
+# CONFIG_SYS_MALLOC_F is not set
+CONFIG_FIT=y
+CONFIG_SPL_FIT_PRINT=y
+CONFIG_SPL_LOAD_FIT=y
+CONFIG_SPL_FIT_SOURCE="arch/arm/mach-imx/mx6/fit_spl.its"
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_BOUNCE_BUFFER=y
+CONFIG_SPL_SEPARATE_BSS=y
+CONFIG_SPL_FIT_IMAGE_TINY=y
 CONFIG_SPL_EXT_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
@@ -47,23 +54,34 @@ CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_EFI_PARTITION=y
+CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="imx6q-sabresd"
+CONFIG_OF_LIST="imx6q-sabresd imx6qp-sabresd imx6dl-sabresd"
+CONFIG_MULTI_DTB_FIT=y
+CONFIG_SPL_MULTI_DTB_FIT=y
+CONFIG_SPL_OF_LIST="imx6dl-sabresd imx6q-sabresd imx6qp-sabresd"
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
+CONFIG_SPL_DM=y
 CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x1200
 CONFIG_FASTBOOT_BUF_SIZE=0x1000
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=2
+CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
 CONFIG_MII=y
 CONFIG_PCI=y
+CONFIG_DM_REGULATOR=y
 CONFIG_SPI=y
 CONFIG_MXC_SPI=y
 CONFIG_USB=y
-CONFIG_USB_STORAGE=y
+CONFIG_DM_USB=y
+# CONFIG_SPL_DM_USB is not set
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="FSL"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0525
@@ -73,4 +91,3 @@ CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
-CONFIG_OF_LIBFDT=y
-- 
2.7.4

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


[U-Boot] [PATCH v3 17/22] board: mx6sabreauto: Remove the non-DM code

2019-01-30 Thread Abel Vesa
Since the mx6sabreauto has DM support, remove the unused non-DM code
from mx6sabreauto board file.

Signed-off-by: Abel Vesa 
---
 board/freescale/mx6sabreauto/mx6sabreauto.c | 70 -
 1 file changed, 70 deletions(-)

diff --git a/board/freescale/mx6sabreauto/mx6sabreauto.c 
b/board/freescale/mx6sabreauto/mx6sabreauto.c
index c7e3e67..dd72de9 100644
--- a/board/freescale/mx6sabreauto/mx6sabreauto.c
+++ b/board/freescale/mx6sabreauto/mx6sabreauto.c
@@ -159,44 +159,6 @@ static iomux_v3_cfg_t const port_exp[] = {
IOMUX_PADS(PAD_SD2_DAT0__GPIO1_IO15 | MUX_PAD_CTRL(NO_PAD_CTRL)),
 };
 
-/*Define for building port exp gpio, pin starts from 0*/
-#define PORTEXP_IO_NR(chip, pin) \
-   ((chip << 5) + pin)
-
-/*Get the chip addr from a ioexp gpio*/
-#define PORTEXP_IO_TO_CHIP(gpio_nr) \
-   (gpio_nr >> 5)
-
-/*Get the pin number from a ioexp gpio*/
-#define PORTEXP_IO_TO_PIN(gpio_nr) \
-   (gpio_nr & 0x1f)
-
-static int port_exp_direction_output(unsigned gpio, int value)
-{
-   int ret;
-
-   i2c_set_bus_num(2);
-   ret = i2c_probe(PORTEXP_IO_TO_CHIP(gpio));
-   if (ret)
-   return ret;
-
-   ret = pca953x_set_dir(PORTEXP_IO_TO_CHIP(gpio),
-   (1 << PORTEXP_IO_TO_PIN(gpio)),
-   (PCA953X_DIR_OUT << PORTEXP_IO_TO_PIN(gpio)));
-
-   if (ret)
-   return ret;
-
-   ret = pca953x_set_val(PORTEXP_IO_TO_CHIP(gpio),
-   (1 << PORTEXP_IO_TO_PIN(gpio)),
-   (value << PORTEXP_IO_TO_PIN(gpio)));
-
-   if (ret)
-   return ret;
-
-   return 0;
-}
-
 #ifdef CONFIG_MTD_NOR_FLASH
 static iomux_v3_cfg_t const eimnor_pads[] = {
IOMUX_PADS(PAD_EIM_D16__EIM_DATA16  | 
MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL)),
@@ -681,19 +643,10 @@ int checkboard(void)
 }
 
 #ifdef CONFIG_USB_EHCI_MX6
-#define USB_HOST1_PWR PORTEXP_IO_NR(0x32, 7)
-#define USB_OTG_PWR   PORTEXP_IO_NR(0x34, 1)
-
-iomux_v3_cfg_t const usb_otg_pads[] = {
-   IOMUX_PADS(PAD_ENET_RX_ER__USB_OTG_ID | MUX_PAD_CTRL(NO_PAD_CTRL)),
-};
-
 int board_ehci_hcd_init(int port)
 {
switch (port) {
case 0:
-   SETUP_IOMUX_PADS(usb_otg_pads);
-
/*
  * Set daisy chain for otg_pin_id on 6q.
 *  For 6dl, this bit is reserved.
@@ -708,29 +661,6 @@ int board_ehci_hcd_init(int port)
}
return 0;
 }
-
-int board_ehci_power(int port, int on)
-{
-   switch (port) {
-   case 0:
-   if (on)
-   port_exp_direction_output(USB_OTG_PWR, 1);
-   else
-   port_exp_direction_output(USB_OTG_PWR, 0);
-   break;
-   case 1:
-   if (on)
-   port_exp_direction_output(USB_HOST1_PWR, 1);
-   else
-   port_exp_direction_output(USB_HOST1_PWR, 0);
-   break;
-   default:
-   printf("MXC USB port %d not yet supported\n", port);
-   return -EINVAL;
-   }
-
-   return 0;
-}
 #endif
 
 #ifdef CONFIG_SPL_BUILD
-- 
2.7.4

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


[U-Boot] [PATCH v3 15/22] configs: mx6sabreauto: Add DM_SPI_FLASH necessary configs

2019-01-30 Thread Abel Vesa
Enable all neceassary configs to support DM_SPI_FLASH on mx6sabreauto.

Signed-off-by: Abel Vesa 
Reviewed-by: Peng Fan 
---
 configs/mx6sabreauto_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configs/mx6sabreauto_defconfig b/configs/mx6sabreauto_defconfig
index 31e8153..34fb9d04 100644
--- a/configs/mx6sabreauto_defconfig
+++ b/configs/mx6sabreauto_defconfig
@@ -63,12 +63,14 @@ CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_NAND=y
 CONFIG_NAND_MXS=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
 CONFIG_MII=y
 CONFIG_DM_REGULATOR=y
 CONFIG_SPI=y
+CONFIG_DM_SPI=y
 CONFIG_MXC_SPI=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
-- 
2.7.4

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


[U-Boot] [PATCH v3 16/22] configs: mx6sabresd: Add DM_SPI_FLASH necessary configs

2019-01-30 Thread Abel Vesa
Enable all neceassary configs to support DM_SPI_FLASH on mx6sabresd.

Signed-off-by: Abel Vesa 
Reviewed-by: Peng Fan 
---
 configs/mx6sabresd_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configs/mx6sabresd_defconfig b/configs/mx6sabresd_defconfig
index 1f4c5c5..b26e764 100644
--- a/configs/mx6sabresd_defconfig
+++ b/configs/mx6sabresd_defconfig
@@ -72,6 +72,7 @@ CONFIG_FASTBOOT_FLASH_MMC_DEV=2
 CONFIG_DM_GPIO=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
@@ -79,6 +80,7 @@ CONFIG_MII=y
 CONFIG_PCI=y
 CONFIG_DM_REGULATOR=y
 CONFIG_SPI=y
+CONFIG_DM_SPI=y
 CONFIG_MXC_SPI=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
-- 
2.7.4

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


[U-Boot] [PATCH v3 04/22] configs: imx6sabreauto: Add DM_USB support

2019-01-30 Thread Abel Vesa
Add the DM support for USB. For that, DM_REGULATOR is needed.

Signed-off-by: Abel Vesa 
---
 configs/mx6sabreauto_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configs/mx6sabreauto_defconfig b/configs/mx6sabreauto_defconfig
index a3d63a2..4bdcbb1 100644
--- a/configs/mx6sabreauto_defconfig
+++ b/configs/mx6sabreauto_defconfig
@@ -52,9 +52,11 @@ CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
 CONFIG_MII=y
+CONFIG_DM_REGULATOR=y
 CONFIG_SPI=y
 CONFIG_MXC_SPI=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="FSL"
-- 
2.7.4

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


[U-Boot] [PATCH v3 05/22] mmc: fsl_esdhc: Fix DM_REGULATOR ifdefs for SPL builds

2019-01-30 Thread Abel Vesa
Since the fsl_esdhc will also be used by SPL, make the
preprocessor switches more generic to allow any kind of build.

Signed-off-by: Abel Vesa 
---
 drivers/mmc/fsl_esdhc.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
index b8171ba..47f2a8f 100644
--- a/drivers/mmc/fsl_esdhc.c
+++ b/drivers/mmc/fsl_esdhc.c
@@ -804,7 +804,7 @@ static int esdhc_set_voltage(struct mmc *mmc)
case MMC_SIGNAL_VOLTAGE_330:
if (priv->vs18_enable)
return -EIO;
-#ifdef CONFIG_DM_REGULATOR
+#if CONFIG_IS_ENABLED(DM_REGULATOR)
if (!IS_ERR_OR_NULL(priv->vqmmc_dev)) {
ret = regulator_set_value(priv->vqmmc_dev, 330);
if (ret) {
@@ -823,7 +823,7 @@ static int esdhc_set_voltage(struct mmc *mmc)
 
return -EAGAIN;
case MMC_SIGNAL_VOLTAGE_180:
-#ifdef CONFIG_DM_REGULATOR
+#if CONFIG_IS_ENABLED(DM_REGULATOR)
if (!IS_ERR_OR_NULL(priv->vqmmc_dev)) {
ret = regulator_set_value(priv->vqmmc_dev, 180);
if (ret) {
@@ -1442,7 +1442,7 @@ static int fsl_esdhc_probe(struct udevice *dev)
int node = dev_of_offset(dev);
struct esdhc_soc_data *data =
(struct esdhc_soc_data *)dev_get_driver_data(dev);
-#ifdef CONFIG_DM_REGULATOR
+#if CONFIG_IS_ENABLED(DM_REGULATOR)
struct udevice *vqmmc_dev;
 #endif
fdt_addr_t addr;
@@ -1500,7 +1500,7 @@ static int fsl_esdhc_probe(struct udevice *dev)
 
priv->vs18_enable = 0;
 
-#ifdef CONFIG_DM_REGULATOR
+#if CONFIG_IS_ENABLED(DM_REGULATOR)
/*
 * If emmc I/O has a fixed voltage at 1.8V, this must be provided,
 * otherwise, emmc will work abnormally.
-- 
2.7.4

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


[U-Boot] [PATCH v3 07/22] board: mx6sabreauto: Add board_fit_config_name_match to support FIT in SPL

2019-01-30 Thread Abel Vesa
This matches one of the following three boards (or fails):
 - imx6q-sabreauto
 - imx6qp-sabreauto
 - imx6dl-sabreauto

Signed-off-by: Abel Vesa 
Reviewed-by: Peng Fan 
---
 board/freescale/mx6sabreauto/mx6sabreauto.c | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/board/freescale/mx6sabreauto/mx6sabreauto.c 
b/board/freescale/mx6sabreauto/mx6sabreauto.c
index c1bef85..c8f1263 100644
--- a/board/freescale/mx6sabreauto/mx6sabreauto.c
+++ b/board/freescale/mx6sabreauto/mx6sabreauto.c
@@ -1097,3 +1097,21 @@ void board_init_f(ulong dummy)
board_init_r(NULL, 0);
 }
 #endif
+
+#ifdef CONFIG_SPL_LOAD_FIT
+int board_fit_config_name_match(const char *name)
+{
+   if (is_mx6dq()) {
+   if (!strcmp(name, "imx6q-sabreauto"))
+   return 0;
+   } else if (is_mx6dqp()) {
+   if (!strcmp(name, "imx6qp-sabreauto"))
+   return 0;
+   } else if (is_mx6dl()) {
+   if (!strcmp(name, "imx6dl-sabreauto"))
+   return 0;
+   }
+
+   return -1;
+}
+#endif
-- 
2.7.4

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


[U-Boot] [PATCH v3 06/22] board: mx6sabresd: Add board_fit_config_name_match to support FIT in SPL

2019-01-30 Thread Abel Vesa
This matches one of the following three boards (or fails):
 - imx6q-sabresd
 - imx6qp-sabresd
 - imx6dl-sabresd

Signed-off-by: Abel Vesa 
Reviewed-by: Peng Fan 
---
 board/freescale/mx6sabresd/mx6sabresd.c | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/board/freescale/mx6sabresd/mx6sabresd.c 
b/board/freescale/mx6sabresd/mx6sabresd.c
index 0183ede..4688095 100644
--- a/board/freescale/mx6sabresd/mx6sabresd.c
+++ b/board/freescale/mx6sabresd/mx6sabresd.c
@@ -1062,3 +1062,21 @@ void board_init_f(ulong dummy)
board_init_r(NULL, 0);
 }
 #endif
+
+#ifdef CONFIG_SPL_LOAD_FIT
+int board_fit_config_name_match(const char *name)
+{
+   if (is_mx6dq()) {
+   if (!strcmp(name, "imx6q-sabresd"))
+   return 0;
+   } else if (is_mx6dqp()) {
+   if (!strcmp(name, "imx6qp-sabresd"))
+   return 0;
+   } else if (is_mx6dl()) {
+   if (!strcmp(name, "imx6dl-sabresd"))
+   return 0;
+   }
+
+   return -1;
+}
+#endif
-- 
2.7.4

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


[U-Boot] [PATCH v3 01/22] usb: Rename SPL_USB_SUPPORT to SPL_USB_STORAGE

2019-01-30 Thread Abel Vesa
Since there is the SPL_USB_HOST_SUPPORT for enabling USB support in SPL,
makes more sense to rename the SPL_USB_SUPPORT as SPL_USB_STORAGE.
Everything that is not part of the usb storage support in SPL is now
build under SPL_USB_HOST_SUPPORT.

Signed-off-by: Abel Vesa 
Reviewed-by: Tom Rini 
---
 arch/arm/include/asm/arch-am33xx/spl.h| 2 +-
 arch/arm/mach-omap2/boot-common.c | 2 +-
 common/Makefile   | 5 +++--
 common/spl/Kconfig| 4 ++--
 common/spl/Makefile   | 2 +-
 common/spl/spl_usb.c  | 4 
 configs/am43xx_evm_usbhost_boot_defconfig | 2 +-
 configs/am43xx_hs_evm_defconfig   | 2 +-
 8 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/arch/arm/include/asm/arch-am33xx/spl.h 
b/arch/arm/include/asm/arch-am33xx/spl.h
index 0bf8c17..f3910c2 100644
--- a/arch/arm/include/asm/arch-am33xx/spl.h
+++ b/arch/arm/include/asm/arch-am33xx/spl.h
@@ -62,7 +62,7 @@
 #define BOOT_DEVICE_CPGMAC 0x47
 
 #define MMC_BOOT_DEVICES_START BOOT_DEVICE_MMC1
-#ifdef CONFIG_SPL_USB_SUPPORT
+#ifdef CONFIG_SPL_USB_STORAGE
 #define MMC_BOOT_DEVICES_END   BOOT_DEVICE_USB
 #else
 #define MMC_BOOT_DEVICES_END   BOOT_DEVICE_MMC2
diff --git a/arch/arm/mach-omap2/boot-common.c 
b/arch/arm/mach-omap2/boot-common.c
index 2db1922..c8b8ac6 100644
--- a/arch/arm/mach-omap2/boot-common.c
+++ b/arch/arm/mach-omap2/boot-common.c
@@ -93,7 +93,7 @@ void save_omap_boot_params(void)
sys_boot_device = 1;
break;
 #endif
-#if defined(BOOT_DEVICE_USB) && !defined(CONFIG_SPL_USB_SUPPORT)
+#if defined(BOOT_DEVICE_USB) && !defined(CONFIG_SPL_USB_STORAGE)
case BOOT_DEVICE_USB:
sys_boot_device = 1;
break;
diff --git a/common/Makefile b/common/Makefile
index ad390d0..8c92feb 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -75,8 +75,9 @@ obj-$(CONFIG_SPL_NET_SUPPORT) += miiphyutil.o
 obj-$(CONFIG_$(SPL_TPL_)OF_LIBFDT) += fdt_support.o
 
 ifdef CONFIG_SPL_USB_HOST_SUPPORT
-obj-$(CONFIG_SPL_USB_SUPPORT) += usb.o usb_hub.o
-obj-$(CONFIG_USB_STORAGE) += usb_storage.o
+obj-y += usb.o
+obj-y += usb_hub.o
+obj-$(CONFIG_SPL_USB_STORAGE) += usb_storage.o
 else
 obj-$(CONFIG_USB_MUSB_HOST) += usb.o
 endif
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 54b0dc3..8b0627e 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -766,9 +766,9 @@ config SPL_USB_HOST_SUPPORT
  device can be attached. This option enables the drivers in
  drivers/usb/host as part of an SPL build.
 
-config SPL_USB_SUPPORT
+config SPL_USB_STORAGE
bool "Support loading from USB"
-   depends on SPL_USB_HOST_SUPPORT
+   depends on SPL_USB_HOST_SUPPORT && !(BLK && !DM_USB)
help
  Enable support for USB devices in SPL. This allows use of USB
  devices such as hard drives and flash drivers for loading U-Boot.
diff --git a/common/spl/Makefile b/common/spl/Makefile
index 6f8d759..a3980ce 100644
--- a/common/spl/Makefile
+++ b/common/spl/Makefile
@@ -22,7 +22,7 @@ obj-$(CONFIG_$(SPL_TPL_)NET_SUPPORT) += spl_net.o
 obj-$(CONFIG_$(SPL_TPL_)MMC_SUPPORT) += spl_mmc.o
 obj-$(CONFIG_$(SPL_TPL_)ATF) += spl_atf.o
 obj-$(CONFIG_$(SPL_TPL_)OPTEE) += spl_optee.o
-obj-$(CONFIG_$(SPL_TPL_)USB_SUPPORT) += spl_usb.o
+obj-$(CONFIG_$(SPL_TPL_)USB_STORAGE) += spl_usb.o
 obj-$(CONFIG_$(SPL_TPL_)FAT_SUPPORT) += spl_fat.o
 obj-$(CONFIG_$(SPL_TPL_)EXT_SUPPORT) += spl_ext.o
 obj-$(CONFIG_$(SPL_TPL_)SATA_SUPPORT) += spl_sata.o
diff --git a/common/spl/spl_usb.c b/common/spl/spl_usb.c
index c8d8231..e29d579 100644
--- a/common/spl/spl_usb.c
+++ b/common/spl/spl_usb.c
@@ -15,9 +15,7 @@
 #include 
 #include 
 
-#ifdef CONFIG_USB_STORAGE
 static int usb_stor_curr_dev = -1; /* current device */
-#endif
 
 static int spl_usb_load_image(struct spl_image_info *spl_image,
  struct spl_boot_device *bootdev)
@@ -34,13 +32,11 @@ static int spl_usb_load_image(struct spl_image_info 
*spl_image,
return err;
}
 
-#ifdef CONFIG_USB_STORAGE
/* try to recognize storage devices immediately */
usb_stor_curr_dev = usb_stor_scan(1);
stor_dev = blk_get_devnum_by_type(IF_TYPE_USB, usb_stor_curr_dev);
if (!stor_dev)
return -ENODEV;
-#endif
 
debug("boot mode - FAT\n");
 
diff --git a/configs/am43xx_evm_usbhost_boot_defconfig 
b/configs/am43xx_evm_usbhost_boot_defconfig
index 5131f19..5bd919b 100644
--- a/configs/am43xx_evm_usbhost_boot_defconfig
+++ b/configs/am43xx_evm_usbhost_boot_defconfig
@@ -14,7 +14,7 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL_MTD_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_SPL_USB_HOST_SUPPORT=y
-CONFIG_SPL_USB_SUPPORT=y
+CONFIG_SPL_USB_STORAGE=y
 CONFIG_CMD_SPL=y
 CONFIG_CMD_SPL_NAND_OFS=0x0010
 CONFIG_CMD_SPL_WRITE_SIZE=0x4
diff --git a/configs/am43xx_hs_e

[U-Boot] [PATCH v3 02/22] usb: ehci-mx6: Make regulator DM_REGULATOR dependent

2019-01-30 Thread Abel Vesa
Do the regulator related work only if the build has the DM_REGULATOR.

Signed-off-by: Abel Vesa 
Reviewed-by: Peng Fan 
---
 drivers/usb/host/ehci-mx6.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/ehci-mx6.c b/drivers/usb/host/ehci-mx6.c
index 1acf08d..9483947 100644
--- a/drivers/usb/host/ehci-mx6.c
+++ b/drivers/usb/host/ehci-mx6.c
@@ -404,6 +404,7 @@ static int mx6_init_after_reset(struct ehci_ctrl *dev)
if (ret)
return ret;
 
+#if CONFIG_IS_ENABLED(DM_REGULATOR)
if (priv->vbus_supply) {
ret = regulator_set_enable(priv->vbus_supply,
   (type == USB_INIT_DEVICE) ?
@@ -413,6 +414,7 @@ static int mx6_init_after_reset(struct ehci_ctrl *dev)
return ret;
}
}
+#endif
 
if (type == USB_INIT_DEVICE)
return 0;
@@ -514,15 +516,17 @@ static int ehci_usb_probe(struct udevice *dev)
priv->portnr = dev->seq;
priv->init_type = type;
 
+#if CONFIG_IS_ENABLED(DM_REGULATOR)
ret = device_get_supply_regulator(dev, "vbus-supply",
  >vbus_supply);
if (ret)
debug("%s: No vbus supply\n", dev->name);
-
+#endif
ret = ehci_mx6_common_init(ehci, priv->portnr);
if (ret)
return ret;
 
+#if CONFIG_IS_ENABLED(DM_REGULATOR)
if (priv->vbus_supply) {
ret = regulator_set_enable(priv->vbus_supply,
   (type == USB_INIT_DEVICE) ?
@@ -532,6 +536,7 @@ static int ehci_usb_probe(struct udevice *dev)
return ret;
}
}
+#endif
 
if (priv->init_type == USB_INIT_HOST) {
setbits_le32(>usbmode, CM_HOST);
-- 
2.7.4

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


[U-Boot] [PATCH v3 03/22] configs: imx6sabreauto: Add DM_MMC support

2019-01-30 Thread Abel Vesa
Add DM_MMC config to imx6sabreauto defconfig.

Signed-off-by: Abel Vesa 
---
 configs/mx6sabreauto_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/mx6sabreauto_defconfig b/configs/mx6sabreauto_defconfig
index 40386c2..a3d63a2 100644
--- a/configs/mx6sabreauto_defconfig
+++ b/configs/mx6sabreauto_defconfig
@@ -44,6 +44,7 @@ CONFIG_ENV_IS_IN_MMC=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_SF=y
+CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_NAND=y
 CONFIG_NAND_MXS=y
-- 
2.7.4

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


[U-Boot] [PATCH v3 00/22] mx6sabre: Add DM and SPL FIT support

2019-01-30 Thread Abel Vesa
The second version is here:
https://lists.denx.de/pipermail/u-boot/2019-January/356557.html

Changes since v2:
 * Removed the unecessary SYS_MALLOC_F_LEN from both defocnfig
 * Fixed the copyright for all the *u-boot.dtsi files

Abel Vesa (22):
  usb: Rename SPL_USB_SUPPORT to SPL_USB_STORAGE
  usb: ehci-mx6: Make regulator DM_REGULATOR dependent
  configs: imx6sabreauto: Add DM_MMC support
  configs: imx6sabreauto: Add DM_USB support
  mmc: fsl_esdhc: Fix DM_REGULATOR ifdefs for SPL builds
  board: mx6sabresd: Add board_fit_config_name_match to support FIT in
SPL
  board: mx6sabreauto: Add board_fit_config_name_match to support FIT in
SPL
  arm: dts: Add all the imx6[q|qp|dl] sabre[auto|sd] u-boot dts[i] files
  arm: dts: Update all the dts[i] files for imx6[q|qp|dl] sabre[auto|sd]
  arm: imx: Add FIT SPL its
  configs: mx6sabreauto: Add SPL FIT and DM support
  configs: mx6sabresd: Add SPL FIT and DM support
  mx6sabreauto: Add DM_GPIO support
  mx6sabresd: Add DM_GPIO support
  configs: mx6sabreauto: Add DM_SPI_FLASH necessary configs
  configs: mx6sabresd: Add DM_SPI_FLASH necessary configs
  board: mx6sabreauto: Remove the non-DM code
  board: mx6sabresd: Remove non-DM code
  board: mx6sabresd: Remove the enet reset gpio handling
  configs: mx6sabresd: Reduce size for SPL by disabling SPL_DOS and
SPL_EFI
  board: mx6sabreauto: Update README with the SPL DM FIT info
  board: mx6sabresd: Update README with the SPL DM FIT info

 arch/arm/dts/Makefile   |   8 +-
 arch/arm/dts/imx6dl-sabreauto-u-boot.dtsi   |   6 +
 arch/arm/dts/imx6dl-sabreauto.dts   |  13 +
 arch/arm/dts/imx6dl-sabresd-u-boot.dtsi |   6 +
 arch/arm/dts/imx6dl-sabresd.dts |  18 +
 arch/arm/dts/imx6dl.dtsi| 306 ++-
 arch/arm/dts/imx6q-sabreauto-u-boot.dtsi|   6 +
 arch/arm/dts/imx6q-sabreauto.dts|  18 +
 arch/arm/dts/imx6q-sabresd-u-boot.dtsi  |   6 +
 arch/arm/dts/imx6q-sabresd.dts  |  23 +
 arch/arm/dts/imx6q.dtsi | 310 +--
 arch/arm/dts/imx6qdl-sabreauto-u-boot.dtsi  |  21 +
 arch/arm/dts/imx6qdl-sabreauto.dtsi | 810 
 arch/arm/dts/imx6qdl-sabresd-u-boot.dtsi|  14 +
 arch/arm/dts/imx6qdl-sabresd.dtsi   | 741 +
 arch/arm/dts/imx6qdl-u-boot.dtsi|   4 +-
 arch/arm/dts/imx6qdl.dtsi   | 455 +---
 arch/arm/dts/imx6qp-sabreauto-u-boot.dtsi   |   6 +
 arch/arm/dts/imx6qp-sabreauto.dts   |  55 ++
 arch/arm/dts/imx6qp-sabresd-u-boot.dtsi |   6 +
 arch/arm/dts/imx6qp-sabresd.dts |  55 ++
 arch/arm/dts/imx6qp.dtsi| 115 
 arch/arm/include/asm/arch-am33xx/spl.h  |   2 +-
 arch/arm/mach-imx/mx6/fit_spl.its   |  41 ++
 arch/arm/mach-omap2/boot-common.c   |   2 +-
 board/freescale/mx6sabreauto/README |   6 +-
 board/freescale/mx6sabreauto/mx6sabreauto.c |  91 +---
 board/freescale/mx6sabresd/README   |   9 +-
 board/freescale/mx6sabresd/mx6sabresd.c |  78 +--
 common/Makefile |   5 +-
 common/spl/Kconfig  |   4 +-
 common/spl/Makefile |   2 +-
 common/spl/spl_usb.c|   4 -
 configs/am43xx_evm_usbhost_boot_defconfig   |   2 +-
 configs/am43xx_hs_evm_defconfig |   2 +-
 configs/mx6sabreauto_defconfig  |  21 +-
 configs/mx6sabresd_defconfig|  26 +-
 drivers/mmc/fsl_esdhc.c |   8 +-
 drivers/usb/host/ehci-mx6.c |   7 +-
 39 files changed, 2900 insertions(+), 412 deletions(-)
 create mode 100644 arch/arm/dts/imx6dl-sabreauto-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6dl-sabreauto.dts
 create mode 100644 arch/arm/dts/imx6dl-sabresd-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6dl-sabresd.dts
 create mode 100644 arch/arm/dts/imx6q-sabreauto-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6q-sabreauto.dts
 create mode 100644 arch/arm/dts/imx6q-sabresd-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6q-sabresd.dts
 create mode 100644 arch/arm/dts/imx6qdl-sabreauto-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6qdl-sabreauto.dtsi
 create mode 100644 arch/arm/dts/imx6qdl-sabresd-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6qdl-sabresd.dtsi
 create mode 100644 arch/arm/dts/imx6qp-sabreauto-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6qp-sabreauto.dts
 create mode 100644 arch/arm/dts/imx6qp-sabresd-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6qp-sabresd.dts
 create mode 100644 arch/arm/dts/imx6qp.dtsi
 create mode 100644 arch/arm/mach-imx/mx6/fit_spl.its

-- 
2.7.4

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


Re: [U-Boot] [PATCH v2 05/22] mmc: fsl_esdhc: Fix DM_REGULATOR ifdefs for SPL builds

2019-01-30 Thread Abel Vesa
On 19-01-29 13:29:04, Peng Fan wrote:
> Hi Abel,
> 
> > -Original Message-
> > From: Abel Vesa
> > Sent: 2019年1月29日 19:31
> > To: Tom Rini ; Fabio Estevam
> > ; u-boot@lists.denx.de; dl-uboot-imx
> > ; Peng Fan 
> > Cc: Nitin Garg ; Abel Vesa 
> > Subject: [PATCH v2 05/22] mmc: fsl_esdhc: Fix DM_REGULATOR ifdefs for SPL
> > builds
> > 
> > Since the fsl_esdhc will also be used by SPL, make the preprocessor switches
> > more generic to allow any kind of build.
> > 
> > Signed-off-by: Abel Vesa 
> > ---
> >  drivers/mmc/fsl_esdhc.c | 8 
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c index
> > b8171ba..47f2a8f 100644
> > --- a/drivers/mmc/fsl_esdhc.c
> > +++ b/drivers/mmc/fsl_esdhc.c
> > @@ -804,7 +804,7 @@ static int esdhc_set_voltage(struct mmc *mmc)
> > case MMC_SIGNAL_VOLTAGE_330:
> > if (priv->vs18_enable)
> > return -EIO;
> > -#ifdef CONFIG_DM_REGULATOR
> > +#if CONFIG_IS_ENABLED(DM_REGULATOR)
> 
> If you need SPL DM REGULATOR, this is not enough, you might also need 
> SPL_DM_REGULATOR.
> 

According to the definition:

/*
 * CONFIG_IS_ENABLED(FOO) evaluates to
 *  1 if CONFIG_SPL_BUILD is undefined and CONFIG_FOO is set to 'y' or 'm',
 *  1 if CONFIG_SPL_BUILD is defined and CONFIG_SPL_FOO is set to 'y' or 'm',
 *  0 otherwise.
  
 */
#define CONFIG_IS_ENABLED(option) \
(config_enabled(CONFIG_VAL(option)) ||  \
 config_enabled(CONFIG_VAL(option##_MODULE))

if the building for SPL and SPL_DM_REGULATOR is enabled, then build in whatever 
is inside.

What exactly am I missing here ?

> Regards,
> Peng.
> 
> > if (!IS_ERR_OR_NULL(priv->vqmmc_dev)) {
> > ret = regulator_set_value(priv->vqmmc_dev, 330);
> > if (ret) {
> > @@ -823,7 +823,7 @@ static int esdhc_set_voltage(struct mmc *mmc)
> > 
> > return -EAGAIN;
> > case MMC_SIGNAL_VOLTAGE_180:
> > -#ifdef CONFIG_DM_REGULATOR
> > +#if CONFIG_IS_ENABLED(DM_REGULATOR)
> > if (!IS_ERR_OR_NULL(priv->vqmmc_dev)) {
> > ret = regulator_set_value(priv->vqmmc_dev, 180);
> > if (ret) {
> > @@ -1442,7 +1442,7 @@ static int fsl_esdhc_probe(struct udevice *dev)
> > int node = dev_of_offset(dev);
> > struct esdhc_soc_data *data =
> > (struct esdhc_soc_data *)dev_get_driver_data(dev); -#ifdef
> > CONFIG_DM_REGULATOR
> > +#if CONFIG_IS_ENABLED(DM_REGULATOR)
> > struct udevice *vqmmc_dev;
> >  #endif
> > fdt_addr_t addr;
> > @@ -1500,7 +1500,7 @@ static int fsl_esdhc_probe(struct udevice *dev)
> > 
> > priv->vs18_enable = 0;
> > 
> > -#ifdef CONFIG_DM_REGULATOR
> > +#if CONFIG_IS_ENABLED(DM_REGULATOR)
> > /*
> >  * If emmc I/O has a fixed voltage at 1.8V, this must be provided,
> >  * otherwise, emmc will work abnormally.
> > --
> > 2.7.4
> 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 08/22] arm: dts: Add all the imx6[q|qp|dl] sabre[auto|sd] u-boot dts[i] files

2019-01-30 Thread Abel Vesa
On 19-01-29 12:03:35, Tom Rini wrote:
> On Tue, Jan 29, 2019 at 11:30:47AM +0000, Abel Vesa wrote:
> > This allows us to keep the basic dts[i] files up-to-date with
> > the ones in kernel, but at the same time allowing the u-boot
> > to add its own properties to the existing nodes.
> > 
> > Signed-off-by: Abel Vesa 
> > ---
> >  arch/arm/dts/imx6dl-sabreauto-u-boot.dtsi  |  6 ++
> >  arch/arm/dts/imx6dl-sabresd-u-boot.dtsi|  6 ++
> >  arch/arm/dts/imx6q-sabreauto-u-boot.dtsi   |  6 ++
> >  arch/arm/dts/imx6q-sabresd-u-boot.dtsi |  6 ++
> >  arch/arm/dts/imx6qdl-sabreauto-u-boot.dtsi | 23 +++
> >  arch/arm/dts/imx6qdl-sabresd-u-boot.dtsi   | 14 ++
> >  arch/arm/dts/imx6qdl-u-boot.dtsi   |  4 ++--
> >  arch/arm/dts/imx6qp-sabreauto-u-boot.dtsi  |  6 ++
> >  arch/arm/dts/imx6qp-sabresd-u-boot.dtsi|  6 ++
> >  9 files changed, 75 insertions(+), 2 deletions(-)
> >  create mode 100644 arch/arm/dts/imx6dl-sabreauto-u-boot.dtsi
> >  create mode 100644 arch/arm/dts/imx6dl-sabresd-u-boot.dtsi
> >  create mode 100644 arch/arm/dts/imx6q-sabreauto-u-boot.dtsi
> >  create mode 100644 arch/arm/dts/imx6q-sabresd-u-boot.dtsi
> >  create mode 100644 arch/arm/dts/imx6qdl-sabreauto-u-boot.dtsi
> >  create mode 100644 arch/arm/dts/imx6qdl-sabresd-u-boot.dtsi
> >  create mode 100644 arch/arm/dts/imx6qp-sabreauto-u-boot.dtsi
> >  create mode 100644 arch/arm/dts/imx6qp-sabresd-u-boot.dtsi
> 
> Since a lot of these files are just #include the main one, is there not
> some rule under u_boot_dtsi_options in scripts/Makefile.lib that would
> match and pick that main one up automatically?
> 

OK, so I looked into it. The thing is, the CONFIG_SYS_SOC is not generic enough.
Lets take an example. For imx6dl-sabresd.dts, in order to include the most 
generic one
(or as you named it: 'the main one'), in this case imx6qdl-sabresd-u-boot.dtsi,
the CONFIG_SYS_SOC should be set to imx6qdl instead of imx6dl. I don't know
the implications if we make this rename, but this is why your suggestion doesn't
work as is. So I'll keep all the files for now.

> -- 
> Tom

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


Re: [U-Boot] [PATCH v2 08/22] arm: dts: Add all the imx6[q|qp|dl] sabre[auto|sd] u-boot dts[i] files

2019-01-30 Thread Abel Vesa
On 19-01-29 13:33:54, Peng Fan wrote:
> Hi Abel,
> 
> > -Original Message-
> > From: Abel Vesa
> > Sent: 2019年1月29日 19:31
> > To: Tom Rini ; Fabio Estevam
> > ; u-boot@lists.denx.de; dl-uboot-imx
> > ; Peng Fan 
> > Cc: Nitin Garg ; Abel Vesa 
> > Subject: [PATCH v2 08/22] arm: dts: Add all the imx6[q|qp|dl] sabre[auto|sd]
> > u-boot dts[i] files
> > 
> > This allows us to keep the basic dts[i] files up-to-date with the ones in 
> > kernel,
> > but at the same time allowing the u-boot to add its own properties to the
> > existing nodes.
> > 
> > Signed-off-by: Abel Vesa 
> > ---
> >  arch/arm/dts/imx6dl-sabreauto-u-boot.dtsi  |  6 ++
> >  arch/arm/dts/imx6dl-sabresd-u-boot.dtsi|  6 ++
> >  arch/arm/dts/imx6q-sabreauto-u-boot.dtsi   |  6 ++
> >  arch/arm/dts/imx6q-sabresd-u-boot.dtsi |  6 ++
> >  arch/arm/dts/imx6qdl-sabreauto-u-boot.dtsi | 23
> > +++
> >  arch/arm/dts/imx6qdl-sabresd-u-boot.dtsi   | 14 ++
> >  arch/arm/dts/imx6qdl-u-boot.dtsi   |  4 ++--
> >  arch/arm/dts/imx6qp-sabreauto-u-boot.dtsi  |  6 ++
> >  arch/arm/dts/imx6qp-sabresd-u-boot.dtsi|  6 ++
> >  9 files changed, 75 insertions(+), 2 deletions(-)  create mode 100644
> > arch/arm/dts/imx6dl-sabreauto-u-boot.dtsi
> >  create mode 100644 arch/arm/dts/imx6dl-sabresd-u-boot.dtsi
> >  create mode 100644 arch/arm/dts/imx6q-sabreauto-u-boot.dtsi
> >  create mode 100644 arch/arm/dts/imx6q-sabresd-u-boot.dtsi
> >  create mode 100644 arch/arm/dts/imx6qdl-sabreauto-u-boot.dtsi
> >  create mode 100644 arch/arm/dts/imx6qdl-sabresd-u-boot.dtsi
> >  create mode 100644 arch/arm/dts/imx6qp-sabreauto-u-boot.dtsi
> >  create mode 100644 arch/arm/dts/imx6qp-sabresd-u-boot.dtsi
> > 
> > diff --git a/arch/arm/dts/imx6dl-sabreauto-u-boot.dtsi
> > b/arch/arm/dts/imx6dl-sabreauto-u-boot.dtsi
> > new file mode 100644
> > index 000..b3f5f2d
> > --- /dev/null
> > +++ b/arch/arm/dts/imx6dl-sabreauto-u-boot.dtsi
> > @@ -0,0 +1,6 @@
> > +// SPDX-License-Identifier: GPL-2.0+
> > +/*
> > + * Copyright (C) 2018 Jagan Teki   */
> 
> Is this file copied from other places? Do you need to update Copyright?
> Same questions to the following files with Copyright.
> 

Oups, I took the icore implementation as example and forgot to
modify the copyright header. Will do in the next version.

> > +
> > +#include "imx6qdl-sabreauto-u-boot.dtsi"
> > diff --git a/arch/arm/dts/imx6dl-sabresd-u-boot.dtsi
> > b/arch/arm/dts/imx6dl-sabresd-u-boot.dtsi
> > new file mode 100644
> > index 000..e34cf3c
> > --- /dev/null
> > +++ b/arch/arm/dts/imx6dl-sabresd-u-boot.dtsi
> > @@ -0,0 +1,6 @@
> > +// SPDX-License-Identifier: GPL-2.0+
> > +/*
> > + * Copyright (C) 2018 Jagan Teki   */
> > +
> > +#include "imx6qdl-sabresd-u-boot.dtsi"
> > diff --git a/arch/arm/dts/imx6q-sabreauto-u-boot.dtsi
> > b/arch/arm/dts/imx6q-sabreauto-u-boot.dtsi
> > new file mode 100644
> > index 000..b3f5f2d
> > --- /dev/null
> > +++ b/arch/arm/dts/imx6q-sabreauto-u-boot.dtsi
> > @@ -0,0 +1,6 @@
> > +// SPDX-License-Identifier: GPL-2.0+
> > +/*
> > + * Copyright (C) 2018 Jagan Teki   */
> > +
> > +#include "imx6qdl-sabreauto-u-boot.dtsi"
> > diff --git a/arch/arm/dts/imx6q-sabresd-u-boot.dtsi
> > b/arch/arm/dts/imx6q-sabresd-u-boot.dtsi
> > new file mode 100644
> > index 000..e34cf3c
> > --- /dev/null
> > +++ b/arch/arm/dts/imx6q-sabresd-u-boot.dtsi
> > @@ -0,0 +1,6 @@
> > +// SPDX-License-Identifier: GPL-2.0+
> > +/*
> > + * Copyright (C) 2018 Jagan Teki   */
> > +
> > +#include "imx6qdl-sabresd-u-boot.dtsi"
> > diff --git a/arch/arm/dts/imx6qdl-sabreauto-u-boot.dtsi
> > b/arch/arm/dts/imx6qdl-sabreauto-u-boot.dtsi
> > new file mode 100644
> > index 000..3995849
> > --- /dev/null
> > +++ b/arch/arm/dts/imx6qdl-sabreauto-u-boot.dtsi
> > @@ -0,0 +1,23 @@
> > +// SPDX-License-Identifier: GPL-2.0+
> > +/*
> > + * Copyright (C) 2019 NXP
> > + */
> > +
> > +#include "imx6qdl-u-boot.dtsi"
> > +
> > +/ {
> > +   aliases {
> > +   mmc0 = 
> > +   };
> > +};
> > +
> > + {
> > +   no-1-8-v;
> > +   keep-power-in-suspend;
> > +   enable-sdio-wakeup;
> 
> You could drop the upper two lines. They are not used by U-Boot.
> 
> Regards,
> Peng.
> 
> > +   u-boot,dm-spl;
> > +};
>

Re: [U-Boot] [PATCH v2 17/22] board: mx6sabreauto: Remove the non-DM code

2019-01-30 Thread Abel Vesa
On 19-01-29 13:43:49, Peng Fan wrote:
> 
> 
> > -Original Message-
> > From: Abel Vesa
> > Sent: 2019年1月29日 19:35
> > To: Tom Rini ; Fabio Estevam
> > ; u-boot@lists.denx.de; dl-uboot-imx
> > ; Peng Fan 
> > Cc: Nitin Garg ; Abel Vesa 
> > Subject: [PATCH v2 17/22] board: mx6sabreauto: Remove the non-DM code
> > 
> > Since the mx6sabreauto has DM support, remove the unused non-DM code
> > from mx6sabreauto board file.
> 
> Has DM_PCA953X been enabled?
> 

No. Why?

> Regards,
> Peng.
> 
> > 
> > Signed-off-by: Abel Vesa 
> > ---
> >  board/freescale/mx6sabreauto/mx6sabreauto.c | 70
> > -
> >  1 file changed, 70 deletions(-)
> > 
> > diff --git a/board/freescale/mx6sabreauto/mx6sabreauto.c
> > b/board/freescale/mx6sabreauto/mx6sabreauto.c
> > index c7e3e67..dd72de9 100644
> > --- a/board/freescale/mx6sabreauto/mx6sabreauto.c
> > +++ b/board/freescale/mx6sabreauto/mx6sabreauto.c
> > @@ -159,44 +159,6 @@ static iomux_v3_cfg_t const port_exp[] = {
> > IOMUX_PADS(PAD_SD2_DAT0__GPIO1_IO15 |
> > MUX_PAD_CTRL(NO_PAD_CTRL)),
> >  };
> > 
> > -/*Define for building port exp gpio, pin starts from 0*/ -#define
> > PORTEXP_IO_NR(chip, pin) \
> > -   ((chip << 5) + pin)
> > -
> > -/*Get the chip addr from a ioexp gpio*/ -#define
> > PORTEXP_IO_TO_CHIP(gpio_nr) \
> > -   (gpio_nr >> 5)
> > -
> > -/*Get the pin number from a ioexp gpio*/ -#define
> > PORTEXP_IO_TO_PIN(gpio_nr) \
> > -   (gpio_nr & 0x1f)
> > -
> > -static int port_exp_direction_output(unsigned gpio, int value) -{
> > -   int ret;
> > -
> > -   i2c_set_bus_num(2);
> > -   ret = i2c_probe(PORTEXP_IO_TO_CHIP(gpio));
> > -   if (ret)
> > -   return ret;
> > -
> > -   ret = pca953x_set_dir(PORTEXP_IO_TO_CHIP(gpio),
> > -   (1 << PORTEXP_IO_TO_PIN(gpio)),
> > -   (PCA953X_DIR_OUT << PORTEXP_IO_TO_PIN(gpio)));
> > -
> > -   if (ret)
> > -   return ret;
> > -
> > -   ret = pca953x_set_val(PORTEXP_IO_TO_CHIP(gpio),
> > -   (1 << PORTEXP_IO_TO_PIN(gpio)),
> > -   (value << PORTEXP_IO_TO_PIN(gpio)));
> > -
> > -   if (ret)
> > -   return ret;
> > -
> > -   return 0;
> > -}
> > -
> >  #ifdef CONFIG_MTD_NOR_FLASH
> >  static iomux_v3_cfg_t const eimnor_pads[] = {
> > IOMUX_PADS(PAD_EIM_D16__EIM_DATA16  |
> > MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL)),
> > @@ -681,19 +643,10 @@ int checkboard(void)  }
> > 
> >  #ifdef CONFIG_USB_EHCI_MX6
> > -#define USB_HOST1_PWR PORTEXP_IO_NR(0x32, 7)
> > -#define USB_OTG_PWR   PORTEXP_IO_NR(0x34, 1)
> > -
> > -iomux_v3_cfg_t const usb_otg_pads[] = {
> > -   IOMUX_PADS(PAD_ENET_RX_ER__USB_OTG_ID |
> > MUX_PAD_CTRL(NO_PAD_CTRL)),
> > -};
> > -
> >  int board_ehci_hcd_init(int port)
> >  {
> > switch (port) {
> > case 0:
> > -   SETUP_IOMUX_PADS(usb_otg_pads);
> > -
> > /*
> >   * Set daisy chain for otg_pin_id on 6q.
> >  *  For 6dl, this bit is reserved.
> > @@ -708,29 +661,6 @@ int board_ehci_hcd_init(int port)
> > }
> > return 0;
> >  }
> > -
> > -int board_ehci_power(int port, int on)
> > -{
> > -   switch (port) {
> > -   case 0:
> > -   if (on)
> > -   port_exp_direction_output(USB_OTG_PWR, 1);
> > -   else
> > -   port_exp_direction_output(USB_OTG_PWR, 0);
> > -   break;
> > -   case 1:
> > -   if (on)
> > -   port_exp_direction_output(USB_HOST1_PWR, 1);
> > -   else
> > -   port_exp_direction_output(USB_HOST1_PWR, 0);
> > -   break;
> > -   default:
> > -   printf("MXC USB port %d not yet supported\n", port);
> > -   return -EINVAL;
> > -   }
> > -
> > -   return 0;
> > -}
> >  #endif
> > 
> >  #ifdef CONFIG_SPL_BUILD
> > --
> > 2.7.4
> 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2 20/22] configs: mx6sabresd: Reduce size for SPL by disabling SPL_DOS and SPL_EFI

2019-01-29 Thread Abel Vesa
With DM and FIT enabled in SPL, there is an sram overflow.
By disabling CONFIG_SPL_DOS_PARTITION and CONFIG_SPL_EFI_PARTITION,
we get to keep the 'one binary to fit all' for imx6[q|qp|dl]
on sabresd since the final SPL image is now under 64KB.

Signed-off-by: Abel Vesa 
---
 configs/mx6sabresd_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configs/mx6sabresd_defconfig b/configs/mx6sabresd_defconfig
index 14adf65..26d30fd 100644
--- a/configs/mx6sabresd_defconfig
+++ b/configs/mx6sabresd_defconfig
@@ -56,6 +56,8 @@ CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_EFI_PARTITION=y
+# CONFIG_SPL_DOS_PARTITION is not set
+# CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_OF_CONTROL=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="imx6q-sabresd"
-- 
2.7.4

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


[U-Boot] [PATCH v2 16/22] configs: mx6sabresd: Add DM_SPI_FLASH necessary configs

2019-01-29 Thread Abel Vesa
Enable all neceassary configs to support DM_SPI_FLASH on mx6sabresd.

Signed-off-by: Abel Vesa 
---
 configs/mx6sabresd_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configs/mx6sabresd_defconfig b/configs/mx6sabresd_defconfig
index 4f3a619..14adf65 100644
--- a/configs/mx6sabresd_defconfig
+++ b/configs/mx6sabresd_defconfig
@@ -74,6 +74,7 @@ CONFIG_FASTBOOT_FLASH_MMC_DEV=2
 CONFIG_DM_GPIO=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
@@ -81,6 +82,7 @@ CONFIG_MII=y
 CONFIG_PCI=y
 CONFIG_DM_REGULATOR=y
 CONFIG_SPI=y
+CONFIG_DM_SPI=y
 CONFIG_MXC_SPI=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
-- 
2.7.4

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


[U-Boot] [PATCH v2 14/22] mx6sabresd: Add DM_GPIO support

2019-01-29 Thread Abel Vesa
Add the DM_GPIO related config for mx6sabresd.
Also add the gpio request calls.

Signed-off-by: Abel Vesa 
---
 board/freescale/mx6sabresd/mx6sabresd.c | 5 +
 configs/mx6sabresd_defconfig| 1 +
 2 files changed, 6 insertions(+)

diff --git a/board/freescale/mx6sabresd/mx6sabresd.c 
b/board/freescale/mx6sabresd/mx6sabresd.c
index 4688095..99002bd 100644
--- a/board/freescale/mx6sabresd/mx6sabresd.c
+++ b/board/freescale/mx6sabresd/mx6sabresd.c
@@ -96,6 +96,7 @@ static void setup_iomux_enet(void)
SETUP_IOMUX_PADS(enet_pads);
 
/* Reset AR8031 PHY */
+   gpio_request(IMX_GPIO_NR(1, 25), "ENET PHY Reset");
gpio_direction_output(IMX_GPIO_NR(1, 25) , 0);
mdelay(10);
gpio_set_value(IMX_GPIO_NR(1, 25), 1);
@@ -189,6 +190,7 @@ static iomux_v3_cfg_t const bl_pads[] = {
 static void enable_backlight(void)
 {
SETUP_IOMUX_PADS(bl_pads);
+   gpio_request(DISP0_PWR_EN, "Display Power Enable");
gpio_direction_output(DISP0_PWR_EN, 1);
 }
 
@@ -307,11 +309,13 @@ int board_mmc_init(bd_t *bis)
switch (i) {
case 0:
SETUP_IOMUX_PADS(usdhc2_pads);
+   gpio_request(USDHC2_CD_GPIO, "USDHC2 CD");
gpio_direction_input(USDHC2_CD_GPIO);
usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK);
break;
case 1:
SETUP_IOMUX_PADS(usdhc3_pads);
+   gpio_request(USDHC3_CD_GPIO, "USDHC3 CD");
gpio_direction_input(USDHC3_CD_GPIO);
usdhc_cfg[1].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK);
break;
@@ -729,6 +733,7 @@ int checkboard(void)
 #ifdef CONFIG_SPL_OS_BOOT
 int spl_start_uboot(void)
 {
+   gpio_request(KEY_VOL_UP, "KEY Volume UP");
gpio_direction_input(KEY_VOL_UP);
 
/* Only enter in Falcon mode if KEY_VOL_UP is pressed */
diff --git a/configs/mx6sabresd_defconfig b/configs/mx6sabresd_defconfig
index 2b585b2..4f3a619 100644
--- a/configs/mx6sabresd_defconfig
+++ b/configs/mx6sabresd_defconfig
@@ -71,6 +71,7 @@ CONFIG_FASTBOOT_BUF_ADDR=0x1200
 CONFIG_FASTBOOT_BUF_SIZE=0x1000
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=2
+CONFIG_DM_GPIO=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_SPI_FLASH=y
-- 
2.7.4

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


[U-Boot] [PATCH v2 21/22] board: mx6sabreauto: Update README with the SPL DM FIT info

2019-01-29 Thread Abel Vesa
There is a new step now. The need to build the u-boot.itb.
And instead of flashing the .img file, now the .itb file needs
to be flashed.

Signed-off-by: Abel Vesa 
---
 board/freescale/mx6sabreauto/README | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/board/freescale/mx6sabreauto/README 
b/board/freescale/mx6sabreauto/README
index e8c589b..960a7d7 100644
--- a/board/freescale/mx6sabreauto/README
+++ b/board/freescale/mx6sabreauto/README
@@ -8,6 +8,7 @@ In order to build it:
 $ make mx6sabreauto_defconfig
 
 $ make
+$ make u-boot.itb
 
 This will generate the SPL and u-boot.img binaries.
 
@@ -17,7 +18,7 @@ $ sudo dd if=SPL of=/dev/sdX bs=1K seek=1 && sync
 
 - Flash the u-boot.img binary into the SD card:
 
-$ sudo dd if=u-boot.img of=/dev/sdX bs=1K seek=69 && sync
+$ sudo dd if=u-boot.itb of=/dev/sdX bs=1K seek=69 && sync
 
 Booting via Falcon mode
 ---
@@ -31,6 +32,7 @@ In order to build it:
 $ make mx6sabreauto_defconfig
 
 $ make
+$ make u-boot.itb
 
 This will generate the SPL image called SPL and the u-boot.img.
 
@@ -40,7 +42,7 @@ $ sudo dd if=SPL of=/dev/sdb bs=1K seek=1 && sync
 
 - Flash the u-boot.img image into the SD card:
 
-$ sudo dd if=u-boot.img of=/dev/sdb bs=1K seek=69 && sync
+$ sudo dd if=u-boot.itb of=/dev/sdb bs=1K seek=69 && sync
 
 Create a FAT16 boot partition to store uImage and the dtb file, then copy the 
files there:
 
-- 
2.7.4

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


[U-Boot] [PATCH v2 15/22] configs: mx6sabreauto: Add DM_SPI_FLASH necessary configs

2019-01-29 Thread Abel Vesa
Enable all neceassary configs to support DM_SPI_FLASH on mx6sabreauto.

Signed-off-by: Abel Vesa 
---
 configs/mx6sabreauto_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configs/mx6sabreauto_defconfig b/configs/mx6sabreauto_defconfig
index 4a9739c..e1b4b2f 100644
--- a/configs/mx6sabreauto_defconfig
+++ b/configs/mx6sabreauto_defconfig
@@ -65,12 +65,14 @@ CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_NAND=y
 CONFIG_NAND_MXS=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
 CONFIG_MII=y
 CONFIG_DM_REGULATOR=y
 CONFIG_SPI=y
+CONFIG_DM_SPI=y
 CONFIG_MXC_SPI=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
-- 
2.7.4

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


[U-Boot] [PATCH v2 11/22] configs: mx6sabreauto: Add SPL FIT and DM support

2019-01-29 Thread Abel Vesa
Enable all the necessary configs for SPL DM and FIT support for
mx6sabreauto.

Signed-off-by: Abel Vesa 
---
 configs/mx6sabreauto_defconfig | 17 -
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/configs/mx6sabreauto_defconfig b/configs/mx6sabreauto_defconfig
index 4bdcbb1..c64ec66 100644
--- a/configs/mx6sabreauto_defconfig
+++ b/configs/mx6sabreauto_defconfig
@@ -4,19 +4,28 @@ CONFIG_SYS_TEXT_BASE=0x1780
 CONFIG_SPL_GPIO_SUPPORT=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
+CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_TARGET_MX6SABREAUTO=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_SPL_SYS_MALLOC_F_LEN=0x400
 CONFIG_SPL=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_NXP_BOARD_REVISION=y
 CONFIG_NR_DRAM_BANKS=1
+CONFIG_TPL_SYS_MALLOC_F_LEN=0x400
+CONFIG_FIT=y
+CONFIG_SPL_FIT_PRINT=y
+CONFIG_SPL_LOAD_FIT=y
+CONFIG_SPL_FIT_SOURCE="arch/arm/mach-imx/mx6/fit_spl.its"
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_BOUNCE_BUFFER=y
+CONFIG_SPL_SEPARATE_BSS=y
+CONFIG_SPL_FIT_IMAGE_TINY=y
 CONFIG_SPL_EXT_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_WATCHDOG_SUPPORT=y
@@ -40,8 +49,15 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
+CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="imx6q-sabreauto"
+CONFIG_OF_LIST="imx6dl-sabreauto imx6q-sabreauto imx6qp-sabreauto"
+CONFIG_MULTI_DTB_FIT=y
+CONFIG_SPL_MULTI_DTB_FIT=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
+CONFIG_SPL_DM=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_SF=y
 CONFIG_DM_MMC=y
@@ -68,4 +84,3 @@ CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
-CONFIG_OF_LIBFDT=y
-- 
2.7.4

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


[U-Boot] [PATCH v2 18/22] board: mx6sabresd: Remove non-DM code

2019-01-29 Thread Abel Vesa
Since the mx6sabreauto has DM support, remove the unused non-DM code
from mx6sabresd board file.

Signed-off-by: Abel Vesa 
---
 board/freescale/mx6sabresd/mx6sabresd.c | 50 -
 1 file changed, 50 deletions(-)

diff --git a/board/freescale/mx6sabresd/mx6sabresd.c 
b/board/freescale/mx6sabresd/mx6sabresd.c
index 99002bd..0824a05 100644
--- a/board/freescale/mx6sabresd/mx6sabresd.c
+++ b/board/freescale/mx6sabresd/mx6sabresd.c
@@ -563,63 +563,13 @@ int board_eth_init(bd_t *bis)
 }
 
 #ifdef CONFIG_USB_EHCI_MX6
-#define USB_OTHERREGS_OFFSET   0x800
-#define UCTRL_PWR_POL  (1 << 9)
-
-static iomux_v3_cfg_t const usb_otg_pads[] = {
-   IOMUX_PADS(PAD_EIM_D22__USB_OTG_PWR | MUX_PAD_CTRL(NO_PAD_CTRL)),
-   IOMUX_PADS(PAD_ENET_RX_ER__USB_OTG_ID | MUX_PAD_CTRL(NO_PAD_CTRL)),
-};
-
-static iomux_v3_cfg_t const usb_hc1_pads[] = {
-   IOMUX_PADS(PAD_ENET_TXD1__GPIO1_IO29 | MUX_PAD_CTRL(NO_PAD_CTRL)),
-};
-
 static void setup_usb(void)
 {
-   SETUP_IOMUX_PADS(usb_otg_pads);
-
/*
 * set daisy chain for otg_pin_id on 6q.
 * for 6dl, this bit is reserved
 */
imx_iomux_set_gpr_register(1, 13, 1, 0);
-
-   SETUP_IOMUX_PADS(usb_hc1_pads);
-}
-
-int board_ehci_hcd_init(int port)
-{
-   u32 *usbnc_usb_ctrl;
-
-   if (port > 1)
-   return -EINVAL;
-
-   usbnc_usb_ctrl = (u32 *)(USB_BASE_ADDR + USB_OTHERREGS_OFFSET +
-port * 4);
-
-   setbits_le32(usbnc_usb_ctrl, UCTRL_PWR_POL);
-
-   return 0;
-}
-
-int board_ehci_power(int port, int on)
-{
-   switch (port) {
-   case 0:
-   break;
-   case 1:
-   if (on)
-   gpio_direction_output(IMX_GPIO_NR(1, 29), 1);
-   else
-   gpio_direction_output(IMX_GPIO_NR(1, 29), 0);
-   break;
-   default:
-   printf("MXC USB port %d not yet supported\n", port);
-   return -EINVAL;
-   }
-
-   return 0;
 }
 #endif
 
-- 
2.7.4

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


[U-Boot] [PATCH v2 12/22] configs: mx6sabresd: Add SPL FIT and DM support

2019-01-29 Thread Abel Vesa
Enable all the necessary configs for SPL DM and FIT support for
mx6sabresd.

Signed-off-by: Abel Vesa 
---
 configs/mx6sabresd_defconfig | 23 +--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/configs/mx6sabresd_defconfig b/configs/mx6sabresd_defconfig
index 3babfd5..2b585b2 100644
--- a/configs/mx6sabresd_defconfig
+++ b/configs/mx6sabresd_defconfig
@@ -4,18 +4,27 @@ CONFIG_SYS_TEXT_BASE=0x1780
 CONFIG_SPL_GPIO_SUPPORT=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
+CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_TARGET_MX6SABRESD=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_SPL_SYS_MALLOC_F_LEN=0x400
 CONFIG_SPL=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_NR_DRAM_BANKS=1
+CONFIG_TPL_SYS_MALLOC_F_LEN=0x400
+CONFIG_FIT=y
+CONFIG_SPL_FIT_PRINT=y
+CONFIG_SPL_LOAD_FIT=y
+CONFIG_SPL_FIT_SOURCE="arch/arm/mach-imx/mx6/fit_spl.its"
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_BOUNCE_BUFFER=y
+CONFIG_SPL_SEPARATE_BSS=y
+CONFIG_SPL_FIT_IMAGE_TINY=y
 CONFIG_SPL_EXT_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
@@ -47,23 +56,34 @@ CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_EFI_PARTITION=y
+CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="imx6q-sabresd"
+CONFIG_OF_LIST="imx6q-sabresd imx6qp-sabresd imx6dl-sabresd"
+CONFIG_MULTI_DTB_FIT=y
+CONFIG_SPL_MULTI_DTB_FIT=y
+CONFIG_SPL_OF_LIST="imx6dl-sabresd imx6q-sabresd imx6qp-sabresd"
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
+CONFIG_SPL_DM=y
 CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x1200
 CONFIG_FASTBOOT_BUF_SIZE=0x1000
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=2
+CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
 CONFIG_MII=y
 CONFIG_PCI=y
+CONFIG_DM_REGULATOR=y
 CONFIG_SPI=y
 CONFIG_MXC_SPI=y
 CONFIG_USB=y
-CONFIG_USB_STORAGE=y
+CONFIG_DM_USB=y
+# CONFIG_SPL_DM_USB is not set
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="FSL"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0525
@@ -73,4 +93,3 @@ CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
-CONFIG_OF_LIBFDT=y
-- 
2.7.4

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


[U-Boot] [PATCH v2 22/22] board: mx6sabresd: Update README with the SPL DM FIT info

2019-01-29 Thread Abel Vesa
There is a new step now. The need to build the u-boot.itb.
And instead of flashing the .img file, now the .itb file needs
to be flashed.

Signed-off-by: Abel Vesa 
---
 board/freescale/mx6sabresd/README | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/board/freescale/mx6sabresd/README 
b/board/freescale/mx6sabresd/README
index 4b4df06..9b7f7cd 100644
--- a/board/freescale/mx6sabresd/README
+++ b/board/freescale/mx6sabresd/README
@@ -20,6 +20,7 @@ In order to build it:
 $ make mx6sabresd_defconfig
 
 $ make
+$ make u-boot.itb
 
 This will generate the SPL and u-boot.img binaries.
 
@@ -29,7 +30,7 @@ $ sudo dd if=SPL of=/dev/sdX bs=1K seek=1 && sync
 
 - Flash the u-boot.img binary into the SD card:
 
-$ sudo dd if=u-boot.img of=/dev/sdX bs=1K seek=69 && sync
+$ sudo dd if=u-boot.itb of=/dev/sdX bs=1K seek=69 && sync
 
 
 2. Booting from eMMC
@@ -38,6 +39,7 @@ $ sudo dd if=u-boot.img of=/dev/sdX bs=1K seek=69 && sync
 $ make mx6sabresd_defconfig
 
 $ make
+$ make u-boot.itb
 
 This will generate the SPL and u-boot.img binaries.
 
@@ -54,7 +56,7 @@ Mount the eMMC in the host PC:
 - Flash SPL and u-boot.img binaries into the eMMC:
 
 $ sudo dd if=SPL of=/dev/sdX bs=1K seek=1 && sync
-$ sudo dd if=u-boot.img of=/dev/sdX bs=1K seek=69 && sync
+$ sudo dd if=u-boot.itb of=/dev/sdX bs=1K seek=69 && sync
 
 Set SW6 to eMMC 8-bit boot: 11010110
 
@@ -64,6 +66,7 @@ Set SW6 to eMMC 8-bit boot: 11010110
 
 $ make mx6sabresd_defconfig
 $ make
+$ make u-boot.itb
 
 This will generate the SPL image called SPL and the u-boot.img.
 
@@ -73,7 +76,7 @@ $ sudo dd if=SPL of=/dev/sdX bs=1K seek=1 oflag=sync 
status=none && sync
 
 - Flash the u-boot.img image into the SD card:
 
-$ sudo dd if=u-boot.img of=/dev/sdX bs=1K seek=69 oflag=sync status=none && 
sync
+$ sudo dd if=u-boot.itb of=/dev/sdX bs=1K seek=69 oflag=sync status=none && 
sync
 
 Create a partition for root file system and extract it there:
 
-- 
2.7.4

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


[U-Boot] [PATCH v2 19/22] board: mx6sabresd: Remove the enet reset gpio handling

2019-01-29 Thread Abel Vesa
Rely on the phy-reset-gpios which is set in imx6qdl-sabresd dtsi
and get rid of the enet reset gpio handling from the board file.

Signed-off-by: Abel Vesa 
---
 board/freescale/mx6sabresd/mx6sabresd.c | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/board/freescale/mx6sabresd/mx6sabresd.c 
b/board/freescale/mx6sabresd/mx6sabresd.c
index 0824a05..385a18e 100644
--- a/board/freescale/mx6sabresd/mx6sabresd.c
+++ b/board/freescale/mx6sabresd/mx6sabresd.c
@@ -94,13 +94,6 @@ static iomux_v3_cfg_t const enet_pads[] = {
 static void setup_iomux_enet(void)
 {
SETUP_IOMUX_PADS(enet_pads);
-
-   /* Reset AR8031 PHY */
-   gpio_request(IMX_GPIO_NR(1, 25), "ENET PHY Reset");
-   gpio_direction_output(IMX_GPIO_NR(1, 25) , 0);
-   mdelay(10);
-   gpio_set_value(IMX_GPIO_NR(1, 25), 1);
-   udelay(100);
 }
 
 static iomux_v3_cfg_t const usdhc2_pads[] = {
-- 
2.7.4

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


[U-Boot] [PATCH v2 13/22] mx6sabreauto: Add DM_GPIO support

2019-01-29 Thread Abel Vesa
Add the DM_GPIO related config for mx6sabreauto.
Also add the gpio request calls.

Signed-off-by: Abel Vesa 
---
 board/freescale/mx6sabreauto/mx6sabreauto.c | 3 +++
 configs/mx6sabreauto_defconfig  | 1 +
 2 files changed, 4 insertions(+)

diff --git a/board/freescale/mx6sabreauto/mx6sabreauto.c 
b/board/freescale/mx6sabreauto/mx6sabreauto.c
index c8f1263..c7e3e67 100644
--- a/board/freescale/mx6sabreauto/mx6sabreauto.c
+++ b/board/freescale/mx6sabreauto/mx6sabreauto.c
@@ -501,6 +501,7 @@ iomux_v3_cfg_t const backlight_pads[] = {
 
 static void setup_iomux_backlight(void)
 {
+   gpio_request(IMX_GPIO_NR(2, 9), "backlight");
gpio_direction_output(IMX_GPIO_NR(2, 9), 1);
SETUP_IOMUX_PADS(backlight_pads);
 }
@@ -594,6 +595,7 @@ int board_init(void)
else
setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, _i2c_pad_info1);
/* I2C 3 Steer */
+   gpio_request(IMX_GPIO_NR(5, 4), "steer logic");
gpio_direction_output(IMX_GPIO_NR(5, 4), 1);
SETUP_IOMUX_PADS(i2c3_pads);
 #ifndef CONFIG_SYS_FLASH_CFI
@@ -602,6 +604,7 @@ int board_init(void)
else
setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, _i2c_pad_info2);
 #endif
+   gpio_request(IMX_GPIO_NR(1, 15), "expander en");
gpio_direction_output(IMX_GPIO_NR(1, 15), 1);
SETUP_IOMUX_PADS(port_exp);
 
diff --git a/configs/mx6sabreauto_defconfig b/configs/mx6sabreauto_defconfig
index c64ec66..4a9739c 100644
--- a/configs/mx6sabreauto_defconfig
+++ b/configs/mx6sabreauto_defconfig
@@ -60,6 +60,7 @@ CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_SPL_DM=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_SF=y
+CONFIG_DM_GPIO=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_NAND=y
-- 
2.7.4

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


[U-Boot] [PATCH v2 17/22] board: mx6sabreauto: Remove the non-DM code

2019-01-29 Thread Abel Vesa
Since the mx6sabreauto has DM support, remove the unused non-DM code
from mx6sabreauto board file.

Signed-off-by: Abel Vesa 
---
 board/freescale/mx6sabreauto/mx6sabreauto.c | 70 -
 1 file changed, 70 deletions(-)

diff --git a/board/freescale/mx6sabreauto/mx6sabreauto.c 
b/board/freescale/mx6sabreauto/mx6sabreauto.c
index c7e3e67..dd72de9 100644
--- a/board/freescale/mx6sabreauto/mx6sabreauto.c
+++ b/board/freescale/mx6sabreauto/mx6sabreauto.c
@@ -159,44 +159,6 @@ static iomux_v3_cfg_t const port_exp[] = {
IOMUX_PADS(PAD_SD2_DAT0__GPIO1_IO15 | MUX_PAD_CTRL(NO_PAD_CTRL)),
 };
 
-/*Define for building port exp gpio, pin starts from 0*/
-#define PORTEXP_IO_NR(chip, pin) \
-   ((chip << 5) + pin)
-
-/*Get the chip addr from a ioexp gpio*/
-#define PORTEXP_IO_TO_CHIP(gpio_nr) \
-   (gpio_nr >> 5)
-
-/*Get the pin number from a ioexp gpio*/
-#define PORTEXP_IO_TO_PIN(gpio_nr) \
-   (gpio_nr & 0x1f)
-
-static int port_exp_direction_output(unsigned gpio, int value)
-{
-   int ret;
-
-   i2c_set_bus_num(2);
-   ret = i2c_probe(PORTEXP_IO_TO_CHIP(gpio));
-   if (ret)
-   return ret;
-
-   ret = pca953x_set_dir(PORTEXP_IO_TO_CHIP(gpio),
-   (1 << PORTEXP_IO_TO_PIN(gpio)),
-   (PCA953X_DIR_OUT << PORTEXP_IO_TO_PIN(gpio)));
-
-   if (ret)
-   return ret;
-
-   ret = pca953x_set_val(PORTEXP_IO_TO_CHIP(gpio),
-   (1 << PORTEXP_IO_TO_PIN(gpio)),
-   (value << PORTEXP_IO_TO_PIN(gpio)));
-
-   if (ret)
-   return ret;
-
-   return 0;
-}
-
 #ifdef CONFIG_MTD_NOR_FLASH
 static iomux_v3_cfg_t const eimnor_pads[] = {
IOMUX_PADS(PAD_EIM_D16__EIM_DATA16  | 
MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL)),
@@ -681,19 +643,10 @@ int checkboard(void)
 }
 
 #ifdef CONFIG_USB_EHCI_MX6
-#define USB_HOST1_PWR PORTEXP_IO_NR(0x32, 7)
-#define USB_OTG_PWR   PORTEXP_IO_NR(0x34, 1)
-
-iomux_v3_cfg_t const usb_otg_pads[] = {
-   IOMUX_PADS(PAD_ENET_RX_ER__USB_OTG_ID | MUX_PAD_CTRL(NO_PAD_CTRL)),
-};
-
 int board_ehci_hcd_init(int port)
 {
switch (port) {
case 0:
-   SETUP_IOMUX_PADS(usb_otg_pads);
-
/*
  * Set daisy chain for otg_pin_id on 6q.
 *  For 6dl, this bit is reserved.
@@ -708,29 +661,6 @@ int board_ehci_hcd_init(int port)
}
return 0;
 }
-
-int board_ehci_power(int port, int on)
-{
-   switch (port) {
-   case 0:
-   if (on)
-   port_exp_direction_output(USB_OTG_PWR, 1);
-   else
-   port_exp_direction_output(USB_OTG_PWR, 0);
-   break;
-   case 1:
-   if (on)
-   port_exp_direction_output(USB_HOST1_PWR, 1);
-   else
-   port_exp_direction_output(USB_HOST1_PWR, 0);
-   break;
-   default:
-   printf("MXC USB port %d not yet supported\n", port);
-   return -EINVAL;
-   }
-
-   return 0;
-}
 #endif
 
 #ifdef CONFIG_SPL_BUILD
-- 
2.7.4

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


[U-Boot] [PATCH v2 10/22] arm: imx: Add FIT SPL its

2019-01-29 Thread Abel Vesa
Add simple its in order to allow SPL to boot u-boot proper
via FIT table.

Signed-off-by: Abel Vesa 
---
 arch/arm/mach-imx/mx6/fit_spl.its | 41 +++
 1 file changed, 41 insertions(+)
 create mode 100644 arch/arm/mach-imx/mx6/fit_spl.its

diff --git a/arch/arm/mach-imx/mx6/fit_spl.its 
b/arch/arm/mach-imx/mx6/fit_spl.its
new file mode 100644
index 000..bf3ffee
--- /dev/null
+++ b/arch/arm/mach-imx/mx6/fit_spl.its
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2018 NXP
+ *
+ * Simple U-boot fit source file containing U-Boot (with dtb appended)
+ */
+
+/dts-v1/;
+
+/ {
+   description = "Image for u-boot proper (with dtb appended)";
+   #address-cells = <1>;
+
+   images {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   uboot@1 {
+   reg = <0>;
+   description = "U-Boot";
+   data = /incbin/("../../../../u-boot-fit-dtb.bin");
+   type = "standalone";
+   os = "U-Boot";
+   compression = "none";
+   arch = "arm";
+   load = <0x1780>;
+   };
+   };
+
+   configurations {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   default = "conf@1";
+
+   conf@1 {
+   reg = <0>;
+   description = "i.MX armv7";
+   loadables = "uboot@1";
+   };
+   };
+};
-- 
2.7.4

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


[U-Boot] [PATCH v2 05/22] mmc: fsl_esdhc: Fix DM_REGULATOR ifdefs for SPL builds

2019-01-29 Thread Abel Vesa
Since the fsl_esdhc will also be used by SPL, make the
preprocessor switches more generic to allow any kind of build.

Signed-off-by: Abel Vesa 
---
 drivers/mmc/fsl_esdhc.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
index b8171ba..47f2a8f 100644
--- a/drivers/mmc/fsl_esdhc.c
+++ b/drivers/mmc/fsl_esdhc.c
@@ -804,7 +804,7 @@ static int esdhc_set_voltage(struct mmc *mmc)
case MMC_SIGNAL_VOLTAGE_330:
if (priv->vs18_enable)
return -EIO;
-#ifdef CONFIG_DM_REGULATOR
+#if CONFIG_IS_ENABLED(DM_REGULATOR)
if (!IS_ERR_OR_NULL(priv->vqmmc_dev)) {
ret = regulator_set_value(priv->vqmmc_dev, 330);
if (ret) {
@@ -823,7 +823,7 @@ static int esdhc_set_voltage(struct mmc *mmc)
 
return -EAGAIN;
case MMC_SIGNAL_VOLTAGE_180:
-#ifdef CONFIG_DM_REGULATOR
+#if CONFIG_IS_ENABLED(DM_REGULATOR)
if (!IS_ERR_OR_NULL(priv->vqmmc_dev)) {
ret = regulator_set_value(priv->vqmmc_dev, 180);
if (ret) {
@@ -1442,7 +1442,7 @@ static int fsl_esdhc_probe(struct udevice *dev)
int node = dev_of_offset(dev);
struct esdhc_soc_data *data =
(struct esdhc_soc_data *)dev_get_driver_data(dev);
-#ifdef CONFIG_DM_REGULATOR
+#if CONFIG_IS_ENABLED(DM_REGULATOR)
struct udevice *vqmmc_dev;
 #endif
fdt_addr_t addr;
@@ -1500,7 +1500,7 @@ static int fsl_esdhc_probe(struct udevice *dev)
 
priv->vs18_enable = 0;
 
-#ifdef CONFIG_DM_REGULATOR
+#if CONFIG_IS_ENABLED(DM_REGULATOR)
/*
 * If emmc I/O has a fixed voltage at 1.8V, this must be provided,
 * otherwise, emmc will work abnormally.
-- 
2.7.4

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


[U-Boot] [PATCH v2 09/22] arm: dts: Update all the dts[i] files for imx6[q|qp|dl] sabre[auto|sd]

2019-01-29 Thread Abel Vesa
Update all the dts[i] files for imx6[q|qp|dl] sabre[auto|sd] to the ones
from kernel v4.20 (commit 8fe28cb58bcb2).

Signed-off-by: Abel Vesa 
---
 arch/arm/dts/Makefile   |   8 +-
 arch/arm/dts/imx6dl-sabreauto.dts   |  13 +
 arch/arm/dts/imx6dl-sabresd.dts |  18 +
 arch/arm/dts/imx6dl.dtsi| 306 --
 arch/arm/dts/imx6q-sabreauto.dts|  18 +
 arch/arm/dts/imx6q-sabresd.dts  |  23 +
 arch/arm/dts/imx6q.dtsi | 310 --
 arch/arm/dts/imx6qdl-sabreauto.dtsi | 810 
 arch/arm/dts/imx6qdl-sabresd.dtsi   | 741 +
 arch/arm/dts/imx6qdl.dtsi   | 455 +++-
 arch/arm/dts/imx6qp-sabreauto.dts   |  55 +++
 arch/arm/dts/imx6qp-sabresd.dts |  55 +++
 arch/arm/dts/imx6qp.dtsi| 115 +
 13 files changed, 2669 insertions(+), 258 deletions(-)
 create mode 100644 arch/arm/dts/imx6dl-sabreauto.dts
 create mode 100644 arch/arm/dts/imx6dl-sabresd.dts
 create mode 100644 arch/arm/dts/imx6q-sabreauto.dts
 create mode 100644 arch/arm/dts/imx6q-sabresd.dts
 create mode 100644 arch/arm/dts/imx6qdl-sabreauto.dtsi
 create mode 100644 arch/arm/dts/imx6qdl-sabresd.dtsi
 create mode 100644 arch/arm/dts/imx6qp-sabreauto.dts
 create mode 100644 arch/arm/dts/imx6qp-sabresd.dts
 create mode 100644 arch/arm/dts/imx6qp.dtsi

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 5c3225b..c18da3d 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -443,7 +443,13 @@ dtb-$(CONFIG_MX6QDL) += \
imx6q-icore.dtb \
imx6q-icore-mipi.dtb \
imx6q-icore-rqs.dtb \
-   imx6q-logicpd.dtb
+   imx6q-logicpd.dtb \
+   imx6q-sabreauto.dtb \
+   imx6q-sabresd.dtb \
+   imx6dl-sabreauto.dtb \
+   imx6dl-sabresd.dtb \
+   imx6qp-sabreauto.dtb \
+   imx6qp-sabresd.dtb
 
 dtb-$(CONFIG_MX6SL) += imx6sl-evk.dtb
 
diff --git a/arch/arm/dts/imx6dl-sabreauto.dts 
b/arch/arm/dts/imx6dl-sabreauto.dts
new file mode 100644
index 000..660d52a
--- /dev/null
+++ b/arch/arm/dts/imx6dl-sabreauto.dts
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// Copyright (C) 2013 Freescale Semiconductor, Inc.
+
+/dts-v1/;
+
+#include "imx6dl.dtsi"
+#include "imx6qdl-sabreauto.dtsi"
+
+/ {
+   model = "Freescale i.MX6 DualLite/Solo SABRE Automotive Board";
+   compatible = "fsl,imx6dl-sabreauto", "fsl,imx6dl";
+};
diff --git a/arch/arm/dts/imx6dl-sabresd.dts b/arch/arm/dts/imx6dl-sabresd.dts
new file mode 100644
index 000..cd6bbf2
--- /dev/null
+++ b/arch/arm/dts/imx6dl-sabresd.dts
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// Copyright (C) 2013 Freescale Semiconductor, Inc.
+
+/dts-v1/;
+
+#include "imx6dl.dtsi"
+#include "imx6qdl-sabresd.dtsi"
+
+/ {
+   model = "Freescale i.MX6 DualLite SABRE Smart Device Board";
+   compatible = "fsl,imx6dl-sabresd", "fsl,imx6dl";
+};
+
+_csi1_from_ipu1_csi1_mux {
+   clock-lanes = <0>;
+   data-lanes = <1 2>;
+};
diff --git a/arch/arm/dts/imx6dl.dtsi b/arch/arm/dts/imx6dl.dtsi
index 9a4c22c..f0607eb 100644
--- a/arch/arm/dts/imx6dl.dtsi
+++ b/arch/arm/dts/imx6dl.dtsi
@@ -1,12 +1,6 @@
-
-/*
- * 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.
- *
- */
+// SPDX-License-Identifier: GPL-2.0
+//
+// Copyright 2013 Freescale Semiconductor, Inc.
 
 #include 
 #include "imx6dl-pinfunc.h"
@@ -39,6 +33,7 @@
396000  1175000
>;
clock-latency = <61036>; /* two CLK32 periods */
+   #cooling-cells = <2>;
clocks = < IMX6QDL_CLK_ARM>,
 < IMX6QDL_CLK_PLL2_PFD2_396M>,
 < IMX6QDL_CLK_STEP>,
@@ -56,39 +51,57 @@
device_type = "cpu";
reg = <1>;
next-level-cache = <>;
+   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

[U-Boot] [PATCH v2 04/22] configs: imx6sabreauto: Add DM_USB support

2019-01-29 Thread Abel Vesa
Add the DM support for USB. For that, DM_REGULATOR is needed.

Signed-off-by: Abel Vesa 
---
 configs/mx6sabreauto_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configs/mx6sabreauto_defconfig b/configs/mx6sabreauto_defconfig
index a3d63a2..4bdcbb1 100644
--- a/configs/mx6sabreauto_defconfig
+++ b/configs/mx6sabreauto_defconfig
@@ -52,9 +52,11 @@ CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
 CONFIG_MII=y
+CONFIG_DM_REGULATOR=y
 CONFIG_SPI=y
 CONFIG_MXC_SPI=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="FSL"
-- 
2.7.4

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


[U-Boot] [PATCH v2 06/22] board: mx6sabresd: Add board_fit_config_name_match to support FIT in SPL

2019-01-29 Thread Abel Vesa
This matches one of the following three boards (or fails):
 - imx6q-sabresd
 - imx6qp-sabresd
 - imx6dl-sabresd

Signed-off-by: Abel Vesa 
---
 board/freescale/mx6sabresd/mx6sabresd.c | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/board/freescale/mx6sabresd/mx6sabresd.c 
b/board/freescale/mx6sabresd/mx6sabresd.c
index 0183ede..4688095 100644
--- a/board/freescale/mx6sabresd/mx6sabresd.c
+++ b/board/freescale/mx6sabresd/mx6sabresd.c
@@ -1062,3 +1062,21 @@ void board_init_f(ulong dummy)
board_init_r(NULL, 0);
 }
 #endif
+
+#ifdef CONFIG_SPL_LOAD_FIT
+int board_fit_config_name_match(const char *name)
+{
+   if (is_mx6dq()) {
+   if (!strcmp(name, "imx6q-sabresd"))
+   return 0;
+   } else if (is_mx6dqp()) {
+   if (!strcmp(name, "imx6qp-sabresd"))
+   return 0;
+   } else if (is_mx6dl()) {
+   if (!strcmp(name, "imx6dl-sabresd"))
+   return 0;
+   }
+
+   return -1;
+}
+#endif
-- 
2.7.4

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


[U-Boot] [PATCH v2 03/22] configs: imx6sabreauto: Add DM_MMC support

2019-01-29 Thread Abel Vesa
Add DM_MMC config to imx6sabreauto defconfig.

Signed-off-by: Abel Vesa 
---
 configs/mx6sabreauto_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/mx6sabreauto_defconfig b/configs/mx6sabreauto_defconfig
index 40386c2..a3d63a2 100644
--- a/configs/mx6sabreauto_defconfig
+++ b/configs/mx6sabreauto_defconfig
@@ -44,6 +44,7 @@ CONFIG_ENV_IS_IN_MMC=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_SF=y
+CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_NAND=y
 CONFIG_NAND_MXS=y
-- 
2.7.4

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


[U-Boot] [PATCH v2 08/22] arm: dts: Add all the imx6[q|qp|dl] sabre[auto|sd] u-boot dts[i] files

2019-01-29 Thread Abel Vesa
This allows us to keep the basic dts[i] files up-to-date with
the ones in kernel, but at the same time allowing the u-boot
to add its own properties to the existing nodes.

Signed-off-by: Abel Vesa 
---
 arch/arm/dts/imx6dl-sabreauto-u-boot.dtsi  |  6 ++
 arch/arm/dts/imx6dl-sabresd-u-boot.dtsi|  6 ++
 arch/arm/dts/imx6q-sabreauto-u-boot.dtsi   |  6 ++
 arch/arm/dts/imx6q-sabresd-u-boot.dtsi |  6 ++
 arch/arm/dts/imx6qdl-sabreauto-u-boot.dtsi | 23 +++
 arch/arm/dts/imx6qdl-sabresd-u-boot.dtsi   | 14 ++
 arch/arm/dts/imx6qdl-u-boot.dtsi   |  4 ++--
 arch/arm/dts/imx6qp-sabreauto-u-boot.dtsi  |  6 ++
 arch/arm/dts/imx6qp-sabresd-u-boot.dtsi|  6 ++
 9 files changed, 75 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/dts/imx6dl-sabreauto-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6dl-sabresd-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6q-sabreauto-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6q-sabresd-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6qdl-sabreauto-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6qdl-sabresd-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6qp-sabreauto-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6qp-sabresd-u-boot.dtsi

diff --git a/arch/arm/dts/imx6dl-sabreauto-u-boot.dtsi 
b/arch/arm/dts/imx6dl-sabreauto-u-boot.dtsi
new file mode 100644
index 000..b3f5f2d
--- /dev/null
+++ b/arch/arm/dts/imx6dl-sabreauto-u-boot.dtsi
@@ -0,0 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2018 Jagan Teki 
+ */
+
+#include "imx6qdl-sabreauto-u-boot.dtsi"
diff --git a/arch/arm/dts/imx6dl-sabresd-u-boot.dtsi 
b/arch/arm/dts/imx6dl-sabresd-u-boot.dtsi
new file mode 100644
index 000..e34cf3c
--- /dev/null
+++ b/arch/arm/dts/imx6dl-sabresd-u-boot.dtsi
@@ -0,0 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2018 Jagan Teki 
+ */
+
+#include "imx6qdl-sabresd-u-boot.dtsi"
diff --git a/arch/arm/dts/imx6q-sabreauto-u-boot.dtsi 
b/arch/arm/dts/imx6q-sabreauto-u-boot.dtsi
new file mode 100644
index 000..b3f5f2d
--- /dev/null
+++ b/arch/arm/dts/imx6q-sabreauto-u-boot.dtsi
@@ -0,0 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2018 Jagan Teki 
+ */
+
+#include "imx6qdl-sabreauto-u-boot.dtsi"
diff --git a/arch/arm/dts/imx6q-sabresd-u-boot.dtsi 
b/arch/arm/dts/imx6q-sabresd-u-boot.dtsi
new file mode 100644
index 000..e34cf3c
--- /dev/null
+++ b/arch/arm/dts/imx6q-sabresd-u-boot.dtsi
@@ -0,0 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2018 Jagan Teki 
+ */
+
+#include "imx6qdl-sabresd-u-boot.dtsi"
diff --git a/arch/arm/dts/imx6qdl-sabreauto-u-boot.dtsi 
b/arch/arm/dts/imx6qdl-sabreauto-u-boot.dtsi
new file mode 100644
index 000..3995849
--- /dev/null
+++ b/arch/arm/dts/imx6qdl-sabreauto-u-boot.dtsi
@@ -0,0 +1,23 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 NXP
+ */
+
+#include "imx6qdl-u-boot.dtsi"
+
+/ {
+   aliases {
+   mmc0 = 
+   };
+};
+
+ {
+   no-1-8-v;
+   keep-power-in-suspend;
+   enable-sdio-wakeup;
+   u-boot,dm-spl;
+};
+
+_usdhc3 {
+   u-boot,dm-spl;
+};
diff --git a/arch/arm/dts/imx6qdl-sabresd-u-boot.dtsi 
b/arch/arm/dts/imx6qdl-sabresd-u-boot.dtsi
new file mode 100644
index 000..45f02b1
--- /dev/null
+++ b/arch/arm/dts/imx6qdl-sabresd-u-boot.dtsi
@@ -0,0 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 NXP
+ */
+
+#include "imx6qdl-u-boot.dtsi"
+
+ {
+   u-boot,dm-spl;
+};
+
+_usdhc3 {
+   u-boot,dm-spl;
+};
diff --git a/arch/arm/dts/imx6qdl-u-boot.dtsi b/arch/arm/dts/imx6qdl-u-boot.dtsi
index dffc21b..45ae2fa 100644
--- a/arch/arm/dts/imx6qdl-u-boot.dtsi
+++ b/arch/arm/dts/imx6qdl-u-boot.dtsi
@@ -7,11 +7,11 @@
soc {
u-boot,dm-spl;
 
-   aips-bus@0200 {
+   aips-bus@200 {
u-boot,dm-spl;
};
 
-   aips-bus@0210 {
+   aips-bus@210 {
u-boot,dm-spl;
};
};
diff --git a/arch/arm/dts/imx6qp-sabreauto-u-boot.dtsi 
b/arch/arm/dts/imx6qp-sabreauto-u-boot.dtsi
new file mode 100644
index 000..b3f5f2d
--- /dev/null
+++ b/arch/arm/dts/imx6qp-sabreauto-u-boot.dtsi
@@ -0,0 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2018 Jagan Teki 
+ */
+
+#include "imx6qdl-sabreauto-u-boot.dtsi"
diff --git a/arch/arm/dts/imx6qp-sabresd-u-boot.dtsi 
b/arch/arm/dts/imx6qp-sabresd-u-boot.dtsi
new file mode 100644
index 000..e34cf3c
--- /dev/null
+++ b/arch/arm/dts/imx6qp-sabresd-u-boot.dtsi
@@ -0,0 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2018 Jagan Teki 
+ */
+
+#include "imx6qdl-sabresd-u-boot.dtsi"
-- 
2.7.4

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


[U-Boot] [PATCH v2 07/22] board: mx6sabreauto: Add board_fit_config_name_match to support FIT in SPL

2019-01-29 Thread Abel Vesa
This matches one of the following three boards (or fails):
 - imx6q-sabreauto
 - imx6qp-sabreauto
 - imx6dl-sabreauto

Signed-off-by: Abel Vesa 
---
 board/freescale/mx6sabreauto/mx6sabreauto.c | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/board/freescale/mx6sabreauto/mx6sabreauto.c 
b/board/freescale/mx6sabreauto/mx6sabreauto.c
index c1bef85..c8f1263 100644
--- a/board/freescale/mx6sabreauto/mx6sabreauto.c
+++ b/board/freescale/mx6sabreauto/mx6sabreauto.c
@@ -1097,3 +1097,21 @@ void board_init_f(ulong dummy)
board_init_r(NULL, 0);
 }
 #endif
+
+#ifdef CONFIG_SPL_LOAD_FIT
+int board_fit_config_name_match(const char *name)
+{
+   if (is_mx6dq()) {
+   if (!strcmp(name, "imx6q-sabreauto"))
+   return 0;
+   } else if (is_mx6dqp()) {
+   if (!strcmp(name, "imx6qp-sabreauto"))
+   return 0;
+   } else if (is_mx6dl()) {
+   if (!strcmp(name, "imx6dl-sabreauto"))
+   return 0;
+   }
+
+   return -1;
+}
+#endif
-- 
2.7.4

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


[U-Boot] [PATCH v2 02/22] usb: ehci-mx6: Make regulator DM_REGULATOR dependent

2019-01-29 Thread Abel Vesa
Do the regulator related work only if the build has the DM_REGULATOR.

Signed-off-by: Abel Vesa 
---
 drivers/usb/host/ehci-mx6.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/ehci-mx6.c b/drivers/usb/host/ehci-mx6.c
index 1acf08d..9483947 100644
--- a/drivers/usb/host/ehci-mx6.c
+++ b/drivers/usb/host/ehci-mx6.c
@@ -404,6 +404,7 @@ static int mx6_init_after_reset(struct ehci_ctrl *dev)
if (ret)
return ret;
 
+#if CONFIG_IS_ENABLED(DM_REGULATOR)
if (priv->vbus_supply) {
ret = regulator_set_enable(priv->vbus_supply,
   (type == USB_INIT_DEVICE) ?
@@ -413,6 +414,7 @@ static int mx6_init_after_reset(struct ehci_ctrl *dev)
return ret;
}
}
+#endif
 
if (type == USB_INIT_DEVICE)
return 0;
@@ -514,15 +516,17 @@ static int ehci_usb_probe(struct udevice *dev)
priv->portnr = dev->seq;
priv->init_type = type;
 
+#if CONFIG_IS_ENABLED(DM_REGULATOR)
ret = device_get_supply_regulator(dev, "vbus-supply",
  >vbus_supply);
if (ret)
debug("%s: No vbus supply\n", dev->name);
-
+#endif
ret = ehci_mx6_common_init(ehci, priv->portnr);
if (ret)
return ret;
 
+#if CONFIG_IS_ENABLED(DM_REGULATOR)
if (priv->vbus_supply) {
ret = regulator_set_enable(priv->vbus_supply,
   (type == USB_INIT_DEVICE) ?
@@ -532,6 +536,7 @@ static int ehci_usb_probe(struct udevice *dev)
return ret;
}
}
+#endif
 
if (priv->init_type == USB_INIT_HOST) {
setbits_le32(>usbmode, CM_HOST);
-- 
2.7.4

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


[U-Boot] [PATCH v2 01/22] usb: Rename SPL_USB_SUPPORT to SPL_USB_STORAGE

2019-01-29 Thread Abel Vesa
Since there is the SPL_USB_HOST_SUPPORT for enabling USB support in SPL,
makes more sense to rename the SPL_USB_SUPPORT as SPL_USB_STORAGE.
Everything that is not part of the usb storage support in SPL is now
build under SPL_USB_HOST_SUPPORT.

Signed-off-by: Abel Vesa 
Reviewed-by: Tom Rini 
---
 arch/arm/include/asm/arch-am33xx/spl.h| 2 +-
 arch/arm/mach-omap2/boot-common.c | 2 +-
 common/Makefile   | 5 +++--
 common/spl/Kconfig| 4 ++--
 common/spl/Makefile   | 2 +-
 common/spl/spl_usb.c  | 4 
 configs/am43xx_evm_usbhost_boot_defconfig | 2 +-
 configs/am43xx_hs_evm_defconfig   | 2 +-
 8 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/arch/arm/include/asm/arch-am33xx/spl.h 
b/arch/arm/include/asm/arch-am33xx/spl.h
index 0bf8c17..f3910c2 100644
--- a/arch/arm/include/asm/arch-am33xx/spl.h
+++ b/arch/arm/include/asm/arch-am33xx/spl.h
@@ -62,7 +62,7 @@
 #define BOOT_DEVICE_CPGMAC 0x47
 
 #define MMC_BOOT_DEVICES_START BOOT_DEVICE_MMC1
-#ifdef CONFIG_SPL_USB_SUPPORT
+#ifdef CONFIG_SPL_USB_STORAGE
 #define MMC_BOOT_DEVICES_END   BOOT_DEVICE_USB
 #else
 #define MMC_BOOT_DEVICES_END   BOOT_DEVICE_MMC2
diff --git a/arch/arm/mach-omap2/boot-common.c 
b/arch/arm/mach-omap2/boot-common.c
index 2db1922..c8b8ac6 100644
--- a/arch/arm/mach-omap2/boot-common.c
+++ b/arch/arm/mach-omap2/boot-common.c
@@ -93,7 +93,7 @@ void save_omap_boot_params(void)
sys_boot_device = 1;
break;
 #endif
-#if defined(BOOT_DEVICE_USB) && !defined(CONFIG_SPL_USB_SUPPORT)
+#if defined(BOOT_DEVICE_USB) && !defined(CONFIG_SPL_USB_STORAGE)
case BOOT_DEVICE_USB:
sys_boot_device = 1;
break;
diff --git a/common/Makefile b/common/Makefile
index ad390d0..8c92feb 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -75,8 +75,9 @@ obj-$(CONFIG_SPL_NET_SUPPORT) += miiphyutil.o
 obj-$(CONFIG_$(SPL_TPL_)OF_LIBFDT) += fdt_support.o
 
 ifdef CONFIG_SPL_USB_HOST_SUPPORT
-obj-$(CONFIG_SPL_USB_SUPPORT) += usb.o usb_hub.o
-obj-$(CONFIG_USB_STORAGE) += usb_storage.o
+obj-y += usb.o
+obj-y += usb_hub.o
+obj-$(CONFIG_SPL_USB_STORAGE) += usb_storage.o
 else
 obj-$(CONFIG_USB_MUSB_HOST) += usb.o
 endif
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 54b0dc3..8b0627e 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -766,9 +766,9 @@ config SPL_USB_HOST_SUPPORT
  device can be attached. This option enables the drivers in
  drivers/usb/host as part of an SPL build.
 
-config SPL_USB_SUPPORT
+config SPL_USB_STORAGE
bool "Support loading from USB"
-   depends on SPL_USB_HOST_SUPPORT
+   depends on SPL_USB_HOST_SUPPORT && !(BLK && !DM_USB)
help
  Enable support for USB devices in SPL. This allows use of USB
  devices such as hard drives and flash drivers for loading U-Boot.
diff --git a/common/spl/Makefile b/common/spl/Makefile
index 6f8d759..a3980ce 100644
--- a/common/spl/Makefile
+++ b/common/spl/Makefile
@@ -22,7 +22,7 @@ obj-$(CONFIG_$(SPL_TPL_)NET_SUPPORT) += spl_net.o
 obj-$(CONFIG_$(SPL_TPL_)MMC_SUPPORT) += spl_mmc.o
 obj-$(CONFIG_$(SPL_TPL_)ATF) += spl_atf.o
 obj-$(CONFIG_$(SPL_TPL_)OPTEE) += spl_optee.o
-obj-$(CONFIG_$(SPL_TPL_)USB_SUPPORT) += spl_usb.o
+obj-$(CONFIG_$(SPL_TPL_)USB_STORAGE) += spl_usb.o
 obj-$(CONFIG_$(SPL_TPL_)FAT_SUPPORT) += spl_fat.o
 obj-$(CONFIG_$(SPL_TPL_)EXT_SUPPORT) += spl_ext.o
 obj-$(CONFIG_$(SPL_TPL_)SATA_SUPPORT) += spl_sata.o
diff --git a/common/spl/spl_usb.c b/common/spl/spl_usb.c
index c8d8231..e29d579 100644
--- a/common/spl/spl_usb.c
+++ b/common/spl/spl_usb.c
@@ -15,9 +15,7 @@
 #include 
 #include 
 
-#ifdef CONFIG_USB_STORAGE
 static int usb_stor_curr_dev = -1; /* current device */
-#endif
 
 static int spl_usb_load_image(struct spl_image_info *spl_image,
  struct spl_boot_device *bootdev)
@@ -34,13 +32,11 @@ static int spl_usb_load_image(struct spl_image_info 
*spl_image,
return err;
}
 
-#ifdef CONFIG_USB_STORAGE
/* try to recognize storage devices immediately */
usb_stor_curr_dev = usb_stor_scan(1);
stor_dev = blk_get_devnum_by_type(IF_TYPE_USB, usb_stor_curr_dev);
if (!stor_dev)
return -ENODEV;
-#endif
 
debug("boot mode - FAT\n");
 
diff --git a/configs/am43xx_evm_usbhost_boot_defconfig 
b/configs/am43xx_evm_usbhost_boot_defconfig
index 5131f19..5bd919b 100644
--- a/configs/am43xx_evm_usbhost_boot_defconfig
+++ b/configs/am43xx_evm_usbhost_boot_defconfig
@@ -14,7 +14,7 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL_MTD_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_SPL_USB_HOST_SUPPORT=y
-CONFIG_SPL_USB_SUPPORT=y
+CONFIG_SPL_USB_STORAGE=y
 CONFIG_CMD_SPL=y
 CONFIG_CMD_SPL_NAND_OFS=0x0010
 CONFIG_CMD_SPL_WRITE_SIZE=0x4
diff --git a/configs/am43xx_hs_e

[U-Boot] [PATCH v2 00/22] mx6sabre: Add DM and SPL FIT support

2019-01-29 Thread Abel Vesa
The first version is here:
https://lists.denx.de/pipermail/u-boot/2019-January/355196.html

Changes since v1:
 * updated all the related dts[i] files from kernel v4.20 as suggested
   by Fabio
 * enabled multi-dtb in SPL to support one binary for all imx6[q|qp|dl]
 * updated the board README files
 * dropped support for EFI and DOS partition to decrease SPL size on
   sabresd

Abel Vesa (22):
  usb: Rename SPL_USB_SUPPORT to SPL_USB_STORAGE
  usb: ehci-mx6: Make regulator DM_REGULATOR dependent
  configs: imx6sabreauto: Add DM_MMC support
  configs: imx6sabreauto: Add DM_USB support
  mmc: fsl_esdhc: Fix DM_REGULATOR ifdefs for SPL builds
  board: mx6sabresd: Add board_fit_config_name_match to support FIT in
SPL
  board: mx6sabreauto: Add board_fit_config_name_match to support FIT in
SPL
  arm: dts: Add all the imx6[q|qp|dl] sabre[auto|sd] u-boot dts[i] files
  arm: dts: Update all the dts[i] files for imx6[q|qp|dl] sabre[auto|sd]
  arm: imx: Add FIT SPL its
  configs: mx6sabreauto: Add SPL FIT and DM support
  configs: mx6sabresd: Add SPL FIT and DM support
  mx6sabreauto: Add DM_GPIO support
  mx6sabresd: Add DM_GPIO support
  configs: mx6sabreauto: Add DM_SPI_FLASH necessary configs
  configs: mx6sabresd: Add DM_SPI_FLASH necessary configs
  board: mx6sabreauto: Remove the non-DM code
  board: mx6sabresd: Remove non-DM code
  board: mx6sabresd: Remove the enet reset gpio handling
  configs: mx6sabresd: Reduce size for SPL by disabling SPL_DOS and
SPL_EFI
  board: mx6sabreauto: Update README with the SPL DM FIT info
  board: mx6sabresd: Update README with the SPL DM FIT info

 arch/arm/dts/Makefile   |   8 +-
 arch/arm/dts/imx6dl-sabreauto-u-boot.dtsi   |   6 +
 arch/arm/dts/imx6dl-sabreauto.dts   |  13 +
 arch/arm/dts/imx6dl-sabresd-u-boot.dtsi |   6 +
 arch/arm/dts/imx6dl-sabresd.dts |  18 +
 arch/arm/dts/imx6dl.dtsi| 306 ++-
 arch/arm/dts/imx6q-sabreauto-u-boot.dtsi|   6 +
 arch/arm/dts/imx6q-sabreauto.dts|  18 +
 arch/arm/dts/imx6q-sabresd-u-boot.dtsi  |   6 +
 arch/arm/dts/imx6q-sabresd.dts  |  23 +
 arch/arm/dts/imx6q.dtsi | 310 +--
 arch/arm/dts/imx6qdl-sabreauto-u-boot.dtsi  |  23 +
 arch/arm/dts/imx6qdl-sabreauto.dtsi | 810 
 arch/arm/dts/imx6qdl-sabresd-u-boot.dtsi|  14 +
 arch/arm/dts/imx6qdl-sabresd.dtsi   | 741 +
 arch/arm/dts/imx6qdl-u-boot.dtsi|   4 +-
 arch/arm/dts/imx6qdl.dtsi   | 455 +---
 arch/arm/dts/imx6qp-sabreauto-u-boot.dtsi   |   6 +
 arch/arm/dts/imx6qp-sabreauto.dts   |  55 ++
 arch/arm/dts/imx6qp-sabresd-u-boot.dtsi |   6 +
 arch/arm/dts/imx6qp-sabresd.dts |  55 ++
 arch/arm/dts/imx6qp.dtsi| 115 
 arch/arm/include/asm/arch-am33xx/spl.h  |   2 +-
 arch/arm/mach-imx/mx6/fit_spl.its   |  41 ++
 arch/arm/mach-omap2/boot-common.c   |   2 +-
 board/freescale/mx6sabreauto/README |   6 +-
 board/freescale/mx6sabreauto/mx6sabreauto.c |  91 +---
 board/freescale/mx6sabresd/README   |   9 +-
 board/freescale/mx6sabresd/mx6sabresd.c |  78 +--
 common/Makefile |   5 +-
 common/spl/Kconfig  |   4 +-
 common/spl/Makefile |   2 +-
 common/spl/spl_usb.c|   4 -
 configs/am43xx_evm_usbhost_boot_defconfig   |   2 +-
 configs/am43xx_hs_evm_defconfig |   2 +-
 configs/mx6sabreauto_defconfig  |  23 +-
 configs/mx6sabresd_defconfig|  28 +-
 drivers/mmc/fsl_esdhc.c |   8 +-
 drivers/usb/host/ehci-mx6.c |   7 +-
 39 files changed, 2906 insertions(+), 412 deletions(-)
 create mode 100644 arch/arm/dts/imx6dl-sabreauto-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6dl-sabreauto.dts
 create mode 100644 arch/arm/dts/imx6dl-sabresd-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6dl-sabresd.dts
 create mode 100644 arch/arm/dts/imx6q-sabreauto-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6q-sabreauto.dts
 create mode 100644 arch/arm/dts/imx6q-sabresd-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6q-sabresd.dts
 create mode 100644 arch/arm/dts/imx6qdl-sabreauto-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6qdl-sabreauto.dtsi
 create mode 100644 arch/arm/dts/imx6qdl-sabresd-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6qdl-sabresd.dtsi
 create mode 100644 arch/arm/dts/imx6qp-sabreauto-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6qp-sabreauto.dts
 create mode 100644 arch/arm/dts/imx6qp-sabresd-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6qp-sabresd.dts
 create mode 100644 arch/arm/dts/imx6qp.dtsi
 create mode 100644 arch/arm/mach-imx/mx6/fit_spl.its

-- 
2.7.4

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u

Re: [U-Boot] [PATCH 19/26] configs: mx6sabresd: Add SPL FIT and DM support

2019-01-28 Thread Abel Vesa
On 19-01-18 10:30:24, Tom Rini wrote:
> On Fri, Jan 18, 2019 at 03:26:42PM +0000, Abel Vesa wrote:
> > On 19-01-18 13:16:07, Fabio Estevam wrote:
> > > Hi Abel,
> > > 
> > > On Fri, Jan 18, 2019 at 12:59 PM Abel Vesa  wrote:
> > > 
> > > > +CONFIG_OF_CONTROL=y
> > > > +CONFIG_SPL_OF_CONTROL=y
> > > > +CONFIG_DEFAULT_DEVICE_TREE="imx6q-sabresd"
> > > 
> > > Does this mean that only imx6q-sabresd variant is supported after this
> > > series is applied?
> > > 
> > > We still need to support imx6dl/imx6qp sabresd in the same binary as
> > > we currently do today.
> > 
> > Hmmm, so all the dtbs get built, trouble is we need to specify which dtb 
> > gets
> > used by SPL. This is why the DEFAULT_DEVICE_TREE gets set.
> > 
> > A solution to do what you're asking is to have a dtb in SPL that works for
> > all socs (dl/qp/q) for each board (sabreauto/sabresd). I'm afraid it might
> > get too big to fit in sram. I'll give it a try tomorrow.
> > 
> > As for the u-boot proper, in order to have one u-boot.itb file that works
> > on all socs we need to support MULTI_FIT in u-boot proper and make u-boot
> > chose from the fit table the right dtb. I'll try to do that for the next
> > version of this patchset. I'll keep you up to date with the development.
> 
> Please note that this isn't the first family to have this problem.
> Please see the TI Keystone 2 families and CONFIG_DTB_RESELECT as I would
> swear we can go from a "good enough for all" to "correct for what we're
> on" DTB in both SPL and U-Boot.  And then yes, you end up compressing
> the DTBs too so that we can fit things into limited space.  And if we
> still run into problems, which we might well still, lets talk.  And it
> might indeed end up making the most sense to make up a "just enough for
> SPL for everyone" DTB or set of DTBs too.
> 

OK, so I finally managed to get the multi dtb support in SPL. Added all 
three dtbs (for 6q, 6qp and 6dl) but the 6dl doesn't wanna boot anymore.
The 6q and 6qp boot up just fine.

The final SPL is 75K so it obviously doesn't fit in the 64K ocram the 6dl
has.

Once I enable the GZIP options (SPL_GZIP and SPL_MULTI_DTB_FIT_GZIP)
I get this:

u-boot-spl section `.rodata' will not fit in region `.sram'
region `.sram' overflowed by 12708 bytes


Same thing happens with LZO:

u-boot-spl section `.data' will not fit in region `.sram'
region `.sram' overflowed by 1396 bytes

A solution would be to split the q/qp and dl into two separate defconfigs
(and implicitly two different binaries).


Btw, I don't understand why the dtbs (the fit table to be exact) do not
overflow the ocram limit. I mean, I know why, but I believe that is incorrect.
The fit table gets appended at the end so it builds fine. But I guess it should
fail.

Let me know what you guys think.

> -- 
> Tom

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


Re: [U-Boot] [PATCH 01/26] usb: Rename SPL_USB_SUPPORT to SPL_USB_STORAGE

2019-01-18 Thread Abel Vesa
On 19-01-18 10:03:14, Tom Rini wrote:
> On Fri, Jan 18, 2019 at 02:53:15PM +0000, Abel Vesa wrote:
> 
> > Since there is the SPL_USB_HOST_SUPPORT for enabling USB support in SPL,
> > makes more sense to rename the SPL_USB_SUPPORT as SPL_USB_STORAGE.
> > Everything that is not part of the usb storage support in SPL is now
> > build under SPL_USB_HOST_SUPPORT.
> > 
> > Signed-off-by: Abel Vesa 
> 
> Thanks!
> 
> Reviewed-by: Tom Rini 
> 
> Do you have a follow-up patch to then disable this option and remove the
> line you added to mx6_spl.h as you can't do SPL from USB storage devices
> on these platforms?
> 

Hmm, I missed that in. I'm sure there will be a need for a new version
of this patchset so I'll remove that in the next version.

> -- 
> Tom

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


Re: [U-Boot] [PATCH 19/26] configs: mx6sabresd: Add SPL FIT and DM support

2019-01-18 Thread Abel Vesa
On 19-01-18 13:16:07, Fabio Estevam wrote:
> Hi Abel,
> 
> On Fri, Jan 18, 2019 at 12:59 PM Abel Vesa  wrote:
> 
> > +CONFIG_OF_CONTROL=y
> > +CONFIG_SPL_OF_CONTROL=y
> > +CONFIG_DEFAULT_DEVICE_TREE="imx6q-sabresd"
> 
> Does this mean that only imx6q-sabresd variant is supported after this
> series is applied?
> 
> We still need to support imx6dl/imx6qp sabresd in the same binary as
> we currently do today.

Hmmm, so all the dtbs get built, trouble is we need to specify which dtb gets
used by SPL. This is why the DEFAULT_DEVICE_TREE gets set.

A solution to do what you're asking is to have a dtb in SPL that works for
all socs (dl/qp/q) for each board (sabreauto/sabresd). I'm afraid it might
get too big to fit in sram. I'll give it a try tomorrow.

As for the u-boot proper, in order to have one u-boot.itb file that works
on all socs we need to support MULTI_FIT in u-boot proper and make u-boot
chose from the fit table the right dtb. I'll try to do that for the next
version of this patchset. I'll keep you up to date with the development.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 26/26] board: mx6sabresd: Remove the enet reset gpio handling

2019-01-18 Thread Abel Vesa
Rely on the phy-reset-gpios which is set in imx6qdl-sabresd dtsi
and get rid of the enet reset gpio handling from the board file.

Signed-off-by: Abel Vesa 
---
 board/freescale/mx6sabresd/mx6sabresd.c | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/board/freescale/mx6sabresd/mx6sabresd.c 
b/board/freescale/mx6sabresd/mx6sabresd.c
index 71b9bfe..c9f2076 100644
--- a/board/freescale/mx6sabresd/mx6sabresd.c
+++ b/board/freescale/mx6sabresd/mx6sabresd.c
@@ -94,13 +94,6 @@ static iomux_v3_cfg_t const enet_pads[] = {
 static void setup_iomux_enet(void)
 {
SETUP_IOMUX_PADS(enet_pads);
-
-   /* Reset AR8031 PHY */
-   gpio_request(IMX_GPIO_NR(1, 25), "ENET PHY Reset");
-   gpio_direction_output(IMX_GPIO_NR(1, 25) , 0);
-   mdelay(10);
-   gpio_set_value(IMX_GPIO_NR(1, 25), 1);
-   udelay(100);
 }
 
 static iomux_v3_cfg_t const usdhc2_pads[] = {
-- 
2.7.4

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


[U-Boot] [PATCH 13/26] arm: dts: Add imx6dl-sabreauto dts file

2019-01-18 Thread Abel Vesa
Add imx6dl-sabreauto dts support from Linux.

Signed-off-by: Abel Vesa 
---
 arch/arm/dts/Makefile |  3 ++-
 arch/arm/dts/imx6dl-sabreauto.dts | 17 +
 2 files changed, 19 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/imx6dl-sabreauto.dts

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index eeb2587..d766ab5 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -442,7 +442,8 @@ dtb-$(CONFIG_MX6QDL) += \
imx6q-icore-rqs.dtb \
imx6q-logicpd.dtb \
imx6q-sabreauto.dtb \
-   imx6q-sabresd.dtb
+   imx6q-sabresd.dtb \
+   imx6dl-sabreauto.dtb
 
 dtb-$(CONFIG_MX6SL) += imx6sl-evk.dtb
 
diff --git a/arch/arm/dts/imx6dl-sabreauto.dts 
b/arch/arm/dts/imx6dl-sabreauto.dts
new file mode 100644
index 000..a6ce7b4
--- /dev/null
+++ b/arch/arm/dts/imx6dl-sabreauto.dts
@@ -0,0 +1,17 @@
+/*
+ * Copyright (C) 2013 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+/dts-v1/;
+
+#include "imx6dl.dtsi"
+#include "imx6qdl-sabreauto.dtsi"
+
+/ {
+   model = "Freescale i.MX6 DualLite/Solo SABRE Automotive Board";
+   compatible = "fsl,imx6dl-sabreauto", "fsl,imx6dl";
+};
-- 
2.7.4

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


[U-Boot] [PATCH 14/26] arm: dts: Add imx6dl-sabresd dts file

2019-01-18 Thread Abel Vesa
Add imx6dl-sabresd dts support from Linux.

Signed-off-by: Abel Vesa 
---
 arch/arm/dts/Makefile   |  3 ++-
 arch/arm/dts/imx6dl-sabresd.dts | 17 +
 2 files changed, 19 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/imx6dl-sabresd.dts

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index d766ab5..520d1a5 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -443,7 +443,8 @@ dtb-$(CONFIG_MX6QDL) += \
imx6q-logicpd.dtb \
imx6q-sabreauto.dtb \
imx6q-sabresd.dtb \
-   imx6dl-sabreauto.dtb
+   imx6dl-sabreauto.dtb \
+   imx6dl-sabresd.dtb
 
 dtb-$(CONFIG_MX6SL) += imx6sl-evk.dtb
 
diff --git a/arch/arm/dts/imx6dl-sabresd.dts b/arch/arm/dts/imx6dl-sabresd.dts
new file mode 100644
index 000..1e45f2f
--- /dev/null
+++ b/arch/arm/dts/imx6dl-sabresd.dts
@@ -0,0 +1,17 @@
+/*
+ * Copyright (C) 2013 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+/dts-v1/;
+
+#include "imx6dl.dtsi"
+#include "imx6qdl-sabresd.dtsi"
+
+/ {
+   model = "Freescale i.MX6 DualLite SABRE Smart Device Board";
+   compatible = "fsl,imx6dl-sabresd", "fsl,imx6dl";
+};
-- 
2.7.4

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


[U-Boot] [PATCH 11/26] arm: dts: Add imx6q-sabreauto dts file

2019-01-18 Thread Abel Vesa
Add imx6q-sabreauto dts support from Linux.

Signed-off-by: Abel Vesa 
---
 arch/arm/dts/Makefile|  3 ++-
 arch/arm/dts/imx6q-sabreauto.dts | 25 +
 2 files changed, 27 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/imx6q-sabreauto.dts

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index b2ca87d..fee6338 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -440,7 +440,8 @@ dtb-$(CONFIG_MX6QDL) += \
imx6q-icore.dtb \
imx6q-icore-mipi.dtb \
imx6q-icore-rqs.dtb \
-   imx6q-logicpd.dtb
+   imx6q-logicpd.dtb \
+   imx6q-sabreauto.dtb
 
 dtb-$(CONFIG_MX6SL) += imx6sl-evk.dtb
 
diff --git a/arch/arm/dts/imx6q-sabreauto.dts b/arch/arm/dts/imx6q-sabreauto.dts
new file mode 100644
index 000..334b924
--- /dev/null
+++ b/arch/arm/dts/imx6q-sabreauto.dts
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2012 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
+ */
+
+/dts-v1/;
+
+#include "imx6q.dtsi"
+#include "imx6qdl-sabreauto.dtsi"
+
+/ {
+   model = "Freescale i.MX6 Quad SABRE Automotive Board";
+   compatible = "fsl,imx6q-sabreauto", "fsl,imx6q";
+};
+
+ {
+   status = "okay";
+};
-- 
2.7.4

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


[U-Boot] [PATCH 20/26] mx6sabreauto: Add DM_GPIO support

2019-01-18 Thread Abel Vesa
Add the DM_GPIO related config for mx6sabreauto.
Also add the gpio request calls.

Signed-off-by: Abel Vesa 
---
 board/freescale/mx6sabreauto/mx6sabreauto.c | 3 +++
 configs/mx6sabreauto_defconfig  | 1 +
 2 files changed, 4 insertions(+)

diff --git a/board/freescale/mx6sabreauto/mx6sabreauto.c 
b/board/freescale/mx6sabreauto/mx6sabreauto.c
index c1bef85..b28e5e3 100644
--- a/board/freescale/mx6sabreauto/mx6sabreauto.c
+++ b/board/freescale/mx6sabreauto/mx6sabreauto.c
@@ -501,6 +501,7 @@ iomux_v3_cfg_t const backlight_pads[] = {
 
 static void setup_iomux_backlight(void)
 {
+   gpio_request(IMX_GPIO_NR(2, 9), "backlight");
gpio_direction_output(IMX_GPIO_NR(2, 9), 1);
SETUP_IOMUX_PADS(backlight_pads);
 }
@@ -594,6 +595,7 @@ int board_init(void)
else
setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, _i2c_pad_info1);
/* I2C 3 Steer */
+   gpio_request(IMX_GPIO_NR(5, 4), "steer logic");
gpio_direction_output(IMX_GPIO_NR(5, 4), 1);
SETUP_IOMUX_PADS(i2c3_pads);
 #ifndef CONFIG_SYS_FLASH_CFI
@@ -602,6 +604,7 @@ int board_init(void)
else
setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, _i2c_pad_info2);
 #endif
+   gpio_request(IMX_GPIO_NR(1, 15), "expander en");
gpio_direction_output(IMX_GPIO_NR(1, 15), 1);
SETUP_IOMUX_PADS(port_exp);
 
diff --git a/configs/mx6sabreauto_defconfig b/configs/mx6sabreauto_defconfig
index fa3d649..bcd6ff0 100644
--- a/configs/mx6sabreauto_defconfig
+++ b/configs/mx6sabreauto_defconfig
@@ -56,6 +56,7 @@ CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_SPL_DM=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_SF=y
+CONFIG_DM_GPIO=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_NAND=y
-- 
2.7.4

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


[U-Boot] [PATCH 18/26] configs: mx6sabreauto: Add SPL FIT and DM support

2019-01-18 Thread Abel Vesa
Enable all the necessary configs for SPL DM and FIT support for
mx6sabreauto.

Signed-off-by: Abel Vesa 
---
 configs/mx6sabreauto_defconfig | 14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/configs/mx6sabreauto_defconfig b/configs/mx6sabreauto_defconfig
index e55c2d9..fa3d649 100644
--- a/configs/mx6sabreauto_defconfig
+++ b/configs/mx6sabreauto_defconfig
@@ -4,18 +4,27 @@ CONFIG_SYS_TEXT_BASE=0x1780
 CONFIG_SPL_GPIO_SUPPORT=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
+CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_TARGET_MX6SABREAUTO=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_SPL_SYS_MALLOC_F_LEN=0x400
 CONFIG_SPL=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_NXP_BOARD_REVISION=y
 CONFIG_NR_DRAM_BANKS=1
+CONFIG_TPL_SYS_MALLOC_F_LEN=0x400
+CONFIG_FIT=y
+CONFIG_SPL_FIT_PRINT=y
+CONFIG_SPL_LOAD_FIT=y
+CONFIG_SPL_FIT_SOURCE="arch/arm/mach-imx/mx6/fit_spl.its"
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
 CONFIG_SUPPORT_RAW_INITRD=y
+CONFIG_SPL_SEPARATE_BSS=y
+CONFIG_SPL_FIT_IMAGE_TINY=y
 CONFIG_SPL_EXT_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_WATCHDOG_SUPPORT=y
@@ -39,8 +48,12 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
+CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="imx6q-sabreauto"
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
+CONFIG_SPL_DM=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_SF=y
 CONFIG_DM_MMC=y
@@ -67,4 +80,3 @@ CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
-CONFIG_OF_LIBFDT=y
-- 
2.7.4

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


[U-Boot] [PATCH 22/26] configs: mx6sabreauto: Add DM_SPI_FLASH necessary configs

2019-01-18 Thread Abel Vesa
Enable all neceassary configs to support DM_SPI_FLASH on mx6sabreauto.

Signed-off-by: Abel Vesa 
---
 configs/mx6sabreauto_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configs/mx6sabreauto_defconfig b/configs/mx6sabreauto_defconfig
index bcd6ff0..a4d051a 100644
--- a/configs/mx6sabreauto_defconfig
+++ b/configs/mx6sabreauto_defconfig
@@ -61,12 +61,14 @@ CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_NAND=y
 CONFIG_NAND_MXS=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
 CONFIG_MII=y
 CONFIG_DM_REGULATOR=y
 CONFIG_SPI=y
+CONFIG_DM_SPI=y
 CONFIG_MXC_SPI=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
-- 
2.7.4

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


[U-Boot] [PATCH 23/26] configs: mx6sabresd: Add DM_SPI_FLASH necessary configs

2019-01-18 Thread Abel Vesa
Enable all neceassary configs to support DM_SPI_FLASH on mx6sabresd.

Signed-off-by: Abel Vesa 
---
 configs/mx6sabresd_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configs/mx6sabresd_defconfig b/configs/mx6sabresd_defconfig
index 9451bbd..7fbfddb 100644
--- a/configs/mx6sabresd_defconfig
+++ b/configs/mx6sabresd_defconfig
@@ -69,6 +69,7 @@ CONFIG_FASTBOOT_FLASH_MMC_DEV=2
 CONFIG_DM_GPIO=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
@@ -76,6 +77,7 @@ CONFIG_MII=y
 CONFIG_PCI=y
 CONFIG_DM_REGULATOR=y
 CONFIG_SPI=y
+CONFIG_DM_SPI=y
 CONFIG_MXC_SPI=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
-- 
2.7.4

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


[U-Boot] [PATCH 12/26] arm: dts: Add imx6q-sabresd dts file

2019-01-18 Thread Abel Vesa
Add imx6q-sabresd dts support from Linux.

Signed-off-by: Abel Vesa 
---
 arch/arm/dts/Makefile  |  3 ++-
 arch/arm/dts/imx6q-sabresd.dts | 25 +
 2 files changed, 27 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/imx6q-sabresd.dts

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index fee6338..eeb2587 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -441,7 +441,8 @@ dtb-$(CONFIG_MX6QDL) += \
imx6q-icore-mipi.dtb \
imx6q-icore-rqs.dtb \
imx6q-logicpd.dtb \
-   imx6q-sabreauto.dtb
+   imx6q-sabreauto.dtb \
+   imx6q-sabresd.dtb
 
 dtb-$(CONFIG_MX6SL) += imx6sl-evk.dtb
 
diff --git a/arch/arm/dts/imx6q-sabresd.dts b/arch/arm/dts/imx6q-sabresd.dts
new file mode 100644
index 000..9cbdfe7
--- /dev/null
+++ b/arch/arm/dts/imx6q-sabresd.dts
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2012 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
+ */
+
+/dts-v1/;
+
+#include "imx6q.dtsi"
+#include "imx6qdl-sabresd.dtsi"
+
+/ {
+   model = "Freescale i.MX6 Quad SABRE Smart Device Board";
+   compatible = "fsl,imx6q-sabresd", "fsl,imx6q";
+};
+
+ {
+   status = "okay";
+};
-- 
2.7.4

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


[U-Boot] [PATCH 08/26] arm: dts: Add imx6qdl-sabreauto dtsi file

2019-01-18 Thread Abel Vesa
Add imx6qdl-sabreauto dtsi support from Linux.

Signed-off-by: Abel Vesa 
---
 arch/arm/dts/imx6qdl-sabreauto.dtsi | 634 
 1 file changed, 634 insertions(+)
 create mode 100644 arch/arm/dts/imx6qdl-sabreauto.dtsi

diff --git a/arch/arm/dts/imx6qdl-sabreauto.dtsi 
b/arch/arm/dts/imx6qdl-sabreauto.dtsi
new file mode 100644
index 000..62f2f80
--- /dev/null
+++ b/arch/arm/dts/imx6qdl-sabreauto.dtsi
@@ -0,0 +1,634 @@
+/*
+ * Copyright 2012 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 
+
+/ {
+   aliases {
+   mmc0 = 
+   };
+
+   memory {
+   reg = <0x1000 0x8000>;
+   };
+
+   leds {
+   compatible = "gpio-leds";
+   pinctrl-names = "default";
+   pinctrl-0 = <_gpio_leds>;
+
+   user {
+   label = "debug";
+   gpios = < 15 GPIO_ACTIVE_HIGH>;
+   };
+   };
+
+   clocks {
+   codec_osc: anaclk2 {
+   compatible = "fixed-clock";
+   #clock-cells = <0>;
+   clock-frequency = <24576000>;
+   };
+   };
+
+   regulators {
+   compatible = "simple-bus";
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   reg_audio: regulator@0 {
+   compatible = "regulator-fixed";
+   reg = <0>;
+   regulator-name = "cs42888_supply";
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   regulator-always-on;
+   };
+
+   reg_usb_h1_vbus: regulator@1 {
+   compatible = "regulator-fixed";
+   reg = <1>;
+   regulator-name = "usb_h1_vbus";
+   regulator-min-microvolt = <500>;
+   regulator-max-microvolt = <500>;
+   gpio = <_b 7 GPIO_ACTIVE_HIGH>;
+   enable-active-high;
+   };
+
+   reg_usb_otg_vbus: regulator@2 {
+   compatible = "regulator-fixed";
+   reg = <2>;
+   regulator-name = "usb_otg_vbus";
+   regulator-min-microvolt = <500>;
+   regulator-max-microvolt = <500>;
+   gpio = <_c 1 GPIO_ACTIVE_HIGH>;
+   enable-active-high;
+   };
+   };
+
+   sound-cs42888 {
+   compatible = "fsl,imx6-sabreauto-cs42888",
+   "fsl,imx-audio-cs42888";
+   model = "imx-cs42888";
+   audio-cpu = <>;
+   audio-asrc = <>;
+   audio-codec = <>;
+   audio-routing =
+   "Line Out Jack", "AOUT1L",
+   "Line Out Jack", "AOUT1R",
+   "Line Out Jack", "AOUT2L",
+   "Line Out Jack", "AOUT2R",
+   "Line Out Jack", "AOUT3L",
+   "Line Out Jack", "AOUT3R",
+   "Line Out Jack", "AOUT4L",
+   "Line Out Jack", "AOUT4R",
+   "AIN1L", "Line In Jack",
+   "AIN1R", "Line In Jack",
+   "AIN2L", "Line In Jack",
+   "AIN2R", "Line In Jack";
+   };
+
+   sound-spdif {
+   compatible = "fsl,imx-audio-spdif",
+  "fsl,imx-sabreauto-spdif";
+   model = "imx-spdif";
+   spdif-controller = <>;
+   spdif-in;
+   };
+
+   backlight {
+   compatible = "pwm-backlight";
+   pwms = < 0 500>;
+   brightness-levels = <0 4 8 16 32 64 128 255>;
+   default-brightness-level = <7>;
+   status = "okay";
+   };
+};
+
+ {
+   assigned-clocks = < IMX6QDL_PLL4_BYPASS_SRC>,

[U-Boot] [PATCH 24/26] board: mx6sabreauto: Remove the non-DM code

2019-01-18 Thread Abel Vesa
Since the mx6sabreauto has DM support, remove the unused non-DM code
from mx6sabreauto board file.

Signed-off-by: Abel Vesa 
---
 board/freescale/mx6sabreauto/mx6sabreauto.c | 70 -
 1 file changed, 70 deletions(-)

diff --git a/board/freescale/mx6sabreauto/mx6sabreauto.c 
b/board/freescale/mx6sabreauto/mx6sabreauto.c
index b28e5e3..0f3b134 100644
--- a/board/freescale/mx6sabreauto/mx6sabreauto.c
+++ b/board/freescale/mx6sabreauto/mx6sabreauto.c
@@ -159,44 +159,6 @@ static iomux_v3_cfg_t const port_exp[] = {
IOMUX_PADS(PAD_SD2_DAT0__GPIO1_IO15 | MUX_PAD_CTRL(NO_PAD_CTRL)),
 };
 
-/*Define for building port exp gpio, pin starts from 0*/
-#define PORTEXP_IO_NR(chip, pin) \
-   ((chip << 5) + pin)
-
-/*Get the chip addr from a ioexp gpio*/
-#define PORTEXP_IO_TO_CHIP(gpio_nr) \
-   (gpio_nr >> 5)
-
-/*Get the pin number from a ioexp gpio*/
-#define PORTEXP_IO_TO_PIN(gpio_nr) \
-   (gpio_nr & 0x1f)
-
-static int port_exp_direction_output(unsigned gpio, int value)
-{
-   int ret;
-
-   i2c_set_bus_num(2);
-   ret = i2c_probe(PORTEXP_IO_TO_CHIP(gpio));
-   if (ret)
-   return ret;
-
-   ret = pca953x_set_dir(PORTEXP_IO_TO_CHIP(gpio),
-   (1 << PORTEXP_IO_TO_PIN(gpio)),
-   (PCA953X_DIR_OUT << PORTEXP_IO_TO_PIN(gpio)));
-
-   if (ret)
-   return ret;
-
-   ret = pca953x_set_val(PORTEXP_IO_TO_CHIP(gpio),
-   (1 << PORTEXP_IO_TO_PIN(gpio)),
-   (value << PORTEXP_IO_TO_PIN(gpio)));
-
-   if (ret)
-   return ret;
-
-   return 0;
-}
-
 #ifdef CONFIG_MTD_NOR_FLASH
 static iomux_v3_cfg_t const eimnor_pads[] = {
IOMUX_PADS(PAD_EIM_D16__EIM_DATA16  | 
MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL)),
@@ -681,19 +643,10 @@ int checkboard(void)
 }
 
 #ifdef CONFIG_USB_EHCI_MX6
-#define USB_HOST1_PWR PORTEXP_IO_NR(0x32, 7)
-#define USB_OTG_PWR   PORTEXP_IO_NR(0x34, 1)
-
-iomux_v3_cfg_t const usb_otg_pads[] = {
-   IOMUX_PADS(PAD_ENET_RX_ER__USB_OTG_ID | MUX_PAD_CTRL(NO_PAD_CTRL)),
-};
-
 int board_ehci_hcd_init(int port)
 {
switch (port) {
case 0:
-   SETUP_IOMUX_PADS(usb_otg_pads);
-
/*
  * Set daisy chain for otg_pin_id on 6q.
 *  For 6dl, this bit is reserved.
@@ -708,29 +661,6 @@ int board_ehci_hcd_init(int port)
}
return 0;
 }
-
-int board_ehci_power(int port, int on)
-{
-   switch (port) {
-   case 0:
-   if (on)
-   port_exp_direction_output(USB_OTG_PWR, 1);
-   else
-   port_exp_direction_output(USB_OTG_PWR, 0);
-   break;
-   case 1:
-   if (on)
-   port_exp_direction_output(USB_HOST1_PWR, 1);
-   else
-   port_exp_direction_output(USB_HOST1_PWR, 0);
-   break;
-   default:
-   printf("MXC USB port %d not yet supported\n", port);
-   return -EINVAL;
-   }
-
-   return 0;
-}
 #endif
 
 #ifdef CONFIG_SPL_BUILD
-- 
2.7.4

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


  1   2   >