OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [branches/] [oc/] [orpmon/] [include/] [common.h] - Blame information for rev 1771

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 809 simons
#ifndef _COMMON_H_
2
#define _COMMON_H_
3
 
4
#include "board.h"
5
 
6
#ifdef  DEBUG
7
#define debug(fmt,args...) printf (fmt ,##args)
8
#else
9
#define debug(fmt,args...) __printf (fmt ,##args)
10
#endif
11
 
12
/* A Board Information structure that is given to a program when
13
 * ppcboot starts it up. */
14
typedef struct bd_info {
15
  enum bi_console_type_t {
16
    CT_NONE,
17
    CT_UART,
18
    CT_CRT,
19
    CT_SIM,
20
  } bi_console_type;
21
        unsigned long   bi_memstart;    /* start of  DRAM memory                */
22
        unsigned long   bi_memsize;     /* size  of  DRAM memory in bytes       */
23
        unsigned long   bi_flashstart;  /* start of FLASH memory                */
24
        unsigned long   bi_flashsize;   /* size  of FLASH memory                */
25
        unsigned long   bi_flashoffset; /* reserved area for startup monitor    */
26
        unsigned long   bi_sramstart;   /* start of  SRAM memory                */
27
        unsigned long   bi_sramsize;    /* size  of  SRAM memory                */
28
        unsigned long   bi_bootflags;   /* boot / reboot flag (for LynxOS)      */
29
        unsigned long   bi_ip_addr;     /* IP Address                           */
30
        unsigned char   bi_enetaddr[6]; /* Ethernet adress                      */
31
        unsigned short  bi_ethspeed;    /* Ethernet speed in Mbps               */
32
        unsigned long   bi_intfreq;     /* Internal Freq, in MHz                */
33
        unsigned long   bi_busfreq;     /* Bus Freq, in MHz                     */
34
        unsigned long   bi_baudrate;    /* Console Baudrate                     */
35
} bd_t;
36
 
37
typedef struct {
38
  unsigned long src_addr;
39
  unsigned long dst_addr;
40
  unsigned long length;
41
  unsigned long ip;
42
  unsigned long gw_ip;
43
  unsigned long mask;
44
  unsigned long srv_ip;
45
  unsigned char eth_add[6];
46
} global_struct;
47
 
48
extern bd_t bd;
49
extern global_struct global;
50
 
51
/* stdio */
52
extern int getc (void);
53
extern int testc (void);
54
extern int ctrlc (void);
55
extern void putc (const char c);
56
extern int printf (const char *fmt, ...);
57
 
58
extern unsigned long strtoul(char *s);
59
 
60
/* simulator stdout */
61
extern void __printf (const char *fmt, ...);
62
 
63
/* Reports a 32bit value to the simulator */
64
extern void report(unsigned long value);
65
 
66
/* Commands stuff */
67
#if HELP_ENABLED
68
#define register_command(name,params,help,funct) register_command_func (name, params, help, funct)
69
#else /* !HELP_ENABLED */
70
#define register_command(name,params,help,funct) register_command_func (name, "", "", funct)
71
#endif /* HELP_ENABLED */
72
 
73
extern void register_command_func (const char *name, const char *params, const char *help, int (*func)(int argc, char *argv[]));
74
 
75
/* Redirects console */
76
extern void change_console_type (enum bi_console_type_t con_type);
77
 
78
/* OR1k specific */
79
/* For writing into SPR. */
80
extern void mtspr(unsigned long spr, unsigned long value);
81
 
82
/* For reading SPR. */
83
extern unsigned long mfspr(unsigned long spr);
84
 
85
#endif  /* _COMMON_H_ */
86
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.