public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Dragan Simic <dsimic@manjaro.org>
To: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Jonas Karlman <jonas@kwiboo.se>,
	u-boot@lists.denx.de, Kever Yang <kever.yang@rock-chips.com>,
	Simon Glass <sjg@chromium.org>,
	Philipp Tomsich <philipp.tomsich@vrull.eu>,
	Tom Rini <trini@konsulko.com>,
	Jagan Teki <jagan@amarulasolutions.com>,
	Sughosh Ganu <sughosh.ganu@linaro.org>
Subject: Re: [PATCH 10/15] rng: rockchip: Use same compatible as linux
Date: Wed, 07 Feb 2024 08:26:45 +0100	[thread overview]
Message-ID: <3aee86337f0621c628b2c174c03087fb@manjaro.org> (raw)
In-Reply-To: <9c8e247b-e827-4c0d-953c-4cbab061bb24@gmx.de>

Hello Heinrich,

On 2024-02-07 08:12, Heinrich Schuchardt wrote:
> On 2/7/24 01:02, Jonas Karlman wrote:
>> Replace the rockchip,cryptov1-rng compatible with compatibles used in
>> the linux device tree for RK3288, RK3328 and RK3399 to ease sync of 
>> SoC
>> device tree from linux.
>> 
>> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
> 
> It is strange that U-Boot only uses the random number generation while
> Linux only seems to use the crypto algorithm acceleration.
> 
> U-Boot has some crypto accelerator drivers in drivers/crypto/. But here
> we only make use of modular exponentiation (see struct mod_exp_ops). We
> could improve on crypto acceleration.

Pleas, let's keep in mind that using crypto accelerators doesn't
always result in improved performance;  it all depends on the
workload and on the particular SoC.  For example, performing
crypto operations on small chunks of data may be much faster when
performed on a CPU core.  Another example is that some crypto IP
cores don't use the available CPU caches at all, which inevitably
slows them down.

Though, crypto IP cores are quite often more power-efficient vs.
performing the same crypto operations on a CPU core, which seems
to be the main reason why they get included in a number of SoCs.
Of course, this power efficiency becomes noticeable only when
offloading crypto operations performed on large chunks of data,
or when offloading for sizable amounts of time.

