1 // SPDX-License-Identifier: GPL-2.0+ 2 /* 3 * Copyright (C) 2012 Sughosh Ganu <urwithsughosh@gmail.com> 4 */ 5 6 #include <common.h> 7 8 #include <asm/arch/da8xx-usb.h> 9 10 int 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 25 int 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 36 int usb_cpu_init_fail(void) 37 { 38 return usb_cpu_stop(); 39 } 40