Commit 5ac4e38e authored by Federico Vaga's avatar Federico Vaga

kernel: reduce driver verbosity

Signed-off-by: 's avatarFederico Vaga <federico.vaga@gmail.com>
parent 89cf5fee
...@@ -202,7 +202,7 @@ int fd_calibrate_outputs(struct fd_dev *fd) ...@@ -202,7 +202,7 @@ int fd_calibrate_outputs(struct fd_dev *fd)
fd_ch_writel(fd, ch, new, FD_REG_FRR); fd_ch_writel(fd, ch, new, FD_REG_FRR);
fd->ch[ch].frr_cur = new; fd->ch[ch].frr_cur = new;
if (1) { if (fd->verbose > 1) {
dev_info(&fd->fmc->dev, dev_info(&fd->fmc->dev,
"%s: ch%i: 8ns @%i (f %i, off %i, t %i.%02i)\n", "%s: ch%i: 8ns @%i (f %i, off %i, t %i.%02i)\n",
__func__, FD_CH_EXT(ch), __func__, FD_CH_EXT(ch),
......
...@@ -153,24 +153,26 @@ int fd_handle_eeprom_calibration(struct fd_dev *fd) ...@@ -153,24 +153,26 @@ int fd_handle_eeprom_calibration(struct fd_dev *fd)
calib->vcxo_default_tune = be32_to_cpu(calib->vcxo_default_tune); calib->vcxo_default_tune = be32_to_cpu(calib->vcxo_default_tune);
if (calibration_default) { if (calibration_default) {
dev_info(d, "Overriding with default calibration\n"); dev_info(d, "calibration: overriding with default values\n");
*calib = fd_calib_default; *calib = fd_calib_default;
hash = horig; /* whatever it is */ hash = horig; /* whatever it is */
} }
dev_info(d, "calibration: version %i, date %08x\n", calib->version, if (fd->verbose) {
calib->date); dev_info(d, "calibration: version %i, date %08x\n",
if (calibration_check) { calib->version, calib->date);
/* dump human-readable values */ if (calibration_check) {
dev_info(d, "calib: magic 0x%08x\n", calib->magic); /* dump human-readable values */
for (i = 0; i < ARRAY_SIZE(calib->frr_poly); i++) dev_info(d, "calib: magic 0x%08x\n", calib->magic);
dev_info(d, "calib: poly[%i] = %lli\n", i, for (i = 0; i < ARRAY_SIZE(calib->frr_poly); i++)
(long long)calib->frr_poly[i]); dev_info(d, "calib: poly[%i] = %lli\n", i,
for (i = 0; i < ARRAY_SIZE(calib->zero_offset); i++) (long long)calib->frr_poly[i]);
dev_info(d, "calib: offset[%i] = %li\n", i, for (i = 0; i < ARRAY_SIZE(calib->zero_offset); i++)
(long)calib->zero_offset[i]); dev_info(d, "calib: offset[%i] = %li\n", i,
dev_info(d, "calib: tdc_offset %i\n", calib->tdc_zero_offset); (long)calib->zero_offset[i]);
dev_info(d, "calib: vcxo %i\n", calib->vcxo_default_tune); dev_info(d, "calib: tdc_offset %i\n", calib->tdc_zero_offset);
dev_info(d, "calib: vcxo %i\n", calib->vcxo_default_tune);
}
} }
if (hash != horig) { if (hash != horig) {
......
...@@ -36,9 +36,6 @@ static struct fmc_driver fd_drv; /* forward declaration */ ...@@ -36,9 +36,6 @@ static struct fmc_driver fd_drv; /* forward declaration */
FMC_PARAM_BUSID(fd_drv); FMC_PARAM_BUSID(fd_drv);
FMC_PARAM_GATEWARE(fd_drv); FMC_PARAM_GATEWARE(fd_drv);
static int fd_show_sdb;
module_param_named(show_sdb, fd_show_sdb, int, 0444);
/* FIXME: add parameters "file=" and "wrc=" like wr-nic-core does */ /* FIXME: add parameters "file=" and "wrc=" like wr-nic-core does */
/** /**
...@@ -172,23 +169,19 @@ int fd_probe(struct fmc_device *fmc) ...@@ -172,23 +169,19 @@ int fd_probe(struct fmc_device *fmc)
} }
return ret; /* other error: pass over */ return ret; /* other error: pass over */
} }
dev_info(dev, "Gateware successfully loaded\n"); dev_dbg(dev, "Gateware successfully loaded\n");
/* FIXME: this is obsoleted by fmc-bus internal parameters */
if (fd_show_sdb)
fmc_show_sdb_tree(fmc);
/* Now use SDB to find the base addresses */ /* Now use SDB to find the base addresses */
ord = fmc->slot_id; ord = fmc->slot_id;
fd->fd_regs_base = fmc_sdb_find_nth_device ( fmc->sdb, 0xce42, 0xf19ede1a, &ord, NULL ); fd->fd_regs_base = fmc_sdb_find_nth_device ( fmc->sdb, 0xce42, 0xf19ede1a, &ord, NULL );
if( (signed long)fd->fd_regs_base < 0) if( (signed long)fd->fd_regs_base < 0)
{ {
dev_err(dev, "Can't find the FD core. Wrong gateware?\n"); dev_err(dev, "Can't find the FD core. Wrong gateware?\n");
} }
dev_info(dev, "fd_regs_base is %x\n", fd->fd_regs_base); dev_dbg(dev, "fd_regs_base is %x\n", fd->fd_regs_base);
fd->fd_owregs_base = fd->fd_regs_base + 0x500; fd->fd_owregs_base = fd->fd_regs_base + 0x500;
...@@ -201,8 +194,6 @@ int fd_probe(struct fmc_device *fmc) ...@@ -201,8 +194,6 @@ int fd_probe(struct fmc_device *fmc)
if (fd_readl(fd, FD_REG_IDR) != FD_MAGIC_FPGA) { if (fd_readl(fd, FD_REG_IDR) != FD_MAGIC_FPGA) {
dev_err(dev, "wrong gateware\n"); dev_err(dev, "wrong gateware\n");
return -ENODEV; return -ENODEV;
} else {
dev_info(dev, "%s: initializing\n", KBUILD_MODNAME);
} }
/* Retrieve calibration from the eeprom, and validate */ /* Retrieve calibration from the eeprom, and validate */
...@@ -277,6 +268,7 @@ int fd_probe(struct fmc_device *fmc) ...@@ -277,6 +268,7 @@ int fd_probe(struct fmc_device *fmc)
/* set all output enable stages */ /* set all output enable stages */
for (ch = 1; ch <= FD_CH_NUMBER; ch++) for (ch = 1; ch <= FD_CH_NUMBER; ch++)
fd_gpio_set(fd, FD_GPIO_OUTPUT_EN(ch)); fd_gpio_set(fd, FD_GPIO_OUTPUT_EN(ch));
return 0; return 0;
err: err:
......
...@@ -216,7 +216,7 @@ static int fd_read_hw_fifo(struct fd_dev *fd) ...@@ -216,7 +216,7 @@ static int fd_read_hw_fifo(struct fd_dev *fd)
BUG_ON(diff < 0); BUG_ON(diff < 0);
if (diff >= fd_sw_fifo_len) if (diff >= fd_sw_fifo_len)
dev_warn(fd->fmc->hwdev, "Fifo overflow: " dev_dbg(fd->fmc->hwdev, "Fifo overflow: "
" dropped %i samples (%li -> %li == %li)\n", " dropped %i samples (%li -> %li == %li)\n",
fd_sw_fifo_len / 2, fd_sw_fifo_len / 2,
fd->sw_fifo.tail, fd->sw_fifo.head, diff); fd->sw_fifo.tail, fd->sw_fifo.head, diff);
...@@ -316,11 +316,11 @@ int fd_irq_init(struct fd_dev *fd) ...@@ -316,11 +316,11 @@ int fd_irq_init(struct fd_dev *fd)
if (fd_timer_period_ms) { if (fd_timer_period_ms) {
setup_timer(&fd->fifo_timer, fd_tlet, (unsigned long)fd); setup_timer(&fd->fifo_timer, fd_tlet, (unsigned long)fd);
fd_timer_period_jiffies = msecs_to_jiffies(fd_timer_period_ms); fd_timer_period_jiffies = msecs_to_jiffies(fd_timer_period_ms);
dev_info(&fd->fmc->dev,"Using a timer for input (%i ms)\n", dev_dbg(&fd->fmc->dev,"Using a timer for input (%i ms)\n",
jiffies_to_msecs(fd_timer_period_jiffies)); jiffies_to_msecs(fd_timer_period_jiffies));
mod_timer(&fd->fifo_timer, jiffies + fd_timer_period_jiffies); mod_timer(&fd->fifo_timer, jiffies + fd_timer_period_jiffies);
} else { } else {
dev_info(fd->fmc->hwdev, "Using interrupts for input\n"); dev_dbg(fd->fmc->hwdev, "Using interrupts for input\n");
/* Disable interrupts */ /* Disable interrupts */
fd_writel(fd, ~0, FD_REG_EIC_IDR); fd_writel(fd, ~0, FD_REG_EIC_IDR);
......
...@@ -117,7 +117,7 @@ void mi2c_scan(struct fd_dev *fd) ...@@ -117,7 +117,7 @@ void mi2c_scan(struct fd_dev *fd)
int i; int i;
for(i = 0; i < 256; i += 2) { for(i = 0; i < 256; i += 2) {
mi2c_start(fd); mi2c_start(fd);
if(!mi2c_put_byte(fd, i)) if(!mi2c_put_byte(fd, i) && fd->verbose)
dev_info(&fd->fmc->dev, dev_info(&fd->fmc->dev,
"%s: Found i2c device at 0x%x\n", "%s: Found i2c device at 0x%x\n",
KBUILD_MODNAME, i >> 1); KBUILD_MODNAME, i >> 1);
......
...@@ -242,7 +242,7 @@ int fd_onewire_init(struct fd_dev *fd) ...@@ -242,7 +242,7 @@ int fd_onewire_init(struct fd_dev *fd)
printk("%02x%c", fd->ds18_id[i], i == 7 ? '\n' : ':'); printk("%02x%c", fd->ds18_id[i], i == 7 ? '\n' : ':');
} }
/* read the temperature once, to ensure it works, and print it */ /* read the temperature once, to ensure it works, and print it */
fd_read_temp(fd, 2); fd_read_temp(fd, fd->verbose);
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment