您尚未登录。

楼主 # 2021-12-17 16:31:01

Crystal
会员
注册时间: 2020-11-25
已发帖子: 3
积分: 3

D1s调试lvds,求解?

lvds2link_pins_a 和 lvds2link_pins_b Dual link LVDS 接口管脚定义(主显 lcd0)
这个是手册上给的管脚定义,但是定义中没有这两个。要如何定义

离线

#1 2021-12-17 16:51:16

哇酷小二
管理员
所在地: 你猜
注册时间: 2020-04-22
已发帖子: 3,386
积分: 1902
个人网站

Re: D1s调试lvds,求解?

lichee/linux-5.4/arch/riscv/boot/dts/sunxi/sun20iw1p1.dtsi

                        lvds0_pins_a: lvds0@0 {
                                pins  = "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9";
                                function = "lvds0";
                                drive-strength = <30>;
                                bias-disable;
                        };

                        lvds0_pins_b: lvds0@1 {
                                pins  = "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9";
                                function = "io_disabled";
                                drive-strength = <30>;
                                bias-disable;
                        };




离线

楼主 #2 2021-12-17 16:54:25

Crystal
会员
注册时间: 2020-11-25
已发帖子: 3
积分: 3

Re: D1s调试lvds,求解?

@哇酷小二
这个是signal link的配置,我想用double link

离线

#3 2021-12-17 17:07:58

哇酷小二
管理员
所在地: 你猜
注册时间: 2020-04-22
已发帖子: 3,386
积分: 1902
个人网站

Re: D1s调试lvds,求解?

                        lcd1_lvds2link_pins_a: lcd1_lvds2link@0 {
                                pins = "PJ10", "PJ11", "PJ12", "PJ13", "PJ14", "PJ15", "PJ16", "PJ17", "PJ18", "PJ19", \
                                "PJ7", "PJ6", "PJ5", "PJ4", "PJ3", "PJ2", "PJ1", "PJ0", "PJ8", "PJ9";
                                function = "lvds3";
                                drive-strength = <30>;
                        };

                        lcd1_lvds2link_pins_b: lcd1_lvds2link@1 {
                                pins = "PJ10", "PJ11", "PJ12", "PJ13", "PJ14", "PJ15", "PJ16", "PJ17", "PJ18", "PJ19", \
                                "PJ7", "PJ6", "PJ5", "PJ4", "PJ3", "PJ2", "PJ1", "PJ0", "PJ8", "PJ9";
                                function = "gpio_in";
                        };

                        lvds2link_pins_a: lvds2link@0 {
                                pins = "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD8", "PD9", "PD6", "PD7", \
                                "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PD18", "PD19", "PD16", "PD17";
                                function = "lvds2link";
                                drive-strength = <30>;
                        };
                        lvds2link_pins_b: lvds2link@1 {
                                pins = "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD8", "PD9", "PD6", "PD7", \
                                "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PD18", "PD19", "PD16", "PD17";
                                function = "gpio_in";
                        };

别的soc sdk抄来的,将就看看。





离线

#4 2024-05-16 11:55:10

ghosoft
会员
注册时间: 2020-02-16
已发帖子: 31
积分: 10.5

Re: D1s调试lvds,求解?

Crystal 说:

@哇酷小二
这个是signal link的配置,我想用double link

后来成功了么

离线

#5 2024-06-27 15:37:22

ghosoft
会员
注册时间: 2020-02-16
已发帖子: 31
积分: 10.5

Re: D1s调试lvds,求解?

@哇酷小二
function = lvds2link
看起来驱动里边没有定义这个function
导致pd0到pd19全都UNCLAIMED
麻烦看看应该怎么改

离线

#6 2024-06-27 15:55:11

晕哥
管理员
注册时间: 2017-09-06
已发帖子: 9,339
积分: 9202

Re: D1s调试lvds,求解?

找一下哪个文件参与编译 find . -name pinctrl-sun*.o

然后直接那个 .c 文件





离线

