devres_add(dev, hpriv);
 
-       hpriv->mmio = devm_ioremap_resource(dev,
-                             platform_get_resource(pdev, IORESOURCE_MEM, 0));
+       /*
+        * If the DT provided an "ahci" named resource, use it. Otherwise,
+        * fallback to using the default first resource for the device node.
+        */
+       if (platform_get_resource_byname(pdev, IORESOURCE_MEM, "ahci"))
+               hpriv->mmio = devm_platform_ioremap_resource_byname(pdev, "ahci");
+       else
+               hpriv->mmio = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(hpriv->mmio)) {
                rc = PTR_ERR(hpriv->mmio);
                goto err_out;