[[PageOutline]] [=#bootloader] = Newport U-Boot Bootloader = Gateworks supports the U-Boot Bootloader for the Newport product family. We provide pre-built firmware images (see [wiki:newport#firmware here]) as well as source for building and/or modifying it yourself. One of the primary features of the Bootloader is to provide access to the {{{hwconfig}}} environment variable that the firmware uses for initial board configuration on power-up. [=#hwconfig] == hwconfig == The U-Boot Bootloader by convention provides a {{{hwconfig}}} environment variable which is used by the boot firmware (before U-Boot is loaded and executed) to configure board options at power-up. These options can include things such as: * miniPCIe socket functions (ie PCIe vs mSATA vs USB3.0) * serial configuration (ie RS232 vs RS485) [=#socketconfig] === hwconfig: miniPCIe Socket Configuration === Newport board model socket options: * GW630x: - J9: PCIe - J10: PCIe or SATA - J11: PCIe or USB3.0 Note that USB2.0 is routed to all three miniPCIe sockets always but as USB3.0 shares signals with PCIe you must choose between PCIe and USB3 on sockets that support USB3. You can get/set the {{{hwconfig}}} variable within the U-Boot bootloader but you must reboot the board for it to take effect as the variable is acted upon in the Secondary Program Loader (SPL). Examples: * GW630x: - J10 PCIe, J11 PCIe (default) {{{#!bash setenv hwconfig 'j10:pcie;j11:pcie'; saveenv }}} - J10 mSATA, J11 USB3.0 {{{#!bash setenv hwconfig 'j10:sata;j11:usb3'; saveenv }}} - J9/J10 disabled, J11 PCIe {{{#!bash setenv hwconfig 'j9:disabled;j10:disabled;j11:pcie'; saveenv }}} '''Note that {{{hwconfig}}} is also used for serial configuration so care should be taken to preserve that configuration if used''' [=#serialconfig] === hwconfig: serial Configuration === Many boards in the Newport product family provide a 5-pin off-board serial connector that provides the following options: - 1x RS485 FD (UART2) - 1x RS485 HD (UART2) - 1x RS232 w/ hardware flow control (UART2) - 2x RS232 w/o hardware flow control (UART2/UART3) By default 2x RS232 with no flow control is enabled. To configure a different option use the {{{hwconfig}}} U-Boot env variable. The {{{mode}}} property of the {{{serial}}} option defines the initial configuration of the serial port(s). If RS485 is selected by the {{{mode}}} property the {{{term}}} property will select whether or not on-board termination is enabled. The {{{mode}}} property can have the following values: * rs232 - 2x RS232 (UART2/UART3) without hardware flow control (default if not specified) * rs232_dtr - RS232 (UART2) with hardware flow control * rs485_hd - RS485 half-duplex * rs485_fd - RS485 full-duplex Examples: * enable RS485 half duplex no on-board termination {{{#!bash setenv hwconfig "serial:mode=rs485_hd,term=no"; saveenv }}} * enable RS485 full duplex with on-board termination {{{#!bash setenv hwconfig "serial:mode=rs485_fd,term=yes"; saveenv }}} * enable RS232 with hardware flow-control: {{{#!bash setenv hwconfig "serial:mode=rs232_dtr"; saveenv }}} '''Note that {{{hwconfig}}} is also used for serial configuration so care should be taken to preserve that configuration if used'''