From owner-freebsd-questions Mon Sep 24 9:36:47 2001 Delivered-To: freebsd-questions@freebsd.org Received: from po4.wam.umd.edu (po4.wam.umd.edu [128.8.10.166]) by hub.freebsd.org (Postfix) with ESMTP id 0338D37B414; Mon, 24 Sep 2001 09:36:37 -0700 (PDT) Received: from sun09pg2.wam.umd.edu (IDENT:root@sun09pg2.wam.umd.edu [128.8.73.19]) by po4.wam.umd.edu (8.9.3/8.9.3) with ESMTP id MAA21622; Mon, 24 Sep 2001 12:36:08 -0400 (EDT) Received: from sun09pg2.wam.umd.edu (IDENT:sendmail@localhost [127.0.0.1]) by sun09pg2.wam.umd.edu (8.9.3/8.9.3) with SMTP id MAA01265; Mon, 24 Sep 2001 12:36:08 -0400 (EDT) Received: from localhost (culverk@localhost) by sun09pg2.wam.umd.edu (8.9.3/8.9.3) with ESMTP id MAA01260; Mon, 24 Sep 2001 12:36:06 -0400 (EDT) X-Authentication-Warning: sun09pg2.wam.umd.edu: culverk owned process doing -bs Date: Mon, 24 Sep 2001 12:36:06 -0400 (EDT) From: Kenneth Wayne Culver To: Mike Bruins Cc: freebsd-questions@FreeBSD.ORG, freebsd-hardware@FreeBSD.ORG Subject: Re: health chip driver - vt82c686 - finishing off In-Reply-To: <20010924221149.A4971@wall.hal9000.net.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG This is the same problem I was having when I tried to write the driver for freebsd, I never came up with a solution but mainly b/c I didn't have time to mess with it anymore. Ken On Mon, 24 Sep 2001, Mike Bruins wrote: > Hello, > > I have put together most of a device driver for the health > monitoring chip via technologies vt82c686 function 4 (PCI 3057:1106). > All the kernel loadable module, device probe/attach code, > temperature/fan/voltage conversion routines are there. > I can read the device registers for PCI Vendor/Device, chip enable, > class, subclass etc. > > Basically what I am not able to do is read the values > hardware offset registers. The call to bus_alloc_resource > fails (returns null) and I can't work out why. > > If anyone could please help with the following questions: > > 1. It looks like bus_alloc_resource() gets resources from it's parent > device driver. > Does the vt82c686 function 4, talk I2C to it's parent to get resources? > If so, do I need a device driver for this parent? > Anyone know it's PCI vendor/device chip code? > > 2. Perhaps I am going down the wrong path. Ideas, example code > references appreciated. I have looked at many examples of > code, but can't work out what is relevent/required for the 686a/b, > in terms of resources and how it communicates. > > 3. The bit of my code that is actually failing is below. > Like I said, I am pretty much sure the code to this point > is correct and working as I can print any of the registers > and they have sane values. > > I have tried every conbination I can think of for hwm_io_base_reg > and the type of resource I am asking for. > I have read the 686a.pdf file many times, tried all I can think of. > According to the 686a.pdf the data size is 0x80 bytes. > > > via->mem_rid = hwm_io_base_reg; > via->res_mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &(via->mem_rid), > 0ul, ~0ul, 0x80, RF_ACTIVE); > if (!via->res_mem) { > device_printf(dev, "could not map memory\n"); > goto bad; > } > via->memt = rman_get_bustag(via->res_mem); > via->memh = rman_get_bushandle(via->res_mem); > > Ultimately I need the memt and memh values, so I can make calls like: > > val = bus_space_read_1(via->memt, via->memh, regno); > > > > My system: > Motherboard: Gigabyte 6vxd7 > CPU : dual 866 > OS : 4.3-RELEASE free-bsd > > I have altered chip_match() so no driver is loaded at boot time for 0x30571106. > > chip0@pci0:0:0: class=0x060000 card=0x00000000 chip=0x06911106 rev=0xc4 hdr=0x00 > pcib1@pci0:1:0: class=0x060400 card=0x00000080 chip=0x85981106 rev=0x00 hdr=0x01 > isab0@pci0:7:0: class=0x060100 card=0x06861106 chip=0x06861106 rev=0x22 hdr=0x00 > uhci0@pci0:7:2: class=0x0c0300 card=0x12340925 chip=0x30381106 rev=0x10 hdr=0x00 > uhci1@pci0:7:3: class=0x0c0300 card=0x12340925 chip=0x30381106 rev=0x10 hdr=0x00 > none0@pci0:7:4: class=0x0c0500 card=0x00000000 chip=0x30571106 rev=0x30 hdr=0x00 > sym0@pci0:9:0: class=0x010000 card=0x00000000 chip=0x00201000 rev=0x01 hdr=0x00 > sym1@pci0:9:1: class=0x010000 card=0x00000000 chip=0x00201000 rev=0x01 hdr=0x00 > rl0@pci0:10:0: class=0x020000 card=0x0027a0a0 chip=0x813910ec rev=0x10 hdr=0x00 > pcm0@pci0:13:0: class=0x040100 card=0x13711274 chip=0x13711274 rev=0x08 hdr=0x00 > none1@pci0:14:0: class=0x040100 card=0x20601458 chip=0x13711274 rev=0x07 hdr=0x00 > none2@pci1:0:0: class=0x030000 card=0x00000000 chip=0x002c10de rev=0x15 hdr=0x00 > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message