一、驱动配置 io模拟i2c驱动在内核的路径:linux-4.1.15-elf1/drivers/i2c/busses/i2c-gpio.c (1)修改linux-4.1.15-elf1/drivers/i2c/busses/Makefile
(2)修改arch/arm/configs/imx6ull_elf1_defconfig,配置为y编译进内核
(3)编译内核 elf@ubuntu:~/work/linux-4.1.15-elf1$ . /opt/fsl-imx-x11/4.1.15-2.0.0/environment-setup-cortexa7hf-neon-poky-linux-gnueabi elf@ubuntu:~/work/linux-4.1.15-elf1$ make imx6ull_elf1_defconfig elf@ubuntu:~/work/linux-4.1.15-elf1$ make zImage
二、设备树修改 设备树路径:linux-4.1.15-elf1/arch/arm/boot/dts/imx6ull-elf1-emmc.dts (1)将i2c节点放到根节点下
(2) iomuxc节点复用IO引脚
(3)编译设备树 elf@ubuntu:~/work/linux-4.1.15-elf1$ make dtbs
三、替换内核和设备树 (1)将imx6ull-elf1-emmc.dtb和zImage拷贝到U盘 root@ELF1:~# cp /run/media/sda1/imx6ull-elf1-emmc.dtb /run/media/mmcblk1p1/ root@ELF1:~# cp /run/media/sda1/zImage /run/media/mmcblk1p1/ root@ELF1:~# sync (3)重启开发板在文件系统相应路径下可以看到新的i2c节点 root@ELF1:~# ls /dev/i2c-* /dev/i2c-0 /dev/i2c-1 /dev/i2c-4
|