#7 2024-06-27 16:05:25

ghosoft
会员
注册时间: 2020-02-16
已发帖子: 31
积分: 10.5

Re: D1s调试lvds,求解?

晕哥 说:

找一下哪个文件参与编译 find . -name pinctrl-sun*.o

然后直接那个 .c 文件

找到了,

ao@ubuntu:~/DongshanNezhaSTU-TinaV2.0-SDK/tina-d1-h$ find . -name pinctrl-sun*.o
./lichee/linux-5.4/drivers/pinctrl/sunxi/pinctrl-sun8iw20.o
./lichee/linux-5.4/drivers/pinctrl/sunxi/pinctrl-sunxi.o

这里没有lvds2link, 是不是这个芯片不可以双8

/* PD */
	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 0),
		SUNXI_FUNCTION(0x0, "gpio_in"),
		SUNXI_FUNCTION(0x1, "gpio_out"),
		SUNXI_FUNCTION(0x2, "lcd0"),		/* D2 */
		SUNXI_FUNCTION(0x3, "lvds0"),		/* V0P */
		SUNXI_FUNCTION(0x4, "dsi"),		/* D0P */
		SUNXI_FUNCTION(0x5, "twi0"),		/* SCK */
		SUNXI_FUNCTION_IRQ_BANK(0xE, 2, 0),
		SUNXI_FUNCTION(0xF, "io_disabled")),
	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 1),
		SUNXI_FUNCTION(0x0, "gpio_in"),
		SUNXI_FUNCTION(0x1, "gpio_out"),
		SUNXI_FUNCTION(0x2, "lcd0"),		/* D3 */
		SUNXI_FUNCTION(0x3, "lvds0"),		/* V0N */
		SUNXI_FUNCTION(0x4, "dsi"),		/* D0N */
		SUNXI_FUNCTION(0x5, "uart2"),		/* TX */
		SUNXI_FUNCTION_IRQ_BANK(0xE, 2, 1),
		SUNXI_FUNCTION(0xF, "io_disabled")),

最近编辑记录 ghosoft (2024-06-27 16:07:17)

离线

#8 2024-06-27 16:46:42

晕哥
管理员
注册时间: 2017-09-06
已发帖子: 9,339
积分: 9202

Re: D1s调试lvds,求解?

参考这个帖子:d1 lvds dual

首先在dts中配置lvds1的gpio,大致是下面这样的

			lvds1_pins_a: lvds1@0 {
				pins  = "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PD16", "PD17", "PD18", "PD19";
				function = "lvds1";
				drive-strength = <30>;
				bias-disable;
			};

			lvds1_pins_b: lvds1@1 {
				pins  = "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PD16", "PD17", "PD18", "PD19";
				function = "io_disabled";
				drive-strength = <30>;
				bias-disable;
			};

然后在dts中配置dual lvds,主要是lcd_lvds_if与pinctrl-0

&lcd0 {
	lcd_used            = <1>;

	lcd_driver_name     = "default_lcd";
	lcd_backlight       = <50>;
	lcd_if              = <3>;

	lcd_x               = <640>;
	lcd_y               = <2560>;
	lcd_width           = <150>;
	lcd_height          = <94>;
	lcd_dclk_freq       = <117>;

	lcd_pwm_used        = <0>;
	lcd_pwm_ch          = <7>;
	lcd_pwm_freq        = <50000>;
	lcd_pwm_pol         = <1>;
	lcd_pwm_max_limit   = <255>;
 
	lcd_hbp             = <40>;
	lcd_ht              = <720>;
	lcd_hspw            = <20>;
	lcd_vbp             = <20>;
	lcd_vt              = <2600>;
	lcd_vspw            = <10>;
	
	lcd_lvds_if         = <1>;
	lcd_lvds_colordepth = <0>;	
	lcd_lvds_mode       = <0>;
	lcd_frm             = <0>;
	lcd_hv_clk_phase    = <0>;
	lcd_hv_sync_polarity= <0>;
	lcd_gamma_en        = <0>;
	lcd_bright_curve_en = <0>;
	lcd_cmap_en         = <0>;

	deu_mode            = <0>;
	lcdgamma4iep        = <22>;
	smart_color         = <90>;
	
        pinctrl-0 = <&lvds0_pins_a &lvds1_pins_a>;
        pinctrl-1 = <&lvds0_pins_b &lvds1_pins_b>;	
  
};

