ARM: Expose some PMON registers through sysfs
authorMans Rullgard <mans@mansr.com>
Sat, 28 Mar 2009 13:05:02 +0000 (13:05 +0000)
committerGrazvydas Ignotas <notasas@gmail.com>
Sat, 14 Jan 2012 00:01:05 +0000 (02:01 +0200)
arch/arm/kernel/sysfs_v7.c

index f3654ae..fcafe95 100644 (file)
@@ -124,6 +124,12 @@ static ssize_t l2_aux_ctl_store(struct sys_device *dev,
 static SYSDEV_ATTR(l2_aux_control, S_IRUGO|L2AUX_WR,
                   l2_aux_ctl_show, l2_aux_ctl_store);
 
+RDWR_REG(pmon_pmnc,   0, c9, c12, 0, 0x3f)
+RDWR_REG(pmon_cntens, 0, c9, c12, 1, 0x8000000f)
+RDWR_REG(pmon_cntenc, 0, c9, c12, 2, 0x8000000f)
+RDWR_REG(pmon_ccnt,   0, c9, c13, 0, 0xffffffff)
+RDWR_REG(pmon_useren, 0, c9, c14, 0, 1)
+
 #define REG_ATTR(sysdev, name)                                         \
        do {                                                            \
                int err = sysfs_create_file(&sysdev->kobj, &name.attr); \
@@ -140,6 +146,11 @@ static int __init cpu_sysfs_init(void)
                REG_ATTR(sysdev, attr_control);
                REG_ATTR(sysdev, attr_aux_control);
                REG_ATTR(sysdev, attr_l2_aux_control);
+               REG_ATTR(sysdev, attr_pmon_pmnc);
+               REG_ATTR(sysdev, attr_pmon_cntens);
+               REG_ATTR(sysdev, attr_pmon_cntenc);
+               REG_ATTR(sysdev, attr_pmon_ccnt);
+               REG_ATTR(sysdev, attr_pmon_useren);
        }
 
        return 0;