struct usb_endpoint_descriptor *ep_desc;
unsigned int flags = 0;
- int protocol = 0;
- int subclass = 0;
-
/* let's examine the device now */
iface = &dev->config.if_desc[ifnum];
-#if 0
- /* this is the place to patch some storage devices */
- debug("iVendor %X iProduct %X\n", dev->descriptor.idVendor,
- dev->descriptor.idProduct);
-
- if ((dev->descriptor.idVendor) == 0x066b &&
- (dev->descriptor.idProduct) == 0x0103) {
- debug("patched for E-USB\n");
- protocol = US_PR_CB;
- subclass = US_SC_UFI; /* an assumption */
- }
-#endif
-
if (dev->descriptor.bDeviceClass != 0 ||
iface->desc.bInterfaceClass != USB_CLASS_MASS_STORAGE ||
iface->desc.bInterfaceSubClass < US_SC_MIN ||
ss->ifnum = ifnum;
ss->pusb_dev = dev;
ss->attention_done = 0;
-
- /* If the device has subclass and protocol, then use that. Otherwise,
- * take data from the specific interface.
- */
- if (subclass) {
- ss->subclass = subclass;
- ss->protocol = protocol;
- } else {
- ss->subclass = iface->desc.bInterfaceSubClass;
- ss->protocol = iface->desc.bInterfaceProtocol;
- }
+ ss->subclass = iface->desc.bInterfaceSubClass;
+ ss->protocol = iface->desc.bInterfaceProtocol;
/* set the handler pointers based on the protocol */
debug("Transport: ");
int dfu_fill_entity_sf(struct dfu_entity *dfu, char *devstr, char *s)
{
char *st;
+ char *devstr_bkup = strdup(devstr);
- dfu->data.sf.dev = parse_dev(devstr);
+ dfu->data.sf.dev = parse_dev(devstr_bkup);
+ free(devstr_bkup);
if (!dfu->data.sf.dev)
return -ENODEV;
return 0;
err1:
- dma_unmap_single((void *)dwc->scratch_addr, dwc->nr_scratch *
+ dma_unmap_single((void *)(uintptr_t)dwc->scratch_addr, dwc->nr_scratch *
DWC3_SCRATCHBUF_SIZE, DMA_BIDIRECTIONAL);
err0:
if (!dwc->nr_scratch)
return;
- dma_unmap_single((void *)dwc->scratch_addr, dwc->nr_scratch *
+ dma_unmap_single((void *)(uintptr_t)dwc->scratch_addr, dwc->nr_scratch *
DWC3_SCRATCHBUF_SIZE, DMA_BIDIRECTIONAL);
kfree(dwc->scratchbuf);
}
dwc = PTR_ALIGN(mem, DWC3_ALIGN_MASK + 1);
dwc->mem = mem;
- dwc->regs = (int *)(dwc3_dev->base + DWC3_GLOBALS_REGS_START);
+ dwc->regs = (void *)(uintptr_t)(dwc3_dev->base +
+ DWC3_GLOBALS_REGS_START);
/* default to highest possible threshold */
lpm_nyet_threshold = 0xff;
trb->ctrl |= (DWC3_TRB_CTRL_IOC
| DWC3_TRB_CTRL_LST);
- dwc3_flush_cache((int)buf_dma, len);
- dwc3_flush_cache((int)trb, sizeof(*trb));
+ dwc3_flush_cache((long)buf_dma, len);
+ dwc3_flush_cache((long)trb, sizeof(*trb));
if (chain)
return 0;
if (!r)
return;
- dwc3_flush_cache((int)trb, sizeof(*trb));
+ dwc3_flush_cache((long)trb, sizeof(*trb));
status = DWC3_TRB_SIZE_TRBSTS(trb->size);
if (status == DWC3_TRBSTS_SETUP_PENDING) {
ur->actual += transferred;
trb++;
- dwc3_flush_cache((int)trb, sizeof(*trb));
+ dwc3_flush_cache((long)trb, sizeof(*trb));
length = trb->size & DWC3_TRB_SIZE_MASK;
ep0->free_slot = 0;
maxp);
transferred = min_t(u32, ur->length - transferred,
transfer_size - length);
- dwc3_flush_cache((int)dwc->ep0_bounce, DWC3_EP0_BOUNCE_SIZE);
+ dwc3_flush_cache((long)dwc->ep0_bounce, DWC3_EP0_BOUNCE_SIZE);
memcpy(buf, dwc->ep0_bounce, transferred);
} else {
transferred = ur->length - length;
list_del(&req->list);
req->trb = NULL;
- dwc3_flush_cache((int)req->request.dma, req->request.length);
+ dwc3_flush_cache((long)req->request.dma, req->request.length);
if (req->request.status == -EINPROGRESS)
req->request.status = status;
trb->ctrl |= DWC3_TRB_CTRL_HWO;
- dwc3_flush_cache((int)dma, length);
- dwc3_flush_cache((int)trb, sizeof(*trb));
+ dwc3_flush_cache((long)dma, length);
+ dwc3_flush_cache((long)trb, sizeof(*trb));
}
/*
slot %= DWC3_TRB_NUM;
trb = &dep->trb_pool[slot];
- dwc3_flush_cache((int)trb, sizeof(*trb));
+ dwc3_flush_cache((long)trb, sizeof(*trb));
__dwc3_cleanup_done_trbs(dwc, dep, req, trb, event, status);
dwc3_gadget_giveback(dep, req, status);
for (i = 0; i < dwc->num_event_buffers; i++) {
evt = dwc->ev_buffs[i];
- dwc3_flush_cache((int)evt->buf, evt->length);
+ dwc3_flush_cache((long)evt->buf, evt->length);
}
dwc3_thread_interrupt(0, dwc);
#define CACHELINE_SIZE CONFIG_SYS_CACHELINE_SIZE
static inline u32 dwc3_readl(void __iomem *base, u32 offset)
{
- u32 offs = offset - DWC3_GLOBALS_REGS_START;
+ unsigned long offs = offset - DWC3_GLOBALS_REGS_START;
u32 value;
/*
static inline void dwc3_writel(void __iomem *base, u32 offset, u32 value)
{
- u32 offs = offset - DWC3_GLOBALS_REGS_START;
+ unsigned long offs = offset - DWC3_GLOBALS_REGS_START;
/*
* We requested the mem region starting from the Globals address
dev->in_req->length = len;
- debug("%s: dev->in_req->length:%d to_cpy:%d\n", __func__,
+ debug("%s: dev->in_req->length:%d to_cpy:%zd\n", __func__,
dev->in_req->length, sizeof(data));
status = usb_ep_queue(dev->in_ep, dev->in_req, 0);
if (req->length == 0)
return;
- dma_unmap_single((void *)req->dma, req->length,
+ dma_unmap_single((void *)(uintptr_t)req->dma, req->length,
is_in ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
}
EXPORT_SYMBOL_GPL(usb_gadget_unmap_request);
if (!ohci->hcca)
return -ENOMEM;
memset(ohci->hcca, 0, sizeof(struct ohci_hcca));
+ flush_dcache_hcca(ohci->hcca);
if (hc_reset(ohci) < 0)
return -EIO;
"fdt ram 0x80f80000 0x80000;" \
"ramdisk ram 0x81000000 0x4000000\0"
+#define DFU_ALT_INFO_QSPI \
+ "dfu_alt_info_qspi=" \
+ "MLO raw 0x0 0x010000;" \
+ "MLO.backup1 raw 0x010000 0x010000;" \
+ "MLO.backup2 raw 0x020000 0x010000;" \
+ "MLO.backup3 raw 0x030000 0x010000;" \
+ "u-boot.img raw 0x040000 0x0100000;" \
+ "u-boot-spl-os raw 0x140000 0x080000;" \
+ "u-boot-env raw 0x1C0000 0x010000;" \
+ "u-boot-env.backup raw 0x1D0000 0x010000;" \
+ "kernel raw 0x1E0000 0x800000\0"
+
#define DFUARGS \
"dfu_bufsiz=0x10000\0" \
DFU_ALT_INFO_MMC \
DFU_ALT_INFO_EMMC \
- DFU_ALT_INFO_RAM
+ DFU_ALT_INFO_RAM \
+ DFU_ALT_INFO_QSPI
/* Fastboot */
#define CONFIG_USB_FUNCTION_FASTBOOT
#define CONFIG_DFU_MMC
#define CONFIG_DFU_RAM
+#define CONFIG_DFU_SF
/* SATA */
#define CONFIG_BOARD_LATE_INIT