Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions Documentation/devicetree/bindings/clock/google,zuma-clock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ description: |
CMU_TOP supplies the HSI0 NoC and peripheral clocks to CMU_HSI0 from its
shared PLLs. CMU_HSI0 supplies USI2, the touchscreen's SPI, from the HSI0
peripheral clock; its NoC path also takes the board-level HSI0 ALT clock.
CMU_TOP also supplies the PERIC1 NoC and USI input clocks to CMU_PERIC1,
which supplies USI11, the I2C bus of the battery, charger and USB-C chips.
CMU_APM supplies the APM mailbox, its internal memory and the always-on
GPIO banks from the always-on ALV PLL and the oscillator.
The external oscillator supplies the PLL reference and the oscillator mux
Expand All @@ -25,6 +27,7 @@ properties:
- google,zuma-cmu-top
- google,zuma-cmu-apm
- google,zuma-cmu-hsi0
- google,zuma-cmu-peric1

reg:
maxItems: 1
Expand Down Expand Up @@ -80,6 +83,22 @@ allOf:
- const: bus
- const: peri
- const: alt
- if:
properties:
compatible:
const: google,zuma-cmu-peric1
then:
properties:
clocks:
items:
- description: External oscillator reference clock
- description: PERIC1 NoC clock from CMU_TOP
- description: PERIC1 USI input clock from CMU_TOP
clock-names:
items:
- const: oscclk
- const: bus
- const: ip

additionalProperties: false

Expand All @@ -104,4 +123,13 @@ examples:
clock-names = "oscclk", "bus", "peri", "alt";
};

clock-controller@10c00000 {
compatible = "google,zuma-cmu-peric1";
reg = <0x10c00000 0x8000>;
#clock-cells = <1>;
clocks = <&oscclk>, <&cmu_top CLK_DOUT_PERIC1_NOC>,
<&cmu_top CLK_DOUT_PERIC1_IP>;
clock-names = "oscclk", "bus", "ip";
};

...
1 change: 1 addition & 0 deletions Documentation/devicetree/bindings/i2c/i2c-exynos5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ properties:
- enum:
- google,gs101-hsi2c
- google,gs201-hsi2c
- google,zuma-hsi2c
- google,zumapro-hsi2c
- samsung,exynos2200-hsi2c
- samsung,exynos850-hsi2c
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ properties:
- google,gs201-peric1-sysreg
- google,gs201-vgpio2ap-sysreg
- google,zuma-hsi0-sysreg
- google,zuma-peric1-sysreg
- google,zuma-ufs-sysreg
- google,zumapro-apm-sysreg
- google,zumapro-hsi0-sysreg
Expand Down Expand Up @@ -116,6 +117,7 @@ allOf:
- google,gs201-hsi2-sysreg
- google,gs201-peric0-sysreg
- google,gs201-peric1-sysreg
- google,zuma-peric1-sysreg
- google,zumapro-apm-sysreg
- google,zumapro-hsi0-sysreg
- google,zumapro-peric0-sysreg
Expand Down
101 changes: 101 additions & 0 deletions arch/arm64/boot/dts/exynos/google/zuma-husky.dts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/usb/pd.h>
#include "zuma.dtsi"

/ {
Expand Down Expand Up @@ -105,6 +107,21 @@
};
};

/*
* The 4950 mAh pack (Google's husky battery data). The charger and
* gauge limits are deliberately conservative: stock charges to 4.48 V
* in steps (4.20/4.30/4.35/4.48 V by temperature), which is not
* described here yet. 0.3 C is 1485 mA.
*/
battery: battery {
compatible = "simple-battery";
charge-full-design-microamp-hours = <4950000>;
voltage-max-design-microvolt = <4480000>;
voltage-min-design-microvolt = <3300000>;
constant-charge-voltage-max-microvolt = <4200000>;
constant-charge-current-max-microamp = <1485000>;
};

