buildroot.busybox.net archive mirror
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v5 0/3] add support for TI's AM64x boards
@ 2022-09-23 20:55 Anand Gadiyar
  2022-09-23 20:55 ` [Buildroot] [PATCH v5 1/3] boot/ti-k3-r5-loader: add new package Anand Gadiyar via buildroot
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Anand Gadiyar @ 2022-09-23 20:55 UTC (permalink / raw)
  To: buildroot; +Cc: Xuanhao Shi, Anand Gadiyar

This series introduces support for TI's AM64x SK boards.

It was previously sent out by Xuanhao in August and reviewed by
Giulio Benetti (Thanks!).

If this looks okay, I'll mark the previous series as superceded
in patchwork. Let me know if there's anything more to be done to
get these patches merged, as this is the first time we're engaging
with the buildroot community and may not be familiar with the
process.

We would like to add support for the AM62x SK as well, but are
currently blocked by availability of some firmware. Hopefully that
will get sorted out soon.


Changes in v4:
- rebased to latest master and retested
- dropped OPTEE CUSTOM* options as we don't need them.

Changes in v3:
- Fix boot/ti-k3-r5-loader package's build options and dependencies.
- Fix boot/ti-k3-image-gen package's config
- Add more details in board/ti/am64x_sk's readme
- Trim configs/am64x_sk's toolchain options and 
  fix uboot and genimage dependencies.
- Remove board/ti/am62x_sk and configs/am62x_sk for now due to some
  firmware dependency problems. Will be added back in the future.

Changes in v2:
- Revert arm-gnu-toolchain back to version 10.x due to a bug.
  When the pre-packaged GCC was built, it could be targeting
  a newer x86_64 architecture than the processor being used.
- Add boot/ti-k3-r5-loader package that builds a separate U-Boot
  for the R5 cores on TI's K3 devices.
- Add boot/ti-k3-image-gen package that builds the full boot binary
  tiboot3.bin from the spl built from ti-k3-r5-loader.
- Add board/ti directory to include sdcard config and board information
  for AM64x_sk and AM62x_sk boards.
- Add the Buildroot defconfigs for AM64x_sk and AM62x_sk.
- Add to DEVELOPERS list.

Xuanhao Shi (3):
  boot/ti-k3-r5-loader: add new package
  boot/ti-k3-image-gen: add new package
  board/ti/am64x_sk: add new board

 DEVELOPERS                                | 12 ++++++
 board/ti/am64x_sk/genimage.cfg            | 27 +++++++++++++
 board/ti/am64x_sk/readme.txt              | 49 +++++++++++++++++++++++
 boot/Config.in                            |  2 +
 boot/ti-k3-image-gen/Config.in            | 24 +++++++++++
 boot/ti-k3-image-gen/ti-k3-image-gen.hash |  2 +
 boot/ti-k3-image-gen/ti-k3-image-gen.mk   | 33 +++++++++++++++
 boot/ti-k3-r5-loader/Config.in            | 13 ++++++
 boot/ti-k3-r5-loader/ti-k3-r5-loader.hash |  2 +
 boot/ti-k3-r5-loader/ti-k3-r5-loader.mk   | 45 +++++++++++++++++++++
 configs/am64x_sk_defconfig                | 45 +++++++++++++++++++++
 11 files changed, 254 insertions(+)
 create mode 100644 board/ti/am64x_sk/genimage.cfg
 create mode 100644 board/ti/am64x_sk/readme.txt
 create mode 100644 boot/ti-k3-image-gen/Config.in
 create mode 100644 boot/ti-k3-image-gen/ti-k3-image-gen.hash
 create mode 100644 boot/ti-k3-image-gen/ti-k3-image-gen.mk
 create mode 100644 boot/ti-k3-r5-loader/Config.in
 create mode 100644 boot/ti-k3-r5-loader/ti-k3-r5-loader.hash
 create mode 100644 boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
 create mode 100644 configs/am64x_sk_defconfig

-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [PATCH v5 1/3] boot/ti-k3-r5-loader: add new package
  2022-09-23 20:55 [Buildroot] [PATCH v5 0/3] add support for TI's AM64x boards Anand Gadiyar
@ 2022-09-23 20:55 ` Anand Gadiyar via buildroot
  2022-10-01 17:13   ` Romain Naour
  2022-09-23 20:55 ` [Buildroot] [PATCH v5 2/3] boot/ti-k3-image-gen: " Anand Gadiyar
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Anand Gadiyar via buildroot @ 2022-09-23 20:55 UTC (permalink / raw)
  To: buildroot; +Cc: Xuanhao Shi, Giulio Benetti, Xuanhao Shi, Anand Gadiyar

From: Xuanhao Shi <x-shi@ti.com>

This is a separate U-Boot package that would build
the intermediate spl binary for the R5 core on TI's k3 boards.
Usually, the resulting spl will be used for k3-image-gen
to build the full R5 boot binary tiboot3.bin.

Signed-off-by: Xuanhao Shi <x-shi@ti.com>
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Reviewed-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 DEVELOPERS                                |  6 +++
 boot/Config.in                            |  1 +
 boot/ti-k3-r5-loader/Config.in            | 13 +++++++
 boot/ti-k3-r5-loader/ti-k3-r5-loader.hash |  2 +
 boot/ti-k3-r5-loader/ti-k3-r5-loader.mk   | 45 +++++++++++++++++++++++
 5 files changed, 67 insertions(+)
 create mode 100644 boot/ti-k3-r5-loader/Config.in
 create mode 100644 boot/ti-k3-r5-loader/ti-k3-r5-loader.hash
 create mode 100644 boot/ti-k3-r5-loader/ti-k3-r5-loader.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index 3de63ea72f..5f36cbf535 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -128,6 +128,9 @@ F:	package/dcron/
 F:	package/libxmlrpc/
 F:	package/python-docopt/
 
+N:	Anand Gadiyar <gadiyar@ti.com>
+F:	boot/ti-k3-r5-loader/
+
 N:	André Zwing <nerv@dawncrow.de>
 F:	package/libkrb5/
 F:	package/openal/
@@ -3063,6 +3066,9 @@ F:	package/python-pyusb/
 N:	Wojciech Niziński <niziak@spox.org>
 F:	package/fwup/
 
+N:	Xuanhao Shi <X15000177@gmail.com>
+F:	boot/ti-k3-r5-loader/
+
 N:	Yair Ben Avraham <yairba@protonmail.com>
 F:	package/casync/
 F:	package/gloox/
diff --git a/boot/Config.in b/boot/Config.in
index 40472ae07d..ce17b2df6b 100644
--- a/boot/Config.in
+++ b/boot/Config.in
@@ -22,6 +22,7 @@ source "boot/s500-bootloader/Config.in"
 source "boot/shim/Config.in"
 source "boot/sun20i-d1-spl/Config.in"
 source "boot/syslinux/Config.in"
+source "boot/ti-k3-r5-loader/Config.in"
 source "boot/uboot/Config.in"
 source "boot/vexpress-firmware/Config.in"
 
diff --git a/boot/ti-k3-r5-loader/Config.in b/boot/ti-k3-r5-loader/Config.in
new file mode 100644
index 0000000000..7f5fa0b4c8
--- /dev/null
+++ b/boot/ti-k3-r5-loader/Config.in
@@ -0,0 +1,13 @@
+config BR2_TARGET_TI_K3_R5_LOADER
+	bool "ti-k3-r5-loader"
+	help
+	  Separate U-Boot build for R5 cores on TI's k3 boards.
+	  Usually used to build tiboot3.bin with k3-image-gen.
+
+config BR2_TARGET_TI_K3_R5_LOADER_BOARD
+	string "Board to configure for"
+	depends on BR2_TARGET_TI_K3_R5_LOADER
+	help
+	  Specify the board to configure the bootloader for.
+	  This should be the name of a board under board/ti
+	  For example, "am64x_evm".
diff --git a/boot/ti-k3-r5-loader/ti-k3-r5-loader.hash b/boot/ti-k3-r5-loader/ti-k3-r5-loader.hash
new file mode 100644
index 0000000000..fb6ce7c2a6
--- /dev/null
+++ b/boot/ti-k3-r5-loader/ti-k3-r5-loader.hash
@@ -0,0 +1,2 @@
+# Locally computed:
+sha256  6d69d5e4635cb3fa7852bf15f88ca342ef7740196e71961d3572deb58ba44bea  u-boot-2022.10-rc1.tar.bz2
diff --git a/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk b/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
new file mode 100644
index 0000000000..1e09fad9f5
--- /dev/null
+++ b/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
@@ -0,0 +1,45 @@
+################################################################################
+#
+# ti-k3-r5-loader.mk
+#
+################################################################################
+
+TI_K3_R5_LOADER_VERSION = 2022.10-rc1
+TI_K3_R5_LOADER_SITE = https://ftp.denx.de/pub/u-boot
+TI_K3_R5_LOADER_SOURCE = u-boot-$(TI_K3_R5_LOADER_VERSION).tar.bz2
+TI_K3_R5_LOADER_LICENSE = GPL-2.0+
+TI_K3_R5_LOADER_LICENSE_FILES = Licenses/gpl-2.0.txt
+TI_K3_R5_LOADER_CPE_ID_VENDOR = denx
+TI_K3_R5_LOADER_CPE_ID_PRODUCT = u-boot
+TI_K3_R5_LOADER_INSTALL_IMAGES = YES
+TI_K3_R5_LOADER_DEPENDENCIES = \
+	host-pkgconf \
+	$(BR2_MAKE_HOST_DEPENDENCY) \
+	host-arm-gnu-toolchain \
+	host-openssl
+
+TI_K3_R5_LOADER_MAKE = $(BR2_MAKE)
+TI_K3_R5_LOADER_MAKE_ENV = $(TARGET_MAKE_ENV)
+TI_K3_R5_LOADER_KCONFIG_DEPENDENCIES = \
+	host-arm-gnu-toolchain \
+	$(BR2_MAKE_HOST_DEPENDENCY) \
+	$(BR2_BISON_HOST_DEPENDENCY) \
+	$(BR2_FLEX_HOST_DEPENDENCY)
+
+TI_K3_R5_LOADER_BOARD = $(call qstrip,$(BR2_TARGET_TI_K3_R5_LOADER_BOARD))
+TI_K3_R5_LOADER_KCONFIG_DEFCONFIG = $(TI_K3_R5_LOADER_BOARD)_r5_defconfig
+TI_K3_R5_LOADER_MAKE_OPTS += \
+	CROSS_COMPILE=$(HOST_ARM_GNU_TOOLCHAIN_INSTALL_DIR)/bin/arm-none-eabi- \
+	ARCH=arm \
+	HOSTCC="$(HOSTCC) $(subst -I/,-isystem /,$(subst -I /,-isystem /,$(HOST_CFLAGS)))" \
+	HOSTLDFLAGS="$(HOST_LDFLAGS)"
+
+define TI_K3_R5_LOADER_BUILD_CMDS
+	$(TARGET_CONFIGURE_OPTS) $(TI_K3_R5_LOADER_MAKE) -C $(@D) $(TI_K3_R5_LOADER_MAKE_OPTS)
+endef
+
+define TI_K3_R5_LOADER_INSTALL_IMAGES_CMDS
+	cp $(@D)/spl/u-boot-spl.bin $(BINARIES_DIR)/r5-u-boot-spl.bin
+endef
+
+$(eval $(kconfig-package))
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [PATCH v5 2/3] boot/ti-k3-image-gen: add new package
  2022-09-23 20:55 [Buildroot] [PATCH v5 0/3] add support for TI's AM64x boards Anand Gadiyar
  2022-09-23 20:55 ` [Buildroot] [PATCH v5 1/3] boot/ti-k3-r5-loader: add new package Anand Gadiyar via buildroot
@ 2022-09-23 20:55 ` Anand Gadiyar
  2022-09-26 15:50   ` Andrew Davis via buildroot
  2022-10-01 17:34   ` Romain Naour
  2022-09-23 20:55 ` [Buildroot] [PATCH v5 3/3] board/ti/am64x_sk: add new board Anand Gadiyar
  2022-09-23 21:53 ` [Buildroot] [PATCH v5 0/3] add support for TI's AM64x boards Giulio Benetti
  3 siblings, 2 replies; 11+ messages in thread