把20条腿都复用为LVDS:
        pinctrl-0 = <&lvds0_pins_a &lvds1_pins_a>;


驱动配置为双8:
    lcd_lvds_if         = <1>;

Linux启动后查看引脚复用状态:

# cat /sys/kernel/debug/pinctrl/pio/pinmux-pins
Pinmux settings per pin
Format: pin (name): mux_owner|gpio_owner (strict) hog?
pin 32 (PB0): device 2502800.twi function gpio_in group PB0
pin 33 (PB1): device 2502800.twi function gpio_in group PB1
pin 34 (PB2): UNCLAIMED
pin 35 (PB3): UNCLAIMED
pin 36 (PB4): UNCLAIMED
pin 37 (PB5): UNCLAIMED
pin 38 (PB6): UNCLAIMED
pin 39 (PB7): UNCLAIMED
pin 40 (PB8): device 2500000.uart function uart0 group PB8
pin 41 (PB9): device 2500000.uart function uart0 group PB9
pin 42 (PB10): GPIO pio:42
pin 43 (PB11): GPIO pio:43
pin 44 (PB12): GPIO pio:44
pin 64 (PC0): device 2008000.ledc function ledc group PC0
pin 65 (PC1): UNCLAIMED
pin 66 (PC2): device 4025000.spi function spi0 group PC2
pin 67 (PC3): device 4025000.spi function spi0 group PC3
pin 68 (PC4): device 4025000.spi function spi0 group PC4
pin 69 (PC5): device 4025000.spi function spi0 group PC5
pin 70 (PC6): device 4025000.spi function spi0 group PC6
pin 71 (PC7): device 4025000.spi function spi0 group PC7
pin 96 (PD0): UNCLAIMED
pin 97 (PD1): UNCLAIMED
pin 98 (PD2): UNCLAIMED
pin 99 (PD3): UNCLAIMED
pin 100 (PD4): UNCLAIMED
pin 101 (PD5): UNCLAIMED
pin 102 (PD6): UNCLAIMED
pin 103 (PD7): UNCLAIMED
pin 104 (PD8): UNCLAIMED
pin 105 (PD9): UNCLAIMED
pin 106 (PD10): UNCLAIMED
pin 107 (PD11): UNCLAIMED
pin 108 (PD12): UNCLAIMED
pin 109 (PD13): UNCLAIMED
pin 110 (PD14): UNCLAIMED
pin 111 (PD15): UNCLAIMED
pin 112 (PD16): UNCLAIMED
pin 113 (PD17): UNCLAIMED
pin 114 (PD18): UNCLAIMED
pin 115 (PD19): UNCLAIMED
pin 116 (PD20): UNCLAIMED
pin 117 (PD21): UNCLAIMED
pin 118 (PD22): UNCLAIMED
pin 128 (PE0): device 4500000.eth function gmac0 group PE0
pin 129 (PE1): device 4500000.eth function gmac0 group PE1
pin 130 (PE2): device 4500000.eth function gmac0 group PE2
pin 131 (PE3): device 4500000.eth function gmac0 group PE3
pin 132 (PE4): device 4500000.eth function gmac0 group PE4
pin 133 (PE5): device 4500000.eth function gmac0 group PE5
pin 134 (PE6): device 4500000.eth function gmac0 group PE6
pin 135 (PE7): device 4500000.eth function gmac0 group PE7
pin 136 (PE8): device 4500000.eth function gmac0 group PE8
pin 137 (PE9): device 4500000.eth function gmac0 group PE9
pin 138 (PE10): device 4500000.eth function gmac0 group PE10
pin 139 (PE11): device 4500000.eth function gmac0 group PE11
pin 140 (PE12): device 4500000.eth function gmac0 group PE12
pin 141 (PE13): device 4500000.eth function gmac0 group PE13
pin 142 (PE14): device 4500000.eth function gmac0 group PE14
pin 143 (PE15): device 4500000.eth function gmac0 group PE15
pin 144 (PE16): GPIO pio:144
pin 145 (PE17): UNCLAIMED
pin 160 (PF0): device 4020000.sdmmc function sdc0 group PF0
pin 161 (PF1): device 4020000.sdmmc function sdc0 group PF1
pin 162 (PF2): device 4020000.sdmmc function sdc0 group PF2
pin 163 (PF3): device 4020000.sdmmc function sdc0 group PF3
pin 164 (PF4): device 4020000.sdmmc function sdc0 group PF4
pin 165 (PF5): device 4020000.sdmmc function sdc0 group PF5
pin 166 (PF6): GPIO pio:166
pin 192 (PG0): device 4021000.sdmmc function sdc1 group PG0
pin 193 (PG1): device 4021000.sdmmc function sdc1 group PG1
pin 194 (PG2): device 4021000.sdmmc function sdc1 group PG2
pin 195 (PG3): device 4021000.sdmmc function sdc1 group PG3
pin 196 (PG4): device 4021000.sdmmc function sdc1 group PG4
pin 197 (PG5): device 4021000.sdmmc function sdc1 group PG5
pin 198 (PG6): device 2500400.uart function uart1 group PG6
pin 199 (PG7): device 2500400.uart function uart1 group PG7
pin 200 (PG8): device 2500400.uart function uart1 group PG8
pin 201 (PG9): device 2500400.uart function uart1 group PG9
pin 202 (PG10): GPIO pio:202
pin 203 (PG11): device soc@3000000:rfkill@0 function clk_fanout1 group PG11
pin 204 (PG12): GPIO pio:204
pin 205 (PG13): UNCLAIMED
pin 206 (PG14): UNCLAIMED
pin 207 (PG15): GPIO pio:207
pin 208 (PG16): GPIO pio:208
pin 209 (PG17): GPIO pio:209
pin 210 (PG18): GPIO pio:210

