Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Ajay Bhargav | 13a9cf5 | 2012-02-13 03:27:43 +0000 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2012 |
| 4 | * eInfochips Ltd. <www.einfochips.com> |
Ajay Bhargav | 0ad0b61 | 2016-12-21 13:28:06 +0530 | [diff] [blame] | 5 | * Written-by: Ajay Bhargav <contact@8051projects.net> |
Ajay Bhargav | 13a9cf5 | 2012-02-13 03:27:43 +0000 | [diff] [blame] | 6 | * |
| 7 | * This driver is based on Kirkwood echi driver |
| 8 | * (C) Copyright 2009 |
| 9 | * Marvell Semiconductor <www.marvell.com> |
| 10 | * Written-by: Prafulla Wadaskar <prafulla@marvell.com> |
Ajay Bhargav | 13a9cf5 | 2012-02-13 03:27:43 +0000 | [diff] [blame] | 11 | */ |
| 12 | |
| 13 | #include <common.h> |
Simon Glass | 0f2af88 | 2020-05-10 11:40:05 -0600 | [diff] [blame^] | 14 | #include <log.h> |
Ajay Bhargav | 13a9cf5 | 2012-02-13 03:27:43 +0000 | [diff] [blame] | 15 | #include <asm/io.h> |
| 16 | #include <usb.h> |
| 17 | #include "ehci.h" |
Ajay Bhargav | 13a9cf5 | 2012-02-13 03:27:43 +0000 | [diff] [blame] | 18 | #include <asm/arch/cpu.h> |
| 19 | #include <asm/arch/armada100.h> |
| 20 | #include <asm/arch/utmi-armada100.h> |
| 21 | |
| 22 | /* |
| 23 | * EHCI host controller init |
| 24 | */ |
Troy Kisky | 7d6bbb9 | 2013-10-10 15:27:57 -0700 | [diff] [blame] | 25 | int ehci_hcd_init(int index, enum usb_init_type init, |
| 26 | struct ehci_hccr **hccr, struct ehci_hcor **hcor) |
Ajay Bhargav | 13a9cf5 | 2012-02-13 03:27:43 +0000 | [diff] [blame] | 27 | { |
| 28 | if (utmi_init() < 0) |
| 29 | return -1; |
| 30 | |
Lucas Stach | 3494a4c | 2012-09-26 00:14:35 +0200 | [diff] [blame] | 31 | *hccr = (struct ehci_hccr *)(ARMD1_USB_HOST_BASE + 0x100); |
| 32 | *hcor = (struct ehci_hcor *)((uint32_t) *hccr |
| 33 | + HC_LENGTH(ehci_readl(&(*hccr)->cr_capbase))); |
Ajay Bhargav | 13a9cf5 | 2012-02-13 03:27:43 +0000 | [diff] [blame] | 34 | |
| 35 | debug("armada100-ehci: init hccr %x and hcor %x hc_length %d\n", |
Lucas Stach | 3494a4c | 2012-09-26 00:14:35 +0200 | [diff] [blame] | 36 | (uint32_t)*hccr, (uint32_t)*hcor, |
| 37 | (uint32_t)HC_LENGTH(ehci_readl(&(*hccr)->cr_capbase))); |
Ajay Bhargav | 13a9cf5 | 2012-02-13 03:27:43 +0000 | [diff] [blame] | 38 | |
| 39 | return 0; |
| 40 | } |
| 41 | |
| 42 | /* |
| 43 | * EHCI host controller stop |
| 44 | */ |
Lucas Stach | 3494a4c | 2012-09-26 00:14:35 +0200 | [diff] [blame] | 45 | int ehci_hcd_stop(int index) |
Ajay Bhargav | 13a9cf5 | 2012-02-13 03:27:43 +0000 | [diff] [blame] | 46 | { |
| 47 | return 0; |
| 48 | } |