RK3399驱动移植记录

android R(11)

Posted by LXG on November 21, 2022

rockchip-io-domain.txt

kernel/Documentation/devicetree/bindings/power/rockchip-io-domain.txt

支持配置的两种电压1.8v / 3.3v:

  • 寄存器配置成1,一般对应的电压范围是 1.62v ~ 1.98v,typical 电压1.8v;
  • 寄存器配置成0,一般对应的电压范围是 3.00v ~ 3.60v,typical 电压3.3v。

Possible supplies for rk3399:

  • bt656-supply: The supply connected to APIO2_VDD.
  • audio-supply: The supply connected to APIO5_VDD.
  • sdmmc-supply: The supply connected to SDMMC0_VDD.
  • gpio1830-supply: The supply connected to APIO4_VDD.

Possible supplies for rk3399 pmu-domains:

  • pmu1830-supply:The supply connected to PMUIO2_VDD.

RK3399 IO 电源域配置说明

Rockchip_RK3399_Introduction_IO_Power_Domains_Configuration.pdf

Rockchip_Developer_Guide_Linux_IO_DOMAIN_CN.pdf

主控电源域的IO电平要与对接外设芯片的IO电平保持一致,还要注意软件的电压配置要跟硬件的电压一致,否则,最坏的情况可能会导致IO的损坏

修改前


&io_domains {
	status = "okay";

	bt656-supply = <&vcc1v8_dvp>;          // 对应原理图 APIO2_VDD
	audio-supply = <&vcca1v8_codec>;       // 对应原理图 APIO5_VDD
	sdmmc-supply = <&vcc_sd>;              // 对应原理图 SDMMC0_VDD
	gpio1830-supply = <&vcc_3v0>;          // 对应原理图 APIO4_VDD
};

&pmu_io_domains {
	status = "okay";
	pmu1830-supply = <&vcc1v8_pmu>;        // 对应原理图 PMUIO2_VDD
};

查看原理图

rk3399_pmuio

修改后


&io_domains {
	status = "okay";

	bt656-supply = <&vcc1v8_dvp>;
	audio-supply = <&vcca1v8_codec>;
	sdmmc-supply = <&vcc_sd>;
	gpio1830-supply = <&vcc_3v0>;
};

&pmu_io_domains {
	status = "okay";
	pmu1830-supply = <&vcc_3v0>;  // 此处需要修改
};

分区问题

Rockchip_Introduction_Partition_CN.pdf

Rockchip android系统平台使用parameter文件来配置一些系统参数,比如固件版本,存储器分区信息等。

  • Parameter文件是非常重要的系统配置文件,最好在能了解清楚各个配置功能时再做修改,避免出现
  • parameter文件配置异常造成系统不能正常工作的问题。
  • Parameter文件大小有限制,最大不能超过64KB。

parameter.txt


FIRMWARE_VER: 11.0
MACHINE_MODEL: RXE11
MACHINE_ID: 007
MANUFACTURER: WIF
MAGIC: 0x5041524B
ATAG: 0x00200800
MACHINE: rk3399_Android11
CHECK_MASK: 0x80
PWR_HLD: 0,0,A,0,1
TYPE: GPT
CMDLINE:mtdparts=rk29xxnand:0x00002000@0x00002000(security),0x00002000@0x00004000(uboot),0x00002000@0x00006000(trust),0x00002000@0x00008000(misc),0x00002000@0x0000a000(dtbo),0x00000800@0x0000c000(vbmeta),0x00014000@0x0000c800(boot),0x00037000@0x00020800(recovery),0x000c0000@0x00057800(backup),0x000c0000@0x00117800(cache),0x00008000@0x001d7800(metadata),0x00000800@0x001df800(baseparameter),0x00614000@0x001e0000(super),-@0x007f4000(userdata:grow)

刷机工具分区表回读

rockchip_partions

