コード例 #1
0
int check_fwbl(struct ssp_data *data)
{
	int iRet;
	unsigned int fw_revision;

	fw_revision = get_module_rev(data);
	data->uCurFirmRev = get_firmware_rev(data);

	if ((data->uCurFirmRev == SSP_INVALID_REVISION) \
		|| (data->uCurFirmRev == SSP_INVALID_REVISION2)) {
		iRet = check_bootloader(data, BL_WAITING_BOOTLOAD_CMD);

		if (iRet >= 0)
			pr_info("[SSP] ssp_load_fw_bootmode\n");
		else {
			pr_warn("[SSP] Firm Rev is invalid(%8u). Retry.\n",
				data->uCurFirmRev);
			data->uCurFirmRev = get_firmware_rev(data);
		}
		data->uCurFirmRev = SSP_INVALID_REVISION;
		pr_err("[SSP] SSP_INVALID_REVISION\n");
		return FW_DL_STATE_NEED_TO_SCHEDULE;
	} else {
		if (data->uCurFirmRev != fw_revision) {
			pr_info("[SSP] MCU Firm Rev : Old = %8u, New = %8u\n",
				data->uCurFirmRev, fw_revision);

			return FW_DL_STATE_NEED_TO_SCHEDULE;
		}
		pr_info("[SSP] MCU Firm Rev : Old = %8u, New = %8u\n",
			data->uCurFirmRev, fw_revision);
	}

	return FW_DL_STATE_NONE;
}
コード例 #2
0
void check_fwbl(struct ssp_data *data)
{
	int iRet;

	data->client->addr = BOOTLOADER_SLAVE_ADDR;
	iRet = check_bootloader(data->client, BL_WAITING_BOOTLOAD_CMD);

	if (iRet >= 0) {
		pr_info("[SSP] ssp_load_fw_bootmode\n");
		load_fw_bootmode(data->client, BL_FW_NAME);
		msleep(SSP_SW_RESET_TIME);
	} else {
		data->client->addr = APP_SLAVE_ADDR;
		data->uCurFirmRev = get_firmware_rev(data);
		if (data->uCurFirmRev != SSP_FIRMWARE_REVISION) {
			pr_info("[SSP] MPU Firm Rev. : Old = %8u, New = %8u\n",
				data->uCurFirmRev, SSP_FIRMWARE_REVISION);
			update_mcu_bin(data);
		}
	}

	data->client->addr = APP_SLAVE_ADDR;
	data->uCurFirmRev = get_firmware_rev(data);
	pr_info("[SSP] MPU Firm Rev. : Old = %8u, New = %8u\n",
		data->uCurFirmRev, SSP_FIRMWARE_REVISION);
}
コード例 #3
0
int check_fwbl(struct ssp_data *data)
{

	unsigned int fw_revision;

	pr_info("[SSP] change_rev = %d\n", data->ssp_changes);
#if defined(CONFIG_SEC_KSPORTS_PROJECT)
	fw_revision = SSP_FIRMWARE_REVISION_TASMAN;
#elif defined(CONFIG_SENSORS_SSP_STM_HESTIA)
	fw_revision = SSP_FIRMWARE_REVISION_HESTIA;
#else
	fw_revision = SSP_FIRMWARE_REVISION_STM;
#endif

	data->uCurFirmRev = get_firmware_rev(data);

	if ((data->uCurFirmRev == SSP_INVALID_REVISION)
			|| (data->uCurFirmRev == SSP_INVALID_REVISION2)) {
#if STM_SHOULD_BE_IMPLEMENT
		data->client->addr = BOOTLOADER_SLAVE_ADDR;
		iRet = check_bootloader(data->client, BL_WAITING_BOOTLOAD_CMD);

		if (iRet >= 0)
			pr_info("[SSP] ssp_load_fw_bootmode\n");
		else {
			pr_warn("[SSP] Firm Rev is invalid(%8u). Retry.\n",
					data->uCurFirmRev);
			data->client->addr = APP_SLAVE_ADDR;
			data->uCurFirmRev = get_firmware_rev(data);
			if (data->uCurFirmRev == SSP_INVALID_REVISION
					|| data->uCurFirmRev == ERROR) {
				pr_err("[SSP] MCU is not working, FW download failed\n");
				return FW_DL_STATE_FAIL;
			}
		}
#endif
		data->uCurFirmRev = SSP_INVALID_REVISION;
		pr_err("[SSP] SSP_INVALID_REVISION\n");
		return FW_DL_STATE_NEED_TO_SCHEDULE;
	} else {
		if (data->uCurFirmRev != fw_revision) {
			pr_info("[SSP] MCU Firm Rev : Old = %8u, New = %8u\n",
				data->uCurFirmRev, fw_revision);

			return FW_DL_STATE_NEED_TO_SCHEDULE;
		}
		pr_info("[SSP] MCU Firm Rev : Old = %8u, New = %8u\n",
			data->uCurFirmRev, fw_revision);
	}

	return FW_DL_STATE_NONE;
}
コード例 #4
0
int check_fwbl(struct ssp_data *data)
{
	int iRet;

	data->client->addr = APP_SLAVE_ADDR;
	data->uCurFirmRev = get_firmware_rev(data);

	if (data->uCurFirmRev == SSP_INVALID_REVISION) {
		toggle_mcu_reset(data);
		msleep(SSP_SW_RESET_TIME);

		data->client->addr = BOOTLOADER_SLAVE_ADDR;
		iRet = check_bootloader(data->client, BL_WAITING_BOOTLOAD_CMD);

		if (iRet >= 0) {
			pr_info("[SSP] ssp_load_fw_bootmode\n");

			return FW_DL_STATE_NEED_TO_SCHEDULE;
		} else {
			pr_warn("[SSP] Firm Rev is invalid. Retry.\n");
			data->client->addr = APP_SLAVE_ADDR;
			data->uCurFirmRev = get_firmware_rev(data);

			if (data->uCurFirmRev == SSP_INVALID_REVISION ||\
				data->uCurFirmRev == ERROR) {
				pr_err("[SSP] MCU is not working\n");
				return FW_DL_STATE_FAIL;
			} else if (data->uCurFirmRev != SSP_FIRMWARE_REVISION) {
				pr_info("[SSP] MCU Firm Rev : Old = %8u, New = "
					"%8u\n", data->uCurFirmRev,
					SSP_FIRMWARE_REVISION);
				return FW_DL_STATE_NEED_TO_SCHEDULE;
			}
			pr_info("[SSP] MCU Firm Rev : Old = %8u, New = %8u\n",
				data->uCurFirmRev, SSP_FIRMWARE_REVISION);
		}
	} else {
		if (data->uCurFirmRev != SSP_FIRMWARE_REVISION) {
			pr_info("[SSP] MCU Firm Rev : Old = %8u, New = %8u\n",
				data->uCurFirmRev, SSP_FIRMWARE_REVISION);

			return FW_DL_STATE_NEED_TO_SCHEDULE;
		}
		pr_info("[SSP] MCU Firm Rev : Old = %8u, New = %8u\n",
			data->uCurFirmRev, SSP_FIRMWARE_REVISION);
	}

	return FW_DL_STATE_NONE;
}
コード例 #5
0
ファイル: ssp_dev.c プロジェクト: sdemills/SM-V700
static void work_function_firmware_update(struct work_struct *work)
{
	struct ssp_data *data = container_of((struct delayed_work *)work,
						struct ssp_data, work_firmware);
	int iRet = 0;

	pr_info("[SSP] : %s start\n", __func__);

	iRet = forced_to_download_binary(data, KERNEL_BINARY);
	if (iRet < 0) {
		ssp_dbg("[SSP]: %s - forced_to_download_binary failed!\n",
			__func__);
		return;
	}

	data->uCurFirmRev = get_firmware_rev(data);
	pr_info("[SSP] MCU Firm Rev : New = %8u\n", data->uCurFirmRev);

	if (data->check_lpmode() == true) {
		data->bLpModeEnabled = true;
		pr_info("[SSP]: LPM Charging...\n");
	} else {
		data->bLpModeEnabled = false;
		pr_info("[SSP]: Normal Booting OK\n");
	}

	pr_info("[SSP] : %s done\n!", __func__);
}
コード例 #6
0
int check_fwbl(struct ssp_data *data)
{
	int iRet;
	unsigned int fw_revision;

	pr_info("[SSP] change_rev = %d\n", data->ssp_changes);

	if (data->ssp_changes == SSP_MCU_L0)
		fw_revision = SSP_FIRMWARE_REVISION;
	else
		fw_revision = SSP_FIRMWARE_REVISION_03;

	data->client->addr = APP_SLAVE_ADDR;
	data->uCurFirmRev = check_firmware_rev(data);

	if (data->uCurFirmRev == SSP_INVALID_REVISION) {
		toggle_mcu_reset(data);
		msleep(SSP_SW_RESET_TIME);
	}

	if ((data->uCurFirmRev == SSP_INVALID_REVISION) \
		|| (data->uCurFirmRev == SSP_INVALID_REVISION2)) {
		data->client->addr = BOOTLOADER_SLAVE_ADDR;
		iRet = check_bootloader(data->client, BL_WAITING_BOOTLOAD_CMD);

		if (iRet >= 0) {
			pr_info("[SSP] ssp_load_fw_bootmode\n");

			return FW_DL_STATE_NEED_TO_SCHEDULE;
		} else {
			pr_warn("[SSP] Firm Rev is invalid(%8u). Retry.\n",
				data->uCurFirmRev);
			data->client->addr = APP_SLAVE_ADDR;
			data->uCurFirmRev = get_firmware_rev(data);
			if (data->uCurFirmRev == SSP_INVALID_REVISION ||\
				data->uCurFirmRev == ERROR) {
				pr_err("[SSP] MCU is not working, FW download failed\n");
				return FW_DL_STATE_FAIL;
			} else if (data->uCurFirmRev != fw_revision) {
				pr_info("[SSP] MCU Firm Rev : Old = %8u, New = %8u\n",
					data->uCurFirmRev, fw_revision);

				return FW_DL_STATE_NEED_TO_SCHEDULE;
			}
			pr_info("[SSP] MCU Firm Rev : Old = %8u, New = %8u\n",
				data->uCurFirmRev, fw_revision);
		}
	} else {
		if (data->uCurFirmRev != fw_revision) {
			pr_info("[SSP] MCU Firm Rev : Old = %8u, New = %8u\n",
				data->uCurFirmRev, fw_revision);

			return FW_DL_STATE_NEED_TO_SCHEDULE;
		}
		pr_info("[SSP] MCU Firm Rev : Old = %8u, New = %8u\n",
			data->uCurFirmRev, fw_revision);
	}

	return FW_DL_STATE_NONE;
}
コード例 #7
0
int check_fwbl(struct ssp_data *data)
{

	unsigned int fw_revision;

	fw_revision = SSP_FIRMWARE_REVISION_STM;

	data->uCurFirmRev = get_firmware_rev(data);

	if ((data->uCurFirmRev == SSP_INVALID_REVISION)
			|| (data->uCurFirmRev == SSP_INVALID_REVISION2)) {
		data->uCurFirmRev = SSP_INVALID_REVISION;
		ssp_err("SSP_INVALID_REVISION");
		return FW_DL_STATE_NEED_TO_SCHEDULE;
	} else {
		if (data->uCurFirmRev != fw_revision) {
			ssp_info("MCU Firm Rev : Old = %8u, New = %8u",
				data->uCurFirmRev, fw_revision);

			return FW_DL_STATE_NEED_TO_SCHEDULE;
		}
		ssp_info("MCU Firm Rev : Old = %8u, New = %8u",
			data->uCurFirmRev, fw_revision);
	}

	return FW_DL_STATE_NONE;
}
コード例 #8
0
ファイル: ssp_dev.c プロジェクト: bigzz/Galaxy_S6_920F_Kernel
int initialize_mcu(struct ssp_data *data)
{
	int iRet = 0;

	clean_pending_list(data);

	iRet = get_chipid(data);
	pr_info("[SSP] MCU device ID = %d, reading ID = %d\n", DEVICE_ID, iRet);
	if (iRet != DEVICE_ID) {
		if (iRet < 0) {
			pr_err("[SSP]: %s - MCU is not working : 0x%x\n",
				__func__, iRet);
		} else {
			pr_err("[SSP]: %s - MCU identification failed\n",
				__func__);
			iRet = -ENODEV;
		}
		goto out;
	}

	iRet = set_sensor_position(data);
	if (iRet < 0) {
		pr_err("[SSP]: %s - set_sensor_position failed\n", __func__);
		goto out;
	}
	    
#ifdef CONFIG_SENSORS_MULTIPLE_GLASS_TYPE
    	iRet = set_glass_type(data);
	if (iRet < 0) {
		pr_err("[SSP]: %s - set_sensor_position failed\n", __func__);
		goto out;
	}
#endif

	data->uSensorState = get_sensor_scanning_info(data);
	if (data->uSensorState == 0) {
		pr_err("[SSP]: %s - get_sensor_scanning_info failed\n",
			__func__);
		iRet = ERROR;
		goto out;
	}

	iRet = initialize_magnetic_sensor(data);
	if (iRet < 0)
		pr_err("[SSP]: %s - initialize magnetic sensor failed\n",
			__func__);

	data->uCurFirmRev = get_firmware_rev(data);
	pr_info("[SSP] MCU Firm Rev : New = %8u\n",
		data->uCurFirmRev);

// hoi: il dan mak a
#ifndef CONFIG_SENSORS_SSP_BBD
	iRet = ssp_send_cmd(data, MSG2SSP_AP_MCU_DUMP_CHECK, 0);
#endif
out:
	return iRet;
}
コード例 #9
0
int check_fwbl(struct ssp_data *data)
{
	int iRet;
	unsigned int fw_revision;

#if defined(CONFIG_SENSORS_MPU6500_BMI058_DUAL)
	if (data->ap_rev < MPU6500_REV)
		fw_revision = SSP_BMI_FIRMWARE_REVISION;
	else
		fw_revision = SSP_FIRMWARE_REVISION;
#else
	fw_revision = SSP_FIRMWARE_REVISION;
#endif
	data->uCurFirmRev = get_firmware_rev(data);

	if ((data->uCurFirmRev == SSP_INVALID_REVISION) \
		|| (data->uCurFirmRev == SSP_INVALID_REVISION2)) {
		iRet = check_bootloader(data, BL_WAITING_BOOTLOAD_CMD);

		if (iRet >= 0)
			pr_info("[SSP] ssp_load_fw_bootmode\n");
		else {
			pr_warn("[SSP] Firm Rev is invalid(%8u). Retry.\n",
				data->uCurFirmRev);
			data->uCurFirmRev = get_firmware_rev(data);
		}
		data->uCurFirmRev = SSP_INVALID_REVISION;
		pr_err("[SSP] SSP_INVALID_REVISION\n");
		return FW_DL_STATE_NEED_TO_SCHEDULE;
	} else {
		if (data->uCurFirmRev != fw_revision) {
			pr_info("[SSP] MCU Firm Rev : Old = %8u, New = %8u\n",
				data->uCurFirmRev, fw_revision);

			return FW_DL_STATE_NEED_TO_SCHEDULE;
		}
		pr_info("[SSP] MCU Firm Rev : Old = %8u, New = %8u\n",
			data->uCurFirmRev, fw_revision);
	}

	return FW_DL_STATE_NONE;
}
コード例 #10
0
ファイル: ssp_dev.c プロジェクト: ShedrockN4/wiliteneo
int initialize_mcu(struct ssp_data *data)
{
	int iRet = 0;

	clean_pending_list(data);

	iRet = get_chipid(data);
	ssp_info("MCU device ID = %d, reading ID = %d", DEVICE_ID, iRet);
	if (iRet != DEVICE_ID) {
		if (iRet < 0) {
			ssp_errf("MCU is not working : 0x%x", iRet);
		} else {
			ssp_errf("MCU identification failed");
			iRet = -ENODEV;
		}
		goto out;
	}

	iRet = set_sensor_position(data);
	if (iRet < 0) {
		ssp_errf("set_sensor_position failed");
		goto out;
	}

#ifdef CONFIG_SENSORS_MULTIPLE_GLASS_TYPE
    	iRet = set_glass_type(data);
	if (iRet < 0) {
		pr_err("[SSP]: %s - set_sensor_position failed\n", __func__);
		goto out;
	}
#endif

	data->uSensorState = get_sensor_scanning_info(data);
	if (data->uSensorState == 0) {
		ssp_errf("get_sensor_scanning_info failed");
		iRet = ERROR;
		goto out;
	}

	iRet = initialize_magnetic_sensor(data);
	if (iRet < 0)
		ssp_errf("initialize magnetic sensor failed");

	data->uCurFirmRev = get_firmware_rev(data);
	ssp_info("MCU Firm Rev : New = %8u", data->uCurFirmRev);

out:
	return iRet;
}
コード例 #11
0
int initialize_mcu(struct ssp_data *data)
{
	int iRet = 0;

	clean_pending_list(data);

	iRet = get_chipid(data);
	pr_info("[SSP] MCU device ID = %d, reading ID = %d\n", DEVICE_ID, iRet);
	if (iRet != DEVICE_ID) {
		if (iRet < 0) {
			pr_err("[SSP]: %s - MCU is not working : 0x%x\n",
				__func__, iRet);
		} else {
			pr_err("[SSP]: %s - MCU identification failed\n",
				__func__);
			iRet = -ENODEV;
		}
		goto out;
	}

	iRet = set_sensor_position(data);
	if (iRet < 0) {
		pr_err("[SSP]: %s - set_sensor_position failed\n", __func__);
		goto out;
	}

	iRet = get_fuserom_data(data);
	if (iRet < 0)
		pr_err("[SSP]: %s - get_fuserom_data failed\n", __func__);

	data->uSensorState = get_sensor_scanning_info(data);
	if (data->uSensorState == 0) {
		pr_err("[SSP]: %s - get_sensor_scanning_info failed\n",
			__func__);
		iRet = ERROR;
		goto out;
	}

	data->uCurFirmRev = get_firmware_rev(data);
	pr_info("[SSP] MCU Firm Rev : New = %8u\n",
		data->uCurFirmRev);

	iRet = ssp_send_cmd(data, MSG2SSP_AP_MCU_DUMP_CHECK, 0);
out:
	return iRet;
}
コード例 #12
0
ファイル: ssp_dev.c プロジェクト: LuckJC/Adam-Kernel-GS3
static void work_function_firmware_update(struct work_struct *work)
{
	struct ssp_data *data = container_of((struct delayed_work *)work,
	struct ssp_data, work_firmware);
	int iRet = 0;

	pr_info("[SSP] : %s\n", __func__);

	iRet = forced_to_download_binary(data, KERNEL_BINARY);
	if (iRet < 0) {
		ssp_dbg("[SSP]: %s - forced_to_download_binary failed!\n",
			__func__);
		return;
	}

	data->uCurFirmRev = get_firmware_rev(data);
	pr_info("[SSP] MCU Firm Rev : New = %8u\n", data->uCurFirmRev);
}
コード例 #13
0
ファイル: ssp_firmware.c プロジェクト: vikrant82/t320_kernel
int check_fwbl(struct ssp_data *data)
{

	unsigned int fw_revision;

	pr_info("[SSP] change_rev = %d\n", data->ssp_changes);
#if defined (CONFIG_MACH_VIKALCU)
	fw_revision = SSP_FIRMWARE_REVISION_STM;
#elif defined (CONFIG_MACH_HLTEVZW) || defined (CONFIG_MACH_HLTESPR) \
	|| defined (CONFIG_MACH_HLTEUSC)
		if (data->ap_rev > 3)
			fw_revision = SSP_FIRMWARE_REVISION_STM;
		else if (data->ap_rev > 2)
			fw_revision = SSP_FIRMWARE_REVISION_STM_88921;
		else
			fw_revision = SSP_FIRMWARE_REVISION_STM_RVS;
#else
	if (data->ap_rev > 3)
		fw_revision = SSP_FIRMWARE_REVISION_STM;
	else
		fw_revision = SSP_FIRMWARE_REVISION_STM_88921;
#endif

	data->uCurFirmRev = get_firmware_rev(data);

	if ((data->uCurFirmRev == SSP_INVALID_REVISION) \
		|| (data->uCurFirmRev == SSP_INVALID_REVISION2)) {
#if STM_SHOULD_BE_IMPLEMENT
		data->client->addr = BOOTLOADER_SLAVE_ADDR;
		iRet = check_bootloader(data->client, BL_WAITING_BOOTLOAD_CMD);

		if (iRet >= 0) {
			pr_info("[SSP] ssp_load_fw_bootmode\n");

			return FW_DL_STATE_NEED_TO_SCHEDULE;
		} else {
			pr_warn("[SSP] Firm Rev is invalid(%8u). Retry.\n",
				data->uCurFirmRev);
			data->client->addr = APP_SLAVE_ADDR;
			data->uCurFirmRev = get_firmware_rev(data);
			if (data->uCurFirmRev == SSP_INVALID_REVISION ||\
				data->uCurFirmRev == ERROR) {
				pr_err("[SSP] MCU is not working, FW download failed\n");
				return FW_DL_STATE_FAIL;
			} else if (data->uCurFirmRev != fw_revision) {
				pr_info("[SSP] MCU Firm Rev : Old = %8u, New = %8u\n",
					data->uCurFirmRev, fw_revision);

				return FW_DL_STATE_NEED_TO_SCHEDULE;
			}
			pr_info("[SSP] MCU Firm Rev : Old = %8u, New = %8u\n",
				data->uCurFirmRev, fw_revision);
		}
#endif
		pr_err("[SSP] SSP_INVALID_REVISION\n");
		return FW_DL_STATE_NEED_TO_SCHEDULE;
	} else {
		if (data->uCurFirmRev != fw_revision) {
			pr_info("[SSP] MCU Firm Rev : Old = %8u, New = %8u\n",
				data->uCurFirmRev, fw_revision);

			return FW_DL_STATE_NEED_TO_SCHEDULE;
		}
		pr_info("[SSP] MCU Firm Rev : Old = %8u, New = %8u\n",
			data->uCurFirmRev, fw_revision);
	}

	return FW_DL_STATE_NONE;
}