From: Anand Gadiyar @ 2022-09-23 20:55 UTC (permalink / raw)
  To: buildroot; +Cc: Xuanhao Shi, Giulio Benetti, Xuanhao Shi, Anand Gadiyar

From: Xuanhao Shi <x-shi@ti.com>

This is the image generator that builds the full boot binary,
tiboot3.bin, for the R5 core on TI's k3 devices.
This requires the R5 spl output from the ti-k3-r5-loader package.

https://git.ti.com/cgit/k3-image-gen/k3-image-gen

Signed-off-by: Xuanhao Shi <x-shi@ti.com>
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Reviewed-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 DEVELOPERS                                |  2 ++
 boot/Config.in                            |  1 +
 boot/ti-k3-image-gen/Config.in            | 24 +++++++++++++++++
 boot/ti-k3-image-gen/ti-k3-image-gen.hash |  2 ++
 boot/ti-k3-image-gen/ti-k3-image-gen.mk   | 33 +++++++++++++++++++++++
 5 files changed, 62 insertions(+)
 create mode 100644 boot/ti-k3-image-gen/Config.in
 create mode 100644 boot/ti-k3-image-gen/ti-k3-image-gen.hash
 create mode 100644 boot/ti-k3-image-gen/ti-k3-image-gen.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index 5f36cbf535..81f095f799 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -129,6 +129,7 @@ F:	package/libxmlrpc/
 F:	package/python-docopt/
 
 N:	Anand Gadiyar <gadiyar@ti.com>
+F:	boot/ti-k3-image-gen/
 F:	boot/ti-k3-r5-loader/
 
 N:	André Zwing <nerv@dawncrow.de>
@@ -3067,6 +3068,7 @@ N:	Wojciech Niziński <niziak@spox.org>
 F:	package/fwup/
 
 N:	Xuanhao Shi <X15000177@gmail.com>
+F:	boot/ti-k3-image-gen/
 F:	boot/ti-k3-r5-loader/
 
 N:	Yair Ben Avraham <yairba@protonmail.com>
diff --git a/boot/Config.in b/boot/Config.in
index ce17b2df6b..1b25bacfee 100644
--- a/boot/Config.in
+++ b/boot/Config.in
@@ -22,6 +22,7 @@ source "boot/s500-bootloader/Config.in"
 source "boot/shim/Config.in"
 source "boot/sun20i-d1-spl/Config.in"
 source "boot/syslinux/Config.in"
+source "boot/ti-k3-image-gen/Config.in"
 source "boot/ti-k3-r5-loader/Config.in"
 source "boot/uboot/Config.in"
 source "boot/vexpress-firmware/Config.in"
diff --git a/boot/ti-k3-image-gen/Config.in b/boot/ti-k3-image-gen/Config.in
new file mode 100644
index 0000000000..00416dcefc
--- /dev/null
+++ b/boot/ti-k3-image-gen/Config.in
@@ -0,0 +1,24 @@
+config BR2_TARGET_TI_K3_IMAGE_GEN
+	bool "ti-k3-image-gen"
+	select BR2_TARGET_TI_K3_R5_LOADER
+	help
+	  Use TI's k3-image-gen to build a separate bare metal
+	  boot binary from a separate spl. Currently supports
+	  version 08.04.00.005 as default.
+
+	  https://git.ti.com/cgit/k3-image-gen/k3-image-gen/
+
+config BR2_TARGET_TI_K3_IMAGE_GEN_SOC
+	string "SOC type for image gen"
+	depends on BR2_TARGET_TI_K3_IMAGE_GEN
+	help
+	  The target SoC option for image gen.
+	  For example, "am64x" for AM64X boards.
+
+config BR2_TARGET_TI_K3_IMAGE_GEN_CONFIG
+	string "CONFIG type for image gen"
+	depends on BR2_TARGET_TI_K3_IMAGE_GEN
+	help
+	  The board config option for image gen.
+	  Usually "sk" or "evm".
+
diff --git a/boot/ti-k3-image-gen/ti-k3-image-gen.hash b/boot/ti-k3-image-gen/ti-k3-image-gen.hash
new file mode 100644
index 0000000000..e307a02a67
--- /dev/null
+++ b/boot/ti-k3-image-gen/ti-k3-image-gen.hash
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256  e585dc868ada21ef3389159541d669b88bc406b453470e92da85d9222d271c96  k3-image-gen-08.04.00.005.tar.gz
diff --git a/boot/ti-k3-image-gen/ti-k3-image-gen.mk b/boot/ti-k3-image-gen/ti-k3-image-gen.mk
new file mode 100644
index 0000000000..1f97490392
--- /dev/null
+++ b/boot/ti-k3-image-gen/ti-k3-image-gen.mk
@@ -0,0 +1,33 @@
+################################################################################
+#
+# ti-k3-image-gen
+#
+################################################################################
+
+TI_K3_IMAGE_GEN_VERSION = 08.04.00.005
+TI_K3_IMAGE_GEN_SITE = https://git.ti.com/cgit/k3-image-gen/k3-image-gen/snapshot
+TI_K3_IMAGE_GEN_SOURCE = k3-image-gen-$(TI_K3_IMAGE_GEN_VERSION).tar.gz
+TI_K3_IMAGE_GEN_LICENSE = BSD-3-Clause
+TI_K3_IMAGE_GEN_LICENSE_FILES = system-firmware-image-gen-1.0-manifest.html
+TI_K3_IMAGE_GEN_INSTALL_IMAGES = YES
+TI_K3_IMAGE_GEN_DEPENDENCIES = host-arm-gnu-toolchain ti-k3-r5-loader
+TI_K3_IMAGE_GEN_MAKE = $(BR2_MAKE)
+TI_K3_IMAGE_GEN_SOC = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SOC))
+TI_K3_IMAGE_GEN_CONFIG = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_CONFIG))
+TI_K3_IMAGE_GEN_MAKE_OPTS = \
+	SOC=$(TI_K3_IMAGE_GEN_SOC) \
+	CONFIG=$(TI_K3_IMAGE_GEN_CONFIG) \
+	CROSS_COMPILE=$(HOST_ARM_GNU_TOOLCHAIN_INSTALL_DIR)/bin/arm-none-eabi- \
+	SBL=$(BINARIES_DIR)/r5-u-boot-spl.bin \
+	O=$(BINARIES_DIR) \
+	BIN_DIR=$(BINARIES_DIR)
+
+define TI_K3_IMAGE_GEN_BUILD_CMDS
+	$(TI_K3_IMAGE_GEN_MAKE) -C $(@D) $(TI_K3_IMAGE_GEN_MAKE_OPTS)
+endef
+
+define TI_K3_IMAGE_GEN_INSTALL_IMAGES_CMDS
+	cp $(@D)/tiboot3.bin $(BINARIES_DIR)
+endef
+
+$(eval $(generic-package))
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [PATCH v5 3/3] board/ti/am64x_sk: add new board
  2022-09-23 20:55 [Buildroot] [PATCH v5 0/3] add support for TI's AM64x boards Anand Gadiyar
  2022-09-23 20:55 ` [Buildroot] [PATCH v5 1/3] boot/ti-k3-r5-loader: add new package Anand Gadiyar via buildroot
  2022-09-23 20:55 ` [Buildroot] [PATCH v5 2/3] boot/ti-k3-image-gen: " Anand Gadiyar
