FreeNOS
Broadcom2836.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2025 Ivan Tan
3 * Copyright (C) 2015 Niek Linnenbank
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef __LIBARCH_ARM64_BROADCOM2836_H
20#define __LIBARCH_ARM64_BROADCOM2836_H
21
22#include <arm64/ARM64IO.h>
23#include <Types.h>
24
39class Broadcom2836
40{
41 private:
42
44 static const Address IOBase = 0x40000000;
45
50 {
51 CorePrescalerRegister = 0x0008,
52 CoreTimerRegister = 0x0040,
53 CoreIrqRegister = 0x0060,
55 };
56
57 public:
58
66
70 enum Result
71 {
72 Success,
74 IOError,
76 };
77
78 public:
79
84
91
100 Result setCoreTimerIrq(Timer timer, bool enable);
101
109 bool getCoreTimerIrqStatus(Timer timer) const;
110
111 private:
112
115
118};
119
126#endif /* __LIBARCH_ARM64_BROADCOM2836_H */
u8 coreId
Definition IntelACPI.h:1
Input/Output operations specific to the ARM architecture.
Definition ARM64IO.h:41
Broadcom 2836 device specific I/O configuration.
Result setCoreTimerIrq(Timer timer, bool enable)
Set Core Timer interrupt.
static const Address IOBase
Base address for the BCM2836 I/O configuration.
Registers
Hardware registers.
ARM64IO m_io
I/O instance.
Result initialize()
Initialize the Controller.
bool getCoreTimerIrqStatus(Timer timer) const
Get core timer interrupt status.
Result
Result code.
Size m_coreId
Core identifier.
Broadcom2836(Size coreId)
Constructor.
Represents a configurable timer device.
Definition Timer.h:36
unsigned long Address
A memory address.
Definition Types.h:131
unsigned int Size
Any sane size indicator cannot go negative.
Definition Types.h:128