0x00002000@0x00008000(boot),@符号之前的数值是分区大小,@符号之后的数值是分区的起始位置,括号里面的字符是分区的名字。所有数值的单位是 sector ,1个 sector 为512Bytes.上例中,boot分区起始位置为0x8000 sectors位置,大小为0x2000 sectors(4MB).

分区说明

rockchip_partition

找不到分区无法开机问题日志

[    1.078180] Run /init as init process
[    1.087832] init: init first stage started!
[    1.087978] init: Unable to open /lib/modules, skipping module loading.
[    1.088994] init: Using Android DT directory /proc/device-tree/firmware/android/
[    1.183639] init: bool android::init::BlockDevInitializer::InitDevices(std::set<std::string>): partition(s) not found in /sys, waiting for their uevent(s): system, vendor
[   11.184889] init: Wait for partitions returned after 10001ms
[   11.184986] init: bool android::init::BlockDevInitializer::InitDevices(std::set<std::string>): partition(s) not found after polling timeout: system, vendor
[   11.185141] init: Failed to mount required partitions early ...
[   11.186059] init: InitFatalReboot: signal 6
[   11.202144] init: #00 pc 0000000000304068  /init (UnwindStackCurrent::UnwindFromContext(unsigned long, void*)+96)
[   11.202197] init: #01 pc 0000000000274ed8  /init (android::init::InitFatalReboot(int)+208)
[   11.202218] init: #02 pc 00000000002752c0  /init (android::init::InstallRebootSignalHandlers()::$_22::__invoke(int)+32)
[   11.202237] init: #03 pc 00000000000005c0  [vdso:0000007f87396000] (__kernel_rt_sigreturn)
[   11.202254] init: #04 pc 0000000000378ba0  /init (abort+176)
[   11.202271] init: #05 pc 0000000000277c44  /init (android::init::InitAborter(char const*)+44)

修改方案

删除驱动中firmware_android fstab的配置,同时需要重新编译整个项目


/*
&firmware_android {
	compatible = "android,firmware";
	fstab {
		compatible = "android,fstab";
		system {
			compatible = "android,system";
			dev = "/dev/block/by-name/system";
			type = "ext4";
			mnt_flags = "ro,barrier=1,inode_readahead_blks=8";
			fsmgr_flags = "wait,verify";
		};
		vendor {
			compatible = "android,vendor";
			dev = "/dev/block/by-name/vendor";
			type = "ext4";
			mnt_flags = "ro,barrier=1,inode_readahead_blks=8";
			fsmgr_flags = "wait,verify";
		};
	};
};
*/

USB OTG 配置

Rockchip_RK3399_Developer_Guide_USB_CN.pdf

Rockchip_Developer_Guide_Linux_USB_Initialization_Log_Analysis_CN_V1.1.1.pdf

在 Linux 系统中,提供了主机侧和设备侧视角的 USB 驱动框架及通用驱动程序。

  • 主机侧分为 USB Core、HOST 控制器驱动, HUB 驱动和各设备类驱动。
  • 设备侧分为 Gadget 框架、Devices 控制器驱动和各设备类 Function 驱动。

主机侧和设备侧日志


// 注册 USB 文件系统,系统正常启动后,对应生成/sys/bus/usb/目录
[    0.105910] usbcore: registered new interface driver usbfs
// 表示成功注册 USB HUB 驱动
[    0.105955] usbcore: registered new interface driver hub
// 表明注册 USB 通用设备驱动 即 usb_generic_driver
[    0.105995] usbcore: registered new device driver usb

通常 USB 设备都是以设备的身份先与 usb_generic_driver 匹配,成功之后,会分裂出接口,当对接口调用 device_add()后,会引起接口和接口驱动的匹配


