reformatted, added diagnostics, defined swapped access

This commit is contained in:
Markus Fröschle
2013-11-03 18:07:54 +00:00
parent 0b97fd806d
commit a1c960772b
3 changed files with 133 additions and 120 deletions

View File

@@ -163,8 +163,11 @@ static struct ehci {
const char *slot_name; const char *slot_name;
} gehci; } gehci;
#define DEBUG
#define SHOW_INFO
#ifdef DEBUG #ifdef DEBUG
#define debug(format, arg...) board_printf("DEBUG: " format, ## arg) #define debug(format, arg...) xprintf("DEBUG: " format, ## arg)
#else #else
#define debug(format, arg...) do {} while (0) #define debug(format, arg...) do {} while (0)
#endif /* DEBUG */ #endif /* DEBUG */

View File

@@ -68,6 +68,8 @@
/* /*
* e.g. PCI controllers need this * e.g. PCI controllers need this
*/ */
#define CONFIG_SYS_OHCI_SWAP_REG_ACCES
#ifdef CONFIG_SYS_OHCI_SWAP_REG_ACCESS #ifdef CONFIG_SYS_OHCI_SWAP_REG_ACCESS
#define readl(a) swpl(*((volatile uint32_t *)(a))) #define readl(a) swpl(*((volatile uint32_t *)(a)))
#define writel(a, b) (*((volatile uint32_t *)(b)) = swpl((volatile uint32_t)a)) #define writel(a, b) (*((volatile uint32_t *)(b)) = swpl((volatile uint32_t)a))
@@ -108,7 +110,15 @@ struct pci_device_id ohci_usb_pci_table[] =
0 0
}, /* Philips 1561 PCI OHCI module ids */ }, /* Philips 1561 PCI OHCI module ids */
/* Please add supported PCI OHCI controller ids here */ /* Please add supported PCI OHCI controller ids here */
{ 0, 0, 0, 0, 0, 0, 0 } {
0,
0,
0,
0,
0,
0,
0
}
}; };
#ifdef DEBUG #ifdef DEBUG
@@ -134,7 +144,8 @@ static inline uint32_t roothub_portstatus(ohci_t *ohci, int i) { return readl(&o
static void flush_data_cache(ohci_t *ohci); static void flush_data_cache(ohci_t *ohci);
static int hc_interrupt(ohci_t *ohci); static int hc_interrupt(ohci_t *ohci);
static void td_submit_job(ohci_t *ohci, struct usb_device *dev, uint32_t pipe, static void td_submit_job(ohci_t *ohci, struct usb_device *dev, uint32_t pipe,
void *buffer, int transfer_len, struct devrequest *setup, urb_priv_t *urb, int interval); void *buffer, int transfer_len, struct devrequest *setup,
urb_priv_t *urb, int interval);
/*-------------------------------------------------------------------------* /*-------------------------------------------------------------------------*
* URB support functions * URB support functions

View File

@@ -248,7 +248,6 @@ int usb_mem_init(void)
#ifdef USE_RADEON_MEMORY #ifdef USE_RADEON_MEMORY
usb_buffer = (void *)offscren_reserved(); usb_buffer = (void *)offscren_reserved();
if (usb_buffer == NULL) if (usb_buffer == NULL)
#else
#endif #endif
memset(usb_buffer, 0, USB_BUFFER_SIZE); memset(usb_buffer, 0, USB_BUFFER_SIZE);