Make UDC & Android ADB Gadget driver work

45 篇文章 0 订阅
18 篇文章 0 订阅

Make UDC & Android ADB Gadget driver work

1. Open the config menu, enable USB Gadget support and choose PXA27x UDC driver support and Android ADB Gadget driver support.

If you don't have PXA27x item appeared in the menu, copy pxa27x_udc.c and pxa27x_udc.h from Linux 2.6.27 source tree into drivers/usb/gadget directory and make the modifications of Kconfig and Makefile files accordingly.

If you don't have Android ADB Gadget item appeared in the menu, copy android_adb.c from the kernel directory of Android source code tree into drivers/usb/gadget directory and make the modifications of Kconfig and Makefile files accordingly.


2. Open the devices.c in directory arch/arm/mach-pxa, locate at struct platform_device pxa_device_udc, make sure the .name field value is "pxa27x-udc ". If not, change it.

3. Write p535_udc.c , in which calls the pxa_set_udc_info function to do the initial work for the PXA27x UDC driver.

4. Make and generate the zImage file.

5. Run Android on your P535 with the new zImage.

6. In your host Linux PC (I am using Ubuntu), create a file "/etc/udev/rules.d/50-android.rules " with following contents:
SUBSYSTEM=="usb", SYSFS{idVendor}=="18d1", MODE="0666"

In which, the "18d1 " is the USB device's vendor ID which is hard-coded in android_adb.c . Actually P535's VID is 0B05 , you can change it or not, but if you change, remember to change both the
50-android.rules file and android_adb.c file.

After creating the file, execute command:
chmod a+rx /etc/udev/rules.d/50-android.rules


7. Now connect your P535 with your host PC with USB cable, go to "out/host/linux-x86/bin " in your
Android source tree directory and execute command:
./adb devices

You will get:
List of devices attached
0123456789ABCDEF        device


Which shows that your device has been connected. Now you can use the adb tool in whichever way you like. 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值