devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] gs101 max77759 enablement (DT)
@ 2025-03-06 10:14 André Draszik
  2025-03-06 10:14 ` [PATCH 1/3] arm64: defconfig: enable Maxim max77759 driver André Draszik
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: André Draszik @ 2025-03-06 10:14 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Peter Griffin, Tudor Ambarus,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alim Akhtar
  Cc: Will McVicker, kernel-team, linux-arm-kernel, linux-kernel,
	linux-samsung-soc, devicetree, André Draszik

Hi,

This series enables the recently submitted Maxim max77759 driver and
updates the DT for the Google Pixel 6 / Pro (oriole / raven) boards
accordingly.

!!! Dependency note !!!

This series depends on the corresponding driver and DT bindings
proposed in
https://lore.kernel.org/r/20250228-max77759-mfd-v3-0-0c3627d42526@linaro.org

Note that in that series bindings and gpio driver are accepted, but mfd
and nvmem drivers are still waiting for review comments.

!!! Dependency note end !!!

This gives us some extra GPIOs, and enables NVMEM which is used to
communicate the requested boot mode to the bootloader when doing a cold
reset.

Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
André Draszik (3):
      arm64: defconfig: enable Maxim max77759 driver
      arm64: dts: exynos: gs101-pixel-common: add the MAX77759 PMIC
      arm64: dts: exynos: gs101-pixel-common: add nvmem-reboot-mode

 .../boot/dts/exynos/google/gs101-pixel-common.dtsi | 75 ++++++++++++++++++++++
 arch/arm64/configs/defconfig                       |  1 +
 2 files changed, 76 insertions(+)
---
base-commit: 0226d0ce98a477937ed295fb7df4cc30b46fc304
change-id: 20250306-b4-max77759-mfd-dts-fb88b6c6bd60

Best regards,
-- 
André Draszik <andre.draszik@linaro.org>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/3] arm64: defconfig: enable Maxim max77759 driver
  2025-03-06 10:14 [PATCH 0/3] gs101 max77759 enablement (DT) André Draszik
@ 2025-03-06 10:14 ` André Draszik
  2025-03-06 10:14 ` [PATCH 2/3] arm64: dts: exynos: gs101-pixel-common: add the MAX77759 PMIC André Draszik
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: André Draszik @ 2025-03-06 10:14 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Peter Griffin, Tudor Ambarus,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alim Akhtar
  Cc: Will McVicker, kernel-team, linux-arm-kernel, linux-kernel,
	linux-samsung-soc, devicetree, André Draszik

Enable the Maxim max77759 as this is used by the gs101-oriole and
gs101-raven (Google Pixel 6 and Pixel 6 Pro) boards,

The child devices' defaults are based on this MFD driver's state, so
this commit enables those implicitly as well.

Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
 arch/arm64/configs/defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index a1cc3814b09b31ee659536a64b7db704153d6fe9..eaa88c3e6a93ce555468458763c2531fee2a903f 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -763,6 +763,7 @@ CONFIG_MFD_EXYNOS_LPASS=m
 CONFIG_MFD_HI6421_PMIC=y
 CONFIG_MFD_HI655X_PMIC=y
 CONFIG_MFD_MAX77620=y
+CONFIG_MFD_MAX77759=m
 CONFIG_MFD_MT6360=y
 CONFIG_MFD_MT6397=y
 CONFIG_MFD_SPMI_PMIC=y

-- 
2.49.0.rc0.332.g42c0ae87b1-goog


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/3] arm64: dts: exynos: gs101-pixel-common: add the MAX77759 PMIC
  2025-03-06 10:14 [PATCH 0/3] gs101 max77759 enablement (DT) André Draszik
  2025-03-06 10:14 ` [PATCH 1/3] arm64: defconfig: enable Maxim max77759 driver André Draszik
