summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/cmd_ace.c27
-rw-r--r--common/cmd_nvedit.c5
2 files changed, 28 insertions, 4 deletions
diff --git a/common/cmd_ace.c b/common/cmd_ace.c
index 4969811..c5b08bf 100644
--- a/common/cmd_ace.c
+++ b/common/cmd_ace.c
@@ -50,12 +50,35 @@
*/
static unsigned ace_readw(unsigned offset)
{
- return readw(CFG_SYSTEMACE_BASE+offset);
+#if (CFG_SYSTEMACE_WIDTH == 8)
+ u16 temp;
+
+#if !defined(__BIG_ENDIAN)
+ temp =((u16)readb(CFG_SYSTEMACE_BASE+offset) << 8);
+ temp |= (u16)readb(CFG_SYSTEMACE_BASE+offset+1);
+#else
+ temp = (u16)readb(CFG_SYSTEMACE_BASE+offset);
+ temp |=((u16)readb(CFG_SYSTEMACE_BASE+offset+1) << 8);
+#endif
+ return temp;
+#else
+ return readw(CFG_SYSTEMACE_BASE+offset);
+#endif
}
static void ace_writew(unsigned val, unsigned offset)
{
- writew(val, CFG_SYSTEMACE_BASE+offset);
+#if (CFG_SYSTEMACE_WIDTH == 8)
+#if !defined(__BIG_ENDIAN)
+ writeb((u8)(val>>8), CFG_SYSTEMACE_BASE+offset);
+ writeb((u8)val, CFG_SYSTEMACE_BASE+offset+1);
+#else
+ writeb((u8)val, CFG_SYSTEMACE_BASE+offset);
+ writeb((u8)(val>>8), CFG_SYSTEMACE_BASE+offset+1);
+#endif
+#else
+ writew(val, CFG_SYSTEMACE_BASE+offset);
+#endif
}
/* */
diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index 3510561..578b0ca 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -586,8 +586,9 @@ U_BOOT_CMD(
" - delete environment variable 'name'\n"
);
-#if ((CONFIG_COMMANDS & (CFG_CMD_ENV|CFG_CMD_FLASH)) == (CFG_CMD_ENV|CFG_CMD_FLASH))
-
+#if defined(CFG_ENV_IS_IN_NVRAM) || defined(CFG_ENV_IS_IN_EEPROM) || \
+ ((CONFIG_COMMANDS & (CFG_CMD_ENV|CFG_CMD_FLASH)) == \
+ (CFG_CMD_ENV|CFG_CMD_FLASH))
U_BOOT_CMD(
saveenv, 1, 0, do_saveenv,
"saveenv - save environment variables to persistent storage\n",