RE: [PATCH 03/16] dh_imx6: Switch to full DM-aware

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

RE: [PATCH 03/16] dh_imx6: Switch to full DM-aware

Ludwig Zenz
On 6/13/20 3:55 PM, Jagan Teki wrote:
> Enable DM_SPI/DM_SPI_FLASH with a related config option.
>
> Build fine, but not tested.

Hello,

due to memory limitations in the SRAM of the i.MX6S in SPL we have not used the device tree. Have the restrictions been removed in the meantime? We need a single binary for the i.MX6 q/d/dl/s variants of our system on module.

I think this patch breaks the board support for our module.

regards,
Ludwig Zenz

> Cc: Ludwig Zenz <[hidden email]>
> Cc: Andreas Geisreiter <[hidden email]>
> Signed-off-by: Jagan Teki <[hidden email]>
> ---
>  configs/dh_imx6_defconfig | 3 +++
>  include/configs/dh_imx6.h | 6 ------
>  2 files changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/configs/dh_imx6_defconfig b/configs/dh_imx6_defconfig index d20405e5b2..da756a8e3d 100644
> --- a/configs/dh_imx6_defconfig
> +++ b/configs/dh_imx6_defconfig
> @@ -49,12 +49,14 @@ CONFIG_CMD_CACHE=y
>  CONFIG_CMD_TIME=y
>  CONFIG_CMD_EXT4_WRITE=y
>  CONFIG_OF_CONTROL=y
> +CONFIG_SPL_OF_CONTROL=y
>  CONFIG_DEFAULT_DEVICE_TREE="imx6q-dhcom-pdk2"
>  CONFIG_OF_LIST="imx6q-dhcom-pdk2 imx6dl-dhcom-pdk2"
>  CONFIG_MULTI_DTB_FIT=y
>  CONFIG_ENV_IS_IN_SPI_FLASH=y
>  CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
>  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
> +CONFIG_SPL_DM=y
>  CONFIG_DWC_AHSATA=y
>  CONFIG_BOOTCOUNT_LIMIT=y
>  CONFIG_DM_I2C=y
> @@ -100,4 +102,5 @@ CONFIG_CI_UDC=y
>  CONFIG_USB_GADGET_DOWNLOAD=y
>  CONFIG_WATCHDOG_TIMEOUT_MSECS=60000
>  CONFIG_IMX_WATCHDOG=y
> +# CONFIG_SPL_WDT is not set
>  CONFIG_BZIP2=y
> diff --git a/include/configs/dh_imx6.h b/include/configs/dh_imx6.h index 5bfdf4044b..5fb84f72a2 100644
> --- a/include/configs/dh_imx6.h
> +++ b/include/configs/dh_imx6.h
> @@ -53,12 +53,6 @@
>  /* SATA Configs */
>  #define CONFIG_LBA48
>  
> -/* SPI Flash Configs */
> -#if defined(CONFIG_SPL_BUILD)
> -#undef CONFIG_DM_SPI
> -#undef CONFIG_DM_SPI_FLASH
> -#endif
> -
>  /* UART */
>  #define CONFIG_MXC_UART
>  #define CONFIG_MXC_UART_BASE UART1_BASE
> --
> 2.25.1
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 03/16] dh_imx6: Switch to full DM-aware

Tom Rini-4
On Mon, Jun 22, 2020 at 09:38:36AM +0000, Ludwig Zenz wrote:

> On 6/13/20 3:55 PM, Jagan Teki wrote:
> > Enable DM_SPI/DM_SPI_FLASH with a related config option.
> >
> > Build fine, but not tested.
>
> Hello,
>
> due to memory limitations in the SRAM of the i.MX6S in SPL we have not used the device tree. Have the restrictions been removed in the meantime? We need a single binary for the i.MX6 q/d/dl/s variants of our system on module.
>
> I think this patch breaks the board support for our module.
I _think_ i.MX is making use of the generic hooks to cause build time
failures when we grow too large.  And we have addressed some, but not
all of the concerns about DM size.  Can you please test this patch?  If
it doesn't work doing:

