Genna

  • Posts

    6
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. If you just want to get PWM running do the following: create a file (lets name it pwm_cd.dts) with this contents /dts-v1/; /plugin/; /{ fragment@0 { target = <&pwm_cd>; __overlay__{ status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&pwm_c_x5_pins &pwm_d_x3_pins>; }; }; }; compile that file with dtc -I dts -O dtb pwm_cd.dts -o pwm_cd.dtbo create a directory for user overlays and move that file there mkdir /boot/overlay-user cp pwm_cd.dtbo /boot/overlay-user/ edit /boot/armbianEnv.txt and add the following line user_overlays=pwm_cd then do a reboot and you should be able to use PWM_C and PWM_D with sysfs like cd /sys/class/pwm/pwmchip-2/ echo 0 > export echo 1000000 > pwm0/period echo 50000 > pwm0/duty_cycle echo 1 > pwm0/enable This can be done for the other PWM's as well. You'll just have to figure out which pinctrl-names you have to use by comparing the files from odroid (overlays and dtb) with the dtb from armbian.
  2. Have you tried adding it as a user overlay? Basically create a folder '/boot/overlay-user'. Compile your plugin with the usual 'dtc -I dts -O dtb [your file] -o [output name].dtbo' and put it into the created directory. Then edit '/boot/armbianEnv.txt' and add the line 'user_overlays=[output name]'. That is what worked for me every time so far.
  3. So as we know, the Hardkernel kernel did support powering the device on and off via a GPIO pin. This does not seem to work on Armbian with the mainline kernel. What does work is powering the device on and off with the remote control. So I wonder, what has to be done to enable power on and off vie the GPIO? My approach till now makes it possible to shutdown the device via GPIO interrupt. But then it will not come up again except if I reconnect the power cord or use the remote. I use this user device three overlay btw: /dts-v1/; /plugin/; /{ fragment@0 { target = <&ao_pinctrl>; __overlay__ { power_btn_port:power_btn_port { mux { groups = "GPIOAO_10"; function = "gpio_periphs"; bias-pull-up; output-high; }; }; }; }; fragment@1 { target-path = "/"; __overlay__ { gpio_keys:gpio_keys { compatible = "gpio-keys"; power_btn:power_btn { label = "POWER BUTTON"; linux,code = <116>; gpios = <&gpio_ao 10 0>; //GPIOAO_10 interrupt-parent = <&gpio_intc>; interrupts = <10 3>; wakeup-source; }; }; }; }; }; I've tried with the default pin as well (GPIOX_4) but with the same result. The hope was that the AO domain would do some magic like with the remote but no dice. Also the 'wakeup-source' seems to be ignored by the system as 'cat /sys/kernel/irq/*/wakeup' prints 'disabled' for all IRQ's. So, any ideas besides dissembling the remote and some solider works from the power button on the chassis to the IR IC to make it part of the final device? This would be very Frankenstein'ish just have a power button.
  4. I can confirm that it works on my C4 with the orange 32 gig emmc v0.5 as well.
  5. So It seems to work on my side now. Did a lot of reading on topics that I did not and still do not understand. One of the articles mentioned a debug command. "cat /sys/kernel/debug/pinctl/pinctl-handles". The command was kind of useful because I could see that "ff80200.pwm" was active but not my patched "ffd1a000.pwm". Which was strange because the driver was visible in "/sys/class/pwm". So the PWM controller was working, but had no pin 'attached' to it. The output or "cat /sys/kernel/debug/pinctrl/pinctrl-handles" made it more clear. I compared the code again and noticed that pwm@2000 in the dtb from armbian did use "default" for the "pinctrl-names" property unlike 'pwm_pins' in the dtb from hardkernel. I changed my overlay to use the same and finally got some output on the scope. So to enable pwm_cd the overlay should look like: fragment@0 { target = <&pwm_cd>; __overlay__{ status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&pwm_c_x5_pins &pwm_d_x3_pins>; clocks = <&xtal>, <&xtal>; clock-names = "clkin0", "clkin1"; }; }; Unfortunately I am now on a self build image with kernel 5.10. I'll try to go back to an *official* image and see if it still works.
  6. So here I am stuck with the same problem on my c4. Even though I can enable the PWM's trough a user overlay with something like fragment@0 { target = <&pwm_cd>; __overlay__{ status = "okay"; pinctrl-names = "pwm_pins"; pinctrl-0 = <&pwm_c_x5_pins &pwm_d_x3_pins>; clocks = <&xtal>, <&xtal>; clock-names = "clkin0", "clkin1"; }; }; And by by providing all the properties that are present in the hardkernel's dtb. It does not seem to work. The pwm is available in /sys/class/pwm and I can also export one of them and enable it. But when I put the scope on the pin there is simply nothing. Does anyone have a clue where to look next?