meson_sdioreg.h revision 1.1 1 1.1 jmcneill /* $NetBSD: meson_sdioreg.h,v 1.1 2019/01/19 20:56:03 jmcneill Exp $ */
2 1.1 jmcneill
3 1.1 jmcneill /*-
4 1.1 jmcneill * Copyright (c) 2015 Jared D. McNeill <jmcneill (at) invisible.ca>
5 1.1 jmcneill * All rights reserved.
6 1.1 jmcneill *
7 1.1 jmcneill * Redistribution and use in source and binary forms, with or without
8 1.1 jmcneill * modification, are permitted provided that the following conditions
9 1.1 jmcneill * are met:
10 1.1 jmcneill * 1. Redistributions of source code must retain the above copyright
11 1.1 jmcneill * notice, this list of conditions and the following disclaimer.
12 1.1 jmcneill * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 jmcneill * notice, this list of conditions and the following disclaimer in the
14 1.1 jmcneill * documentation and/or other materials provided with the distribution.
15 1.1 jmcneill *
16 1.1 jmcneill * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 1.1 jmcneill * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 1.1 jmcneill * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 1.1 jmcneill * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 1.1 jmcneill * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 1.1 jmcneill * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 1.1 jmcneill * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 1.1 jmcneill * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 1.1 jmcneill * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 1.1 jmcneill * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 1.1 jmcneill * SUCH DAMAGE.
27 1.1 jmcneill */
28 1.1 jmcneill
29 1.1 jmcneill #ifndef _MESON_SDIOREG_H
30 1.1 jmcneill #define _MESON_SDIOREG_H
31 1.1 jmcneill
32 1.1 jmcneill #define SDIO_ARGU_REG 0x00
33 1.1 jmcneill #define SDIO_SEND_REG 0x04
34 1.1 jmcneill #define SDIO_CONF_REG 0x08
35 1.1 jmcneill #define SDIO_IRQS_REG 0x0c
36 1.1 jmcneill #define SDIO_IRQC_REG 0x10
37 1.1 jmcneill #define SDIO_MULT_REG 0x14
38 1.1 jmcneill #define SDIO_ADDR_REG 0x18
39 1.1 jmcneill #define SDIO_EXT_REG 0x1c
40 1.1 jmcneill #define SDIO_CCTL_REG 0x40
41 1.1 jmcneill #define SDIO_CDAT_REG 0x44
42 1.1 jmcneill
43 1.1 jmcneill #define SDIO_SEND_COMMAND_INDEX __BITS(7,0)
44 1.1 jmcneill #define SDIO_SEND_RESPONSE_BITS __BITS(15,8)
45 1.1 jmcneill #define SDIO_SEND_RESPONSE_NO_CRC __BIT(16)
46 1.1 jmcneill #define SDIO_SEND_RESPONSE_DATA __BIT(17)
47 1.1 jmcneill #define SDIO_SEND_RESPONSE_CRC7_FROM_8 __BIT(18)
48 1.1 jmcneill #define SDIO_SEND_CHECK_BUSY_DAT0 __BIT(19)
49 1.1 jmcneill #define SDIO_SEND_COMMAND_HAS_DATA __BIT(20)
50 1.1 jmcneill #define SDIO_SEND_USE_INT_WINDOW __BIT(21)
51 1.1 jmcneill #define SDIO_SEND_REPEAT_PACKAGE __BITS(31,24)
52 1.1 jmcneill
53 1.1 jmcneill #define SDIO_CONF_COMMAND_CLK_DIV __BITS(9,0)
54 1.1 jmcneill #define SDIO_CONF_COMMAND_DISABLE_CRC __BIT(10)
55 1.1 jmcneill #define SDIO_CONF_COMMAND_OUT_AT_POSEDGE __BIT(11)
56 1.1 jmcneill #define SDIO_CONF_COMMAND_ARG_BITS __BITS(17,12)
57 1.1 jmcneill #define SDIO_CONF_NO_DELAY_DATA __BIT(18)
58 1.1 jmcneill #define SDIO_CONF_DATA_LATCH_AT_NEGEDGE __BIT(19)
59 1.1 jmcneill #define SDIO_CONF_BUS_WIDTH __BIT(20)
60 1.1 jmcneill #define SDIO_CONF_M_ENDIAN __BITS(22,21)
61 1.1 jmcneill #define SDIO_CONF_WRITE_NWR __BITS(28,23)
62 1.1 jmcneill #define SDIO_CONF_WRITE_CRC_OK_STATUS __BITS(31,29)
63 1.1 jmcneill
64 1.1 jmcneill #define SDIO_IRQS_STATUS __BITS(3,0)
65 1.1 jmcneill #define SDIO_IRQS_CMD_BUSY __BIT(4)
66 1.1 jmcneill #define SDIO_IRQS_RESPONSE_CRC7_OK __BIT(5)
67 1.1 jmcneill #define SDIO_IRQS_DATA_READ_CRC16_OK __BIT(6)
68 1.1 jmcneill #define SDIO_IRQS_DATA_WRITE_CRC16_OK __BIT(7)
69 1.1 jmcneill #define SDIO_IRQS_IF_INT __BIT(8)
70 1.1 jmcneill #define SDIO_IRQS_CMD_INT __BIT(9)
71 1.1 jmcneill #define SDIO_IRQS_SOFT_INT __BIT(10)
72 1.1 jmcneill #define SDIO_IRQS_SET_SOFT_INT __BIT(11)
73 1.1 jmcneill #define SDIO_IRQS_STATUS_INFO __BIT(15,12)
74 1.1 jmcneill #define SDIO_IRQS_TIMING_OUT_INT __BIT(16)
75 1.1 jmcneill #define SDIO_IRQS_AMRISC_TIMING_OUT_INTEN __BIT(17)
76 1.1 jmcneill #define SDIO_IRQS_ARC_TIMING_OUT_INTEN __BIT(18)
77 1.1 jmcneill #define SDIO_IRQS_TIMING_OUT_COUNT __BITS(31,19)
78 1.1 jmcneill #define SDIO_IRQS_CLEAR \
79 1.1 jmcneill (SDIO_IRQS_IF_INT|SDIO_IRQS_SOFT_INT|SDIO_IRQS_SET_SOFT_INT|\
80 1.1 jmcneill SDIO_IRQS_TIMING_OUT_INT)
81 1.1 jmcneill
82 1.1 jmcneill #define SDIO_IRQC_AMRISC_IF_INTEN __BIT(0)
83 1.1 jmcneill #define SDIO_IRQC_AMRISC_CMD_INTEN __BIT(1)
84 1.1 jmcneill #define SDIO_IRQC_AMRISC_SOFT_INTEN __BIT(2)
85 1.1 jmcneill #define SDIO_IRQC_ARC_IF_INTEN __BIT(3)
86 1.1 jmcneill #define SDIO_IRQC_ARC_CMD_INTEN __BIT(4)
87 1.1 jmcneill #define SDIO_IRQC_ARC_SOFT_INTEN __BIT(5)
88 1.1 jmcneill #define SDIO_IRQC_IF_INT_CONFIG __BITS(7,6)
89 1.1 jmcneill #define SDIO_IRQC_FORCE_DATA __BITS(13,8)
90 1.1 jmcneill #define SDIO_IRQC_FORCE_ENABLE __BIT(14)
91 1.1 jmcneill #define SDIO_IRQC_SOFT_RESET __BIT(15)
92 1.1 jmcneill #define SDIO_IRQC_FORCE_OUTEN __BITS(21,16)
93 1.1 jmcneill #define SDIO_IRQC_DISABLE_MEM_HALT __BITS(23,22)
94 1.1 jmcneill #define SDIO_IRQC_FORCE_DATA_READ __BITS(29,24)
95 1.1 jmcneill #define SDIO_IRQC_FORCE_HALT __BIT(30)
96 1.1 jmcneill #define SDIO_IRQC_HALT_HOLE __BIT(31)
97 1.1 jmcneill
98 1.1 jmcneill #define SDIO_MULT_PORT_SEL __BITS(1,0)
99 1.1 jmcneill #define SDIO_MULT_MS_ENABLE __BIT(2)
100 1.1 jmcneill #define SDIO_MULT_MS_SCLK_ALWAYS __BIT(3)
101 1.1 jmcneill #define SDIO_MULT_STREAM_ENABLE __BIT(4)
102 1.1 jmcneill #define SDIO_MULT_STREAM_8BIT_MODE __BIT(5)
103 1.1 jmcneill #define SDIO_MULT_DATA_CATCH_LEVEL __BITS(7,6)
104 1.1 jmcneill #define SDIO_MULT_WRITE_READ_OUT_INDEX __BIT(8)
105 1.1 jmcneill #define SDIO_MULT_DATA_CATCH_READOUT_EN __BIT(9)
106 1.1 jmcneill #define SDIO_MULT_DAT0_DATA_ON_DAT1 __BIT(10)
107 1.1 jmcneill #define SDIO_MULT_DAT1_DATA_SWAPPED __BIT(11)
108 1.1 jmcneill #define SDIO_MULT_RESPONSE_READ_INDEX __BITS(15,12)
109 1.1 jmcneill #define SDIO_MULT_DATA_CATCH_FINISH_PT __BITS(27,16)
110 1.1 jmcneill
111 1.1 jmcneill #define SDIO_EXT_CMD_ARG_EXT __BITS(15,0)
112 1.1 jmcneill #define SDIO_EXT_DATA_RW_NUMBER __BITS(29,16)
113 1.1 jmcneill #define SDIO_EXT_DATA_RW_NO_CRC16 __BIT(30)
114 1.1 jmcneill #define SDIO_EXT_CRC_STATUS_4LINE __BIT(31)
115 1.1 jmcneill
116 1.1 jmcneill #endif /* _MESON_SDIOREG_H */
117