[iMX25][PDK 1.6] How to activate pr_debug function?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[iMX25][PDK 1.6] How to activate pr_debug function?

12,881 Views
Apple92
Contributor II

Hello,

 

The PDK 1.6 contains a SIM card driver with debug capabilities.

 

The SIM card driver is in imx_sim.c (/rpm/BUILD/linux...../driver/char). The fact is that I am trying to debug the imx_sim.c source file for this SIM interface. mxc_sim is a SIM driver. In order to achieve this, I would like to enable pr_debug (...) output to my console when this driver is running and watch all debug messages displayed.

The kernel.h shows the pr_debug macro like this:

 /* If you are writing a driver, please use dev_dbg instead */ #if
 defined(CONFIG_DYNAMIC_PRINTK_DEBUG)
 #define pr_debug(fmt, ...) do { \
   dynamic_pr_debug(pr_fmt(fmt), ##__VA_ARGS__); \
    } while (0)
 #elif defined(DEBUG)
 #define pr_debug(fmt, ...) \
    printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) #else #define
 pr_debug(fmt, ...) \
    ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; })
 #endif


By browsing the LTIB menus, I found out (by searching in kernel hacking the label CONFIG_DYNAMIC_PRINTK_DEBUG) that I could select enable dynamic printk() call support option. The fact is that this options is enabled by writing the modules names in a file called debugfs which should be located in dynamic_printk/modules.

 

My questions are:

1- Is that mandatory to have the driver compiled and loaded as a module (<M>) (instead of part of the core kernel<*>)?

2- Where is the debugfs module? I cannot find the dynamic_printk/modules, the documentation is unclear on that topic.

 

Best Regards,

Franz

Tags (1)
0 Kudos
3 Replies

1,344 Views
fabio_estevam
NXP Employee
NXP Employee

Take a look at: http://www.kernel.org/doc/local/pr_debug.txt

 

Regards,

 

Fabio Estevam

0 Kudos

1,344 Views
bhakrim
Contributor I

Hello Fabio,

 

This is regarding imx51 , i wanted to setup SIM CARD for IMx51 , are there any documentation or web site links for this

 

Regards

Mohan

0 Kudos

1,344 Views
Apple92
Contributor II

Hi,

 

In the boot command line, you must add:

 

sim

 

This enables to setup the gpio properly upon boot in xxxxxxx_gpio.c (xxxxxxx = mx25_3stack for my imx25 board). This should be similar on the i.MX 51. On the i.MX 25, these gpio are shared with the CMOS sensor. By default, the CMOS sensor is activated.

 

If this does no work, search for soeting like __setup ("sim", sim_setup)

 

I also checked IMX SIM Support in LTIB, as a built-in feature or module.

 

You must use a library provided by Freescale and which implements T=0 protocol. I do not remember the lib name but it should be in the latest PDK release.

 

Franz

 

 

0 Kudos