Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Kishon Vijay Abraham I | 2cdd496 | 2015-02-23 18:40:03 +0530 | [diff] [blame] | 2 | /* include/dwc3-uboot.h |
| 3 | * |
Nishanth Menon | eaa39c6 | 2023-11-01 15:56:03 -0500 | [diff] [blame] | 4 | * Copyright (c) 2015 Texas Instruments Incorporated - https://www.ti.com |
Kishon Vijay Abraham I | 2cdd496 | 2015-02-23 18:40:03 +0530 | [diff] [blame] | 5 | * |
| 6 | * Designware SuperSpeed USB uboot init |
Kishon Vijay Abraham I | 2cdd496 | 2015-02-23 18:40:03 +0530 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #ifndef __DWC3_UBOOT_H_ |
| 10 | #define __DWC3_UBOOT_H_ |
| 11 | |
developer | f8bced1 | 2020-05-02 11:35:13 +0200 | [diff] [blame] | 12 | #include <generic-phy.h> |
Kishon Vijay Abraham I | 2cdd496 | 2015-02-23 18:40:03 +0530 | [diff] [blame] | 13 | #include <linux/usb/otg.h> |
Jagan Teki | 106c71f | 2019-11-19 13:56:20 +0530 | [diff] [blame] | 14 | #include <linux/usb/phy.h> |
Kishon Vijay Abraham I | 2cdd496 | 2015-02-23 18:40:03 +0530 | [diff] [blame] | 15 | |
| 16 | struct dwc3_device { |
Siva Durga Prasad Paladugu | a10da43 | 2016-05-12 08:57:13 +0200 | [diff] [blame] | 17 | unsigned long base; |
Kishon Vijay Abraham I | 2cdd496 | 2015-02-23 18:40:03 +0530 | [diff] [blame] | 18 | enum usb_dr_mode dr_mode; |
Jagan Teki | 106c71f | 2019-11-19 13:56:20 +0530 | [diff] [blame] | 19 | enum usb_phy_interface hsphy_mode; |
Kishon Vijay Abraham I | 2cdd496 | 2015-02-23 18:40:03 +0530 | [diff] [blame] | 20 | u32 maximum_speed; |
| 21 | unsigned tx_fifo_resize:1; |
| 22 | unsigned has_lpm_erratum; |
| 23 | u8 lpm_nyet_threshold; |
| 24 | unsigned is_utmi_l1_suspend; |
| 25 | u8 hird_threshold; |
| 26 | unsigned disable_scramble_quirk; |
| 27 | unsigned u2exit_lfps_quirk; |
| 28 | unsigned u2ss_inp3_quirk; |
| 29 | unsigned req_p1p2p3_quirk; |
| 30 | unsigned del_p1p2p3_quirk; |
| 31 | unsigned del_phy_power_chg_quirk; |
| 32 | unsigned lfps_filter_quirk; |
| 33 | unsigned rx_detect_poll_quirk; |
| 34 | unsigned dis_u3_susphy_quirk; |
| 35 | unsigned dis_u2_susphy_quirk; |
Jagan Teki | c1157dc | 2020-05-06 13:20:25 +0530 | [diff] [blame] | 36 | unsigned dis_del_phy_power_chg_quirk; |
Jagan Teki | 0ece2f7 | 2020-05-26 11:33:48 +0800 | [diff] [blame] | 37 | unsigned dis_tx_ipgap_linecheck_quirk; |
Frank Wang | 0c3b6f5 | 2020-05-26 11:33:46 +0800 | [diff] [blame] | 38 | unsigned dis_enblslpm_quirk; |
Frank Wang | b29bcd7 | 2020-05-26 11:33:47 +0800 | [diff] [blame] | 39 | unsigned dis_u2_freeclk_exists_quirk; |
Kishon Vijay Abraham I | 2cdd496 | 2015-02-23 18:40:03 +0530 | [diff] [blame] | 40 | unsigned tx_de_emphasis_quirk; |
| 41 | unsigned tx_de_emphasis; |
Kishon Vijay Abraham I | dc5c653 | 2015-02-23 18:40:05 +0530 | [diff] [blame] | 42 | int index; |
Kishon Vijay Abraham I | 2cdd496 | 2015-02-23 18:40:03 +0530 | [diff] [blame] | 43 | }; |
| 44 | |
| 45 | int dwc3_uboot_init(struct dwc3_device *dev); |
Kishon Vijay Abraham I | dc5c653 | 2015-02-23 18:40:05 +0530 | [diff] [blame] | 46 | void dwc3_uboot_exit(int index); |
Marek Vasut | 26ec65b | 2024-03-17 05:42:52 +0100 | [diff] [blame] | 47 | int dwc3_uboot_interrupt_status(struct udevice *dev); |
Jean-Jacques Hiblot | 3de978a | 2018-11-29 10:52:45 +0100 | [diff] [blame] | 48 | |
| 49 | struct phy; |
| 50 | #if CONFIG_IS_ENABLED(PHY) && CONFIG_IS_ENABLED(DM_USB) |
developer | f8bced1 | 2020-05-02 11:35:13 +0200 | [diff] [blame] | 51 | int dwc3_setup_phy(struct udevice *dev, struct phy_bulk *phys); |
| 52 | int dwc3_shutdown_phy(struct udevice *dev, struct phy_bulk *phys); |
Jean-Jacques Hiblot | 3de978a | 2018-11-29 10:52:45 +0100 | [diff] [blame] | 53 | #else |
developer | f8bced1 | 2020-05-02 11:35:13 +0200 | [diff] [blame] | 54 | static inline int dwc3_setup_phy(struct udevice *dev, struct phy_bulk *phys) |
Jean-Jacques Hiblot | 3de978a | 2018-11-29 10:52:45 +0100 | [diff] [blame] | 55 | { |
| 56 | return -ENOTSUPP; |
| 57 | } |
| 58 | |
developer | f8bced1 | 2020-05-02 11:35:13 +0200 | [diff] [blame] | 59 | static inline int dwc3_shutdown_phy(struct udevice *dev, struct phy_bulk *phys) |
Jean-Jacques Hiblot | 3de978a | 2018-11-29 10:52:45 +0100 | [diff] [blame] | 60 | { |
| 61 | return -ENOTSUPP; |
| 62 | } |
| 63 | #endif |
| 64 | |
Kishon Vijay Abraham I | 2cdd496 | 2015-02-23 18:40:03 +0530 | [diff] [blame] | 65 | #endif /* __DWC3_UBOOT_H_ */ |