diff options
author | Zhang Bo <bo.zhang@nxp.com> | 2017-08-30 17:51:36 +0800 |
---|---|---|
committer | Zhang Bo <bo.zhang@nxp.com> | 2017-08-30 18:06:43 +0800 |
commit | 651da95b3dab3cccb81d2905552b837f157b941e (patch) | |
tree | 382421edef945edeb93e7603ee642d54b766d50d | |
parent | 2282451d00b19375550374ef4998b89cda57ca7a (diff) |
MA-10118[Android EVK-8MQ] realize the get_board_serial function which read unique id from ocopt
Read the unique id directly from the ocopt register.
Change-Id: I6cfb246153812709ea98edd5b9a85aff4714a329
Signed-off-by: Zhang Bo <bo.zhang@nxp.com>
-rw-r--r-- | arch/arm/cpu/armv8/imx8m/soc.c | 10 | ||||
-rw-r--r-- | arch/arm/include/asm/arch-imx8m/imx-regs.h | 7 |
2 files changed, 14 insertions, 3 deletions
diff --git a/arch/arm/cpu/armv8/imx8m/soc.c b/arch/arm/cpu/armv8/imx8m/soc.c index 4bd8ec6386..3830e12876 100644 --- a/arch/arm/cpu/armv8/imx8m/soc.c +++ b/arch/arm/cpu/armv8/imx8m/soc.c @@ -361,9 +361,13 @@ int mmc_get_env_dev(void) #ifdef CONFIG_SERIAL_TAG void get_board_serial(struct tag_serialnr *serialnr) { - /* TODO: */ - serialnr->low = 0; - serialnr->high = 0; + struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR; + struct fuse_bank *bank = &ocotp->bank[0]; + struct fuse_bank0_regs *fuse = + (struct fuse_bank0_regs *)bank->fuse_regs; + + serialnr->low = fuse->uid_low; + serialnr->high = fuse->uid_high; } #endif diff --git a/arch/arm/include/asm/arch-imx8m/imx-regs.h b/arch/arm/include/asm/arch-imx8m/imx-regs.h index 6de9941f96..55feaf0ac4 100644 --- a/arch/arm/include/asm/arch-imx8m/imx-regs.h +++ b/arch/arm/include/asm/arch-imx8m/imx-regs.h @@ -192,6 +192,13 @@ struct ocotp_regs { } bank[0]; }; +struct fuse_bank0_regs { + u32 lock; + u32 uid_low; + u32 uid_high; + u32 rsvd; +}; + struct fuse_bank1_regs { u32 tester3; u32 rsvd0[3]; |