From owner-freebsd-hardware Wed Sep 26 17: 3:49 2001 Delivered-To: freebsd-hardware@freebsd.org Received: from hal9000.net.au (cu764.adelaide.adsl.on.net [150.101.237.2]) by hub.freebsd.org (Postfix) with ESMTP id BF05237B406 for ; Wed, 26 Sep 2001 17:03:39 -0700 (PDT) Received: (from bruins@localhost) by hal9000.net.au (8.11.1/8.11.1) id f8R02uh14169; Thu, 27 Sep 2001 08:02:56 +0800 (WST) (envelope-from bruins) Date: Thu, 27 Sep 2001 08:02:56 +0800 From: Mike Bruins To: "Matthew N. Dodd" Cc: Mike Bruins , freebsd-hardware@freebsd.org Subject: Re: health chip driver - vt82c686 - finishing off Message-ID: <20010927080256.A14035@wall.hal9000.net.au> References: <20010925092517.A7092@wall.hal9000.net.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from winter@jurai.net on Mon, Sep 24, 2001 at 09:47:38PM -0400 Sender: owner-freebsd-hardware@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Mon, Sep 24, 2001 at 09:47:38PM -0400, Matthew N. Dodd wrote: > On Tue, 25 Sep 2001, Mike Bruins wrote: > > I will again try a value of 1. Do you have any thoughts on > > how to determine the value of the hwm_io_base_reg ? > > The documentation should tell you which config space register contains > your io/mem address mapping. > > Typically this is 0x10 for IO and 0x14 for MEM. I believe I need to read the value "loosely" pointed to by 0x70. (by loosely I mean " &= 0xFFFE") #define CONF_HWM_BASE 0x70 a = CONF_HWM_BASE; v = pci_read_config(dev, a, 2); viahwm_base = 0xFFFE & v; device_printf(dev, "Base Address = 0x%04x\n",viahwm_base); > > What does the probe line for your driver output? > Output : Sep 26 23:15:32 hal9000 /kernel: via0: via_attach via0 Sep 26 23:15:32 hal9000 /kernel: via0: register 0x00 = 0x1106 Sep 26 23:15:32 hal9000 /kernel: via0: register 0x02 = 0x3057 Sep 26 23:15:32 hal9000 /kernel: via0: register 0x74 = 0x0001 Sep 26 23:15:32 hal9000 /kernel: via0: register 0x74 = 0x0001 Sep 26 23:15:32 hal9000 /kernel: via0: register 0x70 = 0x0c01 Sep 26 23:15:32 hal9000 /kernel: via0: Base Address = 0x0c00 Sep 26 23:15:32 hal9000 /kernel: via0: via_attach: done Sep 26 23:15:32 hal9000 /kernel: Sep 26 23:15:32 hal9000 /kernel: Loaded via character device driver Typically the viahwm_base is 0x0c00. I have seen code using /dev/io device to access that memory, but wondering if that should only be done in userland. (asside:I am planning to write a bit of perl on the weekend to test if it actually works.) My questions is: What do I set the value of rid to? a) 0x70 b) 0x0c00 c) Other? Please specify. rid = ??; via->res_mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, 0ul, ~0ul, 0x01, RF_ACTIVE); Oh yes, I want to thank everyone who has been involved with this discussion. I didn't expect such a good response. - mike > | Matthew N. Dodd | '78 Datsun 280Z | '75 Volvo 164E | FreeBSD/NetBSD | > | winter@jurai.net | 2 x '84 Volvo 245DL | ix86,sparc,pmax | > | http://www.jurai.net/~winter | For Great Justice! | ISO8802.5 4ever | > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hardware" in the body of the message