1
0
Fork 0

arm64: qxp: support read chip unique id

call scfw api get chip unique id

cat /sys/devices/soc0/soc_uid
A264080B57AC1898

Signed-off-by: Frank Li <Frank.Li@nxp.com>
pull/10/head
Frank Li 2018-03-19 03:10:44 -05:00 committed by Jason Liu
parent 34d67423e4
commit 25573e1de5
1 changed files with 8 additions and 1 deletions

View File

@ -103,6 +103,7 @@ static u32 imx_init_revision_from_scu(void)
sc_err_t sc_err = SC_ERR_NONE;
sc_ipc_t ipc_handle;
u32 id, rev;
u32 uid_l = 0, uid_h = 0;
sc_err = sc_ipc_getMuID(&mu_id);
if (sc_err != SC_ERR_NONE) {
@ -132,6 +133,12 @@ static u32 imx_init_revision_from_scu(void)
imx8_set_soc_id(id);
imx8_set_soc_revision(rev);
sc_misc_unique_id(ipc_handle, &uid_l, &uid_h);
imx8_soc_uid = uid_h;
imx8_soc_uid <<= 32;
imx8_soc_uid |= uid_l;
return rev;
}
@ -251,7 +258,7 @@ static ssize_t imx8_get_soc_uid(struct device *dev,
struct device_attribute *attr,
char *buf)
{
return sprintf(buf, "%016llx\n", imx8_soc_uid);
return sprintf(buf, "%016llX\n", imx8_soc_uid);
}
static struct device_attribute imx8_uid =