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 E2564C46467 for ; Tue, 10 Jan 2023 16:22:03 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 70CB685605; Tue, 10 Jan 2023 17:20:47 +0100 (CET) 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="h1lJ849A"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5E8188539D; Tue, 10 Jan 2023 17:20:00 +0100 (CET) Received: from mail-yw1-x112e.google.com (mail-yw1-x112e.google.com [IPv6:2607:f8b0:4864:20::112e]) (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 EFF8B85566 for ; Tue, 10 Jan 2023 17:19:55 +0100 (CET) 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-yw1-x112e.google.com with SMTP id 00721157ae682-4bf16baa865so159973877b3.13 for ; Tue, 10 Jan 2023 08:19:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=m6MGWxnYA4VqFxLQFHYhgr3xsUmGjh09i11XpNmVmBs=; b=h1lJ849Aqqfm/clVrFIM7aIkx9EqQJinVf+GLuFfqXvo7sBdonf3ImkB0f6v/cIpAq voJUnmP/EXXmswXy5URdreth90YFseIWZ+OyIwReq/thYPIiHG2Xztl3eYgXEFJlYL6q GxNdDEJKCaRH82Vna2PsQyKxG+ooOMI2FG9XQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=m6MGWxnYA4VqFxLQFHYhgr3xsUmGjh09i11XpNmVmBs=; b=Z0UxFBMB1GXl8EyNO8sEHrE82kcjNv1aHYazDdGNIs2qKlQDUjvGRFEHnM0ZXcFLYs ky6nQT9vmKmSeaagnA8WQkbOS0BusroJcTX7bcB7OXlh23guaysIWKPSiu9Mv+g2cPZz iLmYMAQr5RmRYs5/nixYAJTAILj6m+zxMWyWjboPPfQsaP6b/n1nElIFFu4SrIkHpzBJ H1pXOkLnMIeTmNjq5H7Wed+Cu5kdsI353Eq/SK3JdyPNEG8CNg3AkXq5P86d7we9H8wh 70DLPN5T4DMZ19JSDZTRtRcxQCF1LP+Cx81nDCImLH4FEF+fl9ch+e812na5nyiW0lg5 0svQ== X-Gm-Message-State: AFqh2kqmhxdbGWwNicxWs/zfxoKCSxvkuwIHF6lyQznPQOaefG9k98mU 8ef28qLawGxRvjJrfOq47a8aCLQ65LSdDSmkknM= X-Google-Smtp-Source: AMrXdXvIAJrlcJzjE7FJJeKAGm1qNfUhb0ZnnhuZLXa9Qxv7eZCzhLP82pltBUnsAEj7d9KgcYgfaw== X-Received: by 2002:a05:7500:4496:b0:ef:f110:982b with SMTP id gb22-20020a057500449600b000eff110982bmr2009231gab.24.1673367594228; Tue, 10 Jan 2023 08:19:54 -0800 (PST) Received: from bill-the-cat.lan (2603-6081-7b00-6400-2c2f-ce0f-8dee-7136.res6.spectrum.com. [2603:6081:7b00:6400:2c2f:ce0f:8dee:7136]) by smtp.gmail.com with ESMTPSA id d12-20020a05620a240c00b006fcc3858044sm7557110qkn.86.2023.01.10.08.19.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 08:19:53 -0800 (PST) From: Tom Rini To: u-boot@lists.denx.de Subject: [PATCH 09/19] common/update: Finish Kconfig migration Date: Tue, 10 Jan 2023 11:19:36 -0500 Message-Id: <20230110161946.3816866-9-trini@konsulko.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230110161946.3816866-1-trini@konsulko.com> References: <20230110161946.3816866-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.6 at phobos.denx.de X-Virus-Status: Clean We can enforce the dependencies of this module via Kconfig now, so do so rather than with #error statements. Further, we can ensure that all required values are set to their defaults in Kconfig, and in fact already do so, so remove the tests here. The exception is CONFIG_UPDATE_LOAD_ADDR which needed to be migrated to Kconfig in the first place. Signed-off-by: Tom Rini --- common/Kconfig | 16 ++++++++++++---- common/update.c | 21 --------------------- 2 files changed, 12 insertions(+), 25 deletions(-) diff --git a/common/Kconfig b/common/Kconfig index 8c71d3c972bf..655d198d30b5 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -865,7 +865,7 @@ config UPDATE_COMMON config UPDATE_TFTP bool "Auto-update using fitImage via TFTP" - depends on FIT + depends on FIT && OF_LIBFDT && !MTD_NOR_FLASH select UPDATE_COMMON help This option allows performing update of NOR with data in fitImage @@ -874,16 +874,24 @@ config UPDATE_TFTP config UPDATE_TFTP_CNT_MAX int "The number of connection retries during auto-update" default 0 - depends on UPDATE_TFTP + depends on UPDATE_TFTP || DFU_TFTP config UPDATE_TFTP_MSEC_MAX int "Delay in mSec to wait for the TFTP server during auto-update" default 100 - depends on UPDATE_TFTP + depends on UPDATE_TFTP || DFU_TFTP + +config UPDATE_LOAD_ADDR + hex "Address in memory to load the update to" + depends on UPDATE_TFTP || DFU_TFTP + default 0x100000 + help + This option defines the location in memory to be used to load the + update to, if 'loadaddr' is not set in the environment. config UPDATE_FIT bool "Firmware update using fitImage" - depends on FIT + depends on FIT && OF_LIBFDT depends on DFU select UPDATE_COMMON help diff --git a/common/update.c b/common/update.c index 80f16af65358..3502713d7d83 100644 --- a/common/update.c +++ b/common/update.c @@ -10,14 +10,6 @@ #include #include -#if !(defined(CONFIG_FIT) && defined(CONFIG_OF_LIBFDT)) -#error "CONFIG_FIT and CONFIG_OF_LIBFDT are required for auto-update feature" -#endif - -#if defined(CONFIG_UPDATE_TFTP) && !defined(CONFIG_MTD_NOR_FLASH) -#error "CONFIG_UPDATE_TFTP and !CONFIG_MTD_NOR_FLASH needed for legacy behaviour" -#endif - #include #include #include @@ -31,19 +23,6 @@ /* env variable holding the location of the update file */ #define UPDATE_FILE_ENV "updatefile" -/* set configuration defaults if needed */ -#ifndef CONFIG_UPDATE_LOAD_ADDR -#define CONFIG_UPDATE_LOAD_ADDR 0x100000 -#endif - -#ifndef CONFIG_UPDATE_TFTP_MSEC_MAX -#define CONFIG_UPDATE_TFTP_MSEC_MAX 100 -#endif - -#ifndef CONFIG_UPDATE_TFTP_CNT_MAX -#define CONFIG_UPDATE_TFTP_CNT_MAX 0 -#endif - extern ulong tftp_timeout_ms; extern int tftp_timeout_count_max; #ifdef CONFIG_MTD_NOR_FLASH -- 2.25.1