blob: 9654fa2996f8ac5f4e140da3120b43ae990b50b1 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Sergey Kostanbaev7237d222014-06-25 23:44:29 +04002/*
3 * (C) Copyright 2013
4 * Sergey Kostanbaev < sergey.kostanbaev <at> fairwaves.ru >
Sergey Kostanbaev7237d222014-06-25 23:44:29 +04005 */
6
7#include <config.h>
8#include <common.h>
9
10#if defined(CONFIG_USB_OHCI_NEW) && defined(CONFIG_SYS_USB_OHCI_CPU_INIT)
11#include <asm/io.h>
12#include <asm/arch/ep93xx.h>
13
14int usb_cpu_init(void)
15{
16 struct syscon_regs *syscon = (struct syscon_regs *)SYSCON_BASE;
17 unsigned long pwr = readl(&syscon->pwrcnt);
18 writel(pwr | SYSCON_PWRCNT_USH_EN, &syscon->pwrcnt);
19
20 return 0;
21}
22
23int usb_cpu_stop(void)
24{
25 struct syscon_regs *syscon = (struct syscon_regs *)SYSCON_BASE;
26 unsigned long pwr = readl(&syscon->pwrcnt);
27 writel(pwr & ~SYSCON_PWRCNT_USH_EN, &syscon->pwrcnt);
28
29 return 0;
30}
31
32int usb_cpu_init_fail(void)
33{
34 return usb_cpu_stop();
35}
36
37#endif /* defined(CONFIG_USB_OHCI) && defined(CONFIG_SYS_USB_OHCI_CPU_INIT) */