Commit Graph

22 Commits

Author SHA1 Message Date
Michael Sevakis
1654efc313 Unify storage threads into one
* 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
2017-10-26 14:35:41 -04:00
Michael Sevakis
a56f1ca1ed Cleanup MV/MD macros a little.
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
2013-08-17 12:18:22 -04:00
Michael Sparmann
b59d6642e2 Fix ata_idle_notify on iPod Nano 2G
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27020 a1c6a512-1295-4272-9138-f99709370657
2010-06-21 16:54:25 +00:00
Michael Sparmann
64ac121e2c Squash another bunch of iPod Nano 2G NAND bugs by moving the idle powerdown code down into the lowlevel driver. Move even more things from the FTL to the bss instead of the stack to prevent USB stkovs. Also fix some evil whitespace.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23570 a1c6a512-1295-4272-9138-f99709370657
2009-11-08 14:55:30 +00:00
Michael Sparmann
c9667e6d23 Fix iPod Nano 2G UI sluggishness (thanks to JdGordon for spotting this)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23365 a1c6a512-1295-4272-9138-f99709370657
2009-10-26 22:22:01 +00:00
Michael Sparmann
49d4c428dc Implement iPod Nano 2G storage active indicator
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23325 a1c6a512-1295-4272-9138-f99709370657
2009-10-23 23:50:32 +00:00
Michael Sparmann
4562e683a2 Implement iPod Nano 2G nand_get_info()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23238 a1c6a512-1295-4272-9138-f99709370657
2009-10-17 23:00:49 +00:00
Michael Sparmann
6b17295926 Bring the iPod Nano 2G shutdown FTL panics back.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23126 a1c6a512-1295-4272-9138-f99709370657
2009-10-12 08:54:51 +00:00
Michael Sparmann
264d877889 Add a thread to power down the NAND after inactivity on the iPod Nano 2G
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23106 a1c6a512-1295-4272-9138-f99709370657
2009-10-11 12:45:27 +00:00
Michael Sparmann
e6c8a185e5 Implement NAND power management for iPod Nano 2G
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23099 a1c6a512-1295-4272-9138-f99709370657
2009-10-11 10:10:49 +00:00
Michael Sparmann
f0a96580ae Core changes to allow storage drivers to do cleanup on shutdown, and iPod Nano 2G shutdown code rework (FS#10668)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23057 a1c6a512-1295-4272-9138-f99709370657
2009-10-09 20:36:09 +00:00
Dave Chapman
a7ea270e9c Read/write Nano2G FTL/NAND driver by Michael Sparmann (FS#10633).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22918 a1c6a512-1295-4272-9138-f99709370657
2009-10-04 15:02:40 +00:00
Frank Gevaerts
c247483ef1 fix ata-nand-s5l8700 compilation properly this time
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21938 a1c6a512-1295-4272-9138-f99709370657
2009-07-17 23:19:21 +00:00
Frank Gevaerts
c0a5a67387 Commit FS#9545, storage cleanup and multi-driver support
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21933 a1c6a512-1295-4272-9138-f99709370657
2009-07-17 22:28:49 +00:00
Rafaël Carré
9191b3c16e remove nand_soft_reset and nand_disk_is_active already voided in storage.h
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21924 a1c6a512-1295-4272-9138-f99709370657
2009-07-17 16:34:41 +00:00
Rafaël Carré
bdb5974c0e Revert r21912 : "Storage API : remove undeeded target-specific functions"
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
2009-07-17 16:34:34 +00:00
Rafaël Carré
8eba69f91b Storage API : remove undeeded target-specific functions
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
2009-07-17 00:09:14 +00:00
Bertrik Sikken
92fed35da6 S5L8700/Meizu: miscellaneous minor fixes, stubs added, keywords set
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21820 a1c6a512-1295-4272-9138-f99709370657
2009-07-12 19:36:27 +00:00
Frank Gevaerts
e86d651647 make the meizu bootloaders compile again with the new storage infrastructure
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19088 a1c6a512-1295-4272-9138-f99709370657
2008-11-11 14:11:49 +00:00
Frank Gevaerts
147a23a6ed More storage work.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19003 a1c6a512-1295-4272-9138-f99709370657
2008-11-04 19:36:17 +00:00
Daniel Stenberg
2acc0ac542 Updated our source code header to explicitly mention that we are GPL v2 or
later. We still need to hunt down snippets used that are not. 1324 modified
files...
http://www.rockbox.org/mail/archive/rockbox-dev-archive-2008-06/0060.shtml


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17847 a1c6a512-1295-4272-9138-f99709370657
2008-06-28 18:10:04 +00:00
Marcoen Hirschberg
7b10ef9a7c initial Meizu M6SL port (take 2)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17819 a1c6a512-1295-4272-9138-f99709370657
2008-06-27 23:24:34 +00:00