summaryrefslogtreecommitdiff
path: root/cpu
diff options
context:
space:
mode:
authorNitin Garg <nitin.garg@freescale.com>2012-12-21 12:33:49 -0600
committerNitin Garg <nitin.garg@freescale.com>2012-12-21 12:33:49 -0600
commitb07b53788a970985363f6daee88e0ead9aff05b7 (patch)
treedf5095a2bc1342d4d933a9f1685fe7d6fc3f3ed9 /cpu
parent896d566f53e7bbe6d108ba0ded08b9087b9711a9 (diff)
downloadu-boot-imx-b07b53788a970985363f6daee88e0ead9aff05b7.zip
u-boot-imx-b07b53788a970985363f6daee88e0ead9aff05b7.tar.gz
u-boot-imx-b07b53788a970985363f6daee88e0ead9aff05b7.tar.bz2
ENGR00238048: Add support for processor serial ATAG in uboot for iMX53
Add support for Processor UID ATAG in uboot for iMX53. The UID is present in Fuses bank 0 at offset 0x20. Signed-off-by: Nitin Garg <nitin.garg@freescale.com>
Diffstat (limited to 'cpu')
-rw-r--r--cpu/arm_cortexa8/mx53/generic.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/cpu/arm_cortexa8/mx53/generic.c b/cpu/arm_cortexa8/mx53/generic.c
index 83dbd4b..ca7e0be 100644
--- a/cpu/arm_cortexa8/mx53/generic.c
+++ b/cpu/arm_cortexa8/mx53/generic.c
@@ -22,6 +22,8 @@
#include <common.h>
#include <asm/arch/mx53.h>
+#include <asm/imx_iim.h>
+#include <asm/setup.h>
#include <asm/errno.h>
#include <asm/io.h>
#include "crm_regs.h"
@@ -1258,3 +1260,29 @@ int fastboot_check_and_clean_flag(void)
}
#endif
+#ifdef CONFIG_SERIAL_TAG
+void get_board_serial(struct tag_serialnr *serialnr)
+{
+ int i = 0, tmp = 0;
+ u32 *iim0_unique_id_base =
+ (u32 *)(IIM_BASE_ADDR + IIM_BANK_AREA_0_OFFSET +
+ CONFIG_IIM_UNIQUE_ID_OFFSET);
+
+ serialnr->low = 0;
+ serialnr->high = 0;
+
+ /* Read the 32-63 bits of UID from 4 registers */
+ for (i = 0; i < 4; ++i, ++iim0_unique_id_base) {
+ tmp = readl(iim0_unique_id_base);
+ serialnr->high = serialnr->high << 8;
+ serialnr->high |= (tmp & 0xff);
+ }
+
+ /* Read the 0-31 bits of UID from next 4 registers */
+ for (i = 0; i < 4; ++i, ++iim0_unique_id_base) {
+ tmp = readl(iim0_unique_id_base);
+ serialnr->low = serialnr->low << 8;
+ serialnr->low |= (tmp & 0xff);
+ }
+}
+#endif