summaryrefslogtreecommitdiff
path: root/drivers/block
Commit message (Collapse)AuthorAgeLines
...
* ahci: Fix 'Invaild' typoTaylor Hutt2012-11-02-1/+1
| | | | | | | | This fixes a spelling error in a message which can be output to the console. Signed-off-by: Taylor Hutt <thutt@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
* ahci: Use sizeof(fis) instead of hardcoding '20'Taylor Hutt2012-11-02-5/+5
| | | | | | | | This cleanup replaces the hardcoded use of '20', which represents the number of bytes in the FIS, with sizeof(fis). Signed-off-by: Taylor Hutt <thutt@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
* ahci: Make the AHCI code find the capacity of disks > 128 GB properlyGabe Black2012-11-02-5/+50
| | | | | | | | | | | | | | | | | | | | | | | In the structure returned by the ATA identify device command, there are two fields which describe the device capacity. One is a 32 bit data type which reports the number of sectors as a 28 bit LBA, and the other is a 64 bit data type which is for a 48 bit LBA. If the device doesn't support 48 bit LBAs, the small value is the only value with the correct size. If it supports more, if the number of sectors is small enough to fit into 28 bits, both fields reflect the correct value. If it's too large, the smaller field has 28 bits of 1s, 0xfffffff, and the other field has the correct value. The AHCI driver is implemented by attaching to the generic SCSI code and translating on the fly between SCSI binary data structures and AHCI data structures. It responds to requests to execute specific SCSI commands by executing the equivalent AHCI commands and then crafting a response which matches what a SCSI disk would send. The AHCI driver now considers both fields and chooses the correct one when implementing both the SCSI READ CAPACITY (10) and READ CAPACITY (16) commands. Signed-off-by: Gabe Black <gabeblack@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
* ahci: support scsi writing in AHCI driverHung-Te Lin2012-11-02-24/+30
| | | | | | | | | | | | | | | | | | The "scsi write" command requires support from underlying driver. This CL enables SCSI_WRITE10 in AHCI driver. Tested in U-Boot console, try to i/o with sector #64: scsi read 1000 40 1 md.b 1000 200 # check if things are not 0xcc mw.b 1000 cc 200 # try to fill with 0xcc scsi write 1000 40 1 mw.b 1000 0 200 # fill with zero md.b 1000 200 # should be all 0 scsi read 1000 40 1 md.b 1000 200 # should be all 0xcc Signed-off-by: Hung-Te Lin <hungte@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
* ahci: Make sending the SETFEATURES_XFER command optionalGabe Black2012-11-02-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | This command doesn't really do anything when talking to a SATA device, and sending it confuses some of them. This change makes sending the command optional, and defaults to not. The situations where it should be sent are not the common case. With the standard SSD in the machine, here are some times with the option turned off: 1. 8277 2. 8273 3. 8050 And turned on: 1. 8303 2. 8155 3. 8276 Sending that command seems to have no meaningful effect on performance. This fixes problems with an SSD marked Toshiba NV6424, Taiwan 11159AE P and TC58NVG5D2FTA10. Signed-off-by: Gabe Black <gabeblack@chromium.org> Signed-off-by: Taylor Hutt <thutt@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
* ahci: cosmetics and cleanupStefan Reinauer2012-11-02-7/+18
| | | | | | | | | | | | | | | | - print the correct speed - print all the AHCI capability flags (information taken from Linux kernel driver) - clean up some comments For example, this might show the following string: AHCI 0001.0300 32 slots 6 ports 6 Gbps 0x3 impl SATA mode Signed-off-by: Stefan Reinauer <reinauer@chromium.org> Commit-Ready: Stefan Reinauer <reinauer@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Stefan Reinauer <reinauer@chromium.org>
* ahci: Improve AHCI debuggingStefan Reinauer2012-11-02-1/+2
| | | | | | | | - remove unused ssleep macro - add some useful debugging information Signed-off-by: Stefan Reinauer <reinauer@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
* ahci: Optimise AHCI controller reset and start-upStefan Reinauer2012-11-02-9/+15
| | | | | | | | | | The existing code waits a whole second for the AHCI controller to reset. Instead, let's poll the status register to see if the reset has succeeded and return earlier if possible. This brings down the time for AHCI probing from 1s to 20ms. Signed-off-by: Stefan Reinauer <reinauer@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
* ahci: Support splitting of read transactions into multiple chunksVadim Bendebury2012-11-02-29/+69
| | | | | | | | | | | | | With an Intel AHCI controller, the driver does not operate properly if the requested amount of blocks to read exceeds 255. It is probably possible to specify 0 as the block count and the driver will read 256 blocks, but it was decided to limit the number of blocks read at once to 128 (it should be a power of 2 for the optimal performance of solid state drives). Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
* sata.h: Make all sata/ata drivers include <sata.h>Pavel Herrmann2012-10-15-16/+7
| | | | | | | | | | - block_dev_desc_t says that block_(read|write) take lbaint_t for blkcnt not ulong. - We also move the extern of sata_dev_desc into <sata.h> - Remove now duplicate declarations from driver-specific headers. Signed-off-by: Tom Rini <trini@ti.com> Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com>
* sil_sata: Make sata_write() comply with <part.h>Tom Rini2012-10-15-3/+3
| | | | | | | sata_write() takes a const void as the last argument. Fixing this means we also need to make ata_low_level_rw_lba{28,48} also take a const void. Signed-off-by: Tom Rini <trini@ti.com>
* sata_dwc: Make sata_write() use const void, per <part.h>Tom Rini2012-10-15-1/+1
| | | | Signed-off-by: Tom Rini <trini@ti.com>
* pata_bfin: Make sata_{read,write}() comply with <part.h>Tom Rini2012-10-15-2/+2
| | | | | | These functions take lbaint_t for blkcnt. Signed-off-by: Tom Rini <trini@ti.com>
* fsl_sata: Make sata_{read,write}() comply with <part.h>Tom Rini2012-10-15-4/+6
| | | | | | | | | - sata_write() takes a const void as the last argument. Fixing this means we also need to make ata_low_level_rw_lba{28,48} also take a const void. - Both sata_{read,write} take lbaint_t for blkcnt and ulong for blknr Signed-off-by: Tom Rini <trini@ti.com>
* dwc_ahsata: Make sata_write() comply with <part.h>Tom Rini2012-10-15-4/+4
| | | | | | | | sata_write() takes a const void as the last argument. Fixing this means we also need to make ata_low_level_rw_lba{28,48} also take a const void. Acked-by: Stefano Babic <sbabic@denx.de> Signed-off-by: Tom Rini <trini@ti.com>
* ata_piix: sata_write must take a const void argument.Tom Rini2012-10-15-2/+2
| | | | Signed-off-by: Tom Rini <trini@ti.com>
* ata_piix: Fix checkpatch issuesTom Rini2012-10-15-267/+232
| | | | | | | | While in here also: - Switch to debug from custom PRINTF for debugging. - Use mdelay rather than custom msleep. Signed-off-by: Tom Rini <trini@ti.com>
* remove unnecessary code in ata_piixPavel Herrmann2012-09-28-3/+0
| | | | | | | | | | We set sata_curr_device to 0 right after returning from init_sata(), so there's no point in setting it to the last scanned driver at this point. Note: there are more duplicities with cmd_sata, but those might be required, as the code seems to reset the entire controller on every scan, ignoring the requested port number. Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com>
* block: systemace: Simplify base and width initializationMichal Simek2012-09-11-13/+25
| | | | | | | Use CONFIG parameters only at one location to simplify the code. Also create ace_readw/writew functions. Signed-off-by: Michal Simek <monstr@monstr.eu>
* Remove remaining mdelay() macrosAnatolij Gustschin2012-07-08-1/+0
| | | | | | | Drop mdelay() macros since we already have a common mdelay() func. Signed-off-by: Anatolij Gustschin <agust@denx.de> Acked-by: Mike Frysinger <vapier@gentoo.org>
* Block: Remove MG DISK supportMarek Vasut2012-06-21-731/+0
| | | | | | | | This driver is unused and obsolete. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Wolfgang Denk <wd@denx.de> Cc: unsik Kim <donari75@gmail.com>
* SATA: add driver for MX5 / MX6 SOCsStefano Babic2012-05-15-0/+1305
| | | | | | | | | | This driver is part of Freescale's LTIB for MX5 / MX6. Signed-off-by: Stefano Babic <sbabic@denx.de> Signed-off-by: Terry Lv <r65388@freescale.com> CC: Fabio Estevam <fabio.estevam@freescale.com> CC: Dirk Behme <dirk.behme@de.bosch.com>
* Blackfin: pata_bfin: fix printf warningMike Frysinger2012-02-12-1/+1
| | | | | | | | pata_bfin.c: In function 'bfin_ata_identify': pata_bfin.c:887:2: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'lbaint_t' Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* mvsata: fix ide_preinit for missing disksSimon Guinot2011-12-06-6/+8
| | | | | | | | Consider that ide_preinit() succeed if at least one port is successfully initialized. This allows to iniatialize IDE support on a board with two SATA ports but a single hard disk available. Signed-off-by: Simon Guinot <simon.guinot@sequanux.org>
* drivers/block/sata_dwc.c: Fix GCC 4.6 build warningWolfgang Denk2011-12-02-5/+1
| | | | | | | | | | Fix: sata_dwc.c: In function 'scan_sata': sata_dwc.c:535:38: warning: variable 'udma_mask' set but not used [-Wunused-but-set-variable] Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Kazuaki Ichinohe <kazuichi@fsi.co.jp>
* powerpc/85xx: always implement the work-around for Erratum SATA_A001Timur Tabi2011-11-29-21/+1
| | | | | | | | | | On the P1022/P1013, the work-around for erratum SATA_A001 was implemented only if U-Boot initializes SATA, but SATA is not initialized by default. So move the work-around to the CPU initialization function, so that it's always executed on the SOCs that need it. Signed-off-by: Timur Tabi <timur@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* ftide020: fix incorrect information display formatMacpaul Lin2011-11-18-3/+2
| | | | | | Fix incorrect information display format when probing the device. Signed-off-by: Macpaul Lin <macpaul@andestech.com>
* sata_dwc.c: Fix GCC 4.6 build warningsStefan Roese2011-11-16-32/+3
| | | | | | | | | | | | | | | | | | Fix: sata_dwc.c: In function 'sata_dwc_softreset': sata_dwc.c:444:5: warning: variable 'status' set but not used [-Wunused-but-set-variable] sata_dwc.c:443:6: warning: variable 'serror' set but not used [-Wunused-but-set-variable] sata_dwc.c: In function 'scan_sata': sata_dwc.c:654:16: warning: variable 'lba_desc' set but not used [-Wunused-but-set-variable] sata_dwc.c:538:16: warning: variable 'xfer_mask' set but not used [-Wunused-but-set-variable] sata_dwc.c: In function 'ata_dev_read_id': sata_dwc.c:747:14: warning: variable 'reason' set but not used [-Wunused-but-set-variable] sata_dwc.c: In function 'ata_dev_read_sectors': sata_dwc.c:1810:6: warning: variable 'rc' set but not used [-Wunused-but-set-variable] sata_dwc.c: In function 'ata_dev_write_sectors': sata_dwc.c:1994:6: warning: variable 'rc' set but not used [-Wunused-but-set-variable] Signed-off-by: Stefan Roese <sr@denx.de>
* drivers/block/sym53c8xx.c: Fix GCC 4.6 build warningWolfgang Denk2011-11-16-2/+0
| | | | | | | | | Fix: sym53c8xx.c: In function 'scsi_write_dsp': sym53c8xx.c:456:16: warning: variable 'val' set but not used [-Wunused-but-set-variable] Signed-off-by: Wolfgang Denk <wd@denx.de>
* drivers/block/sata_sil3114.c: Fix GCC 4.6 build warningKumar Gala2011-11-16-0/+4
| | | | | | | | | | | | | | | | | | Fix: sata_sil3114.c: In function 'scan_sata': sata_sil3114.c:793:7: warning: array subscript is above array bounds [-Warray-bounds] sata_sil3114.c:794:7: warning: array subscript is above array bounds [-Warray-bounds] sata_sil3114.c:795:39: warning: array subscript is above array bounds [-Warray-bounds] sata_sil3114.c:795:7: warning: array subscript is above array bounds [-Warray-bounds] sata_sil3114.c:797:7: warning: array subscript is above array bounds [-Warray-bounds] sata_sil3114.c:800:7: warning: array subscript is above array bounds [-Warray-bounds] sata_sil3114.c:801:7: warning: array subscript is above array bounds [-Warray-bounds] sata_sil3114.c:802:39: warning: array subscript is above array bounds [-Warray-bounds] sata_sil3114.c:802:7: warning: array subscript is above array bounds [-Warray-bounds] sata_sil3114.c:804:7: warning: array subscript is above array bounds [-Warray-bounds] Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* drivers/block/ahci.c: Fix GCC 4.6 build warningKumar Gala2011-11-16-3/+0
| | | | | | | | | Fix: ahci.c: In function 'ata_scsiop_read10': ahci.c:564:6: warning: variable 'lba' set but not used [-Wunused-but-set-variable] Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* GCC4.6: Squash warnings in sata_sil3114.cMarek Vasut2011-10-27-1/+1
| | | | | | | | | | | sata_sil3114.c: In function 'sata_identify': sata_sil3114.c:174: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'lbaint_t' Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Cc: Wolfgang Denk <wd@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Mike Frysinger <vapier@gentoo.org>
* GCC4.6: Squash warnings in ahci.cMarek Vasut2011-10-27-1/+1
| | | | | | | | | | | ahci.c: In function 'ahci_port_start': ahci.c:401: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'struct ahci_cmd_hdr *' Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Cc: Wolfgang Denk <wd@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Mike Frysinger <vapier@gentoo.org>
* consolidate mdelay by providing a common function for all usersAnatolij Gustschin2011-10-22-9/+0
| | | | | | | | | There are several mdelay() definitions in the driver and board code. Remove them all and provide a common mdelay() in lib/time.c. Signed-off-by: Anatolij Gustschin <agust@denx.de> Acked-by: Mike Frysinger <vapier@gentoo.org>
* drivers: add the support for Silicon Image SATA controllerTang Yuantian2011-10-22-0/+952
| | | | | | | | | | | | | | | | | Add the Silicon Image series PCI Express to Serial ATA controller support, including Sil3132, Sil3131 and Sil3124. The SATA controller can be used to load kernel. The features list: - Supports 1-lane 2.5 Gbit/s PCI Express - Supports one/two/four independent Serial ATA channels - Supports Serial ATA Generation 2 transfer rate of 3.0 Gbit/s - Supports LBA28 and LBA48 Signed-off-by: Tang Yuantian <b29983@freescale.com> Signed-off-by: Aaron Williams <Aaron.Williams@cavium.com> Tested-by: Lan Chunhe <b25806@freescale.com>
* fsl_sata: Fix compile error when CONFIG_LBA48 is not definedTang Yuantian2011-10-09-5/+10
| | | | | | | | If CONFIG_LBA48 is not defined, the element lba48 of struct sata_dev_desc is not avaible, and can't be used. Signed-off-by: Tang Yuantian <b29983@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* ATA: Squash warnings in mxc_ata.Marek Vasut2011-09-30-13/+9
| | | | | | | | | | | | | mxc_ata.c: In function ‘set_ata_bus_timing’: mxc_ata.c:118: warning: dereferencing type-punned pointer will break strict-aliasing rules mxc_ata.c:125: warning: dereferencing type-punned pointer will break strict-aliasing rules mxc_ata.c:129: warning: dereferencing type-punned pointer will break strict-aliasing rules Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Cc: Stefano Babic <sbabic@denx.de>
* Convert ISO-8859 files to UTF-8Albert ARIBAUD2011-08-04-2/+2
| | | | | | | | There was a mix of UTF-8 and ISO-8859 files in the U-Boot source tree, which could cause issues with the patchwork review system. This commit converts all ISO-8859 files to UTF-8. Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
* Timer: Allow reset_timer() only for systems with low resolution timersGraeme Russ2011-07-26-0/+2
|
* disk/part.c: Make features optionalMatthew McClintock2011-07-26-0/+4
| | | | | | | | | If we don't want to build support for any partition types we can now add #undef CONFIG_PARTITIONS in a board config file to keep this from being compiled in. Otherwise boards assume this is compiled in by default Signed-off-by: Matthew McClintock <msm@freescale.com>
* scsi/ahci: add support for non-PCI controllersRob Herring2011-07-26-8/+62
| | | | | | | Add support for AHCI controllers that are not PCI based. Signed-off-by: Rob Herring <rob.herring@calxeda.com> Cc: Wolfgang Denk <wd@denx.de>
* scsi/ahci: ata id little endian fixRob Herring2011-07-26-1/+1
| | | | | | The ata id string always needs swapping, not just on BE machines. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
* mvsata: issue hard reset on initializationMichael Walle2011-05-23-1/+9
| | | | | | | | | | | | Before the actual initialization do a hard reset of the SATA port and the connected device. changes v1->v2: - add comment for udelay Signed-off-by: Michael Walle <michael@walle.cc> Cc: Prafulla Wadaskar <prafulla@marvell.com> Cc: Albert Aribaud <albert.u.boot@aribaud.net>
* ftide020: add faraday ide ahb controllerMacpaul Lin2011-05-12-0/+651
| | | | | | | | | | | | | | Faraday's ftide020_s is an IDE-AHB controller for SoC design. This patch add the u-boot driver (PIO) of ftide020 ATA (IDE) driver. IDE commands include read, info, and other functions has been implemented. Because this IDE controller support AHB interface only which is differ from other most IDE controller supports PCI interface. Some registers access is required during CMD/DATA I/O. Hence a configuration "CONFIG_IDE_AHB" is required to be defined according to the feature in cmd_ide.c. Signed-off-by: Macpaul Lin <macpaul@andestech.com>
* Replace obsolete e-mail addressAlbert ARIBAUD2011-04-27-2/+2
| | | | Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
* MXC: removed warnings from IMX51 ATA driverStefano Babic2011-02-02-3/+0
| | | | | | | | Drop warnings due to unused variables. Signed-off-by: Stefano Babic <sbabic@denx.de> CC: Marek Vasut <marek.vasut@gmail.com> Acked-by: Marek Vasut <marek.vasut@gmail.com>
* BLOCK: Add freescale IMX51 PATA driverMarek Vasut2011-02-02-0/+150
| | | | | | Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Acked-by: Stefano Babic <sbabic@denx.de> Acked-by: Wolfgang Denk <wd@denx.de>
* Switch from archive libraries to partial linkingSebastien Carlier2010-11-17-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Before this commit, weak symbols were not overridden by non-weak symbols found in archive libraries when linking with recent versions of binutils. As stated in the System V ABI, "the link editor does not extract archive members to resolve undefined weak symbols". This commit changes all Makefiles to use partial linking (ld -r) instead of creating library archives, which forces all symbols to participate in linking, allowing non-weak symbols to override weak symbols as intended. This approach is also used by Linux, from which the gmake function cmd_link_o_target (defined in config.mk and used in all Makefiles) is inspired. The name of each former library archive is preserved except for extensions which change from ".a" to ".o". This commit updates references accordingly where needed, in particular in some linker scripts. This commit reveals board configurations that exclude some features but include source files that depend these disabled features in the build, resulting in undefined symbols. Known such cases include: - disabling CMD_NET but not CMD_NFS; - enabling CONFIG_OF_LIBFDT but not CONFIG_QE. Signed-off-by: Sebastien Carlier <sebastien.carlier@gmail.com>
* mvsata_ide: adjust port init sequenceAlbert Aribaud2010-10-13-9/+33
| | | | | | | | | | | mvsata_ide_initialize_port(): adjust init sequence (SStatus should be checked only after all writes to SControl) and return success/failure to ide_preinit(). Also, as some tests showed init durations in the hundreds of us, raise the time-out to 01 ms to be on the safe side. Signed-off-by: Albert Aribaud <albert.aribaud@free.fr>
* ide: add mvsata_ide driverAlbert Aribaud2010-08-08-0/+141
| | | | | | | | This driver only provides initialization code; actual driving is done by cmd_ide.c using the ATA compatibility mode of the Marvell SATAHC controller. Signed-off-by: Albert Aribaud <albert.aribaud@free.fr>