mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH 0/3] Add support for Rockchip firmware blobs
@ 2021-12-03 16:54 Michael Riesch
  2021-12-03 16:54 ` [ptxdist] [PATCH 1/3] platforms: add section for non-free " Michael Riesch
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Michael Riesch @ 2021-12-03 16:54 UTC (permalink / raw)
  To: ptxdist; +Cc: michael.tretter, Michael Riesch

Hi all,

Integrating binary firmware blobs provided by vendors into our BSPs
is a nasty part of our job, isn't it... But maybe we can at least
share the efforts to reduce the pain. In this spirit I look forward
to your comments on these patches:

The first patch adds a section dedicated to non-free firmware blobs,
as has been suggested in the firmware-imx rule in DistroKit.
This allows to group the firmware blob rules at a defined point and
disable them with a single switch, if required.

The second patch adds a rule to download the Rockchip binaries, where
the files for the RK3566/RK3568 are in the focus for now. Barebox
support for those two SoCs is coming along rather nicely, but those
blobs are a mandatory requirement.

In similar cases, a separate rule file for barebox have been added to
a ptxdist setup that takes care of integrating the firmware blobs
into the source tree. Maybe a generic approach would eliminate the
need for a different rule file only to copy a few files.

Therefore, the third patch allows to configure files that are
injected into the barebox source tree during preparation. This patch
can be considered as RFC, as my knowledge of the ptxdist internals as
well as my shell script skills leave a lot to be desired. Still I
think you can get the gist.

Have a nice weekend!

Best regards,
Michael

Michael Riesch (3):
  platforms: add section for non-free firmware blobs
  add package for rockchip firmware binaries
  barebox: add integration of firmware blobs

 platforms/Kconfig                      | 10 ++++
 platforms/barebox.in                   | 23 ++++++++
 platforms/firmware-rockchip.in         | 35 ++++++++++++
 rules/barebox.make                     |  6 +++
 rules/firmware-rockchip.make           | 75 ++++++++++++++++++++++++++
 rules/post/ptxd_make_world_inject.make | 19 +++++++
 scripts/lib/ptxd_make_world_inject.sh  | 21 ++++++++
 7 files changed, 189 insertions(+)
 create mode 100644 platforms/firmware-rockchip.in
 create mode 100644 rules/firmware-rockchip.make
 create mode 100644 rules/post/ptxd_make_world_inject.make
 create mode 100644 scripts/lib/ptxd_make_world_inject.sh

-- 
2.30.2


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [ptxdist] [PATCH 1/3] platforms: add section for non-free firmware blobs
  2021-12-03 16:54 [ptxdist] [PATCH 0/3] Add support for Rockchip firmware blobs Michael Riesch
@ 2021-12-03 16:54 ` Michael Riesch
  2021-12-03 16:54 ` [ptxdist] [PATCH 2/3] add package for rockchip firmware binaries Michael Riesch
  2021-12-03 16:54 ` [ptxdist] [RFC PATCH 3/3] barebox: add integration of firmware blobs Michael Riesch
  2 siblings, 0 replies; 12+ messages in thread
From: Michael Riesch @ 2021-12-03 16:54 UTC (permalink / raw)
  To: ptxdist; +Cc: michael.tretter, Michael Riesch

Add a dedicated section for non-free firmware binary blobs, such
as SDRAM initialization binaries.

Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>
---
 platforms/Kconfig | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/platforms/Kconfig b/platforms/Kconfig
index 0bfe34cdc..d9abd712d 100644
--- a/platforms/Kconfig
+++ b/platforms/Kconfig
@@ -40,3 +40,13 @@ source "generated/hosttools_noprompt.in"
 source "generated/hosttools_platform.in"
 
 source "generated/platform_project_specific.in"
+
+menuconfig NON_FREE_FIRMWARE
+       bool
+       prompt "non-free firmware blobs       "
+       help
+         Enable integration of non-free firmware blobs.
+
+if NON_FREE_FIRMWARE
+source "generated/non_free_firmware.in"
+endif
-- 
2.30.2


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [ptxdist] [PATCH 2/3] add package for rockchip firmware binaries
  2021-12-03 16:54 [ptxdist] [PATCH 0/3] Add support for Rockchip firmware blobs Michael Riesch
  2021-12-03 16:54 ` [ptxdist] [PATCH 1/3] platforms: add section for non-free " Michael Riesch
@ 2021-12-03 16:54 ` Michael Riesch
  2021-12-03 17:55   ` Christian Melki
  2021-12-05  0:56   ` Roland Hieber
  2021-12-03 16:54 ` [ptxdist] [RFC PATCH 3/3] barebox: add integration of firmware blobs Michael Riesch
  2 siblings, 2 replies; 12+ messages in thread
From: Michael Riesch @ 2021-12-03 16:54 UTC (permalink / raw)
  To: ptxdist; +Cc: michael.tretter, Michael Riesch

Rockchip provides the SDRAM initialization as well as BL31/BL32
firmware for their SoCs in binary from. Add a package that downloads
those binaries for further use in e.g., barebox.

Signed-off-by: Michael Tretter <michael.tretter@pengutronix.de>
[revised and extended Kconfig]
Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>
---
 platforms/firmware-rockchip.in | 35 ++++++++++++++++
 rules/firmware-rockchip.make   | 75 ++++++++++++++++++++++++++++++++++
 2 files changed, 110 insertions(+)
 create mode 100644 platforms/firmware-rockchip.in
 create mode 100644 rules/firmware-rockchip.make

diff --git a/platforms/firmware-rockchip.in b/platforms/firmware-rockchip.in
new file mode 100644
index 000000000..3b7c996bb
--- /dev/null
+++ b/platforms/firmware-rockchip.in
@@ -0,0 +1,35 @@
+## 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.
+
+config FIRMWARE_ROCKCHIP_RK3568_SDRAM
+       bool
+       prompt "RK3568 SDRAM init"
+       help
+         Rockchip RK3568 SDRAM initialization binary.
+
+config FIRMWARE_ROCKCHIP_RK356x_BL31
+       bool
+       prompt "RK356x BL31 binary"
+       help
+         Rockchip RK3566/RK3568 BL31 binary.
+
+config FIRMWARE_ROCKCHIP_RK356x_BL32
+       bool
+       prompt "RK356x BL32 binary"
+       help
+         Rockchip RK3566/RK3568 BL32 binary.
+
+endif
diff --git a/rules/firmware-rockchip.make b/rules/firmware-rockchip.make
new file mode 100644
index 000000000..54a0b7493
--- /dev/null
+++ b/rules/firmware-rockchip.make
@@ -0,0 +1,75 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2021 by Michael Tretter <m.tretter@pengutronix.de>
+#
+# 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		:= bfb7b9601b88784e263c2cc6baa5da9f
+FIRMWARE_ROCKCHIP		:= firmware-rockchip-$(FIRMWARE_ROCKCHIP_VERSION)
+FIRMWARE_ROCKCHIP_SUFFIX	:= tar.xz
+FIRMWARE_ROCKCHIP_URL		:= \
+	git://github.com/rockchip-linux/rkbin;tag=$(FIRMWARE_ROCKCHIP_VERSION)
+FIRMWARE_ROCKCHIP_SOURCE	:= $(SRCDIR)/$(FIRMWARE_ROCKCHIP).$(FIRMWARE_ROCKCHIP_SUFFIX)
+FIRMWARE_ROCKCHIP_DIR		:= $(BUILDDIR)/$(FIRMWARE_ROCKCHIP)
+FIRMWARE_ROCKCHIP_LICENSE	:= unknown
+
+# ----------------------------------------------------------------------------
+# 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


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [ptxdist] [RFC PATCH 3/3] barebox: add integration of firmware blobs
  2021-12-03 16:54 [ptxdist] [PATCH 0/3] Add support for Rockchip firmware blobs Michael Riesch
  2021-12-03 16:54 ` [ptxdist] [PATCH 1/3] platforms: add section for non-free " Michael Riesch
  2021-12-03 16:54 ` [ptxdist] [PATCH 2/3] add package for rockchip firmware binaries Michael Riesch
@ 2021-12-03 16:54 ` Michael Riesch
  2 siblings, 0 replies; 12+ messages in thread
