[U-Boot] am335x board i2c_probe fails from nand boot

Hi!
Would anyone have idea why spl boot fails in i2c_probe when running from nand but not when running from mmc card or anything at all to check?
My card is am335x based board with u-boot coming from u-boot-it v2016.05.
Spl boot crashes when it tries to run i2c_probe getting timeout in omap24.._i2c.c/wait_for_event() function. Boot enters wait_for_event() only once, if spl boot is coming from nand and exiting with: "Timed out in wait_for_event: status=0000 Check if pads/pull-ups of bus are properly configured",
However, if spl comes from mmc card, everything goes well, wait_for_event is executed tens of times without problem.
All help very well appreciated!!
Thanks, Matti

Hi Matti,
On Tue, Jan 3, 2017 at 10:26 AM, matti kaasinen matti.kaasinen@gmail.com wrote:
Hi!
Would anyone have idea why spl boot fails in i2c_probe when running from nand but not when running from mmc card or anything at all to check?
My card is am335x based board with u-boot coming from u-boot-it v2016.05.
Spl boot crashes when it tries to run i2c_probe getting timeout in omap24.._i2c.c/wait_for_event() function. Boot enters wait_for_event() only once, if spl boot is coming from nand and exiting with: "Timed out in wait_for_event: status=0000 Check if pads/pull-ups of bus are properly configured",
However, if spl comes from mmc card, everything goes well, wait_for_event is executed tens of times without problem.
All help very well appreciated!!
What PMIC are you using?
Yegor

2017-01-03 12:56 GMT+02:00 Yegor Yefremov yegorslists@googlemail.com:
What PMIC are you using?
It is TPS65217, so probe command is: i2c_probe(TPS65217_CHIP_PM)

On Tue, Jan 3, 2017 at 12:02 PM, matti kaasinen matti.kaasinen@gmail.com wrote:
2017-01-03 12:56 GMT+02:00 Yegor Yefremov yegorslists@googlemail.com:
What PMIC are you using?
It is TPS65217, so probe command is: i2c_probe(TPS65217_CHIP_PM)
I had some problems with tps65910. Anyway try to reduce I2C speed up to 1000. The kernel can still run the full speed. It's only for bootloader stage.
Yegor

I could try that, but how does it work properly when I run it from mmc. Does reading spl from mmc touch I2C somehow (interrupt, speed or anything) or does reading spl from nand do that.
2017-01-03 13:05 GMT+02:00 Yegor Yefremov yegorslists@googlemail.com:
On Tue, Jan 3, 2017 at 12:02 PM, matti kaasinen matti.kaasinen@gmail.com wrote:
2017-01-03 12:56 GMT+02:00 Yegor Yefremov yegorslists@googlemail.com:
What PMIC are you using?
It is TPS65217, so probe command is: i2c_probe(TPS65217_CHIP_PM)
I had some problems with tps65910. Anyway try to reduce I2C speed up to 1000. The kernel can still run the full speed. It's only for bootloader stage.
Yegor

On Tuesday 03 January 2017 02:56 PM, matti kaasinen wrote:
Hi!
Would anyone have idea why spl boot fails in i2c_probe when running from nand but not when running from mmc card or anything at all to check?
Do you have different mux configurations for different boot modes?(Just wondering if mux is properly configured for i2c in nand boot)
My card is am335x based board with u-boot coming from u-boot-it v2016.05.
Can you specify the tree? Also which config are you using and what board it it?
Thanks and regards, Lokesh
Spl boot crashes when it tries to run i2c_probe getting timeout in omap24.._i2c.c/wait_for_event() function. Boot enters wait_for_event() only once, if spl boot is coming from nand and exiting with: "Timed out in wait_for_event: status=0000 Check if pads/pull-ups of bus are properly configured",
However, if spl comes from mmc card, everything goes well, wait_for_event is executed tens of times without problem.
All help very well appreciated!!
Thanks, Matti _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot

2017-01-03 13:16 GMT+02:00 Lokesh Vutla lokeshvutla@ti.com:
Would anyone have idea why spl boot fails in i2c_probe when running from nand but not when running from mmc card or anything at all to check?
Do you have different mux configurations for different boot modes?(Just wondering if mux is properly configured for i2c in nand boot)
No, not that I know and can detect from the board file. In fact it looks
like mmc boot has the correct configuration.
My card is am335x based board with u-boot coming from u-boot-it v2016.05.
Can you specify the tree? Also which config are you using and what board it it?
I have been using youcto/poky build system with meta-ti layer that brings up u-boot-ti-staging. I have patched board/ti/am335x/board.c and mux.c. I have used am335x_evm config that I have had to patch somewhat to suit my board. Board resembles somewhat am335x_evm but it does not have configuration eeprom, has different ddr3 chips. Also, it has different PMIC (same as beaglebone). Therefore I need to patch guite a lot. One reason why I2C configuration is wrong in nand mode could be the fact that I have CONFIG_TI_I2C_BOARD_DETECT variable is undefined (because I do not have that eeprom). But it looks that do_board_detect runs enable_i2c0_pin_mux() that I do not run separately. On the other hand, that does not explain why mmc boot works.
Thanks and regards, Lokesh

2017-01-03 14:33 GMT+02:00 matti kaasinen matti.kaasinen@gmail.com:
One reason why I2C configuration is wrong in nand mode could be the fact that I have CONFIG_TI_I2C_BOARD_DETECT variable is undefined (because I do not have that eeprom). But it looks that do_board_detect runs enable_i2c0_pin_mux() that I do not run separately. On the other hand, that does not explain why mmc boot works.
Now I did this I2C0 configuration separately prior to running i2c_probe(). Nand boot went further now. However, main u-boot did not start properly. I got following messages Trying to boot from NAND The Expected Linux image was not found. Please check your NAND configuration. Trying to start u-boot now...
........ more messages .... Press SPACE to abort autoboot in 2 seconds Card did not respond to voltage select! Card did not respond to voltage select! Card did not respond to voltage select! Card did not respond to voltage select! Card did not respond to voltage select! data abort pc : [<8ff70f94>] lr : [<8ff701dd>] reloc pc : [<8081df94>] lr : [<8081d1dd>] sp : 8ef28678 ip : 8ff5891d fp : 00000003 r10: 8ffb3af8 r9 : 8ef32ed8 r8 : 8ef41e40 r7 : 8ff584bd r6 : 8ef39478 r5 : 8ef39500 r4 : 47810000 r3 : 8ff70f85 r2 : 00000d8d r1 : 00000000 r0 : 8ef39500 Flags: nZCv IRQs off FIQs on Mode SVC_32 Resetting CPU ...
resetting ...
And game over.... So, it's not quite sure that voltage adjustments went through even though I2C did not complain anymore. There could be something wrong with nand settings, too. I need to check where these complaints are coming.
Thanks anyway for your comments, Matti

