goldfish_nand_reg.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * drivers/mtd/devices/goldfish_nand_reg.h
  3. *
  4. * Copyright (C) 2007 Google, Inc.
  5. *
  6. * This software is licensed under the terms of the GNU General Public
  7. * License version 2, as published by the Free Software Foundation, and
  8. * may be copied, distributed, and modified under those terms.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. */
  16. #ifndef GOLDFISH_NAND_REG_H
  17. #define GOLDFISH_NAND_REG_H
  18. enum nand_cmd {
  19. /* Write device name for NAND_DEV to NAND_DATA (vaddr) */
  20. NAND_CMD_GET_DEV_NAME,
  21. NAND_CMD_READ,
  22. NAND_CMD_WRITE,
  23. NAND_CMD_ERASE,
  24. /* NAND_RESULT is 1 if block is bad, 0 if it is not */
  25. NAND_CMD_BLOCK_BAD_GET,
  26. NAND_CMD_BLOCK_BAD_SET,
  27. NAND_CMD_READ_WITH_PARAMS,
  28. NAND_CMD_WRITE_WITH_PARAMS,
  29. NAND_CMD_ERASE_WITH_PARAMS
  30. };
  31. enum nand_dev_flags {
  32. NAND_DEV_FLAG_READ_ONLY = 0x00000001,
  33. NAND_DEV_FLAG_CMD_PARAMS_CAP = 0x00000002,
  34. };
  35. #define NAND_VERSION_CURRENT (1)
  36. enum nand_reg {
  37. /* Global */
  38. NAND_VERSION = 0x000,
  39. NAND_NUM_DEV = 0x004,
  40. NAND_DEV = 0x008,
  41. /* Dev info */
  42. NAND_DEV_FLAGS = 0x010,
  43. NAND_DEV_NAME_LEN = 0x014,
  44. NAND_DEV_PAGE_SIZE = 0x018,
  45. NAND_DEV_EXTRA_SIZE = 0x01c,
  46. NAND_DEV_ERASE_SIZE = 0x020,
  47. NAND_DEV_SIZE_LOW = 0x028,
  48. NAND_DEV_SIZE_HIGH = 0x02c,
  49. /* Command */
  50. NAND_RESULT = 0x040,
  51. NAND_COMMAND = 0x044,
  52. NAND_DATA = 0x048,
  53. NAND_DATA_HIGH = 0x100,
  54. NAND_TRANSFER_SIZE = 0x04c,
  55. NAND_ADDR_LOW = 0x050,
  56. NAND_ADDR_HIGH = 0x054,
  57. NAND_CMD_PARAMS_ADDR_LOW = 0x058,
  58. NAND_CMD_PARAMS_ADDR_HIGH = 0x05c,
  59. };
  60. struct cmd_params {
  61. u32 dev;
  62. u32 addr_low;
  63. u32 addr_high;
  64. u32 transfer_size;
  65. unsigned long data;
  66. u32 result;
  67. };
  68. #endif