Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Sep 2008 16:28:32 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-stable@freebsd.org
Cc:        KAHO Toshikazu <vinwa@rocky.kais.kyoto-u.ac.jp>
Subject:   Re: alpm(4) I/O range is claimed by ACPI
Message-ID:  <200809191628.33000.jhb@freebsd.org>
In-Reply-To: <200809180139.m8I1dJEt067791@pf2.ed.niigata-u.ac.jp>
References:  <200809171137.32759.jhb@freebsd.org> <200809180139.m8I1dJEt067791@pf2.ed.niigata-u.ac.jp>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday 17 September 2008 09:39:19 pm KAHO Toshikazu wrote:
>   Hello,
> 
> > Well, bus_alloc_resource() will allocate resources for the BAR and update 
the 
> > BAR for you, the question is if you need to hardcode the range to 
> > bus_alloc_resource() or not.
> 
> It is necessary for a pci device to set the BAR, if the device
> would use memory or I/O space, isn't it? I don't know why the
> BAR is not settable, but I think it is disabled by some reasons
> and the BAR may be settable if the device could be enabled.

The BIOS simply may have not set a range for the BAR and left it at 0.  In 
that case, the BAR can probably be enabled by just programming it to a valid 
range.  You can try doing that via

	rid = PCIR_BAR(x);
	/* Or SYS_RES_IOPORT */
	res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid);

This will allocate fresh resources for the BAR if possible.  However, if the 
BAR is "special" and only works with a certain hard-coded address, then you 
can try specifying the start/end/count using bus_alloc_resource() rather than 
bus_alloc_resource_any().

-- 
John Baldwin



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