From: Michael Riesch @ 2021-12-03 16:54 UTC (permalink / raw)
  To: ptxdist; +Cc: michael.tretter, Michael Riesch

In some cases barebox requires firmware blobs, which may be
provided in binary form by the vendor or compiled in a
preceding step. Add the possibility to specify files which
are injected in the barebox source directory during
preparation.

Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>
---
 platforms/barebox.in                   | 23 +++++++++++++++++++++++
 rules/barebox.make                     |  6 ++++++
 rules/post/ptxd_make_world_inject.make | 19 +++++++++++++++++++
 scripts/lib/ptxd_make_world_inject.sh  | 21 +++++++++++++++++++++
 4 files changed, 69 insertions(+)
 create mode 100644 rules/post/ptxd_make_world_inject.make
 create mode 100644 scripts/lib/ptxd_make_world_inject.sh

diff --git a/platforms/barebox.in b/platforms/barebox.in
index d35d16501..422897a66 100644
--- a/platforms/barebox.in
+++ b/platforms/barebox.in
@@ -55,6 +55,29 @@ config BAREBOX_CONFIG
 	  This entry specifies the .config file used to compile
 	  barebox.
 
+menuconfig BAREBOX_FIRMWARE
+	bool
+	prompt "integrate firmware blobs      "
+
+if BAREBOX_FIRMWARE
+
+config BAREBOX_FIRMWARE_PATH
+	string "path(s) to firmware blobs"
+	default "${PTXDIST_SYSROOT_TARGET}/usr/lib/firmware"
+	help
+	  Define path to the firmware blob(s). Multiple directories can
+	  be specified separated by ':'.
+
+config BAREBOX_FIRMWARE_FILES
+	string "firmware blob file(s)"
+	default "<vendorblob>.bin"
+	help
+	  Select the firmware blob to use integrated into the barebox
+	  source before compilation. Multiple dts files can be
+	  specified, separated by spaces.
+
+endif
+
 config BAREBOX_EXTRA_ENV
 	prompt "extend the builtin barebox environment"
 	bool
diff --git a/rules/barebox.make b/rules/barebox.make
index bea9f3adc..a81fc86b3 100644
--- a/rules/barebox.make
+++ b/rules/barebox.make
@@ -26,6 +26,8 @@ BAREBOX_BUILD_DIR	:= $(BAREBOX_DIR)-build
 BAREBOX_LICENSE		:= GPL-2.0-only
 BAREBOX_DEVPKG		:= NO
 BAREBOX_BUILD_OOT	:= KEEP
+BAREBOX_INJECT_PATH	:=$(call remove_quotes,$(PTXCONF_BAREBOX_FIRMWARE_PATH))
+BAREBOX_INJECT_FILES	:=$(call remove_quotes,$(PTXCONF_BAREBOX_FIRMWARE_FILES))
 
 BAREBOX_CONFIG		:= $(call ptx/in-platformconfigdir, \
 		$(call remove_quotes, $(PTXCONF_BAREBOX_CONFIG)))
@@ -94,6 +96,10 @@ ifdef PTXCONF_BAREBOX_EXTRA_ENV
 	@rm -rf $(BAREBOX_BUILD_DIR)/defaultenv/barebox_default_env
 endif
 
+ifdef PTXCONF_BAREBOX_FIRMWARE
+	@$(call world/inject, BAREBOX)
+endif
+
 	@$(call touch)
 
 # ----------------------------------------------------------------------------
diff --git a/rules/post/ptxd_make_world_inject.make b/rules/post/ptxd_make_world_inject.make
new file mode 100644
index 000000000..b7d28e92f
--- /dev/null
+++ b/rules/post/ptxd_make_world_inject.make
@@ -0,0 +1,19 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2021 by Michael Riesch <michael.riesch@wolfvision.net>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+world/inject/env = \
+	$(call world/env, $(1)) \
+	pkg_inject_path="$($(1)_INJECT_PATH)" \
+	pkg_inject_files="$($(1)_INJECT_FILES)" \
+	pkg_source="$($(1)_DIR)"
+
+world/inject = \
+	$(call world/inject/env,$(strip $(1))) \
+	ptxd_make_world_inject
+
+# vim: syntax=make
diff --git a/scripts/lib/ptxd_make_world_inject.sh b/scripts/lib/ptxd_make_world_inject.sh
new file mode 100644
index 000000000..ac3134498
--- /dev/null
+++ b/scripts/lib/ptxd_make_world_inject.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+#
+# Copyright (C) 2021 by Michael Riesch <michael.riesch@wolfvision.net>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+ptxd_make_world_inject() {
+    for pair in ${pkg_inject_files}; do
+	# TODO implement lookup
+
+	source=$pkg_inject_path/$(echo $pair | cut -d ":" -f 1)
+	target=$pkg_source/$(echo $pair | cut -d ":" -f 2)
+
+	echo -e "\nInject file $source into $target..."
+	cp $source $target
+
+    done
+}
+export -f ptxd_make_world_inject
-- 
2.30.2


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [ptxdist] [PATCH 2/3] add package for rockchip firmware binaries
  2021-12-03 16:54 ` [ptxdist] [PATCH 2/3] add package for rockchip firmware binaries Michael Riesch
@ 2021-12-03 17:55   ` Christian Melki
  2021-12-04  7:10     ` Michael Riesch
  2021-12-05  0:56   ` Roland Hieber
  1 sibling, 1 reply; 12+ messages in thread
From: Christian Melki @ 2021-12-03 17:55 UTC (permalink / raw)
  To: ptxdist, Michael Riesch; +Cc: michael.tretter

Hi.

Good idea with a non-free firmware section.
But these Rockchip things looks like they are highly board/project
dependent.
A non-JEDEC timing named DDR-blob? For what board?
RK3566/8 are SoCs afaiu, not complete system implementations?
Also, ARM Trustzone blobs can also be very project specific?

Regards,
Christian

