/****************************************************************************** *File name : MM_lib.h *Version.Revision: 1.1 *Description: * This file contains the definitions of the variables used to serve memory * management TC's. It is only included by MM_lib.c *Creation Date & Author: 05-09-2005, SP ******************************************************************************/ #ifndef __MM_LIB_ #define __MM_LIB_ #define MAX_SUBSYSTEM 4 /* Data Memory Map as defined in the DPU Board Specification Document by Gavazzi (DPU-SP-CGS-001). This include file is based on the Issue 1, 11/12/2000 */ #define DATA_MEMORY_BASE_ADDRESS 0 #define START_DM_IN_PM 0x7BC00 #define IF_1355_BASE_ADDRESS 0x40000000 #define EEPROM_MEMORY_BASE_ADDRESS 0x80000000 #define INTERVAL_TIMER_BASE_ADDRESS 0x81000000 #define WATCHDOG_BASE_ADDRESS 0x82000000 #define INT_MANAGER_BASE_ADDRESS 0x83000000 #define SMCS_REGISTERS_BASE_ADDRESS 0x84000000 #define BUS_IF_BOARD_REGISTERS 0x8D000000 #define BUS_IF_MIL_AND_ANALOG_INP 0x8F000000 /* Registers for the ADC converter. MSEL_reg selects the line, MDATA_reg contains the 12bit output and one "ready" flag bit (the MSB) */ #define MSEL_reg 0x8000 #define MDATA_reg 0x8001 /* Error codes for memory management. Begin */ #define INVALID_MEMID 0x12 #define INVALID_ADDRESS 0x13 #define INVALID_MEMLENGTH 0x14 #define INVALID_CRC_1ST_CHK 0x15 #define INVALID_CRC_2ND_CHK 0x1B #define MEM_LOAD_OK 0xFFFF /* More Error codes */ #define COPY_OBSW_IMAGE_OK 0 #define NUM_OF_WORDS_WRONG 1 #define ILLEGAL_DIRECTION 3 /* Definitions used in copy_OBSW_image */ /* direction, 1 or 2 */ #define LOW_PM2HIGH_PM 1 #define HIGH_PM2LOW_PM 2 /* Maximum number of words in a memory load TC */ #define MAX_NUMBER_PM_WORDS_TC 38 #define MAX_NUMBER_DM_WORDS_TC 57 /* Maximum number of words in a memory dump TM */ #define MAX_NUMBER_PM_WORDS_TM 166 #define MAX_NUMBER_DM_WORDS_TM 249 /* Struct to exchange with the functions */ typedef struct { unsigned int subsystem; /* First 3 bit; always 0 for SPIRE and HIFI */ unsigned int RAM_type; /* 1 bit; 0 PRAM, 1 DRAM */ unsigned int memory_ID; /* 4 bit */ unsigned int start_address; /* 24 bit */ unsigned int length_SAU; /* Length in SAU */ unsigned int length_bytes; /* Length in bytes */ } memory_header; /* functions implemented in the library */ extern void delete_memory_segments(void); extern int add_memory_segment(unsigned int, unsigned int, unsigned int, int); extern int create_memory_header (unsigned int *, memory_header *, unsigned int); extern unsigned int memory_load(unsigned int *, memory_header *, int *); extern unsigned int memory_dump(memory_header *, unsigned int *, unsigned int *); extern unsigned int memory_check(memory_header *, unsigned int); extern unsigned int copy_OBSW_image (unsigned int, unsigned int, unsigned int); #endif