]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
timer: sandbox: Use device tree to pass the clock frequency
authorBin Meng <bmeng.cn@gmail.com>
Fri, 13 Nov 2015 08:11:17 +0000 (00:11 -0800)
committerSimon Glass <sjg@chromium.org>
Tue, 1 Dec 2015 13:23:51 +0000 (06:23 -0700)
We should use device tree to pass the clock frequency of the timer
instead of hardcoded in the driver codes.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
arch/sandbox/dts/sandbox.dts
drivers/timer/sandbox_timer.c

index 720ef932ff71d55b798d3104a8f11f0d240ae59f..d2addb4cf0ba0d8066e809ac7abbbc53569a69bf 100644 (file)
 
        timer {
                compatible = "sandbox,timer";
+               clock-frequency = <1000000>;
        };
 
        tpm {
index 38de76365c020cc7590927bc7110b18ea9e2383f..4b20af222885f6139438a0c87b92bd5388cc45e5 100644 (file)
@@ -27,10 +27,6 @@ static int sandbox_timer_get_count(struct udevice *dev, unsigned long *count)
 
 static int sandbox_timer_probe(struct udevice *dev)
 {
-       struct timer_dev_priv *uc_priv = dev_get_uclass_priv(dev);
-
-       uc_priv->clock_rate = 1000000;
-
        return 0;
 }