- 07 11月, 2019 9 次提交
-
-
由 Tudor Ambarus 提交于
Drop the default spansion_quad_enable() method and replace it with spansion_read_cr_quad_enable(). The function was buggy, it didn't care about the previous values of the Status and Configuration Registers. spansion_read_cr_quad_enable() is a Read-Modify-Write-Check function that keeps track of what were the previous values of the Status and Configuration Registers. In terms of instruction types sent to the flash, the only difference between the spansion_quad_enable() and spansion_read_cr_quad_enable() is that the later calls spi_nor_read_sr(). We can safely assume that all flashes support spi_nor_read_sr(), because all flashes call it in spi_nor_sr_ready(). The transition from spansion_quad_enable() to spansion_read_cr_quad_enable() will not affect anybody, drop the buggy code. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
-
由 Tudor Ambarus 提交于
Document all the Register Operations. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
-
由 Tudor Ambarus 提交于
Merge static int spi_nor_write_sr(struct spi_nor *nor, u8 val) static int spi_nor_write_sr_cr(struct spi_nor *nor, const u8 *sr_cr) into static int spi_nor_write_sr(struct spi_nor *nor, const u8 *sr, size_t len) The Status Register can be written with one or two bytes. Merge the two functions to avoid code duplication. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com>
-
由 Tudor Ambarus 提交于
Avoid duplicating code by moving the calls to spi_nor_write_enable() and spi_nor_wait_till_ready() inside the Write Status Register methods. Move spi_nor_write_sr() to avoid forward declaration of spi_nor_wait_till_ready(). Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com>
-
由 Tudor Ambarus 提交于
spi_nor_clear_sr() and spi_nor_clear_fsr() are called just in case of errors. The callers didn't check their return value, make them of type void. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com>
-
由 Tudor Ambarus 提交于
Rename 'sst_write_err' label to 'out' as it is no longer generic for all the errors in the sst_write() method, and may introduce confusion. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com>
-
由 Tudor Ambarus 提交于
Check for the return vales of each Register Operation. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
-
由 Tudor Ambarus 提交于
Spare the callers of printing debug messages by themselves. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
-
由 Tudor Ambarus 提交于
What most users care about is "my dev is not working properly". All low level information should be discovered when activating the debug traces. Keep error messages just for the following cases: - when the SR/FSR report program or erase fails, or attempts of modifying a protected sector, - when the JEDEC ID is not recognized, - when the resume() call fails, - when the spi_nor_check() fails. Suggested-by: NBoris Brezillon <boris.brezillon@collabora.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
-
- 02 11月, 2019 3 次提交
-
-
由 Sergei Shtylyov 提交于
spi_nor_read_raw() assigns the result of 'ssize_t spi_nor_read_data()' to the 'int ret' variable, while 'ssize_t' is a 64-bit type and *int* is a 32-bit type on the 64-bit machines. This silent truncation isn't really valid, so fix up the variable's type. Fixes: f384b352 ("mtd: spi-nor: parse Serial Flash Discoverable Parameters (SFDP) tables") Signed-off-by: NSergei Shtylyov <sergei.shtylyov@cogentembedded.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Sergei Shtylyov 提交于
spi_nor_read() assigns the result of 'ssize_t spi_nor_read_data()' to the 'int ret' variable, while 'ssize_t' is a 64-bit type and *int* is a 32-bit type on the 64-bit machines. This silent truncation isn't really valid, so fix up the variable's type. Fixes: 59451e12 ("mtd: spi-nor: change return value of read/write") Signed-off-by: NSergei Shtylyov <sergei.shtylyov@cogentembedded.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Tudor Ambarus 提交于
Print identifying information about struct device. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com>
-
- 01 11月, 2019 12 次提交
-
-
由 Tudor Ambarus 提交于
Constify the data to write to the Status Register. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com>
-
由 Tudor Ambarus 提交于
In case the write of the first byte failed, retlen was incorrectly incremented to *retlen += actual; on the exit path. retlen should be incremented when actual data was written to the flash. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com>
-
由 Tudor Ambarus 提交于
Drop the error messages from the callers, since the callees already print an error message in case of failure. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com>
-
由 Tudor Ambarus 提交于
Let the callers pass the pointer to the DMA-able buffer where the value of the Configuration Register will be written. This way we avoid the casts between int and u8, which can be confusing. Callers stop compare the return value of spi_nor_read_cr() with negative, spi_nor_read_cr() returns 0 on success and -errno otherwise. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com>
-
由 Tudor Ambarus 提交于
Let the callers pass the pointer to the DMA-able buffer where the value of the Flag Status Register will be written. This way we avoid the casts between int and u8, which can be confusing. Caller stops compare the return value of spi_nor_read_fsr() with negative, spi_nor_read_fsr() returns 0 on success and -errno otherwise. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com>
-
由 Tudor Ambarus 提交于
Let the callers pass the pointer to the DMA-able buffer where the value of the Status Register will be written. This way we avoid the casts between int and u8, which can be confusing. Callers stop compare the return value of spi_nor_read_sr() with negative, spi_nor_read_sr() returns 0 on success and -errno otherwise. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com>
-
由 Tudor Ambarus 提交于
Do not overwrite the error numbers received the Register Operations methods. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com>
-
由 Tudor Ambarus 提交于
ret is already of type int. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com>
-
由 Tudor Ambarus 提交于
spi_mem_exec_op() nor->controller_ops->write_reg() nor->controller_ops->read_reg() spi_nor_wait_till_ready() Return 0 on success, -errno otherwise. Stop compare with negative and compare with zero in all the register operations methods. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com>
-
由 Tudor Ambarus 提交于
Group all register methods up in the file, to avoid forward declarations. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com>
-
由 Tudor Ambarus 提交于
Two new lines, one after another, drop one. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com>
-
由 Tudor Ambarus 提交于
All the core functions should begin with "spi_nor_". Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com>
-
- 23 10月, 2019 2 次提交
-
-
由 Tudor Ambarus 提交于
Move all SPI NOR controller driver specific ops in a dedicated structure. 'struct spi_nor' becomes lighter. Use size_t for lengths in 'int (*write_reg)()' and 'int (*read_reg)()'. Rename wite/read_buf to buf, the name of the functions are suggestive enough. Constify buf in int (*write_reg). Comply with these changes in the SPI NOR controller drivers. Suggested-by: NBoris Brezillon <boris.brezillon@collabora.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com>
-
由 DENG Qingfang 提交于
Tested on HiWiFi C526A Datasheet is available at: http://www.xinyahong.com/upLoad/product/month_1411/201411201256018276.pdfSigned-off-by: NDENG Qingfang <dqfext@gmail.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
- 05 10月, 2019 1 次提交
-
-
由 Tudor Ambarus 提交于
write_sr() sends data to the SPI memory, fix the direction. Fixes: b35b9a10 ("mtd: spi-nor: Move m25p80 code in spi-nor.c") Reported-by: NJohn Garry <john.garry@huawei.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Tested-by: NJohn Garry <john.garry@huawei.com> Acked-by: NVignesh Raghavendra <vigneshr@ti.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
- 30 8月, 2019 2 次提交
-
-
由 Ashish Kumar 提交于
n25q512a was rebranded to mt25qu512a after its spin off from STM. mt25qu512a is different only in terms of operating frequency, the JEDEC id is the same as in n25q512a. Dual reads are supported (0x3b, 0x3c), set the SPI_NOR_DUAL_READ flag. 4-byte opcodes are supported, set the SPI_NOR_4B_OPCODES flag. Tested Single I/O and QUAD I/O mode on LS1046FRWY. Signed-off-by: NKuldeep Singh <kuldeep.singh@nxp.com> Signed-off-by: NAshish Kumar <Ashish.Kumar@nxp.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com> [tudor.ambarus@microchip.com: rename entry to "mt25qu512a (n25q512a)", reword commit message, order entry by size, drop comment as it looked redundant] Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Ashish Kumar 提交于
mt35xu02g is an Octal flash supporting Single and OCTAL I/O. Tested on LS1028ARDB. Signed-off-by: NKuldeep Singh <kuldeep.singh@nxp.com> Signed-off-by: NAshish Kumar <ashish.kumar@nxp.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com> [tudor.ambarus@microchip.com: reword commit message] Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
- 29 8月, 2019 2 次提交
-
-
由 Tudor Ambarus 提交于
We already pass a pointer to nor, we can obtain the sector_size by dereferencing it. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
-
由 Zhuohao Lee 提交于
This patch adds spi_nor_debugfs_init() for the debugfs initialization. With this patch, we can read the partname and partid through the debugfs. The output of new debugfs nodes on my device are: cat /sys/kernel/debug/mtd/mtd0/partid spi-nor:ef6017 cat /sys/kernel/debug/mtd/mtd0/partname w25q64dw Signed-off-by: NZhuohao Lee <zhuohao@chromium.org> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
- 28 8月, 2019 9 次提交
-
-
由 Tudor Ambarus 提交于
Dedicate a function for getting the pointer to the flash_info const struct. Trim a bit the spi_nor_scan() huge function. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
-
由 Tudor Ambarus 提交于
Parsing of flash parameters were interleaved with setting of the nor addr width. Dedicate a function for setting nor addr width. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
-
由 Tudor Ambarus 提交于
Bring all flash parameters default initialization in spi_nor_legacy_params_init(). Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
-
由 Boris Brezillon 提交于
S3AN flashes use a specific opcode to read the status register. We currently use the SPI_S3AN flag to decide whether this specific SR read opcode should be used, but SPI_S3AN is about to disappear, so let's add a new flag. Note that we use the same bit as SPI_S3AN implies SPI_NOR_XSR_RDY and vice versa. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
-
由 Tudor Ambarus 提交于
s3an_nor_scan() was overriding the opcode selection done in spi_nor_default_setup(). Set nor->setup() method in order to avoid the unnecessary call to spi_nor_default_setup(). Now that the call to spi_nor_default_setup() is skipped, set mtd.erasesize to nor->info->sector_size, as it was when spi_nor_select_erase() was called. No dummy byte is required for the S3AN's Random Read command (0x03), so no need to set nor->read_dummy. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
-
由 Tudor Ambarus 提交于
nor->params.setup() configures the SPI NOR memory. Useful for SPI NOR flashes that have peculiarities to the SPI NOR standard, e.g. different opcodes, specific address calculation, page size, etc. Right now the only user will be the S3AN chips, but other manufacturers can implement it if needed. Move spi_nor_setup() related code in order to avoid a forward declaration to spi_nor_default_setup(). Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
-
由 Boris Brezillon 提交于
In order to separate manufacturer quirks from the core we need to get rid of all the manufacturer specific flags, like the SNOR_F_S3AN_ADDR_DEFAULT one. This can easily be replaced by a ->convert_addr() hook, which when implemented will provide the core with an easy way to convert an absolute address into something the flash understands. Right now the only user are the S3AN chips, but other manufacturers can implement it if needed. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
-
由 Boris Brezillon 提交于
Add a spansion_post_sfdp_fixups() function to fix the erase opcode, erase sector size and set the SNOR_F_4B_OPCODES flag. This way, all spansion related quirks are placed in the spansion_post_sfdp_fixups() function. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
-
由 Boris Brezillon 提交于
SFDP tables are sometimes wrong and we need a way to override the config chosen by the SFDP parsing logic without discarding all of it. Add a new hook called after the SFDP parsing has taken place to deal with such problems. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
-