Skip to content

Commit

Permalink
board: raspberrypi: add support for Raspberry Pi 5
Browse files Browse the repository at this point in the history
Add support for Raspberry Pi 5.
Currently only internal GPIO(gio_aon) is supported.
'Blinky' is the only sample that is working for now.

Signed-off-by: Junho Lee <junho@tsnlab.com>
  • Loading branch information
Lahyllas committed Mar 28, 2024
1 parent 46b8560 commit 6ae88ee
Show file tree
Hide file tree
Showing 6 changed files with 167 additions and 0 deletions.
5 changes: 5 additions & 0 deletions boards/raspberrypi/rpi_5/Kconfig.rpi_5
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright 2024 Junho Lee <junho@tsnlab.com>
# SPDX-License-Identifier: Apache-2.0

config BOARD_RPI_5
select SOC_BCM2712
5 changes: 5 additions & 0 deletions boards/raspberrypi/rpi_5/board.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
board:
name: rpi_5
vendor: raspberrypi
socs:
- name: bcm2712
97 changes: 97 additions & 0 deletions boards/raspberrypi/rpi_5/doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
.. rpi_5:
Raspberry Pi 5 (Cortex-A76)
###########################

Overview
********

`Raspberry Pi 5 product-brief`_

Hardware
********

- Broadcom BCM2712 2.4GHz quad-core 64-bit Arm Cortex-A76 CPU, with cryptography extensions, 512KB per-core L2 caches and a 2MB shared L3 cache
- VideoCore VII GPU, supporting OpenGL ES 3.1, Vulkan 1.2
- Dual 4Kp60 HDMI® display output with HDR support
- 4Kp60 HEVC decoder
- LPDDR4X-4267 SDRAM (4GB and 8GB SKUs available at launch)
- Dual-band 802.11ac Wi-Fi®
- Bluetooth 5.0 / Bluetooth Low Energy (BLE)
- microSD card slot, with support for high-speed SDR104 mode
- 2 x USB 3.0 ports, supporting simultaneous 5Gbps operation
- 2 x USB 2.0 ports
- Gigabit Ethernet, with PoE+ support (requires separate PoE+ HAT)
- 2 x 4-lane MIPI camera/display transceivers
- PCIe 2.0 x1 interface for fast peripherals (requires separate M.2 HAT or other adapter)
- 5V/5A DC power via USB-C, with Power Delivery support
- Raspberry Pi standard 40-pin header
- Real-time clock (RTC), powered from external battery
- Power button

Supported Features
==================

The Raspberry Pi 5 board configuration supports the following hardware features:

+-----------+----------------+--------------------------+
| Interface | Kconfig | Devicetree compatible |
+===========+================+==========================+
| GIC-400 | N/A | arm,gic-v2 |
+-----------+----------------+--------------------------+
| GPIO | CONFIG_GPIO | brcm,brcmstb-gpio |
+-----------+----------------+--------------------------+

There are many hardware fatures of Raspberry Pi 5. But now, only `GPIO` feautre has been implemented for Raspberry Pi 5.

Other hardware features are not currently supported by the port. See the `Raspberry Pi hardware`_ for a complete list of MPS3 AN547 board hardware features.

The default configuration can be found in
:zephyr_file:`boards/raspberrypi/rpi_5/rpi_5_defconfig`.

Programming and Debugging
*************************

Flashing
========

In brief,
1. Format your TF card with MBR and FAT32.
2. Save three files below in the root directory.
* config.txt
* zephyr.bin
* `bcm2712-rpi-5.dtb`_
3. Insert the TF card and power on the Raspberry Pi 5.

then, You will see the Raspberry Pi 5 running the `zephyr.bin`.

config.txt
----------

.. code-block:: text
kernel=zephyr.bin
arm_64bit=1
zephyr.bin
----------

Build an app `samples/basic/blinky`

.. code-block:: console
west -b rpi_5 samples/basic/blinky
Copy `zephyr.bin` from `build/zephyr` directory to the root directory of the TF card.

Insert the TF card and power on the Raspberry Pi 5. And then, the STAT LED will start to blink.

.. _Raspberry Pi 5 product-brief:
https://datasheets.raspberrypi.com/rpi5/raspberry-pi-5-product-brief.pdf

.. _Raspberry Pi hardware:
https://www.raspberrypi.com/documentation/computers/raspberry-pi.html

.. _bcm2712-rpi-5.dtb:
https://github.com/raspberrypi/firmware/raw/master/boot/bcm2712-rpi-5-b.dtb
38 changes: 38 additions & 0 deletions boards/raspberrypi/rpi_5/rpi_5.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright 2024 Junho Lee <junho@tsnlab.com>
*
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;

#include <broadcom/bcm2712.dtsi>
#include <zephyr/dt-bindings/gpio/gpio.h>

/ {
compatible = "raspberrypi,5-model-b", "brcm,bcm2712";
model = "Raspberry Pi 5";
#address-cells = <2>;
#size-cells = <1>;

aliases {
led0 = &led_act;
};

chosen {
zephyr,sram = &sram0;
};

leds {
compatible = "gpio-leds";

led_act: led-act {
gpios = <&gio_aon 9 GPIO_ACTIVE_LOW>;
label = "ACT";
};
};
};

&gio_aon {
status = "okay";
};
7 changes: 7 additions & 0 deletions boards/raspberrypi/rpi_5/rpi_5.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
identifier: rpi_5
name: Raspberry Pi 5
type: mcu
arch: arm64
toolchain:
- zephyr
- cross-compile
15 changes: 15 additions & 0 deletions boards/raspberrypi/rpi_5/rpi_5_defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# SPDX-License-Identifier: Apache-2.0

CONFIG_ARM64_VA_BITS_40=y
CONFIG_ARM64_PA_BITS_40=y
CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME=y

# Serial drivers are not available for now
CONFIG_SERIAL=n
CONFIG_CONSOLE=n
CONFIG_UART_CONSOLE=n
CONFIG_UART_INTERRUPT_DRIVEN=n

CONFIG_XIP=n
CONFIG_FLASH_SIZE=0
CONFIG_FLASH_BASE_ADDRESS=0x0

0 comments on commit 6ae88ee

Please sign in to comment.