@ 2022-09-23 20:55 ` Anand Gadiyar
  2022-10-01 17:47   ` Romain Naour
  2022-09-23 21:53 ` [Buildroot] [PATCH v5 0/3] add support for TI's AM64x boards Giulio Benetti
  3 siblings, 1 reply; 11+ messages in thread
From: Anand Gadiyar @ 2022-09-23 20:55 UTC (permalink / raw)
  To: buildroot; +Cc: Xuanhao Shi, Giulio Benetti, Xuanhao Shi, Anand Gadiyar

From: Xuanhao Shi <x-shi@ti.com>

Adds support for ti's am64x_sk board.
Adds the configs for generating output sdcard image.
Adds the defconfigs for am64x_sk.

The AM64x_sk board is designed for the AM642 SoC with
two ARM Cortex-A53 and four ARM Cortex-R5. It also
supports RJ 45 Ethernet, Wi-Fi, and Bluetooth.

More information about the board can be found at:
https://www.ti.com/tool/SK-AM64

Signed-off-by: Xuanhao Shi <x-shi@ti.com>
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Reviewed-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 DEVELOPERS                     |  4 +++
 board/ti/am64x_sk/genimage.cfg | 27 +++++++++++++++++++
 board/ti/am64x_sk/readme.txt   | 49 ++++++++++++++++++++++++++++++++++
 configs/am64x_sk_defconfig     | 45 +++++++++++++++++++++++++++++++
 4 files changed, 125 insertions(+)
 create mode 100644 board/ti/am64x_sk/genimage.cfg
 create mode 100644 board/ti/am64x_sk/readme.txt
 create mode 100644 configs/am64x_sk_defconfig

diff --git a/DEVELOPERS b/DEVELOPERS
index 81f095f799..121952369c 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -129,8 +129,10 @@ F:	package/libxmlrpc/
 F:	package/python-docopt/
 
 N:	Anand Gadiyar <gadiyar@ti.com>
+F:	board/ti/am64x_sk/
 F:	boot/ti-k3-image-gen/
 F:	boot/ti-k3-r5-loader/
+F:	configs/am64x_sk_defconfig
 
 N:	André Zwing <nerv@dawncrow.de>
 F:	package/libkrb5/
@@ -3068,8 +3070,10 @@ N:	Wojciech Niziński <niziak@spox.org>
 F:	package/fwup/
 
 N:	Xuanhao Shi <X15000177@gmail.com>
+F:	board/ti/am64x_sk/
 F:	boot/ti-k3-image-gen/
 F:	boot/ti-k3-r5-loader/
+F:	configs/am64x_sk_defconfig
 
 N:	Yair Ben Avraham <yairba@protonmail.com>
 F:	package/casync/
diff --git a/board/ti/am64x_sk/genimage.cfg b/board/ti/am64x_sk/genimage.cfg
new file mode 100644
index 0000000000..26304fe98f
--- /dev/null
+++ b/board/ti/am64x_sk/genimage.cfg
@@ -0,0 +1,27 @@
+image boot.vfat {
+	vfat {
+		files = {
+			"tiboot3.bin",
+			"tispl.bin",
+			"u-boot.img",
+		}
+	}
+
+	size = 16M
+}
+
+image sdcard.img {
+	hdimage {
+	}
+
+	partition u-boot {
+		partition-type = 0xC
+		bootable = "true"
+		image = "boot.vfat"
+	}
+
+	partition rootfs {
+		partition-type = 0x83
+		image = "rootfs.ext4"
+	}
+}
diff --git a/board/ti/am64x_sk/readme.txt b/board/ti/am64x_sk/readme.txt
new file mode 100644
index 0000000000..8096fcb2d4
--- /dev/null
+++ b/board/ti/am64x_sk/readme.txt
@@ -0,0 +1,49 @@
+Texas Instuments AM64x SK Test and Development Board
+
+Description
+===========
+
+These configurations will build a complete image and
+device tree blobs for the the TI AM64x_sk board.
+
+How to build it
+===============
+
+Select the default configuration for the target:
+$ make am64x_sk_defconfig
+
+Optional: modify the configuration:
+$ make menuconfig
+
+Build:
+$ make
+
+Result of the build:
+===================
+output/images/
++-- soc
++-- ti-connectivity
++-- bl31.bin
++-- boot.vfat
++-- Image
++-- k3-am642-sk.dtb
++-- r5-u-boot-spl.bin
++-- rootfs.ext2
++-- rootfs.ext4
++-- rootfs.tar
++-- sdcard.img
++-- tee.bin
++-- tee-header_v2.bin
++-- tee-pageable_v2.bin
++-- tee-pager_v2.bin
++-- tiboot3.bin
++-- tispl.bin
++-- u-boot.img
+
+To copy the image file to the sdcard use dd:
+$ dd if=output/images/sdcard.img of=/dev/sdX
+
+Insert the SDcard into the AM64x_sk board, and power it up with
+a USB Type-C connector. The system should come up. You can use
+a micro-USB to connect to the connector labled MAIN_UART0 to
+communicate with the board.
diff --git a/configs/am64x_sk_defconfig b/configs/am64x_sk_defconfig
new file mode 100644
index 0000000000..1d37b411b3
--- /dev/null
+++ b/configs/am64x_sk_defconfig
@@ -0,0 +1,45 @@
+BR2_aarch64=y
+BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/ti/am64x_sk/genimage.cfg"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.19"
+BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="ti/k3-am642-sk"
+BR2_LINUX_KERNEL_INSTALL_TARGET=y
+BR2_PACKAGE_LINUX_FIRMWARE=y
+BR2_PACKAGE_LINUX_FIRMWARE_TI_WL18XX=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_EXT2_SIZE="120M"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE="v2.7.0"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="k3"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_TARGET_BOARD="lite"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL32_OPTEE=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES="SPD=opteed"
+BR2_TARGET_OPTEE_OS=y
+BR2_TARGET_OPTEE_OS_NEEDS_PYTHON_CRYPTOGRAPHY=y
+BR2_TARGET_OPTEE_OS_PLATFORM="k3"
+BR2_TARGET_TI_K3_IMAGE_GEN=y
+BR2_TARGET_TI_K3_IMAGE_GEN_SOC="am64x"
+BR2_TARGET_TI_K3_IMAGE_GEN_CONFIG="evm"
+BR2_TARGET_TI_K3_R5_LOADER_BOARD="am64x_evm"
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2022.10-rc1"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="am64x_evm_a53"
+BR2_TARGET_UBOOT_NEEDS_DTC=y
+BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
+BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
+# BR2_TARGET_UBOOT_FORMAT_BIN is not set
+BR2_TARGET_UBOOT_FORMAT_IMG=y
+BR2_TARGET_UBOOT_SPL=y
+BR2_TARGET_UBOOT_SPL_NAME="tispl.bin"
+BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="TEE=$(BINARIES_DIR)/tee-pager_v2.bin"
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v5 0/3] add support for TI's AM64x boards
  2022-09-23 20:55 [Buildroot] [PATCH v5 0/3] add support for TI's AM64x boards Anand Gadiyar
                   ` (2 preceding siblings ...)
  2022-09-23 20:55 ` [Buildroot] [PATCH v5 3/3] board/ti/am64x_sk: add new board Anand Gadiyar
@ 2022-09-23 21:53 ` Giulio Benetti
  3 siblings, 0 replies; 11+ messages in thread
From: Giulio Benetti @ 2022-09-23 21:53 UTC (permalink / raw)
  To: Anand Gadiyar, buildroot; +Cc: Xuanhao Shi

Hi Anand,

On 23/09/22 22:55, Anand Gadiyar wrote:
> This series introduces support for TI's AM64x SK boards.
> 
> It was previously sent out by Xuanhao in August and reviewed by
> Giulio Benetti (Thanks!).

It's a pleasure :-)
Anyway no need to respin to add my Reviewed-by's since Patchwork keeps
track of them.

Here we need to wait for a Maintainer to review and commit your patches
if everything is ok.

> If this looks okay, I'll mark the previous series as superceded
> in patchwork. 

Yes please.

Kind regards!
-- 
Giulio Benetti
Benetti Engineering sas


Let me know if there's anything more to be done to
> get these patches merged, as this is the first time we're engaging
> with the buildroot community and may not be familiar with the
> process.
> 
> We would like to add support for the AM62x SK as well, but are
> currently blocked by availability of some firmware. Hopefully that
> will get sorted out soon.
> 
> 
> Changes in v4:
> - rebased to latest master and retested
> - dropped OPTEE CUSTOM* options as we don't need them.
> 
> Changes in v3:
> - Fix boot/ti-k3-r5-loader package's build options and dependencies.
> - Fix boot/ti-k3-image-gen package's config
> - Add more details in board/ti/am64x_sk's readme
> - Trim configs/am64x_sk's toolchain options and
>    fix uboot and genimage dependencies.
> - Remove board/ti/am62x_sk and configs/am62x_sk for now due to some
>    firmware dependency problems. Will be added back in the future.
> 
> Changes in v2:
> - Revert arm-gnu-toolchain back to version 10.x due to a bug.
>    When the pre-packaged GCC was built, it could be targeting
>    a newer x86_64 architecture than the processor being used.
> - Add boot/ti-k3-r5-loader package that builds a separate U-Boot
>    for the R5 cores on TI's K3 devices.
> - Add boot/ti-k3-image-gen package that builds the full boot binary
>    tiboot3.bin from the spl built from ti-k3-r5-loader.
> - Add board/ti directory to include sdcard config and board information
>    for AM64x_sk and AM62x_sk boards.
> - Add the Buildroot defconfigs for AM64x_sk and AM62x_sk.
> - Add to DEVELOPERS list.
> 
> Xuanhao Shi (3):
>    boot/ti-k3-r5-loader: add new package
>    boot/ti-k3-image-gen: add new package
>    board/ti/am64x_sk: add new board
> 
>   DEVELOPERS                                | 12 ++++++
>   board/ti/am64x_sk/genimage.cfg            | 27 +++++++++++++
>   board/ti/am64x_sk/readme.txt              | 49 +++++++++++++++++++++++
>   boot/Config.in                            |  2 +
>   boot/ti-k3-image-gen/Config.in            | 24 +++++++++++
>   boot/ti-k3-image-gen/ti-k3-image-gen.hash |  2 +
>   boot/ti-k3-image-gen/ti-k3-image-gen.mk   | 33 +++++++++++++++
>   boot/ti-k3-r5-loader/Config.in            | 13 ++++++
>   boot/ti-k3-r5-loader/ti-k3-r5-loader.hash |  2 +
>   boot/ti-k3-r5-loader/ti-k3-r5-loader.mk   | 45 +++++++++++++++++++++
>   configs/am64x_sk_defconfig                | 45 +++++++++++++++++++++
>   11 files changed, 254 insertions(+)
>   create mode 100644 board/ti/am64x_sk/genimage.cfg
>   create mode 100644 board/ti/am64x_sk/readme.txt
>   create mode 100644 boot/ti-k3-image-gen/Config.in
>   create mode 100644 boot/ti-k3-image-gen/ti-k3-image-gen.hash
>   create mode 100644 boot/ti-k3-image-gen/ti-k3-image-gen.mk
>   create mode 100644 boot/ti-k3-r5-loader/Config.in
>   create mode 100644 boot/ti-k3-r5-loader/ti-k3-r5-loader.hash
>   create mode 100644 boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
>   create mode 100644 configs/am64x_sk_defconfig
> 

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v5 2/3] boot/ti-k3-image-gen: add new package
  2022-09-23 20:55 ` [Buildroot] [PATCH v5 2/3] boot/ti-k3-image-gen: " Anand Gadiyar
@ 2022-09-26 15:50   ` Andrew Davis via buildroot
  2022-10-01 17:34   ` Romain Naour
  1 sibling, 0 replies; 11+ messages in thread
From: Andrew Davis via buildroot @ 2022-09-26 15:50 UTC (permalink / raw)
  To: Anand Gadiyar, buildroot; +Cc: Xuanhao Shi, Giulio Benetti

On 9/23/22 3:55 PM, Anand Gadiyar wrote:
> From: Xuanhao Shi <x-shi@ti.com>
> 
> This is the image generator that builds the full boot binary,
> tiboot3.bin, for the R5 core on TI's k3 devices.
> This requires the R5 spl output from the ti-k3-r5-loader package.
> 
> https://git.ti.com/cgit/k3-image-gen/k3-image-gen
> 
> Signed-off-by: Xuanhao Shi <x-shi@ti.com>
> Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
> Reviewed-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> ---
>   DEVELOPERS                                |  2 ++
>   boot/Config.in                            |  1 +
>   boot/ti-k3-image-gen/Config.in            | 24 +++++++++++++++++
>   boot/ti-k3-image-gen/ti-k3-image-gen.hash |  2 ++
>   boot/ti-k3-image-gen/ti-k3-image-gen.mk   | 33 +++++++++++++++++++++++
>   5 files changed, 62 insertions(+)
>   create mode 100644 boot/ti-k3-image-gen/Config.in
>   create mode 100644 boot/ti-k3-image-gen/ti-k3-image-gen.hash
>   create mode 100644 boot/ti-k3-image-gen/ti-k3-image-gen.mk
> 
> diff --git a/DEVELOPERS b/DEVELOPERS
> index 5f36cbf535..81f095f799 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -129,6 +129,7 @@ F:	package/libxmlrpc/
>   F:	package/python-docopt/
>   
>   N:	Anand Gadiyar <gadiyar@ti.com>
> +F:	boot/ti-k3-image-gen/
>   F:	boot/ti-k3-r5-loader/
>   
>   N:	André Zwing <nerv@dawncrow.de>
> @@ -3067,6 +3068,7 @@ N:	Wojciech Niziński <niziak@spox.org>
>   F:	package/fwup/
>   
>   N:	Xuanhao Shi <X15000177@gmail.com>
> +F:	boot/ti-k3-image-gen/
>   F:	boot/ti-k3-r5-loader/
>   
>   N:	Yair Ben Avraham <yairba@protonmail.com>
> diff --git a/boot/Config.in b/boot/Config.in
> index ce17b2df6b..1b25bacfee 100644
> --- a/boot/Config.in
> +++ b/boot/Config.in
> @@ -22,6 +22,7 @@ source "boot/s500-bootloader/Config.in"
>   source "boot/shim/Config.in"
>   source "boot/sun20i-d1-spl/Config.in"
>   source "boot/syslinux/Config.in"
> +source "boot/ti-k3-image-gen/Config.in"
>   source "boot/ti-k3-r5-loader/Config.in"
>   source "boot/uboot/Config.in"
>   source "boot/vexpress-firmware/Config.in"
> diff --git a/boot/ti-k3-image-gen/Config.in b/boot/ti-k3-image-gen/Config.in
> new file mode 100644
> index 0000000000..00416dcefc
> --- /dev/null
> +++ b/boot/ti-k3-image-gen/Config.in
> @@ -0,0 +1,24 @@
> +config BR2_TARGET_TI_K3_IMAGE_GEN
> +	bool "ti-k3-image-gen"
> +	select BR2_TARGET_TI_K3_R5_LOADER
> +	help
> +	  Use TI's k3-image-gen to build a separate bare metal
> +	  boot binary from a separate spl. Currently supports
> +	  version 08.04.00.005 as default.
> +
> +	  https://git.ti.com/cgit/k3-image-gen/k3-image-gen/
> +
> +config BR2_TARGET_TI_K3_IMAGE_GEN_SOC
> +	string "SOC type for image gen"
> +	depends on BR2_TARGET_TI_K3_IMAGE_GEN
> +	help
> +	  The target SoC option for image gen.
> +	  For example, "am64x" for AM64X boards.
> +


I can add this in an add-on patch later, but if this patch needs re-spun
for some other reason, feel free to add it here.

We need one more option for "type"

>config BR2_TARGET_TI_K3_IMAGE_GEN_TYPE
>	string "SOC security type for image gen"
>	depends on BR2_TARGET_TI_K3_IMAGE_GEN
>	help
>	  The security type option for image gen.
>	  Options are "gp", "hs-fs", or "hs-se".

and used as another make setting below as

>SOC_TYPE=$(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_TYPE)) \

otherwise LGTM,

Acked-by: Andrew Davis <afd@ti.com>

Andrew


> +config BR2_TARGET_TI_K3_IMAGE_GEN_CONFIG
> +	string "CONFIG type for image gen"
> +	depends on BR2_TARGET_TI_K3_IMAGE_GEN
> +	help
> +	  The board config option for image gen.
> +	  Usually "sk" or "evm".
> +
> diff --git a/boot/ti-k3-image-gen/ti-k3-image-gen.hash b/boot/ti-k3-image-gen/ti-k3-image-gen.hash
> new file mode 100644
> index 0000000000..e307a02a67
> --- /dev/null
> +++ b/boot/ti-k3-image-gen/ti-k3-image-gen.hash
> @@ -0,0 +1,2 @@
> +# Locally calculated
> +sha256  e585dc868ada21ef3389159541d669b88bc406b453470e92da85d9222d271c96  k3-image-gen-08.04.00.005.tar.gz
> diff --git a/boot/ti-k3-image-gen/ti-k3-image-gen.mk b/boot/ti-k3-image-gen/ti-k3-image-gen.mk
> new file mode 100644
> index 0000000000..1f97490392
> --- /dev/null
> +++ b/boot/ti-k3-image-gen/ti-k3-image-gen.mk
> @@ -0,0 +1,33 @@
> +################################################################################
> +#
> +# ti-k3-image-gen
> +#
> +################################################################################
> +
> +TI_K3_IMAGE_GEN_VERSION = 08.04.00.005
> +TI_K3_IMAGE_GEN_SITE = https://git.ti.com/cgit/k3-image-gen/k3-image-gen/snapshot
> +TI_K3_IMAGE_GEN_SOURCE = k3-image-gen-$(TI_K3_IMAGE_GEN_VERSION).tar.gz
> +TI_K3_IMAGE_GEN_LICENSE = BSD-3-Clause
> +TI_K3_IMAGE_GEN_LICENSE_FILES = system-firmware-image-gen-1.0-manifest.html
> +TI_K3_IMAGE_GEN_INSTALL_IMAGES = YES
> +TI_K3_IMAGE_GEN_DEPENDENCIES = host-arm-gnu-toolchain ti-k3-r5-loader
> +TI_K3_IMAGE_GEN_MAKE = $(BR2_MAKE)
> +TI_K3_IMAGE_GEN_SOC = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SOC))
> +TI_K3_IMAGE_GEN_CONFIG = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_CONFIG))
> +TI_K3_IMAGE_GEN_MAKE_OPTS = \
> +	SOC=$(TI_K3_IMAGE_GEN_SOC) \
> +	CONFIG=$(TI_K3_IMAGE_GEN_CONFIG) \
> +	CROSS_COMPILE=$(HOST_ARM_GNU_TOOLCHAIN_INSTALL_DIR)/bin/arm-none-eabi- \
> +	SBL=$(BINARIES_DIR)/r5-u-boot-spl.bin \
> +	O=$(BINARIES_DIR) \
> +	BIN_DIR=$(BINARIES_DIR)
> +
> +define TI_K3_IMAGE_GEN_BUILD_CMDS
> +	$(TI_K3_IMAGE_GEN_MAKE) -C $(@D) $(TI_K3_IMAGE_GEN_MAKE_OPTS)
> +endef
> +
> +define TI_K3_IMAGE_GEN_INSTALL_IMAGES_CMDS
> +	cp $(@D)/tiboot3.bin $(BINARIES_DIR)
> +endef
> +
> +$(eval $(generic-package))
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v5 1/3] boot/ti-k3-r5-loader: add new package
  2022-09-23 20:55 ` [Buildroot] [PATCH v5 1/3] boot/ti-k3-r5-loader: add new package Anand Gadiyar via buildroot
