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>
This commit is contained in:
Damien Le Moal 2019-01-14 13:00:37 +09:00 committed by Anup Patel
parent 58d9f2983a
commit 868ad0b0e5
3 changed files with 72 additions and 0 deletions

View file

@ -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

View file

@ -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>;
};
};

View file

@ -8,3 +8,4 @@
#
platform-objs-y += uarths.o sysctl.o platform.o
platform-dtb-y += k210.dtb