kendryte-k210.dtsi 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. // Source: https://github.com/torvalds/linux/blob/master/arch/riscv/boot/dts/kendryte/k210.dtsi
  2. // SPDX-License-Identifier: GPL-2.0+
  3. /*
  4. * Copyright (C) 2019 Sean Anderson <[email protected]>
  5. * Copyright (C) 2020 Western Digital Corporation or its affiliates.
  6. */
  7. /*
  8. #define K210_CLK_PLL0 0
  9. #define K210_CLK_PLL1 0
  10. #define K210_CLK_ACLK 0
  11. #define K210_CLK_CPU 0
  12. */
  13. // todo: generate clock speed in sbi binary
  14. / {
  15. /*
  16. * Although the K210 is a 64-bit CPU, the address bus is only 32-bits
  17. * wide, and the upper half of all addresses is ignored.
  18. */
  19. #address-cells = <1>;
  20. #size-cells = <1>;
  21. compatible = "kendryte,k210";
  22. aliases {
  23. serial0 = &uarths0;
  24. };
  25. /*
  26. * The K210 has an sv39 MMU following the priviledge specification v1.9.
  27. * Since this is a non-ratified draft specification, the kernel does not
  28. * support it and the K210 support enabled only for the !MMU case.
  29. * Be consistent with this by setting the CPUs MMU type to "none".
  30. */
  31. /* No, I want to use mmu in my application -- luojia65 */
  32. cpus {
  33. #address-cells = <1>;
  34. #size-cells = <0>;
  35. timebase-frequency = <7800000>;
  36. cpu0: cpu@0 {
  37. device_type = "cpu";
  38. reg = <0>;
  39. compatible = "kendryte,k210", "sifive,rocket0", "riscv";
  40. riscv,isa = "rv64imafdc";
  41. mmu-type = "none";
  42. i-cache-size = <0x8000>;
  43. i-cache-block-size = <64>;
  44. d-cache-size = <0x8000>;
  45. d-cache-block-size = <64>;
  46. clocks = <&sysctl K210_CLK_CPU>;
  47. clock-frequency = <390000000>;
  48. cpu0_intc: interrupt-controller {
  49. #interrupt-cells = <1>;
  50. interrupt-controller;
  51. compatible = "riscv,cpu-intc";
  52. };
  53. };
  54. cpu1: cpu@1 {
  55. device_type = "cpu";
  56. reg = <1>;
  57. compatible = "kendryte,k210", "sifive,rocket0", "riscv";
  58. riscv,isa = "rv64imafdc";
  59. mmu-type = "none";
  60. i-cache-size = <0x8000>;
  61. i-cache-block-size = <64>;
  62. d-cache-size = <0x8000>;
  63. d-cache-block-size = <64>;
  64. clocks = <&sysctl K210_CLK_CPU>;
  65. clock-frequency = <390000000>;
  66. cpu1_intc: interrupt-controller {
  67. #interrupt-cells = <1>;
  68. interrupt-controller;
  69. compatible = "riscv,cpu-intc";
  70. };
  71. };
  72. };
  73. sram: memory@80000000 {
  74. device_type = "memory";
  75. reg = <0x80000000 0x400000>,
  76. <0x80400000 0x200000>,
  77. <0x80600000 0x200000>;
  78. reg-names = "sram0", "sram1", "aisram";
  79. };
  80. clocks {
  81. in0: oscillator {
  82. compatible = "fixed-clock";
  83. #clock-cells = <0>;
  84. clock-frequency = <26000000>;
  85. };
  86. };
  87. soc {
  88. #address-cells = <1>;
  89. #size-cells = <1>;
  90. compatible = "kendryte,k210-soc", "simple-bus";
  91. ranges;
  92. interrupt-parent = <&plic0>;
  93. sysctl: sysctl@50440000 {
  94. compatible = "kendryte,k210-sysctl", "simple-mfd";
  95. reg = <0x50440000 0x1000>;
  96. #clock-cells = <1>;
  97. };
  98. clint0: interrupt-controller@2000000 {
  99. compatible = "riscv,clint0";
  100. reg = <0x2000000 0xC000>;
  101. interrupts-extended = <&cpu0_intc 3>, <&cpu1_intc 3>;
  102. clocks = <&sysctl K210_CLK_ACLK>;
  103. };
  104. plic0: interrupt-controller@c000000 {
  105. #interrupt-cells = <1>;
  106. interrupt-controller;
  107. compatible = "kendryte,k210-plic0", "riscv,plic0";
  108. reg = <0xC000000 0x4000000>;
  109. interrupts-extended = <&cpu0_intc 11>, <&cpu0_intc 0xffffffff>,
  110. <&cpu1_intc 11>, <&cpu1_intc 0xffffffff>;
  111. riscv,ndev = <65>;
  112. riscv,max-priority = <7>;
  113. };
  114. uarths0: serial@38000000 {
  115. compatible = "kendryte,k210-uarths", "sifive,uart0";
  116. reg = <0x38000000 0x1000>;
  117. interrupts = <33>;
  118. clocks = <&sysctl K210_CLK_CPU>;
  119. };
  120. // todo: other peripherals -- luojia65
  121. };
  122. };