Tuesday, November 23, 2010

beagleboard Android froyo - adding usb mass storage gadget support

Originally in TI devkit 2.0 android for beagleboard usb mass storage gadget driver is not enabled.
(i.e. when beagle board is connected to PC via USB OTG port it will shows a usb mass storage device on PC).

following modification is for enabling this usb mass storage gadget driver both in the kernel and the android system.


1]. Modifications to the Kernel

a). make sure kernel is configured support android USB Gadget with both "abd" and "mass_storage" functions.

make ARCH=arm CROSS_COMPILE=arm-eabi- menuconfig

at Device Drivers -> USB support -> USB Gadget support -> USB Gadget drivers (android)

both adb and mass storage function should be enabled


b). modification to arch/arm/mach-omap2/board-omap3beagle.c

change ,

static char *usb_functions_adb[] = {
"adb",
};

static char *usb_functions_all[] = {
"adb",
};

static struct android_usb_product usb_products[] = {
{
.product_id = GOOGLE_PRODUCT_ID,
.num_functions = ARRAY_SIZE(usb_functions_adb),
.functions = usb_functions_adb,
},
};

code section in to this,

static char *usb_functions_mass_storage[] = {
"usb_mass_storage",
};

static char *usb_functions_adb[] = {
"adb",
};

static char *usb_functions_all[] = {
"adb","usb_mass_storage"
};

static struct android_usb_product usb_products[] = {
{
.product_id = GOOGLE_PRODUCT_ID,
.num_functions = ARRAY_SIZE(usb_functions_adb),
.functions = usb_functions_adb,
},
{
.product_id = GOOGLE_PRODUCT_ID, /*added for usb mass storage */
.num_functions = ARRAY_SIZE(usb_functions_mass_storage),
.functions = usb_functions_mass_storage,
},
};

2]. Modifications to android system

with in the android srouce,in the system/vold/VolumeManager.cpp file change "/sys/devices/platform/usb_mass_storage/lun0/file" string to
"/sys/devices/platform/musb_hdrc/gadget/lun0/file".

There were two instants in Line. 810 and Line. 854

1 comment:

Unknown said...

Do you add musb driver to support