OpenCores
URL https://opencores.org/ocsvn/mips_enhanced/mips_enhanced/trunk

Subversion Repositories mips_enhanced

[/] [mips_enhanced/] [trunk/] [grlib-gpl-1.0.19-b3188/] [software/] [leon3/] [amba.c] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 dimamali
 
2
#include "amba.h"
3
 
4
struct ahbpp_type *ahbpp = (struct ahbpp_type *) 0xFFFFF000;
5
struct apbpp_type *apbpp = (struct apbpp_type *) 0x800FF000;
6
 
7
find_ahb_slv(int id, struct ambadev *dev)
8
{
9
struct ambadev *ahbdevpp;
10
int i, j;
11
    for (i=0; i<NAHBSLV; i++) {
12
        if ((ahbpp[i].cfg[0] >> 12) == id) {
13
            ahbdevpp->id = id;
14
            ahbdevpp->irq = ahbpp[i].cfg[0] & PPIRQMASK;
15
            ahbdevpp->ppstart = (int) &ahbpp[i];
16
            for (j = 0; j < 4; j++) {
17
                switch (ahbpp[i].mem[0] & 0x0F) {
18
                case 2:
19
                    ahbdevpp->start[j] = ahbpp[i].mem[j] & PPAHBMASK;
20
                    ahbdevpp->end[j] = ahbdevpp->start[j] +
21
                        ((~(ahbpp[i].mem[j] << 16)) + 0x100000) & PPAHBMASK;
22
                case 3:
23
                    ahbdevpp->start[j] = ((int) ahbpp) +
24
                        (ahbpp[i].mem[j] & PPAHBMASK) >> 12;
25
                    ahbdevpp->end[j] = ahbdevpp->start[j] +
26
                        (((~(ahbpp[i].mem[j] << 16)) + 0x100000) & PPAHBMASK) >> 12;
27
                }
28
            }
29
            break;
30
        }
31
    }
32
    return(i/NAHBSLV);
33
}
34
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.