From patchwork Thu Feb 24 04:49:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver Upton X-Patchwork-Id: 12757839 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E7A16C433EF for ; Thu, 24 Feb 2022 04:51:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Mime-Version: Message-Id:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=0bdDsp1y2tL5iXGnI6cwSgn8fOkAV32mcxTdd+wm32Y=; b=jWE OFDIUepDoxI5+hJLlnzjhFkZnRwzo/NajyMlmNR7KN3gCPfKtLU0vnsmWQVI0HfNeVw79Yz4K4JsY RcTsRN0mnqVJpjc16oWdatEV0qh+vAwBSxI4pI3+JO1t8yc5hKQ6E0HrTRlafoJvD0xu3o8JuGXOD ER19ZYPQfglC4IR3/hdLQ55bva5BViUsHKuzqXJhVLzkcKyHjlzTOqgBDRugg8/m7BmmErydr1xPX 0s14RMo3HQsEHmsDqyQ7Q19niv4a0IFN8t54q3qdd/OMjyboXuWT1d1xJDoE0Cb/R+vkELuVzgeh0 wr/5/Dl1BLR5dEWcxorKjXITFYUgXwQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nN64t-00GnaU-CO; Thu, 24 Feb 2022 04:50:07 +0000 Received: from mail-io1-xd4a.google.com ([2607:f8b0:4864:20::d4a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nN64m-00GnZi-ER for linux-arm-kernel@lists.infradead.org; Thu, 24 Feb 2022 04:50:04 +0000 Received: by mail-io1-xd4a.google.com with SMTP id x16-20020a6bfe10000000b006409f03e39eso822100ioh.7 for ; Wed, 23 Feb 2022 20:49:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc; bh=MrmEhtY6smNQGB81I8757kEPrv13vrbuTq5Mn+F/vfE=; b=AtJaOZp7CAHq5zknUgv/5pbcZSsr7XNF3CYVtcDfXjg5Y+/0sRla8XSxcsTvWIDsKb uXorTZsWZ6nrF1Bgxsvr0qwXYP5sETs6JKtM/nc6ydCY5DOyGYvIRNTaiMMblt6L2a1g qv88fGAopK+W2pOOHB8+cB/6ff0/z2FyyDdMK92GsvJLVzfDeFxuAMeNXhD6TDCTAkKr P1jfudK3893I2uRemIjfktuHzG6PhLQgHinoVBgxZcs2xMhUcSxDZuqmnOJ4+y8c+iDu 1oANQZjLD2y2Ah/kWJz2VAmK7EgbYHx9iXJtoRcSYVD6LkXH4YKEhTEo8NjOBsQW9iKB lSVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=MrmEhtY6smNQGB81I8757kEPrv13vrbuTq5Mn+F/vfE=; b=PaEDJHleROi8toEISvpvgH1kmX/iGidiUT/oMTDF5owaR9KXmFDV+J7KAsHWWal6tK WYjGzpXn4R03KNDezEGyH23/7svzHhQZzaKh1dsKYRx0YHblu5bNEwYrms+NarcTDS/J 6q3YIIEnDwLLFDRWyYXmQlZb9u4BAQToUlIgTuFguh8R9uuzfAmYusX9CfgOg/VNhunH DTQdHP3VZOiwPg6Hyvv6xGVSnsS80jrtKt2T/7S6OGijzjBDvCbpQLhOD17e3SUc/MOB bYJgf/ig5KPzdRpGDHGiiFJi5svm7yRn7BbpiCj+zodZKNX/xfbKXteko6LQX2G+KqDn hBhQ== X-Gm-Message-State: AOAM533/iql1IPVwyDsU9lPGgcEwvTGp597NZ8yOTBBGEKJL4YE4/zBF bRw4Gx9X3UJgKOOztYFxALIpuP5Vt2goAnZfGEfI7i4LbO3NHC3DLyPBFEZS1J2PIdteBOHCreu edYx4KaCAxi9QnjX9stxv4R3+MOXkhg6mJ+Qo8+jXl5IJuFMkJqh86dAPwJj3RtAP8ilwX9T3M7 qV3Lw/ X-Google-Smtp-Source: ABdhPJx1XBLbGDyqnuo7xqpRCg3STpH4m8jdj5UkhcpQT6h5IA0HczkBxoxVh+XZKiy+kdrhQ6QJ+dEasmk= X-Received: from oupton.c.googlers.com ([fda3:e722:ac3:cc00:2b:ff92:c0a8:404]) (user=oupton job=sendgmr) by 2002:a05:6638:22c3:b0:30f:88b:e546 with SMTP id j3-20020a05663822c300b0030f088be546mr748479jat.247.1645678198274; Wed, 23 Feb 2022 20:49:58 -0800 (PST) Date: Thu, 24 Feb 2022 04:49:47 +0000 Message-Id: <20220224044947.980030-1-oupton@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.35.1.473.g83b2b277ed-goog Subject: [boot-wrapper PATCH] configure: Allow user to specify the counter frequency From: Oliver Upton To: linux-arm-kernel@lists.infradead.org Cc: Marc Zyngier , Mark Rutland , Ricardo Koller , Reiji Watanabe , Oliver Upton X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220223_205000_514746_66DF6E01 X-CRM114-Status: GOOD ( 12.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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 ""