Skip to contentSkip to conversation

Raspberry Pi power domains

PATCH Superseded Eric Anholt 6 participants 17 messages Dec 15, 2015 – Dec 17, 2015

Subsystems (5)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v3 cover Raspberry Pi power domains

Since the pm_genpd_exit() patch is still going through review, and other drivers in the tree just ignore the error cases, Ulf offered to merge the series as a builtin driver not depending on that interface. We still avoid dangling pointer references, by just continuing with probing if of_genpd_add_provider_onecell() fails. We can easily go back and update the driver when a pm_genpd_exit() lands.

Alexander Aring (3):
ARM: bcm2835: add rpi power domain driver
dt-bindings: add rpi power domain driver bindings
ARM: bcm2835: Add the Raspberry Pi power domain driver to the DT.

Eric Anholt (1):
ARM: bcm2835: Define two new packets from the latest firmware.

 .../bindings/arm/bcm/raspberrypi,bcm2835-power.txt |  47 ++++
 arch/arm/boot/dts/bcm2835-rpi.dtsi                 |  11 +
 arch/arm/boot/dts/bcm2835.dtsi                     |   2 +-
 arch/arm/mach-bcm/Kconfig                          |  10 +
 arch/arm/mach-bcm/Makefile                         |   1 +
 arch/arm/mach-bcm/raspberrypi-power.c              | 247 +++++++++++++++++++++
 include/dt-bindings/arm/raspberrypi-power.h        |  41 ++++
 include/soc/bcm2835/raspberrypi-firmware.h         |   2 +
 8 files changed, 360 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-power.txt
 create mode 100644 arch/arm/mach-bcm/raspberrypi-power.c
 create mode 100644 include/dt-bindings/arm/raspberrypi-power.h
Signature · 1 line
2.6.2
#1 lore raw

PATCH v3 1/4 ARM: bcm2835: Define two new packets from the latest firmware.

These packets give us direct access to the firmware's power management code, as opposed to GET/SET_POWER_STATE packets that only had a couple of domains implemented.

---
 include/soc/bcm2835/raspberrypi-firmware.h | 2 ++
 1 file changed, 2 insertions(+)
