]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - arch/powerpc/cpu/mpc5xxx/usb.c
Add GPL-2.0+ SPDX-License-Identifier to source files
[karo-tx-uboot.git] / arch / powerpc / cpu / mpc5xxx / usb.c
1 /*
2  * (C) Copyright 2007
3  * Markus Klotzbuecher, DENX Software Engineering <mk@denx.de>
4  *
5  * SPDX-License-Identifier:     GPL-2.0+
6  */
7
8 #include <common.h>
9
10 #if defined(CONFIG_USB_OHCI_NEW) && defined(CONFIG_SYS_USB_OHCI_CPU_INIT)
11
12 #include <mpc5xxx.h>
13
14 int usb_cpu_init(void)
15 {
16         /* Set the USB Clock                                                 */
17         *(vu_long *)MPC5XXX_CDM_48_FDC = CONFIG_USB_CLOCK;
18
19 #ifdef CONFIG_PSC3_USB /* USB is using the alternate configuration */
20         /* remove all PSC3 USB bits first before ORing in ours */
21         *(vu_long *)MPC5XXX_GPS_PORT_CONFIG &= ~0x00804f00;
22 #else
23         /* remove all USB bits first before ORing in ours */
24         *(vu_long *)MPC5XXX_GPS_PORT_CONFIG &= ~0x00807000;
25 #endif
26         /* Activate USB port                                                 */
27         *(vu_long *)MPC5XXX_GPS_PORT_CONFIG |= CONFIG_USB_CONFIG;
28
29         return 0;
30 }
31
32 int usb_cpu_stop(void)
33 {
34         return 0;
35 }
36
37 int usb_cpu_init_fail(void)
38 {
39         return 0;
40 }
41
42 #endif /* defined(CONFIG_USB_OHCI) && defined(CONFIG_SYS_USB_OHCI_CPU_INIT) */