diff options
-rw-r--r-- | common/usb_storage.c | 25 | ||||
-rw-r--r-- | drivers/usb/host/ehci-pci.c | 3 | ||||
-rw-r--r-- | drivers/usb/musb/blackfin_usb.c | 36 | ||||
-rw-r--r-- | fs/fat/fat.c | 37 |
4 files changed, 57 insertions, 44 deletions
diff --git a/common/usb_storage.c b/common/usb_storage.c index 1e6cd6a..6963e6d 100644 --- a/common/usb_storage.c +++ b/common/usb_storage.c @@ -1346,31 +1346,6 @@ int usb_stor_get_info(struct usb_device *dev, struct us_data *ss, unsigned long *capacity, *blksz; ccb *pccb = &usb_ccb; - /* for some reasons a couple of devices would not survive this reset */ - if ( - /* Sony USM256E */ - (dev->descriptor.idVendor == 0x054c && - dev->descriptor.idProduct == 0x019e) - || - /* USB007 Mini-USB2 Flash Drive */ - (dev->descriptor.idVendor == 0x066f && - dev->descriptor.idProduct == 0x2010) - || - /* SanDisk Corporation Cruzer Micro 20044318410546613953 */ - (dev->descriptor.idVendor == 0x0781 && - dev->descriptor.idProduct == 0x5151) - || - /* - * SanDisk Corporation U3 Cruzer Micro 1/4GB - * Flash Drive 000016244373FFB4 - */ - (dev->descriptor.idVendor == 0x0781 && - dev->descriptor.idProduct == 0x5406) - ) - USB_STOR_PRINTF("usb_stor_get_info: skipping RESET..\n"); - else - ss->transport_reset(ss); - pccb->pdata = usb_stor_buf; dev_desc->target = dev->devnum; diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c index cff3438..2b68f7b 100644 --- a/drivers/usb/host/ehci-pci.c +++ b/drivers/usb/host/ehci-pci.c @@ -28,7 +28,8 @@ #ifdef CONFIG_PCI_EHCI_DEVICE static struct pci_device_id ehci_pci_ids[] = { /* Please add supported PCI EHCI controller ids here */ - {0x1033, 0x00E0}, + {0x1033, 0x00E0}, /* NEC */ + {0x12D8, 0x400F}, /* Pericom */ {0, 0} }; #endif diff --git a/drivers/usb/musb/blackfin_usb.c b/drivers/usb/musb/blackfin_usb.c index 38aceb2..35268ba 100644 --- a/drivers/usb/musb/blackfin_usb.c +++ b/drivers/usb/musb/blackfin_usb.c @@ -15,6 +15,10 @@ #include "musb_core.h" +#ifndef CONFIG_USB_BLACKFIN_CLKIN +#define CONFIG_USB_BLACKFIN_CLKIN 24 +#endif + /* MUSB platform configuration */ struct musb_config musb_cfg = { .regs = (struct musb_regs *)USB_FADDR, @@ -93,10 +97,25 @@ static void __def_musb_init(void) } void board_musb_init(void) __attribute__((weak, alias("__def_musb_init"))); -int musb_platform_init(void) +static void bfin_anomaly_init(void) { - /* board specific initialization */ - board_musb_init(); + u32 revid; + + if (!ANOMALY_05000346 && !ANOMALY_05000347) + return; + + revid = bfin_revid(); + +#ifdef __ADSPBF54x__ + if (revid > 0) + return; +#endif +#ifdef __ADSPBF52x__ + if (ANOMALY_BF526 && revid > 0) + return; + if (ANOMALY_BF527 && revid > 1) + return; +#endif if (ANOMALY_05000346) { bfin_write_USB_APHY_CALIB(ANOMALY_05000346_value); @@ -107,9 +126,18 @@ int musb_platform_init(void) bfin_write_USB_APHY_CNTRL(0x0); SSYNC(); } +} + +int musb_platform_init(void) +{ + /* board specific initialization */ + board_musb_init(); + + bfin_anomaly_init(); /* Configure PLL oscillator register */ - bfin_write_USB_PLLOSC_CTRL(0x30a8); + bfin_write_USB_PLLOSC_CTRL(0x3080 | + ((480 / CONFIG_USB_BLACKFIN_CLKIN) << 1)); SSYNC(); bfin_write_USB_SRP_CLKDIV((get_sclk()/1000) / 32 - 1); diff --git a/fs/fat/fat.c b/fs/fat/fat.c index a75e4f2..c450bf6 100644 --- a/fs/fat/fat.c +++ b/fs/fat/fat.c @@ -209,7 +209,7 @@ static __u32 get_fatent (fsdata *mydata, __u32 entry) /* Read a new block of FAT entries into the cache. */ if (bufnum != mydata->fatbufnum) { - int getsize = FATBUFSIZE / FS_BLOCK_SIZE; + __u32 getsize = FATBUFSIZE / FS_BLOCK_SIZE; __u8 *bufptr = mydata->fatbuf; __u32 fatlength = mydata->fatlength; __u32 startblock = bufnum * FATBUFBLOCKS; @@ -279,7 +279,7 @@ static int get_cluster (fsdata *mydata, __u32 clustnum, __u8 *buffer, unsigned long size) { - int idx = 0; + __u32 idx = 0; __u32 startsect; if (clustnum > 0) { @@ -767,12 +767,13 @@ do_fat_read (const char *filename, void *buffer, unsigned long maxsize, dir_entry *dentptr; __u16 prevcksum = 0xffff; char *subname = ""; - int cursect; + __u32 cursect; int idx, isdir = 0; int files = 0, dirs = 0; long ret = 0; int firsttime; - int root_cluster; + __u32 root_cluster; + int rootdir_size = 0; int j; if (read_bootsectandvi(&bs, &volinfo, &mydata->fatsize)) { @@ -798,8 +799,6 @@ do_fat_read (const char *filename, void *buffer, unsigned long maxsize, mydata->data_begin = mydata->rootdir_sect - (mydata->clust_size * 2); } else { - int rootdir_size; - rootdir_size = ((bs.dir_entries[1] * (int)256 + bs.dir_entries[0]) * sizeof(dir_entry)) / @@ -1006,20 +1005,18 @@ do_fat_read (const char *filename, void *buffer, unsigned long maxsize, * root directory clusters when a cluster has been * completely processed. */ - if ((mydata->fatsize == 32) && (++j == mydata->clust_size)) { - int nxtsect; - int nxt_clust; + ++j; + int fat32_end = 0; + if ((mydata->fatsize == 32) && (j == mydata->clust_size)) { + int nxtsect = 0; + int nxt_clust = 0; nxt_clust = get_fatent(mydata, root_cluster); + fat32_end = CHECK_CLUST(nxt_clust, 32); nxtsect = mydata->data_begin + (nxt_clust * mydata->clust_size); - debug("END LOOP: sect=%d, root_clust=%d, " - "n_sect=%d, n_clust=%d\n", - cursect, root_cluster, - nxtsect, nxt_clust); - root_cluster = nxt_clust; cursect = nxtsect; @@ -1027,6 +1024,18 @@ do_fat_read (const char *filename, void *buffer, unsigned long maxsize, } else { cursect++; } + + /* If end of rootdir reached */ + if ((mydata->fatsize == 32 && fat32_end) || + (mydata->fatsize != 32 && j == rootdir_size)) { + if (dols == LS_ROOT) { + printf("\n%d file(s), %d dir(s)\n\n", + files, dirs); + return 0; + } else { + return -1; + } + } } rootdir_done: |