aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-s3c24xx/s3c2410-iotiming.c
diff options
context:
space:
mode:
authorBen Dooks <ben@simtec.co.uk>2009-07-30 18:23:42 -0400
committerBen Dooks <ben-linux@fluff.org>2009-07-30 18:22:56 -0400
commite6d197a6954c8a9ff85727c31ca61fc1da78628a (patch)
tree4f83b37f17499111ae9381746b3427996eb75007 /arch/arm/plat-s3c24xx/s3c2410-iotiming.c
parentdfff4e95d749c414af3f7350835139103408a50d (diff)
ARM: S3C: CPUFREQ: Add debugfs support for cpufreq
Add debugfs support for the cpufreq driver to allow information about the system state to be exported to the user. Signed-off-by: Ben Dooks <ben@simtec.co.uk> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/plat-s3c24xx/s3c2410-iotiming.c')
-rw-r--r--arch/arm/plat-s3c24xx/s3c2410-iotiming.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/arch/arm/plat-s3c24xx/s3c2410-iotiming.c b/arch/arm/plat-s3c24xx/s3c2410-iotiming.c
index 26fe2129cf25..d0a3a145cd4d 100644
--- a/arch/arm/plat-s3c24xx/s3c2410-iotiming.c
+++ b/arch/arm/plat-s3c24xx/s3c2410-iotiming.c
@@ -15,6 +15,7 @@
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/errno.h> 16#include <linux/errno.h>
17#include <linux/cpufreq.h> 17#include <linux/cpufreq.h>
18#include <linux/seq_file.h>
18#include <linux/io.h> 19#include <linux/io.h>
19 20
20#include <mach/map.h> 21#include <mach/map.h>
@@ -304,6 +305,50 @@ void s3c2410_iotiming_getbank(struct s3c_cpufreq_config *cfg,
304} 305}
305 306
306/** 307/**
308 * s3c2410_iotiming_debugfs - debugfs show io bank timing information
309 * @seq: The seq_file to write output to using seq_printf().
310 * @cfg: The current configuration.
311 * @iob: The IO bank information to decode.
312 */
313void s3c2410_iotiming_debugfs(struct seq_file *seq,
314 struct s3c_cpufreq_config *cfg,
315 union s3c_iobank *iob)
316{
317 struct s3c2410_iobank_timing *bt = iob->io_2410;
318 unsigned long bankcon = bt->bankcon;
319 unsigned long hclk = cfg->freq.hclk_tns;
320 unsigned int tacs;
321 unsigned int tcos;
322 unsigned int tacc;
323 unsigned int tcoh;
324 unsigned int tcah;
325
326 seq_printf(seq, "BANKCON=0x%08lx\n", bankcon);
327
328 tcah = get_0124(hclk, bankcon >> S3C2410_BANKCON_Tcah_SHIFT);
329 tcoh = get_0124(hclk, bankcon >> S3C2410_BANKCON_Tcoh_SHIFT);
330 tcos = get_0124(hclk, bankcon >> S3C2410_BANKCON_Tcos_SHIFT);
331 tacs = get_0124(hclk, bankcon >> S3C2410_BANKCON_Tacs_SHIFT);
332 tacc = get_tacc(hclk, bankcon >> S3C2410_BANKCON_Tacc_SHIFT);
333
334 seq_printf(seq,
335 "\tRead: Tacs=%d.%d, Tcos=%d.%d, Tacc=%d.%d, Tcoh=%d.%d, Tcah=%d.%d\n",
336 print_ns(bt->tacs),
337 print_ns(bt->tcos),
338 print_ns(bt->tacc),
339 print_ns(bt->tcoh),
340 print_ns(bt->tcah));
341
342 seq_printf(seq,
343 "\t Set: Tacs=%d.%d, Tcos=%d.%d, Tacc=%d.%d, Tcoh=%d.%d, Tcah=%d.%d\n",
344 print_ns(tacs),
345 print_ns(tcos),
346 print_ns(tacc),
347 print_ns(tcoh),
348 print_ns(tcah));
349}
350
351/**
307 * s3c2410_iotiming_calc - Calculate bank timing for frequency change. 352 * s3c2410_iotiming_calc - Calculate bank timing for frequency change.
308 * @cfg: The frequency configuration 353 * @cfg: The frequency configuration
309 * @iot: The IO timing information to fill out. 354 * @iot: The IO timing information to fill out.