全志T507主板linux体系的快速调试

分享
计算机软件开发 2024-9-14 03:53:14 84 0 来自 中国
我们都知道,T507要改动设置和重新分配处置惩罚器的引脚,都要先改动DTS,然后重新编译内核,把固件烧写到板上举行调试。
这种方式费时,费力。那么怎样淘汰编译次数,同时快速调试主板呢?盈鹏飞嵌入式给出一个方法,仅供各人参考。
以下先容内容均在盈鹏飞嵌入式AHD-T507(CoM-T507)主板验证通过。以下是AHD-T507主板的先容:
AHD-T507产物功能图:

产物特性:
采用Allwinner公司Cortex-A53四核T507处置惩罚器,运行最高速率为1.5GHZ;
支持Mali-G31 MP2 GPU,支持OpenGL ES 3.2/2.0/1.0, Valkan 1.1,OpenCL 2.0
支持4K/25fps H.264视频编码,支持4K/15fps MJPEG编码;
多格式4K/60fps视频解码 (H.265,H.264,VC-1, MPEG-1/2/4, VP8) ;
支持双屏异显;支持RGB666/LVDS,分辨率最高1920x1080/60fps;支持HDMI 2.0A, 分辨率最高4K/60fps;支持TV CVBS OUT(NTSC/PAL);
支持1-2G  Bytes LPDDR4 SDRAM;
支持EMMC 4G-64G大容量电子盘,可启动;
支持SDIO3.0,5路USB2.0 HOST和一起OTG,1路I2C,4路RS485, 2路PWM(应用于背光)
支持双路以太网,一起10/100M;一起10/100/1000M;
支持3G/4G通讯;
支持6路AHD视频输入;
稳固的操纵体系的支持,可预装Android10.0/LINUX 4.9/UBUNTU 20.04;
尺寸为:146*132MM
假如要快速验证功能,一种是改动DTS,然后重新编译内核等,烧写固件举行验证,那么是否有更快捷的办法呢?
答案是有的,那就是在线更改DTS。我们都知道,DTS颠末编译后,就会变成DTB文件,组后烧写到板上,每次linux体系启动时,
DTb就会加载到内存,从而设置好主板的相干硬件并加载驱动。怎样在线改动DTS呢?这里我们就要先容的是u-boot相干fdt指令。
1. uboot FDT命令阐明
FDT:flattened device tree的缩写
在UBOOT控制台停下后,输入fdt,可以检察fdt命令资助
xxx#fdt
fdt - flattened device tree utility commands
Usage:
fdt addr [-c]  <addr> [<length>]   - Set the [control] fdt location to<addr>
fdt move  <fdt> <newaddr> <length> - Copy the fdt to<addr> and make it active
fdt resize                          - Resize fdt to size+ padding to 4k addr
fdt print <path> [<prop>]         - Recursive print starting at <path>
fdt list  <path> [<prop>]         - Print one level starting at <path>
fdt get value <var> <path><prop>   - Get <property> andstore in <var>
fdt get name <var> <path> <index>   - Get name of node <index> and storein <var>
fdt get addr <var> <path><prop>    - Get start address of<property> and store in <var>
fdt get size <var> <path>[<prop>]  - Get size of[<property>] or num nodes and store in <var>
fdt set   <path> <prop> [<val>]    - Set <property> [to <val>]
fdt mknode <path> <node>            - Create a new node after<path>
fdt rm    <path> [<prop>]         - Delete the node or <property>
fdt header                          - Display header info
fdt bootcpu <id>                    - Set boot cpuid
fdt memory <addr> <size>            - Add/Update memory node
fdt rsvmem print                    - Show current mem reserves
fdt rsvmem add <addr><size>        - Add a mem reserve
fdt rsvmem delete <index>           - Delete a mem reserves
fdt chosen [<start> <end>]          - Add/update the /chosen branch inthe tree
                                       <start>/<end> - initrd start/end addr
