XenevaOS
Loading...
Searching...
No Matches
bcm2835.h
Go to the documentation of this file.
1//
2// bcm2835.h
3//
4// USPi - An USB driver for Raspberry Pi written in C
5// Copyright (C) 2014-2017 R. Stange <rsta2@o2online.de>
6//
7// This program is free software: you can redistribute it and/or modify
8// it under the terms of the GNU General Public License as published by
9// the Free Software Foundation, either version 3 of the License, or
10// (at your option) any later version.
11//
12// This program is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15// GNU General Public License for more details.
16//
17// You should have received a copy of the GNU General Public License
18// along with this program. If not, see <http://www.gnu.org/licenses/>.
19//
20#ifndef _uspi_bcm2835_h
21#define _uspi_bcm2835_h
22
23#include "uspios.h"
24
25#if RASPPI == 1
26#define ARM_IO_BASE 0x20000000
27#else
28#define ARM_IO_BASE 0x3F000000
29#endif
30
31#define GPU_IO_BASE 0x7E000000
32
33#define GPU_CACHED_BASE 0x40000000
34#define GPU_UNCACHED_BASE 0xC0000000
35
36#if RASPPI == 1
37 #ifdef GPU_L2_CACHE_ENABLED
38 #define GPU_MEM_BASE GPU_CACHED_BASE
39 #else
40 #define GPU_MEM_BASE GPU_UNCACHED_BASE
41 #endif
42#else
43 #define GPU_MEM_BASE GPU_UNCACHED_BASE
44#endif
45
46// Convert physical ARM address into bus address
47// (does even work, if a bus address is provided already)
48#define BUS_ADDRESS(phys) (((phys) & ~0xC0000000) | GPU_MEM_BASE)
49
50//
51// USB Host Controller
52//
53#define ARM_USB_BASE (ARM_IO_BASE + 0x980000)
54
55#define ARM_USB_CORE_BASE ARM_USB_BASE
56#define ARM_USB_HOST_BASE (ARM_USB_BASE + 0x400)
57#define ARM_USB_POWER (ARM_USB_BASE + 0xE00)
58
59#endif