@lex

Members
  • Content Count

    430
  • Joined

  • Last visited

2 Followers

About @lex

  • Rank
    Embedded member

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

1434 profile views
  1. @lex

    Orangepi 3 h6 allwiner chip

    Just an update to i2c and spi. The pin node definition i2c0 and i2c1 are reversed. It works. (5.0.1) So i think it is safe to assume i2c and spi are working, just need someone with better experience with the spi LCD to find the right DT configuration for the mainline 5.0.y . Hope this help. i2cdetect -l i2c-3 i2c DesignWare HDMI I2C adapter i2c-1 i2c mv64xxx_i2c adapter I2C adapter i2c-2 i2c mv64xxx_i2c adapter I2C adapter i2cdetect -y 1 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- 3d -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- --
  2. @lex

    Orangepi 3 h6 allwiner chip

    Using this code i got an output but similar to the previous one. https://github.com/rm-hull/spidev-test ./spidev_test -D /dev/spidev0.0 spi mode: 0x0 bits per word: 8 max speed: 500000 Hz (500 KHz) RX | FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D | ......@....�..................�. PS: the TX data: uint8_t default_tx[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x40, 0x00, 0x00, 0x00, 0x00, 0x95, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x0D, };
  3. @lex

    Orangepi 3 h6 allwiner chip

    Can you share your DT changes? Did you use the new dma? O used this code: https://github.com/torvalds/linux/blob/master/tools/spi/spidev_test.c
  4. @lex

    Orangepi 3 h6 allwiner chip

    Yes, I guess this is a confirmation SPI is not working yet. I used the -v to see some output (the spidev_test did not return anything). I had some hope that TX would be the data sent and RX would be the receiving data which is the same.
  5. @lex

    Orangepi 3 h6 allwiner chip

    @jernej FYI, i just did a simple test on /dev/spidev.0.0 with a loop, not sure what should be the result, but here it is: ./spidev_test -v -D /dev/spidev0.0 spi mode: 0x0 bits per word: 8 max speed: 500000 Hz (500 KHz) TX | FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D |......@.........................| RX | FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D |......@.........................|
  6. @lex

    Orangepi 3 h6 allwiner chip

    That seems to be the case here. Unfortunately, I have to wait for this support. Thanks anyway.
  7. @lex

    Orangepi 3 h6 allwiner chip

    Sure, but sorry, no progress yet to test your code, I got stuck with the error below and i could not figure out where the mistake is. The message is obvious, but the same setup works with others sbc with 4.18, 4.19 and 4.20. [ 3.455164] sun50i-h6-pinctrl 300b000.pinctrl: pin PC5 already requested by 5010000.spi; cannot claim for 300b000.pinctrl:69 [ 3.444948] fbtft: module is from the staging directory, the quality is unknown, you have been warned. [ 3.454515] fb_ili9341: module is from the staging directory, the quality is unknown, you have been warned. [ 3.454940] fbtft_of_value: buswidth = 8 [ 3.454947] fbtft_of_value: debug = 0 [ 3.454950] fbtft_of_value: rotate = 90 [ 3.454953] fbtft_of_value: fps = 60 [ 3.454955] fbtft_of_value: txbuflen = 16384 [ 3.476347] fb_ili9341 spi0.0: gpio_request_one('cs-gpios'=69) failed with -22 [ 3.483740] fb_ili9341: probe of spi0.0 failed with error -22 [ 4.091824] sun4i-drm display-engine: fb0: DRM emulated frame buffer device dma: dma-controller@3002000 { compatible = "allwinner,sun50i-h6-dma"; reg = <0x03002000 0x1000>; interrupts = <GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH>; clocks = <&ccu CLK_BUS_DMA>, <&ccu CLK_MBUS_DMA>; clock-names = "bus", "mbus"; dma-channels = <16>; dma-requests = <46>; resets = <&ccu RST_BUS_DMA>; #dma-cells = <1>; }; pio: pinctrl@300b000 { . . spi0_pins: spi0 { pins = "PC0", "PC2", "PC3", "PC5"; function = "spi0"; }; }; spi0: spi@5010000 { compatible = "allwinner,sun8i-h3-spi"; reg = <0x05010000 0x1000>; interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>; clocks = <&ccu CLK_BUS_SPI0>, <&ccu CLK_SPI0>; clock-names = "ahb", "mod"; dmas = <&dma 23>, <&dma 23>; dma-names = "rx", "tx"; pinctrl-names = "default"; pinctrl-0 = <&spi0_pins>; resets = <&ccu RST_BUS_SPI0>; status = "disabled"; num-cs = <1>; #address-cells = <1>; #size-cells = <0>; }; &pio { spi0_cs_pins: spi0_cs_pins { pins = "PC5", "PH3"; function = "gpio_out"; }; }; &spi0 { #address-cells = <1>; #size-cells = <0>; status = "okay"; pinctrl-0 = <&spi0_pins &spi0_cs_pins>; cs-gpios = <&pio 2 5 GPIO_ACTIVE_HIGH>, <&pio 7 3 GPIO_ACTIVE_HIGH>; num-cs = <2>; pitft: pitft@0{ compatible = "ilitek,ili9341"; reg = <0>; status = "okay"; spi-max-frequency = <50000000>; rotate = <90>; fps = <60>; bgr = <1>; buswidth = <8>; txbuflen = <16384>; dc-gpios = <&pio 2 9 GPIO_ACTIVE_HIGH>; /* PC9 */ reset-gpios = <&pio 2 8 GPIO_ACTIVE_HIGH>; /* PC8 */ led-gpios = <&pio 2 7 GPIO_ACTIVE_LOW>; /* PC7 */ cs-gpios = <&pio 2 5 GPIO_ACTIVE_HIGH>; /* PC5 */ <== kernel complain debug = <0x0>; }; };
  8. @lex

    Orangepi 3 h6 allwiner chip

    Okay, I promise i will try to learn that. Anyway, Your dma code seems to work for the SPI0 although the device is not connected yet and need some tests. [ 3.983705] fbtft: module is from the staging directory, the quality is unknown, you have been warned. [ 3.990224] fb_ili9341: module is from the staging directory, the quality is unknown, you have been warned. [ 3.990921] fbtft_of_value: buswidth = 8 [ 3.990929] fbtft_of_value: debug = 0 [ 3.990932] fbtft_of_value: rotate = 90 [ 3.990934] fbtft_of_value: fps = 60 [ 3.990936] fbtft_of_value: txbuflen = 16384 [ 4.273841] graphics fb0: fb_ili9341 frame buffer, 320x240, 150 KiB video memory, 16 KiB buffer memory, fps=62, spi0.0 at 50 MHz [ 4.276796] sun4i-drm display-engine: fb1: DRM emulated frame buffer device
  9. @lex

    Orangepi 3 h6 allwiner chip

    Err... Just don't know how to do that... In a proper way I mean.
  10. @lex

    Orangepi 3 h6 allwiner chip

    The opi3-h6.dts i pointed to already have all the nodes. HDMI works like a charm. Those who will try need to compile the kernel with Wifi and BT enabled. I synced the regulators with H64 but that does not fix the reboot issue. I just noticed the power ON/OFF button works, maybe the H64 does not have this button? Do you have any suggestion about i2c? I will use your dma code and see if i get SPI0 to work.
  11. @lex

    Orangepi 3 h6 allwiner chip

    Nice. BTW Do you have mali working on your kernel?
  12. @lex

    Orangepi 3 h6 allwiner chip

    These are the changes from H64 and OpiOne+ @@ -161,6 +155,7 @@ regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; regulator-name = "vcc-ac200"; + regulator-enable-ramp-delay = <100000>; }; reg_aldo3: aldo3 { @@ -219,7 +214,7 @@ reg_dcdca: dcdca { regulator-always-on; regulator-min-microvolt = <810000>; - regulator-max-microvolt = <1160000>; + regulator-max-microvolt = <1080000>; regulator-name = "vdd-cpu"; };
  13. @lex

    Orangepi 3 h6 allwiner chip

    Forgot to print the dma used: dma: dma-controller@3002000 { compatible = "allwinner,sun50i-a64-dma"; reg = <0x03002000 0x1000>; interrupts = <GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH>; clocks = <&ccu CLK_BUS_DMA>; dma-channels = <8>; dma-requests = <27>; resets = <&ccu RST_BUS_DMA>; #dma-cells = <1>; };
  14. @lex

    Orangepi 3 h6 allwiner chip

    Possible, do you mean u-boot? I am using old u-boot with old values, will re-check and see if it changes something. Thanks for the tip.
  15. @lex

    Orangepi 3 h6 allwiner chip

    The printed info above (i2cdetect -y 0/1) is from the stock kernel, as soon as i added the i2c entries i2c gets lazy and do not detect the device i attach on PH6 and PH5 (Orange Pi One Plus). I added: &i2c0_pins { bias-pull-up; }; just in case. No success. SPI seems to be in the right direction, i tried to drive ili9341 display but kernel complains PC5 is already in use, so i gave up for now.