Jump to content

ZTE BLADE / SAN FRAN - USB OTG QUESTION !


Guest maxmix

Recommended Posts

Been reading a lot of Orange San Fran / ZTE Blade posts for a while now and going to go for one, next week etc...

Can anyone tell me has anyone got USB OTG working on this handset yet.... I had been looking at the Nokia N8 for this feature

but handset is just too expensive ATM, but I see USB OTG works well on it... (N8)

Any help would be great... I see the little USB adapters from Micro USB to USB (Female) are only £2 odds on Ebay...

maxmix

Link to comment
Share on other sites

Guest hecatae

Hi H,

I'll will check on monday for you if no one checks over the weekend

this post http://android.modaco.com/content/zte-blad.../usb-host-mode/ states the cpu has

The Qualcom MSM7227 (the chip at the heart of the Blade) has a USB2.0 OTG controller (both host and device)

http://wenku.baidu.com/view/0f4f8637f111f18583d05af3.html

Edited by hecatae
Link to comment
Share on other sites

Hi H,

I'll will check on monday for you if no one checks over the weekend

this post http://android.modaco.com/content/zte-blad.../usb-host-mode/ states the cpu has

Alright me old buddy ;) How you doing ? (Well I hope) :P

Well thats good news regarding what Sven was saying on the link you supplied.... Even more reason to get one now....

Spk soon...

H

maxmix :P

PS If your on FB add me.... A quick search will find me easily lol

Link to comment
Share on other sites

  • 5 weeks later...
Guest maxmix
Hi H,

I'll will check on monday for you if no one checks over the weekend

this post http://android.modaco.com/content/zte-blad.../usb-host-mode/ states the cpu has

Hi M8, Hope you had a good New Year.... :unsure:

Just splashed out and grabbed a San Fran.... Good value for the £... I'm no good with the Rom stuff but got there eventually...

Rooted, Clockwork and Bladevillian Rom installed, all seems to be going OK for the last day or so, but I did have a couple of probs etc...

Anyway.... Any news on how I can use OTG on The San Fran ?

maxmix

Link to comment
Share on other sites

Guest maxmix

2 days in with the new Jellyfish rom, all pretty good....

Just wish someone caould tell me if USB OTG will work ! Dying to try my cable when it arrives this week...

maxmix

Link to comment
Share on other sites

Guest StevenHarperUK
2 days in with the new Jellyfish rom, all pretty good....

Just wish someone caould tell me if USB OTG will work ! Dying to try my cable when it arrives this week...

maxmix

Even thou the hardware supports it

http://www.tombom.co.uk/blog/?p=124

If you read through you see that the Kernel and the ROM will need to add support.

The Kernel part is possible as we have a 2.2 Source now - but may be difficult.

The ROM - well if 2.3 adds OTG support, then it will be much easier to use - rather than developing an APP from scratch

Link to comment
Share on other sites

Guest Arr Too

I'm sure kallt_kaffe was pointed at Sven's excellent work on this, but I'm not sure he's thought about adding it to the 2.2 kernel (yet?). Of course, to make good use of it you also need drivers for the all stuff you want to hang on the end of the Blade!

Link to comment
Share on other sites

Even thou the hardware supports it

http://www.tombom.co.uk/blog/?p=124

If you read through you see that the Kernel and the ROM will need to add support.

The Kernel part is possible as we have a 2.2 Source now - but may be difficult.

The ROM - well if 2.3 adds OTG support, then it will be much easier to use - rather than developing an APP from scratch

Hi Steven

I had read that a while back, but as it was dated.... {February 9th, 2010 by Chris in Uncategorized} I thought it would

be coming a standard feature now in Android handsets.... Especially something with so many MODS as the Blade...

Is their any Android that you know of that supports OTG ? (Always handy to copy a flash drive etc) and even better

if you have no PC around....

Cheers

maxmix

PS I never knew about the Fat32 on N8, Not too much of a problem, but handset a little pricey still....

Link to comment
Share on other sites

Guest hecatae

http://www.tombom.co.uk/blog/?p=134

been playing with this, going to need a kernel with specific OTG, a usb keyboard works, but quite a few others need external power

the patch on the HTC Hero was this http://adq.livejournal.com/101420.html

