Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Aug 2007 14:43:11 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        Mike Tancsa <mike@sentex.net>
Cc:        Dag-Erling =?iso-8859-1?q?Sm=C3=B8rgrav?= <des@des.no>, freebsd-acpi@freebsd.org
Subject:   Re: ichwd for ICH8
Message-ID:  <200708131443.12208.jhb@freebsd.org>
In-Reply-To: <200708101901.l7AJ1pKa060911@lava.sentex.ca>
References:  <46337B06.9080102@ybb.ne.jp> <200708101455.44492.jhb@freebsd.org> <200708101901.l7AJ1pKa060911@lava.sentex.ca>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday 10 August 2007 03:02:12 pm Mike Tancsa wrote:
> At 02:55 PM 8/10/2007, John Baldwin wrote:
> 
> >Don't use ~0ul for the end address, but use the real one.  However, the
> >resource management in this driver is all wrong.  What it should be doing, 
is
> >to identify as a child of 'isab' and create a child device of 'isab'.  It
> >should then allocate the appropriate BAR from the 'isab' device (the isab
> >driver can "proxy" alloc_resource requests from direct children to its bars
> >just like the vgapci(4) device) and use that single BAR resource for I/O.
> >However, just fixing the end address to be appropriate should fix the 
driver
> >for now.
> 
> Hi,
> Apart from the FreeBSD Architecture Handbook, are there any other 
> resources you can point to that will help me better understand 
> FreeBSD and PCI drivers ? I am trying to make a watchdog driver for 
> http://wwwd.amd.com/support/PCSGtech.nsf/FAQTablookup/FAQ.49?OpenDocument
> 
> as a learning exercise and am trying to understand how to get
> 
> "The base address of the MFGPT hardware is typically located in PCI 
> configuration space at 80007818h. This is Bus 0h, Device Fh, Function 
> 0h, Offset 18h."

This is a PCI device.  Offset 0x18 is a PCI BAR, in fact it is the standard 
BAR 2.  So, if you were to make 'isab' pass through resource requests then 
you would have your driver attach to isab and then do this to get its 
resource:

	rid = PCIR_BAR(2);
	res = bus_alloc_resource_any(dev, SYS_RES_IO, &rid...);

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200708131443.12208.jhb>