From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 5/7] OMAP3: Add serial number based on die ID
Date: Thu, 5 Feb 2009 00:28:00 +0100 [thread overview]
Message-ID: <20090204232800.GL31498@game.jcrosoft.org> (raw)
In-Reply-To: <1233554011-30084-6-git-send-email-dirk.behme@googlemail.com>
On 06:53 Mon 02 Feb , Dirk Behme wrote:
> Add serial number based on OMAP3 die ID.
>
> Signed-off-by: Dirk Behme <dirk.behme@googlemail.com>
>
> ---
> 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 | 27 +++++++++++++++++++++++++++
> 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, 51 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,33 @@ 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;
>
> +/*****************************************************************
> + * serial_num_r(void) - read and set serial number based on DIE ID
> + *****************************************************************/
> +void serial_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("serial");
why not call a cat a cat?
IMHO why don't you report the die id?
> +
> + 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("serial", die_id);
> + } else {
> + strncpy(die_id, uid_s, 34);
why copy it? why not simply print it
> + }
> +
> + printf("Serial #%s\n", die_id);
> +}
> +
> /******************************************
> * get_cpu_type(void) - extract cpu info
> ******************************************/
> Index: u-boot-main/include/asm-arm/arch-omap3/cpu.h
Best Regards,
J.
next prev parent reply other threads:[~2009-02-04 23:28 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-02 5:53 [U-Boot] [PATCH 0/7] OMAP3: Add some additional improvements and fixes Dirk Behme
2009-02-02 5:53 ` [U-Boot] [PATCH 1/7] OMAP3: Overo: Clean up pin mux and GPIO configuration Dirk Behme
2009-02-02 5:53 ` [U-Boot] [PATCH 2/7] OMAP3: Beagle: Add board revision detection Dirk Behme
2009-02-02 5:53 ` [U-Boot] [PATCH 3/7] OMAP3: Add OMAP3 auto detection Dirk Behme
2009-02-02 5:53 ` [U-Boot] [PATCH 4/7] OMAP3: Pandora: Update pin mux Dirk Behme
2009-02-02 5:53 ` [U-Boot] [PATCH 5/7] OMAP3: Add serial number based on die ID Dirk Behme
2009-02-02 5:53 ` [U-Boot] [PATCH 6/7] OMAP3: Add OMAP3 core changes for MUSB Dirk Behme
2009-02-02 5:53 ` [U-Boot] [PATCH 7/7] OMAP3: Clean up MMC code Dirk Behme
2009-02-11 22:26 ` [U-Boot] [PATCH 6/7] OMAP3: Add OMAP3 core changes for MUSB Jean-Christophe PLAGNIOL-VILLARD
2009-02-12 18:56 ` Dirk Behme
2009-02-04 23:28 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2009-02-05 19:14 ` [U-Boot] [PATCH 5/7] OMAP3: Add serial number based on die ID Dirk Behme
2009-02-11 22:24 ` Jean-Christophe PLAGNIOL-VILLARD
2009-02-12 18:56 ` Dirk Behme
2009-02-11 22:34 ` Wolfgang Denk
2009-02-04 23:24 ` [U-Boot] [PATCH 4/7] OMAP3: Pandora: Update pin mux Jean-Christophe PLAGNIOL-VILLARD
2009-02-05 19:13 ` Dirk Behme
2009-02-05 19:52 ` Jean-Christophe PLAGNIOL-VILLARD
2009-02-05 20:01 ` Dirk Behme
2009-02-05 20:54 ` Grazvydas Ignotas
2009-02-04 23:22 ` [U-Boot] [PATCH 2/7] OMAP3: Beagle: Add board revision detection Jean-Christophe PLAGNIOL-VILLARD
2009-02-05 19:12 ` Dirk Behme
2009-02-11 22:17 ` Jean-Christophe PLAGNIOL-VILLARD
2009-02-04 23:18 ` [U-Boot] [PATCH 1/7] OMAP3: Overo: Clean up pin mux and GPIO configuration Jean-Christophe PLAGNIOL-VILLARD
2009-02-05 19:11 ` Dirk Behme
2009-02-04 12:46 ` [U-Boot] [PATCH 0/7] OMAP3: Add some additional improvements and fixes Jason Kridner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090204232800.GL31498@game.jcrosoft.org \
--to=plagnioj@jcrosoft.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox