/linux/drivers/mtd/spi-nor/ |
H A D | core.c | 58 static u8 spi_nor_get_cmd_ext(const struct spi_nor *nor, in spi_nor_get_cmd_ext() argument 61 switch (nor->cmd_ext_type) { in spi_nor_get_cmd_ext() 69 dev_err(nor->dev, "Unknown command extension type\n"); in spi_nor_get_cmd_ext() 81 void spi_nor_spimem_setup_op(const struct spi_nor *nor, in spi_nor_spimem_setup_op() argument 113 ext = spi_nor_get_cmd_ext(nor, op); in spi_nor_spimem_setup_op() 118 if (proto == SNOR_PROTO_8_8_8_DTR && nor->flags & SNOR_F_SWAP16) in spi_nor_spimem_setup_op() 132 static bool spi_nor_spimem_bounce(struct spi_nor *nor, struct spi_mem_op *op) in spi_nor_spimem_bounce() argument 137 if (op->data.nbytes > nor->bouncebuf_size) in spi_nor_spimem_bounce() 138 op->data.nbytes = nor->bouncebuf_size; in spi_nor_spimem_bounce() 139 op->data.buf.in = nor->bouncebuf; in spi_nor_spimem_bounce() [all …]
|
H 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 36 int spi_nor_otp_read_secr(struct spi_nor *nor, loff_t addr, size_t len, u8 *buf) in spi_nor_otp_read_secr() argument 43 read_opcode = nor->read_opcode; in spi_nor_otp_read_secr() 44 addr_nbytes = nor->addr_nbytes; in spi_nor_otp_read_secr() 45 read_dummy = nor->read_dummy; in spi_nor_otp_read_secr() 46 read_proto = nor->read_proto; in spi_nor_otp_read_secr() 47 rdesc = nor->dirmap.rdesc; in spi_nor_otp_read_secr() 49 nor->read_opcode = SPINOR_OP_RSECR; in spi_nor_otp_read_secr() 50 nor->read_dummy = 8; in spi_nor_otp_read_secr() [all …]
|
H A D | swp.c | 13 static u8 spi_nor_get_sr_bp_mask(struct spi_nor *nor) in spi_nor_get_sr_bp_mask() argument 17 if (nor->flags & SNOR_F_HAS_SR_BP3_BIT6) in spi_nor_get_sr_bp_mask() 20 if (nor->flags & SNOR_F_HAS_4BIT_BP) in spi_nor_get_sr_bp_mask() 26 static u8 spi_nor_get_sr_tb_mask(struct spi_nor *nor) in spi_nor_get_sr_tb_mask() argument 28 if (nor->flags & SNOR_F_HAS_SR_TB_BIT6) in spi_nor_get_sr_tb_mask() 34 static u64 spi_nor_get_min_prot_length_sr(struct spi_nor *nor) in spi_nor_get_min_prot_length_sr() argument 41 unsigned int sector_size = nor->info->sector_size ?: SPI_NOR_DEFAULT_SECTOR_SIZE; in spi_nor_get_min_prot_length_sr() 42 u64 n_sectors = div_u64(nor->params->size, sector_size); in spi_nor_get_min_prot_length_sr() 43 u8 mask = spi_nor_get_sr_bp_mask(nor); in spi_nor_get_min_prot_length_sr() 55 static void spi_nor_get_locked_range_sr(struct spi_nor *nor, u8 sr, loff_t *ofs, in spi_nor_get_locked_range_sr() argument [all …]
|
H A D | micron-st.c | 51 static int micron_st_nor_octal_dtr_en(struct spi_nor *nor) in micron_st_nor_octal_dtr_en() argument 54 u8 *buf = nor->bouncebuf; in micron_st_nor_octal_dtr_en() 56 u8 addr_mode_nbytes = nor->params->addr_mode_nbytes; 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() 76 ret = spi_nor_read_id(nor, 0, 8, buf, SNOR_PROTO_8_8_8_DTR); in micron_st_nor_octal_dtr_en() 78 dev_dbg(nor->dev, "error %d reading JEDEC ID after enabling 8D-8D-8D mode\n", ret); 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() 88 static int micron_st_nor_octal_dtr_dis(struct spi_nor *nor) in micron_st_nor_octal_dtr_dis() argument 91 u8 *buf = nor->bouncebuf; in micron_st_nor_octal_dtr_dis() [all …]
|
H A D | sst.c | 16 static int sst26vf_nor_lock(struct spi_nor *nor, loff_t ofs, u64 len) in sst26vf_nor_lock() argument 21 static int sst26vf_nor_unlock(struct spi_nor *nor, loff_t ofs, u64 len) in sst26vf_nor_unlock() argument 26 if (ofs != 0 || len != nor->params->size) in sst26vf_nor_unlock() 29 ret = spi_nor_read_cr(nor, nor->bouncebuf); in sst26vf_nor_unlock() 33 if (!(nor->bouncebuf[0] & SST26VF_CR_BPNV)) { in sst26vf_nor_unlock() 34 dev_dbg(nor->dev, "Any block has been permanently locked\n"); in sst26vf_nor_unlock() 38 return spi_nor_global_block_unlock(nor); in sst26vf_nor_unlock() 41 static int sst26vf_nor_is_locked(struct spi_nor *nor, loff_t ofs, u64 len) in sst26vf_nor_is_locked() argument 52 static int sst26vf_nor_late_init(struct spi_nor *nor) in sst26vf_nor_late_init() argument 54 nor->params->locking_ops = &sst26vf_nor_locking_ops; in sst26vf_nor_late_init() [all …]
|
H A D | sfdp.c | 151 static int spi_nor_read_raw(struct spi_nor *nor, u32 addr, size_t len, u8 *buf) in spi_nor_read_raw() argument 156 ret = spi_nor_read_data(nor, addr, len, buf); in spi_nor_read_raw() 182 static int spi_nor_read_sfdp(struct spi_nor *nor, u32 addr, in spi_nor_read_sfdp() argument 188 read_opcode = nor->read_opcode; in spi_nor_read_sfdp() 189 addr_nbytes = nor->addr_nbytes; in spi_nor_read_sfdp() 190 read_dummy = nor->read_dummy; in spi_nor_read_sfdp() 192 nor->read_opcode = SPINOR_OP_RDSFDP; in spi_nor_read_sfdp() 193 nor->addr_nbytes = 3; in spi_nor_read_sfdp() 194 nor->read_dummy = 8; in spi_nor_read_sfdp() 196 ret = spi_nor_read_raw(nor, addr, len, buf); in spi_nor_read_sfdp() [all …]
|
H A D | Makefile | 3 spi-nor-objs := core.o sfdp.o swp.o otp.o sysfs.o 4 spi-nor-objs += atmel.o 5 spi-nor-objs += eon.o 6 spi-nor-objs += esmt.o 7 spi-nor-objs += everspin.o 8 spi-nor-objs += gigadevice.o 9 spi-nor-objs += intel.o 10 spi-nor-objs += issi.o 11 spi-nor-objs += macronix.o 12 spi-nor-objs += micron-st.o [all …]
|
H A D | debugfs.c | 78 struct spi_nor *nor = s->private; in spi_nor_params_show() local 79 struct spi_nor_flash_parameter *params = nor->params; in spi_nor_params_show() 82 const struct flash_info *info = nor->info; in spi_nor_params_show() 87 seq_printf(s, "id\t\t%*ph\n", SPI_NOR_MAX_ID_LEN, nor->id); in spi_nor_params_show() 92 seq_printf(s, "address nbytes\t%u\n", nor->addr_nbytes); in spi_nor_params_show() 95 spi_nor_print_flags(s, nor->flags, snor_f_names, sizeof(snor_f_names)); in spi_nor_params_show() 99 seq_printf(s, " read\t\t0x%02x\n", nor->read_opcode); in spi_nor_params_show() 100 seq_printf(s, " dummy cycles\t%u\n", nor->read_dummy); in spi_nor_params_show() 101 seq_printf(s, " erase\t\t0x%02x\n", nor->erase_opcode); in spi_nor_params_show() 102 seq_printf(s, " program\t0x%02x\n", nor->program_opcode); in spi_nor_params_show() [all …]
|
H A D | winbond.c | 21 w25q128_post_bfpt_fixups(struct spi_nor *nor, in w25q128_post_bfpt_fixups() argument 32 nor->params->size == SZ_2M && in w25q128_post_bfpt_fixups() 33 nor->params->erase_map.regions[0].size == SZ_2M) { in w25q128_post_bfpt_fixups() 34 nor->params->size = SZ_16M; in w25q128_post_bfpt_fixups() 35 nor->params->erase_map.regions[0].size = SZ_16M; in w25q128_post_bfpt_fixups() 46 w25q256_post_bfpt_fixups(struct spi_nor *nor, in w25q256_post_bfpt_fixups() argument 60 nor->flags |= SNOR_F_4B_OPCODES; in w25q256_post_bfpt_fixups() 268 static int winbond_nor_write_ear(struct spi_nor *nor, u8 ear) in winbond_nor_write_ear() argument 272 nor->bouncebuf[0] = ear; in winbond_nor_write_ear() 274 if (nor->spimem) { in winbond_nor_write_ear() [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()
|
H A D | everspin.c | 37 static void everspin_nor_default_init(struct spi_nor *nor) in everspin_nor_default_init() argument 40 nor->params->hwcaps.mask &= ~SNOR_HWCAPS_READ_FAST; in everspin_nor_default_init()
|
/linux/drivers/mtd/spi-nor/controllers/ |
H A D | hisi-sfc.c | 99 struct spi_nor *nor[HIFMC_MAX_CHIP_NUM]; member 147 static int hisi_spi_nor_prep(struct spi_nor *nor) in hisi_spi_nor_prep() argument 149 struct hifmc_priv *priv = nor->priv; in hisi_spi_nor_prep() 170 static void hisi_spi_nor_unprep(struct spi_nor *nor) in hisi_spi_nor_unprep() argument 172 struct hifmc_priv *priv = nor->priv; in hisi_spi_nor_unprep() 179 static int hisi_spi_nor_op_reg(struct spi_nor *nor, in hisi_spi_nor_op_reg() argument 182 struct hifmc_priv *priv = nor->priv; in hisi_spi_nor_op_reg() 202 static int hisi_spi_nor_read_reg(struct spi_nor *nor, u8 opcode, u8 *buf, in hisi_spi_nor_read_reg() argument 205 struct hifmc_priv *priv = nor->priv; in hisi_spi_nor_read_reg() 209 ret = hisi_spi_nor_op_reg(nor, opcode, len, FMC_OP_READ_DATA_EN); in hisi_spi_nor_read_reg() [all …]
|
H A D | nxp-spifi.c | 58 struct spi_nor nor; member 125 static int nxp_spifi_read_reg(struct spi_nor *nor, u8 opcode, u8 *buf, in nxp_spifi_read_reg() argument 128 struct nxp_spifi *spifi = nor->priv; in nxp_spifi_read_reg() 148 static int nxp_spifi_write_reg(struct spi_nor *nor, u8 opcode, const u8 *buf, in nxp_spifi_write_reg() argument 151 struct nxp_spifi *spifi = nor->priv; in nxp_spifi_write_reg() 172 static ssize_t nxp_spifi_read(struct spi_nor *nor, loff_t from, size_t len, in nxp_spifi_read() argument 175 struct nxp_spifi *spifi = nor->priv; in nxp_spifi_read() 187 static ssize_t nxp_spifi_write(struct spi_nor *nor, loff_t to, size_t len, in nxp_spifi_write() argument 190 struct nxp_spifi *spifi = nor->priv; in nxp_spifi_write() 204 SPIFI_CMD_OPCODE(nor->program_opcode) | in nxp_spifi_write() [all …]
|
/linux/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/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() 431 static inline struct device_node *spi_nor_get_flash_node(struct spi_nor *nor) in spi_nor_get_flash_node() argument [all …]
|
/linux/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";
|
H A D | mpc8544ds.dtsi | 13 * * Neither the name of Freescale Semiconductor nor the 36 nor@0,0 { 46 label = "dtb-nor"; 51 label = "diagnostic-nor"; 57 label = "dink-nor"; 63 label = "kernel-nor"; 68 label = "u-boot-nor";
|
H A D | mpc8572ds.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 = "env-nor"; 84 label = "u-boot-nor";
|
H A D | t1024qds.dts | 13 * * Neither the name of Freescale Semiconductor nor the 71 nor@0,0 { 119 compatible = "micron,n25q128a11", "jedec,spi-nor"; /* 16MB */ 127 compatible = "sst,sst25wf040", "jedec,spi-nor"; /* 512KB */ 135 compatible = "eon,en25s64", "jedec,spi-nor"; /* 8MB */
|
/linux/arch/arm64/boot/dts/freescale/ |
H A D | fsl-ls1088a-qds.dts | 27 compatible = "jedec,spi-nor"; 35 compatible = "jedec,spi-nor"; 45 compatible = "jedec,spi-nor"; 150 compatible = "jedec,spi-nor"; 160 compatible = "jedec,spi-nor";
|
H A D | fsl-ls1028a-qds.dts | 152 compatible = "jedec,spi-nor"; 162 compatible = "jedec,spi-nor"; 172 compatible = "jedec,spi-nor"; 187 compatible = "jedec,spi-nor"; 197 compatible = "jedec,spi-nor"; 207 compatible = "jedec,spi-nor"; 222 compatible = "jedec,spi-nor"; 260 compatible = "jedec,spi-nor";
|
H A D | fsl-ls2081a-rdb.dts | 33 compatible = "jedec,spi-nor"; 98 compatible = "jedec,spi-nor"; 108 compatible = "jedec,spi-nor";
|
/linux/Documentation/driver-api/mtd/ |
H A D | spi-nor.rst | 17 on its SFDP data. All one has to do is to specify the "jedec,spi-nor" 41 root@1:~# cat /sys/bus/spi/devices/spi0.0/spi-nor/partname 43 root@1:~# cat /sys/bus/spi/devices/spi0.0/spi-nor/jedec_id 45 root@1:~# cat /sys/bus/spi/devices/spi0.0/spi-nor/manufacturer 47 root@1:~# xxd -p /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 69 root@1:~# sha256sum /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 70 …0461876f189ac97f93e68a05fa6428c6650b3b7baf736a921e5898ed1 /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 79 root@1:~# cat /sys/kernel/debug/spi-nor/spi0.0/capabilities 114 root@1:~# cat /sys/kernel/debug/spi-nor/spi0.0/params
|
/linux/Documentation/ABI/testing/ |
H A D | sysfs-bus-spi-devices-spi-nor | 1 What: /sys/bus/spi/devices/.../spi-nor/jedec_id 12 What: /sys/bus/spi/devices/.../spi-nor/manufacturer 22 What: /sys/bus/spi/devices/.../spi-nor/partname 32 What: /sys/bus/spi/devices/.../spi-nor/sfdp
|