blob: 3fe0d7594bb759c435ae2b9985880f34d4a603ed [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
*/
/*******************************************************************/
/**************************** 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
{
NVRAM_OSD_ON = 0,
NVRAM_OSD_OFF
}NVRAM_OSD_DISPLAY_E;
typedef enum
{
NVRAM_FRONTPANEL_DISPLAY_ON = 0,
NVRAM_FRONTPANEL_DISPLAY_OFF
}NVRAM_FRONTPANEL_DISPLAY_E;
typedef enum
{
NVRAM_ASPECT_RATIO_4_3 = 0,
NVRAM_ASPECT_RATIO_16_9
}NVRAM_ASPECT_RATIO_E;
typedef enum
{
NVRAM_OTA_SSU = 1,
NVRAM_OTA_DTG = 2,
NVRAM_OTA_HUMAX = 3,
NVRAM_OTA_NORDIG = 4,
NVRAM_OTA_FILE = 5,
NVRAM_OTA_SKYD = 6,
NVRAM_OTA_MAX
}NVRAM_OTA_TYPE_E;
typedef enum
{
NVRAM_OTA_CHANNEL_SAT = 1,
NVRAM_OTA_CHANNEL_CAB = 2,
NVRAM_OTA_CHANNEL_TER = 3,
NVRAM_OTA_CHANNEL_FLASH = 4,
NVRAM_OTA_CHANNEL_FTP = 5
}NVRAM_OTA_CHANNEL_E;
typedef enum
{
NVRAM_RESOLUTION_Unknown =0x00000000,
NVRAM_RESOLUTION_720x240P =0x00000001,
NVRAM_RESOLUTION_2880x240P =0x00000002,
NVRAM_RESOLUTION_640x480P =0x00000004,
NVRAM_RESOLUTION_720x480I =0x00000008,
NVRAM_RESOLUTION_720x480P =0x00000010,
NVRAM_RESOLUTION_1440x480P =0x00000020,
NVRAM_RESOLUTION_2880x480I =0x00000040,
NVRAM_RESOLUTION_2880x480P =0x00000080,
NVRAM_RESOLUTION_720x288P =0x00000100,
NVRAM_RESOLUTION_2880x288P =0x00000200,
NVRAM_RESOLUTION_720x576I =0x00000400,
NVRAM_RESOLUTION_720x576P =0x00000800,
NVRAM_RESOLUTION_1440x576P =0x00001000,
NVRAM_RESOLUTION_2880x576I =0x00002000,
NVRAM_RESOLUTION_2880x576P =0x00004000,
NVRAM_RESOLUTION_1080x720P =0x00008000,
NVRAM_RESOLUTION_1280x720P =0x00010000,
NVRAM_RESOLUTION_1920x1080I =0x00020000,
NVRAM_RESOLUTION_1920x1080P =0x00040000,
NVRAM_RESOLUTION_DUMMY =0x000FFFFF
} NVRAM_VIDEO_RESOLUTION_E;
typedef enum
{
NVRAM_HDMI_FIELD_RATE_Unknown =0x0000,
NVRAM_HDMI_FIELD_RATE_24HZ =0x0001,
NVRAM_HDMI_FIELD_RATE_25HZ =0x0002,
NVRAM_HDMI_FIELD_RATE_30HZ =0x0004,
NVRAM_HDMI_FIELD_RATE_50HZ =0x0008,
NVRAM_HDMI_FIELD_RATE_60HZ =0x0010,
NVRAM_HDMI_FIELD_RATE_100HZ =0x0020,
NVRAM_HDMI_FIELD_RATE_120HZ =0x0040,
NVRAM_HDMI_FIELD_RATE_200HZ =0x0080,
NVRAM_HDMI_FIELD_RATE_240HZ =0x0100,
NVRAM_HDMI_FIELD_RATE_DUMMY =0xFFFF
} NVRAM_HDMI_VIDEO_FIELD_RATE_E;
typedef enum
{
NVRAM_HDMI_VIDEO_AR_eNoData = 0,
NVRAM_HDMI_VIDEO_AR_e4_3,
NVRAM_HDMI_VIDEO_AR_e16_9
}NVRAM_HDMI_VIDEO_AR_E;
typedef enum
{
NVRAM_SCART_OUTPUT_CVBS=3,
NVRAM_SCART_OUTPUT_RGB,
NVRAM_SCART_OUTPUT_SVIDEO,
NVRAM_SCART_MAX
} NVRAM_SCART_SETTING_VALUE;
typedef enum tagNVRAM_FIELD
{
NVRAM_FIELD_SYSTEM_ID = 0, // unsigned int // 4 // System Id
NVRAM_FIELD_SFLASH,
NVRAM_FIELD_SERIAL_NO,
NVRAM_FIELD_MAC_ADDR,
NVRAM_FIELD_HDCP_KEY,
NVRAM_FIELD_DTCP_KEY,
NVRAM_FIELD_CI_PLUS_KEY,
NVRAM_FIELD_PARING_DATA,
NVRAM_FIELD_PRIVATE,
NVRAM_FIELD_CSC_KEY,
NVRAM_FIELD_CM_SERIAL_NO,
NVRAM_FIELD_CM_MAC_ADDR,
NVRAM_FIELD_CM_MAC_ADDR_ANOTHER,
NVRAM_FIELD_IRDETO_BBCB,
NVRAM_FIELD_OTA_TYPE1 = 0x100, // NVRAM_OTA_TYPE_E
NVRAM_FIELD_OTA_TYPE2, // NVRAM_OTA_TYPE_E
NVRAM_FIELD_OTA_TYPE3, // NVRAM_OTA_TYPE_E
NVRAM_FIELD_CH_TYPE1, // NVRAM_OTA_CHANNEL_E
NVRAM_FIELD_CH_TYPE2, // NVRAM_OTA_CHANNEL_E
NVRAM_FIELD_CH_TYPE3, // NVRAM_OTA_CHANNEL_E
NVRAM_FIELD_OTA_FLAG1, // NVRAM_OTA_FLAG_E
NVRAM_FIELD_OTA_FLAG2, // NVRAM_OTA_FLAG_E
NVRAM_FIELD_OTA_FLAG3, // NVRAM_OTA_FLAG_E
NVRAM_FIELD_TUNER_ID1, // Tuner Id
NVRAM_FIELD_TUNER_ID2, // Tuner Id
NVRAM_FIELD_TUNER_ID3, // Tuner Id
NVRAM_FIELD_ANTENA_POWER1, // External Antena Power for Ter, 0:Off/1:On
NVRAM_FIELD_ANTENA_POWER2, // External Antena Power for Ter, 0:Off/1:On
NVRAM_FIELD_ANTENA_POWER3, // External Antena Power for Ter, 0:Off/1:On
NVRAM_FIELD_ES_PID1, // Element Stream PID for OTA
NVRAM_FIELD_ES_PID2, // Element Stream PID for OTA
NVRAM_FIELD_ES_PID3, // Element Stream PID for OTA
NVRAM_FIELD_TRANSACTION_ID1, // Transaction Id for Nordic OTA
NVRAM_FIELD_TRANSACTION_ID2, // Transaction Id for Nordic OTA
NVRAM_FIELD_TRANSACTION_ID3, // Transaction Id for Nordic OTA
NVRAM_FIELD_CH_INFO_S, // DI_CHANNEL_PARAM
NVRAM_FIELD_CH_INFO_T, // DI_CHANNEL_PARAM
NVRAM_FIELD_CH_INFO_C, // DI_CHANNEL_PARAM
NVRAM_FIELD_NET_PORTAL_IP, // portal ip address
NVRAM_FIELD_NET_DOWN_PATH, // Network Download Path
NVRAM_FIELD_NET_DEVICE_ID, // ethernet device id 0 = eth0
NVRAM_FIELD_NET_IP_CONFIG, // DHCP/Manual
NVRAM_FIELD_NET_IP_SETTING, // Manual IP setting
NVRAM_FIELD_OTA_FTP_INFO, // NVRAM_FTP_OTA_SETTING_T
NVRAM_FIELD_FILE_SIZE, // file size of backgrould ota
NVRAM_FIELD_LOADER_VERSION, // Version of boot Loader
NVRAM_FIELD_APP_VERSION, // Version number of Application
NVRAM_FIELD_OTALDR_VERSION, // Version of OTA Loader
NVRAM_FIELD_CUR_OTAIMAGE_VERSION, // Version number of OTA image
NVRAM_FIELD_LOADER_VER,
NVRAM_FIELD_APP_VER,
NVRAM_FIELD_LANGUAGE, // OSD language code in ISO 639 code
NVRAM_FIELD_COUNTRY_CODE, // unsigned char a[3]
NVRAM_FIELD_TV_STANDARD, // DI_VIDEO_SD_STANDARD
NVRAM_FIELD_SCART_RGB, // NVRAM_SCART_SETTING_VALUE
NVRAM_FIELD_HD_RESOULTION, // NVRAM_VIDEO_RESOLUTION_E
NVRAM_FIELD_FIELD_RATE, // NVRAM_HDMI_VIDEO_FIELD_RATE_E
NVRAM_FIELD_OAD_VERSION, // for MHEG ???
NVRAM_FIELD_RCU_CUSTOM_CODE, // for RCU custom code
NVRAM_FIELD_RCU_CUSTOM_CODE2, // for alternative RCU custom code
NVRAM_FIELD_PANEL_DISPLAY, // DI_OTA_PANELDISPLAY_t
NVRAM_FIELD_PANEL_DIMMING, // unsigned char
NVRAM_FIELD_OSD_DISPLAY, // NVRAM_OSD_DISPLAY_E
NVRAM_FIELD_START_BANK_FLAG, // µÎ °³ÀÇ bankÁß ¾îµð·Î ºÎÆà ÇÒ Áö °áÁ¤
NVRAM_FIELD_CHECK_USB, // ºÎÆà ½Ã USB ¸¶¿îÆ®Çؼ­ hdf¸¦ °Ë»çÇÒÁö ¸»Áö °áÁ¤
NVRAM_FIELD_CHECK_USB_COUNT, // À§ µ¿ÀÛ ½ÇÆÐ ½Ã ¸î ¹ø Àç ½Ãµµ ÇÒÁö count¸¦ ÀúÀå
NVRAM_FIELD_ASPECT_RATIO, // NVRAM_ASPECT_RATIO_E
NVRAM_FIELD_USAGE_ID, // for UPC OTA
NVRAM_FIELD_BIN8K, // for eeprom emulation
NVRAM_FIELD_IRDETO_CPCB, // for IRDETO CPCB
NVRAM_FIELD_IRDETO_CPCB_ENCRYPTED, // for IRDETO CPCB (encrypted)
NVRAM_FIELD_ACTIVATED_KERNEL_NUM, // ACTIVATED_KERNEL_NUM
NVRAM_FIELD_ACTIVATED_ROOTFS_NUM, // ACTIVATED_ROOTFS_NUM
NVRAM_FIELD_MTD_TYPE_FOR_KERNEL, // MTD_TYPE_FOR_KERNEL
NVRAM_FIELD_TYPE_OF_FILESYSTEM, // TYPE_OF_FILESYSTEM
NVRAM_FIELD_L_TYPE_OF_FILESYSTEM, // Length TYPE_OF_FILESYSTEM
NVRAM_FIELD_NAME_OF_BOARD, // NAME_OF_BOARD
NVRAM_FIELD_L_NAME_OF_BOARD, // Length NAME_OF_BOARD
NVRAM_FIELD_ACTIVATED_KERNEL_NAME, // "kernel0", lookup mtd partition
NVRAM_FIELD_EXTRA_KERNEL_OPT, // string to append to cmdline
NVRAM_FIELD_RAWFS = 0x1000,
NVRAM_FIELD_DUMMY = 0xFFFF
} NVRAM_FIELD_T;
typedef enum
{
NVRAM_OTA_FLAG_NO_OTA = 0x00,
NVRAM_OTA_FLAG_DETECTED = 0x01,
NVRAM_OTA_FLAG_COMPLETED = 0x02,
NVRAM_OTA_FLAG_FORCE_UPGRADE = 0x04,
NVRAM_OTA_FLAG_NAGRA_RECOVERY = 0x08,
NVRAM_OTA_FLAG_DOWNLOADING = 0x10,
NVRAM_OTA_FLAG_WRITING = 0x20,
NVRAM_OTA_FLAG_ERROR = 0x80
} NVRAM_OTA_FLAG_E;
typedef struct NVRAM_NET_IP_SETTING_Tag
{
#define NET_ADDR_LENGTH 4
unsigned char ip[NET_ADDR_LENGTH];
unsigned char mask[NET_ADDR_LENGTH];
unsigned char gateway[NET_ADDR_LENGTH];
unsigned char dns[NET_ADDR_LENGTH];
} NVRAM_NET_IP_SETTING_T;
typedef struct NVRAM_FTP_OTA_SETTING_Tag
{
#define NVRAM_FTP_USER_LENGTH 20
#define NVRAM_FTP_PASSWD_LENGTH 20
#define NVRAM_FTP_DIR_PATH_LENGTH 200
#define NVRAM_FTP_FILE_NAME_LENGTH 50
unsigned char aServerIp[NET_ADDR_LENGTH];
unsigned char aUserName[NVRAM_FTP_USER_LENGTH];
unsigned char aPasswd[NVRAM_FTP_PASSWD_LENGTH];
unsigned char aDirPath[NVRAM_FTP_DIR_PATH_LENGTH];
unsigned char aFileName[NVRAM_FTP_FILE_NAME_LENGTH];
} NVRAM_FTP_OTA_SETTING_T;
typedef enum
{
NVRAM_IP_DHCP = 0,
NVRAM_IP_MANUAL
} NVRAM_NET_IP_CONFIG_E;
/* 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 */
/*@}*/