> > diff --git a/include/configs/dh_imx6.h b/include/configs/dh_imx6.h index 5bfdf4044b..5fb84f72a2 100644
> > --- a/include/configs/dh_imx6.h
> > +++ b/include/configs/dh_imx6.h
> > @@ -53,12 +53,6 @@
> >  /* SATA Configs */
> >  #define CONFIG_LBA48
> >  
> > -/* SPI Flash Configs */
> > -#if defined(CONFIG_SPL_BUILD)
> > -#undef CONFIG_DM_SPI
> > -#undef CONFIG_DM_SPI_FLASH
> > -#endif
is still needed as we have a symbol to control DM SPI in SPL directly so
the above isn't doing what you imply you want.  Thanks!

--
Tom

signature.asc (673 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

AW: [PATCH 03/16] dh_imx6: Switch to full DM-aware

Ludwig Zenz
On 22/06/20 9:38 AM, Tom Rini wrote:

> On Mon, Jun 22, 2020 at 09:38:36AM +0000, Ludwig Zenz wrote:
>
>> On 6/13/20 3:55 PM, Jagan Teki wrote:
>> > Enable DM_SPI/DM_SPI_FLASH with a related config option.
>> >
>> > Build fine, but not tested.
>>
>> Hello,
>>
>> due to memory limitations in the SRAM of the i.MX6S in SPL we have not used the device tree. Have the restrictions been removed in the meantime? We need a single binary for the i.MX6 q/d/dl/s variants of our system on module.
>>
>> I think this patch breaks the board support for our module.
>
> I _think_ i.MX is making use of the generic hooks to cause build time failures when we grow too large.  And we have addressed some, but not all of the concerns about DM size.  Can you please test this patch?  If it doesn't work doing:
>
>> > diff --git a/include/configs/dh_imx6.h b/include/configs/dh_imx6.h
>> > index 5bfdf4044b..5fb84f72a2 100644
>> > --- a/include/configs/dh_imx6.h
>> > +++ b/include/configs/dh_imx6.h
>> > @@ -53,12 +53,6 @@
>> >  /* SATA Configs */
>> >  #define CONFIG_LBA48
>> >  
>> > -/* SPI Flash Configs */
>> > -#if defined(CONFIG_SPL_BUILD)
>> > -#undef CONFIG_DM_SPI
>> > -#undef CONFIG_DM_SPI_FLASH
>> > -#endif
>
> is still needed as we have a symbol to control DM SPI in SPL directly so the above isn't doing what you imply you want.  Thanks!
>
>

With the above patch the board hangs after printing "U-Boot SPL 2020.07-rc5-38776-g922c6d5d009-dirty (Jun 25 2020 - 16:34:23 +0200)".

Through some debugging i found the board hangs on calling gpio_request() in dhcom_get_ddr3_code().
 
Just for testing I skipped dhcom_get_ddr3_code and hardcoded the DDR3 size. Then I get:

Missing DTB
fdtdec_setup() returned error -1
### ERROR ### Please RESET the board ###

Unfortunately I have not found out how the SPL should load the devicetree. Can you give me a hint for this?

regards,
Ludwig
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 03/16] dh_imx6: Switch to full DM-aware

Tom Rini-4
On Thu, Jun 25, 2020 at 02:52:58PM +0000, Ludwig Zenz wrote:

> On 22/06/20 9:38 AM, Tom Rini wrote:
> > On Mon, Jun 22, 2020 at 09:38:36AM +0000, Ludwig Zenz wrote:
> >
> >> On 6/13/20 3:55 PM, Jagan Teki wrote:
> >> > Enable DM_SPI/DM_SPI_FLASH with a related config option.
> >> >
> >> > Build fine, but not tested.
> >>
> >> Hello,
> >>
> >> due to memory limitations in the SRAM of the i.MX6S in SPL we have not used the device tree. Have the restrictions been removed in the meantime? We need a single binary for the i.MX6 q/d/dl/s variants of our system on module.
> >>
> >> I think this patch breaks the board support for our module.
> >
> > I _think_ i.MX is making use of the generic hooks to cause build time failures when we grow too large.  And we have addressed some, but not all of the concerns about DM size.  Can you please test this patch?  If it doesn't work doing:
> >
> >> > diff --git a/include/configs/dh_imx6.h b/include/configs/dh_imx6.h
> >> > index 5bfdf4044b..5fb84f72a2 100644
> >> > --- a/include/configs/dh_imx6.h
> >> > +++ b/include/configs/dh_imx6.h
> >> > @@ -53,12 +53,6 @@
> >> >  /* SATA Configs */
> >> >  #define CONFIG_LBA48
> >> >  
> >> > -/* SPI Flash Configs */
> >> > -#if defined(CONFIG_SPL_BUILD)
> >> > -#undef CONFIG_DM_SPI
> >> > -#undef CONFIG_DM_SPI_FLASH
> >> > -#endif
> >
> > is still needed as we have a symbol to control DM SPI in SPL directly so the above isn't doing what you imply you want.  Thanks!
> >
> >
>
> With the above patch the board hangs after printing "U-Boot SPL 2020.07-rc5-38776-g922c6d5d009-dirty (Jun 25 2020 - 16:34:23 +0200)".
>
> Through some debugging i found the board hangs on calling gpio_request() in dhcom_get_ddr3_code().
>  
> Just for testing I skipped dhcom_get_ddr3_code and hardcoded the DDR3 size. Then I get:
>
> Missing DTB
> fdtdec_setup() returned error -1
> ### ERROR ### Please RESET the board ###
>
> Unfortunately I have not found out how the SPL should load the devicetree. Can you give me a hint for this?
Ah, so you've not done any SPL DM migration.

So there's two paths here.  Path 1, the config header snippet that got
things rolling here does need to be removed as "no DM SPI in SPL" means
CONFIG_SPL_DM_SPI=n and not "CONFIG_DM_SPI=n if CONFIG_SPL_BUILD".  We
are not now, and are not at the point where we can say we will be at
some future point, saying everyone must use DM in SPL.  You may want to
examine the .config you get today from running dh_imx6_defconfig and
seeing what can/should be disabled, if anything, that's an unexpected
enabled option.  Path 2, look at something like mx6cuboxi and convert to
CONFIG_SPL_DM=y

--
Tom

signature.asc (673 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 03/16] dh_imx6: Switch to full DM-aware

Simon Glass-3
In reply to this post by Ludwig Zenz
Hi Ludwig,

On Thu, 25 Jun 2020 at 08:53, Ludwig Zenz <[hidden email]> wrote:

>
> On 22/06/20 9:38 AM, Tom Rini wrote:
> > On Mon, Jun 22, 2020 at 09:38:36AM +0000, Ludwig Zenz wrote:
> >
> >> On 6/13/20 3:55 PM, Jagan Teki wrote:
> >> > Enable DM_SPI/DM_SPI_FLASH with a related config option.
> >> >
> >> > Build fine, but not tested.
> >>
> >> Hello,
> >>
> >> due to memory limitations in the SRAM of the i.MX6S in SPL we have not used the device tree. Have the restrictions been removed in the meantime? We need a single binary for the i.MX6 q/d/dl/s variants of our system on module.
> >>
> >> I think this patch breaks the board support for our module.
> >
> > I _think_ i.MX is making use of the generic hooks to cause build time failures when we grow too large.  And we have addressed some, but not all of the concerns about DM size.  Can you please test this patch?  If it doesn't work doing:
> >
> >> > diff --git a/include/configs/dh_imx6.h b/include/configs/dh_imx6.h
> >> > index 5bfdf4044b..5fb84f72a2 100644
> >> > --- a/include/configs/dh_imx6.h
> >> > +++ b/include/configs/dh_imx6.h
> >> > @@ -53,12 +53,6 @@
> >> >  /* SATA Configs */
> >> >  #define CONFIG_LBA48
> >> >
> >> > -/* SPI Flash Configs */
> >> > -#if defined(CONFIG_SPL_BUILD)
> >> > -#undef CONFIG_DM_SPI
> >> > -#undef CONFIG_DM_SPI_FLASH
> >> > -#endif
> >
> > is still needed as we have a symbol to control DM SPI in SPL directly so the above isn't doing what you imply you want.  Thanks!
> >
> >
>
> With the above patch the board hangs after printing "U-Boot SPL 2020.07-rc5-38776-g922c6d5d009-dirty (Jun 25 2020 - 16:34:23 +0200)".
>
> Through some debugging i found the board hangs on calling gpio_request() in dhcom_get_ddr3_code().
>
> Just for testing I skipped dhcom_get_ddr3_code and hardcoded the DDR3 size. Then I get:
>
> Missing DTB
> fdtdec_setup() returned error -1
> ### ERROR ### Please RESET the board ###
>
> Unfortunately I have not found out how the SPL should load the devicetree. Can you give me a hint for this?

