Commit graph

29 commits

Author SHA1 Message Date
Torne Wuff
5db83c155a pp5020: use ipod firmware timings for ATA PIO.
Some mSATA adapters seem to have trouble working with Rockbox using our
normal PIO timings; the timing value we use is probably out of spec and
is different to the OF. Switch to using the OF's timings according to
which PIO mode we select. This may not completely resolve problems with
these adapters but allows Rockbox to boot and play audio.

Change-Id: If73210700eb4af01864b373709ee1d15c775fb11
2020-11-04 03:03:19 +00:00
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
Cástor Muñoz
e9497dbf6d iPod Classic: ATA SMART updates
- Add description for attributes supported by Samsung HS081HA (80Gb)
  and HS161JQ (CEATA 160Gb).
- Show error code when ata_read_smart() fails.

Change-Id: I618cc4f37d139fc90f596e2cf3a751346b27deb6
2016-02-14 15:17:42 +01:00
Cástor Muñoz
d20185ac96 iPod Classic: reads HDD S.M.A.R.T. data
Adds ata_read_smart() function to storage ATA driver, current
SMART data can be displayed and optionally written to hard
disk using System->Debug menu.

Change-Id: Ie8817bb311d5d956df2f0fbfaf554e2d53e89a93
2015-10-07 06:15:04 +02: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
Boris Gjenero
e4dbcc414b FS#12418 - Merge prototypes from ata-target.h files into new file ata-driver.h. After this change:
- ata.h is for users of ata.c
- ata-driver.h is for functions implemented by target-specific code and used by ata.c
- ata-target.h is for target-specific defines


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31182 a1c6a512-1295-4272-9138-f99709370657
2011-12-08 21:23:53 +00:00
Rafaël Carré
814ffffdbe Add INIT_ATTR to storage_init() when possible
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31036 a1c6a512-1295-4272-9138-f99709370657
2011-11-20 18:44:40 +00:00
Michael Sparmann
6f40387e74 Fix yellow
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28952 a1c6a512-1295-4272-9138-f99709370657
2011-01-02 23:09:01 +00:00
Michael Sparmann
1a1fc09863 Fix red
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28951 a1c6a512-1295-4272-9138-f99709370657
2011-01-02 23:02:55 +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
Michael Sevakis
bc8cab4c24 Commit the common portion of FS#9708: ATA (IDE) DMA by Boris Gjenero with a couple cosmetic tweaks and without the inclusion of 'FS#9721: No error check after writes in ata.c'changes (which can be done separately). No code is changed for targets without HAVE_ATA_DMA defined other than to not display DMA modes in the View Disk Info debug screen if not using DMA (Gigabeat F/X/S were). No target uses the code yet but Gigabeat S use will follow shortly.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20298 a1c6a512-1295-4272-9138-f99709370657
2009-03-12 02:01:25 +00:00
Frank Gevaerts
6f32dab2ae *_hard_reset() is only used inside ata.c, so there's no need to export it to the world
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19004 a1c6a512-1295-4272-9138-f99709370657
2008-11-04 19:37:28 +00:00
Frank Gevaerts
19eb800f75 conditionalise *_get_info() to get some binsize back
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18965 a1c6a512-1295-4272-9138-f99709370657
2008-11-01 17:33:21 +00:00
Frank Gevaerts
2f8a0081c6 Apply FS#9500. This adds a storage_*() abstraction to replace ata_*(). To do that, it also introduces sd_*, nand_*, and mmc_*.
This should be a good first step to allow multi-driver targets, like the Elio (ATA/SD), or the D2 (NAND/SD).


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18960 a1c6a512-1295-4272-9138-f99709370657
2008-11-01 16:14:28 +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
Michael Sevakis
80278e45aa Bring Gigabeat S bootloader one step close to a release version.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17442 a1c6a512-1295-4272-9138-f99709370657
2008-05-10 18:00:11 +00:00
Jonathan Gordon
327f845adf remove the 2nd last evil use of ata_disk_is_active() in apps/
the last abuse is in battery bench


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17292 a1c6a512-1295-4272-9138-f99709370657
2008-04-30 09:23:12 +00:00
Jonathan Gordon
bd47d48c21 Do the CONFIG_LED define
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12383 a1c6a512-1295-4272-9138-f99709370657
2007-02-18 05:07:19 +00:00
Magnus Holmgren
2067fcc695 Fix most (all?) CONFIG_LED warnings.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12370 a1c6a512-1295-4272-9138-f99709370657
2007-02-17 23:22:37 +00:00
Nils Wallménius
1b85f60ae0 Permanently enable powering down the disk when it's sleeping for supported targets (iriver h1xx, h3xx and h10, iaudio x5, gigabeat and archos recorders)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12094 a1c6a512-1295-4272-9138-f99709370657
2007-01-23 15:43:37 +00:00
Miika Pekkarinen
077ed4925e Prevent the click of death when connecting an ipod to usb.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11622 a1c6a512-1295-4272-9138-f99709370657
2006-11-29 12:17:26 +00:00
Jonathan Gordon
f184152c05 * changes to ata.c - idle callbacks are called after 2 sec of real idle,
and shutdown and usb (it makes sense here). ata_sleep doesnt get broken
by callbacks.
* allow ata_sleep() at the end of buffering again
* config block uses ata_idle instead of delayed sector when saving
* remove delayed sector code from ata_mmc.c (idle callbacks are not yet
implemented for ata_mmc.c tho)


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11461 a1c6a512-1295-4272-9138-f99709370657
2006-11-08 01:55:26 +00:00
Jens Arnold
a8c1c20305 Removed unused ata_standby(), changed return type of ata_sleep() to void, removed misleading comment from ata.h
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7782 a1c6a512-1295-4272-9138-f99709370657
2005-11-07 23:19:06 +00:00
Jens Arnold
5690f78fb2 Multiple choice LED configuration instead of HAVE_LED. Removes erroneous MMC icon display on iriver, and saves some code on Ondio. Removed invert_led() as it is no longer used.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6568 a1c6a512-1295-4272-9138-f99709370657
2005-06-04 23:15:52 +00:00
Linus Nielsen Feltzing
68482bbed2 Patch #868645 by Philipp Pertermann, volume triggered recording for the Archos recording devices
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6243 a1c6a512-1295-4272-9138-f99709370657
2005-04-04 09:12:12 +00:00
Jörg Hohensohn
da84857631 prepared to mount multiple partitions into one logical file system (most useful for Ondio, internal memory + external MMC)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5514 a1c6a512-1295-4272-9138-f99709370657
2004-12-28 22:16:07 +00:00
Jens Arnold
0ceaa5e365 Const policed pointer arguments to functions, part 2
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4996 a1c6a512-1295-4272-9138-f99709370657
2004-08-17 01:45:48 +00:00
Linus Nielsen Feltzing
159d04d3f9 Experiment: enable ATA STANDBY when switching to USB mode
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3668 a1c6a512-1295-4272-9138-f99709370657
2003-05-10 01:55:23 +00:00
Daniel Stenberg
e597ca4732 Move publicly (from apps) accessed files from drivers/ to export/.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3219 a1c6a512-1295-4272-9138-f99709370657
2003-02-07 10:08:02 +00:00
Renamed from firmware/drivers/ata.h (Browse further)