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

Wolfgang Denk wd at denx.de
Mon Mar 21 22:44:11 CET 2011


Dear Laurence Withers,

In message <20110321212544.GB15999 at lwithers.me.uk> you wrote:
>
> Looking at the hardware.h file that I changed, just above the enum { } block
> where my changes reside are a set of #defines for the same symbols. The
> #defines are used when CONFIG_SOC_DA8XX is not defined; the enum is used when
> it is.

Argh.   Can we please clean up such a mess, then?

> Which is the preferred option? Or something else entirely?

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()).


I am aware that this is unrelated to your patch, but this needs to be
cleaned up ASAP!



As for your patch - maybe we can at least unify the #define versus
enum mixture?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Beauty is transitory." "Beauty survives."
	-- Spock and Kirk, "That Which Survives", stardate unknown


More information about the U-Boot mailing list