From: Nishanth Menon <nm@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 3/4] ARM: DRA7: Set serial number environment variable
Date: Sat, 07 Mar 2015 01:00:02 -0600 [thread overview]
Message-ID: <54FAA1F2.8030306@ti.com> (raw)
In-Reply-To: <1425381044-19460-3-git-send-email-dileep.katta@linaro.org>
On 03/03/2015 05:10 AM, Dileep Katta wrote:
> Adds the registers to get the serial number of dra7xx boards.
> Serial# environment variable will be set if not done already.
> This will be useful to show correct information in
> "fastboot devices" commands.
>
> Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
> Signed-off-by: Dileep Katta <dileep.katta@linaro.org>
> ---
> arch/arm/cpu/armv7/omap5/prcm-regs.c | 2 ++
> arch/arm/include/asm/omap_common.h | 2 ++
> board/ti/dra7xx/evm.c | 11 +++++++++++
> 3 files changed, 15 insertions(+)
>
> diff --git a/arch/arm/cpu/armv7/omap5/prcm-regs.c b/arch/arm/cpu/armv7/omap5/prcm-regs.c
> index 0745d42..020a964 100644
> --- a/arch/arm/cpu/armv7/omap5/prcm-regs.c
> +++ b/arch/arm/cpu/armv7/omap5/prcm-regs.c
> @@ -440,6 +440,8 @@ struct omap_sys_ctrl_regs const dra7xx_ctrl = {
> .control_emif1_sdram_config_ext = 0x4AE0C144,
> .control_emif2_sdram_config_ext = 0x4AE0C148,
> .control_wkup_ldovbb_mpu_voltage_ctrl = 0x4AE0C158,
> + .control_std_fuse_die_id_3 = 0x4AE0C210,
> + .control_std_fuse_prod_id_0 = 0x4AE0C214,
Are these serial numbers of dra7 "boards"? they dont match up with
commit message.
http://www.ti.com/lit/ug/spruhz6/spruhz6.pdf
See section "AM572x Device Identification" on page 357
you would rather want to use CTRL_WKUP_STD_FUSE_DIE_ID_0,1,2,3
Is'nt better to unify with existing requirements such as
arch/arm/cpu/armv7/omap3/sys_info.c dieid_num_r() such that every
omap3,4,5,dra7 SoCs can use the same function in different ways
(example: usb_fake_mac_from_die_id in omap5_uevm and panda) ?
here we do fastboot_serial_from_die_id? Standardizing such information
allows us to just hook up the missing information for various SoCs and
reuse the common code.
> .control_padconf_mode = 0x4AE0C5A0,
> .control_xtal_oscillator = 0x4AE0C5A4,
> .control_i2c_2 = 0x4AE0C5A8,
> diff --git a/arch/arm/include/asm/omap_common.h b/arch/arm/include/asm/omap_common.h
> index 323952f..b329803 100644
> --- a/arch/arm/include/asm/omap_common.h
> +++ b/arch/arm/include/asm/omap_common.h
> @@ -362,6 +362,8 @@ struct omap_sys_ctrl_regs {
> u32 control_core_control_io1;
> u32 control_core_control_io2;
> u32 control_id_code;
> + u32 control_std_fuse_die_id_3;
> + u32 control_std_fuse_prod_id_0;
> u32 control_std_fuse_opp_bgap;
> u32 control_ldosram_iva_voltage_ctrl;
> u32 control_ldosram_mpu_voltage_ctrl;
> diff --git a/board/ti/dra7xx/evm.c b/board/ti/dra7xx/evm.c
> index 6522241..e20d950 100644
> --- a/board/ti/dra7xx/evm.c
> +++ b/board/ti/dra7xx/evm.c
> @@ -88,10 +88,21 @@ int board_init(void)
> int board_late_init(void)
> {
> #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
> + char serialno[72];
> + uint32_t serialno_lo, serialno_hi;
> +
> if (omap_revision() == DRA722_ES1_0)
> setenv("board_name", "dra72x");
> else
> setenv("board_name", "dra7xx");
> +
> + if (!getenv("serial#")) {
> + printf("serial# not set, setting...\n");
> + serialno_lo = readl((*ctrl)->control_std_fuse_die_id_3);
> + serialno_hi = readl((*ctrl)->control_std_fuse_prod_id_0);
> + sprintf(serialno, "%08x%08x", serialno_hi, serialno_lo);
> + setenv("serial#", serialno);
> + }
> #endif
> return 0;
> }
>
next prev parent reply other threads:[~2015-03-07 7:00 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-03 11:10 [U-Boot] [PATCH v1 1/4] ARM: DRA7XX: Add config file for Android with fastboot support Dileep Katta
2015-03-03 11:10 ` [U-Boot] [PATCH v2 2/4] fastboot: call board_usb_init() to enable usb Dileep Katta
2015-03-04 13:19 ` Lukasz Majewski
2015-03-04 17:05 ` Stegmaier, Angela
2015-03-04 18:29 ` Tom Rini
2015-03-04 19:06 ` Dileep Katta
2015-03-05 14:37 ` Tom Rini
2015-03-12 6:36 ` Dileep Katta
2015-03-12 8:55 ` Lukasz Majewski
2015-03-12 17:28 ` Marek Vasut
2015-03-12 21:12 ` Dileep Katta
2015-03-13 7:53 ` Lukasz Majewski
2015-03-13 19:28 ` Dileep Katta
2015-03-13 20:55 ` Lukasz Majewski
2015-03-27 17:53 ` Dileep Katta
2015-03-27 18:15 ` Tom Rini
2015-03-27 18:25 ` Marek Vasut
2015-03-30 8:38 ` Lukasz Majewski
2015-03-03 11:10 ` [U-Boot] [PATCH v3 3/4] ARM: DRA7: Set serial number environment variable Dileep Katta
2015-03-04 13:23 ` Lukasz Majewski
2015-03-04 16:53 ` Tom Rini
2015-03-07 7:00 ` Nishanth Menon [this message]
2015-03-03 11:10 ` [U-Boot] [PATCH v1 4/4] ARM: DRA7: fastboot: Implement reboot-bootloader command - Implemented fb_set_reboot_flag() for DRA7 - Defined a weak function, fb_check_reboot_flag() - Implemented for DRA7 Dileep Katta
2015-03-03 14:15 ` Rob Herring
2015-03-04 16:57 ` Tom Rini
2015-03-04 13:31 ` Lukasz Majewski
2015-03-03 11:53 ` [U-Boot] [PATCH v1 1/4] ARM: DRA7XX: Add config file for Android with fastboot support Dileep Katta
2015-03-04 13:18 ` Lukasz Majewski
2015-03-04 16:52 ` Tom Rini
2015-03-12 6:31 ` Dileep Katta
2015-03-12 19:29 ` Tom Rini
2015-03-17 18:38 ` [U-Boot] [PATCH v2 1/1] " Dileep Katta
2015-03-18 16:11 ` Tom Rini
2015-03-18 21:12 ` Dileep Katta
2015-03-19 13:15 ` Tom Rini
2015-03-23 22:41 ` Dileep Katta
2015-03-24 22:34 ` [U-Boot] [PATCH v3 1/3] ARM: DRA7XX: Enable Fastboot Dileep Katta
2015-03-24 22:34 ` [U-Boot] [PATCH v3 2/3] ARM: DRA7: Set serial number environment variable Dileep Katta
2015-03-27 14:19 ` Tom Rini
2015-04-23 22:03 ` [U-Boot] [U-Boot, v3, " Tom Rini
2015-03-24 22:34 ` [U-Boot] [PATCH v3 3/3] fastboot: ARM: OMAP5: Enable reboot-bootloader Dileep Katta
2015-03-27 14:19 ` Tom Rini
2015-03-27 17:28 ` Dileep Katta
2015-03-27 17:36 ` [U-Boot] [PATCH v4 " Dileep Katta
2015-03-27 18:02 ` Tom Rini
2015-04-23 22:03 ` [U-Boot] [U-Boot, v4, " Tom Rini
2015-03-27 14:19 ` [U-Boot] [PATCH v3 1/3] ARM: DRA7XX: Enable Fastboot Tom Rini
2015-04-23 22:03 ` [U-Boot] [U-Boot,v3,1/3] " Tom Rini
2015-03-23 8:50 ` [U-Boot] [PATCH v2 1/1] ARM: DRA7XX: Add config file for Android with fastboot support Lukasz Majewski
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=54FAA1F2.8030306@ti.com \
--to=nm@ti.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