如果文件/sys/kernel/debug/pinctrl/pio/pinmux-pins不存在,先执行这个命令:

mount -t debugfs none /sys/kernel/debug;




离线

#9 2024-07-08 08:54:02

ghosoft
会员
注册时间: 2020-02-16
已发帖子: 31
积分: 10.5

Re: D1s调试lvds,求解?

@晕哥
感谢晕哥, 弄好了

离线

#10 2024-07-08 08:57:05

ubuntu
会员
注册时间: 2020-03-30
已发帖子: 271
积分: 249

Re: D1s调试lvds,求解?

ghosoft 说:

@晕哥
感谢晕哥, 弄好了

大佬改了哪里,分享一下

离线

#11 2024-07-08 14:04:48

ghosoft
会员
注册时间: 2020-02-16
已发帖子: 31
积分: 10.5

Re: D1s调试lvds,求解?

ubuntu 说:
ghosoft 说:

@晕哥
感谢晕哥, 弄好了

大佬改了哪里,分享一下

看晕哥8楼写的, 我照着抄的

离线

#12 2024-08-08 15:36:28

ghosoft
会员
注册时间: 2020-02-16
已发帖子: 31
积分: 10.5

Re: D1s调试lvds,求解?

@晕哥


晕哥,  kernel好使了,  但是我今天想弄弄uboot,  照着改却不好使

uboot的报错

U-Boot 2018.05-g24521d6-dirty (Aug 08 2024 - 14:50:24 +0800) Allwinner Technology