@ 2022-10-01 17:13   ` Romain Naour
  0 siblings, 0 replies; 11+ messages in thread
From: Romain Naour @ 2022-10-01 17:13 UTC (permalink / raw)
  To: Anand Gadiyar, buildroot; +Cc: Xuanhao Shi, Giulio Benetti, Xuanhao Shi

Hello Anand,

Le 23/09/2022 à 22:55, Anand Gadiyar via buildroot a écrit :
> From: Xuanhao Shi <x-shi@ti.com>
> 
> This is a separate U-Boot package that would build
> the intermediate spl binary for the R5 core on TI's k3 boards.
> Usually, the resulting spl will be used for k3-image-gen
> to build the full R5 boot binary tiboot3.bin.
> 
> Signed-off-by: Xuanhao Shi <x-shi@ti.com>
> Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
> Reviewed-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> ---
>  DEVELOPERS                                |  6 +++
>  boot/Config.in                            |  1 +
>  boot/ti-k3-r5-loader/Config.in            | 13 +++++++
>  boot/ti-k3-r5-loader/ti-k3-r5-loader.hash |  2 +
>  boot/ti-k3-r5-loader/ti-k3-r5-loader.mk   | 45 +++++++++++++++++++++++
>  5 files changed, 67 insertions(+)
>  create mode 100644 boot/ti-k3-r5-loader/Config.in
>  create mode 100644 boot/ti-k3-r5-loader/ti-k3-r5-loader.hash
>  create mode 100644 boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
> 
> diff --git a/DEVELOPERS b/DEVELOPERS
> index 3de63ea72f..5f36cbf535 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -128,6 +128,9 @@ F:	package/dcron/
>  F:	package/libxmlrpc/
>  F:	package/python-docopt/
>  
> +N:	Anand Gadiyar <gadiyar@ti.com>
> +F:	boot/ti-k3-r5-loader/
> +
>  N:	André Zwing <nerv@dawncrow.de>
>  F:	package/libkrb5/
>  F:	package/openal/
> @@ -3063,6 +3066,9 @@ F:	package/python-pyusb/
>  N:	Wojciech Niziński <niziak@spox.org>
>  F:	package/fwup/
>  
> +N:	Xuanhao Shi <X15000177@gmail.com>
> +F:	boot/ti-k3-r5-loader/
> +
>  N:	Yair Ben Avraham <yairba@protonmail.com>
>  F:	package/casync/
>  F:	package/gloox/
> diff --git a/boot/Config.in b/boot/Config.in
> index 40472ae07d..ce17b2df6b 100644
> --- a/boot/Config.in
> +++ b/boot/Config.in
> @@ -22,6 +22,7 @@ source "boot/s500-bootloader/Config.in"
>  source "boot/shim/Config.in"
>  source "boot/sun20i-d1-spl/Config.in"
>  source "boot/syslinux/Config.in"
> +source "boot/ti-k3-r5-loader/Config.in"
>  source "boot/uboot/Config.in"
>  source "boot/vexpress-firmware/Config.in"
>  
> diff --git a/boot/ti-k3-r5-loader/Config.in b/boot/ti-k3-r5-loader/Config.in
> new file mode 100644
> index 0000000000..7f5fa0b4c8
> --- /dev/null
> +++ b/boot/ti-k3-r5-loader/Config.in
> @@ -0,0 +1,13 @@
> +config BR2_TARGET_TI_K3_R5_LOADER
> +	bool "ti-k3-r5-loader"
> +	help
> +	  Separate U-Boot build for R5 cores on TI's k3 boards.
> +	  Usually used to build tiboot3.bin with k3-image-gen.

Usually we add a "if BR2_TARGET_TI_K3_R5_LOADER" instead of "depends on
BR2_TARGET_TI_K3_R5_LOADER" for each sub-options.

> +
> +config BR2_TARGET_TI_K3_R5_LOADER_BOARD
> +	string "Board to configure for"
> +	depends on BR2_TARGET_TI_K3_R5_LOADER
> +	help
> +	  Specify the board to configure the bootloader for.
> +	  This should be the name of a board under board/ti
> +	  For example, "am64x_evm".
> diff --git a/boot/ti-k3-r5-loader/ti-k3-r5-loader.hash b/boot/ti-k3-r5-loader/ti-k3-r5-loader.hash
> new file mode 100644
> index 0000000000..fb6ce7c2a6
> --- /dev/null
> +++ b/boot/ti-k3-r5-loader/ti-k3-r5-loader.hash
> @@ -0,0 +1,2 @@
> +# Locally computed:
> +sha256  6d69d5e4635cb3fa7852bf15f88ca342ef7740196e71961d3572deb58ba44bea  u-boot-2022.10-rc1.tar.bz2
> diff --git a/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk b/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
> new file mode 100644
> index 0000000000..1e09fad9f5
> --- /dev/null
> +++ b/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
> @@ -0,0 +1,45 @@
> +################################################################################
> +#
> +# ti-k3-r5-loader.mk
> +#
> +################################################################################
> +
> +TI_K3_R5_LOADER_VERSION = 2022.10-rc1

We prefer using a release version not an -rc pre-release.

Is 2022.07 is good enough?

> +TI_K3_R5_LOADER_SITE = https://ftp.denx.de/pub/u-boot
> +TI_K3_R5_LOADER_SOURCE = u-boot-$(TI_K3_R5_LOADER_VERSION).tar.bz2
> +TI_K3_R5_LOADER_LICENSE = GPL-2.0+
> +TI_K3_R5_LOADER_LICENSE_FILES = Licenses/gpl-2.0.txt
> +TI_K3_R5_LOADER_CPE_ID_VENDOR = denx
> +TI_K3_R5_LOADER_CPE_ID_PRODUCT = u-boot
> +TI_K3_R5_LOADER_INSTALL_IMAGES = YES
> +TI_K3_R5_LOADER_DEPENDENCIES = \
> +	host-pkgconf \
> +	$(BR2_MAKE_HOST_DEPENDENCY) \
> +	host-arm-gnu-toolchain \
> +	host-openssl
> +
> +TI_K3_R5_LOADER_MAKE = $(BR2_MAKE)
> +TI_K3_R5_LOADER_MAKE_ENV = $(TARGET_MAKE_ENV)
> +TI_K3_R5_LOADER_KCONFIG_DEPENDENCIES = \
> +	host-arm-gnu-toolchain \
> +	$(BR2_MAKE_HOST_DEPENDENCY) \
> +	$(BR2_BISON_HOST_DEPENDENCY) \
> +	$(BR2_FLEX_HOST_DEPENDENCY)
> +
> +TI_K3_R5_LOADER_BOARD = $(call qstrip,$(BR2_TARGET_TI_K3_R5_LOADER_BOARD))

We have to check if BR2_TARGET_TI_K3_R5_LOADER_BOARD is not empty.

> +TI_K3_R5_LOADER_KCONFIG_DEFCONFIG = $(TI_K3_R5_LOADER_BOARD)_r5_defconfig

I think we should handle the ti-k3-r5-loader defconfig as for other packages
using a defconfig. We should use a Kconfig option to provide the ti-k3-r5-loader
(uboot) defconfig name from Buildroot defconfig and not hardcoding a suffix _r5_
from the package makefile (.mk).

> +TI_K3_R5_LOADER_MAKE_OPTS += \
> +	CROSS_COMPILE=$(HOST_ARM_GNU_TOOLCHAIN_INSTALL_DIR)/bin/arm-none-eabi- \

Use the $(HOST_DIR) instead.

> +	ARCH=arm \
> +	HOSTCC="$(HOSTCC) $(subst -I/,-isystem /,$(subst -I /,-isystem /,$(HOST_CFLAGS)))" \
> +	HOSTLDFLAGS="$(HOST_LDFLAGS)"
> +
> +define TI_K3_R5_LOADER_BUILD_CMDS
> +	$(TARGET_CONFIGURE_OPTS) $(TI_K3_R5_LOADER_MAKE) -C $(@D) $(TI_K3_R5_LOADER_MAKE_OPTS)
> +endef
> +
> +define TI_K3_R5_LOADER_INSTALL_IMAGES_CMDS
> +	cp $(@D)/spl/u-boot-spl.bin $(BINARIES_DIR)/r5-u-boot-spl.bin
> +endef
Best regards,
Romain

> +
> +$(eval $(kconfig-package))

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v5 2/3] boot/ti-k3-image-gen: add new package
  2022-09-23 20:55 ` [Buildroot] [PATCH v5 2/3] boot/ti-k3-image-gen: " Anand Gadiyar
  2022-09-26 15:50   ` Andrew Davis via buildroot
@ 2022-10-01 17:34   ` Romain Naour
  2022-10-03 21:33     ` Gadiyar, Anand via buildroot
  1 sibling, 1 reply; 11+ messages in thread
From: Romain Naour @ 2022-10-01 17:34 UTC (permalink / raw)
  To: Anand Gadiyar, buildroot; +Cc: Xuanhao Shi, Giulio Benetti, Xuanhao Shi

Hello Anand,

Le 23/09/2022 à 22:55, Anand Gadiyar a écrit :
> From: Xuanhao Shi <x-shi@ti.com>
> 
> This is the image generator that builds the full boot binary,
> tiboot3.bin, for the R5 core on TI's k3 devices.
> This requires the R5 spl output from the ti-k3-r5-loader package.
> 
> https://git.ti.com/cgit/k3-image-gen/k3-image-gen
> 
> Signed-off-by: Xuanhao Shi <x-shi@ti.com>
> Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
> Reviewed-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> ---
>  DEVELOPERS                                |  2 ++
>  boot/Config.in                            |  1 +
>  boot/ti-k3-image-gen/Config.in            | 24 +++++++++++++++++
>  boot/ti-k3-image-gen/ti-k3-image-gen.hash |  2 ++
>  boot/ti-k3-image-gen/ti-k3-image-gen.mk   | 33 +++++++++++++++++++++++
>  5 files changed, 62 insertions(+)
>  create mode 100644 boot/ti-k3-image-gen/Config.in
>  create mode 100644 boot/ti-k3-image-gen/ti-k3-image-gen.hash
>  create mode 100644 boot/ti-k3-image-gen/ti-k3-image-gen.mk
> 
> diff --git a/DEVELOPERS b/DEVELOPERS
> index 5f36cbf535..81f095f799 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -129,6 +129,7 @@ F:	package/libxmlrpc/
>  F:	package/python-docopt/
>  
>  N:	Anand Gadiyar <gadiyar@ti.com>
> +F:	boot/ti-k3-image-gen/
>  F:	boot/ti-k3-r5-loader/
>  
>  N:	André Zwing <nerv@dawncrow.de>
> @@ -3067,6 +3068,7 @@ N:	Wojciech Niziński <niziak@spox.org>
>  F:	package/fwup/
>  
>  N:	Xuanhao Shi <X15000177@gmail.com>
> +F:	boot/ti-k3-image-gen/
>  F:	boot/ti-k3-r5-loader/

Actually this email is bouncing. please remove it.

>  
>  N:	Yair Ben Avraham <yairba@protonmail.com>
> diff --git a/boot/Config.in b/boot/Config.in
> index ce17b2df6b..1b25bacfee 100644
> --- a/boot/Config.in
> +++ b/boot/Config.in
> @@ -22,6 +22,7 @@ source "boot/s500-bootloader/Config.in"
>  source "boot/shim/Config.in"
>  source "boot/sun20i-d1-spl/Config.in"
>  source "boot/syslinux/Config.in"
> +source "boot/ti-k3-image-gen/Config.in"
>  source "boot/ti-k3-r5-loader/Config.in"
>  source "boot/uboot/Config.in"
>  source "boot/vexpress-firmware/Config.in"
> diff --git a/boot/ti-k3-image-gen/Config.in b/boot/ti-k3-image-gen/Config.in
> new file mode 100644
> index 0000000000..00416dcefc
> --- /dev/null
> +++ b/boot/ti-k3-image-gen/Config.in
> @@ -0,0 +1,24 @@
> +config BR2_TARGET_TI_K3_IMAGE_GEN
> +	bool "ti-k3-image-gen"
> +	select BR2_TARGET_TI_K3_R5_LOADER
> +	help
> +	  Use TI's k3-image-gen to build a separate bare metal
> +	  boot binary from a separate spl. Currently supports
> +	  version 08.04.00.005 as default.
> +
> +	  https://git.ti.com/cgit/k3-image-gen/k3-image-gen/

Same comment as for the patch 1/3, use "if BR2_TARGET_TI_K3_IMAGE_GEN" here.

> +
> +config BR2_TARGET_TI_K3_IMAGE_GEN_SOC
> +	string "SOC type for image gen"
> +	depends on BR2_TARGET_TI_K3_IMAGE_GEN
> +	help
> +	  The target SoC option for image gen.
> +	  For example, "am64x" for AM64X boards.
> +
> +config BR2_TARGET_TI_K3_IMAGE_GEN_CONFIG
> +	string "CONFIG type for image gen"
> +	depends on BR2_TARGET_TI_K3_IMAGE_GEN
> +	help
> +	  The board config option for image gen.
> +	  Usually "sk" or "evm".
> +
> diff --git a/boot/ti-k3-image-gen/ti-k3-image-gen.hash b/boot/ti-k3-image-gen/ti-k3-image-gen.hash
> new file mode 100644
> index 0000000000..e307a02a67
> --- /dev/null
> +++ b/boot/ti-k3-image-gen/ti-k3-image-gen.hash
> @@ -0,0 +1,2 @@
> +# Locally calculated
> +sha256  e585dc868ada21ef3389159541d669b88bc406b453470e92da85d9222d271c96  k3-image-gen-08.04.00.005.tar.gz

Since it's a tool released by TI, it would be great if the hash can be provided
in the release note.

> diff --git a/boot/ti-k3-image-gen/ti-k3-image-gen.mk b/boot/ti-k3-image-gen/ti-k3-image-gen.mk
> new file mode 100644
> index 0000000000..1f97490392
> --- /dev/null
> +++ b/boot/ti-k3-image-gen/ti-k3-image-gen.mk
> @@ -0,0 +1,33 @@
> +################################################################################
> +#
> +# ti-k3-image-gen
> +#
> +################################################################################
> +
> +TI_K3_IMAGE_GEN_VERSION = 08.04.00.005
> +TI_K3_IMAGE_GEN_SITE = https://git.ti.com/cgit/k3-image-gen/k3-image-gen/snapshot
> +TI_K3_IMAGE_GEN_SOURCE = k3-image-gen-$(TI_K3_IMAGE_GEN_VERSION).tar.gz
> +TI_K3_IMAGE_GEN_LICENSE = BSD-3-Clause
> +TI_K3_IMAGE_GEN_LICENSE_FILES = system-firmware-image-gen-1.0-manifest.html

It seems the BSD-3-Clause is not the only license of this tool. The manifest
file is also about GPL-2.0, TI Text File  License, TI Commercial License.

Can you clarify the licensing info ?

Also the manifest file hash should be listed in ti-k3-image-gen.hash

(Actually having an html file as license file may not really practical in the
end, can you provide a LICENSE or COPYING file ?)

> +TI_K3_IMAGE_GEN_INSTALL_IMAGES = YES
> +TI_K3_IMAGE_GEN_DEPENDENCIES = host-arm-gnu-toolchain ti-k3-r5-loader

The build dependency on ti-k3-r5-loader may not be obvious, maybe add a comment
to say that ti-k3-image needs r5-u-boot-spl.bin to build.

> +TI_K3_IMAGE_GEN_MAKE = $(BR2_MAKE)

Why do you really need this? This is only required when the build system
requires make 4.0+. If yes, add a small comment.

> +TI_K3_IMAGE_GEN_SOC = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SOC))
> +TI_K3_IMAGE_GEN_CONFIG = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_CONFIG))
> +TI_K3_IMAGE_GEN_MAKE_OPTS = \
> +	SOC=$(TI_K3_IMAGE_GEN_SOC) \
> +	CONFIG=$(TI_K3_IMAGE_GEN_CONFIG) \
> +	CROSS_COMPILE=$(HOST_ARM_GNU_TOOLCHAIN_INSTALL_DIR)/bin/arm-none-eabi- \

Use $(HOST_DIR) here

> +	SBL=$(BINARIES_DIR)/r5-u-boot-spl.bin \
> +	O=$(BINARIES_DIR) \
> +	BIN_DIR=$(BINARIES_DIR)
> +
> +define TI_K3_IMAGE_GEN_BUILD_CMDS
> +	$(TI_K3_IMAGE_GEN_MAKE) -C $(@D) $(TI_K3_IMAGE_GEN_MAKE_OPTS)
> +endef
> +
> +define TI_K3_IMAGE_GEN_INSTALL_IMAGES_CMDS
> +	cp $(@D)/tiboot3.bin $(BINARIES_DIR)
> +endef


Best regards,
Romain


> +
> +$(eval $(generic-package))

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v5 3/3] board/ti/am64x_sk: add new board
  2022-09-23 20:55 ` [Buildroot] [PATCH v5 3/3] board/ti/am64x_sk: add new board Anand Gadiyar
