wiki:laguna/peripherals

List of onboard Peripherals and associated Drivers

32MB Flash

Memory Technology Device (MTD)

  • drivers/mtd

8Kbits Serial EEPROM

I2C EEPROMs from most vendors

  • drivers/misc/eeprom/at24.c

2 Port 10/100/100 Ethernet Switch

Cavium CNS3xxx Ethernet support

  • drivers/net/cns3xxx_eth.c

RTC

Dallas/Maxim? DS1672

  • drivers/rtc/rtc-ds1672.c

HWMON

Gateworks System Peripheral

  • drivers/hwmon/gsp.c

USB

Cavium CNS3XXX EHCI Module

  • drivers/usb/host/ehci-cns3xxx.c
  • drivers/usb/host/ohci-cns3xxx.c

Cavium CNS3XXX OTG Module

  • drivers/usb/otg

GPS

  • Uses a builtin serial port

GPIO

Emulates a TI 16-bit i2c Digital-IO: pca9555:

J9.1 - gpio108
J9.3 - gpio109
J9.5 - gpio110
J9.7 - gpio111
J9.9 - gpio112

Modern kernels use gpiolib to access gpio from userspace. By default these are not exported in the OpenWrt kernels, but you can do so in userspace such as:

echo 108 > /sys/class/gpio/export 
echo 109 > /sys/class/gpio/export 
echo 110 > /sys/class/gpio/export 
echo 111 > /sys/class/gpio/export 
echo 112 > /sys/class/gpio/export 
echo in > /sys/class/gpio/gpio108/direction
echo in > /sys/class/gpio/gpio109/direction
echo in > /sys/class/gpio/gpio110/direction
echo in > /sys/class/gpio/gpio111/direction
echo in > /sys/class/gpio/gpio112/direction

to see the value of an input/output:

cat /sys/class/gpio/gpio112/value

to set the value of an output

echo out > /sys/class/gpio/gpio122/direction  ;# set as output
echo 1 >/sys/class/gpio/gpio112/value ;# set hi
echo 0 >/sys/class/gpio/gpio112/value ;# set low

to see all gpio status (assuming you have debugfs mounted):

cat /sys/kernel/debug/gpio
</pre
Last modified 10 months ago Last modified on 10/23/2017 09:37:41 PM