include/soc/bcm2835/raspberrypi-firmware.h +2 -0
index c07d74a..3fb3571 100644
@@ -72,10 +72,12 @@ enum rpi_firmware_property_tag {
 	RPI_FIRMWARE_SET_ENABLE_QPU =                         0x00030012,
 	RPI_FIRMWARE_GET_DISPMANX_RESOURCE_MEM_HANDLE =       0x00030014,
 	RPI_FIRMWARE_GET_EDID_BLOCK =                         0x00030020,
+	RPI_FIRMWARE_GET_DOMAIN_STATE =                       0x00030030,
 	RPI_FIRMWARE_SET_CLOCK_STATE =                        0x00038001,
 	RPI_FIRMWARE_SET_CLOCK_RATE =                         0x00038002,
 	RPI_FIRMWARE_SET_VOLTAGE =                            0x00038003,
 	RPI_FIRMWARE_SET_TURBO =                              0x00038009,
+	RPI_FIRMWARE_SET_DOMAIN_STATE =                       0x00038030,
 
 	/* Dispmanx TAGS */
 	RPI_FIRMWARE_FRAMEBUFFER_ALLOCATE =                   0x00040001,
Signature · 1 line
2.6.2
#2 lore raw

PATCH v3 2/4 ARM: bcm2835: add rpi power domain driver

In reply to Eric Anholt

From: Alexander Aring <[email protected]>

This patch adds support for several power domains on Raspberry Pi, including USB (so it can be enabled even if the bootloader didn't do it), and graphics.

This patch is the combined work of Eric Anholt (who wrote USB support inside of the Raspberry Pi firmware driver, and wrote the non-USB domain support) and Alexander Aring (who separated the original USB work out from the firmware driver).

---

v2: Add support for power domains other than USB, using the new
firmware interface, reword commit message (changes by Eric)

v3: Restructure as a builtin driver, and drop
of_genpd_add_provider_onecell error handling to avoid pm_genpd_exit() dependency until that API can be settled. Clean up copyright header, add missing ISP initialization, and fix typo in transposer's name.

 arch/arm/mach-bcm/Kconfig                   |  10 ++
 arch/arm/mach-bcm/Makefile                  |   1 +
 arch/arm/mach-bcm/raspberrypi-power.c       | 247 ++++++++++++++++++++++++++++
 include/dt-bindings/arm/raspberrypi-power.h |  41 +++++
 4 files changed, 299 insertions(+)
 create mode 100644 arch/arm/mach-bcm/raspberrypi-power.c
 create mode 100644 include/dt-bindings/arm/raspberrypi-power.h
arch/arm/mach-bcm/Kconfig +10 -0
index 8c53c55..0f23bad 100644
@@ -134,6 +134,16 @@ config ARCH_BCM2835
 	  This enables support for the Broadcom BCM2835 SoC. This SoC is
 	  used in the Raspberry Pi and Roku 2 devices.
 
+config RASPBERRYPI_POWER
+	bool "Raspberry Pi power domain driver"
+	depends on ARCH_BCM2835 || COMPILE_TEST
+	depends on RASPBERRYPI_FIRMWARE
+	select PM_GENERIC_DOMAINS if PM
+	select PM_GENERIC_DOMAINS_OF if PM
+	help
+	  This enables support for the RPi power domains which can be enabled
+	  or disabled via the RPi firmware.
+
 config ARCH_BCM_63XX
 	bool "Broadcom BCM63xx DSL SoC" if ARCH_MULTI_V7
 	depends on MMU
arch/arm/mach-bcm/Makefile +1 -0
index 892261f..fec2d6b 100644
@@ -36,6 +36,7 @@ endif
 
 # BCM2835
 obj-$(CONFIG_ARCH_BCM2835)	+= board_bcm2835.o
+obj-$(CONFIG_RASPBERRYPI_POWER)	+= raspberrypi-power.o
 
 # BCM5301X
 obj-$(CONFIG_ARCH_BCM_5301X)	+= bcm_5301x.o
arch/arm/mach-bcm/raspberrypi-power.c new file +247 -0

247 lines not on this page · raw message

include/dt-bindings/arm/raspberrypi-power.h new file +41 -0

41 lines not on this page · raw message

Signature · 1 line
2.6.2
#3 lore raw

Re: [PATCH v3 2/4] ARM: bcm2835: add rpi power domain driver

Quoted 24 lines · Eric Anholt

From: Alexander Aring <[email protected]>

This patch adds support for several power domains on Raspberry Pi, including USB (so it can be enabled even if the bootloader didn't do it), and graphics.

This patch is the combined work of Eric Anholt (who wrote USB support inside of the Raspberry Pi firmware driver, and wrote the non-USB domain support) and Alexander Aring (who separated the original USB work out from the firmware driver).

---

v2: Add support for power domains other than USB, using the new
firmware interface, reword commit message (changes by Eric)

v3: Restructure as a builtin driver, and drop
of_genpd_add_provider_onecell error handling to avoid pm_genpd_exit() dependency until that API can be settled. Clean up copyright header, add missing ISP initialization, and fix typo in transposer's name.

Quoted 6 lines
 arch/arm/mach-bcm/Kconfig                   |  10 ++
 arch/arm/mach-bcm/Makefile                  |   1 +
 arch/arm/mach-bcm/raspberrypi-power.c       | 247 ++++++++++++++++++++++++++++
 include/dt-bindings/arm/raspberrypi-power.h |  41 +++++
 4 files changed, 299 insertions(+)
 create mode 100644 arch/arm/mach-bcm/raspberrypi-power.c

What motivated the location of this power domain driver in arch/arm/mach-bcm? Should not we have this in drivers/power/ or somewhere in drivers/ at the very least?

Signature · 1 line
Florian
#4 lore raw

Re: [PATCH v3 2/4] ARM: bcm2835: add rpi power domain driver

Quoted 32 lines · Florian Fainelli
Quoted 24 lines · Eric Anholt

From: Alexander Aring <[email protected]>

This patch adds support for several power domains on Raspberry Pi, including USB (so it can be enabled even if the bootloader didn't do it), and graphics.

This patch is the combined work of Eric Anholt (who wrote USB support inside of the Raspberry Pi firmware driver, and wrote the non-USB domain support) and Alexander Aring (who separated the original USB work out from the firmware driver).

---

v2: Add support for power domains other than USB, using the new
firmware interface, reword commit message (changes by Eric)

v3: Restructure as a builtin driver, and drop
of_genpd_add_provider_onecell error handling to avoid pm_genpd_exit() dependency until that API can be settled. Clean up copyright header, add missing ISP initialization, and fix typo in transposer's name.

Quoted 6 lines
 arch/arm/mach-bcm/Kconfig                   |  10 ++
 arch/arm/mach-bcm/Makefile                  |   1 +
 arch/arm/mach-bcm/raspberrypi-power.c       | 247 ++++++++++++++++++++++++++++
 include/dt-bindings/arm/raspberrypi-power.h |  41 +++++
 4 files changed, 299 insertions(+)
 create mode 100644 arch/arm/mach-bcm/raspberrypi-power.c
Quoted 3 lines

What motivated the location of this power domain driver in arch/arm/mach-bcm? Should not we have this in drivers/power/ or somewhere in drivers/ at the very least?

ls stronly suggests that power contains drivers for power supplies and
batteries, not power domains. There are 6 power domain drivers in
arch/arm, 3 in drivers/clk, and 3 in drivers/soc.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20151215/54ad096c/attachment.sig>

#5 lore raw

Re: [PATCH v3 2/4] ARM: bcm2835: add rpi power domain driver

Quoted 34 lines · Eric Anholt
Quoted 32 lines · Florian Fainelli
Quoted 30 lines · Eric Anholt

From: Alexander Aring <[email protected]>

This patch adds support for several power domains on Raspberry Pi, including USB (so it can be enabled even if the bootloader didn't do it), and graphics.

This patch is the combined work of Eric Anholt (who wrote USB support inside of the Raspberry Pi firmware driver, and wrote the non-USB domain support) and Alexander Aring (who separated the original USB work out from the firmware driver).

---

v2: Add support for power domains other than USB, using the new
firmware interface, reword commit message (changes by Eric)

v3: Restructure as a builtin driver, and drop
of_genpd_add_provider_onecell error handling to avoid pm_genpd_exit() dependency until that API can be settled. Clean up copyright header, add missing ISP initialization, and fix typo in transposer's name.

 arch/arm/mach-bcm/Kconfig                   |  10 ++
 arch/arm/mach-bcm/Makefile                  |   1 +
 arch/arm/mach-bcm/raspberrypi-power.c       | 247 ++++++++++++++++++++++++++++
 include/dt-bindings/arm/raspberrypi-power.h |  41 +++++
 4 files changed, 299 insertions(+)
 create mode 100644 arch/arm/mach-bcm/raspberrypi-power.c
Quoted 7 lines
Quoted 3 lines

What motivated the location of this power domain driver in arch/arm/mach-bcm? Should not we have this in drivers/power/ or somewhere in drivers/ at the very least?

ls stronly suggests that power contains drivers for power supplies and batteries, not power domains. There are 6 power domain drivers in arch/arm, 3 in drivers/clk, and 3 in drivers/soc.

If we ever have to support a different architecture which happens to use a similar power domain, then we want it to be in a location which makes it easy for sharing it in the first place. As it stands today, it does not seem useful to me to have this code in arch/arm/mach-bcm/ at all.

Maybe there is room from a drivers/power/domains/ of some kind?

Signature · 1 line
Florian
#6 lore raw

Re: [PATCH v3 2/4] ARM: bcm2835: add rpi power domain driver

Quoted 43 lines · Florian Fainelli
Quoted 34 lines · Eric Anholt
Quoted 32 lines · Florian Fainelli
Quoted 30 lines · Eric Anholt

From: Alexander Aring <[email protected]>

This patch adds support for several power domains on Raspberry Pi, including USB (so it can be enabled even if the bootloader didn't do it), and graphics.

This patch is the combined work of Eric Anholt (who wrote USB support inside of the Raspberry Pi firmware driver, and wrote the non-USB domain support) and Alexander Aring (who separated the original USB work out from the firmware driver).

---

v2: Add support for power domains other than USB, using the new
firmware interface, reword commit message (changes by Eric)

v3: Restructure as a builtin driver, and drop
of_genpd_add_provider_onecell error handling to avoid pm_genpd_exit() dependency until that API can be settled. Clean up copyright header, add missing ISP initialization, and fix typo in transposer's name.

 arch/arm/mach-bcm/Kconfig                   |  10 ++
 arch/arm/mach-bcm/Makefile                  |   1 +
 arch/arm/mach-bcm/raspberrypi-power.c       | 247 ++++++++++++++++++++++++++++
 include/dt-bindings/arm/raspberrypi-power.h |  41 +++++
 4 files changed, 299 insertions(+)
 create mode 100644 arch/arm/mach-bcm/raspberrypi-power.c
Quoted 7 lines
Quoted 3 lines

What motivated the location of this power domain driver in arch/arm/mach-bcm? Should not we have this in drivers/power/ or somewhere in drivers/ at the very least?

ls stronly suggests that power contains drivers for power supplies and batteries, not power domains. There are 6 power domain drivers in arch/arm, 3 in drivers/clk, and 3 in drivers/soc.

Quoted 6 lines

If we ever have to support a different architecture which happens to use a similar power domain, then we want it to be in a location which makes it easy for sharing it in the first place. As it stands today, it does not seem useful to me to have this code in arch/arm/mach-bcm/ at all.

Maybe there is room from a drivers/power/domains/ of some kind?

The great thing about git is that moving code is easy, even after it's first committed.

The subsystem maintainer didn't comment on the code's location in v1 or
v2, and I think they probably have the final say on that. Whatever they
want, where there is currently a genpd driver, is fine with me.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20151215/734717d8/attachment.sig>

#7 lore raw

Re: [PATCH v3 2/4] ARM: bcm2835: add rpi power domain driver

Hi,

Quoted 6 lines · Eric Anholt
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines

What motivated the location of this power domain driver in arch/arm/mach-bcm? Should not we have this in drivers/power/ or somewhere in drivers/ at the very least?

ls stronly suggests that power contains drivers for power supplies and batteries, not power domains.

Indeed it's used for fuel gauges and chargers, but also for reboot/powerdown and adaptive voltage scaling, so another subdirectory for power-domains wouldn't be that odd.

Quoted 9 lines
Quoted 9 lines
Quoted 2 lines

There are 6 power domain drivers in
arch/arm, 3 in drivers/clk, and 3 in drivers/soc.

If we ever have to support a different architecture which happens to use a similar power domain, then we want it to be in a location which makes it easy for sharing it in the first place. As it stands today, it does not seem useful to me to have this code in arch/arm/mach-bcm/ at all.

Maybe there is room from a drivers/power/domains/ of some kind?

I like the idea, but let's include generic power domain maintainers in this discussion, as I suggested here (I got a power domain driver patch for drivers/power just a few days ago):

https://lkml.org/lkml/2015/12/15/815

Also somebody would have to step up to maintain that directory.

Quoted 6 lines

The great thing about git is that moving code is easy, even after it's first committed.

The subsystem maintainer didn't comment on the code's location in v1 or v2, and I think they probably have the final say on that. Whatever they want, where there is currently a genpd driver, is fine with me.

sounds reasonable.

P.S.: Thanks for taking bringing RPI support upstream :)

-- Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20151216/987f00f3/attachment.sig>

#8 lore raw

Re: [PATCH v3 2/4] ARM: bcm2835: add rpi power domain driver

2015-12-16 10:11 GMT+09:00 Sebastian Reichel <[email protected]>:

Quoted 24 lines

Hi,

Quoted 6 lines · Eric Anholt
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines

What motivated the location of this power domain driver in arch/arm/mach-bcm? Should not we have this in drivers/power/ or somewhere in drivers/ at the very least?

ls stronly suggests that power contains drivers for power supplies and batteries, not power domains.

Indeed it's used for fuel gauges and chargers, but also for reboot/powerdown and adaptive voltage scaling, so another subdirectory for power-domains wouldn't be that odd.

Quoted 9 lines
Quoted 9 lines
Quoted 2 lines

There are 6 power domain drivers in
arch/arm, 3 in drivers/clk, and 3 in drivers/soc.

If we ever have to support a different architecture which happens to use a similar power domain, then we want it to be in a location which makes it easy for sharing it in the first place. As it stands today, it does not seem useful to me to have this code in arch/arm/mach-bcm/ at all.

Maybe there is room from a drivers/power/domains/ of some kind?

Quoted 7 lines

I like the idea, but let's include generic power domain maintainers in this discussion, as I suggested here (I got a power domain driver patch for drivers/power just a few days ago):

https://lkml.org/lkml/2015/12/15/815

Also somebody would have to step up to maintain that directory.

This could go into drivers/soc. We put there a lot of mach-specific stuff which we want to make a little more generic (like generic enough multiplatform, multiarchitecture etc). Rockchip has its own power domains there. Dove and Mediatek seem as well but I am not sure. Some other architectures keep this still in arm/mach (exynos, ux500, zx, imx, s34c64xx, shmobile) but this looks more of like a legacy choice.

However, since generic power domains have its own maintainers entry and reside under drivers/base/power, maybe making a separate directory for power domains drivers makes sense?

Best regards,
Krzysztof

#9 lore raw

Re: [PATCH v3 2/4] ARM: bcm2835: add rpi power domain driver

Quoted 31 lines · Krzysztof Kozlowski

2015-12-16 10:11 GMT+09:00 Sebastian Reichel <[email protected]>:

Quoted 30 lines

Hi,

Quoted 6 lines · Eric Anholt
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines

What motivated the location of this power domain driver in arch/arm/mach-bcm? Should not we have this in drivers/power/ or somewhere in drivers/ at the very least?

ls stronly suggests that power contains drivers for power supplies and batteries, not power domains.

Indeed it's used for fuel gauges and chargers, but also for reboot/powerdown and adaptive voltage scaling, so another subdirectory for power-domains wouldn't be that odd.

Quoted 9 lines
Quoted 9 lines
Quoted 2 lines

There are 6 power domain drivers in
arch/arm, 3 in drivers/clk, and 3 in drivers/soc.

If we ever have to support a different architecture which happens to use a similar power domain, then we want it to be in a location which makes it easy for sharing it in the first place. As it stands today, it does not seem useful to me to have this code in arch/arm/mach-bcm/ at all.

Maybe there is room from a drivers/power/domains/ of some kind?

I like the idea, but let's include generic power domain maintainers in this discussion, as I suggested here (I got a power domain driver patch for drivers/power just a few days ago):

https://lkml.org/lkml/2015/12/15/815

Quoted 8 lines
Quoted 1 line

Also somebody would have to step up to maintain that directory.

This could go into drivers/soc. We put there a lot of mach-specific stuff which we want to make a little more generic (like generic enough multiplatform, multiarchitecture etc). Rockchip has its own power domains there. Dove and Mediatek seem as well but I am not sure. Some other architectures keep this still in arm/mach (exynos, ux500, zx, imx, s34c64xx, shmobile) but this looks more of like a legacy choice.

Agree, drivers/soc is good.

Quoted 4 lines

However, since the generic power domains have its own maintainers entry and reside under drivers/base/power, maybe making a separate directory for power domains drivers makes sense?

That could work as well, but I have no strong opinion. Perhaps it would become a bit more clear, although in that case I would also move drivers/base/power/domain* in there.

If that happens, I am willing to help maintain it.

Kind regards
Uffe

#10 lore raw

Re: [PATCH v3 2/4] ARM: bcm2835: add rpi power domain driver

Quoted 24 lines · Ulf Hansson
Quoted 22 lines · Krzysztof Kozlowski

2015-12-16 10:11 GMT+09:00 Sebastian Reichel <[email protected]>:

Quoted 20 lines

Hi,

Quoted 9 lines · Eric Anholt
Quoted 9 lines
Quoted 2 lines

There are 6 power domain drivers in
arch/arm, 3 in drivers/clk, and 3 in drivers/soc.

If we ever have to support a different architecture which happens to use a similar power domain, then we want it to be in a location which makes it easy for sharing it in the first place. As it stands today, it does not seem useful to me to have this code in arch/arm/mach-bcm/ at all.

Maybe there is room from a drivers/power/domains/ of some kind?

I like the idea, but let's include generic power domain maintainers in this discussion, as I suggested here (I got a power domain driver patch for drivers/power just a few days ago):

https://lkml.org/lkml/2015/12/15/815

Also somebody would have to step up to maintain that directory.

Quoted 8 lines
Quoted 6 lines

This could go into drivers/soc. We put there a lot of mach-specific stuff which we want to make a little more generic (like generic enough multiplatform, multiarchitecture etc). Rockchip has its own power domains there. Dove and Mediatek seem as well but I am not sure. Some other architectures keep this still in arm/mach (exynos, ux500, zx, imx, s34c64xx, shmobile) but this looks more of like a legacy choice.

Agree, drivers/soc is good.

OK, I've resent with a move to drivers/soc/bcm/.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20151216/5f8e7d40/attachment.sig>

#11 lore raw

PATCH v3 3/4 dt-bindings: add rpi power domain driver bindings

In reply to Eric Anholt

From: Alexander Aring <[email protected]>

This patch adds devicetree tree bindings for the Raspberry Pi power domain driver.

---

v2: Add the new domains present in v2 to the list.

 .../bindings/arm/bcm/raspberrypi,bcm2835-power.txt | 47 ++++++++++++++++++++++
 1 file changed, 47 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-power.txt
Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-power.txt new file +47 -0
new file mode 100644
index 0000000..30942cf
@@ -0,0 +1,47 @@
+Raspberry Pi power domain driver
+
+Required properties:
+
+- compatible:		Should be "raspberrypi,bcm2835-power".
+- firmware:		Reference to the RPi firmware device node.
+- #power-domain-cells:	Should be <1>, we providing multiple power domains.
+
+The valid defines for power domain are:
+
+ RPI_POWER_DOMAIN_I2C0
+ RPI_POWER_DOMAIN_I2C1
+ RPI_POWER_DOMAIN_I2C2
+ RPI_POWER_DOMAIN_VIDEO_SCALER
+ RPI_POWER_DOMAIN_VPU1
+ RPI_POWER_DOMAIN_HDMI
+ RPI_POWER_DOMAIN_USB
+ RPI_POWER_DOMAIN_VEC
+ RPI_POWER_DOMAIN_JPEG
+ RPI_POWER_DOMAIN_H264
+ RPI_POWER_DOMAIN_V3D
+ RPI_POWER_DOMAIN_ISP
+ RPI_POWER_DOMAIN_UNICAM0
+ RPI_POWER_DOMAIN_UNICAM1
+ RPI_POWER_DOMAIN_CCP2RX
+ RPI_POWER_DOMAIN_CSI2
+ RPI_POWER_DOMAIN_CPI
+ RPI_POWER_DOMAIN_DSI0
+ RPI_POWER_DOMAIN_DSI1
+ RPI_POWER_DOMAIN_TRANSPOSER
+ RPI_POWER_DOMAIN_CCP2TX
+ RPI_POWER_DOMAIN_CDP
+ RPI_POWER_DOMAIN_ARM
+
+Example:
+
+power: power {
+	compatible = "raspberrypi,bcm2835-power";
+	firmware = <&firmware>;
+	#power-domain-cells = <1>;
+};
+
+Example for using power domain:
+
+&usb {
+       power-domains = <&power RPI_POWER_DOMAIN_USB>;
+};
Signature · 1 line
2.6.2
#12 lore raw

PATCH v3 4/4 ARM: bcm2835: Add the Raspberry Pi power domain driver to the DT.

In reply to Eric Anholt

From: Alexander Aring <[email protected]>

This connects the USB driver to the USB power domain, so that USB can actually be turned on at boot if the bootloader didn't do it for us.

---
 arch/arm/boot/dts/bcm2835-rpi.dtsi | 11 +++++++++++
 arch/arm/boot/dts/bcm2835.dtsi     |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)
arch/arm/boot/dts/bcm2835-rpi.dtsi +11 -0
index 3572f03..f828202 100644
@@ -1,3 +1,4 @@
+#include <dt-bindings/arm/raspberrypi-power.h>
 #include "bcm2835.dtsi"
 
 / {
@@ -20,6 +21,12 @@
 			compatible = "raspberrypi,bcm2835-firmware";
 			mboxes = <&mailbox>;
 		};
+
+		power: power {
+			compatible = "raspberrypi,bcm2835-power";
+			firmware = <&firmware>;
+			#power-domain-cells = <1>;
+		};
 	};
 };
 
@@ -60,3 +67,7 @@
 	status = "okay";
 	bus-width = <4>;
 };
+
+&usb {
+	power-domains = <&power RPI_POWER_DOMAIN_USB>;
+};
arch/arm/boot/dts/bcm2835.dtsi +1 -1
index aef64de..6d62af0 100644
@@ -177,7 +177,7 @@
 			status = "disabled";
 		};
 
