Skip to contentSkip to conversation

Apple M1 power management controller support

PATCH New Mark Kettenis 1 participant 4 messages Jan 10, 2022 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

v3 cover Apple M1 power management controller support

This series adds support for the power management controller found on Apple SoCs based on the device tree bindings submitted to upstream Linux. This is needed to enable power domains for devices that haven't been enabled by earlier boot stages.

ChangeLog:

v3: - Extend Kconfig description
- Add comment on driver priv struct member
- Update device trees

v2: - Drop unrelated changes from device tree update

Mark Kettenis (3):
arm: dts: apple: Update Apple M1 device trees
arm: dts: apple: Add u-boot,dm-pre-reloc properties
power: domain: Add Apple pmgr driver

 arch/arm/Kconfig                    |    3 +
 arch/arm/dts/Makefile               |    5 +-
 arch/arm/dts/t8103-j274-u-boot.dtsi |    1 +
 arch/arm/dts/t8103-j274.dts         |  176 ++---
 arch/arm/dts/t8103-j293-u-boot.dtsi |    1 +
 arch/arm/dts/t8103-j293.dts         |  135 ++--
 arch/arm/dts/t8103-j313-u-boot.dtsi |    1 +
 arch/arm/dts/t8103-j313.dts         |  111 +++
 arch/arm/dts/t8103-j456-u-boot.dtsi |    1 +
 arch/arm/dts/t8103-j456.dts         |  117 +++
 arch/arm/dts/t8103-j457-u-boot.dtsi |    1 +
 arch/arm/dts/t8103-j457.dts         |  105 +++
 arch/arm/dts/t8103-jxxx.dtsi        |  143 ++++
 arch/arm/dts/t8103-pmgr.dtsi        | 1138 +++++++++++++++++++++++++++
 arch/arm/dts/t8103-u-boot.dtsi      |   25 +
 arch/arm/dts/t8103.dtsi             |  675 +++++++++-------
 drivers/power/domain/Kconfig        |    9 +
 drivers/power/domain/Makefile       |    1 +
 drivers/power/domain/apple-pmgr.c   |  113 +++
 19 files changed, 2340 insertions(+), 421 deletions(-)
 create mode 100644 arch/arm/dts/t8103-j274-u-boot.dtsi
 create mode 100644 arch/arm/dts/t8103-j293-u-boot.dtsi
 create mode 100644 arch/arm/dts/t8103-j313-u-boot.dtsi
 create mode 100644 arch/arm/dts/t8103-j313.dts
 create mode 100644 arch/arm/dts/t8103-j456-u-boot.dtsi
 create mode 100644 arch/arm/dts/t8103-j456.dts
 create mode 100644 arch/arm/dts/t8103-j457-u-boot.dtsi
 create mode 100644 arch/arm/dts/t8103-j457.dts
 create mode 100644 arch/arm/dts/t8103-jxxx.dtsi
 create mode 100644 arch/arm/dts/t8103-pmgr.dtsi
 create mode 100644 arch/arm/dts/t8103-u-boot.dtsi
 create mode 100644 drivers/power/domain/apple-pmgr.c
Signature · 1 line
2.34.1
#1 lore raw

PATCH v3 1/3 arm: dts: apple: Update Apple M1 device trees

This synchronizes the device trees with those that are in the process of being upstreamed into Linux. This is mostly the current state of the device trees on the asahilinux branch with a few extra bits used by OpenBSD. This includes device trees for machines that were still missing.

There are still some differences that will hopefully be resolved soon.

---

ChangeLog:

