1/* $NetBSD: bcm2835_bscreg.h,v 1.1 2013/01/05 20:15:17 jakllsch Exp $ */
2
3/*
4 * Copyright (c) 2012 Jonathan A. Kollasch
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 *    notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 *    notice, this list of conditions and the following disclaimer in the
14 *    documentation and/or other materials provided with the distribution.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
20 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
23 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
25 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
26 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#ifndef _BROADCOM_BCM2835_BSCREG_H_
30#define _BROADCOM_BCM2835_BSCREG_H_
31
32#include <sys/cdefs.h>
33
34#define __BIT32(x)	((uint32_t)__BIT(x))
35#define __BITS32(x, y)	((uint32_t)__BITS((x), (y)))
36
37#define BSC_C		0x000
38#define BSC_C_READ		__BIT32(0)
39#define BSC_C_CLEAR		__BITS32(5,4)
40#define BSC_C_CLEAR_NONE	__SHIFTIN(0, BSC_C_CLEAR)
41#define BSC_C_CLEAR_CLEAR	__SHIFTIN(3, BSC_C_CLEAR)
42#define BSC_C_ST		__BIT32(7)
43#define BSC_C_INTD		__BIT32(8)
44#define BSC_C_INTT		__BIT32(9)
45#define BSC_C_INTR		__BIT32(10)
46#define BSC_C_I2CEN		__BIT32(15)
47
48#define BSC_S		0x004
49#define BSC_S_TA		__BIT32(0)
50#define BSC_S_DONE		__BIT32(1)
51#define BSC_S_TXW		__BIT32(2)
52#define BSC_S_RXR		__BIT32(3)
53#define BSC_S_TXD		__BIT32(4)
54#define BSC_S_RXD		__BIT32(5)
55#define BSC_S_TXE		__BIT32(6)
56#define BSC_S_RXF		__BIT32(7)
57#define BSC_S_ERR		__BIT32(8)
58#define BSC_S_CLKT		__BIT32(9)
59
60#define BSC_DLEN	0x008
61#define BSC_DLEN_DLEN		__BITS32(15,0)
62
63#define BSC_A		0x00c
64#define BSC_A_ADDR		__BITS32(6,0)
65
66#define BSC_FIFO	0x010
67#define BSC_FIFO_DATA		__BITS32(7,0)
68
69#define BSC_DIV		0x014
70#define BSC_DIV_CDIV		__BITS32(15,0)
71
72#define BSC_DEL		0x018
73#define BSC_DEL_REDL		__BITS32(15,0)
74#define BSC_DEL_FEDL		__BITS32(31,16)
75
76#define BSC_CLKT	0x01c
77#define BSC_CLKT_TOUT		__BITS32(15,0)
78
79#endif /* _BROADCOM_BCM2835_BSCREG_H_ */
80