Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/evbarm/rpi Get the CPU frequency and set cpu_cc_freq.



details:   https://anonhg.NetBSD.org/src/rev/cdeb4f5b9f9d
branches:  trunk
changeset: 783409:cdeb4f5b9f9d
user:      skrll <skrll%NetBSD.org@localhost>
date:      Wed Dec 19 15:49:47 2012 +0000

description:
Get the CPU frequency and set cpu_cc_freq.

diffstat:

 sys/arch/evbarm/rpi/rpi_machdep.c |  16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diffs (51 lines):

diff -r 17e6c11a08c8 -r cdeb4f5b9f9d sys/arch/evbarm/rpi/rpi_machdep.c
--- a/sys/arch/evbarm/rpi/rpi_machdep.c Wed Dec 19 15:05:16 2012 +0000
+++ b/sys/arch/evbarm/rpi/rpi_machdep.c Wed Dec 19 15:49:47 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rpi_machdep.c,v 1.18 2012/10/30 20:14:22 skrll Exp $   */
+/*     $NetBSD: rpi_machdep.c,v 1.19 2012/12/19 15:49:47 skrll Exp $   */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rpi_machdep.c,v 1.18 2012/10/30 20:14:22 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rpi_machdep.c,v 1.19 2012/12/19 15:49:47 skrll Exp $");
 
 #include "opt_evbarm_boardtype.h"
 
@@ -130,6 +130,7 @@
        struct vcprop_tag_boardserial   vbt_serial;
        struct vcprop_tag_cmdline       vbt_cmdline;
        struct vcprop_tag_clockrate     vbt_emmcclockrate;
+       struct vcprop_tag_clockrate     vbt_armclockrate;
        struct vcprop_tag end;
 } vb __packed __aligned(16) =
 {
@@ -194,6 +195,14 @@
                },
                .id = VCPROP_CLK_EMMC
        },
+       .vbt_armclockrate = {
+               .tag = {
+                       .vpt_tag = VCPROPTAG_GET_CLOCKRATE,
+                       .vpt_len = VCPROPTAG_LEN(vb.vbt_armclockrate),
+                       .vpt_rcode = VCPROPTAG_REQUEST
+               },
+               .id = VCPROP_CLK_ARM
+       },
        .end = {
                .vpt_tag = VCPROPTAG_NULL
        }
@@ -239,6 +248,9 @@
                        bootconfig.dramblocks++;
                }
        }
+       
+       if (vcprop_tag_success_p(&vb.vbt_armclockrate.tag))
+               curcpu()->ci_data.cpu_cc_freq = vb.vbt_armclockrate.rate;
 
 #ifdef VERBOSE_INIT_ARM
        if (vcprop_tag_success_p(&vb.vbt_fwrev.tag))



Home | Main Index | Thread Index | Old Index