]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
* Patch by Gary Jennejohn, 11 Sep 2003:
authorwdenk <wdenk>
Thu, 11 Sep 2003 19:48:06 +0000 (19:48 +0000)
committerwdenk <wdenk>
Thu, 11 Sep 2003 19:48:06 +0000 (19:48 +0000)
  - allow for longer timeouts for USB mass storage devices

* Patch by Denis Peter, 11 Sep 2003:
  - fix USB data pointer assignment for bulk only transfer.
  - prevent to display erased directories in FAT filesystem.

* Change output format for NAND flash - make it look like for other
  memory, too

15 files changed:
CHANGELOG
board/at91rm9200dk/at91rm9200dk.c
board/dave/PPChameleonEVB/PPChameleonEVB.c
board/esd/ash405/ash405.c
board/mpl/vcma9/vcma9.c
board/netvia/netvia.c
board/sixnet/sixnet.c
common/cmd_nand.c
common/usb_storage.c
cpu/arm920t/usb_ohci.c
fs/fat/fat.c
include/linux/mtd/nand.h
include/version.h
lib_arm/board.c
lib_ppc/board.c

index 232a485974a00f9dd08600587dc1fc02ff35a4db..29c5a2fb44974527855106289c9871bef43615c0 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,14 @@
+======================================================================
+Changes for U-Boot 1.0.0:
+======================================================================
+
+* Patch by Denis Peter, 11 Sep 2003:
+  - fix USB data pointer assignment for bulk only transfer.
+  - prevent to display erased directories in FAT filesystem.
+
+* Change output format for NAND flash - make it look like for other
+  memory, too
+
 ======================================================================
 Changes for U-Boot 0.4.8:
 ======================================================================
index ffd9687bf4c50303de313b779ebf1c51d96d1c40..8a05c5321fe59f0f59c9be889ae836f830a72236 100644 (file)
@@ -66,7 +66,7 @@ int dram_init (void)
  * The NAND lives in the CS2* space
  */
 #if (CONFIG_COMMANDS & CFG_CMD_NAND)
-extern void nand_probe (ulong physadr);
+extern ulong nand_probe (ulong physadr);
 
 #define AT91_SMARTMEDIA_BASE 0x40000000        /* physical address to access memory on NCS3 */
 void nand_init (void)
@@ -103,10 +103,12 @@ void nand_init (void)
        *AT91C_PIOB_ODR = AT91C_PIO_PB1;        /* disable output */
 
        if (*AT91C_PIOB_PDSR & AT91C_PIO_PB1)
-               printf ("No ");
-       printf ("SmartMedia card inserted\n");
+               printf ("  No SmartMedia card inserted\n");
+#ifdef DEBUG
+       printf ("  SmartMedia card inserted\n");
 
        printf ("Probing at 0x%.8x\n", AT91_SMARTMEDIA_BASE);
-       nand_probe (AT91_SMARTMEDIA_BASE);
+#endif
+       printf ("%4lu MB\n", nand_probe(AT91_SMARTMEDIA_BASE) >> 20);
 }
 #endif
index d015f69a90706eb37bec85ba20a5958093f986e3..47670fa21bf195c1b99ba2b4c0fd86a4c02ce841 100644 (file)
@@ -255,16 +255,20 @@ int testdram (void)
 /* ------------------------------------------------------------------------- */
 
 #if (CONFIG_COMMANDS & CFG_CMD_NAND)
-extern void
+extern ulong
 nand_probe(ulong physadr);
 
 void
 nand_init(void)
 {
+       ulong totlen;
+
        debug ("Probing at 0x%.8x\n", CFG_NAND0_BASE);
-       nand_probe (CFG_NAND0_BASE);
+       totlen = nand_probe (CFG_NAND0_BASE);
 
        debug ("Probing at 0x%.8x\n", CFG_NAND1_BASE);
-       nand_probe (CFG_NAND1_BASE);
+       totlen += nand_probe (CFG_NAND1_BASE);
+
+       printf ("%4lu MB\n", totlen >>20);
 }
 #endif
index 50dbadeddb7beb42df1412251b907511447bbd50..edca8b28c099c8af6f7d5fef71976641a1f69572 100644 (file)
@@ -239,15 +239,11 @@ int testdram (void)
 /* ------------------------------------------------------------------------- */
 
 #if (CONFIG_COMMANDS & CFG_CMD_NAND)
-#include <linux/mtd/nand.h>
-extern struct nand_chip nand_dev_desc[CFG_MAX_NAND_DEVICE];
 
 void nand_init(void)
 {
-       nand_probe(CFG_NAND_BASE);
-       if (nand_dev_desc[0].ChipID != NAND_ChipID_UNKNOWN) {
-               puts("NAND:  ");
-               print_size(nand_dev_desc[0].totlen, "\n");
-       }
+       unsigned long totlen = nand_probe(CFG_NAND_BASE);
+
+       printf ("%4lu MB\n", totlen >> 20);
 }
 #endif
