summaryrefslogtreecommitdiffstats
path: root/include/asm-xtensa/xtensa/xtboard.h
blob: 22469c1753072624a706e3b29493551c015df058 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#ifndef _xtboard_h_included_
#define _xtboard_h_included_

/*
 * THIS FILE IS GENERATED -- DO NOT MODIFY BY HAND
 *
 *  xtboard.h  --  Routines for getting useful information from the board.
 *
 * This file is subject to the terms and conditions of the GNU General Public
 * License.  See the file "COPYING" in the main directory of this archive
 * for more details.
 *
 * Copyright (C) 2002 Tensilica Inc.
 */


#include <xtensa/xt2000.h>

#define	XTBOARD_RTC_ERROR	-1
#define	XTBOARD_RTC_STOPPED	-2


/*  xt2000-i2cdev.c:  */
typedef void XtboardDelayFunc( unsigned );
extern XtboardDelayFunc* xtboard_set_nsdelay_func( XtboardDelayFunc *delay_fn );
extern int xtboard_i2c_read (unsigned id, unsigned char *buf, unsigned addr, unsigned size);
extern int xtboard_i2c_write(unsigned id, unsigned char *buf, unsigned addr, unsigned size);
extern int xtboard_i2c_wait_nvram_ack(unsigned id, unsigned swtimer);

/*  xtboard.c:  */
extern int xtboard_nvram_read (unsigned addr, unsigned len, unsigned char *buf);
extern int xtboard_nvram_write(unsigned addr, unsigned len, unsigned char *buf);
extern int xtboard_nvram_binfo_read (xt2000_nvram_binfo *buf);
extern int xtboard_nvram_binfo_write(xt2000_nvram_binfo *buf);
extern int xtboard_nvram_binfo_valid(xt2000_nvram_binfo *buf);
extern int xtboard_ethermac_get(unsigned char *buf);
extern int xtboard_ethermac_set(unsigned char *buf);

/*+*----------------------------------------------------------------------------
/ Function: xtboard_get_rtc_time
/
/ Description:  Get time stored in real-time clock.
/
/ Returns: time in seconds stored in real-time clock.
/-**----------------------------------------------------------------------------*/

extern unsigned xtboard_get_rtc_time(void);

/*+*----------------------------------------------------------------------------
/ Function: xtboard_set_rtc_time
/
/ Description:  Set time stored in real-time clock.
/
/ Parameters: 	time -- time in seconds to store to real-time clock
/
/ Returns: 0 on success, xtboard_i2c_write() error code otherwise.
/-**----------------------------------------------------------------------------*/

extern int xtboard_set_rtc_time(unsigned time);


/*  xtfreq.c:  */
/*+*----------------------------------------------------------------------------
/ Function: xtboard_measure_sys_clk
/
/ Description:  Get frequency of system clock.
/
/ Parameters:	none
/
/ Returns: frequency of system clock.
/-**----------------------------------------------------------------------------*/

extern unsigned xtboard_measure_sys_clk(void);


#if 0	/* old stuff from xtboard.c: */

/*+*----------------------------------------------------------------------------
/ Function: xtboard_nvram valid
/
/ Description:  Determines if data in NVRAM is valid.
/
/ Parameters:	delay -- 10us delay function
/
/ Returns: 1 if NVRAM is valid, 0 otherwise
/-**----------------------------------------------------------------------------*/

extern unsigned xtboard_nvram_valid(void (*delay)( void ));

/*+*----------------------------------------------------------------------------
/ Function: xtboard_get_nvram_contents
/
/ Description:  Returns contents of NVRAM.
/
/ Parameters: 	buf -- buffer to NVRAM contents.
/		delay -- 10us delay function
/
/ Returns: 1 if NVRAM is valid, 0 otherwise
/-**----------------------------------------------------------------------------*/

extern unsigned xtboard_get_nvram_contents(unsigned char *buf, void (*delay)( void ));

/*+*----------------------------------------------------------------------------
/ Function: xtboard_get_ether_addr
/
/ Description:  Returns ethernet address of board.
/
/ Parameters: 	buf -- buffer to store ethernet address
/		delay -- 10us delay function
/
/ Returns: nothing.
/-**----------------------------------------------------------------------------*/

extern void xtboard_get_ether_addr(unsigned char *buf, void (*delay)( void ));

#endif /*0*/


#endif /*_xtboard_h_included_*/

OpenPOWER on IntegriCloud