blob: 237d28774797854d289ca2587d6f647a796fe34e [file] [log] [blame]
Ajay Bhargav13a9cf52012-02-13 03:27:43 +00001/*
2 * (C) Copyright 2012
3 * eInfochips Ltd. <www.einfochips.com>
Ajay Bhargav0ad0b612016-12-21 13:28:06 +05304 * Written-by: Ajay Bhargav <contact@8051projects.net>
Ajay Bhargav13a9cf52012-02-13 03:27:43 +00005 *
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 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +020011 * SPDX-License-Identifier: GPL-2.0+
Ajay Bhargav13a9cf52012-02-13 03:27:43 +000012 */
13
14#include <common.h>
15#include <asm/io.h>
16#include <usb.h>
17#include "ehci.h"
Ajay Bhargav13a9cf52012-02-13 03:27:43 +000018#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 Kisky7d6bbb92013-10-10 15:27:57 -070025int ehci_hcd_init(int index, enum usb_init_type init,
26 struct ehci_hccr **hccr, struct ehci_hcor **hcor)
Ajay Bhargav13a9cf52012-02-13 03:27:43 +000027{
28 if (utmi_init() < 0)
29 return -1;
30
Lucas Stach3494a4c2012-09-26 00:14:35 +020031 *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 Bhargav13a9cf52012-02-13 03:27:43 +000034
35 debug("armada100-ehci: init hccr %x and hcor %x hc_length %d\n",
Lucas Stach3494a4c2012-09-26 00:14:35 +020036 (uint32_t)*hccr, (uint32_t)*hcor,
37 (uint32_t)HC_LENGTH(ehci_readl(&(*hccr)->cr_capbase)));
Ajay Bhargav13a9cf52012-02-13 03:27:43 +000038
39 return 0;
40}
41
42/*
43 * EHCI host controller stop
44 */
Lucas Stach3494a4c2012-09-26 00:14:35 +020045int ehci_hcd_stop(int index)
Ajay Bhargav13a9cf52012-02-13 03:27:43 +000046{
47 return 0;
48}