firmware: tegra: Reword messaging terminology
authorTimo Alho <talho@nvidia.com>
Thu, 24 Jan 2019 17:03:52 +0000 (19:03 +0200)
committerThierry Reding <treding@nvidia.com>
Fri, 25 Jan 2019 14:57:52 +0000 (15:57 +0100)
commit165ce6e01d2d00bff2f10eba8dd679cee44163bd
treef3b3aae855155331f959fccc50ca791baf53b52c
parentbfeffd155283772bbe78c6a05dec7c0128ee500c
firmware: tegra: Reword messaging terminology

As a preparatory change to refactor BPMP driver to support other than
Tegra186 and Tegra194 chip generations, reword and slightly refactor
some of the functions to better match with what is actually happening
in the wire-level protocol.

The communication with BPMP is essentially a Remote Procedure Call
consisting of "request" and "response". Either side (BPMP or CPU) can
initiate the communication. The state machine for communication
consists of following steps (from Linux point of view):

Linux initiating the call:
 1) check that channel is free to transmit a request
    (is_request_channel_free)
 2) copy request message payload to shared location
 3) post the request in channel (post_request)
 4) notify BPMP that channel state has been updated (ring_doorbell)
 5) wait for response (is_response_ready)
 6) copy response message payload from shared location
 7) acknowledge the response in channel (ack_response)

BPMP initiating the call:
 1) wait for request (is_request_ready)
 2) copy request message payload from shared location
 3) acknowledge the request in channel (ack_request)
 4) check that channel is free to transmit response
    (is_response_channel_free)
 5) copy response message payload to shared location
 6) post the response message to channel (post_response)
 7) notify BPMP that channel state has been updated (ring_doorbell)

Signed-off-by: Timo Alho <talho@nvidia.com>
Acked-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/firmware/tegra/bpmp.c