public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC 0/3] mmc: sdhci-brcmstb: Add rpmb sharing support
@ 2025-02-06 22:09 Kamal Dasu
  2025-02-06 22:09 ` [PATCH RFC 1/3] mmc: add request_start() and request_done() mmc ops Kamal Dasu
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Kamal Dasu @ 2025-02-06 22:09 UTC (permalink / raw)
  To: ulf.hansson, linux-kernel, linux-arm-kernel, adrian.hunter,
	linux-mmc, robh, krzk+dt, conor+dt, wsa+renesas
  Cc: f.fainelli, bcm-kernel-feedback-list, Kamal Dasu

This patch set adds support for Broadcom TZOS to read and write to RPMB
partition using synchronized access to the controller hardware.
To achieve this Linux OS and the secure TZOS make use of:
- shared hardware semaphore register
- a set of SDIO shared work registers and
- IPI interrupt registers
The sdio shared work registers indicates next in queue to access the controller
and current agent in the queue. The currently running OS that needs access to
the controller puts itself in its slot of work register and if its next in line
it can try to grab the hardware semaphore and complete its mmc requests.
Next agent queue state is changed under the hardware semaphore lock before it
release it by looking at work slot register. send and receive IPI interrupts
between linux and secure world are used to indicatecompletion of transaction to
the waiting OS. TZOS has its own RPMB driver which accesses partition when it
wants to read/write RPMB frames. Current implementation assumes Linux and TZOS
as the two work agents. 

Change required adding two core mmc_host_ops request_start() and request_done()
to let the host controller driver know when a mmc request starts and ends so
that the access can be synchronized. This has been tested with both the sdhci
and cqhci access. Currently these ops are implemented by the sdhci-brcmstb
controller dirver to acquire and release the hardware semaphore before and
after access. This change to the mmc/core driver does not have any impact to
existing controller drivers.

Posting this path to get comments on the initial implementation.

Todo :
- Provide  hardware smeaphore using the harware spinlock driver framework
- Use IPI send receive interrupt controller driver

Kamal Dasu (3):
  mmc: add request_start() and request_done() mmc ops
  dt-bindings: mmc: brcm,sdhci-brcmstb: Add sdio sharing support
  mmc: sdhci-brcmstb: Add rpmb sharing support in host driver

 .../bindings/mmc/brcm,sdhci-brcmstb.yaml      |  16 +-
 drivers/mmc/core/core.c                       |  14 +-
 drivers/mmc/host/sdhci-brcmstb.c              | 275 +++++++++++++++++-
 include/linux/mmc/host.h                      |   4 +
 4 files changed, 303 insertions(+), 6 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2025-03-12 17:51 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-06 22:09 [PATCH RFC 0/3] mmc: sdhci-brcmstb: Add rpmb sharing support Kamal Dasu
2025-02-06 22:09 ` [PATCH RFC 1/3] mmc: add request_start() and request_done() mmc ops Kamal Dasu
2025-02-06 22:09 ` [PATCH RFC 2/3] dt-bindings: mmc: brcm,sdhci-brcmstb: Add sdio sharing support Kamal Dasu
2025-02-09 16:30   ` Krzysztof Kozlowski
2025-02-06 22:09 ` [PATCH RFC 3/3] mmc: sdhci-brcmstb: Add rpmb sharing support in host driver Kamal Dasu
2025-02-10 13:21 ` [PATCH RFC 0/3] mmc: sdhci-brcmstb: Add rpmb sharing support Ulf Hansson
2025-02-10 17:09   ` Florian Fainelli
2025-02-11  8:13     ` Avri Altman
2025-02-11 17:01       ` Florian Fainelli
2025-02-11 18:39         ` Avri Altman
2025-03-12 13:17         ` Ulf Hansson
2025-03-12 17:51           ` Florian Fainelli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox