mbox series

[V2,0/2] mailbox: tmel-qmp: Introduce QCOM TMEL QMP mailbox driver

Message ID 20241231054900.2144961-1-quic_srichara@quicinc.com (mailing list archive)
Headers show
Series mailbox: tmel-qmp: Introduce QCOM TMEL QMP mailbox driver | expand

Message

Sricharan Ramabadhran Dec. 31, 2024, 5:48 a.m. UTC
From: Sricharan Ramabadhran <quic_srichara@quicinc.com>

The QMP mailbox is the primary means of communication between TME-L SS
and other subsystem on the SoC. A dedicated pair of inbound and outbound
mailboxes is implemented for each subsystem/external execution environment
which needs to communicate with TME-L for security services. The inbound
mailboxes are used to send IPC requests to TME-L, which are then processed
by TME-L firmware and accordingly the responses are sent to the requestor
via outbound mailboxes.

It is an IPC transport protocol which is light weight and supports
a subset of API's. It handles link initialization, negotiation,
establishment and communication across client(APPSS/BTSS/AUDIOSS)
and server(TME-L SS).

   -----------------------------------------------       ---------------------------------------------------
  |                                              |       |                                                 |
  |                 SOC  CLIENT                  | SOC   |                TME-L  SS                        |
  |                                              | AHB   |                                                 |
  |     ----------    ---------   ---------      |       | ------    -------     --------    ------------  |
  |     |        |    |       |   |       |      | WO    | |     | R |     |     |      |    |SERVICES   | |
  |     | APPS   |<-->| TMEL  |<->|       |------------->| | IN  |-->|     |     | TMEL |    |--------   | |
  |     |        |    | COM   |   | QMP   |      | RO    | |     | W | QMP |<--->| COM  |<-->| a) ATTEST | |
  |     |        |    |       |   |       |<-------------| | OUT |<--|     |     |      |    | b) CRYPTO | |
  |     |        |    |       |   |       |      |       | |     |   |     |     |      |    | .. more   | |
  |     ---------     ---------   ---------      |       | ------    -------     -------     ------------  |
  |                                              |       |                                                 |
   -----------------------------------------------       --------------------------------------------------

TME-L SS provides different kinds of services like secureboot, remote image authentication,
key management, crypto, OEM provisioning etc. This patch adds support for remote image
authentication. Support for rest of the services can be added.

Remote proc driver subscribes to this mailbox and uses the mbox_send_message to use
TME-L to securely authenticate/teardown the images.

Since clients like same rproc driver use SCM/TMEL across socs, the goal here was to abstract the
TMEL-QMP SS functionality, so that clients should be able to connect and send messages with
a common API.

[v1] RFC Post

[v2]
     Added HW description in the bindings patch.
     Fixed review comments for bindings from Krzysztof and Dmitry
     Changed patch#2 driver to add work for mailbox tx processing    
     Cleaned up patch#2 for some checkpatch warnings.
     There are some checkpatch [CHECK] like below, which looks like false positive.

	CHECK: Macro argument 'm' may be better as '(m)' to avoid precedence issues
	#1072: FILE: include/linux/mailbox/tmelcom-qmp.h:40:
	+#define TMEL_MSG_UID_CREATE(m, a)      ((u32)(((m & 0xff) << 8) | (a & 0xff)))


Sricharan Ramabadhran (2):
  dt-bindings: mailbox: Document qcom,tmel-qmp
  mailbox: tmelite-qmp: Introduce TMEL QMP mailbox driver

 .../bindings/mailbox/qcom,tmelite-qmp.yaml    |  65 ++
 drivers/mailbox/Kconfig                       |   7 +
 drivers/mailbox/Makefile                      |   2 +
 drivers/mailbox/qcom-tmel-qmp.c               | 969 ++++++++++++++++++
 include/linux/mailbox/tmelcom-qmp.h           | 157 +++
 5 files changed, 1200 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mailbox/qcom,tmelite-qmp.yaml
 create mode 100644 drivers/mailbox/qcom-tmel-qmp.c
 create mode 100644 include/linux/mailbox/tmelcom-qmp.h

Comments

Krzysztof Kozlowski Dec. 31, 2024, 7:57 a.m. UTC | #1
On 31/12/2024 06:48, Sricharan R wrote:
> Since clients like same rproc driver use SCM/TMEL across socs, the goal here was to abstract the
> TMEL-QMP SS functionality, so that clients should be able to connect and send messages with
> a common API.
> 
> [v1] RFC Post
> 
> [v2]
>      Added HW description in the bindings patch.
>      Fixed review comments for bindings from Krzysztof and Dmitry

Which ones? This is just too vague.

Best regards,
Krzysztof
Sricharan Ramabadhran Jan. 3, 2025, 12:10 p.m. UTC | #2
On 12/31/2024 1:27 PM, Krzysztof Kozlowski wrote:
> On 31/12/2024 06:48, Sricharan R wrote:
>> Since clients like same rproc driver use SCM/TMEL across socs, the goal here was to abstract the
>> TMEL-QMP SS functionality, so that clients should be able to connect and send messages with
>> a common API.
>>
>> [v1] RFC Post
>>
>> [v2]
>>       Added HW description in the bindings patch.
>>       Fixed review comments for bindings from Krzysztof and Dmitry
> 
> Which ones? This is just too vague.
ok, i mentioned detailed in respective patches.
will have detailed in Cover letter also for next version.

Regards,
  Sricharan
Krzysztof Kozlowski Jan. 3, 2025, 12:41 p.m. UTC | #3
On 03/01/2025 13:10, Sricharan Ramabadhran wrote:
> 
> 
> On 12/31/2024 1:27 PM, Krzysztof Kozlowski wrote:
>> On 31/12/2024 06:48, Sricharan R wrote:
>>> Since clients like same rproc driver use SCM/TMEL across socs, the goal here was to abstract the
>>> TMEL-QMP SS functionality, so that clients should be able to connect and send messages with
>>> a common API.
>>>
>>> [v1] RFC Post
>>>
>>> [v2]
>>>       Added HW description in the bindings patch.
>>>       Fixed review comments for bindings from Krzysztof and Dmitry
>>
>> Which ones? This is just too vague.
> ok, i mentioned detailed in respective patches.
> will have detailed in Cover letter also for next version.
> 
Just say that detailed changelog is in individual patches.

Best regards,
Krzysztof