]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
env: Drop ENV_IS_IN_SATA
authorSimon Glass <sjg@chromium.org>
Wed, 1 Feb 2023 20:19:30 +0000 (13:19 -0700)
committerTom Rini <trini@konsulko.com>
Tue, 7 Feb 2023 19:33:48 +0000 (14:33 -0500)
This is not used anywhere, so drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
cmd/nvedit.c
env/Makefile
env/env.c
env/sata.c [deleted file]

index 53e6b57b60eada06ad974915c1ea418bb56dfd4b..e2a5f0089e990cdcb066c02f5d8cc2985bb30bbe 100644 (file)
@@ -51,7 +51,6 @@ DECLARE_GLOBAL_DATA_PTR;
        defined(CONFIG_ENV_IS_IN_NAND)          || \
        defined(CONFIG_ENV_IS_IN_NVRAM)         || \
        defined(CONFIG_ENV_IS_IN_ONENAND)       || \
-       defined(CONFIG_ENV_IS_IN_SATA)          || \
        defined(CONFIG_ENV_IS_IN_SPI_FLASH)     || \
        defined(CONFIG_ENV_IS_IN_REMOTE)        || \
        defined(CONFIG_ENV_IS_IN_UBI)
index bb6e24b396df9b0a6db9e843817c5b95e88c850b..673b979fdfa915718a7974c596811b6f546355be 100644 (file)
@@ -16,7 +16,6 @@ extra-$(CONFIG_ENV_IS_IN_FLASH) += embedded.o
 obj-$(CONFIG_ENV_IS_IN_NVRAM) += embedded.o
 obj-$(CONFIG_ENV_IS_IN_NVRAM) += nvram.o
 obj-$(CONFIG_ENV_IS_IN_ONENAND) += onenand.o
-obj-$(CONFIG_ENV_IS_IN_SATA) += sata.o
 obj-$(CONFIG_ENV_IS_IN_REMOTE) += remote.o
 obj-$(CONFIG_ENV_IS_IN_UBI) += ubi.o
 endif
index 06078c7f3744178524211ae46873ffcf311a3b42..0f73ebc08e0e615c29fcbe5e440c55f215b997fe 100644 (file)
--- a/env/env.c
+++ b/env/env.c
@@ -78,9 +78,6 @@ static enum env_location env_locations[] = {
 #ifdef CONFIG_ENV_IS_IN_REMOTE
        ENVL_REMOTE,
 #endif
-#ifdef CONFIG_ENV_IS_IN_SATA
-       ENVL_ESATA,
-#endif
 #ifdef CONFIG_ENV_IS_IN_SPI_FLASH
        ENVL_SPI_FLASH,
 #endif
diff --git a/env/sata.c b/env/sata.c
deleted file mode 100644 (file)
index 9442cfc..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2010-2016 Freescale Semiconductor, Inc.
- */
-
-/* #define DEBUG */
-
-#include <common.h>
-
-#include <command.h>
-#include <env.h>
-#include <env_internal.h>
-#include <linux/stddef.h>
-#include <errno.h>
-#include <memalign.h>
-#include <sata.h>
-#include <search.h>
-
-#if defined(CONFIG_ENV_OFFSET_REDUND)
-#error ENV REDUND not supported
-#endif
-
-#if !defined(CONFIG_ENV_OFFSET) || !defined(CONFIG_ENV_SIZE)
-#error CONFIG_ENV_OFFSET or CONFIG_ENV_SIZE not defined
-#endif
-
-__weak int sata_get_env_dev(void)
-{
-       return CONFIG_SYS_SATA_ENV_DEV;
-}
-
-#ifdef CONFIG_CMD_SAVEENV
-static inline int write_env(struct blk_desc *sata, unsigned long size,
-                           unsigned long offset, void *buffer)
-{
-       uint blk_start, blk_cnt, n;
-
-       blk_start = ALIGN(offset, sata->blksz) / sata->blksz;
-       blk_cnt   = ALIGN(size, sata->blksz) / sata->blksz;
-
-       n = blk_dwrite(sata, blk_start, blk_cnt, buffer);
-
-       return (n == blk_cnt) ? 0 : -1;
-}
-
-static int env_sata_save(void)
-{
-       ALLOC_CACHE_ALIGN_BUFFER(env_t, env_new, 1);
-       struct blk_desc *sata = NULL;
-       int env_sata, ret;
-
-       if (sata_initialize())
-               return 1;
-
-       env_sata = sata_get_env_dev();
-
-       sata = sata_get_dev(env_sata);
-       if (sata == NULL) {
-               printf("Unknown SATA(%d) device for environment!\n",
-                      env_sata);
-               return 1;
-       }
-
-       ret = env_export(env_new);
-       if (ret)
-               return 1;
-
-       printf("Writing to SATA(%d)...", env_sata);
-       if (write_env(sata, CONFIG_ENV_SIZE, CONFIG_ENV_OFFSET, (u_char *)env_new)) {
-               puts("failed\n");
-               return 1;
-       }
-
-       puts("done\n");
-       return 0;
-}
-#endif /* CONFIG_CMD_SAVEENV */
-
-static inline int read_env(struct blk_desc *sata, unsigned long size,
-                          unsigned long offset, void *buffer)
-{
-       uint blk_start, blk_cnt, n;
-
-       blk_start = ALIGN(offset, sata->blksz) / sata->blksz;
-       blk_cnt   = ALIGN(size, sata->blksz) / sata->blksz;
-
-       n = blk_dread(sata, blk_start, blk_cnt, buffer);
-
-       return (n == blk_cnt) ? 0 : -1;
-}
-
-static void env_sata_load(void)
-{
-       ALLOC_CACHE_ALIGN_BUFFER(char, buf, CONFIG_ENV_SIZE);
-       struct blk_desc *sata = NULL;
-       int env_sata;
-
-       if (sata_initialize())
-               return -EIO;
-
-       env_sata = sata_get_env_dev();
-
-       sata = sata_get_dev(env_sata);
-       if (sata == NULL) {
-               printf("Unknown SATA(%d) device for environment!\n", env_sata);
-               return -EIO;
-       }
-
-       if (read_env(sata, CONFIG_ENV_SIZE, CONFIG_ENV_OFFSET, buf)) {
-               env_set_default(NULL, 0);
-               return -EIO;
-       }
-
-       return env_import(buf, 1, H_EXTERNAL);
-}
-
-U_BOOT_ENV_LOCATION(sata) = {
-       .location       = ENVL_ESATA,
-       ENV_NAME("SATA")
-       .load           = env_sata_load,
-       .save           = env_save_ptr(env_sata_save),
-};