added more diagnostic printouts and fixed debug() routines to ease debugging

This commit is contained in:
Markus Fröschle
2013-11-07 20:29:30 +00:00
parent 8ba5726efc
commit 735b6a690b
6 changed files with 14 additions and 10 deletions

View File

@@ -170,7 +170,7 @@ struct ohci_hcca {
uint16_t pad1; /* set to 0 on each frame_no change */
#endif
uint32_t done_head; /* info returned for an interrupt */
u8 reserved_for_hc[116];
uint8_t reserved_for_hc[116];
} __attribute__((aligned(256)));
/*

View File

@@ -228,7 +228,7 @@ typedef struct
* this is how the lowlevel part communicate with the outer world
*/
int ohci_usb_lowlevel_init(uint16_t handle, const struct pci_device_id *ent, void **priv);
int ohci_usb_lowlevel_init(int32_t handle, const struct pci_device_id *ent, void **priv);
int ohci_usb_lowlevel_stop(void *priv);
int ohci_submit_bulk_msg(struct usb_device *dev, uint32_t pipe, void *buffer, int transfer_len);
int ohci_submit_control_msg(struct usb_device *dev, uint32_t pipe, void *buffer, int transfer_len, struct devrequest *setup);
@@ -270,7 +270,7 @@ void usb_mem_stop(void);
/* routines */
USB_COOKIE *usb_get_cookie(long id);
void usb_error_msg(const char *const fmt, ... );
int usb_init(uint16_t handle, const struct pci_device_id *ent); /* initialize the USB Controller */
int usb_init(int32_t handle, const struct pci_device_id *ent); /* initialize the USB Controller */
int usb_stop(void); /* stop the USB Controller */
int usb_set_protocol(struct usb_device *dev, int ifnum, int protocol);

View File

@@ -168,7 +168,7 @@ static struct ehci {
#define SHOW_INFO
#ifdef DEBUG
#define debug(format, arg...) xprintf("DEBUG: " format, ## arg)
#define debug(format, arg...) xprintf("DEBUG: " format "\r\n", ## arg)
#else
#define debug(format, arg...) do {} while (0)
#endif /* DEBUG */
@@ -276,6 +276,7 @@ static int ehci_reset(void)
pci_write_config_longword(gehci.handle, 0xE4, 0x20); // oscillator
}
cmd = ehci_readl(&gehci.hcor->or_usbcmd);
debug("cmd: 0x%08x\r\n", cmd);
cmd |= CMD_RESET;
ehci_writel(&gehci.hcor->or_usbcmd, cmd);
ret = handshake((uint32_t *)&gehci.hcor->or_usbcmd, CMD_RESET, 0, 250 * 1000);

View File

@@ -69,7 +69,6 @@
/*
* e.g. PCI controllers need this
*/
#define CONFIG_SYS_OHCI_SWAP_REG_ACCES
#ifdef CONFIG_SYS_OHCI_SWAP_REG_ACCESS
#define readl(a) swpl(*((volatile uint32_t *)(a)))
@@ -1925,7 +1924,7 @@ static void hc_free_buffers(ohci_t *ohci)
/*
* low level initalisation routine, called from usb.c
*/
int ohci_usb_lowlevel_init(uint16_t handle, const struct pci_device_id *ent, void **priv)
int ohci_usb_lowlevel_init(int32_t handle, const struct pci_device_id *ent, void **priv)
{
uint32_t usb_base_addr = 0xFFFFFFFF;
ohci_t *ohci = &gohci[PCI_FUNCTION_FROM_HANDLE(handle) & 1];
@@ -1990,7 +1989,7 @@ int ohci_usb_lowlevel_init(uint16_t handle, const struct pci_device_id *ent, voi
unsigned short flags;
do
{
xprintf("PCI USB descriptors: flags 0x%04x start 0x%08lx \r\n offset 0x%08lx dmaoffset 0x%08lx length 0x%08lx",
xprintf("\r\nPCI USB descriptors: flags 0x%04x start 0x%08lx \r\n offset 0x%08lx dmaoffset 0x%08lx length 0x%08lx\r\n",
pci_rsc_desc->flags, pci_rsc_desc->start, pci_rsc_desc->offset, pci_rsc_desc->dmaoffset, pci_rsc_desc->length);
if (!(pci_rsc_desc->flags & FLG_IO))
{

View File

@@ -513,7 +513,7 @@ void init_usb(void)
uint16_t usb_found;
int index = 0;
xprintf("USB controller initialization: ");
xprintf("USB controller initialization:\r\n");
do
{
@@ -528,7 +528,11 @@ void init_usb(void)
if (PCI_CLASS_CODE(class) == PCI_CLASS_SERIAL_USB)
{
xprintf("serial USB found at #%x\r\n", handle);
xprintf("serial USB found at bus=0x%x, dev=0x%x, fnc=0x%x (0x%x)\r\n",
PCI_BUS_FROM_HANDLE(handle),
PCI_DEVICE_FROM_HANDLE(handle),
PCI_FUNCTION_FROM_HANDLE(handle),
handle);
if (PCI_SUBCLASS(class) == PCI_CLASS_SERIAL_USB_EHCI)
{
board = ehci_usb_pci_table;

View File

@@ -111,7 +111,7 @@ extern int printk(PRINTK_INFO *info, const char *fmt, va_list ap);
/***************************************************************************
* Init USB Device
*/
int usb_init(uint16_t handle, const struct pci_device_id *ent)
int usb_init(int32_t handle, const struct pci_device_id *ent)
{
void *priv;
int res = 0;