[00.159]DRAM:  64 MiB
[00.161]Relocation Offset is: 01ee7000
[00.166]secure enable bit: 0
[00.168]CPU=1008 MHz,PLL6=600 Mhz,AHB=200 Mhz, APB1=100Mhz  MBus=300Mhz
[00.174]flash init start
[00.177]workmode = 0,storage type = 3
individual lock is enable
[00.185]spi sunxi_slave->max_hz:100000000
SF: Detected w25q256fw with page size 256 Bytes, erase size 64 KiB, total 32 MiB
[00.196]sunxi flash init ok
[00.199]line:703 init_clocks
[00.202]drv_disp_init
[00.214]drv_disp_init finish
[00.216]boot_gui_init:start
[00.219]set disp.dev2_output_type fail. using defval=0
[00.226]boot_gui_init:finish
partno erro : can't find partition bootloader
54 bytes read in 0 ms
[00.235]bmp_name=bootlogo.bmp size 38454
38454 bytes read in 1 ms (36.7 MiB/s)
[00.251]Loading Environment from SUNXI_FLASH... OK
[00.265]out of usb burn from boot: not need burn key
[00.270]get secure storage map err
partno erro : can't find partition private
root_partition is rootfs
set root to /dev/mtdblock5
[00.281]update part info
[00.284]update bootcmd
[00.286]change working_fdt 0x42aa6da0 to 0x42a86da0
No reserved memory region found in source FDT
[00.312]update dts
noncached_alloc(): addr = 0x432bc080
noncached_alloc(): addr = 0x432bc0c0
noncached_alloc(): addr = 0x432bc100
noncached_alloc(): addr = 0x432bc940
geth_sys_init:634: get node 'gmac0' error
geth_sys_init fail!
[00.332]Board Net Initialization Failed
[00.336]No ethernet found.
Hit any key to stop autoboot:  0
[00.406]LCD open finish
Unhandled exception: Load access fault
EPC: 0000000043ef8804 TVAL: 000000c0c412c0e8
### ERROR ### Please RESET the board ###

uboot-board.dts

lcd_used = <1>;
	lcd_driver_name = "default_lcd";

	lcd_if = <3>;
	lcd_lvds_if = <1>;

	lcd_x               = <1920>;
	lcd_y               = <1080>;
	lcd_width           = <476>;
	lcd_height          = <268>;
	lcd_dclk_freq       = <150>;
	lcd_hbp             = <40>;
	lcd_ht              = <2200>;
	lcd_hspw            = <20>;
	lcd_vbp             = <16>;
	lcd_vt              = <1125>;
	lcd_vspw            = <16>;

	lcd_lvds_colordepth = <0>;
	lcd_lvds_mode 		= <0>;

	lcd_frm 			= <0>;
	lcd_hv_clk_phase 	= <3>;
	lcd_hv_sync_polarity= <0>;
	lcd_gamma_en 		= <0>;
	lcd_cmap_en 		= <0>;

	/*lcd_power = "vcc-lcd";*/

	pinctrl-0 = <&lvds0_pins_a &lvds1_pins_a>;
	pinctrl-1 = <&lvds0_pins_b &lvds1_pins_b>;

然后我注意到uboot-board.dts里面并没有引用到上级dtsi

我看/tina-d1-h/lichee/brandy-2.0/u-boot-2018/arch/riscv/dts/sun20iw1p1-soc-system.dts这个文件参与编译了, 我改的他

			lvds1_pins_a: lvds1@0 {
				allwinner,pins  = "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PD16", "PD17", "PD18", "PD19";
				allwinner,pname = "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PD16", "PD17", "PD18", "PD19";
				allwinner,function = "lvds1";
				allwinner,muxsel = <3>;
				allwinner,drive = <3>;
				allwinner,pull = <0>;
			};

			lvds1_pins_b: lvds1@1 {
				allwinner,pins  = "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PD16", "PD17", "PD18", "PD19";
				allwinner,pname = "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PD16", "PD17", "PD18", "PD19";
				allwinner,function = "io_disabled";
				allwinner,muxsel = <15>;
				allwinner,drive = <3>;
				allwinner,pull = <0>;
			};

最近编辑记录 ghosoft (2024-08-08 15:37:13)

