All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix booting from eMMC on BeagleBone Black
@ 2016-02-29 14:23 Jussi Laako
  2016-03-01  9:02 ` Jussi Laako
  0 siblings, 1 reply; 3+ messages in thread
From: Jussi Laako @ 2016-02-29 14:23 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 603 bytes --]

Hello,

By default, on BeagleBone, u-boot only looks for rootfs UUID from first 
mmc device and thus only from microSD. Thus booting from eMMC fails in 
kernel panic because command line has empty root partition UUID 
"root=PARTUUID=".

This patch makes it first look in the same place as before and if the 
lookup fails (no microSD inserted) it next looks up for the rootfs UUID 
on the second mmc device which is the on-board eMMC. I placed the 
bbappend and patch on meta-yocto-bsp layer because the BeagleBone 
support in general is located there.


Best regards,

	- Jussi Laako


[-- Attachment #2: 0001-Search-for-rootfs-partitions-on-both-SD-and-eMMC.patch --]
[-- Type: text/x-patch, Size: 2973 bytes --]

From f54171b120b1fa47a592bdb8f3fbac2350e1757e Mon Sep 17 00:00:00 2001
From: Jussi Laako <jussi.laako@linux.intel.com>
Date: Mon, 29 Feb 2016 16:12:11 +0200
Subject: [PATCH] Search for rootfs partitions on both SD and eMMC

On BeagleBone Black, first attempt to find rootfs from microSD
and then from eMMC if not available.

Fixes: #9176

Signed-off-by: Jussi Laako <jussi.laako@linux.intel.com>
---
 ...r-bootable-partitions-on-both-SD-and-eMMC.patch | 38 ++++++++++++++++++++++
 .../recipes-bsp/u-boot/u-boot_2016.01.bbappend     |  3 ++
 2 files changed, 41 insertions(+)
 create mode 100644 meta-yocto-bsp/recipes-bsp/u-boot/u-boot/0001-Search-for-bootable-partitions-on-both-SD-and-eMMC.patch
 create mode 100644 meta-yocto-bsp/recipes-bsp/u-boot/u-boot_2016.01.bbappend

diff --git a/meta-yocto-bsp/recipes-bsp/u-boot/u-boot/0001-Search-for-bootable-partitions-on-both-SD-and-eMMC.patch b/meta-yocto-bsp/recipes-bsp/u-boot/u-boot/0001-Search-for-bootable-partitions-on-both-SD-and-eMMC.patch
new file mode 100644
index 0000000..729dddf
--- /dev/null
+++ b/meta-yocto-bsp/recipes-bsp/u-boot/u-boot/0001-Search-for-bootable-partitions-on-both-SD-and-eMMC.patch
@@ -0,0 +1,38 @@
+From 86cc560ff9a6578326532e277d987e24661e5f04 Mon Sep 17 00:00:00 2001
+From: Jussi Laako <jussi.laako@linux.intel.com>
+Date: Fri, 26 Feb 2016 14:58:32 +0200
+Subject: [PATCH] Search for bootable partitions on both SD and eMMC
+
+On BeagleBone Black, first attempt to boot from microSD and then from
+eMMC if not available.
+
+Signed-off-by: Jussi Laako <jussi.laako@linux.intel.com>
+---
+ include/configs/ti_armv7_common.h | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/include/configs/ti_armv7_common.h b/include/configs/ti_armv7_common.h
+index 199612b..ece87ab 100644
+--- a/include/configs/ti_armv7_common.h
++++ b/include/configs/ti_armv7_common.h
+@@ -60,7 +60,16 @@
+ #define DEFAULT_MMC_TI_ARGS \
+ 	"mmcdev=0\0" \
+ 	"mmcrootfstype=ext4 rootwait\0" \
+-	"finduuid=part uuid mmc 0:2 uuid\0" \
++	"findsduuid=part uuid mmc 0:2 sduuid\0" \
++	"findemmcuuid=part uuid mmc 1:2 emmcuuid\0" \
++	"finduuid=if run findsduuid; then "\
++		"echo \"Boot from microSD\"; "\
++		"setenv uuid ${sduuid}; " \
++	"else " \
++		"run findemmcuuid; " \
++		"echo \"Boot from eMMC\"; " \
++		"setenv uuid ${emmcuuid}; " \
++	"fi;\0" \
+ 	"args_mmc=run finduuid;setenv bootargs console=${console} " \
+ 		"${optargs} " \
+ 		"root=PARTUUID=${uuid} rw " \
+-- 
+2.7.0
+
diff --git a/meta-yocto-bsp/recipes-bsp/u-boot/u-boot_2016.01.bbappend b/meta-yocto-bsp/recipes-bsp/u-boot/u-boot_2016.01.bbappend
new file mode 100644
index 0000000..01c8e68
--- /dev/null
+++ b/meta-yocto-bsp/recipes-bsp/u-boot/u-boot_2016.01.bbappend
@@ -0,0 +1,3 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI_append = " file://0001-Search-for-bootable-partitions-on-both-SD-and-eMMC.patch"
-- 
2.7.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] Fix booting from eMMC on BeagleBone Black
  2016-02-29 14:23 [PATCH] Fix booting from eMMC on BeagleBone Black Jussi Laako
@ 2016-03-01  9:02 ` Jussi Laako
  2016-05-12 15:07   ` Saul Wold
  0 siblings, 1 reply; 3+ messages in thread
From: Jussi Laako @ 2016-03-01  9:02 UTC (permalink / raw)
  To: poky

[-- Attachment #1: Type: text/plain, Size: 598 bytes --]

Hello,

By default, on BeagleBone, u-boot only looks for rootfs UUID from first
mmc device and thus only from microSD. Thus booting from eMMC fails in
kernel panic because command line has empty root partition UUID
"root=PARTUUID=".

This patch makes it first look in the same place as before and if the
lookup fails (no microSD inserted) it next looks up for the rootfs UUID
on the second mmc device which is the on-board eMMC. I placed the
bbappend and patch on meta-yocto-bsp layer because the BeagleBone
support in general is located there.


Best regards,

	- Jussi Laako



[-- Attachment #2: 0001-Search-for-rootfs-partitions-on-both-SD-and-eMMC.patch --]
[-- Type: text/x-patch, Size: 2975 bytes --]

From f54171b120b1fa47a592bdb8f3fbac2350e1757e Mon Sep 17 00:00:00 2001
From: Jussi Laako <jussi.laako@linux.intel.com>
Date: Mon, 29 Feb 2016 16:12:11 +0200
Subject: [PATCH] Search for rootfs partitions on both SD and eMMC

On BeagleBone Black, first attempt to find rootfs from microSD
and then from eMMC if not available.

Fixes: #9176

Signed-off-by: Jussi Laako <jussi.laako@linux.intel.com>
---
 ...r-bootable-partitions-on-both-SD-and-eMMC.patch | 38 ++++++++++++++++++++++
 .../recipes-bsp/u-boot/u-boot_2016.01.bbappend     |  3 ++
 2 files changed, 41 insertions(+)
 create mode 100644 meta-yocto-bsp/recipes-bsp/u-boot/u-boot/0001-Search-for-bootable-partitions-on-both-SD-and-eMMC.patch
 create mode 100644 meta-yocto-bsp/recipes-bsp/u-boot/u-boot_2016.01.bbappend

diff --git a/meta-yocto-bsp/recipes-bsp/u-boot/u-boot/0001-Search-for-bootable-partitions-on-both-SD-and-eMMC.patch b/meta-yocto-bsp/recipes-bsp/u-boot/u-boot/0001-Search-for-bootable-partitions-on-both-SD-and-eMMC.patch
new file mode 100644
index 0000000..729dddf
--- /dev/null
+++ b/meta-yocto-bsp/recipes-bsp/u-boot/u-boot/0001-Search-for-bootable-partitions-on-both-SD-and-eMMC.patch
@@ -0,0 +1,38 @@
+From 86cc560ff9a6578326532e277d987e24661e5f04 Mon Sep 17 00:00:00 2001
+From: Jussi Laako <jussi.laako@linux.intel.com>
+Date: Fri, 26 Feb 2016 14:58:32 +0200
+Subject: [PATCH] Search for bootable partitions on both SD and eMMC
+
+On BeagleBone Black, first attempt to boot from microSD and then from
+eMMC if not available.
+
+Signed-off-by: Jussi Laako <jussi.laako@linux.intel.com>
+---
+ include/configs/ti_armv7_common.h | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/include/configs/ti_armv7_common.h b/include/configs/ti_armv7_common.h
+index 199612b..ece87ab 100644
+--- a/include/configs/ti_armv7_common.h
++++ b/include/configs/ti_armv7_common.h
+@@ -60,7 +60,16 @@
+ #define DEFAULT_MMC_TI_ARGS \
+ 	"mmcdev=0\0" \
+ 	"mmcrootfstype=ext4 rootwait\0" \
+-	"finduuid=part uuid mmc 0:2 uuid\0" \
++	"findsduuid=part uuid mmc 0:2 sduuid\0" \
++	"findemmcuuid=part uuid mmc 1:2 emmcuuid\0" \
++	"finduuid=if run findsduuid; then "\
++		"echo \"Boot from microSD\"; "\
++		"setenv uuid ${sduuid}; " \
++	"else " \
++		"run findemmcuuid; " \
++		"echo \"Boot from eMMC\"; " \
++		"setenv uuid ${emmcuuid}; " \
++	"fi;\0" \
+ 	"args_mmc=run finduuid;setenv bootargs console=${console} " \
+ 		"${optargs} " \
+ 		"root=PARTUUID=${uuid} rw " \
+-- 
+2.7.0
+
diff --git a/meta-yocto-bsp/recipes-bsp/u-boot/u-boot_2016.01.bbappend b/meta-yocto-bsp/recipes-bsp/u-boot/u-boot_2016.01.bbappend
new file mode 100644
index 0000000..01c8e68
--- /dev/null
+++ b/meta-yocto-bsp/recipes-bsp/u-boot/u-boot_2016.01.bbappend
@@ -0,0 +1,3 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI_append = " file://0001-Search-for-bootable-partitions-on-both-SD-and-eMMC.patch"
-- 
2.7.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix booting from eMMC on BeagleBone Black
  2016-03-01  9:02 ` Jussi Laako
