Add GPL-2.0+ SPDX-License-Identifier to source files
[platform/kernel/u-boot.git] / board / intercontrol / digsy_mtc / digsy_mtc.c
index 784ba2a..5843725 100644 (file)
  * (C) Copyright 2009
  * Grzegorz Bernacki, Semihalf, gjb@semihalf.com
  *
- * 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>
@@ -49,6 +33,7 @@
 #include <libfdt.h>
 #include <fdt_support.h>
 #include <i2c.h>
+#include <mb862xx.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -220,20 +205,12 @@ int checkboard(void)
 
 #define GPT_GPIO_ON            0x00000034      /* GPT as simple GPIO, high */
 
-/* ExBo I2C Addresses */
-#define EXBO_EE_I2C_ADDRESS    0x56
-
 static void exbo_hw_init(void)
 {
        struct mpc5xxx_gpt *gpt = (struct mpc5xxx_gpt *)MPC5XXX_GPT;
        struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio *)MPC5XXX_GPIO;
        struct mpc5xxx_wu_gpio *wu_gpio =
                                (struct mpc5xxx_wu_gpio *)MPC5XXX_WU_GPIO;
-       unsigned char val;
-
-       /* 1st, check if extension board is present */
-       if (i2c_read(EXBO_EE_I2C_ADDRESS, 0, 1, &val, 1))
-               return;
 
        /* configure IrDA pins (PSC6 port) as gpios */
        gpio->port_config &= 0xFF8FFFFF;
@@ -288,8 +265,6 @@ int board_early_init_r(void)
        /* enable CS0 */
        setbits_be32((void *)MPC5XXX_ADDECR, (1 << 16));
 
-       exbo_hw_init();
-
 #if defined(CONFIG_USB_OHCI_NEW) && defined(CONFIG_SYS_USB_OHCI_CPU_INIT)
        /* Low level USB init, required for proper kernel operation */
        usb_cpu_init();
@@ -329,8 +304,15 @@ void board_get_enetaddr (uchar * enet)
 
 int misc_init_r(void)
 {
+       pci_dev_t devbusfn;
        uchar enetaddr[6];
 
+       /* check if graphic extension board is present */
+       devbusfn = pci_find_device(PCI_VENDOR_ID_FUJITSU,
+                                  PCI_DEVICE_ID_CORAL_PA, 0);
+       if (devbusfn != -1)
+               exbo_hw_init();
+
        if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
                board_get_enetaddr(enetaddr);
                eth_setenv_enetaddr("ethaddr", enetaddr);