[PATCH v5 1/2] arm: rmobile: Add RZ/G2[HMNE] SoC support

Biju Das biju.das.jz at bp.renesas.com
Tue Nov 3 11:06:25 CET 2020


Hi Marek,

> Subject: Re: [PATCH v5 1/2] arm: rmobile: Add RZ/G2[HMNE] SoC support
> 
> On 11/1/20 8:26 PM, Biju Das wrote:
> > Hi Marek,
> 
> Hi,
> 
> [...]
> 
> >>> @@ -23,7 +48,9 @@ static u32 rmobile_get_prr(void)
> >>>
> >>>   u32 rmobile_get_cpu_type(void)
> >>>   {
> >>> -	return (rmobile_get_prr() & 0x00007F00) >> 8;
> >>> +	const u32 soc_id = (rmobile_get_prr() & 0x00007F00) >> 8;
> >>
> >> The soc_id = ... can be inlined into get_cpu_type().
> >>
> >> However, you might want to cache the result of rmobile_get_cpu_type()
> >> , because doing OF match every time this is called is expensive.
> >
> > I agree calling OF match is expensive. So I have ported Renesas SoC
> > identification driver  from Linux to u-boot which will cache the
> > family type, soc_id and revision. I already sent a patch for
> > supporting soc_id in UCLASS_SOC in ML[4] [4]
> >
> https://jpn01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fpatch
> > work.ozlabs.org%2Fproject%2Fuboot%2Fpatch%2F20201030140724.12773-
> 1-bij
> >
> u.das.jz%40bp.renesas.com%2F&data=04%7C01%7Cbiju.das.jz%40bp.r
> enes
> >
> as.com%7C23804e7d89d0437047b308d87f654edd%7C53d82571da1947e49cb4
> 625a16
> >
> 6a4a2a%7C0%7C1%7C637399420383910105%7CUnknown%7CTWFpbGZsb3d8
> eyJWIjoiMC
> >
> 4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&
> amp;sd
> >
> ata=%2Bu6HZyimz2%2Froy%2FEfTAzAxXupL0hDSBGUqT4%2B%2F2lVJ8%3D&
> amp;reser
> > ved=0
> >
> > On the next version, I will send Renesas SoC identification driver,
> > which supports caching family type which can be used to provide unique
> identification for CPU type.
> 
> Please make sure to check it on RCar2 as well, those use SPL and the SPL size
> is quite limited.

Currently SoC identification driver is enabled only for RZ/G2 boards and support is added to both R-Car Gen3 and RZ/G2 devices.

For the disabled case, the UCLASS-SOC class functions are inlined to "NULL"  for soc_device_match and rest of the api's it is "-ENOSYS".

I agree, in future we need to add support for RCar2 as well, since we are going to add u-boot support for RZ/G1 devices.
Please find the size details related to R-Car Gen2(by adding support for R-Car M2-W and RZ/G1M SoC).

There is increase of 944 bytes, for R-Car Gen2 device, if we enable Renesas SoC identification driver for Gen2 devices.

Current u-boot-sh/master
-----------------------------------
$ ls -al u-boot.bin 
-rw-r--r-- 1 biju biju 523001 Nov  3 09:16 u-boot.bin

Current u-boot-sh/master + SoC renesas driver (R-Car M2-W enabled only case)
--------------------------------------------------------------------------------------------
$ ls -al u-boot.bin 
-rw-r--r-- 1 biju biju 523945 Nov  3 09:47 u-boot.bin

If you agree, we will add support for Gen2 to SoC identification driver later. Currently there is no users for using it.
Please let me know.

Regards,
Biju



More information about the U-Boot mailing list