aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2014-08-19 03:14:13 -0400
committerBrian Norris <computersforpeace@gmail.com>2014-09-18 02:18:50 -0400
commit785e5e111f2187ea3e6f4035f6009da62dd5c043 (patch)
tree0a0918471beaf617031f4e23aeab0f2ff0a0d4f8 /drivers/mtd
parent024629fdca1bbb44a25d40c2362a878a7a67ce3b (diff)
mtd: bcm47xxnflash: fix typo in freq calculation
We are supposed to mask value, not multiply it. Add some comments btw. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c b/drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c
index b2ab373c9eef..dc204f3a47ed 100644
--- a/drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c
+++ b/drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c
@@ -364,11 +364,13 @@ int bcm47xxnflash_ops_bcm4706_init(struct bcm47xxnflash *b47n)
364 364
365 /* Configure wait counters */ 365 /* Configure wait counters */
366 if (b47n->cc->status & BCMA_CC_CHIPST_4706_PKG_OPTION) { 366 if (b47n->cc->status & BCMA_CC_CHIPST_4706_PKG_OPTION) {
367 freq = 100000000; 367 /* 400 MHz */
368 freq = 400000000 / 4;
368 } else { 369 } else {
369 freq = bcma_chipco_pll_read(b47n->cc, 4); 370 freq = bcma_chipco_pll_read(b47n->cc, 4);
370 freq = (freq * 0xFFF) >> 3; 371 freq = (freq & 0xFFF) >> 3;
371 freq = (freq * 25000000) >> 3; 372 /* Fixed reference clock 25 MHz and m = 2 */
373 freq = (freq * 25000000 / 2) / 4;
372 } 374 }
373 clock = freq / 1000000; 375 clock = freq / 1000000;
374 w0 = bcm47xxnflash_ops_bcm4706_ns_to_cycle(15, clock); 376 w0 = bcm47xxnflash_ops_bcm4706_ns_to_cycle(15, clock);