Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DA98EEB64DD for ; Tue, 25 Jul 2023 21:09:17 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5595686128; Tue, 25 Jul 2023 23:08:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="IlXcm6pV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2FE1386768; Tue, 25 Jul 2023 23:08:54 +0200 (CEST) Received: from mail-vs1-xe34.google.com (mail-vs1-xe34.google.com [IPv6:2607:f8b0:4864:20::e34]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 76FC786377 for ; Tue, 25 Jul 2023 23:08:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-vs1-xe34.google.com with SMTP id ada2fe7eead31-440ac4b44a8so2090260137.3 for ; Tue, 25 Jul 2023 14:08:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; t=1690319330; x=1690924130; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=buqD7IyFyazz+YAqBbR/X1SvhWkfHGXeYnwW0ZzFGBI=; b=IlXcm6pV1nklk3m3yk0rNAjOTnIdkgAy5rv2LJt7KtvEzRN7KSZsoG7mAdEHKzhQgY AElwyuilGZp1VBkRdpfJHdLpXpSWgRQKuCGztIjMxP2dal/OIrWa0Av2E4EJ96G4WXZZ UTqs8k+RNYiRZgbN00FaK7XEGXV4bdNXG10/A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690319330; x=1690924130; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=buqD7IyFyazz+YAqBbR/X1SvhWkfHGXeYnwW0ZzFGBI=; b=fmQHbugs56UyvQ+0biTJyUf/L4lhqLC/ijhOdsXXqZQiTXrd7kOugw3gk+ECjzh6PO mNFGSUyofeQ94SII/GFGikRyi3BE6a1NS27qND5IQsz9E4MlRxwwDCcDqCjYNI33ybH+ Mu03wId2YwtP/1Ge2wllVAlmCisAYYfURmqtQjFfGSvfRmkvzEkSktAO1y7BUvQDBNHs 0xg3uHKIg/rF8bi6xvYffwtSR+F+XXYGzAi6Oftq4Ilv7rqiQOiXeC3T+1KiLdxp36Wu 5DBp4hMgrF0H6pFSfwBDnm6Od20QVC9VGhZ+G5rIy4N+nF3RzyE34DN5Jm3E9Od64u4H IBMQ== X-Gm-Message-State: ABy/qLYP5HbPkmqQQONoS/rUuIc05r5JNFU5XiroVxIVcseooECUlGx7 sBJMmzKiFnAVYPdMsWHzaRWjj2GJsN8JBWs4uFXZjw== X-Google-Smtp-Source: APBJJlE0g1Augu8wcBJjGRg7ftwqb0SUuWjPNW900+/rXopy7CfmX2/j2ZRGqGkhaRUEWswLs8pGKg== X-Received: by 2002:a05:6102:3005:b0:443:8034:be4a with SMTP id s5-20020a056102300500b004438034be4amr131862vsa.28.1690319330112; Tue, 25 Jul 2023 14:08:50 -0700 (PDT) Received: from bill-the-cat.lan (2603-6081-7b00-6400-b236-e3a5-57be-379d.res6.spectrum.com. [2603:6081:7b00:6400:b236:e3a5:57be:379d]) by smtp.gmail.com with ESMTPSA id z26-20020ab0565a000000b0078f3657faa5sm366825uaa.36.2023.07.25.14.08.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jul 2023 14:08:49 -0700 (PDT) From: Tom Rini To: u-boot@lists.denx.de Cc: Simon Glass Subject: [u-boot-test-hooks 2/4] bin/writer.rpi*mount: Rework to support all current Pi platforms Date: Tue, 25 Jul 2023 17:08:45 -0400 Message-Id: <20230725210847.1472585-2-trini@konsulko.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230725210847.1472585-1-trini@konsulko.com> References: <20230725210847.1472585-1-trini@konsulko.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Now that we have access to more variables in our "mount" writer scripts, we can have a single one that covers all Pi variants. Signed-off-by: Tom Rini --- I use this locally to test a Pi 3 in both 32, 64 and "arm64" mode. Cc: Simon Glass --- bin/kea/conf.rpi_3_32b_sjg-rpi_3b | 2 +- bin/kea/conf.rpi_3_sjg-rpi_3b | 2 +- bin/{writer.rpi3_mount => writer.rpi_mount} | 46 +++++++++++++-------- 3 files changed, 31 insertions(+), 19 deletions(-) rename bin/{writer.rpi3_mount => writer.rpi_mount} (63%) diff --git a/bin/kea/conf.rpi_3_32b_sjg-rpi_3b b/bin/kea/conf.rpi_3_32b_sjg-rpi_3b index 5fe98687221d..020eca2404d8 100644 --- a/bin/kea/conf.rpi_3_32b_sjg-rpi_3b +++ b/bin/kea/conf.rpi_3_32b_sjg-rpi_3b @@ -23,7 +23,7 @@ reset_impl=ykush flash_impl=sdwire_poweroff_mount power_impl=ykush -flash_writer=rpi3_mount +flash_writer=rpi_mount ykush_serial=YK17698 ykush_port=1 diff --git a/bin/kea/conf.rpi_3_sjg-rpi_3b b/bin/kea/conf.rpi_3_sjg-rpi_3b index 64ffff01737f..d8d2a94f036a 100644 --- a/bin/kea/conf.rpi_3_sjg-rpi_3b +++ b/bin/kea/conf.rpi_3_sjg-rpi_3b @@ -23,7 +23,7 @@ reset_impl=ykush flash_impl=sdwire_ykush_mount power_impl=ykush -flash_writer=rpi3_mount +flash_writer=rpi_mount ykush_serial=YK17698 ykush_port=1 diff --git a/bin/writer.rpi3_mount b/bin/writer.rpi_mount similarity index 63% rename from bin/writer.rpi3_mount rename to bin/writer.rpi_mount index a63e7999e57b..73fb8bf6af04 100755 --- a/bin/writer.rpi3_mount +++ b/bin/writer.rpi_mount @@ -1,4 +1,5 @@ # Copyright 2019 Google LLC. All rights reserved. +# Copyright 2024 Konsulko Group. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), @@ -18,27 +19,38 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # DEALINGS IN THE SOFTWARE. -# Writes rpi3_b to the board - -set -ex +set -e build=${U_BOOT_BUILD_DIR} echo "Writing to ${mount_dir} from build at ${build}" -# First make a copy of the original files if we haven't already -if [[ ! -e ${mount_dir}/config.orig ]]; then - cp ${mount_dir}/config.txt ${mount_dir}/config.orig -fi -if [[ ! -e ${mount_dir}/rpi3-u-boot.bin.orig ]]; then - cp ${mount_dir}/rpi3-u-boot.bin ${mount_dir}/rpi3-u-boot.bin.orig -fi +case "${board_type}" in +rpi) + kernel_dst=kernel.img + ;; +rpi_2) + kernel_dst=kernel7.img + ;; +rpi_3|rpi_3b|rpi_3_b_plus|rpi_4|rpi_arm64) + kernel_dst=kernel8.img + ;; +rpi_3_32b|rpi_4_32b) + kernel_dst=kernel8-32.img + ;; +*) + echo Unknown Pi \""${board_type}"\" + exit 1 + ;; +esac + +sudo rm -f ${mount_dir}/kernel*img +sudo cp -v ${build}/u-boot.bin ${mount_dir}/${kernel_dst} -# Enable the UART and fix the GPU frequency so it works correctly -sed -i '/enable_uart/c\enable_uart = 1' /media/rpi3_b_boot/config.txt -if ! grep -q "^gpu_freq=250" /media/rpi3_b_boot/config.txt; then - echo 'gpu_freq=250' >>/media/rpi3_b_boot/config.txt -fi +echo "enable_uart=1" | sudo tee ${mount_dir}/config.txt -# Copy U-Boot over from the build directory -cp ${build}/u-boot.bin ${mount_dir}/rpi3-u-boot.bin +case "${board_ident}" in +3-32-pl011) + echo "dtoverlay=pi3-miniuart-bt" | sudo tee -a ${mount_dir}/config.txt + ;; +esac -- 2.34.1