2 * S5PC210 Power/Clock debugging stuff
4 * Copyright (C) 2011 Samsung Electronics
7 #include <linux/kernel.h>
8 #include <linux/init.h>
10 #include <linux/platform_device.h>
11 #include <linux/seq_file.h>
12 #include <linux/debugfs.h>
15 #include <plat/devs.h>
17 #include <mach/regs-pmu.h>
18 #include <mach/regs-clock.h>
20 static const char *powerdomain_name[] = {
31 #define MAX_GATE_IP_NUM 17
33 static const char *clock_gate_ip[][MAX_GATE_IP_NUM] = {
35 "FIMC0", "FIMC1", "FIMC2", "FIMC3",
36 "CSIC0", "CSIS1", "JPEG", "SMMUFIMC0",
37 "SMMUFIMC1", "SMMUFIMC2", "SMMUFIMC3", "SMMUJPEG",
38 "QEFIMC0", "QEFIMC1", "QEFIMC2", "QEFIMC3",
41 "VP", "MIXER", "TVENC", "HDMI",
48 "FIMD0", "MIE0", "MDNIE0", "DSIM0",
49 "SMMUFIMD0", "PPMULCD0",
51 "FIMD1", "MIE1", "MDNIE1", "DSIM1",
52 "SMMUFIMD1", "PPMULCD1",
60 static int pd_show(struct seq_file *s, void *unused)
62 struct samsung_pd_info *spi;
63 struct s5pv310_pd_data *spd;
64 struct platform_device *p;
69 for (i = 0; i <= PD_GPS; i++) {
70 p = &s5pv310_device_pd[i];
75 spi = dev_get_platdata(&p->dev);
80 seq_printf(s, "ID %d %4s, ", p->id, powerdomain_name[i]);
81 seq_printf(s, "base 0x%x : 0x%x\n",
82 (u32) spi->base, __raw_readl(spi->base));
84 if (__raw_readl(spi->base) == 0)
109 val = __raw_readl(spd->clk_base);
110 for (start = 0; start < MAX_GATE_IP_NUM; start++) {
114 seq_printf(s, "%s, ", clock_gate_ip[i][start]);
121 seq_printf(s, "\tread_base 0x%x : 0x%x\n",
122 (u32) spd->read_base, __raw_readl(spd->read_base));
129 static int pd_open(struct inode *inode, struct file *file)
131 return single_open(file, pd_show, NULL);
134 static const struct file_operations pd_operations = {
138 .release = single_release,
141 static int __init pd_debugfs_init(void)
143 (void) debugfs_create_file("power-debug", S_IFREG | S_IRUGO,
144 NULL, NULL, &pd_operations);
148 late_initcall(pd_debugfs_init);