[    0.317949] usbcore: registered new interface driver catc
[    0.317986] usbcore: registered new interface driver kaweth
[    0.317998] pegasus: v0.9.3 (2013/04/25), Pegasus/Pegasus II USB Ethernet driver
[    0.318032] usbcore: registered new interface driver pegasus
[    0.318067] usbcore: registered new interface driver rtl8150
[    0.318112] usbcore: registered new interface driver r8152
[    0.318125] hso: drivers/net/usb/hso.c: Option Wireless
[    0.318175] usbcore: registered new interface driver hso
[    0.318213] usbcore: registered new interface driver asix
[    0.318250] usbcore: registered new interface driver ax88179_178a
[    0.318286] usbcore: registered new interface driver cdc_ether
[    0.318321] usbcore: registered new interface driver cdc_eem
[    0.318355] usbcore: registered new interface driver dm9601
[    0.318395] usbcore: registered new interface driver smsc75xx
[    0.318432] usbcore: registered new interface driver smsc95xx
[    0.318467] usbcore: registered new interface driver gl620a
[    0.318502] usbcore: registered new interface driver net1080
[    0.318536] usbcore: registered new interface driver plusb
[    0.318572] usbcore: registered new interface driver rndis_host
[    0.318608] usbcore: registered new interface driver cdc_subset
[    0.318654] usbcore: registered new interface driver zaurus
[    0.318691] usbcore: registered new interface driver MOSCHIP usb-ethernet driver
[    0.318729] usbcore: registered new interface driver int51x1
[    0.318768] usbcore: registered new interface driver kalmia
[    0.318803] usbcore: registered new interface driver ipheth
[    0.318838] usbcore: registered new interface driver sierra_net
[    0.318874] usbcore: registered new interface driver cx82310_eth
[    0.318909] usbcore: registered new interface driver cdc_ncm
[    0.318959] usbcore: registered new interface driver qmi_wwan
[    0.318994] usbcore: registered new interface driver cdc_mbim

上面为主机侧设备类驱动,即各个 USB 设备 HOST 端的驱动程序,可通过 menuconfig 进行配置。


[    0.319913] dwc3 fe800000.dwc3: Failed to get clk 'ref': -2
[    0.320813] dwc3 fe900000.dwc3: Failed to get clk 'ref': -2

Host 控制器驱动 EHCI
[    0.322000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.322011] ehci-pci: EHCI PCI platform driver
[    0.322061] ehci-platform: EHCI generic platform driver

Host 控制器驱动 OHCI
[    0.322488] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    0.322505] ohci-platform: OHCI generic platform driver


[    0.323293] usbcore: registered new interface driver cdc_acm
[    0.323309] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[    0.323352] usbcore: registered new interface driver usblp
[    0.323390] usbcore: registered new interface driver cdc_wdm
[    0.323560] usbcore: registered new interface driver uas
[    0.323605] usbcore: registered new interface driver usb-storage
[    0.323640] usbcore: registered new interface driver ums-alauda
[    0.323674] usbcore: registered new interface driver ums-cypress
[    0.323703] usbcore: registered new interface driver ums-datafab
[    0.323739] usbcore: registered new interface driver ums_eneub6250
[    0.323773] usbcore: registered new interface driver ums-freecom
[    0.323807] usbcore: registered new interface driver ums-isd200
[    0.323841] usbcore: registered new interface driver ums-jumpshot
[    0.323874] usbcore: registered new interface driver ums-karma
[    0.323911] usbcore: registered new interface driver ums-onetouch
[    0.323939] usbcore: registered new interface driver ums-sddr09
[    0.323973] usbcore: registered new interface driver ums-sddr55
[    0.324009] usbcore: registered new interface driver ums-usbat
[    0.324079] usbcore: registered new interface driver usbserial_generic
[    0.324105] usbserial: USB Serial support registered for generic
[    0.324140] usbcore: registered new interface driver option
[    0.324165] usbserial: USB Serial support registered for GSM modem (1-port)
[    0.324196] usbcore: registered new interface driver trancevibrator
[    0.324500] usbcore: registered new interface driver xpad
[    0.324543] usbcore: registered new interface driver usb_acecad
[    0.324579] usbcore: registered new interface driver aiptek
[    0.324617] usbcore: registered new interface driver gtco
[    0.324654] usbcore: registered new interface driver hanwang
[    0.324689] usbcore: registered new interface driver kbtab

