1
完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
1.1实验原理
STM32MP157A系列SoC中默认没有HDMI相关控制器,FS-MP1A使用SiI9022芯片将RGB信号转化为HDMI信号。STM32MP157A集成LTDC(LCD-TFT Display Controller),提供一个24bit RGB并行接口用于连接到各种LCD和TFT面板。 SiI9022芯片通过I2C5总线与SoC进行交互,通过SoC的LCD_PCLK、LCD_VSYNC、LCD_HSYNC、LCD_DEN与RGB信号线来进行图像信号的传输,通过I2S2总线进行音频数据的传输。 查看原理图确认I2C5、中断、复位管脚对应关系:
LCD接口管脚对应关系:
参考文档: Documentation/devicetree/bindings/i2c/i2c-stm32.txt 内核中ST对STM32MP15x系列芯片的设备树资源了做了定义,可参见: arch/arm/boot/dts/stm32mp151.dtsi stm32mp151中i2c5定义如下: i2c5: i2c@40015000 { compatible = "st,stm32mp15-i2c"; reg = <0x40015000 0x400>; interrupt-names = "event", "error"; interrupts-extended = <&exti 25 IRQ_TYPE_LEVEL_HIGH>, <&intc GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>; clocks = <&rcc I2C5_K>; resets = <&rcc I2C5_R>; #address-cells = <1>; #size-cells = <0>; dmas = <&dmamux1 115 0x400 0x80000001>, <&dmamux1 116 0x400 0x80000001>; dma-names = "rx", "tx"; power-domains = <&pd_core>; st,syscfg-fmp = <&syscfg 0x4 0x10>; wakeup-source; status = "disabled"; }; 上述代码只对i2c5做了基本的初始化,并没有针对不同的硬件设计做适配,所以需结合硬件补全设备树节点信息。 参考stm32mp15xx-dkx.dtsi对于i2c设备节点的描述,修改i2c5内容如下: &i2c5 { pinctrl-names = "default", "sleep"; pinctrl-0 = <&i2c5_pins_a>; pinctrl-1 = <&i2c5_pins_sleep_a>; i2c-scl-rising-time-ns = <100>; i2c-scl-falling-time-ns = <7>; clock-frequency = <100000>; /* spare dmas for other usage */ /delete-property/dmas; /delete-property/dma-names; status = "okay"; }; 由于stm32mp15-pinctrl.dtsi中对于i2c5_pins_a和i2c5_pins_sleep_a的定义与板子实际使用管脚一致,所以无需修改,内容如下: i2c5_pins_a: i2c5-0 { pins { pinmux = bias-disable; drive-open-drain; slew-rate = <0>; }; }; i2c5_pins_sleep_a: i2c5-1 { pins { pinmux = }; };
参考文档: Documentation/devicetree/bindings/i2c/sound/st,stm32-i2s.txt
SiI9022实现HDMI输出需要RGB信号作为数据源,LTDC为STM32MP157的LCD显示控制器,可以输出24bit的并行数据,HDMI显示首先需要驱动LTDC。 参考文档: Documentation/devicetree/bindings/display/st,stm32-ltdc.txt 内核中ST对STM32MP15x系列芯片的设备树资源了做了定义,可参见: arch/arm/boot/dts/stm32mp151.dtsi stm32mp151中ltdc定义如下: ltdc: display-controller@5a001000 { compatible = "st,stm32-ltdc"; reg = <0x5a001000 0x400>; interrupts = clocks = <&rcc LTDC_PX>; clock-names = "lcd"; resets = <&rcc LTDC_R>; status = "disabled"; }; 上述代码只对ltdc做了基本的初始化,并没有针对不同的硬件设计做适配,所以需结合硬件补全设备树节点信息。 参考stm32mp15xx-dkx.dtsi对于ltdc设备节点的描述,需增加内容如下: pinctrl-names = "default", "sleep"; pinctrl-0 = < pinctrl-1 = < status = "okay"; port { #address-cells = <1>; #size-cells = <0>; ltdc_ep0_out: endpoint@0 { reg = <0>; /*图像输出通道,需对接显示设备*/ remote-endpoint = <&sii9022_in>; }; }; }; 由于stm32mp15-pinctrl.dtsi中对于ltdc_pins_b和ltdc_pins_b的定于与板子实际使用管脚一致,所以无需修改,内容如下: ltdc_pins_b: ltdc-b-0 { pins { pinmux = bias-disable; drive-push-pull; slew-rate = <1>; }; }; ltdc_pins_sleep_b: ltdc-b-1 { pins { pinmux = }; };
参考文档: Documentation/devicetree/bindings/display/arm,hdlcd.txt 由于SiI9002只是I2C5总线上的一个外设,所以STM32MP157A的通用设备树文件中并没有相关的定义,结合arm,hdlcd.txt和stm32mp15xx-dkx.dtsi对于HDMI的描述,增加SiI9002的支持,需在I2C5节点下添加相关信息,添加内容为: hdmi-transmitter@39 { compatible = "sil,sii9022"; reg = <0x39>; iovcc-supply = <&v3v3_hdmi>; cvcc12-supply = <&v1v2_hdmi>; reset-gpios = <&gpioa 10 GPIO_ACTIVE_LOW>; interrupts = <1 IRQ_TYPE_EDGE_FALLING>; interrupt-parent = <&gpiog>; #sound-dai-cells = <0>; status = "okay"; ports { #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; sii9022_in: endpoint { /*视频输入端口,与LTDC输出端口对接*/ remote-endpoint = < }; }; port@3 { reg = <3>; sii9022_tx_endpoint: endpoint { /*音频输入端口,与声卡输出端口对接*/ remote-endpoint = <&i2s2_endpoint>; }; }; }; };
由于内核中很多驱动会根据电源的方位调整设备的工作方式,所以在设备树中需要传递相关电源电压参数,如sii9022驱动中需要两个电源分别是iovcc和cvcc12,但是在设备树中并没有这两个电源的定义,官方参考板DK1使用的是MPU作为电源管理,而FS-MP1A使用的分离元器件的形式,所以stm32mp15xx-dkx.dtsi中对于电源的定义就不实用了。参考内核中相关文档添加固定电源节点的形式添加iovcc和cvcc12即可,根据sii9022的需求,iovcc和cvcc12电压分别为3.3v和1.2v。 参考文档 Documentation/devicetree/bindings/regulator/fixed-regulator.yaml 需在设备树根节点下添加,内容如下: v3v3_hdmi: regulator-v3v3-hdmi { compatible = "regulator-fixed"; regulator-name = "v3v3_hdmi "; regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; regulator-always-on; regulator-boot-on; }; v1v2_hdmi: regulator-v1v2-hdmi { compatible = "regulator-fixed"; regulator-name = "v1v2_hdmi"; regulator-min-microvolt = <1200000>; regulator-max-microvolt = <1200000>; regulator-always-on; regulator-boot-on; }; 1.2实验目的 熟悉基于Linux操作系统下的HDMI设备驱动移植配置过程。 1.3实验平台 华清远见开发环境,FS-MP1A平台; 1.4实验步骤
linux@ubuntu:$ source /opt/st/stm32mp1/3.1-openstlinux-5.4-dunfell-mp1-20-06-24/environment-setup-cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi
修改arch/arm/boot/dts/stm32mp15xx-fsmp1x.dtsi文件,在文件末尾添加如下内容: &i2c5 { pinctrl-names = "default", "sleep"; pinctrl-0 = <&i2c5_pins_a>; pinctrl-1 = <&i2c5_pins_sleep_a>; i2c-scl-rising-time-ns = <100>; i2c-scl-falling-time-ns = <7>; clock-frequency = <100000>; /* spare dmas for other usage */ /delete-property/dmas; /delete-property/dma-names; status = "okay"; hdmi-transmitter@39 { compatible = "sil,sii9022"; reg = <0x39>; iovcc-supply = <&v3v3_hdmi>; cvcc12-supply = <&v1v2_hdmi>; reset-gpios = <&gpioa 13 GPIO_ACTIVE_LOW>; interrupts = <14 IRQ_TYPE_EDGE_FALLING>; interrupt-parent = <&gpioa>; #sound-dai-cells = <0>; status = "okay"; ports { #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; sii9022_in: endpoint { remote-endpoint = < }; }; }; }; };
修改arch/arm/boot/dts/stm32mp15xx-fsmp1x.dtsi文件,在文件末尾添加如下内容: pinctrl-names = "default", "sleep"; pinctrl-0 = < pinctrl-1 = < status = "okay"; port { #address-cells = <1>; #size-cells = <0>; ltdc_ep0_out: endpoint@0 { reg = <0>; remote-endpoint = <&sii9022_in>; }; }; };
修改arch/arm/boot/dts/stm32mp15xx-fsmp1x.dtsi文件,在根节点末尾添加如下内容: v3v3_hdmi: regulator-v3v3-hdmi { compatible = "regulator-fixed"; regulator-name = "v3v3_hdmi "; regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; regulator-always-on; regulator-boot-on; }; v1v2_hdmi: regulator-v1v2-hdmi { compatible = "regulator-fixed"; regulator-name = "v1v2_hdmi"; regulator-min-microvolt = <1200000>; regulator-max-microvolt = <1200000>; regulator-always-on; regulator-boot-on; };
由于内核源码默认配置以及支持sii902x,本节列出主要选项,如下: linux@ubuntu:$ make menuconfig Device Drivers ---> Graphics support ---> <*> Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) ---> <*> DRM Support for STMicroelectronics SoC Series Display Interface Bridges ---> <*> Silicon Image sii902x RGB/HDMI bridge
linux@ubuntu:$ make -j4 uImage dtbs LOADADDR=0xC2000040
将编译好的设备树和内核镜像拷贝到/tftpboot目录下,通过tftp引导内核,设备连接HDMI显示器,重启设备后查看/sys/class/drm会多出HMID的信息,同时显示器会有显示。 |
|||
|
|||
只有小组成员才能发言,加入小组>>
3310 浏览 9 评论
2991 浏览 16 评论
3492 浏览 1 评论
9055 浏览 16 评论
4086 浏览 18 评论
1174浏览 3评论
603浏览 2评论
const uint16_t Tab[10]={0}; const uint16_t *p; p = Tab;//报错是怎么回事?
596浏览 2评论
用NUC131单片机UART3作为打印口,但printf没有输出东西是什么原因?
2333浏览 2评论
NUC980DK61YC启动随机性出现Err-DDR是为什么?
1894浏览 2评论
小黑屋| 手机版| Archiver| 德赢Vwin官网 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-21 22:03 , Processed in 1.215070 second(s), Total 78, Slave 59 queries .
Powered by 德赢Vwin官网 网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
德赢Vwin官网 观察
版权所有 © 湖南华秋数字科技有限公司
德赢Vwin官网 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号