[U-Boot] [PATCH] Add mpc5125ads board and processor to the mpc512x family

John Rigby jcrigby at gmail.com
Tue Oct 20 00:45:57 CEST 2009


Regarding 512x psc register maps:

The register map for 5125 does not just change the size of the registers.
Some registers change locations.  The issue is that the hardware guys
decided to "fix" the old broken register access.  The 5200, 5121, 5123 had
some registers that were:

Function A when read but function B when written.

For this case the old register is replaced by two read/write registers.  So
the index of all subsequent registers is incremented.

Function A on first access after writing to another register and Function B
on subsequent accesses.

This was also fixed by replacing the statefull register by two registers.

So the problem is painful but I believe doable.  The problem I never
resolved was dealing with this mess in linux where the same binary has to
work with both platforms.  I decided that the register accesses needed to be
done via an offsets array that was populated at run time but I never got
around to implementing that.

John



>
> > >> + * MPC5121 PSC
> > >> + * note: MPC5121e register overloading is handled by unions with
> > #defines to
> > >> + * reference the reg seemlessly these #defines must not exist for
> > MPC5125 code
> > >> + * since it does not have this overloading. Since the register naming
> > is the
> > >> + * same as the MPC5125 Reference Manual and this naming is exactly
> the
> > reg names
> > >> + * used in the init code (which is nearly identical) it causes
> compile
> > errors to
> > >> + * leave in and must be #ifdef'ed out.  It also helps to share code
> > to have the
> > >> + * same structure for both MPC5121 and MPC5125
> > >>   */
> > > I disagree. To me the code becomes pretty much unreadable.  I think we
> > > need to find a better implementation for this.
> >
> > Look Wolfgang ... It's very readable .. with a 5121 type
>
> You definition of readable does not match mine. I nak this code.
>
>
> 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
> There is a time in the tides of men, Which, taken at its flood, leads
> on to success. On the other hand, don't count on it.   - T. K. Lawson
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>


More information about the U-Boot mailing list