Skip to contentSkip to conversation

dh_imx6: Switch to full DM-aware

PATCH New Ludwig Zenz 3 participants 3 messages Jun 29, 2020 – Jan 13, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 3/16 dh_imx6: Switch to full DM-aware

Quoted 25 lines · Tom Rini
Quoted 24 lines · Ludwig Zenz
Quoted 23 lines · Tom Rini
Quoted 10 lines · Ludwig Zenz
Quoted 3 lines · Jagan Teki

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:

Quoted 8 lines
Quoted 8 lines
(quoted diff) +0 -0

b/include/configs/dh_imx6.h index 5bfdf4044b..5fb84f72a2 100644

include/configs/dh_imx6.h +0 -0
@@ -53,12 +53,6 @@
 /* SATA Configs */
 #define CONFIG_LBA48
 
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines

include/configs/dh_imx6.h line 60

Quoted 5 lines
include/configs/dh_imx6.h +0 -5
-/* 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

Quoted 12 lines
Quoted 12 lines

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 ###

Quoted 6 lines
Quoted 1 line

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

#1 lore raw

PATCH 3/16 dh_imx6: Switch to full DM-aware

Quoted 61 lines · Ludwig Zenz
Quoted 25 lines · Tom Rini
Quoted 24 lines · Ludwig Zenz
Quoted 23 lines · Tom Rini
Quoted 10 lines · Ludwig Zenz
Quoted 3 lines · Jagan Teki

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:

Quoted 8 lines
Quoted 8 lines
(quoted diff) +0 -0

b/include/configs/dh_imx6.h index 5bfdf4044b..5fb84f72a2 100644

include/configs/dh_imx6.h +0 -0
@@ -53,12 +53,6 @@
 /* SATA Configs */
 #define CONFIG_LBA48
 
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines

include/configs/dh_imx6.h line 60

Quoted 5 lines
include/configs/dh_imx6.h +0 -5
-/* 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

(quoted diff) +1 -0
@@ -14,6 +14,7 @@
 #undef CONFIG_DM_SERIAL
 #undef CONFIG_DM_I2C
 #undef CONFIG_DM_SPI
+#undef CONFIG_DM_SPI_FLASH
 #endif
 
Quoted 16 lines
Quoted 6 lines

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().

Quoted 7 lines

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.

Quoted 8 lines
Quoted 2 lines

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 at nxp.com/ and I'll be pushing that to -next shortly, as it needed
http://patchwork.ozlabs.org/project/uboot/patch/20200627120041.11223-1-trini at konsulko.com/ as well. Thanks for digging in to this more.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200629/5f32ccaf/attachment.sig>
#2 lore raw

PATCH 3/16 dh_imx6: Switch to full DM-aware

Quoted 69 lines · Tom Rini
Quoted 68 lines · Ludwig Zenz
Quoted 25 lines · Tom Rini
Quoted 24 lines · Ludwig Zenz
Quoted 23 lines · Tom Rini
Quoted 10 lines · Ludwig Zenz
Quoted 3 lines · Jagan Teki

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:

Quoted 8 lines
Quoted 8 lines
(quoted diff) +0 -0

b/include/configs/dh_imx6.h index 5bfdf4044b..5fb84f72a2 100644

include/configs/dh_imx6.h +0 -0
@@ -53,12 +53,6 @@
  /* SATA Configs */
  #define CONFIG_LBA48
 
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines

include/configs/dh_imx6.h line 60

Quoted 5 lines
include/configs/dh_imx6.h +0 -5
-/* 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

(quoted diff) +1 -0
@@ -14,6 +14,7 @@
  #undef CONFIG_DM_SERIAL
  #undef CONFIG_DM_I2C
  #undef CONFIG_DM_SPI
+#undef CONFIG_DM_SPI_FLASH
  #endif
 
Quoted 12 lines
Quoted 12 lines

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 ###

Quoted 6 lines
Quoted 1 line

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.

Quoted 7 lines
Quoted 1 line

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 at nxp.com/ and I'll be pushing that to -next shortly, as it needed
http://patchwork.ozlabs.org/project/uboot/patch/20200627120041.11223-1-trini at konsulko.com/ as well. Thanks for digging in to this more.

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