v3: - Update device trees

 arch/arm/dts/Makefile        |    5 +-
 arch/arm/dts/t8103-j274.dts  |  176 +++---
 arch/arm/dts/t8103-j293.dts  |  135 ++--
 arch/arm/dts/t8103-j313.dts  |  111 ++++
 arch/arm/dts/t8103-j456.dts  |  117 ++++
 arch/arm/dts/t8103-j457.dts  |  105 ++++
 arch/arm/dts/t8103-jxxx.dtsi |  143 +++++
 arch/arm/dts/t8103-pmgr.dtsi | 1138 ++++++++++++++++++++++++++++++++++
 arch/arm/dts/t8103.dtsi      |  675 ++++++++++++--------
 9 files changed, 2184 insertions(+), 421 deletions(-)
 create mode 100644 arch/arm/dts/t8103-j313.dts
 create mode 100644 arch/arm/dts/t8103-j456.dts
 create mode 100644 arch/arm/dts/t8103-j457.dts
 create mode 100644 arch/arm/dts/t8103-jxxx.dtsi
 create mode 100644 arch/arm/dts/t8103-pmgr.dtsi
arch/arm/dts/Makefile +4 -1
index aeaec7136f..1b65e65eb8 100644
@@ -34,7 +34,10 @@ dtb-$(CONFIG_TARGET_A7Y17LTE) += exynos78x0-axy17lte.dtb
 
 dtb-$(CONFIG_ARCH_APPLE) += \
 	t8103-j274.dtb \
-	t8103-j293.dtb
+	t8103-j293.dtb \
+	t8103-j313.dtb \
+	t8103-j456.dtb \
+	t8103-j457.dtb
 
 dtb-$(CONFIG_ARCH_DAVINCI) += \
 	da850-evm.dtb \
arch/arm/dts/t8103-j274.dts +85 -91

211 lines not on this page · raw message

arch/arm/dts/t8103-j293.dts +77 -58

171 lines not on this page · raw message

arch/arm/dts/t8103-j313.dts new file +111 -0

111 lines not on this page · raw message

arch/arm/dts/t8103-j456.dts new file +117 -0

117 lines not on this page · raw message

arch/arm/dts/t8103-j457.dts new file +105 -0

105 lines not on this page · raw message

arch/arm/dts/t8103-jxxx.dtsi new file +143 -0

143 lines not on this page · raw message

arch/arm/dts/t8103-pmgr.dtsi new file +1138 -0

1,138 lines not on this page · raw message

arch/arm/dts/t8103.dtsi +404 -271

847 lines not on this page · raw message

Signature · 1 line
2.34.1
#2 lore raw

PATCH v3 2/3 arm: dts: apple: Add u-boot,dm-pre-reloc properties

In reply to Mark Kettenis

These are necessary to make sure the power domains needed for the serial console are availble in the pre-relocation phase.

---
 arch/arm/dts/t8103-j274-u-boot.dtsi |  1 +
 arch/arm/dts/t8103-j293-u-boot.dtsi |  1 +
 arch/arm/dts/t8103-j313-u-boot.dtsi |  1 +
 arch/arm/dts/t8103-j456-u-boot.dtsi |  1 +
 arch/arm/dts/t8103-j457-u-boot.dtsi |  1 +
 arch/arm/dts/t8103-u-boot.dtsi      | 25 +++++++++++++++++++++++++
 6 files changed, 30 insertions(+)
 create mode 100644 arch/arm/dts/t8103-j274-u-boot.dtsi
 create mode 100644 arch/arm/dts/t8103-j293-u-boot.dtsi
 create mode 100644 arch/arm/dts/t8103-j313-u-boot.dtsi
 create mode 100644 arch/arm/dts/t8103-j456-u-boot.dtsi
 create mode 100644 arch/arm/dts/t8103-j457-u-boot.dtsi
 create mode 100644 arch/arm/dts/t8103-u-boot.dtsi