--- kernel_hero/arch/arm/mach-msm/devices.c	2009-10-22 07:39:39.000000000 +0100
+++ kernel_hero.patched/arch/arm/mach-msm/devices.c 2010-01-31 17:55:42.835673987 +0000
@@ -158,6 +158,7 @@
/* adjust eye diagram, disable vbusvalid interrupts */
static int hsusb_phy_init_seq[] = { 0x40, 0x31, 0x1, 0x0D, 0x1, 0x10, -1 };

+#ifdef CONFIG_USB_FUNCTION
static char *usb_functions[] = {

#if defined(CONFIG_USB_FUNCTION_MASS_STORAGE) || defined(CONFIG_USB_FUNCTION_UMS)
@@ -227,10 +228,12 @@
},

};
+#endif

struct msm_hsusb_platform_data msm_hsusb_pdata = {
.phy_reset = internal_phy_reset,
.phy_init_seq = hsusb_phy_init_seq,
+#ifdef CONFIG_USB_FUNCTION
.vendor_id = 0x0bb4,
.product_id = 0x0c02,
.version = 0x0100,
@@ -241,6 +244,7 @@
.num_functions = ARRAY_SIZE(usb_functions),
.products = usb_products,
.num_products = ARRAY_SIZE(usb_products),
+#endif
};

static struct resource resources_hsusb[] = {
@@ -1123,6 +1127,7 @@
return mfg_mode;
}

+#ifdef CONFIG_USB_FUNCTION
static int __init board_serialno_setup(char *serialno)
{
if (board_mfg_mode() || !strlen(serialno))
@@ -1133,6 +1138,7 @@
}

__setup("androidboot.serialno=", board_serialno_setup);
+#endif

EXPORT_SYMBOL(board_mfg_mode);
static char *keycap_tag = NULL;
--- kernel_hero/arch/arm/mach-msm/htc_battery.c 2009-10-22 07:39:39.000000000 +0100
+++ kernel_hero.patched/arch/arm/mach-msm/htc_battery.c 2010-01-31 17:57:51.915655870 +0000
@@ -205,12 +205,14 @@
},
};

-static void usb_status_notifier_func(int online);
static int g_usb_online;
+#ifdef CONFIG_USB_FUNCTION
+static void usb_status_notifier_func(int online);
static struct t_usb_status_notifier usb_status_notifier = {
.name = "htc_battery",
.func = usb_status_notifier_func,
};
+#endif

/* -------------------------------------------------------------------------- */
/* For sleep charging screen. */
@@ -476,6 +478,7 @@
return rc;
}

