[EXT] Re: [PATCH v1] 3: Added dcp_rng driver device binding code

Kshitiz Varshney kshitiz.varshney at nxp.com
Wed Dec 21 12:08:09 CET 2022


Please find comment inline.

Regards,
Kshitiz

-----Original Message-----
From: Simon Glass <sjg at chromium.org> 
Sent: Thursday, September 8, 2022 11:49 PM
To: Kshitiz Varshney <kshitiz.varshney at nxp.com>
Cc: U-Boot Mailing List <u-boot at lists.denx.de>; Horia Geanta <horia.geanta at nxp.com>; Pankaj Gupta <pankaj.gupta at nxp.com>; Varun Sethi <V.Sethi at nxp.com>; Gaurav Jain <gaurav.jain at nxp.com>; Rahul Kumar Yadav <rahulkumar.yadav at nxp.com>; Vabhav Sharma <vabhav.sharma at nxp.com>; Sahil Malhotra <sahil.malhotra at nxp.com>; Ye Li <ye.li at nxp.com>; Heinrich Schuchardt <xypron.glpk at gmx.de>; Stefano Babic <sbabic at denx.de>; Fabio Estevam <festevam at gmail.com>; Peng Fan <peng.fan at nxp.com>
Subject: [EXT] Re: [PATCH v1] 3: Added dcp_rng driver device binding code

Caution: EXT Email

Hi Kshitiz,

+Ilias Apalodimas


On Thu, 8 Sept 2022 at 02:59, Kshitiz Varshney <kshitiz.varshney at nxp.com> wrote:
>
> From: Kshitiz <kshitiz.varshney at nxp.com>
>
> This commit manually binds dcp_rng device driver and initalizes it 
> inside
> arch_misc_init() function.
>
> Signed-off-by: Kshitiz Varshney <kshitiz.varshney at nxp.com>
> Reviewed-by: Ye Li <ye.li at nxp.com>
> ---
>  arch/arm/mach-imx/mx6/soc.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
>
> diff --git a/arch/arm/mach-imx/mx6/soc.c b/arch/arm/mach-imx/mx6/soc.c 
> index 3e538754d9..9bf16119c2 100644
> --- a/arch/arm/mach-imx/mx6/soc.c
> +++ b/arch/arm/mach-imx/mx6/soc.c
> @@ -31,6 +31,8 @@
>  #include <hang.h>
>  #include <cpu_func.h>
>  #include <env.h>
> +#include<dm/device-internal.h>
> +#include<dm/lists.h>
>
>  DECLARE_GLOBAL_DATA_PTR;
>
> @@ -1005,6 +1007,20 @@ int arch_misc_init(void)
>                 if (ret)
>                         printf("Failed to initialize caam_jr: %d\n", ret);
>         }
> +
> +       if (IS_ENABLED(CONFIG_FSL_DCP_RNG)) {
> +               struct udevice *dev;
> +               int ret;
> +
> +               ret = device_bind_driver(NULL, "dcp_rng", "dcp_rng", 
> + NULL);

This needs to be in the device tree. This it the kind of madness I was warning about with Ilias, so I have copied him here.

We need to stop manually binding devices when they should be in the DT.

I have removed manual binding in next patch instead used u-boot device tree rngb entry for binding device automatically.

> +               if (ret)
> +                       printf("Couldn't bind dcp rng driver (%d)\n", 
> + ret);
> +
> +               ret = uclass_get_device_by_driver(UCLASS_RNG, DM_DRIVER_GET(dcp_rng), &dev);
> +               if (ret)
> +                       printf("Failed to initialize dcp rng: %d\n", ret);
> +       }
> +
>         setup_serial_number();
>         return 0;
>  }
> --
> 2.25.1
>

Regards,
SImon


More information about the U-Boot mailing list