aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlistair Delva <adelva@google.com>2022-09-26 11:52:55 -0700
committerAlistair Delva <adelva@google.com>2022-09-26 11:55:33 -0700
commite7db439788ad259f3c6182bb5e6d0b8f3e7c6a53 (patch)
treed8c2c64f2ebd29ff0fbee3a88f710ef33acc8dd7
parent066925bdea42277bc303867dbf7b7f38161dec2a (diff)
ANDROID: Drop unused ENV_RAW_DISK feature
The environment is now compiled into U-Boot, and if a "supplement" is required, it is loaded via verified_import. Drop this old path. Signed-off-by: Alistair Delva <adelva@google.com> Change-Id: I1ebcb27d8ef19b400076ffdc4f3552aa6568133d
-rw-r--r--cmd/nvedit.c1
-rw-r--r--env/Kconfig35
-rw-r--r--env/Makefile1
-rw-r--r--env/env.c3
-rw-r--r--env/raw_disk.c99
-rw-r--r--include/env_internal.h1
6 files changed, 2 insertions, 138 deletions
diff --git a/cmd/nvedit.c b/cmd/nvedit.c
index 304ab0d9369..b1fb6a67eab 100644
--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
@@ -56,7 +56,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_RAW_DISK) || \
defined(CONFIG_ENV_IS_IN_SATA) || \
defined(CONFIG_ENV_IS_IN_SPI_FLASH) || \
defined(CONFIG_ENV_IS_IN_REMOTE) || \
diff --git a/env/Kconfig b/env/Kconfig
index bc7cb8b18df..2f625b22575 100644
--- a/env/Kconfig
+++ b/env/Kconfig
@@ -36,8 +36,8 @@ config ENV_IS_NOWHERE
!ENV_IS_IN_FAT && !ENV_IS_IN_FLASH && \
!ENV_IS_IN_MMC && !ENV_IS_IN_NAND && \
!ENV_IS_IN_NVRAM && !ENV_IS_IN_ONENAND && \
- !ENV_IS_IN_RAW_DISK && !ENV_IS_IN_REMOTE && \
- !ENV_IS_IN_SPI_FLASH && !ENV_IS_IN_UBI
+ !ENV_IS_IN_REMOTE && !ENV_IS_IN_SPI_FLASH && \
+ !ENV_IS_IN_UBI
help
Define this if you don't want to or can't have an environment stored
on a storage medium. In this case the environment will still exist
@@ -91,13 +91,6 @@ config ENV_IS_IN_EXT4
help
Define this if you want to use the EXT4 file system for the environment.
-config ENV_IS_IN_RAW_DISK
- bool "Environment is in a raw partition on a hard disk"
- depends on !CHAIN_OF_TRUST
- help
- Define this if you want to use a raw disk or partition for the
- environment.
-
config ENV_IS_IN_FLASH
bool "Environment in flash memory"
depends on !CHAIN_OF_TRUST
@@ -515,30 +508,6 @@ config ENV_EXT4_DEVICE_AND_PART
leaving the string starting with a colon, and the boot device will
be used.
-config ENV_RAW_DISK_INTERFACE
- string "Name of the block device for the environment"
- depends on ENV_IS_IN_RAW_DISK
- help
- Define this to a string that is the name of the block device.
-
-config ENV_RAW_DISK_DEVICE_AND_PART
- string "Device and partition for where to store the environment image"
- depends on ENV_IS_IN_RAW_DISK
- help
- Define this to a string to specify the partition of the device. It can
- be as following:
-
- "D:P", "D:0", "D", "D:" or "D:auto" (D, P are integers. And P >= 1)
- - "D:P": device D partition P. Error occurs if device D has no
- partition table.
- - "D:0": device D.
- - "D" or "D:": device D partition 1 if device D has partition
- table, or the whole device D if has no partition
- table.
- - "D:auto": first partition in device D with bootable flag set.
- If none, first valid partition in device D. If no
- partition table then means device D.
-
config ENV_EXT4_FILE
string "Name of the EXT4 file to use for the environment"
depends on ENV_IS_IN_EXT4
diff --git a/env/Makefile b/env/Makefile
index 4c8a21371e2..c4ad6543286 100644
--- a/env/Makefile
+++ b/env/Makefile
@@ -25,7 +25,6 @@ endif
obj-$(CONFIG_$(SPL_TPL_)ENV_IS_NOWHERE) += nowhere.o
obj-$(CONFIG_$(SPL_TPL_)ENV_IS_IN_MMC) += mmc.o
obj-$(CONFIG_$(SPL_TPL_)ENV_IS_IN_FAT) += fat.o
-obj-$(CONFIG_$(SPL_TPL_)ENV_IS_IN_RAW_DISK) += raw_disk.o
obj-$(CONFIG_$(SPL_TPL_)ENV_IS_IN_EXT4) += ext4.o
obj-$(CONFIG_$(SPL_TPL_)ENV_IS_IN_NAND) += nand.o
obj-$(CONFIG_$(SPL_TPL_)ENV_IS_IN_SPI_FLASH) += sf.o
diff --git a/env/env.c b/env/env.c
index b7ec6990cfe..936a1d63095 100644
--- a/env/env.c
+++ b/env/env.c
@@ -75,9 +75,6 @@ static enum env_location env_locations[] = {
#ifdef CONFIG_ENV_IS_IN_NVRAM
ENVL_NVRAM,
#endif
-#ifdef CONFIG_ENV_IS_IN_RAW_DISK
- ENVL_RAW_DISK,
-#endif
#ifdef CONFIG_ENV_IS_IN_REMOTE
ENVL_REMOTE,
#endif
diff --git a/env/raw_disk.c b/env/raw_disk.c
deleted file mode 100644
index 4e82c4c80bb..00000000000
--- a/env/raw_disk.c
+++ /dev/null
@@ -1,99 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (c) Copyright 2019 by Google, Inc
- *
- * Author:
- * David Anderson <dvander@google.com>
- */
-
-#include <common.h>
-
-#include <command.h>
-#include <dm/device.h>
-#include <env_internal.h>
-#include <linux/stddef.h>
-#include <malloc.h>
-#include <memalign.h>
-#include <search.h>
-#include <errno.h>
-#include <mmc.h>
-#include <virtio_types.h>
-#include <virtio.h>
-
-#ifdef CONFIG_CMD_SAVEENV
-static int env_raw_disk_save(void)
-{
- ALLOC_CACHE_ALIGN_BUFFER(env_t, env_new, 1);
- struct blk_desc *dev_desc = NULL;
- struct disk_partition info;
- uint blk_cnt, n;
- int part, err;
-
- err = env_export(env_new);
- if (err)
- return err;
-
- part = blk_get_device_part_str(CONFIG_ENV_RAW_DISK_INTERFACE,
- CONFIG_ENV_RAW_DISK_DEVICE_AND_PART,
- &dev_desc, &info, 1);
- if (part < 0)
- return 1;
-
- printf("Writing to disk...");
-
- blk_cnt = ALIGN(CONFIG_ENV_SIZE, info.blksz) / info.blksz;
- n = blk_dwrite(dev_desc, info.start, blk_cnt, (u_char *)env_new);
- if (n != blk_cnt) {
- puts("failed\n");
- return 1;
- }
-
- puts("done\n");
- return 0;
-}
-#endif /* CONFIG_CMD_SAVEENV */
-
-static int env_raw_disk_load(void)
-{
- ALLOC_CACHE_ALIGN_BUFFER(char, buf, CONFIG_ENV_SIZE);
- struct blk_desc *dev_desc = NULL;
- struct disk_partition info;
- uint blk_cnt, n;
- int part;
-
-#ifdef CONFIG_MMC
- if (!strcmp(CONFIG_ENV_RAW_DISK_INTERFACE, "mmc"))
- mmc_initialize(NULL);
-#endif
-#ifdef CONFIG_VIRTIO
- if (!strcmp(CONFIG_ENV_RAW_DISK_INTERFACE, "virtio"))
- virtio_init();
-#endif
-
- part = blk_get_device_part_str(CONFIG_ENV_RAW_DISK_INTERFACE,
- CONFIG_ENV_RAW_DISK_DEVICE_AND_PART,
- &dev_desc, &info, 1);
- if (part < 0) {
- env_set_default(NULL, 0);
- return -EINVAL;
- }
-
- blk_cnt = ALIGN(CONFIG_ENV_SIZE, info.blksz) / info.blksz;
- n = blk_dread(dev_desc, info.start, blk_cnt, buf);
- if (n != blk_cnt) {
- env_set_default(NULL, 0);
- return -EIO;
- }
-
- return env_import(buf, 1, H_EXTERNAL);
-}
-
-U_BOOT_ENV_LOCATION(raw_disk) = {
- .location = ENVL_RAW_DISK,
- ENV_NAME("Raw Disk")
- .load = env_raw_disk_load,
-#ifdef CONFIG_CMD_SAVEENV
- .save = env_save_ptr(env_raw_disk_save),
-#endif
-};
-
diff --git a/include/env_internal.h b/include/env_internal.h
index 93f05481e24..f30fd6159d8 100644
--- a/include/env_internal.h
+++ b/include/env_internal.h
@@ -133,7 +133,6 @@ enum env_location {
ENVL_NAND,
ENVL_NVRAM,
ENVL_ONENAND,
- ENVL_RAW_DISK,
ENVL_REMOTE,
ENVL_SPI_FLASH,
ENVL_UBI,