"The Expected Linux image was not found. Please check your NAND configuration" message is coming from: common/spl/spl_nand.c In practice this message seems coming from the fact that header of kernel image can't be identified from offset after executing: nand_spl_load_image(CONFIG_SYS_NAND_SPL_KERNEL_OFFS,,) So, something gets broken in while executing nand_spl_load_image. Perhaps CONFIG_SYS_NAND_SPL_KERNEL_OFFS value.
"Card did not respond to voltage select!" is coming from: drivers/mmc/mmc.c
2017-01-03 15:34 GMT+02:00 matti kaasinen matti.kaasinen@gmail.com:
2017-01-03 14:33 GMT+02:00 matti kaasinen matti.kaasinen@gmail.com:
One reason why I2C configuration is wrong in nand mode could be the fact that I have CONFIG_TI_I2C_BOARD_DETECT variable is undefined (because I do not have that eeprom). But it looks that do_board_detect runs enable_i2c0_pin_mux() that I do not run separately. On the other hand, that does not explain why mmc boot works.
Now I did this I2C0 configuration separately prior to running i2c_probe(). Nand boot went further now. However, main u-boot did not start properly. I got following messages Trying to boot from NAND The Expected Linux image was not found. Please check your NAND configuration. Trying to start u-boot now...
........ more messages .... Press SPACE to abort autoboot in 2 seconds Card did not respond to voltage select! Card did not respond to voltage select! Card did not respond to voltage select! Card did not respond to voltage select! Card did not respond to voltage select! data abort pc : [<8ff70f94>] lr : [<8ff701dd>] reloc pc : [<8081df94>] lr : [<8081d1dd>] sp : 8ef28678 ip : 8ff5891d fp : 00000003 r10: 8ffb3af8 r9 : 8ef32ed8 r8 : 8ef41e40 r7 : 8ff584bd r6 : 8ef39478 r5 : 8ef39500 r4 : 47810000 r3 : 8ff70f85 r2 : 00000d8d r1 : 00000000 r0 : 8ef39500 Flags: nZCv IRQs off FIQs on Mode SVC_32 Resetting CPU ...
resetting ...
And game over.... So, it's not quite sure that voltage adjustments went through even though I2C did not complain anymore. There could be something wrong with nand settings, too. I need to check where these complaints are coming.
Thanks anyway for your comments, Matti

On Tuesday 03 January 2017 08:07 PM, matti kaasinen wrote:
"The Expected Linux image was not found. Please check your NAND configuration" message is coming from: common/spl/spl_nand.c In practice this message seems coming from the fact that header of kernel image can't be identified from offset after executing: nand_spl_load_image(CONFIG_SYS_NAND_SPL_KERNEL_OFFS,,)
This is fine as SPL_OS_BOOT is enabled by default. We are successfully going to u-boot prompt, so no issues.
So, something gets broken in while executing nand_spl_load_image. Perhaps CONFIG_SYS_NAND_SPL_KERNEL_OFFS value.
"Card did not respond to voltage select!" is coming from: drivers/mmc/mmc.c
Can you check if mmc mux is being done properly?
Thanks and regards, Lokesh
2017-01-03 15:34 GMT+02:00 matti kaasinen <matti.kaasinen@gmail.com mailto:matti.kaasinen@gmail.com>:
2017-01-03 14:33 GMT+02:00 matti kaasinen <matti.kaasinen@gmail.com <mailto:matti.kaasinen@gmail.com>>: One reason why I2C configuration is wrong in nand mode could be the fact that I have CONFIG_TI_I2C_BOARD_DETECT variable is undefined (because I do not have that eeprom). But it looks that do_board_detect runs enable_i2c0_pin_mux() that I do not run separately. On the other hand, that does not explain why mmc boot works. Now I did this I2C0 configuration separately prior to running i2c_probe(). Nand boot went further now. However, main u-boot did not start properly. I got following messages Trying to boot from NAND The Expected Linux image was not found. Please check your NAND configuration. Trying to start u-boot now... ........ more messages .... Press SPACE to abort autoboot in 2 seconds Card did not respond to voltage select! Card did not respond to voltage select! Card did not respond to voltage select! Card did not respond to voltage select! Card did not respond to voltage select! data abort pc : [<8ff70f94>] lr : [<8ff701dd>] reloc pc : [<8081df94>] lr : [<8081d1dd>] sp : 8ef28678 ip : 8ff5891d fp : 00000003 r10: 8ffb3af8 r9 : 8ef32ed8 r8 : 8ef41e40 r7 : 8ff584bd r6 : 8ef39478 r5 : 8ef39500 r4 : 47810000 r3 : 8ff70f85 r2 : 00000d8d r1 : 00000000 r0 : 8ef39500 Flags: nZCv IRQs off FIQs on Mode SVC_32 Resetting CPU ... resetting ... And game over.... So, it's not quite sure that voltage adjustments went through even though I2C did not complain anymore. There could be something wrong with nand settings, too. I need to check where these complaints are coming. Thanks anyway for your comments, Matti

