Thank you to anyone who has already donated - your generous donations helped make three months of treatment possible.
My brother Nate continues to fight stage IV Hodgkin's lymphoma. He's just 31, with a wife and baby girl. They have no active income (since he's been unable to return to work), no insurance, and cannot afford the treatment he needs. Nate and his family need your help. Please consider a donation, every dollar helps. Thanks.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
diff --git a/firmware/export/as3525.h b/firmware/export/as3525.h index 699762a..c7431fc 100644 CE lines /* USB : TODO */ #define USB_NUM_ENDPOINTS 4 -#define USB_DEVBSS_ATTR IBSS_ATTR +#define USB_DEVBSS_ATTR /* I2SIN registers */ diff --git a/firmware/export/config.h b/firmware/export/config.h index 38eb696..d16ede4 100644 Lyre prototype 1 */ #else /* BOOTLOADER */ #ifndef SIMULATOR -//#define USB_ENABLE_SERIAL +#define USB_ENABLE_SERIAL #define USB_ENABLE_STORAGE #ifdef USB_HAS_INTERRUPT diff --git a/firmware/export/config/sansaclip.h b/firmware/export/config/sansaclip.h index fc26f9d..86075c7 100644 /* Type of LCD */ #define CONFIG_LCD LCD_SSD1303 -#ifndef BOOTLOADER - -#define USB_HANDLED_BY_OF - #define CONFIG_USBOTG USBOTG_AS3525 /* enable these for the experimental usb stack */ #define HAVE_USBSTACK +#define USE_ROCKBOX_USB #define USB_VENDOR_ID 0x0781 #define USB_PRODUCT_ID 0x7433 -#endif /* BOOTLOADER */ - /* Define this if you have adjustable CPU frequency */ #define HAVE_ADJUSTABLE_CPU_FREQ diff --git a/firmware/target/arm/as3525/usb-drv-as3525.c b/firmware/target/arm/as3525/usb-drv-as3525.c index 2cb1318..f78fcfd 100644 static struct usb_endpoint endpoints[USB_NUM_EPS][2]; static struct usb_dev_dma_desc dmadescs[USB_NUM_EPS][2] __attribute__((aligned(32))); static struct usb_dev_setup_buf setup_desc; -/* Dummy buffer, to keep rx_buf out of this cacheline */ -static struct usb_dev_setup_buf dummy __attribute__((unused)); -static char rx_buf[1024]; -static char tx_buf[1024]; +static char rx_buf[1024] __attribute__((aligned(32))); +static char tx_buf[1024] __attribute__((aligned(32))); void usb_attach(void) { void usb_drv_cancel_all_transfers(void) restore_irq(flags); } -static void *virt_to_bus(void *addr) +static inline void *virt_to_bus(void *addr) { - unsigned int x = (long)addr; + uintptr_t x = (uintptr_t)addr; - x -= (x & 0x40000000) >> 2; /* fix uncached address */ - - if (x >= IRAM_ORIG) { /* iram address */ - x -= IRAM_ORIG; - } + x &= ~0x40000000; + x |= 0x30000000; return (void*)x; } static void handle_out_ep(int ep) /* * If parts of the just dmaed range are in cache, dump them now. */ - dump_dcache_range(uc_desc->data_ptr, dma_len); + //dump_dcache_range(uc_desc->data_ptr, dma_len); + clean_dcache(); } else{ logf("EP%d OUT token, st:%08x len:%d frm:%x\n", ep, dma_mst, dma_len, dma_frm); diff --git a/firmware/usbstack/usb_storage.c b/firmware/usbstack/usb_storage.c index 3373bf4..8917a67 100644 void usb_storage_init_connection(void) state = WAITING_FOR_COMMAND; #if CONFIG_CPU == IMX31L || defined(CPU_TCC77X) || defined(CPU_TCC780X) || \ - defined(BOOTLOADER) || CONFIG_CPU == DM320 + defined(BOOTLOADER) || CONFIG_CPU == DM320 || CONFIG_CPU == AS3525 static unsigned char _cbw_buffer[MAX_CBW_SIZE] USB_DEVBSS_ATTR __attribute__((aligned(32))); cbw_buffer = (void *)_cbw_buffer; |