@ 2025-03-06 10:14 ` André Draszik
  2025-03-06 10:14 ` [PATCH 3/3] arm64: dts: exynos: gs101-pixel-common: add nvmem-reboot-mode André Draszik
  2025-03-06 10:57 ` [PATCH 0/3] gs101 max77759 enablement (DT) André Draszik
  3 siblings, 0 replies; 6+ messages in thread
From: André Draszik @ 2025-03-06 10:14 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Peter Griffin, Tudor Ambarus,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alim Akhtar
  Cc: Will McVicker, kernel-team, linux-arm-kernel, linux-kernel,
	linux-samsung-soc, devicetree, André Draszik

Also add the subnodes for the GPIO expander and NVMEM, and define the
NVMEM layout.

The NVMEM layout is declared such that it matches downstream's
open-coded configuration [1].

The pinctrl nodes are kept sorted by the 'samsung,pins' property rather
than node name, as I think that makes it easier to look at and to add
new nodes unambiguously in the future.

Link: https://android.googlesource.com/kernel/google-modules/bms/+/96e729a83817/max77759_maxq.c#67 [1]
Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
 .../boot/dts/exynos/google/gs101-pixel-common.dtsi | 61 ++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/arch/arm64/boot/dts/exynos/google/gs101-pixel-common.dtsi b/arch/arm64/boot/dts/exynos/google/gs101-pixel-common.dtsi
index b25230495c64dce60916b7cd5dcb9a7cce5d0e4e..f67fa1e84d994de4d40f29a2d437ab6401ac133d 100644
--- a/arch/arm64/boot/dts/exynos/google/gs101-pixel-common.dtsi
+++ b/arch/arm64/boot/dts/exynos/google/gs101-pixel-common.dtsi
@@ -188,6 +188,60 @@ usbc0_role_sw: endpoint {
 			};
 		};
 	};
+
+	pmic@66 {
+		compatible = "maxim,max77759";
+		reg = <0x66>;
+
+		pinctrl-0 = <&if_pmic_int>;
+		pinctrl-names = "default";
+		interrupts-extended = <&gpa8 3 IRQ_TYPE_LEVEL_LOW>;
+
+		interrupt-controller;
+		#interrupt-cells = <2>;
+
+		gpio {
+			compatible = "maxim,max77759-gpio";
+
+			gpio-controller;
+			#gpio-cells = <2>;
+			/*
+			 * "Human-readable name [SIGNAL_LABEL]" where the
+			 * latter comes from the schematic
+			 */
+			gpio-line-names = "OTG boost [OTG_BOOST_EN]",
+					  "max20339 IRQ [MW_OVP_INT_L]";
+
+			interrupt-controller;
+			#interrupt-cells = <2>;
+		};
+
+		nvmem-0 {
+			compatible = "maxim,max77759-nvmem";
+
+			nvmem-layout {
+				compatible = "fixed-layout";
+				#address-cells = <1>;
+				#size-cells = <1>;
+
+				reboot-mode@0 {
+					reg = <0x0 0x4>;
+				};
+
+				boot-reason@4 {
+					reg = <0x4 0x4>;
+				};
+
+				shutdown-user-flag@8 {
+					reg = <0x8 0x1>;
+				};
+
+				rsoc@a {
+					reg = <0xa 0x2>;
+				};
+			};
+		};
+	};
 };
 
 &pinctrl_far_alive {
@@ -211,6 +265,13 @@ typec_int: typec-int-pins {
 		samsung,pin-pud = <GS101_PIN_PULL_UP>;
 		samsung,pin-drv = <GS101_PIN_DRV_2_5_MA>;
 	};
+
+	if_pmic_int: if-pmic-int-pins {
+		samsung,pins = "gpa8-3";
+		samsung,pin-function = <GS101_PIN_FUNC_EINT>;
+		samsung,pin-pud = <GS101_PIN_PULL_UP>;
+		samsung,pin-drv = <GS101_PIN_DRV_2_5_MA>;
+	};
 };
 
 &pinctrl_gpio_alive {

-- 
2.49.0.rc0.332.g42c0ae87b1-goog


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/3] arm64: dts: exynos: gs101-pixel-common: add nvmem-reboot-mode
  2025-03-06 10:14 [PATCH 0/3] gs101 max77759 enablement (DT) André Draszik
  2025-03-06 10:14 ` [PATCH 1/3] arm64: defconfig: enable Maxim max77759 driver André Draszik
  2025-03-06 10:14 ` [PATCH 2/3] arm64: dts: exynos: gs101-pixel-common: add the MAX77759 PMIC André Draszik
@ 2025-03-06 10:14 ` André Draszik
  2025-03-06 10:57 ` [PATCH 0/3] gs101 max77759 enablement (DT) André Draszik
  3 siblings, 0 replies; 6+ messages in thread
From: André Draszik @ 2025-03-06 10:14 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Peter Griffin, Tudor Ambarus,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alim Akhtar
  Cc: Will McVicker, kernel-team, linux-arm-kernel, linux-kernel,
	linux-samsung-soc, devicetree, André Draszik

Now that we have the NVMEM, we can also hook-in the nvmem-reboot-mode,
so as to have Linux communicate the requested boot mode to the boot
loader via it.

The two remarks regarding missing reboot modes from commit ae32b65c9359
("arm64: dts: exynos: gs101: add reboot-mode support (SYSIP_DAT0)")
apply to this commit as well.

Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
 .../arm64/boot/dts/exynos/google/gs101-pixel-common.dtsi | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/exynos/google/gs101-pixel-common.dtsi b/arch/arm64/boot/dts/exynos/google/gs101-pixel-common.dtsi
index f67fa1e84d994de4d40f29a2d437ab6401ac133d..41f63b4d93fd34e1c955d1f47039cc0d9fb4813a 100644
--- a/arch/arm64/boot/dts/exynos/google/gs101-pixel-common.dtsi
+++ b/arch/arm64/boot/dts/exynos/google/gs101-pixel-common.dtsi
@@ -60,6 +60,20 @@ button-power {
 		};
 	};
 
+	reboot-mode {
+		compatible = "nvmem-reboot-mode";
+		nvmem-cells = <&nvmem_reboot_mode>;
+		nvmem-cell-names = "reboot-mode";
+		mode-bootloader = <0x800000fc>;
+		mode-charge = <0x8000000a>;
+		mode-fastboot = <0x800000fa>;
+		mode-reboot-ab-update = <0x80000052>;
+		mode-recovery = <0x800000ff>;
+		mode-rescue = <0x800000f9>;
+		mode-shutdown-thermal = <0x80000051>;
+		mode-shutdown-thermal-battery = <0x80000051>;
+	};
+
 	/* TODO: Remove this once PMIC is implemented  */
 	reg_placeholder: regulator-0 {
 		compatible = "regulator-fixed";
@@ -224,7 +238,7 @@ nvmem-layout {
 				#address-cells = <1>;
 				#size-cells = <1>;
 
-				reboot-mode@0 {
+				nvmem_reboot_mode: reboot-mode@0 {
 					reg = <0x0 0x4>;
 				};
 

-- 
2.49.0.rc0.332.g42c0ae87b1-goog


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/3] gs101 max77759 enablement (DT)
  2025-03-06 10:14 [PATCH 0/3] gs101 max77759 enablement (DT) André Draszik
                   ` (2 preceding siblings ...)
  2025-03-06 10:14 ` [PATCH 3/3] arm64: dts: exynos: gs101-pixel-common: add nvmem-reboot-mode André Draszik
@ 2025-03-06 10:57 ` André Draszik
  2025-03-11 19:40   ` Krzysztof Kozlowski
  3 siblings, 1 reply; 6+ messages in thread
From: André Draszik @ 2025-03-06 10:57 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Peter Griffin, Tudor Ambarus,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alim Akhtar
  Cc: Will McVicker, kernel-team, linux-arm-kernel, linux-kernel,
	linux-samsung-soc, devicetree

On Thu, 2025-03-06 at 10:14 +0000, André Draszik wrote:
> Hi,
> 
> This series enables the recently submitted Maxim max77759 driver and
> updates the DT for the Google Pixel 6 / Pro (oriole / raven) boards
> accordingly.
> 
> !!! Dependency note !!!
> 
> This series depends on the corresponding driver and DT bindings
> proposed in
> https://lore.kernel.org/r/20250228-max77759-mfd-v3-0-0c3627d42526@linaro.org
> 
> Note that in that series bindings and gpio driver are accepted, but mfd
> and nvmem drivers are still waiting for review comments.

To avoid ambiguity... with 'accepted' I meant reviewed, but not merged!

A.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/3] gs101 max77759 enablement (DT)
  2025-03-06 10:57 ` [PATCH 0/3] gs101 max77759 enablement (DT) André Draszik
