Re: [U-Boot] [PATCH 1/5] Tegra2: Add bitfield access macros

2011-06-08 Thread Wolfgang Denk
Dear Simon Glass, In message you wrote: > > I think I responded to your point about not being able to search in > the source code. I can't really respond to your point about it being Yes, and doing so you ignore all previous discussion about portability etc. etc. etc. Let's stop this discussio

Re: [U-Boot] [PATCH 1/5] Tegra2: Add bitfield access macros

2011-06-08 Thread Simon Glass
On Wed, Jun 8, 2011 at 12:21 PM, Wolfgang Denk wrote: > Dear Simon Glass, > > In message > you > wrote: >> >> I don't agree. Going back to the original patch, the macro allow us to >> write this code to read/write bias time for example (showing header >> and C file): > > We don't make any progr

Re: [U-Boot] [PATCH 1/5] Tegra2: Add bitfield access macros

2011-06-08 Thread Wolfgang Denk
Dear Simon Glass, In message you wrote: > > I don't agree. Going back to the original patch, the macro allow us to > write this code to read/write bias time for example (showing header > and C file): We don't make any progress if you now go back to the starting point. Please feel free to do so

Re: [U-Boot] [PATCH 1/5] Tegra2: Add bitfield access macros

2011-06-08 Thread Simon Glass
Hi Wolfgang, On Tue, Jun 7, 2011 at 1:00 PM, Wolfgang Denk wrote: > Dear Simon Glass, > > In message you wrote: >> >> >        clrsetbits_le32(&my_device->ctrl, FIELD_MASK, FIELD_VAL(6)); >> >> We now have a computed mask which is good, thank you. >> >> But the FIELD is specified twice in the sa

Re: [U-Boot] [PATCH 1/5] Tegra2: Add bitfield access macros

2011-06-08 Thread Detlev Zundel
Hi, > Dear Simon Glass, > > In message you wrote: >> >> >clrsetbits_le32(&my_device->ctrl, FIELD_MASK, FIELD_VAL(6)); >> >> We now have a computed mask which is good, thank you. >> >> But the FIELD is specified twice in the same statement. Can we >> therefore please take this a step furt

Re: [U-Boot] [PATCH 1/5] Tegra2: Add bitfield access macros

2011-06-07 Thread Wolfgang Denk
Dear Simon Glass, In message you wrote: > > >clrsetbits_le32(&my_device->ctrl, FIELD_MASK, FIELD_VAL(6)); > > We now have a computed mask which is good, thank you. > > But the FIELD is specified twice in the same statement. Can we > therefore please take this a step further and write som

Re: [U-Boot] [PATCH 1/5] Tegra2: Add bitfield access macros

2011-06-07 Thread Wolfgang Denk
Dear Simon Glass, In message you wrote: > > But the FIELD is specified twice in the same statement. Can we > therefore please take this a step further and write something like > this? > > clrsetfield_le32(&my_device->ctrl, FIELD, 6); I consider this too specific on one side, and the additional

Re: [U-Boot] [PATCH 1/5] Tegra2: Add bitfield access macros

2011-06-07 Thread Simon Glass
Hi Wolfgang, On Tue, Jun 7, 2011 at 3:06 AM, Wolfgang Denk wrote: > Dear Simon Glass, > > In message you wrote: >> >> >> #define clrsetfield_le32(bitfield, addr, value) =A0... >> >> >> >> Then caller can define these in a header file: >> >> >> >> #define FIELD_MASK 0xf >> >> #define FIELD_SH

Re: [U-Boot] [PATCH 1/5] Tegra2: Add bitfield access macros

2011-06-07 Thread Mike Frysinger
On Tuesday, June 07, 2011 06:06:23 Wolfgang Denk wrote: > #define FIELD_VAL(x)(x << 16) > #define FIELD_MASK FIELD_VAL(0xF) this is basically what we do in the blackfin port. we keep most of the logic in the defines so that we can use the simpler i/o logic without too much

Re: [U-Boot] [PATCH 1/5] Tegra2: Add bitfield access macros

2011-06-07 Thread Wolfgang Denk
Dear Simon Glass, In message you wrote: > > >> #define clrsetfield_le32(bitfield, addr, value) =A0... > >> > >> Then caller can define these in a header file: > >> > >> #define FIELD_MASK 0xf > >> #define FIELD_SHIFT 16 > >> > >> And use this macro to set the bitfield to 6, for example: > >>

Re: [U-Boot] [PATCH 1/5] Tegra2: Add bitfield access macros

2011-06-06 Thread Simon Glass
Hi Wolfgang, On Mon, Jun 6, 2011 at 11:28 PM, Wolfgang Denk wrote: > Dear Simon Glass, > > In message > you > wrote: >> >> OK I understand, thank you. How about this approach: we could add a >> new macro to io.h, something like: >> >> #define clrsetfield_le32(bitfield, addr, value)  ... >> >>

Re: [U-Boot] [PATCH 1/5] Tegra2: Add bitfield access macros

2011-06-06 Thread Wolfgang Denk
Dear Simon Glass, In message you wrote: > > OK I understand, thank you. How about this approach: we could add a > new macro to io.h, something like: > > #define clrsetfield_le32(bitfield, addr, value) ... > > Then caller can define these in a header file: > > #define FIELD_MASK 0xf > #de

Re: [U-Boot] [PATCH 1/5] Tegra2: Add bitfield access macros

2011-06-06 Thread Simon Glass
On Mon, Jun 6, 2011 at 11:50 AM, Wolfgang Denk wrote: > Dear Simon Glass, > [big snip] Hi Wolfgang, OK I understand, thank you. How about this approach: we could add a new macro to io.h, something like: #define clrsetfield_le32(bitfield, addr, value) ... Then caller can define these in a head

Re: [U-Boot] [PATCH 1/5] Tegra2: Add bitfield access macros

2011-06-06 Thread Wolfgang Denk
Dear Simon Glass, In message <1306973675-8411-2-git-send-email-...@chromium.org> you wrote: > To use these, set things up like this: > > struct uart_ctlr *uart = (struct uart_ctlr *)UART_PA_START; > > #define UART_PA_START 0x6700 /* Physical address of UART */ > #define UART_FBCON_RA

[U-Boot] [PATCH 1/5] Tegra2: Add bitfield access macros

2011-06-01 Thread Simon Glass
To use these, set things up like this: struct uart_ctlr *uart = (struct uart_ctlr *)UART_PA_START; #define UART_PA_START 0x6700 /* Physical address of UART */ #define UART_FBCON_RANGE 5:3 /* Bit range for the FBCON field */ enum { /* An enum