Merge branch 'master' of git://git.denx.de/u-boot-samsung
[platform/kernel/u-boot.git] / board / davinci / da8xxevm / omapl138_lcdk.c
index bef2570..52bb736 100644 (file)
@@ -6,19 +6,7 @@
  * Copyright (C) 2009 Nick Thompson, GE Fanuc, Ltd. <nick.thompson@gefanuc.com>
  * Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net>
  *
- * 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>
 #include <asm/arch/hardware.h>
 #include <asm/ti-common/davinci_nand.h>
 #include <asm/io.h>
-#include <asm/errno.h>
+#include <linux/errno.h>
+#include <asm/mach-types.h>
 #include <asm/arch/davinci_misc.h>
-#ifdef CONFIG_DAVINCI_MMC
+#ifdef CONFIG_MMC_DAVINCI
 #include <mmc.h>
 #include <asm/arch/sdmmc_defs.h>
 #endif
@@ -41,7 +30,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #define pinmux(x)      (&davinci_syscfg_regs->pinmux[x])
 
-#ifdef CONFIG_DAVINCI_MMC
+#ifdef CONFIG_MMC_DAVINCI
 /* MMC0 pin muxer settings */
 const struct pinmux_config mmc0_pins[] = {
        /* GP0[11] is required for SD to work on Rev 3 EVMs */
@@ -142,7 +131,7 @@ const struct lpsc_resource lpsc[] = {
        { DAVINCI_LPSC_EMAC },  /* image download */
        { DAVINCI_LPSC_UART2 }, /* console */
        { DAVINCI_LPSC_GPIO },
-#ifdef CONFIG_DAVINCI_MMC
+#ifdef CONFIG_MMC_DAVINCI
        { DAVINCI_LPSC_MMC_SD },
 #endif
 };
@@ -183,9 +172,7 @@ int board_early_init_f(void)
 
 int board_init(void)
 {
-#ifndef CONFIG_USE_IRQ
        irq_init();
-#endif
 
        /* arch number of the board */
        gd->bd->bi_arch_number = MACH_TYPE_OMAPL138_LCDK;
@@ -222,7 +209,7 @@ int board_init(void)
 #endif
 
 
-#ifdef CONFIG_DAVINCI_MMC
+#ifdef CONFIG_MMC_DAVINCI
        if (davinci_configure_pin_mux(mmc0_pins, ARRAY_SIZE(mmc0_pins)) != 0)
                return 1;
 #endif
@@ -345,15 +332,17 @@ int misc_init_r(void)
                        get_mac_addr(addr);
                }
 
-               if (is_multicast_ethaddr(addr) || is_zero_ethaddr(addr)) {
+               if (!is_multicast_ethaddr(addr) && !is_zero_ethaddr(addr)) {
+                       sprintf((char *)tmp, "%02x:%02x:%02x:%02x:%02x:%02x",
+                               addr[0], addr[1], addr[2], addr[3], addr[4],
+                               addr[5]);
+
+                       setenv("ethaddr", (char *)tmp);
+               } else {
                        printf("Invalid MAC address read.\n");
-                       return -EINVAL;
                }
-               sprintf((char *)tmp, "%02x:%02x:%02x:%02x:%02x:%02x", addr[0],
-                               addr[1], addr[2], addr[3], addr[4], addr[5]);
-
-               setenv("ethaddr", (char *)tmp);
        }
+
 #ifdef CONFIG_DRIVER_TI_EMAC_USE_RMII
        /* Select RMII fucntion through the expander */
        if (rmii_hw_init())
@@ -365,7 +354,7 @@ int misc_init_r(void)
        return 0;
 }
 
-#ifdef CONFIG_DAVINCI_MMC
+#ifdef CONFIG_MMC_DAVINCI
 static struct davinci_mmc mmc_sd0 = {
        .reg_base = (struct davinci_mmc_regs *)DAVINCI_MMC_SD0_BASE,
        .host_caps = MMC_MODE_4BIT,     /* DA850 supports only 4-bit SD/MMC */