On Wed, Nov 18, 2009 at 6:15 PM, Larry Finger <larry.fin...@lwfinger.net> wrote:
> On 11/18/2009 08:34 AM, Oncaphillis wrote:
>> The first ioread16 actually succeeds, only the second one fails.
>> My lspci -vnn tells me that the memory is:
>>
>> Memory at 57100000 (64-bit, non-prefetchable) [size=16K]
>>
>> Could it be that one has to make a ioread32 here since the
>> memory is 64-bit ? I remember very very remotely that
>> in older days it was impossible or even forbidden to read
>> data from addresses which are not a multiple of 2/4/8 what
>> so ever. But that was pre-PCI.
>
> As long as a 16-bit read is aligned on an even address, it should be OK;
> however, to check completely, please try this patch:
>
> Index: wireless-testing/drivers/ssb/pci.c
> ===================================================================
> --- wireless-testing.orig/drivers/ssb/pci.c
> +++ wireless-testing/drivers/ssb/pci.c
> @@ -251,10 +251,16 @@ static int sprom_check_crc(const u16 *sp
>  static int sprom_do_read(struct ssb_bus *bus, u16 *sprom)
>  {
>        int i;
> +       u32 buf;
>
> -       for (i = 0; i < bus->sprom_size; i++)
> -               sprom[i] = ioread16(bus->mmio + SSB_SPROM_BASE + (i * 2));
> -
> +       printk(KERN_INFO "ssb: Entering %s\n", __func__);
> +       for (i = 0; i < bus->sprom_size; i = i + 2) {

I know this is just a debugging patch, but we use "i+=2" or "i += 2"
in such cases.

> +               buf = ioread32(bus->mmio + SSB_SPROM_BASE + (i * 2));
> +               printk(KERN_INFO "ssb: Read 0x%.8X from SPROM\n", buf);
> +               sprom[i] = buf & 0x0000FFFF;
> +               sprom[i+1] = (buf >> 16) & 0x0000FFFF;
> +       }
> +       printk(KERN_INFO "ssb: Leaving %s\n", __func__);
>        return 0;
>  }
>
>
>
> Larry
>
> _______________________________________________
> Bcm43xx-dev mailing list
> Bcm43xx-dev@lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/bcm43xx-dev
>



-- 
Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-)
_______________________________________________
Bcm43xx-dev mailing list
Bcm43xx-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev

Reply via email to