soc/tegra: Implement Tegra186 PMC support
Subsystems (2)
PATCH 1/1 soc/tegra: Implement Tegra186 PMC support
From: Thierry Reding <[email protected]>
The power management controller on Tegra186 has changed in backwards- incompatible ways with respect to earlier generations. This implements a new driver that supports inversion of the PMU interrupt as well as the "recovery", "bootloader" and "forced-recovery" reboot commands.
--- .../bindings/arm/tegra/nvidia,tegra186-pmc.txt | 34 +++++ drivers/soc/tegra/Makefile | 2 +- drivers/soc/tegra/pmc-tegra186.c | 169 +++++++++++++++++++++ 3 files changed, 204 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.txt create mode 100644 drivers/soc/tegra/pmc-tegra186.c
Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.txt new file +34 -0
@@ -0,0 +1,34 @@ +NVIDIA Tegra Power Management Controller (PMC) + +Required properties: +- compatible: Should contain one of the following: + - "nvidia,tegra186-pmc": for Tegra186 +- reg: Must contain an (offset, length) pair of the register set for each + entry in reg-names. +- reg-names: Must include the following entries: + - "pmc" + - "wake" + - "aotag" + - "scratch" + +Optional properties: +- nvidia,invert-interrupt: If present, inverts the PMU interrupt signal. + +Example: + +SoC DTSI: + + pmc@c3600000 { + compatible = "nvidia,tegra186-pmc"; + reg = <0 0x0c360000 0 0x10000>, + <0 0x0c370000 0 0x10000>, + <0 0x0c380000 0 0x10000>, + <0 0x0c390000 0 0x10000>; + reg-names = "pmc", "wake", "aotag", "scratch"; + }; + +Board DTS: + + pmc@c360000 { + nvidia,invert-interrupt; + };
drivers/soc/tegra/Makefile +1 -1
@@ -1,4 +1,4 @@ obj-y += fuse/ obj-y += common.o -obj-y += pmc.o +obj-y += pmc.o pmc-tegra186.o
drivers/soc/tegra/pmc-tegra186.c new file +169 -0
169 lines not on this page · raw message
Signature · 1 line
2.10.2
A message that is not in the archive (sent off-list or not yet received): 20161117171636.20580-1-thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Quoted 16 lines · Thierry Reding
From: Thierry Reding <[email protected]>
The power management controller on Tegra186 has changed in backwards- incompatible ways with respect to earlier generations. This implements a new driver that supports inversion of the PMU interrupt as well as the "recovery", "bootloader" and "forced-recovery" reboot commands.
Signed-off-by Thierry Reding <[email protected]>--- .../bindings/arm/tegra/nvidia,tegra186-pmc.txt | 34 +++++ drivers/soc/tegra/Makefile | 2 +- drivers/soc/tegra/pmc-tegra186.c | 169 +++++++++++++++++++++ 3 files changed, 204 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.txt create mode 100644 drivers/soc/tegra/pmc-tegra186.c
[...]
Quoted 5 lines
drivers/soc/tegra/pmc-tegra186.c new file +0
-0
[...]
drivers/soc/tegra/pmc-tegra186.c line 81
Quoted 10 lines
drivers/soc/tegra/pmc-tegra186.c new file +10
-0+ +/* +* If available, call the system restart implementation that was +* registered earlier (typically PSCI). +*/ +if (pmc->system_restart) { + pmc->system_restart (reboot_mode, cmd); +return NOTIFY_DONE ; + } +
IIUC, Tegra186 implements PSCI v1.0 and it always takes above path. So what other platforms does this driver support ? The name is pmc-tegra186.c, hence the confusion.
Signature · 2 lines
Regards, Sudeep
A message that is not in the archive (sent off-list or not yet received): 0068ebe4-09f3-4434-fc38-071cf2d553bc-5wv7dgnIgG8@public.gmane.org
Quoted 30 lines · Sudeep Holla
Quoted 16 lines · Thierry Reding
From: Thierry Reding <[email protected]>
The power management controller on Tegra186 has changed in backwards- incompatible ways with respect to earlier generations. This implements a new driver that supports inversion of the PMU interrupt as well as the "recovery", "bootloader" and "forced-recovery" reboot commands.
Signed-off-by Thierry Reding <[email protected]>--- .../bindings/arm/tegra/nvidia,tegra186-pmc.txt | 34 +++++ drivers/soc/tegra/Makefile | 2 +- drivers/soc/tegra/pmc-tegra186.c | 169 +++++++++++++++++++++ 3 files changed, 204 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.txt create mode 100644 drivers/soc/tegra/pmc-tegra186.c[...]
Quoted 5 lines
drivers/soc/tegra/pmc-tegra186.c new file +0
-0[...]
Quoted 14 lines
drivers/soc/tegra/pmc-tegra186.c line 81
Quoted 10 lines
drivers/soc/tegra/pmc-tegra186.c new file +10
-0+ +/* +* If available, call the system restart implementation that was +* registered earlier (typically PSCI). +*/ +if (pmc->system_restart) { + pmc->system_restart (reboot_mode, cmd); +return NOTIFY_DONE ; + } +IIUC, Tegra186 implements PSCI v1.0 and it always takes above path. So what other platforms does this driver support ? The name is
pmc-tegra186.c, hence the confusion.
It's technically possible to run Tegra186 without PSCI enabled, or even boot it with firmware that doesn't implement PSCI. In such cases it would be nice to still be able to reboot via the PMC code above.
Thierry
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 46 lines · Thierry Reding
Quoted 30 lines · Sudeep Holla
Quoted 16 lines · Thierry Reding
From: Thierry Reding <[email protected]>
The power management controller on Tegra186 has changed in backwards- incompatible ways with respect to earlier generations. This implements a new driver that supports inversion of the PMU interrupt as well as the "recovery", "bootloader" and "forced-recovery" reboot commands.
Signed-off-by Thierry Reding <[email protected]>--- .../bindings/arm/tegra/nvidia,tegra186-pmc.txt | 34 +++++ drivers/soc/tegra/Makefile | 2 +- drivers/soc/tegra/pmc-tegra186.c | 169 +++++++++++++++++++++ 3 files changed, 204 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.txt create mode 100644 drivers/soc/tegra/pmc-tegra186.c[...]
Quoted 5 lines
drivers/soc/tegra/pmc-tegra186.c new file +0
-0[...]
Quoted 14 lines
drivers/soc/tegra/pmc-tegra186.c line 81
Quoted 10 lines
drivers/soc/tegra/pmc-tegra186.c new file +10
-0+ +/* +* If available, call the system restart implementation that was +* registered earlier (typically PSCI). +*/ +if (pmc->system_restart) { + pmc->system_restart (reboot_mode, cmd); +return NOTIFY_DONE ; + } +IIUC, Tegra186 implements PSCI v1.0 and it always takes above path. So what other platforms does this driver support ? The name is
pmc-tegra186.c, hence the confusion.
Quoted 2 lines
It's technically possible to run Tegra186 without PSCI enabled, or even boot it with firmware that doesn't implement PSCI. In such cases it
OK, with enable-method as "spin-table" I suppose ?
Quoted 1 line
would be nice to still be able to reboot via the PMC code above.
I assume it's only for development purposes as you won't have much CPU power management support without PSCI.
Signature · 2 lines
Regards, Sudeep
A message that is not in the archive (sent off-list or not yet received): efb274c8-d361-f4d1-95aa-547b9e941d68-5wv7dgnIgG8@public.gmane.org
Quoted 49 lines · Sudeep Holla
Quoted 46 lines · Thierry Reding
Quoted 44 lines · Sudeep Holla
Quoted 16 lines · Thierry Reding
From: Thierry Reding <[email protected]>
The power management controller on Tegra186 has changed in backwards- incompatible ways with respect to earlier generations. This implements a new driver that supports inversion of the PMU interrupt as well as the "recovery", "bootloader" and "forced-recovery" reboot commands.
Signed-off-by Thierry Reding <[email protected]>--- .../bindings/arm/tegra/nvidia,tegra186-pmc.txt | 34 +++++ drivers/soc/tegra/Makefile | 2 +- drivers/soc/tegra/pmc-tegra186.c | 169 +++++++++++++++++++++ 3 files changed, 204 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.txt create mode 100644 drivers/soc/tegra/pmc-tegra186.c[...]
Quoted 5 lines
drivers/soc/tegra/pmc-tegra186.c new file +0
-0[...]
drivers/soc/tegra/pmc-tegra186.c
Quoted 10 lines
drivers/soc/tegra/pmc-tegra186.c new file +10
-0+ +/* +* If available, call the system restart implementation that was +* registered earlier (typically PSCI). +*/ +if (pmc->system_restart) { + pmc->system_restart (reboot_mode, cmd); +return NOTIFY_DONE ; + } +IIUC, Tegra186 implements PSCI v1.0 and it always takes above path. So what other platforms does this driver support ? The name is
pmc-tegra186.c, hence the confusion.
Quoted 4 lines
Quoted 2 lines
It's technically possible to run Tegra186 without PSCI enabled, or even boot it with firmware that doesn't implement PSCI. In such cases it
OK, with enable-method as "spin-table" I suppose ?
Yes, that would probably be the other choice for SMP.
Quoted 4 lines
Quoted 1 line
would be nice to still be able to reboot via the PMC code above.
I assume it's only for development purposes as you won't have much CPU power management support without PSCI.
This is what I had primarily in mind. Sometimes it might be useful to boot without PSCI at all (as a poor man's way of disable SMP), in which case this driver can still be used for reboot into the bootloader or recovery mode.
Thierry
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 4 lines · Thierry Reding
Quoted 3 lines · Sudeep Holla
On 17/11/16 17:31, Thierry Reding wrote:
[...]
Quoted 10 lines
Quoted 4 lines
Quoted 1 line
would be nice to still be able to reboot via the PMC code above.
I assume it's only for development purposes as you won't have much CPU power management support without PSCI.
This is what I had primarily in mind. Sometimes it might be useful to boot without PSCI at all (as a poor man's way of disable SMP), in which case this driver can still be used for reboot into the bootloader or recovery mode.
Thanks for clarification.
Signature · 2 lines
Regards, Sudeep
Quoted 15 lines · Thierry Reding
From: Thierry Reding <[email protected]>
The power management controller on Tegra186 has changed in backwards- incompatible ways with respect to earlier generations. This implements a new driver that supports inversion of the PMU interrupt as well as the "recovery", "bootloader" and "forced-recovery" reboot commands.
Signed-off-by Thierry Reding <[email protected]>--- .../bindings/arm/tegra/nvidia,tegra186-pmc.txt | 34 +++++ drivers/soc/tegra/Makefile | 2 +- drivers/soc/tegra/pmc-tegra186.c | 169 +++++++++++++++++++++ 3 files changed, 204 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.txt create mode 100644 drivers/soc/tegra/pmc-tegra186.c
...
drivers/soc/tegra/Makefile line 4
Quoted 10 lines
drivers/soc/tegra/Makefile +1
-1@@ -1,4 +1,4 @@ obj-y += fuse/ obj-y += common.o -obj-y += pmc.o +obj-y += pmc.o pmc-tegra186.o
Do we want to enable this driver for all Tegra devices? Was not sure if this should be dependent on ARM64.
Cheers
Jon
Signature · 1 line
nvpublic
A message that is not in the archive (sent off-list or not yet received): e9a081f5-8e93-d3e8-a702-79903e5a6a78-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org
Quoted 27 lines · Jon Hunter
Quoted 15 lines · Thierry Reding
From: Thierry Reding <[email protected]>
The power management controller on Tegra186 has changed in backwards- incompatible ways with respect to earlier generations. This implements a new driver that supports inversion of the PMU interrupt as well as the "recovery", "bootloader" and "forced-recovery" reboot commands.
Signed-off-by Thierry Reding <[email protected]>--- .../bindings/arm/tegra/nvidia,tegra186-pmc.txt | 34 +++++ drivers/soc/tegra/Makefile | 2 +- drivers/soc/tegra/pmc-tegra186.c | 169 +++++++++++++++++++++ 3 files changed, 204 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.txt create mode 100644 drivers/soc/tegra/pmc-tegra186.c...
Quoted 7 lines
drivers/soc/tegra/Makefile +0
-0@@ -1,4 +1,4 @@ obj-y += fuse/
Quoted 6 lines
drivers/soc/tegra/Makefile line 4
Quoted 3 lines
drivers/soc/tegra/Makefile +1
-1obj-y += common.o -obj-y += pmc.o +obj-y += pmc.o pmc-tegra186.oDo we want to enable this driver for all Tegra devices? Was not sure if this should be dependent on ARM64.
Yeah, I think adding an non-user-visible Kconfig symbol for this might make sense. Then we can use Kconfig to encode the logic about where to enable this and simply use the Kconfig symbol in the Makefile.
Thierry
Rob Herring
Acked-byQuoted 10 lines · Thierry Reding
From: Thierry Reding <[email protected]>
The power management controller on Tegra186 has changed in backwards- incompatible ways with respect to earlier generations. This implements a new driver that supports inversion of the PMU interrupt as well as the "recovery", "bootloader" and "forced-recovery" reboot commands.
Signed-off-by Thierry Reding <[email protected]>--- .../bindings/arm/tegra/nvidia,tegra186-pmc.txt | 34 +++++
Quoted 5 lines
drivers/soc/tegra/Makefile | 2 +- drivers/soc/tegra/pmc-tegra186.c | 169 +++++++++++++++++++++ 3 files changed, 204 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.txt create mode 100644 drivers/soc/tegra/pmc-tegra186.c