alpm(4) I/O range is claimed by ACPI

John Baldwin jhb at freebsd.org
Fri Sep 19 20:35:27 UTC 2008


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


More information about the freebsd-stable mailing list