flexbus.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /*
  2. * FlexBus Internal Memory Map
  3. *
  4. * Copyright (C) 2004-2007 Freescale Semiconductor, Inc.
  5. * TsiChung Liew (Tsi-Chung.Liew@freescale.com)
  6. *
  7. * See file CREDITS for list of people who contributed to this
  8. * project.
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License as
  12. * published by the Free Software Foundation; either version 2 of
  13. * the License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  23. * MA 02111-1307 USA
  24. */
  25. #ifndef __FLEXBUS_H
  26. #define __FLEXBUS_H
  27. /*********************************************************************
  28. * FlexBus Chip Selects (FBCS)
  29. *********************************************************************/
  30. typedef struct fbcs {
  31. u32 csar0; /* Chip-select Address */
  32. u32 csmr0; /* Chip-select Mask */
  33. u32 cscr0; /* Chip-select Control */
  34. u32 csar1;
  35. u32 csmr1;
  36. u32 cscr1;
  37. u32 csar2;
  38. u32 csmr2;
  39. u32 cscr2;
  40. u32 csar3;
  41. u32 csmr3;
  42. u32 cscr3;
  43. u32 csar4;
  44. u32 csmr4;
  45. u32 cscr4;
  46. u32 csar5;
  47. u32 csmr5;
  48. u32 cscr5;
  49. u32 csar6;
  50. u32 csmr6;
  51. u32 cscr6;
  52. u32 csar7;
  53. u32 csmr7;
  54. u32 cscr7;
  55. } fbcs_t;
  56. #define FBCS_CSAR_BA(x) ((x) & 0xFFFF0000)
  57. #define FBCS_CSMR_BAM(x) (((x) & 0xFFFF) << 16)
  58. #define FBCS_CSMR_BAM_MASK (0x0000FFFF)
  59. #define FBCS_CSMR_BAM_4G (0xFFFF0000)
  60. #define FBCS_CSMR_BAM_2G (0x7FFF0000)
  61. #define FBCS_CSMR_BAM_1G (0x3FFF0000)
  62. #define FBCS_CSMR_BAM_1024M (0x3FFF0000)
  63. #define FBCS_CSMR_BAM_512M (0x1FFF0000)
  64. #define FBCS_CSMR_BAM_256M (0x0FFF0000)
  65. #define FBCS_CSMR_BAM_128M (0x07FF0000)
  66. #define FBCS_CSMR_BAM_64M (0x03FF0000)
  67. #define FBCS_CSMR_BAM_32M (0x01FF0000)
  68. #define FBCS_CSMR_BAM_16M (0x00FF0000)
  69. #define FBCS_CSMR_BAM_8M (0x007F0000)
  70. #define FBCS_CSMR_BAM_4M (0x003F0000)
  71. #define FBCS_CSMR_BAM_2M (0x001F0000)
  72. #define FBCS_CSMR_BAM_1M (0x000F0000)
  73. #define FBCS_CSMR_BAM_1024K (0x000F0000)
  74. #define FBCS_CSMR_BAM_512K (0x00070000)
  75. #define FBCS_CSMR_BAM_256K (0x00030000)
  76. #define FBCS_CSMR_BAM_128K (0x00010000)
  77. #define FBCS_CSMR_BAM_64K (0x00000000)
  78. #ifdef CONFIG_M5249
  79. #define FBCS_CSMR_WP (0x00000080)
  80. #define FBCS_CSMR_AM (0x00000040)
  81. #define FBCS_CSMR_CI (0x00000020)
  82. #define FBCS_CSMR_SC (0x00000010)
  83. #define FBCS_CSMR_SD (0x00000008)
  84. #define FBCS_CSMR_UC (0x00000004)
  85. #define FBCS_CSMR_UD (0x00000002)
  86. #else
  87. #define FBCS_CSMR_WP (0x00000100)
  88. #endif
  89. #define FBCS_CSMR_V (0x00000001) /* Valid bit */
  90. #define FBCS_CSCR_SWS(x) (((x) & 0x3F) << 26)
  91. #define FBCS_CSCR_SWS_MASK (0x03FFFFFF)
  92. #define FBCS_CSCR_SWSEN (0x00800000)
  93. #define FBCS_CSCR_ASET(x) (((x) & 0x03) << 20)
  94. #define FBCS_CSCR_ASET_MASK (0xFFCFFFFF)
  95. #define FBCS_CSCR_RDAH(x) (((x) & 0x03) << 18)
  96. #define FBCS_CSCR_RDAH_MASK (0xFFF3FFFF)
  97. #define FBCS_CSCR_WRAH(x) (((x) & 0x03) << 16)
  98. #define FBCS_CSCR_WRAH_MASK (0xFFFCFFFF)
  99. #define FBCS_CSCR_WS(x) (((x) & 0x3F) << 10)
  100. #define FBCS_CSCR_WS_MASK (0xFFFF03FF)
  101. #define FBCS_CSCR_SBM (0x00000200)
  102. #define FBCS_CSCR_AA (0x00000100)
  103. #define FBCS_CSCR_PS(x) (((x) & 0x03) << 6)
  104. #define FBCS_CSCR_PS_MASK (0xFFFFFF3F)
  105. #define FBCS_CSCR_BEM (0x00000020)
  106. #define FBCS_CSCR_BSTR (0x00000010)
  107. #define FBCS_CSCR_BSTW (0x00000008)
  108. #define FBCS_CSCR_PS_16 (0x00000080)
  109. #define FBCS_CSCR_PS_8 (0x00000040)
  110. #define FBCS_CSCR_PS_32 (0x00000000)
  111. #endif /* __FLEXBUS_H */