12 #include <hwregs/reg_map.h>
14 #include <hwregs/marb_defs.h>
16 #include <hwregs/intr_vect.h>
18 #include <linux/signal.h>
19 #include <linux/errno.h>
22 #include <asm/irq_regs.h>
32 #define NUMBER_OF_BP 4
33 #define NBR_OF_CLIENTS 14
34 #define NBR_OF_SLOTS 64
35 #define SDRAM_BANDWIDTH 100000000
36 #define INTMEM_BANDWIDTH 400000000
37 #define NBR_OF_REGIONS 2
68 static void crisv32_arbiter_config(
int region,
int unused_slots)
105 if (!requested_slots[region][client]) {
111 if (!active_clients[region][client]
112 || unused_slots <= 0)
121 NBR_OF_SLOTS / requested_slots[region][
client];
124 while (pos < NBR_OF_SLOTS) {
144 while (!active_clients[region][client]) {
145 client = (client + 1) % NBR_OF_CLIENTS;
150 client = (client + 1) % NBR_OF_CLIENTS;
163 static void crisv32_arbiter_init(
void)
191 #ifndef CONFIG_ETRAX_KGDB
204 int total_assigned = 0;
205 int total_clients = 0;
208 crisv32_arbiter_init();
211 total_assigned += requested_slots[region][
i];
212 total_clients += active_clients[region][
i];
217 ? 0 : NBR_OF_SLOTS / (max_bandwidth[region] /
bandwidth);
227 if (total_assigned + req > NBR_OF_SLOTS)
230 active_clients[region][
client] = 1;
232 crisv32_arbiter_config(region, NBR_OF_SLOTS - total_assigned);
252 int total_assigned = 0;
254 requested_slots[region][
client] = 0;
255 active_clients[region][
client] = 0;
258 total_assigned += requested_slots[region][i];
260 crisv32_arbiter_config(region, NBR_OF_SLOTS - total_assigned);
264 unsigned long clients,
unsigned long accesses,
269 crisv32_arbiter_init();
271 if (start > 0x80000000) {
273 "physical address", start);
277 spin_lock(&arbiter_lock);
280 if (!watches[i].
used) {
291 REG_WR_INT(marb_bp, watches[i].instance, rw_last_addr,
293 REG_WR_INT(marb_bp, watches[i].instance, rw_op,
295 REG_WR_INT(marb_bp, watches[i].instance, rw_clients,
308 spin_unlock(&arbiter_lock);
313 spin_unlock(&arbiter_lock);
321 crisv32_arbiter_init();
323 spin_lock(&arbiter_lock);
326 spin_unlock(&arbiter_lock);
343 spin_unlock(&arbiter_lock);
360 .
bp0 = 1, .bp1 = 1, .bp2 = 1, .bp3 = 1
364 if (masked_intr.
bp0) {
367 }
else if (masked_intr.
bp1) {
370 }
else if (masked_intr.
bp2) {
373 }
else if (masked_intr.
bp3) {