Posts by straylit

    Is it in hyperion.ng new version?

    It is in both hyperion and hyperion.ng if you compile it yourself with the right flags enabled.

    The binary is included in the hyperion add-on from the LibreELEC repo in kodi which is what I'm testing against for now.

    The only issue with hyperion-aml is it doesn't appear to capture the kodi GUI but I haven't looked into it farther than confirming that it grabs video correctly.

    I'll keep experimenting and with some luck might find it.

    Worst case I'll write a script to iterate over a range of values and record all nodes from the error messages.

    My script iterated over the range 0x00 to 0x7A without finding anything that didn't error out.

    It appears &spi_pins doesn't have a phandle to find. ;(

    Upon further research I found this explanation on Device Tree Mysteries which clarifies the syntax of using the full path instead of a label but fdt doesn't appear to like it as there is no pinctrl-0 node in /proc/device-tree/spicc upon boot when using it.

    kszaq Do you have any ideas on where I should focus next?

    I feel very close to a solution but also very far away.

    I'll probably try getting up and running on the mainline linux build to see if it works there and possibly illuminates the issue on LibreELEC.

    Thanks for any/all feedback, support, ideas...

    I'll keep looking at it and would appreciate any ideas y'all might have.

    I pulled the dtb from the mainline linux build from LibreTech which has the supposedly functional spi overlay, then replaced the one from kszaq with it and was still able to boot.

    I had noticed that /proc/device-tree/spicc/ did not reflect any fdt command with &references so I assume they were erroring out.

    By comparing the dts source with the decompiled version I was able to replace the references with real values which are then reflected in /proc/device-tree properly.

    I'm very confident in the values for cs-gpios, they are defined here and multiple times in the decompiled version, but much less so for pinctrl-0 because there are no other references to &spi_pins and I had to guess.

    Code
    fdt set /aliases spi0 /soc/cbus@c1100000/spi@8d80
    fdt set /spicc status okay
    fdt set /spicc pinctrl-0 <0x65>
    fdt set /spicc pinctrl-names default
    fdt set /spicc cs-gpios <0x1d 0x59 0x1>
    fdt mknode /spicc spidev@0
    fdt set /spicc/spidev@0 compatible "linux, spidev"
    fdt set /spicc/spidev@0 reg <0>
    fdt set /spicc/spidev@0 spi-max-frequency <30000000>

    This resulted in the following dmesg output:

    Code
    [    0.283014@0] spicc c1108d80.spicc: dma_en=0
    [    0.283043@0] spicc c1108d80.spicc: irq = 0x71
    [    0.283053@0] spicc c1108d80.spicc: delay_control=21
    [    0.283063@0] spicc c1108d80.spicc: enhance=0
    [    0.284688@0] spicc c1108d80.spicc: could not find pctldev for node /i2s_platform, deferring probe
    [    0.284703@0] spicc c1108d80.spicc: get pinctrl fail
    [    0.284713@0] spicc c1108d80.spicc: of error=-517
    [    0.284732@0] platform c1108d80.spicc: Driver spicc requests probe deferral

    Trying other values of pinctrl-0 results errors referencing other nodes such as this for 0x49:

    Code
    ...
    [    0.286320@0] spicc c1108d80.spicc: could not find pctldev for node /unifykey/key_4, deferring probe
    [    0.286336@0] spicc c1108d80.spicc: get pinctrl fail
    [    0.286346@0] spicc c1108d80.spicc: of error=-517
    [    0.286364@0] platform c1108d80.spicc: Driver spicc requests probe deferral

    The only clue I have for the proper value of &spi_pins is from the compiled source:

    I'm pretty sure all that remains is finding the right value for pinctrl-0/&spi_pins.

    I'll keep experimenting and with some luck might find it.

    Worst case I'll write a script to iterate over a range of values and record all nodes from the error messages.

    What you can try is edit boot.ini and add this line right before "bootm prep": fdt set /spicc status okay

    This should enable SPICC node and load the driver. Whether it works and how - you tell me. ;)

    kszaq Thanks for the info!

    I'll give that a shot when I get home.

    I've added the following to my boot.ini:

    Code
    fdt set /spicc status okay
    fdt mknode /spicc spidev
    fdt set /spicc/spidev compatible linux,spidev
    fdt set /spicc/spidev reg <0>
    fdt set /spicc/spidev spi-max-frequency <30000000>

    Which resulted in the very promising:

    However my SPI devices don't seem to be getting any data.

    I attempted to translate the rest of the overlay as follows, but I'm less confident about the syntax here:

    Code
    fdt set /aliases spi0 /soc/cbus@c1100000/spi@8d80
    fdt set /spicc pinctrl-0 <&spi_pins>
    fdt set /spicc pinctrl-names default
    fdt set /spicc cs-gpios <&gpio 89 1>

    This didn't change the dmesg output or get my hardware working so not sure it had any effect.

    The line about aliases seems especially dodgy.

    I'll keep looking at it and would appreciate any ideas y'all might have.

    Cheers:thumbup:

    straylit Device tree overlays do not work with legacy Amlogic u-boot and kernel as far as I know.

    What you can try is edit boot.ini and add this line right before "bootm prep": fdt set /spicc status okay

    This should enable SPICC node and load the driver. Whether it works and how - you tell me. ;)

    kszaq Thanks for the info!

    I'll give that a shot when I get home.

    If that doesn't work perhaps I could apply the overlay to your device tree source file by hand before compiling with dtc to create my own dtb.

    On that note, is there a file missing from your s905-device-trees repo?

    There are references to a gxl_p212_2g.dts but I don't see it in there and can't get gxl_p212_2g_lepotato.dts to compile without it.

    Thanks again!

    Code: gxl_p212_2g_lepotato.dts
    #include "gxl_p212_2g.dts"
    ...

    Does anyone know how to enable SPI support on the LePotato?

    It is my understanding that the 905x, unlike the 905, does have hardware SPI support so it should be possible.

    After splitting dtb.img and converting to dts, I can see that the SPI section is present but disabled.

    I found the overlays needed for SPI and spidev on libre computer projects's github.

    I'm now looking into how to either enable these overlays or rebuild the device tree blob with them built-in.

    If successful this will allow the LePotato to use hyperion, ambilight or boblight with SPI/APA102 devices directly.

    Howdy!

    I'm running a fresh installation of kszaq's 8.2.2.3 LePotato build and it has been working great so far.

    Does anyone know how to enable SPI support on the LePotato?

    It is my understanding that the 905x, unlike the 905, does have hardware SPI support so it should be possible.

    On a Pi I would add "dtparam=spi=on" to /boot/config.txt but I can't seem to find the equivalent for this board.

    Perhaps there's a "setenv ..." for it in /flash/boot.ini?

    Or maybe I just need to load the correct module?

    I see entries for "SPICC_PINS" in the dtb.img file which gives me hope but there is no corresponding /dev/spidev0.0

    If anyone could point me in the right direction I would appreciate it!

    Thanks to all and especially thanks to kszaq for this great build.