[U-Boot] i.MX6Q SPL won't boot U-Boot from NAND

I am trying to boot an i.MX6Q via SPL to U-Boot and eventually, use Falcon mode to start the kernel. I can boot via SPL over USB. I have enabled the NAND and SPL NAND, and i can confirm that mxs_nand_spl.c is being built in. The board is imx6q_logic
Unfortunately, I have run into two issues.
1. Imxs_nand_init from mxs_nand_spl.c is trying to run nand_chip.scan_bbt(mtd), but nand_chip.scan_bbt hasn't been defined from what i can tell.
There is a function called nand_default_bb which looks like it should be setup as the default for this, but I am not sure. As-is, the system crashes when it attempts to run because it's a broken/NULL function pointer. Is there something that should initialize this pointer and/or what should it reference?
2. With the #1 commented out, I get some error messages, but I am mostly concerned about the BCH read timeout. I am asking if there is something missing.
#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x200000
U-Boot SPL 2018.07-00031-g771af54de4-dirty (Jul 24 2018 - 14:18:14 -0500)
spl:board_init_r()
spl_early_init() Trying to boot from NAND spl: nand - using hw ecc 0x01:0xd3 erasesize=131072 (>>17) writesize=2048 (>>11) oobsize=64 chipsize=1073741824 nand_spl_load_image offset:0x00200000 len:64 page:1024 MXS NAND: BCH read timeout mkimage signature not found - ih_magic = d4aa74ca nand_spl_load_image offset:0x00200000 len:204800 page:1024 MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout is_badblock offs=0x00220000 block:17 page:1088 MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout MXS NAND: BCH read timeout Jumping to U-Boot loaded - jumping to U-Boot... image entry point: 0x17800000

On Wed, Jul 25, 2018 at 12:55 AM, Adam Ford aford173@gmail.com wrote:
I am trying to boot an i.MX6Q via SPL to U-Boot and eventually, use Falcon mode to start the kernel. I can boot via SPL over USB. I have enabled the NAND and SPL NAND, and i can confirm that mxs_nand_spl.c is being built in. The board is imx6q_logic
Unfortunately, I have run into two issues.
- Imxs_nand_init from mxs_nand_spl.c is trying to run
nand_chip.scan_bbt(mtd), but nand_chip.scan_bbt hasn't been defined from what i can tell.
There is a function called nand_default_bb which looks like it should be setup as the default for this, but I am not sure. As-is, the system crashes when it attempts to run because it's a broken/NULL function pointer. Is there something that should initialize this pointer and/or what should it reference?
- With the #1 commented out, I get some error messages, but I am
mostly concerned about the BCH read timeout. I am asking if there is something missing.
Did you write the SPL from Linux?
#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x200000
U-Boot SPL 2018.07-00031-g771af54de4-dirty (Jul 24 2018 - 14:18:14 -0500)
spl:board_init_r()
spl_early_init() Trying to boot from NAND spl: nand - using hw ecc 0x01:0xd3 erasesize=131072 (>>17) writesize=2048 (>>11) oobsize=64 chipsize=1073741824
Look like something broken in between, I'm observing SPL looping while loading spl_load_image
U-Boot SPL 2018.07-00368-g323a73adc9-dirty (Jul 25 2018 - 12:07:08 +0530)
spl:board_init_r()
spl_early_init() I'm nand 12 Trying to boot from NAND spl: nand - using hw ecc 0x2c:0xdc erasesize=262144 (>>18) writesize=4096 (>>12) oobsize=224 chipsize=536870912
U-Boot SPL 2018.07-00368-g323a73adc9-dirty (Jul 25 2018 - 12:07:08 +0530)
spl:board_init_r()
spl_early_init() I'm nand 12 Trying to boot from NAND spl: nand - using hw ecc 0x2c:0xdc erasesize=262144 (>>18) writesize=4096 (>>12) oobsize=224 chipsize=536870912
May be bisect with working commit can help us, here?

