[U-Boot] [PATCH 1/7] Add support for MX35 processor

Wolfgang Denk
2011-01-19T11:37:44Z

Dear Stefano Babic,

In message <4D36B2AF.9000305@denx.de> you wrote:
>
> >> +void imx_get_mac_from_fuse(unsigned char *mac)
> >> +{
> >> + int i;
> >> +
> >> + for (i = 0; i < 6; i++)
> >> + mac[i] = 0;
> >
> > memset(mac, 0, 6);
> >
> > ?
>
> I think your question mark is related to the fact that it is not so
> clear why I set the mac address to all zero. At first glance, it makes
> no sense.

No, I wonder why code a loop when a simple memset() does the same.

> > What do these "!<" markers mean?
>
> They have no useful meaning and I must drop them.

There are other such cryptic markers - eventually from some doc
generating tool.

> >> +/* CCM */
> >> +#define CLKCTL_CCMR 0x00
> >> +#define CLKCTL_PDR0 0x04
> >> +#define CLKCTL_PDR1 0x08
> >> +#define CLKCTL_PDR2 0x0C
> >> +#define CLKCTL_PDR3 0x10
> >> +#define CLKCTL_PDR4 0x14
> >> +#define CLKCTL_RCSR 0x18
> >> +#define CLKCTL_MPCTL 0x1C
> >> +#define CLKCTL_PPCTL 0x20
> >> +#define CLKCTL_ACMR 0x24
> >> +#define CLKCTL_COSR 0x28
> >> +#define CLKCTL_CGR0 0x2C
> >> +#define CLKCTL_CGR1 0x30
> >> +#define CLKCTL_CGR2 0x34
> >> +#define CLKCTL_CGR3 0x38
> >
> > NAK!! Please use C struct. Please fix globally.
>
> No, this not. I have already set a structure for the Clock Module, that

If you already have a struct, then drop these duplication.

> it is used in most part of code (ccm_regs). However, these offsets are
> used in the assembly file (lowlevel_init.S), and I cannot use the
> structure. It seems to me the only structure needed, and it seems to me
> not necessary to add an asm-offsets.h only for it. For this reason. I
> let it in imx-regs.h

Such duplication of information is just a source of errors. And
asm-offsets.h has been provided exactly for the purpose to avoid such
#defines. Please use it.

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
Those who hate and fight must stop themselves -- otherwise it is not
stopped.
-- Spock, "Day of the Dove", stardate unknown