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

2013-09-30 Thread Claudiu Manoil
Currently, the buffer descriptor (BD) fields cannot be correctly accessed by a little endian processor. This patch fixes the issue by making the access of BDs to be portable among different cpu architectures. Use portable data types for the Rx/Tx buffer descriptor fields. Add macro accessors to

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

2013-09-30 Thread Scott Wood
On Mon, 2013-09-30 at 12:44 +0300, Claudiu Manoil wrote: > +static RTXBD rtx __aligned(8); > +#define RXBD(i) rtx.rxbd[i] > +#define TXBD(i) rtx.txbd[i] > +#define GET_BD_STAT(T, i) be16_to_cpu((__force __be16)T##BD(i).status) > +#define SET_BD_STAT(T, i, v) T##BD(i).status = (__force __u16)cpu_to_

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

2013-10-01 Thread Claudiu Manoil
On 10/1/2013 2:22 AM, Scott Wood wrote: On Mon, 2013-09-30 at 12:44 +0300, Claudiu Manoil wrote: +static RTXBD rtx __aligned(8); +#define RXBD(i) rtx.rxbd[i] +#define TXBD(i) rtx.txbd[i] +#define GET_BD_STAT(T, i) be16_to_cpu((__force __be16)T##BD(i).status) +#define SET_BD_STAT(T, i, v) T##BD

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

2013-10-01 Thread Scott Wood
On Tue, 2013-10-01 at 14:38 +0300, Claudiu Manoil wrote: > > On 10/1/2013 2:22 AM, Scott Wood wrote: > > On Mon, 2013-09-30 at 12:44 +0300, Claudiu Manoil wrote: > >> +static RTXBD rtx __aligned(8); > >> +#define RXBD(i) rtx.rxbd[i] > >> +#define TXBD(i) rtx.txbd[i] > >> +#define GET_BD_STAT(T, i)

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

2013-10-02 Thread Claudiu Manoil
On 10/1/2013 9:50 PM, Scott Wood wrote: On Tue, 2013-10-01 at 14:38 +0300, Claudiu Manoil wrote: On 10/1/2013 2:22 AM, Scott Wood wrote: On Mon, 2013-09-30 at 12:44 +0300, Claudiu Manoil wrote: +static RTXBD rtx __aligned(8); +#define RXBD(i) rtx.rxbd[i] +#define TXBD(i) rtx.txbd[i] +#define

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

2013-10-02 Thread Scott Wood
On Wed, 2013-10-02 at 17:16 +0300, Claudiu Manoil wrote: > On 10/1/2013 9:50 PM, Scott Wood wrote: > > On Tue, 2013-10-01 at 14:38 +0300, Claudiu Manoil wrote: > >> > >> On 10/1/2013 2:22 AM, Scott Wood wrote: > >>> On Mon, 2013-09-30 at 12:44 +0300, Claudiu Manoil wrote: > +static RTXBD rtx _

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

2013-10-03 Thread Claudiu Manoil
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

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

2013-10-03 Thread Timur Tabi
On Mon, Sep 30, 2013 at 4:44 AM, Claudiu Manoil wrote: > +#define GET_BD_STAT(T, i) be16_to_cpu((__force __be16)T##BD(i).status) > +#define SET_BD_STAT(T, i, v) T##BD(i).status = (__force __u16)cpu_to_be16(v) > +#define GET_BD_BLEN(T, i) be16_to_cpu((__force __be16)T##BD(i).length) > +#define SET_

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

2013-10-04 Thread Claudiu Manoil
On 10/4/2013 6:12 AM, Timur Tabi wrote: On Mon, Sep 30, 2013 at 4:44 AM, Claudiu Manoil wrote: +#define GET_BD_STAT(T, i) be16_to_cpu((__force __be16)T##BD(i).status) +#define SET_BD_STAT(T, i, v) T##BD(i).status = (__force __u16)cpu_to_be16(v) +#define GET_BD_BLEN(T, i) be16_to_cpu((__force __