fixed more undefined symbols
This commit is contained in:
@@ -210,7 +210,7 @@ struct resource_descriptor
|
|||||||
uint8_t private;
|
uint8_t private;
|
||||||
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
extern int pci_find_device(uint16_t device_id, uint16_t vendor_id, int index);
|
extern uint16_t pci_find_device(uint16_t device_id, uint16_t vendor_id, int index);
|
||||||
|
|
||||||
extern uint32_t pci_read_config_longword(uint16_t handle, uint16_t offset);
|
extern uint32_t pci_read_config_longword(uint16_t handle, uint16_t offset);
|
||||||
extern uint16_t pci_read_config_word(uint16_t handle, uint16_t offset);
|
extern uint16_t pci_read_config_word(uint16_t handle, uint16_t offset);
|
||||||
@@ -221,8 +221,8 @@ extern void pci_write_config_word(uint16_t handle, uint16_t offset, uint16_t val
|
|||||||
extern void pci_write_config_byte(uint16_t handle, uint16_t offset, uint8_t value);
|
extern void pci_write_config_byte(uint16_t handle, uint16_t offset, uint8_t value);
|
||||||
|
|
||||||
extern struct resource_descriptor *pci_get_resource(uint16_t handle);
|
extern struct resource_descriptor *pci_get_resource(uint16_t handle);
|
||||||
extern void pci_hook_interrupt();
|
extern int16_t pci_hook_interrupt(uint16_t handle, void *interrupt_handler, void *parameter);
|
||||||
extern void pci_unhook_interrupt();
|
extern int16_t pci_unhook_interrupt(uint16_t handle);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ static struct ehci {
|
|||||||
#else
|
#else
|
||||||
#define debug(format, arg...) do {} while (0)
|
#define debug(format, arg...) do {} while (0)
|
||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
#define err usb_error_msg
|
#define err xprintf
|
||||||
#ifdef SHOW_INFO
|
#ifdef SHOW_INFO
|
||||||
#define info(format, arg...) board_printf("INFO: " format "\r\n", ## arg)
|
#define info(format, arg...) board_printf("INFO: " format "\r\n", ## arg)
|
||||||
#else
|
#else
|
||||||
@@ -309,11 +309,7 @@ static int ehci_reset(void)
|
|||||||
{
|
{
|
||||||
uint32_t usb_base_addr = 0xFFFFFFFF;
|
uint32_t usb_base_addr = 0xFFFFFFFF;
|
||||||
PCI_RSC_DESC *pci_rsc_desc;
|
PCI_RSC_DESC *pci_rsc_desc;
|
||||||
#ifdef PCI_XBIOS
|
pci_rsc_desc = (PCI_RSC_DESC *)pci_get_resource(handle); /* USB OHCI */
|
||||||
pci_rsc_desc = (PCI_RSC_DESC *)get_resource(handle); /* USB OHCI */
|
|
||||||
#else
|
|
||||||
pci_rsc_desc = (PCI_RSC_DESC *)Get_resource(handle); /* USB OHCI */
|
|
||||||
#endif
|
|
||||||
if((long)pci_rsc_desc >= 0)
|
if((long)pci_rsc_desc >= 0)
|
||||||
{
|
{
|
||||||
unsigned short flags;
|
unsigned short flags;
|
||||||
@@ -594,11 +590,7 @@ fail:
|
|||||||
ehci_free(qh, sizeof(*qh));
|
ehci_free(qh, sizeof(*qh));
|
||||||
if(ehci_readl(&gehci.hcor->or_usbsts) & STS_HSE) /* Host System Error */
|
if(ehci_readl(&gehci.hcor->or_usbsts) & STS_HSE) /* Host System Error */
|
||||||
{
|
{
|
||||||
#ifdef PCI_XBIOS
|
unsigned short status = pci_read_config_word(gehci.handle, PCISR);
|
||||||
unsigned short status = fast_read_config_word(gehci.handle, PCISR);
|
|
||||||
#else
|
|
||||||
unsigned short status = Fast_read_config_word(gehci.handle, PCISR);
|
|
||||||
#endif
|
|
||||||
err("EHCI Host System Error, controller usb-%s disabled\r\n(SR:0x%04X%s%s%s%s%s%s)", gehci.slot_name, status & 0xFFFF,
|
err("EHCI Host System Error, controller usb-%s disabled\r\n(SR:0x%04X%s%s%s%s%s%s)", gehci.slot_name, status & 0xFFFF,
|
||||||
status & 0x8000 ? ", Parity error" : "", status & 0x4000 ? ", Signaled system error" : "", status & 0x2000 ? ", Received master abort" : "",
|
status & 0x8000 ? ", Parity error" : "", status & 0x4000 ? ", Signaled system error" : "", status & 0x2000 ? ", Received master abort" : "",
|
||||||
status & 0x1000 ? ", Received target abort" : "", status & 0x800 ? ", Signaled target abort" : "", status & 0x100 ? ", Data parity error" : "");
|
status & 0x1000 ? ", Received target abort" : "", status & 0x800 ? ", Signaled target abort" : "", status & 0x100 ? ", Data parity error" : "");
|
||||||
@@ -947,16 +939,7 @@ int ehci_usb_lowlevel_init(long handle, const struct pci_device_id *ent, void **
|
|||||||
#endif
|
#endif
|
||||||
uint32_t usb_base_addr = 0xFFFFFFFF;
|
uint32_t usb_base_addr = 0xFFFFFFFF;
|
||||||
PCI_RSC_DESC *pci_rsc_desc;
|
PCI_RSC_DESC *pci_rsc_desc;
|
||||||
#ifdef PCI_XBIOS
|
pci_rsc_desc = (PCI_RSC_DESC *)pci_get_resource(handle); /* USB EHCI */
|
||||||
pci_rsc_desc = (PCI_RSC_DESC *)get_resource(handle); /* USB EHCI */
|
|
||||||
#else
|
|
||||||
USB_COOKIE *p = usb_get_cookie('_PCI');
|
|
||||||
PCI_COOKIE *bios_cookie = (PCI_COOKIE *)p->v.l;
|
|
||||||
if(bios_cookie == NULL) /* faster than XBIOS calls */
|
|
||||||
return(-1);
|
|
||||||
tab_funcs_pci = &bios_cookie->routine[0];
|
|
||||||
pci_rsc_desc = (PCI_RSC_DESC *)Get_resource(handle); /* USB EHCI */
|
|
||||||
#endif
|
|
||||||
if(handle && (ent != NULL))
|
if(handle && (ent != NULL))
|
||||||
{
|
{
|
||||||
memset(&gehci, 0, sizeof(struct ehci));
|
memset(&gehci, 0, sizeof(struct ehci));
|
||||||
@@ -1048,7 +1031,7 @@ int ehci_usb_lowlevel_init(long handle, const struct pci_device_id *ent, void **
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
gehci.hcor = (struct ehci_hcor *)((uint32_t)gehci.hccr + HC_LENGTH(ehci_readl(&gehci.hccr->cr_capbase)));
|
gehci.hcor = (struct ehci_hcor *)((uint32_t)gehci.hccr + HC_LENGTH(ehci_readl(&gehci.hccr->cr_capbase)));
|
||||||
kprint("EHCI usb-%s, regs address 0x%08X, PCI handle 0x%X\r\n", gehci.slot_name, gehci.hccr, handle);
|
xprintf("EHCI usb-%s, regs address 0x%08X, PCI handle 0x%X\r\n", gehci.slot_name, gehci.hccr, handle);
|
||||||
|
|
||||||
/* EHCI spec section 4.1 */
|
/* EHCI spec section 4.1 */
|
||||||
if(ehci_reset() != 0)
|
if(ehci_reset() != 0)
|
||||||
@@ -1090,15 +1073,9 @@ int ehci_usb_lowlevel_init(long handle, const struct pci_device_id *ent, void **
|
|||||||
wait(5 * 1000);
|
wait(5 * 1000);
|
||||||
reg = HC_VERSION(ehci_readl(&gehci.hccr->cr_capbase));
|
reg = HC_VERSION(ehci_readl(&gehci.hccr->cr_capbase));
|
||||||
info("USB EHCI %x.%02x", reg >> 8, reg & 0xff);
|
info("USB EHCI %x.%02x", reg >> 8, reg & 0xff);
|
||||||
#ifndef CONFIG_USB_INTERRUPT_POLLING
|
|
||||||
/* turn on interrupts */
|
/* turn on interrupts */
|
||||||
#ifdef PCI_XBIOS
|
pci_hook_interrupt(handle, handle_usb_interrupt, &gehci);
|
||||||
hook_interrupt(handle, handle_usb_interrupt, &gehci);
|
|
||||||
#else
|
|
||||||
Hook_interrupt(handle, (void *)handle_usb_interrupt, (uint32_t *)&gehci);
|
|
||||||
#endif /* PCI_BIOS */
|
|
||||||
ehci_writel(&gehci.hcor->or_usbintr, INTR_PCDE);
|
ehci_writel(&gehci.hcor->or_usbintr, INTR_PCDE);
|
||||||
#endif /* CONFIG_USB_INTERRUPT_POLLING */
|
|
||||||
rootdev = 0;
|
rootdev = 0;
|
||||||
if(priv != NULL)
|
if(priv != NULL)
|
||||||
*priv = (void *)&gehci;
|
*priv = (void *)&gehci;
|
||||||
@@ -1112,15 +1089,9 @@ int ehci_usb_lowlevel_stop(void *priv)
|
|||||||
if(priv);
|
if(priv);
|
||||||
if(!ehci_inited)
|
if(!ehci_inited)
|
||||||
return(0);
|
return(0);
|
||||||
#ifndef CONFIG_USB_INTERRUPT_POLLING
|
|
||||||
/* turn off interrupts */
|
/* turn off interrupts */
|
||||||
ehci_writel(&gehci.hcor->or_usbintr, 0);
|
ehci_writel(&gehci.hcor->or_usbintr, 0);
|
||||||
#ifdef PCI_XBIOS
|
pci_unhook_interrupt(gehci.handle);
|
||||||
unhook_interrupt(gehci.handle);
|
|
||||||
#else
|
|
||||||
Unhook_interrupt(gehci.handle);
|
|
||||||
#endif /* PCI_BIOS */
|
|
||||||
#endif /* CONFIG_USB_INTERRUPT_POLLING */
|
|
||||||
/* stop the controller */
|
/* stop the controller */
|
||||||
cmd = ehci_readl(&gehci.hcor->or_usbcmd);
|
cmd = ehci_readl(&gehci.hcor->or_usbcmd);
|
||||||
cmd &= ~CMD_RUN;
|
cmd &= ~CMD_RUN;
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ struct resource_descriptor *pci_get_resource(uint16_t handle)
|
|||||||
return (struct resource_descriptor *) 0L;
|
return (struct resource_descriptor *) 0L;
|
||||||
}
|
}
|
||||||
|
|
||||||
int pci_find_device(uint16_t device_id, uint16_t vendor_id, int index)
|
uint16_t pci_find_device(uint16_t device_id, uint16_t vendor_id, int index)
|
||||||
{
|
{
|
||||||
uint16_t bus;
|
uint16_t bus;
|
||||||
uint16_t slot;
|
uint16_t slot;
|
||||||
@@ -201,6 +201,19 @@ int pci_find_device(uint16_t device_id, uint16_t vendor_id, int index)
|
|||||||
return PCI_DEVICE_NOT_FOUND;
|
return PCI_DEVICE_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int16_t pci_hook_interrupt(uint16_t handle, void *handler, void *parameter)
|
||||||
|
{
|
||||||
|
/* FIXME: implement */
|
||||||
|
return PCI_SUCCESSFUL;
|
||||||
|
}
|
||||||
|
|
||||||
|
int16_t pci_unhook_interrupt(uint16_t handle)
|
||||||
|
{
|
||||||
|
/* FIXME: implement */
|
||||||
|
|
||||||
|
return PCI_SUCCESSFUL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static uint32_t mem_address = PCI_MEMORY_OFFSET;
|
static uint32_t mem_address = PCI_MEMORY_OFFSET;
|
||||||
static uint32_t io_address = PCI_IO_OFFSET;
|
static uint32_t io_address = PCI_IO_OFFSET;
|
||||||
|
|||||||
Reference in New Issue
Block a user