1297670Ssgalabov/*- 2297670Ssgalabov * Copyright (c) 2016 Stanislav Galabov. 3297670Ssgalabov * All rights reserved. 4297670Ssgalabov * 5297670Ssgalabov * Redistribution and use in source and binary forms, with or without 6297670Ssgalabov * modification, are permitted provided that the following conditions 7297670Ssgalabov * are met: 8297670Ssgalabov * 1. Redistributions of source code must retain the above copyright 9297670Ssgalabov * notice, this list of conditions and the following disclaimer. 10297670Ssgalabov * 2. Redistributions in binary form must reproduce the above copyright 11297670Ssgalabov * notice, this list of conditions and the following disclaimer in the 12297670Ssgalabov * documentation and/or other materials provided with the distribution. 13297670Ssgalabov * 14297670Ssgalabov * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15297670Ssgalabov * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16297670Ssgalabov * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17297670Ssgalabov * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18297670Ssgalabov * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19297670Ssgalabov * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20297670Ssgalabov * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21297670Ssgalabov * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22297670Ssgalabov * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23297670Ssgalabov * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24297670Ssgalabov * SUCH DAMAGE. 25297670Ssgalabov * 26297670Ssgalabov * $FreeBSD$ 27297670Ssgalabov */ 28297670Ssgalabov#ifndef _MTK_USB_PHY_H_ 29297670Ssgalabov#define _MTK_USB_PHY_H_ 30297670Ssgalabov 31297670Ssgalabov#define MT7621_FM_FEG_BASE 0x0100 32297670Ssgalabov#define MT7621_U2_BASE 0x0800 33297670Ssgalabov#define MT7621_U2_BASE_P1 0x1000 34297670Ssgalabov#define MT7621_SR_COEF 28 35297670Ssgalabov 36297670Ssgalabov#define MT7628_FM_FEG_BASE 0x0f00 37297670Ssgalabov#define MT7628_U2_BASE 0x0800 38297670Ssgalabov#define MT7628_SR_COEF 32 39297670Ssgalabov 40297670Ssgalabov#define U2_PHY_AC0 0x00 41297670Ssgalabov#define U2_PHY_AC1 0x04 42297670Ssgalabov#define U2_PHY_AC2 0x08 43297670Ssgalabov#define U2_PHY_ACR0 0x10 44297670Ssgalabov#define SRCAL_EN (1<<23) 45297670Ssgalabov#define SRCTRL_MSK 0x7 46297670Ssgalabov#define SRCTRL_OFF 16 47297670Ssgalabov#define SRCTRL (SRCTRL_MSK<<SRCTRL_OFF) 48297670Ssgalabov#define U2_PHY_ACR1 0x14 49297670Ssgalabov#define U2_PHY_ACR2 0x18 50297670Ssgalabov#define U2_PHY_ACR3 0x1C 51297670Ssgalabov 52297670Ssgalabov#define U2_PHY_DCR0 0x60 53297670Ssgalabov#define U2_PHY_DCR1 0x64 54297670Ssgalabov#define U2_PHY_DTM0 0x68 55297670Ssgalabov#define U2_PHY_DTM1 0x6C 56297670Ssgalabov 57297670Ssgalabov#define U2_PHY_FMCR0 0x00 58297670Ssgalabov#define CYCLECNT (0xffffff) 59297670Ssgalabov#define FDET_EN (1<<24) 60297670Ssgalabov#define U2_PHY_FMCR1 0x04 61297670Ssgalabov#define FRCK_EN (1<<8) 62297670Ssgalabov#define U2_PHY_FMCR2 0x08 63297670Ssgalabov#define U2_PHY_FMMONR0 0x0C 64297670Ssgalabov#define U2_PHY_FMMONR1 0x10 65297670Ssgalabov 66297670Ssgalabov#endif /* _MTK_USB_PHY_H_ */ 67