From: Thierry Reding <thierry.reding@gmail.com>
To: Svyatoslav Ryhel <clamor95@gmail.com>
Cc: Thierry Reding <treding@nvidia.com>, u-boot@lists.denx.de
Subject: Re: [PATCH v1 15/19] ARM: tegra: board2: add generic late init
Date: Wed, 23 Aug 2023 13:13:11 +0200 [thread overview]
Message-ID: <ZOXpx6oq8MYkoHcw@orome> (raw)
In-Reply-To: <20230822112217.4646-16-clamor95@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2685 bytes --]
On Tue, Aug 22, 2023 at 02:22:13PM +0300, Svyatoslav Ryhel wrote:
> Board specific late init allows vendors to set up different device
> or board specific env variables (like serial number, platform name).
> In case this information is missing, u-boot will lack info regards
> serial or platform.
>
> To avoid this prior nvidia_board_late_init internal generic function
> is called which fills required data. In this case platform name is
> obtained from get_chip and serialno is filled with SoC id.
>
> Though SoC id is not dedicated to be devices serial but it fits well
> in case of restriction of data about device and since SoC is basically
> a main chip of the device.
>
> Tested-by: Andreas Westman Dorcsak <hedmoo@yahoo.com> # ASUS Transformers
> Tested-by: Svyatoslav Ryhel <clamor95@gmail.com> # Nvidia Tegratab
> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
> ---
> arch/arm/mach-tegra/board2.c | 43 ++++++++++++++++++++++++++++++++++++
> 1 file changed, 43 insertions(+)
>
> diff --git a/arch/arm/mach-tegra/board2.c b/arch/arm/mach-tegra/board2.c
> index 981768bb0e..ee69cb657a 100644
> --- a/arch/arm/mach-tegra/board2.c
> +++ b/arch/arm/mach-tegra/board2.c
> @@ -26,6 +26,10 @@
> #include <asm/arch-tegra/gpu.h>
> #include <asm/arch-tegra/usb.h>
> #include <asm/arch-tegra/xusb-padctl.h>
> +#ifndef CONFIG_TEGRA186
> +#include <asm/arch-tegra/fuse.h>
> +#include <asm/arch/gp_padctrl.h>
> +#endif
> #if IS_ENABLED(CONFIG_TEGRA_CLKRST)
> #include <asm/arch/clock.h>
> #endif
> @@ -256,6 +260,37 @@ int board_early_init_f(void)
> }
> #endif /* EARLY_INIT */
>
> +#ifndef CONFIG_TEGRA186
> +static void nvidia_board_late_init_generic(void)
> +{
> + char serialno_str[17];
> +
> + /* Set chip id as serialno */
> + sprintf(serialno_str, "%016llx", tegra_chip_uid());
> + env_set("serial#", serialno_str);
> +
> + switch (tegra_get_chip()) {
> + case CHIPID_TEGRA20:
> + env_set("platform", "Tegra 2 T20");
> + break;
> + case CHIPID_TEGRA30:
> + env_set("platform", "Tegra 3 T30");
> + break;
> + case CHIPID_TEGRA114:
> + env_set("platform", "Tegra 4 T114");
> + break;
> + case CHIPID_TEGRA124:
> + env_set("platform", "Tegra K1 T124");
> + break;
> + case CHIPID_TEGRA210:
> + env_set("platform", "Tegra X1 T210");
This variable is presumably something that you'd want to match on in a
script, so perhaps we can settle on something a bit more canonical. In
upstream Linux we use tegraXYZ quite consistently and you'll see that
reflected in things like compatible strings, so I'd suggest reusing the
same naming scheme here to simplify and avoid confusion.
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2023-08-23 11:13 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-22 11:21 [PATCH v1 00/19] General tegra and board improvements Svyatoslav Ryhel
2023-08-22 11:21 ` [PATCH v1 01/19] ARM: dts: p1801-t: separate from common transformers tree Svyatoslav Ryhel
2023-08-22 11:22 ` [PATCH v1 02/19] ARM: dts: tf600t: " Svyatoslav Ryhel
2023-08-22 11:22 ` [PATCH v1 03/19] configs: transformer_t30: support booting from USB Svyatoslav Ryhel
2023-08-22 11:22 ` [PATCH v1 04/19] ARM: dts: tf201: configure dock USB phy Svyatoslav Ryhel
2023-08-22 11:22 ` [PATCH v1 05/19] board: asus: transformer-t30: remove PMIC GPIOs configuration Svyatoslav Ryhel
2023-08-22 11:22 ` [PATCH v1 06/19] configs: transformer_t30: convert bootmenu option Svyatoslav Ryhel
2023-08-22 11:22 ` [PATCH v1 07/19] ARM: dts: transformer-t30: complete missing bindings Svyatoslav Ryhel
2023-08-22 11:22 ` [PATCH v1 08/19] ARM: dts: endeavoru: " Svyatoslav Ryhel
2023-08-22 11:22 ` [PATCH v1 09/19] ARM: dts: lg-x3: " Svyatoslav Ryhel
2023-08-22 11:22 ` [PATCH v1 10/19] ARM: dts: grouper: " Svyatoslav Ryhel
2023-08-22 11:22 ` [PATCH v1 11/19] configs: transformer_t30: grouper: lg-x3: endeavoru: sync defconfigs Svyatoslav Ryhel
2023-08-22 11:22 ` [PATCH v1 12/19] ARM: tegra114: enable base voltages setup from board Svyatoslav Ryhel
2023-08-22 11:22 ` [PATCH v1 13/19] ARM: tegra210: set default-tap and default-trim values in sdhci nodes Svyatoslav Ryhel
2023-08-22 11:22 ` [PATCH v1 14/19] ARM: tegra20: tegra30: support EBTUPDATE on non-encrypted devices Svyatoslav Ryhel
2023-08-22 11:22 ` [PATCH v1 15/19] ARM: tegra: board2: add generic late init Svyatoslav Ryhel
2023-08-23 11:13 ` Thierry Reding [this message]
2023-08-23 11:42 ` Svyatoslav Ryhel
2023-08-23 23:57 ` Simon Glass
2023-08-24 5:41 ` Svyatoslav Ryhel
2023-08-24 14:41 ` Simon Glass
2023-08-22 11:22 ` [PATCH v1 16/19] board: tegra30: remove nvidia_board_late_init calls Svyatoslav Ryhel
2023-08-22 11:22 ` [PATCH v1 17/19] ARM: tegra: dt-setup: convert TrustZone remove into config Svyatoslav Ryhel
2023-08-23 11:17 ` Thierry Reding
2023-08-23 11:47 ` Svyatoslav Ryhel
2023-08-23 14:54 ` Simon Glass
2023-08-23 15:11 ` Svyatoslav Ryhel
2023-08-24 13:33 ` Thierry Reding
2023-08-24 13:43 ` Svyatoslav Ryhel
2023-08-22 11:22 ` [PATCH v1 18/19] board: tegra30: switch to config version of TZ remove Svyatoslav Ryhel
2023-08-22 11:22 ` [PATCH v1 19/19] board: asus: lg: move config fragments into device boards Svyatoslav Ryhel
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=ZOXpx6oq8MYkoHcw@orome \
--to=thierry.reding@gmail.com \
--cc=clamor95@gmail.com \
--cc=treding@nvidia.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 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.