0005-riscv-sifive-unleashed-define-opp-table-cpufreq.patch 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. From d3cf2859a056273400fbdf9d389b75750ff6ca5e Mon Sep 17 00:00:00 2001
  2. From: David Abdurachmanov <[email protected]>
  3. Date: Fri, 14 May 2021 05:27:51 -0700
  4. Subject: [PATCH 6/7] riscv: sifive: unleashed: define opp table (cpufreq)
  5. Source: https://github.com/sifive/riscv-linux/commits/dev/paulw/cpufreq-dt-aloe-v5.3-rc4
  6. Signed-off-by: David Abdurachmanov <[email protected]>
  7. ---
  8. arch/riscv/Kconfig | 8 +++++
  9. arch/riscv/boot/dts/sifive/fu540-c000.dtsi | 5 ++++
  10. .../riscv/boot/dts/sifive/hifive-unleashed-a00.dts | 34 ++++++++++++++++++++++
  11. 3 files changed, 47 insertions(+)
  12. --- a/arch/riscv/Kconfig
  13. +++ b/arch/riscv/Kconfig
  14. @@ -566,6 +566,14 @@ config BUILTIN_DTB
  15. depends on OF
  16. default y if XIP_KERNEL
  17. +menu "CPU Power Management"
  18. +
  19. +source "drivers/cpuidle/Kconfig"
  20. +
  21. +source "drivers/cpufreq/Kconfig"
  22. +
  23. +endmenu
  24. +
  25. menu "Power management options"
  26. source "kernel/power/Kconfig"
  27. --- a/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
  28. +++ b/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
  29. @@ -30,6 +30,7 @@
  30. i-cache-size = <16384>;
  31. reg = <0>;
  32. riscv,isa = "rv64imac";
  33. + clocks = <&prci PRCI_CLK_COREPLL>;
  34. status = "disabled";
  35. cpu0_intc: interrupt-controller {
  36. #interrupt-cells = <1>;
  37. @@ -54,6 +55,7 @@
  38. reg = <1>;
  39. riscv,isa = "rv64imafdc";
  40. tlb-split;
  41. + clocks = <&prci PRCI_CLK_COREPLL>;
  42. next-level-cache = <&l2cache>;
  43. cpu1_intc: interrupt-controller {
  44. #interrupt-cells = <1>;
  45. @@ -78,6 +80,7 @@
  46. reg = <2>;
  47. riscv,isa = "rv64imafdc";
  48. tlb-split;
  49. + clocks = <&prci PRCI_CLK_COREPLL>;
  50. next-level-cache = <&l2cache>;
  51. cpu2_intc: interrupt-controller {
  52. #interrupt-cells = <1>;
  53. @@ -102,6 +105,7 @@
  54. reg = <3>;
  55. riscv,isa = "rv64imafdc";
  56. tlb-split;
  57. + clocks = <&prci PRCI_CLK_COREPLL>;
  58. next-level-cache = <&l2cache>;
  59. cpu3_intc: interrupt-controller {
  60. #interrupt-cells = <1>;
  61. @@ -126,6 +130,7 @@
  62. reg = <4>;
  63. riscv,isa = "rv64imafdc";
  64. tlb-split;
  65. + clocks = <&prci PRCI_CLK_COREPLL>;
  66. next-level-cache = <&l2cache>;
  67. cpu4_intc: interrupt-controller {
  68. #interrupt-cells = <1>;
  69. --- a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
  70. +++ b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
  71. @@ -84,6 +84,40 @@
  72. label = "d4";
  73. };
  74. };
  75. +
  76. + fu540_c000_opp_table: opp-table {
  77. + compatible = "operating-points-v2";
  78. + opp-shared;
  79. +
  80. + opp-350000000 {
  81. + opp-hz = /bits/ 64 <350000000>;
  82. + };
  83. + opp-700000000 {
  84. + opp-hz = /bits/ 64 <700000000>;
  85. + };
  86. + opp-999999999 {
  87. + opp-hz = /bits/ 64 <999999999>;
  88. + };
  89. + opp-1400000000 {
  90. + opp-hz = /bits/ 64 <1400000000>;
  91. + };
  92. + };
  93. +};
  94. +
  95. +&cpu0 {
  96. + operating-points-v2 = <&fu540_c000_opp_table>;
  97. +};
  98. +&cpu1 {
  99. + operating-points-v2 = <&fu540_c000_opp_table>;
  100. +};
  101. +&cpu2 {
  102. + operating-points-v2 = <&fu540_c000_opp_table>;
  103. +};
  104. +&cpu3 {
  105. + operating-points-v2 = <&fu540_c000_opp_table>;
  106. +};
  107. +&cpu4 {
  108. + operating-points-v2 = <&fu540_c000_opp_table>;
  109. };
  110. &uart0 {