From e703f17abef41dda0f0ea80c441bbd056581e1e5 Mon Sep 17 00:00:00 2001 From: Tinghan Shen Date: Thu, 28 Jul 2022 15:55:55 +0800 Subject: chip/mt_scp: remove gpio configuration The UART console is mainly for debug purpose. Remove it to prevent malicious usage of this interface. If required, a user can configure the pin mux by kernel dts. Take mt8195 as an example to enable the SCP UART in dts, scp_pins: scp { pins_scp_vreq { pinmux = ; bias-disable; input-enable; }; + + pins_uart { + pinmux = , + ; + bias-pull-up; + }; }; -- Conflicts on branch factory-cherry-14455.B-main: There's no mt818x folder on this branch. Remove changes for chip/mt_scp/mt818x/uart.c from original CL:3791283 -- BUG=none TEST=boot cherry scp ok. scp boot log still records in /var/log/cros_scp.log Signed-off-by: Tinghan Shen Change-Id: I37bc65b47e7423e9def5a399ba7ceb2761dc9615 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3791283 Tested-by: TingHan Shen Reviewed-by: Wei-Shun Chang Commit-Queue: Wei-Shun Chang (cherry picked from commit 2e68f3ee03f51fb0a3f8c0cad6868b2f1fb34a5a) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3835234 --- chip/mt_scp/mt8192/uart.c | 4 ---- chip/mt_scp/mt8195/uart.c | 4 ---- 2 files changed, 8 deletions(-) diff --git a/chip/mt_scp/mt8192/uart.c b/chip/mt_scp/mt8192/uart.c index 0ebb93cbb4..9e2c097414 100644 --- a/chip/mt_scp/mt8192/uart.c +++ b/chip/mt_scp/mt8192/uart.c @@ -19,10 +19,6 @@ void uart_init_pinmux(void) #if UARTN == 0 SCP_UART_CK_SEL |= UART0_CK_SEL_VAL(UART_CK_SEL_ULPOSC); SCP_SET_CLK_CG |= CG_UART0_MCLK | CG_UART0_BCLK | CG_UART0_RST; - - /* set AP GPIO164 and GPIO165 to alt func 3 */ - AP_GPIO_MODE20_CLR = 0x00770000; - AP_GPIO_MODE20_SET = 0x00330000; #elif UARTN == 1 SCP_UART_CK_SEL |= UART1_CK_SEL_VAL(UART_CK_SEL_ULPOSC); SCP_SET_CLK_CG |= CG_UART1_MCLK | CG_UART1_BCLK | CG_UART1_RST; diff --git a/chip/mt_scp/mt8195/uart.c b/chip/mt_scp/mt8195/uart.c index 76674fa7d3..dab25e7d19 100644 --- a/chip/mt_scp/mt8195/uart.c +++ b/chip/mt_scp/mt8195/uart.c @@ -19,9 +19,5 @@ void uart_init_pinmux(void) #if UARTN == 0 SCP_UART_CK_SEL |= UART0_CK_SEL_VAL(UART_CK_SEL_ULPOSC); SCP_SET_CLK_CG |= CG_UART0_MCLK | CG_UART0_BCLK | CG_UART0_RST; - - /* set AP GPIO102 and GPIO103 to alt func 5 */ - AP_GPIO_MODE12_CLR = 0x77000000; - AP_GPIO_MODE12_SET = 0x55000000; #endif } -- cgit v1.2.1