summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/cmd_bdinfo.c2
-rw-r--r--common/cmd_mem.c4
-rw-r--r--common/cmd_net.c2
-rw-r--r--common/fdt_support.c54
-rw-r--r--common/miiphyutil.c31
-rw-r--r--common/serial.c15
6 files changed, 32 insertions, 76 deletions
diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c
index 3a4dbcf6bd..bbb01921df 100644
--- a/common/cmd_bdinfo.c
+++ b/common/cmd_bdinfo.c
@@ -347,6 +347,7 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
print_num("-> size", bd->bi_dram[i].size);
}
+#if defined(CONFIG_CMD_NET)
puts ("ethaddr =");
for (i=0; i<6; ++i) {
printf ("%c%02X", i ? ':' : ' ', bd->bi_enetaddr[i]);
@@ -354,6 +355,7 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
puts ( "\n"
"ip_addr = ");
print_IPaddr (bd->bi_ip_addr);
+#endif
printf ("\n"
"baudrate = %d bps\n", bd->bi_baudrate);
diff --git a/common/cmd_mem.c b/common/cmd_mem.c
index d080810eca..000107f726 100644
--- a/common/cmd_mem.c
+++ b/common/cmd_mem.c
@@ -697,6 +697,7 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
vu_long *addr, *start, *end;
ulong val;
ulong readback;
+ int rcode = 0;
#if defined(CFG_ALT_MEMTEST)
vu_long addr_mask;
@@ -727,7 +728,6 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
#else
ulong incr;
ulong pattern;
- int rcode = 0;
#endif
if (argc > 1) {
@@ -992,8 +992,8 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
}
incr = -incr;
}
- return rcode;
#endif
+ return rcode;
}
diff --git a/common/cmd_net.c b/common/cmd_net.c
index 56eb684d55..dbf6b861b1 100644
--- a/common/cmd_net.c
+++ b/common/cmd_net.c
@@ -51,7 +51,7 @@ int do_tftpb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
U_BOOT_CMD(
tftpboot, 3, 1, do_tftpb,
"tftpboot- boot image via network using TFTP protocol\n",
- "[loadAddress] [bootfilename]\n"
+ "[loadAddress] [[hostIPaddr:]bootfilename]\n"
);
int do_rarpb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
diff --git a/common/fdt_support.c b/common/fdt_support.c
index a13c140cff..69eb667954 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -30,9 +30,6 @@
#include <fdt_support.h>
#include <exports.h>
-#ifdef CONFIG_QE
-#include "../drivers/qe/qe.h"
-#endif
/*
* Global data (for the gd->bd)
*/
@@ -418,7 +415,7 @@ void do_fixup_by_path(void *fdt, const char *path, const char *prop,
{
#if defined(DEBUG)
int i;
- debug("Updating property '%s/%s' = ", node, prop);
+ debug("Updating property '%s/%s' = ", path, prop);
for (i = 0; i < len; i++)
debug(" %.2x", *(u8*)(val+i));
debug("\n");
@@ -444,7 +441,7 @@ void do_fixup_by_prop(void *fdt,
int off;
#if defined(DEBUG)
int i;
- debug("Updating property '%s/%s' = ", node, prop);
+ debug("Updating property '%s' = ", prop);
for (i = 0; i < len; i++)
debug(" %.2x", *(u8*)(val+i));
debug("\n");
@@ -471,7 +468,7 @@ void do_fixup_by_compat(void *fdt, const char *compat,
int off = -1;
#if defined(DEBUG)
int i;
- debug("Updating property '%s/%s' = ", node, prop);
+ debug("Updating property '%s' = ", prop);
for (i = 0; i < len; i++)
debug(" %.2x", *(u8*)(val+i));
debug("\n");
@@ -617,49 +614,4 @@ void fdt_fixup_ethernet(void *fdt, bd_t *bd)
#endif
}
}
-
-#ifdef CONFIG_QE
-/*
- * If a QE firmware has been uploaded, then add the 'firmware' node under
- * the 'qe' node.
- */
-void fdt_fixup_qe_firmware(void *fdt)
-{
- struct qe_firmware_info *qe_fw_info;
- int node, ret;
-
- qe_fw_info = qe_get_firmware_info();
- if (!qe_fw_info)
- return;
-
- node = fdt_path_offset(fdt, "/qe");
- if (node < 0)
- return;
-
- /* We assume the node doesn't exist yet */
- node = fdt_add_subnode(fdt, node, "firmware");
- if (node < 0)
- return;
-
- ret = fdt_setprop(fdt, node, "extended-modes",
- &qe_fw_info->extended_modes, sizeof(u64));
- if (ret < 0)
- goto error;
-
- ret = fdt_setprop_string(fdt, node, "id", qe_fw_info->id);
- if (ret < 0)
- goto error;
-
- ret = fdt_setprop(fdt, node, "virtual-traps", qe_fw_info->vtraps,
- sizeof(qe_fw_info->vtraps));
- if (ret < 0)
- goto error;
-
- return;
-
-error:
- fdt_del_node(fdt, node);
-}
-#endif
-
#endif
diff --git a/common/miiphyutil.c b/common/miiphyutil.c
index 281f0b29e3..eac8275a40 100644
--- a/common/miiphyutil.c
+++ b/common/miiphyutil.c
@@ -36,7 +36,6 @@
#include <net.h>
/* local debug macro */
-#define MII_DEBUG
#undef MII_DEBUG
#undef debug
@@ -261,31 +260,25 @@ int miiphy_info (char *devname, unsigned char addr, unsigned int *oui,
unsigned short tmp;
if (miiphy_read (devname, addr, PHY_PHYIDR2, &tmp) != 0) {
-#ifdef DEBUG
- puts ("PHY ID register 2 read failed\n");
-#endif
+ debug ("PHY ID register 2 read failed\n");
return (-1);
}
reg = tmp;
-#ifdef DEBUG
- printf ("PHY_PHYIDR2 @ 0x%x = 0x%04x\n", addr, reg);
-#endif
+ debug ("PHY_PHYIDR2 @ 0x%x = 0x%04x\n", addr, reg);
+
if (reg == 0xFFFF) {
/* No physical device present at this address */
return (-1);
}
if (miiphy_read (devname, addr, PHY_PHYIDR1, &tmp) != 0) {
-#ifdef DEBUG
- puts ("PHY ID register 1 read failed\n");
-#endif
+ debug ("PHY ID register 1 read failed\n");
return (-1);
}
reg |= tmp << 16;
-#ifdef DEBUG
- printf ("PHY_PHYIDR[1,2] @ 0x%x = 0x%08x\n", addr, reg);
-#endif
+ debug ("PHY_PHYIDR[1,2] @ 0x%x = 0x%08x\n", addr, reg);
+
*oui = (reg >> 10);
*model = (unsigned char)((reg >> 4) & 0x0000003F);
*rev = (unsigned char)(reg & 0x0000000F);
@@ -304,15 +297,11 @@ int miiphy_reset (char *devname, unsigned char addr)
int loop_cnt;
if (miiphy_read (devname, addr, PHY_BMCR, &reg) != 0) {
-#ifdef DEBUG
- printf ("PHY status read failed\n");
-#endif
+ debug ("PHY status read failed\n");
return (-1);
}
if (miiphy_write (devname, addr, PHY_BMCR, reg | 0x8000) != 0) {
-#ifdef DEBUG
- puts ("PHY reset failed\n");
-#endif
+ debug ("PHY reset failed\n");
return (-1);
}
#ifdef CONFIG_PHY_RESET_DELAY
@@ -327,9 +316,7 @@ int miiphy_reset (char *devname, unsigned char addr)
reg = 0x8000;
while (((reg & 0x8000) != 0) && (loop_cnt++ < 1000000)) {
if (miiphy_read (devname, addr, PHY_BMCR, &reg) != 0) {
-# ifdef DEBUG
- puts ("PHY status read failed\n");
-# endif
+ debug ("PHY status read failed\n");
return (-1);
}
}
diff --git a/common/serial.c b/common/serial.c
index 56010807be..bfda7ca551 100644
--- a/common/serial.c
+++ b/common/serial.c
@@ -60,6 +60,16 @@ struct serial_device *__default_serial_console (void)
#else
return &serial0_device;
#endif
+#elif defined(CONFIG_S3C2410)
+#if defined(CONFIG_SERIAL1)
+ return &s3c24xx_serial0_device;
+#elif defined(CONFIG_SERIAL2)
+ return &s3c24xx_serial1_device;
+#elif defined(CONFIG_SERIAL3)
+ return &s3c24xx_serial2_device;
+#else
+#error "CONFIG_SERIAL? missing."
+#endif
#else
#error No default console
#endif
@@ -123,6 +133,11 @@ void serial_initialize (void)
#if defined (CONFIG_STUART)
serial_register(&serial_stuart_device);
#endif
+#if defined(CONFIG_S3C2410)
+ serial_register(&s3c24xx_serial0_device);
+ serial_register(&s3c24xx_serial1_device);
+ serial_register(&s3c24xx_serial2_device);
+#endif
serial_assign (default_serial_console ()->name);
}