Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c2ced4e4 authored by yushixian's avatar yushixian Committed by Daniel Jacob Chittoor
Browse files

[JIRA:FP4-358] [FP4]:add mcf read interface in TP driver

 &&&%%%comment:[FP4]:add mcf read interface in TP driver
 &&&%%%bug number:fp4-358
 &&&%%%product name:sm7225_r_fp4
 &&&%%%root cause:Coding
 &&&%%%Bug category:T2M
 &&&%%%Module_Impact:kernel
 &&&%%%Test_Suggestion:NA
 &&&%%%Solution:add mcf read interface
 &&&%%%Test_Report:test is ok
 &&&%%%VAL Can Test:yes

Change-Id: I0d3990ac3909cb96df65ea39575999cda1c66e8a
parent 5e580c09
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -169,6 +169,7 @@ extern void (*himax_mcu_cmd_struct_free)(void);


#if defined(HX_TP_PROC_GUEST_INFO)
#if defined(HX_TP_PROC_GUEST_INFO)
#define HX_GUEST_INFO_FLASH_SADDR 0x20000
#define HX_GUEST_INFO_FLASH_SADDR 0x20000
#define HX_GUEST_INFO_MCF_SADDR 0x23000
#define HX_GUEST_INFO_SIZE	10
#define HX_GUEST_INFO_SIZE	10
#define HX_GUEST_INFO_LEN_SIZE	4
#define HX_GUEST_INFO_LEN_SIZE	4
#define HX_GUEST_INFO_ID_SIZE	4
#define HX_GUEST_INFO_ID_SIZE	4
@@ -967,6 +968,7 @@ struct himax_core_fp {
#if defined(HX_TP_PROC_GUEST_INFO)
#if defined(HX_TP_PROC_GUEST_INFO)
	int (*guest_info_get_status)(void);
	int (*guest_info_get_status)(void);
	int (*read_guest_info)(void);
	int (*read_guest_info)(void);
	int (*read_mcf_data)(void);
#endif
#endif
/* CORE_DRIVER */
/* CORE_DRIVER */
#if defined(HX_ZERO_FLASH)
#if defined(HX_ZERO_FLASH)
+29 −3
Original line number Original line Diff line number Diff line
@@ -52,6 +52,8 @@ static uint8_t *g_internal_buffer;
uint32_t dbg_reg_ary[4] = {fw_addr_fw_dbg_msg_addr, fw_addr_chk_fw_status,
uint32_t dbg_reg_ary[4] = {fw_addr_fw_dbg_msg_addr, fw_addr_chk_fw_status,
	fw_addr_chk_dd_status, fw_addr_flag_reset_event};
	fw_addr_chk_dd_status, fw_addr_flag_reset_event};


u8 panel_mcf_data[512] = {0};
static int hx_read_mcf_data(void);
/* CORE_IC */
/* CORE_IC */
/* IC side start*/
/* IC side start*/
static void himax_mcu_burst_enable(uint8_t auto_add_4_byte)
static void himax_mcu_burst_enable(uint8_t auto_add_4_byte)
@@ -2880,10 +2882,10 @@ static int himax_guest_info_read(uint32_t start_addr,
		tmp_addr[0], tmp_addr[1],
		tmp_addr[0], tmp_addr[1],
		tmp_addr[2], tmp_addr[3]);
		tmp_addr[2], tmp_addr[3]);


	result = g_core_fp.fp_check_CRC(tmp_addr, flash_page_len);
	/*result = g_core_fp.fp_check_CRC(tmp_addr, flash_page_len);
	I("Checksum = 0x%8X\n", result);
	I("Checksum = 0x%8X\n", result);
	if (result != 0)
	if (result != 0)
		goto END_FUNC;
		goto END_FUNC;*/


	for (temp_addr = start_addr;
	for (temp_addr = start_addr;
	temp_addr < (start_addr + flash_page_len);
	temp_addr < (start_addr + flash_page_len);
@@ -2905,10 +2907,33 @@ static int himax_guest_info_read(uint32_t start_addr,
		 */
		 */
	}
	}


END_FUNC:
//END_FUNC:
	return result;
	return result;
}
}


static int hx_read_mcf_data(void)
{
	uint32_t mcf_data_addr = HX_GUEST_INFO_MCF_SADDR;
	int rc = 0;
	uint32_t mcf_page_len = 0x200;
	//unsigned int mcf_data_temp = 0;
	uint8_t *mcf_tmp_buffer = NULL;

	himax_guest_info_set_status(1);

	mcf_tmp_buffer = kcalloc(HX_GUEST_INFO_SIZE * mcf_page_len,
		sizeof(uint8_t), GFP_KERNEL);


	rc = himax_guest_info_read(mcf_data_addr,&mcf_tmp_buffer[0]);
	memcpy(panel_mcf_data, mcf_tmp_buffer, 512);

	kfree(mcf_tmp_buffer);
	himax_guest_info_set_status(0);

	return 0;
}

static int hx_read_guest_info(void)
static int hx_read_guest_info(void)
{
{
	/* uint8_t tmp_addr[4]; */
	/* uint8_t tmp_addr[4]; */
@@ -4220,6 +4245,7 @@ static void himax_mcu_fp_init(void)
	g_core_fp.guest_info_get_status = himax_guest_info_get_status;
	g_core_fp.guest_info_get_status = himax_guest_info_get_status;
	g_core_fp.read_guest_info = hx_read_guest_info;
	g_core_fp.read_guest_info = hx_read_guest_info;
#endif
#endif
	g_core_fp.read_mcf_data = hx_read_mcf_data;
/* CORE_DRIVER */
/* CORE_DRIVER */
#if defined(HX_ZERO_FLASH)
#if defined(HX_ZERO_FLASH)
	g_core_fp.fp_reload_disable = hx_dis_rload_0f;
	g_core_fp.fp_reload_disable = hx_dis_rload_0f;
+2 −0
Original line number Original line Diff line number Diff line
@@ -1124,6 +1124,8 @@ int himax_chip_common_probe(struct i2c_client *client,
		goto err_common_init_failed;
		goto err_common_init_failed;
	}
	}


	g_core_fp.read_mcf_data();

	return ret;
	return ret;


err_common_init_failed:
err_common_init_failed: