nvram.h 1.36 KB
#ifndef _NVRAM_H_
#define _NVRAM_H_

#include <stdio.h>

#define PASS 0
#define FAIL -1

/*
 * Set this value for whatever scaling of sys clock to speed up timing
 */
/* converted to command line with default */
/*
#define SYSCLK_SCALE 20
*/

/*
 * Values below for wait are exact. Need to add a little to make sure
 * event is triggered: 
 */

#define EXTRA_WAIT 100

/* increased to fix timeout failure on virage 2 nms recall.
 */
#define MORE_EXTRA_WAIT 400

void print_crsto_1(FILE *fp, int reg);
void print_crsto_0(FILE *fp, int reg);
void print_ctrl(FILE *fp, int reg);

int get_sys_clk_ns(int sysclk_scale);
int get_vpp(int reg);
int get_mrcl_tecc_bias(int x, unsigned char * newmrcl, 
		       unsigned char * newtecc, unsigned char * newbias);
int nms_ready(FILE *LogFp, int ctrl_reg);
int nms_recall(int sysclk_scale, FILE *LogFp, int ctrl_reg);
int nms_store_default(FILE *LogFp, int ctrl_reg);
int nms_store(FILE *LogFp, int ctrl_reg, int store_pw, int vpp_level, int vpp_max, int vpp_delta, int max_pulses, int dumb_pulses);
int nms_store_interrupt(FILE *LogFp, int ctrl_reg, int store_pw, int vpp_level, int vpp_max, int vpp_delta, int max_pulses, int dumb_pulses);
int nms_store_checkvpp(FILE *LogFp, int ctrl_reg, int store_pw, int vpp_level,
		       int vpp_max, int vpp_delta, int max_pulses, 
		       int dumb_pulses, 
		       int *expected_array, int size);

#endif