source: rtems/c/src/lib/libbsp/arm/raspberrypi/include/raspberrypi.h @ 8fbe2e6

4.115
Last change on this file since 8fbe2e6 was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 5.4 KB
Line 
1
2/**
3 * @file
4 *
5 * @ingroup raspberrypi_reg
6 *
7 * @brief Register definitions.
8 */
9
10/*
11 * Copyright (c) 2013 Alan Cudmore.
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *
16 *  http://www.rtems.org/license/LICENSE
17 *
18 */
19
20#ifndef LIBBSP_ARM_RASPBERRYPI_RASPBERRYPI_H
21#define LIBBSP_ARM_RASPBERRYPI_RASPBERRYPI_H
22
23#include <stdint.h>
24#include <bsp/utility.h>
25
26/**
27 * @defgroup raspberrypi_reg Register Definitions
28 *
29 * @ingroup arm_raspberrypi
30 *
31 * @brief Register Definitions
32 *
33 * @{
34 */
35
36/**
37 * @name Register Macros
38 *
39 * @{
40 */
41
42#define BCM2835_REG(x)           (*(volatile uint32_t *)(x))
43#define BCM2835_BIT(n)           (1 << (n))
44
45/** @} */
46
47/**
48 * @name Internal ARM Timer Registers
49 *
50 * @{
51 */
52
53#define BCM2835_CLOCK_FREQ       250000000
54
55#define BCM2835_TIMER_BASE       (0x2000B400)
56
57#define BCM2835_TIMER_LOD        (BCM2835_TIMER_BASE+0x00)
58#define BCM2835_TIMER_VAL        (BCM2835_TIMER_BASE+0x04)
59#define BCM2835_TIMER_CTL        (BCM2835_TIMER_BASE+0x08)
60#define BCM2835_TIMER_CLI        (BCM2835_TIMER_BASE+0x0C)
61#define BCM2835_TIMER_RIS        (BCM2835_TIMER_BASE+0x10)
62#define BCM2835_TIMER_MIS        (BCM2835_TIMER_BASE+0x14)
63#define BCM2835_TIMER_RLD        (BCM2835_TIMER_BASE+0x18)
64#define BCM2835_TIMER_DIV        (BCM2835_TIMER_BASE+0x1C)
65#define BCM2835_TIMER_CNT        (BCM2835_TIMER_BASE+0x20)
66
67#define BCM2835_TIMER_PRESCALE    0xF9
68
69/** @} */
70
71/**
72 * @name GPIO Registers
73 *
74 * @{
75 */
76
77#define BCM2835_GPIO_REGS_BASE   (0x20200000)
78
79#define BCM2835_GPIO_GPFSEL1     (BCM2835_GPIO_REGS_BASE+0x04)
80#define BCM2835_GPIO_GPSET0      (BCM2835_GPIO_REGS_BASE+0x1C)
81#define BCM2835_GPIO_GPCLR0      (BCM2835_GPIO_REGS_BASE+0x28)
82#define BCM2835_GPIO_GPPUD       (BCM2835_GPIO_REGS_BASE+0x94)
83#define BCM2835_GPIO_GPPUDCLK0   (BCM2835_GPIO_REGS_BASE+0x98)
84
85/** @} */
86
87/**
88 * @name AUX Registers
89 *
90 * @{
91 */
92
93#define BCM2835_AUX_BASE         (0x20215000)
94
95#define AUX_ENABLES              (BCM2835_AUX_BASE+0x04)
96#define AUX_MU_IO_REG            (BCM2835_AUX_BASE+0x40)
97#define AUX_MU_IER_REG           (BCM2835_AUX_BASE+0x44)
98#define AUX_MU_IIR_REG           (BCM2835_AUX_BASE+0x48)
99#define AUX_MU_LCR_REG           (BCM2835_AUX_BASE+0x4C)
100#define AUX_MU_MCR_REG           (BCM2835_AUX_BASE+0x50)
101#define AUX_MU_LSR_REG           (BCM2835_AUX_BASE+0x54)
102#define AUX_MU_MSR_REG           (BCM2835_AUX_BASE+0x58)
103#define AUX_MU_SCRATCH           (BCM2835_AUX_BASE+0x5C)
104#define AUX_MU_CNTL_REG          (BCM2835_AUX_BASE+0x60)
105#define AUX_MU_STAT_REG          (BCM2835_AUX_BASE+0x64)
106#define AUX_MU_BAUD_REG          (BCM2835_AUX_BASE+0x68)
107
108/** @} */
109
110
111/**
112 * @name UART 0 (PL011) Registers
113 *
114 * @{
115 */
116
117
118#define BCM2835_UART0_BASE       (0x20201000)
119
120#define BCM2835_UART0_DR         (BCM2835_UART0_BASE+0x00)
121#define BCM2835_UART0_RSRECR     (BCM2835_UART0_BASE+0x04)
122#define BCM2835_UART0_FR         (BCM2835_UART0_BASE+0x18)
123#define BCM2835_UART0_ILPR       (BCM2835_UART0_BASE+0x20)
124#define BCM2835_UART0_IBRD       (BCM2835_UART0_BASE+0x24)
125#define BCM2835_UART0_FBRD       (BCM2835_UART0_BASE+0x28)
126#define BCM2835_UART0_LCRH       (BCM2835_UART0_BASE+0x2C)
127#define BCM2835_UART0_CR         (BCM2835_UART0_BASE+0x30)
128#define BCM2835_UART0_IFLS       (BCM2835_UART0_BASE+0x34)
129#define BCM2835_UART0_IMSC       (BCM2835_UART0_BASE+0x38)
130#define BCM2835_UART0_RIS        (BCM2835_UART0_BASE+0x3C)
131#define BCM2835_UART0_MIS        (BCM2835_UART0_BASE+0x40)
132#define BCM2835_UART0_ICR        (BCM2835_UART0_BASE+0x44)
133#define BCM2835_UART0_DMACR      (BCM2835_UART0_BASE+0x48)
134#define BCM2835_UART0_ITCR       (BCM2835_UART0_BASE+0x80)
135#define BCM2835_UART0_ITIP       (BCM2835_UART0_BASE+0x84)
136#define BCM2835_UART0_ITOP       (BCM2835_UART0_BASE+0x88)
137#define BCM2835_UART0_TDR        (BCM2835_UART0_BASE+0x8C)
138
139#define BCM2835_UART0_MIS_RX    0x10
140#define BCM2835_UART0_MIS_TX    0x20
141#define BCM2835_UART0_IMSC_RX   0x10
142#define BCM2835_UART0_IMSC_TX   0x20
143#define BCM2835_UART0_FR_RXFE   0x10
144#define BCM2835_UART0_FR_TXFF   0x20
145#define BCM2835_UART0_ICR_RX    0x10
146#define BCM2835_UART0_ICR_TX    0x20
147
148
149/** @} */
150
151
152/**
153 * @name IRQ Registers
154 *
155 * @{
156 */
157
158#define BCM2835_BASE_INTC         (0x2000B200)
159
160#define BCM2835_IRQ_BASIC         (BCM2835_BASE_INTC + 0x00)
161#define BCM2835_IRQ_PENDING1      (BCM2835_BASE_INTC + 0x04)
162#define BCM2835_IRQ_PENDING2      (BCM2835_BASE_INTC + 0x08)
163#define BCM2835_IRQ_FIQ_CTRL      (BCM2835_BASE_INTC + 0x0C)
164#define BCM2835_IRQ_ENABLE1       (BCM2835_BASE_INTC + 0x10)
165#define BCM2835_IRQ_ENABLE2       (BCM2835_BASE_INTC + 0x14)
166#define BCM2835_IRQ_ENABLE_BASIC  (BCM2835_BASE_INTC + 0x18)
167#define BCM2835_IRQ_DISABLE1      (BCM2835_BASE_INTC + 0x1C)
168#define BCM2835_IRQ_DISABLE2      (BCM2835_BASE_INTC + 0x20)
169#define BCM2835_IRQ_DISABLE_BASIC (BCM2835_BASE_INTC + 0x24)
170
171/** @} */
172
173
174/**
175 * @name GPU Timer Registers
176 *
177 * @{
178 */
179
180/**
181 * NOTE: The GPU uses Compare registers 0 and 2 for
182 *       it's own RTOS. 1 and 3 are available for use in
183 *       RTEMS.
184 */
185#define BCM2835_GPU_TIMER_BASE    (0x20003000)
186
187#define BCM2835_GPU_TIMER_CS      (BCM2835_TIMER_BASE+0x00)
188#define BCM2835_GPU_TIMER_CLO     (BCM2835_TIMER_BASE+0x04)
189#define BCM2835_GPU_TIMER_CHI     (BCM2835_TIMER_BASE+0x08)
190#define BCM2835_GPU_TIMER_C0      (BCM2835_TIMER_BASE+0x0C)
191#define BCM2835_GPU_TIMER_C1      (BCM2835_TIMER_BASE+0x10)
192#define BCM2835_GPU_TIMER_C2      (BCM2835_TIMER_BASE+0x14)
193#define BCM2835_GPU_TIMER_C3      (BCM2835_TIMER_BASE+0x18)
194
195/** @} */
196
197
198/** @} */
199
200#endif /* LIBBSP_ARM_RASPBERRYPI_RASPBERRYPI_H */
Note: See TracBrowser for help on using the repository browser.