Jump to content

ning

Members
  • Posts

    311
  • Joined

  • Last visited

Posts posted by ning

  1. you need to develop your dtbo to support your addon devices.

     

    from your description, your device needs a set of SPI pins, and a reset pin.

    1574068610_.png.68c2465c4155018bef919af6f9385769.png

     

    OPI PC plus already provides the pins you want.

     

    MOSI     SPI0_MOSI / GPIO10 (PIN 19)
    MISO     SPI0_MISO / GPIO9 (PIN 21)
    SCK     SPI0_SCLK / GPIO11 (PIN 23)
    NSS/Enable     SPI0_CE0_N / GPIO8 (PIN 24)

     

    then, you need develop a dtbo for your device.

     

    156 &spi0 {
    157         status = "okay";
    158 
    159         YOUR_DEVICE@0 {
    160                 compatible = "YOUR_DEVICE";
    161                 reg = <0>;
    162                 spi-max-frequency = <50000000>;
    163         };
    164 };

     

    if your device use an userspace driver, that not need YOUR_DEVICE@0 node.

     

    that all you need to do.

  2. you want to add a 2 pin fan to opi5, unfortunitly, PWM port is IO port, it doesn't have enough power to driver your fan, thus would break the GPIO bank, and make whole bank unfunction.

     

    thus suggest to directly use 5V power pin.

     

    if you have 3 pin fan, you can use a PWM pin to control it speed. in this case, you need write dts code to enable it.

     

  3. you can't use GPIO as power supply for fan, this will break the gpio bank.

     

    you can use GPIO as ON/OFF switch for fan, you should use "gpio-fan" driver.

     

    https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/Documentation/devicetree/bindings/hwmon/gpio-fan.txt?h=v6.7.8

     

    by this you can use /sys/class/thermal/cooling_deviceX/state control you fan, but if you want to system automatically enable your fan at certan temperature,

    you need register the fan as a cooling device, for cpu/gpu or hard driver.

     

    https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/Documentation/devicetree/bindings/thermal/thermal-cooling-devices.yaml

  4. after study,

    I find there 2 way can make mpv work good on RK3288

     

    1,  mpv.conf
     

    Quote

    vo=gpu
    hwdec=auto
    gpu-hwdec-interop=drmprime-overlay

     

    2, mpv.conf

    Quote

    vo=gpu-next
    hwdec=auto

    with a patch:

    diff --git a/filters/f_hwtransfer.c b/filters/f_hwtransfer.c
    index 26b1daaedc..17aaa56ef2 100644
    --- a/filters/f_hwtransfer.c
    +++ b/filters/f_hwtransfer.c
    @@ -348,7 +348,8 @@ static bool probe_formats(struct mp_filter *f, int hw_imgfmt, bool use_conversio
             if (!cstr) {
                 MP_VERBOSE(f, "hwdec '%s' does not report hwframe constraints. "
                               "Using static metadata.\n", cur->driver_name);
    -            cstr = build_static_constraints(cur);
    +            //cstr = build_static_constraints(cur);
    +           continue;
             }
             bool found = false;
             for (int i = 0; cstr->valid_hw_formats &&

     

    recomend is 1.

  5. commit 78285e98f1479ba27d652c9f79329fee5eb1add2
    Author: Philip Langdale <philipl@overt.org>
    Date:   Thu Jun 22 12:43:02 2023 -0700
    
        vo: hwdec: prioritise `drmprime` over `drmprime_overlay`
        
        I originally left `drmprime_overlay` as higher priority because
        `drmprime` was new, and because I didn't have any hardware where both
        worked (only one or the other) so I couldn't compare relative
        performance, and if only one worked, the priority didn't matter.
        
        But with time and more usage, we've reached a point where we can say we
        would recommend using `drmprime` in situations where both work, and
        we've also been able to identify hardware where both do indeed work and
        it seems that `drmprime` is more reliable.
        
        So, let's flip them.
    
    diff --git a/video/out/gpu/hwdec.c b/video/out/gpu/hwdec.c
    index 1e3edb0d8d..878ac148fb 100644
    --- a/video/out/gpu/hwdec.c
    +++ b/video/out/gpu/hwdec.c
    @@ -74,8 +74,8 @@ const struct ra_hwdec_driver *const ra_hwdec_drivers[] = {
         &ra_hwdec_rpi_overlay,
     #endif
     #if HAVE_DRM
    -    &ra_hwdec_drmprime_overlay,
         &ra_hwdec_drmprime,
    +    &ra_hwdec_drmprime_overlay,
     #endif
     #if HAVE_ANDROID_MEDIA_NDK
         &ra_hwdec_aimagereader,

    just let know, when use mpv 0.36 on H3, need revert this patch to make mpv work.

  6. my kernel saves the dts for jianpian.

    Vendor dts for bluetooth

            wireless-bluetooth {
                    pinctrl-names = "default\0rts_gpio";
                    pinctrl-0 = <0x13c>;
                    clock-names = "ext_clock";
                    clocks = <0x138 0x01>;
                    BT,wake_gpio = <0x13a 0x11 0x00>;
                    BT,reset_gpio = <0x13a 0x0f 0x00>;
                    uart_rts_gpios = <0x13a 0x0d 0x01>;
                    compatible = "bluetooth-platdata";
                    BT,wake_host_irq = <0x13a 0x10 0x00>;
                    pinctrl-1 = <0x13d>;
                    status = "okay";
                    phandle = <0x1e7>;
            };

     

    pinctrl-0, pinctrl-1 and uart_rts_gpio are decription for gpio2 RK_PB5, which is uart1 rtsn pin.

    phandle <0x13a> is gpio2.

     

    My mainline dts for bluetooth:

     

    &uart1 {
    	pinctrl-names = "default";
    	pinctrl-0 = <&uart1m0_xfer &uart1m0_ctsn &uart1m0_rtsn>;
    	status = "okay";
    	uart-has-rtscts;
    
    	bluetooth {
    		compatible = "brcm,bcm43438-bt";
    		clocks = <&rk809 1>;
    		clock-names = "lpo";
    		device-wakeup-gpios = <&gpio2 RK_PC1 GPIO_ACTIVE_HIGH>;
    		host-wakeup-gpios = <&gpio2 RK_PC0 GPIO_ACTIVE_HIGH>;
    		shutdown-gpios = <&gpio2 RK_PB7 GPIO_ACTIVE_HIGH>;
    		pinctrl-names = "default";
    		pinctrl-0 = <&bt_host_wake_l &bt_wake_l &bt_enable_h>;
    		vbat-supply = <&vcc3v3_sys>;
    		vddio-supply = <&vcca1v8_pmu>;
    	};
    };

     

    but bluetooth failed:

     

    Quote

    [   14.433949] Bluetooth: hci0: command 0xfc18 tx timeout
    [   22.498017] Bluetooth: hci0: BCM: failed to write update baudrate (-110)
    [   22.498690] Bluetooth: hci0: Failed to set baudrate
    [   24.514009] Bluetooth: hci0: command 0x0c03 tx timeout
    [   32.737999] Bluetooth: hci0: BCM: Reset failed (-110)

     

  7. Quote

    ning@Jianpian:~$ uname -a
    Linux Jianpian 6.5.0-5-arm64 #1 SMP Debian 6.5.13-1 (2023-11-29) aarch64 GNU/Linux

    ning@Jianpian:~$ journalctl -b
    12月 20 15:03:51 Jianpian kernel: Booting Linux on physical CPU 0x0000000000 [0x412fd050]
    12月 20 15:03:51 Jianpian kernel: Linux version 6.5.0-5-arm64 (debian-kernel@lists.debian.org) (gcc-13 (Debian 13.2.0-7) 13.2.0, GNU ld (GN>
    12月 20 15:03:51 Jianpian kernel: KASLR disabled due to lack of seed
    12月 20 15:03:51 Jianpian kernel: Machine model: Rockchip RK3566 JianPian 8G TV Box

    ning@Jianpian:~$ free -m
                   total        used        free      shared  buff/cache   available
    内存:          7689         257        7432           1         150        7431
    交换:             0           0           0

     

    ethernet fixed.

     

    almost done.

  8. a mistake happens in u-boot, I forget to change/add boot device, only MMC1 is boot device, but MMC1 is wifi in dts. MMC2 is emmc.

     

    I have to buy a male-to-male usb cable and a rom. (less than 1RMB together)

     

    when I write the post, I suddenly realize I don't need to buy a rom, I can use RKdevtool to flash the uboot only!!

     

    let m try it when usb cable arrive.

×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines