Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,732,619 Members 52,084 Now Online
XDA Developers Android and Mobile Development Forum

!!!! HTC HD2's USB-HOST IS WORKING ON ICS! [KERNEL: ultrakernel base:trtung-ICS]

Tip us?
 
liiochen
Old
#1  
Member - OP
Thanks Meter 260
Posts: 45
Join Date: May 2012
Default !!!! HTC HD2's USB-HOST IS WORKING ON ICS! [KERNEL: ultrakernel base:trtung-ICS]

ANDROID ICS4.0.3 TESTED SUCCESS NOW!

LOG HERE:
Code:
<6>[  100.196990] usb 1-1: USB disconnect, address 3
<7>[  100.197052] usb 1-1: unregistering device
<7>[  100.197082] usb 1-1: usb_disable_device nuking all URBs
<7>[  100.197143] usb 1-1: unregistering interface 1-1:1.0
<7>[  100.199371] msm_hsusb_host msm_hsusb_host.0: irq status 4008c 

FLR PCD
<7>[  100.205596] usb 1-1:1.0: uevent
<7>[  100.207031] usb 1-1: uevent
<7>[  100.207672] msm_hsusb_host msm_hsusb_host.0: GetStatus port 1 

status 80001803 POWER sig=j CSC CONNECT
<7>[  100.245178] msm_hsusb_host msm_hsusb_host.0: GetStatus port 1 

status 80001801 POWER sig=j CONNECT
<7>[  100.285095] msm_hsusb_host msm_hsusb_host.0: GetStatus port 1 

status 80001801 POWER sig=j CONNECT
<7>[  100.325256] msm_hsusb_host msm_hsusb_host.0: GetStatus port 1 

status 80001801 POWER sig=j CONNECT
<7>[  100.365264] msm_hsusb_host msm_hsusb_host.0: GetStatus port 1 

status 80001801 POWER sig=j CONNECT
<7>[  100.365325] msm_hsusb_host msm_hsusb_host.0: port 1 reset
<7>[  100.420623] msm_hsusb_host msm_hsusb_host.0: irq status 4008c 

FLR PCD
<7>[  100.425201] msm_hsusb_host msm_hsusb_host.0: GetStatus port 1 

status 88001205 POWER sig=se0 PE CONNECT
<6>[  100.485229] usb 1-1: new high speed USB device using 

msm_hsusb_host and address 4
<7>[  100.485900] msm_hsusb_host msm_hsusb_host.0: irq status 48089 

Async FLR INT
<7>[  100.485961] msm_hsusb_host msm_hsusb_host.0: port 1 reset
<7>[  100.515136] msm_hsusb_host msm_hsusb_host.0: IAA watchdog: 

status 480a8 cmd 10029
<7>[  100.541229] msm_hsusb_host msm_hsusb_host.0: irq status 4808c 

Async FLR PCD
<7>[  100.545013] msm_hsusb_host msm_hsusb_host.0: GetStatus port 1 

status 88001205 POWER sig=se0 PE CONNECT
<7>[  100.605651] msm_hsusb_host msm_hsusb_host.0: irq status 48089 

Async FLR INT
<7>[  100.615295] msm_hsusb_host msm_hsusb_host.0: IAA watchdog: 

status 4a0a8 cmd 10029
<7>[  100.635589] msm_hsusb_host msm_hsusb_host.0: irq status 48089 

Async FLR INT
<7>[  100.636322] msm_hsusb_host msm_hsusb_host.0: irq status 4a089 

Async Recl FLR INT
<7>[  100.637084] msm_hsusb_host msm_hsusb_host.0: irq status 48089 

Async FLR INT
<7>[  100.637573] msm_hsusb_host msm_hsusb_host.0: irq status 48089 

Async FLR INT
<7>[  100.637695] usb 1-1: default language 0x0409
<7>[  100.638336] msm_hsusb_host msm_hsusb_host.0: irq status 48089 

Async FLR INT
<7>[  100.638946] msm_hsusb_host msm_hsusb_host.0: irq status 48089 

Async FLR INT
<7>[  100.639831] msm_hsusb_host msm_hsusb_host.0: irq status 48089 

Async FLR INT
<7>[  100.639953] usb 1-1: udev 4, busnum 1, minor = 3
<6>[  100.639984] usb 1-1: New USB device found, idVendor=0951, 

idProduct=1624
<6>[  100.640014] usb 1-1: New USB device strings: Mfr=1, Product=2, 

SerialNumber=3
<6>[  100.640075] usb 1-1: Product: DataTraveler G2
<6>[  100.640106] usb 1-1: Manufacturer: Kingston
<6>[  100.640136] usb 1-1: SerialNumber: 001D0F0CAAA3A94115080014
<7>[  100.640563] usb 1-1: uevent
<7>[  100.642059] usb 1-1: usb_probe_device
<6>[  100.642120] usb 1-1: configuration #1 chosen from 1 choice
<7>[  100.642608] msm_hsusb_host msm_hsusb_host.0: irq status 48089 

