qspi.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*
  2. * Queue Serial Peripheral Interface Memory Map
  3. *
  4. * Copyright (C) 2004-2007 Freescale Semiconductor, Inc.
  5. * TsiChung Liew (Tsi-Chung.Liew@freescale.com)
  6. *
  7. * SPDX-License-Identifier: GPL-2.0+
  8. */
  9. #ifndef __QSPI_H__
  10. #define __QSPI_H__
  11. /* QSPI module registers */
  12. typedef struct qspi_ctrl {
  13. u16 mr; /* 0x00 Mode */
  14. u16 res1;
  15. u16 dlyr; /* 0x04 Delay */
  16. u16 res2;
  17. u16 wr; /* 0x08 Wrap */
  18. u16 res3;
  19. u16 ir; /* 0x0C Interrupt */
  20. u16 res4;
  21. u16 ar; /* 0x10 Address */
  22. u16 res5;
  23. u16 dr; /* 0x14 Data */
  24. u16 res6;
  25. } qspi_t;
  26. /* MR */
  27. #define QSPI_QMR_MSTR (0x8000)
  28. #define QSPI_QMR_DOHIE (0x4000)
  29. #define QSPI_QMR_BITS(x) (((x)&0x000F)<<10)
  30. #define QSPI_QMR_BITS_MASK (0xC3FF)
  31. #define QSPI_QMR_BITS_8 (0x2000)
  32. #define QSPI_QMR_BITS_9 (0x2400)
  33. #define QSPI_QMR_BITS_10 (0x2800)
  34. #define QSPI_QMR_BITS_11 (0x2C00)
  35. #define QSPI_QMR_BITS_12 (0x3000)
  36. #define QSPI_QMR_BITS_13 (0x3400)
  37. #define QSPI_QMR_BITS_14 (0x3800)
  38. #define QSPI_QMR_BITS_15 (0x3C00)
  39. #define QSPI_QMR_BITS_16 (0x0000)
  40. #define QSPI_QMR_CPOL (0x0200)
  41. #define QSPI_QMR_CPHA (0x0100)
  42. #define QSPI_QMR_BAUD(x) ((x)&0x00FF)
  43. #define QSPI_QMR_BAUD_MASK (0xFF00)
  44. /* DLYR */
  45. #define QSPI_QDLYR_SPE (0x8000)
  46. #define QSPI_QDLYR_QCD(x) (((x)&0x007F)<<8)
  47. #define QSPI_QDLYR_QCD_MASK (0x80FF)
  48. #define QSPI_QDLYR_DTL(x) ((x)&0x00FF)
  49. #define QSPI_QDLYR_DTL_MASK (0xFF00)
  50. /* WR */
  51. #define QSPI_QWR_HALT (0x8000)
  52. #define QSPI_QWR_WREN (0x4000)
  53. #define QSPI_QWR_WRTO (0x2000)
  54. #define QSPI_QWR_CSIV (0x1000)
  55. #define QSPI_QWR_ENDQP(x) (((x)&0x000F)<<8)
  56. #define QSPI_QWR_ENDQP_MASK (0xF0FF)
  57. #define QSPI_QWR_CPTQP(x) (((x)&0x000F)<<4)
  58. #define QSPI_QWR_CPTQP_MASK (0xFF0F)
  59. #define QSPI_QWR_NEWQP(x) ((x)&0x000F)
  60. #define QSPI_QWR_NEWQP_MASK (0xFFF0)
  61. /* IR */
  62. #define QSPI_QIR_WCEFB (0x8000)
  63. #define QSPI_QIR_ABRTB (0x4000)
  64. #define QSPI_QIR_ABRTL (0x1000)
  65. #define QSPI_QIR_WCEFE (0x0800)
  66. #define QSPI_QIR_ABRTE (0x0400)
  67. #define QSPI_QIR_SPIFE (0x0100)
  68. #define QSPI_QIR_WCEF (0x0008)
  69. #define QSPI_QIR_ABRT (0x0004)
  70. #define QSPI_QIR_SPIF (0x0001)
  71. /* AR */
  72. #define QSPI_QAR_ADDR(x) ((x)&0x003F)
  73. #define QSPI_QAR_ADDR_MASK (0xFFC0)
  74. #define QSPI_QAR_TRANS (0x0000)
  75. #define QSPI_QAR_RECV (0x0010)
  76. #define QSPI_QAR_CMD (0x0020)
  77. /* DR with RAM command word definitions */
  78. #define QSPI_QDR_CONT (0x8000)
  79. #define QSPI_QDR_BITSE (0x4000)
  80. #define QSPI_QDR_DT (0x2000)
  81. #define QSPI_QDR_DSCK (0x1000)
  82. #define QSPI_QDR_QSPI_CS3 (0x0800)
  83. #define QSPI_QDR_QSPI_CS2 (0x0400)
  84. #define QSPI_QDR_QSPI_CS1 (0x0200)
  85. #define QSPI_QDR_QSPI_CS0 (0x0100)
  86. #endif /* __QSPI_H__ */