@ 2016-05-12 15:07   ` Saul Wold
  0 siblings, 0 replies; 3+ messages in thread
From: Saul Wold @ 2016-05-12 15:07 UTC (permalink / raw)
  To: Jussi Laako, poky, Richard Purdie; +Cc: Ross Burton

Richard,

Not sure why/how this got missed, it is missing an Upstream-Status in
the patch file, I would recommend that Jussi attempt to upstream it. 

Jussi, can you please add Upstream-Status to this patch.

Thanks
   Sau!


On Tue, 2016-03-01 at 11:02 +0200, Jussi Laako wrote:
> Hello,
> 
> By default, on BeagleBone, u-boot only looks for rootfs UUID from
> first
> mmc device and thus only from microSD. Thus booting from eMMC fails
> in
> kernel panic because command line has empty root partition UUID
> "root=PARTUUID=".
> 
> This patch makes it first look in the same place as before and if the
> lookup fails (no microSD inserted) it next looks up for the rootfs
> UUID
> on the second mmc device which is the on-board eMMC. I placed the
> bbappend and patch on meta-yocto-bsp layer because the BeagleBone
> support in general is located there.
> 
> 
> Best regards,
> 
> 	- Jussi Laako
> 
> 
> -- 
> _______________________________________________
> poky mailing list
> poky@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/poky


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-05-12 15:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-29 14:23 [PATCH] Fix booting from eMMC on BeagleBone Black Jussi Laako
2016-03-01  9:02 ` Jussi Laako
2016-05-12 15:07   ` Saul Wold

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.