1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Freescale USB Controller
5 * Copyright 2013 Freescale Semiconductor, Inc.
8 #ifndef _ASM_FSL_USB_H_
9 #define _ASM_FSL_USB_H_
11 #ifdef CONFIG_SYS_FSL_USB_DUAL_PHY_ENABLE
12 struct ccsr_usb_port_ctrl {
31 struct ccsr_usb_port_ctrl port1;
39 struct ccsr_usb_port_ctrl port2;
43 #define CFG_SYS_FSL_USB_CTRL_PHY_EN (1 << 0)
44 #define CFG_SYS_FSL_USB_DRVVBUS_CR_EN (1 << 1)
45 #define CFG_SYS_FSL_USB_PWRFLT_CR_EN (1 << 1)
46 #define CFG_SYS_FSL_USB_PLLPRG2_PHY2_CLK_EN (1 << 0)
47 #define CFG_SYS_FSL_USB_PLLPRG2_PHY1_CLK_EN (1 << 1)
48 #ifdef CONFIG_SYS_FSL_SINGLE_SOURCE_CLK
49 #define CFG_SYS_FSL_USB_PLLPRG2_REF_DIV_INTERNAL_CLK (5 << 4)
50 #define CFG_SYS_FSL_USB_PLLPRG2_MFI_INTERNAL_CLK (6 << 16)
51 #define CFG_SYS_FSL_USB_INTERNAL_SOC_CLK_EN (1 << 20)
53 #define CFG_SYS_FSL_USB_PLLPRG2_REF_DIV (1 << 4)
54 #define CFG_SYS_FSL_USB_PLLPRG2_MFI (5 << 16)
55 #define CFG_SYS_FSL_USB_PLLPRG2_PLL_EN (1 << 21)
56 #define CFG_SYS_FSL_USB_XCVRPRG_HS_DCNT_PROG_EN (1 << 7)
57 #define CFG_SYS_FSL_USB_XCVRPRG_HS_DCNT_PROG_MASK (3 << 4)
59 #define INC_DCNT_THRESHOLD_25MV (0 << 4)
60 #define INC_DCNT_THRESHOLD_50MV (1 << 4)
61 #define DEC_DCNT_THRESHOLD_25MV (2 << 4)
62 #define DEC_DCNT_THRESHOLD_50MV (3 << 4)
71 u32 usb_enable_override;
74 #define CFG_SYS_FSL_USB_HS_DISCNCT_INC (3 << 22)
75 #define CFG_SYS_FSL_USB_RX_AUTO_CAL_RD_WR_SEL (1 << 20)
76 #define CFG_SYS_FSL_USB_SQUELCH_PROG_WR_0 13
77 #define CFG_SYS_FSL_USB_SQUELCH_PROG_WR_3 16
78 #define CFG_SYS_FSL_USB_SQUELCH_PROG_RD_0 0
79 #define CFG_SYS_FSL_USB_SQUELCH_PROG_RD_3 3
80 #define CFG_SYS_FSL_USB_ENABLE_OVERRIDE 1
81 #define CFG_SYS_FSL_USB_SQUELCH_PROG_MASK 0x07
84 /* USB Erratum Checking code */
85 #if defined(CONFIG_PPC) || defined(CONFIG_ARM)
86 bool has_dual_phy(void);
87 bool has_erratum_a005275(void);
88 bool has_erratum_a006261(void);
89 bool has_erratum_a007075(void);
90 bool has_erratum_a007798(void);
91 bool has_erratum_a007792(void);
92 bool has_erratum_a005697(void);
93 bool has_erratum_a004477(void);
94 bool has_erratum_a008751(void);
95 bool has_erratum_a010151(void);
97 #endif /*_ASM_FSL_USB_H_ */