diff options
author | Marcoen Hirschberg <marcoen@gmail.com> | 2007-02-08 10:21:37 +0000 |
---|---|---|
committer | Marcoen Hirschberg <marcoen@gmail.com> | 2007-02-08 10:21:37 +0000 |
commit | e645e2dcf2cc03c7e4c9a9d26ac93bbf82e8414b (patch) | |
tree | 616413a217662ee8f0f4c30c0c3ecd8785682829 | |
parent | 6dd8fbe25d5c91f7ba101b6c68c02c5c796cce1b (diff) | |
download | rockbox-e645e2dcf2cc03c7e4c9a9d26ac93bbf82e8414b.tar.gz rockbox-e645e2dcf2cc03c7e4c9a9d26ac93bbf82e8414b.zip |
Fix the delay loops. Without scaling the CPU is always at 300MHz.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12229 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/target/arm/gigabeat/meg-fx/i2c-meg-fx.c | 2 | ||||
-rw-r--r-- | firmware/target/arm/gigabeat/meg-fx/sc606-meg-fx.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/firmware/target/arm/gigabeat/meg-fx/i2c-meg-fx.c b/firmware/target/arm/gigabeat/meg-fx/i2c-meg-fx.c index fd5d9577a3..770f4eb4e6 100644 --- a/firmware/target/arm/gigabeat/meg-fx/i2c-meg-fx.c +++ b/firmware/target/arm/gigabeat/meg-fx/i2c-meg-fx.c | |||
@@ -90,7 +90,7 @@ static void i2c_delay(void) | |||
90 | /* about 30 cycles overhead + X * 7 */ | 90 | /* about 30 cycles overhead + X * 7 */ |
91 | /* 300MHz: 1000nS @3.36nS/cyc = 297cyc: X = 38*/ | 91 | /* 300MHz: 1000nS @3.36nS/cyc = 297cyc: X = 38*/ |
92 | /* 100MHz: 1000nS @10nS/cyc = 100cyc : X = 10 */ | 92 | /* 100MHz: 1000nS @10nS/cyc = 100cyc : X = 10 */ |
93 | for (_x = get_cpu_boost_counter() ? 38 : 10; _x; _x--) | 93 | for (_x = 38; _x; _x--) |
94 | { | 94 | { |
95 | /* burn CPU cycles */ | 95 | /* burn CPU cycles */ |
96 | /* gcc makes it an inc loop - check with objdump for asm timing */ | 96 | /* gcc makes it an inc loop - check with objdump for asm timing */ |
diff --git a/firmware/target/arm/gigabeat/meg-fx/sc606-meg-fx.c b/firmware/target/arm/gigabeat/meg-fx/sc606-meg-fx.c index d4e061a0c7..f9cb35f884 100644 --- a/firmware/target/arm/gigabeat/meg-fx/sc606-meg-fx.c +++ b/firmware/target/arm/gigabeat/meg-fx/sc606-meg-fx.c | |||
@@ -30,9 +30,9 @@ | |||
30 | /* cycles delayed = 30 + 7 * loops */ | 30 | /* cycles delayed = 30 + 7 * loops */ |
31 | /* 100MHz = 10nS per cycle: LO:1300nS=130:14 HI:600nS=60:9 */ | 31 | /* 100MHz = 10nS per cycle: LO:1300nS=130:14 HI:600nS=60:9 */ |
32 | /* 300MHz = 3.36nS per cycle: LO:1300nS=387:51 HI:600nS=179:21 */ | 32 | /* 300MHz = 3.36nS per cycle: LO:1300nS=387:51 HI:600nS=179:21 */ |
33 | #define DELAY_LO do{int x;for(x=get_cpu_boost_counter()?51:14;x;x--);} while (0) | 33 | #define DELAY_LO do{int x;for(x=51;x;x--);} while (0) |
34 | #define DELAY do{int x;for(x=get_cpu_boost_counter()?35:10;x;x--);} while (0) | 34 | #define DELAY do{int x;for(x=35;x;x--);} while (0) |
35 | #define DELAY_HI do{int x;for(x=get_cpu_boost_counter()?21: 9;x;x--);} while (0) | 35 | #define DELAY_HI do{int x;for(x=21;x;x--);} while (0) |
36 | 36 | ||
37 | 37 | ||
38 | 38 | ||