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