+#ifdef CONFIG_USB_FUNCTION
/* A9 reports USB charging when helf AC cable in and China AC charger. */
/* Work arround: notify userspace AC charging first,
and notify USB charging again when receiving usb connected notificaiton from usb driver. */
@@ -496,6 +499,8 @@
}
mutex_unlock(&htc_batt_info.lock);
}
+#endif
+
static int htc_get_batt_info(struct battery_info_reply *buffer)
{
struct rpc_request_hdr req;
@@ -1231,7 +1236,9 @@
wake_lock_init(&vbus_wake_lock, WAKE_LOCK_SUSPEND, "vbus_present");
mutex_init(&htc_batt_info.lock);
mutex_init(&htc_batt_info.rpc_lock);
+#ifdef CONFIG_USB_FUNCTION
usb_register_notifier(&usb_status_notifier);
+#endif
msm_rpc_create_server(&battery_server);
platform_driver_register(&htc_battery_driver);
batt_register_client(&batt_notify);
--- kernel_hero/drivers/usb/function/Kconfig 2009-10-22 07:39:58.000000000 +0100
+++ kernel_hero.patched/drivers/usb/function/Kconfig 2010-02-07 18:50:28.137447755 +0000
@@ -14,7 +14,7 @@

config USB_FUNCTION_MSM_HSUSB
boolean "MSM7K Highspeed USB Peripheral Controller"
- depends on ARCH_MSM7XXX
+ depends on ARCH_MSM7XXX && (!USB_EHCI_MSM7201)

endchoice

--- kernel_hero/drivers/usb/host/ehci-hcd.c 2009-10-22 07:39:59.000000000 +0100
+++ kernel_hero.patched/drivers/usb/host/ehci-hcd.c 2010-02-09 20:06:33.162966732 +0000
@@ -1040,6 +1040,11 @@
#define PLATFORM_DRIVER ixp4xx_ehci_driver
#endif

+#ifdef CONFIG_ARCH_MSM7XXX
+#include "ehci-msm7201.c"
+#define PLATFORM_DRIVER ehci_msm7201_driver
+#endif
+
#if !defined(PCI_DRIVER) && !defined(PLATFORM_DRIVER) && \
!defined(PS3_SYSTEM_BUS_DRIVER) && !defined(OF_PLATFORM_DRIVER)
#error "missing bus glue for ehci-hcd"
--- kernel_hero/drivers/usb/host/ehci-msm7201.c 1970-01-01 01:00:00.000000000 +0100
+++ kernel_hero.patched/drivers/usb/host/ehci-msm7201.c 2010-02-09 20:09:10.556297861 +0000
@@ -0,0 +1,319 @@
+/*
+ * Copyright © 2010 Andrew de Quincey
+ *
+ * (heavily) based on ehci-fsl.c, which is:
+ *
+ * Copyright © 2005 MontaVista Software
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Ported to 834x by Randy Vinson <[email protected]> using code provided
+ * by Hunter Wu.
+ */
+
+#include <linux/platform_device.h>
+#include <linux/clk.h>
+#include <mach/msm_hsusb.h>
+
+#include "ehci-msm7201.h"
+
+static void ulpi_write(struct usb_hcd *hcd, unsigned val, unsigned reg)
+{
+ unsigned timeout = 10000;
+
+ /* initiate write operation */
+ writel(ULPI_RUN | ULPI_WRITE |
+ ULPI_ADDR(reg) | ULPI_DATA(val),
+ USB_ULPI_VIEWPORT);
+
+ /* wait for completion */
+ while ((readl(USB_ULPI_VIEWPORT) & ULPI_RUN) && (--timeout)) ;
+
+ if (timeout == 0)
+ printk(KERN_WARNING "%s: timeout: reg: 0x%X, var: 0x%X\n",
+ __func__, reg, val);
+}
+
+static void msm7201_setup_phy(struct usb_hcd *hcd)
+{
+ struct msm7201_usb_priv *msm7201 = hcd_to_msm7201(hcd);
+
+ int *seq = msm7201->phy_init_seq;
+
+ if (!seq)
+ return;
+
+ while (seq[0] >= 0) {
+ ulpi_write(hcd, seq[0], seq[1]);
+ seq += 2;
+ }
+}
+
+static void msm7201_shutdown_phy(struct usb_hcd *hcd)
+{
+ struct msm7201_usb_priv *msm7201 = hcd_to_msm7201(hcd);
+
+ if (msm7201->phy_shutdown)
+ msm7201->phy_shutdown();
+
+ /* disable interface protect circuit to drop current consumption */
+ ulpi_write(hcd, (1 << 7), 0x08);
+ /* clear the SuspendM bit -> suspend the PHY */
+ ulpi_write(hcd, 1 << 6, 0x06);
+}
+
+static void msm7201_usb_setup(struct usb_hcd *hcd)
+{
+ struct msm7201_usb_priv *msm7201 = hcd_to_msm7201(hcd);
+ int i;
+
+ /* INCR8 BURST mode */
+ writel(0x02, USB_SBUSCFG); /*boost performance to fix CRC error.*/
+
+ /* select ULPI phy */
+ writel(0x80000000, USB_PORTSC);
+
+ if (msm7201->phy_reset)
+ msm7201->phy_reset();
+ msm7201_setup_phy(hcd);
+}
+
+/* called after powerup, by probe or system-pm "wakeup" */
+static int ehci_msm7201_reinit(struct ehci_hcd *ehci)
+{
+ msm7201_usb_setup(ehci_to_hcd(ehci));
+ ehci_port_power(ehci, 0);
+
+ return 0;
+}
+
+/* called during probe() after chip reset completes */
+static int ehci_msm7201_setup(struct usb_hcd *hcd)
+{
+ struct ehci_hcd *ehci = hcd_to_ehci(hcd);
+ int retval;
+
+ /* EHCI registers start at offset 0x100 */
+ ehci->caps = hcd->regs + 0x100;
+ ehci->regs = hcd->regs + 0x100 +
+ HC_LENGTH(ehci_readl(ehci, &ehci->caps->hc_capbase));
+
+ /* configure other settings */
+ ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params);
+ hcd->has_tt = 1;
+ ehci->sbrn = 0x20;
+
+ /* reset and halt controller */
+ ehci_reset(ehci);
+ retval = ehci_halt(ehci);
+ if (retval)
+ return retval;
+
+ /* data structure init */
+ retval = ehci_init(hcd);
+ if (retval)
+ return retval;
+
+ ehci_reset(ehci);
+
+ retval = ehci_msm7201_reinit(ehci);
+ return retval;
+}
+
+static const struct hc_driver ehci_msm7201_hc_driver = {
+ .description = hcd_name,
+ .product_desc = "Qualcomm MSM7201 On-Chip EHCI Host Controller",
+ .hcd_priv_size = sizeof(struct ehci_hcd) + sizeof(struct msm7201_usb_priv),
+
+ /*
+ * generic hardware linkage
+ */
+ .irq = ehci_irq,
+ .flags = HCD_USB2 | HCD_MEMORY | HCD_LOCAL_MEM,
+
+ /*
+ * basic lifecycle operations
+ */
+ .reset = ehci_msm7201_setup,
+ .start = ehci_run,
+ .stop = ehci_stop,
+ .shutdown = ehci_shutdown,
+
+ /*
+ * managing i/o requests and associated device resources
+ */
+ .urb_enqueue = ehci_urb_enqueue,
+ .urb_dequeue = ehci_urb_dequeue,
+ .endpoint_disable = ehci_endpoint_disable,
+
+ /*
+ * scheduling support
+ */
+ .get_frame_number = ehci_get_frame,
+
+ /*
+ * root hub support
+ */
+ .hub_status_data = ehci_hub_status_data,
+ .hub_control = ehci_hub_control,
+ .bus_suspend = ehci_bus_suspend,
+ .bus_resume = ehci_bus_resume,
+ .relinquish_port = ehci_relinquish_port,
+ .port_handed_over = ehci_port_handed_over,
+};
+
+/**
+ * usb_hcd_msm7201_remove - shutdown processing for MSM7201-based HCDs
+ * @pdev: USB Host Controller being removed
+ * Context: !in_interrupt()
+ *
+ * Reverses the effect of usb_hcd_msm7201_probe().
+ *
+ */
+static int usb_hcd_msm7201_remove(struct platform_device *pdev)
+{
+ struct usb_hcd *hcd = platform_get_drvdata(pdev);
+ struct msm7201_usb_priv *msm7201 = hcd_to_msm7201(hcd);
+
+ usb_remove_hcd(hcd);
+ msm7201_shutdown_phy(hcd);
+ clk_put(msm7201->clk);
+ clk_put(msm7201->pclk);
+ iounmap(hcd->regs);
+ release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
+ usb_put_hcd(hcd);
+
+ return 0;
+}
+
+/**
+ * usb_hcd_msm7201_probe - initialize MSM7201-based HCDs
+ * @pdev: USB Host Controller being probed
+ * Context: !in_interrupt()
+ *
+ * Allocates basic resources for this USB host controller.
+ *
+ */
+static int usb_hcd_msm7201_probe(struct platform_device *pdev)
+{
+ struct usb_hcd *hcd;
+ struct resource *res;
+ struct msm7201_usb_priv *msm7201;
+ int irq;
+ int retval;
+ const struct hc_driver *driver = &ehci_msm7201_hc_driver;
+ struct msm_hsusb_platform_data *pdata = pdev->dev.platform_data;
+
+ if (usb_disabled())
+ return -ENODEV;
+
+ pr_debug("initializing MSM7201 USB Controller\n");
+
+ res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
+ if (!res) {
+ dev_err(&pdev->dev,
+ "Found HC with no IRQ. Check %s setup!\n",
+ dev_name(&pdev->dev));
+ return -ENODEV;
+ }
+ irq = res->start;
+
+ hcd = usb_create_hcd(driver, &pdev->dev, dev_name(&pdev->dev));
+ if (!hcd) {
+ retval = -ENOMEM;
+ goto err1;
+ }
+
+ msm7201 = hcd_to_msm7201(hcd);
+ if (pdata) {
+ msm7201->phy_reset = pdata->phy_reset;
+ msm7201->phy_shutdown = pdata->phy_shutdown;
+ msm7201->phy_init_seq = pdata->phy_init_seq;
+ }
+
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (!res) {
+ dev_err(&pdev->dev,
+ "Found HC with no register addr. Check %s setup!\n",
+ dev_name(&pdev->dev));
+ retval = -ENODEV;
+ goto err2;
+ }
+ hcd->rsrc_start = res->start;
+ hcd->rsrc_len = res->end - res->start + 1;
+ if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len,
+ driver->description)) {
+ dev_dbg(&pdev->dev, "controller already in use\n");
+ retval = -EBUSY;
+ goto err2;
+ }
+ hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len);
+
+ if (hcd->regs == NULL) {
+ dev_dbg(&pdev->dev, "error mapping memory\n");
+ retval = -EFAULT;
+ goto err3;
+ }
+
+ 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)) {
+ dev_dbg(&pdev->dev, "error getting usb_hs_pclk\n");
+ retval = -EFAULT;
+ goto err5;
+ }
+
+ clk_enable(msm7201->clk);
+ clk_enable(msm7201->pclk);
+
+ /* wait for a while after enable usb clk*/
+ msleep(5);
+
+ retval = usb_add_hcd(hcd, irq, IRQF_DISABLED | IRQF_SHARED);
+ if (retval != 0)
+ goto err6;
+ return retval;
+
+ err6:
+ clk_put(msm7201->pclk);
+ err5:
+ clk_put(msm7201->clk);
+ err4:
+ iounmap(hcd->regs);
+ err3:
+ release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
+ err2:
+ usb_put_hcd(hcd);
+ err1:
+ dev_err(&pdev->dev, "init %s fail, %d\n", dev_name(&pdev->dev), retval);
+ return retval;
+}
+
+MODULE_ALIAS("platform:msm_hsusb");
+
+static struct platform_driver ehci_msm7201_driver = {
+ .probe = usb_hcd_msm7201_probe,
+ .remove = usb_hcd_msm7201_remove,
+ .shutdown = usb_hcd_platform_shutdown,
+ .driver = {
+ .name = "msm_hsusb",
+ },
+};
--- kernel_hero/drivers/usb/host/ehci-msm7201.h 1970-01-01 01:00:00.000000000 +0100
+++ kernel_hero.patched/drivers/usb/host/ehci-msm7201.h 2010-02-09 18:22:32.530257554 +0000
@@ -0,0 +1,88 @@
+/*
+ * Copyright © 2010 Andrew de Quincey
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#ifndef _EHCI_MSM7201_H
+#define _EHCI_MSM7201_H
+
+struct msm7201_usb_priv
+{
+ struct clk *clk;
+ struct clk *pclk;
+
+ int *phy_init_seq;
+ void (*phy_reset)(void);
+ void (*phy_shutdown)(void);
+};
+
+static inline struct msm7201_usb_priv *hcd_to_msm7201(struct usb_hcd *hcd)
+{
+ return (struct msm7201_usb_priv *) (hcd->hcd_priv) + sizeof(struct ehci_hcd);
+}
+
+#define MSM_USB_BASE ((unsigned) hcd->regs)
+
+#define USB_ID (MSM_USB_BASE + 0x0000)
+#define USB_HWGENERAL (MSM_USB_BASE + 0x0004)
+#define USB_HWHOST (MSM_USB_BASE + 0x0008)
+#define USB_HWDEVICE (MSM_USB_BASE + 0x000C)
+#define USB_HWTXBUF (MSM_USB_BASE + 0x0010)
+#define USB_HWRXBUF (MSM_USB_BASE + 0x0014)
+#define USB_SBUSCFG (MSM_USB_BASE + 0x0090)
+
+#define USB_CAPLENGTH (MSM_USB_BASE + 0x0100) /* 8 bit */
+#define USB_HCIVERSION (MSM_USB_BASE + 0x0102) /* 16 bit */
+#define USB_HCSPARAMS (MSM_USB_BASE + 0x0104)
+#define USB_HCCPARAMS (MSM_USB_BASE + 0x0108)
+#define USB_DCIVERSION (MSM_USB_BASE + 0x0120) /* 16 bit */
+#define USB_USBCMD (MSM_USB_BASE + 0x0140)
+#define USB_USBSTS (MSM_USB_BASE + 0x0144)
+#define USB_USBINTR (MSM_USB_BASE + 0x0148)
+#define USB_FRINDEX (MSM_USB_BASE + 0x014C)
+#define USB_DEVICEADDR (MSM_USB_BASE + 0x0154)
+#define USB_ENDPOINTLISTADDR (MSM_USB_BASE + 0x0158)
+#define USB_BURSTSIZE (MSM_USB_BASE + 0x0160)
+#define USB_TXFILLTUNING (MSM_USB_BASE + 0x0164)
+#define USB_ULPI_VIEWPORT (MSM_USB_BASE + 0x0170)
+#define USB_ENDPTNAK (MSM_USB_BASE + 0x0178)
+#define USB_ENDPTNAKEN (MSM_USB_BASE + 0x017C)
+#define USB_PORTSC (MSM_USB_BASE + 0x0184)
+#define USB_OTGSC (MSM_USB_BASE + 0x01A4)
+#define USB_USBMODE (MSM_USB_BASE + 0x01A8)
+#define USB_ENDPTSETUPSTAT (MSM_USB_BASE + 0x01AC)
+#define USB_ENDPTPRIME (MSM_USB_BASE + 0x01B0)
+#define USB_ENDPTFLUSH (MSM_USB_BASE + 0x01B4)
+#define USB_ENDPTSTAT (MSM_USB_BASE + 0x01B8)
+#define USB_ENDPTCOMPLETE (MSM_USB_BASE + 0x01BC)
+#define USB_ENDPTCTRL(n) (MSM_USB_BASE + 0x01C0 + (4 * (n)))
+
+#define USBCMD_RESET 2
+#define USBCMD_ATTACH 1
+#define USBCMD_ATDTW (1 << 14)
+
+#define USBMODE_DEVICE 2
+#define USBMODE_HOST 3
+
+#define ULPI_WAKEUP (1 << 31)
+#define ULPI_RUN (1 << 30)
+#define ULPI_WRITE (1 << 29)
+#define ULPI_READ (0 << 29)
+#define ULPI_STATE_NORMAL (1 << 27)
+#define ULPI_ADDR(n) (((n) & 255) << 16)
+#define ULPI_DATA(n) ((n) & 255)
+#define ULPI_DATA_READ(n) (((n) >> 8) & 255)
+
+#endif /* _EHCI_MSM7201_H */
--- kernel_hero/drivers/usb/host/Kconfig 2009-10-22 07:39:59.000000000 +0100
+++ kernel_hero.patched/drivers/usb/host/Kconfig 2010-02-07 18:27:17.314978017 +0000
@@ -88,6 +88,13 @@
---help---
Variation of ARC USB block used in some Freescale chips.

