aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorDavid E. Box <david.e.box@linux.intel.com>2014-09-18 01:13:51 -0400
committerIngo Molnar <mingo@kernel.org>2014-09-19 07:08:43 -0400
commited2226bd4d4a53bcc3b2ea0b1b28e955ebc15da7 (patch)
tree8b5892beccf4c7985a914bf7c96742aebf3dbf22 /arch/x86
parentced3ce760b8df08e8bafba44f6b40407df2d0402 (diff)
x86/platform/intel/iosf: Add debugfs config option for IOSF
Makes the IOSF sideband available through debugfs. Allows developers to experiment with using the sideband to provide debug and analytical tools for units on the SoC. Signed-off-by: David E. Box <david.e.box@linux.intel.com> Link: http://lkml.kernel.org/r/1411017231-20807-4-git-send-email-david.e.box@linux.intel.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/Kconfig13
-rw-r--r--arch/x86/kernel/iosf_mbi.c23
2 files changed, 32 insertions, 4 deletions
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index d6334f489214..6354964ff949 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -496,6 +496,19 @@ config IOSF_MBI
496 496
497 You should say Y if you are running a kernel on one of these SoC's. 497 You should say Y if you are running a kernel on one of these SoC's.
498 498
499config IOSF_MBI_DEBUG
500 bool "Enable IOSF sideband access through debugfs"
501 depends on IOSF_MBI && DEBUG_FS
502 ---help---
503 Select this option to expose the IOSF sideband access registers (MCR,
504 MDR, MCRX) through debugfs to write and read register information from
505 different units on the SoC. This is most useful for obtaining device
506 state information for debug and analysis. As this is a general access
507 mechanism, users of this option would have specific knowledge of the
508 device they want to access.
509
510 If you don't require the option or are in doubt, say N.
511
499config X86_RDC321X 512config X86_RDC321X
500 bool "RDC R-321x SoC" 513 bool "RDC R-321x SoC"
501 depends on X86_32 514 depends on X86_32
diff --git a/arch/x86/kernel/iosf_mbi.c b/arch/x86/kernel/iosf_mbi.c
index e01f7414b5e7..82f8d02f0df2 100644
--- a/arch/x86/kernel/iosf_mbi.c
+++ b/arch/x86/kernel/iosf_mbi.c
@@ -190,7 +190,7 @@ bool iosf_mbi_available(void)
190} 190}
191EXPORT_SYMBOL(iosf_mbi_available); 191EXPORT_SYMBOL(iosf_mbi_available);
192 192
193/********************** debugfs begin ****************************/ 193#ifdef CONFIG_IOSF_MBI_DEBUG
194static u32 dbg_mdr; 194static u32 dbg_mdr;
195static u32 dbg_mcr; 195static u32 dbg_mcr;
196static u32 dbg_mcrx; 196static u32 dbg_mcrx;
@@ -229,6 +229,7 @@ static int mcr_set(void *data, u64 val)
229DEFINE_SIMPLE_ATTRIBUTE(iosf_mcr_fops, mcr_get, mcr_set , "%llx\n"); 229DEFINE_SIMPLE_ATTRIBUTE(iosf_mcr_fops, mcr_get, mcr_set , "%llx\n");
230 230
231static struct dentry *iosf_dbg; 231static struct dentry *iosf_dbg;
232
232static void iosf_sideband_debug_init(void) 233static void iosf_sideband_debug_init(void)
233{ 234{
234 struct dentry *d; 235 struct dentry *d;
@@ -257,7 +258,20 @@ static void iosf_sideband_debug_init(void)
257cleanup: 258cleanup:
258 debugfs_remove_recursive(d); 259 debugfs_remove_recursive(d);
259} 260}
260/********************** debugfs end ****************************/ 261
262static void iosf_debugfs_init(void)
263{
264 iosf_sideband_debug_init();
265}
266
267static void iosf_debugfs_remove(void)
268{
269 debugfs_remove_recursive(iosf_dbg);
270}
271#else
272static inline void iosf_debugfs_init(void) { }
273static inline void iosf_debugfs_remove(void) { }
274#endif /* CONFIG_IOSF_MBI_DEBUG */
261 275
262static int iosf_mbi_probe(struct pci_dev *pdev, 276static int iosf_mbi_probe(struct pci_dev *pdev,
263 const struct pci_device_id *unused) 277 const struct pci_device_id *unused)
@@ -290,13 +304,14 @@ static struct pci_driver iosf_mbi_pci_driver = {
290 304
291static int __init iosf_mbi_init(void) 305static int __init iosf_mbi_init(void)
292{ 306{
293 iosf_sideband_debug_init(); 307 iosf_debugfs_init();
308
294 return pci_register_driver(&iosf_mbi_pci_driver); 309 return pci_register_driver(&iosf_mbi_pci_driver);
295} 310}
296 311
297static void __exit iosf_mbi_exit(void) 312static void __exit iosf_mbi_exit(void)
298{ 313{
299 debugfs_remove_recursive(iosf_dbg); 314 iosf_debugfs_remove();
300 315
301 pci_unregister_driver(&iosf_mbi_pci_driver); 316 pci_unregister_driver(&iosf_mbi_pci_driver);
302 if (mbi_pdev) { 317 if (mbi_pdev) {