summaryrefslogtreecommitdiffstats
path: root/drivers/ata
Commit message (Collapse)AuthorAgeFilesLines
...
* dwc_ahci: Fix breakageJean-Jacques Hiblot2018-04-131-13/+10
| | | | | | | | | | The dwc_ahci has been broken for quite some time now. The breakage has been introduced by the series "dm: scsi: Enhance SCSI support for driver model" Use ahci_bind_scsi() and ahci_probe_scsi() to properly bind and probe the driver. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
* Move most CONFIG_HAVE_BLOCK_DEVICE to KconfigAdam Ford2018-02-081-0/+1
| | | | | | | | | | | config_fallbacks.h has some logic that sets HAVE_BLOCK_DEVICE based on a list of enabled options. Moving HAVE_BLOCK_DEVICE to Kconfig allows us to drastically shrink the logic in config_fallbacks.h Signed-off-by: Adam Ford <aford173@gmail.com> [trini: Rename HAVE_BLOCK_DEVICE to CONFIG_BLOCK_DEVICE] Signed-off-by: Tom Rini <trini@konsulko.com>
* ata: Migrate CONFIG_MVSATA_IDE to KconfigTuomas Tynkkynen2017-12-121-0/+6
| | | | Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
* ata: Migrate CONFIG_LIBATA to KconfigTuomas Tynkkynen2017-12-121-0/+11
| | | | | | | | This symbol enables some library code used by various SATA drivers, so make this a non-user-visible symbol select'ed by the respective drivers, and let moveconfig handle the rest. Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
* ata: Migrate CONFIG_SCSI_AHCI to KconfigTuomas Tynkkynen2017-12-121-0/+5
| | | | | | And use 'imply' liberally. Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
* ata: Migrate CONFIG_DWC_AHSATA to KconfigTuomas Tynkkynen2017-12-121-0/+6
| | | | Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
* ata: Migrate CONFIG_FSL_SATA to KconfigTuomas Tynkkynen2017-12-121-0/+6
| | | | | | | Use 'imply' here liberally to avoid the combinatorial explosion of defconfig changes in the PowerPC boards. Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
* ata: Migrate CONFIG_SATA_MV to KconfigTuomas Tynkkynen2017-12-121-0/+6
| | | | Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
* ata: Migrate CONFIG_SATA_SIL3114 to KconfigTuomas Tynkkynen2017-12-121-0/+5
| | | | Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
* ata: Migrate CONFIG_SATA_SIL to KconfigTuomas Tynkkynen2017-12-121-0/+6
| | | | | | | Use 'imply' here liberally to avoid the combinatorial explosion of defconfig changes in the PowerPC boards. Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
* ata: Drop CONFIG_MX51_PATATuomas Tynkkynen2017-12-122-130/+0
| | | | | | | The last user of this driver went away in August 2015 in commit: b6073fd2115 ("arm: Remove mx51_efikamx, mx51_efikasb boards") Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
* ata: Drop CONFIG_SATA_DWCTuomas Tynkkynen2017-12-123-2536/+0
| | | | | | | The last user of this driver went away in June 2017, in commit: 98f705c9ce ("powerpc: remove 4xx support") Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
* ata: Fix ahci wordingMichal Simek2017-11-283-5/+5
| | | | | | | s/achi_/ahci_/g Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* scsi: ceva: Start port in probeMichal Simek2017-11-031-1/+6
| | | | | | | | | | | | The patch: "dm: ahci: Unwind the confusing init code" (sha1: 7cf1afce7fa3fe64189020fe14b93f7326dd0758) introduce bug for ceva sata because port didn't start. On the other hand the dwc_ahci.c was fixed correctly. Do the same change for ceva too. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Tested-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
* treewide: replace with error() with pr_err()Masahiro Yamada2017-10-041-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | U-Boot widely uses error() as a bit noisier variant of printf(). This macro causes name conflict with the following line in include/linux/compiler-gcc.h: # define __compiletime_error(message) __attribute__((error(message))) This prevents us from using __compiletime_error(), and makes it difficult to fully sync BUILD_BUG macros with Linux. (Notice Linux's BUILD_BUG_ON_MSG is implemented by using compiletime_assert().) Let's convert error() into now treewide-available pr_err(). Done with the help of Coccinelle, excluing tools/ directory. The semantic patch I used is as follows: // <smpl> @@@@ -error +pr_err (...) // </smpl> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org> [trini: Re-run Coccinelle] Signed-off-by: Tom Rini <trini@konsulko.com>
* dma: import linux/dma-direction.h to consolidate enum dma_data_directionMasahiro Yamada2017-09-122-7/+1
| | | | | | | | Import include/linux/dma-direction.h from Linux 4.13-rc7 and delete duplicated definitions of enum dma_data_direction. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
* dm: sata: dwc_ahsata: Add support for driver modelSimon Glass2017-08-171-0/+113
| | | | | | | Update this driver to support driver model. This involves implementing the AHCI operations and reusing existing common code. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: sata: Update the AHCI uclass to support operationsSimon Glass2017-08-171-0/+37
| | | | | | | At present the AHCI uclass is just a shell and we still use the global functions to access SATA. Fix this by adding operations to the uclass. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: sata: dw_sata: Set up common versions of operationsSimon Glass2017-08-171-105/+131
| | | | | | | | Driver model wants to use the core functions in this file but accesses the uclass-private data in a different way. Move the code into new 'common' functions and set up stubs to call these. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: sata: dw_sata: More ahci_init_one() futher downSimon Glass2017-08-171-33/+33
| | | | | | | This function will not be used with driver model and it relates to the other exported functions. Move it down next to them. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: sata: dw_sata: Drop is_readySimon Glass2017-08-171-4/+0
| | | | | | This variable is set but never used. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: sata: dw_sata: Rename the dwc_ahsata private headerSimon Glass2017-08-172-4/+4
| | | | | | | Rename dwc_ahsata.h to indicate that it is a private header file. We plan to create another header with some public functions. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: sata: dw_sata: Sort #include directivesSimon Glass2017-08-171-7/+6
| | | | | | Sort the header file inclusions into the correct order. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: sata: dw_sata: Drop unnecessary bracketsSimon Glass2017-08-171-50/+48
| | | | | | | There is a strange &(var) coding style in this driver. Adjust it to use &var instead, which is more usual. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: sata: dw_sata: Pass uc_priv to internal functionsSimon Glass2017-08-171-48/+41
| | | | | | | | | With driver model sata_dev_desc[] does not exist. We still want to use the common code of this driver so update it to pass struct ahci_uc_priv * to each of these functions, instead of an integer which must be looked up in sata_dev_desc[]. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: sata: dw_sata: Drop unnecessary castsSimon Glass2017-08-171-38/+22
| | | | | | | Most of the casts in this driver are not necessary. With driver model we do not cast from void *. Update the driver to follow this rule. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: sata: dw_sata: Rename 'probe_ent' to uc_privSimon Glass2017-08-171-90/+85
| | | | | | | | | | | With driver model this becomes uclass-private data. Rename the parameter varable to reflect this. With the driver model conversion we will not have any exported functions. Move all exported functions to be together at the end of the file so that we can deal with them in one #ifdef block. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: sata: dw_sata: Move exported functions to the endSimon Glass2017-08-171-62/+62
| | | | | | | | With the driver model conversion we will not have any exported functions. Move all exported functions to be together at the end of the file so that we can deal with them in one #ifdef block. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: sata: dw_sata: Drop dwc_ahsata_rw_ncq_cmd()Simon Glass2017-08-171-43/+0
| | | | | | This function is not called from anywhere. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: sata: dwc_ahsata: Make functions staticSimon Glass2017-08-171-6/+6
| | | | | | | Some functions are not called from outside this file. Make these static to make that obvious. Signed-off-by: Simon Glass <sjg@chromium.org>
* ahci-pci: Update call to ahci_probe_scsi_pci()Bin Meng2017-08-031-1/+1
| | | | | | | | | ahci_probe_scsi() now takes a 'base' argument, and there is an API that prepares base address for us: ahci_probe_scsi_pci(). Reported-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
* Merge git://git.denx.de/u-boot-x86Tom Rini2017-08-013-0/+49
|\
| * dm: scsi: Add a generic PCI-based AHCI driverBin Meng2017-08-013-0/+49
| | | | | | | | | | | | | | | | This adds support for PCI-based AHCI controller based on DM SCSI. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
* | dm: ahci: Correct uclass private dataSimon Glass2017-08-012-1/+3
| | | | | | | | | | | | | | | | | | This is expected to be attached to the uclass and the code operates that way, but the uclass has not been updated. Fix it to avoid using memory at address 0. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: 47fc61a (dm: ahci: Drop use of probe_ent)
* | dm: scsi: Drop duplicate SCSI and DM_SCSI optionsSimon Glass2017-08-011-18/+0
| | | | | | | | | | | | | | | | | | When the SATA code was moved into drivers/ata these Kconfig options were added to that directory. They already exist in drivers/scsi. Remove them from drivers/ata to fix the duplication. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: 7f2b5f4 (sata: Move drivers into new drivers/ata directory)
* | ahci: Support non-PCI controllersSimon Glass2017-08-011-9/+17
|/ | | | | | | | At present the AHCI SCSI driver only supports PCI with driver model. Rename the existing function to indicate this and add support for adding a non-PCI controller . Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: ahci: Avoid scsi_scan_dev() in ahci_probe_scsi()Bin Meng2017-07-281-5/+0
| | | | | | | | | | | | Running 'scsi scan' command causes scsi_scan_dev() to be called, from which device_probe() is called and consequently AHCI driver probe routine will be called as SCSI driver's parent, and finally ahci_probe_scsi() calls scsi_scan_dev() again. Remove the call to scsi_scan_dev() in ahci_probe_scsi(). Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* dm: ahci: Add a driver for SCSI on AHCISimon Glass2017-07-111-0/+57
| | | | | | | | | | | | | Some AHCI drivers use SCSI under the hood. Rather than making the AHCI driver be in the SCSI uclass it makes sense to have the AHCI device create a SCSI device as a child. That way we can handle any AHCI-specific operations rather than trying to pretend tha the device is just SCSI. To handle this we need to provide a way for AHCI drivers to bind a SCSI device as its child, and probe it. Add functions for this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* dm: scsi: Adjust return value of scsi_exec()Simon Glass2017-07-111-3/+3
| | | | | | | | Change this function to return an error number instead of true/false. This allows us to return a proper error number. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* dm: scsi: Add operations for SCSI devicesSimon Glass2017-07-113-0/+9
| | | | | | | | | | The SCSI uclass currently has no operations. It just uses the global SCSI functions. Fix this by adding operations to the only two drivers that use the uclass, and replacing the global functions with those defined locally in the SCSI code. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* dm: ahci: Create a local version of two SCSI functionsSimon Glass2017-07-111-2/+13
| | | | | | | | | | With driver model we need to define implementations of exec() and bus_reset() separately for each SCSI driver. As a first step, create a local version of each function in the AHCI driver and call each from its global version. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* dm: scsi: Add a device pointer to scan_exec(), scsi_bus_reset()Simon Glass2017-07-111-3/+12
| | | | | | | | | | With driver model these functions need a device pointer. Add one even when CONFIG_DM_SCSI is not defined. This avoids having ugly conditional function prototypes, When CONFIG_DM_SCSI is not defined we can just ignore the pointer. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* dm: ahci: Drop use of probe_entSimon Glass2017-07-112-30/+45
| | | | | | | | | | | With driver model we cannot have static data or assume that there is only one device of each time. Adjust the code so that 'probe_ent' is not needed with driver model. Add a new ahci_init_dm() function which can init AHCI for driver model without re-allocating the uclass data. Move over the only existing driver to use this new function. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* dm: ahci: Unwind the confusing init codeSimon Glass2017-07-113-8/+27
| | | | | | | | | | | | | | | | | | | Two AHCI drivers use SCSI with CONFIG_DM_SCSI. The SCSI uclass calls scsi_low_level_init() which is implemented by ahci.c. If CONFIG_SCSI_AHCI_PLAT is defined it does one thing and if it is not it does something else. We don't need to call through scsi_low_level_init() to get the init completed. Instead, adjust the two drivers to call into AHCI directly. Drop the post-probe init in the SCSI uclass. This means that driver model doesn't need to use scsi_low_level_init(). It is a legacy function and driver model should use a driver's probe() method instead. While we are here, add a comment to the top of the file explaining what ahci.c does. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* dm: ahci: Move common code for starting ports into a functionSimon Glass2017-07-111-23/+22
| | | | | | | | This code is duplicated. Create a ahci_start_ports() function to handle this and call it from both places. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* dm: ahci: Refactor to avoid static variablesSimon Glass2017-07-111-68/+76
| | | | | | | | | | With driver model we need each device to have its own state. As a step towards this, restrict use of the global 'probe_ent' to just a few places in the file. This will allow us to add driver-model functions which can pass the correct data around. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* dm: sata: Move ataid into struct ahci_uc_privSimon Glass2017-07-111-23/+27
| | | | | | | | | This array relates to the AHCI controller so should be exist out on its own in the file. Move it into the structure. Adjust functions that need access to this to take the structure as a parameter. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* dm: ahci: Rename struct ahci_probe_entSimon Glass2017-07-112-45/+45
| | | | | | | | | This is not a very useful name since once it is probed it still hangs around. With driver model we will use uclass data for this, so rename the struct. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* dm: scsi: Use the uclass platform dataSimon Glass2017-07-113-6/+4
| | | | | | | | | At present the two driver-model SCSI drivers use device platform data to store information that relates to the uclass. It is better to use uclass platform data in this situation. Update the code to do this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* dm: scsi: Drop the ccb typedefSimon Glass2017-07-111-6/+6
| | | | | | | | | We should not be using typedefs in U-Boot and 'ccb' is a pretty short name. It is also used with variables. Drop the typedef and use 'struct' instead. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>