On Wed, Jul 25, 2018 at 1:43 AM Jagan Teki jagan@amarulasolutions.com wrote:
On Wed, Jul 25, 2018 at 12:55 AM, Adam Ford aford173@gmail.com wrote:
I am trying to boot an i.MX6Q via SPL to U-Boot and eventually, use Falcon mode to start the kernel. I can boot via SPL over USB. I have enabled the NAND and SPL NAND, and i can confirm that mxs_nand_spl.c is being built in. The board is imx6q_logic
Unfortunately, I have run into two issues.
- Imxs_nand_init from mxs_nand_spl.c is trying to run
nand_chip.scan_bbt(mtd), but nand_chip.scan_bbt hasn't been defined from what i can tell.
There is a function called nand_default_bb which looks like it should be setup as the default for this, but I am not sure. As-is, the system crashes when it attempts to run because it's a broken/NULL function pointer. Is there something that should initialize this pointer and/or what should it reference?
- With the #1 commented out, I get some error messages, but I am
mostly concerned about the BCH read timeout. I am asking if there is something missing.
Did you write the SPL from Linux?
Yes with kobs-ng. It wouldn't boot at all without doing that.
#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x200000
U-Boot SPL 2018.07-00031-g771af54de4-dirty (Jul 24 2018 - 14:18:14 -0500)
spl:board_init_r()
spl_early_init() Trying to boot from NAND spl: nand - using hw ecc 0x01:0xd3 erasesize=131072 (>>17) writesize=2048 (>>11) oobsize=64 chipsize=1073741824
Look like something broken in between, I'm observing SPL looping while loading spl_load_image
U-Boot SPL 2018.07-00368-g323a73adc9-dirty (Jul 25 2018 - 12:07:08 +0530)
spl:board_init_r()
spl_early_init() I'm nand 12 Trying to boot from NAND spl: nand - using hw ecc 0x2c:0xdc erasesize=262144 (>>18) writesize=4096 (>>12) oobsize=224 chipsize=536870912
U-Boot SPL 2018.07-00368-g323a73adc9-dirty (Jul 25 2018 - 12:07:08 +0530)
spl:board_init_r()
spl_early_init() I'm nand 12 Trying to boot from NAND spl: nand - using hw ecc 0x2c:0xdc erasesize=262144 (>>18) writesize=4096 (>>12) oobsize=224 chipsize=536870912
May be bisect with working commit can help us, here?
I never had NAND working from SPL, so I am not sure if there is a good starting point from which to bisect.
If I boot without using SPL, I can easily read/write my U-Boot environment to NAND and I can store the kernel, device tree, and UBIFS in NAND and successfully boot, so I think the problem is somewhere in the SPL version of the NAND drivers.
adam

On 07/24/2018 09:25 PM, Adam Ford wrote:
I am trying to boot an i.MX6Q via SPL to U-Boot and eventually, use Falcon mode to start the kernel. I can boot via SPL over USB. I have enabled the NAND and SPL NAND, and i can confirm that mxs_nand_spl.c is being built in. The board is imx6q_logic
Unfortunately, I have run into two issues.
- Imxs_nand_init from mxs_nand_spl.c is trying to run
nand_chip.scan_bbt(mtd), but nand_chip.scan_bbt hasn't been defined from what i can tell.
There is a function called nand_default_bb which looks like it should be setup as the default for this, but I am not sure. As-is, the system crashes when it attempts to run because it's a broken/NULL function pointer. Is there something that should initialize this pointer and/or what should it reference?
- With the #1 commented out, I get some error messages, but I am
mostly concerned about the BCH read timeout. I am asking if there is something missing.
#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x200000
+CC Stefano.
btw I think you need kobs-ng to write the SPL in the special NXP format.

On Wed, Jul 25, 2018 at 5:23 AM Marek Vasut marex@denx.de wrote:
On 07/24/2018 09:25 PM, Adam Ford wrote:
I am trying to boot an i.MX6Q via SPL to U-Boot and eventually, use Falcon mode to start the kernel. I can boot via SPL over USB. I have enabled the NAND and SPL NAND, and i can confirm that mxs_nand_spl.c is being built in. The board is imx6q_logic
Unfortunately, I have run into two issues.
- Imxs_nand_init from mxs_nand_spl.c is trying to run
nand_chip.scan_bbt(mtd), but nand_chip.scan_bbt hasn't been defined from what i can tell.
There is a function called nand_default_bb which looks like it should be setup as the default for this, but I am not sure. As-is, the system crashes when it attempts to run because it's a broken/NULL function pointer. Is there something that should initialize this pointer and/or what should it reference?
- With the #1 commented out, I get some error messages, but I am
mostly concerned about the BCH read timeout. I am asking if there is something missing.
#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x200000
+CC Stefano.
btw I think you need kobs-ng to write the SPL in the special NXP format.
I did that. It wouldn't have booted at all without it.
-- Best regards, Marek Vasut
participants (3)
-
Adam Ford
-
Jagan Teki
-
Marek Vasut