Changes between Version 3 and Version 4 of ventana/openwrt


Ignore:
Timestamp:
02/08/2018 09:19:48 AM (2 weeks ago)
Author:
Tim Harvey
Comment:

fairly large re-write and cleanup

Legend:

Unmodified
Added
Removed
Modified
  • ventana/openwrt

    v3 v4  
    22
    33
    4 = Building OpenWrt & Installing for the Gateworks Ventana Family =
    5 Gateworks Provides patches to OpenWrt for the Ventana Family that can be downloaded and applied.  These patches are periodically updated to fit on top of recent OpenWrt snapshots.  The Ventana Family currently is using Linux v3.8.x and is provided with a host of userland tools built into the filesystem to do everything from mesh routing to mounting a hard drive on a read/write filesystem with room for plenty of additional tools/utilities provided by OpenWrt.  A web GUI (LUCI) has also been provided on the boards that enables easy administration of the product.
    6 
    7 **Ventana is still under heavy software development.  It is a good idea to update to the latest firmware and monitor our [http://lists.gateworks.com/mailman/listinfo maillist] for activity.
    8 **
    9 
    10 
    11 = Step 1. Compiling the Source Code =
    12 Please refer [wiki:build_openwrt here] for instructions on building OpenWrt for the Gateworks products.
    13 
    14 
    15 = Step 2. Installing Firmware =
    16 [http://svn.gateworks.com/ventana/images/ Prebuilt OpenWrt Binaries]
    17 
    18 Customers may choose to compile their own firmware or use our prebuilt binaries [http://svn.gateworks.com/ventana/images/ Prebuilt OpenWrt Binaries]
    19 
    20 
    21 === Installing Firmware on a Ventana board via JTAG - Easiest Option ===
    22 If you have a JTAG programmer it is easier to install firmware this way! (TFTP method below is faster)
    23 
    24 NOTE: Ventana JTAG only works on Linux and with the latest JTAG software (version 4 available [wiki:jtag_instructions here]).
    25 
    26 Every Ventana product is nearly the same and they can all use one universal prebuilt OpenWrt binary (ending in a .bin extension). The file to use is: ventana_owrt_normal.bin. This includes the SPL bootloader and uboot as well. (Exceptions include GW5400A with SPI flash and Ventana boards with larger amounts of flash such as a 1GB/2GB version, whereas 256mb is standard)
    27 
    28 The binary files can be found in the link above. If running a custom build, here is out to create a JTAG binary image 
    29  * [http://trac.gateworks.com/wiki/jtag_instructions#CreatingjtagableimagesforVentana Manual Create Images]
    30  * [http://trac.gateworks.com/wiki/build_openwrt#BuildingJTAGBinaryFile Easy Create Images]
    31 
    32 An example using a Linux PC
    33 {{{
    34 ./sudo rmmod ftdi_sio
    35 
    36 ./sudo jtag_usbv4 –p ventana_owrt_normal.bin
     4= OpenWrt on Ventana =
     5Gateworks Provides an OpenWrt BSP supporting the Ventana product family.
     6
     7For more info on OpenWrt see:
     8[[TitleIndex(OpenWrt)]]
     9
     10
     11[=#building]
     12== Building ==
     13Please refer to the [wiki:OpenWrt/building OpenWrt/building page] for instructions on building OpenWrt for the Gateworks products.
     14
     15
     16[=#prebuilt]
     17== Prebuilt binaries ==
     18You can find pre-built binaries for Ventana OpenWrt here:
     19 * [http://dev.gateworks.com/openwrt/latest/imx6/ latest build]
     20 * [http://svn.gateworks.com/ventana/images/ Stable well tested releases]
     21
     22
     23[=#install]
     24== Installing ==
     25As Ventana boards have a variety of storage and boot devices there are several options to choose from.
     26
     27
     28[=#jtag]
     29=== Installing via JTAG - Easiest Option ===
     30If you have a Gateworks USB JTAG programmer you can install firmware images using the {{{jtag_usbv4}}} software running on a Linux host. Note that the serial/ethernet method ([#serial_enet below]) is much faster if you have serial console access and network access to a TFTP server.
     31
     32This method does not require anything other than a Gateworks USB JTAG programmer, a Linux PC, and the {{{jtag_usbv4}}} application.
     33
     34'''NOTE: Ventana JTAG only works on Linux and with {{{jtag_usbv4}}}''' found [http://svn.gateworks.com/jtag/linux/x86/jtag_usbv4 here]. Please see [wiki:jtag_instructions JTAG instructions] for more details.
     35
     36The {{{jtag_usbv4}}} application requires a binary firmware image of the entire FLASH storage device. By convention we put a {{{.bin}}} file extension on this. These images are created with the {{{mkimage_jtag}}} script which can be found [http://svn.gateworks.com/ventana/images/mkimage_jtag here]. For details on creating JTAGable FLASH images see [wiki:jtag_instructions#ventana-images here].
     37
     38Note that you need to choose the firmware image appropriate for your board's FLASH storage:
     39 * u-boot_spl.bin - Binary JTAG image of 'just' the boot firmware (works for all FLASH types and sizes)
     40 * ventana-owrt-*-large.bin - for 2GB NAND FLASH devices
     41 * ventana-owrt-*-normal.bin - for 256MB NAND FLASH devices
     42
     43Example usage of {{{jtag_usbv4}}} to program a 256MB NAND FLASH running on a Linux PC:
     44{{{#!bash
     45sudo rmmod ftdi_sio # make sure the ftdi_sio kernel module is not using the JTAG device
     46sudo jtag_usbv4 –p ventana_owrt_normal.bin # program
    3747
    3848Gateworks JTAG Programmer v4.0 r311
     
    5767}}}
    5868
    59 Please see more details about the JTAG firmware install here: [wiki:jtag_instructions JTAG Tutorial Page]
    60 
    61 While the JTAG method is the easiest, the TFTP method shown below will transfer faster.
    62 
    63 
    64 === Installing Firmware on a Ventana board via Serial/ENET(tftp) using the bootloader ===
     69See also:
     70 * [wiki:jtag_instructions JTAG Tutorial Page]
     71 * [http://svn.gateworks.com/jtag/linux/x86/jtag_usbv4 jtag_usbv4 executable (32/64bit x86 Linux)]
     72 * [http://dev.gateworks.com/openwrt/latest/imx6 Ventana most recent pre-built OpenWrt images]
     73 * [http://svn.gateworks.com/images/ventana Ventana stable/released pre-built OpenWrt images]
     74
     75
     76[=#serial_enet]
     77=== Installing Firmware via Serial / Ethernet(TFTP) using the bootloader ===
    6578The procedure for updating the OS (kernel+rootfs) via Serial/ENET and a tftp server depends on what type of FLASH the Ventana product has. 
    6679
    67 '''All Ventana product's except for the GW5400-A have NAND FLASH.'''
    68 
    69 
     80
     81[=#serial_enet_nand]
    7082==== NAND flash ====
    71 To install firmware to a Ventana board using Serial/ENET once your kernel/rootfs are on a network attached tftpserver (tftpserver instructions->[wiki:tftpserver]) do the following:
    72 
    73 1. Connect your target board to your network, set ipaddress and serverip in uboot
    74 
    75 <boot the board and hit a key to enter into u-boot prompt>
    76 {{{
    77 setenv ipaddr <localip>
    78 setenv serverip <serverip>
    79 }}}
    80 i.e. Set localip to 192.168.1.211 and serverip to 192.168.1.14
    81 {{{
    82 setenv ipaddr 192.168.1.211
    83 setenv serverip 192.168.1.14
    84 }}}
    85 
    86 2. run the nand_update script (present in the default Ventana NAND bootloader) which will tftp 'openwrt-imx6-ventana-rootfs_normal.ubi' (defined in ${image_rootfs}), erase and program NAND
    87  1. Confirm the file in the variable image_rootfs is the one you want. To change it use the following command:
    88 {{{
    89 setenv image_rootfs openwrt-imx6-ventana-rootfs_normal.ubi
    90 }}}
    91  2. Run the nand_update script:
    92 {{{
    93 run nand_update
    94 }}}
    95 
    96 3. boot to nand:
    97 {{{
    98 boot
    99 }}}
     83The fastest way to update the OS firmware on a board is to use the Bootloader with a serial console connection and a network connection to a TFTP server. Note that this does not allow updating the entire boot firmware.
     84
     85Before doing this, make sure you have a TFTP server on the same network as the board and have placed the required firmware images there. The firmware images in this case are not JTAG'able binary files used in the [#jtag JTAG programming method above] but instead are UBI filesystem images ({{{.ubi}}} files).
     86
     87The following steps are used to install firmware to a Ventana board using Serial and Ethernet.
     881. Connect your target board to your network, power the device, and break into the Bootloader when prompted:
     89{{{#!bash
     90U-Boot SPL 2015.04-ge511908 (Jan 12 2018 - 08:46:10)
     91Booting from NAND
     92PMIC:  PFUZE100 ID=0x10
     93NAND : 2048 MiB
     94
     95
     96U-Boot 2015.04-ge511908 (Jan 12 2018 - 08:46:10)
     97
     98CPU:   Freescale i.MX6Q rev1.5 996 MHz (running at 792 MHz)
     99CPU:   Automotive temperature grade (-40C to 125C) at 45C
     100Reset cause: POR
     101I2C:   ready
     102DRAM:  2 GiB
     103PMIC:  PFUZE100 ID=0x10
     104NAND:  2048 MiB
     105MMC:   FSL_SDHC: 0
     106auto-detected panel HDMI
     107Display: HDMI (1024x768)
     108In:    serial
     109Out:   serial
     110Err:   serial
     111
     112Gateworks Corporation Copyright 2014
     113Model: GW5404-D
     114MFGDate: 10-23-2015
     115Serial:662039
     116GSC:   v50 0xd60e WDT:disabled board temp at 48C
     117RTC:   0
     118DIO0:  GPIO1_IO09 (gpio-9)
     119DIO1:  GPIO1_IO19 (gpio-19)
     120DIO2:  GPIO2_IO09 (gpio-41)
     121DIO3:  GPIO2_IO10 (gpio-42)
     122MSATA: enabled
     123RS232: enabled
     124Net:   FEC [PRIME], usb_ether
     125Hit any key to stop autoboot:  0
     126Ventana >
     127}}}
     1281. Set your the env variables used by {{{tftpboot}}} appropriate for your network. For example:
     129{{{#!bash
     130Ventana > setenv ipaddr 192.168.1.1
     131Ventana > setenv netmask 255.255.255.0
     132Ventana > setenv serverip 192.168.1.146
     133}}}
     1341. run the {{{image_rootfs}}} variable to the filename on your TFTP server and run the {{{nand_update}}} script (present in the default Ventana NAND bootloader) which will TFTP the file, erase and program NAND:
     135{{{#!bash
     136Ventana > setenv image_rootfs ventana-owrt-16.02-large.ubi
     137Ventana > run nand_update
     138Updating NAND from 192.168.1.146:ventana-owrt-16.02-large.ubi...
     139Using FEC device
     140TFTP from server 192.168.1.146; our IP address is 192.168.1.1
     141Filename 'ventana-owrt-16.02-large.ubi'.
     142Load address: 0x12000000
     143Loading: #################################################################
     144         #################################################################
     145         #################################################################
     146         #################################################################
     147...
     148         #################################################################
     149         #################################################################
     150         #################################################################
     151         #############
     152         8.8 MiB/s
     153done
     154Bytes transferred = 25952256 (18c0000 hex)
     155
     156NAND erase.part: device 0 offset 0x1100000, size 0x7ef00000
     157Skipping bad block at  0x50580000                                         
     158Erasing at 0x7ffc0000 -- 100% complete.
     159OK
     160
     161NAND write: device 0 offset 0x1100000, size 0x18c0000
     162 25952256 bytes written: OK
     163Ventana >
     164}}}
     1651. reset or power cycle the board
    100166
    101167If no changes have been made to the default environment variables, your board will boot to a OpenWrt prompt on your newly built kernel/filesystem.
    102168
    103169If the bootloader environment was modified you may want to erase the u-boot env flash section to set the board back to factory defaults. This can be done by the following:
    104 {{{
     170{{{#!bash
    105171env default -f -a
    106172saveenv
     
    112178
    113179
    114 ==== SPI flash ====
    115 To install firmware to a Ventana board using Serial/ENET once your kernel/rootfs are on a network attached tftpserver (tftpserver instructions->[wiki:tftpserver]) do the following:
    116 
    117 1. Connect your target board to your network, set ipaddress and serverip in uboot
    118 
    119 <boot the board and hit a key to enter into u-boot prompt>
    120 {{{
    121 setenv ipaddr <localip>
    122 setenv serverip <serverip>
    123 }}}
    124 i.e. Set localip to 192.168.1.211 and serverip to 192.168.1.14
    125 {{{
    126 setenv ipaddr 192.168.1.211
    127 setenv serverip 192.168.1.14
    128 }}}
    129 
    130 
    131 3. run the spi_update script (present in the default Ventana SPI bootloader) which will tftp 'openwrt-imx6-imx6q-gw5400-squashfs.bin' (defined in ${image_os}), erase and program NAND
    132 {{{
    133 run spi_update
    134 }}}
    135 
    136 4. boot to nand:
    137 {{{
    138 boot
    139 }}}
    140 
    141 
    142 If no changes have been made to the default environment variables, your board will boot to a OpenWrt prompt on your newly built kernel/filesystem.
    143 
    144 If the bootloader environment was modified you may want to erase the u-boot env flash section to set the board back to factory defaults. This can be done by the following:
    145 {{{
    146 env default -f -a
    147 saveenv
    148 }}}
    149 
    150180[=#blockdev]
    151 = Installing OpenWrt on a removable block storage device: MicroSD card / USB drive / mSATA device =
     181=== Installing OpenWrt on a removable block storage device: MicroSD card / USB drive / mSATA device ===
    152182Installing OpenWrt on a removable block storage device: MicroSD card / USB drive / mSATA device
    153183The latest OpenWrt package and kernel configuration in the trunk BSP supports the necessary configuration for booting to a USB/micro-SD/mSATA based root filesystem (static kernel support for chipidea USB host controller, EHCI, and MXS phy) therefore all you need to do is create the storage device using the tarball of the root filesystem.