Broadcom STB S2/S3/S5 support for ARM and MIPS
Subsystems (4)
cover Broadcom STB S2/S3/S5 support for ARM and MIPS
Hi,
This patch series adds support for S2/S3/S5 suspend/resume states on ARM and MIPS based Broadcom STB SoCs.
This was submitted a long time ago by Brian, and I am now picking this up and trying to get this included with support for our latest chips.
Provided that I can collect the necessary Acks from Rob (DT) and other people (Rafael?) I would probably take this via the Broadcom ARM SoC pull requests.
Thank you!
Brian Norris (1):
soc: bcm: brcmstb: Add support for S2/S3/S5 suspend states (ARM)
Florian Fainelli (3):
dt-bindings: Update Broadcom STB binding
soc: bcm: brcmstb: Add Kconfig entry point for power management
dt-bindings: Document MIPS Broadcom STB power management nodes
Justin Chen (1):
soc bcm: brcmstb: Add support for S2/S3/S5 suspend states (MIPS)
.../devicetree/bindings/arm/bcm/brcm,brcmstb.txt | 6 +- .../devicetree/bindings/mips/brcm/soc.txt | 77 ++ drivers/soc/bcm/Kconfig | 2 + drivers/soc/bcm/brcmstb/Kconfig | 9 + drivers/soc/bcm/brcmstb/Makefile | 1 + drivers/soc/bcm/brcmstb/pm/Makefile | 2 + drivers/soc/bcm/brcmstb/pm/aon_defs.h | 113 +++ drivers/soc/bcm/brcmstb/pm/pm-arm.c | 836 +++++++++++++++++++++ drivers/soc/bcm/brcmstb/pm/pm-mips.c | 461 ++++++++++++ drivers/soc/bcm/brcmstb/pm/pm.h | 89 +++ drivers/soc/bcm/brcmstb/pm/s2-arm.S | 76 ++ drivers/soc/bcm/brcmstb/pm/s2-mips.S | 200 +++++ drivers/soc/bcm/brcmstb/pm/s3-mips.S | 146 ++++ 13 files changed, 2017 insertions(+), 1 deletion(-) create mode 100644 drivers/soc/bcm/brcmstb/Kconfig create mode 100644 drivers/soc/bcm/brcmstb/pm/Makefile create mode 100644 drivers/soc/bcm/brcmstb/pm/aon_defs.h create mode 100644 drivers/soc/bcm/brcmstb/pm/pm-arm.c create mode 100644 drivers/soc/bcm/brcmstb/pm/pm-mips.c create mode 100644 drivers/soc/bcm/brcmstb/pm/pm.h create mode 100644 drivers/soc/bcm/brcmstb/pm/s2-arm.S create mode 100644 drivers/soc/bcm/brcmstb/pm/s2-mips.S create mode 100644 drivers/soc/bcm/brcmstb/pm/s3-mips.S
Signature · 1 line
2.9.3
PATCH 1/5 dt-bindings: Update Broadcom STB binding
Update the Broadcom STB binding document with new compatible strings for the DDR PHY and memory controller found on newer chips.
--- Documentation/devicetree/bindings/arm/bcm/brcm,brcmstb.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/arm/bcm/brcm,brcmstb.txt +5 -1
@@ -164,6 +164,8 @@ Control registers for this memory controller's DDR PHY. Required properties: - compatible : should contain one of these + "brcm,brcmstb-ddr-phy-v71.1" + "brcm,brcmstb-ddr-phy-v72.0" "brcm,brcmstb-ddr-phy-v225.1" "brcm,brcmstb-ddr-phy-v240.1" "brcm,brcmstb-ddr-phy-v240.2"
@@ -184,7 +186,9 @@ Sequencer DRAM parameters and control registers. Used for Self-Refresh Power-Down (SRPD), among other things. Required properties: -- compatible : should contain "brcm,brcmstb-memc-ddr" +- compatible : should contain one of these + "brcm,brcmstb-memc-ddr-rev-b.2.2" + "brcm,brcmstb-memc-ddr" - reg : the MEMC DDR register range Example:
Signature · 1 line
2.9.3
Rob Herring
maintainerRe: [PATCH 1/5] dt-bindings: Update Broadcom STB binding
Quoted 2 lines · Florian Fainelli
Update the Broadcom STB binding document with new compatible strings for the DDR PHY and memory controller found on newer chips.
The subject should be more specific what this patch is doing.
Quoted 32 lines
Signed-off-by Florian Fainelli <[email protected]>--- Documentation/devicetree/bindings/arm/bcm/brcm,brcmstb.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)Documentation/devicetree/bindings/arm/bcm/brcm,brcmstb.txt +5
-1@@ -164,6 +164,8 @@ Control registers for this memory controller's DDR PHY. Required properties: - compatible : should contain one of these + "brcm,brcmstb-ddr-phy-v71.1" + "brcm,brcmstb-ddr-phy-v72.0" "brcm,brcmstb-ddr-phy-v225.1" "brcm,brcmstb-ddr-phy-v240.1" "brcm,brcmstb-ddr-phy-v240.2"@@ -184,7 +186,9 @@ Sequencer DRAM parameters and control registers. Used for Self-Refresh Power-Down (SRPD), among other things. Required properties: -- compatible : should contain "brcm,brcmstb-memc-ddr" +- compatible : should contain one of these + "brcm,brcmstb-memc-ddr-rev-b.2.2" + "brcm,brcmstb-memc-ddr" - reg : the MEMC DDR register range Example:Signature · 1 line
2.9.3
PATCH 2/5 soc: bcm: brcmstb: Add Kconfig entry point for power management
In reply to Florian FainelliAdd the necessary pluming to select and build CONFIG_BRCMSTB_PM. Functional code is not added yet.
--- drivers/soc/bcm/Kconfig | 2 ++ drivers/soc/bcm/brcmstb/Kconfig | 8 ++++++++ drivers/soc/bcm/brcmstb/Makefile | 1 + 3 files changed, 11 insertions(+) create mode 100644 drivers/soc/bcm/brcmstb/Kconfig
drivers/soc/bcm/Kconfig +2 -0
@@ -20,4 +20,6 @@ config SOC_BRCMSTB If unsure, say N. +source "drivers/soc/bcm/brcmstb/Kconfig" + endmenu
drivers/soc/bcm/brcmstb/Kconfig new file +8 -0
@@ -0,0 +1,8 @@ +if SOC_BRCMSTB + +config BRCMSTB_PM + bool "Support suspend/resume for STB platforms" + default y + depends on PM + +endif # SOC_BRCMSTB
drivers/soc/bcm/brcmstb/Makefile +1 -0
@@ -1 +1,2 @@ obj-y += common.o biuctrl.o +obj-y += pm/
Signature · 1 line
2.9.3
kbuild test robot
build botRe: [PATCH 2/5] soc: bcm: brcmstb: Add Kconfig entry point for power management
url: https://github.com/0day-ci/linux/commits/Florian-Fainelli/Broadcom-STB-S2-S3-S5-support-for-ARM-and-MIPS/20170618-091951 config: arm-multi_v7_defconfig (attached as .config) compiler…
Hi Florian,
[auto build test ERROR on linus/master]
[also build test ERROR on v4.12-rc5 next-20170616]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Florian-Fainelli/Broadcom-STB-S2-S3-S5-support-for-ARM-and-MIPS/20170618-091951
config: arm-multi_v7_defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm
Note: the linux-review/Florian-Fainelli/Broadcom-STB-S2-S3-S5-support-for-ARM-and-MIPS/20170618-091951 HEAD 353cf2b6363828f6d8a3139858d669f7098d9b69 builds fine.
It only hurts bisectibility.
All errors (new ones prefixed by >>):
>> scripts/Makefile.modbuiltin:25: drivers/soc/bcm/brcmstb/pm/Makefile: No such file or directory >> make[6]: *** No rule to make target 'drivers/soc/bcm/brcmstb/pm/Makefile'. make[6]: Failed to remake makefile 'drivers/soc/bcm/brcmstb/pm/Makefile'. -- >> scripts/Makefile.build:44: drivers/soc/bcm/brcmstb/pm/Makefile: No such file or directory >> make[6]: *** No rule to make target 'drivers/soc/bcm/brcmstb/pm/Makefile'.
make[6]: Failed to remake makefile 'drivers/soc/bcm/brcmstb/pm/Makefile'.
vim +25 scripts/Makefile.modbuiltin
bc081dd6 Michal Marek 2009-12-07 9
bc081dd6 Michal Marek 2009-12-07 10 -include include/config/auto.conf bc081dd6 Michal Marek 2009-12-07 11 # tristate.conf sets tristate variables to uppercase 'Y' or 'M' bc081dd6 Michal Marek 2009-12-07 12 # That way, we get the list of built-in modules in obj-Y bc081dd6 Michal Marek 2009-12-07 13 -include include/config/tristate.conf bc081dd6 Michal Marek 2009-12-07 14 bc081dd6 Michal Marek 2009-12-07 15 include scripts/Kbuild.include bc081dd6 Michal Marek 2009-12-07 16 607b30fc Michal Marek 2010-06-10 17 ifneq ($(KBUILD_SRC),) 607b30fc Michal Marek 2010-06-10 18 # Create output directory if not already present 607b30fc Michal Marek 2010-06-10 19 _dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj)) 607b30fc Michal Marek 2010-06-10 20 endif 607b30fc Michal Marek 2010-06-10 21 bc081dd6 Michal Marek 2009-12-07 22 # The filename Kbuild has precedence over Makefile bc081dd6 Michal Marek 2009-12-07 23 kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src)) bc081dd6 Michal Marek 2009-12-07 24 kbuild-file := $(if $(wildcard $(kbuild-dir)/Kbuild),$(kbuild-dir)/Kbuild,$(kbuild-dir)/Makefile) bc081dd6 Michal Marek 2009-12-07 @25 include $(kbuild-file) bc081dd6 Michal Marek 2009-12-07 26 bc081dd6 Michal Marek 2009-12-07 27 include scripts/Makefile.lib bc081dd6 Michal Marek 2009-12-07 28 __subdir-Y := $(patsubst %/,%,$(filter %/, $(obj-Y))) bc081dd6 Michal Marek 2009-12-07 29 subdir-Y += $(__subdir-Y) bc081dd6 Michal Marek 2009-12-07 30 subdir-ym := $(sort $(subdir-y) $(subdir-Y) $(subdir-m)) bc081dd6 Michal Marek 2009-12-07 31 subdir-ym := $(addprefix $(obj)/,$(subdir-ym)) bc081dd6 Michal Marek 2009-12-07 32 obj-Y := $(addprefix $(obj)/,$(obj-Y)) bc081dd6 Michal Marek 2009-12-07 33
:::::: The code at line 25 was first introduced by commit
:::::: bc081dd6e9f622c73334dc465359168543ccaabf kbuild: generate modules.builtin
:::::: TO: Michal Marek <[email protected]>
:::::: CC: Michal Marek <[email protected]>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 41296 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170618/9ddd2e5e/attachment-0001.gz>
PATCH 3/5 soc: bcm: brcmstb: Add support for S2/S3/S5 suspend states (ARM)
In reply to Florian FainelliFrom: Brian Norris <[email protected]>
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.
--- drivers/soc/bcm/brcmstb/Kconfig | 1 + drivers/soc/bcm/brcmstb/pm/Makefile | 1 + drivers/soc/bcm/brcmstb/pm/aon_defs.h | 113 +++++ drivers/soc/bcm/brcmstb/pm/pm-arm.c | 836 ++++++++++++++++++++++++++++++++++ drivers/soc/bcm/brcmstb/pm/pm.h | 78 ++++ drivers/soc/bcm/brcmstb/pm/s2-arm.S | 76 ++++ 6 files changed, 1105 insertions(+) create mode 100644 drivers/soc/bcm/brcmstb/pm/Makefile create mode 100644 drivers/soc/bcm/brcmstb/pm/aon_defs.h create mode 100644 drivers/soc/bcm/brcmstb/pm/pm-arm.c create mode 100644 drivers/soc/bcm/brcmstb/pm/pm.h create mode 100644 drivers/soc/bcm/brcmstb/pm/s2-arm.S
drivers/soc/bcm/brcmstb/Kconfig +1 -0
@@ -3,6 +3,7 @@ if SOC_BRCMSTB config BRCMSTB_PM bool "Support suspend/resume for STB platforms" default y + depends on ARM depends on PM endif # SOC_BRCMSTB
drivers/soc/bcm/brcmstb/pm/Makefile new file +1 -0
@@ -0,0 +1 @@ +obj-$(CONFIG_ARM) += s2-arm.o pm-arm.o
drivers/soc/bcm/brcmstb/pm/aon_defs.h new file +113 -0
113 lines not on this page · raw message
drivers/soc/bcm/brcmstb/pm/pm-arm.c new file +836 -0
836 lines not on this page · raw message
drivers/soc/bcm/brcmstb/pm/pm.h new file +78 -0
78 lines not on this page · raw message
drivers/soc/bcm/brcmstb/pm/s2-arm.S new file +76 -0
76 lines not on this page · raw message
Signature · 1 line
2.9.3
kbuild test robot
build botRe: [PATCH 3/5] soc: bcm: brcmstb: Add support for S2/S3/S5 suspend states (ARM)
url: https://github.com/0day-ci/linux/commits/Florian-Fainelli/Broadcom-STB-S2-S3-S5-support-for-ARM-and-MIPS/20170618-091951 config: arm-allmodconfig (attached as .config) compiler…
Hi Brian,
[auto build test ERROR on linus/master]
[also build test ERROR on v4.12-rc5 next-20170616]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Florian-Fainelli/Broadcom-STB-S2-S3-S5-support-for-ARM-and-MIPS/20170618-091951
config: arm-allmodconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm
All errors (new ones prefixed by >>):
drivers/soc/bcm/brcmstb/pm/s2-arm.S: Assembler messages:
>> drivers/soc/bcm/brcmstb/pm/s2-arm.S:35: Error: selected processor does not support `dsb' in ARM mode
vim +35 drivers/soc/bcm/brcmstb/pm/s2-arm.S
29 ENTRY(brcmstb_pm_do_s2)
30 stmfd sp!, {r4-r11, lr}
31 mov AON_CTRL_REG, r0
32 mov DDR_PHY_STATUS_REG, r1
33
34 /* Flush memory transactions */
> 35 dsb
36
37 /* Cache DDR_PHY_STATUS_REG translation */
38 ldr r0, [DDR_PHY_STATUS_REG]---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 62410 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170618/4c19ae92/attachment-0001.gz>
PATCH 4/5 dt-bindings: Document MIPS Broadcom STB power management nodes
In reply to Florian FainelliDocument the different nodes required for supporting S2/S3/S5 suspend states on MIPS-based Broadcom STB SoCs.
--- .../devicetree/bindings/mips/brcm/soc.txt | 77 ++++++++++++++++++++++ 1 file changed, 77 insertions(+)
Documentation/devicetree/bindings/mips/brcm/soc.txt +77 -0
@@ -11,3 +11,80 @@ Required properties: The experimental -viper variants are for running Linux on the 3384's BMIPS4355 cable modem CPU instead of the BMIPS5000 application processor. + +Power management +---------------- + +For power management (particularly, S2/S3/S5 system suspend), the following SoC +components are needed: + += Always-On control block (AON CTRL) + +This hardware provides control registers for the "always-on" (even in low-power +modes) hardware, such as the Power Management State Machine (PMSM). + +Required properties: +- compatible : should contain "brcm,brcmstb-aon-ctrl" +- reg : the register start and length for the AON CTRL block + +Example: + +aon-ctrl at 410000 { + compatible = "brcm,brcmstb-aon-ctrl"; + reg = <0x410000 0x400>; +}; + += Memory controllers + +A Broadcom STB SoC typically has a number of independent memory controllers, +each of which may have several associated hardware blocks, which are versioned +independently (control registers, DDR PHYs, etc.). One might consider +describing these controllers as a parent "memory controllers" block, which +contains N sub-nodes (one for each controller in the system), each of which is +associated with a number of hardware register resources (e.g., its PHY). See +the example device tree snippet below. + +== MEMC (MEMory Controller) + +Represents a single memory controller instance. + +Required properties: +- compatible : should contain "brcm,brcmstb-memc" and "simple-bus" + +Should contain subnodes for any of the following relevant hardware resources: + +== DDR PHY control + +Control registers for this memory controller's DDR PHY. + +Required properties: +- compatible : should contain one of these + "brcm,brcmstb-ddr-phy-v64.5" + "brcm,brcmstb-ddr-phy" + +- reg : the DDR PHY register range + +== MEMC Arbiter + +The memory controller arbiter is responsible for memory clients allocation +(bandwidth, priorities etc.) and needs to have its contents restored during +deep sleep states (S3). + +Required properties: + +- compatible : should contain one of these + "brcm,brcmstb-memc-arb-v10.0.0.0" + "brcm,brcmstb-memc-arb" + +- reg : the DDR Arbiter register range + +== Timers + +The Broadcom STB chips contain a timer block with several general purpose +timers that can be used. + +Required properties: + +- compatible : should contain "brcm,brcmstb-timers" +- reg : the timers register range +
Signature · 1 line
2.9.3
Rob Herring
maintainerRe: [PATCH 4/5] dt-bindings: Document MIPS Broadcom STB power management nodes
Quoted 20 lines · Florian Fainelli
Document the different nodes required for supporting S2/S3/S5 suspend states on MIPS-based Broadcom STB SoCs.
Signed-off-by Florian Fainelli <[email protected]>--- .../devicetree/bindings/mips/brcm/soc.txt | 77 ++++++++++++++++++++++ 1 file changed, 77 insertions(+)Documentation/devicetree/bindings/mips/brcm/soc.txt +4
-0@@ -11,3 +11,80 @@ Required properties: The experimental -viper variants are for running Linux on the 3384's BMIPS4355 cable modem CPU instead of the BMIPS5000 application processor. + +Power management +---------------- +
Documentation/devicetree/bindings/mips/brcm/soc.txt Required properties: · line 27
Quoted 10 lines
Documentation/devicetree/bindings/mips/brcm/soc.txt +10
-0+For power management (particularly, S2/S3/S5 system suspend), the following SoC +components are needed: + += Always-On control block (AON CTRL) + +This hardware provides control registers for the "always-on" (even in low-power +modes) hardware, such as the Power Management State Machine (PMSM). + +Required properties: +- compatible : should contain "brcm,brcmstb-aon-ctrl"
Exact same block on all SoCs?
Documentation/devicetree/bindings/mips/brcm/soc.txt Required properties: · line 32
Quoted 5 lines
Documentation/devicetree/bindings/mips/brcm/soc.txt +5
-0+- reg : the register start and length for the AON CTRL block + +Example: + +aon-ctrl at 410000 {
syscon at ...
Documentation/devicetree/bindings/mips/brcm/soc.txt Required properties: · line 45
Quoted 13 lines
Documentation/devicetree/bindings/mips/brcm/soc.txt +13
-0+ compatible = "brcm,brcmstb-aon-ctrl"; + reg = <0x410000 0x400>; +}; + += Memory controllers + +A Broadcom STB SoC typically has a number of independent memory controllers, +each of which may have several associated hardware blocks, which are versioned +independently (control registers, DDR PHYs, etc.). One might consider +describing these controllers as a parent "memory controllers" block, which +contains N sub-nodes (one for each controller in the system), each of which is +associated with a number of hardware register resources (e.g., its PHY). See +the example device tree snippet below.
What example?
Documentation/devicetree/bindings/mips/brcm/soc.txt Required properties: · line 52
Quoted 7 lines
Documentation/devicetree/bindings/mips/brcm/soc.txt +7
-0+ +== MEMC (MEMory Controller) + +Represents a single memory controller instance. + +Required properties: +- compatible : should contain "brcm,brcmstb-memc" and "simple-bus"
No registers for the controller?
Quoted 41 lines
Documentation/devicetree/bindings/mips/brcm/soc.txt +38
-0+ +Should contain subnodes for any of the following relevant hardware resources: + +== DDR PHY control + +Control registers for this memory controller's DDR PHY. + +Required properties: +- compatible : should contain one of these + "brcm,brcmstb-ddr-phy-v64.5" + "brcm,brcmstb-ddr-phy" + +- reg : the DDR PHY register range + +== MEMC Arbiter + +The memory controller arbiter is responsible for memory clients allocation +(bandwidth, priorities etc.) and needs to have its contents restored during +deep sleep states (S3). + +Required properties: + +- compatible : should contain one of these + "brcm,brcmstb-memc-arb-v10.0.0.0" + "brcm,brcmstb-memc-arb" + +- reg : the DDR Arbiter register range + +== Timers + +The Broadcom STB chips contain a timer block with several general purpose +timers that can be used. + +Required properties: + +- compatible : should contain "brcm,brcmstb-timers" +- reg : the timers register range +Signature · 1 line
2.9.3
Re: [PATCH 4/5] dt-bindings: Document MIPS Broadcom STB power management nodes
Quoted 25 lines · Rob Herring
Quoted 24 lines · Florian Fainelli
Document the different nodes required for supporting S2/S3/S5 suspend states on MIPS-based Broadcom STB SoCs.
Signed-off-by Florian Fainelli <[email protected]>--- .../devicetree/bindings/mips/brcm/soc.txt | 77 ++++++++++++++++++++++ 1 file changed, 77 insertions(+)Documentation/devicetree/bindings/mips/brcm/soc.txt +8
-0@@ -11,3 +11,80 @@ Required properties: The experimental -viper variants are for running Linux on the 3384's BMIPS4355 cable modem CPU instead of the BMIPS5000 application processor. + +Power management +---------------- + +For power management (particularly, S2/S3/S5 system suspend), the following SoC +components are needed: + += Always-On control block (AON CTRL)
Quoted 8 lines
Documentation/devicetree/bindings/mips/brcm/soc.txt Required properties: · line 27
Quoted 6 lines
Documentation/devicetree/bindings/mips/brcm/soc.txt +6
-0+ +This hardware provides control registers for the "always-on" (even in low-power +modes) hardware, such as the Power Management State Machine (PMSM). + +Required properties: +- compatible : should contain "brcm,brcmstb-aon-ctrl"Exact same block on all SoCs?
Not quite exactly the same, I will put something more SoC-specific in the binding here.
Quoted 9 lines
Documentation/devicetree/bindings/mips/brcm/soc.txt Required properties: · line 32
Quoted 6 lines
Documentation/devicetree/bindings/mips/brcm/soc.txt +5
-0+- reg : the register start and length for the AON CTRL block + +Example: + +aon-ctrl at 410000 {syscon at ...
Quoted 15 lines
Documentation/devicetree/bindings/mips/brcm/soc.txt Required properties: · line 45
Quoted 13 lines
Documentation/devicetree/bindings/mips/brcm/soc.txt +13
-0+ compatible = "brcm,brcmstb-aon-ctrl"; + reg = <0x410000 0x400>; +}; + += Memory controllers + +A Broadcom STB SoC typically has a number of independent memory controllers, +each of which may have several associated hardware blocks, which are versioned +independently (control registers, DDR PHYs, etc.). One might consider +describing these controllers as a parent "memory controllers" block, which +contains N sub-nodes (one for each controller in the system), each of which is +associated with a number of hardware register resources (e.g., its PHY). See +the example device tree snippet below.What example?
Whoops, that's indeed missing.
Quoted 10 lines
Documentation/devicetree/bindings/mips/brcm/soc.txt Required properties: · line 52
Quoted 8 lines
Documentation/devicetree/bindings/mips/brcm/soc.txt +7
-0+ +== MEMC (MEMory Controller) + +Represents a single memory controller instance. + +Required properties: +- compatible : should contain "brcm,brcmstb-memc" and "simple-bus"No registers for the controller?
There are indeed registers, thanks for catching that.
Quoted 42 lines
Quoted 42 lines
Documentation/devicetree/bindings/mips/brcm/soc.txt +38
-0+ +Should contain subnodes for any of the following relevant hardware resources: + +== DDR PHY control + +Control registers for this memory controller's DDR PHY. + +Required properties: +- compatible : should contain one of these + "brcm,brcmstb-ddr-phy-v64.5" + "brcm,brcmstb-ddr-phy" + +- reg : the DDR PHY register range + +== MEMC Arbiter + +The memory controller arbiter is responsible for memory clients allocation +(bandwidth, priorities etc.) and needs to have its contents restored during +deep sleep states (S3). + +Required properties: + +- compatible : should contain one of these + "brcm,brcmstb-memc-arb-v10.0.0.0" + "brcm,brcmstb-memc-arb" + +- reg : the DDR Arbiter register range + +== Timers + +The Broadcom STB chips contain a timer block with several general purpose +timers that can be used. + +Required properties: + +- compatible : should contain "brcm,brcmstb-timers" +- reg : the timers register range +Signature · 1 line
2.9.3
Signature · 1 line
Florian
PATCH 5/5 soc bcm: brcmstb: Add support for S2/S3/S5 suspend states (MIPS)
In reply to Florian FainelliFrom: Justin Chen <[email protected]>
This commit adds support for the Broadcom STB S2/S3/S5 suspend states on MIPS 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
- DDR memory controller and arbiter
- control processor
The final steps of the suspend execute in cache and there is is a little bit of assembly code in order to shut down the DDR PHY PLL and then go into a wait 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.
--- drivers/soc/bcm/brcmstb/Kconfig | 2 +- drivers/soc/bcm/brcmstb/pm/Makefile | 1 + drivers/soc/bcm/brcmstb/pm/pm-mips.c | 461 +++++++++++++++++++++++++++++++++++ drivers/soc/bcm/brcmstb/pm/pm.h | 13 +- drivers/soc/bcm/brcmstb/pm/s2-mips.S | 200 +++++++++++++++ drivers/soc/bcm/brcmstb/pm/s3-mips.S | 146 +++++++++++ 6 files changed, 821 insertions(+), 2 deletions(-) create mode 100644 drivers/soc/bcm/brcmstb/pm/pm-mips.c create mode 100644 drivers/soc/bcm/brcmstb/pm/s2-mips.S create mode 100644 drivers/soc/bcm/brcmstb/pm/s3-mips.S
drivers/soc/bcm/brcmstb/Kconfig +1 -1
@@ -3,7 +3,7 @@ if SOC_BRCMSTB config BRCMSTB_PM bool "Support suspend/resume for STB platforms" default y - depends on ARM + depends on ARM || BMIPS_GENERIC depends on PM endif # SOC_BRCMSTB
drivers/soc/bcm/brcmstb/pm/Makefile +1 -0
@@ -1 +1,2 @@ obj-$(CONFIG_ARM) += s2-arm.o pm-arm.o +obj-$(CONFIG_BMIPS_GENERIC) += s2-mips.o s3-mips.o pm-mips.o
drivers/soc/bcm/brcmstb/pm/pm-mips.c new file +461 -0
461 lines not on this page · raw message
drivers/soc/bcm/brcmstb/pm/pm.h +12 -1
@@ -70,9 +70,20 @@#ifndef __ASSEMBLY__ +#ifndef CONFIG_MIPS extern const unsigned long brcmstb_pm_do_s2_sz; extern asmlinkage int brcmstb_pm_do_s2(void __iomem *aon_ctrl_base,void __iomem *ddr_phy_pll_status); -#endif +#else +/* s2 asm */ +extern asmlinkage int brcm_pm_do_s2(u32 *s2_params); + +/* s3 asm */ +extern asmlinkage int brcm_pm_do_s3(void __iomem *aon_ctrl_base, +int dcache_linesz); +extern int s3_reentry; +#endif /* CONFIG_MIPS */ + +#endif #endif /* __BRCMSTB_PM_H__ */
drivers/soc/bcm/brcmstb/pm/s2-mips.S new file +200 -0
200 lines not on this page · raw message
drivers/soc/bcm/brcmstb/pm/s3-mips.S new file +146 -0
146 lines not on this page · raw message
Signature · 1 line
2.9.3