From owner-freebsd-hackers Mon Mar 10 16:12:57 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id QAA09929 for hackers-outgoing; Mon, 10 Mar 1997 16:12:57 -0800 (PST) Received: from root.com (implode.root.com [198.145.90.17]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id QAA09924 for ; Mon, 10 Mar 1997 16:12:47 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by root.com (8.8.5/8.6.5) with SMTP id QAA18267; Mon, 10 Mar 1997 16:13:30 -0800 (PST) Message-Id: <199703110013.QAA18267@root.com> X-Authentication-Warning: implode.root.com: localhost [127.0.0.1] didn't use HELO protocol To: Brian McGovern cc: Mark Tinguely , marcio@cyclades.com, hackers@freebsd.org Subject: Re: Question on mapping PCI memory... In-reply-to: Your message of "Mon, 10 Mar 1997 16:25:21 EST." <199703102125.QAA16038@bmcgover-pc.cisco.com> From: David Greenman Reply-To: dg@root.com Date: Mon, 10 Mar 1997 16:13:30 -0800 Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >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. I don't have the time to get sucked into this, but as it turns out, I'm quite familiar with the PLX 9060. In the code above, you're trying to memory map the Programmed I/O "ports". Needless to say, you can't do that. :-) Here is a breakdown of the base address registers for the PLX chip: /* memory mapped runtime registers */ #define PLX_PCI_BASE_ADDR0 0x10 /* runtime registers via I/O ports */ #define PLX_PCI_BASE_ADDR1 0x14 /* local address space 0 */ #define PLX_PCI_BASE_ADDR2 0x18 /* local address space 1 */ #define PLX_PCI_BASE_ADDR3 0x1c The Cyclades card is probably using "address space 0" for the 512K of buffer area. -DG David Greenman Core-team/Principal Architect, The FreeBSD Project