Skip to content

Commit de93d4f

Browse files
Chenhongrencfriedt
authored andcommitted
soc: ite: it82xx2: add it82000.bw variant support
as title. Signed-off-by: Ren Chen <[email protected]>
1 parent 20c8f6b commit de93d4f

File tree

9 files changed

+178
-0
lines changed

9 files changed

+178
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright (c) 2025 ITE Corporation. All Rights Reserved.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/dt-bindings/pinctrl/it8xxx2-pinctrl.h>
8+
#include <ite/it8xxx2-pinctrl-map.dtsi>
9+
10+
&pinctrl {
11+
/* UART alternate function */
12+
/delete-node/ uart1_rx_gpb0_default;
13+
/delete-node/ uart1_tx_gpb1_default;
14+
/omit-if-no-ref/ uart1_rx_gpc7_default: uart1_rx_gpc7_default {
15+
pinmuxs = <&pinctrlc 7 IT8XXX2_ALT_FUNC_5>;
16+
};
17+
/omit-if-no-ref/ uart1_tx_gpe6_default: uart1_tx_gpe6_default {
18+
pinmuxs = <&pinctrle 6 IT8XXX2_ALT_FUNC_3>;
19+
};
20+
21+
/* I2C alternate function */
22+
/delete-node/ i2c0_clk_gpb3_default;
23+
/delete-node/ i2c0_data_gpb4_default;
24+
/omit-if-no-ref/ i2c0_clk_gpf2_default: i2c0_clk_gpf2_default {
25+
pinmuxs = <&pinctrlf 2 IT8XXX2_ALT_FUNC_1>;
26+
};
27+
/omit-if-no-ref/ i2c0_data_gpf3_default: i2c0_data_gpf3_default {
28+
pinmuxs = <&pinctrlf 3 IT8XXX2_ALT_FUNC_1>;
29+
};
30+
};

