From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Mon, 05 Sep 2022 18:36:32 +0200 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1oVF5K-007hy7-Jf for lore@lore.pengutronix.de; Mon, 05 Sep 2022 18:36:32 +0200 Received: from localhost ([127.0.0.1] helo=metis.ext.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1oVF5J-0002SD-9n; Mon, 05 Sep 2022 18:36:29 +0200 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oVF5A-00026l-Dv; Mon, 05 Sep 2022 18:36:20 +0200 Received: from [2a0a:edc0:0:1101:1d::39] (helo=dude03.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1oVF57-00460B-Ji; Mon, 05 Sep 2022 18:36:19 +0200 Received: from mtr by dude03.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1oVF56-00BmRN-Cc; Mon, 05 Sep 2022 18:36:16 +0200 From: Michael Tretter To: distrokit@pengutronix.de Date: Mon, 5 Sep 2022 18:36:09 +0200 Message-Id: <20220905163615.2807729-15-m.tretter@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220905163615.2807729-1-m.tretter@pengutronix.de> References: <20220905163615.2807729-1-m.tretter@pengutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [DistroKit] [PATCH 14/20] v8a: rockchip: add rule for rockchip firmware X-BeenThere: distrokit@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: DistroKit Mailinglist List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mtr@pengutronix.de, jzi@pengutronix.de Sender: "DistroKit" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: distrokit-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false From: Johannes Zink There are prebuilt binaries by Rockchip for SDRAM configuration of the board we use. Add a rule to download them off Github. This rule also downloads BL31 (TF-A) and BL32 (OP-TEE) binaries, which we will eventually compile from source. However, as of now, Rockchip did not release the source code and we have to use use the prebuilt binaries. Any board specific setup we need will happen within Barebox. Signed-off-by: Johannes Zink Signed-off-by: Michael Tretter --- configs/platform-v8a/platformconfig | 6 ++ .../platform-v8a/rules/firmware-rockchip.in | 41 ++++++++++ .../platform-v8a/rules/firmware-rockchip.make | 74 +++++++++++++++++++ 3 files changed, 121 insertions(+) create mode 100644 configs/platform-v8a/rules/firmware-rockchip.in create mode 100644 configs/platform-v8a/rules/firmware-rockchip.make diff --git a/configs/platform-v8a/platformconfig b/configs/platform-v8a/platformconfig index e71e64972435..e00371be7a1c 100644 --- a/configs/platform-v8a/platformconfig +++ b/configs/platform-v8a/platformconfig @@ -265,3 +265,9 @@ PTXCONF_FIRMWARE_IMX=y # # non-free firmware blobs # +PTXCONF_FIRMWARE_ROCKCHIP=y +# PTXCONF_FIRMWARE_ROCKCHIP_RK3566_SDRAM is not set +PTXCONF_FIRMWARE_ROCKCHIP_RK3568_SDRAM=y +PTXCONF_FIRMWARE_ROCKCHIP_RK356x_BL31=y +PTXCONF_FIRMWARE_ROCKCHIP_RK356x_BL32=y +# end of non-free firmware blobs diff --git a/configs/platform-v8a/rules/firmware-rockchip.in b/configs/platform-v8a/rules/firmware-rockchip.in new file mode 100644 index 000000000000..aa702416df00 --- /dev/null +++ b/configs/platform-v8a/rules/firmware-rockchip.in @@ -0,0 +1,41 @@ +## SECTION=non_free_firmware + +menuconfig FIRMWARE_ROCKCHIP + bool + prompt "Rockchip firmware binaries " + help + Rockchip prebuilt SDRAM initialization and TF-A binaries. + +if FIRMWARE_ROCKCHIP + +config FIRMWARE_ROCKCHIP_RK3566_SDRAM + bool + prompt "RK3566 SDRAM init" + help + Rockchip RK3566 SDRAM initialization binary. + Compatible with e.g., the Pine64 Quartz64 Model A board. + +config FIRMWARE_ROCKCHIP_RK3568_SDRAM + bool + prompt "RK3568 SDRAM init" + help + Rockchip RK3568 SDRAM initialization binary. + Compatible with e.g., the Rockchip RK3568 EVB1 board. + +config FIRMWARE_ROCKCHIP_RK356x_BL31 + bool + prompt "RK356x BL31 binary" + help + Rockchip RK3566/RK3568 BL31 binary. + Compatible with e.g., the Pine64 Quartz64 Model A board + and the Rockchip RK3568 EVB1 board. + +config FIRMWARE_ROCKCHIP_RK356x_BL32 + bool + prompt "RK356x BL32 binary" + help + Rockchip RK3566/RK3568 BL32 binary. + Compatible with e.g., the Pine64 Quartz64 Model A board + and the Rockchip RK3568 EVB1 board. + +endif diff --git a/configs/platform-v8a/rules/firmware-rockchip.make b/configs/platform-v8a/rules/firmware-rockchip.make new file mode 100644 index 000000000000..dd50c865a037 --- /dev/null +++ b/configs/platform-v8a/rules/firmware-rockchip.make @@ -0,0 +1,74 @@ +# -*-makefile-*- +# +# Copyright (C) 2021 by Michael Tretter +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +# +# We provide this package +# +PACKAGES-$(PTXCONF_FIRMWARE_ROCKCHIP) += firmware-rockchip + +FIRMWARE_ROCKCHIP_VERSION := 2021-06-01-g7d631e0d +FIRMWARE_ROCKCHIP_MD5 := 4ca62f76ca75019dc708c4cb7cc31b0a +FIRMWARE_ROCKCHIP := firmware-rockchip-$(FIRMWARE_ROCKCHIP_VERSION) +FIRMWARE_ROCKCHIP_SUFFIX := zip +FIRMWARE_ROCKCHIP_URL := https://github.com/rockchip-linux/rkbin/archive/$(FIRMWARE_ROCKCHIP_VERSION).$(FIRMWARE_ROCKCHIP_SUFFIX) +FIRMWARE_ROCKCHIP_SOURCE := $(SRCDIR)/$(FIRMWARE_ROCKCHIP).$(FIRMWARE_ROCKCHIP_SUFFIX) +FIRMWARE_ROCKCHIP_DIR := $(BUILDDIR)/$(FIRMWARE_ROCKCHIP) +FIRMWARE_ROCKCHIP_LICENSE := proprietary + +# ---------------------------------------------------------------------------- +# Prepare +# ---------------------------------------------------------------------------- + +FIRMWARE_ROCKCHIP_CONF_TOOL := NO + +# ---------------------------------------------------------------------------- +# Compile +# ---------------------------------------------------------------------------- + +$(STATEDIR)/firmware-rockchip.compile: + @$(call targetinfo) + @$(call touch) + +# ---------------------------------------------------------------------------- +# Install +# ---------------------------------------------------------------------------- + +$(STATEDIR)/firmware-rockchip.install: + @$(call targetinfo) + +ifdef PTXCONF_FIRMWARE_ROCKCHIP_RK3566_SDRAM + install -v -D -m644 $(FIRMWARE_ROCKCHIP_DIR)/bin/rk35/rk3566_ddr_1056MHz_v1.08.bin \ + $(FIRMWARE_ROCKCHIP_PKGDIR)/usr/lib/firmware/rk3566_ddr_1056MHz_v1.08.bin +endif + +ifdef PTXCONF_FIRMWARE_ROCKCHIP_RK3568_SDRAM + install -v -D -m644 $(FIRMWARE_ROCKCHIP_DIR)/bin/rk35/rk3568_ddr_1560MHz_v1.08.bin \ + $(FIRMWARE_ROCKCHIP_PKGDIR)/usr/lib/firmware/rk3568_ddr_1560MHz_v1.08.bin +endif + +ifdef PTXCONF_FIRMWARE_ROCKCHIP_RK356x_BL31 + install -v -D -m644 $(FIRMWARE_ROCKCHIP_DIR)/bin/rk35/rk3568_bl31_v1.24.elf \ + $(FIRMWARE_ROCKCHIP_PKGDIR)/usr/lib/firmware/rk3568_bl31_v1.24.elf +endif + +ifdef PTXCONF_FIRMWARE_ROCKCHIP_RK356x_BL32 + install -v -D -m644 $(FIRMWARE_ROCKCHIP_DIR)/bin/rk35/rk3568_bl32_v1.05.bin \ + $(FIRMWARE_ROCKCHIP_PKGDIR)/usr/lib/firmware/rk3568_bl32_v1.05.bin +endif + + @$(call touch) + +# ---------------------------------------------------------------------------- +# Target-Install +# ---------------------------------------------------------------------------- + +$(STATEDIR)/firmware-rockchip.targetinstall: + @$(call targetinfo) + @$(call touch) + +# vim: syntax=make -- 2.30.2