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.