Deleted Added
sdiff udiff text old ( 13531:e6f1bf55d038 ) new ( 13690:284050bbec68 )
full compact
1/*
2 * Copyright (c) 2018 Metempsy Technology Consulting
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 105 unchanged lines hidden (view full) ---

114 GICR_IGRPMODR0 = SGI_base + 0x0d00,
115 // Non-secure Access Control Register
116 GICR_NSACR = SGI_base + 0x0e00,
117 };
118
119 // Interrupt Priority Registers
120 static const AddrRange GICR_IPRIORITYR;
121
122 std::vector <uint8_t> irqGroup;
123 std::vector <bool> irqEnabled;
124 std::vector <bool> irqPending;
125 std::vector <bool> irqActive;
126 std::vector <uint8_t> irqPriority;
127 std::vector <Gicv3::IntTriggerType> irqConfig;
128 std::vector <uint8_t> irqGrpmod;
129 std::vector <uint8_t> irqNsacr;
130
131 bool DPG1S;
132 bool DPG1NS;
133 bool DPG0;
134
135 static const uint32_t GICR_CTLR_DPG0 = 1 << 24;
136 static const uint32_t GICR_CTLR_DPG1NS = 1 << 25;
137 static const uint32_t GICR_CTLR_DPG1S = 1 << 26;
138
139 public:
140
141 /*
142 * GICv3 defines only 2 64K consecutive frames for the redistributor
143 * (RD_base and SGI_base) but we are using 2 extra 64K stride frames
144 * to match GICv4 that defines 4 64K consecutive frames for them.
145 * Note this must match with DTB/DTS GIC node definition and boot
146 * loader code.
147 */
148 static const uint32_t ADDR_RANGE_SIZE = 0x40000;
149
150 Gicv3Redistributor(Gicv3 * gic, uint32_t cpu_id);
151 ~Gicv3Redistributor();
152 void init();
153 void initState();
154
155 uint64_t read(Addr addr, size_t size, bool is_secure_access);
156 void write(Addr addr, uint64_t data, size_t size,
157 bool is_secure_access);

--- 5 unchanged lines hidden (view full) ---

163
164 Gicv3CPUInterface *
165 getCPUInterface() const
166 {
167 return cpuInterface;
168 }
169
170 bool canBeSelectedFor1toNInterrupt(Gicv3::GroupId group);
171
172 protected:
173
174 void reset();
175 void update();
176 void updateAndInformCPUInterface();
177 Gicv3::IntStatus intStatus(uint32_t int_id);
178 Gicv3::GroupId getIntGroup(int int_id);
179 void activateIRQ(uint32_t int_id);
180 void deactivateIRQ(uint32_t int_id);
181};
182
183#endif //__DEV_ARM_GICV3_REDISTRIBUTOR_H__