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 68E25C4332F for ; Fri, 2 Dec 2022 21:45:13 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2D79F85238; Fri, 2 Dec 2022 22:43:28 +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="kT9E8Vz1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B945285035; Fri, 2 Dec 2022 22:43:12 +0100 (CET) Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) (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 48FAA84F7C for ; Fri, 2 Dec 2022 22:43:08 +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-ej1-x635.google.com with SMTP id vp12so14429903ejc.8 for ; Fri, 02 Dec 2022 13:43:08 -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=Z+I33NWMRr4SO1RZU8lBbtqiOw6IghMu3W0ahh1ysE0=; b=kT9E8Vz1dsXcPddrT6Rq+AYCiRkYTr2+DywkzGUhLASvpZkaopZzR3xUAvAQwZjZo3 jLZBjFNb5SzI+U7oBfKO4jowIlEgeylmvADMhajmZ1YjzZyNVG0UvD1FUBMS8DudF3Hm iqXmO28eIGvE0dQfXR1FjMmNb3osICWO411mA= 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=Z+I33NWMRr4SO1RZU8lBbtqiOw6IghMu3W0ahh1ysE0=; b=x4PwB9wbNEjfcE6aL8LBvehVP5YOPhk4lg8oFssHneHCHDnvQKUd+3lqMPwHgKxiFA Yk7RgqqLIXcFfJnTmkc8OZdCOeyp/7bgtNFx3vGdX9wlrXqL2YiGXqg4DbL96hcOYZ5X r9546XMOLsWFSl62prf0fL+JcJAOw3aGm2Fc7I8anuYQTxX7c/iFhinc5cnR6tI/zY38 JmWJ5S/LOGrhaKgG605HrpfljRQOG+mSbVGboJpR+iX43aqpZi3RiC499mMQNJiCh6Nw lfnp9Lz5Ini3DFKUGvLEt8zNTTwtbS5GZJlRttryAW3v2HF/iQvnj8qmpIfUf1A+/h4K 8maQ== X-Gm-Message-State: ANoB5pm00wO0ro9l+IAyiLm/oYQUrrTiNC50lNrQPA2UrEbyUuiQbHnB juA/CPPCyz6oaNKKH0KVPPe6qc5TUTlrou4t X-Google-Smtp-Source: AA0mqf5Jmdt81xp0EUQcIbsEWqboCIr1C+kP5/Ki2JnjV58GDrjPIujHRGtMDPPIKKRszYR/E/I/Lw== X-Received: by 2002:a17:906:fcac:b0:7ba:a9cb:8643 with SMTP id qw12-20020a170906fcac00b007baa9cb8643mr37565423ejb.298.1670017387825; Fri, 02 Dec 2022 13:43:07 -0800 (PST) Received: from bill-the-cat.lan (2603-6081-7b00-6400-f99b-6f1a-2cc1-7368.res6.spectrum.com. [2603:6081:7b00:6400:f99b:6f1a:2cc1:7368]) by smtp.gmail.com with ESMTPSA id b23-20020a1709062b5700b007c0991735c0sm3434248ejg.79.2022.12.02.13.43.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 13:43:07 -0800 (PST) From: Tom Rini To: u-boot@lists.denx.de Subject: [PATCH 13/41] env: nvram: Drop CONFIG_SYS_NVRAM_ACCESS_ROUTINE Date: Fri, 2 Dec 2022 16:42:23 -0500 Message-Id: <20221202214251.3027264-13-trini@konsulko.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221202214251.3027264-1-trini@konsulko.com> References: <20221127152536.1556469-41-trini@konsulko.com> <20221202214251.3027264-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 This option is unused anywhere and likely untested for quite a long while. Drop this support code. Signed-off-by: Tom Rini --- env/nvram.c | 42 ++---------------------------------------- 1 file changed, 2 insertions(+), 40 deletions(-) diff --git a/env/nvram.c b/env/nvram.c index fb265235afc7..229c34f5367c 100644 --- a/env/nvram.c +++ b/env/nvram.c @@ -7,22 +7,6 @@ * Andreas Heppel */ -/* - * 09-18-2001 Andreas Heppel, Sysgo RTS GmbH - * - * It might not be possible in all cases to use 'memcpy()' to copy - * the environment to NVRAM, as the NVRAM might not be mapped into - * the memory space. (I.e. this is the case for the BAB750). In those - * cases it might be possible to access the NVRAM using a different - * method. For example, the RTC on the BAB750 is accessible in IO - * space using its address and data registers. To enable usage of - * NVRAM in those cases I invented the functions 'nvram_read()' and - * 'nvram_write()', which will be activated upon the configuration - * #define CONFIG_SYS_NVRAM_ACCESS_ROUTINE. Note, that those functions are - * strongly dependent on the used HW, and must be redefined for each - * board that wants to use them. - */ - #include #include #include @@ -35,22 +19,14 @@ DECLARE_GLOBAL_DATA_PTR; -#ifdef CONFIG_SYS_NVRAM_ACCESS_ROUTINE -extern void *nvram_read(void *dest, const long src, size_t count); -extern void nvram_write(long dest, const void *src, size_t count); -#else static env_t *env_ptr = (env_t *)CONFIG_ENV_ADDR; -#endif static int env_nvram_load(void) { char buf[CONFIG_ENV_SIZE]; -#if defined(CONFIG_SYS_NVRAM_ACCESS_ROUTINE) - nvram_read(buf, CONFIG_ENV_ADDR, CONFIG_ENV_SIZE); -#else memcpy(buf, (void *)CONFIG_ENV_ADDR, CONFIG_ENV_SIZE); -#endif + return env_import(buf, 1, H_EXTERNAL); } @@ -63,12 +39,9 @@ static int env_nvram_save(void) if (rcode) return rcode; -#ifdef CONFIG_SYS_NVRAM_ACCESS_ROUTINE - nvram_write(CONFIG_ENV_ADDR, &env_new, CONFIG_ENV_SIZE); -#else if (memcpy((char *)CONFIG_ENV_ADDR, &env_new, CONFIG_ENV_SIZE) == NULL) rcode = 1; -#endif + return rcode; } @@ -79,19 +52,8 @@ static int env_nvram_save(void) */ static int env_nvram_init(void) { -#if defined(CONFIG_SYS_NVRAM_ACCESS_ROUTINE) - ulong crc; - uchar data[ENV_SIZE]; - - nvram_read(&crc, CONFIG_ENV_ADDR, sizeof(ulong)); - nvram_read(data, CONFIG_ENV_ADDR + sizeof(ulong), ENV_SIZE); - - if (crc32(0, data, ENV_SIZE) == crc) { - gd->env_addr = (ulong)CONFIG_ENV_ADDR + sizeof(long); -#else if (crc32(0, env_ptr->data, ENV_SIZE) == env_ptr->crc) { gd->env_addr = (ulong)&env_ptr->data; -#endif gd->env_valid = ENV_VALID; } else { gd->env_valid = ENV_INVALID; -- 2.25.1