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