[    0.327417] fusb302 6-0022: Can't get property of role, set role to default DRP
[    0.330473] fusb302 6-0022: port 0 probe success with role ROLE_MODE_DRP, try_role ROLE_MODE_NONE
[    0.330584] input: Typec_Headphone as /devices/platform/ff150000.i2c/i2c-6/6-0022/input/input0
[    0.331618] fusb302 0-0022: Can't get property of role, set role to default DRP
[    0.334631] fusb302 0-0022: port 1 probe success with role ROLE_MODE_DRP, try_role ROLE_MODE_NONE

[    0.458233] usbcore: registered new interface driver uvcvideo
[    0.458248] USB Video Class driver (1.1.1)

[    0.588821] usbcore: registered new interface driver usbhid
[    0.588836] usbhid: USB HID core driver
[    0.595668] usbcore: registered new interface driver snd-usb-audio
[    0.637044] phy phy-ff770000.syscon:usb2-phy@e450.1: Linked as a consumer to regulator.2
[    0.637638] phy phy-ff770000.syscon:usb2-phy@e450.2: No vbus specified for otg port
[    0.639223] phy phy-ff770000.syscon:usb2-phy@e460.3: Linked as a consumer to regulator.2
[    0.639773] phy phy-ff770000.syscon:usb2-phy@e460.4: No vbus specified for otg port


[    0.674873] dwc3 fe800000.dwc3: Failed to get clk 'ref': -2
[    0.682851] dwc3 fe900000.dwc3: Failed to get clk 'ref': -2


DWC3 Host 集成 XHCI 控制器,上述为 XHCI 控制器初始化完整打印,从 log 可以获取到如下信息:
控制器基本信息,包括中断号、设备虚拟地址、控制器版本等信息
[    0.686695] xhci-hcd xhci-hcd.1.auto: xHCI Host Controller
[    0.686938] xhci-hcd xhci-hcd.1.auto: new USB bus registered, assigned bus number 1
[    0.687419] xhci-hcd xhci-hcd.1.auto: hcc params 0x0220fe64 hci version 0x110 quirks 0x0000009002030010
[    0.687480] xhci-hcd xhci-hcd.1.auto: irq 65, io mem 0xfe900000
[    0.687764] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 4.19
[    0.687777] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.687787] usb usb1: Product: xHCI Host Controller
[    0.687797] usb usb1: Manufacturer: Linux 4.19.232 xhci-hcd
[    0.687807] usb usb1: SerialNumber: xhci-hcd.1.auto

XHCI 控制器分别被枚举为一个 USB3.0 Root HUB (hub 2-0:1.0)和一个 USB2.0 Root HUB (hub 1-0:1.0),同时也可以看出两个 HUB 被分配到的 BUS Number
[    0.688208] hub 1-0:1.0: USB hub found
[    0.688239] hub 1-0:1.0: 1 port detected
[    0.688445] xhci-hcd xhci-hcd.1.auto: xHCI Host Controller
[    0.688552] xhci-hcd xhci-hcd.1.auto: new USB bus registered, assigned bus number 2
[    0.688571] xhci-hcd xhci-hcd.1.auto: Host supports USB 3.0 SuperSpeed
[    0.688627] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[    0.688714] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 4.19
[    0.688726] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.688736] usb usb2: Product: xHCI Host Controller
[    0.688746] usb usb2: Manufacturer: Linux 4.19.232 xhci-hcd
[    0.688756] usb usb2: SerialNumber: xhci-hcd.1.auto
[    0.689012] hub 2-0:1.0: USB hub found
[    0.689039] hub 2-0:1.0: 1 port detected

