From: Oliver Upton <oupton@google.com>
To: linux-arm-kernel@lists.infradead.org
Cc: Marc Zyngier <maz@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Ricardo Koller <ricarkol@google.com>,
Reiji Watanabe <reijiw@google.com>,
Oliver Upton <oupton@google.com>
Subject: [boot-wrapper PATCH] configure: Allow user to specify the counter frequency
Date: Thu, 24 Feb 2022 04:49:47 +0000 [thread overview]
Message-ID: <20220224044947.980030-1-oupton@google.com> (raw)
The default counter frequency on certain models is not actually 24MHz.
For example, on the FVP Base RevC model, the default counter frequency
is 100MHz, and is user configurable. Users testing against an ARMv8.6
counter (1GHz) also need to override the default value.
Add an optional configuration option which allows users to specify the
counter frequency.
Signed-off-by: Oliver Upton <oupton@google.com>
---
Makefile.am | 1 -
configure.ac | 8 ++++++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
index 08e304a..c71c601 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -13,7 +13,6 @@ SCRIPT_DIR := $(top_srcdir)/scripts
PHYS_OFFSET := $(shell perl -I $(SCRIPT_DIR) $(SCRIPT_DIR)/findmem.pl $(KERNEL_DTB))
UART_BASE := $(shell perl -I $(SCRIPT_DIR) $(SCRIPT_DIR)/findbase.pl $(KERNEL_DTB) 0 'arm,pl011')
SYSREGS_BASE := $(shell perl -I $(SCRIPT_DIR) $(SCRIPT_DIR)/findbase.pl $(KERNEL_DTB) 0 'arm,vexpress-sysreg' 2> /dev/null)
-COUNTER_FREQ := 24000000
CPU_IDS := $(shell perl -I $(SCRIPT_DIR) $(SCRIPT_DIR)/findcpuids.pl $(KERNEL_DTB))
NR_CPUS := $(shell echo $(CPU_IDS) | tr ',' ' ' | wc -w)
diff --git a/configure.ac b/configure.ac
index 9e3b722..e7d086a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -118,6 +118,13 @@ AC_ARG_ENABLE([gicv3],
AM_CONDITIONAL([GICV3], [test "x$USE_GICV3" = "xyes"])
AS_IF([test "x$USE_GICV3" = "xyes"], [], [USE_GICV3=no])
+# Allow a user to set the exposed counter frequency
+C_COUNTER_FREQ=24000000
+AC_ARG_WITH([counter-frequency],
+ AS_HELP_STRING([--with-counter-frequency], [set counter frequency (in Hz)]),
+ [C_COUNTER_FREQ=$withval])
+AC_SUBST([COUNTER_FREQ], [$C_COUNTER_FREQ])
+
# Ensure that we have all the needed programs
AC_PROG_CC
AC_PROG_CPP
@@ -151,4 +158,5 @@ echo " Xen image ${XEN_IMAGE:-NONE}"
if test "x${XEN_IMAGE}" != "x"; then
echo " Xen command line: ${XEN_CMDLINE}"
fi
+echo " Counter frequency (Hz) ${COUNTER_FREQ}"
echo ""
--
2.35.1.473.g83b2b277ed-goog
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2022-02-24 4:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-24 4:49 Oliver Upton [this message]
2022-03-16 4:56 ` [boot-wrapper PATCH] configure: Allow user to specify the counter frequency Oliver Upton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220224044947.980030-1-oupton@google.com \
--to=oupton@google.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=maz@kernel.org \
--cc=reijiw@google.com \
--cc=ricarkol@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).