muc_uart: add muc fw to boot mode

Add the muc fw version to the boot mode parameters.
Version is passed in as module parameter.

Change-Id: I4c040ba22c756e67ab174a909f9b86e523d332a9
Signed-off-by: Ryan Lattrel <ryanl@motorola.com>
Reviewed-on: https://gerrit.mot.com/1254562
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Kenneth Kessler <kennykessler@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
Ryan Lattrel 2018-10-11 16:11:50 -05:00
commit b7e0a5bea3
2 changed files with 20 additions and 0 deletions

View file

@ -42,6 +42,7 @@ struct boot_mode_t {
uint32_t hwid; /* androidboot.hwrev */
uint8_t ap_guid[16]; /* ro.mot.build.guid */
uint8_t ap_fw_ver_str[256]; /* ro.build.fingerprint */
uint32_t muc_fw_vers; /* ro.mot.build.version.mod.nuttx */
} __packed;
enum { VBUS_IN = 0, VBUS_IN_SPLIT, VBUS_OUT, DC_IN };

View file

@ -155,6 +155,10 @@ static char *param_vers = "";
module_param(param_vers, charp, S_IRUSR);
MODULE_PARM_DESC(param_vers, "ro.build.fingerprint");
static char *param_mucfw = "";
module_param(param_mucfw, charp, S_IRUSR);
MODULE_PARM_DESC(param_mucfw, "ro.mot.build.version.mod.nuttx");
#if MUC_UART_SEND_SLEEP_ON_IDLE
static inline void reset_idle_timer(struct mod_muc_data_t *mm_data)
{
@ -545,6 +549,8 @@ destroy_msg:
static int muc_uart_send_bootmode(struct mod_muc_data_t *mm_data)
{
struct boot_mode_t bootmode;
uint32_t mucfw_major;
uint32_t mucfw_minor;
memset(&bootmode, 0x00, sizeof(struct boot_mode_t));
@ -557,6 +563,16 @@ static int muc_uart_send_bootmode(struct mod_muc_data_t *mm_data)
param_vers,
sizeof(bootmode.ap_fw_ver_str));
/* Format mucfw vers from "MAJOR.MINOR_DESCRIPTION"
* to uint32_t in format MAJOR<<16|MINOR
*/
if (sscanf(param_mucfw, "%d.%d%*s", &mucfw_major, &mucfw_minor) != 2) {
mucfw_major = 0;
mucfw_minor = 0;
}
bootmode.muc_fw_vers = (mucfw_major << 16) | mucfw_minor;
if (strncmp(bi_bootmode(), "mot-factory", strlen("mot-factory")) == 0) {
bootmode.boot_mode = FACTORY;
} else if (strncmp(bi_bootmode(), "qcom", strlen("qcom")) == 0) {
@ -576,6 +592,8 @@ static int muc_uart_send_bootmode(struct mod_muc_data_t *mm_data)
sizeof(bootmode.ap_guid), bootmode.ap_guid);
MUC_DBG("(%zd) sending AP vers %s\n",
sizeof(bootmode.ap_fw_ver_str), bootmode.ap_fw_ver_str);
MUC_DBG("sending MUC fw vers 0x%08x\n",
bootmode.muc_fw_vers);
return muc_uart_queue_send(mm_data,
BOOT_MODE,
@ -1480,6 +1498,7 @@ int muc_uart_init(void)
{
MUC_LOG("guid: %s\n", param_guid);
MUC_LOG("vers: %s\n", param_vers);
MUC_LOG("mucfw: %s\n", param_mucfw);
return platform_driver_register(&muc_uart_driver);
}