nand.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * u-boot/include/linux/mtd/nand.h
  3. *
  4. * Copyright (c) 2000 David Woodhouse <dwmw2@mvhi.com>
  5. * Steven J. Hill <sjhill@cotw.com>
  6. *
  7. * $Id: nand.h,v 1.8 2000/10/30 17:16:17 sjhill Exp $
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License version 2 as
  11. * published by the Free Software Foundation.
  12. *
  13. * Info:
  14. * Contains standard defines and IDs for NAND flash devices
  15. *
  16. * Changelog:
  17. * 01-31-2000 DMW Created
  18. * 09-18-2000 SJH Moved structure out of the Disk-On-Chip drivers
  19. * so it can be used by other NAND flash device
  20. * drivers. I also changed the copyright since none
  21. * of the original contents of this file are specific
  22. * to DoC devices. David can whack me with a baseball
  23. * bat later if I did something naughty.
  24. * 10-11-2000 SJH Added private NAND flash structure for driver
  25. * 10-24-2000 SJH Added prototype for 'nand_scan' function
  26. */
  27. #ifndef __LINUX_MTD_NAND_H
  28. #define __LINUX_MTD_NAND_H
  29. /*
  30. * Standard NAND flash commands
  31. */
  32. #define NAND_CMD_READ0 0
  33. #define NAND_CMD_READ1 1
  34. #define NAND_CMD_PAGEPROG 0x10
  35. #define NAND_CMD_READOOB 0x50
  36. #define NAND_CMD_ERASE1 0x60
  37. #define NAND_CMD_STATUS 0x70
  38. #define NAND_CMD_SEQIN 0x80
  39. #define NAND_CMD_READID 0x90
  40. #define NAND_CMD_ERASE2 0xd0
  41. #define NAND_CMD_RESET 0xff
  42. /*
  43. * NAND Flash Manufacturer ID Codes
  44. */
  45. #define NAND_MFR_TOSHIBA 0x98
  46. #define NAND_MFR_SAMSUNG 0xec
  47. /*
  48. * NAND Flash Device ID Structure
  49. *
  50. * Structure overview:
  51. *
  52. * name - Complete name of device
  53. *
  54. * manufacture_id - manufacturer ID code of device.
  55. *
  56. * model_id - model ID code of device.
  57. *
  58. * chipshift - total number of address bits for the device which
  59. * is used to calculate address offsets and the total
  60. * number of bytes the device is capable of.
  61. *
  62. * page256 - denotes if flash device has 256 byte pages or not.
  63. *
  64. * pageadrlen - number of bytes minus one needed to hold the
  65. * complete address into the flash array. Keep in
  66. * mind that when a read or write is done to a
  67. * specific address, the address is input serially
  68. * 8 bits at a time. This structure member is used
  69. * by the read/write routines as a loop index for
  70. * shifting the address out 8 bits at a time.
  71. *
  72. * erasesize - size of an erase block in the flash device.
  73. */
  74. struct nand_flash_dev {
  75. char * name;
  76. int manufacture_id;
  77. int model_id;
  78. int chipshift;
  79. char page256;
  80. char pageadrlen;
  81. unsigned long erasesize;
  82. };
  83. #endif /* __LINUX_MTD_NAND_H */