blob: 47ad3f34d5a941b17a7752885992806408eb15b6 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Sughosh Ganu282e2af2012-08-09 10:45:20 +00002/*
3 * Copyright (C) 2012 Sughosh Ganu <urwithsughosh@gmail.com>
Sughosh Ganu282e2af2012-08-09 10:45:20 +00004 */
5
6#include <common.h>
7
8#include <asm/arch/da8xx-usb.h>
9
10int usb_cpu_init(void)
11{
12 /* enable psc for usb2.0 */
13 lpsc_on(DAVINCI_LPSC_USB20);
14
15 /* enable psc for usb1.0 */
16 lpsc_on(DAVINCI_LPSC_USB11);
17
18 /* start the on-chip usb phy and its pll */
19 if (usb_phy_on())
20 return 0;
21
22 return 1;
23}
24
25int usb_cpu_stop(void)
26{
27 usb_phy_off();
28
29 /* turn off the usb clock and assert the module reset */
30 lpsc_disable(DAVINCI_LPSC_USB11);
31 lpsc_disable(DAVINCI_LPSC_USB20);
32
33 return 0;
34}
35
36int usb_cpu_init_fail(void)
37{
38 return usb_cpu_stop();
39}