All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot]  i.MX6: NAND boot with SPL
@ 2016-09-26 15:35 Jagan Teki
  2016-09-26 16:00 ` Fabio Estevam
  2016-09-27  6:57 ` Stefano Babic
  0 siblings, 2 replies; 6+ messages in thread
From: Jagan Teki @ 2016-09-26 15:35 UTC (permalink / raw)
  To: u-boot

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.

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-09-28 16:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-26 15:35 [U-Boot] i.MX6: NAND boot with SPL Jagan Teki
2016-09-26 16:00 ` Fabio Estevam
2016-09-27  6:57 ` Stefano Babic
2016-09-28 14:40   ` Jagan Teki
2016-09-28 14:51     ` Stefano Babic
2016-09-28 16:01       ` Jagan Teki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.