全志A20方案双USB的host配置

如果做的方案有两个USB都用作host(主机设备),既可以用作读USB存储和插usb鼠标键盘。

首先,在device目录下配置。

init.sun7i.rc中添加如下两行:

    mkdir /mnt/usbhost1 0000 system system
    mkdir /mnt/usbhost2 0000 system system


overlay\frameworks\base\core\res\res\xml\storage_list.xml文件中添加如下语句:

overlay\frameworks\base\core\res\res\xml\storage_list.xml

    <storage android:mountPoint="/mnt/usbhost1"
             android:storageDescription="@string/storage_usb"
             android:primary="false"
             android:removable="true"
             android:emulated="false"  
             android:mtpReserve="0"
             android:maxFileSize="0"/>
    <storage android:mountPoint="/mnt/sata"
             android:storageDescription="@string/storage_sata"
             android:primary="false"
             android:removable="true"
             android:emulated="false"  
             android:mtpReserve="0"
             android:maxFileSize="0"/>
    <storage android:mountPoint="/mnt/usbhost0"
             android:storageDescription="@string/storage_usb"
             android:primary="false"
             android:removable="true"
             android:emulated="false"  
             android:mtpReserve="0"
             android:maxFileSize="0"/>
    <storage android:mountPoint="/mnt/usbhost2"
             android:storageDescription="@string/storage_usb"
             android:primary="false"
             android:removable="true"
             android:emulated="false"  
             android:mtpReserve="0"
             android:maxFileSize="0"/>


vold.fstab文件中的挂载修改成如下:

# Mounts the first usable partition of the specified device
#/devices/platform/awsmc.3/mmc_host for sdio
dev_mount    sata    /mnt/sata    auto    /devices/platform/sw_ahci.0
dev_mount    sdcard    /mnt/sdcard    auto    /devices/virtual/block/nandk    /devices/platform/sunxi-mmc.2/mmc_host
dev_mount    extsd    /mnt/extsd    auto    /devices/platform/sunxi-mmc.1/mmc_host    /devices/platform/sunxi-mmc.0/mmc_host
dev_mount    usbhost1    /mnt/usbhost1    auto    /devices/platform/sw-ehci.1/usb2/2-1/2-1.1
dev_mount    usbhost0    /mnt/usbhost0    auto    /devices/platform/sw_hcd_host0/usb1/1-1
dev_mount    usbhost2    /mnt/usbhost2    auto    /devices/platform/sw-ehci.2/usb4/4-1


另外sys_config.fex文件中修改usb配置:

;-------------------------------------------------------------------------------
[usbc0]
usb_used            = 1
usb_port_type       = 1
usb_detect_type     = 0
usb_id_gpio         = port:PH04<0><1><default><default>
usb_det_vbus_gpio   = "axp_ctrl"
usb_drv_vbus_gpio   = port:PB09<1><0><default><0>
usb_restrict_gpio   = port:PH00<1><0><default><0>
usb_host_init_state = 1
usb_restric_flag    = 0
usb_restric_voltage = 3550000
usb_restric_capacity= 5

;-------------------------------------------------------------------------------
;---       USB1控制标志
;------------------------------------------------------------------------------
[usbc1]
usb_used            = 1
usb_port_type       = 1
usb_detect_type     = 0
usb_drv_vbus_gpio   =
usb_restrict_gpio   =
usb_host_init_state = 1
usb_restric_flag    = 0

;------------------------------------------------------------------------------
;---       USB2控制标志
;------------------------------------------------------------------------------
[usbc2]
usb_used            = 1
usb_port_type       = 1
usb_detect_type     = 0
usb_drv_vbus_gpio   =
;usb_drv_vbus_gpio   = port:PH03<1><0><default><0>
usb_restrict_gpio   =
usb_host_init_state = 1
usb_restric_flag    = 0





评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

「已注销」

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值