[PATCH 07/61] bootwrapper: Set timebase_period_ns from dt_fixup_cpu_clocks.

Scott Wood scottwood at freescale.com
Wed Jul 18 11:33:04 EST 2007


This lets udelay() work properly on platforms which use dt_fixup_cpu_clocks.

Signed-off-by: Scott Wood <scottwood at freescale.com>
---
 arch/powerpc/boot/devtree.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/boot/devtree.c b/arch/powerpc/boot/devtree.c
index c995155..3465d3f 100644
--- a/arch/powerpc/boot/devtree.c
+++ b/arch/powerpc/boot/devtree.c
@@ -61,6 +61,7 @@ void dt_fixup_memory(u64 start, u64 size)
 
 void dt_fixup_cpu_clocks(u32 cpu, u32 tb, u32 bus)
 {
+	extern unsigned long timebase_period_ns;
 	void *devp = NULL;
 
 	printf("CPU clock-frequency <- 0x%x (%dMHz)\n\r", cpu, MHZ(cpu));
@@ -74,6 +75,8 @@ void dt_fixup_cpu_clocks(u32 cpu, u32 tb, u32 bus)
 		if (bus > 0)
 			setprop_val(devp, "bus-frequency", bus);
 	}
+
+	timebase_period_ns = 1000000000 / tb;
 }
 
 void dt_fixup_clock(const char *path, u32 freq)
-- 
1.5.0.3




More information about the Linuxppc-dev mailing list