u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [PATCH 09/19] common/update: Finish Kconfig migration
Date: Tue, 10 Jan 2023 11:19:36 -0500	[thread overview]
Message-ID: <20230110161946.3816866-9-trini@konsulko.com> (raw)
In-Reply-To: <20230110161946.3816866-1-trini@konsulko.com>

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 <trini@konsulko.com>
---
 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 <cpu_func.h>
 #include <image.h>
 
-#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 <command.h>
 #include <env.h>
 #include <net.h>
@@ -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


  parent reply	other threads:[~2023-01-10 16:22 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-10 16:19 [PATCH 01/19] global: Remove unused CONFIG defines Tom Rini
2023-01-10 16:19 ` [PATCH 02/19] arc: Migrate ARC_MMU_VER to Kconfig Tom Rini
2023-01-10 16:19 ` [PATCH 03/19] i2c: fsl_i2c: Rework usage of CONFIG_SYS_IMMR Tom Rini
2023-01-10 16:19 ` [PATCH 04/19] arm: Rework usage of CONFIG_ARMV[78]_SECURE_BASE in linker scripts Tom Rini
2023-01-10 16:19 ` [PATCH 05/19] dm: ns16550: Change how we get UART_REG to be defined Tom Rini
2023-01-11  0:15   ` Simon Glass
2023-01-17 22:10   ` [PATCHv2 05/19] dm: ns16550: Restore how we define UART_REG Tom Rini
2023-01-17 23:34     ` Andre Przywara
2023-01-18 14:15     ` Quentin Schulz
2023-01-10 16:19 ` [PATCH 06/19] arm: lib1funcs.S: Update compatibility with Linux comment slightly Tom Rini
2023-01-10 16:19 ` [PATCH 07/19] autoboot: Rework CONFIG_AUTOBOOT_STOP_STR_* usage Tom Rini
2023-01-10 16:19 ` [PATCH 08/19] spl: sata: Rework the loading case it not use IS_ENABLED(...) Tom Rini
2023-01-10 16:19 ` Tom Rini [this message]
2023-01-10 16:19 ` [PATCH 10/19] fpga: Migrate CONFIG_MAX_FPGA_DEVICES to Kconfig Tom Rini
2023-01-11  8:17   ` Michal Simek
2023-01-10 16:19 ` [PATCH 11/19] usb: musb: Rename CONFIG_USB_MUSB_TIMEOUT to MUSB_TIMEOUT Tom Rini
2023-01-10 17:20   ` Marek Vasut
2023-01-10 16:19 ` [PATCH 12/19] fsl-layerscape: Rework usage of CONFIG_CLUSTER_CLK_FREQ Tom Rini
2023-01-10 16:19 ` [PATCH 13/19] net: phy: mv88e61xx: Finish migration of MV88E61XX_FIXED_PORTS Tom Rini
2023-01-10 17:11   ` Ramon Fried
2023-01-10 16:19 ` [PATCH 14/19] nxp: Finish migration of SYS_FSL_IFC_BANK_COUNT to Kconfig Tom Rini
2023-01-10 16:19 ` [PATCH 15/19] nxp: Finish migration of SYS_FSL_SRDS_[12] " Tom Rini
2023-01-10 16:19 ` [PATCH 16/19] usbtty: Remove default CONFIG_USBD_* values Tom Rini
2023-01-10 16:19 ` [PATCH 17/19] watchdog: Clean up defaults for imx_watchdog / ulp_wdog Tom Rini
2023-01-10 16:54   ` Stefan Roese
2023-01-10 16:19 ` [PATCH 18/19] global: Finish CONFIG -> CFG migration Tom Rini
2023-01-11  0:15   ` Simon Glass
2023-01-10 16:19 ` [PATCH 19/19] CI: Make check for new defined CONFIG symbols even more robust Tom Rini
2023-01-11  0:15   ` Simon Glass
2023-01-20 23:21 ` [PATCH 01/19] global: Remove unused CONFIG defines Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230110161946.3816866-9-trini@konsulko.com \
    --to=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).