summaryrefslogtreecommitdiff
path: root/firmware/target/arm/imx233/debug-imx233.c
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2016-05-29 16:07:43 +0100
committerAmaury Pouly <amaury.pouly@gmail.com>2016-05-29 16:07:43 +0100
commit85ad99ee3d5eaae6e98f958c5aed5d3d36ca460a (patch)
tree2b2e6065b3185780e2c19ee9936f4f0a0e37f54d /firmware/target/arm/imx233/debug-imx233.c
parent7aacf4da2dacf649e69139e53405e2e6a9a2cbb6 (diff)
downloadrockbox-85ad99ee3d5eaae6e98f958c5aed5d3d36ca460a.tar.gz
rockbox-85ad99ee3d5eaae6e98f958c5aed5d3d36ca460a.zip
imx233: add sd/mmc debug screen
The screen currently displays for each device the bus width, set_block_count support, HS capability and whether it is enabled for not. Change-Id: I6b1c3b1019e55ef1097a23c1f54fb07f5c7aa3b0
Diffstat (limited to 'firmware/target/arm/imx233/debug-imx233.c')
-rw-r--r--firmware/target/arm/imx233/debug-imx233.c62
1 files changed, 62 insertions, 0 deletions
diff --git a/firmware/target/arm/imx233/debug-imx233.c b/firmware/target/arm/imx233/debug-imx233.c
index edb84b990a..2d0150e33d 100644
--- a/firmware/target/arm/imx233/debug-imx233.c
+++ b/firmware/target/arm/imx233/debug-imx233.c
@@ -43,6 +43,8 @@
43#include "stdio.h" 43#include "stdio.h"
44#include "button.h" 44#include "button.h"
45#include "button-imx233.h" 45#include "button-imx233.h"
46#include "sdmmc-imx233.h"
47#include "storage.h"
46 48
47#include "regs/usbphy.h" 49#include "regs/usbphy.h"
48#include "regs/timrot.h" 50#include "regs/timrot.h"
@@ -1190,6 +1192,65 @@ bool dbg_hw_info_button(void)
1190 } 1192 }
1191} 1193}
1192 1194
1195bool dbg_hw_info_sdmmc(void)
1196{
1197 lcd_setfont(FONT_SYSFIXED);
1198
1199 while(1)
1200 {
1201 int button = my_get_action(HZ / 10);
1202 switch(button)
1203 {
1204 case ACT_NEXT:
1205 case ACT_PREV:
1206 case ACT_OK:
1207 lcd_setfont(FONT_UI);
1208 return true;
1209 case ACT_CANCEL:
1210 lcd_setfont(FONT_UI);
1211 return false;
1212 }
1213
1214 lcd_clear_display();
1215 int line = 0;
1216#if CONFIG_STORAGE & STORAGE_MMC
1217 int mmc_idx = 0;
1218#endif
1219#if CONFIG_STORAGE & STORAGE_SD
1220 int sd_idx = 0;
1221#endif
1222 for(int drive = 0; drive < storage_num_drives(); drive++)
1223 {
1224 struct sdmmc_info_t info;
1225 if(false) {}
1226#if CONFIG_STORAGE & STORAGE_MMC
1227 else if(storage_driver_type(drive) == STORAGE_MMC_NUM)
1228 info = imx233_mmc_get_info(mmc_idx++);
1229#endif
1230#if CONFIG_STORAGE & STORAGE_SD
1231 else if(storage_driver_type(drive) == STORAGE_SD_NUM)
1232 info = imx233_sd_get_info(sd_idx++);
1233#endif
1234 else
1235 continue;
1236 lcd_putsf(0, line++, "%s", info.slot_name);
1237#ifdef HAVE_HOTSWAP
1238 bool removable = storage_removable(info.drive);
1239 bool present = storage_present(info.drive);
1240 if(removable)
1241 lcd_putsf(0, line++, " removable %spresent", present ? "" : "not ");
1242 if(!present)
1243 continue;
1244#endif
1245 lcd_putsf(0, line++, " bus: %d sbc: %d", info.bus_width, info.has_sbc);
1246 lcd_putsf(0, line++, " hs: %s", info.hs_enabled ? "enabled" :
1247 info.hs_capable ? "disabled" : "not capable");
1248 }
1249 lcd_update();
1250 yield();
1251 }
1252}
1253
1193static struct 1254static struct
1194{ 1255{
1195 const char *name; 1256 const char *name;
@@ -1215,6 +1276,7 @@ static struct
1215 {"audio", dbg_hw_info_audio}, 1276 {"audio", dbg_hw_info_audio},
1216 {"timrot", dbg_hw_info_timrot}, 1277 {"timrot", dbg_hw_info_timrot},
1217 {"button", dbg_hw_info_button}, 1278 {"button", dbg_hw_info_button},
1279 {"sdmmc", dbg_hw_info_sdmmc},
1218 {"target", dbg_hw_target_info}, 1280 {"target", dbg_hw_target_info},
1219}; 1281};
1220 1282