Date: Thu, 27 Sep 2001 08:02:56 +0800 From: Mike Bruins <bruins@hal9000.net.au> To: "Matthew N. Dodd" <winter@jurai.net> Cc: Mike Bruins <bruins@hal9000.net.au>, freebsd-hardware@freebsd.org Subject: Re: health chip driver - vt82c686 - finishing off Message-ID: <20010927080256.A14035@wall.hal9000.net.au> In-Reply-To: <Pine.BSF.4.21.0109242143150.3806-100000@sasami.jurai.net>; from winter@jurai.net on Mon, Sep 24, 2001 at 09:47:38PM -0400 References: <20010925092517.A7092@wall.hal9000.net.au> <Pine.BSF.4.21.0109242143150.3806-100000@sasami.jurai.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010927080256.A14035>