[U-Boot] [PATCH 4/4] Added initial support for PRTLVT2-based boards.
Stefano Babic
sbabic at denx.de
Fri Aug 20 11:30:34 CEST 2010
Wolfgang Denk wrote:
Hi Wolfgang,
>> + pmic_reg_write(REG_POWER_MISC, GPO4ADIN);
>
> It would really be great if someone cold clean up this mess in
> "include/fsl_pmic.h"
>
> Using an "enum" for register definitions is just horrible.
>
> I am well aware that you did not introduce this code, but reading this
> feels is if my nails are rolling up.
Well, that's me ! I am aware it sounds crazy. However, the registers on
the pmic are not memory mapped and the access is done via SPI.
The pmic manuals (MC13783, MC13892,) describe the SPI frame (ok, frame
is probably a big word..it is only a 32 bit) and one of the field is the
internal register number.
Using a structure looks like to me even stranger. We have to use some
kind of offsetof() to get the index number back and put it inside the
SPI data.
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================
More information about the U-Boot
mailing list