| 1 | #include <linux/kernel.h> |
| 2 | #include <linux/module.h> |
| 3 | #include <linux/version.h> |
| 4 | |
| 5 | #include <ifxmips.h> |
| 6 | |
| 7 | void |
| 8 | ifxmips_pmu_enable(unsigned int module) |
| 9 | { |
| 10 | int err = 1000000; |
| 11 | |
| 12 | ifxmips_w32(ifxmips_r32(IFXMIPS_PMU_PWDCR) & ~module, IFXMIPS_PMU_PWDCR); |
| 13 | while (--err && (ifxmips_r32(IFXMIPS_PMU_PWDSR) & module)); |
| 14 | |
| 15 | if (!err) |
| 16 | panic("activating PMU module failed!"); |
| 17 | } |
| 18 | EXPORT_SYMBOL(ifxmips_pmu_enable); |
| 19 | |
| 20 | void |
| 21 | ifxmips_pmu_disable(unsigned int module) |
| 22 | { |
| 23 | ifxmips_w32(ifxmips_r32(IFXMIPS_PMU_PWDCR) | module, IFXMIPS_PMU_PWDCR); |
| 24 | } |
| 25 | EXPORT_SYMBOL(ifxmips_pmu_disable); |
| 26 | |