/linux/drivers/mtd/spi-nor/ |
A D | core.c | 183 return nor->controller_ops->erase(nor, offs); in spi_nor_controller_ops_erase() 1306 nor->controller_ops->unprepare(nor); in spi_nor_unlock_and_unprep() 1351 nor->bouncebuf, nor->addr_width); in spi_nor_erase_sector() 2508 nor->info->fixups->default_init(nor); in spi_nor_manufacturer_init_params() 2662 nor->info->fixups->post_sfdp(nor); in spi_nor_post_sfdp_fixups() 2721 nor->params = devm_kzalloc(nor->dev, sizeof(*nor->params), GFP_KERNEL); in spi_nor_init_params() 2788 return nor->params->quad_enable(nor); in spi_nor_quad_enable() 3259 nor->dirmap.rdesc = devm_spi_mem_dirmap_create(nor->dev, nor->spimem, in spi_nor_create_read_dirmap() 3288 nor->dirmap.wdesc = devm_spi_mem_dirmap_create(nor->dev, nor->spimem, in spi_nor_create_write_dirmap() 3345 nor->bouncebuf_size = nor->page_size; in spi_nor_probe() [all …]
|
A D | otp.c | 14 #define spi_nor_otp_region_len(nor) ((nor)->params->otp.org->len) argument 15 #define spi_nor_otp_n_regions(nor) ((nor)->params->otp.org->n_regions) argument 47 rdesc = nor->dirmap.rdesc; in spi_nor_otp_read_secr() 50 nor->read_dummy = 8; in spi_nor_otp_read_secr() 52 nor->dirmap.rdesc = NULL; in spi_nor_otp_read_secr() 60 nor->dirmap.rdesc = rdesc; in spi_nor_otp_read_secr() 94 wdesc = nor->dirmap.wdesc; in spi_nor_otp_write_secr() 98 nor->dirmap.wdesc = NULL; in spi_nor_otp_write_secr() 177 u8 *cr = nor->bouncebuf; in spi_nor_otp_lock_sr2() 209 u8 *cr = nor->bouncebuf; in spi_nor_otp_is_locked_sr2() [all …]
|
A D | swp.c | 44 return nor->info->sector_size << in spi_nor_get_min_prot_length_sr() 47 return nor->info->sector_size; in spi_nor_get_min_prot_length_sr() 53 struct mtd_info *mtd = &nor->mtd; in spi_nor_get_locked_range_sr() 166 ret = spi_nor_read_sr(nor, nor->bouncebuf); in spi_nor_sr_lock() 251 ret = spi_nor_read_sr(nor, nor->bouncebuf); in spi_nor_sr_unlock() 328 ret = spi_nor_read_sr(nor, nor->bouncebuf); in spi_nor_sr_is_locked() 332 return spi_nor_is_locked_sr(nor, ofs, len, nor->bouncebuf[0]); in spi_nor_sr_is_locked() 355 ret = nor->params->locking_ops->lock(nor, ofs, len); in spi_nor_lock() 370 ret = nor->params->locking_ops->unlock(nor, ofs, len); in spi_nor_unlock() 385 ret = nor->params->locking_ops->is_locked(nor, ofs, len); in spi_nor_is_locked() [all …]
|
A D | xilinx.c | 33 offset = addr % nor->page_size; in s3an_convert_addr() 34 page = addr / nor->page_size; in s3an_convert_addr() 45 ret = spi_nor_xread_sr(nor, nor->bouncebuf); in xilinx_nor_setup() 49 nor->erase_opcode = SPINOR_OP_XSE; in xilinx_nor_setup() 50 nor->program_opcode = SPINOR_OP_XPP; in xilinx_nor_setup() 51 nor->read_opcode = SPINOR_OP_READ; in xilinx_nor_setup() 67 nor->page_size = (nor->page_size == 264) ? 256 : 512; in xilinx_nor_setup() 68 nor->mtd.writebufsize = nor->page_size; in xilinx_nor_setup() 69 nor->mtd.size = 8 * nor->page_size * nor->info->n_sectors; in xilinx_nor_setup() 70 nor->mtd.erasesize = 8 * nor->page_size; in xilinx_nor_setup() [all …]
|
A D | sst.c | 26 ret = spi_nor_read_cr(nor, nor->bouncebuf); in sst26vf_unlock() 103 ret = spi_nor_lock_and_prep(nor); in sst_write() 107 ret = spi_nor_write_enable(nor); in sst_write() 111 nor->sst_write_second = false; in sst_write() 143 nor->sst_write_second = true; in sst_write() 145 nor->sst_write_second = false; in sst_write() 147 ret = spi_nor_write_disable(nor); in sst_write() 157 ret = spi_nor_write_enable(nor); in sst_write() 176 spi_nor_unlock_and_unprep(nor); in sst_write() 182 if (nor->info->flags & SST_WRITE) in sst_post_sfdp_fixups() [all …]
|
A D | spansion.c | 35 u8 *buf = nor->bouncebuf; in spi_nor_cypress_octal_dtr_enable() 40 ret = spi_nor_write_enable(nor); in spi_nor_cypress_octal_dtr_enable() 60 nor->read_dummy = 24; in spi_nor_cypress_octal_dtr_enable() 64 ret = spi_nor_write_enable(nor); in spi_nor_cypress_octal_dtr_enable() 103 if (memcmp(buf, nor->info->id, nor->info->id_len)) in spi_nor_cypress_octal_dtr_enable() 112 nor->params->writesize = 16; in s28hs512t_default_init() 164 nor->params->page_size = 512; in s28hs512t_post_bfpt_fixup() 166 nor->params->page_size = 256; in s28hs512t_post_bfpt_fixup() 188 nor->params->page_size = 256; in s25fs_s_post_bfpt_fixups() 281 if (nor->params->size <= SZ_16M) in spansion_post_sfdp_fixups() [all …]
|
A D | atmel.c | 29 if (ofs || len != nor->params->size) in atmel_at25fs_unlock() 33 ret = spi_nor_write_sr_and_check(nor, 0); in atmel_at25fs_unlock() 53 nor->params->locking_ops = &atmel_at25fs_locking_ops; in atmel_at25fs_default_init() 76 if (ofs || len != nor->params->size) in atmel_set_global_protection() 79 ret = spi_nor_read_sr(nor, nor->bouncebuf); in atmel_set_global_protection() 83 sr = nor->bouncebuf[0]; in atmel_set_global_protection() 88 ret = spi_nor_write_sr_and_check(nor, sr); in atmel_set_global_protection() 109 nor->bouncebuf[0] = sr; in atmel_set_global_protection() 116 return spi_nor_write_sr(nor, nor->bouncebuf, 1); in atmel_set_global_protection() 133 if (ofs >= nor->params->size || (ofs + len) > nor->params->size) in atmel_is_global_protected() [all …]
|
A D | .built-in.a.cmd | 1 …nor/built-in.a := echo >/dev/null; rm -f drivers/mtd/spi-nor/built-in.a; /usr/bin/ccache /home/tes…
|
A D | core.h | 218 int (*erase)(struct spi_nor *nor, loff_t addr); 282 int (*quad_enable)(struct spi_nor *nor); 306 void (*default_init)(struct spi_nor *nor); 307 int (*post_bfpt)(struct spi_nor *nor, 310 void (*post_sfdp)(struct spi_nor *nor); 498 int spi_nor_write_enable(struct spi_nor *nor); 499 int spi_nor_write_disable(struct spi_nor *nor); 502 int spi_nor_wait_till_ready(struct spi_nor *nor); 504 int spi_nor_lock_and_prep(struct spi_nor *nor); 509 int spi_nor_read_sr(struct spi_nor *nor, u8 *sr); [all …]
|
A D | micron-st.c | 22 u8 *buf = nor->bouncebuf; in spi_nor_micron_octal_dtr_enable() 27 ret = spi_nor_write_enable(nor); in spi_nor_micron_octal_dtr_enable() 42 ret = spi_nor_wait_till_ready(nor); in spi_nor_micron_octal_dtr_enable() 47 ret = spi_nor_write_enable(nor); in spi_nor_micron_octal_dtr_enable() 85 if (memcmp(buf, nor->info->id, nor->info->id_len)) in spi_nor_micron_octal_dtr_enable() 105 nor->params->rdsr_dummy = 8; in mt35xu512aba_post_sfdp_fixup() 106 nor->params->rdsr_addr_nbytes = 0; in mt35xu512aba_post_sfdp_fixup() 113 nor->params->quad_enable = NULL; in mt35xu512aba_post_sfdp_fixup() 241 ret = spi_nor_write_enable(nor); in st_micron_set_4byte_addr_mode() 254 nor->flags |= SNOR_F_HAS_LOCK; in micron_st_default_init() [all …]
|
A D | Makefile | 4 spi-nor-objs += atmel.o 5 spi-nor-objs += catalyst.o 6 spi-nor-objs += eon.o 7 spi-nor-objs += esmt.o 8 spi-nor-objs += everspin.o 9 spi-nor-objs += fujitsu.o 11 spi-nor-objs += intel.o 12 spi-nor-objs += issi.o 16 spi-nor-objs += sst.o 18 spi-nor-objs += xilinx.o [all …]
|
A D | sfdp.c | 189 nor->addr_width = 3; in spi_nor_read_sfdp() 190 nor->read_dummy = 8; in spi_nor_read_sfdp() 465 nor->addr_width = 3; in spi_nor_parse_bfpt() 469 nor->addr_width = 4; in spi_nor_parse_bfpt() 656 return nor->addr_width; in spi_nor_smpt_addr_width() 673 return nor->read_dummy; in spi_nor_smpt_read_dummy() 712 nor->addr_width = spi_nor_smpt_addr_width(nor, smpt[i]); in spi_nor_get_map_in_use() 713 nor->read_dummy = spi_nor_smpt_read_dummy(nor, smpt[i]); in spi_nor_get_map_in_use() 1101 nor->addr_width = 4; in spi_nor_parse_4bait() 1177 dev_dbg(nor->dev, in spi_nor_parse_profile1() [all …]
|
A D | sysfs.c | 15 struct spi_nor *nor = spi_mem_get_drvdata(spimem); in manufacturer_show() local 17 return sysfs_emit(buf, "%s\n", nor->manufacturer->name); in manufacturer_show() 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 39 return sysfs_emit(buf, "%*phN\n", nor->info->id_len, nor->info->id); in jedec_id_show() 56 struct spi_nor *nor = spi_mem_get_drvdata(spimem); in sfdp_read() local 57 struct sfdp *sfdp = nor->sfdp; in sfdp_read() 60 return memory_read_from_buffer(buf, count, &off, nor->sfdp->dwords, in sfdp_read() 75 struct spi_nor *nor = spi_mem_get_drvdata(spimem); in spi_nor_sysfs_is_bin_visible() local [all …]
|
A D | winbond.c | 12 w25q256_post_bfpt_fixups(struct spi_nor *nor, in w25q256_post_bfpt_fixups() argument 26 nor->flags |= SNOR_F_4B_OPCODES; in w25q256_post_bfpt_fixups() 115 static int winbond_set_4byte_addr_mode(struct spi_nor *nor, bool enable) in winbond_set_4byte_addr_mode() argument 119 ret = spi_nor_set_4byte_addr_mode(nor, enable); in winbond_set_4byte_addr_mode() 128 ret = spi_nor_write_enable(nor); in winbond_set_4byte_addr_mode() 132 ret = spi_nor_write_ear(nor, 0); in winbond_set_4byte_addr_mode() 136 return spi_nor_write_disable(nor); in winbond_set_4byte_addr_mode() 147 static void winbond_default_init(struct spi_nor *nor) in winbond_default_init() argument 149 nor->params->set_4byte_addr_mode = winbond_set_4byte_addr_mode; in winbond_default_init() 150 if (nor->params->otp.org->n_regions) in winbond_default_init() [all …]
|
A D | macronix.c | 12 mx25l25635_post_bfpt_fixups(struct spi_nor *nor, in mx25l25635_post_bfpt_fixups() argument 26 nor->flags |= SNOR_F_4B_OPCODES; in mx25l25635_post_bfpt_fixups() 92 static void macronix_default_init(struct spi_nor *nor) in macronix_default_init() argument 94 nor->params->quad_enable = spi_nor_sr1_bit6_quad_enable; in macronix_default_init() 95 nor->params->set_4byte_addr_mode = spi_nor_set_4byte_addr_mode; in macronix_default_init()
|
/linux/drivers/mtd/ |
A D | built-in.a | 45 spi-nor/core.o/ 46 spi-nor/sfdp.o/ 47 spi-nor/swp.o/ 48 spi-nor/otp.o/ 49 spi-nor/sysfs.o/ 50 spi-nor/atmel.o/ 52 spi-nor/eon.o/ 53 spi-nor/esmt.o/ 58 spi-nor/issi.o/ 62 spi-nor/sst.o/ [all …]
|
/linux/drivers/mtd/spi-nor/controllers/ |
A D | aspeed-smc.c | 100 struct spi_nor nor; member 356 nor->addr_width); in aspeed_smc_send_cmd_addr() 381 aspeed_smc_send_cmd_addr(nor, nor->read_opcode, from); in aspeed_smc_read_user() 396 aspeed_smc_send_cmd_addr(nor, nor->program_opcode, to); in aspeed_smc_write_user() 554 dev_info(chip->nor.dev, in aspeed_smc_chip_set_segment() 589 dev_warn(chip->nor.dev, in aspeed_smc_chip_set_segment() 775 struct spi_nor *nor; in aspeed_smc_setup_flash() local 812 nor = &chip->nor; in aspeed_smc_setup_flash() 813 mtd = &nor->mtd; in aspeed_smc_setup_flash() 815 nor->dev = dev; in aspeed_smc_setup_flash() [all …]
|
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 …]
|
A D | nxp-spifi.c | 59 struct spi_nor nor; member 129 struct nxp_spifi *spifi = nor->priv; in nxp_spifi_read_reg() 152 struct nxp_spifi *spifi = nor->priv; in nxp_spifi_write_reg() 176 struct nxp_spifi *spifi = nor->priv; in nxp_spifi_read() 191 struct nxp_spifi *spifi = nor->priv; in nxp_spifi_write() 221 struct nxp_spifi *spifi = nor->priv; in nxp_spifi_erase() 241 switch (spifi->nor.read_proto) { in nxp_spifi_setup_memory_cmd() 255 if (spifi->nor.addr_width < 1 || spifi->nor.addr_width > 4) in nxp_spifi_setup_memory_cmd() 268 nor->controller_ops->read_reg(nor, SPINOR_OP_RDID, id, in nxp_spifi_dummy_id_read() 343 spifi->nor.dev = spifi->dev; in nxp_spifi_setup_flash() [all …]
|
A D | intel-spi.c | 146 struct spi_nor nor; member 560 struct intel_spi *ispi = nor->priv; in intel_spi_read_reg() 581 struct intel_spi *ispi = nor->priv; in intel_spi_write_reg() 639 struct intel_spi *ispi = nor->priv; in intel_spi_read() 651 switch (nor->read_opcode) { in intel_spi_read() 710 struct intel_spi *ispi = nor->priv; in intel_spi_write() 772 size_t erase_size, len = nor->mtd.erasesize; in intel_spi_erase() 773 struct intel_spi *ispi = nor->priv; in intel_spi_erase() 936 ispi->nor.dev = ispi->dev; in intel_spi_probe() 937 ispi->nor.priv = ispi; in intel_spi_probe() [all …]
|
/linux/Documentation/devicetree/bindings/spi/ |
A D | mediatek,spi-mtk-nor.yaml | 28 - mediatek,mt2701-nor 29 - mediatek,mt2712-nor 30 - mediatek,mt7622-nor 31 - mediatek,mt7623-nor 32 - mediatek,mt7629-nor 33 - mediatek,mt8192-nor 34 - mediatek,mt8195-nor 36 - mediatek,mt8173-nor 38 - const: mediatek,mt8173-nor 73 compatible = "mediatek,mt8173-nor"; [all …]
|
/linux/Documentation/devicetree/bindings/mtd/ |
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"; 20 spi-nor@0 { 21 compatible = "jedec,spi-nor";
|
/linux/include/linux/mtd/ |
A D | spi-nor.h | 327 int (*prepare)(struct spi_nor *nor); 328 void (*unprepare)(struct spi_nor *nor); 329 int (*read_reg)(struct spi_nor *nor, u8 opcode, u8 *buf, size_t len); 330 int (*write_reg)(struct spi_nor *nor, u8 opcode, const u8 *buf, 334 ssize_t (*write)(struct spi_nor *nor, loff_t to, size_t len, 336 int (*erase)(struct spi_nor *nor, loff_t offs); 430 static inline void spi_nor_set_flash_node(struct spi_nor *nor, in spi_nor_set_flash_node() argument 433 mtd_set_of_node(&nor->mtd, np); in spi_nor_set_flash_node() 438 return mtd_get_of_node(&nor->mtd); in spi_nor_get_flash_node() 455 int spi_nor_scan(struct spi_nor *nor, const char *name, [all …]
|
/linux/arch/powerpc/boot/dts/fsl/ |
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 …]
|
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";
|