Tim Harvey | 552c358 | 2014-03-06 07:46:30 -0800 | [diff] [blame] | 1 | U-Boot for the Gateworks Ventana Product Family boards |
| 2 | |
| 3 | This file contains information for the port of U-Boot to the Gateworks |
| 4 | Ventana Product family boards. |
| 5 | |
Tim Harvey | bfa2dae | 2014-06-02 16:13:27 -0700 | [diff] [blame^] | 6 | 1. Secondary Program Loader (SPL) |
| 7 | --------------------------------- |
| 8 | |
| 9 | The i.MX6 has a BOOT ROM PPL (Primary Program Loader) which supports loading |
| 10 | an executable image from various boot devices. |
| 11 | |
| 12 | The Gateworks Ventana board config uses an SPL build configuration. This |
| 13 | will build the following artifacts from u-boot source: |
| 14 | - SPL - Secondary Program Loader that the i.MX6 BOOT ROM (Primary Program |
| 15 | Loader) boots. This detects CPU/DRAM configuration, configures |
| 16 | The DRAM controller, loads u-boot.img from the detected boot device, |
| 17 | and jumps to it. As this is booted from the PPL, it has an IVT/DCD |
| 18 | table. |
| 19 | - u-boot.img - The main u-boot core which is u-boot.bin with a image header. |
| 20 | |
| 21 | |
| 22 | 2. Build |
| 23 | -------- |
| 24 | |
| 25 | To build U-Boot for the Gateworks Ventana product family: |
| 26 | |
| 27 | make gwventana_config |
| 28 | make |
| 29 | |
| 30 | |
| 31 | 3. Boot source, boot from NAND |
Tim Harvey | 552c358 | 2014-03-06 07:46:30 -0800 | [diff] [blame] | 32 | ------------------------------ |
| 33 | |
| 34 | The i.MX6 BOOT ROM expects some structures that provide details of NAND layout |
| 35 | and bad block information (referred to as 'bootstreams') which are replicated |
Tim Harvey | bfa2dae | 2014-06-02 16:13:27 -0700 | [diff] [blame^] | 36 | multiple times in NAND. The number of replications and their spacing (referred |
| 37 | to as search stride) is configurable through board strapping options and/or |
| 38 | eFUSE settings (BOOT_SEARCH_COUNT / Pages in block from BOOT_CFG2). In |
| 39 | addition, the i.MX6 BOOT ROM Flash Configuration Block (FCB) supports two |
| 40 | copies of a bootloader in flash in the case that a bad block has corrupted one. |
| 41 | The Freescale 'kobs-ng' application from the Freescale LTIB BSP, which runs |
| 42 | under Linux and operates on an MTD partition, must be used to program the |
| 43 | bootstream in order to setup this flash structure correctly. |
Tim Harvey | 552c358 | 2014-03-06 07:46:30 -0800 | [diff] [blame] | 44 | |
| 45 | The Gateworks Ventana boards with NAND flash have been factory programmed |
| 46 | such that their eFUSE settings expect 2 copies of the boostream (this is |
| 47 | specified by providing kobs-ng with the --search_exponent=1 argument). Once in |
Tim Harvey | bfa2dae | 2014-06-02 16:13:27 -0700 | [diff] [blame^] | 48 | Linux with MTD support for the NAND on /dev/mtd0 you can program the SPL |
Tim Harvey | 552c358 | 2014-03-06 07:46:30 -0800 | [diff] [blame] | 49 | with: |
| 50 | |
Tim Harvey | bfa2dae | 2014-06-02 16:13:27 -0700 | [diff] [blame^] | 51 | kobs-ng init -v -x --search_exponent=1 SPL |
Tim Harvey | 552c358 | 2014-03-06 07:46:30 -0800 | [diff] [blame] | 52 | |
Tim Harvey | bfa2dae | 2014-06-02 16:13:27 -0700 | [diff] [blame^] | 53 | The kobs-ng application uses an imximage which contains the Image Vector Table |
| 54 | (IVT) and Device Configuration Data (DCD) structures that the i.MX6 BOOT ROM |
| 55 | requires to boot. The kobs-ng adds the Firmware Configuration Block (FCB) and |
| 56 | Discovered Bad Block Table (DBBT). The SPL build artifact from u-boot is |
| 57 | an imximage. |
Tim Harvey | 552c358 | 2014-03-06 07:46:30 -0800 | [diff] [blame] | 58 | |
Tim Harvey | bfa2dae | 2014-06-02 16:13:27 -0700 | [diff] [blame^] | 59 | The u-boot.img, which is the non SPL u-boot binary appended to a u-boot image |
| 60 | header must be programmed in the NAND flash boot device at an offset hard |
| 61 | coded in the SPL. For the Ventana boards, this has been chosen to be 14MB. |
| 62 | The image can be programmed from either u-boot or Linux: |
Tim Harvey | 552c358 | 2014-03-06 07:46:30 -0800 | [diff] [blame] | 63 | |
Tim Harvey | bfa2dae | 2014-06-02 16:13:27 -0700 | [diff] [blame^] | 64 | u-boot: |
| 65 | Ventana > setenv mtdparts mtdparts=nand:14m(spl),2m(uboot),1m(env),-(rootfs) |
| 66 | Ventana > tftp ${loadaddr} u-boot.img && nand erase.part uboot && \ |
| 67 | nand write ${loadaddr} uboot ${filesize} |
Tim Harvey | 552c358 | 2014-03-06 07:46:30 -0800 | [diff] [blame] | 68 | |
Tim Harvey | bfa2dae | 2014-06-02 16:13:27 -0700 | [diff] [blame^] | 69 | Linux: |
| 70 | nandwrite /dev/mtd1 u-boot.img |
Tim Harvey | 552c358 | 2014-03-06 07:46:30 -0800 | [diff] [blame] | 71 | |
Tim Harvey | bfa2dae | 2014-06-02 16:13:27 -0700 | [diff] [blame^] | 72 | The above assumes the default Ventana partitioning scheme which is configured |
| 73 | via the mtdparts env var: |
| 74 | - spl: 14MB |
| 75 | - uboot: 2M |
| 76 | - env: 1M |
| 77 | - rootfs: the rest |
Tim Harvey | 552c358 | 2014-03-06 07:46:30 -0800 | [diff] [blame] | 78 | |
Tim Harvey | bfa2dae | 2014-06-02 16:13:27 -0700 | [diff] [blame^] | 79 | This information is taken from: |
| 80 | http://trac.gateworks.com/wiki/ventana/bootloader#NANDFLASH |
Tim Harvey | 552c358 | 2014-03-06 07:46:30 -0800 | [diff] [blame] | 81 | |
Tim Harvey | bfa2dae | 2014-06-02 16:13:27 -0700 | [diff] [blame^] | 82 | More details about the i.MX6 BOOT ROM can be found in the IMX6 reference manual. |
Tim Harvey | 552c358 | 2014-03-06 07:46:30 -0800 | [diff] [blame] | 83 | |