From: Wolfgang Denk Date: Wed, 19 Nov 2003 09:59:06 +0100 Subject: [U-Boot-Users] Question about setting the sys clk freq based on a pull up on io. In-Reply-To: Your message of "Tue, 18 Nov 2003 18:02:29 PST." <3FBACF35.4020006@esteem.com> Message-ID: <20031119085911.219AFC5F5F@atlas.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Conn, in message <3FBACF35.4020006@esteem.com> you wrote: > > My problem is how do I go about this without severly modifying U-Boots > structure. In analyzing how to do this I determined that the > configuration and reading of the IO pin sould be done in a > board_pre_init function. This rases the issue of passing values between > the init functions called by board_init_f. My second issue is how do I You can store the cpu_clk / bus_clk in the global_data structure. > deal with the two frquencies since only one can be defined as > CONFIG_SYS_CLK_FREQ(which is used in several places) without sticking > lots of nasty board specific ifdefs through out the code. I don't see the need for #ifdef's. > (Note I didn't look at them all). We realy don't want to have to specify > at compile time what frequency we intend on using. This may become an I see no need that CONFIG_SYS_CLK_FREQ must be a constant. Instead of #define CONFIG_SYS_CLK_FREQ 33333333 you can - for example - use #define CONFIG_SYS_CLK_FREQ my_function_to_read_clocks() 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 "Most people would like to be delivered from temptation but would like it to keep in touch." - Robert Orben