summaryrefslogtreecommitdiff
path: root/firmware/export
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2009-07-01 21:49:13 +0000
committerRafaël Carré <rafael.carre@gmail.com>2009-07-01 21:49:13 +0000
commitc0eb9aeb9e89ae33a9f084167147d8eacb9c7c60 (patch)
tree57e96460989d9cccc421486769befb5648601b8c /firmware/export
parent93f6e3df246ff50c24524c9d329f27a06e1845db (diff)
downloadrockbox-c0eb9aeb9e89ae33a9f084167147d8eacb9c7c60.tar.gz
rockbox-c0eb9aeb9e89ae33a9f084167147d8eacb9c7c60.zip
add firmware/driver/sd.c which contains common code between SD drivers
ingenic SD driver needs more cleanup so it still doesn't use the common code correct a comment in hotswap.c: card_extract_bits assume most significant word of register first (so, use this order) fix debug menu which used MMC specific commands / bits positions in csd/cid move the default block size of 512 into sd.h move the mantissa & exponent table into a single file (sd.c) to reduce binsize. we don't need to export it anymore anyway TODO : ingenic cleanup (will happen soon so building sd.c is not conditional) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21601 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export')
-rw-r--r--firmware/export/hotswap.h1
-rw-r--r--firmware/export/sd.h7
2 files changed, 3 insertions, 5 deletions
diff --git a/firmware/export/hotswap.h b/firmware/export/hotswap.h
index a9bb745f38..455dee6bcc 100644
--- a/firmware/export/hotswap.h
+++ b/firmware/export/hotswap.h
@@ -56,6 +56,7 @@ typedef struct
56#define card_detect card_detect_target 56#define card_detect card_detect_target
57#define card_get_info card_get_info_target 57#define card_get_info card_get_info_target
58tCardInfo *card_get_info_target(int card_no); 58tCardInfo *card_get_info_target(int card_no);
59void sd_parse_csd(tCardInfo *card);
59 60
60#ifdef HAVE_HOTSWAP 61#ifdef HAVE_HOTSWAP
61#define card_enable_monitoring card_enable_monitoring_target 62#define card_enable_monitoring card_enable_monitoring_target
diff --git a/firmware/export/sd.h b/firmware/export/sd.h
index 9d47290d85..6c848c34cf 100644
--- a/firmware/export/sd.h
+++ b/firmware/export/sd.h
@@ -25,6 +25,8 @@
25#include <stdbool.h> 25#include <stdbool.h>
26#include "mv.h" /* for HAVE_MULTIVOLUME or not */ 26#include "mv.h" /* for HAVE_MULTIVOLUME or not */
27 27
28#define SD_BLOCK_SIZE 512 /* XXX : support other sizes ? */
29
28struct storage_info; 30struct storage_info;
29 31
30void sd_enable(bool on); 32void sd_enable(bool on);
@@ -51,11 +53,6 @@ bool card_detect_target(void);
51 53
52long sd_last_disk_activity(void); 54long sd_last_disk_activity(void);
53 55
54static const unsigned char sd_mantissa[] = { /* *10 */
55 0, 10, 12, 13, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 70, 80 };
56static const unsigned int sd_exponent[] = { /* use varies */
57 1,10,100,1000,10000,100000,1000000,10000000,100000000,1000000000 };
58
59/* SD States */ 56/* SD States */
60#define SD_IDLE 0 57#define SD_IDLE 0
61#define SD_READY 1 58#define SD_READY 1