6.屏幕配置
1. RGB
RGB屏的调试相对简单,只需要把规格书中所描述的时序和规格参数加入相应的配置文件即可,不需要额外的驱动程序。
1.1. uboot 配置
在 luban 根目录下执行 make um,进入 uboot 的功能配置界面,使能显示模块驱动:
Device Drivers
Graphics support
ArtInChip Graphics --->
[*] Enable ArtInChip Video Support
[*] ArtInChip display rgb support
[ ] ArtInChip display lvds support
[ ] ArtInChip display mipi-dsi support
<*> ArtInChip Panel Drivers (ArtInChip general RGB panel) --->
1.2. kernel 配置
在 luban 根目录下执行 make km,进入 kernel 的功能配置界面,使能显示模块驱动:
Device Drivers
Graphics support
ArtInChip Graphics --->
<*> ArtInChip Framebuffer support
[*] ArtInChip display rgb support
[ ] ArtInChip display lvds support
[ ] ArtInChip display mipi-dsi support
<*> ArtInChip Panel Drivers (ArtInChip general RGB panel) --->
1.3. uboot dts
uboot 如果要进行显示,则声明相应的配置为预加载,以 demo88_nand 工程为例,文件为 target/d211/demo88_nand/board-u-boot.dtsi
1.3.1. 声明通路
&disp {
u-boot,dm-pre-reloc;
fb0: fb@0 {
u-boot,dm-pre-reloc;
port {
fb0_out: endpoint {
u-boot,dm-pre-reloc;
}
};
};
};
&de0 {
u-boot,dm-pre-reloc;
port@0 {
de0_in: endpoint {
u-boot,dm-pre-reloc;
};
};
port@1 {
de0_out: endpoint {
u-boot,dm-pre-reloc;
};
};
};
&rgb0 { //RGB
u-boot,dm-pre-reloc;
port@0 {
rgb0_in: endpoint {
u-boot,dm-pre-reloc;
};
};
port@1 {
rgb0_out: endpoint {
u-boot,dm-pre-reloc;
};
};
};
1.3.2. 声明屏幕参数
panel_rgb {
u-boot,dm-pre-reloc;
port {
panel_rgb_in: endpoint {
u-boot,dm-pre-reloc;
};
};
display-timings {
u-boot,dm-pre-reloc;
timing0: 1024x600 {
u-boot,dm-pre-reloc;
};
};
};
1.3.3. 声明屏幕引脚
lcd_rgb565_ld_pins: lcd-1 {
u-boot,dm-pre-reloc;
pins {
u-boot,dm-pre-reloc;
};
};
1.4. 系统dts
系统的 dts 将进行完整的功能配置,以 demo88_nand 工程为例,文件为 target/d211/demo88_nand/board.dts 中
1.4.1. 配置通路
通过 port 和 status 结点,定义了一条数据通道
fb | de | | rgb | panel
port --> port0 port1 --> port0 port1 --> port
&fb0 {
port {
fb0_out: endpoint {
remote-endpoint = <&de0_in>;
};
};
};
&de0 {
status = "okay";
port@0 {
reg = <0>;
de0_in: endpoint {
remote-endpoint = <&fb0_out>;
};
port@1 {
reg = <1>;
de0_out: endpoint {
remote-endpoint = <&rgb0_in>; //RGB
}
};
};
&rgb0 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&lcd_rgb565_ld_pins>; //RGB
pinctrl-1 = <&lcd_rgb565_ld_sleep_pins>;
status = "okay";
port@0 {
reg = <0>;
rgb0_in: endpoint {
remote-endpoint = <&de0_out>;
}
};
port@1 {
reg = <1>;
rgb0_out: endpoint {
remote-endpoint = <&panel_rgb_in>; //RGB
};
};
}
1.4.2. 配置屏幕参数
panel_rgb {
compatible = "artinchip,aic-general-rgb-panel";
status = "okay";
enable-gpios = <&gpio_e 19 GPIO_ACTIVE_HIGH>;
sleep-gpios = <&gpio_e 15 GPIO_ACTIVE_HIGH>;
rgb-mode = <PRGB>;
interface-format = <PRGB_16BIT_LD>;
clock-phase = <DEGREE_0>;
data-order = <RGB>;
disp-dither = <DITHER_RGB565>;
port {
panel_rgb_in: endpoint {
remote-endpoint = <&rgb0_out>;
};
};
display-timings {
native-mode = <&timing0>;
timing0: 1024x600 {
lock-frequency = <52000000>;
hactive = <1024>;
vactive = <600>;
hback-porch = <160>;
hfront-porch = <160>;
hsync-len = <20>;
vback-porch = <12>;
vfront-porch = <20>;
vsync-len = <3>;
de-active = <1>;
pixelclk-active = <1>;
};
};
其中类似 enable-gpios
控制引脚需要根据实际显示屏的需要增加或减少 ,驱动中做相应修改, rgb-mode
interface-format
需要从规格书中获取, data-order
data-mirror
需要根据板级走线的顺序设置相关参数。 clock-phase
需要根据最终实际的显示效果做相应调整。 关于参数详细的解析请参考 显示部分章节DTS关于pannel_rgb的配置说明
1.4.3. 配置引脚
引脚的配置统一在 d211-pinctrl.dtsi 中完成,在 rgb0 节点中直接进行了引用
&rgb0 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&lcd_rgb565_ld_pins>;
pinctrl-1 = <&lcd_rgb565_ld_sleep_pins>;
status = "okay";
......
};
2. LVDS
LVDS 屏的调试和 RGB 类似,只需要把规格书中所描述的时序和规格参数加入相应的配置文件即可,也不需要额外的驱动程序。
2.1. uboot 配置
在 luban 根目录下执行 make um,进入 uboot 的功能配置界面,使能显示模块驱动:
Device Drivers
Graphics support
ArtInChip Graphics --->
[*] Enable ArtInChip Video Support
[ ] ArtInChip display rgb support
[*] ArtInChip display lvds support
[ ] ArtInChip display mipi-dsi support
<*> ArtInChip Panel Drivers (ArtInChip general LVDS panel) --->
2.2. kernel 配置
在 luban 根目录下执行 make km,进入 kernel 的功能配置界面,使能显示模块驱动:
Device Drivers
Graphics support
ArtInChip Graphics --->
<*> ArtInChip Framebuffer support
[ ] ArtInChip display rgb support
[*] ArtInChip display lvds support
[ ] ArtInChip display mipi-dsi support
<*> ArtInChip Panel Drivers (ArtInChip general LVDS panel) --->
2.3. uboot dts
uboot 如果要进行显示,则声明相应的配置为预加载,以 demo128_nand 工程为例,文件为 target/d211/demo128_nand/board-u-boot.dtsi
2.3.1. 声明通路
&disp {
u-boot,dm-pre-reloc;
fb0: fb@0 {
u-boot,dm-pre-reloc;
port {
fb0_out: endpoint {
u-boot,dm-pre-reloc;
}
};
};
};
&de0 {
u-boot,dm-pre-reloc;
port@0 {
de0_in: endpoint {
u-boot,dm-pre-reloc;
};
};
port@1 {
de0_out: endpoint {
u-boot,dm-pre-reloc;
};
};
};
&lvds0 { //lvds
u-boot,dm-pre-reloc;
port@0 {
lvds0_in: endpoint {
u-boot,dm-pre-reloc;
};
};
port@1 {
lvds0_out: endpoint {
u-boot,dm-pre-reloc;
};
};
};
2.3.2. 声明屏幕参数
panel_lvds {
u-boot,dm-pre-reloc;
port {
panel_lvds_in: endpoint {
u-boot,dm-pre-reloc;
};
};
display-timings {
u-boot,dm-pre-reloc;
timing1: 1024x600 {
u-boot,dm-pre-reloc;
};
};
};
2.3.3. 声明屏幕引脚
lvds1_pins: lvds1-0 {
u-boot,dm-pre-reloc;
pins {
u-boot,dm-pre-reloc;
};
};