[U-Boot] [PATCH] ppc4xx: Initialize magnetic couplers on PLU405
Wolfgang Denk
wd at denx.de
Thu Oct 22 23:30:50 CEST 2009
Dear Matthias Fuchs,
In message <200910222308.14956.matthias.fuchs at esd-electronics.com> you wrote:
>
> + u8 *ctrl = (u8*)addr;
> +
> + /* reset */
> + out_8(ctrl, 0x21);
> +
> + /* dominant */
> + out_8(ctrl + 6, 0x00);
> + out_8(ctrl + 7, 0x14);
> + out_8(ctrl + 8, 0xfe);
> + out_8(ctrl, 0x20);
Please do not acces hardware using a base address plus offsets, please
declare and use a proper C struct for this. Also, you want to add some
symbolic constants (and comments) for all the magic numbers used here.
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 are two ways of constructing a software design. One way is to
make it so simple that there are obviously no deficiencies and the
other is to make it so complicated that there are no obvious defi-
ciencies. - Charles Anthony Richard Hoare
More information about the U-Boot
mailing list