mpc5121.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. /*
  2. * MPC5121 Prototypes and definitions
  3. *
  4. * This file is licensed under the terms of the GNU General Public
  5. * License version 2.
  6. */
  7. #ifndef __ASM_POWERPC_MPC5121_H__
  8. #define __ASM_POWERPC_MPC5121_H__
  9. /* MPC512x Reset module registers */
  10. struct mpc512x_reset_module {
  11. u32 rcwlr; /* Reset Configuration Word Low Register */
  12. u32 rcwhr; /* Reset Configuration Word High Register */
  13. u32 reserved1;
  14. u32 reserved2;
  15. u32 rsr; /* Reset Status Register */
  16. u32 rmr; /* Reset Mode Register */
  17. u32 rpr; /* Reset Protection Register */
  18. u32 rcr; /* Reset Control Register */
  19. u32 rcer; /* Reset Control Enable Register */
  20. };
  21. /*
  22. * Clock Control Module
  23. */
  24. struct mpc512x_ccm {
  25. u32 spmr; /* System PLL Mode Register */
  26. u32 sccr1; /* System Clock Control Register 1 */
  27. u32 sccr2; /* System Clock Control Register 2 */
  28. u32 scfr1; /* System Clock Frequency Register 1 */
  29. u32 scfr2; /* System Clock Frequency Register 2 */
  30. u32 scfr2s; /* System Clock Frequency Shadow Register 2 */
  31. u32 bcr; /* Bread Crumb Register */
  32. u32 psc_ccr[12]; /* PSC Clock Control Registers */
  33. u32 spccr; /* SPDIF Clock Control Register */
  34. u32 cccr; /* CFM Clock Control Register */
  35. u32 dccr; /* DIU Clock Control Register */
  36. u32 mscan_ccr[4]; /* MSCAN Clock Control Registers */
  37. u32 out_ccr[4]; /* OUT CLK Configure Registers */
  38. u32 rsv0[2]; /* Reserved */
  39. u32 scfr3; /* System Clock Frequency Register 3 */
  40. u32 rsv1[3]; /* Reserved */
  41. u32 spll_lock_cnt; /* System PLL Lock Counter */
  42. u8 res[0x6c]; /* Reserved */
  43. };
  44. /*
  45. * LPC Module
  46. */
  47. struct mpc512x_lpc {
  48. u32 cs_cfg[8]; /* CS config */
  49. u32 cs_ctrl; /* CS Control Register */
  50. u32 cs_status; /* CS Status Register */
  51. u32 burst_ctrl; /* CS Burst Control Register */
  52. u32 deadcycle_ctrl; /* CS Deadcycle Control Register */
  53. u32 holdcycle_ctrl; /* CS Holdcycle Control Register */
  54. u32 alt; /* Address Latch Timing Register */
  55. };
  56. int mpc512x_cs_config(unsigned int cs, u32 val);
  57. /*
  58. * SCLPC Module (LPB FIFO)
  59. */
  60. struct mpc512x_lpbfifo {
  61. u32 pkt_size; /* SCLPC Packet Size Register */
  62. u32 start_addr; /* SCLPC Start Address Register */
  63. u32 ctrl; /* SCLPC Control Register */
  64. u32 enable; /* SCLPC Enable Register */
  65. u32 reserved1;
  66. u32 status; /* SCLPC Status Register */
  67. u32 bytes_done; /* SCLPC Bytes Done Register */
  68. u32 emb_sc; /* EMB Share Counter Register */
  69. u32 emb_pc; /* EMB Pause Control Register */
  70. u32 reserved2[7];
  71. u32 data_word; /* LPC RX/TX FIFO Data Word Register */
  72. u32 fifo_status; /* LPC RX/TX FIFO Status Register */
  73. u32 fifo_ctrl; /* LPC RX/TX FIFO Control Register */
  74. u32 fifo_alarm; /* LPC RX/TX FIFO Alarm Register */
  75. };
  76. #define MPC512X_SCLPC_START (1 << 31)
  77. #define MPC512X_SCLPC_CS(x) (((x) & 0x7) << 24)
  78. #define MPC512X_SCLPC_FLUSH (1 << 17)
  79. #define MPC512X_SCLPC_READ (1 << 16)
  80. #define MPC512X_SCLPC_DAI (1 << 8)
  81. #define MPC512X_SCLPC_BPT(x) ((x) & 0x3f)
  82. #define MPC512X_SCLPC_RESET (1 << 24)
  83. #define MPC512X_SCLPC_FIFO_RESET (1 << 16)
  84. #define MPC512X_SCLPC_ABORT_INT_ENABLE (1 << 9)
  85. #define MPC512X_SCLPC_NORM_INT_ENABLE (1 << 8)
  86. #define MPC512X_SCLPC_ENABLE (1 << 0)
  87. #define MPC512X_SCLPC_SUCCESS (1 << 24)
  88. #define MPC512X_SCLPC_FIFO_CTRL(x) (((x) & 0x7) << 24)
  89. #define MPC512X_SCLPC_FIFO_ALARM(x) ((x) & 0x3ff)
  90. enum lpb_dev_portsize {
  91. LPB_DEV_PORTSIZE_UNDEFINED = 0,
  92. LPB_DEV_PORTSIZE_1_BYTE = 1,
  93. LPB_DEV_PORTSIZE_2_BYTES = 2,
  94. LPB_DEV_PORTSIZE_4_BYTES = 4,
  95. LPB_DEV_PORTSIZE_8_BYTES = 8
  96. };
  97. enum mpc512x_lpbfifo_req_dir {
  98. MPC512X_LPBFIFO_REQ_DIR_READ,
  99. MPC512X_LPBFIFO_REQ_DIR_WRITE
  100. };
  101. struct mpc512x_lpbfifo_request {
  102. phys_addr_t dev_phys_addr; /* physical address of some device on LPB */
  103. void *ram_virt_addr; /* virtual address of some region in RAM */
  104. u32 size;
  105. enum lpb_dev_portsize portsize;
  106. enum mpc512x_lpbfifo_req_dir dir;
  107. void (*callback)(struct mpc512x_lpbfifo_request *);
  108. };
  109. int mpc512x_lpbfifo_submit(struct mpc512x_lpbfifo_request *req);
  110. #endif /* __ASM_POWERPC_MPC5121_H__ */