@ 2022-10-01 17:47   ` Romain Naour
  2022-10-03 14:03     ` Gadiyar, Anand via buildroot
  0 siblings, 1 reply; 11+ messages in thread
From: Romain Naour @ 2022-10-01 17:47 UTC (permalink / raw)
  To: Anand Gadiyar, buildroot; +Cc: Xuanhao Shi, Giulio Benetti, Xuanhao Shi

Hello Anand,

Le 23/09/2022 à 22:55, Anand Gadiyar a écrit :
> From: Xuanhao Shi <x-shi@ti.com>
> 
> Adds support for ti's am64x_sk board.
> Adds the configs for generating output sdcard image.
> Adds the defconfigs for am64x_sk.
> 
> The AM64x_sk board is designed for the AM642 SoC with
> two ARM Cortex-A53 and four ARM Cortex-R5. It also
> supports RJ 45 Ethernet, Wi-Fi, and Bluetooth.
> 
> More information about the board can be found at:
> https://www.ti.com/tool/SK-AM64
> 
> Signed-off-by: Xuanhao Shi <x-shi@ti.com>
> Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
> Reviewed-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> ---
>  DEVELOPERS                     |  4 +++
>  board/ti/am64x_sk/genimage.cfg | 27 +++++++++++++++++++
>  board/ti/am64x_sk/readme.txt   | 49 ++++++++++++++++++++++++++++++++++
>  configs/am64x_sk_defconfig     | 45 +++++++++++++++++++++++++++++++
>  4 files changed, 125 insertions(+)
>  create mode 100644 board/ti/am64x_sk/genimage.cfg
>  create mode 100644 board/ti/am64x_sk/readme.txt
>  create mode 100644 configs/am64x_sk_defconfig
> 
> diff --git a/DEVELOPERS b/DEVELOPERS
> index 81f095f799..121952369c 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -129,8 +129,10 @@ F:	package/libxmlrpc/
>  F:	package/python-docopt/
>  
>  N:	Anand Gadiyar <gadiyar@ti.com>
> +F:	board/ti/am64x_sk/
>  F:	boot/ti-k3-image-gen/
>  F:	boot/ti-k3-r5-loader/
> +F:	configs/am64x_sk_defconfig
>  
>  N:	André Zwing <nerv@dawncrow.de>
>  F:	package/libkrb5/
> @@ -3068,8 +3070,10 @@ N:	Wojciech Niziński <niziak@spox.org>
>  F:	package/fwup/
>  
>  N:	Xuanhao Shi <X15000177@gmail.com>
> +F:	board/ti/am64x_sk/
>  F:	boot/ti-k3-image-gen/
>  F:	boot/ti-k3-r5-loader/
> +F:	configs/am64x_sk_defconfig
>  
>  N:	Yair Ben Avraham <yairba@protonmail.com>
>  F:	package/casync/
> diff --git a/board/ti/am64x_sk/genimage.cfg b/board/ti/am64x_sk/genimage.cfg
> new file mode 100644
> index 0000000000..26304fe98f
> --- /dev/null
> +++ b/board/ti/am64x_sk/genimage.cfg
> @@ -0,0 +1,27 @@
> +image boot.vfat {
> +	vfat {
> +		files = {
> +			"tiboot3.bin",
> +			"tispl.bin",
> +			"u-boot.img",
> +		}
> +	}
> +
> +	size = 16M
> +}
> +
> +image sdcard.img {
> +	hdimage {
> +	}
> +
> +	partition u-boot {
> +		partition-type = 0xC
> +		bootable = "true"
> +		image = "boot.vfat"
> +	}
> +
> +	partition rootfs {
> +		partition-type = 0x83
> +		image = "rootfs.ext4"
> +	}
> +}
> diff --git a/board/ti/am64x_sk/readme.txt b/board/ti/am64x_sk/readme.txt
> new file mode 100644
> index 0000000000..8096fcb2d4
> --- /dev/null
> +++ b/board/ti/am64x_sk/readme.txt
> @@ -0,0 +1,49 @@
> +Texas Instuments AM64x SK Test and Development Board
> +
> +Description
> +===========
> +
> +These configurations will build a complete image and
> +device tree blobs for the the TI AM64x_sk board.
> +
> +How to build it
> +===============
> +
> +Select the default configuration for the target:
> +$ make am64x_sk_defconfig
> +
> +Optional: modify the configuration:
> +$ make menuconfig
> +
> +Build:
> +$ make
> +
> +Result of the build:
> +===================
> +output/images/
> ++-- soc
> ++-- ti-connectivity
> ++-- bl31.bin
> ++-- boot.vfat
> ++-- Image
> ++-- k3-am642-sk.dtb
> ++-- r5-u-boot-spl.bin
> ++-- rootfs.ext2
> ++-- rootfs.ext4
> ++-- rootfs.tar
> ++-- sdcard.img
> ++-- tee.bin
> ++-- tee-header_v2.bin
> ++-- tee-pageable_v2.bin
> ++-- tee-pager_v2.bin
> ++-- tiboot3.bin
> ++-- tispl.bin
> ++-- u-boot.img
> +
> +To copy the image file to the sdcard use dd:
> +$ dd if=output/images/sdcard.img of=/dev/sdX
> +
> +Insert the SDcard into the AM64x_sk board, and power it up with
> +a USB Type-C connector. The system should come up. You can use
> +a micro-USB to connect to the connector labled MAIN_UART0 to
> +communicate with the board.
> diff --git a/configs/am64x_sk_defconfig b/configs/am64x_sk_defconfig
> new file mode 100644
> index 0000000000..1d37b411b3
> --- /dev/null
> +++ b/configs/am64x_sk_defconfig
> @@ -0,0 +1,45 @@
> +BR2_aarch64=y
> +BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
> +BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/ti/am64x_sk/genimage.cfg"
> +BR2_LINUX_KERNEL=y
> +BR2_LINUX_KERNEL_CUSTOM_VERSION=y
> +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.19"
> +BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
> +BR2_LINUX_KERNEL_DTS_SUPPORT=y
> +BR2_LINUX_KERNEL_INTREE_DTS_NAME="ti/k3-am642-sk"
> +BR2_LINUX_KERNEL_INSTALL_TARGET=y
> +BR2_PACKAGE_LINUX_FIRMWARE=y
> +BR2_PACKAGE_LINUX_FIRMWARE_TI_WL18XX=y
> +BR2_TARGET_ROOTFS_EXT2=y
> +BR2_TARGET_ROOTFS_EXT2_4=y
> +BR2_TARGET_ROOTFS_EXT2_SIZE="120M"
> +BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
> +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION=y
> +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE="v2.7.0"
> +BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="k3"
> +BR2_TARGET_ARM_TRUSTED_FIRMWARE_TARGET_BOARD="lite"
> +BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL32_OPTEE=y
> +BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES="SPD=opteed"
> +BR2_TARGET_OPTEE_OS=y
> +BR2_TARGET_OPTEE_OS_NEEDS_PYTHON_CRYPTOGRAPHY=y
> +BR2_TARGET_OPTEE_OS_PLATFORM="k3"
> +BR2_TARGET_TI_K3_IMAGE_GEN=y
> +BR2_TARGET_TI_K3_IMAGE_GEN_SOC="am64x"
> +BR2_TARGET_TI_K3_IMAGE_GEN_CONFIG="evm"
> +BR2_TARGET_TI_K3_R5_LOADER_BOARD="am64x_evm"> +BR2_TARGET_UBOOT=y
> +BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
> +BR2_TARGET_UBOOT_CUSTOM_VERSION=y
> +BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2022.10-rc1"

