Sughosh Ganu | 282e2af | 2012-08-09 10:45:20 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2012 Sughosh Ganu <urwithsughosh@gmail.com> |
| 3 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 4 | * SPDX-License-Identifier: GPL-2.0+ |
Sughosh Ganu | 282e2af | 2012-08-09 10:45:20 +0000 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include <common.h> |
| 8 | |
| 9 | #include <asm/arch/da8xx-usb.h> |
| 10 | |
| 11 | int 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 | |
| 26 | int 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 | |
| 37 | int usb_cpu_init_fail(void) |
| 38 | { |
| 39 | return usb_cpu_stop(); |
| 40 | } |