Hello,
I am the author of a home automation platform (RaspberryMatic) which is targeted for embedded platforms like RaspberryPi or Tinkerboard. I am regularly following Armbian kernel and u-boot updates for the Tinkerboard and integrate them into my buildroot-based environment so that recent kernel and u-boot versions can be used. I have already updated my environment to kernel 4.14.x and U-boot 2018.05 using the great armbian patchset from GitHub (Thanks for the hard work to get all the Tinkerboard S related issues sorted out recently).
What I am currently trying to achieve is to get the Tinkerboard to use a different set of standard gpio settings for certain GPIOs because my application requires this for some additional HAT hardware. On the RaspberryPi I was able to perform this by using a device tree overlay and using the following device tree definitions:
[...]
brcm,pins = <18 12 16 20 21>; // 18=reset, 12=button, 16=red, 20=green, 21=blue
brcm,pull = <0 2 0 0 0>; // 18=no-pullup, 12=pullup, 16,20,21=no-pullup
brcm,function = <1 0 1 1 1>; // 18=output, 12=input, 16,20,21=output
[...]
For the tinkerboard I tried to applied similar setting (but using rockchip-like device tree definition) as a patch against linux/arch/arm/boot/dts/rk3288-tinker.dts in the kernel tree. The corresponding patchset which I developed can be found here:
https://github.com/jens-maus/RaspberryMatic/blob/master/buildroot-external/board/tinkerboard/kernel-patches/0002-rk3288-tinker.patch
It is essentially trying to achieve the same like the above RaspberryPi-based device tree overlay by using:
[...]
rockchip,pins = <7 RK_PA7 RK_FUNC_GPIO &pcfg_output_high>,
<6 RK_PA3 RK_FUNC_GPIO &pcfg_output_high>,
<6 RK_PA4 RK_FUNC_GPIO &pcfg_output_high>;
[...]
However, this does not seem to work somehow because after booting the GPIOs in question are still partly assigned as input direction gpios rather than output direction gpio like I need them.
Does anyone have any idea how to solve this issue or point me at the bug in my device tree patch which might explain why I cannot change the default GPIO setup for the Tinkerboard?
BTW: Using WiringPi during bootup of course works (and I am using this as a workaround). But I would like to perform this without using WiringPi directly in the device tree.