source: rtems/c/src/lib/libbsp/powerpc/shared/uboot_dump_bdinfo.c @ c00b49f8

4.104.115
Last change on this file since c00b49f8 was 19b4789, checked in by Joel Sherrill <joel.sherrill@…>, on 06/20/07 at 21:42:24

2007-06-20 Joel Sherrill <joel.sherrill@…>

  • shared/uboot_dump_bdinfo.c: New file.
  • Property mode set to 100644
File size: 2.2 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2007.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.com/license/LICENSE.
8 *
9 *  $Id$
10 */
11
12
13#include <bsp.h>
14#include <rtems/bspIo.h>
15
16/*
17 *  This file should only be compiled if the BSP has U-Boot.
18 *  In addition, this function does not support every PowerPC
19 *  CPU model listed in the bd_t structure.  Users are encouraged
20 *  to augment this code.  The following #error should be fixed
21 *  as more CPU models are supported.
22 */
23#if defined(HAS_UBOOT)
24  #if !defined(CONFIG_MPC5xxx)
25    #error "dumpUBootDBInfo: unsupported configuration!!"
26  #endif
27
28/*
29 *  Dump U-Boot Board Information Structure
30 * 
31 *  u - pointer to information structure
32 */
33void dumpUBootBDInfo(
34  bd_t *u
35)
36{
37  if ( u == (bd_t *)1 ) {
38    printk( "UBoot BD Info Ptr NOT Set\n" );
39    return;
40  }
41
42  printk(
43    "*** U-Boot Information ***\n"
44    "Start/Size of DRAM memory  = %p for %lx\n"
45    "Start/Size of Flash memory = %p for %lx\n"
46    "Reserved area for startup monitor = %ld\n"
47    "Start/Size of SRAM memory  = %p for %ld\n"
48    "Boot/Reboot flag = %ld\n"
49    "IP Address = %d:%d:%d:%d\n"
50    "Ethernet address = %02x:%02x:%02x:%02x:%02x:%02x\n"
51    "Ethernet speed in Mbps = %d\n"
52    "Internal Freq, in MHz = %ld\n"
53    "Bus Freq, in MHz = %ld\n"
54    "Console Baud Rate = %ld\n"
55    #if defined(CONFIG_MPC5xxx)
56      "MBAR                       = %p\n"
57      "IPB Bus Freq, in MHz       = %ld\n"
58      "PCI Bus Freq, in MHz       = %ld\n"
59    #endif
60    ,
61    u->bi_memstart,   u->bi_memsize,
62    u->bi_flashstart, u->bi_flashsize,
63    u->bi_flashoffset,
64    u->bi_sramstart, u->bi_sramsize,
65    u->bi_bootflags,
66    ((u->bi_ip_addr >> 24) & 0xff), ((u->bi_ip_addr >> 16) & 0xff),
67    ((u->bi_ip_addr >> 8) & 0xff),  (u->bi_ip_addr & 0xff),
68    u->bi_enetaddr[0], u->bi_enetaddr[1], u->bi_enetaddr[2],
69    u->bi_enetaddr[3], u->bi_enetaddr[4], u->bi_enetaddr[5],
70    u->bi_ethspeed,
71    u->bi_intfreq,
72    u->bi_busfreq,
73    u->bi_baudrate
74    #if defined(CONFIG_MPC5xxx)
75      ,
76      u->bi_mbar_base,
77      u->bi_ipbfreq,
78      u->bi_pcifreq
79    #endif
80  );
81 
82}
83#endif
84
Note: See TracBrowser for help on using the repository browser.