From patchwork Mon Mar 4 15:32:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3053 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id EDFCC3FA2C for ; Mon, 4 Mar 2024 16:34:29 +0100 (CET) Received: by mail-lf1-f69.google.com with SMTP id 2adb3069b0e04-5132c85310asf3573863e87.2 for ; Mon, 04 Mar 2024 07:34:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709566469; cv=pass; d=google.com; s=arc-20160816; b=h4rZVvDebs7pJjgMsZtNTPAGPF/3oL6bjR7ZXX6Q2ts+KV5IjTYMvbtqGJiNf9uGHZ 4oX661UKDW8Q5mIy9GR9IjD5CQsKkWDYFv2rBPZxb8mOxLu78hSUXH+agg5YvoQ6KP/u 5qIX3DdcJGRAJ0onrUd2rhEGavMGqH9YzeESbUfViOGIIWahVQS4lvaTwp0zVmPVO+2r oGYRoYdlu27QL+V0BoPfSfI2XSUnaBdYiVNghQ8NbXxVUvmotcbiKLazywOqxNB+hKb7 E0BTsArog48rsvriDKOeCsNtKfWRDFDzRMa/3akBOKNQ7tKwB3ndxPf2vNHDyE16CJB8 ik5A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=GzUL91P8uP79PrllwyQtlMj29S9KoXpJLQFE97bJUfk=; fh=v/GGWBjBCmV5Wy7Rv1kWneh9A+ztLeQBJBM09Hr+PEE=; b=p/o/OP/nyw9GUGF5+3jcWf+2nTUNGvUTuSsX2ORKG/4OuVyoaL/vUdqo59pC3f8AOW UCI4d/aOtZpy/A7gfVAg3iRXuvzOCkKIiR6GXoKuJUGtOF75EC0ymtHMbtqVlt7fMS2I rikZ4XgPPH/h2vhgf8TrliBanVov7T5oXlN5+vJLCCS48BMfLt/uHfqBhy/8nvvPFRP4 9mJtKp6yrVR8XPojGlms5nCOQ3+IfxS+QypwS8sz3oneGFnQZVlEcjskdLglaNkun6H9 ZbLawOR1ZQ4gh+VV5+jVo4Vxm5GCkut18kZ0yBpb/RUldfRV0pcBuEnAMKmm61PLG0xD byfQ==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=I+hVODKG; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1709566469; x=1710171269; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=GzUL91P8uP79PrllwyQtlMj29S9KoXpJLQFE97bJUfk=; b=gDfbppm6qZAnu6AkQM3LJ1lJ4akYbbHMavEBa+xQbGRQvl9DFfhCSbAhTP3ANZA0yi 6estR8bsQUAS/NR+7KH6ALIIxaBGCxDsreXqhhumANRPiezCQsvbIuls18T+3e7lpwjD kTBhfUOueriF1TaVZYrL0z9FH9nj1IDTM2m/I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709566469; x=1710171269; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GzUL91P8uP79PrllwyQtlMj29S9KoXpJLQFE97bJUfk=; b=L1XE9itq98oTGMevSdSgG4ZRWCTkIgnu/rIzHeGQDeF3Yvkw27xHrLt7ycdR8rto5v 41AOhn507CUdAhYKyiOeF4i+kmnrqtQb9X4Ir9b6XLCcQ9yiChwJplzDuzIj76v2Lw1E iloLa+P4BdqPQWPeDBdv1tte1s7K4IUQoJH3hV0X/FXVcbWIGCRjtaWxCZiY/1mgwt4m 86AEu4jxNR3YHtXQ985JkqmwE4O0lrB8AlH/nGi3hIMX0UCzg75hQMaARiLZs3leFvGf KUE3pq6Pp1PO0IALrDf9IjCu/pYcs+sCB8jougIwHAxHMOjZhzUInpD/uiqRZuhSShKe rOjg== X-Forwarded-Encrypted: i=2; AJvYcCV9F/6IvRGjrtwOaIkd/7n5do47BrvjyjDJ4jxPEMuaRTgq13FGYT1xo8rxIydJFzQEFypCuZJl1KInqWxMN8u6ZIRrK198Sfsjqhxs0SY3VQmtNtOPC0lCVVqnBA== X-Gm-Message-State: AOJu0YyMdSRmjUZ3+VJt/4pw8DouY1yo3anSJlMM160Ht2WNEdu99mfo 4cgQE//lB987eA+z56uw+N1JPwRNtO+DQlEjRiLlRNkzJLDP7T11APg4R4v07znHQQ== X-Google-Smtp-Source: AGHT+IHp1wrhQVDNcBOV4e40vwxPAi5zZUUXVMbBY7dv2/zTlQW0XqTCX5y+Q195m7o3fkzkJURQvQ== X-Received: by 2002:a05:6512:3127:b0:512:d78e:90fa with SMTP id p7-20020a056512312700b00512d78e90famr5602078lfd.15.1709566469408; Mon, 04 Mar 2024 07:34:29 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:5412:b0:566:730a:6e8b with SMTP id ev18-20020a056402541200b00566730a6e8bls259876edb.0.-pod-prod-03-eu; Mon, 04 Mar 2024 07:34:28 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWpOaRZtRargRtWXbBMnUWgSWvj8BaFQGu2DLYTQc3ZjuK8yaG6zLNsCeL4eeLLaPaUoq3q7UFqkKJcGJ6qC0sUgtX1YNXb5t3P/JcfqBqIaDfM X-Received: by 2002:a17:906:c49:b0:a44:7e16:af30 with SMTP id t9-20020a1709060c4900b00a447e16af30mr5846333ejf.63.1709566467962; Mon, 04 Mar 2024 07:34:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709566467; cv=none; d=google.com; s=arc-20160816; b=Sxi7lC2eEbtsybY48BfsmPfGSIO1ZZBmPLzawAfYM0GBPgFvNsDe6SGToBpoplorJT aiCfc2myeWtTS6d9cE7h6/tC4X1HMQGb+XMwsGYsvsuVOt287oPvZpGhVEaqjv6Wu1jd U6WlI+LrNkwMaoRzlMKdy0XTH6VZFwXmvuupFguF6MmJ8MIBmltMP+ZcydCnQx+kOqkU AFyn7O0oMpp8rzVG6LOloJzbl8jJUccRJEriEWMZC6zMlBV08eNcEP+9k6g/G9XEHS2T OSc78ddAYZCYn67uP1ti7y90AYPHY2rrg/XSgjbk6MsmSLe0kA2pyI2lzLI5iIvFQgps s4GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=BOGhPRnmbpl1vVASgmS2jJ5Nlo6TpoJenWbLbZor/h8=; fh=tNPWA6yf9rwP5VgN4MQCafpAuewQkn4sOT/9LllJCnU=; b=z1e3YzvM7uzR3gLf/rKTpCISstR5LLT8UXuwqo++DkyKQmdHmrpqtReW3RKqOSYJ0E 6CMw76ccZuuMCZgHQNwEnYj7ILubC5oBGroIFwg2EPiNlCSRIgFboZQJeVIIemdoMabZ fbkLR5GeiHvss1RxJFW7/lioW9ELXRT2HCFvTYhQr7Rmy5wJI4bnjSC+gRQA9ZXgeOe4 DH8AOHpu0jq7ZQf48dhF2XDPppGfyhZazTf+CQt+0I3OEiaVoKz/5nPbRMwI23Ck6f9u 5GaSdB19LE3ZydGRCVu/NH7/GSuvq1/5q8/ibCsQvCKC/8VEg+f0QFBJIaUH+qvZlcLc FU2g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=I+hVODKG; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id lz8-20020a170906fb0800b00a458d416504sor135677ejb.15.2024.03.04.07.34.27 for (Google Transport Security); Mon, 04 Mar 2024 07:34:27 -0800 (PST) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Forwarded-Encrypted: i=1; AJvYcCXHZN7fRVV0R9KYroBJYjYIpddLRBn7v+yxK/RIH5RwNGP+9Hqwt2+ZcEFcC5BbAybAWku//z4X8grOqXTX8Zh6CYjv+L4BpTkUa1BFeRsLGzHw X-Received: by 2002:a17:907:b9c8:b0:a44:dc56:e93f with SMTP id xa8-20020a170907b9c800b00a44dc56e93fmr4054595ejc.46.1709566467691; Mon, 04 Mar 2024 07:34:27 -0800 (PST) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2001:b07:6474:ebbf:72fe:558f:d55e:d423]) by smtp.gmail.com with ESMTPSA id sa20-20020a1709076d1400b00a4432543b21sm4936082ejc.198.2024.03.04.07.34.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 07:34:27 -0800 (PST) From: Dario Binacchi To: buildroot@buildroot.org Cc: Romain Naour , Alexander Sverdlin , Andreas Dannenberg , Yegor Yefremov , Xuanhao Shi , Anand Gadiyar , James Hilliard , Thomas Petazzoni , Dario Binacchi , michael@amarulasolutions.com, Asaf Kahlon , francois.perrad@gadz.org, linux-amarula@amarulasolutions.com, bryce@redpinelabs.com Subject: [PATCH v9 16/22] configs/ti_am62x_sk_defconfig: bump U-Boot version to 2024.01 Date: Mon, 4 Mar 2024 16:32:47 +0100 Message-ID: <20240304153253.732708-17-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240304153253.732708-1-dario.binacchi@amarulasolutions.com> References: <20240304153253.732708-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=I+hVODKG; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The 2024.01 version of U-Boot for the am62x-sk board has introduced two major changes: - The device tree k3-am625-sk.dtb is no longer searched in /boot, but in /boot/dtb/ti. Hence, the disabling of BR2_LINUX_KERNEL_INSTALL_TARGET and the use of extlinux.conf for the proper loading of the device tree. Furthermore, the parameter BR2_ROOTFS_POST_SCRIPT_ARGS was used to auto-generate the extlinux.conf file so that developers can change the kernel loading options by modifying the .config. - U-Boot is capable of building tiboot3.bin using Binman. So it's no longer necessary to use custom tools like ti-k3-image-gen. Tested on SK-AM62B-P1. Signed-off-by: Dario Binacchi --- Changes in v7: - Add devicetree k3-am625-sk.dtb to extlinux.conf - Improve error messages in post-build.sh script Changes in v6: - Enable BR2_TARGET_UBOOT_USE_BINMAN option Changes in v5: - Update commit message. Changes in v4: - bump to 204.01 instead of 2023.10 - Update the commit message - Replace 'PARTUUID=00000000-02' with '/dev/mmcblk1p2' where to get rootfs in the BR2_ROOTFS_POST_SCRIPT_ARGS insided the ti_am62x_sk_defconfig. Changes in v2: - Update the commit message - Drop Python options required by binman. - Enable BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN. This option automatically selects the Python modules required by binman. board/ti/am62x-sk/genimage.cfg | 7 ++++- board/ti/am62x-sk/post-build.sh | 54 +++++++++++++++++++++++++++++++++ board/ti/am62x-sk/post-image.sh | 5 +++ configs/ti_am62x_sk_defconfig | 13 ++++---- 4 files changed, 72 insertions(+), 7 deletions(-) create mode 100755 board/ti/am62x-sk/post-build.sh create mode 100755 board/ti/am62x-sk/post-image.sh diff --git a/board/ti/am62x-sk/genimage.cfg b/board/ti/am62x-sk/genimage.cfg index 26304fe98f99..398209f4d831 100644 --- a/board/ti/am62x-sk/genimage.cfg +++ b/board/ti/am62x-sk/genimage.cfg @@ -4,10 +4,15 @@ image boot.vfat { "tiboot3.bin", "tispl.bin", "u-boot.img", + "k3-am625-sk.dtb", + "Image" + } + file extlinux/extlinux.conf { + image = extlinux.conf } } - size = 16M + size = 64M } image sdcard.img { diff --git a/board/ti/am62x-sk/post-build.sh b/board/ti/am62x-sk/post-build.sh new file mode 100755 index 000000000000..4f19f4d6cf91 --- /dev/null +++ b/board/ti/am62x-sk/post-build.sh @@ -0,0 +1,54 @@ +#!/bin/sh -x + +# genimage will need to find the extlinux.conf +# in the binaries directory + +die() { + cat <&2 +Error: $@ + +Usage: ${0} -c -r [-x ] +EOF + exit 1 +} + +o='c:d:r:x:' +O='console:,devicetree:,root:,extra-args:' +opts="$(getopt -n "${0##*/}" -o "${o}" -l "${O}" -- "${@}")" +eval set -- "${opts}" +while [ ${#} -gt 0 ]; do + case "${1}" in + (-c|--console) + CONSOLE="${2}"; shift 2 + ;; + (-d|--devicetree) + DEVICETREE="${2}"; shift 2 + ;; + (-r|--root) + ROOT="${2}"; shift 2 + ;; + (-x|--extra-args) + EXTRA_ARGS="${2}"; shift 2 + ;; + (--) + shift 1; break + ;; + esac +done + +[ -n "${CONSOLE}" ] || die "Missing \`console' argument" +[ -n "${DEVICETREE}" ] || die "Missing \`devicetree' argument" +[ -n "${ROOT}" ] || die "Missing \`root' argument" +append="console=${CONSOLE} root=${ROOT} rw rootfstype=ext4 rootwait" +if [ -n "${EXTRA_ARGS}" ]; then + append="${append} ${EXTRA_ARGS}" +fi + +mkdir -p "${BINARIES_DIR}" +cat <<-__HEADER_EOF > "${BINARIES_DIR}/extlinux.conf" + label am62x-sk-buildroot + kernel /Image + fdtdir / + devicetree /${DEVICETREE} + append ${append} + __HEADER_EOF diff --git a/board/ti/am62x-sk/post-image.sh b/board/ti/am62x-sk/post-image.sh new file mode 100755 index 000000000000..34f732c091ad --- /dev/null +++ b/board/ti/am62x-sk/post-image.sh @@ -0,0 +1,5 @@ +#!/bin/sh -x + +BOARD_DIR="$(dirname "$0")" + +support/scripts/genimage.sh -c "${BOARD_DIR}/genimage.cfg" diff --git a/configs/ti_am62x_sk_defconfig b/configs/ti_am62x_sk_defconfig index 2835404a57df..7d9912024a16 100644 --- a/configs/ti_am62x_sk_defconfig +++ b/configs/ti_am62x_sk_defconfig @@ -1,14 +1,14 @@ BR2_aarch64=y BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_4=y -BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh" -BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/ti/am62x-sk/genimage.cfg" +BR2_ROOTFS_POST_BUILD_SCRIPT="board/ti/am62x-sk/post-build.sh" +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/ti/am62x-sk/post-image.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="-c ttyS2,115200n8 -d k3-am625-sk.dtb -r /dev/mmcblk1p2 -x earlycon=ns16550a,mmio32,0x02800000" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_VERSION=y BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.4.16" BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="ti/k3-am625-sk" -BR2_LINUX_KERNEL_INSTALL_TARGET=y BR2_PACKAGE_LINUX_FIRMWARE=y BR2_PACKAGE_LINUX_FIRMWARE_TI_WL18XX=y BR2_PACKAGE_TI_K3=y @@ -24,20 +24,21 @@ BR2_TARGET_ARM_TRUSTED_FIRMWARE_TARGET_BOARD="lite" BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL32_OPTEE=y BR2_TARGET_OPTEE_OS=y BR2_TARGET_OPTEE_OS_PLATFORM="k3-am62x" -BR2_TARGET_TI_K3_IMAGE_GEN=y +BR2_TARGET_TI_K3_BOOT_FIRMWARE=y BR2_TARGET_TI_K3_R5_LOADER=y BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION=y -BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION_VALUE="2022.10" +BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION_VALUE="2024.01" BR2_TARGET_TI_K3_R5_LOADER_BOARD_DEFCONFIG="am62x_evm_r5" 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" +BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2024.01" BR2_TARGET_UBOOT_BOARD_DEFCONFIG="am62x_evm_a53" BR2_TARGET_UBOOT_NEEDS_DTC=y BR2_TARGET_UBOOT_NEEDS_OPENSSL=y BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y BR2_TARGET_UBOOT_NEEDS_TI_K3_DM=y +BR2_TARGET_UBOOT_USE_BINMAN=y # BR2_TARGET_UBOOT_FORMAT_BIN is not set BR2_TARGET_UBOOT_FORMAT_IMG=y BR2_TARGET_UBOOT_SPL=y