1 /* linux/arch/arm/mach-s5pv310/ppc.c
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
6 * S5PV310 - PPMU support
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
13 #include <linux/types.h>
14 #include <linux/kernel.h>
15 #include <linux/err.h>
19 #include <mach/regs-clock.h>
20 #include <mach/ppmu.h>
22 void s5pv310_ppc_reset(struct s5pv310_ppmu_hw *ppmu)
24 void __iomem *ppmu_base = ppmu->hw_base;
26 __raw_writel(0x8000000f, ppmu_base + 0xf010);
27 __raw_writel(0x8000000f, ppmu_base + 0xf050);
28 __raw_writel(0x6, ppmu_base + 0xf000);
29 __raw_writel(0x0, ppmu_base + 0xf100);
39 void s5pv310_ppc_setevent(struct s5pv310_ppmu_hw *ppmu,
42 void __iomem *ppmu_base = ppmu->hw_base;
46 __raw_writel(((evt << 12) | 0x1), ppmu_base + 0xfc);
49 void s5pv310_ppc_start(struct s5pv310_ppmu_hw *ppmu)
51 void __iomem *ppmu_base = ppmu->hw_base;
53 __raw_writel(0x1, ppmu_base + 0xf000);
56 void s5pv310_ppc_stop(struct s5pv310_ppmu_hw *ppmu)
58 void __iomem *ppmu_base = ppmu->hw_base;
60 __raw_writel(0x0, ppmu_base + 0xf000);
63 void s5pv310_ppc_update(struct s5pv310_ppmu_hw *ppmu)
65 void __iomem *ppmu_base = ppmu->hw_base;
68 ppmu->ccnt = __raw_readl(ppmu_base + 0xf100);
70 for (i = 0; i < NUMBER_OF_COUNTER; i++) {
72 __raw_readl(ppmu_base + (0xf110 + (0x10 * i)));