summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorDamien Le Moal <damien.lemoal@wdc.com>2019-01-14 07:00:37 +0300
committerAnup Patel <anup@brainfault.org>2019-01-21 07:28:33 +0300
commit868ad0b0e51a5e10e77c9bd380240b98d6a133be (patch)
treec40016917a1ae66b57d8e7b3b2080ed872ae639e /platform
parent58d9f2983a4a1ebdbe62f7d40e10ea3bc7d6bbaf (diff)
downloadopensbi-868ad0b0e51a5e10e77c9bd380240b98d6a133be.tar.xz
kendryte/k210: Add device tree support
The Kendryte k210 board initial loader does not provide a device tree for the firmware and subsequent payload. Add the k210.dts device tree description file to solve this. This file describes only the SoC core components: CPUs, memory and PLIC. Automatically compile and add this file to the firmware generated using the FW_PAYLOAD_FDT_PATH configuration parameter. Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Diffstat (limited to 'platform')
-rw-r--r--platform/kendryte/k210/config.mk1
-rw-r--r--platform/kendryte/k210/k210.dts70
-rw-r--r--platform/kendryte/k210/objects.mk1
3 files changed, 72 insertions, 0 deletions
diff --git a/platform/kendryte/k210/config.mk b/platform/kendryte/k210/config.mk
index eed8bfb..14747c0 100644
--- a/platform/kendryte/k210/config.mk
+++ b/platform/kendryte/k210/config.mk
@@ -21,6 +21,7 @@ PLATFORM_SYS_CLINT=y
FW_TEXT_START=0x80000000
FW_PAYLOAD=y
FW_PAYLOAD_ALIGN=0x1000
+FW_PAYLOAD_FDT=k210.dtb
# External Libraries to include
PLATFORM_INCLUDE_LIBC=y
diff --git a/platform/kendryte/k210/k210.dts b/platform/kendryte/k210/k210.dts
new file mode 100644
index 0000000..17f5214
--- /dev/null
+++ b/platform/kendryte/k210/k210.dts
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2018 Western Digital Corporation or its affiliates.
+ *
+ * Authors:
+ * Damien Le Moal <damien.lemoal@wdc.com>
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+/dts-v1/;
+/ {
+ #address-cells = <2>;
+ #size-cells = <2>;
+ compatible = "kendryte,k210";
+
+ chosen {
+ bootargs = "console=hvc0 earlycon=sbi";
+ };
+
+ cpus {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ cpu0: cpu@0 {
+ device_type = "cpu";
+ clock-frequency = <390000000>;
+ i-cache-size = <32768>;
+ d-cache-size = <32768>;
+ mmu-type = "none";
+ reg = <0>;
+ riscv,isa = "rv64imafdc";
+ status = "okay";
+ cpu0_intc: interrupt-controller {
+ #interrupt-cells = <1>;
+ compatible = "riscv,cpu-intc";
+ interrupt-controller;
+ };
+ };
+ cpu1: cpu@1 {
+ device_type = "cpu";
+ clock-frequency = <390000000>;
+ d-cache-size = <32768>;
+ i-cache-size = <32768>;
+ mmu-type = "none";
+ reg = <1>;
+ riscv,isa = "rv64imafdc";
+ status = "okay";
+ cpu1_intc: interrupt-controller {
+ #interrupt-cells = <1>;
+ compatible = "riscv,cpu-intc";
+ interrupt-controller;
+ };
+ };
+ };
+
+ memory@80000000 {
+ /* Bank 0: 4 MB, Bank 1: 2 MB, AI chip SRAM: 2MB */
+ device_type = "memory";
+ reg = <0x00000000 0x80000000 0x00000000 0x00800000>;
+ };
+
+ plic0: interrupt-controller@C000000 {
+ #interrupt-cells = <1>;
+ compatible = "riscv,plic0";
+ interrupt-controller;
+ interrupts-extended =
+ <&cpu0_intc 11 &cpu0_intc 9
+ &cpu1_intc 11 &cpu1_intc 9>;
+ reg = <0x0 0xc000000 0x0 0x4000000>;
+ };
+};
diff --git a/platform/kendryte/k210/objects.mk b/platform/kendryte/k210/objects.mk
index 1f0a20b..a8a6e35 100644
--- a/platform/kendryte/k210/objects.mk
+++ b/platform/kendryte/k210/objects.mk
@@ -8,3 +8,4 @@
#
platform-objs-y += uarths.o sysctl.o platform.o
+platform-dtb-y += k210.dtb