dts/riscv/ite/it82000.dtsi

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
/*
2+
* Copyright (c) 2025 ITE Corporation. All Rights Reserved.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/dt-bindings/dt-util.h>
8+
#include <zephyr/dt-bindings/interrupt-controller/ite-intc.h>
9+
#include <zephyr/dt-bindings/pinctrl/it8xxx2-pinctrl.h>
10+
11+
#include <ite/it82xx2.dtsi>
12+
13+
/ {
14+
soc {
15+
gpioq: gpio@f01611 {
16+
compatible = "ite,it8xxx2-gpio-v2";
17+
reg = <0x00f01611 1 /* GPDR (set) */
18+
0x00f01628 1 /* GPDMR (get) */
19+
0x00f01640 1 /* GPOTR */
20+
NO_FUNC 1 /* P18SCR */
21+
0x00f016e0 8>; /* GPCR */
22+
ngpios = <5>;
23+
gpio-reserved-ranges = <3 1>;
24+
gpio-controller;
25+
interrupts = <IT8XXX2_IRQ_WU184 IRQ_TYPE_LEVEL_HIGH
26+
IT8XXX2_IRQ_WU185 IRQ_TYPE_LEVEL_HIGH
27+
IT8XXX2_IRQ_WU186 IRQ_TYPE_LEVEL_HIGH
28+
NO_FUNC 0
29+
IT8XXX2_IRQ_WU188 IRQ_TYPE_LEVEL_HIGH
30+
NO_FUNC 0
31+
NO_FUNC 0
32+
NO_FUNC 0>;
33+
interrupt-parent = <&intc>;
34+
wuc-base = <0xf01b50 0xf01b50 0xf01b50 NO_FUNC 0xf01b50
35+
NO_FUNC NO_FUNC NO_FUNC>;
36+
wuc-mask = <BIT(0) BIT(1) BIT(2) 0 BIT(4) 0 0 0>;
37+
has-volt-sel = <0 0 0 0 0 0 0 0>;
38+
#gpio-cells = <2>;
39+
};
40+
};
41+
};
42+
43+
&pinctrlb {
44+
func3-gcr = <NO_FUNC NO_FUNC 0xf03e11 NO_FUNC NO_FUNC 0xf03e11 NO_FUNC NO_FUNC>;
45+
func3-en-mask = <0 0 BIT(5) 0 0 BIT(5) 0 0>;
46+
func3-ext = <NO_FUNC NO_FUNC 0xf03e16 NO_FUNC NO_FUNC 0xf03e16 NO_FUNC NO_FUNC>;
47+
func3-ext-mask = <0 0 BIT(6) 0 0 BIT(6) 0 0>;
48+
volt-sel =<NO_FUNC NO_FUNC 0xf01649 NO_FUNC NO_FUNC 0xf01649 0xf01649 NO_FUNC>;
49+
volt-sel-mask = <0 0 BIT(2) 0 0 BIT(5) BIT(6) 0>;
50+
};
51+
52+
&gpiob {
53+
ngpios = <7>;
54+
gpio-reserved-ranges = <0 2>, <3 2>;
55+
interrupts = <NO_FUNC 0
56+
NO_FUNC 0
57+
IT8XXX2_IRQ_WU84 IRQ_TYPE_LEVEL_HIGH
58+
NO_FUNC 0
59+
NO_FUNC 0
60+
IT8XXX2_IRQ_WU104 IRQ_TYPE_LEVEL_HIGH
61+
IT8XXX2_IRQ_WU105 IRQ_TYPE_LEVEL_HIGH
62+
NO_FUNC 0>;
63+
wuc-base = <NO_FUNC NO_FUNC 0xf01b1c NO_FUNC NO_FUNC 0xf01b28 0xf01b28 NO_FUNC>;
64+
wuc-mask = <0 0 BIT(4) 0 0 BIT(0) BIT(1) 0>;
65+
has-volt-sel = <0 0 1 0 0 1 1 0>;
66+
};
67+
68+
&pinctrlc {
69+
func5-gcr = <NO_FUNC NO_FUNC NO_FUNC NO_FUNC NO_FUNC NO_FUNC NO_FUNC 0xf03e15>;
70+
func5-en-mask = <0 0 0 0 0 0 0 BIT(0)>;
71+
};
72+
73+
&pinctrle {
74+
func3-gcr = <NO_FUNC 0xf03e16 0xf03e16 NO_FUNC NO_FUNC 0xf03e10 0xf03e15 NO_FUNC>;
75+
func3-en-mask = <0 BIT(5) BIT(5) 0 0 BIT(3) BIT(1) 0>;
76+
};
77+
78+
&pinctrlf {
79+
func3-gcr = <0xf03e15 0xf03e15 NO_FUNC NO_FUNC NO_FUNC NO_FUNC 0xf03e11 NO_FUNC>;
80+
func3-en-mask = <BIT(2) BIT(3) 0 0 0 0 BIT(4) 0>;
81+
};
82+
83+
&pinctrlg {
84+
func3-gcr = <0xf03e10 NO_FUNC 0xf03e10 NO_FUNC NO_FUNC NO_FUNC 0xf03e10 NO_FUNC>;
85+
func3-en-mask = <BIT(5) 0 BIT(4) 0 0 0 BIT(1) 0>;
86+
volt-sel = <0xf0164e NO_FUNC 0xf0164e NO_FUNC NO_FUNC NO_FUNC 0xf0164e NO_FUNC>;
87+
volt-sel-mask = <BIT(0) 0 BIT(2) 0 0 0 BIT(6) 0>;
88+
};
89+
90+
&gpiog {
91+
ngpios = <8>;
92+
gpio-reserved-ranges = <1 1>;
93+
interrupts = <IT8XXX2_IRQ_WU115 IRQ_TYPE_LEVEL_HIGH
94+
NO_FUNC 0
95+
IT8XXX2_IRQ_WU117 IRQ_TYPE_LEVEL_HIGH
96+
IT8XXX2_IRQ_WU123 IRQ_TYPE_LEVEL_HIGH
97+
IT8XXX2_IRQ_WU124 IRQ_TYPE_LEVEL_HIGH
98+
IT8XXX2_IRQ_WU125 IRQ_TYPE_LEVEL_HIGH
99+
IT8XXX2_IRQ_WU118 IRQ_TYPE_LEVEL_HIGH
100+
IT8XXX2_IRQ_WU126 IRQ_TYPE_LEVEL_HIGH>;
101+
wuc-base = <0xf01b2c NO_FUNC 0xf01b2c 0xf01b30 0xf01b30 0xf01b30 0xf01b2c 0xf01b30>;
102+
wuc-mask = <BIT(3) 0 BIT(5) BIT(3) BIT(4) BIT(5) BIT(6) BIT(6)>;
103+
has-volt-sel = <1 0 1 0 0 0 1 0>;
104+
};

include/zephyr/dt-bindings/interrupt-controller/ite-intc.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,11 @@
172172
/* Group 23 */
173173
#define IT8XXX2_IRQ_WU149 184
174174
#define IT8XXX2_IRQ_WU150 185
175+
/* Group 27 */
176+
#define IT8XXX2_IRQ_WU184 216
177+
#define IT8XXX2_IRQ_WU185 217
178+
#define IT8XXX2_IRQ_WU186 218
179+
#define IT8XXX2_IRQ_WU188 220
175180

176181
#define IT8XXX2_IRQ_COUNT (CONFIG_NUM_IRQS + 1)
177182

soc/ite/ec/it8xxx2/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ config SOC_IT8XXX2_USBPD_PHY_V2
4747
This option is automatically selected by variant soc and sets
4848
the USBPD PHY version.
4949

50+
config SOC_IT8XXX2_GPIO_Q_GROUP_SUPPORTED
51+
bool
52+
help
53+
This option indicates GPIO-Q group support and is
54+
automatically selected based on the SoC variant.
55+
5056
config SOC_IT81302BX
5157
select SOC_IT8XXX2_REG_SET_V1
5258
select SOC_IT8XXX2_USBPD_PHY_V1
@@ -101,6 +107,11 @@ config SOC_IT82302BW
101107
select SOC_IT8XXX2_EC_BUS_24MHZ if !DT_HAS_ITE_IT82XX2_USB_ENABLED
102108
select SOC_IT8XXX2_USBPD_PHY_V2
103109

110+
config SOC_IT82000BW
111+
select SOC_IT8XXX2_REG_SET_V2
112+
select SOC_IT8XXX2_EC_BUS_24MHZ if !DT_HAS_ITE_IT82XX2_USB_ENABLED
113+
select SOC_IT8XXX2_GPIO_Q_GROUP_SUPPORTED
114+
104115
config SOC_IT8XXX2_PLL_FLASH_48M
105116
bool "Flash frequency is 48MHz"
106117
default y
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Copyright (c) 2025 ITE Corporation.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if SOC_IT82000BW
5+
6+
config SOC_IT8XXX2_GPIO_GROUP_K_L_DEFAULT_PULL_DOWN
7+
default y
8+
9+
endif #SOC_IT82000BW

soc/ite/ec/it8xxx2/Kconfig.defconfig.series

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ config VCMP_IT8XXX2_INIT_PRIORITY
2828
default 91 if VCMP_IT8XXX2_WORKQUEUE
2929

3030
config NUM_IRQS
31+
default 221 if SOC_IT82000BW
3132
default 185
3233

3334
config DYNAMIC_INTERRUPTS

soc/ite/ec/it8xxx2/Kconfig.soc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ config SOC_IT82302BW
5959
bool
6060
select SOC_IT8XXX2
6161

62+
config SOC_IT82000BW
63+
bool
64+
select SOC_IT8XXX2
65+
6266
config SOC_SERIES
6367
default "it8xxx2" if SOC_SERIES_IT8XXX2
6468

@@ -69,6 +73,7 @@ config SOC
6973
default "it81302bx" if SOC_IT81302BX
7074
default "it81302cx" if SOC_IT81302CX
7175
default "it81302dx" if SOC_IT81302DX
76+
default "it82000bw" if SOC_IT82000BW
7277
default "it82002aw" if SOC_IT82002AW
7378
default "it82002bw" if SOC_IT82002BW
7479
default "it82202ax" if SOC_IT82202AX

soc/ite/ec/it8xxx2/soc.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ COND_CODE_1(DT_NODE_EXISTS(DT_INST(1, ite_it8xxx2_usbpd)), (2), (1))
5252
#define CLK_DIV_HIGH_FIELDS(n) FIELD_PREP(GENMASK(7, 4), n)
5353
#define CLK_DIV_LOW_FIELDS(n) FIELD_PREP(GENMASK(3, 0), n)
5454

55+
#ifdef CONFIG_SOC_IT8XXX2_GPIO_Q_GROUP_SUPPORTED
56+
#define ELPM_BASE_ADDR 0xF03E00
57+
#define ELPMF5_INPUT_EN 0xF5
58+
#define XLPIN_INPUT_ENABLE_MASK GENMASK(5, 0)
59+
#endif /* CONFIG_SOC_IT8XXX2_GPIO_Q_GROUP_SUPPORTED */
60+
5561
uint32_t chip_get_pll_freq(void)
5662
{
5763
uint32_t pllfreq;
@@ -527,6 +533,12 @@ static int ite_it8xxx2_init(void)
527533
}
528534
#endif /* (SOC_USBPD_ITE_PHY_PORT_COUNT > 0) */
529535

536+
#ifdef CONFIG_SOC_IT8XXX2_GPIO_Q_GROUP_SUPPORTED
537+
/* set gpio-q group as gpio by default */
538+
sys_write8(sys_read8(ELPM_BASE_ADDR + ELPMF5_INPUT_EN) & ~XLPIN_INPUT_ENABLE_MASK,
539+
ELPM_BASE_ADDR + ELPMF5_INPUT_EN);
540+
#endif /* CONFIG_SOC_IT8XXX2_GPIO_Q_GROUP_SUPPORTED */
541+
530542
return 0;
531543
}
532544
SYS_INIT(ite_it8xxx2_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);

soc/ite/ec/soc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ family:
99
- name: it81302bx
1010
- name: it81302cx
1111
- name: it81302dx
12+
- name: it82000bw
1213
- name: it82002aw
1314
- name: it82002bw
1415
- name: it82202ax

0 commit comments

Comments
 (0)