| 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/pll_common.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 | mt_pll_set_usb_clock(); |
| 19 | |
| 20 | gpio_output(GPIO(USB_DRVVBUS_P1), 1); |
| 21 | |
| 22 | /* disable IP0 debounce */ |
| 23 | write32p(PERICFG_BASE + PERI_U3_WAKE_CTRL0, 0); |
| 24 | /* disable IP1 debounce */ |
| 25 | write32p(PERICFG_BASE + PERI_USB_WAKEUP_DEC_CON1, 0); |
| 26 | } |