The device tree is normally appended to SPL, so it is located by
fdtdec_setup() at __bss_end. See board_fdt_blob_setup().

Regards,
Simon
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 03/16] dh_imx6: Switch to full DM-aware

Ludwig Zenz
In reply to this post by Ludwig Zenz
On 25/06/20 2:52 PM, Tom Rini wrote:

> On Thu, Jun 25, 2020 at 02:52:58PM +0000, Ludwig Zenz wrote:
>> On 22/06/20 9:38 AM, Tom Rini wrote:
>> > On Mon, Jun 22, 2020 at 09:38:36AM +0000, Ludwig Zenz wrote:
>> >
>> >> On 6/13/20 3:55 PM, Jagan Teki wrote:
>> >> > Enable DM_SPI/DM_SPI_FLASH with a related config option.
>> >> >
>> >> > Build fine, but not tested.
>> >>
>> >> Hello,
>> >>
>> >> due to memory limitations in the SRAM of the i.MX6S in SPL we have not used the device tree. Have the restrictions been removed in the meantime? We need a single binary for the i.MX6 q/d/dl/s variants of our system on module.
>> >>
>> >> I think this patch breaks the board support for our module.
>> >
>> > I _think_ i.MX is making use of the generic hooks to cause build time failures when we grow too large.  And we have addressed some, but not all of the concerns about DM size.  Can you please test this patch?  If it doesn't work doing:
>> >
>> >> > diff --git a/include/configs/dh_imx6.h
>> >> > b/include/configs/dh_imx6.h index 5bfdf4044b..5fb84f72a2 100644
>> >> > --- a/include/configs/dh_imx6.h
>> >> > +++ b/include/configs/dh_imx6.h
>> >> > @@ -53,12 +53,6 @@
>> >> >  /* SATA Configs */
>> >> >  #define CONFIG_LBA48
>> >> >  
>> >> > -/* SPI Flash Configs */
>> >> > -#if defined(CONFIG_SPL_BUILD)
>> >> > -#undef CONFIG_DM_SPI
>> >> > -#undef CONFIG_DM_SPI_FLASH
>> >> > -#endif
>> >
>> > is still needed as we have a symbol to control DM SPI in SPL directly so the above isn't doing what you imply you want.  Thanks!
>> >

I can remove the above defines from include/configs/dh_imx6.h when I add the following patch:

include/config_uncmd_spl.h
@@ -14,6 +14,7 @@
 #undef CONFIG_DM_SERIAL
 #undef CONFIG_DM_I2C
 #undef CONFIG_DM_SPI
+#undef CONFIG_DM_SPI_FLASH
 #endif

>>
>>
>> With the above patch the board hangs after printing "U-Boot SPL 2020.07-rc5-38776-g922c6d5d009-dirty (Jun 25 2020 - 16:34:23 +0200)".
>>
>> Through some debugging i found the board hangs on calling gpio_request() in dhcom_get_ddr3_code().
>>  
>> Just for testing I skipped dhcom_get_ddr3_code and hardcoded the DDR3 size. Then I get:
>>
>> Missing DTB
>> fdtdec_setup() returned error -1
>> ### ERROR ### Please RESET the board ###
>>
>> Unfortunately I have not found out how the SPL should load the devicetree. Can you give me a hint for this?
>
>Ah, so you've not done any SPL DM migration.
>
>So there's two paths here.  Path 1, the config header snippet that got things rolling here does need to be removed as "no DM SPI in SPL" means CONFIG_SPL_DM_SPI=n and not "CONFIG_DM_SPI=n if CONFIG_SPL_BUILD".  We are not now, and are not at the point where we can say we will be at some future point, saying everyone must use DM in SPL.  You may want to examine the .config you get today from running dh_imx6_defconfig and seeing what can/should be disabled, if anything, that's an unexpected enabled option.  Path 2, look at something like mx6cuboxi and convert to CONFIG_SPL_DM=y
>

