SPDX: Convert all of our single license tags to Linux Kernel style
[oweals/u-boot.git] / board / ti / beagle / beagle.c
index 2f62fbec69e92ed47d56820ddb45744e8e238b48..826aace3fba24ee91216d63d4f6dde7ddc3a3cd3 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * (C) Copyright 2004-2011
  * Texas Instruments, <www.ti.com>
@@ -10,8 +11,6 @@
  *     Richard Woodruff <r-woodruff2@ti.com>
  *     Syed Mohammed Khasim <khasim@ti.com>
  *
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 #include <common.h>
 #include <dm.h>
@@ -20,7 +19,7 @@
 #include <status_led.h>
 #endif
 #include <twl4030.h>
-#include <linux/mtd/nand.h>
+#include <linux/mtd/rawnand.h>
 #include <asm/io.h>
 #include <asm/arch/mmc_host_def.h>
 #include <asm/arch/mux.h>
@@ -103,6 +102,17 @@ int board_init(void)
        return 0;
 }
 
+#if defined(CONFIG_SPL_OS_BOOT)
+int spl_start_uboot(void)
+{
+       /* break into full u-boot on 'c' */
+       if (serial_tstc() && serial_getc() == 'c')
+               return 1;
+
+       return 0;
+}
+#endif /* CONFIG_SPL_OS_BOOT */
+
 /*
  * Routine: get_board_revision
  * Description: Detect if we are running on a Beagle revision Ax/Bx,
@@ -510,6 +520,14 @@ int misc_init_r(void)
        if (generate_fake_mac)
                omap_die_id_usbethaddr();
 
+#if defined(CONFIG_MTDIDS_DEFAULT) && defined(CONFIG_MTDPARTS_DEFAULT)
+       if (strlen(CONFIG_MTDIDS_DEFAULT))
+               env_set("mtdids", CONFIG_MTDIDS_DEFAULT);
+
+       if (strlen(CONFIG_MTDPARTS_DEFAULT))
+               env_set("mtdparts", CONFIG_MTDPARTS_DEFAULT);
+#endif
+
        return 0;
 }