2017-01-04 6:46 GMT+02:00 Lokesh Vutla lokeshvutla@ti.com:
"Card did not respond to voltage select!" is coming from: drivers/mmc/mmc.c
Can you check if mmc mux is being done properly?
I think this message is coming because I have ejected mmc (sd card) in order to boot from nand.
However, I went through include/configs/am335x_evm.h that I have patched very moderately - ionly two changes: 1) disable card detect 2) feed own fdt file. I noticed some nand related values that I'm not sure if they are correct. I get following nand partition listed from mmc boot: [ 1.230539] Creating 10 MTD partitions on "8000000.nand": [ 1.236229] 0x000000000000-0x000000020000 : "NAND.SPL" [ 1.243121] 0x000000020000-0x000000040000 : "NAND.SPL.backup1" [ 1.250614] 0x000000040000-0x000000060000 : "NAND.SPL.backup2" [ 1.258121] 0x000000060000-0x000000080000 : "NAND.SPL.backup3" [ 1.265515] 0x000000080000-0x0000000c0000 : "NAND.u-boot-spl-os" [ 1.273167] 0x0000000c0000-0x0000001c0000 : "NAND.u-boot" [ 1.280890] 0x0000001c0000-0x0000001e0000 : "NAND.u-boot-env" [ 1.288255] 0x0000001e0000-0x000000200000 : "NAND.u-boot-env.backup1" [ 1.296430] 0x000000200000-0x000000a00000 : "NAND.kernel" [ 1.309941] 0x000000a00000-0x000010000000 : "NAND.file-system"
In am335x_evm.h there are following definitions: #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x000c0000 So, this is pointing to NAND.u-boot-spl-os, i.e os parameters in nand, not u-boot
#define CONFIG_CMD_SPL_NAND_OFS 0x00080000 /* os parameters */ This is pointing to NAND.SPL.backup3
#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x00200000 /* kernel offset */ This is pointing to NAND.u-boot-env.backup1, not kernel
#define CONFIG_CMD_SPL_WRITE_SIZE 0x2000 0x2000 does not match with 0x80000 that is reserved for NAND.u-boot-spl-os partition.
As you told, u-boot starts, so most likely these don't matter this time.
Thanks, Matti

FIXME!! Pretty much everything I claim below is wrong and am335x_evm.h correct. Only the last notice is not totally wrong as space reserver for NAND.u-boot-spl-os is not 0x2000.
2017-01-04 9:33 GMT+02:00 matti kaasinen matti.kaasinen@gmail.com:
I noticed some nand related values that I'm not sure if they are correct. I get following nand partition listed from mmc boot: [ 1.230539] Creating 10 MTD partitions on "8000000.nand": [ 1.236229] 0x000000000000-0x000000020000 : "NAND.SPL" [ 1.243121] 0x000000020000-0x000000040000 : "NAND.SPL.backup1" [ 1.250614] 0x000000040000-0x000000060000 : "NAND.SPL.backup2" [ 1.258121] 0x000000060000-0x000000080000 : "NAND.SPL.backup3" [ 1.265515] 0x000000080000-0x0000000c0000 : "NAND.u-boot-spl-os" [ 1.273167] 0x0000000c0000-0x0000001c0000 : "NAND.u-boot" [ 1.280890] 0x0000001c0000-0x0000001e0000 : "NAND.u-boot-env" [ 1.288255] 0x0000001e0000-0x000000200000 : "NAND.u-boot-env.backup1" [ 1.296430] 0x000000200000-0x000000a00000 : "NAND.kernel" [ 1.309941] 0x000000a00000-0x000010000000 : "NAND.file-system"
In am335x_evm.h there are following definitions: #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x000c0000 So, this is pointing to NAND.u-boot-spl-os, i.e os parameters in nand, not u-boot
#define CONFIG_CMD_SPL_NAND_OFS 0x00080000 /* os parameters */ This is pointing to NAND.SPL.backup3
#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x00200000 /* kernel offset */ This is pointing to NAND.u-boot-env.backup1, not kernel
#define CONFIG_CMD_SPL_WRITE_SIZE 0x2000 0x2000 does not match with 0x80000 that is reserved for NAND.u-boot-spl-os partition.

