Skip to content

Latest commit

 

History

History
222 lines (183 loc) · 5.93 KB

V2403C-KL.md

File metadata and controls

222 lines (183 loc) · 5.93 KB

V2403C-KL

After make && make install the upon drivers,
please run depmod -a command to generate modules.dep and map files in /lib/modules/version.

Example code

UART

UART modes are controled by 3 gpio pins and it87_serial:

  • Super IO (IT8786) PIN table
Device Node GPIO#0 GPIO#1 GPIO#2 it87_serial
/dev/ttyS0 GP14 GP11 GP12 1
/dev/ttyS1 GP30 GP15 GP16 2
/dev/ttyS2 GP36 GP32 GP33 3
/dev/ttyS3 GP50 GP37 GP47 4
  • GPIO value of UART modes
UART mode GPIO#0 GPIO#1 GPIO#2 it87_serial
RS232 1 0 0 0
RS485-2W 0 1 0 1
RS422/RS485-4W 0 0 1 1
  • Example code

    1. select port 1 (/dev/ttyS0) as RS232 mode
     mx-gpio-ctl set 14 1
     mx-gpio-ctl set 11 0
     mx-gpio-ctl set 12 0
     echo 0 > /sys/class/misc/it87_serial/serial1/serial1_rs485
    
    1. select port 2 (/dev/ttyS1) as RS485-2W mode
     mx-gpio-ctl set 30 0
     mx-gpio-ctl set 15 1
     mx-gpio-ctl set 16 0
     echo 1 > /sys/class/misc/it87_serial/serial2/serial2_rs485
    
    1. get port 2 (/dev/ttyS1) mode
     mx-gpio-ctl get 30
     mx-gpio-ctl get 15
     mx-gpio-ctl get 16
     cat /sys/class/misc/it87_serial/serial2/serial2_rs485
    

    Result:

     0
     1
     0
     1
    

    Then look up the table, port 2 is on RS485-2W mode.

DIO

  • Super IO (IT8786) PIN table
DIO index GPIO PIN
DI 0 GP70
DI 1 GP71
DI 2 GP72
DI 3 GP73
DO 0 GP74
DO 1 GP75
DO 2 GP76
DO 3 GP77
  • Example code
    1. set DO 0 value as low: mx-gpio-ctl set 74 0
    2. get DI 0 value: mx-gpio-ctl get 70

mPCIe power control

  • Set GPIO Low = Power off
  • Set GPIO High = Power on
MPCIE PWR CTL GPIO PIN
mPCIe Slot #1 GP81
mPCIe Slot #2 GP83
  • Example code
    1. Power on slot #1: mx-gpio-ctl set 81 1
    2. Power off slot #1: mx-gpio-ctl set 81 0
    3. Get power status on slot #1: mx-gpio-ctl get 81

SIM card select

Default status is on Side A (value high)

  • Set GPIO High = Select Side A on SIM Slot
  • Set GPIO Low = Select Side B on SIM Slot
MPCIE PWR CTL GPIO PIN
SIM Slot #1 GP80
SIM Slot #2 GP82
  • Example code
    1. Select Slot (Side) A on Slot 1: mx-gpio-ctl set 80 1
    2. Select Slot (Side) B on Slot 1: mx-gpio-ctl set 80 0
    3. Get Slot (Side) on Slot 1: mx-gpio-ctl get 80
    4. Get Slot (Side) on Slot 2: mx-gpio-ctl get 82

LAN interface

LAN Slot NIC renamed NIC
LAN #1 eth0 enp0s31f6
LAN #2 eth1 enp6s0
LAN #3 eth2 enp7s0
LAN #4 eth3 enp8s0

Power ignition management

https://github.com/Moxa-Linux/moxa-it87-power-igtd

Watchdog

  • Build moxa-it87-wdt-driver on your host

Example for probing it87_wdt driver on boot

  • Edit /lib/modprobe.d/watchdog.conf
# timeout:Watchdog timeout in seconds, default=60 (int)
# nowayout:Watchdog cannot be stopped once started, default=0 (bool)
options it87_wdt nowayout=1 timeout=60

Disable iTCO_wdt driver

  • Edit /lib/modprobe.d/iTCO-blacklist.conf
blacklist iTCO_wdt
blacklist iTCO_vendor_support

Disalbe NMI watchdog driver (for Ubuntu)

  • First edit the /etc/default/grub file as root and then add nmi_watchdog=0 to the line starting with GRUB_CMDLINE_LINUX_DEFAULT
GRUB_CMDLINE_LINUX_DEFAULT="nmi_watchdog=0"
  • After adding the kernel parameter, don't forget to update the GRUB
sudo update-grub

Watchdog daemon package (Debian/Ubuntu)

  • Install package
sudo apt-get update
sudo apt-get install watchdog
  • Edit /etc/default/watchdog
# Start watchdog at boot time? 0 or 1
run_watchdog=1
# Start wd_keepalive after stopping watchdog? 0 or 1
run_wd_keepalive=0
# Load module before starting watchdog
watchdog_module="it87_wdt"
# Specify additional watchdog options here (see manpage).
  • Add device node to config, edit /etc/watchdog.conf
watchdog-device = /dev/watchdog

Watchdog example code

https://github.com/torvalds/linux/tree/master/tools/testing/selftests/watchdog

Audio Re-taksing on ALC888-VD

  • Line out audio port: Support 'output modes' only
  • Line in audio port: Support 'output modes' & 'input modes'

Pin config

  • output modes

    • LINE_OUT="0x01014010"
    • SPEAKER="0x90170150"
    • HEADPHONE="0x02211010"
  • input modes

    • LINE_IN="0x02811020"
    • MICROPHONE="0x03a19020"

edit /lib/modprobe.d/snd-hda-intel.conf

# This file was added by the program 'mx-audio-retask'.
# If you want to revert the changes made by this program, you can simply erase this file and reboot your computer.
options snd-hda-intel patch=mx-audio-retask.fw

edit /lib/firmware/mx-audio-retask.fw

e.g. port 1 for HEADPHONE, port 2 for MICROPHONE

[codec]
0x10ec0888 0x00000000 0

[pincfg]
0x14 0x02211010
0x18 0x03a19020

Then, reboot to let settings be enabled.