coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
usb.c
Go to the documentation of this file.
1
/* SPDX-License-Identifier: GPL-2.0-only */
2
3
/*
4
* This file is created based on MT8186 Functional Specification
5
* Chapter number: 5.5
6
*/
7
8
#include <
device/mmio.h
>
9
#include <gpio.h>
10
#include <soc/gpio.h>
11
#include <soc/usb.h>
12
13
#define PERI_USB_WAKEUP_DEC_CON1 0x404
14
#define PERI_U3_WAKE_CTRL0 0x420
15
16
void
mtk_usb_prepare
(
void
)
17
{
18
gpio_output
(
GPIO
(USB_DRVVBUS_P1), 1);
19
20
/* disable IP0 debounce */
21
write32p
(
PERICFG_BASE
+
PERI_U3_WAKE_CTRL0
, 0);
22
/* disable IP1 debounce */
23
write32p
(
PERICFG_BASE
+
PERI_USB_WAKEUP_DEC_CON1
, 0);
24
}
GPIO
@ GPIO
Definition:
chip.h:84
mmio.h
write32p
static __always_inline void write32p(const uintptr_t addr, const uint32_t value)
Definition:
mmio.h:240
gpio_output
void gpio_output(gpio_t gpio, int value)
Definition:
gpio.c:194
mtk_usb_prepare
__weak void mtk_usb_prepare(void)
Definition:
usb.c:143
PERICFG_BASE
@ PERICFG_BASE
Definition:
addressmap.h:24
PERI_USB_WAKEUP_DEC_CON1
#define PERI_USB_WAKEUP_DEC_CON1
Definition:
usb.c:13
PERI_U3_WAKE_CTRL0
#define PERI_U3_WAKE_CTRL0
Definition:
usb.c:14
src
soc
mediatek
mt8186
usb.c
Generated by
1.9.1