The CONFIG_SPL_DM_SPI is not in the .config of my build. The little patch for include/config_uncmd_spl.h from above allows me to clean up dh_imx6.h.

Remark on path 2: mx6cuboxi avoids gpio usage in spl for some reason. We need gpio support to detect the DDR3 size. I would like to go with path 1.

How can I check if adding CONFIG_DM_SPI_FLASH to include/config_uncmd_spl.h causes problems for other boards?

regards,
Ludwig
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 03/16] dh_imx6: Switch to full DM-aware

Tom Rini-4
On Mon, Jun 29, 2020 at 12:27:08PM +0000, Ludwig Zenz wrote:

> On 25/06/20 2:52 PM, Tom Rini wrote:
> > On Thu, Jun 25, 2020 at 02:52:58PM +0000, Ludwig Zenz wrote:
> >> On 22/06/20 9:38 AM, Tom Rini wrote:
> >> > On Mon, Jun 22, 2020 at 09:38:36AM +0000, Ludwig Zenz wrote:
> >> >
> >> >> On 6/13/20 3:55 PM, Jagan Teki wrote:
> >> >> > Enable DM_SPI/DM_SPI_FLASH with a related config option.
> >> >> >
> >> >> > Build fine, but not tested.
> >> >>
> >> >> Hello,
> >> >>
> >> >> due to memory limitations in the SRAM of the i.MX6S in SPL we have not used the device tree. Have the restrictions been removed in the meantime? We need a single binary for the i.MX6 q/d/dl/s variants of our system on module.
> >> >>
> >> >> I think this patch breaks the board support for our module.
> >> >
> >> > I _think_ i.MX is making use of the generic hooks to cause build time failures when we grow too large.  And we have addressed some, but not all of the concerns about DM size.  Can you please test this patch?  If it doesn't work doing:
> >> >
> >> >> > diff --git a/include/configs/dh_imx6.h
> >> >> > b/include/configs/dh_imx6.h index 5bfdf4044b..5fb84f72a2 100644
> >> >> > --- a/include/configs/dh_imx6.h
> >> >> > +++ b/include/configs/dh_imx6.h
> >> >> > @@ -53,12 +53,6 @@
> >> >> >  /* SATA Configs */
> >> >> >  #define CONFIG_LBA48
> >> >> >  
> >> >> > -/* SPI Flash Configs */
> >> >> > -#if defined(CONFIG_SPL_BUILD)
> >> >> > -#undef CONFIG_DM_SPI
> >> >> > -#undef CONFIG_DM_SPI_FLASH
> >> >> > -#endif
> >> >
> >> > is still needed as we have a symbol to control DM SPI in SPL directly so the above isn't doing what you imply you want.  Thanks!
> >> >
>
> I can remove the above defines from include/configs/dh_imx6.h when I add the following patch:
>
> include/config_uncmd_spl.h
> @@ -14,6 +14,7 @@
>  #undef CONFIG_DM_SERIAL
>  #undef CONFIG_DM_I2C
>  #undef CONFIG_DM_SPI
> +#undef CONFIG_DM_SPI_FLASH
>  #endif
>
> >>
> >>
> >> With the above patch the board hangs after printing "U-Boot SPL 2020.07-rc5-38776-g922c6d5d009-dirty (Jun 25 2020 - 16:34:23 +0200)".
> >>
> >> Through some debugging i found the board hangs on calling gpio_request() in dhcom_get_ddr3_code().
> >>  
> >> Just for testing I skipped dhcom_get_ddr3_code and hardcoded the DDR3 size. Then I get:
> >>
> >> Missing DTB
> >> fdtdec_setup() returned error -1
> >> ### ERROR ### Please RESET the board ###
> >>
> >> Unfortunately I have not found out how the SPL should load the devicetree. Can you give me a hint for this?
> >
> >Ah, so you've not done any SPL DM migration.
> >
> >So there's two paths here.  Path 1, the config header snippet that got things rolling here does need to be removed as "no DM SPI in SPL" means CONFIG_SPL_DM_SPI=n and not "CONFIG_DM_SPI=n if CONFIG_SPL_BUILD".  We are not now, and are not at the point where we can say we will be at some future point, saying everyone must use DM in SPL.  You may want to examine the .config you get today from running dh_imx6_defconfig and seeing what can/should be disabled, if anything, that's an unexpected enabled option.  Path 2, look at something like mx6cuboxi and convert to CONFIG_SPL_DM=y
> >
>
> The CONFIG_SPL_DM_SPI is not in the .config of my build. The little patch for include/config_uncmd_spl.h from above allows me to clean up dh_imx6.h.
>
> Remark on path 2: mx6cuboxi avoids gpio usage in spl for some reason. We need gpio support to detect the DDR3 size. I would like to go with path 1.
>
> How can I check if adding CONFIG_DM_SPI_FLASH to include/config_uncmd_spl.h causes problems for other boards?
So this is another example then where we do need
http://patchwork.ozlabs.org/project/uboot/patch/20200604151153.3980-4-Zhiqiang.Hou@.../
and I'll be pushing that to -next shortly, as it needed
http://patchwork.ozlabs.org/project/uboot/patch/20200627120041.11223-1-trini@.../
as well.  Thanks for digging in to this more.

