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])
455 mask = params->usb_reg_bits_map[field]; in usb_ctrl_unset_family()
456 brcm_usb_ctrl_unset(params->regs[BRCM_REGS_CTRL] + reg_offset, mask); in usb_ctrl_unset_family()
465 mask = params->usb_reg_bits_map[field]; in usb_ctrl_set_family()
466 brcm_usb_ctrl_set(params->regs[BRCM_REGS_CTRL] + reg_offset, mask); in usb_ctrl_set_family()
512 /* reset USB 2.0 PLL */ in brcmusb_usb_phy_ldo_fix()
514 /* PLL reset period */ in brcmusb_usb_phy_ldo_fix()
517 /* Give PLL enough time to lock */ in brcmusb_usb_phy_ldo_fix()
530 /* Set correct window for PLL lock detect */ in brcmusb_usb3_pll_fix()
539 /* Re-enable USB 3.0 pipe reset */ in brcmusb_usb3_enable_pipe_reset()
599 void __iomem *ctrl_base = params->regs[BRCM_REGS_CTRL]; in brcmusb_usb3_pll_54mhz()
603 * 3.0 PLL has been changed from 50MHz to 54MHz so the in brcmusb_usb3_pll_54mhz()
604 * PLL needs to be reprogrammed. in brcmusb_usb3_pll_54mhz()
605 * See SWLINUX-4006. in brcmusb_usb3_pll_54mhz()
608 * 3.0 PLL has been changed from 50MHz to 54MHz to in brcmusb_usb3_pll_54mhz()
610 * See SWLINUX-4169. in brcmusb_usb3_pll_54mhz()
612 switch (params->selected_family) { in brcmusb_usb3_pll_54mhz()
623 if (BRCM_REV(params->family_id) < 0x20) in brcmusb_usb3_pll_54mhz()
628 /* set USB 3.0 PLL to accept 54Mhz reference clock */ in brcmusb_usb3_pll_54mhz()
655 /* restart PLL sequence */ in brcmusb_usb3_pll_54mhz()
657 /* Give PLL enough time to lock */ in brcmusb_usb3_pll_54mhz()
670 /* Currently, USB 3.0 SSC is enabled via port 0 MDIO registers, in brcmusb_usb3_ssc_enable()
672 * USB 3.0 PHY, it must be enabled via both ports (HWUSB3DVT-26). in brcmusb_usb3_ssc_enable()
681 void __iomem *ctrl_base = params->regs[BRCM_REGS_CTRL]; in brcmusb_usb3_phy_workarounds()
696 if (params->selected_family != BRCM_FAMILY_7445D0) in brcmusb_memc_fix()
699 * This is a workaround for HW7445-1869 where a DMA write ends up in brcmusb_memc_fix()
700 * doing a read pre-fetch after the end of the DMA buffer. This in brcmusb_memc_fix()
702 * memory, causing the pre-fetch read to access non-existent memory, in brcmusb_memc_fix()
703 * and the chip bondout has MEMC2 disabled. When the pre-fetch read in brcmusb_memc_fix()
709 prid = params->product_id & 0xfffff000; in brcmusb_memc_fix()
723 void __iomem *xhci_ec_base = params->regs[BRCM_REGS_XHCI_EC]; in brcmusb_usb3_otp_fix()
726 if (params->family_id != 0x74371000 || !xhci_ec_base) in brcmusb_usb3_otp_fix()
736 USB_CTRL_UNSET(params->regs[BRCM_REGS_CTRL], USB30_CTL1, PHY3_RESETB); in brcmusb_usb3_otp_fix()
737 USB_CTRL_SET(params->regs[BRCM_REGS_CTRL], USB30_CTL1, PHY3_RESETB); in brcmusb_usb3_otp_fix()
750 } else { /* De-assert reset */ in brcmusb_xhci_soft_reset()
761 * - exact match of chip and major rev
762 * - exact match of chip and closest older major rev
763 * - default chip/rev.
769 int last_type = -1; in get_family_type()
775 family = params->family_id & 0xfffffff0; in get_family_type()
776 family_no_major = params->family_id & 0xffffff00; in get_family_type()
789 if (last_type == -1) in get_family_type()
796 void __iomem *ctrl = params->regs[BRCM_REGS_CTRL]; in usb_init_ipp()
804 if (params->ioc) in usb_init_ipp()
806 if (params->ipp == 1) in usb_init_ipp()
819 if (params->ipp != 2) in usb_init_ipp()
825 if (params->ioc) in usb_init_ipp()
827 if (params->ipp == 1) in usb_init_ipp()
842 void __iomem *ctrl = params->regs[BRCM_REGS_CTRL]; in usb_wake_enable()
853 void __iomem *ctrl = params->regs[BRCM_REGS_CTRL]; in usb_init_common()
863 /* 1 millisecond - for USB clocks to settle down */ in usb_init_common()
869 /* 1 millisecond - for USB clocks to settle down */ in usb_init_common()
873 if (params->selected_family != BRCM_FAMILY_74371A0 && in usb_init_common()
874 (BRCM_ID(params->family_id) != 0x7364)) in usb_init_common()
876 * HW7439-637: 7439a0 and its derivatives do not have large in usb_init_common()
881 /* Block auto PLL suspend by USB2 PHY (Sasi) */ in usb_init_common()
885 if (params->selected_family == BRCM_FAMILY_7364A0) in usb_init_common()
894 * interfaces are enabled if they exist. in usb_init_common()
905 if ((params->family_id == 0x74390012) && in usb_init_common()
906 (params->supported_port_modes != USB_CTLR_MODE_HOST)) { in usb_init_common()
915 reg |= params->port_mode; in usb_init_common()
919 switch (params->supported_port_modes) { in usb_init_common()
930 if (params->supported_port_modes == USB_CTLR_MODE_TYPEC_PD) in usb_init_common()
941 void __iomem *ctrl = params->regs[BRCM_REGS_CTRL]; in usb_init_eohci()
946 if (params->selected_family == BRCM_FAMILY_7366C0) in usb_init_eohci()
959 if (params->selected_family == BRCM_FAMILY_7271A0) in usb_init_eohci()
960 /* Enable LS keep alive fix for certain keyboards */ in usb_init_eohci()
963 if (params->family_id == 0x72550000) { in usb_init_eohci()
966 * on the 7255a0. See HW7255-24. in usb_init_eohci()
977 void __iomem *ctrl = params->regs[BRCM_REGS_CTRL]; in usb_init_xhci()
980 /* 1 millisecond - for USB clocks to settle down */ in usb_init_xhci()
983 if (BRCM_ID(params->family_id) == 0x7366) { in usb_init_xhci()
1010 if (params->wake_enabled) in usb_uninit_common()
1021 USB_CTRL_SET(params->regs[BRCM_REGS_CTRL], USB30_PCTL, in usb_uninit_xhci()
1027 void __iomem *ctrl = params->regs[BRCM_REGS_CTRL]; in usb_get_dual_select()
1041 void __iomem *ctrl = params->regs[BRCM_REGS_CTRL]; in usb_set_dual_select()
1050 reg |= params->port_mode; in usb_set_dual_select()
1072 params->selected_family = fam; in brcm_usb_dvr_init_4908()
1073 params->usb_reg_bits_map = in brcm_usb_dvr_init_4908()
1075 params->family_name = family_names[fam]; in brcm_usb_dvr_init_4908()
1076 params->ops = &bcm7445_ops; in brcm_usb_dvr_init_4908()
1086 params->selected_family = fam; in brcm_usb_dvr_init_7445()
1087 params->usb_reg_bits_map = in brcm_usb_dvr_init_7445()
1089 params->family_name = family_names[fam]; in brcm_usb_dvr_init_7445()
1090 params->ops = &bcm7445_ops; in brcm_usb_dvr_init_7445()