exynos-bus.txt 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423
  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. - In case of Exynos5433, there is VDD_INT power line as following:
  110. VDD_INT |--- G2D (parent device)
  111. |--- MSCL
  112. |--- GSCL
  113. |--- JPEG
  114. |--- MFC
  115. |--- HEVC
  116. |--- BUS0
  117. |--- BUS1
  118. |--- BUS2
  119. |--- PERIS (Fixed clock rate)
  120. |--- PERIC (Fixed clock rate)
  121. |--- FSYS (Fixed clock rate)
  122. Example1:
  123. Show the AXI buses of Exynos3250 SoC. Exynos3250 divides the buses to
  124. power line (regulator). The MIF (Memory Interface) AXI bus is used to
  125. transfer data between DRAM and CPU and uses the VDD_MIF regulator.
  126. - MIF (Memory Interface) block
  127. : VDD_MIF |--- DMC (Dynamic Memory Controller)
  128. - INT (Internal) block
  129. : VDD_INT |--- LEFTBUS (parent device)
  130. |--- PERIL
  131. |--- MFC
  132. |--- G3D
  133. |--- RIGHTBUS
  134. |--- FSYS
  135. |--- LCD0
  136. |--- PERIR
  137. |--- ISP
  138. |--- CAM
  139. - MIF bus's frequency/voltage table
  140. -----------------------
  141. |Lv| Freq | Voltage |
  142. -----------------------
  143. |L1| 50000 |800000 |
  144. |L2| 100000 |800000 |
  145. |L3| 134000 |800000 |
  146. |L4| 200000 |825000 |
  147. |L5| 400000 |875000 |
  148. -----------------------
  149. - INT bus's frequency/voltage table
  150. ----------------------------------------------------------
  151. |Block|LEFTBUS|RIGHTBUS|MCUISP |ISP |PERIL ||VDD_INT |
  152. | name| |LCD0 | | | || |
  153. | | |FSYS | | | || |
  154. | | |MFC | | | || |
  155. ----------------------------------------------------------
  156. |Mode |*parent|passive |passive|passive|passive|| |
  157. ----------------------------------------------------------
  158. |Lv |Frequency ||Voltage |
  159. ----------------------------------------------------------
  160. |L1 |50000 |50000 |50000 |50000 |50000 ||900000 |
  161. |L2 |80000 |80000 |80000 |80000 |80000 ||900000 |
  162. |L3 |100000 |100000 |100000 |100000 |100000 ||1000000 |
  163. |L4 |134000 |134000 |200000 |200000 | ||1000000 |
  164. |L5 |200000 |200000 |400000 |300000 | ||1000000 |
  165. ----------------------------------------------------------
  166. Example2 :
  167. The bus of DMC (Dynamic Memory Controller) block in exynos3250.dtsi
  168. is listed below:
  169. bus_dmc: bus_dmc {
  170. compatible = "samsung,exynos-bus";
  171. clocks = <&cmu_dmc CLK_DIV_DMC>;
  172. clock-names = "bus";
  173. operating-points-v2 = <&bus_dmc_opp_table>;
  174. status = "disabled";
  175. };
  176. bus_dmc_opp_table: opp_table1 {
  177. compatible = "operating-points-v2";
  178. opp-shared;
  179. opp-50000000 {
  180. opp-hz = /bits/ 64 <50000000>;
  181. opp-microvolt = <800000>;
  182. };
  183. opp-100000000 {
  184. opp-hz = /bits/ 64 <100000000>;
  185. opp-microvolt = <800000>;
  186. };
  187. opp-134000000 {
  188. opp-hz = /bits/ 64 <134000000>;
  189. opp-microvolt = <800000>;
  190. };
  191. opp-200000000 {
  192. opp-hz = /bits/ 64 <200000000>;
  193. opp-microvolt = <825000>;
  194. };
  195. opp-400000000 {
  196. opp-hz = /bits/ 64 <400000000>;
  197. opp-microvolt = <875000>;
  198. };
  199. };
  200. bus_leftbus: bus_leftbus {
  201. compatible = "samsung,exynos-bus";
  202. clocks = <&cmu CLK_DIV_GDL>;
  203. clock-names = "bus";
  204. operating-points-v2 = <&bus_leftbus_opp_table>;
  205. status = "disabled";
  206. };
  207. bus_rightbus: bus_rightbus {
  208. compatible = "samsung,exynos-bus";
  209. clocks = <&cmu CLK_DIV_GDR>;
  210. clock-names = "bus";
  211. operating-points-v2 = <&bus_leftbus_opp_table>;
  212. status = "disabled";
  213. };
  214. bus_lcd0: bus_lcd0 {
  215. compatible = "samsung,exynos-bus";
  216. clocks = <&cmu CLK_DIV_ACLK_160>;
  217. clock-names = "bus";
  218. operating-points-v2 = <&bus_leftbus_opp_table>;
  219. status = "disabled";
  220. };
  221. bus_fsys: bus_fsys {
  222. compatible = "samsung,exynos-bus";
  223. clocks = <&cmu CLK_DIV_ACLK_200>;
  224. clock-names = "bus";
  225. operating-points-v2 = <&bus_leftbus_opp_table>;
  226. status = "disabled";
  227. };
  228. bus_mcuisp: bus_mcuisp {
  229. compatible = "samsung,exynos-bus";
  230. clocks = <&cmu CLK_DIV_ACLK_400_MCUISP>;
  231. clock-names = "bus";
  232. operating-points-v2 = <&bus_mcuisp_opp_table>;
  233. status = "disabled";
  234. };
  235. bus_isp: bus_isp {
  236. compatible = "samsung,exynos-bus";
  237. clocks = <&cmu CLK_DIV_ACLK_266>;
  238. clock-names = "bus";
  239. operating-points-v2 = <&bus_isp_opp_table>;
  240. status = "disabled";
  241. };
  242. bus_peril: bus_peril {
  243. compatible = "samsung,exynos-bus";
  244. clocks = <&cmu CLK_DIV_ACLK_100>;
  245. clock-names = "bus";
  246. operating-points-v2 = <&bus_peril_opp_table>;
  247. status = "disabled";
  248. };
  249. bus_mfc: bus_mfc {
  250. compatible = "samsung,exynos-bus";
  251. clocks = <&cmu CLK_SCLK_MFC>;
  252. clock-names = "bus";
  253. operating-points-v2 = <&bus_leftbus_opp_table>;
  254. status = "disabled";
  255. };
  256. bus_leftbus_opp_table: opp_table1 {
  257. compatible = "operating-points-v2";
  258. opp-shared;
  259. opp-50000000 {
  260. opp-hz = /bits/ 64 <50000000>;
  261. opp-microvolt = <900000>;
  262. };
  263. opp-80000000 {
  264. opp-hz = /bits/ 64 <80000000>;
  265. opp-microvolt = <900000>;
  266. };
  267. opp-100000000 {
  268. opp-hz = /bits/ 64 <100000000>;
  269. opp-microvolt = <1000000>;
  270. };
  271. opp-134000000 {
  272. opp-hz = /bits/ 64 <134000000>;
  273. opp-microvolt = <1000000>;
  274. };
  275. opp-200000000 {
  276. opp-hz = /bits/ 64 <200000000>;
  277. opp-microvolt = <1000000>;
  278. };
  279. };
  280. bus_mcuisp_opp_table: opp_table2 {
  281. compatible = "operating-points-v2";
  282. opp-shared;
  283. opp-50000000 {
  284. opp-hz = /bits/ 64 <50000000>;
  285. };
  286. opp-80000000 {
  287. opp-hz = /bits/ 64 <80000000>;
  288. };
  289. opp-100000000 {
  290. opp-hz = /bits/ 64 <100000000>;
  291. };
  292. opp-200000000 {
  293. opp-hz = /bits/ 64 <200000000>;
  294. };
  295. opp-400000000 {
  296. opp-hz = /bits/ 64 <400000000>;
  297. };
  298. };
  299. bus_isp_opp_table: opp_table3 {
  300. compatible = "operating-points-v2";
  301. opp-shared;
  302. opp-50000000 {
  303. opp-hz = /bits/ 64 <50000000>;
  304. };
  305. opp-80000000 {
  306. opp-hz = /bits/ 64 <80000000>;
  307. };
  308. opp-100000000 {
  309. opp-hz = /bits/ 64 <100000000>;
  310. };
  311. opp-200000000 {
  312. opp-hz = /bits/ 64 <200000000>;
  313. };
  314. opp-300000000 {
  315. opp-hz = /bits/ 64 <300000000>;
  316. };
  317. };
  318. bus_peril_opp_table: opp_table4 {
  319. compatible = "operating-points-v2";
  320. opp-shared;
  321. opp-50000000 {
  322. opp-hz = /bits/ 64 <50000000>;
  323. };
  324. opp-80000000 {
  325. opp-hz = /bits/ 64 <80000000>;
  326. };
  327. opp-100000000 {
  328. opp-hz = /bits/ 64 <100000000>;
  329. };
  330. };
  331. Usage case to handle the frequency and voltage of bus on runtime
  332. in exynos3250-rinato.dts is listed below:
  333. &bus_dmc {
  334. devfreq-events = <&ppmu_dmc0_3>, <&ppmu_dmc1_3>;
  335. vdd-supply = <&buck1_reg>; /* VDD_MIF */
  336. status = "okay";
  337. };
  338. &bus_leftbus {
  339. devfreq-events = <&ppmu_leftbus_3>, <&ppmu_rightbus_3>;
  340. vdd-supply = <&buck3_reg>;
  341. status = "okay";
  342. };
  343. &bus_rightbus {
  344. devfreq = <&bus_leftbus>;
  345. status = "okay";
  346. };
  347. &bus_lcd0 {
  348. devfreq = <&bus_leftbus>;
  349. status = "okay";
  350. };
  351. &bus_fsys {
  352. devfreq = <&bus_leftbus>;
  353. status = "okay";
  354. };
  355. &bus_mcuisp {
  356. devfreq = <&bus_leftbus>;
  357. status = "okay";
  358. };
  359. &bus_isp {
  360. devfreq = <&bus_leftbus>;
  361. status = "okay";
  362. };
  363. &bus_peril {
  364. devfreq = <&bus_leftbus>;
  365. status = "okay";
  366. };
  367. &bus_mfc {
  368. devfreq = <&bus_leftbus>;
  369. status = "okay";
  370. };