--
Tom

signature.asc (673 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 03/16] dh_imx6: Switch to full DM-aware

Jagan Teki-3
In reply to this post by Ludwig Zenz
On Mon, Jun 22, 2020 at 3:09 PM 'Ludwig Zenz' via Amarula Linux
<[hidden email]> wrote:

>
> On 6/13/20 3:55 PM, Jagan Teki wrote:
> > Enable DM_SPI/DM_SPI_FLASH with a related config option.
> >
> > Build fine, but not tested.
>
> Hello,
>
> due to memory limitations in the SRAM of the i.MX6S in SPL we have not used the device tree. Have the restrictions been removed in the meantime? We need a single binary for the i.MX6 q/d/dl/s variants of our system on module.
>
> I think this patch breaks the board support for our module.

Have you tried platdata on SPL side?

Jagan.
Reply | Threaded
Open this post in threaded view
|

AW: [PATCH 03/16] dh_imx6: Switch to full DM-aware

Ludwig Zenz
On 7/8/20 3:07 PM, Jagan Teki wrote:

> On Mon, Jun 22, 2020 at 3:09 PM 'Ludwig Zenz' via Amarula Linux <[hidden email]> wrote:
> >
> > On 6/13/20 3:55 PM, Jagan Teki wrote:
> > > Enable DM_SPI/DM_SPI_FLASH with a related config option.
> > >
> > > Build fine, but not tested.
> >
> > Hello,
> >
> > due to memory limitations in the SRAM of the i.MX6S in SPL we have not used the device tree. Have the restrictions been removed in the meantime? We need a single binary for the i.MX6 q/d/dl/s variants of our system on module.
> >
> > I think this patch breaks the board support for our module.
>
> Have you tried platdata on SPL side?
>
> Jagan.
>

Hello Jagan,

I tested it briefly but it didn't work immediately and I didn't have the time to investigate it further.

Can you reference a board, which has already implemented this?

regards,
Ludwig
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 03/16] dh_imx6: Switch to full DM-aware

Marek Vasut-3
In reply to this post by Tom Rini-4
On 6/29/20 4:01 PM, Tom Rini wrote:

