From: Wolfgang Denk Date: Tue, 31 Mar 2009 22:46:15 +0200 Subject: [U-Boot] core ticks/timer code In-Reply-To: <49CDCCC1.5050503@googlemail.com> References: <200903272130.26825.vapier@gentoo.org> <49CDCCC1.5050503@googlemail.com> Message-ID: <20090331204615.32BBD83797DC@gemini.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 Dirk Behme, In message <49CDCCC1.5050503@googlemail.com> you wrote: > > > - get_ticks - return some notion of "cpu ticks" > > Yes. Returns the number of cpu ticks since power up. I.e. with 1000 > ticks per second (CONFIG_SYS_HZ) the number of elapsed ms since power up. Hey. What a chance. We have a wiki. Add that information. > Yes. Some implementations just return CONFIG_SYS_HZ which is supposed > to be 1000. get_ticks() makes no sense to me. > > - timer_init - setup a core timer > > Some implementations do this in interrupt_init(), too. Let them do it, if they need it, and if they document why they need it. > > - get_timer(x) - not really sure what this is supposed to represent, or how > > "x" is used See ppc code. > > - CONFIG_SYS_HZ - no idea how this relates to ticks/timer in U-Boot as in the > > Linux world, this is the core timer (scheduler) frequency (how many times to > > execute per second) > > CONFIG_SYS_HZ is supposed to be 1000 > > Does this make sense? Yes, it makes sense that CONFIG_SYS_HZ is supposed to be 1000. 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 What is research but a blind date with knowledge? -- Will Harvey