  	"run findfdt; " \
  	"run distro_bootcmd"
  
-@@ -135,8 +136,8 @@
+@@ -103,7 +103,6 @@
+ 	DEFAULT_LINUX_BOOT_ENV \
+ 	DEFAULT_MMC_TI_ARGS \
+ 	"boot_fdt=try\0" \
+-	"bootpart=0:2\0" \
+ 	"bootdir=/boot\0" \
+ 	"bootfile=zImage\0" \
+ 	"fdtfile=undefined\0" \
+@@ -124,19 +123,19 @@
+ 		"root=${spiroot} " \
+ 		"rootfstype=${spirootfstype}\0" \
+ 	"bootenv=uEnv.txt\0" \
+-	"loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \
+-	"bootscript=echo Running bootscript from mmc${mmcdev} ...; " \
++	"loadbootscript=load ${mender_uboot_boot} ${loadaddr} boot.scr\0" \
++	"bootscript=echo Running bootscript from ${mender_uboot_boot} ...; " \
+ 		"source ${loadaddr}\0" \
+-	"loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
++	"loadbootenv=load ${mender_uboot_boot} ${loadaddr} ${bootenv}\0" \
+ 	"importbootenv=echo Importing environment from mmc ...; " \
+ 		"env import -t -r $loadaddr $filesize\0" \
+ 	"ramargs=setenv bootargs console=${console} " \
+ 		"${optargs} " \
  		"root=${ramroot} " \
  		"rootfstype=${ramrootfstype}\0" \
- 	"loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \
+-	"loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \
 -	"loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
 -	"loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
++	"loadramdisk=load ${mender_uboot_root} ${rdaddr} ramdisk.gz\0" \
 +	"loadimage=load ${mender_uboot_root} ${loadaddr} ${bootdir}/${bootfile}\0" \
 +	"loadfdt=load ${mender_uboot_root} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
  	"mmcloados=run args_mmc; " \
  		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
  			"if run loadfdt; then " \
-@@ -226,7 +227,7 @@
+@@ -151,9 +150,9 @@
+ 		"else " \
+ 			"bootz; " \
+ 		"fi;\0" \
+-	"mmcboot=mmc dev ${mmcdev}; " \
++	"mmcboot=mmc dev ${mender_uboot_dev}; " \
+ 		"if mmc rescan; then " \
+-			"echo SD/MMC found on device ${mmcdev};" \
++			"echo SD/MMC found on device ${mender_uboot_dev};" \
+ 			"if run loadbootscript; then " \
+ 				"run bootscript;" \
+ 			"else " \
+@@ -226,7 +225,7 @@
  
  /* Bootcount using the RTC block */
  #define CONFIG_BOOTCOUNT_LIMIT

From 8ada882620ed3005dfc350678c41d47e70f631e2 Mon Sep 17 00:00:00 2001
From: Kristian Amlie <kristian.amlie@mender.io>
Date: Fri, 17 Jun 2016 14:54:04 +0200
Subject: [PATCH] BBB: Use Mender boot code for selecting boot device and
 partition.

---
 include/configs/am335x_evm.h      | 11 +++++------
 include/configs/ti_armv7_common.h |  2 +-
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index 6ebe0b3..12286dc 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -93,6 +93,7 @@
 	func(DHCP, dhcp, na)
 
 #define CONFIG_BOOTCOMMAND \

 #define CONFIG_SYS_BOOTCOUNT_BE
 
 /* USB gadget RNDIS */
@@ -274,9 +273,7 @@
 					"-(NAND.file-system)"
 #define CONFIG_SYS_NAND_U_BOOT_OFFS	0x000c0000
 #undef CONFIG_ENV_IS_NOWHERE