离线

#13 2024-08-08 16:32:55

晕哥
管理员
注册时间: 2017-09-06
已发帖子: 9,339
积分: 9202

Re: D1s调试lvds,求解?

退回去再一步一步修改,看改到哪一步的时候触发Unhandled exception: Load access fault





离线

#14 2024-08-09 13:28:51

ghosoft
会员
注册时间: 2020-02-16
已发帖子: 31
积分: 10.5

Re: D1s调试lvds,求解?

晕哥 说:

退回去再一步一步修改,看改到哪一步的时候触发Unhandled exception: Load access fault

晕哥, 现在似乎只有把uboot-board.dts里面&lcd0的内容全注释掉, 系统才能起来, 并且正常显示
&lcd0里面, 如果留着默认那个mipi屏的设置, 都是不行的, 都得注释掉

离线

#15 2024-08-09 14:06:16

晕哥
管理员
注册时间: 2017-09-06
已发帖子: 9,339
积分: 9202

Re: D1s调试lvds,求解?

@ghosoft
把正常的文件和不正常的文件都发上来看看





离线

#16 2024-08-12 10:26:45

ghosoft
会员
注册时间: 2020-02-16
已发帖子: 31
积分: 10.5

Re: D1s调试lvds,求解?

晕哥 说:

@ghosoft
把正常的文件和不正常的文件都发上来看看

我试出来了, 是分辨率的问题.
下面是复制的uboot的设备树里lvds屏的例子改的
改动的地方只有
lcd_lvds_if=1
还有下面的pinctrl,
pinctrl-0 = <&lvds0_pins_a &lvds1_pins_a>;
pinctrl-1 = <&lvds0_pins_b &lvds1_pins_b>;  lvds1的引脚就是我上面楼层发的.

如果只改这两个地方其他内容都不变, 至少uboot不报"Unhandled exception: Load access fault", 能进到命令行.
并且我拿示波器看lvds引脚波形, 双路引脚都能看到1V多的波形, 虽然我示波器不好, 看不清, 但引脚看起来工作了

如果一旦把lcd_x = <1280>;改到1920,  就会报上面错误

lcd_used            = <1>;
lcd_driver_name     = "default_lcd";
lcd_backlight       = <150>;
lcd_if              = <3>;

lcd_x               = <1280>;
lcd_y               = <800>;
lcd_width           = <150>;
lcd_height          = <94>;
lcd_dclk_freq       = <71>;
lcd_rb_swap			= <0>;

lcd_pwm_used        = <1>;
lcd_pwm_ch          = <7>;
lcd_pwm_freq        = <50000>;
lcd_pwm_pol         = <1>;
lcd_pwm_max_limit   = <255>;

lcd_hbp             = <20>;
lcd_ht              = <1418>;
lcd_hspw            = <10>;
lcd_vbp             = <10>;
lcd_vt              = <814>;
lcd_vspw            = <5>;

/*lcd_lvds_if         = <0>;*/
lcd_lvds_if         = <1>;

lcd_lvds_colordepth = <1>;
lcd_lvds_mode       = <0>;
lcd_frm             = <1>;
lcd_io_phase        = <0x0000>;
lcd_hv_clk_phase	= <0>;
lcd_hv_sync_polarity = <0>;
lcd_gamma_en        = <0>;
lcd_bright_curve_en = <0>;
lcd_cmap_en         = <0>;
lcd_fsync_act_time  = <1000>;
lcd_fsync_dis_time  = <1000>;

deu_mode            = <0>;
lcdgamma4iep        = <22>;
smart_color         = <90>;

/*pinctrl-0 = <&lvds0_pins_a>;
pinctrl-1 = <&lvds0_pins_b>;*/
pinctrl-0 = <&lvds0_pins_a &lvds1_pins_a>;
pinctrl-1 = <&lvds0_pins_b &lvds1_pins_b>;
lcd_bl_en = <&pio PE 8 GPIO_ACTIVE_HIGH>;

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn