Lines Matching refs:phy
117 static struct usb3_dpll_params *ti_usb3_get_dpll_params(struct ti_usb_phy *phy) in ti_usb3_get_dpll_params() argument
120 struct usb3_dpll_map *dpll_map = phy->dpll_map; in ti_usb3_get_dpll_params()
129 dev_err(phy->dev, "No DPLL configuration for %lu Hz SYS CLK\n", rate); in ti_usb3_get_dpll_params()
134 static int ti_usb3_dpll_wait_lock(struct ti_usb_phy *phy) in ti_usb3_dpll_wait_lock() argument
138 val = ti_usb3_readl(phy->pll_ctrl_base, PLL_STATUS); in ti_usb3_dpll_wait_lock()
146 static int ti_usb3_dpll_program(struct ti_usb_phy *phy) in ti_usb3_dpll_program() argument
151 if (!phy->pll_ctrl_base) in ti_usb3_dpll_program()
154 dpll_params = ti_usb3_get_dpll_params(phy); in ti_usb3_dpll_program()
158 val = ti_usb3_readl(phy->pll_ctrl_base, PLL_CONFIGURATION1); in ti_usb3_dpll_program()
161 ti_usb3_writel(phy->pll_ctrl_base, PLL_CONFIGURATION1, val); in ti_usb3_dpll_program()
163 val = ti_usb3_readl(phy->pll_ctrl_base, PLL_CONFIGURATION2); in ti_usb3_dpll_program()
166 ti_usb3_writel(phy->pll_ctrl_base, PLL_CONFIGURATION2, val); in ti_usb3_dpll_program()
168 val = ti_usb3_readl(phy->pll_ctrl_base, PLL_CONFIGURATION1); in ti_usb3_dpll_program()
171 ti_usb3_writel(phy->pll_ctrl_base, PLL_CONFIGURATION1, val); in ti_usb3_dpll_program()
173 val = ti_usb3_readl(phy->pll_ctrl_base, PLL_CONFIGURATION4); in ti_usb3_dpll_program()
176 ti_usb3_writel(phy->pll_ctrl_base, PLL_CONFIGURATION4, val); in ti_usb3_dpll_program()
178 val = ti_usb3_readl(phy->pll_ctrl_base, PLL_CONFIGURATION3); in ti_usb3_dpll_program()
181 ti_usb3_writel(phy->pll_ctrl_base, PLL_CONFIGURATION3, val); in ti_usb3_dpll_program()
183 ti_usb3_writel(phy->pll_ctrl_base, PLL_GO, SET_PLL_GO); in ti_usb3_dpll_program()
185 return ti_usb3_dpll_wait_lock(phy); in ti_usb3_dpll_program()
189 void ti_usb2_phy_power(struct ti_usb_phy *phy, int on) in ti_usb2_phy_power() argument
193 val = readl(phy->usb2_phy_power); in ti_usb2_phy_power()
197 if (phy->index == 1) in ti_usb2_phy_power()
209 if (phy->index == 1) in ti_usb2_phy_power()
221 writel(val, phy->usb2_phy_power); in ti_usb2_phy_power()
225 void ti_usb3_phy_power(struct ti_usb_phy *phy, int on) in ti_usb3_phy_power() argument
232 if (!phy->usb3_phy_power) in ti_usb3_phy_power()
235 val = readl(phy->usb3_phy_power); in ti_usb3_phy_power()
248 writel(val, phy->usb3_phy_power); in ti_usb3_phy_power()
265 struct ti_usb_phy *phy; in ti_usb_phy_uboot_init() local
267 phy = devm_kzalloc(NULL, sizeof(*phy), GFP_KERNEL); in ti_usb_phy_uboot_init()
268 if (!phy) { in ti_usb_phy_uboot_init()
273 phy->dpll_map = dpll_map_usb; in ti_usb_phy_uboot_init()
274 phy->index = dev->index; in ti_usb_phy_uboot_init()
275 phy->pll_ctrl_base = dev->pll_ctrl_base; in ti_usb_phy_uboot_init()
276 phy->usb2_phy_power = dev->usb2_phy_power; in ti_usb_phy_uboot_init()
277 phy->usb3_phy_power = dev->usb3_phy_power; in ti_usb_phy_uboot_init()
280 ti_usb3_dpll_program(phy); in ti_usb_phy_uboot_init()
281 ti_usb3_phy_power(phy, 1); in ti_usb_phy_uboot_init()
283 ti_usb2_phy_power(phy, 1); in ti_usb_phy_uboot_init()
285 list_add_tail(&phy->list, &ti_usb_phy_list); in ti_usb_phy_uboot_init()
302 struct ti_usb_phy *phy = NULL; in ti_usb_phy_uboot_exit() local
304 list_for_each_entry(phy, &ti_usb_phy_list, list) { in ti_usb_phy_uboot_exit()
305 if (phy->index != index) in ti_usb_phy_uboot_exit()
308 ti_usb2_phy_power(phy, 0); in ti_usb_phy_uboot_exit()
310 ti_usb3_phy_power(phy, 0); in ti_usb_phy_uboot_exit()
312 list_del(&phy->list); in ti_usb_phy_uboot_exit()
313 kfree(phy); in ti_usb_phy_uboot_exit()