+config USB_EHCI_MSM7201
+ bool "Support for Qualcomm MSM7201 on-chip EHCI USB controller"
+ depends on USB_EHCI_HCD && ARCH_MSM7XXX && (!USB_FUNCTION)
+ select USB_EHCI_ROOT_HUB_TT
+ ---help---
+ Variation of ARC USB block used in Qualcomm MSM7201 chips.
+
config USB_EHCI_HCD_PPC_OF
bool "EHCI support for PPC USB controller on OF platform bus"
depends on USB_EHCI_HCD && PPC_OF
[/codebox]

as you can read that was a msm7201 and we have a msm7227

nexus one work is here http://sven.killig.de/android/N1/2.2/usb_host/

USB Host mode driver for the ZTE Blade is here http://sven.killig.de/android/Blade/usb_host/

and this has been discussed here http://android.modaco.com/content/zte-blad.../usb-host-mode/

looks like sven has done all the work needed to get usbdrives to show up as media

USB storage

insmod drivers/scsi/scsi_mod.ko

insmod drivers/usb/storage/usb-storage.ko

insmod drivers/scsi/sd_mod.ko

It get's automounted in /data/disk/media

Edited by hecatae
Link to comment
Share on other sites

Guest Arr Too
USB Host mode driver for the ZTE Blade is here http://sven.killig.de/android/Blade/usb_host/

