[U-Boot] i.MX6: NAND boot with SPL

Jagan Teki jagannadh.teki at gmail.com
Mon Sep 26 17:35:49 CEST 2016


Hi Fabio/Peng/Stefano/Any,

Did anyone tried or used nand boot with SPL and
u-boot.img(u-boot-dtb.img)? was it supported by imx6?

So booted with MMC and trying to write the images from 1MB since I
read 0x0 on the flash shows FCB.

Code:
------
diff --git a/arch/arm/imx-common/spl.c b/arch/arm/imx-common/spl.c
index bdcda7d..72f870e 100644
--- a/arch/arm/imx-common/spl.c
+++ b/arch/arm/imx-common/spl.c
@@ -84,6 +84,8 @@ u32 spl_boot_mode(const u32 boot_device)
                return MMCSD_MODE_RAW;
 #endif
                break;
+       case BOOT_DEVICE_NAND:
+               break;
        default:
                puts("spl: ERROR:  unsupported device\n");
                hang();
diff --git a/arch/arm/imx-common/spl_nand.cfg b/arch/arm/imx-common/spl_nand.cfg
new file mode 100644
index 0000000..e918c0d
--- /dev/null
+++ b/arch/arm/imx-common/spl_nand.cfg
@@ -0,0 +1,2 @@
+IMAGE_VERSION  2
+BOOT_FROM      nand

NAND write:

U-Boot >  tftpboot ${loadaddr} SPL
Using FEC device
TFTP from server 192.168.2.68; our IP address is 192.168.2.67
Filename 'SPL'.
Load address: 0x12000000
Loading: #######
         1.4 MiB/s
done
Bytes transferred = 31744 (7c00 hex)
U-Boot > nand erase 0x100000 0x100000

NAND erase: device 0 offset 0x100000, size 0x100000
Erasing at 0x1c0000 -- 100% complete.
OK
U-Boot > nand write ${loadaddr} 0x100000 0x7c00

NAND write: device 0 offset 0x100000, size 0x100000
 1048576 bytes written: OK

U-Boot > tftpboot ${loadaddr} u-boot-dtb.img
Using FEC device
TFTP from server 192.168.2.68; our IP address is 192.168.2.67
Filename 'u-boot-dtb.img'.
Load address: 0x12000000
Loading: ########################################################
         1.7 MiB/s
done
Bytes transferred = 282470 (44f66 hex)
U-Boot > nand erase 0x200000 0x100000

NAND erase: device 0 offset 0x200000, size 0x100000
Erasing at 0x2c0000 -- 100% complete.
OK
U-Boot > nand write ${loadaddr} 0x200000 0x44f66

NAND write: device 0 offset 0x200000, size 0x100000
 1048576 bytes written: OK

Boot Log:
-----------
U-Boot SPL 2016.07-ge1e54c7-dirty (Sep 26 2016 - 16:07:01)
Trying to boot from unknown boot device
SPL: Unsupported Boot Device!
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

When I add prints on SPL to find whether it is nand bootmode or not?
and then did a same nand operations I ended up getting the same SPL
log always.

Any help?

thanks!
-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.


More information about the U-Boot mailing list