* [U-Boot] [PATCH v3] OMAP3: Add serial number based on die ID
@ 2009-03-04 19:34 Dirk Behme
2009-03-08 22:49 ` Wolfgang Denk
0 siblings, 1 reply; 4+ messages in thread
From: Dirk Behme @ 2009-03-04 19:34 UTC (permalink / raw)
To: u-boot
Add serial number based on OMAP3 die ID.
Signed-off-by: Dirk Behme <dirk.behme@googlemail.com>
---
Changes in v3:
- Rename 'serial#' to 'dieid#'
- Rebase against U-Boot mainline commit
00cc5595a7caac8066b408774383a956c2e26797 'lcd: Fix compilation warning
in common/lcd.c'
This patch replaces all older versions of this patch (which where part
of OMAP3 5/7 patch series)
Changes in v2:
- Rename 'serial' to 'serial#'
- Don't copy from a memory to an other, instead just update the pointer
board/omap3/beagle/beagle.c | 2 ++
board/omap3/evm/evm.c | 2 ++
board/omap3/overo/overo.c | 2 ++
board/omap3/pandora/pandora.c | 2 ++
board/omap3/zoom1/zoom1.c | 1 +
cpu/arm_cortexa8/omap3/sys_info.c | 26 ++++++++++++++++++++++++++
include/asm-arm/arch-omap3/cpu.h | 13 +++++++++++++
include/asm-arm/arch-omap3/omap3.h | 1 +
include/asm-arm/arch-omap3/sys_proto.h | 1 +
9 files changed, 50 insertions(+)
Index: u-boot-main/cpu/arm_cortexa8/omap3/sys_info.c
===================================================================
--- u-boot-main.orig/cpu/arm_cortexa8/omap3/sys_info.c
+++ u-boot-main/cpu/arm_cortexa8/omap3/sys_info.c
@@ -36,6 +36,32 @@ static gpmc_csx_t *gpmc_cs_base = (gpmc_
static sdrc_t *sdrc_base = (sdrc_t *)OMAP34XX_SDRC_BASE;
static ctrl_t *ctrl_base = (ctrl_t *)OMAP34XX_CTRL_BASE;
+/*****************************************************************
+ * dieid_num_r(void) - read and set serial number based on DIE ID
+ *****************************************************************/
+void dieid_num_r(void)
+{
+ ctrl_id_t *id_base = (ctrl_id_t *)OMAP34XX_ID_L4_IO_BASE;
+ char *uid_s, die_id[34];
+ u32 id[4];
+
+ memset(die_id, 0, sizeof(die_id));
+
+ uid_s = getenv("dieid#");
+
+ if (uid_s == NULL) {
+ id[3] = readl(&id_base->die_id_0);
+ id[2] = readl(&id_base->die_id_1);
+ id[1] = readl(&id_base->die_id_2);
+ id[0] = readl(&id_base->die_id_3);
+ sprintf(die_id, "%08x%08x%08x%08x", id[0], id[1], id[2], id[3]);
+ setenv("dieid#", die_id);
+ uid_s = die_id;
+ }
+
+ printf("Die ID #%s\n", uid_s);
+}
+
/******************************************
* get_cpu_type(void) - extract cpu info
******************************************/
Index: u-boot-main/include/asm-arm/arch-omap3/cpu.h
===================================================================
--- u-boot-main.orig/include/asm-arm/arch-omap3/cpu.h
+++ u-boot-main/include/asm-arm/arch-omap3/cpu.h
@@ -60,6 +60,19 @@ typedef struct ctrl {
#define OMAP3525 0x4c00
#define OMAP3530 0x0c00
+#ifndef __ASSEMBLY__
+typedef struct ctrl_id {
+ unsigned char res1[0x4];
+ unsigned int idcode; /* 0x04 */
+ unsigned int prod_id; /* 0x08 */
+ unsigned char res2[0x0C];
+ unsigned int die_id_0; /* 0x18 */
+ unsigned int die_id_1; /* 0x1C */
+ unsigned int die_id_2; /* 0x20 */
+ unsigned int die_id_3; /* 0x24 */
+} ctrl_id_t;
+#endif /* __ASSEMBLY__ */
+
/* device type */
#define DEVICE_MASK (0x7 << 8)
#define SYSBOOT_MASK 0x1F
Index: u-boot-main/include/asm-arm/arch-omap3/omap3.h
===================================================================
--- u-boot-main.orig/include/asm-arm/arch-omap3/omap3.h
+++ u-boot-main/include/asm-arm/arch-omap3/omap3.h
@@ -43,6 +43,7 @@
*/
#define OMAP34XX_CORE_L4_IO_BASE 0x48000000
#define OMAP34XX_WAKEUP_L4_IO_BASE 0x48300000
+#define OMAP34XX_ID_L4_IO_BASE 0x4830A200
#define OMAP34XX_L4_PER 0x49000000
#define OMAP34XX_L4_IO_BASE OMAP34XX_CORE_L4_IO_BASE
Index: u-boot-main/board/omap3/overo/overo.c
===================================================================
--- u-boot-main.orig/board/omap3/overo/overo.c
+++ u-boot-main/board/omap3/overo/overo.c
@@ -60,6 +60,8 @@ int misc_init_r(void)
{
power_init_r();
+ dieid_num_r();
+
return 0;
}
Index: u-boot-main/board/omap3/beagle/beagle.c
===================================================================
--- u-boot-main.orig/board/omap3/beagle/beagle.c
+++ u-boot-main/board/omap3/beagle/beagle.c
@@ -116,6 +116,8 @@ int misc_init_r(void)
beagle_identify();
+ dieid_num_r();
+
return 0;
}
Index: u-boot-main/board/omap3/evm/evm.c
===================================================================
--- u-boot-main.orig/board/omap3/evm/evm.c
+++ u-boot-main/board/omap3/evm/evm.c
@@ -68,6 +68,8 @@ int misc_init_r(void)
setup_net_chip();
#endif
+ dieid_num_r();
+
return 0;
}
Index: u-boot-main/include/asm-arm/arch-omap3/sys_proto.h
===================================================================
--- u-boot-main.orig/include/asm-arm/arch-omap3/sys_proto.h
+++ u-boot-main/include/asm-arm/arch-omap3/sys_proto.h
@@ -66,5 +66,6 @@ void sdelay(unsigned long);
void make_cs1_contiguous(void);
void omap_nand_switch_ecc(int);
void power_init_r(void);
+void dieid_num_r(void);
#endif
Index: u-boot-main/board/omap3/pandora/pandora.c
===================================================================
--- u-boot-main.orig/board/omap3/pandora/pandora.c
+++ u-boot-main/board/omap3/pandora/pandora.c
@@ -77,6 +77,8 @@ int misc_init_r(void)
writel(GPIO28, &gpio5_base->setdataout);
writel(GPIO4, &gpio6_base->setdataout);
+ dieid_num_r();
+
return 0;
}
Index: u-boot-main/board/omap3/zoom1/zoom1.c
===================================================================
--- u-boot-main.orig/board/omap3/zoom1/zoom1.c
+++ u-boot-main/board/omap3/zoom1/zoom1.c
@@ -61,6 +61,7 @@ int board_init(void)
int misc_init_r(void)
{
power_init_r();
+ dieid_num_r();
return 0;
}
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH v3] OMAP3: Add serial number based on die ID
2009-03-04 19:34 [U-Boot] [PATCH v3] OMAP3: Add serial number based on die ID Dirk Behme
@ 2009-03-08 22:49 ` Wolfgang Denk
2009-03-10 18:23 ` Dirk Behme
0 siblings, 1 reply; 4+ messages in thread
From: Wolfgang Denk @ 2009-03-08 22:49 UTC (permalink / raw)
To: u-boot
Dear Dirk Behme,
In message <1236195272-26733-1-git-send-email-dirk.behme@googlemail.com> you wrote:
> Add serial number based on OMAP3 die ID.
...
> - Rename 'serial#' to 'dieid#'
Should the commit message not also reflect that this has nothing to do
any more with the serial number (serial#) ?
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Perfection is reached, not when there is no longer anything to add,
but when there is no longer anything to take away.
- Antoine de Saint-Exupery
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH v3] OMAP3: Add serial number based on die ID
2009-03-08 22:49 ` Wolfgang Denk
@ 2009-03-10 18:23 ` Dirk Behme
2009-03-10 19:38 ` Wolfgang Denk
0 siblings, 1 reply; 4+ messages in thread
From: Dirk Behme @ 2009-03-10 18:23 UTC (permalink / raw)
To: u-boot
Dear Wolfgang,
Wolfgang Denk wrote:
> Dear Dirk Behme,
>
> In message <1236195272-26733-1-git-send-email-dirk.behme@googlemail.com> you wrote:
>> Add serial number based on OMAP3 die ID.
> ...
>> - Rename 'serial#' to 'dieid#'
>
> Should the commit message not also reflect that this has nothing to do
> any more with the serial number (serial#) ?
Hmm, well, it seems that some people like to _use_ this number we
report here as serial number of the board independent of any naming
convention U-Boot has. ;)
Anyhow, do you like the commit message to be changed to get this patch
applied?
Best regards
Dirk
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH v3] OMAP3: Add serial number based on die ID
2009-03-10 18:23 ` Dirk Behme
@ 2009-03-10 19:38 ` Wolfgang Denk
0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Denk @ 2009-03-10 19:38 UTC (permalink / raw)
To: u-boot
Dear Dirk Behme,
In message <49B6B007.4000608@googlemail.com> you wrote:
>
> >> Add serial number based on OMAP3 die ID.
> > ...
> >> - Rename 'serial#' to 'dieid#'
> >
> > Should the commit message not also reflect that this has nothing to do
> > any more with the serial number (serial#) ?
>
> Hmm, well, it seems that some people like to _use_ this number we
> report here as serial number of the board independent of any naming
> convention U-Boot has. ;)
Maybe documentation is poor and fails to explain the difference
between a die ID and a board serial number ?
> Anyhow, do you like the commit message to be changed to get this patch
> applied?
Yes, please.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"A dirty mind is a joy forever." - Randy Kunkee
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-03-10 19:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-04 19:34 [U-Boot] [PATCH v3] OMAP3: Add serial number based on die ID Dirk Behme
2009-03-08 22:49 ` Wolfgang Denk
2009-03-10 18:23 ` Dirk Behme
2009-03-10 19:38 ` Wolfgang Denk
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.