TS-7970 FPGA Sections
The Lattice ICE40 FPGA provides auto TX enable for RS-485 half duplex, a few more DIO, the UART MUX, and it can generate clocks for use on a baseboard. Most of these registers are controlled using tshwctl in the ts4900-utils repository. The DIO can be accessed using the sysfs GPIOs 224 to 255 using the "ts4900gpio" driver. See the #GPIO section for more information on the recommended GPIO access. The below examples will communicate directly over i2c.
Usage: tshwctl [OPTIONS] ... Technologic Systems TS-4900 Utility -p, --getin <dio> Returns the input value of an FPGA DIO -e, --setout <dio> Sets an FPGA DIO output value high -l, --clrout <dio> Sets an FPGA DIO output value low -d, --ddrout <dio> Set FPGA DIO to an output -r, --ddrin <dio> Set FPGA DIO to an input -h, --help This message
On every poweron the FPGA is programmed using the file in /boot/ts4900-fpga.bin. U-boot copies this into memory, and runs the "ice40" command to reprogram the FPGA. Without this file the FPGA will not do anything. This FPGA interfaces to the i.MX6 using the first CPU I2C bus.
Addr | Bits | Function | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
00 | 0 | TTYMXC2_RXD Output Enable | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | TTYMXC2_RXD Output Data | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2 | TTYMXC2_RXD Input Data | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
7:3 | TTYMXC2_RXD Crossbar | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
01 | 0 | TTYMXC4_RXD Output Enable | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | TTYMXC4_RXD Output Data | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2 | TTYMXC4_RXD Input Data | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
7:3 | TTYMXC4_RXD Crossbar | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
02 | 0 | TTYMXC2_CTS Output Enable | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | TTYMXC2_CTS Output Data | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2 | TTYMXC2_CTS Input Data | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
7:3 | CN1_87 Crossbar | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
03 | 0 | TTYMXC3_RXD Output Enable | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | TTYMXC3_RXD Output Data | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2 | TTYMXC3_RXD Input Data | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
7:3 | TTYMXC3_RXD Crossbar | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
04 | 0 | TTYMXC1_CTS Output Enable | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | TTYMXC1_CTS Output Data | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2 | TTYMXC1_CTS Input Data | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
7:3 | TTYMXC1_CTS Crossbar | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
05 | 0 | TTYMXC2_RTS Output Enable | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | TTYMXC2_RTS Output Data | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2 | TTYMXC2_RTS Input Data | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
7:3 | TTYMXC2_RTS Crossbar | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
06 | 0 | MB_TXD Output Enable | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | MB_TXD Output Data | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2 | MB_TXD Input Data | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
7:3 | MB_TXD Crossbar | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
07 | 0 | MB_TX_EN_485 Output Enable | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | MB_TX_EN_485 Output Data | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2 | MB_TX_EN_485 Input Data | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
7:3 | MB_TX_EN_485 Crossbar | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
08 | 0 | STC_TXD_485 Output Enable | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | STC_TXD_485 Output Data | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2 | STC_TXD_485 Input Data | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
7:3 | STC_TXD_485 Crossbar | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
09 | 0 | STC_TX_EN_485 Output Enable | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | STC_TX_EN_485 Output Data | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2 | STC_TX_EN_485 Input Data | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
7:3 | STC_TX_EN_485 Crossbar | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
10 | 0 | TXD_232_COM Output Enable | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | TXD_232_COM Output Data | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2 | TXD_232_COM Input Data | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
7:3 | TXD_232_COM Crossbar | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
11 | 0 | RTS_232_COM Output Enable | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | RTS_232_COM Output Data | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2 | RTS_232_COM Input Data | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
7:3 | RTS_232_COM Crossbar | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
12 | 0 | HD1_TXD Output Enable | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | HD1_TXD Output Data | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2 | HD1_TXD Input Data | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
7:3 | HD1_TXD Crossbar | }
On startup these are the default values:
|