fdt save                           - write fdt to flash
NOTE: Dereference aliases by omiting theleading '/', e.g. fdt print ethernet0.
sunxi#
注:
此中常用的命令就是fdt list 和 fdt set,fdt save.
Fdt list用来查询节点设置
Fdt set 用来修改节点设置
fdt save用来生存修改过的节点。
查询设置
起首确定要查询的字段在device tree的路径,假如不知蹊径径,则须要用fdt命令查询:
2.1第一步根目次下查找
xxx#fdtlist  /   
假如找到须要的设置,好比wlan的设置,运行如下命令即可
xxx#fdtlist /wlan                //留意路径中的 /
2.2第二步soc目次查找
fdtlist /soc
2.3第三步使用别名查找
别名是device tree中完备路径的一个简写,有一个专门的节点( /aliases )来表现别名的相干信息,用如下命令可以检察体系中别名的设置情况:
sunxi#fdtlist /aliases
aliases{
        serial0 ="/soc@01c00000/uart@01c28000";
       ..............
        mmc0 ="/soc@01c00000/sdmmc@01c0f000";
        mmc2 ="/soc@01c00000/sdmmc@01C11000";
        nand0 ="/soc@01c00000/nand0@01c03000";
        disp ="/soc@01c00000/disp@01000000";
        lcd0 ="/soc@01c00000/lcd0@01c0c000";
        hdmi = "/soc@01c00000/hdmi@01ee0000";
        pwm ="/soc@01c00000/pwm@01c21400";
        boot_disp ="/soc@01c00000/boot_disp";
};
盈鹏飞嵌入式在开辟AHD-T507主板的时间,常常有效户要适配液晶屏,每次编译内核非常的耗时间。
以下就以调解液晶参数举行阐明:
调解液晶屏参数,通常涉及两个节点,一个是disp节点,另外一个是lcd0节点。
我们先看看disp节点有什么?
=> fdt list disp
disp@01000000 {
        boot_fb0 = "bbf592c0,400,258,20,1000,70,3c,390,21c";
        boot_disp2 = <0x00000004>;
        boot_disp1 = <0x01040000>;
        compatible = "allwinner,sunxi-disp";
        reg = * 0xbbedb92c [0x00000060];
        interrupts = <0x00000000 0x00000058 0x00000004 0x00000000 0x00000040 0x00000004 0x00000000 0x00000041 0x00000004 0x00000000 0x00000042 0x00000004 0x00000000 0x00000043 0x00000004>;
        clocks = <0x0000000b 0x000000ae 0x00000012 0x00000013 0x00000014 0x00000015 0x00000016>;
        boot_disp = <0x00000104>;
        fb_base = <0x00000000>;
        iommus = <0x00000028 0x00000000 0x00000000>;
        status = "okay";
        disp_init_enable = <0x00000001>;
        disp_mode = <0x00000003>;
        screen0_output_type = <0x00000001>;
        screen0_output_mode = <0x00000004>;
        screen1_output_type = <0x00000003>;
        screen1_output_mode = <0x0000000a>;
        screen1_output_format = <0x00000000>;
        screen1_output_bits = <0x00000000>;
        screen1_output_eotf = <0x00000004>;
        screen1_output_cs = <0x00000101>;
        screen1_output_dvi_hdmi = <0x00000002>;
        screen1_output_range = <0x00000002>;
        screen1_output_scan = <0x00000000>;
        screen1_output_aspect_ratio = <0x00000008>;
        dev0_output_type = <0x00000001>;
        dev0_output_mode = <0x00000004>;
        dev0_screen_id = <0x00000000>;
        dev0_do_hpd = <0x00000000>;
        dev1_output_type = <0x00000003>;
        dev1_output_mode = <0x0000000a>;
        dev1_screen_id = <0x00000001>;
        dev1_do_hpd = <0x00000001>;
        def_output_dev = <0x00000000>;
        hdmi_mode_check = <0x00000001>;
        fb0_format = <0x00000009>;
        fb0_width = <0x00000400>;
        fb0_height = <0x00000258>;
        fb1_format = <0x00000000>;
        fb1_width = <0x00000780>;
        fb1_height = <0x00000438>;
        chn_cfg_mode = <0x00000001>;
        disp_para_zone = <0x00000001>;
        dc1sw-supply = <0x000000af>;
        bldo1-supply = <0x0000005b>;
        cldo4-supply = <0x00000062>;
        screen0_output_format = <0x00000000>;
        screen0_output_bits = <0x00000000>;
        screen0_output_eotf = <0x00000004>;
        screen0_output_cs = <0x00000101>;
        screen0_output_dvi_hdmi = <0x00000002>;
        screen0_output_range = <0x00000002>;
        screen0_output_scan = <0x00000000>;
        screen0_output_aspect_ratio = <0x00000008>;
};
以下指令我们把这个disp_mode设置为0;
=> fdt set disp disp_mode <0>;
=> fdt list disp
disp@01000000 {
        boot_fb0 = "bbf592c0,400,258,20,1000,70,3c,390,21c";
        boot_disp2 = <0x00000004>;
        boot_disp1 = <0x01040000>;
        compatible = "allwinner,sunxi-disp";
        reg = * 0xbbedb92c [0x00000060];
        interrupts = <0x00000000 0x00000058 0x00000004 0x00000000 0x00000040 0x00000004 0x00000000 0x00000041 0x00000004 0x00000000 0x00000042 0x00000004 0x00000000 0x00000043 0x00000004>;
        clocks = <0x0000000b 0x000000ae 0x00000012 0x00000013 0x00000014 0x00000015 0x00000016>;
        boot_disp = <0x00000104>;
        fb_base = <0x00000000>;
        iommus = <0x00000028 0x00000000 0x00000000>;
        status = "okay";
        disp_init_enable = <0x00000001>;
        disp_mode = <0x00000000>;
        screen0_output_type = <0x00000001>;
        screen0_output_mode = <0x00000004>;
        screen1_output_type = <0x00000003>;
        screen1_output_mode = <0x0000000a>;
        screen1_output_format = <0x00000000>;
        screen1_output_bits = <0x00000000>;
        screen1_output_eotf = <0x00000004>;
        screen1_output_cs = <0x00000101>;
        screen1_output_dvi_hdmi = <0x00000002>;
        screen1_output_range = <0x00000002>;
        screen1_output_scan = <0x00000000>;
        screen1_output_aspect_ratio = <0x00000008>;
        dev0_output_type = <0x00000001>;
        dev0_output_mode = <0x00000004>;
        dev0_screen_id = <0x00000000>;
        dev0_do_hpd = <0x00000000>;
        dev1_output_type = <0x00000003>;
        dev1_output_mode = <0x0000000a>;
        dev1_screen_id = <0x00000001>;
        dev1_do_hpd = <0x00000001>;
        def_output_dev = <0x00000000>;
        hdmi_mode_check = <0x00000001>;
        fb0_format = <0x00000009>;
        fb0_width = <0x00000400>;
        fb0_height = <0x00000258>;
        fb1_format = <0x00000000>;
        fb1_width = <0x00000780>;
        fb1_height = <0x00000438>;
        chn_cfg_mode = <0x00000001>;
        disp_para_zone = <0x00000001>;
        dc1sw-supply = <0x000000af>;
        bldo1-supply = <0x0000005b>;
        cldo4-supply = <0x00000062>;
        screen0_output_format = <0x00000000>;
        screen0_output_bits = <0x00000000>;
        screen0_output_eotf = <0x00000004>;
        screen0_output_cs = <0x00000101>;
        screen0_output_dvi_hdmi = <0x00000002>;
        screen0_output_range = <0x00000002>;
        screen0_output_scan = <0x00000000>;
        screen0_output_aspect_ratio = <0x00000008>;
};
生存设置;
=> fdt save
uboot size = 0xd8000
storage type = 2
=> fdt list disp
disp@01000000 {
        boot_fb0 = "bbf592c0,400,258,20,1000,70,3c,390,21c";
        boot_disp2 = <0x00000004>;
        boot_disp1 = <0x01040000>;
        compatible = "allwinner,sunxi-disp";
        reg = * 0xbbedb92c [0x00000060];
        interrupts = <0x00000000 0x00000058 0x00000004 0x00000000 0x00000040 0x00000004 0x00000000 0x00000041 0x00000004 0x00000000 0x00000042 0x00000004 0x00000000 0x00000043 0x00000004>;
        clocks = <0x0000000b 0x000000ae 0x00000012 0x00000013 0x00000014 0x00000015 0x00000016>;
        boot_disp = <0x00000104>;
        fb_base = <0x00000000>;
        iommus = <0x00000028 0x00000000 0x00000000>;
        status = "okay";
        disp_init_enable = <0x00000001>;
        disp_mode = <0x00000000>;
        screen0_output_type = <0x00000001>;
        screen0_output_mode = <0x00000004>;
        screen1_output_type = <0x00000003>;
        screen1_output_mode = <0x0000000a>;
        screen1_output_format = <0x00000000>;
        screen1_output_bits = <0x00000000>;
        screen1_output_eotf = <0x00000004>;
        screen1_output_cs = <0x00000101>;
        screen1_output_dvi_hdmi = <0x00000002>;
        screen1_output_range = <0x00000002>;
        screen1_output_scan = <0x00000000>;
        screen1_output_aspect_ratio = <0x00000008>;
        dev0_output_type = <0x00000001>;
        dev0_output_mode = <0x00000004>;
        dev0_screen_id = <0x00000000>;
        dev0_do_hpd = <0x00000000>;
        dev1_output_type = <0x00000003>;
        dev1_output_mode = <0x0000000a>;
        dev1_screen_id = <0x00000001>;
        dev1_do_hpd = <0x00000001>;
        def_output_dev = <0x00000000>;
        hdmi_mode_check = <0x00000001>;
        fb0_format = <0x00000009>;
        fb0_width = <0x00000400>;
        fb0_height = <0x00000258>;
        fb1_format = <0x00000000>;
        fb1_width = <0x00000780>;
        fb1_height = <0x00000438>;
        chn_cfg_mode = <0x00000001>;
        disp_para_zone = <0x00000001>;
        dc1sw-supply = <0x000000af>;
        bldo1-supply = <0x0000005b>;
        cldo4-supply = <0x00000062>;
        screen0_output_format = <0x00000000>;
        screen0_output_bits = <0x00000000>;
        screen0_output_eotf = <0x00000004>;
        screen0_output_cs = <0x00000101>;
        screen0_output_dvi_hdmi = <0x00000002>;
        screen0_output_range = <0x00000002>;
        screen0_output_scan = <0x00000000>;
        screen0_output_aspect_ratio = <0x00000008>;
};
再举行lcd0节点的检察和设置:
=> fdt list lcd0
lcd0@01c0c000 {
        compatible = "allwinner,sunxi-lcd0";
        pinctrl-names = "active", "sleep";
        status = "okay";
        lcd_used = <0x00000001>;
        lcd_driver_name = "default_lcd";
        lcd_backlight = <0x000000c8>;
        lcd_if = <0x00000003>;
        lcd_x = <0x00000400>;
        lcd_y = <0x00000258>;
        lcd_width = <0x00000096>;
        lcd_height = <0x0000005e>;
        lcd_dclk_freq = <0x00000032>;
        lcd_pwm_used = <0x00000001>;
        lcd_pwm_ch = <0x00000000>;
        lcd_pwm_freq = <0x0000c350>;
        lcd_pwm_pol = <0x00000001>;
        lcd_pwm_max_limit = <0x000000ff>;
        lcd_hbp = <0x000000a0>;
        lcd_ht = <0x0000052c>;
        lcd_hspw = <0x00000074>;
        lcd_vbp = <0x00000018>;
        lcd_vt = <0x00000275>;
        lcd_vspw = <0x00000003>;
        lcd_lvds_if = <0x00000000>;
        lcd_lvds_colordepth = <0x00000000>;
        lcd_lvds_mode = <0x00000000>;
        lcd_frm = <0x00000000>;
        lcd_hv_clk_phase = <0x00000000>;
        lcd_hv_sync_polarity = <0x00000000>;
        lcd_gamma_en = <0x00000000>;
        lcd_bright_curve_en = <0x00000000>;
        lcd_cmap_en = <0x00000000>;
        lcd_fsync_en = <0x00000000>;
        lcd_fsync_act_time = <0x000003e8>;
        lcd_fsync_dis_time = <0x000003e8>;
        lcd_fsync_pol = <0x00000000>;
        deu_mode = <0x00000000>;
        lcdgamma4iep = <0x00000016>;
        smart_color = <0x0000005a>;
        lcd_pin_power = "bldo1";
        lcd_power = "dc1sw";
        lcd_bl_en = <0x00000032 0x00000003 0x00000017 0x00000001 0x00000000 0x00000003 0x00000001>;
        pinctrl-0 = <0x000000b0>;
        pinctrl-1 = <0x000000b1>;
};
=>
盼望这个阐明对广大朋侪有效!欢迎互换。
您需要登录后才可以回帖 登录 | 立即注册

Powered by CangBaoKu v1.0 小黑屋藏宝库It社区( 冀ICP备14008649号 )

GMT+8, 2024-10-19 06:17, Processed in 0.153438 second(s), 32 queries.© 2003-2025 cbk Team.

快速回复 返回顶部 返回列表