Age | Commit message (Collapse) | Author |
|
Change-Id: I6f2d4d05249dc01b48caa1507ee0e71496c67ba6
|
|
Use CMD_* macros instead. Makes the code a bit easier to follow.
No functional change.
Change-Id: Ieb3d8f6fcca503421d3067aafbd0011a908368e0
|
|
After continued reports of corruption using iFlash adapters, I went
digging for more clues, and this combination of changes seemed to
solve data corruption with the iFlash adapters on the ipod video:
1) Instead of SLEEP, use STANDBY_IMMEDIATE when we detect drive
as an SSD or CFA-compliant device. The latter is technically higher
power than the former, but what this means in practice is unclear.
2) Don't check ATA powermanagement flag prior to issuing powermgmt
commands. This reverts the previous "workaround" for the FC1307A --
and PM is a mandatory part of the ATA spec for any CFA device.
3) Prior to issuing SLEEP/STANDBY_IMMEDIATE, issue FLUSH CACHE. The
ATA spec says this is redundant for the latter, but says nothing
about the former. Either way it is always safe to call first.
4) Delete all other FC1307A_WORKAROUND code related to powermgmt flags.
Change-Id: I492d06664c097d9bbd5cccfb9f5b516da165b1ee
|
|
The storage subsystem aggressively issues SLEEPNOW events when idle
and power off happened a fixed 2s later. This turns out to not be
enough time for FC1307A (eg iFlash) adapters to flush outstanding writes.
So, when we detect a lack of PM support, increase the poweroff delay to
5 seconds to compensate for not being able to issue the ATA SLEEP command.
Hopefully this is enough time. If not, we will have to re-disable PM
entirely when we detect these popular adapters. Thankfully that is now
just an #ifdef away.
Change-Id: I4112b9acb965973d81f70483bd9d595461c7301c
|
|
The FC1307A ATA->SD chipset (used by the common iFlash adapters)
doesn't support mandatory ATA power management commands, leading to
massive data corruption if they were issued.
A workaround was identified (54629073ae) that basically disabled all of
rockbox's power management code for these adapters, which extends well
beyond the specific ATA commands issued.
This patch moves the gating test to the issuance of the actual SLEEP,
so that the rest of rockbox's PM code can function as intended. This
allows the device to get powered down when idle, yielding potentially
significant improvements in battery life.
Change-Id: Ia13e2405243fe5efe6f68c3a549ab4933567790b
|
|
SSDs that respect powermgmt commands should be treated the same, as the
powermgmt commands are an important part of ensuring it's safe to shut
down.
And greatly expand the comment explaining things.
Change-Id: Ia52b99fca802f495422b5ee097390a72dbc28f61
|
|
support power management
Commit 5462907 made sure that SLEEP commands weren't issued on devices that don't support ATA power management commands (e.g. certain CF->SD converters including several iFlash models).
Since Rockbox waits for the disk to become inactive in shutdown_hw(), which won't happen in this case, the OS would previously stall during the shutdown process until a timeout was reached.
Change-Id: I03bb05f6f6401bb8f0da5d0b76bd3f07681fdc06
|
|
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
|
|
Not all devices advertise this flag, unfortunately.
Change-Id: I6d666febdfcba7598e4d29df7d05c0a288e15158
|
|
The FC-1307 CF->SD converter that is the basis of a lot of ATA->CF
devices (including several iflash iFlash models) claims to not support
ATA power management commands.
Rockbox unconditionally issues those commands as support is mandated by
the ATA spec. This patch checks the capability bit, and if it's not
supported, does not attempt to put the ATA subsystem to sleep.
It is not clear if the problems lie with the SLEEP commands or the wakeup
process, but who knows where else the FC1307 violates the ATA specs, and
reliability is much more important than power savings.
Change-Id: I8b539c579d0449a8a3cfa63cdd1387db990fe820
|
|
Change-Id: I0a7681be7d703c1baa7f8bd7b5e31f04f20f299d
|
|
* 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
|
|
Many includes of fat.h are pointless. Some includes are just for
SECTOR_SIZE. Add a file 'firmware/include/fs_defines.h' for that
and to define tuneable values that were scattered amongst various
headers.
Remove some local definitions of SECTOR_SIZE since they have to be
in agreement with the rest of the fs code anyway.
(We'll see what's in fact pointless in a moment ;)
Change-Id: I9ba183bf58bd87f5c45eba7bd675c7e2c1c18ed5
|
|
Except for unfinished or experimental ports, it isthe case that
USE_ROCKBOX_USB and HAVE_USBSTACK are both defined or both undefined.
Furthermore, it is a leftover of some early developments on the USB stack and
doesn't make sense anymore.
Change-Id: Ic87a865b6bb4c7c9a8d45d1f0bb0f2fb536b8cad
Reviewed-on: http://gerrit.rockbox.org/1091
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
|
|
* HWCODEC bootloaders
* Remove references to thread structures outside the kernel. They are
private and should not be used elsewhere. The mrobe-100 is an offender
that gets squashed.
* The ata.c hack stuff for large sector disks on iPod Video gets squashed
for the same reason. I will no longer maintain it, period; please find
the real reason for its difficulties.
Change-Id: Iae1a675beac887754eb3cc59b560c941077523f5
|
|
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
|
|
This change is motivated by the ATA specs, section 9.2 Software reset protocol
(quote):
A host should issue an IDENTIFY DEVICE and/or IDENTIFY PACKET DEVICE
command after the software reset protocol has completed to determine the
current status of features implemented by the device(s).
This indeed fixes a local issue with an SSD in an iriver h320. No other tests
were carried out.
Change-Id: I191444aec3e55f6890020f601c715d0022d09fb6
Reviewed-on: http://gerrit.rockbox.org/218
Reviewed-by: Bertrik Sikken <bertrik@sikken.nl>
Reviewed-by: Linus Nielsen Feltzing <linus@haxx.se>
Reviewed-by: Peter D'Hoye <peter.dhoye@gmail.com>
Tested-by: Peter D'Hoye <peter.dhoye@gmail.com>
Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
|
|
It was only needed by the old arm toolchain that we no longer use or support.
Change-Id: Id0e6c67477f8834a637079b03cde5fbf9da68b1c
Reviewed-on: http://gerrit.rockbox.org/233
Reviewed-by: Nils Wallménius <nils@rockbox.org>
|
|
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
|
|
on. Note that ATA power may still need to be turned on when starting, so that code in ata_init() always remains.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31079 a1c6a512-1295-4272-9138-f99709370657
|
|
ata_init().
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31067 a1c6a512-1295-4272-9138-f99709370657
|
|
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30943 a1c6a512-1295-4272-9138-f99709370657
|
|
* Remove THREAD_ID_CURRENT macro in favor of a thread_self() function, this allows thread functions to be simpler.
* thread_self_entry() shortcut for kernel.c.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29521 a1c6a512-1295-4272-9138-f99709370657
|
|
(code), use the already defined MEMORYSIZE instead.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29189 a1c6a512-1295-4272-9138-f99709370657
|
|
tick when polling drive status. This prevents pointless jumps to overdrive speed from perceived high load when waiting for lengthy ops to complete such as spinup and sleep.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29108 a1c6a512-1295-4272-9138-f99709370657
|
|
function use. SYS_USB_DISCONNECTED_ACK hasn't been doing anything useful for the USB thread; remove it. USB thread simply ignores that value. Observe only valid usb_state transitions.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29084 a1c6a512-1295-4272-9138-f99709370657
|
|
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29003 a1c6a512-1295-4272-9138-f99709370657
|
|
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29002 a1c6a512-1295-4272-9138-f99709370657
|
|
after recent ATA changes.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28962 a1c6a512-1295-4272-9138-f99709370657
|
|
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28957 a1c6a512-1295-4272-9138-f99709370657
|
|
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28952 a1c6a512-1295-4272-9138-f99709370657
|
|
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28951 a1c6a512-1295-4272-9138-f99709370657
|
|
for non-memory-mapped task file registers.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28950 a1c6a512-1295-4272-9138-f99709370657
|
|
matters). Make sure 'sleeping' is 'false' before the powerup sequence (throws-off powermgmt and it *is* about to woken again and powermgmt will need to compensate). Avoid looking at mutex flag directly; there's no tangible benefit I can discern and changes to the kernel that alter the meaning shouldn't be able to break anything. For that, in the jz sd driver, have sd_disk_is_active just return 'false' like all the other SD drivers do. If it *must* return this, it should implement it's own method but it seems to not matter.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26234 a1c6a512-1295-4272-9138-f99709370657
|
|
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26111 a1c6a512-1295-4272-9138-f99709370657
|
|
sizes if the drive is sane.
The ipod video build has a MAX_PHYS_SECTOR_SIZE of 1024. This meant it would refuse to boot on drives with sectors larger than 1024 bytes, even if those drives don't actually require the workaround originally intended for the 80GB 5.5G's drive.
ata_init() will now, if the drive claims to have >512 byte sectors, try and read sector 1 to determine if the drive is capable of emulating 512-byte sector accesses. If this succeeds, we assume the drive is better at it than us (this is very likely to be true) and set phys_sector_mult to 1, disabling the workaround and ensuring the drive will work regardless of sector size.
Making use of this change requires that you build and install an updated bootloader as well as the main build; a new iPod bootloader will be released soon, so if you can't do this yourself, be patient.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25646 a1c6a512-1295-4272-9138-f99709370657
|
|
sector not valid).
There's no point retrying these requests for five seconds, the sector number isn't going to get any more valid. It interferes with being able to detect broken drives like the 5.5G 80GB iPod's.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25525 a1c6a512-1295-4272-9138-f99709370657
|
|
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24444 a1c6a512-1295-4272-9138-f99709370657
|
|
Patch by Boris Gjenero (dreamlayers). Writes are retried on failure now so this should be safe.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23741 a1c6a512-1295-4272-9138-f99709370657
|
|
Writes will now be retried if they fail, and will be done using multisector transfers which should be faster.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23740 a1c6a512-1295-4272-9138-f99709370657
|
|
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21933 a1c6a512-1295-4272-9138-f99709370657
|
|
instead of 1<<n. Speeds up things on SH1, and also reduces core binsize. Most notable speedups: 1 bit lcd driver: drawpixel +20%, drawline + 27%, hline +5%; jpeg viewer: +8% for 1/8 scaling. Other targets are unaffected.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21205 a1c6a512-1295-4272-9138-f99709370657
|
|
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
|
|
again. This should fix LBA48 issues.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20208 a1c6a512-1295-4272-9138-f99709370657
|
|
SYS_USB_CONNECTED. This way HDDs are spun down properly afterwards before rebooting to USB.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20082 a1c6a512-1295-4272-9138-f99709370657
|
|
the USB core whether or not any drivers require exclusive access at the moment of connect. Doing anthing else just produces nasty effects on Windows because it expects some communication just for enabling the PHY and not allowing it to mount volumes if a thread doesn't ack causes annoying error message boxes. Make behavior of each USB type identical from the system perspective. Some miscellaneous changes (simplify, ata->storage naming, define only used USB_* enums values were possible).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19762 a1c6a512-1295-4272-9138-f99709370657
|
|
unsigned. On SH1, gcc optimizes this by using a right shift, and a signed '1' made it use an arithmetic right-shift-by-n, which is a libgcc function on SH1. This was the only place in the core using it. No effect on other architectures.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19399 a1c6a512-1295-4272-9138-f99709370657
|
|
gives a buffer against wrongly identifying a thread when the slot is recycled (which has been nagging me for awhile). A slot gets 255 uses before it repeats. Everything gets incompatible so a full update is required.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19377 a1c6a512-1295-4272-9138-f99709370657
|
|
the world
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19004 a1c6a512-1295-4272-9138-f99709370657
|
|
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18965 a1c6a512-1295-4272-9138-f99709370657
|