summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/bios_emulator/x86emu/debug.c7
-rw-r--r--drivers/gpio/kw_gpio.c2
-rw-r--r--drivers/net/dm9000x.c10
-rw-r--r--drivers/serial/Makefile1
-rw-r--r--drivers/serial/sandbox.c63
-rw-r--r--drivers/serial/usbtty.h2
6 files changed, 79 insertions, 6 deletions
diff --git a/drivers/bios_emulator/x86emu/debug.c b/drivers/bios_emulator/x86emu/debug.c
index 241acf3..6417d09 100644
--- a/drivers/bios_emulator/x86emu/debug.c
+++ b/drivers/bios_emulator/x86emu/debug.c
@@ -39,6 +39,7 @@
#include <stdarg.h>
#include <common.h>
+#include <linux/ctype.h>
#include "x86emu/x86emui.h"
/*----------------------------- Implementation ----------------------------*/
@@ -333,7 +334,7 @@ static int x86emu_parse_line(char *s, int *ps, int *n)
int cmd;
*n = 0;
- while (*s == ' ' || *s == '\t')
+ while (isblank(*s))
s++;
ps[*n] = *s;
switch (*s) {
@@ -346,13 +347,13 @@ static int x86emu_parse_line(char *s, int *ps, int *n)
}
while (1) {
- while (*s != ' ' && *s != '\t' && *s != '\n')
+ while (!isblank(*s) && *s != '\n')
s++;
if (*s == '\n')
return cmd;
- while (*s == ' ' || *s == '\t')
+ while (isblank(*s))
s++;
*n += 1;
diff --git a/drivers/gpio/kw_gpio.c b/drivers/gpio/kw_gpio.c
index 56383c2..2de179e 100644
--- a/drivers/gpio/kw_gpio.c
+++ b/drivers/gpio/kw_gpio.c
@@ -109,7 +109,7 @@ void kw_gpio_set_valid(unsigned pin, int mode)
*/
int kw_gpio_direction_input(unsigned pin)
{
- if (!kw_gpio_is_valid(pin, GPIO_INPUT_OK))
+ if (kw_gpio_is_valid(pin, GPIO_INPUT_OK) != 0)
return 1;
/* Configure GPIO direction. */
diff --git a/drivers/net/dm9000x.c b/drivers/net/dm9000x.c
index b5c5573..0424110 100644
--- a/drivers/net/dm9000x.c
+++ b/drivers/net/dm9000x.c
@@ -116,13 +116,21 @@ static u8 DM9000_ior(int);
static void DM9000_iow(int reg, u8 value);
/* DM9000 network board routine ---------------------------- */
-
+#ifndef CONFIG_DM9000_BYTE_SWAPPED
#define DM9000_outb(d,r) writeb(d, (volatile u8 *)(r))
#define DM9000_outw(d,r) writew(d, (volatile u16 *)(r))
#define DM9000_outl(d,r) writel(d, (volatile u32 *)(r))
#define DM9000_inb(r) readb((volatile u8 *)(r))
#define DM9000_inw(r) readw((volatile u16 *)(r))
#define DM9000_inl(r) readl((volatile u32 *)(r))
+#else
+#define DM9000_outb(d, r) __raw_writeb(d, r)
+#define DM9000_outw(d, r) __raw_writew(d, r)
+#define DM9000_outl(d, r) __raw_writel(d, r)
+#define DM9000_inb(r) __raw_readb(r)
+#define DM9000_inw(r) __raw_readw(r)
+#define DM9000_inl(r) __raw_readl(r)
+#endif
#ifdef CONFIG_DM9000_DEBUG
static void
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index 1dcc1c7..6309549 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -53,6 +53,7 @@ COBJS-$(CONFIG_SA1100_SERIAL) += serial_sa1100.o
COBJS-$(CONFIG_S3C24X0_SERIAL) += serial_s3c24x0.o
COBJS-$(CONFIG_S3C44B0_SERIAL) += serial_s3c44b0.o
COBJS-$(CONFIG_XILINX_UARTLITE) += serial_xuartlite.o
+COBJS-$(CONFIG_SANDBOX_SERIAL) += sandbox.o
COBJS-$(CONFIG_SCIF_CONSOLE) += serial_sh.o
COBJS-$(CONFIG_TEGRA2) += serial_tegra2.o
diff --git a/drivers/serial/sandbox.c b/drivers/serial/sandbox.c
new file mode 100644
index 0000000..0d65587
--- /dev/null
+++ b/drivers/serial/sandbox.c
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2011 The Chromium OS Authors.
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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
+ */
+
+/*
+ * This provide a test serial port. It provides an emulated serial port where
+ * a test program and read out the serial output and inject serial input for
+ * U-Boot.
+ */
+
+#include <common.h>
+#include <os.h>
+
+int serial_init(void)
+{
+ return 0;
+}
+
+void serial_setbrg(void)
+{
+}
+
+void serial_putc(const char ch)
+{
+ os_write(1, &ch, 1);
+}
+
+void serial_puts(const char *str)
+{
+ while (*str)
+ serial_putc(*str++);
+}
+
+int serial_getc(void)
+{
+ char buf;
+ int count;
+
+ count = os_read(0, &buf, 1);
+ return count == 1 ? buf : 0;
+}
+
+int serial_tstc(void)
+{
+ return 0;
+}
diff --git a/drivers/serial/usbtty.h b/drivers/serial/usbtty.h
index a23169a..14961c1 100644
--- a/drivers/serial/usbtty.h
+++ b/drivers/serial/usbtty.h
@@ -37,7 +37,7 @@
#include <usb/spr_udc.h>
#endif
-#include <version_autogenerated.h>
+#include <version.h>
/* If no VendorID/ProductID is defined in config.h, pretend to be Linux
* DO NOT Reuse this Vendor/Product setup with protocol incompatible devices */