regs-mem.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * arch/arm/mach-ks8695/include/mach/regs-mem.h
  3. *
  4. * Copyright (C) 2006 Andrew Victor
  5. *
  6. * KS8695 - Memory Controller registers and bit definitions
  7. *
  8. * This file is licensed under the terms of the GNU General Public
  9. * License version 2. This program is licensed "as is" without any
  10. * warranty of any kind, whether express or implied.
  11. */
  12. #ifndef KS8695_MEM_H
  13. #define KS8695_MEM_H
  14. #define KS8695_MEM_OFFSET (0xF0000 + 0x4000)
  15. #define KS8695_MEM_VA (KS8695_IO_VA + KS8695_MEM_OFFSET)
  16. #define KS8695_MEM_PA (KS8695_IO_PA + KS8695_MEM_OFFSET)
  17. /*
  18. * Memory Controller Registers
  19. */
  20. #define KS8695_EXTACON0 (0x00) /* External I/O 0 Access Control */
  21. #define KS8695_EXTACON1 (0x04) /* External I/O 1 Access Control */
  22. #define KS8695_EXTACON2 (0x08) /* External I/O 2 Access Control */
  23. #define KS8695_ROMCON0 (0x10) /* ROM/SRAM/Flash 1 Control Register */
  24. #define KS8695_ROMCON1 (0x14) /* ROM/SRAM/Flash 2 Control Register */
  25. #define KS8695_ERGCON (0x20) /* External I/O and ROM/SRAM/Flash General Register */
  26. #define KS8695_SDCON0 (0x30) /* SDRAM Control Register 0 */
  27. #define KS8695_SDCON1 (0x34) /* SDRAM Control Register 1 */
  28. #define KS8695_SDGCON (0x38) /* SDRAM General Control */
  29. #define KS8695_SDBCON (0x3c) /* SDRAM Buffer Control */
  30. #define KS8695_REFTIM (0x40) /* SDRAM Refresh Timer */
  31. /* External I/O Access Control Registers */
  32. #define EXTACON_EBNPTR (0x3ff << 22) /* Last Address Pointer */
  33. #define EXTACON_EBBPTR (0x3ff << 12) /* Base Pointer */
  34. #define EXTACON_EBTACT (7 << 9) /* Write Enable/Output Enable Active Time */
  35. #define EXTACON_EBTCOH (7 << 6) /* Chip Select Hold Time */
  36. #define EXTACON_EBTACS (7 << 3) /* Address Setup Time before ECSN */
  37. #define EXTACON_EBTCOS (7 << 0) /* Chip Select Time before OEN */
  38. /* ROM/SRAM/Flash Control Register */
  39. #define ROMCON_RBNPTR (0x3ff << 22) /* Next Pointer */
  40. #define ROMCON_RBBPTR (0x3ff << 12) /* Base Pointer */
  41. #define ROMCON_RBTACC (7 << 4) /* Access Cycle Time */
  42. #define ROMCON_RBTPA (3 << 2) /* Page Address Access Time */
  43. #define ROMCON_PMC (3 << 0) /* Page Mode Configuration */
  44. #define PMC_NORMAL (0 << 0)
  45. #define PMC_4WORD (1 << 0)
  46. #define PMC_8WORD (2 << 0)
  47. #define PMC_16WORD (3 << 0)
  48. /* External I/O and ROM/SRAM/Flash General Register */
  49. #define ERGCON_TMULT (3 << 28) /* Time Multiplier */
  50. #define ERGCON_DSX2 (3 << 20) /* Data Width (External I/O Bank 2) */
  51. #define ERGCON_DSX1 (3 << 18) /* Data Width (External I/O Bank 1) */
  52. #define ERGCON_DSX0 (3 << 16) /* Data Width (External I/O Bank 0) */
  53. #define ERGCON_DSR1 (3 << 2) /* Data Width (ROM/SRAM/Flash Bank 1) */
  54. #define ERGCON_DSR0 (3 << 0) /* Data Width (ROM/SRAM/Flash Bank 0) */
  55. /* SDRAM Control Register */
  56. #define SDCON_DBNPTR (0x3ff << 22) /* Last Address Pointer */
  57. #define SDCON_DBBPTR (0x3ff << 12) /* Base Pointer */
  58. #define SDCON_DBCAB (3 << 8) /* Column Address Bits */
  59. #define SDCON_DBBNUM (1 << 3) /* Number of Banks */
  60. #define SDCON_DBDBW (3 << 1) /* Data Bus Width */
  61. /* SDRAM General Control Register */
  62. #define SDGCON_SDTRC (3 << 2) /* RAS to CAS latency */
  63. #define SDGCON_SDCAS (3 << 0) /* CAS latency */
  64. /* SDRAM Buffer Control Register */
  65. #define SDBCON_SDESTA (1 << 31) /* SDRAM Engine Status */
  66. #define SDBCON_RBUFBDIS (1 << 24) /* Read Buffer Burst Enable */
  67. #define SDBCON_WFIFOEN (1 << 23) /* Write FIFO Enable */
  68. #define SDBCON_RBUFEN (1 << 22) /* Read Buffer Enable */
  69. #define SDBCON_FLUSHWFIFO (1 << 21) /* Flush Write FIFO */
  70. #define SDBCON_RBUFINV (1 << 20) /* Read Buffer Invalidate */
  71. #define SDBCON_SDINI (3 << 16) /* SDRAM Initialization Control */
  72. #define SDBCON_SDMODE (0x3fff << 0) /* SDRAM Mode Register Value Program */
  73. /* SDRAM Refresh Timer Register */
  74. #define REFTIM_REFTIM (0xffff << 0) /* Refresh Timer Value */
  75. #endif