【TINY4412】LINUX移植笔记:(10)USB OTG

环境

宿主机 : 虚拟机 Ubuntu 16.04 LTS / X64
目标板[底板]: Tiny4412SDK - 1506
目标板[核心板]: Tiny4412 - 1412
LINUX内核: 4.12.0
交叉编译器: arm-none-linux-gnueabi-gcc(gcc version 4.8.3 20140320)
日期: 2017-9-9 20:30:09
作者: SY

简介

前面已经移植好了USB接口,USB-OTG就很简单了。

设备树

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# exynos4.dtsi
hsotg: hsotg@12480000 {
compatible = "samsung,s3c6400-hsotg";
reg = <0x12480000 0x20000>;
interrupts = <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clock CLK_USB_DEVICE>;
clock-names = "otg";
phys = <&exynos_usbphy 0>;
phy-names = "usb2-phy";
status = "disabled";
};
# exynos4412-tiny4412.dts
&hsotg {
status = "okay";
};
1
2
3
Device Drivers --->
[*] USB support --->
[*] OTG support

分析

找到./driver/usb/dwc2/platform.c

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module_platform_driver(dwc2_platform_driver);
static struct platform_driver dwc2_platform_driver = {
.driver = {
.name = dwc2_driver_name,
.of_match_table = dwc2_of_match_table,
.pm = &dwc2_dev_pm_ops,
},
.probe = dwc2_driver_probe, -->
.remove = dwc2_driver_remove,
.shutdown = dwc2_driver_shutdown,
};
static int dwc2_driver_probe(struct platform_device *dev)
{
}

测试

1
2
3
4
5
6
7
8
0.881087] dwc2 12480000.hsotg: 12480000.hsotg supply vusb_d not found, using dummy regulator
[ 0.889656] dwc2 12480000.hsotg: 12480000.hsotg supply vusb_a not found, using dummy regulator
[ 1.302603] dwc2 12480000.hsotg: dwc2_check_params: Invalid parameter g_np_tx_fifo_size=1024
[ 1.302709] dwc2 12480000.hsotg: EPs: 16, dedicated fifos, 7808 entries in SPRAM
[ 1.422647] dwc2 12480000.hsotg: DWC OTG Controller
[ 1.422712] dwc2 12480000.hsotg: new USB bus registered, assigned bus number 1
[ 1.422796] dwc2 12480000.hsotg: irq 45, io mem 0x12480000
[ 1.422980] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
SY wechat
扫一扫,用手机访问本站