]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
spl, mtd, nand, atmel_nand: invert device ready pin logic
authorHeiko Schocher <hs@denx.de>
Fri, 31 Oct 2014 07:31:03 +0000 (08:31 +0100)
committerTom Rini <trini@ti.com>
Mon, 17 Nov 2014 13:47:17 +0000 (08:47 -0500)
device ready pin is signalling that the device is ready on state 1
not on 0. Simmiliar as it is in drivers/mtd/nand/nand_spl_simple.c

Signed-off-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Andreas Bießmann <andreas.devel@googlemail.com>
Reviewed-by: Bo Shen <voice.shen@atmel.com>
Acked-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
drivers/mtd/nand/atmel_nand.c

index d6d6f85a9e3ef1390e659c8dddfea8b0dcff5c64..3b6093a81b1dac898d059004bd992eeaacf75278 100644 (file)
@@ -1188,7 +1188,7 @@ static int nand_command(int block, int page, uint32_t offs, u8 cmd)
        void (*hwctrl)(struct mtd_info *mtd, int cmd,
                        unsigned int ctrl) = this->cmd_ctrl;
 
-       while (this->dev_ready(&mtd))
+       while (!this->dev_ready(&mtd))
                ;
 
        if (cmd == NAND_CMD_READOOB) {
@@ -1213,7 +1213,7 @@ static int nand_command(int block, int page, uint32_t offs, u8 cmd)
        hwctrl(&mtd, NAND_CMD_READSTART, NAND_CTRL_CLE | NAND_CTRL_CHANGE);
        hwctrl(&mtd, NAND_CMD_NONE, NAND_NCE | NAND_CTRL_CHANGE);
 
-       while (this->dev_ready(&mtd))
+       while (!this->dev_ready(&mtd))
                ;
 
        return 0;
@@ -1353,7 +1353,7 @@ int at91_nand_wait_ready(struct mtd_info *mtd)
 
        udelay(this->chip_delay);
 
-       return 0;
+       return 1;
 }
 
 int board_nand_init(struct nand_chip *nand)