Atlas 200外设驱动开发和调试指南_USB 接口
收藏回复举报
Atlas 200外设驱动开发和调试指南_USB 接口
发表于2023-04-15 17:53:59
0 查看

调试基于Atlas 200 参考板驱动包进行重构调试,调试方法请参考 

https://support.huawei.com/enterprise/zh/doc/EDOC1100193743/3db58fa7 

1 芯片型号 

    USB接口使用PCIe转USB芯片uPD720201。 

2 固件烧录 

    是否烧录固件:是 

    芯片uPD720201的固件和烧录方法请联系芯片厂家获取。 

3 内核配置 

    支持USB接口功能 

    Device Drivers ---> 

    [*]USB support ---> 

    <*>xHCI HCD (USB 3.0) support 

    支持U盘功能,需要按照以下进行内核配置,详细操作指导参考:https://support.huawei.com/enterprise/zh/doc/EDOC1100193743/d3bbee8b。 

    Device Drivers ---> 

    SCSI device support ---> 

    <M> SCSI disk support 

    <M> SCSI generic support 

    Device Drivers ---> 

    [*] USB support ---> 

    <M> USB Mass Storage support 

    按照以上配置内核后,编译内核和模块驱动,获取如下驱动: 

    scsi_mod.ko 

    sg.ko 

    sd_mod.ko 

    usb_storage.ko 

4 驱动调试 

    支持U盘功能,需要按顺序插入编译出来的驱动: 

    insmod scsi_mod.ko 

    insmod sg.ko 

    insmod sd_mod.ko 

    insmod usb_storage.ko 

5 测试工具 

    安装lsusb工具进行usb设备的查找,lsusb工具的安装请自行搜索。 

    使用lsusb可以查到usb下挂的设备 

    root@davinci-mini:~$ lsusb 

    Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub 

    Bus 003 Device 002: ID 1a86:e018 QinHeng Electronics 

    Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub 

    Bus 002 Device 002: ID 0bda:8153 Realtek Semiconductor Corp. 

    Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub 

    Bus 001 Device 003: ID 090c:1000 Silicon Motion, Inc. - Taiwan (formerly Feiya 

    Technology Corp.) Flash Drive 

    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub 

    插入U盘,使用fdisk -l可以查到U盘设备。 

    root@davinci-mini:~# fdisk -l 

    Disk /dev/mmcblk1: 29.7 GiB, 31914983424 bytes, 62333952 sectors 

    Units: sectors of 1 * 512 = 512 bytes 

    Sector size (logical/physical): 512 bytes / 512 bytes 

    I/O size (minimum/optimal): 512 bytes / 512 bytes 

    Disklabel type: dos 

    Disk ²šžnì²fižàǿ 0x00000000 

    Device Boot Start End Sectors Size Id Type 

    /dev/mmcblk1p1 2048 10487807 10485760 5G 83 Linux 

    /dev/mmcblk1p2 10487808 12584959 2097152 1G 83 Linux 

    /dev/mmcblk1p3 12584960 61285375 48700416 23.2G 83 Linux 

    Disk /dev/sda: 30 GiB, 32212254720 bytes, 62914560 sectors 

    Units: sectors of 1 * 512 = 512 bytes 

    Sector size (logical/physical): 512 bytes / 512 bytes 

    I/O size (minimum/optimal): 512 bytes / 512 bytes 

    Disklabel type: dos 

    Disk ²šžnì²fižàǿ 0xcad4ebea 

    Device Boot Start End Sectors Size Id Type 

    /dev/sda4 * 256 62914559 62914304 30G c W95 FAT32 (LBA) 

本帖最后由 匿名用户2023/04/15 18:25:46 编辑

我要发帖子