]> git.sur5r.net Git - u-boot/blobdiff - board/freescale/p1_p2_rdb/p1_p2_rdb.c
Merge branch 'master' of git://git.denx.de/u-boot-mpc85xx
[u-boot] / board / freescale / p1_p2_rdb / p1_p2_rdb.c
index d66b130e6d4a20dee8179f6da7b29fbde2207efd..3df557d6a3d445f2cd817d58ec66bec3484968f2 100644 (file)
@@ -1,23 +1,7 @@
 /*
  * Copyright 2009-2011 Freescale Semiconductor, Inc.
  *
- * 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>
@@ -37,6 +21,7 @@
 #include <netdev.h>
 #include <rtc.h>
 #include <i2c.h>
+#include <hwconfig.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -107,11 +92,9 @@ int checkboard (void)
        else
                panic ("Unexpected Board REV %x detected!!\n", board_rev_gpio);
 
-       cpu = gd->cpu;
+       cpu = gd->arch.cpu;
        printf ("Board: %sRDB Rev%c\n", cpu->name, board_rev);
-#ifdef CONFIG_PHYS_64BIT
-       puts ("(36-bit addrmap) \n");
-#endif
+
        setbits_be32(&pgpio->gpdir, GPIO_DIR);
 
 /*
@@ -247,6 +230,8 @@ extern void ft_pci_board_setup(void *blob);
 
 void ft_board_setup(void *blob, bd_t *bd)
 {
+       const char *soc_usb_compat = "fsl-usb2-dr";
+       int err, usb1_off, usb2_off;
        phys_addr_t base;
        phys_size_t size;
 
@@ -260,5 +245,51 @@ void ft_board_setup(void *blob, bd_t *bd)
 #endif /* #if defined(CONFIG_PCI) */
 
        fdt_fixup_memory(blob, (u64)base, (u64)size);
+
+#if defined(CONFIG_HAS_FSL_DR_USB)
+       fdt_fixup_dr_usb(blob, bd);
+#endif
+
+#if defined(CONFIG_SDCARD) || defined(CONFIG_SPIFLASH)
+       /* Delete eLBC node as it is muxed with USB2 controller */
+       if (hwconfig("usb2")) {
+               const char *soc_elbc_compat = "fsl,p1020-elbc";
+               int off = fdt_node_offset_by_compatible(blob, -1,
+                       soc_elbc_compat);
+               if (off < 0) {
+                       printf("WARNING: could not find compatible node"
+                               " %s: %s.\n", soc_elbc_compat,
+                               fdt_strerror(off));
+                               return;
+               }
+               err = fdt_del_node(blob, off);
+               if (err < 0) {
+                       printf("WARNING: could not remove %s: %s.\n",
+                               soc_elbc_compat, fdt_strerror(err));
+               }
+               return;
+       }
+#endif
+       /* Delete USB2 node as it is muxed with eLBC */
+       usb1_off = fdt_node_offset_by_compatible(blob, -1,
+               soc_usb_compat);
+       if (usb1_off < 0) {
+               printf("WARNING: could not find compatible node"
+                       " %s: %s.\n", soc_usb_compat,
+                       fdt_strerror(usb1_off));
+               return;
+       }
+       usb2_off = fdt_node_offset_by_compatible(blob, usb1_off,
+                       soc_usb_compat);
+       if (usb2_off < 0) {
+               printf("WARNING: could not find compatible node"
+                       " %s: %s.\n", soc_usb_compat,
+                       fdt_strerror(usb2_off));
+               return;
+       }
+       err = fdt_del_node(blob, usb2_off);
+       if (err < 0)
+               printf("WARNING: could not remove %s: %s.\n",
+                       soc_usb_compat, fdt_strerror(err));
 }
 #endif