index 1df5c38faeb266d870bcdaf858bd96040ea31c64..359e565761aa96a4bb8d1c379cd14bf6eb05850e 100644 (file)
@@ -144,7 +144,7 @@ int dram_init(void)
  * NAND flash initialization.
  */
 #if (CONFIG_COMMANDS & CFG_CMD_NAND)
-extern void
+extern ulong
 nand_probe(ulong physadr);
 
 
@@ -177,10 +177,15 @@ void
 nand_init(void)
 {
        S3C2410_NAND * const nand = S3C2410_GetBase_NAND();
+       unsigned totlen;
 
        NF_Init();
+#ifdef DEBUG
        printf("NAND flash probing at 0x%.8lX\n", (ulong)nand);
-       nand_probe((ulong)nand);
+#endif
+       totlen = nand_probe((ulong)nand) >> 20;
+
+       printf ("%4lu MB\n", totlen >> 20);
 }
 #endif
 
index 9dd732b3c2800004508069425539defa4d6e5fee..db36b228b4a72d3e1170d3df35323870f67ada7b 100644 (file)
@@ -420,16 +420,13 @@ int board_pre_init(void)
 
 #include <linux/mtd/nand.h>
 
-extern void nand_probe(ulong physadr);
+extern ulong nand_probe(ulong physadr);
 extern struct nand_chip nand_dev_desc[CFG_MAX_NAND_DEVICE];
 
 void nand_init(void)
 {
-       nand_probe(CFG_NAND_BASE);
-       if (nand_dev_desc[0].ChipID != NAND_ChipID_UNKNOWN) {
-               nand_dev_desc[0].name = "NetVia NAND flash";
-               puts("NAND:  ");
-               print_size(nand_dev_desc[0].totlen, "\n");
-       }
+       unsigned long totlen = nand_probe(CFG_NAND_BASE);
+
+       printf ("%4lu MB\n", totlen >> 20);
 }
 #endif
index 4025b4789147c254e718199182e21de235824e9d..63c57c93f92f607e006221a35979b4b0020f3a69 100644 (file)
@@ -330,11 +330,9 @@ int misc_init_r (void)
 #if (CONFIG_COMMANDS & CFG_CMD_NAND)
 void nand_init(void)
 {
-       nand_probe(CFG_DFLASH_BASE);    /* see if any NAND flash present */
-       if (nand_dev_desc[0].ChipID != NAND_ChipID_UNKNOWN) {
-               puts("NAND:  ");
-               print_size(nand_dev_desc[0].totlen, "\n");
-       }
+       unsigned long totlen = nand_probe(CFG_NAND_BASE);
+
+       printf ("%4lu MB\n", totlen >> 20);
 }
 #endif
 
index 60cdd8eb4976fc7108c003e53bddfdc2180967b4..0e49e9f08dad95d0170ae3c5e43d38c0d265265a 100644 (file)
@@ -38,7 +38,7 @@ struct nand_oob_config {
        int eccvalid_pos;       /* position of ECC valid flag inside oob -1 = inactive */
 } oob_config = { {0}, 0, 0};
 
-#define        NAND_DEBUG
+#undef NAND_DEBUG
 #undef PSYCHO_DEBUG
 
 /* ****************** WARNING *********************
@@ -734,7 +734,9 @@ static void NanD_ScanChips(struct nand_chip *nand)
 
        /* If there are none at all that we recognise, bail */
        if (!nand->numchips) {
+#ifdef NAND_DEBUG
                puts ("No NAND flash chips recognised.\n");
+#endif
                return;
        }
 
@@ -1408,7 +1410,7 @@ static inline int nandcheck(unsigned long potential, unsigned long physadr)
        return 0;
 }
 
-void nand_probe(unsigned long physadr)
+unsigned long nand_probe(unsigned long physadr)
 {
        struct nand_chip *nand = NULL;
        int i = 0, ChipID = 1;
@@ -1434,10 +1436,12 @@ void nand_probe(unsigned long physadr)
 
        for (i=0; i<CFG_MAX_NAND_DEVICE; i++) {
                if (nand_dev_desc[i].ChipID == NAND_ChipID_UNKNOWN) {
-                       nand = nand_dev_desc + i;
+                       nand = &nand_dev_desc[i];
                        break;
                }
        }
+       if (!nand)
+               return (0);
 
        memset((char *)nand, 0, sizeof(struct nand_chip));
 
@@ -1449,7 +1453,7 @@ void nand_probe(unsigned long physadr)
                /* no chips found, clean up and quit */
                memset((char *)nand, 0, sizeof(struct nand_chip));
                nand->ChipID = NAND_ChipID_UNKNOWN;
-               return;
+               return (0);
        }
 
        nand->ChipID = ChipID;
