blob: dba88a5844e6cd83112fbd0e233da9cea0071b4b [file] [log] [blame]
/*******************************************************************/
/************************* File Description ************************/
/*******************************************************************/
/* File Name: $Workfile: hmx_uprade_nvram.h $
* Version: $Revision: 1.0 $
* Original Author: Yang Hyun Uk $
* Current Author: $Author: huyang@humaxdigital.com $
* Date: $Date: 2011.11.07
* File Description: Upgrade APIs
* Module:
* Remarks:
*/
/**
* @author Hyunuk Yang(huyang@humaxdigital.com)
* @date 07 Nov 2011
*/
/**
* @note
* Copyright (C) 2011 Humax Corporation. All Rights Reserved. <br>
* This software is the confidential and proprietary information
* of Humax Corporation. You may not use or distribute this software
* except in compliance with the terms and conditions of any applicable license
* agreement in writing between Humax Corporation and you.
*/
/*@{*/
/**
* @file hmx_upgrade_nvram.h
*/
#ifndef HMX_UPGRADE_NVRAM_H_
#define HMX_UPGRADE_NVRAM_H_
/*******************************************************************/
/**************************** Header Files**************************/
/*******************************************************************/
/* Start Including Header Files */
/* End Including Headers*/
/*******************************************************************/
/************************ Extern variables *************************/
/*******************************************************************/
/* Start Extern variablee */
extern int libupgrade_verbose;
/* End Extern variable */
/*******************************************************************/
/************************ Macro Definition *************************/
/*******************************************************************/
/* Start Macro definition */
/* End Macro definition */
/*******************************************************************/
/****************************** typedef ****************************/
/*******************************************************************/
/* Start typedef */
typedef enum tagNVRAM_FIELD {
NVRAM_FIELD_SYSTEM_ID = 0, // System Id
NVRAM_FIELD_SERIAL_NO,
NVRAM_FIELD_MAC_ADDR,
NVRAM_FIELD_HDCP_KEY,
NVRAM_FIELD_DTCP_KEY,
NVRAM_FIELD_1ST_SERIAL_NUMBER,
NVRAM_FIELD_2ND_SERIAL_NUMBER,
NVRAM_FIELD_GPN,
NVRAM_FIELD_MAC_ADDR_MOCA,
NVRAM_FIELD_MAC_ADDR_BT,
NVRAM_FIELD_GOOGLE_SSL_PEM,
NVRAM_FIELD_GOOGLE_SSL_CRT,
NVRAM_FIELD_LOADER_VERSION, // Version of boot Loader
NVRAM_FIELD_ACTIVATED_KERNEL_NUM, // ACTIVATED_KERNEL_NUM
NVRAM_FIELD_MTD_TYPE_FOR_KERNEL, // MTD_TYPE_FOR_KERNEL
NVRAM_FIELD_ACTIVATED_KERNEL_NAME, // "kernel0", lookup mtd partition
NVRAM_FIELD_PLATFORM_NAME, // Platform name, e.g. "gfhd100"
NVRAM_FIELD_EXTRA_KERNEL_OPT, // string to append to cmdline
NVRAM_FIELD_PAIRED_DISK, // serial number of the disk
NVRAM_FIELD_PARTITION_VER, // partition version
NVRAM_FIELD_HW_VER, // hardware revision
NVRAM_FIELD_DUMMY = 0xFFFF
} NVRAM_FIELD_T;
/* Start global function prototypes */
typedef enum HMX_NVRAM_PARTITION_e {
HMX_NVRAM_PARTITION_RO,
HMX_NVRAM_PARTITION_RW,
HMX_NVRAM_PARTITION_W_RAWFS,
HMX_NVRAM_PARTITION_MAX
} HMX_NVRAM_PARTITION_E;
typedef enum {
DRV_OK = 0,
DRV_ERR,
DRV_ERR_INVALID_PARAMETER,
DRV_ERR_INITIALIZATION,
DRV_ERR_EVENT_INITIALIZATION,
DRV_ERR_OUTOFMEMORY,
DRV_ERR_EXTERNAL_ERROR
} DRV_Error;
/* End typedef */
/*******************************************************************/
/******************** global function prototype ********************/
/*******************************************************************/
extern int HMX_UPGRADE_NVRAM_Write(unsigned long offset, unsigned char * data,
unsigned int size );
extern int HMX_UPGRADE_NVRAM_Read(unsigned long offset, unsigned char * data,
unsigned int size );
/*******************************************************************/
/******************** global function prototype ********************/
/*******************************************************************/
DRV_Error HMX_NVRAM_Init(void);
DRV_Error HMX_NVRAM_Write(HMX_NVRAM_PARTITION_E partition,
unsigned char *pName, unsigned int offset,
unsigned char *pValue, unsigned int ulSize);
DRV_Error HMX_NVRAM_Read(HMX_NVRAM_PARTITION_E partition,
unsigned char *pName, unsigned int offset,
unsigned char *pValue, unsigned int ulSize);
DRV_Error HMX_NVRAM_GetField(NVRAM_FIELD_T field, unsigned int offset,
void *data, int nDataSize);
DRV_Error HMX_NVRAM_SetField(NVRAM_FIELD_T field, unsigned int offset,
void *data, int nDataSize);
DRV_Error HMX_NVRAM_GetLength(NVRAM_FIELD_T field, int *pLen);
DRV_Error HMX_NVRAM_Remove(HMX_NVRAM_PARTITION_E partition,
unsigned char *pName);
DRV_Error HMX_NVRAM_Dir(void);
/* End global function prototypes */
#endif // HMX_UPGRADE_NVRAM_H_
/*@}*/