OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [bootloaders/] [orpmon/] [include/] [common.h] - Blame information for rev 265

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

Line No. Rev Author Line
1 2 marcus.erl
#ifndef _COMMON_H_
2
#define _COMMON_H_
3
 
4
#include "board.h"
5
 
6
/* max number of images saved in flash */
7
#ifndef MAX_IMAGES
8
#define MAX_IMAGES 40
9
#endif
10
 
11
#ifdef  DEBUG
12
#define debug(fmt,args...) printf (fmt ,##args)
13
#else
14
#define debug(fmt,args...) __printf (fmt ,##args)
15
#endif
16
 
17
/* A Board Information structure that is given to a program when
18
 * ppcboot starts it up. */
19
typedef struct bd_info {
20
  enum bi_console_type_t {
21
    CT_NONE,
22
    CT_UART,
23
    CT_CRT,
24
    CT_SIM,
25
  } bi_console_type;
26
  unsigned long bi_memstart;    /* start of  DRAM memory                */
27
  unsigned long bi_memsize;     /* size  of  DRAM memory in bytes       */
28
  unsigned long bi_flashstart;  /* start of FLASH memory                */
29
  unsigned long bi_flashsize;   /* size  of FLASH memory                */
30
  unsigned long bi_flashoffset; /* reserved area for startup monitor    */
31
  unsigned long bi_sramstart;   /* start of  SRAM memory                */
32
  unsigned long bi_sramsize;    /* size  of  SRAM memory                */
33
  unsigned long bi_bootflags;   /* boot / reboot flag (for LynxOS)      */
34
  unsigned long bi_ip_addr;     /* IP Address                           */
35
  unsigned short bi_ethspeed;   /* Ethernet speed in Mbps               */
36
  unsigned long bi_intfreq;     /* Internal Freq, in MHz                */
37
  unsigned long bi_busfreq;     /* Bus Freq, in MHz                     */
38
  unsigned long bi_baudrate;    /* Console Baudrate                     */
39
} bd_t;
40
 
41
typedef struct {
42
  unsigned long src_addr;
43
  unsigned long dst_addr;
44
  unsigned long start_addr;
45
  unsigned long length;
46
  unsigned long ip;
47
  unsigned long gw_ip;
48
  unsigned long mask;
49
  unsigned long srv_ip;
50
  unsigned char eth_add[6];
51
  unsigned long erase_method; /* 0 = do not erase, 1 = fully, 2 = as needed */
52
} global_struct;
53
 
54
 
55
/* structure for command interpreter                                  */
56
typedef struct {
57
  const char *name;
58
  const char *params;
59
  const char *help;
60
  int (*func)(int argc, char *argv[]);
61
} command_struct;
62
 
63 140 julius
// Keep a CRC during TFTP receive
64
#define TFTP_CALC_CRC
65
 
66 2 marcus.erl
typedef struct  {
67
  unsigned long eth_ip;
68
  unsigned long eth_mask;
69
  unsigned long eth_gw;
70
  unsigned long tftp_srv_ip;
71
  char tftp_filename[64];
72
  unsigned long img_number;
73
  unsigned long img_start_addr[MAX_IMAGES];
74
  unsigned long img_length[MAX_IMAGES];
75
} flash_cfg_struct;
76
 
77
extern bd_t bd;
78
extern global_struct global;
79
 
80
/* stdio */
81
extern int getc (void);
82
extern int testc (void);
83
extern int ctrlc (void);
84
extern void putc (const char c);
85
extern int printf (const char *fmt, ...);
86 140 julius
extern void show_mem (int start, int stop);
87 2 marcus.erl
extern unsigned long parse_ip (char *ip);
88
 
89
/* simulator stdout */
90
extern void __printf (const char *fmt, ...);
91
 
92
/* Reports a 32bit value to the simulator */
93
extern void report(unsigned long value);
94
 
95
/* Commands stuff */
96
#if HELP_ENABLED
97
#define register_command(name,params,help,funct) register_command_func (name, params, help, funct)
98
#else /* !HELP_ENABLED */
99
#define register_command(name,params,help,funct) register_command_func (name, "", "", funct)
100
#endif /* HELP_ENABLED */
101
 
102
extern void register_command_func (const char *name, const char *params, const char *help, int (*func)(int argc, char *argv[]));
103
 
104
/* Redirects console */
105
extern void change_console_type (enum bi_console_type_t con_type);
106
 
107
/* OR1k specific */
108
/* For writing into SPR. */
109
extern void mtspr(unsigned long spr, unsigned long value);
110
 
111
/* For reading SPR. */
112
extern unsigned long mfspr(unsigned long spr);
113
 
114
 
115
#endif  /* _COMMON_H_ */
116
 

powered by: WebSVN 2.1.0

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