lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20170904162602.GC21849@amd>
Date:   Mon, 4 Sep 2017 18:26:02 +0200
From:   Pavel Machek <pavel@....cz>
To:     Marcin Wojtas <mw@...ihalf.com>
Cc:     linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-mtd@...ts.infradead.org, linux-spi@...r.kernel.org,
        robh+dt@...nel.org, mark.rutland@....com, will.deacon@....com,
        cyrille.pitchen@...ev4u.fr, marek.vasut@...il.com,
        broonie@...nel.org, thomas.petazzoni@...e-electrons.com,
        gregory.clement@...e-electrons.com, nadavh@...vell.com,
        neta@...vell.com, omrii@...vell.com, hannah@...vell.com,
        jaz@...ihalf.com, tn@...ihalf.com
Subject: Re: [PATCH 1/2] mtd: spi-nor: add an option to force 3byte adressing
 mode

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) == 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 = 3;
> +			mtd->size = 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
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