[U-Boot] [PATCH] DA8xx: fix LPSC numbering

Laurence Withers lwithers at guralp.com
Mon Mar 21 23:28:29 CET 2011


On Mon, Mar 21, 2011 at 10:44:11PM +0100, Wolfgang Denk wrote:
> We should agree on a common way to implement this - either #define
> _or_ enum, but not a mix of both.
> 
> Having a closer look, it turns out that all these "indices" are
> actually register names, and functions like lpsc_on() use horrible
> code like this:
> 
> 	mdstat = REG_P(PSC_MDSTAT_BASE + (id * 4));
> 
> to perform address magic, even worse, perform device I/O without using
> any I/O acessors (as in dsp_on()).

So, as a rough way forward, does the following sound sane?

 - drop REG_P() and REG() macros, use readl()/writel()/etc. instead.
 - drop address magic, use structures/arrays instead.
 - choose either enum or #define (I'd say enum as it's mostly a set of
   incrementing integers, but it depends on what the result looks like).
 - try to unify the various Davinci LPSC modules as much as possible.

I'm willing to give this a go, but I am unable to physically test the results
on any of the Davinci family except the DA850.

Bye for now,
-- 
Laurence Withers, <lwithers at guralp.com>                http://www.guralp.com/
Direct tel:+447753988197 or tel:+443333408643               Software Engineer
General support queries: <support at guralp.com>         CMG-DCM CMG-EAM CMG-NAM


More information about the U-Boot mailing list