blob: 85a8adf8065b2f52533ac708c59bf170b5d72d35 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Ajay Bhargav54cb0042012-02-13 03:27:43 +00002/*
3 * (C) Copyright 2012
4 * eInfochips Ltd. <www.einfochips.com>
Ajay Bhargavc7c47ca2016-12-21 13:28:06 +05305 * Written-by: Ajay Bhargav <contact@8051projects.net>
Ajay Bhargav54cb0042012-02-13 03:27:43 +00006 *
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 Bhargav54cb0042012-02-13 03:27:43 +000011 */
12
13#include <common.h>
14#include <asm/io.h>
15#include <usb.h>
16#include "ehci.h"
Ajay Bhargav54cb0042012-02-13 03:27:43 +000017#include <asm/arch/cpu.h>
18#include <asm/arch/armada100.h>
19#include <asm/arch/utmi-armada100.h>
20
21/*
22 * EHCI host controller init
23 */
Troy Kisky127efc42013-10-10 15:27:57 -070024int ehci_hcd_init(int index, enum usb_init_type init,
25 struct ehci_hccr **hccr, struct ehci_hcor **hcor)
Ajay Bhargav54cb0042012-02-13 03:27:43 +000026{
27 if (utmi_init() < 0)
28 return -1;
29
Lucas Stach676ae062012-09-26 00:14:35 +020030 *hccr = (struct ehci_hccr *)(ARMD1_USB_HOST_BASE + 0x100);
31 *hcor = (struct ehci_hcor *)((uint32_t) *hccr
32 + HC_LENGTH(ehci_readl(&(*hccr)->cr_capbase)));
Ajay Bhargav54cb0042012-02-13 03:27:43 +000033
34 debug("armada100-ehci: init hccr %x and hcor %x hc_length %d\n",
Lucas Stach676ae062012-09-26 00:14:35 +020035 (uint32_t)*hccr, (uint32_t)*hcor,
36 (uint32_t)HC_LENGTH(ehci_readl(&(*hccr)->cr_capbase)));
Ajay Bhargav54cb0042012-02-13 03:27:43 +000037
38 return 0;
39}
40
41/*
42 * EHCI host controller stop
43 */
Lucas Stach676ae062012-09-26 00:14:35 +020044int ehci_hcd_stop(int index)
Ajay Bhargav54cb0042012-02-13 03:27:43 +000045{
46 return 0;
47}