and this has been discussed here http://android.modaco.com/content/zte-blad.../usb-host-mode/

looks like sven has done all the work needed to get usbdrives to show up as media

Yeah, in spite of that thread being quoted in pretty much every other post in this thread, it seems nobody wants to read it!

Link to comment
Share on other sites

Guest hecatae
Yeah, in spite of that thread being quoted in pretty much every other post in this thread, it seems nobody wants to read it!

yeah, that thread got update after it was linked to :D

Link to comment
Share on other sites

Guest oh!dougal
http://www.tombom.co.uk/blog/?p=134

been playing with this, going to need a kernel with specific OTG, a usb keyboard works, but quite a few others need external power

...

looks like sven has done all the work needed to get usbdrives to show up as media

I'm sure you'll have noted Sven used a powered hub (and actually found two that supplied power downUPstream - back to its 'host' computer, err, phone - to charge it and keep it awake).

I believe he linked to someone else working on the auto (OTG) switching.

In the absence of OTG switching, how is host mode engaged/disengaged? It wasn't clear to me that any switch had been implemented as such.

But I do know that Sven got host mode working very quickly on the Blade, so hopefully, he wouldn't have much trouble porting across any new usb developments.

Its a pity that his Host Mode hack received so little recognition. Its potentially a game-changer.