> The current change looks good to me.
> 
> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> 
>> ---
>>   arch/arm/dts/rk3328-u-boot.dtsi |  2 +-
>>   arch/arm/dts/rk3399-u-boot.dtsi |  2 +-
>>   drivers/rng/rockchip_rng.c      | 10 +++++++++-
>>   3 files changed, 11 insertions(+), 3 deletions(-)
>> 
>> diff --git a/arch/arm/dts/rk3328-u-boot.dtsi 
>> b/arch/arm/dts/rk3328-u-boot.dtsi
>> index e087b02893c1..d805c2f394f8 100644
>> --- a/arch/arm/dts/rk3328-u-boot.dtsi
>> +++ b/arch/arm/dts/rk3328-u-boot.dtsi
>> @@ -28,7 +28,7 @@
>>   	};
>> 
>>   	rng: rng@ff060000 {
>> -		compatible = "rockchip,cryptov1-rng";
>> +		compatible = "rockchip,rk3328-crypto";
>>   		reg = <0x0 0xff060000 0x0 0x4000>;
>>   		status = "okay";
>>   	};
>> diff --git a/arch/arm/dts/rk3399-u-boot.dtsi 
>> b/arch/arm/dts/rk3399-u-boot.dtsi
>> index 3423b882c437..87b173e59579 100644
>> --- a/arch/arm/dts/rk3399-u-boot.dtsi
>> +++ b/arch/arm/dts/rk3399-u-boot.dtsi
>> @@ -30,7 +30,7 @@
>>   	};
>> 
>>   	rng: rng@ff8b8000 {
>> -		compatible = "rockchip,cryptov1-rng";
>> +		compatible = "rockchip,rk3399-crypto";
>>   		reg = <0x0 0xff8b8000 0x0 0x1000>;
>>   		status = "okay";
>>   	};
>> diff --git a/drivers/rng/rockchip_rng.c b/drivers/rng/rockchip_rng.c
>> index 705b424cf3dd..e82b5572fec5 100644
>> --- a/drivers/rng/rockchip_rng.c
>> +++ b/drivers/rng/rockchip_rng.c
>> @@ -302,7 +302,15 @@ static const struct dm_rng_ops rockchip_rng_ops = 
>> {
>> 
>>   static const struct udevice_id rockchip_rng_match[] = {
>>   	{
>> -		.compatible = "rockchip,cryptov1-rng",
>> +		.compatible = "rockchip,rk3288-crypto",
>> +		.data = (ulong)&rk_cryptov1_soc_data,
>> +	},
>> +	{
>> +		.compatible = "rockchip,rk3328-crypto",
>> +		.data = (ulong)&rk_cryptov1_soc_data,
>> +	},
>> +	{
>> +		.compatible = "rockchip,rk3399-crypto",
>>   		.data = (ulong)&rk_cryptov1_soc_data,
>>   	},
>>   	{

  reply	other threads:[~2024-02-07  7:26 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-07  0:02 [PATCH 00/15] rockchip: rk3328: Update defconfigs, DTs and enable boot from SPI Jonas Karlman
2024-02-07  0:02 ` [PATCH 01/15] rockchip: rk3328: Update default u-boot, spl-boot-order prop Jonas Karlman
2024-02-07  2:58   ` Dragan Simic
2024-02-07  0:02 ` [PATCH 02/15] rockchip: rk3328-evb: Update defconfig Jonas Karlman
2024-02-07  0:02 ` [PATCH 03/15] rockchip: rk3328-rock64: " Jonas Karlman
2024-02-07  3:01   ` Dragan Simic
2024-02-07  7:53   ` Matwey V. Kornilov
2024-02-07  8:34     ` Jonas Karlman
2024-02-07  0:02 ` [PATCH 04/15] rockchip: rk3328-roc-cc: " Jonas Karlman
2024-02-07  5:52   ` Chen-Yu Tsai
2024-02-07  8:17     ` Jonas Karlman
2024-02-07  7:29   ` Chen-Yu Tsai
2024-02-07  0:02 ` [PATCH 05/15] rockchip: rk3328-rock-pi-e: " Jonas Karlman
2024-02-07  0:02 ` [PATCH 06/15] rockchip: rk3328-nanopi-r2: " Jonas Karlman
2024-02-07  0:02 ` [PATCH 07/15] rockchip: rk3328-orangepi-r1-plus: " Jonas Karlman
2024-02-07  9:54   ` Tianling Shen
2024-02-07  0:02 ` [PATCH 08/15] rockchip: rk3328: Fix loading FIT from SD-card when booting from eMMC Jonas Karlman
2024-02-07  0:02 ` [PATCH 09/15] gpio: rockchip: Use gpio alias id as gpio bank id Jonas Karlman
2024-02-07  0:02 ` [PATCH 10/15] rng: rockchip: Use same compatible as linux Jonas Karlman
2024-02-07  7:12   ` Heinrich Schuchardt
2024-02-07  7:26     ` Dragan Simic [this message]
2024-02-07  8:26     ` Jonas Karlman
2024-02-07  0:02 ` [PATCH 11/15] rockchip: rk3328: Sync device tree from linux v6.8-rc1 Jonas Karlman
2024-02-07  0:02 ` [PATCH 12/15] Revert "rockchip: Allow booting from SPI" Jonas Karlman
2024-02-07  0:02 ` [PATCH 13/15] rockchip: rk3328: Add support to build bootable SPI image Jonas Karlman
2024-02-08  3:53   ` Dragan Simic
2024-02-08 21:54     ` Jonas Karlman
2024-02-10 17:18       ` Dragan Simic
2024-02-10 19:30         ` Jonas Karlman
2024-02-10 23:04           ` Dragan Simic
2024-02-09  1:57     ` Da Xue
2024-02-10 17:21       ` Dragan Simic
2024-02-07  0:02 ` [PATCH 14/15] rockchip: rk3328-rock64: Enable boot from SPI NOR flash Jonas Karlman
2024-02-10 18:31   ` Dragan Simic
2024-02-10 19:38     ` Jonas Karlman
2024-02-10 22:31       ` Dragan Simic
2024-02-07  0:02 ` [PATCH 15/15] rockchip: rk3328-orangepi-r1-plus: " Jonas Karlman
2024-02-07  9:52   ` Tianling Shen
2024-02-10  1:15 ` [PATCH 00/15] rockchip: rk3328: Update defconfigs, DTs and enable boot from SPI John Clark

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=3aee86337f0621c628b2c174c03087fb@manjaro.org \
    --to=dsimic@manjaro.org \
    --cc=jagan@amarulasolutions.com \
    --cc=jonas@kwiboo.se \
    --cc=kever.yang@rock-chips.com \
    --cc=philipp.tomsich@vrull.eu \
    --cc=sjg@chromium.org \
    --cc=sughosh.ganu@linaro.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.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