xref: /openbsd-src/sys/arch/octeon/dev/octuctlreg.h (revision f2da64fbbbf1b03f09f390ab01267c93dfd77c4c)
1 /*	$OpenBSD: octuctlreg.h,v 1.1 2016/03/18 05:38:10 jmatthew Exp $ */
2 
3 /*
4  * Copyright (c) 2015 Jonathan Matthew  <jmatthew@openbsd.org>
5  *
6  * Permission to use, copy, modify, and/or distribute this software for any
7  * purpose with or without fee is hereby granted, provided that the above
8  * copyright notice and this permission notice appear in all copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 #ifndef _OCTUCTLREG_H_
20 #define _OCTUCTLREG_H_
21 
22 /*
23  * UCTL - octeon II usb controller interface
24  */
25 #define UCTL_BASE				0x000118006f000000ull
26 #define UCTL_SIZE				0x100
27 
28 #define UCTL_EHCI_BASE				0x00016f0000000000ull
29 #define UCTL_EHCI_SIZE				0x100
30 #define UCTL_OHCI_BASE				0x00016f0000000400ull
31 #define UCTL_OHCI_SIZE				0x100
32 
33 #define UCTL_CLK_TARGET_FREQ			130000000ull
34 
35 #define UCTL_CLK_RST_CTL			0x00
36 #define UCTL_CLK_RST_CTL_HRST			(1 << 0)
37 #define UCTL_CLK_RST_CTL_P_PRST		(1 << 1)
38 #define UCTL_CLK_RST_CTL_P_POR			(1 << 2)
39 #define UCTL_CLK_RST_CTL_P_COM_ON		(1 << 3)
40 #define UCTL_CLK_RST_CTL_P_REFCLK_DIV_SHIFT	5
41 #define UCTL_CLK_RST_CTL_P_REFCLK_SEL_SHIFT	7
42 #define UCTL_CLK_RST_CTL_H_DIV_SHIFT		9
43 #define UCTL_CLK_RST_CTL_O_CLKDIV_EN		(1 << 13)
44 #define UCTL_CLK_RST_CTL_H_CLKDIV_EN		(1 << 14)
45 #define UCTL_CLK_RST_CTL_H_CLKDIV_RST		(1 << 15)
46 #define UCTL_CLK_RST_CTL_H_CLKDIV_BYP		(1 << 16)
47 #define UCTL_CLK_RST_CTL_O_CLKDIV_RST		(1 << 17)
48 #define UCTL_CLK_RST_CTL_APP_START_CLK		(1 << 18)
49 #define UCTL_CLK_RST_CTL_OHCI_SUSP_LGCY	(1 << 19)
50 #define UCTL_CLK_RST_CTL_OHCI_SM		(1 << 20)
51 #define UCTL_CLK_RST_CTL_OHCI_CLKCKTRST	(1 << 21)
52 #define UCTL_CLK_RST_CTL_EHCI_SM		(1 << 22)
53 
54 #define UCTL_UPHY_STATUS			0x08
55 
56 #define UCTL_UPHY_PORTX_STATUS			0x10
57 #define UCTL_UPHY_PORTX_STATUS_TXVREF_SHIFT	28
58 #define UCTL_UPHY_PORTX_STATUS_TXRISETUNE	(1 << 27)
59 #define UCTL_UPHY_PORTX_STATUS_TXPREEMPHTUNE	(1 << 26)
60 
61 #define UCTL_IF_ENA				0x30
62 #define UCTL_IF_ENA_EN				(1 << 0)
63 
64 #define UCTL_EHCI_CTL				0x80
65 #define UCTL_EHCI_CTL_L2C_ADDR_MSB_MASK	0xff
66 #define UCTL_EHCI_CTL_L2C_ADDR_MSB_SHIFT	0
67 #define UCTL_EHCI_CTL_EHCI_64B_ADDR_EN		(1 << 8)
68 #define UCTL_EHCI_CTL_L2C_DESC_EMOD_SHIFT	10
69 #define UCTL_EHCI_CTL_L2C_BUFF_EMOD_SHIFT	12
70 
71 #define UCTL_OHCI_CTL				0x88
72 #define UCTL_OHCI_CTL_L2C_ADDR_MSB_MASK	0xff
73 #define UCTL_OHCI_CTL_L2C_ADDR_MSB_SHIFT	0
74 #define UCTL_OHCI_CTL_L2C_DESC_EMOD_SHIFT	10
75 #define UCTL_OHCI_CTL_L2C_BUFF_EMOD_SHIFT	12
76 
77 #endif /* _OCTUCTLREG_H_ */
78