summaryrefslogtreecommitdiff
path: root/drivers/ata
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-02-21 08:32:02 -0500
committerTom Rini <trini@konsulko.com>2022-02-21 08:32:02 -0500
commit24b628a8f844868adca897aae40af6f98cdbc26d (patch)
tree43572009123231107d618dce3a4f84d7e2c536d6 /drivers/ata
parent55e9cef1432ffd42559874b2a469729f20b627d9 (diff)
parent9bd4232f958b94fdd700e44897fb61bdc898b787 (diff)
downloadu-boot-24b628a8f844868adca897aae40af6f98cdbc26d.tar.gz
u-boot-24b628a8f844868adca897aae40af6f98cdbc26d.tar.bz2
u-boot-24b628a8f844868adca897aae40af6f98cdbc26d.zip
Merge tag 'xilinx-for-v2022.04-rc3' of https://gitlab.denx.de/u-boot/custodians/u-boot-microblaze
Xilinx changes for v2022.04-rc3 microblaze: - Fix exception handler zynqmp: - Show information about secure images - DT changes (som u-boot file removal) - Fix zynqmp_pm_cfg_obj_convert.py - Fix platform boot xilinx: - Fix bootm_size calculation - Remove GPIO_EXTRA_HEADER selection power: - Add zynqmp power management driver scsi: - Add phy support to ceva driver zynq qspi: - Fix unaligned accesses and check baudrate setup - Add support for spi memory operations net: - Fix 64bit calculation in axi_emac video: - Add missing gpio dependency for seps driver
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/sata_ceva.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/drivers/ata/sata_ceva.c b/drivers/ata/sata_ceva.c
index b71f10223d..43bcc59cd2 100644
--- a/drivers/ata/sata_ceva.c
+++ b/drivers/ata/sata_ceva.c
@@ -6,9 +6,12 @@
#include <common.h>
#include <dm.h>
#include <ahci.h>
+#include <generic-phy.h>
#include <log.h>
+#include <reset.h>
#include <scsi.h>
#include <asm/io.h>
+#include <dm/device_compat.h>
#include <linux/ioport.h>
/* Vendor Specific Register Offsets */
@@ -181,6 +184,47 @@ static int sata_ceva_bind(struct udevice *dev)
static int sata_ceva_probe(struct udevice *dev)
{
struct ceva_sata_priv *priv = dev_get_priv(dev);
+ struct phy phy;
+ int ret;
+ struct reset_ctl_bulk resets;
+
+ ret = generic_phy_get_by_index(dev, 0, &phy);
+ if (!ret) {
+ dev_dbg(dev, "Perform PHY initialization\n");
+ ret = generic_phy_init(&phy);
+ if (ret)
+ return ret;
+ } else if (ret != -ENOENT) {
+ dev_dbg(dev, "could not get phy (err %d)\n", ret);
+ return ret;
+ }
+
+ /* reset is optional */
+ ret = reset_get_bulk(dev, &resets);
+ if (ret && ret != -ENOTSUPP && ret != -ENOENT) {
+ dev_dbg(dev, "Getting reset fails (err %d)\n", ret);
+ return ret;
+ }
+
+ /* Just trigger reset when reset is specified */
+ if (!ret) {
+ dev_dbg(dev, "Perform IP reset\n");
+ ret = reset_deassert_bulk(&resets);
+ if (ret) {
+ dev_dbg(dev, "Reset fails (err %d)\n", ret);
+ reset_release_bulk(&resets);
+ return ret;
+ }
+ }
+
+ if (phy.dev) {
+ dev_dbg(dev, "Perform PHY power on\n");
+ ret = generic_phy_power_on(&phy);
+ if (ret) {
+ dev_dbg(dev, "PHY power on failed (err %d)\n", ret);
+ return ret;
+ }
+ }
ceva_init_sata(priv);