ramneek mehresh | 9dee205 | 2013-08-05 16:00:16 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Freescale USB Controller |
| 3 | * |
| 4 | * Copyright 2013 Freescale Semiconductor, Inc. |
| 5 | * |
York Sun | 49d87b1 | 2013-08-14 10:56:49 -0700 | [diff] [blame] | 6 | * SPDX-License-Identifier: GPL-2.0+ |
ramneek mehresh | 9dee205 | 2013-08-05 16:00:16 +0530 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #ifndef _ASM_FSL_USB_H_ |
| 10 | #define _ASM_FSL_USB_H_ |
| 11 | |
| 12 | #ifdef CONFIG_SYS_FSL_USB_DUAL_PHY_ENABLE |
| 13 | struct ccsr_usb_port_ctrl { |
| 14 | u32 ctrl; |
| 15 | u32 drvvbuscfg; |
| 16 | u32 pwrfltcfg; |
| 17 | u32 sts; |
| 18 | u8 res_14[0xc]; |
| 19 | u32 bistcfg; |
| 20 | u32 biststs; |
| 21 | u32 abistcfg; |
| 22 | u32 abiststs; |
| 23 | u8 res_30[0x10]; |
| 24 | u32 xcvrprg; |
| 25 | u32 anaprg; |
| 26 | u32 anadrv; |
| 27 | u32 anasts; |
| 28 | }; |
| 29 | |
| 30 | struct ccsr_usb_phy { |
| 31 | u32 id; |
| 32 | struct ccsr_usb_port_ctrl port1; |
| 33 | u8 res_50[0xc]; |
| 34 | u32 tvr; |
| 35 | u32 pllprg[4]; |
| 36 | u8 res_70[0x4]; |
| 37 | u32 anaccfg; |
| 38 | u32 dbg; |
| 39 | u8 res_7c[0x4]; |
| 40 | struct ccsr_usb_port_ctrl port2; |
| 41 | u8 res_dc[0x334]; |
| 42 | }; |
| 43 | |
| 44 | #define CONFIG_SYS_FSL_USB_CTRL_PHY_EN (1 << 0) |
| 45 | #define CONFIG_SYS_FSL_USB_DRVVBUS_CR_EN (1 << 1) |
| 46 | #define CONFIG_SYS_FSL_USB_PWRFLT_CR_EN (1 << 1) |
| 47 | #define CONFIG_SYS_FSL_USB_PLLPRG1_PHY_DIV (1 << 0) |
| 48 | #define CONFIG_SYS_FSL_USB_PLLPRG2_PHY2_CLK_EN (1 << 0) |
| 49 | #define CONFIG_SYS_FSL_USB_PLLPRG2_PHY1_CLK_EN (1 << 1) |
| 50 | #define CONFIG_SYS_FSL_USB_PLLPRG2_FRAC_LPF_EN (1 << 13) |
| 51 | #define CONFIG_SYS_FSL_USB_PLLPRG2_REF_DIV (1 << 4) |
| 52 | #define CONFIG_SYS_FSL_USB_PLLPRG2_MFI (5 << 16) |
| 53 | #define CONFIG_SYS_FSL_USB_PLLPRG2_PLL_EN (1 << 21) |
| 54 | #define CONFIG_SYS_FSL_USB_SYS_CLK_VALID (1 << 0) |
Suresh Gupta | 9c641a8 | 2014-02-26 14:29:12 +0530 | [diff] [blame] | 55 | #define CONFIG_SYS_FSL_USB_XCVRPRG_HS_DCNT_PROG_EN (1 << 7) |
| 56 | #define CONFIG_SYS_FSL_USB_XCVRPRG_HS_DCNT_PROG_MASK (3 << 4) |
| 57 | |
| 58 | #define INC_DCNT_THRESHOLD_25MV (0 << 4) |
| 59 | #define INC_DCNT_THRESHOLD_50MV (1 << 4) |
| 60 | #define DEC_DCNT_THRESHOLD_25MV (2 << 4) |
| 61 | #define DEC_DCNT_THRESHOLD_50MV (3 << 4) |
ramneek mehresh | 9dee205 | 2013-08-05 16:00:16 +0530 | [diff] [blame] | 62 | #else |
| 63 | struct ccsr_usb_phy { |
Suresh Gupta | 9c641a8 | 2014-02-26 14:29:12 +0530 | [diff] [blame] | 64 | u32 config1; |
| 65 | u32 config2; |
| 66 | u32 config3; |
| 67 | u32 config4; |
| 68 | u32 config5; |
| 69 | u32 status1; |
ramneek mehresh | 9dee205 | 2013-08-05 16:00:16 +0530 | [diff] [blame] | 70 | u32 usb_enable_override; |
| 71 | u8 res[0xe4]; |
| 72 | }; |
Suresh Gupta | 9c641a8 | 2014-02-26 14:29:12 +0530 | [diff] [blame] | 73 | #define CONFIG_SYS_FSL_USB_HS_DISCNCT_INC (3 << 22) |
| 74 | #define CONFIG_SYS_FSL_USB_RX_AUTO_CAL_RD_WR_SEL (1 << 20) |
| 75 | #define CONFIG_SYS_FSL_USB_SQUELCH_PROG_WR_0 13 |
| 76 | #define CONFIG_SYS_FSL_USB_SQUELCH_PROG_WR_3 16 |
| 77 | #define CONFIG_SYS_FSL_USB_SQUELCH_PROG_RD_0 0 |
| 78 | #define CONFIG_SYS_FSL_USB_SQUELCH_PROG_RD_3 3 |
| 79 | #define CONFIG_SYS_FSL_USB_ENABLE_OVERRIDE 1 |
| 80 | #define CONFIG_SYS_FSL_USB_SQUELCH_PROG_MASK 0x07 |
ramneek mehresh | 9dee205 | 2013-08-05 16:00:16 +0530 | [diff] [blame] | 81 | #endif |
| 82 | |
| 83 | #endif /*_ASM_FSL_USB_H_ */ |