Starfishmod Posted February 18, 2017 Posted February 18, 2017 I have an orange pi lite and I'm building my (dev 4.10) image using the Armbian tools. So far I figured out how to enable the DT overlays located in /boot/dtb/overlays by editing the armbianEnv.txt file and adding overlays=sun8i-h3-uart1 sun8i-h3-uart2 sun8i-h3-uart3 sun8i-h3-i2c0 sun8i-h3-spi0-spidev This now enables the various uart, i2c and spi ports I wish to use and that works. I'm trying to now set up a ADS7846 Touch controller using DTB I have copied the file from https://raw.githubusercontent.com/raspberrypi/linux/rpi-4.4.y/arch/arm/boot/dts/overlays/ads7846-overlay.dts and run dtc -I dts -O dtb ads7846-overlay.dts -o /boot/dtb/overlays/ads7846-overlay.dtbo and changed overlays in armbianEnv.txt to overlays=sun8i-h3-uart1 sun8i-h3-uart2 sun8i-h3-uart3 sun8i-h3-i2c0 sun8i-h3-spi0-spidev ads7846-overlay and rebooted. ads7846-overlay doesn't work and according to the information https://github.com/raspberrypi/firmware/blob/master/boot/overlays/README there is supposed to be extra params supplied as part of the dt load How do I add the settings? Thanks Andrew
zador.blood.stained Posted February 18, 2017 Posted February 18, 2017 I'm trying to now set up a ADS7846 Touch controller using DTB I have copied the file from https://raw.githubusercontent.com/raspberrypi/linux/rpi-4.4.y/arch/arm/boot/dts/overlays/ads7846-overlay.dts and run dtc -I dts -O dtb ads7846-overlay.dts -o /boot/dtb/overlays/ads7846-overlay.dtbo This overlay is not compatible with boards others than Raspberry Pi, you have to rewrite it from scratch by yourself, if it's even possible. Official DT bindings also may be useful to you: https://www.kernel.org/doc/Documentation/devicetree/bindings/input/ads7846.txt Also please note that you should use dtc which supports compiling overlays and provide extra arguments for it. Please search the forum, it was discussed before. according to the information https://github.com/raspberrypi/firmware/blob/master/boot/overlays/README there is supposed to be extra params supplied as part of the dt load Extra parameters are not supported, you have to hardcode them in the DT, overlay or the boot script manually.
dhlii Posted March 6, 2017 Posted March 6, 2017 Wow! Device Tree Overlays working - GREAT!!! I am looking to add a push button to a GPIO on the OPI Lite. Does this mean I should be able to loosely follow the directions for doing the same thing using a button overlay for the RPI and with the appropriate OPI changes get it to work such that pushing the button is like hitting a key or a keyboard and I can "read" whether the button was pushed from the standard input stream ?
zador.blood.stained Posted March 6, 2017 Posted March 6, 2017 2 minutes ago, dhlii said: Does this mean I should be able to loosely follow the directions for doing the same thing using a button overlay for the RPI and with the appropriate OPI changes get it to work such that pushing the button is like hitting a key or a keyboard and I can "read" whether the button was pushed from the standard input stream ? Yes, using gpio-keys or gpio-keys-polled should work in theory, but you may want to use "user provided" overlays (/boot/overlay-user/ directory, check the boot script code for details) so your custom files won't be affected by kernel upgrades, and also you may need to change and recompile your overlays due to sunxi pinconf rework if you update the kernel to 4.11 in the future.
dhlii Posted March 6, 2017 Posted March 6, 2017 Wow, that was fast. Thanks for the recomendations. My linux experience is inconsistent - I have a network driver in the kernel.org source, but I spent a day or two trying to get one of the uarts working in the opilite device tree and failed. Most of my kernel work either is pre-device trees or on drivers that do not have anything to do with device trees. So I am expecting to have both fun and difficulties as I try to get a handle on this. If something breaks with 4.11 - well such is life. I will probably mutter a few curse words to myself, and deal with it. My work is extremely eclectic so I am jumping between opi's and linux and pic32's and arduino's and TI 1310's and STM32's and ... depending on the day and the project. The result is broad knowledge with occasional pockets of deep knowledge, but often significant ignorance about somethings that many here are proficient with
Recommended Posts