cxl: Provide debugfs access to PSL_DEBUG/XSL_DEBUG registers
PATCH 1/1 cxl: Provide debugfs access to PSL_DEBUG/XSL_DEBUG registers
Access to PSL/XSL_DEBUG registers on the adapter provides easy access to the debug facilities provided by PSL/XSL. So this patch adds two new files (debug, xsl-debug) to the cxl-adapter specific debugfs folder located at /sys/kernel/debugfs/cxl/card<n>, which will provide direct r/w access to corrosponding debug registers in the adapter config-space.
--- drivers/misc/cxl/cxl.h | 1 + drivers/misc/cxl/debugfs.c | 4 ++++ 2 files changed, 5 insertions(+)
drivers/misc/cxl/cxl.h +1 -0
@@ -100,6 +100,7 @@ static const cxl_p1_reg_t CXL_XSL_FEC = {0x0158};static const cxl_p1_reg_t CXL_XSL_DSNCTL = {0x0168 };/* PSL registers - CAIA 2 */ static const cxl_p1_reg_t CXL_PSL9_CONTROL = {0x0020 }; +static const cxl_p1_reg_t CXL_XSL9_DBG = {0x0130 };static const cxl_p1_reg_t CXL_XSL9_DSNCTL = {0x0168 };static const cxl_p1_reg_t CXL_PSL9_FIR1 = {0x0300 };static const cxl_p1_reg_t CXL_PSL9_FIR2 = {0x0308 };
drivers/misc/cxl/debugfs.c +4 -0
@@ -65,6 +65,10 @@ void cxl_debugfs_add_adapter_regs_psl9(struct cxl *adapter, struct dentry *dir)debugfs_create_io_x64 ("fir2" ,S_IRUSR , dir,_cxl_p1_addr (adapter,CXL_PSL9_FIR2 ));debugfs_create_io_x64 ("fir_cntl" ,S_IRUSR , dir,_cxl_p1_addr (adapter,CXL_PSL9_FIR_CNTL ));debugfs_create_io_x64 ("trace" ,S_IRUSR |S_IWUSR , dir,_cxl_p1_addr (adapter,CXL_PSL9_TRACECFG )); +debugfs_create_io_x64 ("debug" ,0600 , dir, +_cxl_p1_addr (adapter,CXL_PSL9_DEBUG )); +debugfs_create_io_x64 ("xsl-debug" ,0600 , dir, +_cxl_p1_addr (adapter,CXL_XSL9_DBG )); }void cxl_debugfs_add_adapter_regs_psl8 (struct cxl *adapter,struct dentry *dir)
Signature · 1 line
2.13.5
Quoted 8 lines · Vaibhav Jain
Access to PSL/XSL_DEBUG registers on the adapter provides easy access to the debug facilities provided by PSL/XSL. So this patch adds two new files (debug, xsl-debug) to the cxl-adapter specific debugfs folder located at /sys/kernel/debugfs/cxl/card<n>, which will provide direct r/w access to corrosponding debug registers in the adapter config-space.
Signed-off-by Vaibhav Jain <[email protected]>
Quoted 33 lines
--- drivers/misc/cxl/cxl.h | 1 + drivers/misc/cxl/debugfs.c | 4 ++++ 2 files changed, 5 insertions(+)drivers/misc/cxl/cxl.h +1
-0@@ -100,6 +100,7 @@ static const cxl_p1_reg_t CXL_XSL_FEC = {0x0158};static const cxl_p1_reg_t CXL_XSL_DSNCTL = {0x0168 };/* PSL registers - CAIA 2 */ static const cxl_p1_reg_t CXL_PSL9_CONTROL = {0x0020 }; +static const cxl_p1_reg_t CXL_XSL9_DBG = {0x0130 };static const cxl_p1_reg_t CXL_XSL9_DSNCTL = {0x0168 };static const cxl_p1_reg_t CXL_PSL9_FIR1 = {0x0300 };static const cxl_p1_reg_t CXL_PSL9_FIR2 = {0x0308 };drivers/misc/cxl/debugfs.c +4
-0@@ -65,6 +65,10 @@ void cxl_debugfs_add_adapter_regs_psl9(struct cxl *adapter, struct dentry *dir)debugfs_create_io_x64 ("fir2" ,S_IRUSR , dir,_cxl_p1_addr (adapter,CXL_PSL9_FIR2 ));debugfs_create_io_x64 ("fir_cntl" ,S_IRUSR , dir,_cxl_p1_addr (adapter,CXL_PSL9_FIR_CNTL ));debugfs_create_io_x64 ("trace" ,S_IRUSR |S_IWUSR , dir,_cxl_p1_addr (adapter,CXL_PSL9_TRACECFG )); +debugfs_create_io_x64 ("debug" ,0600 , dir, +_cxl_p1_addr (adapter,CXL_PSL9_DEBUG )); +debugfs_create_io_x64 ("xsl-debug" ,0600 , dir, +_cxl_p1_addr (adapter,CXL_XSL9_DBG )); }void cxl_debugfs_add_adapter_regs_psl8 (struct cxl *adapter,struct dentry *dir)
Signature · 2 lines
Andrew Donnellan OzLabs, ADL Canberra [email protected] IBM Australia Limited
Le 20/09/2017 à 08:23, Vaibhav Jain a écrit :
Quoted 9 lines
Access to PSL/XSL_DEBUG registers on the adapter provides easy access to the debug facilities provided by PSL/XSL. So this patch adds two new files (debug, xsl-debug) to the cxl-adapter specific debugfs folder located at /sys/kernel/debugfs/cxl/card<n>, which will provide direct r/w access to corrosponding debug registers in the adapter config-space.
Signed-off-by Vaibhav Jain <[email protected]>---
Thanks!
Quoted 32 lines
drivers/misc/cxl/cxl.h | 1 + drivers/misc/cxl/debugfs.c | 4 ++++ 2 files changed, 5 insertions(+)drivers/misc/cxl/cxl.h +1
-0@@ -100,6 +100,7 @@ static const cxl_p1_reg_t CXL_XSL_FEC = {0x0158};static const cxl_p1_reg_t CXL_XSL_DSNCTL = {0x0168 };/* PSL registers - CAIA 2 */ static const cxl_p1_reg_t CXL_PSL9_CONTROL = {0x0020 }; +static const cxl_p1_reg_t CXL_XSL9_DBG = {0x0130 };static const cxl_p1_reg_t CXL_XSL9_DSNCTL = {0x0168 };static const cxl_p1_reg_t CXL_PSL9_FIR1 = {0x0300 };static const cxl_p1_reg_t CXL_PSL9_FIR2 = {0x0308 };drivers/misc/cxl/debugfs.c +4
-0@@ -65,6 +65,10 @@ void cxl_debugfs_add_adapter_regs_psl9(struct cxl *adapter, struct dentry *dir)debugfs_create_io_x64 ("fir2" ,S_IRUSR , dir,_cxl_p1_addr (adapter,CXL_PSL9_FIR2 ));debugfs_create_io_x64 ("fir_cntl" ,S_IRUSR , dir,_cxl_p1_addr (adapter,CXL_PSL9_FIR_CNTL ));debugfs_create_io_x64 ("trace" ,S_IRUSR |S_IWUSR , dir,_cxl_p1_addr (adapter,CXL_PSL9_TRACECFG )); +debugfs_create_io_x64 ("debug" ,0600 , dir, +_cxl_p1_addr (adapter,CXL_PSL9_DEBUG )); +debugfs_create_io_x64 ("xsl-debug" ,0600 , dir, +_cxl_p1_addr (adapter,CXL_XSL9_DBG )); }void cxl_debugfs_add_adapter_regs_psl8 (struct cxl *adapter,struct dentry *dir)
Michael Ellerman
AppliedQuoted 10 lines · Vaibhav Jain
Access to PSL/XSL_DEBUG registers on the adapter provides easy access to the debug facilities provided by PSL/XSL. So this patch adds two new files (debug, xsl-debug) to the cxl-adapter specific debugfs folder located at /sys/kernel/debugfs/cxl/card<n>, which will provide direct r/w access to corrosponding debug registers in the adapter config-space.
Signed-off-by Vaibhav Jain <[email protected]>Acked-by Andrew Donnellan <[email protected]>Acked-by Frederic Barrat <[email protected]>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/1cafc629408d1883a00c9f656e3de5
cheers