@@ -1459,8 +1463,10 @@ void nand_probe(unsigned long physadr)
        nand->data_buf = malloc (nand->oobblock + nand->oobsize);
        if (!nand->data_buf) {
                puts ("Cannot allocate memory for data structures.\n");
-               return;
+               return (0);
        }
+
+       return (nand->totlen);
 }
 
 #ifdef CONFIG_MTD_NAND_ECC
index 70890361bb0e36934c8751f9036316422eee98f0..f95a1d39beb8cf8de0bba9afcd82111464f2e3a1 100644 (file)
@@ -613,7 +613,7 @@ int usb_stor_BBB_transport(ccb *srb, struct us_data *us)
        result = usb_bulk_msg(us->pusb_dev, pipe, srb->pdata, srb->datalen, &data_actlen, USB_CNTL_TIMEOUT*5);
        /* special handling of STALL in DATA phase */
        if((result < 0) && (us->pusb_dev->status & USB_ST_STALLED)) {
-               printf("DATA:stall\n");
+               USB_STOR_PRINTF("DATA:stall\n");
                /* clear the STALL on the endpoint */
                result = usb_stor_BBB_clear_endpt_stall(us, dir_in? us->ep_in : us->ep_out);
                if (result >= 0)
@@ -1081,8 +1081,8 @@ int usb_storage_probe(struct usb_device *dev, unsigned int ifnum,struct us_data
                ss->irqpipe = usb_rcvintpipe(ss->pusb_dev, ss->ep_int);
                ss->irqmaxp = usb_maxpacket(dev, ss->irqpipe);
                dev->irq_handle=usb_stor_irq;
-               dev->privptr=(void *)ss;
        }
+       dev->privptr=(void *)ss;
        return 1;
 }
 
index 41ba233c4456b01489b6b798fe455e8702a7baf2..55af0348dca94d7feebd6ecefda572bb6b2dae83 100644 (file)
@@ -1197,8 +1197,15 @@ int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
 
        wait_ms(10);
        /* ohci_dump_status(&gohci); */
+       
+       /* allow more time for a BULK device to react - some are slow */
+#define BULK_TO         2000   /* timeout in milliseconds */
+       if (usb_pipetype (pipe) == PIPE_BULK)
+               timeout = BULK_TO;
+       else
+               timeout = 100;
+
        /* wait for it to complete */
-       timeout = 100;
        for (;;) {
                /* check whether the controller is done */
                stat = hc_interrupt();
index 6a6c5be0168ed4043fbe7f78404b44f2456f39b3..972ef33d03c4a2d7445e850fe0e3fa9706ee5f2f 100644 (file)
@@ -860,9 +860,11 @@ do_fat_read (const char *filename, void *buffer, unsigned long maxsize,
                int doit = 0;
 
                if (isdir) {
-                   dirs++;
                    dirc = '/';
-                   doit = 1;
+                   if (s_name[0] != 0) {
+                       dirs++;
+                       doit = 1;
+                   }
                } else {
                    dirc = ' ';
                    if (s_name[0] != 0) {
index bb13431dd89515a0654dc311cc4217505a0a96ee..af2033c5b2ffb089e85063dabb9b07207b9e3992 100644 (file)
@@ -193,6 +193,6 @@ struct nand_flash_dev {
 #define NAND_JFFS2_OOB8_FSDALEN                2
 #define NAND_JFFS2_OOB16_FSDALEN       8
 
-void nand_probe(unsigned long physadr);
+unsigned long nand_probe(unsigned long physadr);
 
 #endif /* __LINUX_MTD_NAND_H */
index f0e19d5bf2ff285891ece69b0a039cf5a2a8f8fc..ef22f7ac0a8a150e053a727604c3e634562c6ef7 100644 (file)
@@ -24,6 +24,6 @@
 #ifndef        __VERSION_H__
 #define        __VERSION_H__
 
-#define        U_BOOT_VERSION  "U-Boot 0.4.8"
+#define        U_BOOT_VERSION  "U-Boot 1.0.0-pre"
 
 #endif /* __VERSION_H__ */
index eebf5e40dd74250236d52dd289e94fe71891fd78..6e19ddc8c1ce511d4a5ee30a4382409f9ff90291 100644 (file)
@@ -248,6 +248,7 @@ void start_armboot (void)
 #endif /* CONFIG_VFD */
 
 #if (CONFIG_COMMANDS & CFG_CMD_NAND)
+       puts ("NAND:");
        nand_init();            /* go init the NAND */
 #endif
 
index 6a2686aa3c1a96e39a4124cbbdea0ff30923b1bf..329bc0a2f6d0983cd6de99476247406599dd92ec 100644 (file)
@@ -865,7 +865,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
 
 #if (CONFIG_COMMANDS & CFG_CMD_NAND)
        WATCHDOG_RESET ();
-       puts ("NAND:  ");
+       puts ("NAND:");
        nand_init();            /* go init the NAND */
 #endif