exynos-bus.txt 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409
  1. * Generic Exynos Bus frequency device
  2. The Samsung Exynos SoC has many buses for data transfer between DRAM
  3. and sub-blocks in SoC. Most Exynos SoCs share the common architecture
  4. for buses. Generally, each bus of Exynos SoC includes a source clock
  5. and a power line, which are able to change the clock frequency
  6. of the bus in runtime. To monitor the usage of each bus in runtime,
  7. the driver uses the PPMU (Platform Performance Monitoring Unit), which
  8. is able to measure the current load of sub-blocks.
  9. The Exynos SoC includes the various sub-blocks which have the each AXI bus.
  10. The each AXI bus has the owned source clock but, has not the only owned
  11. power line. The power line might be shared among one more sub-blocks.
  12. So, we can divide into two type of device as the role of each sub-block.
  13. There are two type of bus devices as following:
  14. - parent bus device
  15. - passive bus device
  16. Basically, parent and passive bus device share the same power line.
  17. The parent bus device can only change the voltage of shared power line
  18. and the rest bus devices (passive bus device) depend on the decision of
  19. the parent bus device. If there are three blocks which share the VDD_xxx
  20. power line, Only one block should be parent device and then the rest blocks
  21. should depend on the parent device as passive device.
  22. VDD_xxx |--- A block (parent)
  23. |--- B block (passive)
  24. |--- C block (passive)
  25. There are a little different composition among Exynos SoC because each Exynos
  26. SoC has different sub-blocks. Therefore, such difference should be specified
  27. in devicetree file instead of each device driver. In result, this driver
  28. is able to support the bus frequency for all Exynos SoCs.
  29. Required properties for all bus devices:
  30. - compatible: Should be "samsung,exynos-bus".
  31. - clock-names : the name of clock used by the bus, "bus".
  32. - clocks : phandles for clock specified in "clock-names" property.
  33. - operating-points-v2: the OPP table including frequency/voltage information
  34. to support DVFS (Dynamic Voltage/Frequency Scaling) feature.
  35. Required properties only for parent bus device:
  36. - vdd-supply: the regulator to provide the buses with the voltage.
  37. - devfreq-events: the devfreq-event device to monitor the current utilization
  38. of buses.
  39. Required properties only for passive bus device:
  40. - devfreq: the parent bus device.
  41. Optional properties only for parent bus device:
  42. - exynos,saturation-ratio: the percentage value which is used to calibrate
  43. the performance count against total cycle count.
  44. - exynos,voltage-tolerance: the percentage value for bus voltage tolerance
  45. which is used to calculate the max voltage.
  46. Detailed correlation between sub-blocks and power line according to Exynos SoC:
  47. - In case of Exynos3250, there are two power line as following:
  48. VDD_MIF |--- DMC
  49. VDD_INT |--- LEFTBUS (parent device)
  50. |--- PERIL
  51. |--- MFC
  52. |--- G3D
  53. |--- RIGHTBUS
  54. |--- PERIR
  55. |--- FSYS
  56. |--- LCD0
  57. |--- PERIR
  58. |--- ISP
  59. |--- CAM
  60. - In case of Exynos4210, there is one power line as following:
  61. VDD_INT |--- DMC (parent device)
  62. |--- LEFTBUS
  63. |--- PERIL
  64. |--- MFC(L)
  65. |--- G3D
  66. |--- TV
  67. |--- LCD0
  68. |--- RIGHTBUS
  69. |--- PERIR
  70. |--- MFC(R)
  71. |--- CAM
  72. |--- FSYS
  73. |--- GPS
  74. |--- LCD0
  75. |--- LCD1
  76. - In case of Exynos4x12, there are two power line as following:
  77. VDD_MIF |--- DMC
  78. VDD_INT |--- LEFTBUS (parent device)
  79. |--- PERIL
  80. |--- MFC(L)
  81. |--- G3D
  82. |--- TV
  83. |--- IMAGE
  84. |--- RIGHTBUS
  85. |--- PERIR
  86. |--- MFC(R)
  87. |--- CAM
  88. |--- FSYS
  89. |--- GPS
  90. |--- LCD0
  91. |--- ISP
  92. - In case of Exynos5422, there are two power line as following:
  93. VDD_MIF |--- DREX 0 (parent device, DRAM EXpress controller)
  94. |--- DREX 1
  95. VDD_INT |--- NoC_Core (parent device)
  96. |--- G2D
  97. |--- G3D
  98. |--- DISP1
  99. |--- NoC_WCORE
  100. |--- GSCL
  101. |--- MSCL
  102. |--- ISP
  103. |--- MFC
  104. |--- GEN
  105. |--- PERIS
  106. |--- PERIC
  107. |--- FSYS
  108. |--- FSYS2
  109. Example1:
  110. Show the AXI buses of Exynos3250 SoC. Exynos3250 divides the buses to
  111. power line (regulator). The MIF (Memory Interface) AXI bus is used to
  112. transfer data between DRAM and CPU and uses the VDD_MIF regulator.
  113. - MIF (Memory Interface) block
  114. : VDD_MIF |--- DMC (Dynamic Memory Controller)
  115. - INT (Internal) block
  116. : VDD_INT |--- LEFTBUS (parent device)
  117. |--- PERIL
  118. |--- MFC
  119. |--- G3D
  120. |--- RIGHTBUS
  121. |--- FSYS
  122. |--- LCD0
  123. |--- PERIR
  124. |--- ISP
  125. |--- CAM
  126. - MIF bus's frequency/voltage table
  127. -----------------------
  128. |Lv| Freq | Voltage |
  129. -----------------------
  130. |L1| 50000 |800000 |
  131. |L2| 100000 |800000 |
  132. |L3| 134000 |800000 |
  133. |L4| 200000 |825000 |
  134. |L5| 400000 |875000 |
  135. -----------------------
  136. - INT bus's frequency/voltage table
  137. ----------------------------------------------------------
  138. |Block|LEFTBUS|RIGHTBUS|MCUISP |ISP |PERIL ||VDD_INT |
  139. | name| |LCD0 | | | || |
  140. | | |FSYS | | | || |
  141. | | |MFC | | | || |
  142. ----------------------------------------------------------
  143. |Mode |*parent|passive |passive|passive|passive|| |
  144. ----------------------------------------------------------
  145. |Lv |Frequency ||Voltage |
  146. ----------------------------------------------------------
  147. |L1 |50000 |50000 |50000 |50000 |50000 ||900000 |
  148. |L2 |80000 |80000 |80000 |80000 |80000 ||900000 |
  149. |L3 |100000 |100000 |100000 |100000 |100000 ||1000000 |
  150. |L4 |134000 |134000 |200000 |200000 | ||1000000 |
  151. |L5 |200000 |200000 |400000 |300000 | ||1000000 |
  152. ----------------------------------------------------------
  153. Example2 :
  154. The bus of DMC (Dynamic Memory Controller) block in exynos3250.dtsi
  155. is listed below:
  156. bus_dmc: bus_dmc {
  157. compatible = "samsung,exynos-bus";
  158. clocks = <&cmu_dmc CLK_DIV_DMC>;
  159. clock-names = "bus";
  160. operating-points-v2 = <&bus_dmc_opp_table>;
  161. status = "disabled";
  162. };
  163. bus_dmc_opp_table: opp_table1 {
  164. compatible = "operating-points-v2";
  165. opp-shared;
  166. opp@50000000 {
  167. opp-hz = /bits/ 64 <50000000>;
  168. opp-microvolt = <800000>;
  169. };
  170. opp@100000000 {
  171. opp-hz = /bits/ 64 <100000000>;
  172. opp-microvolt = <800000>;
  173. };
  174. opp@134000000 {
  175. opp-hz = /bits/ 64 <134000000>;
  176. opp-microvolt = <800000>;
  177. };
  178. opp@200000000 {
  179. opp-hz = /bits/ 64 <200000000>;
  180. opp-microvolt = <825000>;
  181. };
  182. opp@400000000 {
  183. opp-hz = /bits/ 64 <400000000>;
  184. opp-microvolt = <875000>;
  185. };
  186. };
  187. bus_leftbus: bus_leftbus {
  188. compatible = "samsung,exynos-bus";
  189. clocks = <&cmu CLK_DIV_GDL>;
  190. clock-names = "bus";
  191. operating-points-v2 = <&bus_leftbus_opp_table>;
  192. status = "disabled";
  193. };
  194. bus_rightbus: bus_rightbus {
  195. compatible = "samsung,exynos-bus";
  196. clocks = <&cmu CLK_DIV_GDR>;
  197. clock-names = "bus";
  198. operating-points-v2 = <&bus_leftbus_opp_table>;
  199. status = "disabled";
  200. };
  201. bus_lcd0: bus_lcd0 {
  202. compatible = "samsung,exynos-bus";
  203. clocks = <&cmu CLK_DIV_ACLK_160>;
  204. clock-names = "bus";
  205. operating-points-v2 = <&bus_leftbus_opp_table>;
  206. status = "disabled";
  207. };
  208. bus_fsys: bus_fsys {
  209. compatible = "samsung,exynos-bus";
  210. clocks = <&cmu CLK_DIV_ACLK_200>;
  211. clock-names = "bus";
  212. operating-points-v2 = <&bus_leftbus_opp_table>;
  213. status = "disabled";
  214. };
  215. bus_mcuisp: bus_mcuisp {
  216. compatible = "samsung,exynos-bus";
  217. clocks = <&cmu CLK_DIV_ACLK_400_MCUISP>;
  218. clock-names = "bus";
  219. operating-points-v2 = <&bus_mcuisp_opp_table>;
  220. status = "disabled";
  221. };
  222. bus_isp: bus_isp {
  223. compatible = "samsung,exynos-bus";
  224. clocks = <&cmu CLK_DIV_ACLK_266>;
  225. clock-names = "bus";
  226. operating-points-v2 = <&bus_isp_opp_table>;
  227. status = "disabled";
  228. };
  229. bus_peril: bus_peril {
  230. compatible = "samsung,exynos-bus";
  231. clocks = <&cmu CLK_DIV_ACLK_100>;
  232. clock-names = "bus";
  233. operating-points-v2 = <&bus_peril_opp_table>;
  234. status = "disabled";
  235. };
  236. bus_mfc: bus_mfc {
  237. compatible = "samsung,exynos-bus";
  238. clocks = <&cmu CLK_SCLK_MFC>;
  239. clock-names = "bus";
  240. operating-points-v2 = <&bus_leftbus_opp_table>;
  241. status = "disabled";
  242. };
  243. bus_leftbus_opp_table: opp_table1 {
  244. compatible = "operating-points-v2";
  245. opp-shared;
  246. opp@50000000 {
  247. opp-hz = /bits/ 64 <50000000>;
  248. opp-microvolt = <900000>;
  249. };
  250. opp@80000000 {
  251. opp-hz = /bits/ 64 <80000000>;
  252. opp-microvolt = <900000>;
  253. };
  254. opp@100000000 {
  255. opp-hz = /bits/ 64 <100000000>;
  256. opp-microvolt = <1000000>;
  257. };
  258. opp@134000000 {
  259. opp-hz = /bits/ 64 <134000000>;
  260. opp-microvolt = <1000000>;
  261. };
  262. opp@200000000 {
  263. opp-hz = /bits/ 64 <200000000>;
  264. opp-microvolt = <1000000>;
  265. };
  266. };
  267. bus_mcuisp_opp_table: opp_table2 {
  268. compatible = "operating-points-v2";
  269. opp-shared;
  270. opp@50000000 {
  271. opp-hz = /bits/ 64 <50000000>;
  272. };
  273. opp@80000000 {
  274. opp-hz = /bits/ 64 <80000000>;
  275. };
  276. opp@100000000 {
  277. opp-hz = /bits/ 64 <100000000>;
  278. };
  279. opp@200000000 {
  280. opp-hz = /bits/ 64 <200000000>;
  281. };
  282. opp@400000000 {
  283. opp-hz = /bits/ 64 <400000000>;
  284. };
  285. };
  286. bus_isp_opp_table: opp_table3 {
  287. compatible = "operating-points-v2";
  288. opp-shared;
  289. opp@50000000 {
  290. opp-hz = /bits/ 64 <50000000>;
  291. };
  292. opp@80000000 {
  293. opp-hz = /bits/ 64 <80000000>;
  294. };
  295. opp@100000000 {
  296. opp-hz = /bits/ 64 <100000000>;
  297. };
  298. opp@200000000 {
  299. opp-hz = /bits/ 64 <200000000>;
  300. };
  301. opp@300000000 {
  302. opp-hz = /bits/ 64 <300000000>;
  303. };
  304. };
  305. bus_peril_opp_table: opp_table4 {
  306. compatible = "operating-points-v2";
  307. opp-shared;
  308. opp@50000000 {
  309. opp-hz = /bits/ 64 <50000000>;
  310. };
  311. opp@80000000 {
  312. opp-hz = /bits/ 64 <80000000>;
  313. };
  314. opp@100000000 {
  315. opp-hz = /bits/ 64 <100000000>;
  316. };
  317. };
  318. Usage case to handle the frequency and voltage of bus on runtime
  319. in exynos3250-rinato.dts is listed below:
  320. &bus_dmc {
  321. devfreq-events = <&ppmu_dmc0_3>, <&ppmu_dmc1_3>;
  322. vdd-supply = <&buck1_reg>; /* VDD_MIF */
  323. status = "okay";
  324. };
  325. &bus_leftbus {
  326. devfreq-events = <&ppmu_leftbus_3>, <&ppmu_rightbus_3>;
  327. vdd-supply = <&buck3_reg>;
  328. status = "okay";
  329. };
  330. &bus_rightbus {
  331. devfreq = <&bus_leftbus>;
  332. status = "okay";
  333. };
  334. &bus_lcd0 {
  335. devfreq = <&bus_leftbus>;
  336. status = "okay";
  337. };
  338. &bus_fsys {
  339. devfreq = <&bus_leftbus>;
  340. status = "okay";
  341. };
  342. &bus_mcuisp {
  343. devfreq = <&bus_leftbus>;
  344. status = "okay";
  345. };
  346. &bus_isp {
  347. devfreq = <&bus_leftbus>;
  348. status = "okay";
  349. };
  350. &bus_peril {
  351. devfreq = <&bus_leftbus>;
  352. status = "okay";
  353. };
  354. &bus_mfc {
  355. devfreq = <&bus_leftbus>;
  356. status = "okay";
  357. };