soc: bcm: brcmstb: Add support for S2/S3/S5 suspend states (ARM)
authorBrian Norris <computersforpeace@gmail.com>
Thu, 15 Jun 2017 19:37:31 +0000 (12:37 -0700)
committerFlorian Fainelli <f.fainelli@gmail.com>
Mon, 25 Sep 2017 18:46:48 +0000 (11:46 -0700)
commit0b741b8234c86065fb6954d32d427b3f7e14756f
tree1c72f51ff869ecef858ede9fffb582494bdd7e9d
parent9600c2340ded841076367cc78fdd2b65e1cf8ed8
soc: bcm: brcmstb: Add support for S2/S3/S5 suspend states (ARM)

This commit adds support for the Broadcom STB S2/S3/S5 suspend states on
ARM based SoCs.

This requires quite a lot of code in order to deal with the different HW
blocks that need to be quiesced during suspend:

- DDR PHY SHIM
- DDR memory controller and sequencer
- control processor

The final steps of the suspend execute in an on-chip SRAM and there is a
little bit of assembly code in order to shut down the DDR PHY PLL and
then go into a wfi loop until a wake-up even occurs. Conversely the
resume part involves waiting for the DDR PHY PLL to come back up and
resume executions where we left.

For S3, because of our memory hashing (actual hashing code not included
for simplicity, and is bypassed) we need to relocate the writable
variables (stack) into SRAM shortly before suspending in order to leave
the DRAM untouched and create a reliable hash of its contents.

This code has been contributed by Brian Norris initially and has been
incrementally fixed and updated to support new chips by a lot of people.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Markus Mayer <mmayer@broadcom.com>
Signed-off-by: Justin Chen <justinpopo6@gmail.com>
Signed-off-by: Gareth Powell <gpowell@broadcom.com>
Signed-off-by: Doug Berger <opendmb@gmail.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
drivers/soc/bcm/Kconfig
drivers/soc/bcm/brcmstb/Kconfig [new file with mode: 0644]
drivers/soc/bcm/brcmstb/Makefile
drivers/soc/bcm/brcmstb/pm/Makefile [new file with mode: 0644]
drivers/soc/bcm/brcmstb/pm/aon_defs.h [new file with mode: 0644]
drivers/soc/bcm/brcmstb/pm/pm-arm.c [new file with mode: 0644]
drivers/soc/bcm/brcmstb/pm/pm.h [new file with mode: 0644]
drivers/soc/bcm/brcmstb/pm/s2-arm.S [new file with mode: 0644]