On 12/3/21 17:54, Michael Riesch wrote:
> Rockchip provides the SDRAM initialization as well as BL31/BL32
> firmware for their SoCs in binary from. Add a package that downloads
> those binaries for further use in e.g., barebox.
> 
> Signed-off-by: Michael Tretter <michael.tretter@pengutronix.de>
> [revised and extended Kconfig]
> Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>
> ---
>  platforms/firmware-rockchip.in | 35 ++++++++++++++++
>  rules/firmware-rockchip.make   | 75 ++++++++++++++++++++++++++++++++++
>  2 files changed, 110 insertions(+)
>  create mode 100644 platforms/firmware-rockchip.in
>  create mode 100644 rules/firmware-rockchip.make
> 
> diff --git a/platforms/firmware-rockchip.in b/platforms/firmware-rockchip.in
> new file mode 100644
> index 000000000..3b7c996bb
> --- /dev/null
> +++ b/platforms/firmware-rockchip.in
> @@ -0,0 +1,35 @@
> +## 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.
> +
> +config FIRMWARE_ROCKCHIP_RK3568_SDRAM
> +       bool
> +       prompt "RK3568 SDRAM init"
> +       help
> +         Rockchip RK3568 SDRAM initialization binary.
> +
> +config FIRMWARE_ROCKCHIP_RK356x_BL31
> +       bool
> +       prompt "RK356x BL31 binary"
> +       help
> +         Rockchip RK3566/RK3568 BL31 binary.
> +
> +config FIRMWARE_ROCKCHIP_RK356x_BL32
> +       bool
> +       prompt "RK356x BL32 binary"
> +       help
> +         Rockchip RK3566/RK3568 BL32 binary.
> +
> +endif
> diff --git a/rules/firmware-rockchip.make b/rules/firmware-rockchip.make
> new file mode 100644
> index 000000000..54a0b7493
> --- /dev/null
> +++ b/rules/firmware-rockchip.make
> @@ -0,0 +1,75 @@
> +# -*-makefile-*-
> +#
> +# Copyright (C) 2021 by Michael Tretter <m.tretter@pengutronix.de>
> +#
> +# 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		:= bfb7b9601b88784e263c2cc6baa5da9f
> +FIRMWARE_ROCKCHIP		:= firmware-rockchip-$(FIRMWARE_ROCKCHIP_VERSION)
> +FIRMWARE_ROCKCHIP_SUFFIX	:= tar.xz
> +FIRMWARE_ROCKCHIP_URL		:= \
> +	git://github.com/rockchip-linux/rkbin;tag=$(FIRMWARE_ROCKCHIP_VERSION)
> +FIRMWARE_ROCKCHIP_SOURCE	:= $(SRCDIR)/$(FIRMWARE_ROCKCHIP).$(FIRMWARE_ROCKCHIP_SUFFIX)
> +FIRMWARE_ROCKCHIP_DIR		:= $(BUILDDIR)/$(FIRMWARE_ROCKCHIP)
> +FIRMWARE_ROCKCHIP_LICENSE	:= unknown
> +
> +# ----------------------------------------------------------------------------
> +# 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
> 


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [ptxdist] [PATCH 2/3] add package for rockchip firmware binaries
  2021-12-03 17:55   ` Christian Melki
@ 2021-12-04  7:10     ` Michael Riesch
  2021-12-04 15:37       ` Christian Melki
  0 siblings, 1 reply; 12+ messages in thread
From: Michael Riesch @ 2021-12-04  7:10 UTC (permalink / raw)
  To: christian.melki, ptxdist; +Cc: m.tretter

Hi Christian,

(fixed Michael Tretter's mail address in Cc:)

On 12/3/21 6:55 PM, Christian Melki wrote:
> Hi.
> 
> Good idea with a non-free firmware section.
> But these Rockchip things looks like they are highly board/project
> dependent.
> A non-JEDEC timing named DDR-blob? For what board?
> RK3566/8 are SoCs afaiu, not complete system implementations?
> Also, ARM Trustzone blobs can also be very project specific?

The RK356x SoCs are relatively new and there are not too much boards
around yet. AFAIK all existing boards rely on those binaries due to the
lack of alternatives. Therefore, I thought it would be a nice idea to
provide this package to have at least one solution that works for the
first few boards around (such as the Quartz64 by Pine64 with the RK3566
as well as the RK3568 EVB1).

Future alternative SDRAM setups will indeed require a (possibly
per-board) initialization. Rockchip offers a tool to adjust the binary
blobs to target a different SDRAM setup. Maybe this can be even
integrated into the rule file in a later step -- I haven't figured out
the workflow yet.

A similar thing can be said with regard to the ARM Trustzone blobs. The
two files work on both SoCs (the RK3566 and RK3568 are very similar,
consider the 66 as little brother of the 68) and those files are the
only thing that is available right now. Rockchip has indicated that
there are plans to bring TF-A support for the RK356x mainline, but not
before Q2/2022 IIRC. For the time being, the package under discussion
enables initial support for the currently available boards.

In summary, consider this package as a tool to kick-start development on
recent and future Rockchip SoCs. It is not yet the optimal solution but
it is enables early support for the boards that are available at the
moment. The suggested rule file allows to en/disable the individual
binaries, hence it should be easy to let a different package generate
and install e.g., the TF-A binary.

Best regards,
Michael

> Regards,
> Christian
> 
> On 12/3/21 17:54, Michael Riesch wrote:
>> Rockchip provides the SDRAM initialization as well as BL31/BL32
>> firmware for their SoCs in binary from. Add a package that downloads
>> those binaries for further use in e.g., barebox.
>>
>> Signed-off-by: Michael Tretter <michael.tretter@pengutronix.de>
>> [revised and extended Kconfig]
>> Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>
>> ---
>>   platforms/firmware-rockchip.in | 35 ++++++++++++++++
>>   rules/firmware-rockchip.make   | 75 ++++++++++++++++++++++++++++++++++
>>   2 files changed, 110 insertions(+)
>>   create mode 100644 platforms/firmware-rockchip.in
>>   create mode 100644 rules/firmware-rockchip.make
>>
>> diff --git a/platforms/firmware-rockchip.in b/platforms/firmware-rockchip.in
>> new file mode 100644
>> index 000000000..3b7c996bb
>> --- /dev/null
>> +++ b/platforms/firmware-rockchip.in
>> @@ -0,0 +1,35 @@
>> +## 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.
>> +
>> +config FIRMWARE_ROCKCHIP_RK3568_SDRAM
>> +       bool
>> +       prompt "RK3568 SDRAM init"
>> +       help
>> +         Rockchip RK3568 SDRAM initialization binary.
>> +
>> +config FIRMWARE_ROCKCHIP_RK356x_BL31
>> +       bool
>> +       prompt "RK356x BL31 binary"
>> +       help
>> +         Rockchip RK3566/RK3568 BL31 binary.
>> +
>> +config FIRMWARE_ROCKCHIP_RK356x_BL32
>> +       bool
>> +       prompt "RK356x BL32 binary"
>> +       help
>> +         Rockchip RK3566/RK3568 BL32 binary.
>> +
>> +endif
>> diff --git a/rules/firmware-rockchip.make b/rules/firmware-rockchip.make
>> new file mode 100644
>> index 000000000..54a0b7493
>> --- /dev/null
>> +++ b/rules/firmware-rockchip.make
>> @@ -0,0 +1,75 @@
>> +# -*-makefile-*-
>> +#
>> +# Copyright (C) 2021 by Michael Tretter <m.tretter@pengutronix.de>
>> +#
>> +# 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		:= bfb7b9601b88784e263c2cc6baa5da9f
>> +FIRMWARE_ROCKCHIP		:= firmware-rockchip-$(FIRMWARE_ROCKCHIP_VERSION)
>> +FIRMWARE_ROCKCHIP_SUFFIX	:= tar.xz
>> +FIRMWARE_ROCKCHIP_URL		:= \
>> +	git://github.com/rockchip-linux/rkbin;tag=$(FIRMWARE_ROCKCHIP_VERSION)
>> +FIRMWARE_ROCKCHIP_SOURCE	:= $(SRCDIR)/$(FIRMWARE_ROCKCHIP).$(FIRMWARE_ROCKCHIP_SUFFIX)
>> +FIRMWARE_ROCKCHIP_DIR		:= $(BUILDDIR)/$(FIRMWARE_ROCKCHIP)
>> +FIRMWARE_ROCKCHIP_LICENSE	:= unknown
>> +
>> +# ----------------------------------------------------------------------------
>> +# 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
>>
> 

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [ptxdist] [PATCH 2/3] add package for rockchip firmware binaries
  2021-12-04  7:10     ` Michael Riesch
