Merge branch 'master' into next
Conflicts: board/esd/plu405/plu405.c drivers/rtc/ftrtc010.c Signed-off-by: Wolfgang Denk <wd@denx.de>
This commit is contained in:
@@ -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
|
||||
|
||||
110
common/circbuf.c
110
common/circbuf.c
@@ -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;
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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",
|
||||
""
|
||||
);
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user