[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ca36c177-0e7c-647d-f821-ab4bb7d85b10@gmail.com>
Date: Wed, 11 Oct 2017 23:06:02 +0200
From: Marek Vasut <marek.vasut@...il.com>
To: matthew.gerlach@...ux.intel.com
Cc: vndao@...era.com, dwmw2@...radead.org, computersforpeace@...il.com,
boris.brezillon@...e-electrons.com, richard@....at,
cyrille.pitchen@...ev4u.fr, robh+dt@...nel.org,
mark.rutland@....com, linux-mtd@...ts.infradead.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
gregkh@...uxfoundation.org, davem@...emloft.net,
mchehab@...nel.org, linux-fpga@...r.kernel.org,
tien.hock.loh@...el.com, hean.loong.ong@...el.com
Subject: Re: [PATCH v2 2/3] mtd: spi-nor: Altera ASMI Parallel II IP Core
On 10/11/2017 07:00 PM, matthew.gerlach@...ux.intel.com wrote:
>
>
> On Tue, 10 Oct 2017, Marek Vasut wrote:
>
>> On 09/20/2017 08:28 PM, matthew.gerlach@...ux.intel.com wrote:
>>> From: Matthew Gerlach <matthew.gerlach@...ux.intel.com>
>>>
>>> This patch adds support for a spi-nor, platform driver for the
>>> Altera ASMI Parallel II IP Core. The intended use case is to be able
>>> to update the flash used to load a FPGA at power up with mtd-utils.
>>>
>>> Signed-off-by: Matthew Gerlach <matthew.gerlach@...ux.intel.com>
>>> ---
>>> v2:
>>> minor checkpatch fixing by Wu Hao <hao.wu@...el.com>
>>> Use read_dummy value as suggested by Cyrille Pitchen.
>>> Don't assume 4 byte addressing (Cryille Pichecn and Marek Vasut).
>>> Fixed #define indenting as suggested by Marek Vasut.
>>> Added units to timer values as suggested by Marek Vasut.
>>> Use io(read|write)8_rep() as suggested by Marek Vasut.
>>> Renamed function prefixed with __ as suggested by Marek Vasut.
>>
>> [...]
>>
>>> +#define QSPI_ACTION_REG 0
>>> +#define QSPI_ACTION_RST BIT(0)
>>> +#define QSPI_ACTION_EN BIT(1)
>>> +#define QSPI_ACTION_SC BIT(2)
>>> +#define QSPI_ACTION_CHIP_SEL_SFT 4
>>> +#define QSPI_ACTION_DUMMY_SFT 8
>>> +#define QSPI_ACTION_READ_BACK_SFT 16
>>> +
>>> +#define QSPI_FIFO_CNT_REG 4
>>> +#define QSPI_FIFO_DEPTH 0x200
>>> +#define QSPI_FIFO_CNT_MSK 0x3ff
>>> +#define QSPI_FIFO_CNT_RX_SFT 0
>>> +#define QSPI_FIFO_CNT_TX_SFT 12
>>> +
>>> +#define QSPI_DATA_REG 0x8
>>> +
>>> +#define QSPI_POLL_TIMEOUT_US 10000000
>>
>> 10 s poll timeout ? :)
>
> Hi Marek,
>
> The 10s timeout is fairly arbitrary. In other words, I pulled it out of
> thin air. Can you suggest a better timeout? From a practical
> standpoint 10s seemed to be much better than no timeout when I was
> debugging bad FPGA images. Without a timeout I was hanging the system
> when the FPGA image failed. With this timeout, we get a nice message
> and Linux keeps running happily.
AFAIK the SPI subsystem has a timeout which is adaptive to the bus
clock, maybe that's what you want to use here ?
--
Best regards,
Marek Vasut
Powered by blists - more mailing lists