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 0x10800100 !!! 

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 ts7970-emmc-boot.ub as /boot/boot.ub on eMMC.

To boot the TS-7970 from SD card, save Save ts7970-sd-boot.ub as /boot/boot.ub 
on SD.

The TS-4900, too, can boot from the SD card or on-board eMMC.  The requirements
are similar to the TS-7970, but the files required in /boot are:

   ifs-mx6q-ts7970.raw
   ts7970-fpga.bin
   boot.ub

Save ts4900-emmc-boot.ub as /boot/boot.ub on eMMC.
Save ts4900-sd-boot.ub as /boot/boot.ub on SD.

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.


Graphics.  The TS-4900 is intended to be used with a baseboard such as the 
TS-8390, which can drive an LCD panel.  The TS-7970 has an HDMI connector.
You must configure the build for the appropriate one.  Edit the files:
   
  prebuilt/armle-v7/usr/lib/graphics/iMX6X/graphics.conf
  prebuilt/armle-v7/usr/lib/graphics/iMX6X/graphics-ts4900.conf
  src/hardware/startup/boards/imx6x/ts7970/build
   
Look for the lines containing "HDMI display" and "Okaya 7" display panel".
Comment-out the lines you don't want; un-comment the ones you do.

To test graphics, there are two test programs, "gles1-gears" and "gles2-gears".


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.


Update 10/9/2017
Fixed a bug that was preventing the LCD and SD card from working at the
same time.
Note that the load address has changed, from 0x10800000 to 0x10800100.
This is to allow for the placing of additional information in this area.  
Specifically, the status of the SD_BOOT jumper should be placed in bit #0 of 
the byte at 0x10800000.  This is done by the u-boot script -- see the misc-files
directory for details.

   

Check networking.txt for additional information.

