Skip to content

Commit c4ddc85

Browse files
GTLin08kartben
authored andcommitted
soc: it51xxx: Disable default 15K pull-down on GPF4/GPF5
When GPIOF4 and GPIOF5 are not used as USB alternate function, the default 15K pull-down should be disabled. Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
1 parent 03f20f9 commit c4ddc85

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

soc/ite/ec/it51xxx/chip_chipregs.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,12 @@ struct smfi_it51xxx_regs {
9191
struct gpio_it51xxx_regs {
9292
/* 0x00: General Control */
9393
volatile uint8_t GPIO_GCR;
94-
/* 0x01-CF: Reserved_01_cf */
95-
volatile uint8_t reserved_01_cf[207];
94+
/* 0x01-C1: Reserved_01_c1 */
95+
volatile uint8_t reserved_01_c1[193];
96+
/* 0xC2: General Control 35 */
97+
volatile uint8_t GPIO_GCR35;
98+
/* 0xC3-CF: Reserved_c3_cf */
99+
volatile uint8_t reserved_c3_cf[13];
96100
/* 0xD0: General Control 31 */
97101
volatile uint8_t GPIO_GCR31;
98102
/* 0xD1: General Control 32 */
@@ -194,6 +198,8 @@ struct gpio_it51xxx_regs {
194198
/* 0x00: General Control */
195199
#define IT51XXX_GPIO_LPCRSTEN (BIT(2) | BIT(1))
196200
#define ITE_EC_GPIO_LPCRSTEN IT51XXX_GPIO_LPCRSTEN
201+
/* 0xC2: General Control 35 */
202+
#define IT51XXX_GPIO_USBPDEN BIT(5)
197203
/* 0xF0: General Control 1 */
198204
#define IT51XXX_GPIO_U2CTRL_SIN1_SOUT1_EN BIT(2)
199205
#define IT51XXX_GPIO_U1CTRL_SIN0_SOUT0_EN BIT(0)

soc/ite/ec/it51xxx/soc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ void soc_prep_hook(void)
117117
struct gpio_ite_ec_regs *const gpio_regs = GPIO_ITE_EC_REGS_BASE;
118118
struct gctrl_ite_ec_regs *const gctrl_regs = GCTRL_ITE_EC_REGS_BASE;
119119

120+
/* USB pull down disable */
121+
gpio_regs->GPIO_GCR35 &= ~IT51XXX_GPIO_USBPDEN;
122+
120123
/* Set FSPI pins are tri-state */
121124
sys_write8(sys_read8(IT51XXX_SMFI_FLHCTRL3R) | IT51XXX_SMFI_FFSPITRI,
122125
IT51XXX_SMFI_FLHCTRL3R);

0 commit comments

Comments
 (0)