mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Rouven Czerwinski <r.czerwinski@pengutronix.de>,
	Holger Assmann <h.assmann@pengutronix.de>,
	barebox@lists.infradead.org
Subject: Re: [PATCH] ARM: webasto-ccbv2: Add variant with 512MB RAM
Date: Tue, 4 May 2021 11:51:24 +0200	[thread overview]
Message-ID: <d9cff667-e896-fb06-2f1a-254da72bf1ce@pengutronix.de> (raw)
In-Reply-To: <00c790b9dd842a8b6ce6f0bd71869b45baba7e05.camel@pengutronix.de>

Hi,

On 04.05.21 11:36, Rouven Czerwinski wrote:
> Hi Holger,
> 
> On Tue, 2021-05-04 at 11:26 +0200, Holger Assmann wrote:
>>
>> diff --git a/arch/arm/boards/webasto-ccbv2/lowlevel.c b/arch/arm/boards/webasto-ccbv2/lowlevel.c
>> index 8529ea3735..d3c9fa73f9 100644
>> --- a/arch/arm/boards/webasto-ccbv2/lowlevel.c
>> +++ b/arch/arm/boards/webasto-ccbv2/lowlevel.c
>>
>> -static void noinline start_ccbv2(u32 r0)
>> +static void noinline start_ccbv2(u32 r0, unsigned long memsize)
>>  {
>>  	int tee_size;
>>  	void *tee;
>> @@ -48,7 +48,7 @@ static void noinline start_ccbv2(u32 r0)
>>  	 */
>>  	if(IS_ENABLED(CONFIG_FIRMWARE_CCBV2_OPTEE)
>>  	   && !(r0 > MX6_MMDC_P0_BASE_ADDR
>> -	        &&  r0 < MX6_MMDC_P0_BASE_ADDR + SZ_256M)) {
>> +	        &&  r0 < MX6_MMDC_P0_BASE_ADDR + memsize)) {

You could hardcode memsize == SZ_512M here.

>>  		get_builtin_firmware(ccbv2_optee_bin, &tee, &tee_size);
> 
> Unfortunately, OP-TEE build for the old 256MB variant won't work for
> the new 512MB variant. Depending on the OP-TEE Memory size we should
> add a new FIRMWARE KCONFIG variable and retrieve the correct firmware
> per board, i.e.
> 
> if (memsize == SZ_256M) {
> 	get_builtin_firmware(ccbv2_optee_bin, &tee, &tee_size)
> } else {
> 	get_builtin_firmware(ccbv2_optee_512m_bin, &tee, &tee_size)
> 
> with a new FIRMWARE_CCBV2_OPTEE_512M symbol.
> 
> TBH, I don't like this, since our firmware KConfig will expand
> needlessly for the variants. However currently OP-TEE is not setup to
> be able to boot based on different memory sizes…

You could just ship both firmwares always if they are small enough?

If you got some GPIO to differentiate between both variants, you could
also use the same image for both (and drop the r0 hack above).

Cheers,
Ahmad

> 
> Regards,
> Rouven Czerwinski
> 
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
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 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2021-05-04  9:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-04  9:26 Holger Assmann
2021-05-04  9:36 ` Rouven Czerwinski
2021-05-04  9:51   ` Ahmad Fatoum [this message]

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=d9cff667-e896-fb06-2f1a-254da72bf1ce@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=h.assmann@pengutronix.de \
    --cc=r.czerwinski@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