Dear Alexander, in message <4d0b6d1f.8010...@ahsoftware.de> you wrote: > > I think I've nailed down, why an u-boot compiled with gcc 4.5.1 fails > here. Compiling arch/arm/cpu/armv7/omap3/clock.c with > ... > That means get_sys_clk_speed() will allways return S12M, at least that > is what I'm reading here. And I don't see why gcc should be allowed to > optimize that cdiff to a fixed value and therefor returning only S12M.
Well, if you look at the code after preprocessing it looks like this: struct gptimer *gpt1_base = (struct gptimer *)0x48318000; ... cstart = (*(volatile unsigned int *)(&gpt1_base->tcrr)); ... cend = (*(volatile unsigned int *)(&gpt1_base->tcrr)); cdiff = cend - cstart; Eventually that simple definition of readl() is no longer good enough for recent compilers. There is probably a very good reason that Linux uses a "__iormb();" memory barrier in the definition of readl() and similar macros. We should probably update "arch/arm/include/asm/io.h" ... But then, I'm not an expert for ARM. 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 ... Jesus cried with a loud voice: Lazarus, come forth; the bug hath been found and thy program runneth. And he that was dead came forth... -- John 11:43-44 [version 2.0?] _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot