summaryrefslogtreecommitdiff
path: root/src/soc/mediatek/mt8196/usb.c
diff options
context:
space:
mode:
authorMingjin Ge <mingjin.ge@mediatek.corp-partner.google.com>2024-01-25 15:54:31 +0800
committerFelix Held <felix-coreboot@felixheld.de>2024-08-29 13:52:39 +0000
commit1b0ef438db7fa7398fbcc222975a44f7930867f0 (patch)
tree56de391a81c84cff8ea881c49f5a37e99ac52987 /src/soc/mediatek/mt8196/usb.c
parentab663c3cb9bc0bf7779f8a98f8973eda22d54997 (diff)
soc/mediatek/mt8196: Add USB host support
Add USB host function support. TEST=read usb data successfully. BUG=b:317009620 Signed-off-by: Mingjin Ge <mingjin.ge@mediatek.corp-partner.google.com> Change-Id: Ia4efcddac9bf5e04e688648a5c22384075a0b026 Reviewed-on: https://review.coreboot.org/c/coreboot/+/84023 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com> Reviewed-by: Yidi Lin <yidilin@google.com>
Diffstat (limited to 'src/soc/mediatek/mt8196/usb.c')
-rw-r--r--src/soc/mediatek/mt8196/usb.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/soc/mediatek/mt8196/usb.c b/src/soc/mediatek/mt8196/usb.c
new file mode 100644
index 0000000000..56fe15cb4d
--- /dev/null
+++ b/src/soc/mediatek/mt8196/usb.c
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0-only OR MIT */
+
+/*
+ * This file is created based on MT8188 Functional Specification
+ * Chapter number: 13.1,13.2
+ */
+
+#include <soc/addressmap.h>
+#include <device/mmio.h>
+#include <soc/usb.h>
+
+#define CTRL_U3_PORT_SS_SUP_SPEED (3U << 9)
+
+void mtk_usb_prepare(void)
+{
+ /* SW sets this register to change USB3.2 speed to Gen1-5Gbps */
+ struct ssusb_ippc_regs *ippc_regs = (void *)(SSUSB_IPPC_BASE);
+
+ clrsetbits32(&ippc_regs->u3_ctrl_p[0], CTRL_U3_PORT_SS_SUP_SPEED, 0);
+}