From patchwork Wed Jun 1 21:24:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Machek X-Patchwork-Id: 628870 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3rKk012RHHz9sCg for ; Thu, 2 Jun 2016 07:24:48 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C20D4A74DB; Wed, 1 Jun 2016 23:24:44 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LpdUjIrz-Ey8; Wed, 1 Jun 2016 23:24:44 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 22352A74BA; Wed, 1 Jun 2016 23:24:44 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F16D8A74BA for ; Wed, 1 Jun 2016 23:24:40 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QxwiEyGsFW3w for ; Wed, 1 Jun 2016 23:24:40 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from atrey.karlin.mff.cuni.cz (atrey.karlin.mff.cuni.cz [195.113.26.193]) by theia.denx.de (Postfix) with ESMTP id C6F6BA74A8 for ; Wed, 1 Jun 2016 23:24:36 +0200 (CEST) Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 119C3823AD; Wed, 1 Jun 2016 23:24:35 +0200 (CEST) Date: Wed, 1 Jun 2016 23:24:35 +0200 From: Pavel Machek To: Fabio Estevam Message-ID: <20160601212435.GA19605@amd> References: <20160529204041.GA8588@amd> <574BB1B8.8010400@denx.de> <20160530083315.GA18126@amd> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: Marek =?utf-8?B?VmHFoXV0?= , Fabio Estevam , Stefan Roese , Jagan Teki , U-Boot-Denx Subject: [U-Boot] socfpga 2016.07-rc0: have to disable parts of flash probing and limit read size to get SPL to work X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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) ||