And as a side note, if someone managed to put together a usb audio driver, it would be a way of bypassing the Blade's somewhat noisy audio amp ...

Edited by oh!dougal
Link to comment
Share on other sites

Guest oh!dougal

Much of the Host mode stuff is actually on Sven's Nexus One page (linked from the Blade page).

On the N1 page, there's a link to someone working on USB OTG

http://adq.livejournal.com/101420.html

Sadly, it looks as though AdeQ hasn't been working on this since April 2010.

But it does seem as though OTG (auto-host-mode-switching) is very close to working properly ...

... anyone here fancy picking up his source?

Link to comment
Share on other sites

Guest hecatae
And as a side note, if someone managed to put together a usb audio driver, it would be a way of bypassing the Blade's somewhat noisy audio amp ...

Sven's latest modules contain usb audio.

Link to comment
Share on other sites

Guest oh!dougal

A few words of explanation might be in order.

USB "Host mode" allows the phone to play the usb role of 'computer' and instead of connecting like a usb flash drive, you could connect a usb flash (or even hard) drive to the phone.

Or you could connect a usb keyboard, mouse, headphones ...

--- But --- you have to change the phone between pretending to be a usb computer and a usb card reader.

That is where On The Go (OTG) comes in.

The cable wiring switches the mode for you.

