]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/logicpd/am3517evm/am3517evm.c
Merge branch 'u-boot-imx/master' into 'u-boot-arm/master'
[karo-tx-uboot.git] / board / logicpd / am3517evm / am3517evm.c
index 0b3721ed854004f9110d2a4a490f71dc7f060cc0..24be6eabfcd2d2b09d93db8ab70ce0df8057e97b 100644 (file)
@@ -8,19 +8,7 @@
  * Copyright (C) 2010
  * Texas Instruments Incorporated - http://www.ti.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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -34,6 +22,7 @@
 #include <asm/arch/musb.h>
 #include <asm/mach-types.h>
 #include <asm/errno.h>
+#include <asm/gpio.h>
 #include <linux/usb/ch9.h>
 #include <linux/usb/gadget.h>
 #include <linux/usb/musb.h>
@@ -43,6 +32,9 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#define AM3517_IP_SW_RESET     0x48002598
+#define CPGMACSS_SW_RST                (1 << 1)
+
 /*
  * Routine: board_init
  * Description: Early hardware init.
@@ -110,14 +102,42 @@ static void am3517_evm_musb_init(void)
  */
 int misc_init_r(void)
 {
-#ifdef CONFIG_DRIVER_OMAP34XX_I2C
-       i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+       volatile unsigned int ctr;
+       u32 reset;
+
+#ifdef CONFIG_SYS_I2C_OMAP34XX
+       i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
 #endif
 
        dieid_num_r();
 
        am3517_evm_musb_init();
 
+       /* activate PHY reset */
+       gpio_direction_output(30, 0);
+       gpio_set_value(30, 0);
+
+       ctr  = 0;
+       do {
+               udelay(1000);
+               ctr++;
+       } while (ctr < 300);
+
+       /* deactivate PHY reset */
+       gpio_set_value(30, 1);
+
+       /* allow the PHY to stabilize and settle down */
+       ctr = 0;
+       do {
+               udelay(1000);
+               ctr++;
+       } while (ctr < 300);
+
+       /* ensure that the module is out of reset */
+       reset = readl(AM3517_IP_SW_RESET);
+       reset &= (~CPGMACSS_SW_RST);
+       writel(reset,AM3517_IP_SW_RESET);
+
        return 0;
 }
 
@@ -135,8 +155,7 @@ void set_muxconf_regs(void)
 #if defined(CONFIG_GENERIC_MMC) && !defined(CONFIG_SPL_BUILD)
 int board_mmc_init(bd_t *bis)
 {
-       omap_mmc_init(0, 0, 0);
-       return 0;
+       return omap_mmc_init(0, 0, 0, -1, -1);
 }
 #endif
 
@@ -156,4 +175,3 @@ int board_eth_init(bd_t *bis)
        return n;
 }
 #endif
-