Forum: Mikrocontroller und Digitale Elektronik lspci Startadresse des Hexdump herausfinden


von Abrakadabra (Gast)


Lesenswert?

Hallo,

ich suche die Speicheradresse, an dem der unten angehängte Hexdump im 
Speicher zu finden ist."Memory behind Bridge: d4400000" ist aber nur mit 
"FF" gefüllt.
Der Port ist bei Bus 0 Device 28 Function 3 zu finden.

Wie finde ich die Startadresse heraus? Vielen Dank.

$ lspci -v -xxxx -d 8086:1e16

00:1c.3 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset 
Family PCI Express Root Port 4 (rev c4) (prog-if 00 [Normal decode])
  Flags: bus master, fast devsel, latency 0
  Bus: primary=00, secondary=24, subordinate=24, sec-latency=0
  Memory behind bridge: d4400000-d44fffff
  Capabilities: <access denied>
  Kernel driver in use: pcieport
00: 86 80 16 1e 07 04 10 00 c4 00 04 06 10 00 81 00
10: 00 00 00 00 00 00 00 00 00 24 24 00 f0 00 00 00
20: 40 d4 40 d4 f1 ff 01 00 00 00 00 00 00 00 00 00
30: 00 00 00 00 40 00 00 00 00 00 00 00 ff 04 00 00

von $$$ (Gast)


Lesenswert?

> "Memory behind Bridge: d4400000" ist aber nur mit "FF" gefüllt.

Daa fehlt wohl ein mmap() was das IO-Device in den Speicher einblendet.

Fuer den (ARM-)Systemtimer z.B.
ohna Anspruch auf Vollstaendigkeit und Richtigkeit:
1
// I/O access
2
volatile unsigned *syst; 
3
4
...
5
6
void setup_io()
7
{
8
  /* open /dev/mem */
9
  if ((mem_fd = open("/dev/mem", O_RDWR|O_SYNC) ) < 0) {
10
    printf("can't open /dev/mem \n");
11
    exit (-1);
12
  }
13
14
  // System Timer
15
16
  // Allocate MAP block
17
  if ((syst_mem = malloc(BLOCK_SIZE + (PAGE_SIZE-1))) == NULL) {
18
    printf("allocation error \n");
19
    exit (-1);
20
  }
21
22
  // Make sure pointer is on 4K boundary
23
  if ((unsigned long)syst_mem % PAGE_SIZE)
24
    syst_mem += PAGE_SIZE - ((unsigned long)syst_mem % PAGE_SIZE);
25
26
  // Now map it
27
  syst_map = (unsigned char *)mmap(
28
    (caddr_t)syst_mem,
29
    BLOCK_SIZE,
30
    PROT_READ|PROT_WRITE,
31
    MAP_SHARED|MAP_FIXED,
32
    mem_fd,
33
    SYST_BASE
34
    );
35
36
  if ((long)syst_map < 0) {
37
    printf("mmap error %d\n", (int)syst_map);
38
    exit (-1);
39
  }
40
41
  // Always use volatile pointer!
42
  syst = (volatile unsigned *)syst_map;
43
44
45
}  // setup_io
46
47
void prnt_syst()
48
{
49
  unsigned syst_cs, syst_clo, syst_chi;
50
51
  syst_cs = *(syst + (SYST_CS>>2));
52
  syst_clo = *(syst + (SYST_CLO>>2));
53
  syst_chi = *(syst + (SYST_CHI>>2));
54
  printf("syst_cs  syst_chi syst_clo syst_clo(dec)\n");
55
  printf("%08lx %08lx %08lx %d\n",syst_cs,syst_chi,syst_clo,syst_clo);
56
}

Viel Spass!

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.