Use bootverbose to control debug printfs from the Cavium Simple Executive

code.  Also remove an unnecessary CVMX_ENABLE_DEBUG_PRINTS conditional around
what is already a cvmx_dprintf.
This commit is contained in:
Juli Mallett 2012-11-24 02:12:24 +00:00
parent 01a310bd57
commit 85129b4bd4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=243470
3 changed files with 21 additions and 2 deletions

View File

@ -182,9 +182,7 @@ int cvmx_spi_restart_interface(int interface, cvmx_spi_mode_t mode, int timeout)
if (!(OCTEON_IS_MODEL(OCTEON_CN38XX) || OCTEON_IS_MODEL(OCTEON_CN58XX)))
return res;
#if CVMX_ENABLE_DEBUG_PRINTS
cvmx_dprintf ("SPI%d: Restart %s\n", interface, modes[mode]);
#endif
// Callback to perform SPI4 reset
INVOKE_CB(cvmx_spi_callbacks.reset_cb, interface,mode);

View File

@ -76,6 +76,9 @@ extern "C" {
#ifdef CVMX_BUILD_FOR_LINUX_KERNEL
#define cvmx_dprintf printk
#define cvmx_dvprintf vprintk
#elif defined(CVMX_BUILD_FOR_FREEBSD_KERNEL)
void cvmx_dvprintf(const char *, va_list);
void cvmx_dprintf(const char *, ...) __attribute__ ((format(printf, 1, 2)));
#else
#define cvmx_dprintf printf
#define cvmx_dvprintf vprintf

View File

@ -446,6 +446,24 @@ SYSCTL_PROC(_machdep, OID_AUTO, led_display, CTLTYPE_STRING | CTLFLAG_WR,
NULL, 0, sysctl_machdep_led_display, "A",
"String to display on LED display");
void
cvmx_dvprintf(const char *fmt, va_list ap)
{
if (!bootverbose)
return;
vprintf(fmt, ap);
}
void
cvmx_dprintf(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
cvmx_dvprintf(fmt, ap);
va_end(ap);
}
/**
* version of printf that works better in exception context.
*