Re: [PATCH v3 3/4] dt-bindings: firmware: Add Qualcomm QSEECOM interface

From: Sudeep Holla
Date: Tue May 02 2023 - 04:38:40 EST


On Thu, Mar 09, 2023 at 03:27:01AM +0100, Maximilian Luz wrote:
> On 3/9/23 02:33, Dmitry Baryshkov wrote:
> > On 09/03/2023 00:44, Maximilian Luz wrote:
> > > On 3/8/23 23:16, Rob Herring wrote:
> > > > On Sun, Mar 05, 2023 at 03:21:18AM +0100, Maximilian Luz wrote:
> > > > > Add bindings for the Qualcomm Secure Execution Environment interface
> > > > > (QSEECOM).
> > > >
> > > > Pretty sure I already asked, but no answer in the commit message. Why do
> > > > we need this? You've already declared the platform supports SCM calls
> > > > with "qcom,scm". Why can't you probe whether you have QSEECOM or not? DT
> > > > is for non-discoverable h/w we are stuck with.
> > >
> > > Yes, you've asked this before but I can only repeat what I've written in
> > > my last response to your question: I am not aware of any way to properly
> > > discover the interface at runtime from software.
> > >
> > > If it makes you happy, I can put this in the commit message as well...
> > >
> > > > Why is software made non-discoverable too?
> > >
> > > Please direct that question at the Qualcomm guys who actually designed
> > > that interface. I can't give you an answer to that, and I'm not all that
> > > happy about this either.
> > >
> > > To reiterate: I've reverse engineered this based on the Windows driver.
> > > The Windows driver loads on an ACPI HID and it doesn't use any function
> > > to check/verify whether the interface is actually present. Adding a DT
> > > entry is the straight-forward adaption to having a HID in ACPI.
> > >
> > > > Nodes with only a compatible string are usually just an abuse of DT to
> > > > instantiate some driver.
> > >
> > > If you or anyone here has any idea on how to discover the presence of
> > > this, please feel free to let me know and I'd be happy to implement
> > > that. Until then, I unfortunately don't see any other way of dealing
> > > with this.
> >
> > You can probably try requesting QSEECOM version. According to msm-3.18:
> >
> >         uint32_t feature = 10;
> >
> >         rc = qseecom_scm_call(6, 3, &feature, sizeof(feature),
> >                 &resp, sizeof(resp));
> >         pr_info("qseecom.qsee_version = 0x%x\n", resp.result);
> >         if (rc) {
> >                 pr_err("Failed to get QSEE version info %d\n", rc);
> >                 goto exit_del_cdev;
> >         }
> >
>
> Thanks! I'll give that a try.
>
> As I can't test this on a device that doesn't have qseecom, it would
> probably be a good idea if someone could test this on a device that has
> qcom_scm but no qseecom (if those even exist) to make sure this doesn't
> misbehave.
>

TBH, this has been going in round for quite sometime. We have been asking
you to depend on existing platform compatible + a query or a check on the
version. Since you do have a platform that is working, we can start making
it min "qseecom.qsee_version" supported and then adjust the version based
on the testing or the requirement. What do you think ?

--
Regards,
Sudeep