summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/Kconfig8
-rw-r--r--cmd/Makefile1
-rw-r--r--cmd/aes.c1
-rw-r--r--cmd/avb.c1
-rw-r--r--cmd/bdinfo.c1
-rw-r--r--cmd/binop.c1
-rw-r--r--cmd/blob.c1
-rw-r--r--cmd/bmp.c8
-rw-r--r--cmd/bootefi.c1
-rw-r--r--cmd/bootm.c2
-rw-r--r--cmd/bootmenu.c1
-rw-r--r--cmd/cbfs.c1
-rw-r--r--cmd/config.c1
-rw-r--r--cmd/cramfs.c1
-rw-r--r--cmd/dtimg.c1
-rw-r--r--cmd/efidebug.c1
-rw-r--r--cmd/elf.c2
-rw-r--r--cmd/ethsw.c2
-rw-r--r--cmd/fdt.c1
-rw-r--r--cmd/fpga.c2
-rw-r--r--cmd/gpt.c1
-rw-r--r--cmd/i2c.c1
-rw-r--r--cmd/ide.c4
-rw-r--r--cmd/ini.c2
-rw-r--r--cmd/itest.c1
-rw-r--r--cmd/jffs2.c1
-rw-r--r--cmd/license.c1
-rw-r--r--cmd/load.c1
-rw-r--r--cmd/lzmadec.c1
-rw-r--r--cmd/md5sum.c1
-rw-r--r--cmd/mtdparts.c1
-rw-r--r--cmd/mvebu/bubt.c1
-rw-r--r--cmd/nand.c1
-rw-r--r--cmd/net.c1
-rw-r--r--cmd/nvedit.c57
-rw-r--r--cmd/nvedit_efi.c1
-rw-r--r--cmd/part.c1
-rw-r--r--cmd/pcmcia.c341
-rw-r--r--cmd/pxe.c1
-rw-r--r--cmd/qfw.c1
-rw-r--r--cmd/reiser.c1
-rw-r--r--cmd/setexpr.c1
-rw-r--r--cmd/source.c1
-rw-r--r--cmd/spl.c1
-rw-r--r--cmd/tpm-common.c1
-rw-r--r--cmd/tpm-v1.c1
-rw-r--r--cmd/tpm_test.c1
-rw-r--r--cmd/trace.c1
-rw-r--r--cmd/ubi.c1
-rw-r--r--cmd/unzip.c2
-rw-r--r--cmd/ximg.c2
-rw-r--r--cmd/zfs.c1
-rw-r--r--cmd/zip.c1
53 files changed, 68 insertions, 405 deletions
diff --git a/cmd/Kconfig b/cmd/Kconfig
index 22a3737b4e..041de1d831 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -1042,14 +1042,6 @@ config CMD_PCI
peripherals. Sub-commands allow bus enumeration, displaying and
changing configuration space and a few other features.
-config CMD_PCMCIA
- bool "pinit - Set up PCMCIA device"
- help
- Provides a means to initialise a PCMCIA (Personal Computer Memory
- Card International Association) device. This is an old standard from
- about 1990. These devices are typically removable memory or network
- cards using a standard 68-pin connector.
-
config CMD_PINMUX
bool "pinmux - show pins muxing"
default y if PINCTRL
diff --git a/cmd/Makefile b/cmd/Makefile
index 43a6b0ee21..58827b5679 100644
--- a/cmd/Makefile
+++ b/cmd/Makefile
@@ -106,7 +106,6 @@ obj-$(CONFIG_CMD_PART) += part.o
ifdef CONFIG_PCI
obj-$(CONFIG_CMD_PCI) += pci.o
endif
-obj-$(CONFIG_CMD_PCMCIA) += pcmcia.o
obj-$(CONFIG_CMD_PINMUX) += pinmux.o
obj-$(CONFIG_CMD_PXE) += pxe.o
obj-$(CONFIG_CMD_WOL) += wol.o
diff --git a/cmd/aes.c b/cmd/aes.c
index 25efb9642a..7ff4a71709 100644
--- a/cmd/aes.c
+++ b/cmd/aes.c
@@ -7,7 +7,6 @@
#include <common.h>
#include <command.h>
-#include <environment.h>
#include <uboot_aes.h>
#include <malloc.h>
#include <asm/byteorder.h>
diff --git a/cmd/avb.c b/cmd/avb.c
index 3f6fd763a0..5bc158252b 100644
--- a/cmd/avb.c
+++ b/cmd/avb.c
@@ -7,6 +7,7 @@
#include <avb_verify.h>
#include <command.h>
+#include <env.h>
#include <image.h>
#include <malloc.h>
#include <mmc.h>
diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c
index 86c17dc427..ae6006f85f 100644
--- a/cmd/bdinfo.c
+++ b/cmd/bdinfo.c
@@ -9,6 +9,7 @@
*/
#include <common.h>
#include <command.h>
+#include <env.h>
#include <linux/compiler.h>
DECLARE_GLOBAL_DATA_PTR;
diff --git a/cmd/binop.c b/cmd/binop.c
index 116a2c0d55..6d2df5f3dd 100644
--- a/cmd/binop.c
+++ b/cmd/binop.c
@@ -2,6 +2,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <hexdump.h>
#include <malloc.h>
#include <mapmem.h>
diff --git a/cmd/blob.c b/cmd/blob.c
index d3b6e454bf..80478b8802 100644
--- a/cmd/blob.c
+++ b/cmd/blob.c
@@ -6,7 +6,6 @@
#include <common.h>
#include <command.h>
-#include <environment.h>
#include <malloc.h>
#include <asm/byteorder.h>
#include <linux/compiler.h>
diff --git a/cmd/bmp.c b/cmd/bmp.c
index 00f0256a30..d2a39f677f 100644
--- a/cmd/bmp.c
+++ b/cmd/bmp.c
@@ -9,16 +9,16 @@
*/
#include <common.h>
-#include <dm.h>
-#include <lcd.h>
-#include <mapmem.h>
#include <bmp_layout.h>
#include <command.h>
-#include <asm/byteorder.h>
+#include <dm.h>
+#include <gzip.h>
+#include <lcd.h>
#include <malloc.h>
#include <mapmem.h>
#include <splash.h>
#include <video.h>
+#include <asm/byteorder.h>
static int bmp_info (ulong addr);
diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index a45bfd139f..f613cce7e2 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -11,6 +11,7 @@
#include <dm.h>
#include <efi_loader.h>
#include <efi_selftest.h>
+#include <env.h>
#include <errno.h>
#include <linux/libfdt.h>
#include <linux/libfdt_env.h>
diff --git a/cmd/bootm.c b/cmd/bootm.c
index 41b341e2e5..8279f2b7cc 100644
--- a/cmd/bootm.c
+++ b/cmd/bootm.c
@@ -10,7 +10,7 @@
#include <common.h>
#include <bootm.h>
#include <command.h>
-#include <environment.h>
+#include <env.h>
#include <errno.h>
#include <image.h>
#include <malloc.h>
diff --git a/cmd/bootmenu.c b/cmd/bootmenu.c
index 0ae9d5a681..3dc2c854ac 100644
--- a/cmd/bootmenu.c
+++ b/cmd/bootmenu.c
@@ -6,6 +6,7 @@
#include <common.h>
#include <command.h>
#include <ansi.h>
+#include <env.h>
#include <menu.h>
#include <watchdog.h>
#include <malloc.h>
diff --git a/cmd/cbfs.c b/cmd/cbfs.c
index c118a952ac..3d1fc95972 100644
--- a/cmd/cbfs.c
+++ b/cmd/cbfs.c
@@ -8,6 +8,7 @@
*/
#include <common.h>
#include <command.h>
+#include <env.h>
#include <cbfs.h>
static int do_cbfs_init(cmd_tbl_t *cmdtp, int flag, int argc,
diff --git a/cmd/config.c b/cmd/config.c
index fcc9116a49..d2810d573b 100644
--- a/cmd/config.c
+++ b/cmd/config.c
@@ -5,6 +5,7 @@
#include <common.h>
#include <command.h>
+#include <gzip.h>
#include <malloc.h>
#include "config_data_gz.h"
diff --git a/cmd/cramfs.c b/cmd/cramfs.c
index 598028cfad..2188910b2a 100644
--- a/cmd/cramfs.c
+++ b/cmd/cramfs.c
@@ -12,6 +12,7 @@
*/
#include <common.h>
#include <command.h>
+#include <env.h>
#include <malloc.h>
#include <mapmem.h>
#include <linux/list.h>
diff --git a/cmd/dtimg.c b/cmd/dtimg.c
index ae7d82f26d..6c5d53cc68 100644
--- a/cmd/dtimg.c
+++ b/cmd/dtimg.c
@@ -4,6 +4,7 @@
* Sam Protsenko <semen.protsenko@linaro.org>
*/
+#include <env.h>
#include <image-android-dt.h>
#include <common.h>
diff --git a/cmd/efidebug.c b/cmd/efidebug.c
index 961e8fad22..ef97e19d07 100644
--- a/cmd/efidebug.c
+++ b/cmd/efidebug.c
@@ -9,7 +9,6 @@
#include <common.h>
#include <command.h>
#include <efi_loader.h>
-#include <environment.h>
#include <exports.h>
#include <hexdump.h>
#include <malloc.h>
diff --git a/cmd/elf.c b/cmd/elf.c
index d883be4193..538562fda5 100644
--- a/cmd/elf.c
+++ b/cmd/elf.c
@@ -16,7 +16,7 @@
#include <common.h>
#include <command.h>
#include <elf.h>
-#include <environment.h>
+#include <env.h>
#include <net.h>
#include <vxworks.h>
#ifdef CONFIG_X86
diff --git a/cmd/ethsw.c b/cmd/ethsw.c
index 473324f878..8846805799 100644
--- a/cmd/ethsw.c
+++ b/cmd/ethsw.c
@@ -7,7 +7,7 @@
#include <common.h>
#include <command.h>
-#include <environment.h>
+#include <env.h>
#include <errno.h>
#include <env_flags.h>
#include <ethsw.h>
diff --git a/cmd/fdt.c b/cmd/fdt.c
index 10d8f3230b..25a6ed40d2 100644
--- a/cmd/fdt.c
+++ b/cmd/fdt.c
@@ -9,6 +9,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <linux/ctype.h>
#include <linux/types.h>
#include <asm/global_data.h>
diff --git a/cmd/fpga.c b/cmd/fpga.c
index eba989a730..b1c7b5453b 100644
--- a/cmd/fpga.c
+++ b/cmd/fpga.c
@@ -9,8 +9,10 @@
*/
#include <common.h>
#include <command.h>
+#include <env.h>
#include <fpga.h>
#include <fs.h>
+#include <gzip.h>
#include <malloc.h>
static long do_fpga_get_device(char *arg)
diff --git a/cmd/gpt.c b/cmd/gpt.c
index 33cda51396..0c4349f4b2 100644
--- a/cmd/gpt.c
+++ b/cmd/gpt.c
@@ -11,6 +11,7 @@
*/
#include <common.h>
+#include <env.h>
#include <malloc.h>
#include <command.h>
#include <part_efi.h>
diff --git a/cmd/i2c.c b/cmd/i2c.c
index 09c4ba9a1c..e0f8ece597 100644
--- a/cmd/i2c.c
+++ b/cmd/i2c.c
@@ -71,7 +71,6 @@
#include <console.h>
#include <dm.h>
#include <edid.h>
-#include <environment.h>
#include <errno.h>
#include <i2c.h>
#include <malloc.h>
diff --git a/cmd/ide.c b/cmd/ide.c
index 1c58efc55a..2f93ba7904 100644
--- a/cmd/ide.c
+++ b/cmd/ide.c
@@ -17,10 +17,6 @@
#include <asm/byteorder.h>
#include <asm/io.h>
-#if defined(CONFIG_IDE_PCMCIA)
-# include <pcmcia.h>
-#endif
-
#include <ide.h>
#include <ata.h>
diff --git a/cmd/ini.c b/cmd/ini.c
index 8c28fa6394..0c425262d0 100644
--- a/cmd/ini.c
+++ b/cmd/ini.c
@@ -13,7 +13,7 @@
#include <common.h>
#include <command.h>
-#include <environment.h>
+#include <env.h>
#include <linux/ctype.h>
#include <linux/string.h>
diff --git a/cmd/itest.c b/cmd/itest.c
index fd6f4166f1..8b630d71e6 100644
--- a/cmd/itest.c
+++ b/cmd/itest.c
@@ -14,6 +14,7 @@
#include <common.h>
#include <config.h>
#include <command.h>
+#include <env.h>
#include <mapmem.h>
#include <asm/io.h>
diff --git a/cmd/jffs2.c b/cmd/jffs2.c
index 64621f2546..b47cd3d989 100644
--- a/cmd/jffs2.c
+++ b/cmd/jffs2.c
@@ -72,6 +72,7 @@
*/
#include <common.h>
#include <command.h>
+#include <env.h>
#include <malloc.h>
#include <jffs2/jffs2.h>
#include <linux/list.h>
diff --git a/cmd/license.c b/cmd/license.c
index 1c0794f095..c5b04c331b 100644
--- a/cmd/license.c
+++ b/cmd/license.c
@@ -6,6 +6,7 @@
#include <common.h>
#include <command.h>
+#include <gzip.h>
#include <malloc.h>
#include "license_data_gz.h"
diff --git a/cmd/load.c b/cmd/load.c
index dd1e8dac13..713fe56b55 100644
--- a/cmd/load.c
+++ b/cmd/load.c
@@ -10,6 +10,7 @@
#include <common.h>
#include <command.h>
#include <console.h>
+#include <env.h>
#include <s_record.h>
#include <net.h>
#include <exports.h>
diff --git a/cmd/lzmadec.c b/cmd/lzmadec.c
index 6860b5f758..e3b9cc75ac 100644
--- a/cmd/lzmadec.c
+++ b/cmd/lzmadec.c
@@ -11,6 +11,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <mapmem.h>
#include <asm/io.h>
diff --git a/cmd/md5sum.c b/cmd/md5sum.c
index 9d2d4180c5..63cbae0364 100644
--- a/cmd/md5sum.c
+++ b/cmd/md5sum.c
@@ -9,6 +9,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <mapmem.h>
#include <u-boot/md5.h>
#include <asm/io.h>
diff --git a/cmd/mtdparts.c b/cmd/mtdparts.c
index f7ed1a0779..46155cabf6 100644
--- a/cmd/mtdparts.c
+++ b/cmd/mtdparts.c
@@ -72,6 +72,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <malloc.h>
#include <jffs2/load_kernel.h>
#include <linux/list.h>
diff --git a/cmd/mvebu/bubt.c b/cmd/mvebu/bubt.c
index b4d371f305..84d2d531f0 100644
--- a/cmd/mvebu/bubt.c
+++ b/cmd/mvebu/bubt.c
@@ -7,6 +7,7 @@
#include <config.h>
#include <common.h>
#include <command.h>
+#include <env.h>
#include <vsprintf.h>
#include <errno.h>
#include <dm.h>
diff --git a/cmd/nand.c b/cmd/nand.c
index 899d504533..27efef20bc 100644
--- a/cmd/nand.c
+++ b/cmd/nand.c
@@ -23,6 +23,7 @@
#include <linux/mtd/mtd.h>
#include <command.h>
#include <console.h>
+#include <env.h>
#include <watchdog.h>
#include <malloc.h>
#include <asm/byteorder.h>
diff --git a/cmd/net.c b/cmd/net.c
index 89721b8f8b..237403977e 100644
--- a/cmd/net.c
+++ b/cmd/net.c
@@ -9,6 +9,7 @@
*/
#include <common.h>
#include <command.h>
+#include <env.h>
#include <net.h>
static int netboot_common(enum proto_t, cmd_tbl_t *, int, char * const []);
diff --git a/cmd/nvedit.c b/cmd/nvedit.c
index 46b1e60f0a..1cb0bc1460 100644
--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
@@ -27,7 +27,8 @@
#include <cli.h>
#include <command.h>
#include <console.h>
-#include <environment.h>
+#include <env.h>
+#include <env_internal.h>
#include <search.h>
#include <errno.h>
#include <malloc.h>
@@ -69,14 +70,14 @@ NAND|NVRAM|ONENAND|SATA|SPI_FLASH|REMOTE|UBI} or CONFIG_ENV_IS_NOWHERE
/*
* This variable is incremented on each do_env_set(), so it can
- * be used via get_env_id() as an indication, if the environment
+ * be used via env_get_id() as an indication, if the environment
* has changed or not. So it is possible to reread an environment
* variable only if the environment was changed ... done so for
* example in NetInitLoop()
*/
static int env_id = 1;
-int get_env_id(void)
+int env_get_id(void)
{
return env_id;
}
@@ -93,11 +94,11 @@ static int env_print(char *name, int flag)
ssize_t len;
if (name) { /* print a single name */
- ENTRY e, *ep;
+ struct env_entry e, *ep;
e.key = name;
e.data = NULL;
- hsearch_r(e, FIND, &ep, &env_htab, flag);
+ hsearch_r(e, ENV_FIND, &ep, &env_htab, flag);
if (ep == NULL)
return 0;
len = printf("%s=%s\n", ep->key, ep->data);
@@ -224,7 +225,7 @@ static int _do_env_set(int flag, int argc, char * const argv[], int env_flag)
{
int i, len;
char *name, *value, *s;
- ENTRY e, *ep;
+ struct env_entry e, *ep;
debug("Initial value for argc=%d\n", argc);
@@ -287,7 +288,7 @@ static int _do_env_set(int flag, int argc, char * const argv[], int env_flag)
e.key = name;
e.data = value;
- hsearch_r(e, ENTER, &ep, &env_htab, env_flag);
+ hsearch_r(e, ENV_ENTER, &ep, &env_htab, env_flag);
free(value);
if (!ep) {
printf("## Error inserting \"%s\" variable, errno=%d\n",
@@ -357,18 +358,6 @@ ulong env_get_hex(const char *varname, ulong default_val)
return value;
}
-void eth_parse_enetaddr(const char *addr, uint8_t *enetaddr)
-{
- char *end;
- int i;
-
- for (i = 0; i < 6; ++i) {
- enetaddr[i] = addr ? simple_strtoul(addr, &end, 16) : 0;
- if (addr)
- addr = (*end) ? end + 1 : end;
- }
-}
-
int eth_env_get_enetaddr(const char *name, uint8_t *enetaddr)
{
eth_parse_enetaddr(env_get(name), enetaddr);
@@ -484,7 +473,7 @@ static int print_static_binding(const char *var_name, const char *callback_name,
return 0;
}
-static int print_active_callback(ENTRY *entry)
+static int print_active_callback(struct env_entry *entry)
{
struct env_clbk_tbl *clbkp;
int i;
@@ -565,7 +554,7 @@ static int print_static_flags(const char *var_name, const char *flags,
return 0;
}
-static int print_active_flags(ENTRY *entry)
+static int print_active_flags(struct env_entry *entry)
{
enum env_flags_vartype type;
enum env_flags_varaccess access;
@@ -673,13 +662,13 @@ static int do_env_edit(cmd_tbl_t *cmdtp, int flag, int argc,
char *env_get(const char *name)
{
if (gd->flags & GD_FLG_ENV_READY) { /* after import into hashtable */
- ENTRY e, *ep;
+ struct env_entry e, *ep;
WATCHDOG_RESET();
e.key = name;
e.data = NULL;
- hsearch_r(e, FIND, &ep, &env_htab, 0);
+ hsearch_r(e, ENV_FIND, &ep, &env_htab, 0);
return ep ? ep->data : NULL;
}
@@ -708,7 +697,7 @@ int env_get_f(const char *name, char *buf, unsigned len)
return -1;
}
- val = envmatch((uchar *)name, i);
+ val = env_match((uchar *)name, i);
if (val < 0)
continue;
@@ -784,15 +773,7 @@ U_BOOT_CMD(
#endif
#endif /* CONFIG_SPL_BUILD */
-
-/*
- * Match a name / name=value pair
- *
- * s1 is either a simple 'name', or a 'name=value' pair.
- * i2 is the environment index for a 'name2=value2' pair.
- * If the names match, return the index for the value2, else -1.
- */
-int envmatch(uchar *s1, int i2)
+int env_match(uchar *s1, int i2)
{
if (s1 == NULL)
return -1;
@@ -833,13 +814,13 @@ static int do_env_default(cmd_tbl_t *cmdtp, int flag,
debug("Final value for argc=%d\n", argc);
if (all && (argc == 0)) {
/* Reset the whole environment */
- set_default_env("## Resetting to default environment\n",
+ env_set_default("## Resetting to default environment\n",
env_flag);
return 0;
}
if (!all && (argc > 0)) {
/* Reset individual variables */
- set_default_vars(argc, argv, env_flag);
+ env_set_default_vars(argc, argv, env_flag);
return 0;
}
@@ -1021,7 +1002,7 @@ NXTARG: ;
envp->crc = crc32(0, envp->data,
size ? size - offsetof(env_t, data) : ENV_SIZE);
#ifdef CONFIG_ENV_ADDR_REDUND
- envp->flags = ACTIVE_FLAG;
+ envp->flags = ENV_REDUND_ACTIVE;
#endif
}
env_set_hex("filesize", len + offsetof(env_t, data));
@@ -1281,14 +1262,14 @@ static int do_env_info(cmd_tbl_t *cmdtp, int flag,
static int do_env_exists(cmd_tbl_t *cmdtp, int flag, int argc,
char * const argv[])
{
- ENTRY e, *ep;
+ struct env_entry e, *ep;
if (argc < 2)
return CMD_RET_USAGE;
e.key = argv[1];
e.data = NULL;
- hsearch_r(e, FIND, &ep, &env_htab, 0);
+ hsearch_r(e, ENV_FIND, &ep, &env_htab, 0);
return (ep == NULL) ? 1 : 0;
}
diff --git a/cmd/nvedit_efi.c b/cmd/nvedit_efi.c
index 60a8ac84c8..ed6d09a530 100644
--- a/cmd/nvedit_efi.c
+++ b/cmd/nvedit_efi.c
@@ -9,6 +9,7 @@
#include <common.h>
#include <command.h>
#include <efi_loader.h>
+#include <env.h>
#include <exports.h>
#include <hexdump.h>
#include <malloc.h>
diff --git a/cmd/part.c b/cmd/part.c
index 653e13ced1..6cfb67b279 100644
--- a/cmd/part.c
+++ b/cmd/part.c
@@ -18,6 +18,7 @@
#include <common.h>
#include <config.h>
#include <command.h>
+#include <env.h>
#include <part.h>
#include <vsprintf.h>
diff --git a/cmd/pcmcia.c b/cmd/pcmcia.c
deleted file mode 100644
index 3b7537b105..0000000000
--- a/cmd/pcmcia.c
+++ /dev/null
@@ -1,341 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2000-2006
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- ********************************************************************
- *
- * Lots of code copied from:
- *
- * m8xx_pcmcia.c - Linux PCMCIA socket driver for the mpc8xx series.
- * (C) 1999-2000 Magnus Damm <damm@bitsmart.com>
- *
- * "The ExCA standard specifies that socket controllers should provide
- * two IO and five memory windows per socket, which can be independently
- * configured and positioned in the host address space and mapped to
- * arbitrary segments of card address space. " - David A Hinds. 1999
- *
- * This controller does _not_ meet the ExCA standard.
- *
- * m8xx pcmcia controller brief info:
- * + 8 windows (attrib, mem, i/o)
- * + up to two slots (SLOT_A and SLOT_B)
- * + inputpins, outputpins, event and mask registers.
- * - no offset register. sigh.
- *
- * Because of the lacking offset register we must map the whole card.
- * We assign each memory window PCMCIA_MEM_WIN_SIZE address space.
- * Make sure there is (PCMCIA_MEM_WIN_SIZE * PCMCIA_MEM_WIN_NO
- * * PCMCIA_SOCKETS_NO) bytes at PCMCIA_MEM_WIN_BASE.
- * The i/o windows are dynamically allocated at PCMCIA_IO_WIN_BASE.
- * They are maximum 64KByte each...
- */
-
-/* #define DEBUG 1 */
-
-/*
- * PCMCIA support
- */
-#include <common.h>
-#include <command.h>
-#include <config.h>
-#include <pcmcia.h>
-#include <asm/io.h>
-
-/* -------------------------------------------------------------------- */
-
-#if defined(CONFIG_CMD_PCMCIA)
-
-extern int pcmcia_on (void);
-extern int pcmcia_off (void);
-
-int do_pinit (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-{
- int rcode = 0;
-
- if (argc != 2) {
- printf ("Usage: pinit {on | off}\n");
- return 1;
- }
- if (strcmp(argv[1],"on") == 0) {
- rcode = pcmcia_on ();
- } else if (strcmp(argv[1],"off") == 0) {
- rcode = pcmcia_off ();
- } else {
- printf ("Usage: pinit {on | off}\n");
- return 1;
- }
-
- return rcode;
-}
-
-U_BOOT_CMD(
- pinit, 2, 0, do_pinit,
- "PCMCIA sub-system",
- "on - power on PCMCIA socket\n"
- "pinit off - power off PCMCIA socket"
-);
-
-#endif
-
-/* -------------------------------------------------------------------- */
-
-#undef CHECK_IDE_DEVICE
-
-#if defined(CONFIG_PXA_PCMCIA)
-#define CHECK_IDE_DEVICE
-#endif
-
-#ifdef CHECK_IDE_DEVICE
-
-int ide_devices_found;
-static uchar *known_cards[] = {
- (uchar *)"ARGOSY PnPIDE D5",
- NULL
-};
-
-#define MAX_TUPEL_SZ 512
-#define MAX_FEATURES 4
-
-#define MAX_IDENT_CHARS 64
-#define MAX_IDENT_FIELDS 4
-
-#define indent "\t "
-
-static void print_funcid (int func)
-{
- puts (indent);
- switch (func) {
- case CISTPL_FUNCID_MULTI:
- puts (" Multi-Function");
- break;
- case CISTPL_FUNCID_MEMORY:
- puts (" Memory");
- break;
- case CISTPL_FUNCID_SERIAL:
- puts (" Serial Port");
- break;
- case CISTPL_FUNCID_PARALLEL:
- puts (" Parallel Port");
- break;
- case CISTPL_FUNCID_FIXED:
- puts (" Fixed Disk");
- break;
- case CISTPL_FUNCID_VIDEO:
- puts (" Video Adapter");
- break;
- case CISTPL_FUNCID_NETWORK:
- puts (" Network Adapter");
- break;
- case CISTPL_FUNCID_AIMS:
- puts (" AIMS Card");
- break;
- case CISTPL_FUNCID_SCSI:
- puts (" SCSI Adapter");
- break;
- default:
- puts (" Unknown");
- break;
- }
- puts (" Card\n");
-}
-
-static void print_fixed (volatile uchar *p)
-{
- if (p == NULL)
- return;
-
- puts(indent);
-
- switch (*p) {
- case CISTPL_FUNCE_IDE_IFACE:
- { uchar iface = *(p+2);
-
- puts ((iface == CISTPL_IDE_INTERFACE) ? " IDE" : " unknown");
- puts (" interface ");
- break;
- }
- case CISTPL_FUNCE_IDE_MASTER:
- case CISTPL_FUNCE_IDE_SLAVE:
- { uchar f1 = *(p+2);
- uchar f2 = *(p+4);
-
- puts ((f1 & CISTPL_IDE_SILICON) ? " [silicon]" : " [rotating]");
-
- if (f1 & CISTPL_IDE_UNIQUE)
- puts (" [unique]");
-
- puts ((f1 & CISTPL_IDE_DUAL) ? " [dual]" : " [single]");
-
- if (f2 & CISTPL_IDE_HAS_SLEEP)
- puts (" [sleep]");
-
- if (f2 & CISTPL_IDE_HAS_STANDBY)
- puts (" [standby]");
-
- if (f2 & CISTPL_IDE_HAS_IDLE)
- puts (" [idle]");
-
- if (f2 & CISTPL_IDE_LOW_POWER)
- puts (" [low power]");
-
- if (f2 & CISTPL_IDE_REG_INHIBIT)
- puts (" [reg inhibit]");
-
- if (f2 & CISTPL_IDE_HAS_INDEX)
- puts (" [index]");
-
- if (f2 & CISTPL_IDE_IOIS16)
- puts (" [IOis16]");
-
- break;
- }
- }
- putc ('\n');
-}
-
-static int identify (volatile uchar *p)
-{
- uchar id_str[MAX_IDENT_CHARS];
- uchar data;
- uchar *t;
- uchar **card;
- int i, done;
-
- if (p == NULL)
- return (0); /* Don't know */
-
- t = id_str;
- done =0;
-
- for (i=0; i<=4 && !done; ++i, p+=2) {
- while ((data = *p) != '\0') {
- if (data == 0xFF) {
- done = 1;
- break;
- }
- *t++ = data;
- if (t == &id_str[MAX_IDENT_CHARS-1]) {
- done = 1;
- break;
- }
- p += 2;
- }
- if (!done)
- *t++ = ' ';
- }
- *t = '\0';
- while (--t > id_str) {
- if (*t == ' ')
- *t = '\0';
- else
- break;
- }
- puts ((char *)id_str);
- putc ('\n');
-
- for (card=known_cards; *card; ++card) {
- debug ("## Compare against \"%s\"\n", *card);
- if (strcmp((char *)*card, (char *)id_str) == 0) { /* found! */
- debug ("## CARD FOUND ##\n");
- return (1);
- }
- }
-
- return (0); /* don't know */
-}
-
-int check_ide_device (int slot)
-{
- volatile uchar *ident = NULL;
- volatile uchar *feature_p[MAX_FEATURES];
- volatile uchar *p, *start, *addr;
- int n_features = 0;
- uchar func_id = ~0;
- uchar code, len;
- ushort config_base = 0;
- int found = 0;
- int i;
-
- addr = (volatile uchar *)(CONFIG_SYS_PCMCIA_MEM_ADDR +
- CONFIG_SYS_PCMCIA_MEM_SIZE * (slot * 4));
- debug ("PCMCIA MEM: %08lX\n", (ulong)addr);
-
- start = p = (volatile uchar *) addr;
-
- while ((p - start) < MAX_TUPEL_SZ) {
-
- code = *p; p += 2;
-
- if (code == 0xFF) { /* End of chain */
- break;
- }
-
- len = *p; p += 2;
-#if defined(DEBUG) && (DEBUG > 1)
- { volatile uchar *q = p;
- printf ("\nTuple code %02x length %d\n\tData:",
- code, len);
-
- for (i = 0; i < len; ++i) {
- printf (" %02x", *q);
- q+= 2;
- }
- }
-#endif /* DEBUG */
- switch (code) {
- case CISTPL_VERS_1:
- ident = p + 4;
- break;
- case CISTPL_FUNCID:
- /* Fix for broken SanDisk which may have 0x80 bit set */
- func_id = *p & 0x7F;
- break;
- case CISTPL_FUNCE:
- if (n_features < MAX_FEATURES)
- feature_p[n_features++] = p;
- break;
- case CISTPL_CONFIG:
- config_base = (*(p+6) << 8) + (*(p+4));
- debug ("\n## Config_base = %04x ###\n", config_base);
- default:
- break;
- }
- p += 2 * len;
- }
-
- found = identify (ident);
-
- if (func_id != ((uchar)~0)) {
- print_funcid (func_id);
-
- if (func_id == CISTPL_FUNCID_FIXED)
- found = 1;
- else
- return (1); /* no disk drive */
- }
-
- for (i=0; i<n_features; ++i) {
- print_fixed (feature_p[i]);
- }
-
- if (!found) {
- printf ("unknown card type\n");
- return (1);
- }
-
- ide_devices_found |= (1 << slot);
-
- /* set I/O area in config reg -> only valid for ARGOSY D5!!! */
- *((uchar *)(addr + config_base)) = 1;
-#if 0
- printf("\n## Config_base = %04x ###\n", config_base);
- printf("Configuration Option Register: %02x @ %x\n", readb(addr + config_base), addr + config_base);
- printf("Card Configuration and Status Register: %02x\n", readb(addr + config_base + 2));
- printf("Pin Replacement Register Register: %02x\n", readb(addr + config_base + 4));
- printf("Socket and Copy Register: %02x\n", readb(addr + config_base + 6));
-#endif
- return (0);
-}
-
-#endif /* CHECK_IDE_DEVICE */
diff --git a/cmd/pxe.c b/cmd/pxe.c
index 1dd0a74ea3..2059975446 100644
--- a/cmd/pxe.c
+++ b/cmd/pxe.c
@@ -6,6 +6,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <malloc.h>
#include <mapmem.h>
#include <lcd.h>
diff --git a/cmd/qfw.c b/cmd/qfw.c
index 7bf700538c..af826627a2 100644
--- a/cmd/qfw.c
+++ b/cmd/qfw.c
@@ -5,6 +5,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <errno.h>
#include <qfw.h>
diff --git a/cmd/reiser.c b/cmd/reiser.c
index 2c0bca1c54..7f51b927a4 100644
--- a/cmd/reiser.c
+++ b/cmd/reiser.c
@@ -11,6 +11,7 @@
#include <common.h>
#include <config.h>
#include <command.h>
+#include <env.h>
#include <image.h>
#include <linux/ctype.h>
#include <asm/byteorder.h>
diff --git a/cmd/setexpr.c b/cmd/setexpr.c
index 1a6cecdeda..0182f19938 100644
--- a/cmd/setexpr.c
+++ b/cmd/setexpr.c
@@ -11,6 +11,7 @@
#include <common.h>
#include <config.h>
#include <command.h>
+#include <env.h>
#include <mapmem.h>
static ulong get_arg(char *s, int w)
diff --git a/cmd/source.c b/cmd/source.c
index 1a9a71aa37..3a51ebf0b6 100644
--- a/cmd/source.c
+++ b/cmd/source.c
@@ -16,6 +16,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <image.h>
#include <malloc.h>
#include <mapmem.h>
diff --git a/cmd/spl.c b/cmd/spl.c
index 038f48818d..56051b8a4b 100644
--- a/cmd/spl.c
+++ b/cmd/spl.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <command.h>
#include <cmd_spl.h>
+#include <env.h>
#include <linux/libfdt.h>
DECLARE_GLOBAL_DATA_PTR;
diff --git a/cmd/tpm-common.c b/cmd/tpm-common.c
index 89f2aa001b..38900fb159 100644
--- a/cmd/tpm-common.c
+++ b/cmd/tpm-common.c
@@ -6,6 +6,7 @@
#include <common.h>
#include <command.h>
#include <dm.h>
+#include <env.h>
#include <asm/unaligned.h>
#include <linux/string.h>
#include <tpm-common.h>
diff --git a/cmd/tpm-v1.c b/cmd/tpm-v1.c
index b75e0933a1..2807331524 100644
--- a/cmd/tpm-v1.c
+++ b/cmd/tpm-v1.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <env.h>
#include <malloc.h>
#include <asm/unaligned.h>
#include <tpm-common.h>
diff --git a/cmd/tpm_test.c b/cmd/tpm_test.c
index 56a5aa4aa5..c14dd75a26 100644
--- a/cmd/tpm_test.c
+++ b/cmd/tpm_test.c
@@ -5,7 +5,6 @@
#include <common.h>
#include <command.h>
-#include <environment.h>
#include <tpm-v1.h>
#include "tpm-user-utils.h"
diff --git a/cmd/trace.c b/cmd/trace.c
index 7d328f88be..392b129536 100644
--- a/cmd/trace.c
+++ b/cmd/trace.c
@@ -5,6 +5,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <mapmem.h>
#include <trace.h>
#include <asm/io.h>
diff --git a/cmd/ubi.c b/cmd/ubi.c
index c511a2fb76..ca5dc9021b 100644
--- a/cmd/ubi.c
+++ b/cmd/ubi.c
@@ -13,6 +13,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <exports.h>
#include <memalign.h>
#include <mtd.h>
diff --git a/cmd/unzip.c b/cmd/unzip.c
index 6c0f97cb4b..afd58e7cdb 100644
--- a/cmd/unzip.c
+++ b/cmd/unzip.c
@@ -6,6 +6,8 @@
#include <common.h>
#include <command.h>
+#include <env.h>
+#include <gzip.h>
static int do_unzip(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
diff --git a/cmd/ximg.c b/cmd/ximg.c
index 9e53cc4557..a9481004f0 100644
--- a/cmd/ximg.c
+++ b/cmd/ximg.c
@@ -13,6 +13,8 @@
*/
#include <common.h>
#include <command.h>
+#include <env.h>
+#include <gzip.h>
#include <image.h>
#include <mapmem.h>
#include <watchdog.h>
diff --git a/cmd/zfs.c b/cmd/zfs.c
index 384ac4c939..ed5402bb13 100644
--- a/cmd/zfs.c
+++ b/cmd/zfs.c
@@ -12,6 +12,7 @@
#include <part.h>
#include <config.h>
#include <command.h>
+#include <env.h>
#include <image.h>
#include <linux/ctype.h>
#include <asm/byteorder.h>
diff --git a/cmd/zip.c b/cmd/zip.c
index 9cd400a7e8..8ef46e9815 100644
--- a/cmd/zip.c
+++ b/cmd/zip.c
@@ -6,6 +6,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
static int do_zip(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{