Skip to content

Commit c4f102f

Browse files
lenghonglincarlescufi
authored andcommitted
boards: arm64: add support for Raspberry Pi 4 Model B
This is an AArch64 board. We also add BCM2711 SoC support Signed-off-by: honglin leng <[email protected]>
1 parent 859be8c commit c4f102f

20 files changed

+600
-0
lines changed

boards/arm64/rpi_4b/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# SPDX-License-Identifier: Apache-2.0

boards/arm64/rpi_4b/Kconfig.board

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Copyright 2023 honglin leng <[email protected]>
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_RPI_4B
5+
bool "Broadcom BCM2711"
6+
depends on SOC_BCM2711

boards/arm64/rpi_4b/Kconfig.defconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Copyright 2023 honglin leng <[email protected]>
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD
5+
default "Raspberry Pi 4 Model B"
6+
depends on BOARD_RPI_4B

boards/arm64/rpi_4b/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

boards/arm64/rpi_4b/doc/index.rst

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
.. rpi_4b:
2+
3+
Raspberry Pi 4 Model B (Cortex-A72)
4+
###################################
5+
6+
Overview
7+
********
8+
see <https://www.raspberrypi.com/products/raspberry-pi-4-model-b/specifications/>
9+
10+
Hardware
11+
********
12+
see <https://www.raspberrypi.com/documentation/computers/raspberry-pi.html>
13+
14+
Supported Features
15+
==================
16+
The Raspberry Pi 4 Model B board configuration supports the following
17+
hardware features:
18+
19+
+-----------+------------+--------------------------------------+
20+
| Interface | Controller | Driver/Component |
21+
+===========+============+======================================+
22+
| GIC-400 | on-chip | GICv2 interrupt controller |
23+
+-----------+------------+--------------------------------------+
24+
| UART | on-chip | Mini uart serial port |
25+
+-----------+------------+--------------------------------------+
26+
27+
Other hardware features have not been enabled yet for this board.
28+
29+
The default configuration can be found in the defconfig file:
30+
31+
``boards/arm/rpi_4b/rpi_4b_defconfig``
32+
33+
Programming and Debugging
34+
*************************
35+
36+
Flashing
37+
========
38+
39+
1. Install Raspberry Pi OS using Raspberry Pi Imager. see <https://www.raspberrypi.com/software/>.
40+
41+
2. add `kernel=zephyr.bin` in `config.txt`. see <https://www.raspberrypi.com/documentation/computers/config_txt.html#kernel>
42+
43+
.. code-block:: console
44+
45+
*** Booting Zephyr OS build XXXXXXXXXXXX ***
46+
Hello World! Raspberry Pi 4 Model B!

boards/arm64/rpi_4b/rpi_4b.dts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright 2023 honglin leng <[email protected]>
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
9+
#include <broadcom/bcm2711.dtsi>
10+
/ {
11+
model = "Raspberry Pi 4 Model B";
12+
compatible = "raspberrypi,4-model-b", "brcm,bcm2838";
13+
#address-cells = <1>;
14+
#size-cells = <1>;
15+
16+
chosen {
17+
zephyr,console = &uart1;
18+
zephyr,shell-uart = &uart1;
19+
zephyr,sram = &sram0;
20+
};
21+
};
22+
23+
&uart1 {
24+
status = "okay";
25+
current-speed = <115200>;
26+
};

boards/arm64/rpi_4b/rpi_4b.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
identifier: rpi_4b
2+
name: Raspberry Pi 4 Model B
3+
type: mcu
4+
arch: arm64
5+
toolchain:
6+
- zephyr
7+
- cross-compile

boards/arm64/rpi_4b/rpi_4b_defconfig

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
# Platform Configuration
4+
CONFIG_SOC_BCM2711=y
5+
CONFIG_BOARD_RPI_4B=y
6+
CONFIG_ARM64_VA_BITS_36=y
7+
CONFIG_ARM64_PA_BITS_36=y
8+
9+
# Zephyr Kernel Configuration
10+
CONFIG_XIP=n
11+
CONFIG_FLASH_SIZE=0
12+
CONFIG_FLASH_BASE_ADDRESS=0x0
13+
14+
# Serial Drivers
15+
CONFIG_SERIAL=y
16+
CONFIG_UART_INTERRUPT_DRIVEN=y
17+
18+
# Enable Console
19+
CONFIG_CONSOLE=y
20+
CONFIG_UART_CONSOLE=y
21+
22+
# Timer Drivers
23+
CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME=y

drivers/serial/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ zephyr_library_sources_ifdef(CONFIG_UART_EMUL uart_emul.c)
6464
zephyr_library_sources_ifdef(CONFIG_UART_NUMAKER uart_numaker.c)
6565
zephyr_library_sources_ifdef(CONFIG_UART_EFINIX_SAPPIHIRE uart_efinix_sapphire.c)
6666
zephyr_library_sources_ifdef(CONFIG_UART_SEDI uart_sedi.c)
67+
zephyr_library_sources_ifdef(CONFIG_UART_BCM2711_MU uart_bcm2711.c)
6768

6869
zephyr_library_sources_ifdef(CONFIG_USERSPACE uart_handlers.c)
6970

drivers/serial/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,4 +241,6 @@ source "drivers/serial/Kconfig.efinix_sapphire"
241241

242242
source "drivers/serial/Kconfig.sedi"
243243

244+
source "drivers/serial/Kconfig.bcm2711"
245+
244246
endif # SERIAL

0 commit comments

Comments
 (0)