gem5  v22.0.0.2
mhu.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020 ARM Limited
3  * All rights reserved
4  *
5  * The license below extends only to copyright in the software and shall
6  * not be construed as granting a license to any other intellectual
7  * property including but not limited to intellectual property relating
8  * to a hardware implementation of the functionality of the software
9  * licensed hereunder. You may use the software subject to the license
10  * terms below provided that you ensure that this notice is replicated
11  * unmodified and in its entirety in all distributions of the software,
12  * modified or unmodified, in source code or in binary form.
13  *
14  * Redistribution and use in source and binary forms, with or without
15  * modification, are permitted provided that the following conditions are
16  * met: redistributions of source code must retain the above copyright
17  * notice, this list of conditions and the following disclaimer;
18  * redistributions in binary form must reproduce the above copyright
19  * notice, this list of conditions and the following disclaimer in the
20  * documentation and/or other materials provided with the distribution;
21  * neither the name of the copyright holders nor the names of its
22  * contributors may be used to endorse or promote products derived from
23  * this software without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36  */
37 
38 #ifndef __DEV_ARM_CSS_MHU_H__
39 #define __DEV_ARM_CSS_MHU_H__
40 
41 #include "dev/arm/doorbell.hh"
42 #include "dev/io_device.hh"
43 
44 namespace gem5
45 {
46 
47 struct Ap2ScpDoorbellParams;
48 class ArmInterruptPin;
49 class MHU;
50 struct MHUParams;
51 class Scp;
52 struct Scp2ApDoorbellParams;
53 
54 class MhuDoorbell : public Doorbell
55 {
56  public:
57  friend class MHU;
58 
59  MhuDoorbell(const DoorbellParams &p)
60  : Doorbell(p), channel(0)
61  {}
62 
63  void set(uint32_t val) { update(channel | val); }
64  void clear(uint32_t val) { update(channel & ~val); }
65 
66  protected:
67  void update(uint32_t new_val);
68 
69  virtual void raiseInterrupt() = 0;
70  virtual void clearInterrupt() = 0;
71 
72  uint32_t channel;
73 };
74 
76 {
77  public:
78  Scp2ApDoorbell(const Scp2ApDoorbellParams &p);
79 
80  void raiseInterrupt() override;
81  void clearInterrupt() override;
82 
83  private:
85 };
86 
88 {
89  public:
90  Ap2ScpDoorbell(const Ap2ScpDoorbellParams &p);
91 
92  void setScp(Scp *_scp) { scp = _scp; }
93 
94  void raiseInterrupt() override;
95  void clearInterrupt() override;
96 
97  private:
98  Scp *scp;
99 };
100 
102 class MHU : public BasicPioDevice
103 {
104  public:
105  enum
106  {
114 
117  CPU_INTR_L_SET = 0x108,
120  CPU_INTR_H_SET = 0x128,
122 
124  SCP_INTR_S_SET = 0x208,
127  CPU_INTR_S_SET = 0x308,
129 
130  MHU_SCFG = 0x400,
131 
132  PID4 = 0xfd0,
133  PID0 = 0xfe0,
134  PID1 = 0xfe4,
135  PID2 = 0xfe8,
136  PID3 = 0xfec,
137 
138  COMPID0 = 0xff0,
139  COMPID1 = 0xff4,
140  COMPID2 = 0xff8,
141  COMPID3 = 0xffc
142  };
143 
144  // Secure Violation Interrupt: used when accessing
145  // a secure channel in non secure mode
146  static const uint32_t SVI_INT = 0x80000000;
147 
148  MHU(const MHUParams &p);
149 
150  AddrRangeList getAddrRanges() const override;
151 
152  Tick read(PacketPtr pkt) override;
153  Tick write(PacketPtr pkt) override;
154 
155  uint32_t read32(const Addr addr, bool secure_access);
156 
160 
164 
165  // MHU.PIDn, MHU.COMPIDn registers
166  uint32_t pid[5];
167  uint32_t compid[4];
168 
169  uint32_t scfg;
170 };
171 
172 } // namespace gem5
173 
174 #endif // __DEV_ARM_CSS_MHU_H__
gem5::MHU::CPU_INTR_S_CLEAR
@ CPU_INTR_S_CLEAR
Definition: mhu.hh:128
gem5::Ap2ScpDoorbell::raiseInterrupt
void raiseInterrupt() override
Definition: mhu.cc:235
gem5::MHU::CPU_INTR_H_CLEAR
@ CPU_INTR_H_CLEAR
Definition: mhu.hh:121
gem5::MHU::apHigh
Ap2ScpDoorbell * apHigh
Definition: mhu.hh:162
io_device.hh
gem5::MhuDoorbell::channel
uint32_t channel
Definition: mhu.hh:72
gem5::MHU::write
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
Definition: mhu.cc:151
gem5::Ap2ScpDoorbell::Ap2ScpDoorbell
Ap2ScpDoorbell(const Ap2ScpDoorbellParams &p)
Definition: mhu.cc:55
gem5::MHU::SCP_INTR_S_SET
@ SCP_INTR_S_SET
Definition: mhu.hh:124
gem5::MHU::getAddrRanges
AddrRangeList getAddrRanges() const override
Every PIO device is obliged to provide an implementation that returns the address ranges the device r...
Definition: mhu.cc:77
gem5::MhuDoorbell::MhuDoorbell
MhuDoorbell(const DoorbellParams &p)
Definition: mhu.hh:59
gem5::MHU::PID4
@ PID4
Definition: mhu.hh:132
gem5::MHU::SCP_INTR_S_CLEAR
@ SCP_INTR_S_CLEAR
Definition: mhu.hh:125
gem5::MHU
Message Handling Unit.
Definition: mhu.hh:102
gem5::X86ISA::val
Bitfield< 63 > val
Definition: misc.hh:769
gem5::Scp2ApDoorbell::clearInterrupt
void clearInterrupt() override
Definition: mhu.cc:229
gem5::MhuDoorbell::clear
void clear(uint32_t val)
Definition: mhu.hh:64
gem5::Ap2ScpDoorbell::setScp
void setScp(Scp *_scp)
Definition: mhu.hh:92
gem5::MHU::CPU_INTR_L_SET
@ CPU_INTR_L_SET
Definition: mhu.hh:117
gem5::MHU::CPU_INTR_L_CLEAR
@ CPU_INTR_L_CLEAR
Definition: mhu.hh:118
gem5::MHU::SCP_INTR_H_CLEAR
@ SCP_INTR_H_CLEAR
Definition: mhu.hh:113
doorbell.hh
gem5::MHU::pid
uint32_t pid[5]
Definition: mhu.hh:166
gem5::MHU::PID3
@ PID3
Definition: mhu.hh:136
gem5::MHU::SCP_INTR_H_STAT
@ SCP_INTR_H_STAT
Definition: mhu.hh:111
gem5::MHU::COMPID2
@ COMPID2
Definition: mhu.hh:140
gem5::MhuDoorbell::set
void set(uint32_t val)
Definition: mhu.hh:63
gem5::MhuDoorbell::update
void update(uint32_t new_val)
Definition: mhu.cc:209
gem5::MHU::PID1
@ PID1
Definition: mhu.hh:134
gem5::Scp
Definition: scp.hh:48
gem5::VegaISA::p
Bitfield< 54 > p
Definition: pagetable.hh:70
gem5::Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:291
gem5::MhuDoorbell::clearInterrupt
virtual void clearInterrupt()=0
gem5::Tick
uint64_t Tick
Tick count type.
Definition: types.hh:58
gem5::Scp2ApDoorbell::Scp2ApDoorbell
Scp2ApDoorbell(const Scp2ApDoorbellParams &p)
Definition: mhu.cc:51
gem5::MHU::SCP_INTR_L_STAT
@ SCP_INTR_L_STAT
From SCP to Application Processor.
Definition: mhu.hh:108
gem5::MHU::read32
uint32_t read32(const Addr addr, bool secure_access)
Definition: mhu.cc:98
gem5::MHU::SCP_INTR_L_SET
@ SCP_INTR_L_SET
Definition: mhu.hh:109
gem5::MHU::SCP_INTR_H_SET
@ SCP_INTR_H_SET
Definition: mhu.hh:112
gem5::MHU::scpSec
Scp2ApDoorbell * scpSec
Definition: mhu.hh:159
gem5::MHU::apSec
Ap2ScpDoorbell * apSec
Definition: mhu.hh:163
gem5::Ap2ScpDoorbell::clearInterrupt
void clearInterrupt() override
Definition: mhu.cc:241
gem5::Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
gem5::MhuDoorbell
Definition: mhu.hh:54
gem5::MHU::scfg
uint32_t scfg
Definition: mhu.hh:169
gem5::MHU::PID0
@ PID0
Definition: mhu.hh:133
gem5::Ap2ScpDoorbell::scp
Scp * scp
Definition: mhu.hh:98
gem5::MHU::SVI_INT
static const uint32_t SVI_INT
Definition: mhu.hh:146
gem5::Doorbell
Generic doorbell interface.
Definition: doorbell.hh:53
gem5::Ap2ScpDoorbell
Definition: mhu.hh:87
gem5::MHU::read
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
Definition: mhu.cc:83
gem5::Scp2ApDoorbell
Definition: mhu.hh:75
gem5::MHU::apLow
Ap2ScpDoorbell * apLow
Definition: mhu.hh:161
gem5::MHU::scpHigh
Scp2ApDoorbell * scpHigh
Definition: mhu.hh:158
gem5::MhuDoorbell::raiseInterrupt
virtual void raiseInterrupt()=0
gem5::MHU::SCP_INTR_L_CLEAR
@ SCP_INTR_L_CLEAR
Definition: mhu.hh:110
gem5::MHU::COMPID1
@ COMPID1
Definition: mhu.hh:139
gem5::MHU::CPU_INTR_L_STAT
@ CPU_INTR_L_STAT
From Application Processor to SCP.
Definition: mhu.hh:116
gem5::MHU::compid
uint32_t compid[4]
Definition: mhu.hh:167
gem5::MHU::CPU_INTR_S_SET
@ CPU_INTR_S_SET
Definition: mhu.hh:127
gem5::ArmInterruptPin
Generic representation of an Arm interrupt pin.
Definition: base_gic.hh:199
gem5::Scp2ApDoorbell::interrupt
ArmInterruptPin * interrupt
Definition: mhu.hh:84
gem5::MHU::COMPID3
@ COMPID3
Definition: mhu.hh:141
gem5::MHU::CPU_INTR_H_STAT
@ CPU_INTR_H_STAT
Definition: mhu.hh:119
gem5::MHU::MHU_SCFG
@ MHU_SCFG
Definition: mhu.hh:130
std::list< AddrRange >
gem5::MHU::COMPID0
@ COMPID0
Definition: mhu.hh:138
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: gpu_translation_state.hh:37
gem5::MHU::CPU_INTR_S_STAT
@ CPU_INTR_S_STAT
Definition: mhu.hh:126
gem5::MHU::SCP_INTR_S_STAT
@ SCP_INTR_S_STAT
Definition: mhu.hh:123
gem5::BasicPioDevice
Definition: io_device.hh:147
gem5::Scp2ApDoorbell::raiseInterrupt
void raiseInterrupt() override
Definition: mhu.cc:223
gem5::MHU::MHU
MHU(const MHUParams &p)
Definition: mhu.cc:59
gem5::MHU::scpLow
Scp2ApDoorbell * scpLow
Definition: mhu.hh:157
gem5::MHU::PID2
@ PID2
Definition: mhu.hh:135
gem5::MHU::CPU_INTR_H_SET
@ CPU_INTR_H_SET
Definition: mhu.hh:120
gem5::X86ISA::addr
Bitfield< 3 > addr
Definition: types.hh:84

Generated on Thu Jul 28 2022 13:32:30 for gem5 by doxygen 1.8.17