zador.blood.stained

  • Posts

    3633
  • Joined

  • Last visited

Reputation Activity

  1. Like
    zador.blood.stained got a reaction from wildcat_paris in learning device tree   
    Mainline kernel comes with new gpio driver with standart linux gpio interface, it doesn't need any DT configuration. You need to "export" pin number for it to appear in sysfs tree (I'm assuming you want sysfs access)
    Read section "Accessing the GPIO pins through sysfs with mainline kernel" here: https://linux-sunxi.org/GPIO
  2. Like
    zador.blood.stained got a reaction from wildcat_paris in learning device tree   
    FYI, I checked, using dtc from device-tree-compiler on device itself is an easier way to make such small changes in Device Tree config.
    http://forum.armbian.com/index.php/topic/382-armbian-on-pcduino3/#entry2444
    Decompiled dts looks a bit different compared to original, but it's easy to find LED related sections and values.
  3. Like
    zador.blood.stained got a reaction from ASCIInaut in Cubietruck UART 3 4 7 Pin Out (serial, ttyS)   
    Other serial devices are not enabled in Device Tree by default, you need to modify Device Tree files and compile new dtb file to enable them.
    Starting from here 
    https://github.com/torvalds/linux/blob/master/arch/arm/boot/dts/sun7i-a20.dtsi#L1205 are sections for serial devices, common for all A20 devices, here 
    https://github.com/torvalds/linux/blob/master/arch/arm/boot/dts/sun7i-a20-cubietruck.dts#L300 uart0 is enabled. You need to add similar sections for serial devices that you want, using pinctrl parameters from here 
    https://github.com/torvalds/linux/blob/master/arch/arm/boot/dts/sun7i-a20.dtsi#L858 (which also answers your questions for pin numbers, you can check pin mappings in cubietruck schematics pdf).
    Use build script to recompile kernel (you only need new sun7i-a20-cubietruck.dtb file), adding, for example, this section to sun7i-a20-cubietruck.dts to activate uart2
    &uart2 { pinctrl-names = "default"; pinctrl-0 = <&uart2_pins_a>; status = "okay"; }; Some uarts have different pinout variants, check schematic or maybe script.fex to find correct one.
    If pinctrl section lists 4 pins instead of 2, two other pins are RTS and CTS signals, you probably won't use them.