159189a8bSTim HarveyU-Boot for the Gateworks Ventana Product Family boards
259189a8bSTim Harvey
359189a8bSTim HarveyThis file contains information for the port of U-Boot to the Gateworks
459189a8bSTim HarveyVentana Product family boards.
559189a8bSTim Harvey
6*0cc11deaSTim Harvey1. Secondary Program Loader (SPL)
7*0cc11deaSTim Harvey---------------------------------
8*0cc11deaSTim Harvey
9*0cc11deaSTim HarveyThe i.MX6 has a BOOT ROM PPL (Primary Program Loader) which supports loading
10*0cc11deaSTim Harveyan executable image from various boot devices.
11*0cc11deaSTim Harvey
12*0cc11deaSTim HarveyThe Gateworks Ventana board config uses an SPL build configuration. This
13*0cc11deaSTim Harveywill build the following artifacts from u-boot source:
14*0cc11deaSTim Harvey - SPL - Secondary Program Loader that the i.MX6 BOOT ROM (Primary Program
15*0cc11deaSTim Harvey         Loader) boots.  This detects CPU/DRAM configuration, configures
16*0cc11deaSTim Harvey         The DRAM controller, loads u-boot.img from the detected boot device,
17*0cc11deaSTim Harvey         and jumps to it.  As this is booted from the PPL, it has an IVT/DCD
18*0cc11deaSTim Harvey         table.
19*0cc11deaSTim Harvey - u-boot.img - The main u-boot core which is u-boot.bin with a image header.
20*0cc11deaSTim Harvey
21*0cc11deaSTim Harvey
22*0cc11deaSTim Harvey2. Build
23*0cc11deaSTim Harvey--------
24*0cc11deaSTim Harvey
25*0cc11deaSTim HarveyTo build U-Boot for the Gateworks Ventana product family:
26*0cc11deaSTim Harvey
27*0cc11deaSTim Harvey make gwventana_config
28*0cc11deaSTim Harvey make
29*0cc11deaSTim Harvey
30*0cc11deaSTim Harvey
31*0cc11deaSTim Harvey3. Boot source, boot from NAND
3259189a8bSTim Harvey------------------------------
3359189a8bSTim Harvey
3459189a8bSTim HarveyThe i.MX6 BOOT ROM expects some structures that provide details of NAND layout
3559189a8bSTim Harveyand bad block information (referred to as 'bootstreams') which are replicated
36*0cc11deaSTim Harveymultiple times in NAND. The number of replications and their spacing (referred
37*0cc11deaSTim Harveyto as search stride) is configurable through board strapping options and/or
38*0cc11deaSTim HarveyeFUSE settings (BOOT_SEARCH_COUNT / Pages in block from BOOT_CFG2). In
39*0cc11deaSTim Harveyaddition, the i.MX6 BOOT ROM Flash Configuration Block (FCB) supports two
40*0cc11deaSTim Harveycopies of a bootloader in flash in the case that a bad block has corrupted one.
41*0cc11deaSTim HarveyThe Freescale 'kobs-ng' application from the Freescale LTIB BSP, which runs
42*0cc11deaSTim Harveyunder Linux and operates on an MTD partition, must be used to program the
43*0cc11deaSTim Harveybootstream in order to setup this flash structure correctly.
4459189a8bSTim Harvey
4559189a8bSTim HarveyThe Gateworks Ventana boards with NAND flash have been factory programmed
4659189a8bSTim Harveysuch that their eFUSE settings expect 2 copies of the boostream (this is
4759189a8bSTim Harveyspecified by providing kobs-ng with the --search_exponent=1 argument). Once in
48*0cc11deaSTim HarveyLinux with MTD support for the NAND on /dev/mtd0 you can program the SPL
4959189a8bSTim Harveywith:
5059189a8bSTim Harvey
51*0cc11deaSTim Harveykobs-ng init -v -x --search_exponent=1 SPL
5259189a8bSTim Harvey
53*0cc11deaSTim HarveyThe kobs-ng application uses an imximage which contains the Image Vector Table
54*0cc11deaSTim Harvey(IVT) and Device Configuration Data (DCD) structures that the i.MX6 BOOT ROM
55*0cc11deaSTim Harveyrequires to boot.  The kobs-ng adds the Firmware Configuration Block (FCB) and
56*0cc11deaSTim HarveyDiscovered Bad Block Table (DBBT).  The SPL build artifact from u-boot is
57*0cc11deaSTim Harveyan imximage.
58*0cc11deaSTim Harvey
59*0cc11deaSTim HarveyThe u-boot.img, which is the non SPL u-boot binary appended to a u-boot image
60*0cc11deaSTim Harveyheader must be programmed in the NAND flash boot device at an offset hard
61*0cc11deaSTim Harveycoded in the SPL. For the Ventana boards, this has been chosen to be 14MB.
62*0cc11deaSTim HarveyThe image can be programmed from either u-boot or Linux:
63*0cc11deaSTim Harvey
64*0cc11deaSTim Harveyu-boot:
65*0cc11deaSTim HarveyVentana > setenv mtdparts mtdparts=nand:14m(spl),2m(uboot),1m(env),-(rootfs)
66*0cc11deaSTim HarveyVentana > tftp ${loadaddr} u-boot.img && nand erase.part uboot && \
67*0cc11deaSTim Harvey          nand write ${loadaddr} uboot ${filesize}
68*0cc11deaSTim Harvey
69*0cc11deaSTim HarveyLinux:
70*0cc11deaSTim Harveynandwrite /dev/mtd1 u-boot.img
71*0cc11deaSTim Harvey
72*0cc11deaSTim HarveyThe above assumes the default Ventana partitioning scheme which is configured
73*0cc11deaSTim Harveyvia the mtdparts env var:
74*0cc11deaSTim Harvey - spl: 14MB
75*0cc11deaSTim Harvey - uboot: 2M
76*0cc11deaSTim Harvey - env: 1M
77*0cc11deaSTim Harvey - rootfs: the rest
7859189a8bSTim Harvey
7959189a8bSTim HarveyThis information is taken from:
8059189a8bSTim Harvey  http://trac.gateworks.com/wiki/ventana/bootloader#NANDFLASH
8159189a8bSTim Harvey
8259189a8bSTim HarveyMore details about the i.MX6 BOOT ROM can be found in the IMX6 reference manual.
8359189a8bSTim Harvey
84