@ 2025-03-11 19:40   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2025-03-11 19:40 UTC (permalink / raw)
  To: André Draszik, Catalin Marinas, Will Deacon, Peter Griffin,
	Tudor Ambarus, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Alim Akhtar
  Cc: Will McVicker, kernel-team, linux-arm-kernel, linux-kernel,
	linux-samsung-soc, devicetree

On 06/03/2025 11:57, André Draszik wrote:
> On Thu, 2025-03-06 at 10:14 +0000, André Draszik wrote:
>> Hi,
>>
>> This series enables the recently submitted Maxim max77759 driver and
>> updates the DT for the Google Pixel 6 / Pro (oriole / raven) boards
>> accordingly.
>>
>> !!! Dependency note !!!
>>
>> This series depends on the corresponding driver and DT bindings
>> proposed in
>> https://lore.kernel.org/r/20250228-max77759-mfd-v3-0-0c3627d42526@linaro.org
>>
>> Note that in that series bindings and gpio driver are accepted, but mfd
>> and nvmem drivers are still waiting for review comments.
> 
> To avoid ambiguity... with 'accepted' I meant reviewed, but not merged!


Thanks for letting me know. This must wait till bindings get applied to
subsystem tree, so probably will miss this merge window. Anyway, please
ping me when bindings get applied.

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-03-11 19:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-06 10:14 [PATCH 0/3] gs101 max77759 enablement (DT) André Draszik
2025-03-06 10:14 ` [PATCH 1/3] arm64: defconfig: enable Maxim max77759 driver André Draszik
2025-03-06 10:14 ` [PATCH 2/3] arm64: dts: exynos: gs101-pixel-common: add the MAX77759 PMIC André Draszik
2025-03-06 10:14 ` [PATCH 3/3] arm64: dts: exynos: gs101-pixel-common: add nvmem-reboot-mode André Draszik
2025-03-06 10:57 ` [PATCH 0/3] gs101 max77759 enablement (DT) André Draszik
2025-03-11 19:40   ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).