From owner-freebsd-sparc Wed Jun 12 9: 9:36 2002 Delivered-To: freebsd-sparc@freebsd.org Received: from theinternet.com.au (c16543.carlnfd1.nsw.optusnet.com.au [210.49.135.162]) by hub.freebsd.org (Postfix) with ESMTP id 4E55537B404 for ; Wed, 12 Jun 2002 09:09:25 -0700 (PDT) Received: (from akm@localhost) by theinternet.com.au (8.11.6/8.11.4) id g5CG9Oh46249 for freebsd-sparc@freebsd.org; Thu, 13 Jun 2002 02:09:24 +1000 (EST) (envelope-from akm) Date: Thu, 13 Jun 2002 02:09:23 +1000 From: Andrew Kenneth Milton To: freebsd-sparc@freebsd.org Subject: Weird PCI interface Message-ID: <20020613020923.C44400@zeus.theinternet.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i Sender: owner-freebsd-sparc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org I was playing with some stuff to muck with the video card on the sun5 I have. dmesg shows; pci2: at device 2.0 (no driver attached) pciconf -lv shows none0@pci1:2:0: class=0x030000 card=0x00000000 chip=0x47541002 rev=0x9a hdr=0x00 vendor = 'ATI Technologies' device = 'Mach 64 GT Rage 3D II Graphics Accelerator' class = display subclass = VGA I wrote some code based on the pciconf code to basically go fetch things from the video card, but, it was failing, all values were coming back 0xffffffff (-1?) (works in i386, but, I only have one PCI bus there). So I went back to basics... root@orchid~akm#pciconf -l [snip] none0@pci1:2:0: class=0x030000 card=0x00000000 chip=0x47541002 rev=0x9a hdr=0x00 root@orchid~akm#pciconf -r pci1:2:0 0 ffffffff root@orchid~akm#pciconf -r pci2:2:0 0 47541002 There's an off by one error somewhere, the pc_bus reported by ioctl(fd, PCIOCGETCONF, &pc) is coming back wrong. ------------------------------------------------------------------------ FreeBSD orchid.theinternet.com.au 5.0-CURRENT FreeBSD 5.0-CURRENT #0: Wed Jun 12 22:37:04 GMT 2002 akm@orchid.theinternet.com.au:/usr/src/sys/sparc64/compile/orchid sparc64 ------------------------------------------------------------------------ Copyright (c) 1992-2002 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 5.0-CURRENT #0: Wed Jun 12 22:37:04 GMT 2002 akm@orchid.theinternet.com.au:/usr/src/sys/sparc64/compile/orchid Preloaded elf kernel "/boot/kernel/kernel" at 0xc038a000. Timecounter "tick" frequency 269795812 Hz cpu0: Sun Microsystems UltraSparc-IIi Processor (269.80 MHZ CPU) nexus0: pcib0: on nexus0 pcib0: SUNW,sabre: impl 0, version 0: ign 7c0 bus range 0 to 2; PCI bus 0 DVMA map: 0xc0000000 to 0xdfffffff pcib0: ofw_pci_init_intr: descending to subordinate PCI bus pcib0: ofw_pci_init_intr: no interrupt mapping found for 1/1/0 (preset 0) pcib0: ofw_pci_init_intr: mapping intr for 1/1/1 to 33 (preset was 0) pcib0: ofw_pci_init_intr: mapping intr for 1/2/0 to 15 (preset was 15) pcib0: ofw_pci_init_intr: mapping intr for 1/3/0 to 32 (preset was 14) pcib0: ofw_pci_init_intr: descending to subordinate PCI bus pci0: on pcib0 pcib1: at device 1.0 on pci0 pci1: on pcib1 pcib2: at device 1.1 on pci0 pci2: on pcib2 ebus0: revision 0x01 ebus0: mem 0xf1000000-0xf17fffff,0xf0000000-0xf0ffffff at device 1.0 on pci2 ebus0: addr 0x140072f000-0x140072f003,0x140072c000-0x140072c003,0x140072a000-0x140072a003,0x1400728000-0x1400728003,0x1400726000-0x1400726003 (no driver attached) ebus0: addr 0x1400724000-0x1400724003 irq 37 (no driver attached) ebus0: addr 0x1400504000-0x1400504002 (no driver attached) ebus0: addr 0x1400400000-0x140040007f irq 43 (no driver attached) ebus0: addr 0x14003083f8-0x14003083ff irq 41 (no driver attached) ebus0: addr 0x14003062f8-0x14003062ff irq 42 (no driver attached) ebus0: addr 0x1400700000-0x140070000f,0x140030015c-0x140030015d,0x14003043bc-0x14003043cb irq 34 (no driver attached) ebus0: addr 0x1400720000-0x1400720003,0x1400706000-0x140070600f,0x14003023f0-0x14003023f7 irq 39 (no driver attached) eeprom0: addr 0x1400000000-0x1400001fff on ebus0 eeprom0: model mk48t59 eeprom0: hostid 808e84c0 ebus0: addr 0x1000000000-0x10000fffff (no driver attached) ebus0: addr 0x1400722000-0x1400722003,0x1400704000-0x140070400f,0x1400702000-0x140070200f,0x1400200000-0x14002000ff irq 36,35 (no driver attached) hme0: mem 0xe0000000-0xe0007fff irq 33 at device 1.1 on pci2 hme0: Ethernet address: 08:00:20:8e:84:c0 miibus0: on hme0 nsphy0: on miibus0 nsphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto pci2: at device 2.0 (no driver attached) atapci0: port 0xc00020-0xc0002f,0xc00018-0xc0001b,0xc00010-0xc00017,0xc00008-0xc0000b,0xc00000-0xc00007 irq 32 at device 3.0 on pci2 ata2: at 0xc00000 on atapci0 ata3: at 0xc00010 on atapci0 Timecounters tick every 10.000 msec ad0: 4103MB [8894/15/63] at ata2-master WDMA2 acd0: CDROM at ata3-master PIO4 Mounting root from ufs:/dev/ad0c -- Totally Holistic Enterprises Internet| | Andrew Milton The Internet (Aust) Pty Ltd | M:+61 416 022 411 | ACN: 082 081 472 ABN: 83 082 081 472 |akm@theinternet.com.au| Carpe Daemon To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-sparc" in the body of the message