/* 2012-09-16: File added by Sony Corporation */
/*
 * icx_nvp.h
 *
 * Copyright 2011 Sony Corporation.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 */

#ifndef __ICX_NVP_H__
#define __ICX_NVP_H__

/************/
/* NVP area */
/************/

enum {
	NVP_ID_UBOOT_PARAM = 0,
	NVP_ID_BOOT_IMAGE,
	NVP_ID_HOLD_IMAGE,
	NVP_ID_LOWBATT_IMAGE,
	NVP_ID_NUM
};


/********************/
/* U-Boot Parameter */
/********************/

/* system info */
#define NVP_SYSINFO_INVALID  	0xFFFFFFFF

/* memory size */
#define NVP_SYSINFO_MEM_MSK		0x00000018
#define NVP_SYSINFO_MEM_064M	0x00000000
#define NVP_SYSINFO_MEM_128M	0x00000008

/* LCD device */
#define	NVP_SYSINFO_LCD_MSK		0x00003800
#define NVP_SYSIMFO_LCD_CR		0x00000000
#define NVP_SYSIMFO_LCD_BR		0x00000800

/* DAC device */
#define	NVP_SYSINFO_DAC_MSK		0x00180000
#define NVP_SYSINFO_DAC_TBS		0x00000000

/* hold mode */
#define NVP_HOLD_MODE_ALL		0x00000001
#define NVP_HOLD_MODE_TP		0x00000000


/*************/
/* misc flag */
/*************/
#define MISC_FLAG_BRD_TYPE		0x00000001
#define MISC_FLAG_BRD_TYPE_BB	0x00000000
#define MISC_FLAG_BRD_TYPE_SET	0x00000001


/**************/
/* prototypes */
/**************/
void         nvp_init(void);
unsigned int nvp_get_sysinfo(void);
unsigned int nvp_get_sysinfo_mem(void);
unsigned int nvp_get_sysinfo_lcd(void);
unsigned int nvp_get_sysinfo_dac(void);
void		 nvp_get_alarm_date(int *year, int *mdmh);
void		 nvp_get_image_data(int id, char *buf, int size);
void         nvp_get_pwd(char *pwd_buf, int size);
int			 nvp_check_fw_update(void);
int			 nvp_check_hold_mode(void);
int			 nvp_check_beep_flag(void);
void		 nvp_save_sysinfo(void);
void         nvp_save_misc_flag(unsigned int target, unsigned int value);


#endif /* __ICX_NVP_H__ */