@ 2021-12-04 15:37       ` Christian Melki
  2021-12-06  6:06         ` Michael Riesch
  0 siblings, 1 reply; 12+ messages in thread
From: Christian Melki @ 2021-12-04 15:37 UTC (permalink / raw)
  To: Michael Riesch, ptxdist; +Cc: m.tretter

On 12/4/21 08:10, Michael Riesch wrote:
> Hi Christian,
> 
> (fixed Michael Tretter's mail address in Cc:)
> 
> On 12/3/21 6:55 PM, Christian Melki wrote:
>> Hi.
>>
>> Good idea with a non-free firmware section.
>> But these Rockchip things looks like they are highly board/project
>> dependent.
>> A non-JEDEC timing named DDR-blob? For what board?
>> RK3566/8 are SoCs afaiu, not complete system implementations?
>> Also, ARM Trustzone blobs can also be very project specific?
> 
> The RK356x SoCs are relatively new and there are not too much boards
> around yet. AFAIK all existing boards rely on those binaries due to the
> lack of alternatives. Therefore, I thought it would be a nice idea to
> provide this package to have at least one solution that works for the
> first few boards around (such as the Quartz64 by Pine64 with the RK3566
> as well as the RK3568 EVB1).
> 
> Future alternative SDRAM setups will indeed require a (possibly
> per-board) initialization. Rockchip offers a tool to adjust the binary
> blobs to target a different SDRAM setup. Maybe this can be even
> integrated into the rule file in a later step -- I haven't figured out
> the workflow yet.
> 
> A similar thing can be said with regard to the ARM Trustzone blobs. The
> two files work on both SoCs (the RK3566 and RK3568 are very similar,
> consider the 66 as little brother of the 68) and those files are the
> only thing that is available right now. Rockchip has indicated that
> there are plans to bring TF-A support for the RK356x mainline, but not
> before Q2/2022 IIRC. For the time being, the package under discussion
> enables initial support for the currently available boards.
> 
> In summary, consider this package as a tool to kick-start development on
> recent and future Rockchip SoCs. It is not yet the optimal solution but
> it is enables early support for the boards that are available at the
> moment. The suggested rule file allows to en/disable the individual
> binaries, hence it should be easy to let a different package generate
> and install e.g., the TF-A binary.
> 
> Best regards,
> Michael
> 

I don't mind. I like the firmware effort. But could you please change
the Kconfig help to indicate which board(s)/board versions this is meant
to run on? As that's the implementation it's actually tied to.

Best regards,
Christian

>> Regards,
>> Christian
>>
>> On 12/3/21 17:54, Michael Riesch wrote:
>>> Rockchip provides the SDRAM initialization as well as BL31/BL32
>>> firmware for their SoCs in binary from. Add a package that downloads
>>> those binaries for further use in e.g., barebox.
>>>
>>> Signed-off-by: Michael Tretter <michael.tretter@pengutronix.de>
>>> [revised and extended Kconfig]
>>> Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>
>>> ---
>>>   platforms/firmware-rockchip.in | 35 ++++++++++++++++
>>>   rules/firmware-rockchip.make   | 75 ++++++++++++++++++++++++++++++++++
>>>   2 files changed, 110 insertions(+)
>>>   create mode 100644 platforms/firmware-rockchip.in
>>>   create mode 100644 rules/firmware-rockchip.make
>>>
>>> diff --git a/platforms/firmware-rockchip.in b/platforms/firmware-rockchip.in
>>> new file mode 100644
>>> index 000000000..3b7c996bb
>>> --- /dev/null
>>> +++ b/platforms/firmware-rockchip.in
>>> @@ -0,0 +1,35 @@
>>> +## 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.
>>> +
>>> +config FIRMWARE_ROCKCHIP_RK3568_SDRAM
>>> +       bool
>>> +       prompt "RK3568 SDRAM init"
>>> +       help
>>> +         Rockchip RK3568 SDRAM initialization binary.
>>> +
>>> +config FIRMWARE_ROCKCHIP_RK356x_BL31
>>> +       bool
>>> +       prompt "RK356x BL31 binary"
>>> +       help
>>> +         Rockchip RK3566/RK3568 BL31 binary.
>>> +
>>> +config FIRMWARE_ROCKCHIP_RK356x_BL32
>>> +       bool
>>> +       prompt "RK356x BL32 binary"
>>> +       help
>>> +         Rockchip RK3566/RK3568 BL32 binary.
>>> +
>>> +endif
>>> diff --git a/rules/firmware-rockchip.make b/rules/firmware-rockchip.make
>>> new file mode 100644
>>> index 000000000..54a0b7493
>>> --- /dev/null
>>> +++ b/rules/firmware-rockchip.make
>>> @@ -0,0 +1,75 @@
>>> +# -*-makefile-*-
>>> +#
>>> +# Copyright (C) 2021 by Michael Tretter <m.tretter@pengutronix.de>
>>> +#
>>> +# 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		:= bfb7b9601b88784e263c2cc6baa5da9f
>>> +FIRMWARE_ROCKCHIP		:= firmware-rockchip-$(FIRMWARE_ROCKCHIP_VERSION)
>>> +FIRMWARE_ROCKCHIP_SUFFIX	:= tar.xz
>>> +FIRMWARE_ROCKCHIP_URL		:= \
>>> +	git://github.com/rockchip-linux/rkbin;tag=$(FIRMWARE_ROCKCHIP_VERSION)
>>> +FIRMWARE_ROCKCHIP_SOURCE	:= $(SRCDIR)/$(FIRMWARE_ROCKCHIP).$(FIRMWARE_ROCKCHIP_SUFFIX)
>>> +FIRMWARE_ROCKCHIP_DIR		:= $(BUILDDIR)/$(FIRMWARE_ROCKCHIP)
>>> +FIRMWARE_ROCKCHIP_LICENSE	:= unknown
>>> +
>>> +# ----------------------------------------------------------------------------
>>> +# 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
>>>
>>


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [ptxdist] [PATCH 2/3] add package for rockchip firmware binaries
  2021-12-03 16:54 ` [ptxdist] [PATCH 2/3] add package for rockchip firmware binaries Michael Riesch
  2021-12-03 17:55   ` Christian Melki
@ 2021-12-05  0:56   ` Roland Hieber
  2021-12-05  1:00     ` Roland Hieber
  2021-12-06  6:27     ` Michael Riesch
  1 sibling, 2 replies; 12+ messages in thread
From: Roland Hieber @ 2021-12-05  0:56 UTC (permalink / raw)
  To: Michael Riesch; +Cc: ptxdist, michael.tretter

On Fri, Dec 03, 2021 at 05:54:39PM +0100, Michael Riesch wrote:
> Rockchip provides the SDRAM initialization as well as BL31/BL32
> firmware for their SoCs in binary from. Add a package that downloads
> those binaries for further use in e.g., barebox.
> 
> Signed-off-by: Michael Tretter <michael.tretter@pengutronix.de>
> [revised and extended Kconfig]
> Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>
> ---
>  platforms/firmware-rockchip.in | 35 ++++++++++++++++
>  rules/firmware-rockchip.make   | 75 ++++++++++++++++++++++++++++++++++
>  2 files changed, 110 insertions(+)
>  create mode 100644 platforms/firmware-rockchip.in
>  create mode 100644 rules/firmware-rockchip.make
> 
> diff --git a/platforms/firmware-rockchip.in b/platforms/firmware-rockchip.in
> new file mode 100644
> index 000000000..3b7c996bb
> --- /dev/null
> +++ b/platforms/firmware-rockchip.in
> @@ -0,0 +1,35 @@
> +## 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.
> +
> +config FIRMWARE_ROCKCHIP_RK3568_SDRAM
> +       bool
> +       prompt "RK3568 SDRAM init"
> +       help
> +         Rockchip RK3568 SDRAM initialization binary.
> +
> +config FIRMWARE_ROCKCHIP_RK356x_BL31
> +       bool
> +       prompt "RK356x BL31 binary"
> +       help
> +         Rockchip RK3566/RK3568 BL31 binary.
> +
> +config FIRMWARE_ROCKCHIP_RK356x_BL32
> +       bool
> +       prompt "RK356x BL32 binary"
> +       help
> +         Rockchip RK3566/RK3568 BL32 binary.
> +
> +endif
> diff --git a/rules/firmware-rockchip.make b/rules/firmware-rockchip.make
> new file mode 100644
> index 000000000..54a0b7493
> --- /dev/null
> +++ b/rules/firmware-rockchip.make
> @@ -0,0 +1,75 @@
> +# -*-makefile-*-
> +#
> +# Copyright (C) 2021 by Michael Tretter <m.tretter@pengutronix.de>
> +#
> +# 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		:= bfb7b9601b88784e263c2cc6baa5da9f
> +FIRMWARE_ROCKCHIP		:= firmware-rockchip-$(FIRMWARE_ROCKCHIP_VERSION)
> +FIRMWARE_ROCKCHIP_SUFFIX	:= tar.xz
> +FIRMWARE_ROCKCHIP_URL		:= \
> +	git://github.com/rockchip-linux/rkbin;tag=$(FIRMWARE_ROCKCHIP_VERSION)

GitHub will stop serving the git:// protocol starting next year [1]. You
should be able to just use the usual archive URLs instead with the
git-describe-like version. This way you also don't need to clone the
whole git repo first:

  https://github.com/rockchip-linux/rkbin/archive/$(FIRMWARE_ROCKCHIP_VERSION).zip

(but you only get .zips from it.)

[1]: https://github.blog/2021-09-01-improving-git-protocol-security-github/

> +FIRMWARE_ROCKCHIP_SOURCE	:= $(SRCDIR)/$(FIRMWARE_ROCKCHIP).$(FIRMWARE_ROCKCHIP_SUFFIX)
> +FIRMWARE_ROCKCHIP_DIR		:= $(BUILDDIR)/$(FIRMWARE_ROCKCHIP)
> +FIRMWARE_ROCKCHIP_LICENSE	:= unknown

My Chinese is not good enough, but we should probably classify this as
proprietary.

> +
> +# ----------------------------------------------------------------------------
> +# Prepare
> +# ----------------------------------------------------------------------------
> +
> +FIRMWARE_ROCKCHIP_CONF_TOOL:= NO

Please add a space before the walrus operator.

> +
> +# ----------------------------------------------------------------------------
> +# 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)

Nothing installed on the target? Are they for compile-time use only?

 - Roland

> +	@$(call touch)
> +
> +# vim: syntax=make
> -- 
> 2.30.2

-- 
Roland Hieber, Pengutronix e.K.          | r.hieber@pengutronix.de     |
Steuerwalder Str. 21                     | https://www.pengutronix.de/ |
31137 Hildesheim, Germany                | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686         | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [ptxdist] [PATCH 2/3] add package for rockchip firmware binaries
  2021-12-05  0:56   ` Roland Hieber
@ 2021-12-05  1:00     ` Roland Hieber
  2021-12-05  9:07       ` Michael Riesch
  2021-12-06  6:27     ` Michael Riesch
  1 sibling, 1 reply; 12+ messages in thread
From: Roland Hieber @ 2021-12-05  1:00 UTC (permalink / raw)
  To: Michael Riesch; +Cc: ptxdist, m.tretter

On Sun, Dec 05, 2021 at 01:56:45AM +0100, Roland Hieber wrote:
> On Fri, Dec 03, 2021 at 05:54:39PM +0100, Michael Riesch wrote:
> > Rockchip provides the SDRAM initialization as well as BL31/BL32
> > firmware for their SoCs in binary from. Add a package that downloads
> > those binaries for further use in e.g., barebox.
> > 
> > Signed-off-by: Michael Tretter <michael.tretter@pengutronix.de>

We have so many Michaels here at PTX, we usually just abbreviate them.
So the correct address is <m.tretter@pengutronix.de> ;-)

 - Roland

> > [revised and extended Kconfig]
> > Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>
> > ---
> >  platforms/firmware-rockchip.in | 35 ++++++++++++++++
> >  rules/firmware-rockchip.make   | 75 ++++++++++++++++++++++++++++++++++
> >  2 files changed, 110 insertions(+)
> >  create mode 100644 platforms/firmware-rockchip.in
> >  create mode 100644 rules/firmware-rockchip.make
> > 
> > diff --git a/platforms/firmware-rockchip.in b/platforms/firmware-rockchip.in
> > new file mode 100644
> > index 000000000..3b7c996bb
> > --- /dev/null
> > +++ b/platforms/firmware-rockchip.in
> > @@ -0,0 +1,35 @@
> > +## 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.
> > +
> > +config FIRMWARE_ROCKCHIP_RK3568_SDRAM
> > +       bool
> > +       prompt "RK3568 SDRAM init"
> > +       help
> > +         Rockchip RK3568 SDRAM initialization binary.
> > +
> > +config FIRMWARE_ROCKCHIP_RK356x_BL31
> > +       bool
> > +       prompt "RK356x BL31 binary"
> > +       help
> > +         Rockchip RK3566/RK3568 BL31 binary.
> > +
> > +config FIRMWARE_ROCKCHIP_RK356x_BL32
> > +       bool
> > +       prompt "RK356x BL32 binary"
> > +       help
> > +         Rockchip RK3566/RK3568 BL32 binary.
> > +
> > +endif
> > diff --git a/rules/firmware-rockchip.make b/rules/firmware-rockchip.make
> > new file mode 100644
> > index 000000000..54a0b7493
> > --- /dev/null
> > +++ b/rules/firmware-rockchip.make
> > @@ -0,0 +1,75 @@
> > +# -*-makefile-*-
> > +#
> > +# Copyright (C) 2021 by Michael Tretter <m.tretter@pengutronix.de>
> > +#
> > +# 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		:= bfb7b9601b88784e263c2cc6baa5da9f
> > +FIRMWARE_ROCKCHIP		:= firmware-rockchip-$(FIRMWARE_ROCKCHIP_VERSION)
> > +FIRMWARE_ROCKCHIP_SUFFIX	:= tar.xz
> > +FIRMWARE_ROCKCHIP_URL		:= \
> > +	git://github.com/rockchip-linux/rkbin;tag=$(FIRMWARE_ROCKCHIP_VERSION)
> 
> GitHub will stop serving the git:// protocol starting next year [1]. You
> should be able to just use the usual archive URLs instead with the
> git-describe-like version. This way you also don't need to clone the
> whole git repo first:
> 
>   https://github.com/rockchip-linux/rkbin/archive/$(FIRMWARE_ROCKCHIP_VERSION).zip
> 
> (but you only get .zips from it.)
> 
> [1]: https://github.blog/2021-09-01-improving-git-protocol-security-github/
> 
> > +FIRMWARE_ROCKCHIP_SOURCE	:= $(SRCDIR)/$(FIRMWARE_ROCKCHIP).$(FIRMWARE_ROCKCHIP_SUFFIX)
> > +FIRMWARE_ROCKCHIP_DIR		:= $(BUILDDIR)/$(FIRMWARE_ROCKCHIP)
> > +FIRMWARE_ROCKCHIP_LICENSE	:= unknown
> 
> My Chinese is not good enough, but we should probably classify this as
> proprietary.
> 
> > +
> > +# ----------------------------------------------------------------------------
> > +# Prepare
> > +# ----------------------------------------------------------------------------
> > +
> > +FIRMWARE_ROCKCHIP_CONF_TOOL:= NO
> 
> Please add a space before the walrus operator.
> 
> > +
> > +# ----------------------------------------------------------------------------
> > +# 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)
> 
> Nothing installed on the target? Are they for compile-time use only?
> 
>  - Roland
> 
> > +	@$(call touch)
> > +
> > +# vim: syntax=make
> > -- 
> > 2.30.2
> 
> -- 
> Roland Hieber, Pengutronix e.K.          | r.hieber@pengutronix.de     |
> Steuerwalder Str. 21                     | https://www.pengutronix.de/ |
> 31137 Hildesheim, Germany                | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686         | Fax:   +49-5121-206917-5555 |
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de
> To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de
> 

-- 
Roland Hieber, Pengutronix e.K.          | r.hieber@pengutronix.de     |
Steuerwalder Str. 21                     | https://www.pengutronix.de/ |
31137 Hildesheim, Germany                | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686         | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [ptxdist] [PATCH 2/3] add package for rockchip firmware binaries
  2021-12-05  1:00     ` Roland Hieber
@ 2021-12-05  9:07       ` Michael Riesch
  0 siblings, 0 replies; 12+ messages in thread
From: Michael Riesch @ 2021-12-05  9:07 UTC (permalink / raw)
  To: Roland Hieber; +Cc: ptxdist, m.tretter

Hello Roland,

Thanks for your review, I'll address your comments in a v2.

On 12/5/21 2:00 AM, Roland Hieber wrote:
> On Sun, Dec 05, 2021 at 01:56:45AM +0100, Roland Hieber wrote:
>> On Fri, Dec 03, 2021 at 05:54:39PM +0100, Michael Riesch wrote:
>>> Rockchip provides the SDRAM initialization as well as BL31/BL32
>>> firmware for their SoCs in binary from. Add a package that downloads
>>> those binaries for further use in e.g., barebox.
>>>
>>> Signed-off-by: Michael Tretter <michael.tretter@pengutronix.de>
> 
> We have so many Michaels here at PTX, we usually just abbreviate them.
> So the correct address is <m.tretter@pengutronix.de> ;-)

Sorry for this silly mistake -- confused it with my own mail adress :-|
Will fix this in v2.

Best regards,
Michael (yet another one)

> 
>  - Roland
> 
>>> [revised and extended Kconfig]
>>> Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>
>>> ---
>>>  platforms/firmware-rockchip.in | 35 ++++++++++++++++
>>>  rules/firmware-rockchip.make   | 75 ++++++++++++++++++++++++++++++++++
>>>  2 files changed, 110 insertions(+)
>>>  create mode 100644 platforms/firmware-rockchip.in
>>>  create mode 100644 rules/firmware-rockchip.make
>>>
>>> diff --git a/platforms/firmware-rockchip.in b/platforms/firmware-rockchip.in
>>> new file mode 100644
>>> index 000000000..3b7c996bb
>>> --- /dev/null
>>> +++ b/platforms/firmware-rockchip.in
>>> @@ -0,0 +1,35 @@
>>> +## 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.
>>> +
>>> +config FIRMWARE_ROCKCHIP_RK3568_SDRAM
>>> +       bool
>>> +       prompt "RK3568 SDRAM init"
>>> +       help
>>> +         Rockchip RK3568 SDRAM initialization binary.
>>> +
>>> +config FIRMWARE_ROCKCHIP_RK356x_BL31
>>> +       bool
>>> +       prompt "RK356x BL31 binary"
>>> +       help
>>> +         Rockchip RK3566/RK3568 BL31 binary.
>>> +
>>> +config FIRMWARE_ROCKCHIP_RK356x_BL32
>>> +       bool
>>> +       prompt "RK356x BL32 binary"
>>> +       help
>>> +         Rockchip RK3566/RK3568 BL32 binary.
>>> +
>>> +endif
>>> diff --git a/rules/firmware-rockchip.make b/rules/firmware-rockchip.make
>>> new file mode 100644
>>> index 000000000..54a0b7493
>>> --- /dev/null
>>> +++ b/rules/firmware-rockchip.make
>>> @@ -0,0 +1,75 @@
>>> +# -*-makefile-*-
>>> +#
>>> +# Copyright (C) 2021 by Michael Tretter <m.tretter@pengutronix.de>
>>> +#
>>> +# 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		:= bfb7b9601b88784e263c2cc6baa5da9f
>>> +FIRMWARE_ROCKCHIP		:= firmware-rockchip-$(FIRMWARE_ROCKCHIP_VERSION)
>>> +FIRMWARE_ROCKCHIP_SUFFIX	:= tar.xz
>>> +FIRMWARE_ROCKCHIP_URL		:= \
>>> +	git://github.com/rockchip-linux/rkbin;tag=$(FIRMWARE_ROCKCHIP_VERSION)
>>
>> GitHub will stop serving the git:// protocol starting next year [1]. You
>> should be able to just use the usual archive URLs instead with the
>> git-describe-like version. This way you also don't need to clone the
>> whole git repo first:
>>
>>   https://github.com/rockchip-linux/rkbin/archive/$(FIRMWARE_ROCKCHIP_VERSION).zip
>>
>> (but you only get .zips from it.)
>>
>> [1]: https://github.blog/2021-09-01-improving-git-protocol-security-github/
>>
>>> +FIRMWARE_ROCKCHIP_SOURCE	:= $(SRCDIR)/$(FIRMWARE_ROCKCHIP).$(FIRMWARE_ROCKCHIP_SUFFIX)
>>> +FIRMWARE_ROCKCHIP_DIR		:= $(BUILDDIR)/$(FIRMWARE_ROCKCHIP)
>>> +FIRMWARE_ROCKCHIP_LICENSE	:= unknown
>>
>> My Chinese is not good enough, but we should probably classify this as
>> proprietary.
>>
>>> +
>>> +# ----------------------------------------------------------------------------
>>> +# Prepare
>>> +# ----------------------------------------------------------------------------
>>> +
>>> +FIRMWARE_ROCKCHIP_CONF_TOOL:= NO
>>
>> Please add a space before the walrus operator.
>>
>>> +
>>> +# ----------------------------------------------------------------------------
>>> +# 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)
>>
>> Nothing installed on the target? Are they for compile-time use only?
>>
>>  - Roland
>>
>>> +	@$(call touch)
>>> +
>>> +# vim: syntax=make
>>> -- 
>>> 2.30.2
>>
>> -- 
>> Roland Hieber, Pengutronix e.K.          | r.hieber@pengutronix.de     |
>> Steuerwalder Str. 21                     | https://www.pengutronix.de/ |
>> 31137 Hildesheim, Germany                | Phone: +49-5121-206917-0    |
>> Amtsgericht Hildesheim, HRA 2686         | Fax:   +49-5121-206917-5555 |
>>
>> _______________________________________________
>> ptxdist mailing list
>> ptxdist@pengutronix.de
>> To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de
>>
> 

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [ptxdist] [PATCH 2/3] add package for rockchip firmware binaries
  2021-12-04 15:37       ` Christian Melki
@ 2021-12-06  6:06         ` Michael Riesch
  0 siblings, 0 replies; 12+ messages in thread
From: Michael Riesch @ 2021-12-06  6:06 UTC (permalink / raw)
  To: christian.melki, ptxdist; +Cc: m.tretter

Hello Christian,

On 12/4/21 4:37 PM, Christian Melki wrote:
> On 12/4/21 08:10, Michael Riesch wrote:
>> Hi Christian,
>>
>> (fixed Michael Tretter's mail address in Cc:)
>>
>> On 12/3/21 6:55 PM, Christian Melki wrote:
>>> Hi.
>>>
>>> Good idea with a non-free firmware section.
>>> But these Rockchip things looks like they are highly board/project
>>> dependent.
>>> A non-JEDEC timing named DDR-blob? For what board?
>>> RK3566/8 are SoCs afaiu, not complete system implementations?
>>> Also, ARM Trustzone blobs can also be very project specific?
>>
>> The RK356x SoCs are relatively new and there are not too much boards
>> around yet. AFAIK all existing boards rely on those binaries due to the
>> lack of alternatives. Therefore, I thought it would be a nice idea to
>> provide this package to have at least one solution that works for the
>> first few boards around (such as the Quartz64 by Pine64 with the RK3566
>> as well as the RK3568 EVB1).
>>
>> Future alternative SDRAM setups will indeed require a (possibly
>> per-board) initialization. Rockchip offers a tool to adjust the binary
>> blobs to target a different SDRAM setup. Maybe this can be even
>> integrated into the rule file in a later step -- I haven't figured out
>> the workflow yet.
>>
>> A similar thing can be said with regard to the ARM Trustzone blobs. The
>> two files work on both SoCs (the RK3566 and RK3568 are very similar,
>> consider the 66 as little brother of the 68) and those files are the
>> only thing that is available right now. Rockchip has indicated that
>> there are plans to bring TF-A support for the RK356x mainline, but not
>> before Q2/2022 IIRC. For the time being, the package under discussion
>> enables initial support for the currently available boards.
>>
>> In summary, consider this package as a tool to kick-start development on
>> recent and future Rockchip SoCs. It is not yet the optimal solution but
>> it is enables early support for the boards that are available at the
>> moment. The suggested rule file allows to en/disable the individual
>> binaries, hence it should be easy to let a different package generate
>> and install e.g., the TF-A binary.
>>
>> Best regards,
>> Michael
>>
> 
> I don't mind. I like the firmware effort. But could you please change
> the Kconfig help to indicate which board(s)/board versions this is meant
> to run on? As that's the implementation it's actually tied to.

I'll add a note in this regard in v2.

Best regards,
Michael

> 
> Best regards,
> Christian
> 
>>> Regards,
>>> Christian
>>>
>>> On 12/3/21 17:54, Michael Riesch wrote:
>>>> Rockchip provides the SDRAM initialization as well as BL31/BL32
>>>> firmware for their SoCs in binary from. Add a package that downloads
>>>> those binaries for further use in e.g., barebox.
>>>>
>>>> Signed-off-by: Michael Tretter <michael.tretter@pengutronix.de>
>>>> [revised and extended Kconfig]
>>>> Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>
>>>> ---
>>>>   platforms/firmware-rockchip.in | 35 ++++++++++++++++
>>>>   rules/firmware-rockchip.make   | 75 ++++++++++++++++++++++++++++++++++
>>>>   2 files changed, 110 insertions(+)
>>>>   create mode 100644 platforms/firmware-rockchip.in
>>>>   create mode 100644 rules/firmware-rockchip.make
>>>>
>>>> diff --git a/platforms/firmware-rockchip.in b/platforms/firmware-rockchip.in
>>>> new file mode 100644
>>>> index 000000000..3b7c996bb
>>>> --- /dev/null
>>>> +++ b/platforms/firmware-rockchip.in
>>>> @@ -0,0 +1,35 @@
>>>> +## 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.
>>>> +
>>>> +config FIRMWARE_ROCKCHIP_RK3568_SDRAM
>>>> +       bool
>>>> +       prompt "RK3568 SDRAM init"
>>>> +       help
>>>> +         Rockchip RK3568 SDRAM initialization binary.
>>>> +
>>>> +config FIRMWARE_ROCKCHIP_RK356x_BL31
>>>> +       bool
>>>> +       prompt "RK356x BL31 binary"
>>>> +       help
>>>> +         Rockchip RK3566/RK3568 BL31 binary.
>>>> +
>>>> +config FIRMWARE_ROCKCHIP_RK356x_BL32
>>>> +       bool
>>>> +       prompt "RK356x BL32 binary"
>>>> +       help
>>>> +         Rockchip RK3566/RK3568 BL32 binary.
>>>> +
>>>> +endif
>>>> diff --git a/rules/firmware-rockchip.make b/rules/firmware-rockchip.make
>>>> new file mode 100644
>>>> index 000000000..54a0b7493
>>>> --- /dev/null
>>>> +++ b/rules/firmware-rockchip.make
>>>> @@ -0,0 +1,75 @@
>>>> +# -*-makefile-*-
>>>> +#
>>>> +# Copyright (C) 2021 by Michael Tretter <m.tretter@pengutronix.de>
>>>> +#
>>>> +# 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		:= bfb7b9601b88784e263c2cc6baa5da9f
>>>> +FIRMWARE_ROCKCHIP		:= firmware-rockchip-$(FIRMWARE_ROCKCHIP_VERSION)
>>>> +FIRMWARE_ROCKCHIP_SUFFIX	:= tar.xz
>>>> +FIRMWARE_ROCKCHIP_URL		:= \
>>>> +	git://github.com/rockchip-linux/rkbin;tag=$(FIRMWARE_ROCKCHIP_VERSION)
>>>> +FIRMWARE_ROCKCHIP_SOURCE	:= $(SRCDIR)/$(FIRMWARE_ROCKCHIP).$(FIRMWARE_ROCKCHIP_SUFFIX)
>>>> +FIRMWARE_ROCKCHIP_DIR		:= $(BUILDDIR)/$(FIRMWARE_ROCKCHIP)
>>>> +FIRMWARE_ROCKCHIP_LICENSE	:= unknown
>>>> +
>>>> +# ----------------------------------------------------------------------------
>>>> +# 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
>>>>
>>>
> 

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [ptxdist] [PATCH 2/3] add package for rockchip firmware binaries
  2021-12-05  0:56   ` Roland Hieber
  2021-12-05  1:00     ` Roland Hieber
@ 2021-12-06  6:27     ` Michael Riesch
  1 sibling, 0 replies; 12+ messages in thread
From: Michael Riesch @ 2021-12-06  6:27 UTC (permalink / raw)
  To: Roland Hieber; +Cc: ptxdist, m.tretter

Hello Roland,

On 12/5/21 1:56 AM, Roland Hieber wrote:
> On Fri, Dec 03, 2021 at 05:54:39PM +0100, Michael Riesch wrote:
>> Rockchip provides the SDRAM initialization as well as BL31/BL32
>> firmware for their SoCs in binary from. Add a package that downloads
>> those binaries for further use in e.g., barebox.
>>
>> Signed-off-by: Michael Tretter <michael.tretter@pengutronix.de>
>> [revised and extended Kconfig]
>> Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>
>> ---
>>  platforms/firmware-rockchip.in | 35 ++++++++++++++++
>>  rules/firmware-rockchip.make   | 75 ++++++++++++++++++++++++++++++++++
>>  2 files changed, 110 insertions(+)
>>  create mode 100644 platforms/firmware-rockchip.in
>>  create mode 100644 rules/firmware-rockchip.make
>>
>> diff --git a/platforms/firmware-rockchip.in b/platforms/firmware-rockchip.in
>> new file mode 100644
>> index 000000000..3b7c996bb
>> --- /dev/null
>> +++ b/platforms/firmware-rockchip.in
>> @@ -0,0 +1,35 @@
>> +## 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.
>> +
>> +config FIRMWARE_ROCKCHIP_RK3568_SDRAM
>> +       bool
>> +       prompt "RK3568 SDRAM init"
>> +       help
>> +         Rockchip RK3568 SDRAM initialization binary.
>> +
>> +config FIRMWARE_ROCKCHIP_RK356x_BL31
>> +       bool
>> +       prompt "RK356x BL31 binary"
>> +       help
>> +         Rockchip RK3566/RK3568 BL31 binary.
>> +
>> +config FIRMWARE_ROCKCHIP_RK356x_BL32
>> +       bool
>> +       prompt "RK356x BL32 binary"
>> +       help
>> +         Rockchip RK3566/RK3568 BL32 binary.
>> +
>> +endif
>> diff --git a/rules/firmware-rockchip.make b/rules/firmware-rockchip.make
>> new file mode 100644
>> index 000000000..54a0b7493
>> --- /dev/null
>> +++ b/rules/firmware-rockchip.make
>> @@ -0,0 +1,75 @@
>> +# -*-makefile-*-
>> +#
>> +# Copyright (C) 2021 by Michael Tretter <m.tretter@pengutronix.de>
>> +#
>> +# 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		:= bfb7b9601b88784e263c2cc6baa5da9f
>> +FIRMWARE_ROCKCHIP		:= firmware-rockchip-$(FIRMWARE_ROCKCHIP_VERSION)
>> +FIRMWARE_ROCKCHIP_SUFFIX	:= tar.xz
>> +FIRMWARE_ROCKCHIP_URL		:= \
>> +	git://github.com/rockchip-linux/rkbin;tag=$(FIRMWARE_ROCKCHIP_VERSION)
> 
> GitHub will stop serving the git:// protocol starting next year [1]. You
> should be able to just use the usual archive URLs instead with the
> git-describe-like version. This way you also don't need to clone the
> whole git repo first:
> 
>   https://github.com/rockchip-linux/rkbin/archive/$(FIRMWARE_ROCKCHIP_VERSION).zip
> 
> (but you only get .zips from it.)
> 
> [1]: https://github.blog/2021-09-01-improving-git-protocol-security-github/

OK, I'll fix that.

> 
>> +FIRMWARE_ROCKCHIP_SOURCE	:= $(SRCDIR)/$(FIRMWARE_ROCKCHIP).$(FIRMWARE_ROCKCHIP_SUFFIX)
>> +FIRMWARE_ROCKCHIP_DIR		:= $(BUILDDIR)/$(FIRMWARE_ROCKCHIP)
>> +FIRMWARE_ROCKCHIP_LICENSE	:= unknown
> 
> My Chinese is not good enough, but we should probably classify this as
> proprietary.

I was not sure, but proprietary makes sense to me.

> 
>> +
>> +# ----------------------------------------------------------------------------
>> +# Prepare
>> +# ----------------------------------------------------------------------------
>> +
>> +FIRMWARE_ROCKCHIP_CONF_TOOL:= NO
> 
> Please add a space before the walrus operator.

Ack.

> 
>> +
>> +# ----------------------------------------------------------------------------
>> +# 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)
> 
> Nothing installed on the target? Are they for compile-time use only?

Yes, at least at the moment. Currently barebox is the only consumer of
those blobs and on RK356x boards they are compiled into the barebox image.

Best regards,
Michael

> 
>  - Roland
> 
>> +	@$(call touch)
>> +
>> +# vim: syntax=make
>> -- 
>> 2.30.2
> 

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-12-06  6:27 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-03 16:54 [ptxdist] [PATCH 0/3] Add support for Rockchip firmware blobs Michael Riesch
2021-12-03 16:54 ` [ptxdist] [PATCH 1/3] platforms: add section for non-free " Michael Riesch
2021-12-03 16:54 ` [ptxdist] [PATCH 2/3] add package for rockchip firmware binaries Michael Riesch
2021-12-03 17:55   ` Christian Melki
2021-12-04  7:10     ` Michael Riesch
2021-12-04 15:37       ` Christian Melki
2021-12-06  6:06         ` Michael Riesch
2021-12-05  0:56   ` Roland Hieber
2021-12-05  1:00     ` Roland Hieber
2021-12-05  9:07       ` Michael Riesch
2021-12-06  6:27     ` Michael Riesch
2021-12-03 16:54 ` [ptxdist] [RFC PATCH 3/3] barebox: add integration of firmware blobs Michael Riesch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox