mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org, "Leonard Göhrs" <l.goehrs@pengutronix.de>
Subject: Re: [PATCH 2/3] ARM: stm32mp: add Linux Automation TAC board
Date: Mon, 14 Apr 2025 13:42:30 +0200	[thread overview]
Message-ID: <9f905302-9a79-485f-9afa-45e98fa1aa40@pengutronix.de> (raw)
In-Reply-To: <Z_zwJauQq7sEshIw@pengutronix.de>

Hello Sascha,

On 4/14/25 13:23, Sascha Hauer wrote:
> On Fri, Apr 11, 2025 at 09:27:47AM +0200, Ahmad Fatoum wrote:
>> Add support for the Linux Automation GmbH Test Automation
>> Controller (TAC). The board boots from eMMC, but requires USB loading if
>> no previous barebox has been put into the eMMC boot partition.
>>
>> Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
>> Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
>> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
>> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>

[snip]

>> +static const int board_rev_pins[] = {0, 1, 2, 3, 6, 7};
>> +
>> +static u32 get_board_rev(void)
>> +{
>> +	u32 board_rev = 0;
>> +
>> +	/* Enable GPIOZ bank */
>> +	setbits_le32(STM32MP15_RCC_MP_AHB5ENSETR, BIT(0));
>> +
>> +	for (size_t i = 0; i < ARRAY_SIZE(board_rev_pins); i++) {
>> +		int pin = board_rev_pins[i];
>> +
>> +		__stm32_pmx_gpio_input(STM32MP15_GPIOZ_BASE, pin);
>> +		board_rev |= __stm32_pmx_gpio_get(STM32MP15_GPIOZ_BASE, pin) << i;
>> +	}
>> +
>> +	return board_rev;
>> +}
> 
> Is this information available during runtime with some pr_* message or
> variable?

No. There is more extensive board revision information in the EEPROM
though, which is indeed available at runtime via the separately
submitted TLV series.

>> +static void noinline select_fdt_and_start(void *fdt)
>> +{
>> +	putc_ll('>');
>> +
>> +	switch (get_board_rev()) {
>> +	case BOARD_GEN1:
>> +		fdt = runtime_address(__dtb_z_stm32mp157c_lxa_tac_gen1_start);
>> +		break;
>> +	case BOARD_GEN2:
>> +		fdt = runtime_address(__dtb_z_stm32mp157c_lxa_tac_gen2_start);
>> +		break;
>> +	case BOARD_GEN3:
>> +		fdt = runtime_address(__dtb_z_stm32mp153c_lxa_tac_gen3_start);
>> +		break;
>> +	}
> 
> This check only matches for minor revision 0. Shouldn't the minor
> version rather be ignored here?

I am not sure if a generation is always equal to the major version - 1.
It seems we have no minor revisions != 0 in the field.

If Leonard (Cc'd) doesn't object, I'll mask away the lower 2 bits for v2.

>> +ENTRY_FUNCTION(start_stm32mp15xc_lxa_tac, r0, r1, r2)
>> +{
>> +	stm32mp_cpu_lowlevel_init();
>> +
>> +	/*
>> +	 * stm32mp_cpu_lowlevel_init sets up a stack. Do the remaining
>> +	 * init in a non-naked function. Register r2 points to the fdt
>> +	 * from the FIT image which can be used as a default.
>> +	 */
> 
> "the fdt from the FIT image" seems to imply that this entry is only used
> as a 2nd state entry, but it's used as a 1st stage entry as well, isn't
> it?

s/FIT/FIP. First stage bootloader is TF-A.

> I would rephrase that to something like "in case of a 2nd stage boot r2
> points to the fdt..."

There is no first stage boot.

Cheers,
Ahmad

> 
> Sascha
> 

-- 
Pengutronix e.K.                  |                             |
Steuerwalder Str. 21              | http://www.pengutronix.de/  |
31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |




  reply	other threads:[~2025-04-14 11:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-11  7:27 [PATCH 0/3] ARM: stm32mp: add Linux Automation TAC/FairyTux2 Ahmad Fatoum
2025-04-11  7:27 ` [PATCH 1/3] ARM: stm32mp: drop all images with legacy STM32 header Ahmad Fatoum
2025-04-11  7:27 ` [PATCH 2/3] ARM: stm32mp: add Linux Automation TAC board Ahmad Fatoum
2025-04-14 11:23   ` Sascha Hauer
2025-04-14 11:42     ` Ahmad Fatoum [this message]
2025-04-14 11:59       ` Ahmad Fatoum
2025-04-11  7:27 ` [PATCH 3/3] ARM: stm32mp: add Linux Automation FairyTux 2 Ahmad Fatoum

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=9f905302-9a79-485f-9afa-45e98fa1aa40@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=l.goehrs@pengutronix.de \
    --cc=s.hauer@pengutronix.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