All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabio Estevam <fabio.estevam@nxp.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] disk: part_dos: Use the original allocation scheme for the SPL case
Date: Wed, 4 Oct 2017 13:29:57 -0300	[thread overview]
Message-ID: <1507134597-6831-1-git-send-email-fabio.estevam@nxp.com> (raw)

Since commit ff98cb90514d ("part: extract MBR signature from partitions")
SPL boot on i.MX6 starts to fail:

U-Boot SPL 2017.09-00221-g0d6ab32 (Oct 02 2017 - 15:13:19)
Trying to boot from MMC1
(keep in loop)

Use the original allocation scheme for the SPL case, so that MX6 boards
can boot again.

This is a temporary solution to avoid the boot regression.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
Hi Tom,

I do not have time this week to further investigate and narrow down 
this problem.

Using the old allocation scheme fixes the mx6 SPL boot problem.


 disk/part_dos.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/disk/part_dos.c b/disk/part_dos.c
index 1a36be0..6dd2c2d 100644
--- a/disk/part_dos.c
+++ b/disk/part_dos.c
@@ -89,6 +89,7 @@ static int test_block_type(unsigned char *buffer)
 
 static int part_test_dos(struct blk_desc *dev_desc)
 {
+#ifndef CONFIG_SPL_BUILD
 	ALLOC_CACHE_ALIGN_BUFFER(legacy_mbr, mbr, dev_desc->blksz);
 
 	if (blk_dread(dev_desc, 0, 1, (ulong *)mbr) != 1)
@@ -102,6 +103,15 @@ static int part_test_dos(struct blk_desc *dev_desc)
 		dev_desc->sig_type = SIG_TYPE_MBR;
 		dev_desc->mbr_sig = mbr->unique_mbr_signature;
 	}
+#else
+	ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz);
+
+	if (blk_dread(dev_desc, 0, 1, (ulong *)buffer) != 1)
+		return -1;
+
+	if (test_block_type(buffer) != DOS_MBR)
+		return -1;
+#endif
 
 	return 0;
 }
-- 
2.7.4

             reply	other threads:[~2017-10-04 16:29 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-04 16:29 Fabio Estevam [this message]
2017-10-04 17:12 ` [U-Boot] [PATCH] disk: part_dos: Use the original allocation scheme for the SPL case Rob Clark
2017-10-05  4:36   ` Jonathan Gray
2017-10-05  9:05     ` Rob Clark
2017-10-06  4:35       ` Jonathan Gray
2017-10-06 12:21         ` Rob Clark
2017-10-06 12:26           ` Rob Clark
2017-10-07  2:08           ` Jonathan Gray
2017-10-07 12:23             ` Rob Clark
2017-10-07 13:20               ` Jonathan Gray
2017-10-08 23:00               ` Peter Robinson
2017-10-07 17:46     ` Fabio Estevam
2017-10-08  1:06       ` Jonathan Gray
2017-10-08 12:56         ` Fabio Estevam
2017-10-08 14:04           ` Jonathan Gray
2017-10-09  1:56             ` Fabio Estevam
2017-10-09  3:12               ` Tom Rini
2017-10-09  6:19                 ` Jonathan Gray
2017-10-09 12:08                   ` Tom Rini
2017-10-05 11:01 ` Peter Robinson
2017-10-05 21:52 ` [U-Boot] " Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1507134597-6831-1-git-send-email-fabio.estevam@nxp.com \
    --to=fabio.estevam@nxp.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.