> On Mon, Jun 29, 2020 at 12:27:08PM +0000, Ludwig Zenz wrote:
>> On 25/06/20 2:52 PM, Tom Rini wrote:
>>> On Thu, Jun 25, 2020 at 02:52:58PM +0000, Ludwig Zenz wrote:
>>>> On 22/06/20 9:38 AM, Tom Rini wrote:
>>>>> On Mon, Jun 22, 2020 at 09:38:36AM +0000, Ludwig Zenz wrote:
>>>>>
>>>>>> On 6/13/20 3:55 PM, Jagan Teki wrote:
>>>>>>> Enable DM_SPI/DM_SPI_FLASH with a related config option.
>>>>>>>
>>>>>>> Build fine, but not tested.
>>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> due to memory limitations in the SRAM of the i.MX6S in SPL we have not used the device tree. Have the restrictions been removed in the meantime? We need a single binary for the i.MX6 q/d/dl/s variants of our system on module.
>>>>>>
>>>>>> I think this patch breaks the board support for our module.
>>>>>
>>>>> I _think_ i.MX is making use of the generic hooks to cause build time failures when we grow too large.  And we have addressed some, but not all of the concerns about DM size.  Can you please test this patch?  If it doesn't work doing:
>>>>>
>>>>>>> diff --git a/include/configs/dh_imx6.h
>>>>>>> b/include/configs/dh_imx6.h index 5bfdf4044b..5fb84f72a2 100644
>>>>>>> --- a/include/configs/dh_imx6.h
>>>>>>> +++ b/include/configs/dh_imx6.h
>>>>>>> @@ -53,12 +53,6 @@
>>>>>>>   /* SATA Configs */
>>>>>>>   #define CONFIG_LBA48
>>>>>>>  
>>>>>>> -/* SPI Flash Configs */
>>>>>>> -#if defined(CONFIG_SPL_BUILD)
>>>>>>> -#undef CONFIG_DM_SPI
>>>>>>> -#undef CONFIG_DM_SPI_FLASH
>>>>>>> -#endif
>>>>>
>>>>> is still needed as we have a symbol to control DM SPI in SPL directly so the above isn't doing what you imply you want.  Thanks!
>>>>>
>>
>> I can remove the above defines from include/configs/dh_imx6.h when I add the following patch:
>>
>> include/config_uncmd_spl.h
>> @@ -14,6 +14,7 @@
>>   #undef CONFIG_DM_SERIAL
>>   #undef CONFIG_DM_I2C
>>   #undef CONFIG_DM_SPI
>> +#undef CONFIG_DM_SPI_FLASH
>>   #endif
>>
>>>>
>>>>
>>>> With the above patch the board hangs after printing "U-Boot SPL 2020.07-rc5-38776-g922c6d5d009-dirty (Jun 25 2020 - 16:34:23 +0200)".
>>>>
>>>> Through some debugging i found the board hangs on calling gpio_request() in dhcom_get_ddr3_code().
>>>>  
>>>> Just for testing I skipped dhcom_get_ddr3_code and hardcoded the DDR3 size. Then I get:
>>>>
>>>> Missing DTB
>>>> fdtdec_setup() returned error -1
>>>> ### ERROR ### Please RESET the board ###
>>>>
>>>> Unfortunately I have not found out how the SPL should load the devicetree. Can you give me a hint for this?
>>>
>>> Ah, so you've not done any SPL DM migration.
>>>
>>> So there's two paths here.  Path 1, the config header snippet that got things rolling here does need to be removed as "no DM SPI in SPL" means CONFIG_SPL_DM_SPI=n and not "CONFIG_DM_SPI=n if CONFIG_SPL_BUILD".  We are not now, and are not at the point where we can say we will be at some future point, saying everyone must use DM in SPL.  You may want to examine the .config you get today from running dh_imx6_defconfig and seeing what can/should be disabled, if anything, that's an unexpected enabled option.  Path 2, look at something like mx6cuboxi and convert to CONFIG_SPL_DM=y
>>>
>>
>> The CONFIG_SPL_DM_SPI is not in the .config of my build. The little patch for include/config_uncmd_spl.h from above allows me to clean up dh_imx6.h.
>>
>> Remark on path 2: mx6cuboxi avoids gpio usage in spl for some reason. We need gpio support to detect the DDR3 size. I would like to go with path 1.
>>
>> How can I check if adding CONFIG_DM_SPI_FLASH to include/config_uncmd_spl.h causes problems for other boards?
>
> So this is another example then where we do need
> http://patchwork.ozlabs.org/project/uboot/patch/20200604151153.3980-4-Zhiqiang.Hou@.../
> and I'll be pushing that to -next shortly, as it needed
> http://patchwork.ozlabs.org/project/uboot/patch/20200627120041.11223-1-trini@.../
> as well.  Thanks for digging in to this more.

Note that this patch broke the DH iMX6 board, it now hangs in SPL.