
Dear Mike Frysinger,
In message 1241615121-15945-1-git-send-email-vapier@gentoo.org you wrote:
The BF537-STAMP Blackfin board had a driver for working with NAND devices that are simply memory mapped. Since there is nothing Blackfin specific about this, generalize the driver a bit so that everyone can leverage it.
Signed-off-by: Mike Frysinger vapier@gentoo.org
...
diff --git a/drivers/mtd/nand/nand_plat.c b/drivers/mtd/nand/nand_plat.c new file mode 100644 index 0000000..9a0e4c0 --- /dev/null +++ b/drivers/mtd/nand/nand_plat.c @@ -0,0 +1,53 @@ +/*
- Genericish driver for memory mapped NAND devices
Genericish ?
...
+#define NAND_PLAT_WRITE_CMD(cmd, chip) BFIN_NAND_WRITE(BFIN_NAND_CLE(chip), cmd) +#define NAND_PLAT_WRITE_ADR(cmd, chip) BFIN_NAND_WRITE(BFIN_NAND_ALE(chip), cmd) +#define NAND_PLAT_DEV_READY(chip) ((*pPORTFIO & BFIN_NAND_READY) ? 1 : 0) +#define NAND_PLAT_INIT() \
- do { \
*pPORTF_FER &= ~BFIN_NAND_READY; \
*pPORTFIO_DIR &= ~BFIN_NAND_READY; \
*pPORTFIO_INEN |= BFIN_NAND_READY; \
- } while (0)
Please use I/O accessors instead of pointers.
Best regards,
Wolfgang Denk