All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Marcin Wojtas <mw@semihalf.com>
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
Date: Mon, 4 Sep 2017 18:26:02 +0200	[thread overview]
Message-ID: <20170904162602.GC21849@amd> (raw)
In-Reply-To: <1503954854-30963-2-git-send-email-mw@semihalf.com>

[-- Attachment #1: Type: text/plain, Size: 1007 bytes --]

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

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: pavel@ucw.cz (Pavel Machek)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] mtd: spi-nor: add an option to force 3byte adressing mode
Date: Mon, 4 Sep 2017 18:26:02 +0200	[thread overview]
Message-ID: <20170904162602.GC21849@amd> (raw)
In-Reply-To: <1503954854-30963-2-git-send-email-mw@semihalf.com>

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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170904/88a55ffc/attachment.sig>

  parent reply	other threads:[~2017-09-04 16:26 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-28 21:14 [PATCH 0/2] SPI NOR - force 3byte addressing mode Marcin Wojtas
2017-08-28 21:14 ` Marcin Wojtas
2017-08-28 21:14 ` Marcin Wojtas
2017-08-28 21:14 ` [PATCH 1/2] mtd: spi-nor: add an option to force 3byte adressing mode Marcin Wojtas
2017-08-28 21:14   ` Marcin Wojtas
2017-08-28 21:18   ` Geert Uytterhoeven
2017-08-28 21:18     ` Geert Uytterhoeven
2017-08-28 21:54     ` Marcin Wojtas
2017-08-28 21:54       ` Marcin Wojtas
2017-08-28 21:54       ` Marcin Wojtas
2017-08-28 23:24   ` Marek Vasut
2017-08-28 23:24     ` Marek Vasut
2017-08-29  7:40     ` Marcin Wojtas
2017-08-29  7:40       ` Marcin Wojtas
2017-09-04 16:26   ` Pavel Machek [this message]
2017-09-04 16:26     ` Pavel Machek
2017-08-28 21:14 ` [PATCH 2/2] arm64: dts: marvell: Force 3byte addressing mode for SPI on A7040 DB Marcin Wojtas
2017-08-28 21:14   ` Marcin Wojtas

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=20170904162602.GC21849@amd \
    --to=pavel@ucw.cz \
    --cc=broonie@kernel.org \
    --cc=cyrille.pitchen@wedev4u.fr \
    --cc=gregory.clement@free-electrons.com \
    --cc=hannah@marvell.com \
    --cc=jaz@semihalf.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=marek.vasut@gmail.com \
    --cc=mark.rutland@arm.com \
    --cc=mw@semihalf.com \
    --cc=nadavh@marvell.com \
    --cc=neta@marvell.com \
    --cc=omrii@marvell.com \
    --cc=robh+dt@kernel.org \
    --cc=thomas.petazzoni@free-electrons.com \
    --cc=tn@semihalf.com \
    --cc=will.deacon@arm.com \
    /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.