Kyösti Mälkki (kyosti.malkki@gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3476
-gerrit
commit 46d9957b457fa95d328278d0f8b85f74c6588aa6 Author: Aaron Durbin adurbin@chromium.org Date: Sat Jun 15 14:56:20 2013 +0300
usbdebug: Initialize EHCI Debug Port just once
If we already initialized EHCI in romstage, locate current configuration from salvaged CAR_GLOBAL and avoid doing initialization second time.
The initialization sequence resets USB link and has been witnessed to cause troubles/disconnects when used with kernel USB gadget G_DBGP_SERIAL as the receiving party.
Change-Id: I7cb3a359488b25abc9de49c96c0197f6563a4a2c Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- src/lib/usbdebug.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
diff --git a/src/lib/usbdebug.c b/src/lib/usbdebug.c index 0fdf221..ad02b6e 100644 --- a/src/lib/usbdebug.c +++ b/src/lib/usbdebug.c @@ -366,6 +366,33 @@ static int ehci_wait_for_port(struct ehci_regs *ehci_regs, int port) return -1; //-ENOTCONN; }
+#if !defined(__PRE_RAM__) && !defined(__SMM__) +static int get_usbdebug_from_cbmem(struct ehci_debug_info *info) +{ + struct ehci_debug_info *dbg_info_cbmem; + + dbg_info_cbmem = cbmem_find(CBMEM_ID_EHCI_DEBUG); + + if (dbg_info_cbmem == NULL) + return -1; + + printk(BIOS_DEBUG, "EHCI debug port found in cbmem.\n"); + + info->ehci_caps = dbg_info_cbmem->ehci_caps; + info->ehci_regs = dbg_info_cbmem->ehci_regs; + info->ehci_debug = dbg_info_cbmem->ehci_debug; + info->devnum = dbg_info_cbmem->devnum; + info->endpoint_out = dbg_info_cbmem->endpoint_out; + info->endpoint_in = dbg_info_cbmem->endpoint_in; + + return 0; +} +#else +static int get_usbdebug_from_cbmem(struct ehci_debug_info *info) +{ + return -1; +} +#endif
int usbdebug_init(unsigned ehci_bar, unsigned offset, struct ehci_debug_info *info) { @@ -384,6 +411,9 @@ int usbdebug_init(unsigned ehci_bar, unsigned offset, struct ehci_debug_info *in int port_map_tried; int playtimes = 3;
+ if (!get_usbdebug_from_cbmem(info)) + return 0; + ehci_caps = (struct ehci_caps *)ehci_bar; ehci_regs = (struct ehci_regs *)(ehci_bar + HC_LENGTH(read32((unsigned long)&ehci_caps->hc_capbase)));