summaryrefslogtreecommitdiff
path: root/firmware/export/sd.h (follow)
Commit message (Collapse)AuthorAge
* Unify storage threads into oneMichael Sevakis2017-10-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Editing a bunch of drivers' thread routines in order to implement a new feature is tedious. * No matter the number of storage drivers, they share one thread. No extra threads needed for CONFIG_STORAGE_MULTI. * Each has an event callback called by the storage thread. * A default callback is provided to fake sleeping in order to trigger idle callbacks. It could also do other default processing. Changes to it will be part of driver code without editing each one. * Drivers may sleep and wake as they please as long as they give a low pulse on their storage bit to ask to go into sleep mode. Idle callback is called on its behalf and driver immediately put into sleep mode. * Drivers may indicate they are to continue receiving events in USB mode, otherwise they receve nothing until disconnect (they do receive SYS_USB_DISCONNECTED no matter what). * Rework a few things to keep the callback implementation sane and maintainable. ata.c was dreadful with all those bools; make it a state machine and easier to follow. Remove last_user_activity; it has no purpose that isn't served by keeping the disk active through last_disk_activity instead. * Even-out stack sizes partly because of a lack of a decent place to define them by driver or SoC or whatever; it doesn't seem too critical to do that anyway. Many are simply too large while at least one isn't really adequate. They may be individually overridden if necessary (figure out where). The thread uses the greatest size demanded. Newer file code is much more frugal with stack space. I barely see use crack 50% after idle callbacks (usually mid-40s). Card insert/eject doesn't demand much. * No forcing of idle callbacks. If it isn't necessary for one or more non-disk storage types, it really isn't any more necessary for disk storage. Besides, it makes the whole thing easier to implement. Change-Id: Id30c284d82a8af66e47f2cfe104c52cbd8aa7215
* storage: fix MD vs MV confusionAmaury Pouly2013-12-06
| | | | Change-Id: If0e4b0ac8b24413b77f1d67293c652c6a0e01bbd
* Cleanup MV/MD macros a little.Michael Sevakis2013-08-17
| | | | | | | | | | When using variadic macros there's no need for IF_MD2/IF_MV2 to deal with function parameters. IF_MD/IF_MV are enough. Throw in IF_MD_DRV/ID_MV_VOL that return the parameter if MD/MV, or 0 if not. Change-Id: I7605e6039f3be19cb47110c84dcb3c5516f2c3eb
* Add more INIT_ATTR and add config.h includes to header files with INIT_ATTR.Boris Gjenero2011-12-19
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31370 a1c6a512-1295-4272-9138-f99709370657
* Add INIT_ATTR to storage_init() when possibleRafaël Carré2011-11-20
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31036 a1c6a512-1295-4272-9138-f99709370657
* Bootloader USB mode for PP502x. Enable only on GoGear SA9200 for the time ↵Michael Sevakis2011-01-15
| | | | | | being. Add HAVE_BOOTLOADER_USB_MODE to config if BOOTLOADER is defined to enable it. Clean up some kernel stuff a little to support it. Mess up a bunch of other stuff (hopefully not too badly). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29053 a1c6a512-1295-4272-9138-f99709370657
* Remove card_enable_monitoring() and use a mutex instead. The ↵Frank Gevaerts2010-06-06
| | | | | | card_enable_monitoring() method actually didn't eliminate the possible race conditions it was meant to fix. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26627 a1c6a512-1295-4272-9138-f99709370657
* Remove unused card_detect(), and make card_detect_target() static inline in ↵Thomas Martitz2009-11-26
| | | | | | each sd driver. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23757 a1c6a512-1295-4272-9138-f99709370657
* sd.h: No functional changes to present code. Added some additional SD ↵Jack Halpin2009-11-07
| | | | | | | | | | CMD's and a #define for card errors flagged in an R1 response. Add SD_SD_STATUS(ACMD13), SD_SET_WR_BLK_ERASE_COUNT(ACMD23), SD_PROGRAM_CSD(CMD27). Add #define SD_R1_CARD_ERROR to make card error checking easier. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23560 a1c6a512-1295-4272-9138-f99709370657
* Add define for SD_SET_CLR_CARD_DETECT 42 /* acmd42 */ to sd.h for use with ↵Jack Halpin2009-10-25
| | | | | | 4 bit WIDEBUS. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23340 a1c6a512-1295-4272-9138-f99709370657
* Working Bootloader for mini2440. Dominik Wenger2009-10-22
| | | | | | | Flyspray: FS#10701 Author: Bob Cousins git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23316 a1c6a512-1295-4272-9138-f99709370657
* Commit FS#9545, storage cleanup and multi-driver supportFrank Gevaerts2009-07-17
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21933 a1c6a512-1295-4272-9138-f99709370657
* Revert r21912 : "Storage API : remove undeeded target-specific functions"Rafaël Carré2009-07-17
| | | | | | | | After a discussion mixed on mailing list and irc, it was agreed that more abstraction for plugins is better (so developers don't have to add a check to HAVE_DISK_STORAGE when writing disk-specific code) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21923 a1c6a512-1295-4272-9138-f99709370657
* Storage API : remove undeeded target-specific functionsRafaël Carré2009-07-17
| | | | | | | storage_sleep, storage_spin, storage_spindown are only defined if #defiend (HAVE_DISK_STORAGE), not for MMC/ATA/SD remove already unneeded nand_disk_is_active, nand_soft_reset git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21912 a1c6a512-1295-4272-9138-f99709370657
* Ingenic jz4740 SD driver: remove custom list of SD commandsRafaël Carré2009-07-01
| | | | | | | Replace most references to MMC/mmc with SD/sd Remove MMC failover code since MMC cards aren't supported git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21604 a1c6a512-1295-4272-9138-f99709370657
* add firmware/driver/sd.c which contains common code between SD driversRafaël Carré2009-07-01
| | | | | | | | | | | | 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
* Merge tCardInfo struct (MMC) and tSDCardInfo struct (SD)Rafaël Carré2009-07-01
| | | | | | | | | | | | | | | | | Put specific members under #ifdef (CONFIG_STORAGE & STORAGE_xx) (2 members for SD and 1 for MMC) Fix a typo: tsac doesn't exist and must be read taac Move card_get_info functions declaration inside hotswap.h to remove mutual inclusion of ata_mmc.h and hotswap.h Move static const data structures from SD drivers into sd.h (sd_exponent and sd_mantissa) Fix sd_command prototypes in SD drivers (card registers are unsigned long) Fix speed calculation in Sansa AMS driver (PP SD driver needs to be checked) Move ata-sd-target.h to sd-pp-target.h to reflect the PP specifity. Now it only contains declaration of microsd_int() Remove unused ata-sd-target.h for injenic TODO: - check if CSD register bits are extracted correctly in PP driver - correctly define read_timeout and write_timeout unit for MMC & SD, and use timeouts in Sansa AMS driver git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21586 a1c6a512-1295-4272-9138-f99709370657
* sd.h : avoid namespace collision by prefixing defines with SD_Rafaël Carré2008-11-09
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19055 a1c6a512-1295-4272-9138-f99709370657
* SD PP: move non specific defines to sd.h, to be reused by other SD driversRafaël Carré2008-11-09
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19043 a1c6a512-1295-4272-9138-f99709370657
* Since *set_led_enabled() is actually an ata-specific feature, move it back ↵Frank Gevaerts2008-11-04
| | | | | | to ata_* only git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19006 a1c6a512-1295-4272-9138-f99709370657
* *_hard_reset() is only used inside ata.c, so there's no need to export it to ↵Frank Gevaerts2008-11-04
| | | | | | the world git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19004 a1c6a512-1295-4272-9138-f99709370657
* conditionalise *_get_info() to get some binsize backFrank Gevaerts2008-11-01
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18965 a1c6a512-1295-4272-9138-f99709370657
* Now also commit added filesFrank Gevaerts2008-11-01
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18961 a1c6a512-1295-4272-9138-f99709370657