]> git.sur5r.net Git - u-boot/commitdiff
omap3: evm: Fixes for CONFIG_NAND, SPL_OS_BOOT, USB, and environment
authorDerald D. Woods <woods.technical@gmail.com>
Sat, 2 Sep 2017 22:43:05 +0000 (17:43 -0500)
committerTom Rini <trini@konsulko.com>
Sun, 3 Sep 2017 19:30:36 +0000 (15:30 -0400)
- Pass MTDPARTS kernel arguments to kernel
- Use Kconfig CONFIG_NAND instead of CONFIG_SYS_EXTRA_OPTIONS="NAND"
- Call 'usb_stop' on kernel start
- Update Falcon mode setup to match other OMAP3 boards
- Use "uEnv.txt" as boot script instead of "boot.scr"

board/ti/evm/evm.c
configs/omap3_evm_defconfig
include/configs/omap3_evm.h

index 6bf57f9269b4977bd0683fe0842b0f73faadced0..1f0433dcc0471fb638748f67829f974a9cafc3e8 100644 (file)
@@ -122,6 +122,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 */
+
 #if defined(CONFIG_SPL_BUILD)
 /*
  * Routine: get_board_mem_timings
@@ -323,7 +334,14 @@ void board_mmc_power_init(void)
 }
 #endif /* CONFIG_MMC */
 
-#if defined(CONFIG_USB_EHCI_HCD)
+#if defined(CONFIG_USB_EHCI_HCD) && !defined(CONFIG_SPL_BUILD)
+/* Call usb_stop() before starting the kernel */
+void show_boot_progress(int val)
+{
+       if (val == BOOTSTAGE_ID_RUN_OS)
+               usb_stop();
+}
+
 static struct omap_usbhs_board_data usbhs_bdata = {
        .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
        .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
index 9977e8e10f1c49266e170f3d87a68e6439ab7ff2..51fd210d4141ed6f5c246197a7a37635790eaea1 100644 (file)
@@ -7,7 +7,7 @@ CONFIG_SYS_MPUCLK=720
 CONFIG_TARGET_OMAP3_EVM=y
 CONFIG_SPL_STACK_R_ADDR=0x82000000
 CONFIG_DISTRO_DEFAULTS=y
-CONFIG_SYS_EXTRA_OPTIONS="NAND"
+CONFIG_ENV_IS_IN_NAND=y
 CONFIG_BOOTDELAY=3
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_DEFAULT_FDT_FILE="omap3-evm.dtb"
@@ -44,6 +44,7 @@ CONFIG_DM=y
 CONFIG_SPL_DM=y
 CONFIG_DM_GPIO=y
 CONFIG_MMC_OMAP_HS=y
+CONFIG_NAND=y
 CONFIG_MTD=y
 CONFIG_DM_SERIAL=y
 CONFIG_SYS_NS16550=y
index dd7ea5c8a65123603c5b3221be95346b1fe41070..2c48b4f3d86bb59ee3028ec8497dbbf5b3ba15a0 100644 (file)
@@ -36,7 +36,6 @@
 #define CONFIG_INITRD_TAG
 #define CONFIG_REVISION_TAG
 
-
 /* Override OMAP3 serial console configuration */
 #undef CONFIG_CONS_INDEX
 #define CONFIG_CONS_INDEX               1
 #define CONFIG_ENV_OFFSET               SMNAND_ENV_OFFSET
 #define CONFIG_ENV_ADDR                 SMNAND_ENV_OFFSET
 #define CONFIG_ENV_OVERWRITE
-#define CONFIG_MTD_DEVICE               /* needed for mtdparts commands */
 #define CONFIG_MTD_PARTITIONS           /* required for UBI partition support */
+/* NAND: SPL falcon mode configs */
+#if defined(CONFIG_SPL_OS_BOOT)
+#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x280000
+#endif /* CONFIG_SPL_OS_BOOT */
 #endif /* CONFIG_NAND */
 
-#define CONFIG_USB_OMAP3
-
 /* MUSB */
+#define CONFIG_USB_OMAP3
 #define CONFIG_USB_MUSB_OMAP2PLUS
 #define CONFIG_USB_MUSB_PIO_ONLY
 #define CONFIG_USB_ETHER
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
        DEFAULT_LINUX_BOOT_ENV \
-       "mtdids=" CONFIG_MTDIDS_DEFAULT "\0"    \
+       "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
        "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
-       "loadaddr=0x82000000\0" \
-       "usbtty=cdc_acm\0" \
+       "bootenv=uEnv.txt\0" \
+       "optargs=\0" \
        "mmcdev=0\0" \
        "console=ttyO0,115200n8\0" \
        "mmcargs=setenv bootargs console=${console} " \
+               "${mtdparts} " \
                "${optargs} " \
                "root=/dev/mmcblk0p2 rw " \
                "rootfstype=ext4 rootwait\0" \
        "nandargs=setenv bootargs console=${console} " \
+               "${mtdparts} " \
                "${optargs} " \
                "root=ubi0:rootfs rw ubi.mtd=rootfs noinitrd " \
                "rootfstype=ubifs rootwait\0" \
-       "loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
+       "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
+       "importbootenv=echo Importing environment from mmc ...; " \
+               "env import -t ${loadaddr} ${filesize}\0" \
        "bootscript=echo Running bootscript from mmc ...; " \
                "source ${loadaddr}\0" \
        "loaduimage=setenv bootfile uImage; " \
                "fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
        "loadzimage=setenv bootfile zImage; " \
                "fatload mmc ${mmcdev} ${loadaddr} zImage\0" \
-       "loaddtb=fatload mmc ${mmcdev} ${fdtaddr} omap3-evm.dtb\0" \
+       "loaddtb=fatload mmc ${mmcdev} ${fdtaddr} " CONFIG_DEFAULT_FDT_FILE "\0" \
        "mmcboot=echo Booting ${bootfile} from mmc ...; " \
                "run mmcargs; " \
                "bootm ${loadaddr} - ${fdtaddr}\0" \
 
 #define CONFIG_BOOTCOMMAND \
        "mmc dev ${mmcdev}; if mmc rescan; then " \
-               "if run loadbootscript; then " \
-                       "run bootscript; " \
+               "if run loadbootenv; then " \
+                       "run importbootenv; " \
+                       "if test -n $uenvcmd; then " \
+                               "echo Running uenvcmd ...; " \
+                               "run uenvcmd; " \
+                       "fi; " \
                "else " \
                        "if run loadzimage && run loaddtb; then " \
                                "run mmcbootz; fi; " \