imx6ul的otg转host功能

平台:imx6ul
内核版本:4.1.15

otg接口默认就是device功能,用于下载镜像,作为从设备
host功能是外接设备(比如U盘、手机),作为主设备

imx6ul的otg默认作为从设备,如果需要作为主设备,需要修改设备树/arch/arm/boot/dts/tq-imx6ul.dts
1.搜索otg
usbotg1是开发板默认otg作为usb otg功能
usbotg2是设置板卡的USB HOS功能
2.复制一份usbotg1参考usbotg2修改参数

/*
&usbotg1 {
	dr_mode = "otg";
	srp-disable;
	hnp-disable;
	adp-disable;
	status = "disable";
};
*/
&usbotg1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_usbhost>;
	reset-gpio = <&gpio1 18 GPIO_ACTIVE_LOW>;
	dr_mode = "host";
	disable-over-current;
	status = "okay";
};
&usbotg2 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_usbhost>;
	reset-gpio = <&gpio1 18 GPIO_ACTIVE_LOW>;
	dr_mode = "host";
	disable-over-current;
	status = "okay";
};

3.重新编译,烧写设备树

你可能感兴趣的:(linux)