Re: [PATCH] ARM: webasto-ccbv2: Add variant with 512MB RAM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxxx
> 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@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux