summaryrefslogtreecommitdiffstats
path: root/sys/arm
diff options
context:
space:
mode:
authorrpaulo <rpaulo@FreeBSD.org>2009-12-23 23:16:54 +0000
committerrpaulo <rpaulo@FreeBSD.org>2009-12-23 23:16:54 +0000
commitf7db53a9d138b86810b2eec364678ab67ad0ba30 (patch)
tree1507605c16579edd0e3cdad97219adbea0eb689e /sys/arm
parentd4cee572d1358ddf0158d0bd1caeef07c0304584 (diff)
downloadFreeBSD-src-f7db53a9d138b86810b2eec364678ab67ad0ba30.zip
FreeBSD-src-f7db53a9d138b86810b2eec364678ab67ad0ba30.tar.gz
Intel XScale hwpmc(4) support.
This brings hwpmc(4) support for 2nd and 3rd generation XScale cores. Right now it's enabled by default to make sure we test this a bit. When the time comes it can be disabled by default. Tested on Gateworks boards. A man page is coming. Obtained from: //depot/user/rpaulo/xscalepmc/...
Diffstat (limited to 'sys/arm')
-rw-r--r--sys/arm/conf/AVILA4
-rw-r--r--sys/arm/conf/CAMBRIA4
-rw-r--r--sys/arm/include/pmc_mdep.h48
-rw-r--r--sys/arm/xscale/ixp425/files.ixp4251
4 files changed, 51 insertions, 6 deletions
diff --git a/sys/arm/conf/AVILA b/sys/arm/conf/AVILA
index b477618..b665659 100644
--- a/sys/arm/conf/AVILA
+++ b/sys/arm/conf/AVILA
@@ -61,6 +61,10 @@ options BOOTP_COMPAT
#options PREEMPTION
#options VERBOSE_SYSINIT
+# Hardware performance counters
+options HWPMC_HOOKS
+device hwpmc
+
#device saarm
device pci
diff --git a/sys/arm/conf/CAMBRIA b/sys/arm/conf/CAMBRIA
index 151c6f6..4de9b2c 100644
--- a/sys/arm/conf/CAMBRIA
+++ b/sys/arm/conf/CAMBRIA
@@ -58,6 +58,10 @@ options BOOTP_NFSV3
options BOOTP_WIRED_TO=npe0
options BOOTP_COMPAT
+# Hardware performance counters
+options HWPMC_HOOKS
+device hwpmc
+
#options VERBOSE_SYSINIT
options VERBOSE_INIT_ARM
diff --git a/sys/arm/include/pmc_mdep.h b/sys/arm/include/pmc_mdep.h
index 9c719cb..115d4fe 100644
--- a/sys/arm/include/pmc_mdep.h
+++ b/sys/arm/include/pmc_mdep.h
@@ -1,5 +1,27 @@
/*-
- * This file is in the public domain.
+ * Copyright (c) 2009 Rui Paulo <rpaulo@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*
* $FreeBSD$
*/
@@ -7,6 +29,14 @@
#ifndef _MACHINE_PMC_MDEP_H_
#define _MACHINE_PMC_MDEP_H_
+#define PMC_MDEP_CLASS_INDEX_XSCALE 0
+/*
+ * On the ARM platform we support the following PMCs.
+ *
+ * XSCALE Intel XScale processors
+ */
+#include <dev/hwpmc/hwpmc_xscale.h>
+
union pmc_md_op_pmcallocate {
uint64_t __pad[4];
};
@@ -15,14 +45,20 @@ union pmc_md_op_pmcallocate {
#define PMCLOG_READADDR PMCLOG_READ32
#define PMCLOG_EMITADDR PMCLOG_EMIT32
-#if _KERNEL
+#ifdef _KERNEL
union pmc_md_pmc {
+ struct pmc_md_xscale_pmc pm_xscale;
};
-#define PMC_TRAPFRAME_TO_PC(TF) (0) /* Stubs */
-#define PMC_TRAPFRAME_TO_FP(TF) (0)
-#define PMC_TRAPFRAME_TO_SP(TF) (0)
+#define PMC_TRAPFRAME_TO_PC(TF) ((TF)->tf_pc)
+#define PMC_TRAPFRAME_TO_FP(TF) ((TF)->tf_usr_lr)
+#define PMC_TRAPFRAME_TO_SP(TF) ((TF)->tf_usr_sp)
-#endif
+/*
+ * Prototypes
+ */
+struct pmc_mdep *pmc_xscale_initialize(void);
+void pmc_xscale_finalize(struct pmc_mdep *_md);
+#endif /* _KERNEL */
#endif /* !_MACHINE_PMC_MDEP_H_ */
diff --git a/sys/arm/xscale/ixp425/files.ixp425 b/sys/arm/xscale/ixp425/files.ixp425
index 2ac7aca..13d5f52 100644
--- a/sys/arm/xscale/ixp425/files.ixp425
+++ b/sys/arm/xscale/ixp425/files.ixp425
@@ -16,6 +16,7 @@ arm/xscale/ixp425/uart_bus_ixp425.c optional uart
arm/xscale/ixp425/ixp425_a4x_space.c optional uart
arm/xscale/ixp425/ixp425_a4x_io.S optional uart
dev/cfi/cfi_bus_ixp4xx.c optional cfi
+dev/hwpmc/hwpmc_xscale.c optional hwpmc
dev/uart/uart_dev_ns8250.c optional uart
#
# NPE-based Ethernet support (requires qmgr also).
OpenPOWER on IntegriCloud