Async FLR INT
<7>[  100.642700] usb 1-1: adding 1-1:1.0 (config #1, interface 0)
<7>[  100.642883] usb 1-1:1.0: uevent
<7>[  100.643981] usb-storage 1-1:1.0: usb_probe_interface
<7>[  100.644073] usb-storage 1-1:1.0: usb_probe_interface - got id
<6>[  100.644348] scsi2 : SCSI emulation for USB Mass Storage devices
<7>[  100.647491] drivers/usb/core/inode.c: creating file '004'
<7>[  100.649230] usb 1-1: device added!
<7>[  100.649536] msm_hsusb_host msm_hsusb_host.0: GetStatus port 1 

status 88001205 POWER sig=se0 PE CONNECT
<7>[  100.649658] usb-storage: device found at 4
<7>[  100.649688] usb-storage: waiting for device to settle before 

scanning
<7>[  100.665130] msm_hsusb_host msm_hsusb_host.0: IAA watchdog: 

status 480a8 cmd 10029
Code:
localhost / # cat /proc/interrupts
           CPU0
  0:        273         msm  smd_dev
  4:          0         msm  dex_cb
  5:          3         msm  smsm_dev
  7:      18113         msm  gp_timer
  8:          0         msm  dg_timer
 19:       2806         msm  msm_mdp
 20:        429         msm  kgsl-3d0
 21:      54608         msm  msmdatamover
 22:         92         msm  smd_dev
 24:       3159         msm  msm-sdcc (cmd)
 25:       1310         msm  msm-sdcc (pio)
 26:          0         msm  msm-sdcc (cmd)
 27:          0         msm  msm-sdcc (pio)
 34:      49171         msm  msm_i2c
 44:        373         msm  msm_hs_uart
 58:        155         msm  ehci_hcd:usb1
122:          0     msmgpio  mic_headset
124:          6     msmgpio  bt host_wake
126:       1467     msmgpio  akm8973
127:          0     msmgpio  gpio_kp
128:          0     msmgpio  gpio_kp
129:          0     msmgpio  gpio_kp
147:          0     msmgpio  over_voltage_interrupt
177:          0     msmgpio  microp_interrupt
179:        229     msmgpio  leo_touch_name
181:          1     msmgpio  gpio_keys
232:          0     msmgpio  35mm_headset
239:        543     msmgpio  bcmsdh_sdmmc
240:          1     msmgpio  msm-sdcc (slot)

localhost / # cat /proc/scsi/scsi
Attached devices:
Host: scsi2 Channel: 00 Id: 00 Lun: 00
  Vendor: Kingston Model: DataTraveler G2  Rev: 1.00
  Type:   Direct-Access                    ANSI  SCSI revision: 02

localhost / # ls /dev/block/
loop0      loop5      mtdblock2  ram0       ram13      ram4       ram9
loop1      loop6      mtdblock3  ram1       ram14      ram5       sda
loop2      loop7      mtdblock4  ram10      ram15      ram6       sda4
loop3      mtdblock0  mtdblock5  ram11      ram2       ram7       vold
loop4      mtdblock1  platform   ram12      ram3       ram8       zram0

KERNEL WILL UPLOAD TO MY BLOG.
THANKS Rick, Tytung.
The Following 26 Users Say Thank You to liiochen For This Useful Post: [ Click to Expand ]
 
hengsheng120
Old
#2  
Senior Member
Thanks Meter 54
Posts: 296
Join Date: Feb 2012
Wow. Congratulations, this is win.
Current Phone:
HTC First

Others:
SGH-I9100G

HTC HD2 TMOUS
BlackLK 1.5.0.4-build-130412@kotokas
AOKP M5 ICS se+Dorimanx v6.9 HWA
cLK Dual Boot: Hyperdroid 6.0.1 SuperRAM
 
History: HD2 EU- Artemis WM6.5/AmericanAndroid SD> Typhoon CM7(MAGLDR)> Nexus HD2> Frankenstein Droid Lite 1.2~3(CLK)> CYMLXGO DHD> Typhoon CM7> Dorimanx 2.8~3.1> Exchanged | TMOUK - Dorimanx 3.1.2> Pdaimatejam/AmericanAndroid SD>MyMIUIv10+Dorimanx v6.3




 
Spaqin
Old
#3  
Senior Member
Thanks Meter 82
Posts: 325
Join Date: Oct 2010
I knew that! Bought an OTG cable week ago hoping that it will work before it will be delivered to me


Great job man!
Siemens C25 -> Nokia 3510i -> Nokia 6610 -> Nokia 6103 -> HTC Artemis -> HTC HD2 + iPod Touch 3G
My lovely Leo:
Radio: 2.15.50
HSPL 2.08
WP7 HD2O + ParanoidAndroid JB
 
Rick_1995
Old
#4  
Rick_1995's Avatar
Recognized Developer
Thanks Meter 3054
Posts: 1,114
Join Date: Sep 2009
Location: Whoville
Quote:
Originally Posted by Spaqin View Post
I knew that! Bought an OTG cable week ago hoping that it will work before it will be delivered to me


Great job man!
OTG won't work, this is "usb host" not "usb otg"
The Following 3 Users Say Thank You to Rick_1995 For This Useful Post: [ Click to Expand ]
 
Spaqin
Old
#5  
Senior Member
Thanks Meter 82
Posts: 325
Join Date: Oct 2010
Quote:
Originally Posted by Rick_1995 View Post
OTG won't work, this is "usb host" not "usb otg"
Aren't they the same? What's the difference then?
Siemens C25 -> Nokia 3510i -> Nokia 6610 -> Nokia 6103 -> HTC Artemis -> HTC HD2 + iPod Touch 3G
My lovely Leo:
Radio: 2.15.50
HSPL 2.08
WP7 HD2O + ParanoidAndroid JB
 
liiochen
Old
(Last edited by liiochen; 26th May 2012 at 05:20 PM.)
#6  
Member - OP
Thanks Meter 260
Posts: 45
Join Date: May 2012
download: http://www.rerede.com/wp-content/upl...cs-usb-host.7z


Only USB-HOST NOW.

After this I'll port OTG.


If you use my usb-host kernel. the android usb adb function and mass storage will not work.
because kernel not register the android usb gadget.


usgae:

download the packet and flash the boot.img (clk)
copy the mobuldes directory replace to /system/lib/modules

source code and patch coming soon.
I mainly modify the use of interrupts and clock.

add core clock , fix the read device descriptor fail (error = timeout)
Code:
        msm7201->clk = clk_get(&pdev->dev, "usb_hs_clk");
        if (IS_ERR(msm7201->clk)) {
                dev_dbg(&pdev->dev, "error getting usb_hs_clk\n");
                retval = -EFAULT;
                goto err4;
        }

        msm7201->pclk = clk_get(&pdev->dev, "usb_hs_pclk");
        if (IS_ERR(msm7201->pclk)) {
                USB_INFO("MSM7201 --> error getting usb_hs_pclk\n");
                dev_dbg(&pdev->dev, "error getting usb_hs_pclk\n");
                retval = -EFAULT;
                goto err5;
        }

        msm7201->otgclk = clk_get(&pdev->dev, "usb_otg_clk");
        if (IS_ERR(msm7201->otgclk))
                msm7201->otgclk = NULL;

        msm7201->coreclk = clk_get(&pdev->dev, "usb_hs_core_clk");
        if (IS_ERR(msm7201->coreclk))
                msm7201->coreclk = NULL;

        msm7201->ebi1clk = clk_get(NULL, "ebi1_clk");
        if (IS_ERR(msm7201->ebi1clk))
                goto err6;

        if (msm7201->coreclk)
                clk_enable(msm7201->coreclk);
        clk_enable(msm7201->clk);
        clk_enable(msm7201->pclk);
        if (msm7201->otgclk)
                clk_enable(msm7201->otgclk);

        msleep(5);

        writel(0, USB_USBINTR);
        writel(0, USB_OTGSC);

irq is not initialize before disable and enable. must request the irq before any operate.

I'm windows kernel developer, I think writel irq must disable it and enable after writed.

Code:
        // mod
        retval = usb_add_hcd(hcd, irq, IRQF_SHARED);
        //enable interrupts
        disable_irq(irq);
        writel(STS_URI | STS_SLI | STS_UI | STS_PCI , USB_USBINTR);
        enable_irq(irq);
The Following 8 Users Say Thank You to liiochen For This Useful Post: [ Click to Expand ]
 
liiochen
Old
#7  
Member - OP
Thanks Meter 260
Posts: 45
Join Date: May 2012
Quote:
Originally Posted by Spaqin View Post
Aren't they the same? What's the difference then?
kernel is selected host mode from OTG, if you plug-in any device in.
else system only support gadget function
The Following 2 Users Say Thank You to liiochen For This Useful Post: [ Click to Expand ]
 
Rick_1995
Old
(Last edited by Rick_1995; 26th May 2012 at 05:15 PM.)
#8  
Rick_1995's Avatar
Recognized Developer
Thanks Meter 3054
Posts: 1,114
Join Date: Sep 2009
Location: Whoville
Quote:
Originally Posted by Spaqin View Post
Aren't they the same? What's the difference then?
OTG can switch between client mode and host mode depending upon what device is inserted.

Quote:
Originally Posted by liiochen View Post
After this I'll port OTG.
the usb controller lacks support for otg iirc.
The Following 5 Users Say Thank You to Rick_1995 For This Useful Post: [ Click to Expand ]
 
liiochen
Old
#9  
Member - OP
Thanks Meter 260
Posts: 45
Join Date: May 2012
I'm go to bed ,Continue tomorrow.


The Following 4 Users Say Thank You to liiochen For This Useful Post: [ Click to Expand ]
 
clio94
Old
(Last edited by clio94; 26th May 2012 at 08:08 PM.)
#10  
Senior Member
Thanks Meter 297
Posts: 1,139
Join Date: Jan 2007
Location: Kozani
I tested with usb mouse connected via powered usb hub and it work perfect.Thank you very much.Can we connect usb flash storage;

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes