QNX Neutrino for:     BSP_freescale-imx6q-ts7970

This BSP is a near-clone of the Sabrelite BSP.  It has been modified to work 
on the TS-7970 and the TS-4900, both Quad.  Be sure to edit the file...

  src/hardware/startup/boards/imx6x/ts7970/board.h 
  
...so that one (and only one) of BOARD_TS7970 or BOARD_TS4900 is defined.  

The TS boards utilize a Micrel KSZ9031 ethernet PHY, which has a different
ID from the KSZ9021 that is defined in the qnx system header file:

   ../qnx660/target/qnx6/usr/include/netdrv/mdi.h
   
Edit the above file, look for "KSZ9021", and add the following to the 
next line in the file:

      #define KSZ9031			0x22

BE SURE TO LOAD THE "ifs-mx6q-ts7970.raw" file at 0x10800000 !!! 

As of 6/8/2015, only the following drivers have been ported:

UARTs 1 through 5.  These correspond with /dev/ser1 through /dev/ser5.

ETHERNET.

I2C1 and I2C2.

MMCSD.  The SD card appears as /dev/hd0, and if it is formatted (with a
recognized filesystem), the first partition will appear as /dev/hd0t12. 
If the first partition is formatted with DOS FAT32, you may mount it as
follows:

   mount -t dos /dev/hd0t12 <mountpoint>

eMMC.  The chip appears as /dev/emmc0, and if it is formatted (with a 
recognized filesystem), the first partition will appear as /dev/emmc0t12.
Mounting is done in the same way as for the SD card.
   
   
Formatting either SD (use /dev/hd0) or eMMC (use /dev/emmc0).  
  Check to see if there are any partitions on the device:
    fdisk /dev/emmc0 show
  Delete the first partition:
     fdisk /dev/emmc0 delete -s 1
  Delete all partitions:
    fdisk /dev/emmc0 delete -a
  Add an MSDOS partition (using entire device):
    fdisk /dev/emmc0 add -t 12
  Enumerate the partition(s):
    mount -e /dev/emmc0
  Format for MSDOS:
    mkdosfs /dev/emmc0t12
  Mount it:  
    mount -t dos /dev/emmc0t12 <mountpoint>
  
The TS-7970 can boot from either the SD card or on-board eMMC.  To boot
from SD, the CARD must be formatted with a vfat filesystem in the 
first partition (the other three partitions are not relevant), and there needs
to be a /boot directory containing the following files:
   
   ifs-mx6q-ts7970.raw
   ts7970-fpga.vme
   boot.ub
   
To boot from eMMC, it also needs to be formatted.  Use the instructions for
formatting and mounting the eMMC given above.  Create a /boot directory
on eMMC, and copy ifs-mx6q-ts7970.raw and ts7970-fpga.vme there.  The 
boot.ub file is different for the eMMC, and is in this BSP, in the 
"misc-files" directory.  Save emmc-boot.ub as /boot/boot.ub on eMMC.

Note: The "SD Boot" jumper will determine which of SD or eMMC is used.  

USB HOST.  Currently only tested with a USB stick formatted with DOS FAT32.
With such a USB stick inserted, it will appear as /dev/hd1t12.  Mount it
like so:  
    mount -t dos /dev/hd1t12 <mountpoint>
    

SPI NOR FLASH.  This appears as /dev/fs0 (/dev/fs0p0).  Be careful when 
writing to the SPI NOR that you don't overwrite uboot and/or its environment!

Note:  Don't confuse SPI NOR FLASH with the NVRAM (actually 128 bytes of 
battery-backed SRAM) that's in the RTC chip! The latter is accessed with the 
nvramctl utility.


HDMI.  This is enabled in the build.  To use it, run the "screen" command.
There are two test programs, "gles1-gears" and "gles2-gears".


The LCD works (TS-4900), but for some unknown reason, the MMCSD driver stops working
when its enabled.  So LCD is currently disabled.

Update 11/23/2016
Added nvramctl, peekpoke, rtctemp, tshwctl utilities to the build

Added CAN driver.  This will create /dev/can1 and /dev/can2, which correspond
directly to CAN1 and CAN2 on the TS-7970.  For information on how to use it,
see src/hardware/can/mx6x/mx6xcan.readme.

Check networking.txt for additional information.
