/**     ll_post_npa_56x4.h
 **
 **   This file contains supporting definitions for all low-level POST 
 ** "C" tests and related code for the NPA-5651 AMC platform.
 **
 ** Author: Ted Schmitz
 **
 ** Created: December 9, 2008
 **
 **/

extern int read_select_data_from_i2c_dev_timed(unsigned char * buffer, 
                                               unsigned char i2c_adrs,
                                               unsigned int offset, 
                                               int length,
                                               int err_msg_flag);
extern void disp_seeprom_data(void);
extern void dump_all_sdram_spd_data(void);
extern void clear_diag_seeprom_space(void);
extern void tbl_delay(unsigned long count);
extern void report_seeprom_problem(unsigned short error_stop);
extern void report_seeprom_problem_long(unsigned short error_stop,
                                        unsigned int exp,
                                        unsigned int rcv,
                                        unsigned int adrs);
extern int read_select_data_from_seeprom_timed(unsigned char * buffer, 
                                               unsigned int offset, 
                                               int length);
extern int write_select_data_to_seeprom_timed(unsigned char * buffer, 
                                              unsigned int offset, 
                                              int length);
extern int calc_write_seeprom_csum_timed(void);
extern void report_seeprom_problem(unsigned short error_stop);
extern void report_i2c_device_problem(unsigned short error_stop);
extern int write_select_data_to_i2c_dev_timed(unsigned char * buffer, 
                                              unsigned char i2c_adrs,
                                              unsigned int offset, int length);
extern unsigned long ll_read_pci_conf_reg(long dev_num, long pci_bus_num,
                                          long conf_reg_offset, int reg_size);
extern void ll_write_pci_conf_reg(long dev_num, long pci_bus_num,
                                  long conf_reg_offset, int reg_size, 
                                  unsigned long data);
extern char disp_countdown_msg(int msg_no);

extern unsigned char get_def_error_mode(void);
extern void reset_unit(void);
extern void clear_i2c_bus(void);
extern void write_timebase_regs(unsigned long upper, unsigned long lower);
extern int read_entire_seeprom_timed(unsigned char * buf);
extern int write_data_to_seeprom_spec(unsigned char * buffer, 
                                      unsigned int offset, 
                                      int length);
extern void check_diag_area(void);
extern void dummy_bist_call(void);
unsigned char calc_csum_on_diag_area(unsigned char * buf);

extern int cpu_mon_reg_index[];
extern unsigned long uboot_rel_adrs; 
extern char seeprom_data[];

/* Sign on message for the NPA-5644 AMC card */
#define NPA_5644_SO_MSG "<<< NPA-5644 AMC >>>\n"

/* Sign on message for the NPA-5654 AMC card */
#define NPA_5654_SO_MSG "<<< NPA-5654 AMC >>>\n"

#define MAX_I2C_WRITE_RETRYS 10 /* max write retries before returning an error */
#define MAX_I2C_READ_RETRYS 10 /* max read retries before returning an error */