Host 控制器驱动 EHCI
控制器基本信息,包括中断号、设备虚拟地址、控制器驱动版本等信息
[    0.692703] ehci-platform fe380000.usb: EHCI Host Controller
[    0.692996] ehci-platform fe380000.usb: new USB bus registered, assigned bus number 3
[    0.693391] ehci-platform fe380000.usb: irq 28, io mem 0xfe380000
[    0.706131] ehci-platform fe380000.usb: USB 2.0 started, EHCI 1.00
[    0.706360] usb usb3: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 4.19
[    0.706387] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.706408] usb usb3: Product: EHCI Host Controller
[    0.706425] usb usb3: Manufacturer: Linux 4.19.232 ehci_hcd
[    0.706442] usb usb3: SerialNumber: fe380000.usb
EHCI 控制器被枚举为一个 USB2.0 Root HUB (hub 3-0:1.0),同时也可以看出该 HUB 被分配的BUS Number (3)。
[    0.706928] hub 3-0:1.0: USB hub found
[    0.706969] hub 3-0:1.0: 1 port detected


[    0.709366] ehci-platform fe3c0000.usb: EHCI Host Controller
[    0.709587] ehci-platform fe3c0000.usb: new USB bus registered, assigned bus number 4
[    0.709934] ehci-platform fe3c0000.usb: irq 30, io mem 0xfe3c0000
[    0.722633] ehci-platform fe3c0000.usb: USB 2.0 started, EHCI 1.00
[    0.722773] usb usb4: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 4.19
[    0.722793] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.722812] usb usb4: Product: EHCI Host Controller
[    0.722829] usb usb4: Manufacturer: Linux 4.19.232 ehci_hcd
[    0.722845] usb usb4: SerialNumber: fe3c0000.usb
EHCI 控制器被枚举为一个 USB2.0 Root HUB (hub 4-0:1.0),同时也可以看出该 HUB 被分配的BUS Number (4)。
[    0.723299] hub 4-0:1.0: USB hub found
[    0.723336] hub 4-0:1.0: 1 port detected

OHCI 控制器初始化完整打印
控制器基本信息,包括中断号、设备虚拟地址、控制器驱动版本等信息
[    0.723964] ohci-platform fe3a0000.usb: Generic Platform OHCI controller
[    0.724263] ohci-platform fe3a0000.usb: new USB bus registered, assigned bus number 5
[    0.724587] ohci-platform fe3a0000.usb: irq 29, io mem 0xfe3a0000
[    0.746744] vendor storage:20190527 ret = 0
[    0.783859] usb usb5: New USB device found, idVendor=1d6b, idProduct=0001, bcdDevice= 4.19
[    0.783952] usb usb5: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.783976] usb usb5: Product: Generic Platform OHCI controller
[    0.783999] usb usb5: Manufacturer: Linux 4.19.232 ohci_hcd
[    0.784020] usb usb5: SerialNumber: fe3a0000.usb

OHCI 控制器被枚举为一个 USB1.1 Root HUB (hub 5-0:1.0),同时也可以看出该 HUB 被分配的BUS Number (5)。
[    0.785201] hub 5-0:1.0: USB hub found
[    0.785341] hub 5-0:1.0: 1 port detected


[    0.786862] ohci-platform fe3e0000.usb: Generic Platform OHCI controller
[    0.787411] ohci-platform fe3e0000.usb: new USB bus registered, assigned bus number 6
[    0.787962] ohci-platform fe3e0000.usb: irq 31, io mem 0xfe3e0000
[    0.847330] usb usb6: New USB device found, idVendor=1d6b, idProduct=0001, bcdDevice= 4.19
[    0.847422] usb usb6: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.847447] usb usb6: Product: Generic Platform OHCI controller
[    0.847469] usb usb6: Manufacturer: Linux 4.19.232 ohci_hcd
[    0.847491] usb usb6: SerialNumber: fe3e0000.usb

OHCI 控制器被枚举为一个 USB1.1 Root HUB (hub 6-0:1.0),同时也可以看出该 HUB 被分配的BUS Number (6)。
[    0.848689] hub 6-0:1.0: USB hub found
[    0.848814] hub 6-0:1.0: 1 port detected

设备侧日志

