FreeNOS
BroadcomMailbox.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2015 Niek Linnenbank
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef __LIBARCH_ARM_BROADCOM_MAILBOX_H
19#define __LIBARCH_ARM_BROADCOM_MAILBOX_H
20
21#include <Types.h>
22#include <Macros.h>
23#include <arm/ARMIO.h>
24
48{
49 private:
50
52 static const Address Base = 0xb000;
53
55 static const uint ChannelMask = 0xf;
56
61 {
62 Read = 0x0880,
63 Status = 0x0898,
64 Config = 0x089c,
65 Write = 0x08a0
66 };
67
72 {
73 Full = 0x80000000,
74 Empty = 0x40000000
75 };
76
77 public:
78
82 enum Result
83 {
86 };
87
103
104 public:
105
110
117
126 Result read(Channel channel, u32 *message) const;
127
136 Result write(Channel channel, u32 message);
137
138 private:
139
142};
143
150#endif /* __LIBARCH_ARM_BROADCOM_MAILBOX_H */
Input/Output operations specific to the ARM architecture.
Definition ARMIO.h:40
Broadcom System-on-Chip Mailbox interface.
ARMIO m_io
I/O object.
Register
Hardware registers.
StatusFlags
Status register flags.
BroadcomMailbox()
Constructor.
static const uint ChannelMask
Channel Mask when reading or writing (lowest 4-bits).
Result write(Channel channel, u32 message)
Write 28-bit message.
Result read(Channel channel, u32 *message) const
Read 28-bit message.
Result
Result codes.
Result initialize()
Initialize the Mailbox.
static const Address Base
Register base offset for the Mailbox.
Unidirectional point-to-point messaging channel.
Definition Channel.h:35
unsigned int u32
Unsigned 32-bit number.
Definition Types.h:53
unsigned long Address
A memory address.
Definition Types.h:131
unsigned int uint
Unsigned integer number.
Definition Types.h:44