summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorTony Lin <tony.lin@freescale.com>2011-01-11 18:01:03 +0800
committerTony Lin <tony.lin@freescale.com>2011-01-18 11:02:44 +0800
commit0a5db19dd3ae3f43c3df5b99b8e2068043759502 (patch)
tree47982e260db6e5851225614f42bffc378978d25d /arch
parent6319945be2e578cb55374f0881f865bad547f62a (diff)
ENGR00137979-1 [MX28]add performance monitor driver
enable performance monitor driver for system loading analysis Signed-off-by: Tony Lin <tony.lin@freescale.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/configs/imx28evk_defconfig1
-rw-r--r--arch/arm/mach-mx28/device.c48
-rw-r--r--arch/arm/plat-mxs/device.c20
3 files changed, 67 insertions, 2 deletions
diff --git a/arch/arm/configs/imx28evk_defconfig b/arch/arm/configs/imx28evk_defconfig
index 0d01c03b7340..8454a851caea 100644
--- a/arch/arm/configs/imx28evk_defconfig
+++ b/arch/arm/configs/imx28evk_defconfig
@@ -672,6 +672,7 @@ CONFIG_MXS_PERSISTENT=y
# CONFIG_ANDROID_PMEM is not set
# CONFIG_UID_STAT is not set
# CONFIG_C2PORT is not set
+CONFIG_MXS_PERFMON=y
#
# EEPROM support
diff --git a/arch/arm/mach-mx28/device.c b/arch/arm/mach-mx28/device.c
index f0083466ea3e..410928fc7d32 100644
--- a/arch/arm/mach-mx28/device.c
+++ b/arch/arm/mach-mx28/device.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright (C) 2009-2011 Freescale Semiconductor, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1518,6 +1518,51 @@ static void mx28_init_persistent()
}
#endif
+#if defined(CONFIG_MXS_PERFMON)
+
+static struct mxs_perfmon_bit_config
+mx28_perfmon_bit_config[] = {
+ {.field = (1 << 0), .name = "MID0-PXP" },
+ {.field = (1 << 1), .name = "MID1-LCDIF" },
+ {.field = (1 << 2), .name = "MID2-BCH" },
+ {.field = (1 << 3), .name = "MID3-DCP" }
+};
+
+static struct mxs_platform_perfmon_data mx28_perfmon_data = {
+ .bit_config_tab = mx28_perfmon_bit_config,
+ .bit_config_cnt = ARRAY_SIZE(mx28_perfmon_bit_config),
+};
+
+static struct resource mx28_perfmon_res[] = {
+ {
+ .flags = IORESOURCE_MEM,
+ .start = PERFMON_PHYS_ADDR,
+ .end = PERFMON_PHYS_ADDR + 0x1000 - 1,
+ },
+};
+
+static void mx28_init_perfmon(void)
+{
+ struct platform_device *pdev;
+
+ pdev = mxs_get_device("mxs-perfmon", 0);
+ if (pdev == NULL || IS_ERR(pdev))
+ return;
+ pdev->dev.platform_data = &mx28_perfmon_data;
+ pdev->resource = mx28_perfmon_res,
+ pdev->num_resources = ARRAY_SIZE(mx28_perfmon_res),
+ mxs_add_device(pdev, 3);
+}
+
+#else
+
+static void mx28_init_perfmon()
+{
+}
+
+#endif
+
+
#if defined(CONFIG_FSL_OTP)
/* Building up eight registers's names of a bank */
#define BANK(a, b, c, d, e, f, g, h) \
@@ -1587,6 +1632,7 @@ int __init mx28_device_init(void)
mx28_init_dcp();
mx28_init_battery();
mx28_init_persistent();
+ mx28_init_perfmon();
mx28_init_otp();
return 0;
}
diff --git a/arch/arm/plat-mxs/device.c b/arch/arm/plat-mxs/device.c
index e3783d3fe87d..87a38fa8c3d8 100644
--- a/arch/arm/plat-mxs/device.c
+++ b/arch/arm/plat-mxs/device.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright (C) 2009-2011 Freescale Semiconductor, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -485,6 +485,16 @@ static struct platform_device mxs_persistent = {
};
#endif
+#ifdef CONFIG_MXS_PERFMON
+static struct platform_device mxs_perfmon = {
+ .name = "mxs-perfmon",
+ .id = 0,
+ .dev = {
+ .release = mxs_nop_release,
+ },
+};
+#endif
+
#ifdef CONFIG_FSL_OTP
static struct platform_device otp_device = {
.name = "ocotp",
@@ -576,6 +586,14 @@ static struct mxs_dev_lookup dev_lookup[] = {
},
#endif
+#if defined(CONFIG_MXS_PERFMON)
+ {
+ .name = "mxs-perfmon",
+ .size = 1,
+ .pdev = &mxs_perfmon,
+ },
+#endif
+
#if defined(CONFIG_FSL_OTP)
{
.name = "ocotp",