All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] firmware: ti_sci: Introduce system suspend support
@ 2022-04-21 20:36 ` Dave Gerlach
  0 siblings, 0 replies; 29+ messages in thread
From: Dave Gerlach @ 2022-04-21 20:36 UTC (permalink / raw)
  To: Rob Herring, Santosh Shilimkar, Krzysztof Kozlowski, Tero Kristo,
	Nishanth Menon
  Cc: linux-arm-kernel, linux-kernel, devicetree, Vignesh Raghavendra,
	Dave Gerlach

Hi,

This series introduces necessary ti_sci driver functionality in
preparation of supporting DeepSleep mode for suspend to mem on TI K3
AM62 [1]. This series applies on top of [2], which is also required for
proper system suspend operation.

Deep Sleep mode is described in section "5.2.4.4 DeepSleep" of the AM62
Technical Reference Manual: https://www.ti.com/lit/pdf/spruiv7

The kernel triggers entry to Deep Sleep mode through the mem suspend
transition with the following:

* Use a TF-A binary that supports PSCI_SYSTEM_SUSPEND call, which is
  enabled by the pending patches here [3]. This causes system to use
  PSCI system suspend as last step of mem sleep.

* The firmware requires that the OS sends a TISCI_MSG_PREPARE_SLEEP
  message in order to provide details about suspend, so we must add the
  ability to send this message. (Patch 3)

* A memory carveout address must be provided to the firmware using
  the above message, which is passed through device tree to the
  driver. (Patches 1 and 4)

* System must load firmware to a specific location before Deep Sleep is
  entered, and this is accomplished using an lpm memory region in device
  tree to indicate where this firmware should be loaded, and also a
  "ti,lpm-firmware-name" property to indicate the name of the firmware
  to load. The ti_sci driver checks in its suspend handler to see if
  the firmware has been loaded and if not, loads it. (Patches 2 and 5)

* Finally, the ti_sci driver must actually send TISCI_MSG_PREPARE_SLEEP
  message to firmware with the above information included, which it
  does during the driver suspend handler when PM_MEM_SUSPEND is the
  determined state being entered. (Patch 6)

This is tested on am625-sk using a ramdisk with all devices disabled
apart from cpu0, main_uart0, dmsc, and secure_proxy_main.

Regards,
Dave

[1] https://lore.kernel.org/lkml/20220225120239.1303821-1-vigneshr@ti.com/
[2] https://lore.kernel.org/lkml/20220412192138.31189-1-d-gerlach@ti.com/
[3] https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/14714/3

Dave Gerlach (6):
  dt-bindings: ti,sci: Add ti,ctx-memory-region property
  dt-bindings: ti,sci: Add lpm region and ti,lpm-firmware-name
  firmware: ti_sci: Introduce Power Management Ops
  firmware: ti_sci: Introduce ti,ctx-memory-region for reserved LPM
    memory
  firmware: ti_sci: Use dt provided fw name and address to load at
    suspend time
  firmware: ti_sci: Introduce prepare system suspend call

 .../bindings/arm/keystone/ti,sci.yaml         |  30 ++-
 drivers/firmware/ti_sci.c                     | 207 +++++++++++++++++-
 drivers/firmware/ti_sci.h                     |  32 ++-
 include/linux/soc/ti/ti_sci_protocol.h        |   6 +
 4 files changed, 269 insertions(+), 6 deletions(-)

-- 
2.35.0


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

end of thread, other threads:[~2022-05-02 20:16 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-21 20:36 [PATCH 0/6] firmware: ti_sci: Introduce system suspend support Dave Gerlach
2022-04-21 20:36 ` Dave Gerlach
2022-04-21 20:36 ` [PATCH 1/6] dt-bindings: ti,sci: Add ti,ctx-memory-region property Dave Gerlach
2022-04-21 20:36   ` Dave Gerlach
2022-04-22 19:02   ` Andrew Davis
2022-04-22 19:02     ` Andrew Davis
2022-04-22 19:02     ` Andrew Davis
2022-04-22 19:10     ` Dave Gerlach
2022-04-22 19:10       ` Dave Gerlach
2022-04-23 13:36       ` Nishanth Menon
2022-04-23 13:36         ` Nishanth Menon
2022-04-25 20:24         ` Dave Gerlach
2022-04-25 20:24           ` Dave Gerlach
2022-04-26  3:28           ` Nishanth Menon
2022-04-26  3:28             ` Nishanth Menon
2022-05-02 20:14   ` Rob Herring
2022-05-02 20:14     ` Rob Herring
2022-04-21 20:36 ` [PATCH 2/6] dt-bindings: ti,sci: Add lpm region and ti,lpm-firmware-name Dave Gerlach
2022-04-21 20:36   ` [PATCH 2/6] dt-bindings: ti, sci: Add lpm region and ti, lpm-firmware-name Dave Gerlach
2022-05-02 20:15   ` [PATCH 2/6] dt-bindings: ti,sci: Add lpm region and ti,lpm-firmware-name Rob Herring
2022-05-02 20:15     ` Rob Herring
2022-04-21 20:36 ` [PATCH 3/6] firmware: ti_sci: Introduce Power Management Ops Dave Gerlach
2022-04-21 20:36   ` Dave Gerlach
2022-04-21 20:36 ` [PATCH 4/6] firmware: ti_sci: Introduce ti,ctx-memory-region for reserved LPM memory Dave Gerlach
2022-04-21 20:36   ` [PATCH 4/6] firmware: ti_sci: Introduce ti, ctx-memory-region " Dave Gerlach
2022-04-21 20:36 ` [PATCH 5/6] firmware: ti_sci: Use dt provided fw name and address to load at suspend time Dave Gerlach
2022-04-21 20:36   ` Dave Gerlach
2022-04-21 20:36 ` [PATCH 6/6] firmware: ti_sci: Introduce prepare system suspend call Dave Gerlach
2022-04-21 20:36   ` Dave Gerlach

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.