From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753954AbdIDQ0G (ORCPT ); Mon, 4 Sep 2017 12:26:06 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:47126 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753847AbdIDQ0E (ORCPT ); Mon, 4 Sep 2017 12:26:04 -0400 Date: Mon, 4 Sep 2017 18:26:02 +0200 From: Pavel Machek To: Marcin Wojtas Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mtd@lists.infradead.org, linux-spi@vger.kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, will.deacon@arm.com, cyrille.pitchen@wedev4u.fr, marek.vasut@gmail.com, broonie@kernel.org, thomas.petazzoni@free-electrons.com, gregory.clement@free-electrons.com, nadavh@marvell.com, neta@marvell.com, omrii@marvell.com, hannah@marvell.com, jaz@semihalf.com, tn@semihalf.com Subject: Re: [PATCH 1/2] mtd: spi-nor: add an option to force 3byte adressing mode Message-ID: <20170904162602.GC21849@amd> References: <1503954854-30963-1-git-send-email-mw@semihalf.com> <1503954854-30963-2-git-send-email-mw@semihalf.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="hOcCNbCCxyk/YU74" Content-Disposition: inline In-Reply-To: <1503954854-30963-2-git-send-email-mw@semihalf.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --hOcCNbCCxyk/YU74 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > index 1413828..029c87d 100644 > --- a/drivers/mtd/spi-nor/spi-nor.c > +++ b/drivers/mtd/spi-nor/spi-nor.c > @@ -2002,7 +2002,17 @@ int spi_nor_scan(struct spi_nor *nor, const char *= name, > if (JEDEC_MFR(info) =3D=3D SNOR_MFR_SPANSION || > info->flags & SPI_NOR_4B_OPCODES) > spi_nor_set_4byte_opcodes(nor, info); > - else > + else if (of_property_read_bool(np, "spi-3byte-addressing")) { > + /* > + * Do not enter 4byte mode in order to prevent > + * the early bootloader to come up on non-default > + * SPI NOR memory during boot. Limit accessible > + * size to 16MiB. > + */ > + nor->addr_width =3D 3; > + mtd->size =3D 0x1000000; > + dev_info(dev, "Force 3B addressing mode\n"); I'd append "limiting access to first 16MiB" .. because otherwise people will wonder where their flash went. Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --hOcCNbCCxyk/YU74 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlmtfpoACgkQMOfwapXb+vIroACffO9X/PgTB78Lap7a67L4ktNh Um4AoLYdOzK2KItNHTvYmMsBVuX3624u =Bpyw -----END PGP SIGNATURE----- --hOcCNbCCxyk/YU74--