#include <linux/delay.h>
#include <linux/io.h>
#include <linux/soc/brcmstb/brcmstb.h>
#include "phy-brcm-usb-init.h"
#define PHY_PORTS …
#define PHY_PORT_SELECT_0 …
#define PHY_PORT_SELECT_1 …
#define USB_CTRL_SETUP …
#define USB_CTRL_SETUP_BABO_MASK …
#define USB_CTRL_SETUP_FNHW_MASK …
#define USB_CTRL_SETUP_FNBO_MASK …
#define USB_CTRL_SETUP_WABO_MASK …
#define USB_CTRL_SETUP_IOC_MASK …
#define USB_CTRL_SETUP_IPP_MASK …
#define USB_CTRL_SETUP_SCB_CLIENT_SWAP_MASK …
#define USB_CTRL_SETUP_SCB1_EN_MASK …
#define USB_CTRL_SETUP_SCB2_EN_MASK …
#define USB_CTRL_SETUP_SS_EHCI64BIT_EN_MASK …
#define USB_CTRL_SETUP_SS_EHCI64BIT_EN_VAR_MASK …
#define USB_CTRL_SETUP_STRAP_IPP_SEL_MASK …
#define USB_CTRL_SETUP_CC_DRD_MODE_ENABLE_MASK …
#define USB_CTRL_SETUP_STRAP_CC_DRD_MODE_ENABLE_SEL_MASK …
#define USB_CTRL_SETUP_OC_DISABLE_PORT0_MASK …
#define USB_CTRL_SETUP_OC_DISABLE_PORT1_MASK …
#define USB_CTRL_SETUP_OC_DISABLE_MASK …
#define USB_CTRL_SETUP_OC3_DISABLE_PORT0_MASK …
#define USB_CTRL_SETUP_OC3_DISABLE_PORT1_MASK …
#define USB_CTRL_SETUP_OC3_DISABLE_MASK …
#define USB_CTRL_PLL_CTL …
#define USB_CTRL_PLL_CTL_PLL_SUSPEND_EN_MASK …
#define USB_CTRL_PLL_CTL_PLL_RESETB_MASK …
#define USB_CTRL_PLL_CTL_PLL_IDDQ_PWRDN_MASK …
#define USB_CTRL_EBRIDGE …
#define USB_CTRL_EBRIDGE_EBR_SCB_SIZE_MASK …
#define USB_CTRL_EBRIDGE_ESTOP_SCB_REQ_MASK …
#define USB_CTRL_OBRIDGE …
#define USB_CTRL_OBRIDGE_LS_KEEP_ALIVE_MASK …
#define USB_CTRL_MDIO …
#define USB_CTRL_MDIO2 …
#define USB_CTRL_UTMI_CTL_1 …
#define USB_CTRL_UTMI_CTL_1_POWER_UP_FSM_EN_MASK …
#define USB_CTRL_UTMI_CTL_1_POWER_UP_FSM_EN_P1_MASK …
#define USB_CTRL_USB_PM …
#define USB_CTRL_USB_PM_RMTWKUP_EN_MASK …
#define USB_CTRL_USB_PM_USB20_HC_RESETB_VAR_MASK …
#define USB_CTRL_USB_PM_XHC_SOFT_RESETB_MASK …
#define USB_CTRL_USB_PM_BDC_SOFT_RESETB_MASK …
#define USB_CTRL_USB_PM_USB20_HC_RESETB_MASK …
#define USB_CTRL_USB_PM_XHC_SOFT_RESETB_VAR_MASK …
#define USB_CTRL_USB_PM_SOFT_RESET_MASK …
#define USB_CTRL_USB_PM_USB_PWRDN_MASK …
#define USB_CTRL_USB_PM_STATUS …
#define USB_CTRL_USB30_CTL1 …
#define USB_CTRL_USB30_CTL1_PHY3_PLL_SEQ_START_MASK …
#define USB_CTRL_USB30_CTL1_PHY3_RESETB_MASK …
#define USB_CTRL_USB30_CTL1_XHC_SOFT_RESETB_MASK …
#define USB_CTRL_USB30_CTL1_USB3_IOC_MASK …
#define USB_CTRL_USB30_CTL1_USB3_IPP_MASK …
#define USB_CTRL_USB30_PCTL …
#define USB_CTRL_USB30_PCTL_PHY3_SOFT_RESETB_MASK …
#define USB_CTRL_USB30_PCTL_PHY3_IDDQ_OVERRIDE_MASK …
#define USB_CTRL_USB30_PCTL_PHY3_SOFT_RESETB_P1_MASK …
#define USB_CTRL_USB_DEVICE_CTL1 …
#define USB_CTRL_USB_DEVICE_CTL1_PORT_MODE_MASK …
#define USB_XHCI_EC_IRAADR …
#define USB_XHCI_EC_IRADAT …
enum brcm_family_type { … };
#define USB_BRCM_FAMILY(chip) …
static const char *family_names[BRCM_FAMILY_COUNT] = …;
enum { … };
#define USB_CTRL_MASK_FAMILY(params, reg, field) …
#define USB_CTRL_SET_FAMILY(params, reg, field) …
#define USB_CTRL_UNSET_FAMILY(params, reg, field) …
#define MDIO_USB2 …
#define MDIO_USB3 …
#define USB_CTRL_SETUP_ENDIAN_BITS …
#ifdef __LITTLE_ENDIAN
#define ENDIAN_SETTINGS …
#else
#define ENDIAN_SETTINGS …
#endif
struct id_to_type { … };
static const struct id_to_type id_to_type_table[] = …;
static const u32
usb_reg_bits_map_table[BRCM_FAMILY_COUNT][USB_CTRL_SELECTOR_COUNT] = …;
static inline
void usb_ctrl_unset_family(struct brcm_usb_init_params *params,
u32 reg_offset, u32 field)
{
u32 mask;
mask = params->usb_reg_bits_map[field];
brcm_usb_ctrl_unset(params->regs[BRCM_REGS_CTRL] + reg_offset, mask);
};
static inline
void usb_ctrl_set_family(struct brcm_usb_init_params *params,
u32 reg_offset, u32 field)
{
u32 mask;
mask = params->usb_reg_bits_map[field];
brcm_usb_ctrl_set(params->regs[BRCM_REGS_CTRL] + reg_offset, mask);
};
static u32 brcmusb_usb_mdio_read(void __iomem *ctrl_base, u32 reg, int mode)
{ … }
static void brcmusb_usb_mdio_write(void __iomem *ctrl_base, u32 reg,
u32 val, int mode)
{ … }
static void brcmusb_usb_phy_ldo_fix(void __iomem *ctrl_base)
{ … }
static void brcmusb_usb2_eye_fix(void __iomem *ctrl_base)
{ … }
static void brcmusb_usb3_pll_fix(void __iomem *ctrl_base)
{ … }
static void brcmusb_usb3_enable_pipe_reset(void __iomem *ctrl_base)
{ … }
static void brcmusb_usb3_enable_sigdet(void __iomem *ctrl_base)
{ … }
static void brcmusb_usb3_enable_skip_align(void __iomem *ctrl_base)
{ … }
static void brcmusb_usb3_unfreeze_aeq(void __iomem *ctrl_base)
{ … }
static void brcmusb_usb3_pll_54mhz(struct brcm_usb_init_params *params)
{ … }
static void brcmusb_usb3_ssc_enable(void __iomem *ctrl_base)
{ … }
static void brcmusb_usb3_phy_workarounds(struct brcm_usb_init_params *params)
{ … }
static void brcmusb_memc_fix(struct brcm_usb_init_params *params)
{ … }
static void brcmusb_usb3_otp_fix(struct brcm_usb_init_params *params)
{ … }
static void brcmusb_xhci_soft_reset(struct brcm_usb_init_params *params,
int on_off)
{ … }
static enum brcm_family_type get_family_type(
struct brcm_usb_init_params *params)
{ … }
static void usb_init_ipp(struct brcm_usb_init_params *params)
{ … }
static void usb_wake_enable(struct brcm_usb_init_params *params,
bool enable)
{ … }
static void usb_init_common(struct brcm_usb_init_params *params)
{ … }
static void usb_init_eohci(struct brcm_usb_init_params *params)
{ … }
static void usb_init_xhci(struct brcm_usb_init_params *params)
{ … }
static void usb_uninit_common(struct brcm_usb_init_params *params)
{ … }
static void usb_uninit_eohci(struct brcm_usb_init_params *params)
{ … }
static void usb_uninit_xhci(struct brcm_usb_init_params *params)
{ … }
static int usb_get_dual_select(struct brcm_usb_init_params *params)
{ … }
static void usb_set_dual_select(struct brcm_usb_init_params *params)
{ … }
static const struct brcm_usb_init_ops bcm7445_ops = …;
void brcm_usb_dvr_init_4908(struct brcm_usb_init_params *params)
{ … }
void brcm_usb_dvr_init_7445(struct brcm_usb_init_params *params)
{ … }