diff options
Diffstat (limited to 'drivers/net/ethernet/freescale/fman/Peripherals/FM/fman.c')
-rwxr-xr-x | drivers/net/ethernet/freescale/fman/Peripherals/FM/fman.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/net/ethernet/freescale/fman/Peripherals/FM/fman.c b/drivers/net/ethernet/freescale/fman/Peripherals/FM/fman.c index 9e59062..16a0854 100755 --- a/drivers/net/ethernet/freescale/fman/Peripherals/FM/fman.c +++ b/drivers/net/ethernet/freescale/fman/Peripherals/FM/fman.c @@ -186,8 +186,7 @@ void fman_enable_time_stamp(struct fman_fpm_regs *fpm_rg, * we do not div back, since we write this value as a fraction * see spec */ - frac = (((uint64_t)ts_freq << 16) - ((uint64_t)intgr << 16) * fm_clk_freq) - / fm_clk_freq; + frac = ((ts_freq << 16) - (intgr << 16) * fm_clk_freq) / fm_clk_freq; /* we check remainder of the division in order to round up if not int */ if (((ts_freq << 16) - (intgr << 16)*fm_clk_freq) % fm_clk_freq) frac++; @@ -823,7 +822,7 @@ int fman_fpm_init(struct fman_fpm_regs *fpm_rg, struct fman_cfg *cfg) /* RAM ECC - enable and clear events*/ /* first we need to clear all parser memory, * as it is uninitialized and may cause ECC errors */ - + tmp_reg = 0; /* event bits */ tmp_reg = (FPM_RAM_MURAM_ECC | FPM_RAM_IRAM_ECC); /* Rams enable not effected by RCR bit, but by a COP configuration */ @@ -914,12 +913,12 @@ int fman_qmi_init(struct fman_qmi_regs *qmi_rg, struct fman_cfg *cfg) iowrite32be(tmp_reg, &qmi_rg->fmqm_eien); if (cfg->tnum_aging_period) { - /* tnum_aging_period is in units of usec, p_FmClockFreq in Mhz */ + /* tnumAgingPeriod is in units of usec, p_FmClockFreq in Mhz */ period_in_fm_clocks = (uint16_t) (cfg->tnum_aging_period * cfg->clk_freq); - /* period_in_fm_clocks must be a 64 multiply */ + /* periodInFmClocks must be a 64 multiply */ remainder = (uint8_t)(period_in_fm_clocks % 64); - if (remainder) + if (remainder > 64) tmp_reg = (uint32_t)((period_in_fm_clocks / 64) + 1); else{ tmp_reg = (uint32_t)(period_in_fm_clocks / 64); |