Android ADB garget porting

Source: Internet
Author: User

 

1. Kernel support
Device Drivers --->
[*] USB support --->
<*> USB Gadget support --->
USB Peripheral Controller (s3c HS/otg usb device controller) --->
<*> USB Gadget drivers (Android gadget) --->
[*] Android gadget ADB Function
[*] Android gadget mass storage function
2. mach-smdk6410
--- Mach-smdk6410.c 14:37:17. 897565078 + 0800
+ + Samsung/ARCH/ARM/mach-s3c64xx/mach-smdk6410.c 14:49:58. 569615227 + 0800
@-74,6 + 74,7 @@
# Include <Linux/MTD/Partitions. h>
# Include <plat/NAND. h>
# Include <plat/regs-usb-hsotg-phy.h>
+ # Include <Linux/USB/android_composite.h>
 
# Define ucon s3c2410_ucon_default | s3c2410_ucon_uclk
# Define ulcon s3c2410_lcon_cs8 | s3c2410_lcon_pnone | s3c2410_lcon_stopb
@-419,6 + 420,57 @@
 
Static struct map_desc smdk6410_iodesc [] = {};
 
+
+
+ Static char * usb_functions_ums [] = {
+ "Usb_mass_storage ",
+ };
+
+ Static char * usb_functions_ums_adb [] = {
+ "Usb_mass_storage ",
+ "ADB ",
+ };
+
+ Static char * usb_functions_all [] = {
+ "Usb_mass_storage ",
+ "ADB ",
+ };
+
+
+ Static struct android_usb_product usb_products [] = {
+ {
+. Product_id = 0x4e11,
+. Num_functions = array_size (usb_functions_ums ),
+. Functions = usb_functions_ums,
+ },
+ {
+. Product_id = 0x4e12,
+. Num_functions = array_size (usb_functions_ums_adb ),
+. Functions = usb_functions_ums_adb,
+ },
+ };
+
+ Static struct android_usb_platform_data android_usb_pdata = {
+. Vendor_id = 0x18d1,
+. Product_id = 0x4e11,
+. Version = 0x0100,
+. Product_name = "ok6410 ",
+. Manufacturer_name = "witech ",
+. Serial_number = "ok6410_2011m04 ",
+. Num_products = array_size (usb_products ),
+. Products = usb_products,
+. Num_functions = array_size (usb_functions_all ),
+. Functions = usb_functions_all,
+ };
+
+ Struct platform_device initi_device_android_usb = {
+. Name = "android_usb ",
+. ID =-1,
+. Dev = {
+. Platform_data = & android_usb_pdata,
+ },
+ };
+
Static struct platform_device * smdk6410_devices [] _ initdata = {
# Ifdef config_smdk6410_sd_ch0
& Amp; initi_device_hsmmc0,
@-434,6 + 486,7 @@
& Amp; s364xx_device_iisv4,
 
& Amp; cloud64xx_device_ac97,
+ & Amp; cloud_device_android_usb,
# Ifdef config_regulator
& Smdk6410_ B _pwr_5 V,
# Endif
3. Patching file ARCH/ARM/Plat-Samsung/include/plat/Devs. h

Extern struct platform_device initi_device_usb_mass_storage;
Extern struct platform_device initi_device_android_usb;

4. Make zimage
Drivers/USB/gadget/f_adb.c: 207: Error: 'Task _ normal' undeclared (first use in this
Function)
Solution: add the header file # include <Linux/sched. h> to f_adb.c.
5. usb otg connected to PC
USB 1-2: device descriptor read/64, error-62
Hub 1-0: 1. 0: Unable to enumerate USB device on Port 2

USB 1-2: New full speed USB device using s3c2410-ohci and address 2
USB 1-2: device descriptor read/64, error-62
USB 1-2: device descriptor read/64, error-62
USB 1-2: New full speed USB device using s3c2410-ohci and address 3
Enabling ADB
Adb_open
USB 1-2: device descriptor read/64, error-62
USB 1-2: device descriptor read/64, error-62
USB 1-2: New full speed USB device using s3c2410-ohci and address 4
USB 1-2: device not accepting address 4, error-62
USB 1-2: New full speed USB device using s3c2410-ohci and address 5
USB 1-2: device not accepting address 5, error-62
Hub 1-0: 1. 0: Unable to enumerate USB device on Port 2
S3c-hsotg s3c-hsotg: initi_hsotg_corereset: reset failed, grstctl = 80000001
------------------------------------------------------------------------
No configuration file for USB driver is detected.
Usb_driver/android_winusb.inf
[Google. ntx86]
; Ok6410_2011m04
% Singleadbinterface % = usb_install, USB \ vid_18d1 & pid_4e12
% Compositeadbinterface % = usb_install, USB \ vid_18d1 & pid_4e12 & mi_01

[Google. ntamd64]
; Ok6410_2011m04
% Singleadbinterface % = usb_install, USB \ vid_18d1 & pid_4e12
% Compositeadbinterface % = usb_install, USB \ vid_18d1 & pid_4e12 & mi_01
6. on PC
D: \ Software \ Android-SDK-Windows \ tools> ADB push fruit.apk/sdcard
ADB Shell
# Ls

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.