linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [boot-wrapper PATCH] configure: Allow user to specify the counter frequency
@ 2022-02-24  4:49 Oliver Upton
  2022-03-16  4:56 ` Oliver Upton
  0 siblings, 1 reply; 2+ messages in thread
From: Oliver Upton @ 2022-02-24  4:49 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Marc Zyngier, Mark Rutland, Ricardo Koller, Reiji Watanabe, Oliver Upton

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [boot-wrapper PATCH] configure: Allow user to specify the counter frequency
  2022-02-24  4:49 [boot-wrapper PATCH] configure: Allow user to specify the counter frequency Oliver Upton
@ 2022-03-16  4:56 ` Oliver Upton
  0 siblings, 0 replies; 2+ messages in thread
From: Oliver Upton @ 2022-03-16  4:56 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Marc Zyngier, Mark Rutland, Ricardo Koller, Reiji Watanabe

On Thu, Feb 24, 2022 at 04:49:47AM +0000, Oliver Upton wrote:
> 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
> 

Friendly ping :)

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-16  4:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-24  4:49 [boot-wrapper PATCH] configure: Allow user to specify the counter frequency Oliver Upton
2022-03-16  4:56 ` Oliver Upton

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).