fixed type mismatches (unsigned long <-> uint32_t)
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
# can be either "Y" or "N" (without quotes). "Y" for using the m68k-elf-, "N" for using the m68k-atari-mint
|
# can be either "Y" or "N" (without quotes). "Y" for using the m68k-elf-, "N" for using the m68k-atari-mint
|
||||||
# toolchain
|
# toolchain
|
||||||
COMPILE_ELF=Y
|
COMPILE_ELF=N
|
||||||
|
|
||||||
ifeq (Y,$(COMPILE_ELF))
|
ifeq (Y,$(COMPILE_ELF))
|
||||||
TCPREFIX=m68k-elf-
|
TCPREFIX=m68k-elf-
|
||||||
|
|||||||
@@ -369,7 +369,7 @@ typedef struct
|
|||||||
uint16_t td_cnt; /* number of tds already serviced */
|
uint16_t td_cnt; /* number of tds already serviced */
|
||||||
struct usb_device *dev;
|
struct usb_device *dev;
|
||||||
int state;
|
int state;
|
||||||
unsigned long pipe;
|
uint32_t pipe;
|
||||||
void *transfer_buffer;
|
void *transfer_buffer;
|
||||||
int transfer_buffer_length;
|
int transfer_buffer_length;
|
||||||
int interval;
|
int interval;
|
||||||
@@ -414,10 +414,10 @@ typedef struct ohci {
|
|||||||
int disabled; /* e.g. got a UE, we're hung */
|
int disabled; /* e.g. got a UE, we're hung */
|
||||||
int sleeping;
|
int sleeping;
|
||||||
#define OHCI_FLAGS_NEC 0x80000000
|
#define OHCI_FLAGS_NEC 0x80000000
|
||||||
unsigned long flags; /* for HC bugs */
|
uint32_t flags; /* for HC bugs */
|
||||||
|
|
||||||
unsigned long offset;
|
uint32_t offset;
|
||||||
unsigned long dma_offset;
|
uint32_t dma_offset;
|
||||||
struct ohci_regs *regs; /* OHCI controller's memory */
|
struct ohci_regs *regs; /* OHCI controller's memory */
|
||||||
|
|
||||||
int ohci_int_load[32]; /* load of the 32 Interrupt Chains (for load balancing)*/
|
int ohci_int_load[32]; /* load of the 32 Interrupt Chains (for load balancing)*/
|
||||||
@@ -439,7 +439,7 @@ typedef struct ohci {
|
|||||||
/* endpoint */
|
/* endpoint */
|
||||||
static int ep_link(ohci_t * ohci, ed_t * ed);
|
static int ep_link(ohci_t * ohci, ed_t * ed);
|
||||||
static int ep_unlink(ohci_t * ohci, ed_t * ed);
|
static int ep_unlink(ohci_t * ohci, ed_t * ed);
|
||||||
static ed_t * ep_add_ed(ohci_t * ohci, struct usb_device * usb_dev, unsigned long pipe, int interval, int load);
|
static ed_t * ep_add_ed(ohci_t * ohci, struct usb_device * usb_dev, uint32_t pipe, int interval, int load);
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ static struct ehci {
|
|||||||
struct qTD *td[3];
|
struct qTD *td[3];
|
||||||
struct descriptor *descriptor;
|
struct descriptor *descriptor;
|
||||||
int irq;
|
int irq;
|
||||||
unsigned long dma_offset;
|
uint32_t dma_offset;
|
||||||
const char *slot_name;
|
const char *slot_name;
|
||||||
} gehci;
|
} gehci;
|
||||||
|
|
||||||
@@ -299,7 +299,7 @@ static int ehci_reset(void)
|
|||||||
#endif
|
#endif
|
||||||
if((handle >= 0) && ((gehci.handle & 0xFFFF) == (handle & 0xFFFF)))
|
if((handle >= 0) && ((gehci.handle & 0xFFFF) == (handle & 0xFFFF)))
|
||||||
{
|
{
|
||||||
unsigned long class;
|
uint32_t class;
|
||||||
#ifdef PCI_XBIOS
|
#ifdef PCI_XBIOS
|
||||||
long error = read_config_longword(handle, PCIREV, &class);
|
long error = read_config_longword(handle, PCIREV, &class);
|
||||||
#else
|
#else
|
||||||
@@ -307,7 +307,7 @@ static int ehci_reset(void)
|
|||||||
#endif
|
#endif
|
||||||
if((error >= 0) && ((class >> 16) == PCI_CLASS_SERIAL_USB) && ((class >> 8) == PCI_CLASS_SERIAL_USB_OHCI))
|
if((error >= 0) && ((class >> 16) == PCI_CLASS_SERIAL_USB) && ((class >> 8) == PCI_CLASS_SERIAL_USB_OHCI))
|
||||||
{
|
{
|
||||||
unsigned long 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
|
#ifdef PCI_XBIOS
|
||||||
pci_rsc_desc = (PCI_RSC_DESC *)get_resource(handle); /* USB OHCI */
|
pci_rsc_desc = (PCI_RSC_DESC *)get_resource(handle); /* USB OHCI */
|
||||||
@@ -323,13 +323,13 @@ static int ehci_reset(void)
|
|||||||
{
|
{
|
||||||
if(usb_base_addr == 0xFFFFFFFF)
|
if(usb_base_addr == 0xFFFFFFFF)
|
||||||
{
|
{
|
||||||
unsigned long base = pci_rsc_desc->offset + pci_rsc_desc->start;
|
uint32_t base = pci_rsc_desc->offset + pci_rsc_desc->start;
|
||||||
usb_base_addr = pci_rsc_desc->start;
|
usb_base_addr = pci_rsc_desc->start;
|
||||||
ehci_writel(base + OHCI_INTRDISABLE, OHCI_INTR_MIE);
|
ehci_writel(base + OHCI_INTRDISABLE, OHCI_INTR_MIE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
flags = pci_rsc_desc->flags;
|
flags = pci_rsc_desc->flags;
|
||||||
pci_rsc_desc = (PCI_RSC_DESC *)((unsigned long)pci_rsc_desc->next + (unsigned long)pci_rsc_desc);
|
pci_rsc_desc = (PCI_RSC_DESC *)((uint32_t)pci_rsc_desc->next + (uint32_t)pci_rsc_desc);
|
||||||
}
|
}
|
||||||
while(!(flags & FLG_LAST));
|
while(!(flags & FLG_LAST));
|
||||||
}
|
}
|
||||||
@@ -414,12 +414,12 @@ static int ehci_td_buffer(struct qTD *td, void *buf, size_t sz)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ehci_submit_async(struct usb_device *dev, unsigned long pipe, void *buffer, int length, struct devrequest *req)
|
static int ehci_submit_async(struct usb_device *dev, uint32_t pipe, void *buffer, int length, struct devrequest *req)
|
||||||
{
|
{
|
||||||
struct QH *qh;
|
struct QH *qh;
|
||||||
struct qTD *td;
|
struct qTD *td;
|
||||||
volatile struct qTD *vtd;
|
volatile struct qTD *vtd;
|
||||||
unsigned long ts;
|
uint32_t ts;
|
||||||
uint32_t *tdp;
|
uint32_t *tdp;
|
||||||
uint32_t endpt, token, usbsts;
|
uint32_t endpt, token, usbsts;
|
||||||
uint32_t c, toggle;
|
uint32_t c, toggle;
|
||||||
@@ -615,7 +615,7 @@ static inline int min3(int a, int b, int c)
|
|||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer, int length, struct devrequest *req)
|
static int ehci_submit_root(struct usb_device *dev, uint32_t pipe, void *buffer, int length, struct devrequest *req)
|
||||||
{
|
{
|
||||||
uint8_t tmpbuf[4];
|
uint8_t tmpbuf[4];
|
||||||
u16 typeReq;
|
u16 typeReq;
|
||||||
@@ -945,7 +945,7 @@ int ehci_usb_lowlevel_init(long handle, const struct pci_device_id *ent, void **
|
|||||||
#ifndef COLDFIRE
|
#ifndef COLDFIRE
|
||||||
uint32_t tmp;
|
uint32_t tmp;
|
||||||
#endif
|
#endif
|
||||||
unsigned long 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
|
#ifdef PCI_XBIOS
|
||||||
pci_rsc_desc = (PCI_RSC_DESC *)get_resource(handle); /* USB EHCI */
|
pci_rsc_desc = (PCI_RSC_DESC *)get_resource(handle); /* USB EHCI */
|
||||||
@@ -972,7 +972,7 @@ int ehci_usb_lowlevel_init(long handle, const struct pci_device_id *ent, void **
|
|||||||
hc_free_buffers(&gehci);
|
hc_free_buffers(&gehci);
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
gehci.qh_list = (struct QH *)(((unsigned long)gehci.qh_list_unaligned + 31) & ~31);
|
gehci.qh_list = (struct QH *)(((uint32_t)gehci.qh_list_unaligned + 31) & ~31);
|
||||||
memset(gehci.qh_list, 0, sizeof(struct QH));
|
memset(gehci.qh_list, 0, sizeof(struct QH));
|
||||||
gehci.qh_unaligned = (struct QH *)usb_malloc(sizeof(struct QH) + 32);
|
gehci.qh_unaligned = (struct QH *)usb_malloc(sizeof(struct QH) + 32);
|
||||||
if(gehci.qh_unaligned == NULL)
|
if(gehci.qh_unaligned == NULL)
|
||||||
@@ -981,7 +981,7 @@ int ehci_usb_lowlevel_init(long handle, const struct pci_device_id *ent, void **
|
|||||||
hc_free_buffers(&gehci);
|
hc_free_buffers(&gehci);
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
gehci.qh = (struct QH *)(((unsigned long)gehci.qh_unaligned + 31) & ~31);
|
gehci.qh = (struct QH *)(((uint32_t)gehci.qh_unaligned + 31) & ~31);
|
||||||
memset(gehci.qh, 0, sizeof(struct QH));
|
memset(gehci.qh, 0, sizeof(struct QH));
|
||||||
for(i = 0; i < 3; i++)
|
for(i = 0; i < 3; i++)
|
||||||
{
|
{
|
||||||
@@ -992,7 +992,7 @@ int ehci_usb_lowlevel_init(long handle, const struct pci_device_id *ent, void **
|
|||||||
hc_free_buffers(&gehci);
|
hc_free_buffers(&gehci);
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
gehci.td[i] = (struct qTD *)(((unsigned long)gehci.td_unaligned[i] + 31) & ~31);
|
gehci.td[i] = (struct qTD *)(((uint32_t)gehci.td_unaligned[i] + 31) & ~31);
|
||||||
memset(gehci.td[i], 0, sizeof(struct qTD));
|
memset(gehci.td[i], 0, sizeof(struct qTD));
|
||||||
}
|
}
|
||||||
gehci.descriptor = (struct descriptor *)usb_malloc(sizeof(struct descriptor));
|
gehci.descriptor = (struct descriptor *)usb_malloc(sizeof(struct descriptor));
|
||||||
@@ -1024,7 +1024,7 @@ int ehci_usb_lowlevel_init(long handle, const struct pci_device_id *ent, void **
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
flags = pci_rsc_desc->flags;
|
flags = pci_rsc_desc->flags;
|
||||||
pci_rsc_desc = (PCI_RSC_DESC *)((unsigned long)pci_rsc_desc->next + (unsigned long)pci_rsc_desc);
|
pci_rsc_desc = (PCI_RSC_DESC *)((uint32_t)pci_rsc_desc->next + (uint32_t)pci_rsc_desc);
|
||||||
}
|
}
|
||||||
while(!(flags & FLG_LAST));
|
while(!(flags & FLG_LAST));
|
||||||
}
|
}
|
||||||
@@ -1095,7 +1095,7 @@ int ehci_usb_lowlevel_init(long handle, const struct pci_device_id *ent, void **
|
|||||||
#ifdef PCI_XBIOS
|
#ifdef PCI_XBIOS
|
||||||
hook_interrupt(handle, handle_usb_interrupt, &gehci);
|
hook_interrupt(handle, handle_usb_interrupt, &gehci);
|
||||||
#else
|
#else
|
||||||
Hook_interrupt(handle, (void *)handle_usb_interrupt, (unsigned long *)&gehci);
|
Hook_interrupt(handle, (void *)handle_usb_interrupt, (uint32_t *)&gehci);
|
||||||
#endif /* PCI_BIOS */
|
#endif /* PCI_BIOS */
|
||||||
ehci_writel(&gehci.hcor->or_usbintr, INTR_PCDE);
|
ehci_writel(&gehci.hcor->or_usbintr, INTR_PCDE);
|
||||||
#endif /* CONFIG_USB_INTERRUPT_POLLING */
|
#endif /* CONFIG_USB_INTERRUPT_POLLING */
|
||||||
@@ -1136,7 +1136,7 @@ int ehci_usb_lowlevel_stop(void *priv)
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ehci_submit_bulk_msg(struct usb_device *dev, unsigned long pipe, void *buffer, int length)
|
int ehci_submit_bulk_msg(struct usb_device *dev, uint32_t pipe, void *buffer, int length)
|
||||||
{
|
{
|
||||||
if(usb_pipetype(pipe) != PIPE_BULK)
|
if(usb_pipetype(pipe) != PIPE_BULK)
|
||||||
{
|
{
|
||||||
@@ -1146,7 +1146,7 @@ int ehci_submit_bulk_msg(struct usb_device *dev, unsigned long pipe, void *buffe
|
|||||||
return ehci_submit_async(dev, pipe, buffer, length, NULL);
|
return ehci_submit_async(dev, pipe, buffer, length, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ehci_submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer, int length, struct devrequest *setup)
|
int ehci_submit_control_msg(struct usb_device *dev, uint32_t pipe, void *buffer, int length, struct devrequest *setup)
|
||||||
{
|
{
|
||||||
if(usb_pipetype(pipe) != PIPE_CONTROL)
|
if(usb_pipetype(pipe) != PIPE_CONTROL)
|
||||||
{
|
{
|
||||||
@@ -1162,7 +1162,7 @@ int ehci_submit_control_msg(struct usb_device *dev, unsigned long pipe, void *bu
|
|||||||
return ehci_submit_async(dev, pipe, buffer, length, setup);
|
return ehci_submit_async(dev, pipe, buffer, length, setup);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ehci_submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer, int length, int interval)
|
int ehci_submit_int_msg(struct usb_device *dev, uint32_t pipe, void *buffer, int length, int interval)
|
||||||
{
|
{
|
||||||
debug("submit_int_msg dev=%p, pipe=%lu, buffer=%p, length=%d, interval=%d", dev, pipe, buffer, length, interval);
|
debug("submit_int_msg dev=%p, pipe=%lu, buffer=%p, length=%d, interval=%d", dev, pipe, buffer, length, interval);
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ static inline uint32_t roothub_portstatus(ohci_t *ohci, int i) { return readl(&o
|
|||||||
/* forward declaration */
|
/* forward declaration */
|
||||||
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, unsigned long 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);
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------*
|
/*-------------------------------------------------------------------------*
|
||||||
@@ -150,7 +150,7 @@ static int sohci_get_current_frame_number(ohci_t *ohci, struct usb_device *dev);
|
|||||||
* small: 0) header + data packets 1) just header */
|
* small: 0) header + data packets 1) just header */
|
||||||
|
|
||||||
static void pkt_print(ohci_t *ohci, urb_priv_t *purb, struct usb_device *dev,
|
static void pkt_print(ohci_t *ohci, urb_priv_t *purb, struct usb_device *dev,
|
||||||
unsigned long pipe, void *buffer, int transfer_len,
|
uint32_t pipe, void *buffer, int transfer_len,
|
||||||
struct devrequest *setup, char *str, int small)
|
struct devrequest *setup, char *str, int small)
|
||||||
{
|
{
|
||||||
dbg("%s URB:[%4x] dev:%2lu,ep:%2lu-%c,type:%s,len:%d/%d stat:%#lx",
|
dbg("%s URB:[%4x] dev:%2lu,ep:%2lu-%c,type:%s,len:%d/%d stat:%#lx",
|
||||||
@@ -202,7 +202,7 @@ static void ep_print_int_eds(ohci_t *ohci, char *str)
|
|||||||
board_printf(__FILE__ ": %s branch int %2d(%2x):", str, i, i);
|
board_printf(__FILE__ ": %s branch int %2d(%2x):", str, i, i);
|
||||||
while(*ed_p != 0 && j--)
|
while(*ed_p != 0 && j--)
|
||||||
{
|
{
|
||||||
ed_t *ed = (ed_t *)swpl((unsigned long)ed_p);
|
ed_t *ed = (ed_t *)swpl((uint32_t)ed_p);
|
||||||
board_printf(" ed: %4x;", ed->hwINFO);
|
board_printf(" ed: %4x;", ed->hwINFO);
|
||||||
ed_p = &ed->hwNextED;
|
ed_p = &ed->hwNextED;
|
||||||
}
|
}
|
||||||
@@ -373,7 +373,7 @@ static int sohci_submit_job(ohci_t *ohci, urb_priv_t *urb, struct devrequest *se
|
|||||||
urb_priv_t *purb_priv = urb;
|
urb_priv_t *purb_priv = urb;
|
||||||
int i, size = 0;
|
int i, size = 0;
|
||||||
struct usb_device *dev = urb->dev;
|
struct usb_device *dev = urb->dev;
|
||||||
unsigned long pipe = urb->pipe;
|
uint32_t pipe = urb->pipe;
|
||||||
void *buffer = urb->transfer_buffer;
|
void *buffer = urb->transfer_buffer;
|
||||||
int transfer_len = urb->transfer_buffer_length;
|
int transfer_len = urb->transfer_buffer_length;
|
||||||
int interval = urb->interval;
|
int interval = urb->interval;
|
||||||
@@ -562,7 +562,7 @@ static int ep_link(ohci_t *ohci, ed_t *edi)
|
|||||||
if(ohci->ed_controltail == NULL)
|
if(ohci->ed_controltail == NULL)
|
||||||
writel(ed - ohci->dma_offset, &ohci->regs->ed_controlhead);
|
writel(ed - ohci->dma_offset, &ohci->regs->ed_controlhead);
|
||||||
else
|
else
|
||||||
ohci->ed_controltail->hwNextED = swpl((unsigned long)ed - ohci->dma_offset);
|
ohci->ed_controltail->hwNextED = swpl((uint32_t)ed - ohci->dma_offset);
|
||||||
|
|
||||||
ed->ed_prev = ohci->ed_controltail;
|
ed->ed_prev = ohci->ed_controltail;
|
||||||
if(!ohci->ed_controltail && !ohci->ed_rm_list[0] && !ohci->ed_rm_list[1] && !ohci->sleeping)
|
if(!ohci->ed_controltail && !ohci->ed_rm_list[0] && !ohci->ed_rm_list[1] && !ohci->sleeping)
|
||||||
@@ -577,7 +577,7 @@ static int ep_link(ohci_t *ohci, ed_t *edi)
|
|||||||
if(ohci->ed_bulktail == NULL)
|
if(ohci->ed_bulktail == NULL)
|
||||||
writel(ed - ohci->dma_offset, &ohci->regs->ed_bulkhead);
|
writel(ed - ohci->dma_offset, &ohci->regs->ed_bulkhead);
|
||||||
else
|
else
|
||||||
ohci->ed_bulktail->hwNextED = swpl((unsigned long)ed - ohci->dma_offset);
|
ohci->ed_bulktail->hwNextED = swpl((uint32_t)ed - ohci->dma_offset);
|
||||||
ed->ed_prev = ohci->ed_bulktail;
|
ed->ed_prev = ohci->ed_bulktail;
|
||||||
if(!ohci->ed_bulktail && !ohci->ed_rm_list[0] && !ohci->ed_rm_list[1] && !ohci->sleeping)
|
if(!ohci->ed_bulktail && !ohci->ed_rm_list[0] && !ohci->ed_rm_list[1] && !ohci->sleeping)
|
||||||
{
|
{
|
||||||
@@ -600,7 +600,7 @@ static int ep_link(ohci_t *ohci, ed_t *edi)
|
|||||||
ed_p = &(((ed_t *)ed_p)->hwNextED))
|
ed_p = &(((ed_t *)ed_p)->hwNextED))
|
||||||
inter = ep_rev(6, ((ed_t *)ed_p)->int_interval);
|
inter = ep_rev(6, ((ed_t *)ed_p)->int_interval);
|
||||||
ed->hwNextED = *ed_p;
|
ed->hwNextED = *ed_p;
|
||||||
*ed_p = swpl((unsigned long)ed - ohci->dma_offset);
|
*ed_p = swpl((uint32_t)ed - ohci->dma_offset);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -618,7 +618,7 @@ static void periodic_unlink(struct ohci *ohci, volatile struct ed *ed, unsigned
|
|||||||
/* ED might have been unlinked through another path */
|
/* ED might have been unlinked through another path */
|
||||||
while(*ed_p != 0)
|
while(*ed_p != 0)
|
||||||
{
|
{
|
||||||
if((unsigned long)*ed_p == swpl((unsigned long)ed - ohci->dma_offset)) /* changed */
|
if((uint32_t)*ed_p == swpl((uint32_t)ed - ohci->dma_offset)) /* changed */
|
||||||
{
|
{
|
||||||
*ed_p = ed->hwNextED;
|
*ed_p = ed->hwNextED;
|
||||||
break;
|
break;
|
||||||
@@ -694,7 +694,7 @@ static int ep_unlink(ohci_t *ohci, ed_t *edi)
|
|||||||
* info fields are setted anyway even though most of them should not
|
* info fields are setted anyway even though most of them should not
|
||||||
* change
|
* change
|
||||||
*/
|
*/
|
||||||
static ed_t *ep_add_ed(ohci_t *ohci, struct usb_device *usb_dev, unsigned long pipe, int interval, int load)
|
static ed_t *ep_add_ed(ohci_t *ohci, struct usb_device *usb_dev, uint32_t pipe, int interval, int load)
|
||||||
{
|
{
|
||||||
td_t *td;
|
td_t *td;
|
||||||
ed_t *ed_ret;
|
ed_t *ed_ret;
|
||||||
@@ -711,7 +711,7 @@ static ed_t *ep_add_ed(ohci_t *ohci, struct usb_device *usb_dev, unsigned long p
|
|||||||
{
|
{
|
||||||
/* dummy td; end of td list for ed */
|
/* dummy td; end of td list for ed */
|
||||||
td = td_alloc(usb_dev);
|
td = td_alloc(usb_dev);
|
||||||
ed->hwTailP = swpl((unsigned long)td - ohci->dma_offset);
|
ed->hwTailP = swpl((uint32_t)td - ohci->dma_offset);
|
||||||
ed->hwHeadP = ed->hwTailP;
|
ed->hwHeadP = ed->hwTailP;
|
||||||
ed->state = ED_UNLINK;
|
ed->state = ED_UNLINK;
|
||||||
ed->type = usb_pipetype(pipe);
|
ed->type = usb_pipetype(pipe);
|
||||||
@@ -771,15 +771,15 @@ static void td_fill(ohci_t *ohci, unsigned int info, void *data, int len,
|
|||||||
td->hwINFO = swpl(info);
|
td->hwINFO = swpl(info);
|
||||||
if(data != NULL)
|
if(data != NULL)
|
||||||
{
|
{
|
||||||
td->hwCBP = swpl((unsigned long)data - ohci->dma_offset);
|
td->hwCBP = swpl((uint32_t)data - ohci->dma_offset);
|
||||||
td->hwBE = swpl((unsigned long)(data + len - 1 - ohci->dma_offset));
|
td->hwBE = swpl((uint32_t)(data + len - 1 - ohci->dma_offset));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
td->hwCBP = 0;
|
td->hwCBP = 0;
|
||||||
td->hwBE = 0;
|
td->hwBE = 0;
|
||||||
}
|
}
|
||||||
td->hwNextTD = swpl((unsigned long)td_pt - ohci->dma_offset);
|
td->hwNextTD = swpl((uint32_t)td_pt - ohci->dma_offset);
|
||||||
/* append to queue */
|
/* append to queue */
|
||||||
td->ed->hwTailP = td->hwNextTD;
|
td->ed->hwTailP = td->hwNextTD;
|
||||||
#if 0
|
#if 0
|
||||||
@@ -802,7 +802,7 @@ static void td_fill(ohci_t *ohci, unsigned int info, void *data, int len,
|
|||||||
|
|
||||||
/* prepare all TDs of a transfer */
|
/* prepare all TDs of a transfer */
|
||||||
|
|
||||||
static void td_submit_job(ohci_t *ohci, struct usb_device *dev, unsigned long 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)
|
||||||
{
|
{
|
||||||
int data_len = transfer_len;
|
int data_len = transfer_len;
|
||||||
@@ -1163,7 +1163,7 @@ int rh_check_port_status(ohci_t *controller)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ohci_submit_rh_msg(ohci_t *ohci, struct usb_device *dev, unsigned long pipe,
|
static int ohci_submit_rh_msg(ohci_t *ohci, struct usb_device *dev, uint32_t pipe,
|
||||||
void *buffer, int transfer_len, struct devrequest *cmd)
|
void *buffer, int transfer_len, struct devrequest *cmd)
|
||||||
{
|
{
|
||||||
void *data = buffer;
|
void *data = buffer;
|
||||||
@@ -1353,7 +1353,7 @@ static int ohci_submit_rh_msg(ohci_t *ohci, struct usb_device *dev, unsigned lon
|
|||||||
|
|
||||||
/* common code for handling submit messages - used for all but root hub accesses. */
|
/* common code for handling submit messages - used for all but root hub accesses. */
|
||||||
|
|
||||||
static int submit_common_msg(ohci_t *ohci, struct usb_device *dev, unsigned long pipe, void *buffer,
|
static int submit_common_msg(ohci_t *ohci, struct usb_device *dev, uint32_t pipe, void *buffer,
|
||||||
int transfer_len, struct devrequest *setup, int interval)
|
int transfer_len, struct devrequest *setup, int interval)
|
||||||
{
|
{
|
||||||
int stat = 0;
|
int stat = 0;
|
||||||
@@ -1464,13 +1464,13 @@ static int submit_common_msg(ohci_t *ohci, struct usb_device *dev, unsigned long
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* submit routines called from usb.c */
|
/* submit routines called from usb.c */
|
||||||
int ohci_submit_bulk_msg(struct usb_device *dev, unsigned long pipe, void *buffer, int transfer_len)
|
int ohci_submit_bulk_msg(struct usb_device *dev, uint32_t pipe, void *buffer, int transfer_len)
|
||||||
{
|
{
|
||||||
info("submit_bulk_msg dev 0x%p ohci 0x%p buffer 0x%p len %d", dev, dev->priv_hcd, buffer, transfer_len);
|
info("submit_bulk_msg dev 0x%p ohci 0x%p buffer 0x%p len %d", dev, dev->priv_hcd, buffer, transfer_len);
|
||||||
return submit_common_msg((ohci_t *)dev->priv_hcd, dev, pipe, buffer, transfer_len, NULL, 0);
|
return submit_common_msg((ohci_t *)dev->priv_hcd, dev, pipe, buffer, transfer_len, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ohci_submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer, int transfer_len, struct devrequest *setup)
|
int ohci_submit_control_msg(struct usb_device *dev, uint32_t pipe, void *buffer, int transfer_len, struct devrequest *setup)
|
||||||
{
|
{
|
||||||
ohci_t *ohci = (ohci_t *)dev->priv_hcd;
|
ohci_t *ohci = (ohci_t *)dev->priv_hcd;
|
||||||
int maxsize = usb_maxpacket(dev, pipe);
|
int maxsize = usb_maxpacket(dev, pipe);
|
||||||
@@ -1495,7 +1495,7 @@ int ohci_submit_control_msg(struct usb_device *dev, unsigned long pipe, void *bu
|
|||||||
return submit_common_msg(ohci, dev, pipe, buffer, transfer_len, setup, 0);
|
return submit_common_msg(ohci, dev, pipe, buffer, transfer_len, setup, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ohci_submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer, int transfer_len, int interval)
|
int ohci_submit_int_msg(struct usb_device *dev, uint32_t pipe, void *buffer, int transfer_len, int interval)
|
||||||
{
|
{
|
||||||
info("submit_int_msg dev 0x%p ohci 0x%p buffer 0x%p len %d", dev, dev->priv_hcd, buffer, transfer_len);
|
info("submit_int_msg dev 0x%p ohci 0x%p buffer 0x%p len %d", dev, dev->priv_hcd, buffer, transfer_len);
|
||||||
return submit_common_msg((ohci_t *)dev->priv_hcd, dev, pipe, buffer, transfer_len, NULL, interval);
|
return submit_common_msg((ohci_t *)dev->priv_hcd, dev, pipe, buffer, transfer_len, NULL, interval);
|
||||||
@@ -1526,12 +1526,12 @@ static int hc_reset(ohci_t *ohci)
|
|||||||
handle = pci_find_device(0x0, 0xffff, index++);
|
handle = pci_find_device(0x0, 0xffff, index++);
|
||||||
if (handle >= 0)
|
if (handle >= 0)
|
||||||
{
|
{
|
||||||
unsigned long id = 0;
|
uint32_t id = 0;
|
||||||
id = pci_read_config_longword(handle, PCIIDR);
|
id = pci_read_config_longword(handle, PCIIDR);
|
||||||
if ((PCI_VENDOR_ID_PHILIPS == (id & 0xFFFF)) && (PCI_DEVICE_ID_PHILIPS_ISP1561_2 == (id >> 16)))
|
if ((PCI_VENDOR_ID_PHILIPS == (id & 0xFFFF)) && (PCI_DEVICE_ID_PHILIPS_ISP1561_2 == (id >> 16)))
|
||||||
{
|
{
|
||||||
int timeout = 1000;
|
int timeout = 1000;
|
||||||
unsigned long usb_base_addr = 0xFFFFFFFF;
|
uint32_t usb_base_addr = 0xFFFFFFFF;
|
||||||
PCI_RSC_DESC *pci_rsc_desc;
|
PCI_RSC_DESC *pci_rsc_desc;
|
||||||
pci_rsc_desc = (PCI_RSC_DESC *) pci_get_resource(handle); /* USB OHCI */
|
pci_rsc_desc = (PCI_RSC_DESC *) pci_get_resource(handle); /* USB OHCI */
|
||||||
if ((long)pci_rsc_desc >= 0)
|
if ((long)pci_rsc_desc >= 0)
|
||||||
@@ -1543,7 +1543,7 @@ static int hc_reset(ohci_t *ohci)
|
|||||||
{
|
{
|
||||||
if(usb_base_addr == 0xFFFFFFFF)
|
if(usb_base_addr == 0xFFFFFFFF)
|
||||||
{
|
{
|
||||||
unsigned long base = pci_rsc_desc->offset + pci_rsc_desc->start;
|
uint32_t base = pci_rsc_desc->offset + pci_rsc_desc->start;
|
||||||
usb_base_addr = pci_rsc_desc->start;
|
usb_base_addr = pci_rsc_desc->start;
|
||||||
writel(readl(base + EHCI_USBCMD_OFF) | EHCI_USBCMD_HCRESET, base + EHCI_USBCMD_OFF);
|
writel(readl(base + EHCI_USBCMD_OFF) | EHCI_USBCMD_HCRESET, base + EHCI_USBCMD_OFF);
|
||||||
while(readl(base + EHCI_USBCMD_OFF) & EHCI_USBCMD_HCRESET)
|
while(readl(base + EHCI_USBCMD_OFF) & EHCI_USBCMD_HCRESET)
|
||||||
@@ -1558,7 +1558,7 @@ static int hc_reset(ohci_t *ohci)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
flags = pci_rsc_desc->flags;
|
flags = pci_rsc_desc->flags;
|
||||||
pci_rsc_desc = (PCI_RSC_DESC *)((unsigned long)pci_rsc_desc->next + (unsigned long)pci_rsc_desc);
|
pci_rsc_desc = (PCI_RSC_DESC *)((uint32_t)pci_rsc_desc->next + (uint32_t)pci_rsc_desc);
|
||||||
}
|
}
|
||||||
while(!(flags & FLG_LAST));
|
while(!(flags & FLG_LAST));
|
||||||
}
|
}
|
||||||
@@ -1868,7 +1868,7 @@ static void hc_free_buffers(ohci_t *ohci)
|
|||||||
*/
|
*/
|
||||||
int ohci_usb_lowlevel_init(long handle, const struct pci_device_id *ent, void **priv)
|
int ohci_usb_lowlevel_init(long handle, const struct pci_device_id *ent, void **priv)
|
||||||
{
|
{
|
||||||
unsigned long usb_base_addr = 0xFFFFFFFF;
|
uint32_t usb_base_addr = 0xFFFFFFFF;
|
||||||
ohci_t *ohci = &gohci[(handle >> 16) & 1]; // function & 1
|
ohci_t *ohci = &gohci[(handle >> 16) & 1]; // function & 1
|
||||||
PCI_RSC_DESC *pci_rsc_desc = (PCI_RSC_DESC *) pci_get_resource(handle); /* USB OHCI */
|
PCI_RSC_DESC *pci_rsc_desc = (PCI_RSC_DESC *) pci_get_resource(handle); /* USB OHCI */
|
||||||
if (handle && (ent != NULL))
|
if (handle && (ent != NULL))
|
||||||
@@ -1889,7 +1889,7 @@ int ohci_usb_lowlevel_init(long handle, const struct pci_device_id *ent, void **
|
|||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
/* align the storage */
|
/* align the storage */
|
||||||
ohci->hcca = (struct ohci_hcca *)(((unsigned long)ohci->hcca_unaligned + 255) & ~255);
|
ohci->hcca = (struct ohci_hcca *)(((uint32_t)ohci->hcca_unaligned + 255) & ~255);
|
||||||
memset(ohci->hcca, 0, sizeof(struct ohci_hcca));
|
memset(ohci->hcca, 0, sizeof(struct ohci_hcca));
|
||||||
info("aligned ghcca 0x%p", ohci->hcca);
|
info("aligned ghcca 0x%p", ohci->hcca);
|
||||||
ohci->ohci_dev_unaligned = (struct ohci_device *)usb_malloc(sizeof(struct ohci_device) + 8);
|
ohci->ohci_dev_unaligned = (struct ohci_device *)usb_malloc(sizeof(struct ohci_device) + 8);
|
||||||
@@ -1899,7 +1899,7 @@ int ohci_usb_lowlevel_init(long handle, const struct pci_device_id *ent, void **
|
|||||||
hc_free_buffers(ohci);
|
hc_free_buffers(ohci);
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
ohci->ohci_dev = (struct ohci_device *)(((unsigned long)ohci->ohci_dev_unaligned + 7) & ~7);
|
ohci->ohci_dev = (struct ohci_device *)(((uint32_t)ohci->ohci_dev_unaligned + 7) & ~7);
|
||||||
memset(ohci->ohci_dev, 0, sizeof(struct ohci_device));
|
memset(ohci->ohci_dev, 0, sizeof(struct ohci_device));
|
||||||
info("aligned EDs 0x%p", ohci->ohci_dev);
|
info("aligned EDs 0x%p", ohci->ohci_dev);
|
||||||
ohci->td_unaligned = (td_t *)usb_malloc(sizeof(td_t) * (NUM_TD + 1));
|
ohci->td_unaligned = (td_t *)usb_malloc(sizeof(td_t) * (NUM_TD + 1));
|
||||||
@@ -1909,7 +1909,7 @@ int ohci_usb_lowlevel_init(long handle, const struct pci_device_id *ent, void **
|
|||||||
hc_free_buffers(ohci);
|
hc_free_buffers(ohci);
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
ptd = (td_t *)(((unsigned long)ohci->td_unaligned + 7) & ~7);
|
ptd = (td_t *)(((uint32_t)ohci->td_unaligned + 7) & ~7);
|
||||||
memset(ptd, 0, sizeof(td_t) * NUM_TD);
|
memset(ptd, 0, sizeof(td_t) * NUM_TD);
|
||||||
info("aligned TDs 0x%p", ptd);
|
info("aligned TDs 0x%p", ptd);
|
||||||
ohci->disabled = 1;
|
ohci->disabled = 1;
|
||||||
@@ -1938,7 +1938,7 @@ int ohci_usb_lowlevel_init(long handle, const struct pci_device_id *ent, void **
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
flags = pci_rsc_desc->flags;
|
flags = pci_rsc_desc->flags;
|
||||||
pci_rsc_desc = (PCI_RSC_DESC *)((unsigned long)pci_rsc_desc->next + (unsigned long)pci_rsc_desc);
|
pci_rsc_desc = (PCI_RSC_DESC *)((uint32_t)pci_rsc_desc->next + (uint32_t)pci_rsc_desc);
|
||||||
}
|
}
|
||||||
while(!(flags & FLG_LAST));
|
while(!(flags & FLG_LAST));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
#include "usb.h"
|
#include "usb.h"
|
||||||
|
|
||||||
extern int usb_stor_curr_dev;
|
extern int usb_stor_curr_dev;
|
||||||
extern unsigned long usb_1st_disk_drive;
|
extern uint32_t usb_1st_disk_drive;
|
||||||
|
|
||||||
#undef USB_DEBUG
|
#undef USB_DEBUG
|
||||||
|
|
||||||
@@ -266,7 +266,7 @@ void usb_disable_asynch(int disable)
|
|||||||
/*
|
/*
|
||||||
* submits an Interrupt Message
|
* submits an Interrupt Message
|
||||||
*/
|
*/
|
||||||
int usb_submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer, int transfer_len, int interval)
|
int usb_submit_int_msg(struct usb_device *dev, uint32_t pipe, void *buffer, int transfer_len, int interval)
|
||||||
{
|
{
|
||||||
struct hci *priv = (struct hci *)dev->priv_hcd;
|
struct hci *priv = (struct hci *)dev->priv_hcd;
|
||||||
switch(priv->ent->class)
|
switch(priv->ent->class)
|
||||||
@@ -359,7 +359,7 @@ int usb_bulk_msg(struct usb_device *dev, unsigned int pipe, void *data, int len,
|
|||||||
}
|
}
|
||||||
while(timeout--)
|
while(timeout--)
|
||||||
{
|
{
|
||||||
if(!((volatile unsigned long)dev->status & USB_ST_NOT_PROC))
|
if(!((volatile uint32_t)dev->status & USB_ST_NOT_PROC))
|
||||||
break;
|
break;
|
||||||
wait(1 * 1000);
|
wait(1 * 1000);
|
||||||
}
|
}
|
||||||
@@ -379,7 +379,7 @@ int usb_bulk_msg(struct usb_device *dev, unsigned int pipe, void *data, int len,
|
|||||||
* returns the max packet size, depending on the pipe direction and
|
* returns the max packet size, depending on the pipe direction and
|
||||||
* the configurations values
|
* the configurations values
|
||||||
*/
|
*/
|
||||||
int usb_maxpacket(struct usb_device *dev, unsigned long pipe)
|
int usb_maxpacket(struct usb_device *dev, uint32_t pipe)
|
||||||
{
|
{
|
||||||
/* direction is out -> use emaxpacket out */
|
/* direction is out -> use emaxpacket out */
|
||||||
if((pipe & USB_DIR_IN) == 0)
|
if((pipe & USB_DIR_IN) == 0)
|
||||||
@@ -495,7 +495,7 @@ int usb_parse_config(struct usb_device *dev, unsigned char *buffer, int cfgno)
|
|||||||
/* found an endpoint */
|
/* found an endpoint */
|
||||||
dev->config.if_desc[ifno].no_of_ep++;
|
dev->config.if_desc[ifno].no_of_ep++;
|
||||||
memcpy(&dev->config.if_desc[ifno].ep_desc[epno], &buffer[index], buffer[index]);
|
memcpy(&dev->config.if_desc[ifno].ep_desc[epno], &buffer[index], buffer[index]);
|
||||||
dev->config.if_desc[devno].ep_desc.wMaxPacketSize = swpw(&(dev->config.if_desc[ifno].ep_desc[epno].wMaxPacketSize));
|
dev->config.if_desc[ifno].ep_desc[epno].wMaxPacketSize = swpw(dev->config.if_desc[ifno].ep_desc[epno].wMaxPacketSize);
|
||||||
USB_PRINTF("if %d, ep %d\r\n", ifno, epno);
|
USB_PRINTF("if %d, ep %d\r\n", ifno, epno);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user