Dear Kumar Gala, In message <7e86bc8f-7e3f-49b1-b1c5-b21991303...@kernel.crashing.org> you wrote: > > <ga...@kernel.crashing.org> wrote: > > > >> +#ifdef CONFIG_FSL_NGPIXIS > >> +#include "ngpixis.h" > >> +#define PIXIS_VSYSCLK0 offsetof(struct ngpixis, sclk[0]) > >> +#define PIXIS_VSYSCLK1 offsetof(struct ngpixis, sclk[1]) > >> +#define PIXIS_VSYSCLK2 offsetof(struct ngpixis, sclk[2]) > >> +#define PIXIS_VDDRCLK0 offsetof(struct ngpixis, dclk[0]) > >> +#define PIXIS_VDDRCLK1 offsetof(struct ngpixis, dclk[1]) > >> +#define PIXIS_VDDRCLK2 offsetof(struct ngpixis, dclk[2]) > >> +#endif > > > > Yuck. I specifically created the ngpixis_t structure because Wolfgang > > objected to the use of macros for offsets. > > > > But I understand why you did it. It's the easiest way to maintain > > compatibility between pixis and ngpixis. > > Wolfgang, is this an issue?
This, in itself, it not an issue. The issue comes when you wrote code like this: + return ics307_clk_freq ( + in_8(pixis_base + PIXIS_VSYSCLK0), + in_8(pixis_base + PIXIS_VSYSCLK1), + in_8(pixis_base + PIXIS_VSYSCLK2) + ); +} + +unsigned long get_board_ddr_clk(void) +{ + u8 *pixis_base = (u8 *)PIXIS_BASE; + + return ics307_clk_freq ( + in_8(pixis_base + PIXIS_VDDRCLK0), + in_8(pixis_base + PIXIS_VDDRCLK1), + in_8(pixis_base + PIXIS_VDDRCLK2) + ); This clearly gets a NAK because you should use a struct, and not base address + offset notation. > The other option is have 3 different structs: > > On p2020: #define PIXIS_VSYSCLK0 offsetof(struct ngpixis, > sclk[0]) > on 8572: #define PIXIS_VSYSCLK0 0x1C > on 8536: #define PIXIS_VSYSCLK0 0x1A I see #defines here, no structs. I'm not sure if you need different structs (haven't looked into these), or if clever notation of the struct is sufficient. 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: w...@denx.de A committee is a life form with six or more legs and no brain. -- Lazarus Long, "Time Enough For Love" _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot