Linux4.9.9内核USB移植(适配fs4412平台)

本文适配fs4412开发板,使用的内核为linux4.9.9。

  1. 修改设备树文件
vi  arch/arm/boot/dts/exynos4412-liebao.dts

添加如下内容:

usbphy: usbphy@125B0000 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "samsung,exynos4x12-usb2phy";
reg = <0x125B0000 0x100>;
ranges;
clocks = <&clock 2>, <&clock 305>;
clock-names = "xusbxti", "otg";
usbphy-sys {
reg = <0x10020704 0x8 0x1001021c 0x4>;
};
};
ehci@12580000 {
status = "okay";
usbphy = <&usbphy>;
};
usb3503@08 {
compatible = "smsc,usb3503";
reg = <0x08 0x4>;
connect-gpios = <&gpm3 3 1>;
intn-gpios = <&gpx2 3 1>;
reset-gpios = <&gpm2 4 1>;
initial-mode = <1>;
};

注意:放在根节点中

  1. 配置内核
make menuconfig

Device Drivers --->
        [*] USB support --->
        <*> EHCI HCD (USB 2.0) support
        <*>EHCI support for Samsung S5P/EXYNOS SoC Series
        <*> USB Mass Storage support
        <*> USB3503 HSIC to USB20 Driver
USB Physical Layer drivers --->
        <*> Samsung USB 2.0 PHY controller Driver
SCSI device support --->
        <*> SCSI device support
        <*> SCSI disk support
        <*> SCSI generic support
  1. 编译内核和设备树
 make uImage -j2 LOADADDR=0X40008000
make dtbs
  1. 测试:
    拷贝内核和设备树文件到/tftpboot 目录下

cp arch/arm/boot/uImage /tftpboot
cp arch/arm/boot/dts/exynos4412-liebao.dtb /tftpboot/

启动目标板并在目标板上完成如下操作:
插入 U 盘显示如下

[   31.541687] usb 1-3.3: new high-speed USB device number 3 using exynos-ehci
[   31.657886] usb 1-3.3: New USB device found, idVendor=1f75, idProduct=0917
[   31.663307] usb 1-3.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   31.670597] usb 1-3.3: Product: Teclast CoolFlash
[   31.675285] usb 1-3.3: Manufacturer: Generic
[   31.679537] usb 1-3.3: SerialNumber: 201207222874
[   31.685043] usb-storage 1-3.3:1.0: USB Mass Storage device detected
[   31.691154] scsi host0: usb-storage 1-3.3:1.0
[   32.722436] scsi 0:0:0:0: Direct-Access     Teclast  CoolFlash USB3.0 1.00 PQ: 0 ANSI: 6
[   32.730975] sd 0:0:0:0: [sda] 30679040 512-byte logical blocks: (15.7 GB/14.6 GiB)
[   32.737423] sd 0:0:0:0: Attached scsi generic sg0 type 0
[   32.742672] sd 0:0:0:0: [sda] Write Protect is off
[   32.747667] sd 0:0:0:0: [sda] Write cache: disabled, read cache: disabled, doesn't support DPO or FUA
[   32.760661]  sda:
[   32.763408] sd 0:0:0:0: [sda] Attached SCSI removable disk

在终端上执行挂载的设备与上边显示相关

# mount -t vfat /dev/sda  /mnt
# ls

可以查看到 U 盘内容,即完成实验。
注:有关linux4.9.9内核的移植见《移植最新的linux4.9.9内核(适配fs4412平台)》:
http://blog.csdn.net/liebao_han/article/details/79436819
文章内容持续更新。

你可能感兴趣的:(linux系统移植)