Markus Klotzbuecher | 7265757 | 2007-06-06 11:49:43 +0200 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2007 |
| 3 | * Markus Klotzbuecher, DENX Software Engineering <mk@denx.de> |
| 4 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
Markus Klotzbuecher | 7265757 | 2007-06-06 11:49:43 +0200 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #include <common.h> |
| 9 | |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 10 | #if defined(CONFIG_USB_OHCI_NEW) && defined(CONFIG_SYS_USB_OHCI_CPU_INIT) |
Markus Klotzbuecher | 7265757 | 2007-06-06 11:49:43 +0200 | [diff] [blame] | 11 | |
| 12 | #include <mpc5xxx.h> |
| 13 | |
Martin Krause | 4a8527e | 2007-08-21 12:40:34 +0200 | [diff] [blame] | 14 | int usb_cpu_init(void) |
Markus Klotzbuecher | 7265757 | 2007-06-06 11:49:43 +0200 | [diff] [blame] | 15 | { |
| 16 | /* Set the USB Clock */ |
| 17 | *(vu_long *)MPC5XXX_CDM_48_FDC = CONFIG_USB_CLOCK; |
| 18 | |
Eric Millbrandt | 307ecb6 | 2009-08-13 08:32:37 -0500 | [diff] [blame] | 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 |
Markus Klotzbuecher | 7265757 | 2007-06-06 11:49:43 +0200 | [diff] [blame] | 23 | /* remove all USB bits first before ORing in ours */ |
| 24 | *(vu_long *)MPC5XXX_GPS_PORT_CONFIG &= ~0x00807000; |
Eric Millbrandt | 307ecb6 | 2009-08-13 08:32:37 -0500 | [diff] [blame] | 25 | #endif |
Markus Klotzbuecher | 7265757 | 2007-06-06 11:49:43 +0200 | [diff] [blame] | 26 | /* Activate USB port */ |
| 27 | *(vu_long *)MPC5XXX_GPS_PORT_CONFIG |= CONFIG_USB_CONFIG; |
| 28 | |
| 29 | return 0; |
| 30 | } |
| 31 | |
Martin Krause | 4a8527e | 2007-08-21 12:40:34 +0200 | [diff] [blame] | 32 | int usb_cpu_stop(void) |
Markus Klotzbuecher | 7265757 | 2007-06-06 11:49:43 +0200 | [diff] [blame] | 33 | { |
| 34 | return 0; |
| 35 | } |
| 36 | |
Martin Krause | 4a8527e | 2007-08-21 12:40:34 +0200 | [diff] [blame] | 37 | int usb_cpu_init_fail(void) |
Markus Klotzbuecher | 7265757 | 2007-06-06 11:49:43 +0200 | [diff] [blame] | 38 | { |
| 39 | return 0; |
| 40 | } |
| 41 | |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 42 | #endif /* defined(CONFIG_USB_OHCI) && defined(CONFIG_SYS_USB_OHCI_CPU_INIT) */ |