From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kumar Gala Date: Thu, 22 Apr 2004 14:51:16 -0500 Subject: [U-Boot-Users] dynamic setting of CONFIG_SYS_CLK_FREQ In-Reply-To: <20040422194434.A9C1BC109F@atlas.denx.de> References: <20040422194434.A9C1BC109F@atlas.denx.de> Message-ID: <6A9BF178-9496-11D8-9316-000393DBC2E8@motorola.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de thanks, I realized that sys_clk is not defined, I was going to add it for 85xx since none of the other defines in gd currently represent the value. The other option would be to have a function return the proper frequency (as suggested earlier in the thread). Any suggestions as to which option would be preferred? I'm able to initialize gd->sys_clk (CONFIG_SYS_CLK_FREQ) as the first thing done in board_early_init_f. - kumar On Apr 22, 2004, at 2:44 PM, Wolfgang Denk wrote: > In message <89194C60-9482-11D8-9316-000393DBC2E8@motorola.com> you > wrote: >> How bad would it be to do something like: >> >> #define CONFIG_SYS_CLK_FREQ (gd->sys_clk) > > Thisi s perfectly legal. > >> or is this what you meant by 'provide a suitable init fuction' > > No. I meant: you can do something like the above, but you must make > sure that there is code to initialize gd->sys_clk before anyone > attempts to access it. > > And BTW: sys_clk is not a member of the struct "gd". > > Best regards, > > Wolfgang Denk > > -- > Software Engineering: Embedded and Realtime Systems, Embedded Linux > Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: wd at denx.de > ... Hiroshima 45 ... Chernobyl 86 ... Windows 95 ...