smaeul / sun20i_d1_spl

Mainline-friendly SPL for D1
33 stars 21 forks source link

How to support the ‘rgbxxxlcd’ #16

Open xiaguangbo opened 1 week ago

xiaguangbo commented 1 week ago

device: lichee rv dock + dock ext. Schematic: https://dl.sipeed.com/shareURL/LICHEE/D1/Lichee_RV-Dock/2_Schematic branch:smaeul/linux d1/all lcd: rgb888 800x480 7'inc

Is it like this? linux/arch/riscv/boot/dts/allwinner/sun20i-d1-lichee-rv-dock.dts add:

&tcon_lcd0 {
    pinctrl-names = "default";
    pinctrl-0 = <&lcd_rgb666_pins>;
}

Where is the resolution and timing written?

This is how the system is built: https://blog.csdn.net/qq_41544116/article/details/139692368

smaeul commented 1 week ago

The devicetree will look something like this: https://github.com/smaeul/linux/commit/e35dc03880dff31ee70ce4b4ee1d978be6053b57

If your panel does not require an initialization sequence, then you can use the panel-dpi binding (https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/display/panel/panel-dpi.yaml). For panel-dpi, the panel node would be a child of the root node.

xiaguangbo commented 1 week ago

@smaeul Thanks ! I found that I couldn't specify .dtb in extlinux.conf, it would get stuck in "Starting kernel..." Every time you modify the device tree, you have to rebuild uboot. Re-burning uboot will destroy some things, resulting in uboot not booting, you have to clear the partition table and flash uboot again How can I get the kernel to start the .dtb specified in extlinux.conf?

xiaguangbo commented 6 days ago

@smaeul XFCE4 、LXDE is installed and is already on the desktop. This is the new device tree, the others are copied from smaeul/linux d1/all. new-sun20i-d1-lichee-rv-dock-ext.dts:

// SPDX-License-Identifier: (GPL-2.0+ or MIT)
// Copyright (C) 2022 Jisheng Zhang <jszhang@kernel.org>
// Copyright (C) 2022 Samuel Holland <samuel@sholland.org>

#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/gpio/gpio.h>

#include "new-sun20i-d1-lichee-rv-dock.dts"

/ {
    model = "Sipeed Lichee RV Dock Ext";
    compatible = "sipeed,lichee-rv-dock-ext", "sipeed,lichee-rv-dock", "sipeed,lichee-rv",
             "allwinner,sun20i-d1";

    backlight: backlight {
        compatible = "pwm-backlight";
        pwms = <&pwm 7 50000 0>;
        power-supply = <&reg_vcc>;
    };

    panel: panel {
        status = "okay";
        compatible = "panel-dpi";
        backlight = <&backlight>;

        panel-timing {
            clock-frequency = <29200000>;

            hsync-len = <48>;
            hactive = <800>;
            hback-porch = <40>;
            hfront-porch = <40>;

            vsync-len = <3>;
            vactive = <480>;
            vback-porch = <29>;
            vfront-porch = <13>;
        };

        port {
            panel_in_tcon_lcd0: endpoint {
                remote-endpoint = <&tcon_lcd0_out_panel>;
            };
        };
    };
};

&de {
    status = "okay";
};

&hdmi {
    status = "disabled";
};

&hdmi_phy {
    status = "disabled";
};

&pwm {
    status = "okay";
    pinctrl-0 = <&pwm7_pd22_pin>;
    pinctrl-names = "default";
};

&tcon_lcd0 {
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&lcd_rgb666_pins>;
};

&tcon_lcd0_out {
    tcon_lcd0_out_panel: endpoint {
        remote-endpoint = <&panel_in_tcon_lcd0>;
    };
};

&i2c2 {
    status = "okay";
    pinctrl-0 = <&i2c2_pb0_pins>;
    pinctrl-names = "default";

    touchscreen@48 {
        reg = <0x48>;
        compatible = "ti,tsc2007";
        interrupt-parent = <&pio>;
        interrupts = <6 14 IRQ_TYPE_EDGE_FALLING>;
        gpios = <&pio 6 14 GPIO_ACTIVE_LOW>; /* PG14 */
        ti,x-plate-ohms = <660>;
        wakeup-source;
    };
};

&i2c2_pb0_pins {
    bias-pull-up;
};

&usb_otg {
    status = "disabled";
};

&usbphy {
    /delete-property/ usb0_id_det-gpios;
    /delete-property/ usb0_vbus_det-gpios;
};
xiaguangbo commented 6 days ago

@smaeul The desktop is not smooth, but the debian image of sipeed is smooth, and the memory usage is about the same, is it because there is no DMA2D, what should I do?