Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Mar 1997 16:25:21 -0500
From:      Brian McGovern <bmcgover@cisco.com>
To:        Mark Tinguely <tinguely@plains.nodak.edu>, marcio@cyclades.com, hackers@freebsd.org
Subject:   Re: Question on mapping PCI memory... 
Message-ID:  <199703102125.QAA16038@bmcgover-pc.cisco.com>
In-Reply-To: Your message of "Mon, 10 Mar 1997 14:47:08 CST." <199703102047.OAA23607@plains.nodak.edu> 

next in thread | previous in thread | raw e-mail | index | archive | help
According to the docs I have, they define the register set as:

0x00	Vendor ID (bits 0-15), device id (bits 16-31)
0x04	Status register/command register
0x08	Rev ID (bits 0-7), Class code (bits 8-31)
0x10	Base Address 1 (Memory address for 9060 controller chip)
0x14	Base Address 2 (Memory address for 512KB memory window)
0x18	Base Address 3 (unused)
0x3C	IRQ (0-7)

I then have the lines:

#define CYZ_PCI_BASE_ADDR1 0x10   /* 9060 Controller memory address */
#define CYZ_PCI_BASE_ADDR2 0x14   /* Memory Window */
#define CYZ_PCI_IRQ        0x3C   /* IRQ */

to make the registers easier to work with. I then have a code chunk that
does:

vm_offset_t paddr, vaddr;

if (pci_map_mem(config_id, CYZ_PCI_BASE_ADDR2, &vaddr, &paddr) == 0)
  {
    printf("Error mapping shared memory\n");
    return;
  }


When run, it complains with: pci_map_mem failed: device's memrange
0xf880-0xf8ff is incompatible with its bridge's memrange 0x2000000-0xffffffff.

Also, the routine keeps running, so should I think that pci_map_mem returning
0 on error (as according to pcivar.h) may be incorrect, or is this just
considered a warning?

Also, based on this message, is it possible that these pointers need to
be shifted left by 16 bits, so it fits in the window?

In any event, when I try to write to the memory, it has a parity error, and
panics. I'm assumeing this is because the memory range really is invalid.

Any suggestions?
	-Brian



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199703102125.QAA16038>