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 064DAC433EF for ; Mon, 13 Jun 2022 00:02:40 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C788C84425; Mon, 13 Jun 2022 02:02:22 +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="ZzUaCgq6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D4B7C84425; Mon, 13 Jun 2022 02:02:15 +0200 (CEST) Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) (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 7927583EDC for ; Mon, 13 Jun 2022 02:02:09 +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-qt1-x829.google.com with SMTP id i25so2973240qtq.0 for ; Sun, 12 Jun 2022 17:02:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=UshSTOs2ulKWI5LZRAf4T0Sdv30paBTQyS5An2xqMxs=; b=ZzUaCgq6GZ4riniAU0jy3wmpV/qicCVEVRV7ozPYDl9T16gVm4b5lEu0cTsX7Cyw6R xcVPLUaWq9CpDfW6XsAZR4VoaY96MsCS0s/dDAVesicnlSK2rNho8V3rhpyLltKNdJYI liATk8hSiGuck6vOmJjqtqKwh9JZkQ6FoCiHw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=UshSTOs2ulKWI5LZRAf4T0Sdv30paBTQyS5An2xqMxs=; b=3Eg3+2hlEtiL7KFOzWzp/NGZhxE1mipMnYQVs3mU6B+zA4y8aVHyCaGoRXPm6GqzfV LZNuxlCSl4NYaJgGBU+IPugi/cAM8JzdocGvgSYDJAvMOGw6cOq/zYl5P1R6MUQQ6vMu 47e/aWwvJHf0YDOAYl6gnybgsn01w/CDv1phR88RZQm9E3wjVftukbWe2MqRP0T1hV2T cMMQ1ZC/rI2+E1ROD+ar+xJWFOHeFsom/W9l4gSeXi7O6sumj9b31USIRTvpluQcm9th 7ycKGiESN/dxq7SfDxUFNfEdhzao7NEorBBlPW/HSt+TgsL+fErADcy9Q4WnKb2BjQdt YMxQ== X-Gm-Message-State: AOAM531Fw0tBs1oJOWVD1SprMJP1LBa3sFbehHIsTsFVTR13wuUqFMKW B6SyBZPs2sLzcNv5eKVm7yU/i78ESiHpag== X-Google-Smtp-Source: ABdhPJzdxP8YoSHQNJyWejtppfoM+MmbJLRAPmkLlkVpH7waBvQoRRfK9prn4vIw8S58maTv5wfJwQ== X-Received: by 2002:ac8:5783:0:b0:305:32:700d with SMTP id v3-20020ac85783000000b003050032700dmr20819128qta.31.1655078527581; Sun, 12 Jun 2022 17:02:07 -0700 (PDT) Received: from bill-the-cat.lan (cpe-65-184-195-139.ec.res.rr.com. [65.184.195.139]) by smtp.gmail.com with ESMTPSA id h5-20020a05620a400500b006a6d4261f40sm2625551qko.111.2022.06.12.17.02.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jun 2022 17:02:07 -0700 (PDT) From: Tom Rini To: u-boot@lists.denx.de Cc: Michal Simek Subject: [PATCH 1/8] Convert CONFIG_ENV_MIN_ENTRIES et al to Kconfig Date: Sun, 12 Jun 2022 20:01:58 -0400 Message-Id: <20220613000205.891039-1-trini@konsulko.com> X-Mailer: git-send-email 2.25.1 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.5 at phobos.denx.de X-Virus-Status: Clean This converts the following to Kconfig: CONFIG_ENV_MIN_ENTRIES CONFIG_ENV_MAX_ENTRIES Cc: Michal Simek Signed-off-by: Tom Rini --- I'm not 100% sure that what was being done in xilinx_zynqmp.h was working before this change. If we _need_ to tweak this value down in SPL we need to introduce CONFIG_SPL_ENV_{MIN,MAX}_ENTRIES and use CONFIG_VAL() in the code. --- README | 8 -------- configs/clearfog_defconfig | 1 + configs/helios4_defconfig | 1 + env/Kconfig | 16 ++++++++++++++++ include/configs/clearfog.h | 2 -- include/configs/helios4.h | 2 -- include/configs/xilinx_zynqmp.h | 5 ----- lib/hashtable.c | 7 ------- 8 files changed, 18 insertions(+), 24 deletions(-) diff --git a/README b/README index 841f8ce082c0..7649dae36338 100644 --- a/README +++ b/README @@ -1877,14 +1877,6 @@ Configuration Settings: while unprotecting/erasing/programming. Please only enable this option if you really know what you are doing. -- CONFIG_ENV_MAX_ENTRIES - - Maximum number of entries in the hash table that is used - internally to store the environment settings. The default - setting is supposed to be generous and should work in most - cases. This setting can be used to tune behaviour; see - lib/hashtable.c for details. - - CONFIG_ENV_FLAGS_LIST_DEFAULT - CONFIG_ENV_FLAGS_LIST_STATIC Enable validation of the values given to environment variables when diff --git a/configs/clearfog_defconfig b/configs/clearfog_defconfig index bec36beb8554..1ee0c6637573 100644 --- a/configs/clearfog_defconfig +++ b/configs/clearfog_defconfig @@ -50,6 +50,7 @@ CONFIG_CMD_TIME=y CONFIG_CMD_MVEBU_BUBT=y # CONFIG_SPL_PARTITION_UUIDS is not set CONFIG_ENV_OVERWRITE=y +CONFIG_ENV_MIN_ENTRIES=128 CONFIG_ARP_TIMEOUT=200 CONFIG_NET_RETRY_COUNT=50 CONFIG_NET_RANDOM_ETHADDR=y diff --git a/configs/helios4_defconfig b/configs/helios4_defconfig index 2a1db65d1bfd..4642eb1ccb25 100644 --- a/configs/helios4_defconfig +++ b/configs/helios4_defconfig @@ -51,6 +51,7 @@ CONFIG_CMD_TIME=y CONFIG_CMD_MVEBU_BUBT=y # CONFIG_SPL_PARTITION_UUIDS is not set CONFIG_ENV_OVERWRITE=y +CONFIG_ENV_MIN_ENTRIES=128 CONFIG_ARP_TIMEOUT=200 CONFIG_NET_RETRY_COUNT=50 CONFIG_NET_RANDOM_ETHADDR=y diff --git a/env/Kconfig b/env/Kconfig index 2f625b22575a..0aed7aea46bc 100644 --- a/env/Kconfig +++ b/env/Kconfig @@ -30,6 +30,22 @@ config ENV_OVERWRITE Use this to permit overriding of certain environmental variables like Ethernet and Serial +config ENV_MIN_ENTRIES + int "Minimum number of entries in the environment hashtable" + default 64 + help + Minimum number of entries in the hash table that is used internally + to store the environment settings. + +config ENV_MAX_ENTRIES + int "Maximumm number of entries in the environment hashtable" + default 512 + help + Maximum number of entries in the hash table that is used internally + to store the environment settings. The default setting is supposed to + be generous and should work in most cases. This setting can be used + to tune behaviour; see lib/hashtable.c for details. + config ENV_IS_NOWHERE bool "Environment is not stored" default y if !ENV_IS_IN_EEPROM && !ENV_IS_IN_EXT4 && \ diff --git a/include/configs/clearfog.h b/include/configs/clearfog.h index af04352eda3b..9969269bf2ac 100644 --- a/include/configs/clearfog.h +++ b/include/configs/clearfog.h @@ -18,8 +18,6 @@ * U-Boot into it. */ -#define CONFIG_ENV_MIN_ENTRIES 128 - /* Environment in MMC */ /* * For SD - reserve 1 LBA for MBR + 1M for u-boot image. The MMC/eMMC diff --git a/include/configs/helios4.h b/include/configs/helios4.h index cae20073584c..ff2c50644326 100644 --- a/include/configs/helios4.h +++ b/include/configs/helios4.h @@ -18,8 +18,6 @@ * U-Boot into it. */ -#define CONFIG_ENV_MIN_ENTRIES 128 - /* Environment in MMC */ /* * For SD - reserve 1 LBA for MBR + 1M for u-boot image. The MMC/eMMC diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h index 20515b4e26ac..4e71a42cd346 100644 --- a/include/configs/xilinx_zynqmp.h +++ b/include/configs/xilinx_zynqmp.h @@ -207,11 +207,6 @@ /* ATF is my kernel image */ -#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_DFU) -# define CONFIG_SPL_HASH -# define CONFIG_ENV_MAX_ENTRIES 10 -#endif - #ifdef CONFIG_SPL_SYS_MALLOC_SIMPLE # error "Disable CONFIG_SPL_SYS_MALLOC_SIMPLE. Full malloc needs to be used" #endif diff --git a/lib/hashtable.c b/lib/hashtable.c index ff5ff7263949..90c8465611e9 100644 --- a/lib/hashtable.c +++ b/lib/hashtable.c @@ -35,13 +35,6 @@ # include #endif -#ifndef CONFIG_ENV_MIN_ENTRIES /* minimum number of entries */ -#define CONFIG_ENV_MIN_ENTRIES 64 -#endif -#ifndef CONFIG_ENV_MAX_ENTRIES /* maximum number of entries */ -#define CONFIG_ENV_MAX_ENTRIES 512 -#endif - #define USED_FREE 0 #define USED_DELETED -1 -- 2.25.1