diff options
author | Frank Li <Frank.Li@nxp.com> | 2018-03-19 03:10:44 -0500 |
---|---|---|
committer | Leonard Crestez <leonard.crestez@nxp.com> | 2018-08-24 12:41:33 +0300 |
commit | 3da3fa783c77cbec52fe4c79c5d7a5ed2ec8d046 (patch) | |
tree | a997d06b6e004846ddf5f684f7d75ba57107f689 /drivers/soc | |
parent | 4a11dfc5a9464fefeac9a2104866358a056f9b17 (diff) |
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>
Diffstat (limited to 'drivers/soc')
-rw-r--r-- | drivers/soc/imx/soc-imx8.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/soc/imx/soc-imx8.c b/drivers/soc/imx/soc-imx8.c index 941945e912f0..65b6f67fb84d 100644 --- a/drivers/soc/imx/soc-imx8.c +++ b/drivers/soc/imx/soc-imx8.c @@ -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 = |