diff options
author | Rafaël Carré <rafael.carre@gmail.com> | 2009-05-21 17:35:56 +0000 |
---|---|---|
committer | Rafaël Carré <rafael.carre@gmail.com> | 2009-05-21 17:35:56 +0000 |
commit | 442726339ab0a424edf0e3406c68faacb425d9a2 (patch) | |
tree | b7feb0380534d89772a13e6d9f4d464849ae6576 /firmware | |
parent | acc0f799d575f8a19f6c7e1244118ec0f0adf9e6 (diff) |
Sansa AMS: show correct clock speeds for NAND & SD card
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21017 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/target/arm/as3525/debug-as3525.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/firmware/target/arm/as3525/debug-as3525.c b/firmware/target/arm/as3525/debug-as3525.c index 6e9492cdae..ac7253d579 100644 --- a/firmware/target/arm/as3525/debug-as3525.c +++ b/firmware/target/arm/as3525/debug-as3525.c @@ -183,8 +183,18 @@ int calc_freq(int clk) case CLK_DBOP: return calc_freq(CLK_PCLK)/((CGU_DBOP & 7)+1); case CLK_SD_IDENT_NAND: - return calc_freq(CLK_PCLK)/(((MCI_NAND & 0xff)*2)+1); + if(!(MCI_NAND & (1<<8))) + return 0; + else if(MCI_NAND & (1<<10)) + return calc_freq(CLK_PCLK); + else + return calc_freq(CLK_PCLK)/(((MCI_NAND & 0xff)*2)+1); case CLK_SD_IDENT_MSD: + if(!(MCI_SD & (1<<8))) + return 0; + else if(MCI_SD & (1<<10)) + return calc_freq(CLK_PCLK); + else return calc_freq(CLK_PCLK)/(((MCI_SD & 0xff)*2)+1); case CLK_USB: switch(CGU_USB & 3) { /* 0-> div=1 other->div=1/(2*n) */ |