This is now too much off-topic from the original title. I2C is not troublemaker anymore. I'll open new topic for new problems. Thanks
2017-01-05 12:09 GMT+02:00 matti kaasinen matti.kaasinen@gmail.com:
FIXME!! Pretty much everything I claim below is wrong and am335x_evm.h correct. Only the last notice is not totally wrong as space reserver for NAND.u-boot-spl-os is not 0x2000.
2017-01-04 9:33 GMT+02:00 matti kaasinen matti.kaasinen@gmail.com:
I noticed some nand related values that I'm not sure if they are correct. I get following nand partition listed from mmc boot: [ 1.230539] Creating 10 MTD partitions on "8000000.nand": [ 1.236229] 0x000000000000-0x000000020000 : "NAND.SPL" [ 1.243121] 0x000000020000-0x000000040000 : "NAND.SPL.backup1" [ 1.250614] 0x000000040000-0x000000060000 : "NAND.SPL.backup2" [ 1.258121] 0x000000060000-0x000000080000 : "NAND.SPL.backup3" [ 1.265515] 0x000000080000-0x0000000c0000 : "NAND.u-boot-spl-os" [ 1.273167] 0x0000000c0000-0x0000001c0000 : "NAND.u-boot" [ 1.280890] 0x0000001c0000-0x0000001e0000 : "NAND.u-boot-env" [ 1.288255] 0x0000001e0000-0x000000200000 : "NAND.u-boot-env.backup1" [ 1.296430] 0x000000200000-0x000000a00000 : "NAND.kernel" [ 1.309941] 0x000000a00000-0x000010000000 : "NAND.file-system"
In am335x_evm.h there are following definitions: #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x000c0000 So, this is pointing to NAND.u-boot-spl-os, i.e os parameters in nand, not u-boot
#define CONFIG_CMD_SPL_NAND_OFS 0x00080000 /* os parameters */ This is pointing to NAND.SPL.backup3
#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x00200000 /* kernel offset */ This is pointing to NAND.u-boot-env.backup1, not kernel
#define CONFIG_CMD_SPL_WRITE_SIZE 0x2000 0x2000 does not match with 0x80000 that is reserved for NAND.u-boot-spl-os partition.

2017-01-04 6:46 GMT+02:00 Lokesh Vutla lokeshvutla@ti.com:
"Card did not respond to voltage select!" is coming from: drivers/mmc/mmc.c
Can you check if mmc mux is being done properly?
This is one subject I had to fight lately. I just can't figure out how I can feed my own dtb for u-boot usage. Compilation report complains that CONFIG_DEFAULT_DEVICE_TREE is not set. If I set it in am335x_evm.h, i'll get more complaints telling that it has already been set. If I #undef it and then define it as "mydtb", it does not get produced and you will get that first complaint. If I replace "am335x-evm.dtb" with "mydtb.dtb" mmc boot still does not work because card present pin is not correctly mapped because it is coming from gpio told in "mydtb.dtb".
Therefore, I had to modify drivers/mmc/omap_hsmmc.c by removing getdc and getwp methods from omap_hsmmc_ops. After that mmc boot started to work. This can now be dtb related problem in some other place.
So, what is the correct method feeding modified dtb?
Thanks, Matti
participants (3)
-
Lokesh Vutla
-
matti kaasinen
-
Yegor Yefremov