From owner-freebsd-hackers@FreeBSD.ORG Fri Dec 7 13:36:25 2007 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A62B116A41B for ; Fri, 7 Dec 2007 13:36:25 +0000 (UTC) (envelope-from cokane@freebsd.org) Received: from QMTA02.emeryville.ca.mail.comcast.net (qmta02.emeryville.ca.mail.comcast.net [76.96.30.24]) by mx1.freebsd.org (Postfix) with ESMTP id 8110313C442 for ; Fri, 7 Dec 2007 13:36:25 +0000 (UTC) (envelope-from cokane@freebsd.org) Received: from OMTA01.emeryville.ca.mail.comcast.net ([76.96.30.11]) by QMTA02.emeryville.ca.mail.comcast.net with comcast id MmxY1Y0060EPcho0A09800; Fri, 07 Dec 2007 13:36:30 +0000 Received: from discordia ([24.60.136.97]) by OMTA01.emeryville.ca.mail.comcast.net with comcast id MpcU1Y00P26FYqY0800000; Fri, 07 Dec 2007 13:36:30 +0000 X-Authority-Analysis: v=1.0 c=1 a=6_jqQ4TTgSl2EbcZ4eQA:9 a=DyR3shomNN_ODXCgXRUA:7 a=EVuQR1XGrbBUcDgvapBXe2eQRaQA:4 a=kJVaTwQnZmMA:10 a=ytAhK1pYVDElldzvseEA:9 a=GlrMPeyHoEHEeILQLi4A:7 a=_GEH8G1bGzZOLbAlJmRAHSTchIMA:4 a=6bqG61NMjcsA:10 Received: by discordia (Postfix, from userid 103) id 8910E16B559; Fri, 7 Dec 2007 08:36:23 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.1.8-gr1 (2007-02-13) on discordia X-Spam-Level: X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.8-gr1 Received: from [172.20.1.3] (erwin.int.cokane.org [172.20.1.3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by discordia (Postfix) with ESMTP id 577B016B557; Fri, 7 Dec 2007 08:36:08 -0500 (EST) Message-ID: <47594C1F.8070103@FreeBSD.org> Date: Fri, 07 Dec 2007 08:35:27 -0500 From: Coleman Kane Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.9 (X11/20071116) MIME-Version: 1.0 To: "Andrey V. Elsukov" References: <475897DB.1010308@FreeBSD.org> <4758B6E8.7030502@rcn.com> <4758BEAB.6020306@FreeBSD.org> <4758D544.5060405@yandex.ru> In-Reply-To: <4758D544.5060405@yandex.ru> X-Enigmail-Version: 0.96a Content-Type: multipart/mixed; boundary="------------000000060103000106080100" Cc: freebsd-hackers@freebsd.org, Gary Corcoran Subject: Re: Overlap in PCI memory ranges X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: cokane@FreeBSD.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Dec 2007 13:36:25 -0000 This is a multi-part message in MIME format. --------------000000060103000106080100 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Andrey V. Elsukov wrote: > Coleman Kane wrote: >> My apologies. The lines *should* read (mem ranges overlap): >> >> atapci0: port >> 0x9000-0x9007,0x9008-0x900b,0x9010-0x9017,0x5018-0x501b,0x5020-0x502f >> mem 0xd0609000-0xd06093ff irq 16 at device 18.0 on pci0 >> ..... >> pcm0: mem >> 0xd0608000-0xd060bfff irq 16 at device 20.2 on pci0 > > Why you want to do it? Your SATA controoler doesn't works? > Can you show a bit more log messages related to the atapci0? > Also can you show `pciconf -l | grep ^atapci`? > pcm0: hdac_mem_alloc: Unable to allocate memory resource (and then attach fails) Also, the mem resources of the SATA controller are used for AHCI (however, PATA compatibility mode is supported using the port ranges, which is what the controller is forced to do). In addition, the device name string on the SATA controller is only there because I've been fooling with ata-chipset.c (to unsuccessfully attempt to get AHCI working). Reading the MMIO registers in AHCI mode seems to produce spurious instances of reading garbage data, followed by reading the data that I want. For instance, in ata-chipset.c line 771 ata_ahci_reset(): if (!(ATA_INL(ctlr->r_res2, ATA_AHCI_PI) & (1 << ch->unit))) { device_printf(dev, "port not implemented\n"); return; } Produces "port not implemented" whenever it is executed (it ends up reading 0x00020070 or a similar unexpected value. However, if I put another ATA_INL(ctlr->r_res2, ATA_AHCI_PI) just above the if() statement, it will read 0x00000001, which is the expected value for my situation (a single port SATA controller on a laptop). This is supposed to read a bitmap of the enabled ports on the SATA controller. Attaching dmesg: You'll notice the "fpudna in kernel mode!" and "ndis0: bssid_list failed" messages. These are related to an NDIS 5.1 wifi driver and don't apply to my problem. -- Coleman Kane --------------000000060103000106080100 Content-Type: text/plain; name="dmesg.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="dmesg.txt" Copyright (c) 1992-2007 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 is a registered trademark of The FreeBSD Foundation. FreeBSD 8.0-CURRENT #0: Wed Nov 28 17:16:00 EST 2007 root@erwin:/usr/obj/usr/src/sys/ERWIN Timecounter "i8254" frequency 1193182 Hz quality 0 CPU: AMD Turion(tm) 64 X2 Mobile Technology TL-64 (2194.59-MHz K8-class CPU) Origin = "AuthenticAMD" Id = 0x60f81 Stepping = 1 Features=0x178bfbff Features2=0x2001 AMD Features=0xea500800 AMD Features2=0x11f Cores per package: 2 usable memory = 2001375232 (1908 MB) avail memory = 1931157504 (1841 MB) ACPI APIC Table: FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs cpu0 (BSP): APIC ID: 0 cpu1 (AP): APIC ID: 1 ACPI Error (tbfadt-0516): 32/64X address mismatch in "Pm2ControlBlock": [ 8800] [ 0 8100], using 64X [20070320] ioapic0: Changing APIC ID to 2 ioapic0 irqs 0-23 on motherboard kbd1 at kbdmux0 cryptosoft0: on motherboard acpi0: on motherboard acpi0: [ITHREAD] acpi0: Power Button (fixed) unknown: I/O range not supported acpi0: reservation of 0, 8000000 (3) failed acpi0: reservation of 100000, fff00000 (3) failed Timecounter "ACPI-safe" frequency 3579545 Hz quality 850 acpi_timer0: <32-bit timer at 3.579545MHz> port 0x8008-0x800b on acpi0 acpi_ec0: port 0x62,0x66 on acpi0 cpu0: on acpi0 acpi_throttle0: on cpu0 powernow0: on cpu0 cpu1: on acpi0 acpi_throttle1: on cpu1 acpi_throttle1: failed to attach P_CNT device_attach: acpi_throttle1 attach returned 6 powernow1: on cpu1 pcib0: port 0xcf8-0xcff on acpi0 pci0: on pcib0 pcib1: at device 1.0 on pci0 pci1: on pcib1 vgapci0: port 0x4000-0x40ff mem 0xc0000000-0xc7ffffff,0xd0400000-0xd040ffff,0xd0500000-0xd05fffff irq 19 at device 5.0 on pci1 pcib2: at device 4.0 on pci0 pci16: on pcib2 pci0:16:0:0: failed to read VPD data. bge0: mem 0xd0000000-0xd000ffff irq 16 at device 0.0 on pci16 miibus0: on bge0 brgphy0: PHY 1 on miibus0 brgphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX, auto bge0: Ethernet address: 00:1a:4b:74:39:96 bge0: [ITHREAD] pcib3: at device 5.0 on pci0 pci32: on pcib3 pcib4: at device 6.0 on pci0 pci48: on pcib4 ndis0: mem 0xc8100000-0xc8103fff,0xc8000000-0xc80fffff irq 18 at device 0.0 on pci48 ndis0: [ITHREAD] ndis0: NDIS API version: 5.1 fpudna in kernel mode! ndis0: using obsoleted if_watchdog interface ndis0: Ethernet address: 00:1a:73:86:02:df atapci0: port 0x9000-0x9007,0x9008-0x900b,0x9010-0x9017,0x5018-0x501b,0x5020-0x502f mem 0xd0609000-0xd06093ff irq 16 at device 18.0 on pci0 atapci0: [ITHREAD] ata2: on atapci0 ata2: [ITHREAD] ata3: on atapci0 ata3: [ITHREAD] ohci0: mem 0xd0601000-0xd0601fff irq 23 at device 19.0 on pci0 ohci0: [GIANT-LOCKED] ohci0: [ITHREAD] usb0: OHCI version 1.0, legacy support usb0: on ohci0 usb0: USB revision 1.0 uhub0: on usb0 uhub0: 2 ports with 2 removable, self powered ohci1: mem 0xd0602000-0xd0602fff irq 17 at device 19.1 on pci0 ohci1: [GIANT-LOCKED] ohci1: [ITHREAD] usb1: OHCI version 1.0, legacy support usb1: on ohci1 usb1: USB revision 1.0 uhub1: on usb1 uhub1: 2 ports with 2 removable, self powered ohci2: mem 0xd0603000-0xd0603fff irq 17 at device 19.2 on pci0 ohci2: [GIANT-LOCKED] ohci2: [ITHREAD] usb2: OHCI version 1.0, legacy support usb2: on ohci2 usb2: USB revision 1.0 uhub2: on usb2 uhub2: 2 ports with 2 removable, self powered ohci3: mem 0xd0604000-0xd0604fff irq 17 at device 19.3 on pci0 ohci3: [GIANT-LOCKED] ohci3: [ITHREAD] usb3: OHCI version 1.0, legacy support usb3: on ohci3 usb3: USB revision 1.0 uhub3: on usb3 uhub3: 2 ports with 2 removable, self powered ohci4: mem 0xd0605000-0xd0605fff irq 17 at device 19.4 on pci0 ohci4: [GIANT-LOCKED] ohci4: [ITHREAD] usb4: OHCI version 1.0, legacy support usb4: on ohci4 usb4: USB revision 1.0 uhub4: on usb4 uhub4: 2 ports with 2 removable, self powered ehci0: mem 0xd0606000-0xd06060ff irq 23 at device 19.5 on pci0 ehci0: [GIANT-LOCKED] ehci0: [ITHREAD] usb5: EHCI version 1.0 usb5: companion controllers, 2 ports each: usb0 usb1 usb2 usb3 usb4 usb5: on ehci0 usb5: USB revision 2.0 uhub5: on usb5 uhub5: 10 ports with 10 removable, self powered pci0: at device 20.0 (no driver attached) atapci1: port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0x5040-0x504f irq 16 at device 20.1 on pci0 ata0: on atapci1 ata0: [ITHREAD] pci0: at device 20.2 (no driver attached) isab0: at device 20.3 on pci0 isa0: on isab0 pcib5: at device 20.4 on pci0 pci2: on pcib5 cbb0: mem 0xd0100000-0xd0100fff irq 20 at device 4.0 on pci2 cardbus0: on cbb0 pccard0: <16-bit PCCard bus> on cbb0 cbb0: [ITHREAD] pci2: at device 4.1 (no driver attached) battery0: on acpi0 battery1: on acpi0 acpi_acad0: on acpi0 acpi_button0: on acpi0 acpi_lid0: on acpi0 acpi_tz0: on acpi0 atkbdc0: port 0x60,0x64 irq 1 on acpi0 atkbd0: irq 1 on atkbdc0 kbd0 at atkbd0 atkbd0: [GIANT-LOCKED] atkbd0: [ITHREAD] psm0: irq 12 on atkbdc0 psm0: [GIANT-LOCKED] psm0: [ITHREAD] psm0: model IntelliMouse, device ID 3 orm0: at iomem 0xd0000-0xd0fff on isa0 sc0: at flags 0x100 on isa0 sc0: VGA <16 virtual consoles, flags=0x300> vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 fb0 at vga0 ubt0: on uhub0 ubt0: Interface 0 endpoints: interrupt=0x81, bulk-in=0x82, bulk-out=0x2 ubt0: Interface 1 (alt.config 4) endpoints: isoc-in=0x83, isoc-out=0x3; wMaxPacketSize=64; nframes=5, buffer size=320 ugen0: on uhub2 Timecounters tick every 1.000 msec Fast IPsec: Initialized Security Association Processing. acd0: DVDR at ata0-master PIO4 ad0: DMA limited to UDMA33, device found non-ATA66 cable ad0: 152627MB at ata2-master UDMA33 SMP: AP CPU #1 Launched! GEOM_JOURNAL: Journal 3284468597: ad0s1e contains data. GEOM_JOURNAL: Journal 3284468597: ad0s1e contains journal. GEOM_JOURNAL: Journal ad0s1e clean. Trying to mount root from ufs:/dev/ad0s1a fpudna in kernel mode! acd0: FAILURE - INQUIRY ILLEGAL REQUEST asc=0x24 ascq=0x00 cd0 at ata0 bus 0 target 0 lun 0 cd0: Removable CD-ROM SCSI-0 device cd0: 16.000MB/s transfers cd0: Attempt to query device size failed: NOT READY, Medium not present - tray closed Setting ESSID to "" ndis0: bssid_list failed ndis0: link state changed to UP pcm0: mem 0xd0608000-0xd060bfff irq 16 at device 20.2 on pci0 pcm0: hdac_mem_alloc: Unable to allocate memory resource device_attach: pcm0 attach returned 6 fpudna in kernel mode! fpudna in kernel mode! fpudna in kernel mode! Setting ESSID to "" ndis0: link state changed to DOWN ndis0: bssid_list failed ndis0: link state changed to UP pcm0: mem 0xd0608000-0xd060bfff irq 16 at device 20.2 on pci0 pcm0: hdac_mem_alloc: Unable to allocate memory resource device_attach: pcm0 attach returned 6 pcm0: mem 0xd0608000-0xd060bfff irq 16 at device 20.2 on pci0 pcm0: hdac_mem_alloc: Unable to allocate memory resource device_attach: pcm0 attach returned 6 pcm0: mem 0xd0608000-0xd060bfff irq 16 at device 20.2 on pci0 pcm0: hdac_mem_alloc: Unable to allocate memory resource device_attach: pcm0 attach returned 6 --------------000000060103000106080100--