The following is a code snippet which describes the problem.
The value returned by ddi_get64 is wrong. I used PCItool to read the
same address from bar0 and it returns the correct value.
As I mentioned before the same code works on s10 update 6. It also works
fine on build 110 on Sparc. It seems that device address is not set
correctly. I haven't figured out at which address it points to but
certainly not the correct address.
ddi_device_acc_attr_t dev_attr = {
DDI_DEVICE_ATTR_V0,
DDI_NEVERSWAP_ACC,
DDI_STRICTORDER_ACC,
DDI_FLAGERR_ACC
};
/* map BAR0 */
ret = ddi_regs_map_setup(dev_info, 1, (caddr_t *)&attr.bar0,
(offset_t)0, (offset_t)0, &dev_attr, &attr.regh0);
if (ret != DDI_SUCCESS) {
...
}
//
// val64 has a wrong value
//
val64 = ddi_get64(attr.regh0, (uint64_t *)(attr.bar0))
-----Original Message-----
From: Dan Mick [mailto:[email protected]]
Sent: Friday, April 10, 2009 8:45 PM
To: Eitan Eliahu
Cc: [email protected]
Subject: Re: [driver-discuss] OpenSOlaris build 110 - problem with
ddi_regs_map_setup() on x86
Not enough information here. Can you supply a misbehaving code snippet?
How do you know it's the wrong data?
Eitan Eliahu wrote:
>
>
> Hello all,
>
>
>
> I'm facing a problem with this build when running on an x86 machine.
It
> seems that ddi_regs_map_setup()does not return the correct device
> address. When offset provided to ddi_get() a wrong data is read from
the
> device.
>
>
>
> The following attribute is provided:
>
> ddi_device_acc_attr_t dev_attr = {
>
> DDI_DEVICE_ATTR_V0,
>
> DDI_NEVERSWAP_ACC,
>
> DDI_STRICTORDER_ACC,
>
> DDI_FLAGERR_ACC
>
> };
>
>
>
> When range # 0 is provided to ddi_regs_map_setup the correct data is
> read from the configuration space. The issue is for memory mapped I/O,
> on x86 (Sparc works) and OpenSolaris build 110.
>
>
>
> I would appreciate any advice.
>
>
>
> Eitan
>
>
>
>
>
------------------------------------------------------------------------
>
> _______________________________________________
> driver-discuss mailing list
> [email protected]
> http://mail.opensolaris.org/mailman/listinfo/driver-discuss
_______________________________________________
driver-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/driver-discuss