Changes between Version 3 and Version 4 of gsc/alternate_boot_device


Ignore:
Timestamp:
07/29/2020 05:00:13 PM (4 years ago)
Author:
Tim Harvey
Comment:

removed obsolete info and updated for newport

Legend:

Unmodified
Added
Removed
Modified
  • gsc/alternate_boot_device

    v3 v4  
    22
    33= Alternate Boot Device
    4 Some Gateworks Laguna family products have an 'Alternate boot device' that can be used for alternate firmware images, such as a flash recovery image.
     4Some Gateworks family products have an 'Alternate boot device' that can be used for alternate firmware images, such as a flash recovery image:
     5 * Newport - eMMC vs microSD
     6 * Laguna - NOR FLASH vs SPI FLASH
    57
    68Please note that if you have a board with a 4MB SPI flash device, such as the GW2388-4 you will need to use ​[https://github.com/Gateworks/u-boot-cns3xxx u-boot-2014.10 cns3xxx] bootloader.
    79
    8 There are 2 ways that you can instruct the [wiki:gsc Gateworks System Controller] to boot to the **alternate boot device (an SPI FLASH device) vs the primary boot device (a NOR FLASH device)**:
     10There are 2 ways that you can instruct the [wiki:gsc Gateworks System Controller] to boot to the **alternate boot device**:
    9111. set GSC R0.3 and press the user pushbutton 5x times to perform a 1-time hard reboot to the alternate boot device
    1012{{{#!bash
    1113i2cset -f -y 0 0x20 0 0x08
    1214}}}
    13 2. set GSC R1.6 (SWITCH_BOOT_ENABLE) to enable 'switch boot check'. If this is set when the board powers on, it will 'toggle' boot device selection and reboot after 30 seconds unless GSC R1.7 (SWITCH_BOOT_CLEAR) has been set before that time. Note that the countdown timer is only activated when the board powers on from a GSC sleep or unpowered state
    14 
    15 == Flash Mapping
    16 This is an example from a Laguna 2388 with 16MB NOR and 4MB SPI. The mapping is set by us but can be changed.
    17 
    18 {{{#!bash
    19 root@(none):/# cat /proc/mtd
    20 dev:    size   erasesize  name
    21 mtd0: 00040000 00020000 "uboot"
    22 mtd1: 00020000 00020000 "params"
    23 mtd2: 00200000 00020000 "kernel"
    24 mtd3: 00da0000 00020000 "rootfs"
    25 mtd4: 007c0000 00020000 "rootfs_data"
    26 mtd5: 00040000 00010000 "uboot"
    27 mtd6: 00040000 00010000 "params"
    28 mtd7: 00180000 00010000 "kernel"
    29 mtd8: 00200000 00010000 "rootfs"
    30 }}}
     152. set GSC R1.6 (SWITCH_BOOT_ENABLE) to enable 'switch boot check' (see below). If this is set when the board powers on, it will 'toggle' boot device selection and reboot after 30 seconds unless GSC R1.7 (SWITCH_BOOT_CLEAR) has been set before that time. Note that the countdown timer is only activated when the board powers on from a GSC sleep or unpowered state
    3116
    3217== Auto Switch Boot Device
     
    4631{{{#!bash
    4732i2cset -f -y 0 0x20 1 0xC0      ;# cancel countdown by asserting R1.7 (SWITCH_BOOT_CLEAR) but keep enabled R1.6 (SWITCH_BOOT_ENABLE)
    48 # or
    49 i2cset -f -y 0 0x20 1 0x80      ;# cancel countdown by asserting R1.7 (SWITCH_BOOT_CLEAR) and disable R1.6 (SWITCH_BOOT_ENABLE)
    5033}}}
    5134
    52 To programatically hard power-cycle the board by putting it to sleep for a few seconds while also enabling 'switch boot':
    53 {{{#!bash
    54 # power cycle board: must be a hard power cycle, not a soft reboot (which can be done manually or via sleep/wake timer control)
    55 i2cset -f -y 0 0x20 6 5         ;# write add timer to 5sec
    56 i2cset -f -y 0 0x20 7 0
    57 i2cset -f -y 0 0x20 8 0
    58 i2cset -f -y 0 0x20 9 0
    59 i2cset -f -y 0 0x20 1 0x04      ;# set add time bit (must be a separate i2c transaction than activating sleep)
    60 i2cset -f -y 0 0x20 1 0x43      ;# enable R1.6 (SWITCH_BOOT_ENABLE), sleep operation (R1.0) and activate sleep (R1.1)
    61 # wait for board to reboot into linux and within 30 seconds of powerup cancel the boot timer
    62 i2cset -f -y 0 0x20 1 0xC0      ;# set R1.7 (SWITCH_BOOT_CLEAR) to cancel timer but leave R1.6 (SWITCH_BOOT_ENABLE) enabled
    63 }}}
    6435
    6536=== From u-boot
     
    7647}}}
    7748
    78 To programatically hard power-cycle the board by putting it to sleep for a few seconds while also enabling 'switch boot':
    79 {{{#!bash
    80 Laguna > imw 0x20 6 0x05 1  # LSB (5 secs)
    81 Laguna > imw 0x20 7 0x00 1
    82 Laguna > imw 0x20 8 0x00 1
    83 Laguna > imw 0x20 9 0x00 1  # MSB
    84 Laguna > imw 0x20 1 0x04 1  # latch R6-R9 and add to RTC
    85 Laguna > imw 0x20 1 0x43 1  # set SWITCH_BOOT_ENABLE (R1.6), sleep operation (R1.0) and activate sleep (R1.1)
    86 }}}
    87 
    8849
    8950== Alternate Boot Flash firmware images
    9051
    91 === Step 1. Bootloader
     52
     53=== Newport Product families
     54The Newport boards have a primary eMMC device and a removable microSD device that can be used as an **alternate boot device**. Because these are both MMC devices, the same boot firmware can be used on each device.
     55
     56=== Laguna Product families
     57The Laguna boards have a primary NOR FLASH device and a smaller SPI FLASH device for an **alternate boot device**. Because of the differences in the FLASH types you need to have a different bootloader on each device.
     58
     59==== Step 1. Bootloader
    9260The alternate boot device and the primary boot device require different bootloaders **(SPI vs NOR FLASH)**. Only the primary boot device is programmed with a bootable image by Gateworks. In order to program the alternate boot device you will need to do so from Linux (as u-boot-nor.bin on the primary boot device without modification can only access NOR flash).
    9361
     
    11078Now you can follow the instructions above to boot off the **Alternate Boot Device** (SPI Flash) and setup your kernel/rootfs using the instructions for an SPI FLASH device such as the GW2380 found here here
    11179
    112 === Step 2. Kernel / Root Filesystem
     80==== Step 2. Kernel / Root Filesystem
    11381Depending on the size of the SPI FLASH you will likely **need to prune features from your kernel/filesystem**. A good starting point may be the Laguna ​test_config file which uses a ramdisk and a minimal set of utilities used by Gateworks to test boards. As this OpenWrt config file specifies an INTRAMFS ramdisk, you only need to flash the kernel which includes the root filesystem.
    11482
     
    156124}}}
    157125
    158 === Using u-boot-2014.10-cns3xxx bootloader
     126==== Using u-boot-2014.10-cns3xxx bootloader
    159127If using the [https://github.com/Gateworks/u-boot-cns3xxx ​u-boot-2014.10-cns3xxx] which supports both the 16MB and 4MB SPI flash devices used on Laguna products, you will need to use the 'sf' commands within uboot to access flash.
    160128