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