mirror of
https://github.com/torvalds/linux.git
synced 2026-05-23 14:42:08 +02:00
SPI NOR changes for 6.14
Notable changes: - Add flash entries for Atmel AT25SF321, Spansion S28HL256T, S28HL02GT. - Add support for vcc-supply regulators and their DT bindings. - Drop mx25u25635f entry. The flash shares its ID with mx25u25645g and both parts have an SFDP table. Removing their entry lets them be driven by the generic SFDP-based driver. -----BEGIN PGP SIGNATURE----- iIoEABYIADIWIQQTlUWNzXGEo3bFmyIR4drqP028CQUCZ4VXbBQccHJhdHl1c2hA a2VybmVsLm9yZwAKCRAR4drqP028Cb9+AQDDUObpSbXfSXCkk5pgGjPOocrKLjLc gH8+426T1qO4/gEA0tgKfCSxqX6kL7gRGdyxbWRmilfqLDsi5jnn1z3Xtgc= =ibVz -----END PGP SIGNATURE----- Merge tag 'spi-nor/for-6.14' into mtd/next SPI NOR changes for 6.14 Notable changes: - Add flash entries for Atmel AT25SF321, Spansion S28HL256T, S28HL02GT. - Add support for vcc-supply regulators and their DT bindings. - Drop mx25u25635f entry. The flash shares its ID with mx25u25645g and both parts have an SFDP table. Removing their entry lets them be driven by the generic SFDP-based driver.
This commit is contained in:
commit
b44574c7da
|
|
@ -96,6 +96,10 @@ properties:
|
|||
If "broken-flash-reset" is present then having this property does not
|
||||
make any difference.
|
||||
|
||||
vcc-supply:
|
||||
description:
|
||||
Supply for the SPI NOR power.
|
||||
|
||||
spi-cpol: true
|
||||
spi-cpha: true
|
||||
|
||||
|
|
|
|||
|
|
@ -238,6 +238,10 @@ static const struct flash_info atmel_nor_parts[] = {
|
|||
.flags = SPI_NOR_HAS_LOCK,
|
||||
.no_sfdp_flags = SECT_4K,
|
||||
.fixups = &at25fs_nor_fixups
|
||||
}, {
|
||||
.id = SNOR_ID(0x1f, 0x87, 0x01),
|
||||
.size = SZ_4M,
|
||||
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
#include <linux/mtd/spi-nor.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/of_platform.h>
|
||||
#include <linux/regulator/consumer.h>
|
||||
#include <linux/sched/task_stack.h>
|
||||
#include <linux/sizes.h>
|
||||
#include <linux/slab.h>
|
||||
|
|
@ -3576,7 +3577,8 @@ static int spi_nor_create_write_dirmap(struct spi_nor *nor)
|
|||
static int spi_nor_probe(struct spi_mem *spimem)
|
||||
{
|
||||
struct spi_device *spi = spimem->spi;
|
||||
struct flash_platform_data *data = dev_get_platdata(&spi->dev);
|
||||
struct device *dev = &spi->dev;
|
||||
struct flash_platform_data *data = dev_get_platdata(dev);
|
||||
struct spi_nor *nor;
|
||||
/*
|
||||
* Enable all caps by default. The core will mask them after
|
||||
|
|
@ -3586,13 +3588,17 @@ static int spi_nor_probe(struct spi_mem *spimem)
|
|||
char *flash_name;
|
||||
int ret;
|
||||
|
||||
nor = devm_kzalloc(&spi->dev, sizeof(*nor), GFP_KERNEL);
|
||||
ret = devm_regulator_get_enable(dev, "vcc");
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
nor = devm_kzalloc(dev, sizeof(*nor), GFP_KERNEL);
|
||||
if (!nor)
|
||||
return -ENOMEM;
|
||||
|
||||
nor->spimem = spimem;
|
||||
nor->dev = &spi->dev;
|
||||
spi_nor_set_flash_node(nor, spi->dev.of_node);
|
||||
nor->dev = dev;
|
||||
spi_nor_set_flash_node(nor, dev->of_node);
|
||||
|
||||
spi_mem_set_drvdata(spimem, nor);
|
||||
|
||||
|
|
@ -3628,9 +3634,8 @@ static int spi_nor_probe(struct spi_mem *spimem)
|
|||
*/
|
||||
if (nor->params->page_size > PAGE_SIZE) {
|
||||
nor->bouncebuf_size = nor->params->page_size;
|
||||
devm_kfree(nor->dev, nor->bouncebuf);
|
||||
nor->bouncebuf = devm_kmalloc(nor->dev,
|
||||
nor->bouncebuf_size,
|
||||
devm_kfree(dev, nor->bouncebuf);
|
||||
nor->bouncebuf = devm_kmalloc(dev, nor->bouncebuf_size,
|
||||
GFP_KERNEL);
|
||||
if (!nor->bouncebuf)
|
||||
return -ENOMEM;
|
||||
|
|
|
|||
|
|
@ -448,7 +448,11 @@ struct spi_nor_id {
|
|||
* @id: pointer to struct spi_nor_id or NULL, which means "no ID" (mostly
|
||||
* older chips).
|
||||
* @name: (obsolete) the name of the flash. Do not set it for new additions.
|
||||
* @size: the size of the flash in bytes.
|
||||
* @size: the size of the flash in bytes. The flash size is one
|
||||
* property parsed by the SFDP. We use it as an indicator
|
||||
* whether we need SFDP parsing for a particular flash.
|
||||
* I.e. non-legacy flash entries in flash_info will have
|
||||
* a size of zero iff SFDP should be used.
|
||||
* @sector_size: (optional) the size listed here is what works with
|
||||
* SPINOR_OP_SE, which isn't necessarily called a "sector" by
|
||||
* the vendor. Defaults to 64k.
|
||||
|
|
|
|||
|
|
@ -142,12 +142,6 @@ static const struct flash_info macronix_nor_parts[] = {
|
|||
.name = "mx25u12835f",
|
||||
.size = SZ_16M,
|
||||
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
|
||||
}, {
|
||||
.id = SNOR_ID(0xc2, 0x25, 0x39),
|
||||
.name = "mx25u25635f",
|
||||
.size = SZ_32M,
|
||||
.no_sfdp_flags = SECT_4K,
|
||||
.fixup_flags = SPI_NOR_4B_OPCODES,
|
||||
}, {
|
||||
.id = SNOR_ID(0xc2, 0x25, 0x3a),
|
||||
.name = "mx25u51245g",
|
||||
|
|
@ -230,7 +224,8 @@ static int macronix_nor_octal_dtr_en(struct spi_nor *nor)
|
|||
return ret;
|
||||
|
||||
/* Read flash ID to make sure the switch was successful. */
|
||||
ret = spi_nor_read_id(nor, 4, 4, buf, SNOR_PROTO_8_8_8_DTR);
|
||||
ret = spi_nor_read_id(nor, nor->addr_nbytes, 4, buf,
|
||||
SNOR_PROTO_8_8_8_DTR);
|
||||
if (ret) {
|
||||
dev_dbg(nor->dev, "error %d reading JEDEC ID after enabling 8D-8D-8D mode\n", ret);
|
||||
return ret;
|
||||
|
|
|
|||
|
|
@ -957,6 +957,11 @@ static const struct flash_info spansion_nor_parts[] = {
|
|||
.name = "s25hs02gt",
|
||||
.mfr_flags = USE_CLPEF,
|
||||
.fixups = &s25hx_t_fixups
|
||||
}, {
|
||||
/* S28HL256T */
|
||||
.id = SNOR_ID(0x34, 0x5a, 0x19),
|
||||
.mfr_flags = USE_CLPEF,
|
||||
.fixups = &s28hx_t_fixups,
|
||||
}, {
|
||||
.id = SNOR_ID(0x34, 0x5a, 0x1a),
|
||||
.name = "s28hl512t",
|
||||
|
|
@ -967,6 +972,11 @@ static const struct flash_info spansion_nor_parts[] = {
|
|||
.name = "s28hl01gt",
|
||||
.mfr_flags = USE_CLPEF,
|
||||
.fixups = &s28hx_t_fixups,
|
||||
}, {
|
||||
/* S28HL02GT */
|
||||
.id = SNOR_ID(0x34, 0x5a, 0x1c),
|
||||
.mfr_flags = USE_CLPEF,
|
||||
.fixups = &s28hx_t_fixups,
|
||||
}, {
|
||||
.id = SNOR_ID(0x34, 0x5b, 0x19),
|
||||
.mfr_flags = USE_CLPEF,
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ static struct attribute *spi_nor_sysfs_entries[] = {
|
|||
};
|
||||
|
||||
static ssize_t sfdp_read(struct file *filp, struct kobject *kobj,
|
||||
struct bin_attribute *bin_attr, char *buf,
|
||||
const struct bin_attribute *bin_attr, char *buf,
|
||||
loff_t off, size_t count)
|
||||
{
|
||||
struct spi_device *spi = to_spi_device(kobj_to_dev(kobj));
|
||||
|
|
@ -62,9 +62,9 @@ static ssize_t sfdp_read(struct file *filp, struct kobject *kobj,
|
|||
return memory_read_from_buffer(buf, count, &off, nor->sfdp->dwords,
|
||||
sfdp_size);
|
||||
}
|
||||
static BIN_ATTR_RO(sfdp, 0);
|
||||
static const BIN_ATTR_RO(sfdp, 0);
|
||||
|
||||
static struct bin_attribute *spi_nor_sysfs_bin_entries[] = {
|
||||
static const struct bin_attribute *const spi_nor_sysfs_bin_entries[] = {
|
||||
&bin_attr_sfdp,
|
||||
NULL
|
||||
};
|
||||
|
|
@ -104,7 +104,7 @@ static const struct attribute_group spi_nor_sysfs_group = {
|
|||
.is_visible = spi_nor_sysfs_is_visible,
|
||||
.is_bin_visible = spi_nor_sysfs_is_bin_visible,
|
||||
.attrs = spi_nor_sysfs_entries,
|
||||
.bin_attrs = spi_nor_sysfs_bin_entries,
|
||||
.bin_attrs_new = spi_nor_sysfs_bin_entries,
|
||||
};
|
||||
|
||||
const struct attribute_group *spi_nor_sysfs_groups[] = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user