iTOP-iMX6 boards - the device tree expanded configuration and test kernel -IO 01

When users design products, some features may not need development board, while the need for more GPIO.
Many are iMX6 the IO can be multiplexed and to be configured as a GPIO, an example where IO to the camera, which is
partially configured as a GPIO camera mode.
1 remove ov5640 driven
first of all to remove ov5640 drive.
Menuconfig configuration interface to enter, select and enter "Device Drivers --->", as shown below.

Select and enter "Multimedia support --->", as shown below.

Select and enter "V4L platform devices --->", as shown below.

Select and enter "MXC Video For Linux Video Capture" "MXC Camera / V4L2 PRP at
Features support --->", as shown below.

As shown below, to remove the "OmniVision ov5640 camera support", save the configuration and exit.

Save the configuration, overwrite arch / arm / configs the corresponding configuration file.
Drive configuration is complete, the file also need to modify the device tree.
2 IO resource consolidation
IO resource consolidation means that the network numbers and PIN numbers foot pin, sorting out the GPIO device tree macro needs
to define and nr (pin number, for testing).
DETAILED Reference "iTOP-iMX6- apparatus analyzes the document tree kernel configuration -IO _V1.0" documents is given here of only the
result of sorting out, as shown in FIG.

上图的文字版在文档压缩包“camera 的 IO 扩展资源”文本中。
3 设备树配置
需要修改设备树文件“arch/arm/boot/dts/imx6qdl-sabresd.dtsi”。
首先将 camera 的 IO 有关的设备树文件注释掉,
如下图所示,将设备注册 GPIO 部分注释掉

如下图所示,将 camera 的 GPIO 初始化配置注释掉

如下图所示,添加我们要用到的 GPIO 配置。

至此,所有的修改完成,保存,重新编译烧写到开发板。
4 sys 测试
烧写到开发板之后,使用 sys 的方式测试 IO。
以 camera 的 pin5 脚为例,nr 是 17。
使用以下命令测试:
echo 17 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio17/direction
echo 1 > /sys/class/gpio/gpio17/value ---> 写高电平
万用表测试是高电平
echo 0 > /sys/class/gpio/gpio17/value ---> 写低电平
万用表测试是低电平。

本文档主要介绍 iTOP-iMX6 开发板的使用方法,旨在帮助用户快速掌握该产品的应用特
点,通过对开发板进行后续软硬件开发,衍生出符合特定需求的应用系统。

Guess you like

Origin www.cnblogs.com/mingyue77/p/11345434.html