[...]

On Sun Aug 23, 2026 at 10:47 PM EEST, Jan Kiszka wrote:
> +
>  /**
>   * struct optee_private - OP-TEE driver private data
>   * @rpmb_mmc:                mmc device for the RPMB partition
> diff --git a/drivers/tee/optee/rpmb.c b/drivers/tee/optee/rpmb.c
> index bacced6af6c..f7312d7171c 100644
> --- a/drivers/tee/optee/rpmb.c
> +++ b/drivers/tee/optee/rpmb.c
> @@ -191,3 +191,22 @@ void optee_suppl_rpmb_release(struct udevice *dev)
>  {
>       release_mmc(dev_get_priv(dev));
>  }
> +
> +void optee_rpmb_available(void)
> +{
> +     struct udevice *dev;
> +     struct uclass *uc;
> +     u32 tee_sess;
> +
> +     uclass_id_foreach_dev(UCLASS_TEE, dev, uc) {
> +             if (strcmp(dev->driver->name, "optee") != 0)
> +                     continue;
> +
> +             if (optee_open_enum_session(dev, &tee_sess) != 0)
> +                     continue;
> +
> +             optee_bind_services(dev, tee_sess, PTA_CMD_GET_DEVICES_RPMB);

Will this work if devices are bound but not probed? IOW do we need a 
device_active() check?

> +
> +             tee_close_session(dev, tee_sess);
> +     }
> +}
> diff --git a/include/tee/optee.h b/include/tee/optee.h
> index d1194493780..755533b2c0b 100644
> --- a/include/tee/optee.h
> +++ b/include/tee/optee.h
> @@ -74,4 +74,10 @@ static inline bool is_optee_smc_api(void)
>  }
>  #endif
>
> +#if defined(CONFIG_OPTEE) && defined(CONFIG_SUPPORT_EMMC_RPMB)
> +void optee_rpmb_available(void);
> +#else
> +static inline void optee_rpmb_available(void) {}
> +#endif
> +
>  #endif /* _OPTEE_H */

Thanks
/Ilias

Reply via email to