From 231ed29fcb1a8a748a0954c52bff5164db8e04d1 Mon Sep 17 00:00:00 2001 From: "Martin T. H. Sandsmark" Date: Fri, 2 Dec 2016 11:18:33 +0100 Subject: [PATCH] Enable reading of serial tag from OCOTP --- arch/arm/cpu/armv7/mx6/soc.c | 13 +++++++++++++ include/configs/zero-gravitas.h | 6 +++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c index d4b22ad7f3..a78a69aaaa 100644 --- a/arch/arm/cpu/armv7/mx6/soc.c +++ b/arch/arm/cpu/armv7/mx6/soc.c @@ -436,6 +436,19 @@ int board_postclk_init(void) return 0; } +#ifdef CONFIG_SERIAL_TAG +void get_board_serial(struct tag_serialnr *serialnr) +{ + 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 + #if defined(CONFIG_FEC_MXC) void imx_get_mac_from_fuse(int dev_id, unsigned char *mac) { diff --git a/include/configs/zero-gravitas.h b/include/configs/zero-gravitas.h index 2cf9a27bbd..4b90260728 100644 --- a/include/configs/zero-gravitas.h +++ b/include/configs/zero-gravitas.h @@ -1,7 +1,8 @@ /* * Copyright 2013 Freescale Semiconductor, Inc. + * Copyright 2016 reMarkable AS * - * Configuration settings for the Freescale i.MX6SL EVK board. + * Configuration settings for the reMarkable * * SPDX-License-Identifier: GPL-2.0+ */ @@ -28,6 +29,9 @@ /* MMC Configs */ #define CONFIG_SYS_FSL_ESDHC_ADDR USDHC2_BASE_ADDR +/* Enable reading of serial tag from OCOTP */ +#define CONFIG_SERIAL_TAG + /* I2C Configs */ #define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_MXC