dcgu.h 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. /*
  2. * (C) Copyright 2009 Stefan Roese <sr@denx.de>, DENX Software Engineering
  3. *
  4. * Copyright (C) 2006 Micronas GmbH
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License as
  8. * published by the Free Software Foundation; either version 2 of
  9. * the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  19. * MA 02111-1307 USA
  20. */
  21. #ifndef _DCGU_H
  22. #define _DCGU_H
  23. enum dcgu_switch {
  24. DCGU_SWITCH_OFF, /* Switch off */
  25. DCGU_SWITCH_ON /* Switch on */
  26. };
  27. enum dcgu_hw_module {
  28. DCGU_HW_MODULE_DCGU, /* Selects digital clock gen. unit */
  29. DCGU_HW_MODULE_MIC32_SCI, /* Selects MIC32 SoC interface */
  30. DCGU_HW_MODULE_SCI, /* Selects SCI target agent port modules*/
  31. DCGU_HW_MODULE_MR1, /* Selects first MPEG reader module */
  32. DCGU_HW_MODULE_MR2, /* Selects second MPEG reader module */
  33. DCGU_HW_MODULE_MVD, /* Selects MPEG video decoder module */
  34. DCGU_HW_MODULE_DVP, /* Selects dig video processing module */
  35. DCGU_HW_MODULE_CVE, /* Selects color video encoder module */
  36. DCGU_HW_MODULE_VID_ENC, /* Selects video encoder module */
  37. DCGU_HW_MODULE_SSI_S, /* Selects slave sync serial interface */
  38. DCGU_HW_MODULE_SSI_M, /* Selects master sync serial interface */
  39. DCGU_HW_MODULE_GA, /* Selects graphics accelerator module */
  40. DCGU_HW_MODULE_DGPU, /* Selects digital graphics processing */
  41. DCGU_HW_MODULE_UART_1, /* Selects first UART module */
  42. DCGU_HW_MODULE_UART_2, /* Selects second UART module */
  43. DCGU_HW_MODULE_AD, /* Selects audio decoder module */
  44. DCGU_HW_MODULE_ABP_DTV, /* Selects audio baseband processing */
  45. DCGU_HW_MODULE_ABP_SCC, /* Selects audio base band processor SCC*/
  46. DCGU_HW_MODULE_SPDIF, /* Selects sony philips digital interf. */
  47. DCGU_HW_MODULE_TSIO, /* Selects trasnport stream input/output*/
  48. DCGU_HW_MODULE_TSD, /* Selects trasnport stream decoder */
  49. DCGU_HW_MODULE_TSD_KEY, /* Selects trasnport stream decoder key */
  50. DCGU_HW_MODULE_USBH, /* Selects USB hub module */
  51. DCGU_HW_MODULE_USB_PLL, /* Selects USB phase locked loop module */
  52. DCGU_HW_MODULE_USB_60, /* Selects USB 60 module */
  53. DCGU_HW_MODULE_USB_24, /* Selects USB 24 module */
  54. DCGU_HW_MODULE_PERI, /* Selects all mod connected to clkperi20*/
  55. DCGU_HW_MODULE_WDT, /* Selects wtg timer mod con to clkperi20*/
  56. DCGU_HW_MODULE_I2C1, /* Selects first I2C mod con to clkperi20*/
  57. DCGU_HW_MODULE_I2C2, /* Selects 2nd I2C mod con to clkperi20 */
  58. DCGU_HW_MODULE_GPIO1, /* Selects gpio module 1 */
  59. DCGU_HW_MODULE_GPIO2, /* Selects gpio module 2 */
  60. DCGU_HW_MODULE_GPT, /* Selects gpt mod connected to clkperi20*/
  61. DCGU_HW_MODULE_PWM, /* Selects pwm mod connected to clkperi20*/
  62. DCGU_HW_MODULE_MPC, /* Selects multi purpose cipher module */
  63. DCGU_HW_MODULE_MPC_KEY, /* Selects multi purpose cipher key */
  64. DCGU_HW_MODULE_COM, /* Selects COM unit module */
  65. DCGU_HW_MODULE_VCTY_CORE, /* Selects VCT-Y core module */
  66. DCGU_HW_MODULE_FWSRAM, /* Selects firmware SRAM module */
  67. DCGU_HW_MODULE_EBI, /* Selects external bus interface module*/
  68. DCGU_HW_MODULE_I2S, /* Selects integrated interchip sound */
  69. DCGU_HW_MODULE_MSMC, /* Selects memory stick and mmc module */
  70. DCGU_HW_MODULE_SMC, /* Selects smartcard interface module */
  71. DCGU_HW_MODULE_IRQC, /* Selects interrupt C module */
  72. DCGU_HW_MODULE_TOP, /* Selects top level pinmux module */
  73. DCGU_HW_MODULE_SRAM, /* Selects SRAM module */
  74. DCGU_HW_MODULE_EIC, /* Selects External Interrupt controller*/
  75. DCGU_HW_MODULE_CPU, /* Selects CPU subsystem module */
  76. DCGU_HW_MODULE_SCC, /* Selects SCC module */
  77. DCGU_HW_MODULE_MM, /* Selects Memory Manager module */
  78. DCGU_HW_MODULE_BCU, /* Selects Buffer Configuration Unit */
  79. DCGU_HW_MODULE_FH, /* Selects FIFO Handler module */
  80. DCGU_HW_MODULE_IMU, /* Selects Interrupt Management Unit */
  81. DCGU_HW_MODULE_MDU, /* Selects MCI Debug Unit module */
  82. DCGU_HW_MODULE_SI2OCP /* Selects Standard Interface to OCP bridge*/
  83. };
  84. union dcgu_clk_en1 {
  85. u32 reg;
  86. struct {
  87. u32 res1:8; /* reserved */
  88. u32 en_clkmsmc:1; /* Enable bit for clkmsmc (#) */
  89. u32 en_clkssi_s:1; /* Enable bit for clkssi_s (#) */
  90. u32 en_clkssi_m:1; /* Enable bit for clkssi_m (#) */
  91. u32 en_clksmc:1; /* Enable bit for clksmc (#) */
  92. u32 en_clkebi:1; /* Enable bit for clkebi (#) */
  93. u32 en_usbpll:1; /* Enable bit for the USB PLL */
  94. u32 en_clkusb60:1; /* Enable bit for clkusb60 (#) */
  95. u32 en_clkusb24:1; /* Enable bit for clkusb24 (#) */
  96. u32 en_clkuart2:1; /* Enable bit for clkuart2 (#) */
  97. u32 en_clkuart1:1; /* Enable bit for clkuart1 (#) */
  98. u32 en_clkperi20:1; /* Enable bit for clkperi20 (#) */
  99. u32 res2:3; /* reserved */
  100. u32 en_clk_i2s_dly:1; /* Enable bit for clk_scc_abp */
  101. u32 en_clk_scc_abp:1; /* Enable bit for clk_scc_abp */
  102. u32 en_clk_dtv_spdo:1; /* Enable bit for clk_dtv_spdo */
  103. u32 en_clkad:1; /* Enable bit for clkad (#) */
  104. u32 en_clkmvd:1; /* Enable bit for clkmvd (#) */
  105. u32 en_clktsd:1; /* Enable bit for clktsd (#) */
  106. u32 en_clkga:1; /* Enable bit for clkga (#) */
  107. u32 en_clkdvp:1; /* Enable bit for clkdvp (#) */
  108. u32 en_clkmr2:1; /* Enable bit for clkmr2 (#) */
  109. u32 en_clkmr1:1; /* Enable bit for clkmr1 (#) */
  110. } bits;
  111. };
  112. union dcgu_clk_en2 {
  113. u32 reg;
  114. struct {
  115. u32 res1:31; /* reserved */
  116. u32 en_clkcpu:1; /* Enable bit for clkcpu */
  117. } bits;
  118. };
  119. union dcgu_reset_unit1 {
  120. u32 reg;
  121. struct {
  122. u32 res1:1;
  123. u32 swreset_clkmsmc:1;
  124. u32 swreset_clkssi_s:1;
  125. u32 swreset_clkssi_m:1;
  126. u32 swreset_clksmc:1;
  127. u32 swreset_clkebi:1;
  128. u32 swreset_clkusb60:1;
  129. u32 swreset_clkusb24:1;
  130. u32 swreset_clkuart2:1;
  131. u32 swreset_clkuart1:1;
  132. u32 swreset_pwm:1;
  133. u32 swreset_gpt:1;
  134. u32 swreset_i2c2:1;
  135. u32 swreset_i2c1:1;
  136. u32 swreset_gpio2:1;
  137. u32 swreset_gpio1:1;
  138. u32 swreset_clkcpu:1;
  139. u32 res2:2;
  140. u32 swreset_clk_i2s_dly:1;
  141. u32 swreset_clk_scc_abp:1;
  142. u32 swreset_clk_dtv_spdo:1;
  143. u32 swreset_clkad:1;
  144. u32 swreset_clkmvd:1;
  145. u32 swreset_clktsd:1;
  146. u32 swreset_clktsio:1;
  147. u32 swreset_clkga:1;
  148. u32 swreset_clkmpc:1;
  149. u32 swreset_clkcve:1;
  150. u32 swreset_clkdvp:1;
  151. u32 swreset_clkmr2:1;
  152. u32 swreset_clkmr1:1;
  153. } bits;
  154. };
  155. int dcgu_set_clk_switch(enum dcgu_hw_module module, enum dcgu_switch setup);
  156. int dcgu_set_reset_switch(enum dcgu_hw_module module, enum dcgu_switch setup);
  157. #endif /* _DCGU_H */