Merge branch 'master' of git://git.denx.de/u-boot-arm
[oweals/u-boot.git] / drivers / usb / host / ehci-exynos.c
index c4c90be67815ed7a9ff81aa22d278c63f6f2a250..155677e0d948f642313899c35804621b18fc49ac 100644 (file)
@@ -4,20 +4,7 @@
  * Copyright (C) 2012 Samsung Electronics Co.Ltd
  *     Vivek Gautam <gautam.vivek@samsung.com>
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -47,6 +34,7 @@ struct exynos_ehci {
 
 static struct exynos_ehci exynos;
 
+#ifdef CONFIG_OF_CONTROL
 static int exynos_usb_parse_dt(const void *blob, struct exynos_ehci *exynos)
 {
        fdt_addr_t addr;
@@ -90,6 +78,7 @@ static int exynos_usb_parse_dt(const void *blob, struct exynos_ehci *exynos)
 
        return 0;
 }
+#endif
 
 /* Setup the EHCI host controller. */
 static void setup_usb_phy(struct exynos_usb_phy *usb)
@@ -151,10 +140,15 @@ int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
 {
        struct exynos_ehci *ctx = &exynos;
 
+#ifdef CONFIG_OF_CONTROL
        if (exynos_usb_parse_dt(gd->fdt_blob, ctx)) {
                debug("Unable to parse device tree for ehci-exynos\n");
                return -ENODEV;
        }
+#else
+       ctx->usb = (struct exynos_usb_phy *)samsung_get_base_usb_phy();
+       ctx->hcd = (struct ehci_hccr *)samsung_get_base_usb_ehci();
+#endif
 
        setup_usb_phy(ctx->usb);