All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] socfpga 2016.07-rc0: have to disable parts of flash probing and limit read size to get SPL to work
Date: Wed, 1 Jun 2016 23:24:35 +0200	[thread overview]
Message-ID: <20160601212435.GA19605@amd> (raw)
In-Reply-To: <CAOMZO5CN0FhJYdJ7SJDAaEkVvifA_ve9SSpVSqBhc6Yhn89VHg@mail.gmail.com>

Hi!

There's one more "funny" thing I see with SPI: SPL fails to boot if I
let it do full probing, or if I allow it to do reads in big chunks
(that may be explained by watchdog, I'll investigate it some more).

This makes SPL work for me, but I guess I'd like to understand why.

Ideas welcome.

Best regards,
								Pavel

--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -515,6 +520,7 @@ int spi_flash_cmd_read_ops(struct spi_flash *flash, u32 offset,
 #endif
 		remain_len = ((SPI_FLASH_16MB_BOUN << flash->shift) *
 				(bank_sel + 1)) - offset;
+		remain_len = 32768;
 		if (len < remain_len)
 			read_len = len;
 		else
@@ -1176,23 +1178,28 @@ int spi_flash_scan(struct spi_flash *flash)
 	/* Now erase size becomes valid sector size */
 	flash->sector_size = flash->erase_size;
 
+#ifndef CONFIG_SPL_BUILD
 	/* Look for the fastest read cmd */
 	cmd = fls(params->e_rd_cmd & spi->mode_rx);
 	if (cmd) {
 		cmd = spi_read_cmds_array[cmd - 1];
 		flash->read_cmd = cmd;
 	} else {
+#endif
 		/* Go for default supported read cmd */
 		flash->read_cmd = CMD_READ_ARRAY_FAST;
+#ifndef CONFIG_SPL_BUILD		
 	}
-
 	/* Not require to look for fastest only two write cmds yet */
 	if (params->flags & WR_QPP && spi->mode & SPI_TX_QUAD)
 		flash->write_cmd = CMD_QUAD_PAGE_PROGRAM;
 	else
+#endif
 		/* Go for default supported write cmd */
 		flash->write_cmd = CMD_PAGE_PROGRAM;
 
+	/* Why are we even probing writes? SPL should not write anywhere... */
+
 	/* Set the quad enable bit - only for quad commands */
 	if ((flash->read_cmd == CMD_READ_QUAD_OUTPUT_FAST) ||
 	    (flash->read_cmd == CMD_READ_QUAD_IO_FAST) ||




-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  parent reply	other threads:[~2016-06-01 21:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-29 20:40 [U-Boot] Between 2015.10 and 2016.01, SPI flash changed erase size, and saveenv stopped working Pavel Machek
2016-05-30  3:21 ` Stefan Roese
2016-05-30  7:04   ` Pavel Machek
2016-05-30  8:33   ` Pavel Machek
2016-05-30  8:52     ` Pavel Machek
2016-05-30 13:43     ` Fabio Estevam
2016-05-30 20:25       ` Pavel Machek
2016-05-30 21:23         ` Fabio Estevam
2016-06-01 21:24       ` Pavel Machek [this message]
2016-06-02 13:41       ` Pavel Machek
2016-06-04 20:38         ` Fabio Estevam

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=20160601212435.GA19605@amd \
    --to=pavel@denx.de \
    --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.