Appendix
Pat Beirne edited this page 2 years ago

Appendix: Linux driver numbering

Special function mode:

RDA device name i96 Bus Name Linux device name
uart1 UART0 /dev/ttyS1
uart2 UART1 /dev/ttyS2
uart3 n/a /dev/ttyS0 (debug terminal; not on i96 bus)
i2c1 n/a /sys/class/i2c/i2c-0 (link to modem chip; not on i96 bus)
i2c2 I2C0 /sys/class/i2c/i2c-1
i2c3 I2C1 /sys/class/i2c/i2c-2
spi2 SPI0 /sys/class/spi_master TODO: verify
i2s2 PCM /sys/class/pcm/pcm-1 TODO: verify
Appendix: GPIO misc info:
RDA gpio driver group IOMUX address Linux gpio device numbers
Group C 0x11a0.9008 gpio96-gpio127
Group A 0x11a0.900c gpio0-gpio31
Group B 0x11a0.9010 gpio32-gpio63
Group D 0x11a0.9014 gpio64-gpio68 (there are only 5 pins)

Write a '1' into the IOMUX register to set a bit to GPIO mode. Write a '0' to set the same bit to 'special function' See this

The actual gpio direction and value registers are at 0x2093.0000(group a), 0x2093.1000(group b), 0x2093.2000(group d) and 0x11a08000(group c) address + 0 = "data direction register 0=output"

+ 4 set for "dir = out"  
+ 8 set for "dir = in"  
+ c for "value read/write"  
+ 10 set for "write 1"  
+ 14 set for "write 0"  
+ 18 gpio interrupt control reg  

Resources on the net:

Problems not addressed in this doc

  • 2G modem

  • camera interface

  • LCD interface

  • booting from NAND

  • changing the WiFi into an AP (access point)

  • some people had problems with specific makes of sdcards (trans-flash)

    • (personally, I've never had a problem)

Things to do on a fresh install

  • login orangepi/orangepi

  • sudo -i

  • edit /etc/update-motd.d/100-fs-warning (change last escape sequence to \033[0m)

  • dpkg -r alsa-utils libasound2 or simply rm /usr/sbin/alsactl

  • run orangepi-config

    • set up wifi device
    • give your device a new hostname
  • reboot

  • set your timezone :

    • rm /etc/localtime
    • ln -s /usr/share/zoneinfo/America/Toronto /etc/localtime
  • optional

    • add new user: adduser <username>
      • give that user sudo powers: usermod -a -G sudo <username>
    • replace the wifi driver so that your MAC address doesn't change
      • replace rdawfmac.ko in /lib/modules/3.10.62-rel5.0.2+/kernel/drivers/net/wireless/rdaw80211/rdawlan/
  • update your system: apt update && apt upgrade

NOTE there are some wifi hotspots that refuse to DHCP/DHCLIENT but others are fine.....why?

NOTE if you go to compile the source for uboot & kernel, you'll need to load the 32bit versions of the libstdc++6 libraries

OrangePi 2G-IOT

The 2G-IOT version of this board includes a GSM tranceiver and an audio subsystem. Otherwise it is very similar to the i96 board and most of the above notes apply.

The 2G-IOT board does not have the 3 green LEDS, but it does have a single red LED which can be controlled by

  cd /sys/class/leds/red-flash
  echo 0 > brightness
  echo 255 > brightness

NOTE: The i2c-0 device is connected to pins 3/5 (I2C1_SDA/I2C1_SCL) on the 2Giot pin connector. It is NOT recommended to use this bus, because it is also connected to the modem chip, and is used for chip-to-chip communication. For the same reason, do not use opio to modify the operation of these pins.