From owner-freebsd-hackers Fri Feb 11 6: 4:29 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from horse.mail.ru (horse.mail.ru [194.67.23.130]) by builder.freebsd.org (Postfix) with ESMTP id B931B3D58 for ; Fri, 11 Feb 2000 06:03:55 -0800 (PST) Received: from f4.int ([10.0.0.51] helo=f4.mail.ru) by horse.mail.ru with esmtp (Exim 3.02 #116) id 12JGfq-0004WW-00; Fri, 11 Feb 2000 17:03:54 +0300 Received: from mail by f4.mail.ru with local (Exim 3.02 #112) id 12JGfs-000AGS-00; Fri, 11 Feb 2000 17:03:56 +0300 Received: from [195.46.102.248] by win.mail.ru with HTTP; Fri, 11 Feb 2000 14:03:56 +0000 (GMT) From: "Dmitry Chagin" To: "Stefan Esser" Cc: hackers@FreeBSD.ORG Subject: Re[2]: pci_map_mem return 0 Mime-Version: 1.0 X-Mailer: mPOP Web-Mail 2.19 X-Originating-IP: unknown via proxy [195.46.102.248] Reply-To: "Dmitry Chagin" Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 8bit Message-Id: Date: Fri, 11 Feb 2000 17:03:56 +0300 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >On 2000-01-26 21:13 +0800, dmitry@www.asbaikaltv.ru wrote: >> i am working on a specific dev driver for pci genlock >> based on Cirrus Logic GD5446 chip. >> when i try to map the cards memory, pci_map_mem return 0 >> >> map[0]: type 3, range 32, base e4000000, size 25 >> map[1]: type 1, range 32, base e6000000, size 12 >> strm0: rev 0x45 int a irq 12 on >>pci0.11.0 >> >> but map[0] is for Display Memory Base Address, but type = 3 >> it's not a PCI_MAPMEM type and >> map[1] for card registers, but type = 1. it's PCI_MAPMEM type >The PCI code in 3.1 was written by me. In 4.0 it has been much modified >by the NewBus developers, but the function in question is unchanged. >Regarding your problem: I do not see what's wrong with the map. >type 3 == PCI_MAPMEM | PCI_MAPMEMP indicates prefetchable memory, which >is the display memory, as you wrote. >type 1 == PCI_MAPMEM indicates non-prefetchable memory (i.e. memory mapped >registers). >The same map types are working just fine on my system ... Hi, thanks for reply. i decided this problem: GD5446 it's a vga controler, and bios set cmdreg to 0x00200000 i write to func pci_memen(pcicfgregs *cfg) and pci_porten(pcicfgregs *cfg) this code: cfg->cmdreg = pci_cfgread(cfg, PCIR_COMMAND, 2); /* re read command register*/ and ok, but much packed to write data to registers (i need 4 pci vga genlock on one workstation) :(( i write some code void sw_master(u_int8_t bus, u_int8_t slot, u_int8_t func) { outl(0xcf8, (1 << 31) | (bus << 16) | (slot << 11) | (func << 8) | 0x04); outl(0xcfc, 0x00); outl(0xcf8, (1 << 31) | (VGA_MASTER->bus << 16) | (VGA_MASTER->slot << 11) | (VGA_MASTER->func << 8) | 0x04); outl(0xcfc, VGA_MASTER->cmdreg); } void sw_slave(u_int8_t bus, u_int8_t slot, u_int8_t func) { outl(0xcf8, (1 << 31) | (VGA_MASTER->bus << 16) | (VGA_MASTER->slot << 11) | (VGA_MASTER->func << 8) | 0x04); outl(0xcfc, 0x00); outl(0xcf8, (1 << 31) | (bus << 16) | (slot << 11) | (func << 8) | 0x04); outl(0xcfc, 0x03); } where VGA_MASTER it's a pcicfgregs struct of basic vga adapter. is it correctly? thanks, sorry for my bad inglish :) Dmitry Chagin. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message