ehci->cap = regs;
caplength = readb ( ehci->cap + EHCI_CAP_CAPLENGTH );
ehci->op = ( ehci->cap + caplength );
- DBGC2 ( ehci, "EHCI %p cap %08lx op %08lx\n", ehci,
+ DBGC2 ( ehci, "EHCI %s cap %08lx op %08lx\n", ehci->name,
virt_to_phys ( ehci->cap ), virt_to_phys ( ehci->op ) );
/* Read structural parameters */
hcsparams = readl ( ehci->cap + EHCI_CAP_HCSPARAMS );
ehci->ports = EHCI_HCSPARAMS_PORTS ( hcsparams );
- DBGC ( ehci, "EHCI %p has %d ports\n", ehci, ehci->ports );
+ DBGC ( ehci, "EHCI %s has %d ports\n", ehci->name, ehci->ports );
/* Read capability parameters 1 */
hccparams = readl ( ehci->cap + EHCI_CAP_HCCPARAMS );
ehci->flsize = ( EHCI_HCCPARAMS_FLSIZE ( hccparams ) ?
EHCI_FLSIZE_SMALL : EHCI_FLSIZE_DEFAULT );
ehci->eecp = EHCI_HCCPARAMS_EECP ( hccparams );
- DBGC2 ( ehci, "EHCI %p %d-bit flsize %d\n", ehci,
+ DBGC2 ( ehci, "EHCI %s %d-bit flsize %d\n", ehci->name,
( ehci->addr64 ? 64 : 32 ), ehci->flsize );
}
legacy = ehci_extended_capability ( ehci, pci, EHCI_EECP_ID_LEGACY, 0 );
if ( ! legacy ) {
/* Not an error; capability may not be present */
- DBGC ( ehci, "EHCI %p has no USB legacy support capability\n",
- ehci );
+ DBGC ( ehci, "EHCI %s has no USB legacy support capability\n",
+ ehci->name );
return;
}
pci_read_config_byte ( pci, ( legacy + EHCI_USBLEGSUP_BIOS ), &bios );
if ( ! ( bios & EHCI_USBLEGSUP_BIOS_OWNED ) ) {
/* Not an error; already owned by OS */
- DBGC ( ehci, "EHCI %p USB legacy support already disabled\n",
- ehci );
+ DBGC ( ehci, "EHCI %s USB legacy support already disabled\n",
+ ehci->name );
return;
}
pci_read_config_byte ( pci, ( legacy + EHCI_USBLEGSUP_BIOS ),
&bios );
if ( ! ( bios & EHCI_USBLEGSUP_BIOS_OWNED ) ) {
- DBGC ( ehci, "EHCI %p claimed ownership from BIOS\n",
- ehci );
+ DBGC ( ehci, "EHCI %s claimed ownership from BIOS\n",
+ ehci->name );
pci_read_config_dword ( pci, ( legacy +
EHCI_USBLEGSUP_CTLSTS ),
&ctlsts );
if ( ctlsts ) {
- DBGC ( ehci, "EHCI %p warning: BIOS retained "
- "SMIs: %08x\n", ehci, ctlsts );
+ DBGC ( ehci, "EHCI %s warning: BIOS retained "
+ "SMIs: %08x\n", ehci->name, ctlsts );
}
return;
}
/* BIOS did not release ownership. Claim it forcibly by
* disabling all SMIs.
*/
- DBGC ( ehci, "EHCI %p could not claim ownership from BIOS: forcibly "
- "disabling SMIs\n", ehci );
+ DBGC ( ehci, "EHCI %s could not claim ownership from BIOS: forcibly "
+ "disabling SMIs\n", ehci->name );
pci_write_config_dword ( pci, ( legacy + EHCI_USBLEGSUP_CTLSTS ), 0 );
}
/* Do nothing if releasing ownership is prevented */
if ( ehci_legacy_prevent_release ) {
- DBGC ( ehci, "EHCI %p not releasing ownership to BIOS\n", ehci);
+ DBGC ( ehci, "EHCI %s not releasing ownership to BIOS\n",
+ ehci->name );
return;
}
/* Release ownership */
pci_write_config_byte ( pci, ( ehci->legacy + EHCI_USBLEGSUP_OS ), 0 );
- DBGC ( ehci, "EHCI %p released ownership to BIOS\n", ehci );
+ DBGC ( ehci, "EHCI %s released ownership to BIOS\n", ehci->name );
}
/******************************************************************************
continue;
/* Poll child companion controller bus */
+ DBGC2 ( ehci, "EHCI %s polling companion %s\n",
+ ehci->name, bus->name );
usb_poll ( bus );
}
}
mdelay ( 1 );
}
- DBGC ( ehci, "EHCI %p timed out waiting for stop\n", ehci );
+ DBGC ( ehci, "EHCI %s timed out waiting for stop\n", ehci->name );
return -ETIMEDOUT;
}
mdelay ( 1 );
}
- DBGC ( ehci, "EHCI %p timed out waiting for reset\n", ehci );
+ DBGC ( ehci, "EHCI %s timed out waiting for reset\n", ehci->name );
return -ETIMEDOUT;
}
goto err_alloc_queue;
}
if ( ( rc = ehci_ctrl_reachable ( ehci, ring->head ) ) != 0 ) {
- DBGC ( ehci, "EHCI %p queue head unreachable\n", ehci );
+ DBGC ( ehci, "EHCI %s queue head unreachable\n", ehci->name );
goto err_unreachable_queue;
}
memset ( ring->head, 0, sizeof ( *ring->head ) );
for ( i = 0 ; i < EHCI_RING_COUNT ; i++ ) {
desc = &ring->desc[i];
if ( ( rc = ehci_ctrl_reachable ( ehci, desc ) ) != 0 ) {
- DBGC ( ehci, "EHCI %p descriptor unreachable\n", ehci );
+ DBGC ( ehci, "EHCI %s descriptor unreachable\n",
+ ehci->name );
goto err_unreachable_desc;
}
next = &ring->desc[ ( i + 1 ) % EHCI_RING_COUNT ];
}
/* Bad things will probably happen now */
- DBGC ( ehci, "EHCI %p timed out waiting for asynchronous schedule "
- "to advance\n", ehci );
+ DBGC ( ehci, "EHCI %s timed out waiting for asynchronous schedule "
+ "to advance\n", ehci->name );
return -ETIMEDOUT;
}
* safely run concurrently with hardware execution of the
* schedule.
*/
- DBGCP ( ehci, "EHCI %p periodic schedule: ", ehci );
+ DBGCP ( ehci, "EHCI %s periodic schedule: ", ehci->name );
link = EHCI_LINK_TERMINATE;
list_for_each_entry_reverse ( endpoint, &ehci->periodic, schedule ) {
queue = endpoint->ring.head;
DBGCP ( ehci, "\n" );
/* Populate periodic frame list */
- DBGCP ( ehci, "EHCI %p periodic frame list:", ehci );
+ DBGCP ( ehci, "EHCI %s periodic frame list:", ehci->name );
frames = EHCI_PERIODIC_FRAMES ( ehci->flsize );
for ( i = 0 ; i < frames ; i++ ) {
/* No way to prevent hardware from continuing to
* access the memory, so leak it.
*/
- DBGC ( ehci, "EHCI %p %s endpoint %02x could not unschedule: "
- "%s\n", ehci, usb->name, ep->address, strerror ( rc ) );
+ DBGC ( ehci, "EHCI %s %s could not unschedule: %s\n",
+ usb->name, usb_endpoint_name ( ep ), strerror ( rc ) );
return;
}
*/
if ( status & EHCI_STATUS_HALTED ) {
rc = -EIO_STATUS ( status );
- DBGC ( ehci, "EHCI %p %s endpoint %02x completion %d "
- "failed (status %02x): %s\n", ehci, usb->name,
- ep->address, index, status, strerror ( rc ) );
+ DBGC ( ehci, "EHCI %s %s completion %d failed (status "
+ "%02x): %s\n", usb->name,
+ usb_endpoint_name ( ep ), index, status,
+ strerror ( rc ) );
while ( ! iobuf )
iobuf = ehci_dequeue ( ring );
usb_complete_err ( endpoint->ep, iobuf, rc );
address = usb_alloc_address ( bus );
if ( address < 0 ) {
rc = address;
- DBGC ( ehci, "EHCI %p %s could not allocate address: %s\n",
- ehci, usb->name, strerror ( rc ) );
+ DBGC ( ehci, "EHCI %s could not allocate address: %s\n",
+ usb->name, strerror ( rc ) );
goto err_alloc_address;
}
portsc = readl ( ehci->op + EHCI_OP_PORTSC ( port->address ) );
line = EHCI_PORTSC_LINE_STATUS ( portsc );
if ( line == EHCI_PORTSC_LINE_STATUS_LOW ) {
- DBGC ( ehci, "EHCI %p port %d detected low-speed device: "
- "disowning\n", ehci, port->address );
+ DBGC ( ehci, "EHCI %s-%d detected low-speed device: "
+ "disowning\n", ehci->name, port->address );
goto disown;
}
if ( ! ( portsc & EHCI_PORTSC_PR ) ) {
if ( portsc & EHCI_PORTSC_PED )
return 0;
- DBGC ( ehci, "EHCI %p port %d not enabled after reset: "
- "disowning\n", ehci, port->address );
+ DBGC ( ehci, "EHCI %s-%d not enabled after reset: "
+ "disowning\n", ehci->name, port->address );
goto disown;
}
mdelay ( 1 );
}
- DBGC ( ehci, "EHCI %p timed out waiting for port %d to reset\n",
- ehci, port->address );
+ DBGC ( ehci, "EHCI %s-%d timed out waiting for port to reset\n",
+ ehci->name, port->address );
return -ETIMEDOUT;
disown:
/* Read port status */
portsc = readl ( ehci->op + EHCI_OP_PORTSC ( port->address ) );
- DBGC2 ( ehci, "EHCI %p port %d status is %08x\n",
- ehci, port->address, portsc );
+ DBGC2 ( ehci, "EHCI %s-%d status is %08x\n",
+ ehci->name, port->address, portsc );
ccs = ( portsc & EHCI_PORTSC_CCS );
csc = ( portsc & EHCI_PORTSC_CSC );
ped = ( portsc & EHCI_PORTSC_PED );
struct ehci_device *ehci = usb_hub_get_drvdata ( hub );
/* Should never be called; this is a root hub */
- DBGC ( ehci, "EHCI %p port %d nonsensical CLEAR_TT for %s endpoint "
- "%02x\n", ehci, port->address, ep->usb->name, ep->address );
+ DBGC ( ehci, "EHCI %s-%d nonsensical CLEAR_TT for %s %s\n", ehci->name,
+ port->address, ep->usb->name, usb_endpoint_name ( ep ) );
return -ENOTSUP;
}
if ( ehci->addr64 ) {
writel ( ehci->ctrldssegment, ehci->op + EHCI_OP_CTRLDSSEGMENT);
} else if ( ehci->ctrldssegment ) {
- DBGC ( ehci, "EHCI %p CTRLDSSEGMENT not supported\n", ehci );
+ DBGC ( ehci, "EHCI %s CTRLDSSEGMENT not supported\n",
+ ehci->name );
rc = -ENOTSUP;
goto err_ctrldssegment;
}
goto err_alloc_frame;
}
if ( ( rc = ehci_ctrl_reachable ( ehci, ehci->frame ) ) != 0 ) {
- DBGC ( ehci, "EHCI %p frame list unreachable\n", ehci );
+ DBGC ( ehci, "EHCI %s frame list unreachable\n", ehci->name );
goto err_unreachable_frame;
}
ehci_periodic_schedule ( ehci );
/* Report fatal errors */
if ( change & EHCI_USBSTS_SYSERR )
- DBGC ( ehci, "EHCI %p host system error\n", ehci );
+ DBGC ( ehci, "EHCI %s host system error\n", ehci->name );
}
/******************************************************************************
rc = -ENOMEM;
goto err_alloc;
}
+ ehci->name = pci->dev.name;
INIT_LIST_HEAD ( &ehci->endpoints );
INIT_LIST_HEAD ( &ehci->async );
INIT_LIST_HEAD ( &ehci->periodic );