Skip to content

Commit a43b37b

Browse files
Henri Xaviercarlescufi
authored andcommitted
boards: Add support for Khadas Edge-V board
This is an AArch64 board. We also add RK3399 SoC support, as well as a very simple Synopsys 8250dw UART driver. Signed-off-by: Henri Xavier <datacomos@huawei.com>
1 parent d308ca5 commit a43b37b

20 files changed

+402
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# SPDX-License-Identifier: Apache-2.0
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#
2+
# Copyright 2022 Huawei France Technologies SASU
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
6+
config BOARD_KHADAS_EDGEV
7+
bool "Khadas Edge-V"
8+
depends on SOC_SERIES_RK3399
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#
2+
# Copyright 2022 Huawei France Technologies SASU
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
6+
config BOARD
7+
default "khadas_edgev"
8+
depends on BOARD_KHADAS_EDGEV

boards/arm64/khadas_edgev/board.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# SPDX-License-Identifier: Apache-2.0
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
.. _khadas_edgev:
2+
3+
Khadas Edge-V
4+
#################################
5+
6+
Overview
7+
********
8+
9+
See <https://www.khadas.com/edge-v>
10+
11+
Hardware
12+
********
13+
14+
See <https://docs.khadas.com/linux/edge/Hardware.html#Edge-V-1>
15+
16+
Supported Features
17+
==================
18+
19+
Khadas Edge-V board default configuration supports the following
20+
hardware features:
21+
22+
+-----------+------------+--------------------------------------+
23+
| Interface | Controller | Driver/Component |
24+
+===========+============+======================================+
25+
| GIC-500 | on-chip | GICv3 interrupt controller |
26+
+-----------+------------+--------------------------------------+
27+
| ARM TIMER | on-chip | System Clock |
28+
+-----------+------------+--------------------------------------+
29+
| UART | on-chip | Synopsys DesignWare 8250 serial port |
30+
+-----------+------------+--------------------------------------+
31+
32+
Other hardware features have not been enabled yet for this board.
33+
34+
The default configuration can be found in the defconfig file for NON-SMP:
35+
36+
``boards/arm64/khadas_edgev/khadas_edgev_defconfig``
37+
38+
There are multiple serial ports on the board: Zephyr is using
39+
uart2 as serial console.
40+
41+
Programming and Debugging
42+
*************************
43+
44+
Use the following configuration to run basic Zephyr applications and
45+
kernel tests on Khadas Edge-V board. For example, with the :ref:`hello_world`:
46+
47+
1. Non-SMP mode
48+
49+
.. zephyr-app-commands::
50+
:zephyr-app: samples/hello_world
51+
:host-os: unix
52+
:board: khadas_edgev
53+
:goals: build
54+
55+
This will build an image with the synchronization sample app.
56+
57+
Build the zephyr image:
58+
59+
.. code-block:: console
60+
61+
mkimage -C none -A arm64 -O linux -a 0x10000000 -e 0x10000000 -d build/zephyr/zephyr.bin build/zephyr/zephyr.img
62+
63+
Use u-boot to load and kick Zephyr.bin to CPU Core0:
64+
65+
.. code-block:: console
66+
67+
tftpboot ${pxefile_addr_r} zephyr.img; bootm start ${pxefile_addr_r}; bootm loados; bootm go
68+
69+
It will display the following console output:
70+
71+
.. code-block:: console
72+
73+
*** Booting Zephyr OS build XXXXXXXXXXXX ***
74+
Hello World! khadas_edgev
75+
76+
Flashing
77+
========
78+
79+
Zephyr image can be loaded in DDR memory at address 0x10000000 from SD Card,
80+
EMMC, QSPI Flash or downloaded from network in uboot.
81+
82+
References
83+
==========
84+
85+
`Documentation: <https://docs.khadas.com/linux/edge/>`_
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Copyright 2022 Huawei France Technologies SASU
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
9+
#include <rockchip/rk3399.dtsi>
10+
11+
/ {
12+
model = "Khadas Edge-V";
13+
compatible = "khadas,edgev";
14+
15+
chosen {
16+
zephyr,sram = &sram0;
17+
zephyr,console = &uart2;
18+
zephyr,shell-uart = &uart2;
19+
};
20+
21+
cpus {
22+
/delete-node/ cpu@1;
23+
/delete-node/ cpu@2;
24+
/delete-node/ cpu@3;
25+
/delete-node/ cpu@4;
26+
/delete-node/ cpu@5;
27+
};
28+
};
29+
30+
&uart2 {
31+
status = "okay";
32+
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
identifier: khadas_edgev
2+
name: Khadas Edge-V (single core, non SMP)
3+
type: mcu
4+
arch: arm64
5+
toolchain:
6+
- zephyr
7+
- cross-compile
8+
ram: 8192
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
# Platform Configuration
4+
CONFIG_SOC_SERIES_RK3399=y
5+
CONFIG_SOC_RK3399=y
6+
CONFIG_BOARD_KHADAS_EDGEV=y
7+
CONFIG_ARM64_VA_BITS_40=y
8+
CONFIG_ARM64_PA_BITS_40=y
9+
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=24000000
10+
CONFIG_CACHE_MANAGEMENT=y
11+
CONFIG_ARMV8_A_NS=y
12+
13+
# Serial Drivers
14+
CONFIG_SERIAL=y
15+
CONFIG_UART_INTERRUPT_DRIVEN=y
16+
17+
# Enable Console
18+
CONFIG_CONSOLE=y
19+
CONFIG_UART_CONSOLE=y

dts/arm64/rockchip/rk3399.dtsi

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
/*
2+
* Copyright 2022 Huawei France Technologies SASU
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <arm64/armv8-a.dtsi>
8+
#include <zephyr/dt-bindings/interrupt-controller/arm-gic.h>
9+
#include <mem.h>
10+
11+
/ {
12+
#address-cells = <1>;
13+
#size-cells = <1>;
14+
15+
cpus {
16+
#address-cells = <2>;
17+
#size-cells = <0>;
18+
19+
cpu@0 {
20+
device_type = "cpu";
21+
compatible = "arm,cortex-a53";
22+
reg = <0x0 0x0>;
23+
};
24+
cpu@1 {
25+
device_type = "cpu";
26+
compatible = "arm,cortex-a53";
27+
reg = <0x0 0x1>;
28+
};
29+
cpu@2 {
30+
device_type = "cpu";
31+
compatible = "arm,cortex-a53";
32+
reg = <0x0 0x2>;
33+
};
34+
cpu@3 {
35+
device_type = "cpu";
36+
compatible = "arm,cortex-a53";
37+
reg = <0x0 0x3>;
38+
};
39+
cpu@4 {
40+
device_type = "cpu";
41+
compatible = "arm,cortex-a72";
42+
reg = <0x0 0x100>;
43+
};
44+
cpu@5 {
45+
device_type = "cpu";
46+
compatible = "arm,cortex-a72";
47+
reg = <0x0 0x101>;
48+
};
49+
};
50+
51+
gic: interrupt-controller@fee00000 {
52+
#address-cells = <1>;
53+
compatible = "arm,gic";
54+
reg = <0xfee00000 0x10000>, /* GICD */
55+
<0xfef00000 0xc0000>, /* GICR */
56+
<0xfff00000 0x10000>, /* GICC */
57+
<0xfff10000 0x10000>, /* GICH */
58+
<0xfff20000 0x10000>; /* GICV */
59+
interrupt-controller;
60+
#interrupt-cells = <4>;
61+
status = "okay";
62+
};
63+
64+
psci: psci {
65+
compatible = "arm,psci-1.0";
66+
method = "smc";
67+
};
68+
69+
sram0: memory@10000000 {
70+
reg = <0x10000000 DT_SIZE_M(128)>;
71+
};
72+
73+
timer {
74+
compatible = "arm,armv8-timer";
75+
interrupt-parent = <&gic>;
76+
interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL
77+
IRQ_DEFAULT_PRIORITY>,
78+
<GIC_PPI 14 IRQ_TYPE_LEVEL
79+
IRQ_DEFAULT_PRIORITY>,
80+
<GIC_PPI 11 IRQ_TYPE_LEVEL
81+
IRQ_DEFAULT_PRIORITY>,
82+
<GIC_PPI 10 IRQ_TYPE_LEVEL
83+
IRQ_DEFAULT_PRIORITY>;
84+
};
85+
86+
uart2: serial@ff1a0000 {
87+
compatible = "rockchip,rk3399-uart", "ns16550";
88+
reg = <0xff1a0000 0x1000>;
89+
interrupt-parent = <&gic>;
90+
interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL IRQ_DEFAULT_PRIORITY>;
91+
status = "disabled";
92+
reg-shift = <2>;
93+
clock-frequency = <350000000>;
94+
};
95+
};

soc/arm64/rockchip/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#
2+
# Copyright 2022 Huawei France Technologies SASU
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
7+
add_subdirectory(${SOC_SERIES})

0 commit comments

Comments
 (0)