kaladin: Add GPIO configuration for kaladin

Add gpio configuration for kaladin

BUG=b:420836306
TEST=zmake build kaladin

Change-Id: I14088ac916345b20286c1ec012242225e803d00f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/6703677
Reviewed-by: Ivan Chen <yulunchen@google.com>
Tested-by: Arthur Lin <lin.arthur@inventec.corp-partner.google.com>
Commit-Queue: Leo Chen <chen.leoss@inventec.corp-partner.google.com>
Reviewed-by: Kyle Lin <kylelinck@google.com>
Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
Tested-by: Leo Chen <chen.leoss@inventec.corp-partner.google.com>
diff --git a/zephyr/program/trulo/kaladin/adc.dtsi b/zephyr/program/trulo/kaladin/adc.dtsi
new file mode 100644
index 0000000..5eca385
--- /dev/null
+++ b/zephyr/program/trulo/kaladin/adc.dtsi
@@ -0,0 +1,41 @@
+/* Copyright 2025 The ChromiumOS Authors
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+/{
+        named-adc-channels {
+		compatible = "named-adc-channels";
+
+		adc_temp_sensor_1: temp_sensor_1 {
+			enum-name = "ADC_TEMP_SENSOR_1";
+			io-channels = <&adc0 1>;
+		};
+		adc_temp_sensor_2: temp_sensor_2 {
+			enum-name = "ADC_TEMP_SENSOR_2";
+			io-channels = <&adc0 2>;
+		};
+		adc_temp_sensor_3: temp_sensor_3 {
+			enum-name = "ADC_TEMP_SENSOR_3";
+			io-channels = <&adc0 3>;
+		};
+		adc_ec_vsense_pp1050_proc: ec_vsense_pp1050_proc {
+			enum-name = "ADC_PP1050_PROC";
+			io-channels = <&adc0 6>;
+		};
+		adc_ec_vsense_pp3300_s5: ec_vsense_pp3300_s5 {
+			enum-name = "ADC_PP3300_S5";
+			io-channels = <&adc0 7>;
+		};
+	};
+};
+
+&adc0 {
+	pinctrl-0 = <&adc0_ch1_gpi1_default
+		     &adc0_ch2_gpi2_default
+		     &adc0_ch3_gpi3_default
+		     &adc0_ch6_gpi6_default
+		     &adc0_ch7_gpi7_default>;
+	pinctrl-names = "default";
+	status = "okay";
+};
\ No newline at end of file
diff --git a/zephyr/program/trulo/kaladin/gpio.dtsi b/zephyr/program/trulo/kaladin/gpio.dtsi
index a5a1e48..fdd53f9 100644
--- a/zephyr/program/trulo/kaladin/gpio.dtsi
+++ b/zephyr/program/trulo/kaladin/gpio.dtsi
@@ -1,22 +1,188 @@
- /* Copyright 2025 The ChromiumOS Authors
+/* Copyright 2025 The ChromiumOS Authors
  * Use of this source code is governed by a BSD-style license that can be
  * found in the LICENSE file.
  */
 
- / {
-	aliases {
-		gpio-wp = &ec_wp_l;
-	};
+/ {
 
 	named-gpios {
 		compatible = "named-gpios";
 
-		ec_wp_l: write-protect {
-			gpios = <&gpioa 0 GPIO_INPUT>;
+		gpio_acc_int_l: acc_int_l {
+			gpios = <&gpioc 0 (GPIO_INPUT)>;
 		};
-		/* unimplemented GPIOs */
-		entering-rw {
-			enum-name = "GPIO_ENTERING_RW";
+		gpio_acok_od: acok_od {
+			gpios = <&gpioj 0 (GPIO_INPUT_PULL_UP)>;
+			enum-name = "GPIO_AC_PRESENT";
+		};
+		gpio_all_sys_pwrgd: all_sys_pwrgd {
+			gpios = <&gpiof 3 (GPIO_INPUT)>;
+		};
+		gpio_amp_mute_l: amp_mute_l {
+			gpios = <&gpiog 6 (GPIO_OUTPUT | GPIO_ACTIVE_LOW | GPIO_OUTPUT_INIT_HIGH)>;
+		};
+		gpio_cpu_c10_gate_l: cpu_c10_gate_l {
+			gpios = <&gpiog 1 (GPIO_INPUT)>;
+		};
+		gpio_ec_edp_bl_en_od: ec_edp_bl_en_od {
+			gpios = <&gpioh 0 (GPIO_OUTPUT | GPIO_OPEN_DRAIN | GPIO_ACTIVE_HIGH | GPIO_OUTPUT_INIT_LOW)>;
+			enum-name = "GPIO_ENABLE_BACKLIGHT";
+		};
+		gpio_ec_gsc_packet_mode: ec_gsc_packet_mode {
+			gpios = <&gpioe 3 (GPIO_OUTPUT | GPIO_ACTIVE_HIGH | GPIO_OUTPUT_INIT_HIGH)>;
+			enum-name = "GPIO_PACKET_MODE_EN";
+		};
+		gpio_ec_pmc_pd_int_odl: ec_pmc_pd_int_odl {
+			gpios = <&gpioa 5 (GPIO_OUTPUT | GPIO_OPEN_DRAIN | GPIO_ACTIVE_LOW)>;
+		};
+		gpio_ec_prochot_odl: ec_prochot_odl {
+			gpios = <&gpioi 0 (GPIO_OUTPUT | GPIO_OPEN_DRAIN | GPIO_ACTIVE_LOW | GPIO_OUTPUT_INIT_HIGH)>;
+		};
+		gpio_ec_soc_dsw_pwrok: ec_soc_dsw_pwrok {
+			gpios = <&gpioj 4 (GPIO_OUTPUT | GPIO_ACTIVE_HIGH | GPIO_OUTPUT_INIT_LOW)>;
+		};
+		gpio_ec_soc_int_odl: ec_soc_int_odl {
+			gpios = <&gpioe 6 (GPIO_OUTPUT | GPIO_OPEN_DRAIN | GPIO_ACTIVE_LOW | GPIO_OUTPUT_INIT_HIGH)>;
+			enum-name = "GPIO_EC_INT_L";
+		};
+		gpio_ec_soc_pch_pwrok_od: ec_soc_pch_pwrok_od {
+			gpios = <&gpioh 4 (GPIO_OUTPUT | GPIO_OPEN_DRAIN | GPIO_ACTIVE_HIGH | GPIO_OUTPUT_INIT_HIGH)>;
+		};
+		gpio_ec_soc_pwr_btn_odl: ec_soc_pwr_btn_odl {
+			gpios = <&gpioe 1 (GPIO_OUTPUT | GPIO_OPEN_DRAIN | GPIO_ACTIVE_LOW | GPIO_OUTPUT_INIT_HIGH)>;
+			enum-name = "GPIO_PCH_PWRBTN_L";
+		};
+		gpio_ec_soc_rsmrst_l: ec_soc_rsmrst_l {
+			gpios = <&gpioj 6 (GPIO_OUTPUT | GPIO_ACTIVE_LOW | GPIO_OUTPUT_INIT_HIGH)>;
+		};
+		gpio_ec_soc_rtcrst: ec_soc_rtcrst {
+			gpios = <&gpiob 0 (GPIO_OUTPUT | GPIO_ACTIVE_HIGH | GPIO_OUTPUT_INIT_LOW)>;
+		};
+		gpio_ec_soc_sys_pwrok: ec_soc_sys_pwrok {
+			gpios = <&gpiod 5 (GPIO_OUTPUT | GPIO_ACTIVE_HIGH | GPIO_OUTPUT_INIT_LOW)>;
+		};
+		gpio_ec_soc_vccst_pwrgd_od: ec_soc_vccst_pwrgd_od {
+			gpios = <&gpioi 5 (GPIO_INPUT)>;
+		};
+		gpio_ec_soc_wake_odl: ec_soc_wake_odl {
+			gpios = <&gpioj 1 (GPIO_OUTPUT | GPIO_OPEN_DRAIN | GPIO_ACTIVE_LOW | GPIO_OUTPUT_INIT_HIGH)>;
+		};
+		gpio_ec_wp_odl: ec_wp_odl {
+			gpios = <&gpioj 3 (GPIO_INPUT | GPIO_ACTIVE_LOW)>;
+		};
+		gpio_en_pp3300_s5: en_pp3300_s5 {
+			gpios = <&gpioh 1 (GPIO_OUTPUT | GPIO_ACTIVE_HIGH | GPIO_OUTPUT_INIT_LOW)>;
+			enum-name = "GPIO_TEMP_SENSOR_POWER";
+		};
+		gpio_en_pp5000_s5: en_pp5000_s5 {
+			gpios = <&gpioh 2 (GPIO_OUTPUT | GPIO_ACTIVE_HIGH | GPIO_OUTPUT_INIT_LOW)>;
+		};
+		gpio_en_pp5000_vbus: en_pp5000_vbus {
+			gpios = <&gpiof 4 (GPIO_OUTPUT | GPIO_ACTIVE_HIGH | GPIO_OUTPUT_INIT_LOW)>;
+		};
+		gpio_gsc_ec_pwr_btn_odl: gsc_ec_pwr_btn_odl {
+			gpios = <&gpioe 4 (GPIO_INPUT | GPIO_PULL_UP)>;
+			enum-name = "GPIO_POWER_BUTTON_L";
+		};
+		gpio_i2c_ec_pd_int_odl: i2c_ec_pd_int_odl {
+			gpios = <&gpiof 5 (GPIO_INPUT | GPIO_ACTIVE_LOW)>;
+		};
+		gpio_imu_int_l: imu_int_l {
+			gpios = <&gpiod 3 (GPIO_INPUT)>;
+		};
+		gpio_imvp91_vrrdy_r_od: imvp91_vrrdy_r_od {
+			gpios = <&gpioe 7 (GPIO_OUTPUT | GPIO_OPEN_DRAIN | GPIO_ACTIVE_HIGH | GPIO_OUTPUT_INIT_LOW)>;
+		};
+		gpio_lid_open: lid_open {
+			gpios = <&gpiod 6 (GPIO_INPUT)>;
+			enum-name = "GPIO_LID_OPEN";
+		};
+		gpio_pdc_rst: pdc_rst {
+			gpios = <&gpioe 2 GPIO_OUTPUT>;
+		};
+		gpio_pg_pp1050_mem_s3_od: pg_pp1050_mem_s3_od {
+			gpios = <&gpiog 0 (GPIO_INPUT)>;
+		};
+		gpio_pg_pp5000_z1_od: pg_pp5000_z1_od {
+			gpios = <&gpioh 3 (GPIO_INPUT)>;
+		};
+		gpio_rsmrst_pwrgd_l: rsmrst_pwrgd_l {
+			gpios = <&gpiof 2 (GPIO_INPUT)>;
+		};
+		gpio_slp_s0_l: slp_s0_l {
+			gpios = <&gpioj 5 (GPIO_INPUT)>;
+		};
+		gpio_slp_s3_l: slp_s3_l {
+			gpios = <&gpioc 6 (GPIO_INPUT)>;
+		};
+		gpio_slp_s4_l: slp_s4_l {
+			gpios = <&gpioc 4 (GPIO_INPUT)>;
+		};
+		gpio_slp_sus_l: slp_sus_l {
+			gpios = <&gpioe 5 (GPIO_INPUT)>;
+		};
+		gpio_sys_rst_odl: sys_rst_odl {
+			gpios = <&gpioj 7 (GPIO_OUTPUT | GPIO_OPEN_DRAIN | GPIO_ACTIVE_LOW)>;
+		};
+		gpio_tablet_mode_l: tablet_mode_l {
+			gpios = <&gpiod 1 (GPIO_INPUT)>;
+			enum-name = "GPIO_TABLET_MODE_L";
+		};
+		gpio_sen_mode2_ec_pch_int_odl: sen_mode2_ec_pch_int_odl {
+			gpios = <&gpiod 4 GPIO_ODR_LOW>;
+		};
+		gpio_sen_mode2_ec_ish_int_odl: sen_mode2_ec_ish_int_odl {
+			gpios = <&gpiob 1 (GPIO_INPUT | GPIO_OUTPUT)>;
+		};
+		gpio_en_slp_z: en_slp_z {
+			gpios = <&gpioh 5 GPIO_OUTPUT>;
+		};
+		gpio_ec_batt_pres_odl: ec_batt_pres_odl {
+			gpios = <&gpioc 7 GPIO_INPUT>;
+			enum-name = "GPIO_BATT_PRES_ODL";
+		};
+		gpio_bat_disconnect_ec_odl: bat_disconnect_ec_odl {
+			gpios = <&gpiod 0 GPIO_ODR_LOW>;
+		};
+		gpio_ec_kso_02_inv: ec_kso_02_inv {
+			gpios = <&gpioksol 2 GPIO_OUTPUT_HIGH>;
+		};
+		gpio_ec_touchpad_disable: ec_touchpad_disable {
+			gpios = <&gpiob 6 (GPIO_INPUT)>;
+		};
+		gpio_ec_x360_cs_id: ec_x360_cs_id {
+			gpios = <&gpioe 0 GPIO_INPUT>;
+		};
+		gpio_ec_cpu_id: ec_cpu_id {
+			gpios = <&gpioh 6 GPIO_INPUT>;
 		};
 	};
+	unused-pins {
+		compatible = "unused-gpios";
+
+		unused-gpios =
+			/* EC_GPG3 */
+			<&gpiog 3 0>,
+			/* EC_GPG4 */
+			<&gpiog 4 0>,
+			/* EC_GPG5 */
+			<&gpiog 5 0>,
+			/* EC_GPG7 */
+			<&gpiog 7 0>;
+		};
+};
+
+/* The eSPI shim requires this GPIO nodelabel */
+gpio_ec_pch_wake_odl: &gpio_sen_mode2_ec_pch_int_odl{
+};
+
+/* These GPIOS are initialized by the PDC driver */
+&gpio_i2c_ec_pd_int_odl {
+	no-auto-init;
+};
+&gpio_ec_pmc_pd_int_odl {
+	no-auto-init;
+};
+&gpio_imvp91_vrrdy_r_od  {
+	no-auto-init;
 };
\ No newline at end of file
diff --git a/zephyr/program/trulo/kaladin/i2c.dtsi b/zephyr/program/trulo/kaladin/i2c.dtsi
new file mode 100644
index 0000000..98dc0e4
--- /dev/null
+++ b/zephyr/program/trulo/kaladin/i2c.dtsi
@@ -0,0 +1,86 @@
+/* Copyright 2025 The ChromiumOS Authors
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+/{
+
+	named-i2c-ports {
+		compatible = "named-i2c-ports";
+
+		i2c_ec_i2c_sensor: ec_i2c_sensor {
+			i2c-port = <&i2c0>;
+			enum-names = "I2C_PORT_SENSOR";
+		};
+		i2c_ec_i2c_pd_prog: ec_i2c_pd_prog {
+			i2c-port = <&i2c1>;
+			enum-names = "I2C_PORT_PD";
+		};
+		i2c_ec_i2c_charger: ec_i2c_charger {
+			i2c-port = <&i2c2>;
+			enum-names = "I2C_PORT_CHARGER";
+		};
+		i2c_ec_i2c_battery: ec_i2c_battery {
+			i2c-port = <&i2c2>;
+			enum-names = "I2C_PORT_BATTERY";
+		};
+		i2c_i2c_ec_pmc_pd: i2c_ec_pmc_pd {
+			i2c-port = <&i2c3>;
+			enum-names = "I2C_PORT_PMC_PD";
+		};
+	};
+};
+
+&i2c0 {
+	pinctrl-0 = <&i2c0_clk_gpb3_default
+		     &i2c0_data_gpb4_default>;
+	pinctrl-names = "default";
+
+	label = "I2C_SENSOR";
+	clock-frequency = <I2C_BITRATE_FAST>;
+};
+
+&i2c1 {
+	pinctrl-0 = <&i2c1_clk_gpc1_default
+		     &i2c1_data_gpc2_default>;
+	pinctrl-names = "default";
+
+	label = "I2C_PORT_PD";
+	clock-frequency = <I2C_BITRATE_FAST>;
+};
+
+&i2c2 {
+	pinctrl-0 = <&i2c2_clk_gpf6_default
+		     &i2c2_data_gpf7_default>;
+	pinctrl-names = "default";
+
+	label = "I2C_PORT_CHARGER";
+	label = "I2C_PORT_BATTERY";
+	clock-frequency = <I2C_BITRATE_STANDARD>;
+};
+
+&i2c3 {
+	pinctrl-0 = <&i2c3_clk_gpb2_default
+		     &i2c3_data_gpb5_default>;
+	pinctrl-names = "default";
+
+	label = "I2C_PORT_PMC_PD";
+	clock-frequency = <I2C_BITRATE_FAST>;
+};
+
+&i2c0 {
+	status = "okay";
+};
+
+&i2c1 {
+	status = "okay";
+};
+
+&i2c2 {
+	status = "okay";
+};
+
+&i2c3 {
+	status = "disabled";
+};
+/delete-node/ &i2c_i2c_ec_pmc_pd;
diff --git a/zephyr/program/trulo/kaladin/kaladin.dtsi b/zephyr/program/trulo/kaladin/kaladin.dtsi
new file mode 100644
index 0000000..45cee1c
--- /dev/null
+++ b/zephyr/program/trulo/kaladin/kaladin.dtsi
@@ -0,0 +1,44 @@
+/* Copyright 2025 The ChromiumOS Authors
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+/ {
+	aliases {
+		gpio-wp = &gpio_ec_wp_odl;
+	};
+	chosen {
+		zephyr,console = &uart2;
+		zephyr,shell-uart = &uart2;
+	};
+
+	named-gpios {
+		compatible = "named-gpios";
+
+		/* The legacy system code requires GPIO_ENTERING_RW symbol */
+		gpio_ec_entering_rw: ec_entering_rw {
+			enum-name = "GPIO_ENTERING_RW";
+		};
+	};
+};
+
+/* UART interface is SIN1/SOUT1 pins, which ITE maps to devicetree uart2 */
+&uart1 {
+	status = "disabled";
+};
+
+&ite_uart1_wrapper {
+	status = "disabled";
+};
+
+&uart2 {
+	status = "okay";
+	current-speed = <115200>;
+};
+
+&ite_uart2_wrapper {
+	status = "okay";
+	pinctrl-0 = <&uart2_rx_gpf0_default
+		     &uart2_tx_gpf1_default>;
+	pinctrl-names = "default";
+};
diff --git a/zephyr/program/trulo/kaladin/project.overlay b/zephyr/program/trulo/kaladin/project.overlay
index 0147cc6..019d522 100644
--- a/zephyr/program/trulo/kaladin/project.overlay
+++ b/zephyr/program/trulo/kaladin/project.overlay
@@ -9,5 +9,8 @@
 
 /* Kaladin project DTS includes*/
 #include "gpio.dtsi"
+#include "i2c.dtsi"
+#include "adc.dtsi"
+#include "kaladin.dtsi"
 
 /* Kaladin overrides follow... */