| 72 | | '''Important''' Run the following to configure GPIO & enable the modem (requires a 4.20 kernel or newer) : |
| 73 | | {{{ |
| | 72 | If you wish to be able to disable the modem you can use the {{{ftx_prog}}} utility to alter the EEPROM configuration for CBUS0 and make it a GPIO then use either Linux gpiolib (/sys/class/gpio) as shown below or some other means (such as an application using libftdi) to manipulate it. If you change CBUS0 to a GPIO the modem will by default be disabled (due to the 10k pull-down on that signal) until you configure the GPIO to output a logic high. |
| | 73 | |
| | 74 | The {{{ftx_prog}}} utility is an open source program that uses libftdi and can be easily built: |
| | 75 | {{{#!bash |
| | 76 | sudo apt-get install git build-essential gcc make libftdi-dev |
| | 77 | git clone https://github.com/richardeoin/ftx-prog.git |
| | 78 | cd ftx-prog |
| | 79 | make |
| | 80 | }}} |
| | 81 | |
| | 82 | The following commands are used to configure the FTDI EEPROM such that the CBUS0 is a GPIO: |
| | 83 | {{{#!bash |
| | 84 | sudo ./ftx_prog --cbus 0 GPIO # configure CBUS0 as GPIO |
| | 85 | }}} |
| | 86 | |
| | 87 | And if you want to re-configure it to change it back to Drive_1 to make the modem always enabled at power-up: |
| | 88 | {{{#!bash |
| | 89 | sudo ./ftx_prog --cbus 0 Drive_1 # configure CBUS0 as always output high |
| | 90 | }}} |
| | 91 | |
| | 92 | You will need to either power-cycle your board or reload the ftdi_sio kernel module to make this take effect: |
| | 93 | {{{#!bash |
| | 94 | rmmod ftdi_sio |
| | 95 | modprobe ftdi_sio |
| | 96 | }}} |
| | 97 | |
| | 98 | If CBUS0 is configured as GPIO you can use the following commands (on a 4.20 or newer kernel) to configure GPIO & enable the modem: |
| | 99 | {{{#!bash |
| 87 | | === Procedure for kernels prior to Linux 4.20 |
| 88 | | Because support for controlling the FTDI GPIOs was introduced in Kernel 4.20, a program (ftx_prog) can be used to configure the FTDI io-pins in the EEPROM on the FTDI chip on earlier kernels. Configuring CBUS0 as 'drive-1' makes it always output a logic high enabling the modem and removes the need (and ability) to manipulate the gpio to turn the modem on/off. |
| 89 | | |
| 90 | | This is an open source program located here: https://github.com/richardeoin/ftx-prog |
| 91 | | |
| 92 | | Building: |
| 93 | | {{{#!bash |
| 94 | | sudo apt-get install git build-essential gcc make libftdi-dev |
| 95 | | git clone https://github.com/richardeoin/ftx-prog.git |
| 96 | | cd ftx-prog |
| 97 | | make |
| 98 | | }}} |
| 99 | | |
| 100 | | The following commands are used to re-configure the CBUS0 pin to keep the modem always enabled: |
| 101 | | {{{#!bash |
| 102 | | sudo ./ftx_prog --cbus 0 Drive_1 # configure CBUS0 as always output high |
| 103 | | }}} |
| 104 | | |
| 105 | | And if you want to re-configure it to change it back to a GPIO (in which case you will need a Linux 4.20 kernel or newer or a userspace application to configure the ftdi-cbus gpio): |
| 106 | | {{{#!bash |
| 107 | | sudo ./ftx_prog --cbus 0 GPIO # configure CBUS0 as GPIO |
| 108 | | }}} |
| 109 | | |
| 110 | | Note: Power cycle board after running commands. |