summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/Makefile1
-rw-r--r--common/circbuf.c110
-rw-r--r--common/cmd_bootm.c4
-rw-r--r--common/cmd_cache.c4
-rw-r--r--common/cmd_date.c6
-rw-r--r--common/cmd_i2c.c8
-rw-r--r--common/cmd_irq.c9
-rw-r--r--common/cmd_license.c4
-rw-r--r--common/cmd_mgdisk.c4
-rw-r--r--common/cmd_misc.c11
10 files changed, 14 insertions, 147 deletions
diff --git a/common/Makefile b/common/Makefile
index ec025ed..7784180 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -29,7 +29,6 @@ AOBJS =
# core
COBJS-y += main.o
-COBJS-y += circbuf.o
COBJS-y += console.o
COBJS-y += command.o
COBJS-y += dlmalloc.o
diff --git a/common/circbuf.c b/common/circbuf.c
deleted file mode 100644
index 2332c63..0000000
--- a/common/circbuf.c
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * (C) Copyright 2003
- * Gerry Hamel, geh@ti.com, Texas Instruments
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include <common.h>
-#include <malloc.h>
-
-#include <circbuf.h>
-
-
-int buf_init (circbuf_t * buf, unsigned int size)
-{
- assert (buf != NULL);
-
- buf->size = 0;
- buf->totalsize = size;
- buf->data = (char *) malloc (sizeof (char) * size);
- assert (buf->data != NULL);
-
- buf->top = buf->data;
- buf->tail = buf->data;
- buf->end = &(buf->data[size]);
-
- return 1;
-}
-
-int buf_free (circbuf_t * buf)
-{
- assert (buf != NULL);
- assert (buf->data != NULL);
-
- free (buf->data);
- memset (buf, 0, sizeof (circbuf_t));
-
- return 1;
-}
-
-int buf_pop (circbuf_t * buf, char *dest, unsigned int len)
-{
- unsigned int i;
- char *p = buf->top;
-
- assert (buf != NULL);
- assert (dest != NULL);
-
- /* Cap to number of bytes in buffer */
- if (len > buf->size)
- len = buf->size;
-
- for (i = 0; i < len; i++) {
- dest[i] = *p++;
- /* Bounds check. */
- if (p == buf->end) {
- p = buf->data;
- }
- }
-
- /* Update 'top' pointer */
- buf->top = p;
- buf->size -= len;
-
- return len;
-}
-
-int buf_push (circbuf_t * buf, const char *src, unsigned int len)
-{
- /* NOTE: this function allows push to overwrite old data. */
- unsigned int i;
- char *p = buf->tail;
-
- assert (buf != NULL);
- assert (src != NULL);
-
- for (i = 0; i < len; i++) {
- *p++ = src[i];
- if (p == buf->end) {
- p = buf->data;
- }
- /* Make sure pushing too much data just replaces old data */
- if (buf->size < buf->totalsize) {
- buf->size++;
- } else {
- buf->top++;
- if (buf->top == buf->end) {
- buf->top = buf->data;
- }
- }
- }
-
- /* Update 'tail' pointer */
- buf->tail = p;
-
- return len;
-}
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index aa85faf..e0cb869 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -133,7 +133,7 @@ int do_bootelf (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
static boot_os_fn do_bootm_integrity;
#endif
-boot_os_fn * boot_os[] = {
+static boot_os_fn *boot_os[] = {
#ifdef CONFIG_BOOTM_LINUX
[IH_OS_LINUX] = do_bootm_linux,
#endif
@@ -546,7 +546,7 @@ int do_bootm_subcommand (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
}
break;
#endif
-#ifdef CONFIG_OF_LIBFDT
+#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_SYS_BOOTMAPSZ)
case BOOTM_STATE_FDT:
{
ulong bootmap_base = getenv_bootm_low();
diff --git a/common/cmd_cache.c b/common/cmd_cache.c
index 0dfa336..1202258 100644
--- a/common/cmd_cache.c
+++ b/common/cmd_cache.c
@@ -27,8 +27,6 @@
#include <common.h>
#include <command.h>
-#if defined(CONFIG_CMD_CACHE)
-
static int on_off (const char *);
int do_icache ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
@@ -108,5 +106,3 @@ U_BOOT_CMD(
"[on, off]\n"
" - enable or disable data (writethrough) cache"
);
-
-#endif
diff --git a/common/cmd_date.c b/common/cmd_date.c
index 9f50f89..3141a39 100644
--- a/common/cmd_date.c
+++ b/common/cmd_date.c
@@ -71,9 +71,9 @@ int do_date (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
/* and write to RTC */
rcode = rtc_set (&tm);
if(rcode)
- puts("## Set date failled\n");
+ puts("## Set date failed\n");
} else {
- puts("## Get date failled\n");
+ puts("## Get date failed\n");
}
}
/* FALL TROUGH */
@@ -81,7 +81,7 @@ int do_date (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
rcode = rtc_get (&tm);
if (rcode) {
- puts("## Get date failled\n");
+ puts("## Get date failed\n");
break;
}
diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c
index 8f0fc9e..8d6feda 100644
--- a/common/cmd_i2c.c
+++ b/common/cmd_i2c.c
@@ -326,14 +326,6 @@ int do_i2c_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
#if !defined(CONFIG_SYS_I2C_FRAM)
udelay(11000);
#endif
-
-#if 0
- for (timeout = 0; timeout < 10; timeout++) {
- udelay(2000);
- if (i2c_probe(chip) == 0)
- break;
- }
-#endif
}
return (0);
diff --git a/common/cmd_irq.c b/common/cmd_irq.c
index 4604a5a..2c7e6bb 100644
--- a/common/cmd_irq.c
+++ b/common/cmd_irq.c
@@ -47,3 +47,12 @@ U_BOOT_CMD(
"enable or disable interrupts",
"[on, off]"
);
+
+/* Implemented in $(CPU)/interrupts.c */
+int do_irqinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+
+U_BOOT_CMD(
+ irqinfo, 1, 1, do_irqinfo,
+ "print information about IRQs",
+ ""
+);
diff --git a/common/cmd_license.c b/common/cmd_license.c
index 141215b..c6f272a 100644
--- a/common/cmd_license.c
+++ b/common/cmd_license.c
@@ -23,8 +23,6 @@
#include <common.h>
-#if defined(CONFIG_CMD_LICENSE)
-
/* COPYING is currently 15951 bytes in size */
#define LICENSE_MAX 20480
@@ -56,5 +54,3 @@ U_BOOT_CMD(license, 1, 1, do_license,
"print GPL license text",
""
);
-
-#endif /* CONFIG_CMD_LICENSE */
diff --git a/common/cmd_mgdisk.c b/common/cmd_mgdisk.c
index aadc335..3ba62f6 100644
--- a/common/cmd_mgdisk.c
+++ b/common/cmd_mgdisk.c
@@ -24,8 +24,6 @@
#include <common.h>
#include <command.h>
-#if defined (CONFIG_CMD_MG_DISK)
-
#include <mg_disk.h>
int do_mg_disk_cmd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
@@ -72,5 +70,3 @@ U_BOOT_CMD(
" - sector read : mgd readsec [sector] [to] [counts]\n"
" - sector write : mgd writesec [from] [sector] [counts]"
);
-
-#endif
diff --git a/common/cmd_misc.c b/common/cmd_misc.c
index b97537e..b0ced2f 100644
--- a/common/cmd_misc.c
+++ b/common/cmd_misc.c
@@ -49,17 +49,6 @@ int do_sleep (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return 0;
}
-/* Implemented in $(CPU)/interrupts.c */
-#if defined(CONFIG_CMD_IRQ)
-int do_irqinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
-
-U_BOOT_CMD(
- irqinfo, 1, 1, do_irqinfo,
- "print information about IRQs",
- ""
-);
-#endif
-
U_BOOT_CMD(
sleep , 2, 1, do_sleep,
"delay execution for some time",