Standalone boot (SDVX)

From DAVE Developer's Wiki
Revision as of 08:58, 26 September 2018 by U0007 (talk | contribs) (... into NOR flash)

Jump to: navigation, search
Info Box
SDVX.png Applies to SDVX

History[edit | edit source]

Version Date SDVX version Hardware Part Nr Notes
1.0.0 September 2018 SDVX 1.0.0 SDV040000C0R

Introduction[edit | edit source]

This document was written and tested with the software/hardware combination described in the history table above. However, it contains general concepts that can be adapted on any DAVE Embedded Systems' Linux platform.

We'll explain how to program and configure an SDVX to boot in standalone mode, without the need of a system microSD card or an NFS server, with two options:

  • booting with NAND only
    • In this configuration the whole system will boot without the need of a NOR flash storage, all images and the root file system will be fetched from NAND flash.
  • booting with eMMC only
    • In this configuration the whole system will boot without the need of a NOR flash storage, all images and the root file system will be fetched from NAND flash.

Storing root file system into NAND flash (only Lite)[edit | edit source]

This is a common step for both booting options.

  • Boot the system via SD or NFS as described in the e Quick start guide
  • By default, the NAND is already partitioned to allow booting from NAND-only (see next section) and, thus, some partitions are reserved for U-boot and kernel images. Here we won't modify this default configuration. The MTD partitions can be dumped with /proc/mtd (the partition's name should be self-explanatory)
root@sdvx-lite:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00800000 00020000 "nand-uboot"
mtd1: 00100000 00020000 "nand-env1"
mtd2: 00100000 00020000 "nand-env2"
mtd3: 00100000 00020000 "nand-fdt"
mtd4: 00100000 00020000 "nand-spare"
mtd5: 00800000 00020000 "nand-kernel"
mtd6: 00400000 00020000 "nand-splash"
mtd7: 1e800000 00020000 "nand-ubi"

Storing boot images ...[edit | edit source]

... into NOR flash[edit | edit source]

  • Select the proper u-boot, kernel and device tree binary images according to the Axel Lite or Axel ULite SOM used.

U-Boot[edit | edit source]

Update to the latest u-boot version allows usage of u-boot environment variables available.

=> run load
Using FEC device
TFTP from server 192.168.0.13; our IP address is 192.168.0.89
Filename 'sdvx/u-boot/sdvx-1.0.0_mx6dl_sfczg_spi_u-boot.imx'.
Load address: 0x12000000
Loading: #################################################################
         #################################################################
         ##
         1.4 MiB/s
done
Bytes transferred = 671788 (a402c hex)
=> run spi_update
SF: Detected S25FL256S with page size 64 KiB, total 32 MiB
=>

Linux kernel image and device tree[edit | edit source]

We assume that the following environment variables are present in u-boot:

loadk=tftpboot ${loadaddr} ${serverip}:${bootfile}
loadfdt=tftpboot ${fdtaddr} ${serverip}:${fdtfile}
spi_updatek=sf erase 200000 800000; sf write ${loadaddr} 200000 ${filesize}
spi_updatefdt=sf erase 180000 80000; sf write ${fdtaddr} 180000 ${filesize}
spi_loadk=sf read ${loadaddr} 200000 800000
spi_loadfdt=sf read ${fdtaddr} 180000 80000
spi_nand=sf probe; run spi_loadk spi_loadfdt nandargs addcons addmisc; if run configid_fixupfdt; then bootm ${loadaddr} - ${fdtaddr}; fi
  • Update the bootfile and fdtfile environment variables to fit the filename as found inside the TFTP server.
  • Program kernel and device tree on NOR flash with the following U-Boot command
sf probe; run loadk spi_updatek loadfdt spi_updatefdt

E.g.:

=> sf probe; run loadk spi_updatek loadfdt spi_updatefdt
SF: Detected S25FL256S with page size 64 KiB, total 32 MiB
Using FEC device
TFTP from server 192.168.0.13; our IP address is 192.168.0.98
Filename 'sdvx/linux/sdvx-1.0.0_lite_uImage'.
Load address: 0x12000000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #############################################
         1.6 MiB/s
done
Bytes transferred = 6437016 (623898 hex)
Using FEC device
TFTP from server 192.168.0.13; our IP address is 192.168.0.89
Filename 'sdvx/linux/sdvx-1.0.0_lite_imx6dl-sfczg-cb0043.dtb'.
Load address: 0x18000000
Loading: #########
         1.2 MiB/s
done
Bytes transferred = 42547 (a633 hex)
=>

Reboot the system and configure U-Boot to apply the new configuration

=> setenv bootcmd run spi_nand
=> saveenv

... into NAND flash[edit | edit source]

U-Boot[edit | edit source]

Linux kernel image and device tree[edit | edit source]

... into eMMC[edit | edit source]

We assume that the following environment variables are present in u-boot:

mmc_loadfdt=fatload mmc 0:1 ${fdtaddr} imx6ul-lynx.dtb
mmc_loadk=fatload mmc 0:1 ${loadaddr} uImage
mmc_loadsplash=fatload mmc ${mmcdev}:1 ${loadaddr} ${splashfile}; cp.b ${loadaddr} ${splashimage} ${filesize}
mmc_update=setexpr blocks ${filesize} / 0x200; setexpr blocks ${blocks} + 1; mmc write ${loadaddr} 2 ${blocks}
mmcargs=setenv bootargs root=${mmcroot}
  • Update the bootfile and fdtfile environment variables to fit the filename as found inside the TFTP server.
  • Program kernel and device tree on the MMC with the following U-Boot command