diff --git a/boards/khadas/edge2/Kconfig.khadas_edge2 b/boards/khadas/edge2/Kconfig.khadas_edge2 new file mode 100644 index 000000000000000..58dd61dfe79d84a --- /dev/null +++ b/boards/khadas/edge2/Kconfig.khadas_edge2 @@ -0,0 +1,5 @@ +# Copyright 2024 Université Gustave Eiffel +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_KHADAS_EDGE2 + select SOC_RK3588S diff --git a/boards/khadas/edge2/board.yml b/boards/khadas/edge2/board.yml new file mode 100644 index 000000000000000..f5c3644f24226d0 --- /dev/null +++ b/boards/khadas/edge2/board.yml @@ -0,0 +1,5 @@ +board: + name: khadas_edge2 + vendor: khadas + socs: + - name: rk3588s diff --git a/boards/khadas/edge2/doc/index.rst b/boards/khadas/edge2/doc/index.rst new file mode 100644 index 000000000000000..8a91be347942ce9 --- /dev/null +++ b/boards/khadas/edge2/doc/index.rst @@ -0,0 +1,94 @@ +.. _khadas_edge2: + +Khadas Edge2 +################################# + +Overview +******** + +See + +Hardware +******** + +See + +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 :ref:`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 +========== + +`Documentation: `_ diff --git a/boards/khadas/edge2/khadas_edge2.dts b/boards/khadas/edge2/khadas_edge2.dts new file mode 100644 index 000000000000000..021015213b7312e --- /dev/null +++ b/boards/khadas/edge2/khadas_edge2.dts @@ -0,0 +1,33 @@ +/* + * Copyright 2024 Université Gustave Eiffel + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include + +/ { + 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"; +}; diff --git a/boards/khadas/edge2/khadas_edge2.yaml b/boards/khadas/edge2/khadas_edge2.yaml new file mode 100644 index 000000000000000..c9ed4ad11b23aed --- /dev/null +++ b/boards/khadas/edge2/khadas_edge2.yaml @@ -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 diff --git a/boards/khadas/edge2/khadas_edge2_defconfig b/boards/khadas/edge2/khadas_edge2_defconfig new file mode 100644 index 000000000000000..38b7f52812f9f65 --- /dev/null +++ b/boards/khadas/edge2/khadas_edge2_defconfig @@ -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