Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions build/meta-bsp/recipes-bsp/bsp/files/bsp_rpi4_64.inc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ def __do_platform_deploy(d):
uboot_path = d.getVar('IB_UBOOT_PATH')

run(f"cp -r {filedirname}/../bsp/rpi4/* {dst}/p1")

# bsp/rpi4/config.txt is shared with the 32-bit BSP and deliberately holds
# no arm_64bit/kernel setting; append the 64-bit half of the chain.
# FILE_DIRNAME is the *recipe's* directory (recipes-bsp/so3), not this
# include's — hence the ../bsp hop, as in the copy above.
run(f"cat {filedirname}/../bsp/files/config_rpi4_arm64.txt >> {dst}/p1/config.txt")

run(f"cp {uboot_path}/u-boot.bin {dst}/p1/kernel8.img")

__deploy_arm_common(d)
7 changes: 7 additions & 0 deletions build/meta-bsp/recipes-bsp/bsp/files/config_rpi4_arm32.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

# --- 32-bit boot chain (appended by bsp_rpi4.inc) ---
# The deploy installs the arm32 U-Boot as kernel7l.img. arm_64bit=0 is the
# firmware default, but state both explicitly so the loaded file never depends
# on the firmware's 32/64-bit filename default.
arm_64bit=0
kernel=kernel7l.img
9 changes: 9 additions & 0 deletions build/meta-bsp/recipes-bsp/bsp/files/config_rpi4_arm64.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

# --- 64-bit boot chain (appended by bsp_rpi4_64.inc) ---
# The deploy installs the aarch64 U-Boot as kernel8.img. This firmware
# (bcm2711, Aug 2021) defaults arm_64bit to 0, so without this it starts the
# cores in 32-bit mode and looks for kernel7l.img, never finds it, and boots
# nothing at all — no serial output whatsoever. kernel= is stated explicitly so
# the loaded file never depends on the firmware's filename default.
arm_64bit=1
kernel=kernel8.img
21 changes: 21 additions & 0 deletions build/meta-bsp/recipes-bsp/bsp/rpi4/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,24 @@ max_framebuffers=2
#dtoverlay=vc4-fkms-v3d

enable_uart=1

# Don't read an attached HAT's EEPROM. The firmware would merge the HAT's own
# overlay into the device tree it hands to U-Boot, and that DT carries no
# /chosen/stdout-path — so U-Boot picks its console by DT node order, which the
# merge perturbs: with a Sense HAT fitted, U-Boot drives the wrong UART and
# boots in complete silence. SO3 talks to the HAT through its own rpisense
# driver and never needs the overlay. Applies to both 32- and 64-bit.
force_eeprom_read=0

# The 32/64-bit boot settings are NOT here: this file is shared by every rpi4
# BSP, and the two chains need opposite values (kernel7l.img vs kernel8.img).
# bsp_rpi4.inc / bsp_rpi4_64.inc append the right config_rpi4_arm{32,64}.txt
# fragment after copying this directory.

# Diagnostic only — echoes the firmware's own boot stage on the UART, which is
# how you tell a failure *before* U-Boot from a dead board. Leave it OFF for
# normal boots: to print, the firmware muxes GPIO14/15 to the PL011 and resets
# its baud, while the DT gives serial0 = the mini-UART (7e215040, the one SO3
# drives). The pins then stay on the wrong peripheral and U-Boot's output never
# reaches the wire.
#uart_2ndstage=1
2 changes: 1 addition & 1 deletion so3/so3/devices/i2c/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ config I2C_BSC
default y
depends on I2C
bool "I2C Broadcom Serial Controller (BSC) interface"
depends on RPI4
depends on RPI4 || RPI4_64
7 changes: 6 additions & 1 deletion so3/so3/devices/i2c/i2c_bsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,12 @@ static int i2c_bsc_init(dev_t *dev, int fdt_offset)
const struct fdt_property *prop;
int prop_len;
uint32_t mask;
uint32_t gpio_regs_addr;

/* addr_t, not uint32_t: io_map() hands back a virtual address, which on
* arm64 sits at CONFIG_IO_MAPPING_BASE (0xffff9000_00000000) and would
* lose its top half in a 32-bit variable.
*/
addr_t gpio_regs_addr;

LOG_DEBUG("I2C broadcom - Initialization\n");

Expand Down
2 changes: 1 addition & 1 deletion so3/so3/devices/rpisense/Kconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
config RPI_SENSE
bool "Driver for the Sense Hat extension board"
depends on RPI4
depends on RPI4 || RPI4_64


6 changes: 5 additions & 1 deletion so3/so3/devices/rpisense/rpisense.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@

#include <device/arch/rpisense.h>

static uint32_t gpio_regs_addr;
/* addr_t, not uint32_t: io_map() hands back a virtual address, which on arm64
* sits at CONFIG_IO_MAPPING_BASE (0xffff9000_00000000) and would lose its top
* half in a 32-bit variable.
*/
static addr_t gpio_regs_addr;

uint8_t leds_array[SIZE_FB];

Expand Down
Loading