| /linux-6.15/drivers/mtd/spi-nor/ |
| H A D | core.c | 188 return nor->controller_ops->erase(nor, offs); in spi_nor_controller_ops_erase() 621 ret = spi_nor_read_sr(nor, nor->bouncebuf); in spi_nor_sr_ready() 697 ret = nor->params->ready(nor); in spi_nor_ready() 1187 ret = nor->controller_ops->prepare(nor); in spi_nor_prep() 1195 nor->controller_ops->unprepare(nor); in spi_nor_unprep() 1472 nor->bouncebuf, nor->addr_nbytes); in spi_nor_erase_sector() 2650 nor->info->fixups->default_init(nor); in spi_nor_manufacturer_init_params() 2970 nor->params = devm_kzalloc(nor->dev, sizeof(*nor->params), GFP_KERNEL); in spi_nor_init_params() 3045 return nor->params->quad_enable(nor); in spi_nor_quad_enable() 3516 nor->dirmap.rdesc = devm_spi_mem_dirmap_create(nor->dev, nor->spimem, in spi_nor_create_read_dirmap() [all …]
|
| H A D | otp.c | 15 #define spi_nor_otp_region_len(nor) ((nor)->params->otp.org->len) argument 16 #define spi_nor_otp_n_regions(nor) ((nor)->params->otp.org->n_regions) argument 48 rdesc = nor->dirmap.rdesc; in spi_nor_otp_read_secr() 51 nor->read_dummy = 8; in spi_nor_otp_read_secr() 53 nor->dirmap.rdesc = NULL; in spi_nor_otp_read_secr() 61 nor->dirmap.rdesc = rdesc; in spi_nor_otp_read_secr() 95 wdesc = nor->dirmap.wdesc; in spi_nor_otp_write_secr() 99 nor->dirmap.wdesc = NULL; in spi_nor_otp_write_secr() 178 u8 *cr = nor->bouncebuf; in spi_nor_otp_lock_sr2() 210 u8 *cr = nor->bouncebuf; in spi_nor_otp_is_locked_sr2() [all …]
|
| H A D | spansion.c | 88 spi_nor_spimem_setup_op(nor, &op, nor->reg_proto); in spansion_nor_clear_sr() 114 ret = spi_nor_read_any_reg(nor, &op, nor->reg_proto); in cypress_nor_sr_ready_and_clear_reg() 172 ret = spi_nor_read_any_reg(nor, &op, nor->reg_proto); in cypress_nor_set_memlat() 226 ret = spi_nor_read_id(nor, nor->addr_nbytes, 3, buf, in cypress_nor_octal_dtr_en() 294 ret = spi_nor_read_any_reg(nor, &op, nor->reg_proto); in cypress_nor_quad_enable_volatile_reg() 316 ret = spi_nor_read_any_reg(nor, &op, nor->reg_proto); in cypress_nor_quad_enable_volatile_reg() 381 ret = spi_nor_read_sr(nor, &nor->bouncebuf[1]); in cypress_nor_determine_addr_mode_by_sr1() 389 is3byte = (nor->bouncebuf[0] == nor->bouncebuf[1]); in cypress_nor_determine_addr_mode_by_sr1() 398 is4byte = (nor->bouncebuf[0] == nor->bouncebuf[1]); in cypress_nor_determine_addr_mode_by_sr1() 1033 ret = spi_nor_read_sr(nor, nor->bouncebuf); in spansion_nor_sr_ready_and_clear() [all …]
|
| H A D | swp.c | 21 if (nor->flags & SNOR_F_HAS_4BIT_BP) in spi_nor_get_sr_bp_mask() 59 struct mtd_info *mtd = &nor->mtd; in spi_nor_get_locked_range_sr() 171 ret = spi_nor_read_sr(nor, nor->bouncebuf); in spi_nor_sr_lock() 175 status_old = nor->bouncebuf[0]; in spi_nor_sr_lock() 261 ret = spi_nor_read_sr(nor, nor->bouncebuf); in spi_nor_sr_unlock() 338 ret = spi_nor_read_sr(nor, nor->bouncebuf); in spi_nor_sr_is_locked() 342 return spi_nor_is_locked_sr(nor, ofs, len, nor->bouncebuf[0]); in spi_nor_sr_is_locked() 365 ret = nor->params->locking_ops->lock(nor, ofs, len); in spi_nor_lock() 380 ret = nor->params->locking_ops->unlock(nor, ofs, len); in spi_nor_unlock() 395 ret = nor->params->locking_ops->is_locked(nor, ofs, len); in spi_nor_is_locked() [all …]
|
| H A D | micron-st.c | 54 u8 *buf = nor->bouncebuf; in micron_st_nor_octal_dtr_en() 63 ret = spi_nor_write_any_volatile_reg(nor, &op, nor->reg_proto); in micron_st_nor_octal_dtr_en() 71 ret = spi_nor_write_any_volatile_reg(nor, &op, nor->reg_proto); in micron_st_nor_octal_dtr_en() 82 if (memcmp(buf, nor->info->id->bytes, nor->info->id->len)) in micron_st_nor_octal_dtr_en() 118 if (memcmp(buf, nor->info->id->bytes, nor->info->id->len)) in micron_st_nor_octal_dtr_dis() 515 if (nor->spimem) { in micron_st_nor_read_fsr() 528 spi_nor_spimem_setup_op(nor, &op, nor->reg_proto); in micron_st_nor_read_fsr() 550 if (nor->spimem) { in micron_st_nor_clear_fsr() 553 spi_nor_spimem_setup_op(nor, &op, nor->reg_proto); in micron_st_nor_clear_fsr() 581 ret = micron_st_nor_read_fsr(nor, nor->bouncebuf); in micron_st_nor_ready() [all …]
|
| H A D | core.h | 320 int (*erase)(struct spi_nor *nor, loff_t addr); 398 int (*quad_enable)(struct spi_nor *nor); 400 int (*ready)(struct spi_nor *nor); 425 void (*default_init)(struct spi_nor *nor); 426 int (*post_bfpt)(struct spi_nor *nor, 429 int (*post_sfdp)(struct spi_nor *nor); 430 int (*late_init)(struct spi_nor *nor); 607 int spi_nor_write_enable(struct spi_nor *nor); 624 int spi_nor_sr_ready(struct spi_nor *nor); 679 int spi_nor_parse_sfdp(struct spi_nor *nor); [all …]
|
| H A D | atmel.c | 29 if (ofs || len != nor->params->size) in at25fs_nor_unlock() 33 ret = spi_nor_write_sr_and_check(nor, 0); in at25fs_nor_unlock() 51 static int at25fs_nor_late_init(struct spi_nor *nor) in at25fs_nor_late_init() argument 78 if (ofs || len != nor->params->size) in atmel_nor_set_global_protection() 81 ret = spi_nor_read_sr(nor, nor->bouncebuf); in atmel_nor_set_global_protection() 85 sr = nor->bouncebuf[0]; in atmel_nor_set_global_protection() 90 ret = spi_nor_write_sr_and_check(nor, sr); in atmel_nor_set_global_protection() 111 nor->bouncebuf[0] = sr; in atmel_nor_set_global_protection() 118 return spi_nor_write_sr(nor, nor->bouncebuf, 1); in atmel_nor_set_global_protection() 136 if (ofs >= nor->params->size || (ofs + len) > nor->params->size) in atmel_nor_is_global_protected() [all …]
|
| H A D | winbond.c | 39 nor->params->size == SZ_2M && in w25q128_post_bfpt_fixups() 41 nor->params->size = SZ_16M; in w25q128_post_bfpt_fixups() 93 nor->bouncebuf[0] = die; in winbond_nor_select_die() 95 if (nor->spimem) { in winbond_nor_select_die() 98 spi_nor_spimem_setup_op(nor, &op, nor->reg_proto); in winbond_nor_select_die() 104 nor->bouncebuf, 1); in winbond_nor_select_die() 122 ret = spi_nor_sr_ready(nor); in winbond_nor_multi_die_ready() 139 nor->params->n_dice = nor->params->size / SZ_64M; in winbond_nor_multi_die_post_sfdp_fixups() 360 nor->bouncebuf[0] = ear; in winbond_nor_write_ear() 362 if (nor->spimem) { in winbond_nor_write_ear() [all …]
|
| H A D | sst.c | 29 ret = spi_nor_read_cr(nor, nor->bouncebuf); in sst26vf_nor_unlock() 176 nor->program_opcode = op; in sst_nor_write_data() 194 ret = spi_nor_prep_and_lock(nor); in sst_nor_write() 198 ret = spi_nor_write_enable(nor); in sst_nor_write() 202 nor->sst_write_second = false; in sst_nor_write() 223 nor->sst_write_second = true; in sst_nor_write() 225 nor->sst_write_second = false; in sst_nor_write() 227 ret = spi_nor_write_disable(nor); in sst_nor_write() 237 ret = spi_nor_write_enable(nor); in sst_nor_write() 251 spi_nor_unlock_and_unprep(nor); in sst_nor_write() [all …]
|
| H A D | sfdp.c | 193 nor->addr_nbytes = 3; in spi_nor_read_sfdp() 194 nor->read_dummy = 8; in spi_nor_read_sfdp() 715 return nor->read_dummy; in spi_nor_smpt_read_dummy() 754 nor->addr_nbytes = spi_nor_smpt_addr_nbytes(nor, smpt[i]); in spi_nor_get_map_in_use() 755 nor->read_dummy = spi_nor_smpt_read_dummy(nor, smpt[i]); in spi_nor_get_map_in_use() 1215 dev_dbg(nor->dev, in spi_nor_parse_profile1() 1360 if (nor->manufacturer && nor->manufacturer->fixups && in spi_nor_post_sfdp_fixups() 1362 ret = nor->manufacturer->fixups->post_sfdp(nor); in spi_nor_post_sfdp_fixups() 1367 if (nor->info->fixups && nor->info->fixups->post_sfdp) in spi_nor_post_sfdp_fixups() 1368 return nor->info->fixups->post_sfdp(nor); in spi_nor_post_sfdp_fixups() [all …]
|
| H A D | Makefile | 4 spi-nor-objs += atmel.o 5 spi-nor-objs += eon.o 6 spi-nor-objs += esmt.o 7 spi-nor-objs += everspin.o 9 spi-nor-objs += intel.o 10 spi-nor-objs += issi.o 11 spi-nor-objs += macronix.o 13 spi-nor-objs += spansion.o 14 spi-nor-objs += sst.o 15 spi-nor-objs += winbond.o [all …]
|
| H A D | macronix.c | 29 mx25l25635_post_bfpt_fixups(struct spi_nor *nor, in mx25l25635_post_bfpt_fixups() argument 43 nor->flags |= SNOR_F_4B_OPCODES; in mx25l25635_post_bfpt_fixups() 240 u8 *buf = nor->bouncebuf, i; in macronix_nor_octal_dtr_en() 246 ret = spi_nor_write_any_volatile_reg(nor, &op, nor->reg_proto); in macronix_nor_octal_dtr_en() 253 ret = spi_nor_write_any_volatile_reg(nor, &op, nor->reg_proto); in macronix_nor_octal_dtr_en() 258 ret = spi_nor_read_id(nor, nor->addr_nbytes, 4, buf, in macronix_nor_octal_dtr_en() 266 for (i = 0; i < nor->info->id->len; i++) in macronix_nor_octal_dtr_en() 276 u8 *buf = nor->bouncebuf; in macronix_nor_octal_dtr_dis() 299 if (memcmp(buf, nor->info->id->bytes, nor->info->id->len)) in macronix_nor_octal_dtr_dis() 307 return enable ? macronix_nor_octal_dtr_en(nor) : macronix_nor_octal_dtr_dis(nor); in macronix_nor_set_octal_dtr() [all …]
|
| H A D | sysfs.c | 15 struct spi_nor *nor = spi_mem_get_drvdata(spimem); in manufacturer_show() local 26 struct spi_nor *nor = spi_mem_get_drvdata(spimem); in partname_show() local 28 return sysfs_emit(buf, "%s\n", nor->info->name); in partname_show() 37 struct spi_nor *nor = spi_mem_get_drvdata(spimem); in jedec_id_show() local 38 const u8 *id = nor->info->id ? nor->info->id->bytes : nor->id; in jedec_id_show() 39 u8 id_len = nor->info->id ? nor->info->id->len : SPI_NOR_MAX_ID_LEN; in jedec_id_show() 58 struct spi_nor *nor = spi_mem_get_drvdata(spimem); in sfdp_read() local 59 struct sfdp *sfdp = nor->sfdp; in sfdp_read() 77 struct spi_nor *nor = spi_mem_get_drvdata(spimem); in spi_nor_sysfs_is_visible() local 83 if (attr == &dev_attr_jedec_id.attr && !nor->info->id && !nor->id) in spi_nor_sysfs_is_visible() [all …]
|
| H A D | debugfs.c | 78 struct spi_nor *nor = s->private; in spi_nor_params_show() local 82 const struct flash_info *info = nor->info; in spi_nor_params_show() 104 switch (nor->cmd_ext_type) { in spi_nor_params_show() 122 spi_nor_protocol_name(nor->read_proto)); in spi_nor_params_show() 126 spi_nor_protocol_name(nor->reg_proto)); in spi_nor_params_show() 184 struct spi_nor *nor = s->private; in spi_nor_capabilities_show() local 224 struct spi_nor *nor = data; in spi_nor_debugfs_unregister() local 226 debugfs_remove(nor->debugfs_root); in spi_nor_debugfs_unregister() 227 nor->debugfs_root = NULL; in spi_nor_debugfs_unregister() 240 ret = devm_add_action(nor->dev, spi_nor_debugfs_unregister, nor); in spi_nor_debugfs_register() [all …]
|
| H A D | issi.c | 12 is25lp256_post_bfpt_fixups(struct spi_nor *nor, in is25lp256_post_bfpt_fixups() argument 23 nor->params->addr_nbytes = 4; in is25lp256_post_bfpt_fixups() 32 static int pm25lv_nor_late_init(struct spi_nor *nor) in pm25lv_nor_late_init() argument 34 struct spi_nor_erase_map *map = &nor->params->erase_map; in pm25lv_nor_late_init() 132 static void issi_nor_default_init(struct spi_nor *nor) in issi_nor_default_init() argument 134 nor->params->quad_enable = spi_nor_sr1_bit6_quad_enable; in issi_nor_default_init()
|
| /linux-6.15/drivers/mtd/spi-nor/controllers/ |
| H A D | hisi-sfc.c | 149 struct hifmc_priv *priv = nor->priv; in hisi_spi_nor_prep() 172 struct hifmc_priv *priv = nor->priv; in hisi_spi_nor_unprep() 182 struct hifmc_priv *priv = nor->priv; in hisi_spi_nor_op_reg() 337 struct spi_nor *nor; in hisi_spi_nor_register() local 342 nor = devm_kzalloc(dev, sizeof(*nor), GFP_KERNEL); in hisi_spi_nor_register() 343 if (!nor) in hisi_spi_nor_register() 346 nor->dev = dev; in hisi_spi_nor_register() 347 spi_nor_set_flash_node(nor, np); in hisi_spi_nor_register() 368 nor->priv = priv; in hisi_spi_nor_register() 375 mtd = &nor->mtd; in hisi_spi_nor_register() [all …]
|
| H A D | nxp-spifi.c | 58 struct spi_nor nor; member 128 struct nxp_spifi *spifi = nor->priv; in nxp_spifi_read_reg() 151 struct nxp_spifi *spifi = nor->priv; in nxp_spifi_write_reg() 175 struct nxp_spifi *spifi = nor->priv; in nxp_spifi_read() 190 struct nxp_spifi *spifi = nor->priv; in nxp_spifi_write() 220 struct nxp_spifi *spifi = nor->priv; in nxp_spifi_erase() 240 switch (spifi->nor.read_proto) { in nxp_spifi_setup_memory_cmd() 254 if (spifi->nor.addr_nbytes < 1 || spifi->nor.addr_nbytes > 4) in nxp_spifi_setup_memory_cmd() 267 nor->controller_ops->read_reg(nor, SPINOR_OP_RDID, id, in nxp_spifi_dummy_id_read() 342 spifi->nor.dev = spifi->dev; in nxp_spifi_setup_flash() [all …]
|
| /linux-6.15/Documentation/devicetree/bindings/spi/ |
| H A D | mediatek,spi-mtk-nor.yaml | 27 - mediatek,mt8173-nor 28 - mediatek,mt8186-nor 29 - mediatek,mt8192-nor 32 - mediatek,mt2701-nor 33 - mediatek,mt2712-nor 34 - mediatek,mt7622-nor 35 - mediatek,mt7623-nor 36 - mediatek,mt7629-nor 37 - mediatek,mt8195-nor 38 - const: mediatek,mt8173-nor [all …]
|
| H A D | cdns,xspi.yaml | 21 - cdns,xspi-nor 22 - marvell,cn10-xspi-nor 55 - marvell,cn10-xspi-nor 81 compatible = "cdns,xspi-nor"; 90 compatible = "jedec,spi-nor"; 96 compatible = "jedec,spi-nor";
|
| H A D | cdns,qspi-nor.yaml | 4 $id: http://devicetree.org/schemas/spi/cdns,qspi-nor.yaml# 79 # The compatible is qspi-nor for historical reasons but such 82 - const: cdns,qspi-nor 83 - const: cdns,qspi-nor 152 $ref: cdns,qspi-nor-peripheral-props.yaml 176 compatible = "intel,socfpga-qspi", "cdns,qspi-nor"; 190 compatible = "jedec,spi-nor";
|
| /linux-6.15/Documentation/devicetree/bindings/mtd/ |
| H A D | hisilicon,fmc-spi-nor.txt | 4 - compatible : Should be "hisilicon,fmc-spi-nor" and one of the following strings: 5 "hisilicon,hi3519-spi-nor" 10 - clocks : handle to spi-nor flash controller clock. 13 spi-nor-controller@10000000 { 14 compatible = "hisilicon,hi3519-spi-nor", "hisilicon,fmc-spi-nor"; 21 compatible = "jedec,spi-nor";
|
| /linux-6.15/include/linux/mtd/ |
| H A D | spi-nor.h | 306 int (*prepare)(struct spi_nor *nor); 307 void (*unprepare)(struct spi_nor *nor); 308 int (*read_reg)(struct spi_nor *nor, u8 opcode, u8 *buf, size_t len); 309 int (*write_reg)(struct spi_nor *nor, u8 opcode, const u8 *buf, 312 ssize_t (*read)(struct spi_nor *nor, loff_t from, size_t len, u8 *buf); 313 ssize_t (*write)(struct spi_nor *nor, loff_t to, size_t len, 315 int (*erase)(struct spi_nor *nor, loff_t offs); 425 static inline void spi_nor_set_flash_node(struct spi_nor *nor, in spi_nor_set_flash_node() argument 428 mtd_set_of_node(&nor->mtd, np); in spi_nor_set_flash_node() 433 return mtd_get_of_node(&nor->mtd); in spi_nor_get_flash_node() [all …]
|
| /linux-6.15/arch/powerpc/boot/dts/fsl/ |
| H A D | mpc8536ds.dtsi | 13 * * Neither the name of Freescale Semiconductor nor the 36 nor@0,0 { 46 label = "ramdisk-nor"; 51 label = "diagnostic-nor"; 57 label = "dink-nor"; 63 label = "kernel-nor"; 68 label = "fs-nor"; 73 label = "dtb-nor"; 78 label = "u-boot-nor"; 145 compatible = "spansion,s25sl12801", "jedec,spi-nor"; [all …]
|
| H A D | p1022ds.dtsi | 13 * * Neither the name of Freescale Semiconductor nor the 36 nor@0,0 { 46 label = "ramdisk-nor"; 52 label = "diagnostic-nor"; 58 label = "dink-nor"; 64 label = "kernel-nor"; 70 label = "jffs2-nor"; 75 label = "dtb-nor"; 81 label = "u-boot-nor"; 163 compatible = "spansion,s25sl12801", "jedec,spi-nor";
|
| /linux-6.15/arch/arm/boot/dts/xilinx/ |
| H A D | zynq-zc770-xm012.dts | 64 label = "nor-fsbl-uboot"; 68 label = "nor-linux"; 72 label = "nor-device-tree"; 76 label = "nor-rootfs"; 80 label = "nor-bitstream";
|