public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Dragan Simic <dsimic@manjaro.org>
To: Jonas Karlman <jonas@kwiboo.se>
Cc: Kever Yang <kever.yang@rock-chips.com>,
	Simon Glass <sjg@chromium.org>,
	Philipp Tomsich <philipp.tomsich@vrull.eu>,
	Chris Morgan <macromorgan@hotmail.com>,
	Tom Rini <trini@konsulko.com>,
	Quentin Schulz <quentin.schulz@theobroma-systems.com>,
	u-boot@lists.denx.de
Subject: Re: [PATCH v2 07/23] rockchip: rk35xx: Enable random generator
Date: Mon, 15 Apr 2024 10:21:14 +0200	[thread overview]
Message-ID: <b56ecf1050aba369c9ebbb8d50effe0e@manjaro.org> (raw)
In-Reply-To: <f4f5d6c8-4d24-420b-a23e-af2ea9629628@kwiboo.se>

On 2024-04-15 10:03, Jonas Karlman wrote:
> On 2024-04-15 08:37, Dragan Simic wrote:
>> Please see a couple of comments below.
>> 
>> On 2024-04-13 20:13, Jonas Karlman wrote:
>>> The RK35xx SoCs contain a crypto engine block that can generate 
>>> random
>>> numbers.
>>> 
>>> Enable rng node in soc u-boot.dtsi and enable Kconfig options to take
>>> advantage of the random generator.
>>> 
>>> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
>>> ---
>>> v2: No change
>>> ---
>>>  arch/arm/dts/rk3566-anbernic-rgxx3-u-boot.dtsi | 6 ------
>>>  arch/arm/dts/rk356x-u-boot.dtsi                | 5 +++++
>>>  arch/arm/dts/rk3588s-u-boot.dtsi               | 1 -
>>>  arch/arm/mach-rockchip/Kconfig                 | 4 ++++
>>>  configs/anbernic-rgxx3-rk3566_defconfig        | 2 --
>>>  5 files changed, 9 insertions(+), 9 deletions(-)
>>> 
>>> diff --git a/arch/arm/dts/rk3566-anbernic-rgxx3-u-boot.dtsi
>>> b/arch/arm/dts/rk3566-anbernic-rgxx3-u-boot.dtsi
>>> index 791f16b206f2..793ed4ae8ae0 100644
>>> --- a/arch/arm/dts/rk3566-anbernic-rgxx3-u-boot.dtsi
>>> +++ b/arch/arm/dts/rk3566-anbernic-rgxx3-u-boot.dtsi
>>> @@ -6,12 +6,6 @@
>>>  	chosen {
>>>  		u-boot,spl-boot-order = "same-as-spl", &sdmmc1, &sdmmc0;
>>>  	};
>>> -
>>> -	rng: rng@fe388000 {
>>> -		compatible = "rockchip,cryptov2-rng";
>>> -		reg = <0x0 0xfe388000 0x0 0x2000>;
>>> -		status = "okay";
>>> -	};
>>>  };
>>> 
>>>  &dsi_dphy0 {
>>> diff --git a/arch/arm/dts/rk356x-u-boot.dtsi
>>> b/arch/arm/dts/rk356x-u-boot.dtsi
>>> index d347080577d9..05367216e118 100644
>>> --- a/arch/arm/dts/rk356x-u-boot.dtsi
>>> +++ b/arch/arm/dts/rk356x-u-boot.dtsi
>>> @@ -21,6 +21,11 @@
>>>  		bootph-all;
>>>  	};
>>> 
>>> +	rng: rng@fe388000 {
>>> +		compatible = "rockchip,cryptov2-rng";
>>> +		reg = <0x0 0xfe388000 0x0 0x2000>;
>> 
>> Shouldn't
>> 
>>   +		status = "okay";
>> 
>> also be specified here?
> 
> It is not needed as "okay" is the implied status when status prop is
> undefined, and my understanding is that DT maintainers prefer not to
> include status = "okay" where the initial node is defined.
> 
> More correctly if status prop is defined it must explicitly have "okay"
> anything else result in a disabled node, removing the status prop
> entirely has the same effect as status = "okay" in a board file.

I see, thanks for the clarification.  In that case, there seem to be
a few redundant instances of 'status = "okay";' in various U-Boot dtsi
files, which should probably be deleted.

>>> +	};
>>> +
>>>  	otp: nvmem@fe38c000 {
>>>  		compatible = "rockchip,rk3568-otp";
>>>  		reg = <0x0 0xfe38c000 0x0 0x4000>;
>>> diff --git a/arch/arm/dts/rk3588s-u-boot.dtsi
>>> b/arch/arm/dts/rk3588s-u-boot.dtsi
>>> index ac67c777adea..233eb79d9ba2 100644
>>> --- a/arch/arm/dts/rk3588s-u-boot.dtsi
>>> +++ b/arch/arm/dts/rk3588s-u-boot.dtsi
>>> @@ -91,7 +91,6 @@
>>>  	rng: rng@fe378000 {
>>>  		compatible = "rockchip,trngv1";
>>>  		reg = <0x0 0xfe378000 0x0 0x200>;
>>> -		status = "disabled";
>> 
>> Shouldn't it be enabled instead?
> 
> Same as above, not defining any status prop result in node being 
> enabled.
> 
> Board u-boot.dtsi-files could disable the node with status = "disabled"
> if they absolutely do not want to have the rng node in U-Boot.

Thanks once again for the clarification.  Please include this tag:

Reviewed-by: Dragan Simic <dsimic@manjaro.org>

>> 
>>>  	};
>>> 
>>>  	usbdp_phy0: phy@fed80000 {
>>> diff --git a/arch/arm/mach-rockchip/Kconfig
>>> b/arch/arm/mach-rockchip/Kconfig
>>> index 649c22618f36..247b9a3146c2 100644
>>> --- a/arch/arm/mach-rockchip/Kconfig
>>> +++ b/arch/arm/mach-rockchip/Kconfig
>>> @@ -305,9 +305,11 @@ config ROCKCHIP_RK3568
>>>  	select BOARD_LATE_INIT
>>>  	select DM_REGULATOR_FIXED
>>>  	select DM_RESET
>>> +	imply DM_RNG
>>>  	imply MISC_INIT_R
>>>  	imply MMC_HS200_SUPPORT if MMC_SDHCI_ROCKCHIP
>>>  	imply OF_LIBFDT_OVERLAY
>>> +	imply RNG_ROCKCHIP
>>>  	imply ROCKCHIP_COMMON_BOARD
>>>  	imply ROCKCHIP_OTP
>>>  	imply SPL_ATF_NO_PLATFORM_PARAM if SPL_ATF
>>> @@ -334,9 +336,11 @@ config ROCKCHIP_RK3588
>>>  	select DM_RESET
>>>  	imply BOOTSTD_FULL
>>>  	imply CLK_SCMI
>>> +	imply DM_RNG
>>>  	imply MISC_INIT_R
>>>  	imply MMC_HS200_SUPPORT if MMC_SDHCI_ROCKCHIP
>>>  	imply OF_LIBFDT_OVERLAY
>>> +	imply RNG_ROCKCHIP
>>>  	imply ROCKCHIP_COMMON_BOARD
>>>  	imply ROCKCHIP_OTP
>>>  	imply SCMI_FIRMWARE
>>> diff --git a/configs/anbernic-rgxx3-rk3566_defconfig
>>> b/configs/anbernic-rgxx3-rk3566_defconfig
>>> index 24b050c59b53..110237e798f9 100644
>>> --- a/configs/anbernic-rgxx3-rk3566_defconfig
>>> +++ b/configs/anbernic-rgxx3-rk3566_defconfig
>>> @@ -68,8 +68,6 @@ CONFIG_REGULATOR_RK8XX=y
>>>  CONFIG_PWM_ROCKCHIP=y
>>>  CONFIG_SPL_RAM=y
>>>  # CONFIG_RAM_ROCKCHIP_DEBUG is not set
>>> -CONFIG_DM_RNG=y
>>> -CONFIG_RNG_ROCKCHIP=y
>>>  # CONFIG_RNG_SMCCC_TRNG is not set
>>>  CONFIG_BAUDRATE=1500000
>>>  CONFIG_DEBUG_UART_SHIFT=2

  reply	other threads:[~2024-04-15  8:21 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-13 18:13 [PATCH v2 00/23] rockchip: rk35xx: Miscellaneous fixes and updates Jonas Karlman
2024-04-13 18:13 ` [PATCH v2 01/23] clk: rockchip: rk356x: Add CLK_USB3OTGx_REF support Jonas Karlman
2024-04-19  2:44   ` Sean Anderson
2024-04-13 18:13 ` [PATCH v2 02/23] clk: rockchip: rk3588: Add REF_CLK_USB3OTGx support Jonas Karlman
2024-04-19  2:44   ` Sean Anderson
2024-04-13 18:13 ` [PATCH v2 03/23] rockchip: rk35xx: Drop USB_GADGET_PRODUCT_NUM Kconfig option Jonas Karlman
2024-04-15  6:25   ` Dragan Simic
2024-04-13 18:13 ` [PATCH v2 04/23] rockchip: rk3588: Drop REGULATOR_PWM " Jonas Karlman
2024-04-15  6:28   ` Dragan Simic
2024-04-13 18:13 ` [PATCH v2 05/23] rockchip: rk3566-anbernic-rgxx3: Remove SPL_ROCKCHIP_BACK_TO_BROM option Jonas Karlman
2024-04-13 18:13 ` [PATCH v2 06/23] rockchip: rk35xx: Sort imply statements alphabetically Jonas Karlman
2024-04-15  6:29   ` Dragan Simic
2024-04-13 18:13 ` [PATCH v2 07/23] rockchip: rk35xx: Enable random generator Jonas Karlman
2024-04-15  6:37   ` Dragan Simic
2024-04-15  8:03     ` Jonas Karlman
2024-04-15  8:21       ` Dragan Simic [this message]
2024-04-13 18:13 ` [PATCH v2 08/23] rockchip: rk35xx: Imply support for GbE PHY Jonas Karlman
2024-04-15  6:41   ` Dragan Simic
2024-04-13 18:13 ` [PATCH v2 09/23] rockchip: rk356x: Imply enhanced features for standard boot Jonas Karlman
2024-04-15  6:43   ` Dragan Simic
2024-04-13 18:13 ` [PATCH v2 10/23] rockchip: rk35xx: Sort soc u-boot.dtsi alphabetically Jonas Karlman
2024-04-15  8:46   ` Quentin Schulz
2024-04-15 10:50     ` Jonas Karlman
2024-04-13 18:13 ` [PATCH v2 11/23] rockchip: rk356x: Update bootph props Jonas Karlman
2024-04-13 18:13 ` [PATCH v2 12/23] rockchip: rk3588: " Jonas Karlman
2024-04-15  8:55   ` Quentin Schulz
2024-04-15 12:40     ` Jonas Karlman
2024-04-13 18:13 ` [PATCH v2 13/23] rockchip: rk3566-pinetab2: Fix reading FIT from SPI flash Jonas Karlman
2024-04-13 18:13 ` [PATCH v2 14/23] rockchip: rk3588-coolpi: Add boards to documentation Jonas Karlman
2024-04-15  6:47   ` Dragan Simic
2024-04-15  8:56   ` Quentin Schulz
2024-04-15  8:58     ` Dragan Simic
2024-04-15 14:11       ` Jonas Karlman
2024-04-13 18:13 ` [PATCH v2 15/23] rockchip: rk3588-toybrick: Add missing Kconfig options Jonas Karlman
2024-04-15  8:58   ` Quentin Schulz
2024-04-15  9:04     ` Dragan Simic
2024-04-15  9:10       ` Quentin Schulz
2024-04-15 14:17         ` Jonas Karlman
2024-04-13 18:13 ` [PATCH v2 16/23] rockchip: rk3588-turing-rk1: Use dwc3-generic driver Jonas Karlman
2024-04-13 18:13 ` [PATCH v2 17/23] rockchip: rk3588-edgeble-neu6: Enable FIT checksum validation Jonas Karlman
2024-04-13 18:13 ` [PATCH v2 18/23] rockchip: rk356x-generic: Fix eMMC and SD-card pinctrl Jonas Karlman
2024-04-13 18:13 ` [PATCH v2 19/23] rockchip: rk356x-generic: Add support for SPI flash Jonas Karlman
2024-04-13 18:13 ` [PATCH v2 20/23] rockchip: rk356x-generic: Add support for USB OTG Jonas Karlman
2024-04-13 18:13 ` [PATCH v2 21/23] rockchip: rk3588-generic: " Jonas Karlman
2024-04-13 18:13 ` [PATCH v2 22/23] rockchip: rk35xx-generic: Disable unused features Jonas Karlman
2024-04-13 18:13 ` [PATCH v2 23/23] rockchip: rk3588: Enable use of eMMC HS200 mode on a few missed boards Jonas Karlman
2024-04-15  7:00   ` Dragan Simic
2024-04-15  8:23     ` Jonas Karlman
2024-04-15  8:36       ` Dragan Simic
2024-04-15  9:02   ` Quentin Schulz

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=b56ecf1050aba369c9ebbb8d50effe0e@manjaro.org \
    --to=dsimic@manjaro.org \
    --cc=jonas@kwiboo.se \
    --cc=kever.yang@rock-chips.com \
    --cc=macromorgan@hotmail.com \
    --cc=philipp.tomsich@vrull.eu \
    --cc=quentin.schulz@theobroma-systems.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.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