All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [PATCH 08/10] ARM: mvebu: clearfog: run-time selection of DT file
Date: Tue, 14 Jan 2020 12:28:35 +0100	[thread overview]
Message-ID: <8872fd72-f539-0e95-bb76-c0abfbe14eb4@denx.de> (raw)
In-Reply-To: <20200114102612.5peyddjtzbfhup5y@sapphire.tkos.co.il>

Hi Baruch,

On 14.01.20 11:26, Baruch Siach wrote:
> Hi Stefan,
> 
> On Mon, Jan 13, 2020 at 08:27:31AM +0100, Stefan Roese wrote:
>> On 25.11.19 11:30, Baruch Siach wrote:
>>> Set the kernel device-tree file (fdtfile environment variable) based on
>>> run-time detection of the platform.
>>>
>>> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
>>> ---
>>>    arch/arm/mach-mvebu/Kconfig        |  1 +
>>>    board/solidrun/clearfog/clearfog.c | 14 ++++++++++++++
>>>    2 files changed, 15 insertions(+)
>>>
>>> diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig
>>> index fdd39685b75d..bc5eaa5a7679 100644
>>> --- a/arch/arm/mach-mvebu/Kconfig
>>> +++ b/arch/arm/mach-mvebu/Kconfig
>>> @@ -91,6 +91,7 @@ choice
>>>    config TARGET_CLEARFOG
>>>    	bool "Support ClearFog"
>>>    	select 88F6820
>>> +	select BOARD_LATE_INIT
>>>    config TARGET_HELIOS4
>>>    	bool "Support Helios4"
>>> diff --git a/board/solidrun/clearfog/clearfog.c b/board/solidrun/clearfog/clearfog.c
>>> index 852b1ad71bb2..00c1306e9c80 100644
>>> --- a/board/solidrun/clearfog/clearfog.c
>>> +++ b/board/solidrun/clearfog/clearfog.c
>>> @@ -265,3 +265,17 @@ int board_eth_init(bd_t *bis)
>>>    	cpu_eth_init(bis); /* Built in controller(s) come first */
>>>    	return pci_eth_init(bis);
>>>    }
>>> +
>>> +int board_late_init(void)
>>> +{
>>> +	read_tlv_data();
>>> +
>>> +	if (sr_product_is("Clearfog Base"))
>>> +		 env_set("fdtfile", "armada-388-clearfog-base.dtb");
>>> +	else if (sr_product_is("Clearfog GTR S4"))
>>> +		 env_set("fdtfile", "armada-385-clearfog-gtr-s4.dtb");
>>> +	else if (sr_product_is("Clearfog GTR L8"))
>>> +		 env_set("fdtfile", "armada-385-clearfog-gtr-l8.dtb");
>>> +
>>> +	return 0;
>>> +}
>>>
>>
>> Where does this sr_product_is() function come from? I might have missed
>> it in a previous patch - please point me to it, thanks.
> 
> sr_product_is() is added in patch #6 of this series. Match is tested against
> TLV stored product name string.

Ah, I missed it. Thanks.
  
>> Does it make sense to match string values here or wouldn't it be better
>> to match board ID's (enum)?
> 
> sr_product_is() matches also string prefixes. I use this feature in patch #9
> to set Clearfog GTR S4/L8 serdes configuration.

If you prefer to continue this was with string comparison, then feel free
to add my:

Reviewed-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan

  reply	other threads:[~2020-01-14 11:28 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-25 10:30 [U-Boot] [PATCH 00/10] ARM: clearfog: add run-time board detect Baruch Siach
2019-11-25 10:30 ` [U-Boot] [PATCH 01/10] ddr: marvell: a38x: allow board specific clock out setup Baruch Siach
2020-01-13  6:56   ` Stefan Roese
2019-11-25 10:30 ` [U-Boot] [PATCH 02/10] arm: mvebu: clearfog: enable both DDR clocks Baruch Siach
2020-01-13  6:59   ` Stefan Roese
2019-11-25 10:30 ` [U-Boot] [PATCH 03/10] cmd: add sys_eeprom command Baruch Siach
2020-01-13  7:11   ` Stefan Roese
2020-01-14 10:18     ` Baruch Siach
2020-01-14 11:24       ` Stefan Roese
2019-11-25 10:30 ` [U-Boot] [PATCH 04/10] ARM: mvebu: clearfog: add EEPROM devices Baruch Siach
2020-01-13  7:12   ` Stefan Roese
2019-11-25 10:30 ` [U-Boot] [PATCH 05/10] ARM: mvebu: clearfog: add support for EEPROM TLV info Baruch Siach
2020-01-13  7:13   ` Stefan Roese
2019-11-25 10:30 ` [U-Boot] [PATCH 06/10] ARM: mvebu: clearfog: read basic TLV data Baruch Siach
2020-01-13  7:22   ` Stefan Roese
2019-11-25 10:30 ` [U-Boot] [PATCH 07/10] ARM: mvebu: clearfog: print TLV stored product name Baruch Siach
2020-01-13  7:23   ` Stefan Roese
2019-11-25 10:30 ` [U-Boot] [PATCH 08/10] ARM: mvebu: clearfog: run-time selection of DT file Baruch Siach
2020-01-13  7:27   ` Stefan Roese
2020-01-14 10:26     ` Baruch Siach
2020-01-14 11:28       ` Stefan Roese [this message]
2019-11-25 10:30 ` [U-Boot] [PATCH 09/10] ARM: mvebu: clearfog: add Clearfog GTR support Baruch Siach
2020-01-13  7:29   ` Stefan Roese
2019-11-25 10:30 ` [U-Boot] [PATCH 10/10] ARM: mvebu: clearfog: add Clearfog Base serdes configuration Baruch Siach
2020-01-13  7:30   ` Stefan Roese
2020-01-13  7:31 ` [PATCH 00/10] ARM: clearfog: add run-time board detect Stefan Roese

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=8872fd72-f539-0e95-bb76-c0abfbe14eb4@denx.de \
    --to=sr@denx.de \
    --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.