[U-Boot-Users] [PATCH] Common code for detecting new mpc8xx core.

Christopher Cordahi christopher.cordahi at gmail.com
Tue Apr 4 17:43:47 CEST 2006


On 30/03/06, Wolfgang Denk <wd at denx.de> wrote:
> In message <11437528013650-git-send-email-davidho at nanometrics.ca> you wrote:
> > This refines the routine for detecting new mpc8xx core.
> >
> > This does however add a few bytes to the initial stack usage (Implemented as a
> > function).
>
> Is there any actual problem this patch is supposed to fix, or  is  it
> just implemented in a different style?

The problem is that the current code makes (possibly incorrect)
assumptions about how Motorola/Freescale uses of the PARTNUM
field in the IMMR and is inconsistent as to how it checks it.
There's a comment in include/mpc8xx.h
 /*-----------------------------------------------------------------------
 * Newer chips (MPC866 family and MPC87x/88x family) have different
 * clock distribution system. Their IMMR lower half is >= 0x0800
 */
Unfortunately some older parts without the newer clock distribution
system also have a value >= 0x0800.
e.g. The MPC823 has 0x2001 or 0x2000

Someone must have noticed a problem because cpu/mpc8xx/cpu.c
was updated to only look at the 12 low bits, however the
corresponding code in cpu/mpc8xx/cpu_init.c was not updated

> I don't see any immediate reason why I should like your  code  better
> than the existing one.

Someone might ask the same question as to why it was changed
in the first place in commit 180d3f74e4738ee107e269cbb949481075dd789a
(There's no mention in the changelog)
At first glance, the original code using preprocessor #if defined checks
even seems more efficient.

> Also, you patch violates the Coding Style  requirements  (which,  for
> example, requies to use TABs for indentation).

--
Chris




More information about the U-Boot mailing list