目前,Rockchip SoC 除 RK3399 芯片外,其它芯片都是集成 DWC2 OTG IP,RK3399 集成 DWC3 OTG IP,支持 USB3.0,所以设备侧 log 分 dwc2 和 dwc3 阐述。 Kernel 4.4,DWC2 使用 drivers/usb/dwc2 目录驱动; DWC3 使用 drivers/usb/dwc3 目录驱动。


[    0.327417] fusb302 6-0022: Can't get property of role, set role to default DRP
[    0.330473] fusb302 6-0022: port 0 probe success with role ROLE_MODE_DRP, try_role ROLE_MODE_NONE
[    0.330584] input: Typec_Headphone as /devices/platform/ff150000.i2c/i2c-6/6-0022/input/input0
[    0.331618] fusb302 0-0022: Can't get property of role, set role to default DRP
[    0.334631] fusb302 0-0022: port 1 probe success with role ROLE_MODE_DRP, try_role ROLE_MODE_NONE

RK3399 USB支持情况

  • RK3399 支持两个Type-C USB 3.0和两个 USB 2.0 Host
  • 两个 Type-C USB 3.0 控制器硬件都可以支持 OTG(USBPeripheral 和 USB Host),并且向下兼容 USB2.0/1.1/1.0
  • Type-C USB 3.0 可以根据实际的应用需求,将物理接口简化设计为 Type-A USB 3.0/2.0,Micro USB 3.0/2.0 等多种接口类型,内核 USB驱动已经兼容这几种不同类型的 USB 接口,只需要根据实际的硬件设计修改对应的板级 DTS 配置,就可以使能相应的 USB 接口。

RK3399 SDK DTS 的默认配置,支持 Type-C0 USB 3.0 OTG 功能,Type-C1 USB 3.0 Host 功能。DTS的配置主要包括 DWC3 控制器、Type-C USB 3.0 PHY 以及 USB 2.0 PHY。

U-boot 操作GPIO

android 7 修改方案


static int my_set_gpio(void)
{
        // DC5V_2_EN
        gpio_direction_output((GPIO_BANK1 | GPIO_C7), 1);
}


static init_fnc_t init_sequence_f[] = {
        ------------------------------------
        my_set_gpio,
        NULL,
};

android 11 修改方案

rk3399-evb.dtsi


	dc5v_en: dc-5v-regulator {
		compatible = "regulator-fixed";
		pinctrl-names = "default";
		pinctrl-0 = <&dc5v_gpio>;
		regulator-name = "dc5v_en";
		regulator-always-on;
	};

&pinctrl {

	usb5v-gpio {
		usb5v_gpio: usb5v-gpio {
			rockchip,pins = <1 RK_PC7 RK_FUNC_GPIO &pcfg_output_high>;
		};
	};

}

EDP 屏幕有背光无图像

Rockchip_Developer_Guide_DRM_Panel_Porting_CN.pdf

Rockchip_RK3588_User_Guide_DP_CN.pdf

Rockchip_Developer_Guide_DRM_Display_Driver_CN.pdf

adb shell cat /sys/kernel/debug/dri/0/summary

Android 7 正常信息


VOP [ff900000.vop]: ACTIVE
    Connector: eDP
	overlay_mode[0] bus_format[1009] output_mode[f] color_space[0]
    Display mode: 1366x768p59
	clk[76300] real_clk[76300] type[8] flag[a]
	H: 1366 1446 1486 1592
	V: 768 778 788 808
    win0-0: DISABLED
    win1-0: DISABLED
    win2-0: ACTIVE
	format: XB24 little-endian (0x34324258) SDR[0] color_space[0]
	csc: y2r[0] r2r[0] r2y[0] csc mode[0]
	zpos: 0
	src: pos[0x598] rect[1366x768]
	dst: pos[0x0] rect[1366x768]
	buf[0]: addr: 0x0000000003a54000 pitch: 5504 offset: 0
    win2-1: DISABLED
    win2-2: DISABLED
    win2-3: DISABLED
    win3-0: ACTIVE
	format: AB24 little-endian (0x34324241) SDR[0] color_space[0]
	csc: y2r[0] r2r[0] r2y[0] csc mode[0]
	zpos: 1
	src: pos[0x0] rect[1366x768]
	dst: pos[0x0] rect[1366x768]
	buf[0]: addr: 0x0000000004d83000 pitch: 5504 offset: 0
    win3-1: DISABLED
    win3-2: DISABLED
    win3-3: DISABLED
    post: sdr2hdr[0] hdr2sdr[0]
    pre : sdr2hdr[0]
    post CSC: r2y[0] y2r[0] CSC mode[1]
