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

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [orpmon/] [include/] [common.h] - Blame information for rev 816

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 814 markom
  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 short bi_ethspeed;   /* Ethernet speed in Mbps               */
31
  unsigned long bi_intfreq;     /* Internal Freq, in MHz                */
32
  unsigned long bi_busfreq;     /* Bus Freq, in MHz                     */
33
  unsigned long bi_baudrate;    /* Console Baudrate                     */
34 809 simons
} bd_t;
35
 
36
typedef struct {
37
  unsigned long src_addr;
38
  unsigned long dst_addr;
39 816 markom
  unsigned long start_addr;
40 809 simons
  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 816 markom
  unsigned long erase_method; /* 0 = do not erase, 1 = fully, 2 = as needed */
47 809 simons
} global_struct;
48
 
49
extern bd_t bd;
50
extern global_struct global;
51
 
52
/* stdio */
53
extern int getc (void);
54
extern int testc (void);
55
extern int ctrlc (void);
56
extern void putc (const char c);
57
extern int printf (const char *fmt, ...);
58
 
59 812 markom
extern unsigned long parse_ip (char *ip);
60 809 simons
 
61
/* simulator stdout */
62
extern void __printf (const char *fmt, ...);
63
 
64
/* Reports a 32bit value to the simulator */
65
extern void report(unsigned long value);
66
 
67
/* Commands stuff */
68
#if HELP_ENABLED
69
#define register_command(name,params,help,funct) register_command_func (name, params, help, funct)
70
#else /* !HELP_ENABLED */
71
#define register_command(name,params,help,funct) register_command_func (name, "", "", funct)
72
#endif /* HELP_ENABLED */
73
 
74
extern void register_command_func (const char *name, const char *params, const char *help, int (*func)(int argc, char *argv[]));
75
 
76
/* Redirects console */
77
extern void change_console_type (enum bi_console_type_t con_type);
78
 
79
/* OR1k specific */
80
/* For writing into SPR. */
81
extern void mtspr(unsigned long spr, unsigned long value);
82
 
83
/* For reading SPR. */
84
extern unsigned long mfspr(unsigned long spr);
85
 
86
#endif  /* _COMMON_H_ */
87
 

powered by: WebSVN 2.1.0

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