Ajay Bhargav | 54cb004 | 2012-02-13 03:27:43 +0000 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2012 |
| 3 | * eInfochips Ltd. <www.einfochips.com> |
| 4 | * Written-by: Ajay Bhargav <ajay.bhargav@einfochips.com> |
| 5 | * |
| 6 | * This driver is based on Kirkwood echi driver |
| 7 | * (C) Copyright 2009 |
| 8 | * Marvell Semiconductor <www.marvell.com> |
| 9 | * Written-by: Prafulla Wadaskar <prafulla@marvell.com> |
| 10 | * |
| 11 | * See file CREDITS for list of people who contributed to this |
| 12 | * project. |
| 13 | * |
| 14 | * This program is free software; you can redistribute it and/or |
| 15 | * modify it under the terms of the GNU General Public License as |
| 16 | * published by the Free Software Foundation; either version 2 of |
| 17 | * the License, or (at your option) any later version. |
| 18 | * |
| 19 | * This program is distributed in the hope that it will be useful, |
| 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 22 | * GNU General Public License for more details. |
| 23 | * |
| 24 | * You should have received a copy of the GNU General Public License |
| 25 | * along with this program; if not, write to the Free Software |
| 26 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
| 27 | * MA 02110-1301 USA |
| 28 | */ |
| 29 | |
| 30 | #include <common.h> |
| 31 | #include <asm/io.h> |
| 32 | #include <usb.h> |
| 33 | #include "ehci.h" |
Ajay Bhargav | 54cb004 | 2012-02-13 03:27:43 +0000 | [diff] [blame] | 34 | #include <asm/arch/cpu.h> |
| 35 | #include <asm/arch/armada100.h> |
| 36 | #include <asm/arch/utmi-armada100.h> |
| 37 | |
| 38 | /* |
| 39 | * EHCI host controller init |
| 40 | */ |
Lucas Stach | 676ae06 | 2012-09-26 00:14:35 +0200 | [diff] [blame] | 41 | int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor) |
Ajay Bhargav | 54cb004 | 2012-02-13 03:27:43 +0000 | [diff] [blame] | 42 | { |
| 43 | if (utmi_init() < 0) |
| 44 | return -1; |
| 45 | |
Lucas Stach | 676ae06 | 2012-09-26 00:14:35 +0200 | [diff] [blame] | 46 | *hccr = (struct ehci_hccr *)(ARMD1_USB_HOST_BASE + 0x100); |
| 47 | *hcor = (struct ehci_hcor *)((uint32_t) *hccr |
| 48 | + HC_LENGTH(ehci_readl(&(*hccr)->cr_capbase))); |
Ajay Bhargav | 54cb004 | 2012-02-13 03:27:43 +0000 | [diff] [blame] | 49 | |
| 50 | debug("armada100-ehci: init hccr %x and hcor %x hc_length %d\n", |
Lucas Stach | 676ae06 | 2012-09-26 00:14:35 +0200 | [diff] [blame] | 51 | (uint32_t)*hccr, (uint32_t)*hcor, |
| 52 | (uint32_t)HC_LENGTH(ehci_readl(&(*hccr)->cr_capbase))); |
Ajay Bhargav | 54cb004 | 2012-02-13 03:27:43 +0000 | [diff] [blame] | 53 | |
| 54 | return 0; |
| 55 | } |
| 56 | |
| 57 | /* |
| 58 | * EHCI host controller stop |
| 59 | */ |
Lucas Stach | 676ae06 | 2012-09-26 00:14:35 +0200 | [diff] [blame] | 60 | int ehci_hcd_stop(int index) |
Ajay Bhargav | 54cb004 | 2012-02-13 03:27:43 +0000 | [diff] [blame] | 61 | { |
| 62 | return 0; |
| 63 | } |