summaryrefslogtreecommitdiffstats
path: root/drivers/ata
Commit message (Collapse)AuthorAgeFilesLines
* common: Drop linux/bitops.h from common headerSimon Glass2020-05-182-0/+2
| | | | | | Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: Drop linux/delay.h from common headerSimon Glass2020-05-188-0/+8
| | | | | | Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
* Fix some checkpatch warnings in calls to udelay()Simon Glass2020-05-181-8/+8
| | | | | | | Fix up some incorrect code style in calls to functions in the linux/time.h header, mostly udelay(). Signed-off-by: Simon Glass <sjg@chromium.org>
* common: Drop log.h from common headerSimon Glass2020-05-189-0/+9
| | | | | | Move this header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: Drop part.h from common headerSimon Glass2020-05-187-0/+10
| | | | | | Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: Drop net.h from common headerSimon Glass2020-05-182-0/+2
| | | | | | | | | | | Move this header out of the common header. Network support is used in quite a few places but it still does not warrant blanket inclusion. Note that this net.h header itself has quite a lot in it. It could be split into the driver-mode support, functions, structures, checksumming, etc. Signed-off-by: Simon Glass <sjg@chromium.org>
* rename symbol: CONFIG_KIRKWOOD -> CONFIG_ARCH_KIRKWOODTrevor Woerner2020-05-152-2/+2
| | | | | | | | Have this symbol follow the pattern of all other such symbols. This patch also removes a TODO from the code. Reviewed-by: Chris Packham <judge.packham@gmail.com> Signed-off-by: Trevor Woerner <twoerner@gmail.com>
* rename symbol: CONFIG_ORION5X -> CONFIG_ARCH_ORION5XTrevor Woerner2020-05-151-1/+1
| | | | | | | Have this symbol follow the pattern of all other such symbols. This patch removes a TODO from the code. Signed-off-by: Trevor Woerner <twoerner@gmail.com>
* sata: dwc_ahsata: Fix memory issue in reset_sataYe Li2020-05-081-0/+3
| | | | | | | | | The reset_sata should reset the sata device info and free the probe_ent memory. Otherwise, it will cause memory leak if we init the sata again. Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
* sata: dwc_ahsata: Fix incorrect freeYe Li2020-05-081-1/+0
| | | | | | | | | | | | Fix coverity issue CID 43665: Free of address-of expression (BAD_FREE) incorrect_free: free frees incorrect pointer pp. pp points the port array field of struct ahci_uc_priv, should not free it. Acked-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* sata: ahsata: Fix wrong operand for checking SERR DIAG_XYe Li2020-05-081-1/+1
| | | | | | | | | | | | | | Fix coverity issue CID 3261683: Wrong operator used (CONSTANT_EXPRESSION_RESULT) operator_confusion: ({...; __v;}) | 67108864 is always 1/true regardless of the values of its operand. This occurs as the logical operand of ! When DIAG_X is set, the PHY COMINIT signal is detected, so should use '&' to check whether it is set. Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* sata: ahsata: Fix resource leakYe Li2020-05-081-0/+5
| | | | | | | | | Fix coverity issue CID 3606684: Resource leak (RESOURCE_LEAK) leaked_storage: Variable uc_priv going out of scope leaks the storage it points to Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* Revert "ata: fsl_ahci: Add sata DM support for Freescale powerpc socs"Peng Ma2020-02-253-1042/+0
| | | | | | | | | | | | | | This reverts commit 1ee494291880fd51ef0c5f7342e072bdb069d7ff. Commit 1ee494291880 ("ata: fsl_ahci: Add sata DM support for Freescale powerpc socs") introduced SCSI layer to call AHCI private API in order to support sata operations, In DM mode, This is not necessary for non-AHCI sata. So revert it and have already updated the driver itself to operate sata directly. Signed-off-by: Peng Ma <peng.ma@nxp.com> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
* ata: fsl_sata: Continue probing other sata port when failed current port.Peng Ma2020-01-081-7/+51
| | | | | | | | In the initialization of sata driver, we want to initialize all port probes, Therefore, any detection failure between of them should continue initialization by skipping the current port instead of exit. Signed-off-by: Peng Ma <peng.ma@nxp.com>
* ata: sata_sil: Continue probing other sata port when failed current port.Peng Ma2020-01-081-4/+56
| | | | | | | | In the initialization of sata driver, we want to initialize all port probes, Therefore, any detection failure between of them should continue initialization by skipping the current port instead of exit. Signed-off-by: Peng Ma <peng.ma@nxp.com>
* common: Move ARM cache operations out of common.hSimon Glass2019-12-026-0/+6
| | | | | | | | | These functions are CPU-related and do not use driver model. Move them to cpu_func.h Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* ata: sata_sil: Add DM support for Silicon sata driverPeng Ma2019-11-193-193/+353
| | | | | | | | | | | | | | | | | | | Add DM support for Silicon(SIL3131 / SIL3132 / SIL3124) sata driver as few of the PowerPC platforms such as P series based boards need to use SATA_SIL with DM, Also fix below warning while PowerPC P series boards compilation, ===================== WARNING ======================" This board does use CONFIG_LIBATA but has CONFIG_AHCI not" enabled. Please update the storage controller driver to use" CONFIG_AHCI before the v2019.07 release." Failure to update by the deadline may result in board removal." See doc/driver-model/MIGRATION.txt for more info." ====================================================" Signed-off-by: Peng Ma <peng.ma@nxp.com> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
* ata: fsl_sata: Add DM support for Freescale PowerPC SATA driverPeng Ma2019-11-193-88/+233
| | | | | | | | | | | | | | | | | | | | | | | Add DM support for Freescale PowerPC sata driver used for PowerPC T series SoCs, CONFIG_BLK needs to be enabled on these platforms. It adds the SATA controller as AHCI device, which is strictly speaking not correct, as the controller is not AHCI compatible, But the U-Boot AHCI uclass interface enables the usage of this DM driver, Also fix below warning while PowerPC T series boards compilation, ===================== WARNING ======================" This board does use CONFIG_LIBATA but has CONFIG_AHCI not" enabled. Please update the storage controller driver to use" CONFIG_AHCI before the v2019.07 release." Failure to update by the deadline may result in board removal." See doc/driver-model/MIGRATION.txt for more info." ====================================================" Signed-off-by: Peng Ma <peng.ma@nxp.com> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
* ata: ahci allow 64-bit DMA for SATARoman Kapl2019-10-311-3/+11
| | | | | | | Allow 64-bit DMA on AHCI. If not supported by the host controller, at least print a message and fail. Signed-off-by: Roman Kapl <rka@sysgo.com>
* ata: ahci: Don't forget to clear upper address regs.Oleksandr Rybalko2019-10-111-4/+7
| | | | | | | | | In 32bits mode upper bits need to be set to 0, otherwise controller will try to DMA into not existing memory and stops with error. Tested-by: Frank Wunderlich <frank-w@public-files.de> Signed-off-by: Frank Wunderlich <frank-w@public-files.de> Signed-off-by: Oleksandr Rybalko <ray@ddteam.net>
* ahci-pci: ASM1061 report wrong class, but support AHCI.Oleksandr Rybalko2019-10-111-0/+1
| | | | | | Tested-by: Frank Wunderlich <frank-w@public-files.de> Signed-off-by: Frank Wunderlich <frank-w@public-files.de> Signed-off-by: Oleksandr Rybalko <ray@ddteam.net>
* dm: scsi: Scan the actual number of portsPark, Aiden2019-08-261-0/+8
| | | | | | | | | The scsi_scan_dev() is looping over the number of uc_plat->max_id. The number of actual ports a AHCI controller has can be greater than max_id. Update uc_plat->max_id to make SCSI scan all detected ports. Signed-off-by: Aiden Park <aiden.park@intel.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* ata: fsl_ahci: Add sata DM support for Freescale powerpc socsPeng Ma2019-05-234-0/+1042
| | | | | | | | | | | | | | | This patch is to support Freescale sata driver with dts initialized. Also resolved the following problems. ===================== WARNING ====================== This board does not use CONFIG_DM_SCSI. Please update the storage controller to use CONFIG_DM_SCSI before the v2019.07 release. Failure to update by the deadline may result in board removal. See doc/driver-model/MIGRATION.txt for more info. ==================================================== Signed-off-by: Peng Ma <peng.ma@nxp.com> Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
* scsi: ceva: Clean up the driver codePeng Ma2019-05-221-17/+33
| | | | | | | | | Distinguish the ecc val by chassis version and move the ecc addr to dts. Add ls1028a soc support. Signed-off-by: Peng Ma <peng.ma@nxp.com> Reviewed-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
* ata: ahci: drop read-only ahci_ioports membersChristian Gmeiner2019-05-181-12/+0
| | | | | | Also get rid of ahci_setup_port(..). Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
* ata: ahci: fix memory leakChristian Gmeiner2019-05-091-4/+1
| | | | | | | | malloc(..) and memalign(..) are both allocating memory and as a result we leak the memory allocated with malloc(..). Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* Merge branch 'master' of git://git.denx.de/u-boot-sunxiTom Rini2019-04-173-0/+134
|\ | | | | | | | | | | - Convert DM_MMC and DM_SCSI - A20, R40, H6 Linux dts(i) sync - CLK, RESET support for sunxi, sun8_emac net drivers
| * sunxi: update SATA driver to always use DM_SCSIAndre Przywara2019-04-173-0/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It seems like the Allwinner SATA driver is already quite capable of using the driver model, so we can force this on all boards and can remove support for a non-DM_SCSI build. This removes the warning about boards with SATA ports not being DM_SCSI compliant. It also takes the opportunity to move the driver out of the board/sunxi directory to join its siblings in drivers/ata, and to make it a proper Kconfig citizen. The board defconfigs stay untouched. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jagan Teki <jagan@openedev.com> [jagan: select DM_SCSI separately] Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
* | ata: dwc_ahsata: Add ahci driver model supportSoeren Moch2019-04-132-0/+32
| | | | | | | | | | | | Disable this support for cm_fx6 to avoid breakage. Signed-off-by: Soeren Moch <smoch@web.de>
* | ata: dwc_ahsata: Fix sector reports for large disksSoeren Moch2019-04-131-11/+3
|/ | | | | | | Do not report negative sector numbers for disks > 1TB, do not limit sector numbers to 32 bit if CONFIG_SYS_64BIT_LBA is enabled. Signed-off-by: Soeren Moch <smoch@web.de>
* sata: sata_mv: add orion-sata compatible stringMichael Walle2019-04-121-0/+1
| | | | | | | | | The kirkwood devices are compatible with this driver. Signed-off-by: Michael Walle <michael@walle.cc> Reviewed-by: Chris Packham <judge.packham@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de> Signed-off-by: Stefan Roese <sr@denx.de>
* sata: sata_mv: support kirkwood architectureMichael Walle2019-04-121-4/+3
| | | | | | | | Fix the worng include and offset macros. Signed-off-by: Michael Walle <michael@walle.cc> Reviewed-by: Stefan Roese <sr@denx.de> Signed-off-by: Stefan Roese <sr@denx.de>
* sata: sata_mv: use correct format specifier in debug()Michael Walle2019-04-121-1/+1
| | | | | | | | | This fixes a compile error on kirkwood. Signed-off-by: Michael Walle <michael@walle.cc> Reviewed-by: Chris Packham <judge.packham@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de> Signed-off-by: Stefan Roese <sr@denx.de>
* ata: ahci_mvebu: add support for Armada 38xBaruch Siach2019-04-121-0/+1
| | | | | | | | | With board_ahci_enable() implementation for Armada 38x in place we can now enable 38x support in the ahci_mvebu driver. Signed-off-by: Baruch Siach <baruch@tkos.co.il> Reviewed-by: Stefan Roese <sr@denx.de> Signed-off-by: Stefan Roese <sr@denx.de>
* sata: sata_mv: Add DM support to enable CONFIG_BLK usageStefan Roese2019-04-122-149/+197
| | | | | | | | | | | | | | | | | | | | | | | This patch adds DM support to the Armada XP SATA driver. This is needed to enable CONFIG_BLK on this platform. It adds the SATA controller as AHCI device, which is strictly speaking not correct, as the controller is not AHCI compatible. But the U-Boot AHCI uclass interface enables the usage of this DM driver and the creation of the corresponding BLK devices. This conversion is done to get rid of the compile warning: Reviewed-by: Chris Packham <judge.packham@gmail.com> ===================== WARNING ====================== This board does not use CONFIG_DM_SCSI. Please update the storage controller to use CONFIG_DM_SCSI before the v2019.07 release. Failure to update by the deadline may result in board removal. See doc/driver-model/MIGRATION.txt for more info. ==================================================== Signed-off-by: Stefan Roese <sr@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com>
* scsi: ceva: add ls2080a soc supportPeng Ma2018-12-061-0/+4
| | | | | | | | | Add ahci compatible support for ls2080a soc. Signed-off-by: Peng Ma <peng.ma@nxp.com> Acked-by: Michal Simek <michal.simek@xilinx.com> [YS: add fallthrough comment] Reviewed-by: York Sun <york.sun@nxp.com>
* scsi: ceva: add ls1088a soc supportPeng Ma2018-12-061-4/+18
| | | | | | | | Add ahci compatible support for ls1088a soc. Signed-off-by: Peng Ma <peng.ma@nxp.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: York Sun <york.sun@nxp.com>
* scsi: ceva: add ls1046a soc supportPeng Ma2018-12-061-0/+3
| | | | | | | Add ahci compatible support for ls1046a soc. Signed-off-by: Peng Ma <peng.ma@nxp.com> Reviewed-by: York Sun <york.sun@nxp.com>
* Merge tag 'fsl-qoriq-for-v2018.11-rc1' of git://git.denx.de/u-boot-fsl-qoriqTom Rini2018-09-291-1/+27
|\ | | | | | | | | | | | | | | Switch to driver model for eSDHC on Layerscape SoCs including LS1021A, LS1043A, LS1046A, LS1088A, LS2088A. Switch to driver model for SATA on LS1021A and LS1043A. Add support for LS1012AFRWY rev C board. Enable SMMU for LS1043A.
| * scsi: ceva: add ls1021a soc support.Peng Ma2018-09-271-1/+24
| | | | | | | | | | | | | | | | Add ahci compatible support for ls1021a soc. Signed-off-by: Peng Ma <peng.ma@nxp.com> Acked-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: York Sun <york.sun@nxp.com>
| * scsi: ceva: add ls1043a soc supportPeng Ma2018-09-271-0/+3
| | | | | | | | | | | | | | Add ahci compatible support for ls1043a soc. Signed-off-by: Peng Ma <peng.ma@nxp.com> Reviewed-by: York Sun <york.sun@nxp.com>
* | ata: ahci: Don't cap AHCI port count under CONFIG_DM_SCSITuomas Tynkkynen2018-09-251-0/+2
| | | | | | | | | | | | | | | | When using device model this sort of hardcoded limits aren't used or necessary. Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> Reviewed-by: Simon Glass <sjg@chromium.org>
* | ata: ahci: Loop over the actual number of ports, not the maximumTuomas Tynkkynen2018-09-251-1/+1
|/ | | | | | | | | | | | The loop in ahci_start_ports() is looping over the maximum number of SCSI devices in the system, which can be larger than the amount of ports a particular AHCI controller has. The extra looping isn't directly harmful because the link_port_map bitmap won't have the bit set for a nonexistent port, but it is wasteful. Replace the loop limit with the port count of the AHCI controller instead. Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> Reviewed-by: Simon Glass <sjg@chromium.org>
* scsi: ceva: add ls1012a soc supportYuantian Tang2018-07-261-35/+52
| | | | | | | | | | | | Make the code structure more general so that more socs can be added easily and also remove speed limitation restriction. Add the ls1012a sata support as well. Signed-off-by: Tang Yuantian <andy.tang@nxp.com> Reviewed-by: Michal Simek <michal.simek@xilinx.com> Tested-by: Michal Simek <michal.simek@xilinx.com> (with and without CONFIG_OF_LIVE on zynqmp zcu102) Reviewed-by: York Sun <york.sun@nxp.com>
* ata: ahci_mvebu: add scsi supportKen Ma2018-05-292-1/+17
| | | | | | | | | | | | | Mvebu AHCI is AHCI driver which uses SCSI under the hood. This patch adjusts AHCI setup to support SCSI by creating a SCSI device as a child. Since the functions of creating SCSI device need the kconfig option DM_SCSI, so let AHCI_MVEBU select DM_SCSI. Signed-off-by: Ken Ma <make@marvell.com> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Stefan Roese <sr@denx.de>
* ata: ahci_mvebu: a8040 a0: remove bad port register offsets workaroundsDavid Sniatkiwicz2018-05-291-8/+0
| | | | | | | | | | | | This workaround was added for A8040/7040 A0. A8040/7040 A0 is no longer supported so this workaround can be removed. Signed-off-by: David Sniatkiwicz <davidsn@marvell.com> Signed-off-by: Ken Ma <make@marvell.com> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Stefan Roese <sr@denx.de>
* ata: mvebu: move mvebu sata driver to drivers/ata directoryKen Ma2018-05-293-0/+62
| | | | | | | | | | | | | Currently mvebu sata driver is in arch/arm/mach_mvebu directory, this patch moves it to drivers/ata directory with renaming "sata.c" to "ahci_mvebu.c" which is aligned to Linux. New ahci driver's kconfig option is added as AHCI_MVEBU which selects SCSI_AHCI and is based on AHCI. Signed-off-by: Ken Ma <make@marvell.com> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Stefan Roese <sr@denx.de>
* scsi: ceva: Convert driver to use UCLASS_AHCI instead of SCSIMichal Simek2018-05-111-16/+20
| | | | | | | | | | | In v2018 the patch "dm: ahci: Correct uclass private data" (sha1: bfc1c6b4838501d10aa48c0e92eaf70976f4b2dd) was causing an issue for ceva_sata. But this issue is not in v2018.05-rc1 but still converting to UCLASS_AHCI would make more sense. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
* SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini2018-05-0719-39/+19
| | | | | | | | | | | | | | | | | | | | When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
* Remove unnecessary instances of DECLARE_GLOBAL_DATA_PTRTom Rini2018-04-271-2/+0
| | | | | | | | We have a large number of places where while we historically referenced gd in the code we no longer do, as well as cases where the code added that line "just in case" during development and never dropped it. Signed-off-by: Tom Rini <trini@konsulko.com>