reserved-memory {
#address-cells = <2>;
#size-cells = <1>;
Expand Down Expand Up @@ -193,3 +210,87 @@
&usi2_hsi0 {
status = "okay";
};

/*
* MAX77759 (charger, Type-C port controller, fuel gauge, PMIC) on USI11 /
* hsi2c_11. Like the Pixel 7 Pro's, but the interrupt lines are on gpa7 and
* gpa8. The bus and CMU_PERIC1 stay disabled here, and a bring-up overlay
* enables them. Binding the PMIC at 0x66 also creates its charger cell,
* and the charger driver then programs charge limits from the battery
* node, so max77759_charger, gpio_max77759, nvmem_max77759 and tcpci_maxim
* have to be kept from loading until each step is tested. The husky device
* package does not block them yet (cheetah's omamobile-max77759.conf
* does), and has to before an overlay that enables this bus ships.
*
* The fuel gauge has no battery model yet: the pack (ATL or COS, stock
* reads its ID resistor) is not known, and a wrong model would be written
* if the gauge reports power-on reset. The Type-C controller stays disabled,
* as on the Pixel 7 Pro: USB is the only way into the phone.
*/
&hsi2c_11 {
clock-frequency = <400000>;

usb-typec@25 {
compatible = "maxim,max77759-tcpci", "maxim,max33359";
reg = <0x25>;
interrupts-extended = <&gpa8 3 IRQ_TYPE_LEVEL_LOW>;
pinctrl-0 = <&typec_int>;
pinctrl-names = "default";
status = "disabled";

/*
* Sink only: VBUS for host mode comes from an external boost
* (stock: max77759,ext-otg-only, MAX77759 GPIO5 "bst-on" and
* the TCPC's EXTBST_CTRL), which has no driver yet. MAX77759
* GPIO6 is the VBUS input switch (stock in-switch-gpio): leave
* it alone.
*/
connector {
compatible = "usb-c-connector";
label = "USB-C";
data-role = "dual";
power-role = "sink";
self-powered;
op-sink-microwatt = <2600000>;
sink-pdos = <PDO_FIXED(5000, 3000,
(PDO_FIXED_DATA_SWAP
| PDO_FIXED_USB_COMM
| PDO_FIXED_HIGHER_CAP
| PDO_FIXED_DUAL_ROLE))
PDO_FIXED(9000, 2200, 0)
PDO_PPS_APDO(5000, 11000, 3000)>;
pd-disable;
typec-power-opmode = "default";
};
};

fuel-gauge@36 {
compatible = "maxim,max77759-fg";
reg = <0x36>;
interrupts-extended = <&gpa7 7 IRQ_TYPE_LEVEL_LOW>;
pinctrl-0 = <&if_pmic_fg_int>;
pinctrl-names = "default";
shunt-resistor-micro-ohms = <5000>;
monitored-battery = <&battery>;
};

pmic@66 {
compatible = "maxim,max77759";
reg = <0x66>;
interrupts-extended = <&gpa8 0 IRQ_TYPE_LEVEL_LOW>;
pinctrl-0 = <&if_pmic_int>;
pinctrl-names = "default";
interrupt-controller;
#interrupt-cells = <2>;
/* for the charger cell */
monitored-battery = <&battery>;

gpio {
compatible = "maxim,max77759-gpio";
gpio-controller;
#gpio-cells = <2>;
interrupt-controller;
#interrupt-cells = <2>;
};
};
};
34 changes: 34 additions & 0 deletions arch/arm64/boot/dts/exynos/google/zuma-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,28 @@
samsung,pin-pud = <GS101_PIN_PULL_NONE>;
samsung,pin-drv = <GS101_PIN_DRV_2_5_MA>;
};

