[[PageOutline]] = Alternate Boot Device Some Gateworks family products have an 'Alternate boot device' that can be used for alternate firmware images, such as a flash recovery image: * Newport - eMMC vs microSD There are 2 ways that you can instruct the [wiki:gsc Gateworks System Controller] to boot to the **alternate boot device**: 1. set GSC R0.3 and press the user pushbutton 5x times to perform a 1-time hard reboot to the alternate boot device {{{#!bash i2cset -f -y 0 0x20 0 0x08 }}} 2. 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 == Auto Switch Boot Device The [wiki:gsc Gateworks System Controller] implements an 'Auto Switch Boot Device' feature that can be useful as a firmware recovery mechanism. GSC register R1.6 (SWITCH_BOOT_ENABLE) enables this mode. When this is set and the board powers on it will initiate a countdown timer that expires in 30 seconds. Writing a 1 to GSC R1.7 (SWITCH_BOOT_CLEAR) will cancel this timer. If the timer expires the boot device will be 'toggled' and the board will be hard reset. If you need to progamattically hard power cycle the board you can put it to sleep for a few seconds. === From Linux Within the linux command-line shell, you can use i2cset from the i2c-tools package. To enable 'switch boot check': {{{#!bash i2cset -f -y 0 0x20 1 0x40 ;# enable R1.6 (SWITCH_BOOT_ENABLE) }}} To assert 'SWITCH_BOOT_CLEAR' and cancel the countdown timer (within 30 seconds of power up): {{{#!bash i2cset -f -y 0 0x20 1 0xC0 ;# cancel countdown by asserting R1.7 (SWITCH_BOOT_CLEAR) but keep enabled R1.6 (SWITCH_BOOT_ENABLE) }}} === From u-boot Within the u-boot environment you can use the imw command to set i2c registers. To enable 'switch boot check': {{{#!bash imw 0x20 1 0x40 1 ;# enable R1.6 (SWITCH_BOOT_ENABLE) }}} To assert R1.7 (SWITCH_BOOT_CLEAR) and cancel the countdown timer (within 30 seconds of power up): {{{#!bash imw 0x20 1 0xc0 1 # set SWITCH_BOOT_CLEAR (R1.7) }}} == Alternate Boot Flash firmware images === Newport Product families The 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.