[U-Boot] [PATCH 7/9] net: tsec: Use portable types and accessors for BDs

Claudiu Manoil
2013-10-03T13:36:59Z

On 10/3/2013 1:15 AM, Scott Wood wrote:
[snip]
>
> Yeah, it doesn't help when both types of accesses show up when searching
> for the ring, and accessors exist with both possible argument orderings.
> Especially when a driver has custom accessors.
>
> It's OK to use explicit synchronization rather than I/O accessors, if
> you're careful to ensure that it's correct.
>
> It looks like drivers/net/fec_mxc.c in U-Boot is an example that uses
> I/O accessors on ring data, e.g.:
>
> writew(length, &fec->tbd_base[fec->tbd_index].data_length);
>

Hi Scott,

I sent a v2 for this patch (the next 2 patches in the series are
not affected by this one):
http://patchwork.ozlabs.org/patch/280285/

In this version I dropped the macro usage and used I/O accessors for
the ring data, as discussed. This approach does not require the
explicit __beNN type for the BD fields, it also removes the need to
declare the BD structures as "volatile" and it's safer because in_be()/
out_be() enforce HW sync.

Thanks,
Claudiu