tc.h
上传用户:szlgq88
上传日期:2009-04-28
资源大小:48287k
文件大小:3k
源码类别:

嵌入式Linux

开发平台:

Unix_Linux

  1. /*
  2.  * linux/include/asm-arm/arch-omap/tc.h
  3.  *
  4.  * OMAP Traffic Controller
  5.  *
  6.  * Copyright (C) 2004 Nokia Corporation
  7.  * Author: Imre Deak <imre.deak@nokia.com>
  8.  *
  9.  * This program is free software; you can redistribute it and/or modify it
  10.  * under the terms of the GNU General Public License as published by the
  11.  * Free Software Foundation; either version 2 of the License, or (at your
  12.  * option) any later version.
  13.  *
  14.  * This program is distributed in the hope that it will be useful, but
  15.  * WITHOUT ANY WARRANTY; without even the implied warranty of
  16.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  17.  * General Public License for more details.
  18.  *
  19.  * You should have received a copy of the GNU General Public License along
  20.  * with this program; if not, write to the Free Software Foundation, Inc.,
  21.  * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  22.  */
  23. #ifndef __ASM_ARCH_TC_H
  24. #define __ASM_ARCH_TC_H
  25. #define TCMIF_BASE 0xfffecc00
  26. #define OMAP_TC_OCPT1_PRIOR (TCMIF_BASE + 0x00)
  27. #define OMAP_TC_EMIFS_PRIOR (TCMIF_BASE + 0x04)
  28. #define OMAP_TC_EMIFF_PRIOR (TCMIF_BASE + 0x08)
  29. #define EMIFS_CONFIG (TCMIF_BASE + 0x0c)
  30. #define EMIFS_CS0_CONFIG (TCMIF_BASE + 0x10)
  31. #define EMIFS_CS1_CONFIG (TCMIF_BASE + 0x14)
  32. #define EMIFS_CS2_CONFIG (TCMIF_BASE + 0x18)
  33. #define EMIFS_CS3_CONFIG (TCMIF_BASE + 0x1c)
  34. #define EMIFF_SDRAM_CONFIG (TCMIF_BASE + 0x20)
  35. #define EMIFF_MRS (TCMIF_BASE + 0x24)
  36. #define TC_TIMEOUT1 (TCMIF_BASE + 0x28)
  37. #define TC_TIMEOUT2 (TCMIF_BASE + 0x2c)
  38. #define TC_TIMEOUT3 (TCMIF_BASE + 0x30)
  39. #define TC_ENDIANISM (TCMIF_BASE + 0x34)
  40. #define EMIFF_SDRAM_CONFIG_2 (TCMIF_BASE + 0x3c)
  41. #define EMIF_CFG_DYNAMIC_WS (TCMIF_BASE + 0x40)
  42. #define EMIFS_ACS0 (TCMIF_BASE + 0x50)
  43. #define EMIFS_ACS1 (TCMIF_BASE + 0x54)
  44. #define EMIFS_ACS2 (TCMIF_BASE + 0x58)
  45. #define EMIFS_ACS3 (TCMIF_BASE + 0x5c)
  46. #define OMAP_TC_OCPT2_PRIOR (TCMIF_BASE + 0xd0)
  47. /* external EMIFS chipselect regions */
  48. #define OMAP_CS0_PHYS 0x00000000
  49. #define OMAP_CS0_SIZE SZ_64M
  50. #define OMAP_CS1_PHYS 0x04000000
  51. #define OMAP_CS1_SIZE SZ_64M
  52. #define OMAP_CS1A_PHYS OMAP_CS1_PHYS
  53. #define OMAP_CS1A_SIZE SZ_32M
  54. #define OMAP_CS1B_PHYS (OMAP_CS1A_PHYS + OMAP_CS1A_SIZE)
  55. #define OMAP_CS1B_SIZE SZ_32M
  56. #define OMAP_CS2_PHYS 0x08000000
  57. #define OMAP_CS2_SIZE SZ_64M
  58. #define OMAP_CS2A_PHYS OMAP_CS2_PHYS
  59. #define OMAP_CS2A_SIZE SZ_32M
  60. #define OMAP_CS2B_PHYS (OMAP_CS2A_PHYS + OMAP_CS2A_SIZE)
  61. #define OMAP_CS2B_SIZE SZ_32M
  62. #define OMAP_CS3_PHYS 0x0c000000
  63. #define OMAP_CS3_SIZE SZ_64M
  64. #ifndef __ASSEMBLER__
  65. /* EMIF Slow Interface Configuration Register */
  66. #define OMAP_EMIFS_CONFIG_REG __REG32(EMIFS_CONFIG)
  67. #define OMAP_EMIFS_CONFIG_FR (1 << 4)
  68. #define OMAP_EMIFS_CONFIG_PDE (1 << 3)
  69. #define OMAP_EMIFS_CONFIG_PWD_EN (1 << 2)
  70. #define OMAP_EMIFS_CONFIG_BM (1 << 1)
  71. #define OMAP_EMIFS_CONFIG_WP (1 << 0)
  72. #define EMIFS_CCS(n) __REG32(EMIFS_CS0_CONFIG + (4 * (n)))
  73. #define EMIFS_ACS(n) __REG32(EMIFS_ACS0 + (4 * (n)))
  74. /* Almost all documentation for chip and board memory maps assumes
  75.  * BM is clear.  Most devel boards have a switch to control booting
  76.  * from NOR flash (using external chipselect 3) rather than mask ROM,
  77.  * which uses BM to interchange the physical CS0 and CS3 addresses.
  78.  */
  79. static inline u32 omap_cs0_phys(void)
  80. {
  81. return (OMAP_EMIFS_CONFIG_REG & OMAP_EMIFS_CONFIG_BM)
  82. ?  OMAP_CS3_PHYS : 0;
  83. }
  84. static inline u32 omap_cs3_phys(void)
  85. {
  86. return (OMAP_EMIFS_CONFIG_REG & OMAP_EMIFS_CONFIG_BM)
  87. ? 0 : OMAP_CS3_PHYS;
  88. }
  89. #endif /* __ASSEMBLER__ */
  90. #endif /* __ASM_ARCH_TC_H */