/* MAX77759 interrupt lines, active low with pull-ups (stock: pud 3). */
if_pmic_int: if-pmic-int-pins {
samsung,pins = "gpa8-0";
samsung,pin-function = <GS101_PIN_FUNC_EINT>;
samsung,pin-pud = <GS101_PIN_PULL_UP>;
samsung,pin-drv = <GS101_PIN_DRV_2_5_MA>;
};

if_pmic_fg_int: if-pmic-fg-int-pins {
samsung,pins = "gpa7-7";
samsung,pin-function = <GS101_PIN_FUNC_EINT>;
samsung,pin-pud = <GS101_PIN_PULL_UP>;
samsung,pin-drv = <GS101_PIN_DRV_2_5_MA>;
};

typec_int: typec-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_custom_alive {
Expand Down Expand Up @@ -436,6 +458,18 @@
samsung,pin-pud = <GS101_PIN_PULL_NONE>;
samsung,pin-drv = <GS101_PIN_DRV_2_5_MA>;
};

/*
* USI11, the battery bus: stock's board file moves it to gpp21-0/1 and
* sets no pull, then zuma-typec.dtsi, applied after it, sets the
* pull-up (pud 3), which is what the pins end up with.
*/
hsi2c11_bus: hsi2c11-bus-pins {
samsung,pins = "gpp21-0", "gpp21-1";
samsung,pin-function = <GS101_PIN_FUNC_2>;
samsung,pin-pud = <GS101_PIN_PULL_UP>;
samsung,pin-drv = <GS101_PIN_DRV_2_5_MA>;
};
};

&pinctrl_hsi2ufs {
Expand Down
52 changes: 52 additions & 0 deletions arch/arm64/boot/dts/exynos/google/zuma.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,58 @@
interrupts = <GIC_SPI 649 IRQ_TYPE_LEVEL_HIGH>;
};

/*
* CMU_PERIC1 and USI11, the I2C bus of the MAX77759 gauge,
* charger and Type-C controller. Firmware leaves them running;
* board files enable them.
*/
cmu_peric1: clock-controller@10c00000 {
compatible = "google,zuma-cmu-peric1";
reg = <0x10c00000 0x8000>;
#clock-cells = <1>;
clocks = <&oscclk>, <&cmu_top CLK_DOUT_PERIC1_NOC>,
<&cmu_top CLK_DOUT_PERIC1_IP>;
clock-names = "oscclk", "bus", "ip";
status = "disabled";
};

sysreg_peric1: syscon@10c21000 {
compatible = "google,zuma-peric1-sysreg", "syscon";
reg = <0x10c21000 0x1000>;
clocks = <&cmu_peric1 CLK_GOUT_PERIC1_SYSREG>;
status = "disabled";
};

usi11: usi@10cb00c0 {
compatible = "google,zuma-usi", "samsung,exynos850-usi";
reg = <0x10cb00c0 0x20>;
clocks = <&cmu_peric1 CLK_GOUT_PERIC1_USI11_PCLK>,
<&cmu_peric1 CLK_GOUT_PERIC1_USI11_IPCLK>;
clock-names = "pclk", "ipclk";
samsung,sysreg = <&sysreg_peric1 0xc>;
samsung,mode = <USI_MODE_I2C>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
status = "disabled";

hsi2c_11: i2c@10cb0000 {
compatible = "google,zuma-hsi2c",
"samsung,exynosautov9-hsi2c";
/* USI control starts at 0xc0; do not claim it twice. */
reg = <0x10cb0000 0xc0>;
interrupts = <GIC_SPI 659 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&cmu_peric1 CLK_GOUT_PERIC1_USI11_IPCLK>,
<&cmu_peric1 CLK_GOUT_PERIC1_USI11_PCLK>;
clock-names = "hsi2c", "hsi2c_pclk";
pinctrl-0 = <&hsi2c11_bus>;
pinctrl-names = "default";
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
};
};

cmu_hsi0: clock-controller@11000000 {
compatible = "google,zuma-cmu-hsi0";
reg = <0x11000000 0x8000>;
Expand Down
Loading