diff options
author | Wolfgang Denk <wd@denx.de> | 2009-08-16 23:40:13 +0200 |
---|---|---|
committer | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2009-08-17 23:53:41 +0200 |
commit | 4af34177b657e91263919a307fd0b0865a299e52 (patch) | |
tree | 9f2ed36884ee3efe14983b679ad342d3dd7bd783 /board/zylonite/nand.c | |
parent | 7dedefdf749ff02c1086f7ddb8cb83a77b00d030 (diff) | |
download | u-boot-imx-4af34177b657e91263919a307fd0b0865a299e52.zip u-boot-imx-4af34177b657e91263919a307fd0b0865a299e52.tar.gz u-boot-imx-4af34177b657e91263919a307fd0b0865a299e52.tar.bz2 |
Monahans: avoid floating point calculations
Current code for the Monahans CPU defined OSCR_CLK_FREQ as 3.250 (MHz)
which caused floating point operations to be used. This resulted in
unresolved references to some FP related libgcc functions when using
U-Boot's private libgcc functions.
Change the code to use fixed point math only.
Signed-off-by: Wolfgang Denk <wd@denx.de>
Diffstat (limited to 'board/zylonite/nand.c')
-rw-r--r-- | board/zylonite/nand.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/board/zylonite/nand.c b/board/zylonite/nand.c index bec54cb..7cad1ac 100644 --- a/board/zylonite/nand.c +++ b/board/zylonite/nand.c @@ -198,7 +198,7 @@ static unsigned long get_delta(unsigned long start) static void wait_us(unsigned long us) { unsigned long start = OSCR; - us *= OSCR_CLK_FREQ; + us = DIV_ROUND_UP(us * OSCR_CLK_FREQ, 1000); while (get_delta(start) < us) { /* do nothing */ @@ -219,9 +219,11 @@ static unsigned long dfc_wait_event(unsigned long event) if(!event) return 0xff000000; else if(event & (NDSR_CS0_CMDD | NDSR_CS0_BBD)) - timeout = CONFIG_SYS_NAND_PROG_ERASE_TO * OSCR_CLK_FREQ; + timeout = DIV_ROUND_UP(CONFIG_SYS_NAND_PROG_ERASE_TO + * OSCR_CLK_FREQ, 1000); else - timeout = CONFIG_SYS_NAND_OTHER_TO * OSCR_CLK_FREQ; + timeout = DIV_ROUND_UP(CONFIG_SYS_NAND_OTHER_TO + * OSCR_CLK_FREQ, 1000); while(1) { ndsr = NDSR; |