diff options
18 files changed, 117 insertions, 203 deletions
diff --git a/configs/platform-v7a/config/images/rpi2.config b/configs/platform-v7a/config/images/rpi2.config index f8da7d4..08329ff 100644 --- a/configs/platform-v7a/config/images/rpi2.config +++ b/configs/platform-v7a/config/images/rpi2.config @@ -1,7 +1,12 @@ image rpi2-boot.vfat { vfat { files = { @FIRMWARE_RPI2@ } - file barebox.img { image = barebox-raspberry-pi-2.img } + file barebox.img { image = barebox-dt-2nd-rpi.img } + file bcm2836-rpi-2-b.dtb { image = barebox-bcm2836-rpi-2.dtb } + file bcm2837-rpi-3-b.dtb { image = barebox-bcm2837-rpi-3.dtb } + file bcm2837-rpi-3-a-plus.dtb { image = barebox-bcm2837-rpi-3.dtb } + file bcm2837-rpi-3-b-plus.dtb { image = barebox-bcm2837-rpi-3.dtb } + file bcm2837-rpi-cm3-io3.dtb { image = barebox-bcm2837-rpi-cm3.dtb } } size = 32M } diff --git a/configs/platform-v7a/config/images/rpi3.config b/configs/platform-v7a/config/images/rpi3.config deleted file mode 100644 index f87a727..0000000 --- a/configs/platform-v7a/config/images/rpi3.config +++ /dev/null @@ -1,28 +0,0 @@ -image rpi3-boot.vfat { - vfat { - files = { @FIRMWARE_RPI3@ } - file barebox.img { image = barebox-raspberry-pi-3.img } - } - size = 32M -} - -image @IMAGE@ { - hdimage { - align = 1M - disk-signature = 0xbedf7893 - } - partition boot { - image = rpi3-boot.vfat - partition-type = 0xc - bootable = true - } - partition root-A { - image = root.ext2 - partition-type = 0x83 - } - partition data { - partition-type = 0x83 - size = 512M - } -} -/* vim: set tabstop=8 noexpandtab : */ diff --git a/configs/platform-v7a/config/images/rpicm3.config b/configs/platform-v7a/config/images/rpicm3.config deleted file mode 100644 index d0c4c59..0000000 --- a/configs/platform-v7a/config/images/rpicm3.config +++ /dev/null @@ -1,28 +0,0 @@ -image rpicm3-boot.vfat { - vfat { - files = { @FIRMWARE_RPI3@ } - file barebox.img { image = barebox-raspberry-pi-cm3.img } - } - size = 32M -} - -image @IMAGE@ { - hdimage { - align = 1M - disk-signature = 0xbedf7893 - } - partition boot { - image = rpicm3-boot.vfat - partition-type = 0xc - bootable = true - } - partition root-A { - image = root.ext2 - partition-type = 0x83 - } - partition data { - partition-type = 0x83 - size = 512M - } -} -/* vim: set tabstop=8 noexpandtab : */ diff --git a/configs/platform-v7a/patches/barebox-2022.04.0/0004-ARM-cpu-board-dt-2nd-call-arm_cpu_lowlevel_init.patch b/configs/platform-v7a/patches/barebox-2022.04.0/0004-ARM-cpu-board-dt-2nd-call-arm_cpu_lowlevel_init.patch new file mode 100644 index 0000000..b0b825e --- /dev/null +++ b/configs/platform-v7a/patches/barebox-2022.04.0/0004-ARM-cpu-board-dt-2nd-call-arm_cpu_lowlevel_init.patch @@ -0,0 +1,40 @@ +From 92473f8169118472f0f40179eb60cb2cde765bb7 Mon Sep 17 00:00:00 2001 +From: Ahmad Fatoum <a.fatoum@pengutronix.de> +Date: Sat, 23 Apr 2022 12:24:34 +0200 +Subject: [PATCH 4/5] ARM: cpu: board-dt-2nd: call arm_cpu_lowlevel_init + +The generic DT image could be started by boot firmware that doesn't do +all the initialization that we do in arm_cpu_lowlevel_init(), so call it +always for good measure. This enables using the generic image as second +stage to the Raspberry Pi videocore. + +Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> +--- + arch/arm/cpu/board-dt-2nd.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/arch/arm/cpu/board-dt-2nd.c b/arch/arm/cpu/board-dt-2nd.c +index 0731aecd1a51..6f4a6f26a8c7 100644 +--- a/arch/arm/cpu/board-dt-2nd.c ++++ b/arch/arm/cpu/board-dt-2nd.c +@@ -21,6 +21,8 @@ void dt_2nd_aarch64(void *fdt) + + /* entry point already set up stack */ + ++ arm_cpu_lowlevel_init(); ++ + relocate_to_current_adr(); + setup_c(); + +@@ -50,6 +52,8 @@ ENTRY_FUNCTION(start_dt_2nd, r0, r1, r2) + { + unsigned long image_start = (unsigned long)_text + global_variable_offset(); + ++ arm_cpu_lowlevel_init(); ++ + arm_setup_stack(image_start); + + relocate_to_current_adr(); +-- +2.30.2 + diff --git a/configs/platform-v7a/patches/barebox-2022.04.0/0005-ARM-rpi-don-t-warn-about-lack-of-videocore-fdt.patch b/configs/platform-v7a/patches/barebox-2022.04.0/0005-ARM-rpi-don-t-warn-about-lack-of-videocore-fdt.patch new file mode 100644 index 0000000..0586085 --- /dev/null +++ b/configs/platform-v7a/patches/barebox-2022.04.0/0005-ARM-rpi-don-t-warn-about-lack-of-videocore-fdt.patch @@ -0,0 +1,37 @@ +From 675a65a3b42ef74ae37638f780912139a7c31cc6 Mon Sep 17 00:00:00 2001 +From: Ahmad Fatoum <a.fatoum@pengutronix.de> +Date: Sat, 23 Apr 2022 12:54:55 +0200 +Subject: [PATCH 5/5] ARM: rpi: don't warn about lack of videocore fdt + +When barebox is booted as generic second stage DT image, it will throw +an annoying but harmless error that the videocore FDT saved in PBL has +invalid magic. This is expected because the generic code doesn't store +the device tree, instead it passes it to barebox proper to probe from. +Storing the DT in /vd.dtb would thus just be duplication. + +Remove the error message in this case. + +Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> +--- + arch/arm/boards/raspberry-pi/rpi-common.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/arch/arm/boards/raspberry-pi/rpi-common.c b/arch/arm/boards/raspberry-pi/rpi-common.c +index 9aa150de5680..82da4d646482 100644 +--- a/arch/arm/boards/raspberry-pi/rpi-common.c ++++ b/arch/arm/boards/raspberry-pi/rpi-common.c +@@ -328,10 +328,8 @@ static void rpi_vc_fdt(void) + return; + } + +- if (magic != FDT_MAGIC) { +- pr_err("videocore fdt saved in pbl has invalid magic\n"); ++ if (magic != FDT_MAGIC) + return; +- } + + size = be32_to_cpu(oftree->totalsize); + if (write_file("/vc.dtb", saved_vc_fdt, size)) { +-- +2.30.2 + diff --git a/configs/platform-v7a/patches/barebox-2022.04.0/series b/configs/platform-v7a/patches/barebox-2022.04.0/series index 8947868..be48ede 100644 --- a/configs/platform-v7a/patches/barebox-2022.04.0/series +++ b/configs/platform-v7a/patches/barebox-2022.04.0/series @@ -1,3 +1,5 @@ 0001-ARM-asm-fix-miscompilation-of-32-bit-ENTRY_FUNCTION_.patch 0002-clk-add-BCM2835-auxiliary-peripheral-clock-driver.patch 0003-clocksource-assign-non-zero-priorities-to-all-clocks.patch +0004-ARM-cpu-board-dt-2nd-call-arm_cpu_lowlevel_init.patch +0005-ARM-rpi-don-t-warn-about-lack-of-videocore-fdt.patch diff --git a/configs/platform-v7a/platformconfig b/configs/platform-v7a/platformconfig index 3a2a1f8..a399f60 100644 --- a/configs/platform-v7a/platformconfig +++ b/configs/platform-v7a/platformconfig @@ -281,8 +281,6 @@ PTXCONF_IMAGE_ROOT_TGZ_LABEL="" # PTXCONF_IMAGE_ROOT_UBI is not set # PTXCONF_IMAGE_ROOT_UBIFS is not set PTXCONF_IMAGE_RPI2=y -PTXCONF_IMAGE_RPI3=y -PTXCONF_IMAGE_RPICM3=y PTXCONF_IMAGE_SABRELITE=y PTXCONF_IMAGE_SAMA5D27_GIANTBOARD=y PTXCONF_IMAGE_SAMA5D27_SOM1_EK=y diff --git a/configs/platform-v7a/platforms/barebox-rpi2.in b/configs/platform-v7a/platforms/barebox-rpi2.in index d62acd3..82ef1c5 100644 --- a/configs/platform-v7a/platforms/barebox-rpi2.in +++ b/configs/platform-v7a/platforms/barebox-rpi2.in @@ -2,7 +2,7 @@ menuconfig BAREBOX_RPI2 tristate - prompt "Barebox (rpi2)" + prompt "Barebox (rpi2/3/CM3)" select BAREBOX_COMMON help - Raspberry Pi 2 support for barebox. + Raspberry Pi 2, 3, CM3 support for barebox. diff --git a/configs/platform-v7a/platforms/image-rpi2.in b/configs/platform-v7a/platforms/image-rpi2.in index c1ad7c9..cf14b80 100644 --- a/configs/platform-v7a/platforms/image-rpi2.in +++ b/configs/platform-v7a/platforms/image-rpi2.in @@ -7,6 +7,6 @@ config IMAGE_RPI2 select HOST_MTOOLS select IMAGE_ROOT_EXT select BAREBOX_RPI2 - prompt "Generate images/rpi2.hdimg" + prompt "Generate images/rpi.hdimg" help - SD card image for the Raspberry Pi 2 + SD card image for the Raspberry Pi 2, 3 and CM3 diff --git a/configs/platform-v7a/platforms/image-rpi3.in b/configs/platform-v7a/platforms/image-rpi3.in deleted file mode 100644 index 022de98..0000000 --- a/configs/platform-v7a/platforms/image-rpi3.in +++ /dev/null @@ -1,12 +0,0 @@ -## SECTION=image - -config IMAGE_RPI3 - tristate - select HOST_GENIMAGE - select HOST_DOSFSTOOLS - select HOST_MTOOLS - select IMAGE_ROOT_EXT - select BAREBOX_RPI2 - prompt "Generate images/rpi3.hdimg" - help - SD card image for the Raspberry Pi 3 diff --git a/configs/platform-v7a/platforms/image-rpicm3.in b/configs/platform-v7a/platforms/image-rpicm3.in deleted file mode 100644 index 5cecf9a..0000000 --- a/configs/platform-v7a/platforms/image-rpicm3.in +++ /dev/null @@ -1,12 +0,0 @@ -## SECTION=image - -config IMAGE_RPICM3 - tristate - select HOST_GENIMAGE - select HOST_DOSFSTOOLS - select HOST_MTOOLS - select IMAGE_ROOT_EXT - select BAREBOX_RPI2 - prompt "Generate images/rpiCM3.hdimg" - help - SD card image for the Raspberry Pi Compute Module 3 diff --git a/configs/platform-v7a/rpi-firmware/config.txt b/configs/platform-v7a/rpi-firmware/config.txt index 75093b1..d6ecc1e 100644 --- a/configs/platform-v7a/rpi-firmware/config.txt +++ b/configs/platform-v7a/rpi-firmware/config.txt @@ -1,3 +1,5 @@ +# use kernel upstream devicetree names and pass it to barebox +upstream_kernel=1 # Enable the UART (miniuart for RPI3, PL011 for RPI2) enable_uart=1 # Set barebox as third state bootloader diff --git a/configs/platform-v7a/rules/barebox-rpi2.make b/configs/platform-v7a/rules/barebox-rpi2.make index 17f7a33..f1dff40 100644 --- a/configs/platform-v7a/rules/barebox-rpi2.make +++ b/configs/platform-v7a/rules/barebox-rpi2.make @@ -46,8 +46,7 @@ BAREBOX_RPI2_CONF_OPT := \ BAREBOX_RPI2_MAKE_OPT := $(BAREBOX_RPI2_CONF_OPT) -BAREBOX_RPI2_IMAGES := images/barebox-raspberry-pi-2.img images/barebox-raspberry-pi-3.img images/barebox-raspberry-pi-cm3.img -BAREBOX_RPI2_IMAGES := $(addprefix $(BAREBOX_RPI2_BUILD_DIR)/,$(BAREBOX_RPI2_IMAGES)) +BAREBOX_RPI2_DTB_DIR := $(BAREBOX_RPI2_BUILD_DIR)/arch/arm/dts ifdef PTXCONF_BAREBOX_RPI2 $(BAREBOX_RPI2_CONFIG): @@ -82,9 +81,11 @@ $(STATEDIR)/barebox-rpi2.install: $(STATEDIR)/barebox-rpi2.targetinstall: @$(call targetinfo) - @$(foreach image, $(BAREBOX_RPI2_IMAGES), \ + @$(foreach dtb, $(wildcard $(BAREBOX_RPI2_DTB_DIR)/*.dtb), \ install -m 644 \ - $(image) $(IMAGEDIR)/$(notdir $(image))$(ptx/nl)) + $(dtb) $(IMAGEDIR)/barebox-$(notdir $(dtb))$(ptx/nl)) + @install -m 644 $(BAREBOX_RPI2_BUILD_DIR)/images/barebox-dt-2nd.img \ + $(IMAGEDIR)/barebox-dt-2nd-rpi.img @$(call touch) # ---------------------------------------------------------------------------- @@ -94,8 +95,9 @@ $(STATEDIR)/barebox-rpi2.targetinstall: $(STATEDIR)/barebox-rpi2.clean: @$(call targetinfo) @$(call clean_pkg, BAREBOX_RPI2) - @$(foreach image, $(BAREBOX_RPI2_IMAGES), \ - rm -fv $(IMAGEDIR)/$(notdir $(image))$(ptx/nl)) + @$(foreach dtb, $(wildcard $(BAREBOX_RPI2_DTB_DIR)/*.dtb), \ + rm -fv $(IMAGEDIR)/barebox-$(notdir $(dtb))$(ptx/nl)) + @rm -fv $(IMAGEDIR)/barebox-dt-2nd-rpi.img # ---------------------------------------------------------------------------- # oldconfig / menuconfig diff --git a/configs/platform-v7a/rules/image-rpi2.make b/configs/platform-v7a/rules/image-rpi2.make index 8e192e4..db5cbc1 100644 --- a/configs/platform-v7a/rules/image-rpi2.make +++ b/configs/platform-v7a/rules/image-rpi2.make @@ -16,7 +16,7 @@ IMAGE_PACKAGES-$(PTXCONF_IMAGE_RPI2) += image-rpi2 # IMAGE_RPI2 := image-rpi2 IMAGE_RPI2_DIR := $(BUILDDIR)/$(IMAGE_RPI2) -IMAGE_RPI2_IMAGE := $(IMAGEDIR)/rpi2.hdimg +IMAGE_RPI2_IMAGE := $(IMAGEDIR)/rpi.hdimg IMAGE_RPI2_FILES := $(IMAGEDIR)/root.tgz IMAGE_RPI2_CONFIG := rpi2.config IMAGE_RPI2_DATA_DIR := $(call ptx/in-platformconfigdir, rpi-firmware) diff --git a/configs/platform-v7a/rules/image-rpi3.make b/configs/platform-v7a/rules/image-rpi3.make deleted file mode 100644 index 5c56c3a..0000000 --- a/configs/platform-v7a/rules/image-rpi3.make +++ /dev/null @@ -1,46 +0,0 @@ -# -*-makefile-*- -# -# Copyright (C) 2017 by Sascha Hauer <s.hauer@pengutronix.de> -# -# For further information about the PTXdist project and license conditions -# see the README file. -# - -# -# We provide this package -# -IMAGE_PACKAGES-$(PTXCONF_IMAGE_RPI3) += image-rpi3 - -# -# Paths and names -# -IMAGE_RPI3 := image-rpi3 -IMAGE_RPI3_DIR := $(BUILDDIR)/$(IMAGE_RPI3) -IMAGE_RPI3_IMAGE := $(IMAGEDIR)/rpi3.hdimg -IMAGE_RPI3_FILES := $(IMAGEDIR)/root.tgz -IMAGE_RPI3_CONFIG := rpi3.config -IMAGE_RPI3_DATA_DIR := $(call ptx/in-platformconfigdir, rpi-firmware) -IMAGE_RPI3_DATA := \ - $(wildcard $(IMAGE_RPI3_DATA_DIR)/*.bin) \ - $(wildcard $(IMAGE_RPI3_DATA_DIR)/*.elf) \ - $(wildcard $(IMAGE_RPI3_DATA_DIR)/*.dat) \ - $(wildcard $(IMAGE_RPI3_DATA_DIR)/*.dtb) \ - $(wildcard $(IMAGE_RPI3_DATA_DIR)/config.txt) - -# ---------------------------------------------------------------------------- -# Image -# ---------------------------------------------------------------------------- - -define squote_and_comma -$(subst $(ptx/def/space),$(comma) ,$(addsuffix $(ptx/def/squote),$(addprefix $(ptx/def/squote),$(1)))) -endef - -IMAGE_RPI3_ENV := \ - FIRMWARE_RPI3="$(call squote_and_comma,$(IMAGE_RPI3_DATA))" - -$(IMAGE_RPI3_IMAGE): - @$(call targetinfo) - @$(call image/genimage, IMAGE_RPI3) - @$(call finish) - -# vim: syntax=make diff --git a/configs/platform-v7a/rules/image-rpicm3.make b/configs/platform-v7a/rules/image-rpicm3.make deleted file mode 100644 index 81cdd26..0000000 --- a/configs/platform-v7a/rules/image-rpicm3.make +++ /dev/null @@ -1,46 +0,0 @@ -# -*-makefile-*- -# -# Copyright (C) 2017 by Sascha Hauer <s.hauer@pengutronix.de> -# -# For further information about the PTXdist project and license conditions -# see the README file. -# - -# -# We provide this package -# -IMAGE_PACKAGES-$(PTXCONF_IMAGE_RPICM3) += image-rpicm3 - -# -# Paths and names -# -IMAGE_RPICM3 := image-rpicm3 -IMAGE_RPICM3_DIR := $(BUILDDIR)/$(IMAGE_RPICM3) -IMAGE_RPICM3_IMAGE := $(IMAGEDIR)/rpicm3.hdimg -IMAGE_RPICM3_FILES := $(IMAGEDIR)/root.tgz -IMAGE_RPICM3_CONFIG := rpicm3.config -IMAGE_RPICM3_DATA_DIR := $(call ptx/in-platformconfigdir, rpi-firmware) -IMAGE_RPICM3_DATA := \ - $(wildcard $(IMAGE_RPICM3_DATA_DIR)/*.bin) \ - $(wildcard $(IMAGE_RPICM3_DATA_DIR)/*.elf) \ - $(wildcard $(IMAGE_RPICM3_DATA_DIR)/*.dat) \ - $(wildcard $(IMAGE_RPICM3_DATA_DIR)/*.dtb) \ - $(wildcard $(IMAGE_RPICM3_DATA_DIR)/config.txt) - -# ---------------------------------------------------------------------------- -# Image -# ---------------------------------------------------------------------------- - -define squote_and_comma -$(subst $(ptx/def/space),$(comma) ,$(addsuffix $(ptx/def/squote),$(addprefix $(ptx/def/squote),$(1)))) -endef - -IMAGE_RPICM3_ENV := \ - FIRMWARE_RPI3="$(call squote_and_comma,$(IMAGE_RPICM3_DATA))" - -$(IMAGE_RPICM3_IMAGE): - @$(call targetinfo) - @$(call image/genimage, IMAGE_RPICM3) - @$(call finish) - -# vim: syntax=make diff --git a/doc/hardware_v7a_raspi2.rst b/doc/hardware_v7a_raspi2.rst deleted file mode 100644 index a8cdb06..0000000 --- a/doc/hardware_v7a_raspi2.rst +++ /dev/null @@ -1,15 +0,0 @@ -Raspberry Pi 2 -============== - -Boot Media ----------- -Use the image ``platform-v7a/images/rpi2.hdimg`` and copy it onto your MicroSD-Card. - -Serial Console --------------- -The serial boot console is available at J8 (the GPIO header) with 115200 Baud and 8N1 on the following Pins: - -* J8.6: GND -* J8.8: Tx -* J8.10: Rx - diff --git a/doc/hardware_v7a_raspi3.rst b/doc/hardware_v7a_raspi23.rst index 4196a11..0f6eee6 100644 --- a/doc/hardware_v7a_raspi3.rst +++ b/doc/hardware_v7a_raspi23.rst @@ -1,9 +1,24 @@ +Raspberry Pi 2 +============== + +Boot Media +---------- +Use the same ``platform-v7a/images/rpi.hdimg`` image and copy it onto your MicroSD-Card. + +Serial Console +-------------- +The serial boot console is available at J8 (the GPIO header) with 115200 Baud and 8N1 on the following Pins: + +* J8.6: GND +* J8.8: Tx +* J8.10: Rx + Raspberry Pi 3 ============== Boot Media ---------- -Use the image ``platform-v7a/images/rpi3.hdimg`` and copy it onto your MicroSD-Card. +Use the same ``platform-v7a/images/rpi.hdimg`` image and copy it onto your MicroSD-Card. Serial Console -------------- @@ -18,7 +33,7 @@ Raspberry Pi Compute Module 3+ Boot Media ---------- -Use the image ``platform-v7a/images/rpicm3.hdimg`` and copy it onto your MicroSD-Card. +Use the same ``platform-v7a/images/rpi.hdimg`` image and copy it onto your MicroSD-Card. If you have a hardware with eMMC the uSD slot is not functional, in this case you have to use `usbboot <https://github.com/raspberrypi/usbboot>`_ to switch |