JaimeLiao
fc2efaf90a
mtd: spi-nor: sysfs: hide the flash name if not set
...
The flash name is not reliable as we saw flash ID collisions.
Hide the flash name if not set.
Signed-off-by: JaimeLiao <jaimeliao@mxic.com.tw >
Reviewed-by: Michael Walle <michael@walle.cc >
[ta: update commit subject and description and the sysfs description]
Link: https://lore.kernel.org/r/20231215082138.16063-4-tudor.ambarus@linaro.org
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org >
2023-12-19 05:08:23 +02:00
Michael Walle
2d7f3a0887
mtd: spi-nor: move the .id and .id_len into an own structure
...
Create a new structure to hold a flash ID and its length. The goal is to
have a new macro SNOR_ID() which can have a flexible id length. This way
we can get rid of all the individual INFOx() macros.
Signed-off-by: Michael Walle <mwalle@kernel.org >
Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-13-e60548861b10@kernel.org
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org >
2023-09-19 18:57:50 +03:00
Michael Walle
0a92de16b6
mtd: spi-nor: sysfs: print JEDEC ID for generic flash driver
...
We don't have a database entry for the generic SPI-NOR flash driver and
thus we don't have a JEDEC ID to print. Print the (cached) JEDEC ID
instead.
Signed-off-by: Michael Walle <michael@walle.cc >
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com >
Reviewed-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com >
Link: https://lore.kernel.org/r/20220810220654.1297699-8-michael@walle.cc
2022-11-21 15:37:16 +02:00
Michael Walle
0d9270f276
mtd: spi-nor: sysfs: hide manufacturer if it is not set
...
The manufacturer may be optional when pure SFDP flashes are supported.
Hide the sysfs property if no manufacturer is set.
Signed-off-by: Michael Walle <michael@walle.cc >
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com >
Reviewed-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com >
Link: https://lore.kernel.org/r/20220810220654.1297699-3-michael@walle.cc
2022-11-21 15:37:15 +02:00
Michael Walle
7d388551b6
mtd: spi-nor: hide jedec_id sysfs attribute if not present
...
Some non-jedec compliant flashes (like the Everspin flashes) don't have
an ID at all. Hide the attribute in this case.
Fixes: 36ac022862 ("mtd: spi-nor: add initial sysfs support")
Signed-off-by: Michael Walle <michael@walle.cc >
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com >
Reviewed-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com >
Link: https://lore.kernel.org/r/20220810220654.1297699-2-michael@walle.cc
2022-11-21 15:37:15 +02:00
Michael Walle
36ac022862
mtd: spi-nor: add initial sysfs support
...
Add support to show the manufacturer, the partname and JEDEC identifier
as well as to dump the SFDP table. Not all flashes list their SFDP table
contents in their datasheet. So having that is useful. It might also be
helpful in bug reports from users.
Signed-off-by: Michael Walle <michael@walle.cc >
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com >
Acked-by: Pratyush Yadav <p.yadav@ti.com >
2021-06-15 23:18:32 +05:30