lztmfx 发布的最佳帖子
lztmfx 发布的最新帖子
-
Tina linux用屏幕转换芯片时I2C初始化问题
T113S3使用NCS8801 LVDS转EDP芯片,需要LCD驱动里面通过I2C初始化NCS8801,但是实际测试发现,tina linux的i2c晚于disp驱动加载,这样disp驱动里面获取不到有效的i2c适配器。有什么方法让i2c在disp前加载?另外看别的帖子说不建议在disp里面用硬件i2c初始化,推荐用GPIO模拟,看了SDK里面ST7789V也是用GPIO模拟SPI,但是SPI write的时候,引脚的输入输出是固定的,不用切换引脚状态,但是I2C的SDA引脚在发送完数据后需要切换为input模式来接收ACK信号的,这样如果用lcd设备树里面的这种方式是不行的吧?这个还可以在disp驱动里面通过代码切换lcd_gpio_X的参数吗?如输入改为输出。
lcd_gpio_0 = <&pio PG 12 1 0 3 0>; lcd_gpio_1 = <&pio PG 13 1 0 3 0>;
如果直接在disp驱动使用下面这种方式:
#define I2C_SCL 204 #define I2C_SDA 205 #define I2C_SCL_LOW() gpio_set_value(I2C_SCL, 0) #define I2C_SDA_HIGH() gpio_direction_output(I2C_SDA, 1)
开机会有一堆报错
[ 0.650948] 8<--- cut here --- [ 0.650952] Unable to handle kernel NULL pointer dereference at virtual address 00000000 [ 0.650960] pgd = (ptrval) [ 0.658090] uart3: ttyS3 at MMIO 0x2500c00 (irq = 35, base_baud = 1500000) is a SUNXI ▒▒ 0.660901] [00000000] *pgd=00000000 [ 0.669008] sw_console_setup()1807 - console setup baud 115200 parity n bits 8, flow n [ 0.671684] Internal error: Oops: 5 [#1] PREEMPT SMP ARM [ 0.696238] Modules linked in: [ 0.696238] Modules linked in: [ 0.696249] CPU: 0 PID: 21 Comm: kworker/0:1 Not tainted 5.4.61 #159 [ 0.696249] CPU: 0 PID: 21 Comm: kworker/0:1 Not tainted 5.4.61 #159 [ 0.696256] Hardware name: Generic DT based system [ 0.696256] Hardware name: Generic DT based system [ 0.702736] printk: console [ttyS3] enabled [ 0.702736] printk: console [ttyS3] enabled [ 0.716144] Workqueue: events start_work [ 0.716144] Workqueue: events start_work [ 0.716154] PC is at LCD_panel_init+0x44/0x13c [ 0.716154] PC is at LCD_panel_init+0x44/0x13c [ 0.716162] LR is at LCD_panel_init+0x40/0x13c [ 0.716162] LR is at LCD_panel_init+0x40/0x13c [ 0.726281] printk: bootconsole [earlycon0] disabled [ 0.726281] printk: bootconsole [earlycon0] disabled [ 0.735110] pc : [<c03962cc>] lr : [<c03962c8>] psr: 60000013 [ 0.735110] pc : [<c03962cc>] lr : [<c03962c8>] psr: 60000013 [ 0.735114] sp : c714de20 ip : 00000000 fp : 00000000 [ 0.735114] sp : c714de20 ip : 00000000 fp : 00000000 [ 0.735117] r10: 00000001 r9 : 00000000 r8 : c0b1bb66 [ 0.735117] r10: 00000001 r9 : 00000000 r8 : c0b1bb66 [ 0.735124] r7 : c0b1bb50 r6 : 00000000 r5 : 0000000b r4 : c714c000 [ 0.735124] r7 : c0b1bb50 r6 : 00000000 r5 : 0000000b r4 : c714c000 [ 0.821770] r3 : 50ca96b2 r2 : 50ca96b2 r1 : 06c7e000 r0 : 00000026 [ 0.821776] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none [ 0.821783] Control: 10c5387d Table: 4000406a DAC: 00000051 [ 0.829589] sun8iw20-pinctrl 2000000.pinctrl: 2000000.pinctrl supply vcc-pb not found, using dummy regulator [ 0.837001] Process kworker/0:1 (pid: 21, stack limit = 0x(ptrval)) [ 0.837006] Stack: (0xc714de20 to 0xc714e000) [ 0.837017] de20: 00000000 50ca96b2 c730fa00 c7391000 c7390000 00000001 c0c5d028 c0373c88 [ 0.837032] de40: c08272ba c730fa00 c714de98 c07248e0 00000000 00000000 00000000 c036dcf4 [ 0.843742] uart uart4: uart4 supply uart not found, using dummy regulator [ 0.854390] de60: 00000000 00000000 00020002 c714de6c c714de6c 50ca96b2 c7070c00 c06ea2ac [ 0.854399] de80: c714c000 00000001 00000000 00000000 c0c596e8 c036df5c 00000001 00000000 [ 0.854407] dea0: 00000000 00000000 00000004 00000000 00000002 00000002 00000000 00000008 [ 0.854416] dec0: 00000000 50ca96b2 00000000 c714c000 c0c59350 00000002 c0c596e8 c0369d10 [ 0.861637] uart4: ttyS4 at MMIO 0x2501000 (irq = 36, base_baud = 1500000) is a SUNXI [ 0.866247] dee0: 00000001 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 0.866256] df00: 00000000 00000000 00000000 50ca96b2 00000000 c0c591e0 00000001 c0369e28 [ 0.866269] df20: c7040100 c76b6880 c0c594b8 c76b9900 00000000 00000000 c0c594bc c012f0ac [ 0.876002] uart uart5: uart5 supply uart not found, using dummy regulator [ 0.884498] df40: c7040100 c0c594b8 c7040100 c7040114 c76b6880 c714c000 c76b6898 c0b02d00 [ 0.884508] df60: c0b0b27c c012f6d0 00000000 c701e880 c714c000 c701e840 c7040100 c012f49c [ 0.884517] df80: c704bec4 c701e89c 00000000 c0133f24 c701e840 c0133e04 00000000 00000000 [ 0.884527] dfa0: 00000000 00000000 00000000 c01010e8 00000000 00000000 00000000 00000000 [ 0.892457] uart5: ttyS5 at MMIO 0x2501400 (irq = 37, base_baud = 1500000) is a SUNXI [ 0.901302] dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 0.901310] dfe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000 [ 0.901333] [<c03962cc>] (LCD_panel_init) from [<c0373c88>] (disp_lcd_enable+0x2a4/0x2e0) [ 0.901349] [<c0373c88>] (disp_lcd_enable) from [<c036dcf4>] (disp_device_attached_and_enable+0x140/0x260) [ 0.911201] misc dump reg init [ 0.919574] [<c036dcf4>] (disp_device_attached_and_enable) from [<c036df5c>] (bsp_disp_device_switch+0x8c/0xec) [ 0.919586] [<c036df5c>] (bsp_disp_device_switch) from [<c0369d10>] (disp_device_set_config+0xd8/0x100) [ 0.919597] [<c0369d10>] (disp_device_set_config) from [<c0369e28>] (start_work+0xf0/0x174) [ 0.919610] [<c0369e28>] (start_work) from [<c012f0ac>] (process_one_work+0x144/0x20c) [ 0.919626] [<c012f0ac>] (process_one_work) from [<c012f6d0>] (worker_thread+0x234/0x2d8) [ 1.108057] [<c012f6d0>] (worker_thread) from [<c0133f24>] (kthread+0x120/0x12c) [ 1.116309] [<c0133f24>] (kthread) from [<c01010e8>] (ret_from_fork+0x14/0x2c) [ 1.124361] Exception stack(0xc714dfb0 to 0xc714dff8) [ 1.129992] dfa0: 00000000 00000000 00000000 00000000 [ 1.139112] dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 1.148231] dfe0: 00000000 00000000 00000000 00000000 00000013 00000000 [ 1.155610] Code: e2878016 e5cd3003 ebf6fd7c e3a06000 (e5963000) [ 1.162481] ---[ end trace a3d10cdfd74119e3 ]---
最后就是官方LCD调试PDF文档里面提到过SPI,I2C初始化的方式,是通过读取设备树信息probe设备的方式,那理论上这种也是需要i2c在disp之前加载吧,而且他T113S3的设备树貌似无法匹配手册上的方法。
-
T113S3 lvds dual配置不生效
lvds1_pins_a: lvds1@0 { pins = "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PD16", "PD17", "PD18", "PD19"; function = "lvds1"; drive-strength = <30>; bias-disable; }; lvds1_pins_b: lvds1@1 { pins = "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PD16", "PD17", "PD18", "PD19"; function = "io_disabled"; drive-strength = <30>; bias-disable; }; &disp { disp_init_enable = <1>; disp_mode = <0>; screen0_output_type = <1>; screen0_output_mode = <10>; screen1_output_type = <1>; screen1_output_mode = <10>; // screen1_output_format = <0>; // screen1_output_bits = <0>; // screen1_output_eotf = <4>; // screen1_output_cs = <257>; // screen1_output_dvi_hdmi = <2>; // screen1_output_range = <2>; // screen1_output_scan = <0>; // screen1_output_aspect_ratio = <8>; dev0_output_type = <1>; dev0_output_mode = <4>; dev0_screen_id = <0>; dev0_do_hpd = <0>; dev1_output_type = <1>; dev1_output_mode = <10>; dev1_screen_id = <1>; dev1_do_hpd = <1>; def_output_dev = <0>; hdmi_mode_check = <1>; fb0_format = <9>; fb0_width = <1920>; fb0_height = <1080>; fb1_format = <9>; fb1_width = <1920>; fb1_height = <1080>; chn_cfg_mode = <2>; disp_para_zone = <1>; /*VCC-LCD*/ /* dc1sw-supply = <®_dc1sw>;*/ /*VCC-DSI*/ /* eldo3-supply = <®_eldo3>;*/ /*VCC-PD*/ /* dcdc1-supply = <®_dcdc1>;*/ }; &lcd0 { lcd_used = <1>; lcd_driver_name = "dual_lvds_lcd"; lcd_if = <3>; lcd_x = <1920>; lcd_y = <1080>; lcd_width = <340>; lcd_height = <190>; lcd_dclk_freq = <159>; lcd_pwm_used = <0>; lcd_pwm_ch = <5>;//背光PWM通道号 lcd_pwm_freq = <5000>; lcd_pwm_pol = <1>; lcd_backlight = <10>; lcd_pwm_max_limit = <255>; //= <&pio PD 27 1 0 3 1>; // lcd_bl_en = <&pio PG 3 1 0 3 1>;//背光使能引脚 lcd_hbp = <272>; lcd_ht = <2272>;//48 lcd_hspw = <32>; lcd_vbp = <80>; lcd_vt = <1169>;//3 lcd_vspw = <6>; 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>; lcd_fsync_en = <0>; lcd_fsync_act_time = <1000>; lcd_fsync_dis_time = <1000>; lcd_fsync_pol = <0>; deu_mode = <0>; lcdgamma4iep = <22>; smart_color = <90>; lcd_gpio_0 = <&pio PG 3 1 0 3 0>;//背光使能 pinctrl-0 = <&lvds1_pins_a>; pinctrl-1 = <&lvds1_pins_b>; };
adb shell dump的信息:
root@TinaLinux:/# fbset mode "1920x1080-60" geometry 1920 1080 1920 2160 24 timings 6289 240 80 74 9 32 6 accel false rgba 8/0,8/8,8/16,0/24 endmode
root@TinaLinux:/# cat /sys/kernel/debug/pinctrl/2000000.pinctrl/pinmux-pins Pinmux settings per pin Format: pin (name): mux_owner|gpio_owner (strict) hog? ... 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 ....
-
回复: T113S3 I2C异常
@z2500abc 闹乌龙了,SCL和旁边的PWM引脚连锡了,另外正常的哪路TWI也会打印许多信息,我直接把kernel 的log等级改成3就不打印这么多了
-
回复: T113S3 SPINAND启动报错ECC错误
@lztmfx 这个看似固件损坏或者NAND有坏块,实际上就是rootfs和kernel的SPIFLASH.UBIFS SQUASHFS配置不对
-
T113S3 I2C异常
root@TinaLinux:/# i2cdetect -y 0
0 1 2 3 4 5 6 7 8 9 a b c d e f[ 225.484348] sunxi-i2c sunxi-i2c0: runtime resume finish00: [ 225.494594] sunxi-i2c sunxi-i2c0: engine-mode: start signal xfered
[ 225.494608] sunxi-i2c sunxi-i2c0: engine-mode: [slave address:(0x3),irq state:(0x8)]
[ 225.511400] sunxi-i2c sunxi-i2c0: engine-mode: 7bits+r/w = 0x6 xfered
[ 225.518624] sunxi-i2c sunxi-i2c0: engine-mode: data 0x6 xfered
[ 230.529514] sunxi-i2c sunxi-i2c0: engine-mode: xfer timeout(dev addr:0x3)
[ 230.529546] sunxi-i2c sunxi-i2c0: runtime suspend finish
[ 230.537143] 0x02502000: 00000000 00000000 00000000 00000000
[ 230.549452] 0x02502010: 00000000 00000000 00000000 00000000
-- [ 230.555922] sunxi-i2c sunxi-i2c0: runtime resume finish
[ 230.562028] sunxi-i2c sunxi-i2c0: engine-mode: start signal xfered
[ 235.569499] sunxi-i2c sunxi-i2c0: engine-mode: xfer timeout(dev addr:0x4)
[ 235.569529] sunxi-i2c sunxi-i2c0: runtime suspend finish
[ 235.577115] 0x02502000: 00000000 00000000 00000000 00000000
[ 235.577121] 0x02502010: 00000000 00000000 00000000 00000000
-- [ 235.595857] sunxi-i2c sunxi-i2c0: runtime resume finish
[ 235.601971] sunxi-i2c sunxi-i2c0: engine-mode: start signal xfered
^C[ 240.609525] sunxi-i2c sunxi-i2c0: engine-mode: xfer timeout(dev addr:0x5)
[ 240.609543] sunxi-i2c sunxi-i2c0: runtime suspend finish
[ 240.617154] 0x02502000: 00000000 00000000 00000000 00000000
[ 240.629478] 0x02502010: 00000000 00000000 00000000 00000000root@TinaLinux:/# i2cdetect -l
i2c-0 i2c sunxi-i2c0 I2C adapter换了其他没有挂任何设备的I2C也是一样的报错,是不是kernel什么地方配置不对啊?和开源的好几个项目都对比过config配置了,不知道怎么排查了
-
回复: T113 Longan,Nand镜像编译出来之后,kernel跑到ubi0: attaching mtd3时出错
请问找到原因了吗?我T113S3 SPINAND启动也是这个问题
-
回复: 解决那些千奇百怪的 Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block 错误
[ 1.883516] /dev/root: Can't open blockdev
[ 1.888118] VFS: Cannot open root device "ubiblock0_5" or unknown-block(0,0): error -6
[ 1.897030] Please append a correct "root=" boot option; here are the available partitions:
[ 1.906413] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[ 1.915691] CPU0: stopping
[ 1.918729] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.4.61 #43
[ 1.925465] Hardware name: Generic DT based system
[ 1.930859] [<c010df08>] (unwind_backtrace) from [<c010a698>] (show_stack+0x10/0x14)
[ 1.939552] [<c010a698>] (show_stack) from [<c0666870>] (dump_stack+0x88/0xa4)
[ 1.947659] [<c0666870>] (dump_stack) from [<c010c2d4>] (handle_IPI+0xe4/0x180)
[ 1.955864] [<c010c2d4>] (handle_IPI) from [<c032330c>] (gic_handle_irq+0x70/0x78)
[ 1.964362] [<c032330c>] (gic_handle_irq) from [<c01021cc>] (__irq_svc+0x6c/0xa8)
[ 1.972757] Exception stack(0xc0a01f40 to 0xc0a01f88)
[ 1.978425] 1f40: 00000e68 c76b8334 00000000 c0114860 00000001 c0a00000 c0a03de4 c0a03e20
[ 1.987606] 1f60: c0a42000 c77ff540 c09280c0 00000000 00000001 c0a01f90 c0107fd0 c0107fc0
[ 1.996781] 1f80: 60000013 ffffffff
[ 2.000699] [<c01021cc>] (__irq_svc) from [<c0107fc0>] (arch_cpu_idle+0x1c/0x38)
[ 2.009001] [<c0107fc0>] (arch_cpu_idle) from [<c013d694>] (do_idle+0xd4/0x128)
[ 2.017202] [<c013d694>] (do_idle) from [<c013d978>] (cpu_startup_entry+0x18/0x20)
[ 2.025699] [<c013d978>] (cpu_startup_entry) from [<c0900c80>] (start_kernel+0x360/0x3ec)
[ 2.034881] [<c0900c80>] (start_kernel) from [<00000000>] (0x0)
[ 2.041529] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) ]---使用的是SPI NAND,如果烧录到TF卡就正常启动,用NAND就找不到rootfs,实在是找不到问题了