Same comment as for patch 1/3, use a release version if possible.

I have the sk-tda4vm evaluation board. I'll try to do a runtime test.

Best regards,
Romain

> +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="am64x_evm_a53"
> +BR2_TARGET_UBOOT_NEEDS_DTC=y
> +BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
> +BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
> +# BR2_TARGET_UBOOT_FORMAT_BIN is not set
> +BR2_TARGET_UBOOT_FORMAT_IMG=y
> +BR2_TARGET_UBOOT_SPL=y
> +BR2_TARGET_UBOOT_SPL_NAME="tispl.bin"
> +BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="TEE=$(BINARIES_DIR)/tee-pager_v2.bin"
> +BR2_PACKAGE_HOST_DOSFSTOOLS=y
> +BR2_PACKAGE_HOST_GENIMAGE=y
> +BR2_PACKAGE_HOST_MTOOLS=y

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v5 3/3] board/ti/am64x_sk: add new board
  2022-10-01 17:47   ` Romain Naour
@ 2022-10-03 14:03     ` Gadiyar, Anand via buildroot
  0 siblings, 0 replies; 11+ messages in thread
From: Gadiyar, Anand via buildroot @ 2022-10-03 14:03 UTC (permalink / raw)
  To: Romain Naour, buildroot; +Cc: Xuanhao Shi, Giulio Benetti, Xuanhao Shi

> From: Romain Naour <romain.naour@gmail.com>
> 
> Hello Anand,
> 
> Le 23/09/2022 à 22:55, Anand Gadiyar a écrit :
> > From: Xuanhao Shi <x-shi@ti.com>
> >
> > Adds support for ti's am64x_sk board.
> > Adds the configs for generating output sdcard image.
> > Adds the defconfigs for am64x_sk.
> >
> > The AM64x_sk board is designed for the AM642 SoC with
> > two ARM Cortex-A53 and four ARM Cortex-R5. It also
> > supports RJ 45 Ethernet, Wi-Fi, and Bluetooth.
> >
> > More information about the board can be found at:
> > https://www.ti.com/tool/SK-AM64
> >
> > Signed-off-by: Xuanhao Shi <x-shi@ti.com>
> > Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
> > Reviewed-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> > ---
> >  DEVELOPERS                     |  4 +++
> >  board/ti/am64x_sk/genimage.cfg | 27 +++++++++++++++++++
> >  board/ti/am64x_sk/readme.txt   | 49 ++++++++++++++++++++++++++++++++++
> >  configs/am64x_sk_defconfig     | 45 +++++++++++++++++++++++++++++++
> >  4 files changed, 125 insertions(+)
> >  create mode 100644 board/ti/am64x_sk/genimage.cfg
> >  create mode 100644 board/ti/am64x_sk/readme.txt
> >  create mode 100644 configs/am64x_sk_defconfig
> >
> > diff --git a/DEVELOPERS b/DEVELOPERS
> > index 81f095f799..121952369c 100644
> > --- a/DEVELOPERS
> > +++ b/DEVELOPERS
> > @@ -129,8 +129,10 @@ F:	package/libxmlrpc/
> >  F:	package/python-docopt/
> >
> >  N:	Anand Gadiyar <gadiyar@ti.com>
> > +F:	board/ti/am64x_sk/
> >  F:	boot/ti-k3-image-gen/
> >  F:	boot/ti-k3-r5-loader/
> > +F:	configs/am64x_sk_defconfig
> >
> >  N:	André Zwing <nerv@dawncrow.de>
> >  F:	package/libkrb5/
> > @@ -3068,8 +3070,10 @@ N:	Wojciech Niziński <niziak@spox.org>
> >  F:	package/fwup/
> >
> >  N:	Xuanhao Shi <X15000177@gmail.com>
> > +F:	board/ti/am64x_sk/
> >  F:	boot/ti-k3-image-gen/
> >  F:	boot/ti-k3-r5-loader/
> > +F:	configs/am64x_sk_defconfig
> >
> >  N:	Yair Ben Avraham <yairba@protonmail.com>
> >  F:	package/casync/
> > diff --git a/board/ti/am64x_sk/genimage.cfg b/board/ti/am64x_sk/genimage.cfg
> > new file mode 100644
> > index 0000000000..26304fe98f
> > --- /dev/null
> > +++ b/board/ti/am64x_sk/genimage.cfg
> > @@ -0,0 +1,27 @@
> > +image boot.vfat {
> > +	vfat {
> > +		files = {
> > +			"tiboot3.bin",
> > +			"tispl.bin",
> > +			"u-boot.img",
> > +		}
> > +	}
> > +
> > +	size = 16M
> > +}
> > +
> > +image sdcard.img {
> > +	hdimage {
> > +	}
> > +
> > +	partition u-boot {
> > +		partition-type = 0xC
> > +		bootable = "true"
> > +		image = "boot.vfat"
> > +	}
> > +
> > +	partition rootfs {
> > +		partition-type = 0x83
> > +		image = "rootfs.ext4"
> > +	}
> > +}
> > diff --git a/board/ti/am64x_sk/readme.txt b/board/ti/am64x_sk/readme.txt
> > new file mode 100644
> > index 0000000000..8096fcb2d4
> > --- /dev/null
> > +++ b/board/ti/am64x_sk/readme.txt
> > @@ -0,0 +1,49 @@
> > +Texas Instuments AM64x SK Test and Development Board
> > +
> > +Description
> > +===========
> > +
> > +These configurations will build a complete image and
> > +device tree blobs for the the TI AM64x_sk board.
> > +
> > +How to build it
> > +===============
> > +
> > +Select the default configuration for the target:
> > +$ make am64x_sk_defconfig
> > +
> > +Optional: modify the configuration:
> > +$ make menuconfig
> > +
> > +Build:
> > +$ make
> > +
> > +Result of the build:
> > +===================
> > +output/images/
> > ++-- soc
> > ++-- ti-connectivity
> > ++-- bl31.bin
> > ++-- boot.vfat
> > ++-- Image
> > ++-- k3-am642-sk.dtb
> > ++-- r5-u-boot-spl.bin
> > ++-- rootfs.ext2
> > ++-- rootfs.ext4
> > ++-- rootfs.tar
> > ++-- sdcard.img
> > ++-- tee.bin
> > ++-- tee-header_v2.bin
> > ++-- tee-pageable_v2.bin
> > ++-- tee-pager_v2.bin
> > ++-- tiboot3.bin
> > ++-- tispl.bin
> > ++-- u-boot.img
> > +
> > +To copy the image file to the sdcard use dd:
> > +$ dd if=output/images/sdcard.img of=/dev/sdX
> > +
> > +Insert the SDcard into the AM64x_sk board, and power it up with
> > +a USB Type-C connector. The system should come up. You can use
> > +a micro-USB to connect to the connector labled MAIN_UART0 to
> > +communicate with the board.
> > diff --git a/configs/am64x_sk_defconfig b/configs/am64x_sk_defconfig
> > new file mode 100644
> > index 0000000000..1d37b411b3
> > --- /dev/null
> > +++ b/configs/am64x_sk_defconfig
> > @@ -0,0 +1,45 @@
> > +BR2_aarch64=y
> > +BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
> > +BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/ti/am64x_sk/genimage.cfg"
> > +BR2_LINUX_KERNEL=y
> > +BR2_LINUX_KERNEL_CUSTOM_VERSION=y
> > +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.19"
> > +BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
> > +BR2_LINUX_KERNEL_DTS_SUPPORT=y
> > +BR2_LINUX_KERNEL_INTREE_DTS_NAME="ti/k3-am642-sk"
> > +BR2_LINUX_KERNEL_INSTALL_TARGET=y
> > +BR2_PACKAGE_LINUX_FIRMWARE=y
> > +BR2_PACKAGE_LINUX_FIRMWARE_TI_WL18XX=y
> > +BR2_TARGET_ROOTFS_EXT2=y
> > +BR2_TARGET_ROOTFS_EXT2_4=y
> > +BR2_TARGET_ROOTFS_EXT2_SIZE="120M"
> > +BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
> > +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION=y
> > +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE="v2.7.0"
> > +BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="k3"
> > +BR2_TARGET_ARM_TRUSTED_FIRMWARE_TARGET_BOARD="lite"
> > +BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL32_OPTEE=y
> > +BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES="SPD=opteed"
> > +BR2_TARGET_OPTEE_OS=y
> > +BR2_TARGET_OPTEE_OS_NEEDS_PYTHON_CRYPTOGRAPHY=y
> > +BR2_TARGET_OPTEE_OS_PLATFORM="k3"
> > +BR2_TARGET_TI_K3_IMAGE_GEN=y
> > +BR2_TARGET_TI_K3_IMAGE_GEN_SOC="am64x"
> > +BR2_TARGET_TI_K3_IMAGE_GEN_CONFIG="evm"
> > +BR2_TARGET_TI_K3_R5_LOADER_BOARD="am64x_evm"
> > +BR2_TARGET_UBOOT=y
> > +BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
> > +BR2_TARGET_UBOOT_CUSTOM_VERSION=y
> > +BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2022.10-rc1"
> 
> Same comment as for patch 1/3, use a release version if possible.
> 
> I have the sk-tda4vm evaluation board. I'll try to do a runtime test.
> 

Thanks for the review comments Romain!

Will change this - I'll try and resubmit in a few days after 2022.10 is tagged.
2022.07 should work as well, but I haven't built it. Is it better to have the
older version here or the newer one?

The SK-TDA4VM board is for a different TI processor, so the image is not
likely to work for you. I'd love to submit a patch adding support for that
board as well, but I need to check if there are other dependencies (like
the one on firmware that we ran into for the AM62x). We were hoping to
get the AM64x SK supported first as a baseline.

Best Regards,
Anand

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v5 2/3] boot/ti-k3-image-gen: add new package
  2022-10-01 17:34   ` Romain Naour
@ 2022-10-03 21:33     ` Gadiyar, Anand via buildroot
  0 siblings, 0 replies; 11+ messages in thread
From: Gadiyar, Anand via buildroot @ 2022-10-03 21:33 UTC (permalink / raw)
  To: Romain Naour, buildroot; +Cc: Xuanhao Shi, Giulio Benetti

Hi Romain,

> From: Romain Naour <romain.naour@gmail.com>
> 
> Hello Anand,
> 
> Le 23/09/2022 à 22:55, Anand Gadiyar a écrit :
> > From: Xuanhao Shi <x-shi@ti.com>
> >
> > This is the image generator that builds the full boot binary,
> > tiboot3.bin, for the R5 core on TI's k3 devices.
> > This requires the R5 spl output from the ti-k3-r5-loader package.
> >
> > https://git.ti.com/cgit/k3-image-gen/k3-image-gen
> >
> > Signed-off-by: Xuanhao Shi <x-shi@ti.com>
> > Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
> > Reviewed-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> > ---
> >  DEVELOPERS                                |  2 ++
> >  boot/Config.in                            |  1 +
> >  boot/ti-k3-image-gen/Config.in            | 24 +++++++++++++++++
> >  boot/ti-k3-image-gen/ti-k3-image-gen.hash |  2 ++
> >  boot/ti-k3-image-gen/ti-k3-image-gen.mk   | 33 +++++++++++++++++++++++
> >  5 files changed, 62 insertions(+)
> >  create mode 100644 boot/ti-k3-image-gen/Config.in
> >  create mode 100644 boot/ti-k3-image-gen/ti-k3-image-gen.hash
> >  create mode 100644 boot/ti-k3-image-gen/ti-k3-image-gen.mk
> >
> > diff --git a/DEVELOPERS b/DEVELOPERS
> > index 5f36cbf535..81f095f799 100644
> > --- a/DEVELOPERS
> > +++ b/DEVELOPERS
> > @@ -129,6 +129,7 @@ F:	package/libxmlrpc/
> >  F:	package/python-docopt/
> >
> >  N:	Anand Gadiyar <gadiyar@ti.com>
> > +F:	boot/ti-k3-image-gen/
> >  F:	boot/ti-k3-r5-loader/
> >
> >  N:	André Zwing <nerv@dawncrow.de>
> > @@ -3067,6 +3068,7 @@ N:	Wojciech Niziński <niziak@spox.org>
> >  F:	package/fwup/
> >
> >  N:	Xuanhao Shi <X15000177@gmail.com>
> > +F:	boot/ti-k3-image-gen/
> >  F:	boot/ti-k3-r5-loader/
> 
> Actually this email is bouncing. please remove it.

I think Xuanhao's gmail address is still working, but his TI email address is
no longer active. I've removed it from the CC list and I'll change the
sign-off email ID.


> >  N:	Yair Ben Avraham <yairba@protonmail.com>
> > diff --git a/boot/Config.in b/boot/Config.in
> > index ce17b2df6b..1b25bacfee 100644
> > --- a/boot/Config.in
> > +++ b/boot/Config.in
> > @@ -22,6 +22,7 @@ source "boot/s500-bootloader/Config.in"
> >  source "boot/shim/Config.in"
> >  source "boot/sun20i-d1-spl/Config.in"
> >  source "boot/syslinux/Config.in"
> > +source "boot/ti-k3-image-gen/Config.in"
> >  source "boot/ti-k3-r5-loader/Config.in"
> >  source "boot/uboot/Config.in"
> >  source "boot/vexpress-firmware/Config.in"
> > diff --git a/boot/ti-k3-image-gen/Config.in b/boot/ti-k3-image-gen/Config.in
> > new file mode 100644
> > index 0000000000..00416dcefc
> > --- /dev/null
> > +++ b/boot/ti-k3-image-gen/Config.in
> > @@ -0,0 +1,24 @@
> > +config BR2_TARGET_TI_K3_IMAGE_GEN
> > +	bool "ti-k3-image-gen"
> > +	select BR2_TARGET_TI_K3_R5_LOADER
> > +	help
> > +	  Use TI's k3-image-gen to build a separate bare metal
> > +	  boot binary from a separate spl. Currently supports
> > +	  version 08.04.00.005 as default.
> > +
> > +	  https://git.ti.com/cgit/k3-image-gen/k3-image-gen/
> 
> Same comment as for the patch 1/3, use "if BR2_TARGET_TI_K3_IMAGE_GEN"
> here.

Will fix this.

> 
> > +
> > +config BR2_TARGET_TI_K3_IMAGE_GEN_SOC
> > +	string "SOC type for image gen"
> > +	depends on BR2_TARGET_TI_K3_IMAGE_GEN
> > +	help
> > +	  The target SoC option for image gen.
> > +	  For example, "am64x" for AM64X boards.
> > +
> > +config BR2_TARGET_TI_K3_IMAGE_GEN_CONFIG
> > +	string "CONFIG type for image gen"
> > +	depends on BR2_TARGET_TI_K3_IMAGE_GEN
> > +	help
> > +	  The board config option for image gen.
> > +	  Usually "sk" or "evm".
> > +
> > diff --git a/boot/ti-k3-image-gen/ti-k3-image-gen.hash b/boot/ti-k3-image-gen/ti-k3-image-gen.hash
> > new file mode 100644
> > index 0000000000..e307a02a67
> > --- /dev/null
> > +++ b/boot/ti-k3-image-gen/ti-k3-image-gen.hash
> > @@ -0,0 +1,2 @@
> > +# Locally calculated
> > +sha256 e585dc868ada21ef3389159541d669b88bc406b453470e92da85d9222d271c96  k3-image-gen-08.04.00.005.tar.gz
> 
> Since it's a tool released by TI, it would be great if the hash can be provided
> in the release note.
> 

I'll try and get this included in the repository. I assume it's enough to keep a
<filename.gz.sha256> file that has the hash on the server and we will still have
to create this ti-k3-image-gen.hash file here, with just the comment updated?


> > diff --git a/boot/ti-k3-image-gen/ti-k3-image-gen.mk b/boot/ti-k3-image-gen/ti-k3-image-gen.mk
> > new file mode 100644
> > index 0000000000..1f97490392
> > --- /dev/null
> > +++ b/boot/ti-k3-image-gen/ti-k3-image-gen.mk
> > @@ -0,0 +1,33 @@
> >
> +################################################################################
> > +#
> > +# ti-k3-image-gen
> > +#
> >
> +################################################################################
> > +
> > +TI_K3_IMAGE_GEN_VERSION = 08.04.00.005
> > +TI_K3_IMAGE_GEN_SITE = https://git.ti.com/cgit/k3-image-gen/k3-image-gen/snapshot
> > +TI_K3_IMAGE_GEN_SOURCE = k3-image-gen-$(TI_K3_IMAGE_GEN_VERSION).tar.gz
> > +TI_K3_IMAGE_GEN_LICENSE = BSD-3-Clause
> > +TI_K3_IMAGE_GEN_LICENSE_FILES = system-firmware-image-gen-1.0-manifest.html
> 
> It seems the BSD-3-Clause is not the only license of this tool. The manifest
> file is also about GPL-2.0, TI Text File  License, TI Commercial License.
> 
> Can you clarify the licensing info ?
> 
> Also the manifest file hash should be listed in ti-k3-image-gen.hash
> 
> (Actually having an html file as license file may not really practical in the
> end, can you provide a LICENSE or COPYING file ?)


I checked and confirmed that the license is BSD-3-Clause.
The other terms are mentioned in the "Legend" section of the manifest as
examples. The actual license text is at the end of the manifest file and is
indeed BSD-3-Clause.

I'll add the manifest filename and it's hash in ti-k3-image-gen.hash.

I'm checking about adding a LICENSE file - does this have to go into the
source repository we have? We see some other packages (mainly from TI, but
also some others) which seem to include an html license or manifest file.


> 
> > +TI_K3_IMAGE_GEN_INSTALL_IMAGES = YES
> > +TI_K3_IMAGE_GEN_DEPENDENCIES = host-arm-gnu-toolchain ti-k3-r5-loader
> 
> The build dependency on ti-k3-r5-loader may not be obvious, maybe add a comment
> to say that ti-k3-image needs r5-u-boot-spl.bin to build.
> 

Checking - will fix this.


> > +TI_K3_IMAGE_GEN_MAKE = $(BR2_MAKE)
> 
> Why do you really need this? This is only required when the build system
> requires make 4.0+. If yes, add a small comment.

I think this is not needed - will check and remove it.


> > +TI_K3_IMAGE_GEN_SOC = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SOC))
> > +TI_K3_IMAGE_GEN_CONFIG = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_CONFIG))
> > +TI_K3_IMAGE_GEN_MAKE_OPTS = \
> > +	SOC=$(TI_K3_IMAGE_GEN_SOC) \
> > +	CONFIG=$(TI_K3_IMAGE_GEN_CONFIG) \
> > +
> 	CROSS_COMPILE=$(HOST_ARM_GNU_TOOLCHAIN_INSTALL_DIR)/bin/arm-none-eabi- \
> 
> Use $(HOST_DIR) here

Will fix.


Thanks for the review!! I notice that u-boot v2022.10 just got released, so I'll try and
send out an updated series this week.

Best Regards,
Anand
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2022-10-03 21:33 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-23 20:55 [Buildroot] [PATCH v5 0/3] add support for TI's AM64x boards Anand Gadiyar
2022-09-23 20:55 ` [Buildroot] [PATCH v5 1/3] boot/ti-k3-r5-loader: add new package Anand Gadiyar via buildroot
2022-10-01 17:13   ` Romain Naour
2022-09-23 20:55 ` [Buildroot] [PATCH v5 2/3] boot/ti-k3-image-gen: " Anand Gadiyar
2022-09-26 15:50   ` Andrew Davis via buildroot
2022-10-01 17:34   ` Romain Naour
2022-10-03 21:33     ` Gadiyar, Anand via buildroot
2022-09-23 20:55 ` [Buildroot] [PATCH v5 3/3] board/ti/am64x_sk: add new board Anand Gadiyar
2022-10-01 17:47   ` Romain Naour
2022-10-03 14:03     ` Gadiyar, Anand via buildroot
2022-09-23 21:53 ` [Buildroot] [PATCH v5 0/3] add support for TI's AM64x boards Giulio Benetti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).