Kconfig: USB: Migrate CONFIG_USB_EHCI to CONFIG_USB_EHCI_HCD
[platform/kernel/u-boot.git] / board / technexion / twister / twister.c
index b927586..25aeebc 100644 (file)
@@ -4,23 +4,7 @@
  *
  * Copyright (C) 2009 TechNexion Ltd.
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * 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., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
 #include <asm/omap_gpio.h>
 #include <asm/arch/mmc_host_def.h>
 #include <i2c.h>
+#include <spl.h>
+#include <mmc.h>
 #include <asm/gpio.h>
-#ifdef CONFIG_USB_EHCI
+#ifdef CONFIG_USB_EHCI_HCD
 #include <usb.h>
 #include <asm/ehci-omap.h>
 #endif
@@ -60,19 +46,20 @@ static const u32 gpmc_XR16L2751[] = {
        XR16L2751_GPMC_CONFIG6,
 };
 
-#ifdef CONFIG_USB_EHCI
+#ifdef CONFIG_USB_EHCI_HCD
 static struct omap_usbhs_board_data usbhs_bdata = {
        .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
        .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
        .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
 };
 
-int ehci_hcd_init(void)
+int ehci_hcd_init(int index, enum usb_init_type init,
+               struct ehci_hccr **hccr, struct ehci_hcor **hcor)
 {
-       return omap_ehci_hcd_init(&usbhs_bdata);
+       return omap_ehci_hcd_init(index, &usbhs_bdata, hccr, hcor);
 }
 
-int ehci_hcd_stop(void)
+int ehci_hcd_stop(int index)
 {
        return omap_ehci_hcd_stop();
 }
@@ -98,12 +85,26 @@ int board_init(void)
        return 0;
 }
 
+#ifndef CONFIG_SPL_BUILD
 int misc_init_r(void)
 {
-       dieid_num_r();
+       char *eth_addr;
+       struct tam3517_module_info info;
+       int ret;
+
+       omap_die_id_display();
+
+       eth_addr = getenv("ethaddr");
+       if (eth_addr)
+               return 0;
+
+       TAM3517_READ_EEPROM(&info, ret);
+       if (!ret)
+               TAM3517_READ_MAC_FROM_EEPROM(&info);
 
        return 0;
 }
+#endif
 
 /*
  * Routine: set_muxconf_regs
@@ -129,17 +130,17 @@ int board_eth_init(bd_t *bis)
        return 0;
 }
 
-#if defined(CONFIG_OMAP_HSMMC) && \
+#if defined(CONFIG_MMC_OMAP_HS) && \
        !defined(CONFIG_SPL_BUILD)
 int board_mmc_init(bd_t *bis)
 {
-       return omap_mmc_init(0);
+       return omap_mmc_init(0, 0, 0, -1, -1);
 }
 #endif
 
 #ifdef CONFIG_SPL_OS_BOOT
 /*
- * Do board specific preperation before SPL
+ * Do board specific preparation before SPL
  * Linux boot
  */
 void spl_board_prepare_for_linux(void)
@@ -151,10 +152,10 @@ void spl_board_prepare_for_linux(void)
 int spl_start_uboot(void)
 {
        int val = 0;
-       if (!gpio_request(CONFIG_SPL_OS_BOOT_KEY, "U-Boot key")) {
-               gpio_direction_input(CONFIG_SPL_OS_BOOT_KEY);
-               val = gpio_get_value(CONFIG_SPL_OS_BOOT_KEY);
-               gpio_free(CONFIG_SPL_OS_BOOT_KEY);
+       if (!gpio_request(SPL_OS_BOOT_KEY, "U-Boot key")) {
+               gpio_direction_input(SPL_OS_BOOT_KEY);
+               val = gpio_get_value(SPL_OS_BOOT_KEY);
+               gpio_free(SPL_OS_BOOT_KEY);
        }
        return val;
 }