/*
 *               Copyright (C) 2005-2006 BroadOn Communications Corp.
 *
 *  These coded instructions, statements, and computer programs contain
 *  unpublished  proprietary information of BroadOn Communications Corp.,
 *  and  are protected by Federal copyright law. They may not be disclosed
 *  to  third  parties or copied or duplicated in any form, in whole or in
 *  part, without the prior written consent of BroadOn Communications Corp.
 *
 */

#ifndef __NVRAM_H__
#define __NVRAM_H__
/*
 * NC NV (Kilopass XPM) data format definition
 *
 * NOTE: For NC all multi-byte fields are in little endian
 * and bytes are stored as little endian (LSB first)
 * 
 * FAKE_XPM is for software testing before XPM is working
 */
//#define FAKE_XPM
#ifdef FAKE_XPM
#define NV_NC_XPM_SIZE (1024*8)
#else
#define NV_NC_XPM_SIZE (8192*8)
#endif

#define NV_NC_BOOT1_HASH_OFF          (0*8)
#define NV_NC_BOOT1_HASH_SIZE        (20*8)
#define NV_NC_BOOT1_HASHC_OFF        (20*8)
#define NV_NC_BOOT1_HASHC_SIZE       (20*8)
#define NV_NC_COMMON_AES_KEY_OFF     (40*8)
#define NV_NC_COMMON_AES_KEY_SIZE    (16*8)
#define NV_NC_COMMON_AES_KEYC_OFF    (56*8)
#define NV_NC_COMMON_AES_KEYC_SIZE   (16*8)
#define NV_NC_DEVICE_ID_OFF          (72*8)
#define NV_NC_DEVICE_ID_SIZE          (4*8)
#define NV_NC_DEVICE_IDC_OFF         (76*8)  
#define NV_NC_DEVICE_IDC_SIZE         (4*8)

#define NV_NC_DEVICE_ECDH_KEY_OFF    (80*8)
#define NV_NC_DEVICE_ECDH_KEY_SIZE   (30*8)
#define NV_NC_SFS_HMAC_KEY_OFF      (110*8) 
#define NV_NC_SFS_HMAC_KEY_SIZE      (20*8)
#define NV_NC_SFS_AES_KEY_OFF       (130*8)
#define NV_NC_SFS_AES_KEY_SIZE       (16*8)

#define NV_NC_MFR_ID_OFF            (146*8)
#define NV_NC_MFR_ID_SIZE             (4*8)
#define NV_NC_CA_ID_OFF             (150*8)
#define NV_NC_CA_ID_SIZE              (4*8)
#define NV_NC_MFR_DATE_OFF          (154*8)
#define NV_NC_MFR_DATE_SIZE           (4*8)
#define NV_NC_MFR_SIGN_OFF          (158*8)
#define NV_NC_MFR_SIGN_SIZE          (60*8)

/*
 * Start of field writable region
 */
#define NV_NC_WRITEABLE_OFF         (512*8)
#define NV_NC_OS_VERSION_OFF        (512*8)
#define NV_NC_OS_VERSION_SIZE        (32*8)
#define NV_NC_CACRL_VERSION_OFF     (544*8)
#define NV_NC_CACRL_VERSION_SIZE     (32*8)
#define NV_NC_CRL_VERSION_OFF       (576*8)
#define NV_NC_CRL_VERSION_SIZE       (32*8)
#define NV_NC_SFS_VERSION_OFF       (608*8)
#define NV_NC_SFS_VERSION_SIZE      (NV_NC_XPM_SIZE-8-NV_NC_SFS_VERSION_OFF)

/*
 * End of field writeable region
 * Write protect bits and JTAG disables
 */
#define NV_NC_WPROT_OFF             (NV_NC_XPM_SIZE-4)
#define NV_NC_WPROT_SIZE                 4
#define NV_NC_JTAG_ENABLE_OFF       (NV_NC_XPM_SIZE-8)
#define NV_NC_JTAG_ENABLE_SIZE           4

#endif /* __NVRAM_H__ */
