Lines Matching +full:keep +full:- +full:pll +full:- +full:enabled

1 // SPDX-License-Identifier: GPL-2.0-only
3 * phy-brcm-usb-init.c - Broadcom USB Phy chip specific init functions
5 * Copyright (C) 2014-2017 Broadcom
16 #include "phy-brcm-usb-init.h"
142 (params->usb_reg_bits_map[USB_CTRL_##reg##_##field##_SELECTOR])
453 mask = params->usb_reg_bits_map[field]; in usb_ctrl_unset_family()
454 brcm_usb_ctrl_unset(params->regs[BRCM_REGS_CTRL] + reg_offset, mask); in usb_ctrl_unset_family()
463 mask = params->usb_reg_bits_map[field]; in usb_ctrl_set_family()
464 brcm_usb_ctrl_set(params->regs[BRCM_REGS_CTRL] + reg_offset, mask); in usb_ctrl_set_family()
510 /* reset USB 2.0 PLL */ in brcmusb_usb_phy_ldo_fix()
512 /* PLL reset period */ in brcmusb_usb_phy_ldo_fix()
515 /* Give PLL enough time to lock */ in brcmusb_usb_phy_ldo_fix()
528 /* Set correct window for PLL lock detect */ in brcmusb_usb3_pll_fix()
537 /* Re-enable USB 3.0 pipe reset */ in brcmusb_usb3_enable_pipe_reset()
597 void __iomem *ctrl_base = params->regs[BRCM_REGS_CTRL]; in brcmusb_usb3_pll_54mhz()
601 * 3.0 PLL has been changed from 50MHz to 54MHz so the in brcmusb_usb3_pll_54mhz()
602 * PLL needs to be reprogrammed. in brcmusb_usb3_pll_54mhz()
603 * See SWLINUX-4006. in brcmusb_usb3_pll_54mhz()
606 * 3.0 PLL has been changed from 50MHz to 54MHz to in brcmusb_usb3_pll_54mhz()
608 * See SWLINUX-4169. in brcmusb_usb3_pll_54mhz()
610 switch (params->selected_family) { in brcmusb_usb3_pll_54mhz()
621 if (BRCM_REV(params->family_id) < 0x20) in brcmusb_usb3_pll_54mhz()
626 /* set USB 3.0 PLL to accept 54Mhz reference clock */ in brcmusb_usb3_pll_54mhz()
653 /* restart PLL sequence */ in brcmusb_usb3_pll_54mhz()
655 /* Give PLL enough time to lock */ in brcmusb_usb3_pll_54mhz()
668 /* Currently, USB 3.0 SSC is enabled via port 0 MDIO registers, in brcmusb_usb3_ssc_enable()
670 * USB 3.0 PHY, it must be enabled via both ports (HWUSB3DVT-26). in brcmusb_usb3_ssc_enable()
679 void __iomem *ctrl_base = params->regs[BRCM_REGS_CTRL]; in brcmusb_usb3_phy_workarounds()
694 if (params->selected_family != BRCM_FAMILY_7445D0) in brcmusb_memc_fix()
697 * This is a workaround for HW7445-1869 where a DMA write ends up in brcmusb_memc_fix()
698 * doing a read pre-fetch after the end of the DMA buffer. This in brcmusb_memc_fix()
700 * memory, causing the pre-fetch read to access non-existent memory, in brcmusb_memc_fix()
701 * and the chip bondout has MEMC2 disabled. When the pre-fetch read in brcmusb_memc_fix()
707 prid = params->product_id & 0xfffff000; in brcmusb_memc_fix()
721 void __iomem *xhci_ec_base = params->regs[BRCM_REGS_XHCI_EC]; in brcmusb_usb3_otp_fix()
724 if (params->family_id != 0x74371000 || !xhci_ec_base) in brcmusb_usb3_otp_fix()
734 USB_CTRL_UNSET(params->regs[BRCM_REGS_CTRL], USB30_CTL1, PHY3_RESETB); in brcmusb_usb3_otp_fix()
735 USB_CTRL_SET(params->regs[BRCM_REGS_CTRL], USB30_CTL1, PHY3_RESETB); in brcmusb_usb3_otp_fix()
748 } else { /* De-assert reset */ in brcmusb_xhci_soft_reset()
759 * - exact match of chip and major rev
760 * - exact match of chip and closest older major rev
761 * - default chip/rev.
767 int last_type = -1; in get_family_type()
773 family = params->family_id & 0xfffffff0; in get_family_type()
774 family_no_major = params->family_id & 0xffffff00; in get_family_type()
787 if (last_type == -1) in get_family_type()
794 void __iomem *ctrl = params->regs[BRCM_REGS_CTRL]; in usb_init_ipp()
802 if (params->ioc) in usb_init_ipp()
804 if (params->ipp == 1) in usb_init_ipp()
817 if (params->ipp != 2) in usb_init_ipp()
823 if (params->ioc) in usb_init_ipp()
825 if (params->ipp == 1) in usb_init_ipp()
840 void __iomem *ctrl = params->regs[BRCM_REGS_CTRL]; in usb_wake_enable()
851 void __iomem *ctrl = params->regs[BRCM_REGS_CTRL]; in usb_init_common()
861 /* 1 millisecond - for USB clocks to settle down */ in usb_init_common()
867 /* 1 millisecond - for USB clocks to settle down */ in usb_init_common()
871 if (params->selected_family != BRCM_FAMILY_74371A0 && in usb_init_common()
872 (BRCM_ID(params->family_id) != 0x7364)) in usb_init_common()
874 * HW7439-637: 7439a0 and its derivatives do not have large in usb_init_common()
879 /* Block auto PLL suspend by USB2 PHY (Sasi) */ in usb_init_common()
883 if (params->selected_family == BRCM_FAMILY_7364A0) in usb_init_common()
892 * interfaces are enabled if they exist. in usb_init_common()
903 if ((params->family_id == 0x74390012) && in usb_init_common()
904 (params->supported_port_modes != USB_CTLR_MODE_HOST)) { in usb_init_common()
913 reg |= params->port_mode; in usb_init_common()
917 switch (params->supported_port_modes) { in usb_init_common()
928 if (params->supported_port_modes == USB_CTLR_MODE_TYPEC_PD) in usb_init_common()
939 void __iomem *ctrl = params->regs[BRCM_REGS_CTRL]; in usb_init_eohci()
944 if (params->selected_family == BRCM_FAMILY_7366C0) in usb_init_eohci()
957 if (params->selected_family == BRCM_FAMILY_7271A0) in usb_init_eohci()
958 /* Enable LS keep alive fix for certain keyboards */ in usb_init_eohci()
961 if (params->family_id == 0x72550000) { in usb_init_eohci()
964 * on the 7255a0. See HW7255-24. in usb_init_eohci()
975 void __iomem *ctrl = params->regs[BRCM_REGS_CTRL]; in usb_init_xhci()
978 /* 1 millisecond - for USB clocks to settle down */ in usb_init_xhci()
981 if (BRCM_ID(params->family_id) == 0x7366) { in usb_init_xhci()
1008 if (params->wake_enabled) in usb_uninit_common()
1019 USB_CTRL_SET(params->regs[BRCM_REGS_CTRL], USB30_PCTL, in usb_uninit_xhci()
1025 void __iomem *ctrl = params->regs[BRCM_REGS_CTRL]; in usb_get_dual_select()
1039 void __iomem *ctrl = params->regs[BRCM_REGS_CTRL]; in usb_set_dual_select()
1048 reg |= params->port_mode; in usb_set_dual_select()
1070 params->selected_family = fam; in brcm_usb_dvr_init_4908()
1071 params->usb_reg_bits_map = in brcm_usb_dvr_init_4908()
1073 params->family_name = family_names[fam]; in brcm_usb_dvr_init_4908()
1074 params->ops = &bcm7445_ops; in brcm_usb_dvr_init_4908()
1084 params->selected_family = fam; in brcm_usb_dvr_init_7445()
1085 params->usb_reg_bits_map = in brcm_usb_dvr_init_7445()
1087 params->family_name = family_names[fam]; in brcm_usb_dvr_init_7445()
1088 params->ops = &bcm7445_ops; in brcm_usb_dvr_init_7445()