xref: /f-stack/freebsd/mips/ingenic/jz4780_smb.h (revision 22ce4aff)
1 /*-
2  * Copyright (c) 2016 Jared McNeill <[email protected]>
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
14  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
15  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
16  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
18  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
19  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
20  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
21  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23  * SUCH DAMAGE.
24  *
25  * $FreeBSD$
26  */
27 
28 /*
29  * Ingenic JZ4780 SMB Controller
30  */
31 
32 #ifndef __JZ4780_SMB_H__
33 #define __JZ4780_SMB_H__
34 
35 #define	SMBCON			0x00
36 #define	 SMBCON_STPHLD		(1 << 7)
37 #define	 SMBCON_SLVDIS		(1 << 6)
38 #define	 SMBCON_REST		(1 << 5)
39 #define	 SMBCON_MATP		(1 << 4)
40 #define	 SMBCON_SATP		(1 << 3)
41 #define	 SMBCON_SPD		(3 << 1)
42 #define	 SMBCON_SPD_STANDARD	(1 << 1)
43 #define	 SMBCON_SPD_FAST	(2 << 1)
44 #define	 SMBCON_MD		(1 << 0)
45 #define	SMBTAR			0x04
46 #define	 SMBTAR_MATP		(1 << 12)
47 #define	 SMBTAR_SPECIAL		(1 << 11)
48 #define	 SMBTAR_GC_OR_START	(1 << 10)
49 #define	 SMBTAR_SMBTAR		(0x3ff << 0)
50 #define	SMBSAR			0x08
51 #define	SMBDC			0x10
52 #define	 SMBDC_CMD		(1 << 8)
53 #define	 SMBDC_DAT		(0xff << 0)
54 #define	SMBSHCNT		0x14
55 #define	SMBSLCNT		0x18
56 #define	SMBFHCNT		0x1c
57 #define	SMBFLCNT		0x20
58 #define	SMBINTST		0x2c
59 #define	SMBINTM			0x30
60 #define	SMBRXTL			0x38
61 #define	SMBTXTL			0x3c
62 #define	SMBCINT			0x40
63 #define	SMBCRXUF		0x44
64 #define	SMBCRXOF		0x48
65 #define	SMBCTXOF		0x4c
66 #define	SMBCRXREQ		0x50
67 #define	SMBCTXABT		0x54
68 #define	SMBCRXDN		0x58
69 #define	SMBCACT			0x5c
70 #define	SMBCSTP			0x60
71 #define	SMBCSTT			0x64
72 #define	SMBCGC			0x68
73 #define	SMBENB			0x6c
74 #define	 SMBENB_SMBENB		(1 << 0)
75 #define	SMBST			0x70
76 #define	 SMBST_SLVACT		(1 << 6)
77 #define	 SMBST_MSTACT		(1 << 5)
78 #define	 SMBST_RFF		(1 << 4)
79 #define	 SMBST_RFNE		(1 << 3)
80 #define	 SMBST_TFE		(1 << 2)
81 #define	 SMBST_TFNF		(1 << 1)
82 #define	 SMBST_ACT		(1 << 0)
83 #define	SMBABTSRC		0x80
84 #define	SMBDMACR		0x88
85 #define	SMBDMATDLR		0x8c
86 #define	SMBDMARDLR		0x90
87 #define	SMBSDASU		0x94
88 #define	SMBACKGC		0x98
89 #define	SMBENBST		0x9c
90 #define	 SMBENBST_SLVRDLST	(1 << 2)
91 #define	 SMBENBST_SLVDISB	(1 << 1)
92 #define	 SMBENBST_SMBEN		(1 << 0)
93 #define	SMBSDAHD		0xd0
94 #define	 SMBSDAHD_HDENB		(1 << 8)
95 #define	 SMBSDAHD_SDAHD		(0xff << 0)
96 
97 #endif /* !__JZ4780_SMB_H__ */
98