These overlays are designed to work with the 4.13 Linux fork from https://github.com/BayLibre/libretech-linux
You need a "Overlay Enabled" device tree compiler, you can use the following one :
$ git clone https://github.com/RobertCNelson/dtc.git dtc --depth 1
$ cd dtc
dtc$ make all
Add the dtc
binary in your PATH then :
make
Copy the overlays/*.dtbo
files in the /lib/firmware
directory of your rootfs.
Copy the overlay.sh
tool into the /usr/sbin
directory of your rootfs.
# mount x /sys/kernel/config -t configfs
(if not already mounted)
Then load the overlay (we can only specify part of the filename) :
Pinout :
- TX will be on 7J1 Header Pin 8
- RX will be on 7J1 Header Pin 10
- CTS will be on 7J1 Header Pin 16
- RTS will be on 7J1 Header Pin 18
# overlay.sh add libretech-cc-uarta
To enable a serial console on it :
# systemctl enable serial-getty@ttyAML1.service
# systemctl start serial-getty@ttyAML1.service
Pinout :
- SDA will be on 7J1 Header Pin 3
- SCL will be on 7J1 Header Pin 5
# overlay.sh add libretech-cc-i2c-ao
To scan available I2C devices :
# i2cdetect -y 1
To add a simple device, here a DS3231 RTC module :
# echo "ds3231 0x68" > /sys/class/i2c-adapter/i2c-1/new_device
You can also use the device specific overlay, before or after the bus overlay :
- DS3231 on I2C AO
# overlay.sh add libretech-cc-ds3231-i2c-ao
- AT24C32 on I2C AO
# overlay.sh add libretech-cc-at24c32-i2c-ao
Pinout :
- SDA will be on 7J1 Header Pin 27
- SCL will be on 7J1 Header Pin 28
# overlay.sh add libretech-cc-i2c-b
To scan available I2C devices :
# i2cdetect -y 2
To add a simple device, here a DS3231 RTC module :
# echo "ds3231 0x68" > /sys/class/i2c-adapter/i2c-2/new_device
You can also use the device specific overlay, before or after the bus overlay :
- DS3231 on I2C B
# overlay.sh add libretech-cc-ds3231-i2c-b
- AT24C32 on I2C B
# overlay.sh add libretech-cc-at24c32-i2c-b
Pinout :
- MOSI will be on 7J1 Header Pin 19
- MISO will be on 7J1 Header Pin 21
- CLK will be on 7J1 Header Pin 23
- CS0 will be on 7J1 Header Pin 24
# overlay.sh add libretech-cc-spicc
The spidev interface can be activated by loading the spidev overlay :
# overlay.sh add libretech-cc-spidev-spicc
Any overlay loading can be reverted by using the rm
command instead of add
like :
# overlay.sh rm libretech-cc-spicc