summaryrefslogtreecommitdiff
path: root/apps
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 /apps
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 'apps')
-rw-r--r--apps/debug_menu.c43
1 files changed, 35 insertions, 8 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index ab2f2821b2..0e4eab1a44 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -1889,8 +1889,11 @@ static int disk_callback(int btn, struct gui_synclist *lists)
1889 static const unsigned char i_vmax[] = { 1, 5, 10, 25, 35, 45, 80, 200 }; 1889 static const unsigned char i_vmax[] = { 1, 5, 10, 25, 35, 45, 80, 200 };
1890 static const unsigned char *kbit_units[] = { "kBit/s", "MBit/s", "GBit/s" }; 1890 static const unsigned char *kbit_units[] = { "kBit/s", "MBit/s", "GBit/s" };
1891 static const unsigned char *nsec_units[] = { "ns", "µs", "ms" }; 1891 static const unsigned char *nsec_units[] = { "ns", "µs", "ms" };
1892 static const char *spec_vers[] = { "1.0-1.2", "1.4", "2.0-2.2", 1892#if (CONFIG_STORAGE & STORAGE_MMC)
1893 static const char *mmc_spec_vers[] = { "1.0-1.2", "1.4", "2.0-2.2",
1893 "3.1-3.31", "4.0" }; 1894 "3.1-3.31", "4.0" };
1895#endif
1896
1894 if ((btn == ACTION_STD_OK) || (btn == SYS_FS_CHANGED) || (btn == ACTION_REDRAW)) 1897 if ((btn == ACTION_STD_OK) || (btn == SYS_FS_CHANGED) || (btn == ACTION_REDRAW))
1895 { 1898 {
1896#ifdef HAVE_HOTSWAP 1899#ifdef HAVE_HOTSWAP
@@ -1914,19 +1917,43 @@ static int disk_callback(int btn, struct gui_synclist *lists)
1914 (int) card_extract_bits(card->cid, 51, 4)); 1917 (int) card_extract_bits(card->cid, 51, 4));
1915 simplelist_addline(SIMPLELIST_ADD_LINE, 1918 simplelist_addline(SIMPLELIST_ADD_LINE,
1916 "Prod: %d/%d", 1919 "Prod: %d/%d",
1920#if (CONFIG_STORAGE & STORAGE_SD)
1921 (int) card_extract_bits(card->cid, 11, 3),
1922 (int) card_extract_bits(card->cid, 19, 8) + 2000
1923#elif (CONFIG_STORAGE & STORAGE_MMC)
1917 (int) card_extract_bits(card->cid, 15, 4), 1924 (int) card_extract_bits(card->cid, 15, 4),
1918 (int) card_extract_bits(card->cid, 11, 4) + 1997); 1925 (int) card_extract_bits(card->cid, 11, 4) + 1997
1926#endif
1927 );
1919 simplelist_addline(SIMPLELIST_ADD_LINE, 1928 simplelist_addline(SIMPLELIST_ADD_LINE,
1929#if (CONFIG_STORAGE & STORAGE_SD)
1920 "Ser#: 0x%08lx", 1930 "Ser#: 0x%08lx",
1921 card_extract_bits(card->cid, 47, 32)); 1931 card_extract_bits(card->cid, 55, 32)
1922 simplelist_addline(SIMPLELIST_ADD_LINE, 1932#elif (CONFIG_STORAGE & STORAGE_MMC)
1923 "M=%02x, O=%04x", 1933 "Ser#: 0x%04lx",
1934 card_extract_bits(card->cid, 47, 16)
1935#endif
1936 );
1937
1938 simplelist_addline(SIMPLELIST_ADD_LINE, "M=%02x, "
1939#if (CONFIG_STORAGE & STORAGE_SD)
1940 "O=%c%c",
1924 (int) card_extract_bits(card->cid, 127, 8), 1941 (int) card_extract_bits(card->cid, 127, 8),
1925 (int) card_extract_bits(card->cid, 119, 16)); 1942 card_extract_bits(card->cid, 119, 8),
1943 card_extract_bits(card->cid, 111, 8)
1944#elif (CONFIG_STORAGE & STORAGE_MMC)
1945 "O=%04x",
1946 (int) card_extract_bits(card->cid, 127, 8),
1947 (int) card_extract_bits(card->cid, 119, 16)
1948#endif
1949 );
1950
1951#if (CONFIG_STORAGE & STORAGE_MMC)
1926 int temp = card_extract_bits(card->csd, 125, 4); 1952 int temp = card_extract_bits(card->csd, 125, 4);
1927 simplelist_addline(SIMPLELIST_ADD_LINE, 1953 simplelist_addline(SIMPLELIST_ADD_LINE,
1928 CARDTYPE " v%s", temp < 5 ? 1954 "MMC v%s", temp < 5 ?
1929 spec_vers[temp] : "?.?"); 1955 mmc_spec_vers[temp] : "?.?");
1956#endif
1930 simplelist_addline(SIMPLELIST_ADD_LINE, 1957 simplelist_addline(SIMPLELIST_ADD_LINE,
1931 "Blocks: 0x%08lx", card->numblocks); 1958 "Blocks: 0x%08lx", card->numblocks);
1932 output_dyn_value(pbuf, sizeof pbuf, card->speed / 1000, 1959 output_dyn_value(pbuf, sizeof pbuf, card->speed / 1000,