summaryrefslogtreecommitdiff
path: root/firmware/drivers/ata.c (follow)
Commit message (Collapse)AuthorAge
* Do some housekeeping with fat.h and SECTOR_SIZEMichael Sevakis2017-03-12
| | | | | | | | | | | | | | 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
* Get rid of USE_ROCKBOX_USBAmaury Pouly2015-01-08
| | | | | | | | | | | 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>
* Fix some more straggling stuffMichael Sevakis2014-08-08
| | | | | | | | | | | | | | * 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
* 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 identify() call to reset proceduresJonas Wielicki2012-05-19
| | | | | | | | | | | | | | | | | | | 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>
* Remove STATICIRAM hackNils Wallménius2012-05-08
| | | | | | | | 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>
* FS#12418 - Merge prototypes from ata-target.h files into new file ↵Boris Gjenero2011-12-08
| | | | | | | | | | | 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
* If Rockbox never turns off ATA power, don't compile code for turning it back ↵Boris Gjenero2011-11-27
| | | | | | 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
* Add STORAGE_INIT_ATTR to static ata.c functions that are only called via ↵Boris Gjenero2011-11-27
| | | | | | ata_init(). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31067 a1c6a512-1295-4272-9138-f99709370657
* Remove last_sleep when it's not needed because IDE power is never turned off.Boris Gjenero2011-11-08
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30943 a1c6a512-1295-4272-9138-f99709370657
* Change the thread api a bit.Thomas Martitz2011-03-05
| | | | | | | * 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
* Clean up multiple definitions of RAM size. Remove -DMEM (make) and MEM ↵Andree Buschmann2011-02-02
| | | | | | (code), use the already defined MEMORYSIZE instead. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29189 a1c6a512-1295-4272-9138-f99709370657
* i.MX31: Busy wait for a couple microseconds at most then sleep until next ↵Michael Sevakis2011-01-22
| | | | | | 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
* Try to get some control over #ifdef hell in usb.c by refactoring and inline ↵Michael Sevakis2011-01-18
| | | | | | 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
* Oops, that didn't belong in there.Michael Sparmann2011-01-07
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29003 a1c6a512-1295-4272-9138-f99709370657
* Fix CS42L55 (iPod Classic) tone controlMichael Sparmann2011-01-07
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29002 a1c6a512-1295-4272-9138-f99709370657
* Fix USB storage driver. ata_get_info was no longer filling-in num_sectors ↵Michael Sevakis2011-01-04
| | | | | | after recent ATA changes. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28962 a1c6a512-1295-4272-9138-f99709370657
* Fix regression from r28950: ATA broken on MPIO and possibly other targetsMichael Sparmann2011-01-03
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28957 a1c6a512-1295-4272-9138-f99709370657
* Fix yellowMichael Sparmann2011-01-02
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28952 a1c6a512-1295-4272-9138-f99709370657
* Fix redMichael Sparmann2011-01-02
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28951 a1c6a512-1295-4272-9138-f99709370657
* Rework ATA driver to get rid of lots of target-specific constants and allow ↵Michael Sparmann2011-01-02
| | | | | | for non-memory-mapped task file registers. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28950 a1c6a512-1295-4272-9138-f99709370657
* ata: do some threading-related corrections (some sync related where it ↵Michael Sevakis2010-05-21
| | | | | | 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
* Do s/SWAP_WORDS/ATA_SWAP_WORDS/ to prevent namespace clashes.Maurus Cuelenaere2010-05-17
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26111 a1c6a512-1295-4272-9138-f99709370657
* Make builds with MAX_PHYS_SECTOR_SIZE defined (ipod video) work with larger ↵Torne Wuff2010-04-14
| | | | | | | | | | | | | 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
* Make ATA code not bother to retry requests that return IDNF (specified ↵Torne Wuff2010-04-07
| | | | | | | | | 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
* FS#10955 - LBA48 builds doesn't compile after ata read/write unificationTorne Wuff2010-02-01
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24444 a1c6a512-1295-4272-9138-f99709370657
* FS#9721 - No error check after writes in ata.cTorne Wuff2009-11-24
| | | | | | | 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
* FS#10798 - unify ata_read_sectors and ata_write_sectorsTorne Wuff2009-11-24
| | | | | | | 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
* 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
* Convert a number of places in core and plugins to use the BIT_N() macro ↵Jens Arnold2009-06-07
| | | | | | 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
* Commit the common portion of FS#9708: ATA (IDE) DMA by Boris Gjenero with a ↵Michael Sevakis2009-03-12
| | | | | | 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
* Use total_sectors in ata_get_info() instead of calculating it all over ↵Frank Gevaerts2009-03-05
| | | | | | again. This should fix LBA48 issues. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20208 a1c6a512-1295-4272-9138-f99709370657
* Submit FS#9863 by Boris Gjenero. Correct ATA wakeup and power on in case of ↵Andree Buschmann2009-02-22
| | | | | | 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
* USB retweaking: Take out the USB_REQUEST/RELEASE_DISK scheme and simply ask ↵Michael Sevakis2009-01-13
| | | | | | 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
* Reclaim a bit of binsize on hdd based archoses by making the bit test ↵Jens Arnold2008-12-12
| | | | | | 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
* Use cookies for thread identification instead of pointers directly which ↵Michael Sevakis2008-12-10
| | | | | | 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
* *_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
* Apply FS#9500. This adds a storage_*() abstraction to replace ata_*(). To do ↵Frank Gevaerts2008-11-01
| | | | | | | | | 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
* Simplify preprocessor symbols a bit (FS#9457). Thanks to Alexander LevinFrank Gevaerts2008-10-15
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18816 a1c6a512-1295-4272-9138-f99709370657
* fix yellow. Don't do the spindown/usb things in the bootloaderFrank Gevaerts2008-10-03
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18696 a1c6a512-1295-4272-9138-f99709370657
* Accept FS#8943, allow disk spindown during USB connection for software usbFrank Gevaerts2008-10-02
| | | | | | | Implementation by Linus Nielsen Feltzing git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18685 a1c6a512-1295-4272-9138-f99709370657
* Make local variable staticBertrik Sikken2008-07-18
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18089 a1c6a512-1295-4272-9138-f99709370657
* Updated our source code header to explicitly mention that we are GPL v2 orDaniel Stenberg2008-06-28
| | | | | | | | | 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
* Reinstate the awful ATA hack that has no proper reason to exist for iPod ↵Michael Sevakis2008-06-03
| | | | | | 5.5g 60GB and/or 80GB. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17682 a1c6a512-1295-4272-9138-f99709370657
* Actually remove the ata lock hack code for that had been used for iPod Video ↵Michael Sevakis2008-05-17
| | | | | | 60/80. It has been disabled for awhile anyway and the problem that nescessitated it really appears resolved. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17558 a1c6a512-1295-4272-9138-f99709370657
* Disable the ata locking hack since a recent test strongly suggests it has ↵Michael Sevakis2008-05-11
| | | | | | been resolved as of r17426. Leave the code for now just in case. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17468 a1c6a512-1295-4272-9138-f99709370657
* Bring Gigabeat S bootloader one step close to a release version.Michael Sevakis2008-05-10
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17442 a1c6a512-1295-4272-9138-f99709370657
* Fix the short audio dropout at disk spinup from power-off on portalplayer ↵Jens Arnold2008-05-08
| | | | | | targets (observed on Mini G2, probably affected others as well). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17426 a1c6a512-1295-4272-9138-f99709370657
* Apply 2 small size optimisations. * Put ICODE_ATTR into the function ↵Jens Arnold2008-05-08
| | | | | | definitions where applicable, saving the separate declaration. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17408 a1c6a512-1295-4272-9138-f99709370657