mmi_info : add chipid info into bootinfo

Save chipid info into /proc/bootinfo
so that the phone's signed APDP can be produced accroding the known chipid info,
then request the phone to flash APDP directly.

Change-Id: Idfbdc8283708a6e45fb73b64021df977ec68da4b
Signed-off-by: zhongcai ma <mazc5@motorola.com>
Reviewed-on: https://gerrit.mot.com/2417057
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Zhenxin Xi <xizx@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
zhongcai ma 2022-10-31 16:14:57 +08:00 • committed by Zhongcai Ma
commit dd7b2010da
3 changed files with 15 additions and 0 deletions

View file

@ -240,6 +240,15 @@ static u64 bi_serial(void)
#define EMIT_SERIAL() \
EMIT_BOOTINFO("SERIAL", "0x%llx", serial)
const char *bi_chipid(void)
{
return mmi_chosen_data.chipid;
}
EXPORT_SYMBOL(bi_chipid);
#define EMIT_CHIPID() \
EMIT_BOOTINFO("CHIPID", "%s", chipid)
const char *bi_bootreason(void)
{
return bootreason;
@ -266,6 +275,7 @@ static int get_bootinfo(struct seq_file *m, void *v)
EMIT_MBM_VERSION();
EMIT_BL_BUILD_SIG();
EMIT_BOOT_SEQ();
EMIT_CHIPID();
EMIT_BOOTINFO("Last boot reason", "%s", bootreason);
return 0;
@ -318,6 +328,7 @@ int mmi_boot_info_init(void)
mmi_annotate_persist("SERIAL: 0x%llx\n", bi_serial());
mmi_annotate_persist("HW_REV: 0x%04x\n", bi_hwrev());
mmi_annotate_persist("BOOT_SEQ: %d\n", bi_boot_seq());
mmi_annotate_persist("CHIPID: %s\n", bi_chipid());
mmi_annotate("POWERUPREASON: 0x%08x\n", bi_powerup_reason());
mmi_annotate("Last boot reason: %s\n\n", bi_bootreason());

View file

@ -43,6 +43,7 @@ struct mmi_storage_info {
#define MSMHW_MAX_LEN 32
#define DEVICE_MAX_LEN 33
#define RADIO_MAX_LEN 33
#define CHIPID_MAX_LEN 32
struct mmi_unit_info {
uint32_t version;
uint32_t system_rev;
@ -69,6 +70,7 @@ struct mmi_chosen_info {
unsigned int boot_seq;
char baseband[BASEBAND_MAX_LEN];
char msm_hw[MSMHW_MAX_LEN];
char chipid[CHIPID_MAX_LEN];
};
extern struct mmi_chosen_info mmi_chosen_data;

View file

@ -207,6 +207,8 @@ static void mmi_of_populate_setup(void)
strlcpy(mmi_chosen_data.baseband, temp, BASEBAND_MAX_LEN);
if (of_property_read_string(n, "mmi,msm_hw", &temp) == 0)
strlcpy(mmi_chosen_data.msm_hw, temp, MSMHW_MAX_LEN);
if (of_property_read_string(n, "mmi,chipid", &temp) == 0)
strlcpy(mmi_chosen_data.chipid, temp, CHIPID_MAX_LEN);
of_node_put(n);
}