linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] mtd: bcm47xxnflash: fix typo in freq calculation
@ 2014-08-19  7:14 Rafał Miłecki
  2014-08-19  7:14 ` [PATCH 2/4] mtd: bcm47xxnflash: add dev_ready and fill chip_delay Rafał Miłecki
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Rafał Miłecki @ 2014-08-19  7:14 UTC (permalink / raw)
  To: linux-mtd, David Woodhouse, Artem Bityutskiy, Brian Norris
  Cc: Hauke Mehrtens, Rafał Miłecki

We are supposed to mask value, not multiply it. Add some comments btw.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
---
 drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c b/drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c
index b2ab373..dc204f3 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)
 
 	/* Configure wait counters */
 	if (b47n->cc->status & BCMA_CC_CHIPST_4706_PKG_OPTION) {
-		freq = 100000000;
+		/* 400 MHz */
+		freq = 400000000 / 4;
 	} else {
 		freq = bcma_chipco_pll_read(b47n->cc, 4);
-		freq = (freq * 0xFFF) >> 3;
-		freq = (freq * 25000000) >> 3;
+		freq = (freq & 0xFFF) >> 3;
+		/* Fixed reference clock 25 MHz and m = 2 */
+		freq = (freq * 25000000 / 2) / 4;
 	}
 	clock = freq / 1000000;
 	w0 = bcm47xxnflash_ops_bcm4706_ns_to_cycle(15, clock);
-- 
1.8.4.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-09-18  6:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-19  7:14 [PATCH 1/4] mtd: bcm47xxnflash: fix typo in freq calculation Rafał Miłecki
2014-08-19  7:14 ` [PATCH 2/4] mtd: bcm47xxnflash: add dev_ready and fill chip_delay Rafał Miłecki
2014-09-18  6:27   ` Brian Norris
2014-09-18  6:43     ` Rafał Miłecki
2014-09-18  6:54       ` Brian Norris
2014-08-19  7:14 ` [PATCH 3/4] mtd: bcm47xxnflash: add cmd_ctrl handler Rafał Miłecki
2014-08-19  7:14 ` [PATCH 4/4] mtd: bcm47xxnflash: NAND_CMD_RESET support Rafał Miłecki
2014-09-18  6:25 ` [PATCH 1/4] mtd: bcm47xxnflash: fix typo in freq calculation Brian Norris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).