From: Marek Vasut <marek.vasut@gmail.com>
To: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>,
Cyrille Pitchen <cyrille.pitchen@wedev4u.fr>
Cc: Cyrille Pitchen <cyrille.pitchen@atmel.com>,
David Woodhouse <dwmw2@infradead.org>,
Brian Norris <computersforpeace@gmail.com>,
Boris Brezillon <boris.brezillon@free-electrons.com>,
Richard Weinberger <richard@nod.at>,
"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v9] mtd: spi-nor: Add support for S3AN spi-nor devices
Date: Wed, 18 Jan 2017 16:56:32 +0100 [thread overview]
Message-ID: <e105a8f5-b02e-c266-1ffe-279ea1da03cb@gmail.com> (raw)
In-Reply-To: <CAPybu_2rX3HOk=tTQhazjvL-Or0GshN_-CsgxhgC2tstNxczAQ@mail.gmail.com>
On 01/18/2017 04:46 PM, Ricardo Ribalda Delgado wrote:
> Hi Cyrille
>
> I have found a bug on the way the address is generated in special
> mode. Do you prefer a v9 of this patch or a patch?
Subsequent patch, since this one is already applied.
Also please do not top-post.
Thanks
> Regards!
>
> On Tue, Dec 13, 2016 at 5:30 PM, Cyrille Pitchen
> <cyrille.pitchen@wedev4u.fr> wrote:
>> Le 13/12/2016 à 08:53, Marek Vasut a écrit :
>>> On 12/02/2016 12:31 PM, Ricardo Ribalda Delgado wrote:
>>>> Xilinx Spartan-3AN FPGAs contain an In-System Flash where they keep
>>>> their configuration data and (optionally) some user data.
>>>>
>>>> The protocol of this flash follows most of the spi-nor standard. With
>>>> the following differences:
>>>>
>>>> - Page size might not be a power of two.
>>>> - The address calculation (default addressing mode).
>>>> - The spi nor commands used.
>>>>
>>>> Protocol is described on Xilinx User Guide UG333
>>>>
>>>> Reviewed-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
>>>> Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
>>>> Cc: Boris Brezillon <boris.brezillon@free-electrons.com>
>>>> Cc: Brian Norris <computersforpeace@gmail.com>
>>>> Cc: Marek Vasut <marek.vasut@gmail.com>
>>>
>>> [...]
>>>
>>>> +static int s3an_nor_scan(const struct flash_info *info, struct spi_nor *nor)
>>>> +{
>>>> + int ret;
>>>> + u8 val;
>>>> +
>>>> + ret = nor->read_reg(nor, SPINOR_OP_XRDSR, &val, 1);
>>>> + if (ret < 0) {
>>>> + dev_err(nor->dev, "error %d reading XRDSR\n", (int) ret);
>>>> + return ret;
>>>> + }
>>>> +
>>>> + nor->erase_opcode = SPINOR_OP_XSE;
>>>> + nor->program_opcode = SPINOR_OP_XPP;
>>>> + nor->read_opcode = SPINOR_OP_READ;
>>>> + nor->flags |= SNOR_F_NO_OP_CHIP_ERASE ;
>>>
>>> NIT: You have an extra space before ; ^
>>>
>>>> +
>>>> + /*
>>>> + * This flashes have a page size of 264 or 528 bytes (known as
>>>> + * Default addressing mode). It can be changed to a more standard
>>>> + * Power of two mode where the page size is 256/512. This comes
>>>> + * with a price: there is 3% less of space, the data is corrupted
>>>> + * and the page size cannot be changed back to default addressing
>>>> + * mode.
>>>> + *
>>>> + * The current addressing mode can be read from the XRDSR register
>>>> + * and should not be changed, because is a destructive operation.
>>>> + */
>>>> + if (val & XSR_PAGESIZE) {
>>>> + /* Flash in Power of 2 mode */
>>>> + nor->page_size = (nor->page_size == 264) ? 256 : 512;
>>>> + nor->mtd.writebufsize = nor->page_size;
>>>> + nor->mtd.size = 8 * nor->page_size * info->n_sectors;
>>>> + nor->mtd.erasesize = 8 * nor->page_size;
>>>> + } else {
>>>> + /* Flash in Default addressing mode */
>>>> + nor->flags |= SNOR_F_S3AN_ADDR_DEFAULT;
>>>> + }
>>>> +
>>>> + return 0;
>>>> +}
>>>
>>> Looks great otherwise:
>>> Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
>>>
>> Applied to git://github.com/spi-nor/linux.git
>>
>> I've removed the additional SPACE before ';' as reported by Marek.
>>
>> Thanks!
>
>
>
--
Best regards,
Marek Vasut
prev parent reply other threads:[~2017-01-18 16:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-02 11:31 [PATCH v9] mtd: spi-nor: Add support for S3AN spi-nor devices Ricardo Ribalda Delgado
2016-12-12 16:20 ` Ricardo Ribalda Delgado
2016-12-13 7:53 ` Marek Vasut
2016-12-13 7:53 ` Marek Vasut
2016-12-13 16:30 ` Cyrille Pitchen
2017-01-18 15:46 ` Ricardo Ribalda Delgado
2017-01-18 15:56 ` Marek Vasut [this message]
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=e105a8f5-b02e-c266-1ffe-279ea1da03cb@gmail.com \
--to=marek.vasut@gmail.com \
--cc=boris.brezillon@free-electrons.com \
--cc=computersforpeace@gmail.com \
--cc=cyrille.pitchen@atmel.com \
--cc=cyrille.pitchen@wedev4u.fr \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=ricardo.ribalda@gmail.com \
--cc=richard@nod.at \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).