summaryrefslogtreecommitdiffstats
path: root/c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2007-06-20 21:42:24 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2007-06-20 21:42:24 +0000
commit19b4789367234392644443e7961dac6b8645f395 (patch)
tree5a223b1e85ef7afeebd13c2febef386cf9c370c4 /c
parent2007-06-20 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-19b4789367234392644443e7961dac6b8645f395.tar.bz2
2007-06-20 Joel Sherrill <joel.sherrill@oarcorp.com>
* shared/uboot_dump_bdinfo.c: New file.
Diffstat (limited to 'c')
-rw-r--r--c/src/lib/libbsp/powerpc/ChangeLog4
-rw-r--r--c/src/lib/libbsp/powerpc/shared/uboot_dump_bdinfo.c84
2 files changed, 88 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/powerpc/ChangeLog b/c/src/lib/libbsp/powerpc/ChangeLog
index 59d4a61729..ab2d44b60a 100644
--- a/c/src/lib/libbsp/powerpc/ChangeLog
+++ b/c/src/lib/libbsp/powerpc/ChangeLog
@@ -1,3 +1,7 @@
+2007-06-20 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * shared/uboot_dump_bdinfo.c: New file.
+
2007-04-17 Joel Sherrill <joel@OARcorp.com>
* psim/tools/runtest: Do not run pppd.exe from batch mode script.
diff --git a/c/src/lib/libbsp/powerpc/shared/uboot_dump_bdinfo.c b/c/src/lib/libbsp/powerpc/shared/uboot_dump_bdinfo.c
new file mode 100644
index 0000000000..0cb160df4d
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/shared/uboot_dump_bdinfo.c
@@ -0,0 +1,84 @@
+/*
+ * COPYRIGHT (c) 1989-2007.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+
+#include <bsp.h>
+#include <rtems/bspIo.h>
+
+/*
+ * This file should only be compiled if the BSP has U-Boot.
+ * In addition, this function does not support every PowerPC
+ * CPU model listed in the bd_t structure. Users are encouraged
+ * to augment this code. The following #error should be fixed
+ * as more CPU models are supported.
+ */
+#if defined(HAS_UBOOT)
+ #if !defined(CONFIG_MPC5xxx)
+ #error "dumpUBootDBInfo: unsupported configuration!!"
+ #endif
+
+/*
+ * Dump U-Boot Board Information Structure
+ *
+ * u - pointer to information structure
+ */
+void dumpUBootBDInfo(
+ bd_t *u
+)
+{
+ if ( u == (bd_t *)1 ) {
+ printk( "UBoot BD Info Ptr NOT Set\n" );
+ return;
+ }
+
+ printk(
+ "*** U-Boot Information ***\n"
+ "Start/Size of DRAM memory = %p for %lx\n"
+ "Start/Size of Flash memory = %p for %lx\n"
+ "Reserved area for startup monitor = %ld\n"
+ "Start/Size of SRAM memory = %p for %ld\n"
+ "Boot/Reboot flag = %ld\n"
+ "IP Address = %d:%d:%d:%d\n"
+ "Ethernet address = %02x:%02x:%02x:%02x:%02x:%02x\n"
+ "Ethernet speed in Mbps = %d\n"
+ "Internal Freq, in MHz = %ld\n"
+ "Bus Freq, in MHz = %ld\n"
+ "Console Baud Rate = %ld\n"
+ #if defined(CONFIG_MPC5xxx)
+ "MBAR = %p\n"
+ "IPB Bus Freq, in MHz = %ld\n"
+ "PCI Bus Freq, in MHz = %ld\n"
+ #endif
+ ,
+ u->bi_memstart, u->bi_memsize,
+ u->bi_flashstart, u->bi_flashsize,
+ u->bi_flashoffset,
+ u->bi_sramstart, u->bi_sramsize,
+ u->bi_bootflags,
+ ((u->bi_ip_addr >> 24) & 0xff), ((u->bi_ip_addr >> 16) & 0xff),
+ ((u->bi_ip_addr >> 8) & 0xff), (u->bi_ip_addr & 0xff),
+ u->bi_enetaddr[0], u->bi_enetaddr[1], u->bi_enetaddr[2],
+ u->bi_enetaddr[3], u->bi_enetaddr[4], u->bi_enetaddr[5],
+ u->bi_ethspeed,
+ u->bi_intfreq,
+ u->bi_busfreq,
+ u->bi_baudrate
+ #if defined(CONFIG_MPC5xxx)
+ ,
+ u->bi_mbar_base,
+ u->bi_ipbfreq,
+ u->bi_pcifreq
+ #endif
+ );
+
+}
+#endif
+