Just use the right cable, and the phone behaves the right way.

See pin 4 in the MicroUSB diagram in this post http://android.modaco.com/index.php?s=&amp...t&p=1557113

(can't seem to copy his picture across... )

Sven has made Host Mode work on our Blades.

Can anyone fix OTG? Please !! (note the link above to 'nearly working' code)

Edited by oh!dougal
Link to comment
Share on other sites

Guest oh!dougal

Who has actually got the magic OTG cable?

Don't want to get anyone's hopes too high, but I just noticed something over on another thread.

http://android.modaco.com/content/zte-blad...l-optimization/

...kernel from the said github repo

#

# Automatically generated make config: don't edit

# Linux kernel version: 2.6.32.9

# Fri Jan 14 17:25:56 2011

#

<snip>

#

# OTG and related infrastructure

#

CONFIG_USB_OTG_UTILS=y

# CONFIG_USB_GPIO_VBUS is not set

CONFIG_USB_MSM_OTG_72K=y

# CONFIG_NOP_USB_XCEIV is not set

CONFIG_MMC=y

# CONFIG_MMC_DEBUG is not set

# CONFIG_MMC_PERF_PROFILING is not set

CONFIG_MMC_UNSAFE_RESUME=y

# CONFIG_MMC_EMBEDDED_SDIO is not set

CONFIG_MMC_PARANOID_SD_INIT=y

If 'our' FroYo doesn't have OTG, then WTF is this about?

Edited by oh!dougal
Link to comment
Share on other sites

Guest oh!dougal
Who has actually got the magic OTG cable?

...

Absent any response, I've ordered (from the UK) a micro usb to usb B male (to plug into a powered hub ...)

I might yet order the micro usb to usb A female. Only from China (so I'd need more patience), but as well as taking a standard usb cable (A to ;) to attach to a hub, it MIGHT work on its own to very low power consumption devices (keyboard? pen drive? card reader?). But lets see something working at all, before I blow another £3.

Both claim OTG capability (the pin grounded to identify a cable demanding host mode capability).

Anyway, we might be able to see if this stuff is there and working ... Tuesday?

Link to comment
Share on other sites

Guest oh!dougal
... I've ordered (from the UK) a micro usb to usb B male (to plug into a powered hub ...)

...

FAIL !

That one was actually a "micro usb a to usb b male" ... the little end is rectangular and won't fit the phone.

So I've ordered one from China. Said to suit the Nokia N8, C6 and C7 ... lets see ...

Patience!

Link to comment
Share on other sites

  • 3 months later...
Guest glemmy
FAIL !

That one was actually a "micro usb a to usb b male" ... the little end is rectangular and won't fit the phone.

So I've ordered one from China. Said to suit the Nokia N8, C6 and C7 ... lets see ...

Patience!

Any news on this issue? :mellow:

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.