[U-Boot] [PATCH] DA8xx: fix LPSC numbering
Laurence Withers
lwithers at guralp.com
Mon Mar 21 22:25:44 CET 2011
On Mon, Mar 21, 2011 at 10:14:18PM +0100, Wolfgang Denk wrote:
> -> grep -R DAVINCI_LPSC_TPCC *
> arch/arm/include/asm/arch-davinci/hardware.h:#define DAVINCI_LPSC_TPCC 2
> arch/arm/include/asm/arch-davinci/hardware.h: DAVINCI_LPSC_TPCC = 0,
> board/davinci/dm355evm/dm355evm.c: lpsc_on(DAVINCI_LPSC_TPCC);
>
> you change:
>
> - DAVINCI_LPSC_MMC_SD,
> + DAVINCI_LPSC_MMC_SD0,
>
> I see:
>
> -> grep -R DAVINCI_LPSC_MMC_SD *
> arch/arm/cpu/arm926ejs/davinci/psc.c: case DAVINCI_LPSC_MMC_SD:
> arch/arm/include/asm/arch-davinci/hardware.h:#define DAVINCI_LPSC_MMC_SD 15
> arch/arm/include/asm/arch-davinci/hardware.h: DAVINCI_LPSC_MMC_SD,
>
>
> Seems your change would break a few boards...
There are several chips in the Davinci family; my commit changes the LPSC
definitions for the DA8xx (the DA830/DA850) processors only, leaving the
other processors alone (they are quite different).
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.
The existing uses in the code are special cases for the non-DA8xx processors;
DAVINCI_LPSC_TPCC is used in the DM355 EVM kit board code, and while
DAVINCI_LPSC_MMC_SD is used in the processor generic C code it is wrapped in
a #ifdef CONFIG_SOC_DM644X (another chip) with a comment about special
treatment.
So, I can change the non-DA8xx names to match. But that changes existing,
working code and the names would no longer match the datasheets.
Or, I can leave the old names be, and then have the new names with suffices, e.g.:
DAVINCI_LPSC_MMC_SD, /* actually MMC_SD0 on DA8xx */
DAVINCI_LPSC_MMC_SD1,
It seems a little inconsistent to me, but I'm happy to do it if preferred.
Or, I can do what I have done, and change only the DA8xx names.
Which is the preferred option? Or something else entirely?
Many thanks, and 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