arch/arm/dts/t8103-j274-u-boot.dtsi new file +1 -0
new file mode 100644
index 0000000000..6c8dd5a56f
@@ -0,0 +1 @@
+#include "t8103-u-boot.dtsi"
arch/arm/dts/t8103-j293-u-boot.dtsi new file +1 -0
new file mode 100644
index 0000000000..6c8dd5a56f
@@ -0,0 +1 @@
+#include "t8103-u-boot.dtsi"
arch/arm/dts/t8103-j313-u-boot.dtsi new file +1 -0
new file mode 100644
index 0000000000..6c8dd5a56f
@@ -0,0 +1 @@
+#include "t8103-u-boot.dtsi"
arch/arm/dts/t8103-j456-u-boot.dtsi new file +1 -0
new file mode 100644
index 0000000000..6c8dd5a56f
@@ -0,0 +1 @@
+#include "t8103-u-boot.dtsi"
arch/arm/dts/t8103-j457-u-boot.dtsi new file +1 -0
new file mode 100644
index 0000000000..6c8dd5a56f
@@ -0,0 +1 @@
+#include "t8103-u-boot.dtsi"
arch/arm/dts/t8103-u-boot.dtsi new file +25 -0
new file mode 100644
index 0000000000..43f552979d
@@ -0,0 +1,25 @@
+// SPDX-License-Identifier: GPL-2.0+ OR MIT
+
+&serial0 {
+	u-boot,dm-pre-reloc;
+};
+
+&pmgr {
+	u-boot,dm-pre-reloc;
+};
+
+&ps_sio_busif {
+	u-boot,dm-pre-reloc;
+};
+
+&ps_sio {
+	u-boot,dm-pre-reloc;
+};
+
+&ps_uart_p {
+	u-boot,dm-pre-reloc;
+};
+
+&ps_uart0 {
+	u-boot,dm-pre-reloc;
+};
Signature · 1 line
2.34.1
#3 lore raw

PATCH v3 3/3 power: domain: Add Apple pmgr driver

In reply to Mark Kettenis

This driver supports power domains for the power management controller found on Apple SoCs.

---

ChangeLog:

v3: - Extend Kconfig description
- Add comment on driver priv struct member

 arch/arm/Kconfig                  |   3 +
 drivers/power/domain/Kconfig      |   9 +++
 drivers/power/domain/Makefile     |   1 +
 drivers/power/domain/apple-pmgr.c | 113 ++++++++++++++++++++++++++++++
 4 files changed, 126 insertions(+)
 create mode 100644 drivers/power/domain/apple-pmgr.c
arch/arm/Kconfig +3 -0
index 78c6b2e92d..44954977b6 100644
@@ -942,6 +942,9 @@ config ARCH_APPLE
 	select OF_CONTROL
 	select PINCTRL
 	select POSITION_INDEPENDENT
+	select POWER_DOMAIN
+	select REGMAP
+	select SYSCON
 	select SYSRESET
 	select SYSRESET_WATCHDOG
 	select SYSRESET_WATCHDOG_AUTO
drivers/power/domain/Kconfig +9 -0
index 99b3f9ae71..9aea5fcdf0 100644
@@ -9,6 +9,15 @@ config POWER_DOMAIN
 	  domains). This may be used to save power. This API provides the
 	  means to control such power management hardware.
 
+config APPLE_PMGR_POWER_DOMAIN
+	bool "Enable the Apple PMGR power domain driver"
+	depends on POWER_DOMAIN
+	default y if ARCH_APPLE
+	help
+	  Enable support for manipulating power domains on Apple SoCs.
+	  This driver is needed to power on parts of the SoC that have
+	  not been powered on by previous boot stages.
+
 config BCM6328_POWER_DOMAIN
 	bool "Enable the BCM6328 power domain driver"
 	depends on POWER_DOMAIN && ARCH_BMIPS
drivers/power/domain/Makefile +1 -0
index 3d1e5f073c..530ae35671 100644
@@ -4,6 +4,7 @@
 #
 
 obj-$(CONFIG_$(SPL_)POWER_DOMAIN) += power-domain-uclass.o
+obj-$(CONFIG_APPLE_PMGR_POWER_DOMAIN) += apple-pmgr.o
 obj-$(CONFIG_BCM6328_POWER_DOMAIN) += bcm6328-power-domain.o
 obj-$(CONFIG_IMX8_POWER_DOMAIN) += imx8-power-domain-legacy.o imx8-power-domain.o
 obj-$(CONFIG_IMX8M_POWER_DOMAIN) += imx8m-power-domain.o
drivers/power/domain/apple-pmgr.c new file +113 -0

113 lines not on this page · raw message

Signature · 1 line
2.34.1