mcf5225x_fbcs.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. * Copyright 2012 by Embedded Technologies s.r.o
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions
  6. * are met:
  7. *
  8. * 1. Redistributions of source code must retain the above copyright
  9. * notice, this list of conditions and the following disclaimer.
  10. * 2. Redistributions in binary form must reproduce the above copyright
  11. * notice, this list of conditions and the following disclaimer in the
  12. * documentation and/or other materials provided with the distribution.
  13. * 3. Neither the name of the copyright holders nor the names of
  14. * contributors may be used to endorse or promote products derived
  15. * from this software without specific prior written permission.
  16. *
  17. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  18. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  19. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  20. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  21. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  22. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  23. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  24. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  25. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  26. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  27. * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  28. * SUCH DAMAGE.
  29. *
  30. * For additional information see http://www.ethernut.de/
  31. */
  32. #ifndef MCF5225X_FBCS_H_
  33. #define MCF5225X_FBCS_H_
  34. /* Mini-FlexBus Chip Select Registers */
  35. #define MCF_FBCS_CSAR(x) (*(volatile uint32_t*)(0x40000080 + ((x) * 0xC)))
  36. #define MCF_FBCS_CSMR(x) (*(volatile uint32_t*)(0x40000084 + ((x) * 0xC)))
  37. #define MCF_FBCS_CSCR(x) (*(volatile uint32_t*)(0x40000088 + ((x) * 0xC)))
  38. /* MCF_FBCS_CSAR */
  39. #define MCF_FBCS_CSAR_BA(x) ((x) & 0xFFFF0000)
  40. /* MCF_FBCS_CSMR */
  41. #define MCF_FBCS_CSMR_V 0x1
  42. #define MCF_FBCS_CSMR_WP 0x100
  43. #define MCF_FBCS_CSMR_BAM(x) (((x) & 0xFFFF) << 0x10)
  44. #define MCF_FBCS_CSMR_BAM_4G 0xFFFF0000
  45. #define MCF_FBCS_CSMR_BAM_2G 0x7FFF0000
  46. #define MCF_FBCS_CSMR_BAM_1G 0x3FFF0000
  47. #define MCF_FBCS_CSMR_BAM_1024M 0x3FFF0000
  48. #define MCF_FBCS_CSMR_BAM_512M 0x1FFF0000
  49. #define MCF_FBCS_CSMR_BAM_256M 0xFFF0000
  50. #define MCF_FBCS_CSMR_BAM_128M 0x7FF0000
  51. #define MCF_FBCS_CSMR_BAM_64M 0x3FF0000
  52. #define MCF_FBCS_CSMR_BAM_32M 0x1FF0000
  53. #define MCF_FBCS_CSMR_BAM_16M 0xFF0000
  54. #define MCF_FBCS_CSMR_BAM_8M 0x7F0000
  55. #define MCF_FBCS_CSMR_BAM_4M 0x3F0000
  56. #define MCF_FBCS_CSMR_BAM_2M 0x1F0000
  57. #define MCF_FBCS_CSMR_BAM_1M 0xF0000
  58. #define MCF_FBCS_CSMR_BAM_1024K 0xF0000
  59. #define MCF_FBCS_CSMR_BAM_512K 0x70000
  60. #define MCF_FBCS_CSMR_BAM_256K 0x30000
  61. #define MCF_FBCS_CSMR_BAM_128K 0x10000
  62. #define MCF_FBCS_CSMR_BAM_64K 0
  63. /* MCF_FBCS_CSCR */
  64. #define MCF_FBCS_CSCR_BSTW 0x8
  65. #define MCF_FBCS_CSCR_BSTR 0x10
  66. #define MCF_FBCS_CSCR_PS(x) (((x) & 0x3) << 0x6)
  67. #define MCF_FBCS_CSCR_PS_8 0x40
  68. #define MCF_FBCS_CSCR_PS_16 0x80
  69. #define MCF_FBCS_CSCR_AA 0x100
  70. #define MCF_FBCS_CSCR_MUX 0x200
  71. #define MCF_FBCS_CSCR_WS(x) (((x) & 0x3F) << 0xA)
  72. #define MCF_FBCS_CSCR_WRAH(x) (((x) & 0x3) << 0x10)
  73. #define MCF_FBCS_CSCR_RDAH(x) (((x) & 0x3) << 0x12)
  74. #define MCF_FBCS_CSCR_ASET(x) (((x) & 0x3) << 0x14)
  75. #define MCF_FBCS_CSCR_SWSEN 0x800000
  76. #define MCF_FBCS_CSCR_SWS(x) (((x) & 0x3F) << 0x1A)
  77. #endif /* MCF5225X_FBCS_H_ */