@yuzukitsuru 都烧不进去,是不是要改什么配置?
wyljkl 发布的帖子
-
f1c100s tina系统怎么制作SD量产卡?
现在是spi-nor/nand的存储介质,现在想要制作SD量产卡,让SD卡去升级镜像到nor/nand中,这个量产卡怎么去制作,要修改那些配置呀?麻烦各位指点下 -
回复: t133替换开机logo打包提示boot-resource分区内存不足
@yuzukitsuru 我这边没有这个分区,介质是nandflash,只有一下几个分区:
但是,logo打包的时候还是bootresource这个分区里面。
--==========-- PACK_CHIP sun8iw20p1 PACK_PLATFORM tina PACK_BOARD r528-evb1 PACK_KERN PACK_DEBUG uart0 PACK_SIG none PACK_SECURE none PACK_MODE normal PACK_FUNC android PACK_PROGRAMMER none PACK_TAR_IMAGE none PACK_TOPDIR /home/rpdzkj/r528/taobao/tina-r528 --==========-- No kernel param, parse it from r528 copying tools file copying configs file storage_type value is 5 rm /home/rpdzkj/r528/taobao/tina-r528/out/r528-evb1/image/image_nor.cfg copying boot resource LZMA 4.65 : Igor Pavlov : Public domain : 2009-02-03 copying boot file make user resource for : /home/rpdzkj/r528/taobao/tina-r528/out/r528-evb1/image/sys_partition.fex handle partition user-res no user resource partitions APP_PART_DOWNLOAD_FILE = /home/rpdzkj/r528/taobao/tina-r528/out/r528-evb1/image/app.fex Need size of filesystem no data resource partitions don't build dtbo ... update_chip pack boot package GetPrivateProfileSection read to end content_count=3 LICHEE_REDUNDANT_ENV_SIZE config in BoardConfig.mk --mkenvimage create redundant env data!-- ---redundant env data size 0x20000--- packing for tina linux normal this is not a partition key gpt_head->header_crc32 = 0xf9469bf7 GPT----part num 9--- gpt_entry: 128 gpt_header: 92 GPT:boot-resource: 1f8 19f7 GPT:env : 19f8 1bef GPT:env-redund : 1bf0 1de7 GPT:boot : 1de8 4f1f GPT:rootfs : 4f20 ee97 GPT:dsp0 : ee98 f287 GPT:private : f288 fa67 GPT:recovery : fa68 13967 GPT:UDISK : 13968 13977 update gpt file ok update mbr file ok ==================================== show "sys_partition_for_dragon.fex" message ------------------------------------ [mbr] mbr_size : 252 Kbyte ------------------------------------ partition_name : boot-resource partition_size : 6144 downloadfile : boot-resource.fex boot-resource.fex size : 80K byte ------------------------------------ partition_name : env partition_size : 504 downloadfile : env.fex env.fex size : 128K byte ------------------------------------ partition_name : env-redund partition_size : 504 downloadfile : env.fex env.fex size : 128K byte ------------------------------------ partition_name : boot partition_size : 12600 downloadfile : boot.fex boot.fex -> /home/rpdzkj/r528/taobao/tina-r528/out/r528-evb1/boot.img boot.img size : 4.6M byte ------------------------------------ partition_name : rootfs partition_size : 40824 downloadfile : rootfs.fex rootfs.fex -> /home/rpdzkj/r528/taobao/tina-r528/out/r528-evb1/rootfs.img rootfs.img size : 14M byte ------------------------------------ partition_name : dsp0 partition_size : 1008 downloadfile : dsp0.fex dsp0.fex size : 249K byte ------------------------------------ partition_name : private partition_size : 2016 ------------------------------------ partition_name : recovery partition_size : 16128 ------------------------------------ /home/rpdzkj/r528/taobao/tina-r528/out/host/bin/ /home/rpdzkj/r528/taobao/tina-r528/out/r528-evb1/image Begin Parse sys_partion.fex Add partion boot-resource.fex BOOT-RESOURCE_FEX Add partion very boot-resource.fex BOOT-RESOURCE_FEX FilePath: boot-resource.fex FileLength=14000Add partion env.fex ENV_FEX000000000 Add partion very env.fex ENV_FEX000000000 FilePath: env.fex FileLength=20000Add partion env.fex ENV_FEX000000000 Add partion very env.fex ENV_FEX000000000 FilePath: env.fex FileLength=20000Add partion boot.fex BOOT_FEX00000000 Add partion very boot.fex BOOT_FEX00000000 FilePath: boot.fex FileLength=486800Add partion rootfs.fex ROOTFS_FEX000000 Add partion very rootfs.fex ROOTFS_FEX000000 FilePath: rootfs.fex FileLength=de0000Add partion dsp0.fex DSP0_FEX00000000 Add partion very dsp0.fex DSP0_FEX00000000 FilePath: dsp0.fex FileLength=3e2c8BuildImg 0 Dragon execute image.cfg SUCCESS ! ----------image is for nand/emmc---------- ----------image is at---------- /home/rpdzkj/r528/taobao/tina-r528/out/r528-evb1/tina_r528-evb1_uart0.img
-
回复: 【已解决】D1s 调试 MIPI LCD 不亮
现在uboot部分都没有进入到LCD_open_flow 这个函数中,对比了驱动文件和设备树的名字也是一一致的:
驱动:
/* * drivers/video/sunxi/disp2/disp/lcd/K080_IM2HYL802R_800X1280.c * * Copyright (c) 2007-2018 Allwinnertech Co., Ltd. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include "K080_IM2HYL802R_800X1280.h" //#include <mach/sys_config.h> #include "panels.h" /* &lcd0 { lcd_used = <1>; status = "okay"; lcd_driver_name = "K080_IM2HYL802R_800X1280"; lcd_backlight = <50>; lcd_if = <4>; lcd_x = <800>; lcd_y = <1280>; lcd_width = <135>; lcd_height = <216>; lcd_dclk_freq = <75>; lcd_pwm_used = <1>; lcd_pwm_ch = <0>; lcd_pwm_freq = <50000>; lcd_pwm_pol = <1>; lcd_pwm_max_limit = <255>; lcd_hbp = <88>; lcd_ht = <960>; lcd_hspw = <4>; lcd_vbp = <12>; lcd_vt = <1300>; lcd_vspw = <4>; lcd_frm = <0>; lcd_gamma_en = <0>; lcd_bright_curve_en = <0>; lcd_cmap_en = <0>; deu_mode = <0>; lcdgamma4iep = <22>; smart_color = <90>; lcd_dsi_if = <0>; lcd_dsi_lane = <4>; lcd_dsi_format = <0>; lcd_dsi_te = <0>; lcd_dsi_eotp = <0>; lcd_pin_power = "dcdc1"; lcd_pin_power1 = "eldo3"; lcd_power = "eldo3"; lcd_power1 = "dcdc1"; lcd_power2 = "dc1sw"; lcd_gpio_1 = <&pio PD 22 1 0 3 1>; pinctrl-0 = <&dsi4lane_pins_a>; pinctrl-1 = <&dsi4lane_pins_b>; lcd_bl_en = <&pio PB 8 1 0 3 1>; lcd_bl_0_percent = <15>; lcd_bl_100_percent = <100>; }; */ extern s32 bsp_disp_get_panel_info(u32 screen_id, disp_panel_para *info); static void LCD_power_on(u32 sel); static void LCD_power_off(u32 sel); static void LCD_bl_open(u32 sel); static void LCD_bl_close(u32 sel); //static void LCD_panel_try_switch(u32 sel); static void LCD_panel_init(u32 sel); static void LCD_panel_exit(u32 sel); //static u8 const mipi_dcs_pixel_format[4] = {0x77,0x66,0x66,0x55}; #define panel_reset(val) sunxi_lcd_gpio_set_value(sel, 1, val) #define power_en(val) sunxi_lcd_gpio_set_value(sel, 0, val) static void LCD_cfg_panel_info(panel_extend_para *info) { printf("%s %d %s\n",__FILE__,__LINE__,__FUNCTION__); u32 i = 0, j = 0; u32 items; u8 lcd_gamma_tbl[][2] = { //{input value, corrected value} {0, 0}, {15, 15}, {30, 30}, {45, 45}, {60, 60}, {75, 75}, {90, 90}, {105, 105}, {120, 120}, {135, 135}, {150, 150}, {165, 165}, {180, 180}, {195, 195}, {210, 210}, {225, 225}, {240, 240}, {255, 255}, }; u32 lcd_cmap_tbl[2][3][4] = { { {LCD_CMAP_G0, LCD_CMAP_B1, LCD_CMAP_G2, LCD_CMAP_B3}, {LCD_CMAP_B0, LCD_CMAP_R1, LCD_CMAP_B2, LCD_CMAP_R3}, {LCD_CMAP_R0, LCD_CMAP_G1, LCD_CMAP_R2, LCD_CMAP_G3}, }, { {LCD_CMAP_B3, LCD_CMAP_G2, LCD_CMAP_B1, LCD_CMAP_G0}, {LCD_CMAP_R3, LCD_CMAP_B2, LCD_CMAP_R1, LCD_CMAP_B0}, {LCD_CMAP_G3, LCD_CMAP_R2, LCD_CMAP_G1, LCD_CMAP_R0}, }, }; items = sizeof(lcd_gamma_tbl) / 2; for (i = 0; i < items - 1; i++) { u32 num = lcd_gamma_tbl[i + 1][0] - lcd_gamma_tbl[i][0]; for (j = 0; j < num; j++) { u32 value = 0; value = lcd_gamma_tbl[i][1] + ((lcd_gamma_tbl[i + 1][1] - lcd_gamma_tbl[i][1]) * j) / num; info->lcd_gamma_tbl[lcd_gamma_tbl[i][0] + j] = (value << 16) + (value << 8) + value; } } info->lcd_gamma_tbl[255] = (lcd_gamma_tbl[items - 1][1] << 16) + (lcd_gamma_tbl[items - 1][1] << 8) + lcd_gamma_tbl[items - 1][1]; memcpy(info->lcd_cmap_tbl, lcd_cmap_tbl, sizeof(lcd_cmap_tbl)); } static s32 LCD_open_flow(u32 sel) { printf("%s %d %s\n",__FILE__,__LINE__,__FUNCTION__); LCD_OPEN_FUNC(sel, LCD_power_on, 100); //open lcd power, and delay 50ms LCD_OPEN_FUNC(sel, LCD_panel_init, 200); //open lcd power, than delay 200ms LCD_OPEN_FUNC(sel, sunxi_lcd_tcon_enable, 50); //open lcd controller, and delay 100ms LCD_OPEN_FUNC(sel, LCD_bl_open, 0); //open lcd backlight, and delay 0ms printf("%s %d %s\n",__FILE__,__LINE__,__FUNCTION__); return 0; } static s32 LCD_close_flow(u32 sel) { printf("%s %d %s\n",__FILE__,__LINE__,__FUNCTION__); LCD_CLOSE_FUNC(sel, LCD_bl_close, 200); //close lcd backlight, and delay 0ms LCD_CLOSE_FUNC(sel, sunxi_lcd_tcon_disable, 20); //close lcd controller, and delay 0ms LCD_CLOSE_FUNC(sel, LCD_panel_exit, 10); //open lcd power, than delay 200ms LCD_CLOSE_FUNC(sel, LCD_power_off, 500); //close lcd power, and delay 500ms printf("%s %d %s\n",__FILE__,__LINE__,__FUNCTION__); return 0; } static void LCD_power_on(u32 sel) { printf("%s %d %s\n",__FILE__,__LINE__,__FUNCTION__); panel_reset(0); sunxi_lcd_power_enable(sel, 0);//config lcd_power pin to open lcd power sunxi_lcd_delay_ms(5); sunxi_lcd_power_enable(sel, 1);//config lcd_power pin to open lcd power1 sunxi_lcd_delay_ms(5); sunxi_lcd_power_enable(sel, 2);//config lcd_power pin to open lcd power2 sunxi_lcd_delay_ms(5); power_en(1); sunxi_lcd_delay_ms(20); //panel_reset(1); sunxi_lcd_delay_ms(40); panel_reset(1); //sunxi_lcd_delay_ms(10); //panel_reset(0); //sunxi_lcd_delay_ms(5); //panel_reset(1); sunxi_lcd_delay_ms(120); //sunxi_lcd_delay_ms(5); sunxi_lcd_pin_cfg(sel, 1); printf("%s %d %s\n",__FILE__,__LINE__,__FUNCTION__); } static void LCD_power_off(u32 sel) { printf("%s %d %s\n",__FILE__,__LINE__,__FUNCTION__); sunxi_lcd_pin_cfg(sel, 0); power_en(0); sunxi_lcd_delay_ms(20); panel_reset(0); sunxi_lcd_delay_ms(5); sunxi_lcd_power_disable(sel, 2);//config lcd_power pin to close lcd power2 sunxi_lcd_delay_ms(5); sunxi_lcd_power_disable(sel, 1);//config lcd_power pin to close lcd power1 sunxi_lcd_delay_ms(5); sunxi_lcd_power_disable(sel, 0);//config lcd_power pin to close lcd power printf("%s %d %s\n",__FILE__,__LINE__,__FUNCTION__); } static void LCD_bl_open(u32 sel) { printf("%s %d %s\n",__FILE__,__LINE__,__FUNCTION__); sunxi_lcd_pwm_enable(sel); sunxi_lcd_delay_ms(50); sunxi_lcd_backlight_enable(sel);//config lcd_bl_en pin to open lcd backlight printf("%s %d %s\n",__FILE__,__LINE__,__FUNCTION__); } static void LCD_bl_close(u32 sel) { printf("%s %d %s\n",__FILE__,__LINE__,__FUNCTION__); sunxi_lcd_backlight_disable(sel);//config lcd_bl_en pin to close lcd backlight sunxi_lcd_delay_ms(20); sunxi_lcd_pwm_disable(sel); printf("%s %d %s\n",__FILE__,__LINE__,__FUNCTION__); } #define REGFLAG_DELAY 0XFE #define REGFLAG_END_OF_TABLE 0xFD // END OF REGISTERS MARKER struct LCM_setting_table { u8 cmd; u32 count; u8 para_list[64]; }; /*add panel initialization below*/ static struct LCM_setting_table lcm_initialization_setting[] = { {0x80, 1, {0x65} }, //GIP_1 {0x81, 1, {0x99} }, {0x82, 1, {0x15} }, {0x83, 1, {0xD1} }, //STA Width 4H {0x84, 1, {0x40} }, {0x85, 1, {0xDD} }, //STA Width 4H {0x86, 1, {0xE8} }, //CMD_Page 0 {0xFF, 3, {0x98, 0x81, 0x00} }, //SLP OUT {0x11, 0, {0x00} }, // SLPOUT {REGFLAG_DELAY, REGFLAG_DELAY, {120} }, //DISP ON {0x29, 0, {0x00} }, // DSPON {REGFLAG_DELAY, REGFLAG_DELAY, {5} }, //TE ON {0x35, 0, {0x00} }, // TE {REGFLAG_DELAY, REGFLAG_DELAY, {5} }, {REGFLAG_END_OF_TABLE, REGFLAG_END_OF_TABLE, {} } }; static void LCD_panel_init(u32 sel) { __u32 i; char model_name[25]; printf("%s %d %s\n",__FILE__,__LINE__,__FUNCTION__); disp_sys_script_get_item("lcd0", "lcd_model_name", (int *)model_name, 25); sunxi_lcd_dsi_clk_enable(sel); sunxi_lcd_delay_ms(20); sunxi_lcd_dsi_dcs_write_0para(sel, DSI_DCS_SOFT_RESET); sunxi_lcd_delay_ms(10); for (i = 0; ; i++) { if (lcm_initialization_setting[i].count == REGFLAG_END_OF_TABLE) break; else if (lcm_initialization_setting[i].count == REGFLAG_DELAY) sunxi_lcd_delay_ms(lcm_initialization_setting[i].para_list[0]); #ifdef SUPPORT_DSI else dsi_dcs_wr(sel, lcm_initialization_setting[i].cmd, lcm_initialization_setting[i].para_list, lcm_initialization_setting[i].count); #endif //break; } printf("%s %d %s\n",__FILE__,__LINE__,__FUNCTION__); return; } static void LCD_panel_exit(u32 sel) { printf("%s %d %s\n",__FILE__,__LINE__,__FUNCTION__); sunxi_lcd_dsi_dcs_write_0para(sel, DSI_DCS_SET_DISPLAY_OFF); sunxi_lcd_delay_ms(20); sunxi_lcd_dsi_dcs_write_0para(sel, DSI_DCS_ENTER_SLEEP_MODE); sunxi_lcd_delay_ms(80); printf("%s %d %s\n",__FILE__,__LINE__,__FUNCTION__); return ; } //sel: 0:lcd0; 1:lcd1 static s32 LCD_user_defined_func(u32 sel, u32 para1, u32 para2, u32 para3) { printf("%s %d %s\n",__FILE__,__LINE__,__FUNCTION__); return 0; } //sel: 0:lcd0; 1:lcd1 /*static s32 LCD_set_bright(u32 sel, u32 bright) { sunxi_lcd_dsi_dcs_write_1para(sel,0x51,bright); return 0; }*/ __lcd_panel_t K080_IM2HYL802R_800X1280_mipi_panel = { /* panel driver name, must mach the name of lcd_drv_name in sys_config.fex */ .name = "K080_IM2HYL802R_800X1280", .func = { .cfg_panel_info = LCD_cfg_panel_info, .cfg_open_flow = LCD_open_flow, .cfg_close_flow = LCD_close_flow, .lcd_user_defined_func = LCD_user_defined_func, //.set_bright = LCD_set_bright, }, };
设备树:
&lcd0 { lcd_used = <1>; lcd_driver_name = "K080_IM2HYL802R_800X1280"; lcd_backlight = <50>; lcd_if = <4>; /* lcd_x = <1200>; lcd_y = <1920>; */ lcd_x = <1024>; lcd_y = <600>; lcd_width = <135>; lcd_height = <216>; lcd_dclk_freq = <156>; lcd_pwm_used = <0>; lcd_pwm_ch = <7>; lcd_pwm_freq = <50000>; lcd_pwm_pol = <0>; lcd_hbp = <160>; lcd_ht = <1354>; lcd_hspw = <10>; lcd_vbp = <23>; lcd_vt = <636>; lcd_vspw = <1>; lcd_lvds_if = <0>; lcd_lvds_colordepth = <1>; lcd_lvds_mode = <0>; lcd_frm = <0>; lcd_io_phase = <0x0000>; lcd_gamma_en = <0>; lcd_bright_curve_en = <0>; lcd_cmap_en = <0>; deu_mode = <0>; lcdgamma4iep = <22>; smart_color = <90>; lcd_dsi_if = <0>; lcd_dsi_lane = <4>; lcd_dsi_format = <0>; lcd_dsi_eotp = <0>; lcd_dsi_port_num = <0>; /*lcd_gpio_1 = <&pio PB 8 GPIO_ACTIVE_HIGH>;*/ /*lcd_bl_en = <&pio PD 20 GPIO_ACTIVE_HIGH>;*/ pinctrl-0 = <&dsi4lane_pins_a>; pinctrl-1 = <&dsi4lane_pins_b>; };
启动logo:
mtdids : nand0=nand
mtdparts: mtdparts=nand:1024k@0(boot0)ro,3072k@1048576(uboot)ro,1024k@4194304(secure_storage)ro,-(sys)
[00.600]ubi0: attaching mtd4
[00.713]ubi0: scanning is finished
[00.719]ubi0: attached mtd4 (name "sys", size 123 MiB)
[00.724]ubi0: PEB size: 262144 bytes (256 KiB), LEB size: 258048 bytes
[00.730]ubi0: min./max. I/O unit sizes: 4096/4096, sub-page size 2048
[00.736]ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[00.743]ubi0: good PEBs: 492, bad PEBs: 0, corrupted PEBs: 0
[00.748]ubi0: user volume: 10, internal volumes: 1, max. volumes count: 128
[00.755]ubi0: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 0
[00.763]ubi0: available PEBs: 0, total reserved PEBs: 492, PEBs reserved for bad PEB handling: 20
[00.771]sunxi flash init ok
[00.774]line:703 init_clocks
[00.777]drv_disp_init
lcd_x = 1024 drv_disp_check_spec
lcd_y = 600 drv_disp_check_spec
drivers/video/sunxi/disp2/disp/de/disp_display.c 23 bsp_disp_init
drivers/video/sunxi/disp2/disp/de/lowlevel_v2x/disp_al.c 1242 disp_init_al
drivers/video/sunxi/disp2/disp/de/lowlevel_v2x/disp_al.c 1323 disp_init_al
drivers/video/sunxi/disp2/disp/de/disp_lcd.c 2892 disp_init_lcd
drivers/video/sunxi/disp2/disp/de/disp_display.c 65 bsp_disp_init
drivers/video/sunxi/disp2/disp/lcd/panels.c 184 lcd_init
drivers/video/sunxi/disp2/disp/dev_disp.c 720 sunxi_disp_get_source_ops
drivers/video/sunxi/disp2/disp/dev_disp.c 749 sunxi_disp_get_source_ops
drivers/video/sunxi/disp2/disp/lcd/panels.c 174 lcd_set_panel_funs
drivers/video/sunxi/disp2/disp/lcd/panels.c 178 lcd_set_panel_funs
drivers/video/sunxi/disp2/disp/lcd/panels.c 187 lcd_init
[00.856]drv_disp_init finish
[00.975]Loading Environment from SUNXI_FLASH... OK
[00.997]Item0 (Map) magic is bad -
回复: 【已解决】D1s 调试 MIPI LCD 不亮
@smiletiger 在 D1s 调试 MIPI LCD 不亮 中说:
@yuzukitsuru 我这边试了下,uboot和kernel阶段都有logo显示正常
你好,这边logo显示是在哪个部分实现的呀? -
ioctl函数获取值错误
在应用层调用ioctl函数,内核获取的应用层传过去的一个结构体内容,其中有两个结构体成员内容对不上,其他的结构体成员值都是对的,这是怎么回事?
这是驱动层的IOCTL:long disp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { // printk("%s %d %s\n",__FILE__,__LINE__,__FUNCTION__); unsigned long karg[4]; unsigned long ubuffer[4] = { 0 }; s32 ret = 0; int num_screens = 2; struct disp_manager *mgr = NULL; struct disp_device *dispdev = NULL; struct disp_enhance *enhance = NULL; struct disp_smbl *smbl = NULL; struct disp_capture *cptr = NULL; #if defined(SUPPORT_EINK) struct disp_eink_manager *eink_manager = NULL; #endif #ifdef EINK_FLUSH_TIME_TEST do_gettimeofday(&ioctrl_start_timer); #endif /*test eink time */ num_screens = bsp_disp_feat_get_num_screens(); if (copy_from_user ((void *)karg, (void __user *)arg, 4 * sizeof(unsigned long))) { __wrn("copy_from_user fail\n"); return -EFAULT; } ubuffer[0] = *(unsigned long *)karg; ubuffer[1] = (*(unsigned long *)(karg + 1)); ubuffer[2] = (*(unsigned long *)(karg + 2)); ubuffer[3] = (*(unsigned long *)(karg + 3)); if (ubuffer[0] < num_screens) mgr = g_disp_drv.mgr[ubuffer[0]]; if (mgr) { dispdev = mgr->device; enhance = mgr->enhance; smbl = mgr->smbl; cptr = mgr->cptr; } #if defined(SUPPORT_EINK) eink_manager = g_disp_drv.eink_manager[0]; if (!eink_manager) __wrn("eink_manager is NULL!\n"); #endif if (cmd < DISP_FB_REQUEST) { if (ubuffer[0] >= num_screens) { __wrn ("para err, cmd = 0x%x,screen id = %d\n", cmd, (int)ubuffer[0]); return -1; } } if (DISPLAY_DEEP_SLEEP & suspend_status) { __wrn("ioctl:%x fail when in suspend!\n", cmd); return -1; } if (cmd == DISP_print) __wrn("cmd:0x%x,%ld,%ld\n", cmd, ubuffer[0], ubuffer[1]); switch (cmd) { 。。。。。。。。 /* ----layer---- */ case DISP_LAYER_SET_CONFIG: { printk("%s %d %s\n",__FILE__,__LINE__,__FUNCTION__); unsigned int i = 0; const unsigned int lyr_cfg_size = ARRAY_SIZE(lyr_cfg); mutex_lock(&g_disp_drv.mlock); if (ubuffer[2] > lyr_cfg_size) { __wrn("Total layer number is %d\n", lyr_cfg_size); mutex_unlock(&g_disp_drv.mlock); return -EFAULT; } if (copy_from_user(lyr_cfg, (void __user *)ubuffer[1], sizeof(struct disp_layer_config) * ubuffer[2])) { __wrn("copy_from_user fail\n"); mutex_unlock(&g_disp_drv.mlock); return -EFAULT; } printk("lyr_cfg[0].info.alpha_mode = %d,lyr_cfg[0].info.alpha_value = %x,lyr_cfg[0].info.fb.size[0].width = %d,lyr_cfg[0].info.fb.size[0].height = %d,lyr_cfg[0].channel = %d,lyr_cfg[0].layer_id = %d,lyr_cfg[0].enable = %d\n", lyr_cfg[0].info.alpha_mode , lyr_cfg[0].info.alpha_value , lyr_cfg[0].info.fb.size[0].width , lyr_cfg[0].info.fb.size[0].height , lyr_cfg[0].channel , lyr_cfg[0].layer_id , lyr_cfg[0].enable); #if !defined(CONFIG_EINK_PANEL_USED) printk("%s %d %s\n",__FILE__,__LINE__,__FUNCTION__); if (mgr && mgr->set_layer_config) ret = mgr->set_layer_config(mgr, lyr_cfg, ubuffer[2]); printk("%s %d %s\n",__FILE__,__LINE__,__FUNCTION__); #endif mutex_unlock(&g_disp_drv.mlock); break; } 。。。。 default: ret = disp_ioctl_extend(cmd, (unsigned long)ubuffer); break; } return ret; } 这是应用层测试主函数: int main(int argc, char *argv[]) { unsigned long arg[3]; /* 一个 struct disp_layer_config 结构体对应一个图层的全部信息 */ struct disp_layer_config config; unsigned int width = 1024; unsigned int height = 600; unsigned int ret = 0; disp = open("/dev/disp", O_RDWR); if (disp == -1) { printf("hdmitester: open /dev/disp failed(%s)\n", strerror(errno)); return 0; // goto err; } memset(&config, 0, sizeof(struct disp_layer_config)); /* 选择图层所属的通道以及本图层 ID(0-3)*/ config.channel = 0; config.layer_id = 0; config.enable = 1; config.info.mode = LAYER_MODE_BUFFER; // config.info.fb.addr[0] = (unsigned long long)mem_in; //FB 物理地址 config.info.fb.size[0].width = width; config.info.fb.size[0].height = height; config.info.fb.align[0] = 4;//bytes config.info.fb.format = DISP_FORMAT_ARGB_8888; //DISP_FORMAT_YUV420_P /* crop 表示裁剪区域的大小 */ config.info.fb.crop.x = 0; config.info.fb.crop.y = 0; /* 定点小数。 高 32bit 为整数,低 32bit 为小数 */ config.info.fb.crop.width = ((unsigned long)width) << 32; /* 定点小数。 高 32bit 为整数,低 32bit 为小数 */ config.info.fb.crop.height= ((unsigned long)height)<<32; config.info.fb.flags = DISP_BF_NORMAL; config.info.fb.scan = DISP_SCAN_PROGRESSIVE; config.info.alpha_mode = 1; //global pixel alpha config.info.alpha_value = 0xff;//global alpha value /* 显示窗口的大小 */ config.info.screen_win.x = 0; config.info.screen_win.y = 0; config.info.screen_win.width = width; config.info.screen_win.height= height; config.info.id = 0; /* 上层调用 DE 显示引擎所用的 ioctl 接口 */ arg[0] = 0;//screen 0 即选择显示通路 0 arg[1] = (unsigned long)&config; arg[2] = 1; //只设置一个图层即当前图层 ret = ioctl(disp, DISP_LAYER_SET_CONFIG, (void*)arg); printf("%s() <<<\n",__func__); return 0; } 调试信息: root@TinaLinux:/# ./lcd_test [ 17.914242] drivers/video/fbdev/sunxi/disp2/disp/dev_disp.c 3885 disp_ioctl [ 17.922099] lyr_cfg[0].info.alpha_mode = 1,lyr_cfg[0].info.alpha_value = ff,lyr_cfg[0].info.fb.size[0].width = 1024,lyr_cfg[0].info.fb.size[0].height = 600,lyr_cfg[0].channel = 1024,lyr_cfg[0].layer_id = 600,lyr_cfg[0].enable = 1 [ 17.944952] drivers/video/fbdev/sunxi/disp2/disp/dev_disp.c 3933 disp_ioctl [ 17.952800] [DISP] disp_get_layer,line:111: [ 17.952805] disp_get_layer (0,1024,600) fail [ 17.962388] drivers/video/fbdev/sunxi/disp2/disp/dev_disp.c 3936 disp_ioctl
通道值和图层值对不上
-
R528LVDS接口输出怎么配置,在设备树里面配置了,感觉没有效果呀?
&disp { disp_init_enable = <1>; disp_mode = <0>; screen0_output_type = <1>; screen0_output_mode = <4>; screen1_output_type = <3>; screen1_output_mode = <10>; screen1_output_format = <0>; screen1_output_bits = <0>; screen1_output_eotf = <4>; screen1_output_cs = <257>; screen1_output_range = <2>; screen1_output_scan = <0>; screen1_output_aspect_ratio = <8>; dev0_output_type = <1>; dev0_output_mode = <1>; dev0_screen_id = <0>; dev0_do_hpd = <0>; dev1_output_type = <4>; dev1_output_mode = <10>; dev1_screen_id = <1>; dev1_do_hpd = <1>; def_output_dev = <0>; fb0_format = <10>; fb0_width = <0>; fb0_height = <0>; fb1_format = <0>; fb1_width = <0>; fb1_height = <0>; chn_cfg_mode = <1>; disp_para_zone = <1>; /*VCC-LCD*/ /* dc1sw-supply = <®_dc1sw>;*/ /*VCC-DSI*/ /* eldo3-supply = <®_eldo3>;*/ /*VCC-PD*/ /* dcdc1-supply = <®_dcdc1>;*/ }; /*---------------------------------------------------------------------------------- ;lcd0 configuration ;lcd_if: 0:hv(sync+de); 1:8080; 2:ttl; 3:lvds; 4:dsi; 5:edp; 6:extend dsi ;lcd_hv_if 0:Parallel RGB; 8:Serial RGB; 10:Dummy RGB; 11: RGB Dummy;12:CCIR656 ;lcd_hv_clk_phase 0:0 degree;1:90 degree;2:180 degree;3:270 degree ;lcd_hv_sync_polarity 0:vs low,hs low; 1:vs high,hslow; 2:vs low,hs high; 3:vs high,hs high ;lcd_hv_syuv_seq 0:YUYV; 1:YVYU; 2:UYVY; 3:VYUY ;lcd_cpu_if 0:18bit/1 cycle parallel(RGB666); 4:16bit/1cycle parallel (RGB565) ; 6:18bit/3 cycle parallel(RGB666); 7:16bit/2cycle parallel (RGB565) ;lcd_cpu_te 0:frame auto trigger; 1:frame triggered by te rising edge; 2:frame triggered by te falling edge; ;lcd_dsi_if 0:video mode; 1: Command mode; 2:video burst mode ;lcd_dsi_te 0:frame auto trigger; 1:frame triggered by te rising edge; 2:frame triggered by te falling edge; ;lcd_x: lcd horizontal resolution ;lcd_y: lcd vertical resolution ;lcd_width: width of lcd in mm ;lcd_height: height of lcd in mm ;lcd_dclk_freq: in MHZ unit ;lcd_pwm_freq: in HZ unit ;lcd_pwm_pol: lcd backlight PWM polarity ;lcd_pwm_max_limit lcd backlight PWM max limit(<=255) ;lcd_hbp: hsync back porch(pixel) + hsync plus width(pixel); ;lcd_ht: hsync total cycle(pixel) ;lcd_vbp: vsync back porch(line) + vysnc plus width(line) ;lcd_vt: vysnc total cycle(line) ;lcd_hspw: hsync plus width(pixel) ;lcd_vspw: vysnc plus width(pixel) ;lcd_lvds_if: 0:single link; 1:dual link ;lcd_lvds_colordepth: 0:8bit; 1:6bit ;lcd_lvds_mode: 0:NS mode; 1:JEIDA mode ;lcd_frm: 0:disable; 1:enable rgb666 dither; 2:enable rgb656 dither ;lcd_io_phase: 0:noraml; 1:intert phase(0~3bit: vsync phase; 4~7bit:hsync phase; ; 8~11bit:dclk phase; 12~15bit:de phase) ;lcd_gamma_en lcd gamma correction enable ;lcd_bright_curve_en lcd bright curve correction enable ;lcd_cmap_en lcd color map function enable ;deu_mode 0:smoll lcd screen; 1:large lcd screen(larger than 10inch) ;lcdgamma4iep: Smart Backlight parameter, lcd gamma vale * 10; ; decrease it while lcd is not bright enough; increase while lcd is too bright ;smart_color 90:normal lcd screen 65:retina lcd screen(9.7inch) ;Pin setting for special function ie.LVDS, RGB data or vsync ; name(donot care) = port:PD12<pin function><pull up or pull down><drive ability><output level> ;Pin setting for gpio: ; lcd_gpio_X = port:PD12<pin function><pull up or pull down><drive ability><output level> ;Pin setting for backlight enable pin ; lcd_bl_en = port:PD12<pin function><pull up or pull down><drive ability><output level> ;fsync setting, pulse to csi ;lcd_fsync_en (0:disable fsync,1:enable) ;lcd_fsync_act_time (active time of fsync, unit:pixel) ;lcd_fsync_dis_time (disactive time of fsync, unit:pixel) ;lcd_fsync_pol (0:positive;1:negative) ;gpio config: <&pio for cpu or &r_pio for cpus, port, port num, pio function, pull up or pull down(default 0), driver level(default 1), data> ;For dual link lvds: use lvds2link_pins_a and lvds2link_pins_b instead ;For rgb24: use rgb24_pins_a and rgb24_pins_b instead ;For lvds1: use lvds1_pins_a and lvds1_pins_b instead ;For lvds0: use lvds0_pins_a and lvds0_pins_b instead ;----------------------------------------------------------------------------------*/ &lcd0 { lcd_used = <1>; lcd_driver_name = "default_lcd"; lcd_backlight = <50>; lcd_if = <3>; lcd_x = <800>; lcd_y = <600>; lcd_width = <150>; lcd_height = <94>; lcd_dclk_freq = <40>; lcd_pwm_used = <1>; lcd_pwm_ch = <7>; lcd_pwm_freq = <50000>; lcd_pwm_pol = <1>; lcd_pwm_max_limit = <255>; /*lcd_bl_en = <&pio PD 20 GPIO_ACTIVE_HIGH>;*/ lcd_hbp = <46>; lcd_ht = <1501>; lcd_hspw = <10>; lcd_vbp = <23>; lcd_vt = <1270>; lcd_vspw = <5>; lcd_lvds_if = <0>; lcd_lvds_colordepth = <1>; 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>; pinctrl-1 = <&lvds0_pins_b>; };
麻烦各位帮忙看看,感谢