-		usb at 7e980000 {
+		usb: usb at 7e980000 {
 			compatible = "brcm,bcm2835-usb";
 			reg = <0x7e980000 0x10000>;
 			interrupts = <1 9>;
Signature · 1 line
2.6.2
Reviewed-by on the v3 series
#13 lore raw
In reply to Eric Anholt
Quoted 28 lines · Eric Anholt

Since the pm_genpd_exit() patch is still going through review, and other drivers in the tree just ignore the error cases, Ulf offered to merge the series as a builtin driver not depending on that interface. We still avoid dangling pointer references, by just continuing with probing if of_genpd_add_provider_onecell() fails. We can easily go back and update the driver when a pm_genpd_exit() lands.

Alexander Aring (3):
ARM: bcm2835: add rpi power domain driver
dt-bindings: add rpi power domain driver bindings
ARM: bcm2835: Add the Raspberry Pi power domain driver to the DT.

Eric Anholt (1):
ARM: bcm2835: Define two new packets from the latest firmware.

 .../bindings/arm/bcm/raspberrypi,bcm2835-power.txt |  47 ++++
 arch/arm/boot/dts/bcm2835-rpi.dtsi                 |  11 +
 arch/arm/boot/dts/bcm2835.dtsi                     |   2 +-
 arch/arm/mach-bcm/Kconfig                          |  10 +
 arch/arm/mach-bcm/Makefile                         |   1 +
 arch/arm/mach-bcm/raspberrypi-power.c              | 247 +++++++++++++++++++++
 include/dt-bindings/arm/raspberrypi-power.h        |  41 ++++
 include/soc/bcm2835/raspberrypi-firmware.h         |   2 +
 8 files changed, 360 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-power.txt
 create mode 100644 arch/arm/mach-bcm/raspberrypi-power.c
 create mode 100644 include/dt-bindings/arm/raspberrypi-power.h
Quoted 3 lines

--
2.6.2

Besides a nitpick for patch2, I would also reverse the order of patch3 and patch2. DT docs should go in before the actual parsing of the new bindings/compatibles.

Anyway, for the hole series, you may add my:

Kind regards
Uffe

#14 lore raw
Quoted 33 lines · Ulf Hansson
Quoted 28 lines · Eric Anholt

Since the pm_genpd_exit() patch is still going through review, and other drivers in the tree just ignore the error cases, Ulf offered to merge the series as a builtin driver not depending on that interface. We still avoid dangling pointer references, by just continuing with probing if of_genpd_add_provider_onecell() fails. We can easily go back and update the driver when a pm_genpd_exit() lands.

Alexander Aring (3):
ARM: bcm2835: add rpi power domain driver
dt-bindings: add rpi power domain driver bindings
ARM: bcm2835: Add the Raspberry Pi power domain driver to the DT.

Eric Anholt (1):
ARM: bcm2835: Define two new packets from the latest firmware.

 .../bindings/arm/bcm/raspberrypi,bcm2835-power.txt |  47 ++++
 arch/arm/boot/dts/bcm2835-rpi.dtsi                 |  11 +
 arch/arm/boot/dts/bcm2835.dtsi                     |   2 +-
 arch/arm/mach-bcm/Kconfig                          |  10 +
 arch/arm/mach-bcm/Makefile                         |   1 +
 arch/arm/mach-bcm/raspberrypi-power.c              | 247 +++++++++++++++++++++
 include/dt-bindings/arm/raspberrypi-power.h        |  41 ++++
 include/soc/bcm2835/raspberrypi-firmware.h         |   2 +
 8 files changed, 360 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-power.txt
 create mode 100644 arch/arm/mach-bcm/raspberrypi-power.c
 create mode 100644 include/dt-bindings/arm/raspberrypi-power.h
Quoted 3 lines

--
2.6.2

Quoted 7 lines

Besides a nitpick for patch2, I would also reverse the order of patch3 and patch2. DT docs should go in before the actual parsing of the new bindings/compatibles.

Anyway, for the hole series, you may add my:

Would your tree be pulling the series (since it's power domains), or
should I (since it's SOC stuff)?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20151217/53cfcc42/attachment-0001.sig>

#15 lore raw
Quoted 22 lines · On Thursday 17 December 2015 11:03:47 Eric Anholt wrote:
Quoted 22 lines
Quoted 14 lines
 .../bindings/arm/bcm/raspberrypi,bcm2835-power.txt |  47 ++++
 arch/arm/boot/dts/bcm2835-rpi.dtsi                 |  11 +
 arch/arm/boot/dts/bcm2835.dtsi                     |   2 +-
 arch/arm/mach-bcm/Kconfig                          |  10 +
 arch/arm/mach-bcm/Makefile                         |   1 +
 arch/arm/mach-bcm/raspberrypi-power.c              | 247 +++++++++++++++++++++
 include/dt-bindings/arm/raspberrypi-power.h        |  41 ++++
 include/soc/bcm2835/raspberrypi-firmware.h         |   2 +
 8 files changed, 360 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-power.txt
 create mode 100644 arch/arm/mach-bcm/raspberrypi-power.c
 create mode 100644 include/dt-bindings/arm/raspberrypi-power.h
Quoted 3 lines

--
2.6.2

Besides a nitpick for patch2, I would also reverse the order of patch3 and patch2. DT docs should go in before the actual parsing of the new bindings/compatibles.

Quoted 7 lines
Quoted 3 lines

Anyway, for the hole series, you may add my:

Would your tree be pulling the series (since it's power domains), or should I (since it's SOC stuff)?

All of the above files go through the arm-soc tree by default.

Arnd

#16 lore raw
Quoted 25 lines · Arnd Bergmann
Quoted 24 lines · On Thursday 17 December 2015 11:03:47 Eric Anholt wrote:
Quoted 24 lines
Quoted 14 lines
 .../bindings/arm/bcm/raspberrypi,bcm2835-power.txt |  47 ++++
 arch/arm/boot/dts/bcm2835-rpi.dtsi                 |  11 +
 arch/arm/boot/dts/bcm2835.dtsi                     |   2 +-
 arch/arm/mach-bcm/Kconfig                          |  10 +
 arch/arm/mach-bcm/Makefile                         |   1 +
 arch/arm/mach-bcm/raspberrypi-power.c              | 247 +++++++++++++++++++++
 include/dt-bindings/arm/raspberrypi-power.h        |  41 ++++
 include/soc/bcm2835/raspberrypi-firmware.h         |   2 +
 8 files changed, 360 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-power.txt
 create mode 100644 arch/arm/mach-bcm/raspberrypi-power.c
 create mode 100644 include/dt-bindings/arm/raspberrypi-power.h
Quoted 3 lines

--
2.6.2

Besides a nitpick for patch2, I would also reverse the order of patch3 and patch2. DT docs should go in before the actual parsing of the new bindings/compatibles.

Anyway, for the hole series, you may add my:

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Would your tree be pulling the series (since it's power domains), or should I (since it's SOC stuff)?

All of the above files go through the arm-soc tree by default.

That should work as I don't see any other dependency, unless Eric/Alexander think there is.

Kind regards
Uffe