QNX Neutrino for:     BSP_freescale-imx6q-ts7970

This BSP is a near-clone of the Sabrelite BSP.  

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.

NFS works.  First run fs-nfs2 or fs-nfs3 depending on which version you need.

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
    
    

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!


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 (tested with a TS-4900 on a TS-8390).  Run the gles1-gears
or gles2-gears programs.


RS-485

The crossbar on the board's FPGA needs to be programmed, using the 
tshwctl utility.  

For example, to set up RS-485 with auto-tx enable on the modbus connector (J6)
of the TS-7970, using the /dev/ser4 device, the crossbar is set up like so:

   export MB_TXD=TTYSER4_TXD
   export TTYMAX1_RXD=GPIO                                                                
   export TTYSER4_RXD=MB_RXD_485                                                          
   export TXD_232_COM=GPIO   
   export MB_TX_EN_485=TTYSER4_TXEN
   tshwctl -b 0x7970 -s
   
Now run...

   tshwctl -b 0x7970 -c
   
...and you should see something like the following:

     FPGA Pad (DIR) (VAL) FPGA Output                                           
  TTYSER3_RXD ( in) (  0) HD1_RXD                                               
  TTYSER5_RXD ( in) (  0) STC_RXD                                               
  TTYSER3_CTS ( in) (  0) GPIO                                                  
  TTYSER4_RXD ( in) (  0) MB_RXD_485                                            
  TTYSER2_CTS ( in) (  0) BT_RTS                                                
  TTYSER3_RTS ( in) (  0) GPIO                                                  
       MB_TXD ( in) (  0) TTYSER4_TXD                                           
 MB_TX_EN_485 ( in) (  0) TTYSER4_TXEN                                          
  STC_TXD_485 ( in) (  0) TTYMAX0_TXD                                           
STC_TX_EN_485 ( in) (  0) TTYMAX0_TXEN                                          
  TXD_232_COM ( in) (  0) GPIO                                                  
  RTS_232_COM ( in) (  0) TTYMAX2_TXD                                           
      HD1_TXD ( in) (  0) TTYSER3_TXD                                           
       BT_CTS ( in) (  1) TTYSER2_RTS                                           
       BT_RXD ( in) (  0) TTYSER2_TXD                                           
  TTYSER2_RXD ( in) (  0) BT_TXD                                                
    HD1_DIO_1 ( in) (  0) GPIO                                                  
    HD1_DIO_2 ( in) (  0) GPIO                                                  
    HD1_DIO_3 ( in) (  0) GPIO                                                  
    HD1_DIO_4 ( in) (  0) GPIO                                                  
    HD1_DIO_5 ( in) (  0) GPIO                                                  
    HD1_DIO_6 ( in) (  0) GPIO                                                  
     EN_OUT_1 ( in) (  0) GPIO                                                  
     EN_OUT_2 ( in) (  0) GPIO                                                  
   FPGA_IRQ_0 ( in) (  0) PUSH_SW_CPU                                           
  STC_TXD_232 ( in) (  0) TTYSER5_TXD                                           
  TTYMAX0_RXD ( in) (  0) STC_RXD_485_3V                                        
  TTYMAX1_RXD ( in) (  0) GPIO                                                  
  TTYMAX2_RXD ( in) (  0) CTS_232_COM                                           
  TTYMAX0_CTS ( in) (  0) GPIO                                                  
  TTYMAX1_CTS ( in) (  0) GPIO                                                  
  TTYMAX2_CTS ( in) (  0) GPIO                                                  
  HD1_SPI_CLK ( in) (  1) UNCHANGED                                             
 HD1_SPI_MOSI ( in) (  1) UNCHANGED                                             
 HD1_SPI_MISO ( in) (  0) UNCHANGED         
   

The relevant ones are:
  TTYSER4_RXD ( in) (  0) MB_RXD_485  
       MB_TXD ( in) (  0) TTYSER4_TXD
 MB_TX_EN_485 ( in) (  0) TTYSER4_TXEN                                          
  TTYMAX1_RXD ( in) (  0) GPIO                                                  
  TXD_232_COM ( in) (  0) GPIO                                                  
 

Now run the following to enable auto-tx enable on /dev/ser4 ...

   tshwctl -b 0x7970 -a 4 -x 115200 -i 8n1 
   
At this point, /dev/ser4 is ready to use.