VOP [ff8f0000.vop]: DISABLED


Android 11 异常信息


VOP [ff8f0000.vop]: DISABLED
VOP [ff900000.vop]: ACTIVE
    Connector: eDP
	bus_format[100a]: RGB888_1X24
	overlay_mode[0] output_mode[f] color_space[0]
    Display mode: 1536x2048p60
	clk[200000] real_clk[200000] type[48] flag[a]
	H: 1536 1548 1564 1612
	V: 2048 2056 2060 2068
    win0-0: ACTIVE
	format: AB24 little-endian (0x34324241)[AFBC] SDR[0] color_space[0]
	csc: y2r[0] r2r[0] r2y[0] csc mode[0]
	zpos: 0
	src: pos[0x0] rect[1536x2048]
	dst: pos[0x0] rect[1536x2048]
	buf[0]: addr: 0x00000000034dd000 pitch: 6144 offset: 0
    win1-0: DISABLED
    win2-0: DISABLED
    win2-1: DISABLED
    win2-2: DISABLED
    win2-3: DISABLED
    win3-0: DISABLED
    win3-1: DISABLED
    win3-2: DISABLED
    win3-3: DISABLED
    post: sdr2hdr[0] hdr2sdr[0]
    pre : sdr2hdr[0]
    post CSC: r2y[0] y2r[0] CSC mode[1]

修改方案


&edp {
	force-hpd;
	status = "okay";

	ports {
		edp_out: port@1 {
			reg = <1>;
			#address-cells = <1>;
			#size-cells = <0>;

			edp_out_panel: endpoint@0 {
				reg = <0>;
				remote-endpoint = <&panel_in_edp>;
			};
		};
	};
};

&edp_panel {
	status = "okay";
	compatible = "simple-panel";
	backlight = <&backlight>;
	enable-gpios = <&gpio4 21 GPIO_ACTIVE_HIGH>;
        prepare-delay-ms = <200>;
	enable-delay-ms = <20>;
	power-supply = <&vcc_lcd>;
	bus_format = <MEDIA_BUS_FMT_RGB666_1X18>;

	edp_disp_timings: display-timings {
		native-mode = <&timing2>;

		timing2: timing2 {
			clock-frequency = <76300000>;
			hactive = <1366>;
			vactive = <768>;
			hfront-porch = <80>;
			hsync-len = <40>;
			hback-porch = <106>;
			vfront-porch = <10>;
			vsync-len = <10>;
			vback-porch = <20>;
			hsync-active = <0>;
			vsync-active = <0>;
			de-active = <0>;
			pixelclk-active = <0>;

		};
	};
};

&pwm1 {
        status = "okay";
};

&backlight {
	status = "okay";
	pwms = <&pwm1 0 25000 0>;
	enable-gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>;
};

&route_edp {
	status = "okay";
	connect = <&vopb_out_edp>;
};

&edp_in_vopb {
	status = "okay";
};
&edp_in_vopl {
	status = "disabled";
};

&hdmi {
	status = "okay";
};

&hdmi_in_vopb {
	status = "disabled";
};

&hdmi_in_vopl {
	status = "okay";
};

&route_hdmi {
	status = "okay";
	connect = <&vopl_out_hdmi>;
};

&vopb {
	assigned-clocks = <&cru DCLK_VOP0_DIV>;
	assigned-clock-parents = <&cru PLL_CPLL>;
};

&vopl {
	assigned-clocks = <&cru DCLK_VOP1_DIV>;
	assigned-clock-parents = <&cru PLL_VPLL>;
};