-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
boards:khadas: adding support for the edge2 #79559
Open
EstAK
wants to merge
2
commits into
zephyrproject-rtos:main
Choose a base branch
from
EstAK:edge2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Copyright 2024 Université Gustave Eiffel | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
config BOARD_KHADAS_EDGE2 | ||
select SOC_RK3588S |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,6 @@ | ||||||||
board: | ||||||||
name: khadas_edge2 | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
full_name: Edge2 | ||||||||
vendor: khadas | ||||||||
socs: | ||||||||
- name: rk3588s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
.. zephyr:board:: khadas_edge2 | ||
|
||
Overview | ||
******** | ||
|
||
See `Product page`_ | ||
|
||
.. _Product page: https://www.khadas.com/edge2 | ||
|
||
Hardware | ||
******** | ||
|
||
See `Hardware details`_ | ||
|
||
.. _Hardware details: https://docs.khadas.com/products/sbc/edge2/hardware/start | ||
|
||
Supported Features | ||
================== | ||
|
||
The ``khadas_edge2`` board target supports the following | ||
hardware features: | ||
|
||
+-----------+------------+--------------------------------------+ | ||
| Interface | Controller | Driver/Component | | ||
+===========+============+======================================+ | ||
| GIC-600 | on-chip | GICv3 interrupt controller | | ||
+-----------+------------+--------------------------------------+ | ||
| ARM TIMER | on-chip | System Clock | | ||
+-----------+------------+--------------------------------------+ | ||
| UART | on-chip | Synopsys DesignWare 8250 serial port | | ||
+-----------+------------+--------------------------------------+ | ||
|
||
Other hardware features have not been enabled yet for this board. | ||
|
||
The default configuration can be found in (NON-SMP) | ||
:zephyr_file:`boards/khadas/edge2/khadas_edge2_defconfig` | ||
|
||
There are multiple serial ports on the board: Zephyr is using | ||
uart2 as serial console. | ||
|
||
Programming and Debugging | ||
************************* | ||
|
||
Use the following configuration to run basic Zephyr applications and | ||
kernel tests on Khadas Edge2 board. For example, with the :zephyr:code-sample:`hello_world`: | ||
|
||
1. Non-SMP mode | ||
|
||
.. zephyr-app-commands:: | ||
:zephyr-app: samples/hello_world | ||
:host-os: unix | ||
:board: khadas_edge2 | ||
:goals: build | ||
|
||
This will build an image with the hello world sample app. | ||
|
||
Build the zephyr image: | ||
|
||
.. code-block:: console | ||
|
||
mkimage -C none -A arm64 -O linux -a 0x10000000 -e 0x10000000 -d build/zephyr/zephyr.bin build/zephyr/zephyr.img | ||
|
||
Burn the image on the board (we choose to use Rockchip burning tool `rkdeveloptool <https://github.com/rockchip-linux/rkdeveloptool.git>`_, you will need a `SPL <http://dl.khadas.com/products/edge2/firmware/boot/>`_ which is provided by khadas: | ||
|
||
.. code-block:: console | ||
|
||
rkdeveloptool db rk3588_spl_loader_*; rkdeveloptool wl 0x100000 zephyr.img; rkdeveloptool rd | ||
|
||
The sector 0x100000 was chosen arbitrarily (far away from U-Boot image) | ||
|
||
Use U-Boot to load and run Zephyr: | ||
|
||
.. code-block:: console | ||
|
||
mmc read ${pxefile_addr_r} 0x100000 0x1000; bootm start ${pxefile_addr_r}; bootm loados; bootm go | ||
|
||
0x1000 is the size (in number of sectors) or your image. Increase it if needed. | ||
|
||
It will display the following console output: | ||
|
||
.. code-block:: console | ||
|
||
*** Booting Zephyr OS build XXXXXXXXXXXX *** | ||
Hello World! khadas_edge2 | ||
|
||
Flashing | ||
======== | ||
|
||
Zephyr image can be loaded in DDR memory at address 0x10000000 from SD Card, | ||
EMMC, QSPI Flash or downloaded from network in uboot. | ||
|
||
References | ||
========== | ||
|
||
`Edge2 Documentation`_ | ||
|
||
.. _Edge2 Documentation: https://docs.khadas.com/products/sbc/edge2/start |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright 2024 Université Gustave Eiffel | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/dts-v1/; | ||
|
||
#include <rockchip/rk3588s.dtsi> | ||
|
||
/ { | ||
model = "Khadas Edge2"; | ||
compatible = "khadas,edge2"; | ||
|
||
chosen { | ||
zephyr,sram = &sram0; | ||
zephyr,console = &uart2; | ||
zephyr,shell-uart = &uart2; | ||
}; | ||
|
||
cpus { | ||
/delete-node/ cpu@1; | ||
/delete-node/ cpu@2; | ||
/delete-node/ cpu@3; | ||
/delete-node/ cpu@4; | ||
/delete-node/ cpu@5; | ||
/delete-node/ cpu@6; | ||
/delete-node/ cpu@7; | ||
}; | ||
}; | ||
|
||
&uart2 { | ||
status = "okay"; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
identifier: khadas_edge2 | ||
name: Khadas Edge2 (single core, non SMP) | ||
type: mcu | ||
arch: arm64 | ||
toolchain: | ||
- zephyr | ||
- cross-compile | ||
ram: 8192 | ||
vendor: khadas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright 2024 Université Gustave Eiffel | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# Platform Configuration | ||
CONFIG_ARM64_VA_BITS_40=y | ||
CONFIG_ARM64_PA_BITS_40=y | ||
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=24000000 | ||
CONFIG_CACHE_MANAGEMENT=y | ||
CONFIG_ARMV8_A_NS=y | ||
|
||
# Serial Drivers | ||
CONFIG_SERIAL=y | ||
CONFIG_UART_INTERRUPT_DRIVEN=y | ||
|
||
# Enable Console | ||
CONFIG_CONSOLE=y | ||
CONFIG_UART_CONSOLE=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
/* | ||
* Copyright 2024 Université Gustave Eiffel | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include <arm64/armv8-a.dtsi> | ||
#include <zephyr/dt-bindings/interrupt-controller/arm-gic.h> | ||
#include <mem.h> | ||
|
||
/ { | ||
#address-cells = <1>; | ||
#size-cells = <1>; | ||
|
||
cpus { | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
|
||
cpu@0 { | ||
device_type = "cpu"; | ||
compatible = "arm,cortex-a55"; | ||
reg = <0x0>; | ||
}; | ||
cpu@1 { | ||
device_type = "cpu"; | ||
compatible = "arm,cortex-a55"; | ||
reg = <0x100>; | ||
}; | ||
cpu@2 { | ||
device_type = "cpu"; | ||
compatible = "arm,cortex-a55"; | ||
reg = <0x200>; | ||
}; | ||
cpu@3 { | ||
device_type = "cpu"; | ||
compatible = "arm,cortex-a55"; | ||
reg = <0x300>; | ||
}; | ||
cpu@4 { | ||
device_type = "cpu"; | ||
compatible = "arm,cortex-a76"; | ||
reg = <0x400>; | ||
}; | ||
cpu@5 { | ||
device_type = "cpu"; | ||
compatible = "arm,cortex-a76"; | ||
reg = <0x500>; | ||
}; | ||
cpu@6 { | ||
device_type = "cpu"; | ||
compatible = "arm,cortex-a76"; | ||
reg = <0x600>; | ||
}; | ||
cpu@7 { | ||
device_type = "cpu"; | ||
compatible = "arm,cortex-a76"; | ||
reg = <0x700>; | ||
}; | ||
}; | ||
|
||
gic: interrupt-controller@fe600000 { | ||
#address-cells = <1>; | ||
compatible = "arm,gic-v3", "arm,gic"; | ||
reg = <0xfe600000 0x10000>, /* GICD */ | ||
<0xfe680000 0x100000>; /* GICR */ | ||
interrupt-controller; | ||
#interrupt-cells = <4>; | ||
status = "okay"; | ||
}; | ||
|
||
sram0: memory@10000000 { | ||
reg = <0x10000000 DT_SIZE_M(128)>; | ||
}; | ||
|
||
timer { | ||
compatible = "arm,armv8-timer"; | ||
interrupt-parent = <&gic>; | ||
interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL | ||
IRQ_DEFAULT_PRIORITY>, | ||
<GIC_PPI 14 IRQ_TYPE_LEVEL | ||
IRQ_DEFAULT_PRIORITY>, | ||
<GIC_PPI 11 IRQ_TYPE_LEVEL | ||
IRQ_DEFAULT_PRIORITY>, | ||
<GIC_PPI 10 IRQ_TYPE_LEVEL | ||
IRQ_DEFAULT_PRIORITY>; | ||
}; | ||
|
||
uart2: serial@feb50000 { | ||
compatible = "rockchip,rk3588s-uart", "ns16550"; | ||
reg = <0xfeb50000 0x1000>; | ||
interrupt-parent = <&gic>; | ||
interrupts = <GIC_SPI 333 IRQ_TYPE_LEVEL IRQ_DEFAULT_PRIORITY>; | ||
status = "disabled"; | ||
reg-shift = <2>; | ||
clock-frequency = <350000000>; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Copyright 2024 Université Gustave Eiffel | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
if(CONFIG_SOC_RK3568) | ||
add_subdirectory(rk3568) | ||
elseif(CONFIG_SOC_RK3588S) | ||
add_subdirectory(rk3588s) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# | ||
# Copyright 2021 Huawei France Technologies SASU | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
if SOC_FAMILY_ROCKCHIP | ||
|
||
rsource "*/Kconfig" | ||
|
||
endif # SOC_FAMILY_ROCKCHIP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# | ||
# Copyright 2021 Huawei France Technologies SASU | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
if SOC_FAMILY_ROCKCHIP | ||
|
||
rsource "*/Kconfig.defconfig" | ||
|
||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Copyright 2024 Université Gustave Eiffel | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
config SOC_SERIES_RK35 | ||
bool | ||
select SOC_FAMILY_ROCKCHIP | ||
|
||
config SOC_SERIES | ||
default "rk35" if SOC_SERIES_RK35 | ||
|
||
rsource "*/Kconfig.soc" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Copyright 2024 Université Gustave Eiffel | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
zephyr_sources_ifdef(CONFIG_ARM_MMU mmu_regions.c) | ||
|
||
set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm64/scripts/linker.ld CACHE INTERNAL "") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Copyright 2024 Université Gustave Eiffel | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
config SOC_RK3588S | ||
select ARM64 | ||
select CPU_CORTEX_A55 | ||
select ARM_ARCH_TIMER if SYS_CLOCK_EXISTS | ||
|
||
config SOC_PART_NUMBER | ||
default "RK3588S" if SOC_RK3588S |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Copyright 2024 Université Gustave Eiffel | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
if SOC_RK3588S | ||
|
||
rsource "Kconfig.defconfig.rk3588s" | ||
|
||
endif # SOC_RK3588S |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we typically wouldn't want the vendor name to prefix the board name, as it's redundant, is it not @nordicjm?
There are some boards that do it, but it's a minority AFAICS. That being said, "edge2" definitely is a very generic name so it doesn't sound like a bad idea to anticipate and namespace it, it's just that I am not sure what the rule/guideline is here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the alphabet of meaningful, 5-10 character board names is finite, I don't think it should necessarily be unacceptable to prefix boards with some vendor identifier.