Home
last modified time | relevance | path

Searched full:nor (Results 1 – 25 of 6269) sorted by relevance

12345678910>>...251

/kernel/linux/linux-6.6/drivers/mtd/spi-nor/
Dcore.c17 #include <linux/mtd/spi-nor.h>
49 * @nor: pointer to a 'struct spi_nor'
57 static u8 spi_nor_get_cmd_ext(const struct spi_nor *nor, in spi_nor_get_cmd_ext() argument
60 switch (nor->cmd_ext_type) { in spi_nor_get_cmd_ext()
68 dev_err(nor->dev, "Unknown command extension type\n"); in spi_nor_get_cmd_ext()
75 * @nor: pointer to a 'struct spi_nor'
80 void spi_nor_spimem_setup_op(const struct spi_nor *nor, in spi_nor_spimem_setup_op() argument
101 * something like 4S-4D-4D, but SPI NOR can't. So, set all 4 in spi_nor_spimem_setup_op()
112 ext = spi_nor_get_cmd_ext(nor, op); in spi_nor_spimem_setup_op()
121 * @nor: pointer to 'struct spi_nor'
[all …]
Dotp.c3 * OTP support for SPI NOR flashes
10 #include <linux/mtd/spi-nor.h>
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
19 * @nor: pointer to 'struct spi_nor'
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()
[all …]
Dspansion.c10 #include <linux/mtd/spi-nor.h>
47 /* Cypress SPI NOR flash operations. */
77 * @nor: pointer to 'struct spi_nor'.
79 static void spansion_nor_clear_sr(struct spi_nor *nor) in spansion_nor_clear_sr() argument
81 const struct spansion_nor_params *priv_params = nor->params->priv; in spansion_nor_clear_sr()
84 if (nor->spimem) { in spansion_nor_clear_sr()
87 spi_nor_spimem_setup_op(nor, &op, nor->reg_proto); in spansion_nor_clear_sr()
89 ret = spi_mem_exec_op(nor->spimem, &op); in spansion_nor_clear_sr()
91 ret = spi_nor_controller_ops_write_reg(nor, SPINOR_OP_CLSR, in spansion_nor_clear_sr()
96 dev_dbg(nor->dev, "error %d clearing SR\n", ret); in spansion_nor_clear_sr()
[all …]
Dswp.c3 * SPI NOR Software Write Protection logic.
9 #include <linux/mtd/spi-nor.h>
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
37 u8 mask = spi_nor_get_sr_bp_mask(nor); in spi_nor_get_min_prot_length_sr()
41 bp_slots_needed = ilog2(nor->info->n_sectors); in spi_nor_get_min_prot_length_sr()
[all …]
Dxilinx.c7 #include <linux/mtd/spi-nor.h>
38 /* Xilinx S3AN share MFR with Atmel SPI NOR */
57 static u32 s3an_nor_convert_addr(struct spi_nor *nor, u32 addr) in s3an_nor_convert_addr() argument
59 u32 page_size = nor->params->page_size; in s3an_nor_convert_addr()
71 * @nor: pointer to 'struct spi_nor'.
77 static int xilinx_nor_read_sr(struct spi_nor *nor, u8 *sr) in xilinx_nor_read_sr() argument
81 if (nor->spimem) { in xilinx_nor_read_sr()
84 spi_nor_spimem_setup_op(nor, &op, nor->reg_proto); in xilinx_nor_read_sr()
86 ret = spi_mem_exec_op(nor->spimem, &op); in xilinx_nor_read_sr()
88 ret = spi_nor_controller_ops_read_reg(nor, XILINX_OP_RDSR, sr, in xilinx_nor_read_sr()
[all …]
Dmicron-st.c7 #include <linux/mtd/spi-nor.h>
31 /* Micron ST SPI NOR flash operations. */
50 static int micron_st_nor_octal_dtr_en(struct spi_nor *nor) in micron_st_nor_octal_dtr_en() argument
53 u8 *buf = nor->bouncebuf; in micron_st_nor_octal_dtr_en()
55 u8 addr_mode_nbytes = nor->params->addr_mode_nbytes; in micron_st_nor_octal_dtr_en()
62 ret = spi_nor_write_any_volatile_reg(nor, &op, nor->reg_proto); in micron_st_nor_octal_dtr_en()
70 ret = spi_nor_write_any_volatile_reg(nor, &op, nor->reg_proto); in micron_st_nor_octal_dtr_en()
75 ret = spi_nor_read_id(nor, 0, 8, buf, SNOR_PROTO_8_8_8_DTR); in micron_st_nor_octal_dtr_en()
77 dev_dbg(nor->dev, "error %d reading JEDEC ID after enabling 8D-8D-8D mode\n", ret); in micron_st_nor_octal_dtr_en()
81 if (memcmp(buf, nor->info->id, nor->info->id_len)) in micron_st_nor_octal_dtr_en()
[all …]
DMakefile3 spi-nor-objs := core.o sfdp.o swp.o otp.o sysfs.o
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
10 spi-nor-objs += gigadevice.o
11 spi-nor-objs += intel.o
12 spi-nor-objs += issi.o
[all …]
Dsst.c7 #include <linux/mtd/spi-nor.h>
16 static int sst26vf_nor_lock(struct spi_nor *nor, loff_t ofs, uint64_t len) in sst26vf_nor_lock() argument
21 static int sst26vf_nor_unlock(struct spi_nor *nor, loff_t ofs, uint64_t 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, uint64_t len) in sst26vf_nor_is_locked() argument
52 static int sst26vf_nor_late_init(struct spi_nor *nor) in sst26vf_nor_late_init() argument
[all …]
Dcore.h14 /* Standard SPI NOR flash operations. */
195 * struct spi_nor_erase_type - Structure to describe a SPI NOR erase type
234 * struct spi_nor_erase_region - Structure to describe a SPI NOR erase region
238 * the last in the SPI NOR flash memory and to indicate
259 * struct spi_nor_erase_map - Structure to describe the SPI NOR erase map
263 * @uniform_region: a pre-allocated erase region for SPI NOR with a uniform
271 * uniform and non-uniform SPI NOR flash memories if they
283 * struct spi_nor_locking_ops - SPI NOR locking methods
284 * @lock: lock a region of the SPI NOR.
285 * @unlock: unlock a region of the SPI NOR.
[all …]
Datmel.c7 #include <linux/mtd/spi-nor.h>
19 static int at25fs_nor_lock(struct spi_nor *nor, loff_t ofs, uint64_t len) in at25fs_nor_lock() argument
24 static int at25fs_nor_unlock(struct spi_nor *nor, loff_t ofs, uint64_t len) in at25fs_nor_unlock() argument
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()
35 dev_dbg(nor->dev, "unable to clear BP bits, WP# asserted?\n"); in at25fs_nor_unlock()
40 static int at25fs_nor_is_locked(struct spi_nor *nor, loff_t ofs, uint64_t len) in at25fs_nor_is_locked() argument
51 static int at25fs_nor_late_init(struct spi_nor *nor) in at25fs_nor_late_init() argument
53 nor->params->locking_ops = &at25fs_nor_locking_ops; in at25fs_nor_late_init()
64 * @nor: pointer to 'struct spi_nor'
[all …]
Dsysfs.c3 #include <linux/mtd/spi-nor.h>
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
38 const u8 *id = nor->info->id_len ? nor->info->id : nor->id; in jedec_id_show()
39 u8 id_len = 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()
[all …]
Dsfdp.c8 #include <linux/mtd/spi-nor.h>
144 * @nor: pointer to a 'struct spi_nor'
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()
171 * @nor: pointer to a 'struct spi_nor'
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()
[all …]
Ddebugfs.c4 #include <linux/mtd/spi-nor.h>
10 #define SPI_NOR_DEBUGFS_ROOT "spi-nor"
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()
[all …]
/kernel/linux/linux-5.10/drivers/mtd/spi-nor/
Dcore.c23 #include <linux/mtd/spi-nor.h>
46 * @nor: pointer to 'struct spi_nor'
53 static bool spi_nor_spimem_bounce(struct spi_nor *nor, struct spi_mem_op *op) in spi_nor_spimem_bounce() argument
58 if (op->data.nbytes > nor->bouncebuf_size) in spi_nor_spimem_bounce()
59 op->data.nbytes = nor->bouncebuf_size; in spi_nor_spimem_bounce()
60 op->data.buf.in = nor->bouncebuf; in spi_nor_spimem_bounce()
69 * @nor: pointer to 'struct spi_nor'
74 static int spi_nor_spimem_exec_op(struct spi_nor *nor, struct spi_mem_op *op) in spi_nor_spimem_exec_op() argument
78 error = spi_mem_adjust_op_size(nor->spimem, op); in spi_nor_spimem_exec_op()
82 return spi_mem_exec_op(nor->spimem, op); in spi_nor_spimem_exec_op()
[all …]
Dxilinx.c7 #include <linux/mtd/spi-nor.h>
29 static u32 s3an_convert_addr(struct spi_nor *nor, u32 addr) in s3an_convert_addr() argument
33 offset = addr % nor->page_size; in s3an_convert_addr()
34 page = addr / nor->page_size; in s3an_convert_addr()
35 page <<= (nor->page_size > 512) ? 10 : 9; in s3an_convert_addr()
40 static int xilinx_nor_setup(struct spi_nor *nor, in xilinx_nor_setup() argument
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()
[all …]
DMakefile3 spi-nor-objs := core.o sfdp.o
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
10 spi-nor-objs += gigadevice.o
11 spi-nor-objs += intel.o
12 spi-nor-objs += issi.o
[all …]
Dsst.c7 #include <linux/mtd/spi-nor.h>
48 struct spi_nor *nor = mtd_to_spi_nor(mtd); in sst_write() local
52 dev_dbg(nor->dev, "to 0x%08x, len %zd\n", (u32)to, len); in sst_write()
54 ret = spi_nor_lock_and_prep(nor); in sst_write()
58 ret = spi_nor_write_enable(nor); in sst_write()
62 nor->sst_write_second = false; in sst_write()
66 nor->program_opcode = SPINOR_OP_BP; in sst_write()
69 ret = spi_nor_write_data(nor, to, 1, buf); in sst_write()
73 ret = spi_nor_wait_till_ready(nor); in sst_write()
83 nor->program_opcode = SPINOR_OP_AAI_WP; in sst_write()
[all …]
Dcore.h86 * struct spi_nor_erase_type - Structure to describe a SPI NOR erase type
125 * struct spi_nor_erase_region - Structure to describe a SPI NOR erase region
129 * the last in the SPI NOR flash memory and to indicate
150 * struct spi_nor_erase_map - Structure to describe the SPI NOR erase map
154 * @uniform_region: a pre-allocated erase region for SPI NOR with a uniform
162 * uniform and non-uniform SPI NOR flash memories if they
174 * struct spi_nor_locking_ops - SPI NOR locking methods
175 * @lock: lock a region of the SPI NOR.
176 * @unlock: unlock a region of the SPI NOR.
177 * @is_locked: check if a region of the SPI NOR is completely locked
[all …]
/kernel/linux/linux-6.6/Documentation/devicetree/bindings/spi/
Dmediatek,spi-mtk-nor.yaml4 $id: http://devicetree.org/schemas/spi/mediatek,spi-mtk-nor.yaml#
7 title: Serial NOR flash controller for MediaTek ARM SoCs
15 SPI NOR flash. There should be only one spi slave device following
17 for devices other than SPI NOR flash due to limited transfer
27 - mediatek,mt8173-nor
28 - mediatek,mt8186-nor
29 - mediatek,mt8192-nor
32 - mediatek,mt2701-nor
33 - mediatek,mt2712-nor
34 - mediatek,mt7622-nor
[all …]
/kernel/linux/linux-6.6/drivers/mtd/spi-nor/controllers/
Dhisi-sfc.c3 * HiSilicon FMC SPI NOR flash controller driver
13 #include <linux/mtd/spi-nor.h>
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
[all …]
Dnxp-spifi.c3 * SPI NOR driver for NXP SPI Flash Interface (SPIFI)
18 #include <linux/mtd/spi-nor.h>
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
[all …]
/kernel/linux/linux-5.10/drivers/mtd/spi-nor/controllers/
Dhisi-sfc.c3 * HiSilicon FMC SPI NOR flash controller driver
13 #include <linux/mtd/spi-nor.h>
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
[all …]
Daspeed-smc.c15 #include <linux/mtd/spi-nor.h>
100 struct spi_nor nor; member
119 * CE0 and CE1 can only be of type SPI. CE2 can be of type NOR but the
277 static void aspeed_smc_start_user(struct spi_nor *nor) in aspeed_smc_start_user() argument
279 struct aspeed_smc_chip *chip = nor->priv; in aspeed_smc_start_user()
296 static void aspeed_smc_stop_user(struct spi_nor *nor) in aspeed_smc_stop_user() argument
298 struct aspeed_smc_chip *chip = nor->priv; in aspeed_smc_stop_user()
308 static int aspeed_smc_prep(struct spi_nor *nor) in aspeed_smc_prep() argument
310 struct aspeed_smc_chip *chip = nor->priv; in aspeed_smc_prep()
316 static void aspeed_smc_unprep(struct spi_nor *nor) in aspeed_smc_unprep() argument
[all …]
Dnxp-spifi.c3 * SPI NOR driver for NXP SPI Flash Interface (SPIFI)
18 #include <linux/mtd/spi-nor.h>
59 struct spi_nor nor; member
126 static int nxp_spifi_read_reg(struct spi_nor *nor, u8 opcode, u8 *buf, in nxp_spifi_read_reg() argument
129 struct nxp_spifi *spifi = nor->priv; in nxp_spifi_read_reg()
149 static int nxp_spifi_write_reg(struct spi_nor *nor, u8 opcode, const u8 *buf, in nxp_spifi_write_reg() argument
152 struct nxp_spifi *spifi = nor->priv; in nxp_spifi_write_reg()
173 static ssize_t nxp_spifi_read(struct spi_nor *nor, loff_t from, size_t len, in nxp_spifi_read() argument
176 struct nxp_spifi *spifi = nor->priv; in nxp_spifi_read()
188 static ssize_t nxp_spifi_write(struct spi_nor *nor, loff_t to, size_t len, in nxp_spifi_write() argument
[all …]
/kernel/linux/linux-5.10/Documentation/devicetree/bindings/spi/
Dmediatek,spi-mtk-nor.yaml4 $id: http://devicetree.org/schemas/spi/mediatek,spi-mtk-nor.yaml#
7 title: Serial NOR flash controller for MediaTek ARM SoCs
15 SPI NOR flash. There should be only one spi slave device following
17 for devices other than SPI NOR flash due to limited transfer
28 - mediatek,mt2701-nor
29 - mediatek,mt2712-nor
30 - mediatek,mt7622-nor
31 - mediatek,mt7623-nor
32 - mediatek,mt7629-nor
33 - mediatek,mt8192-nor
[all …]

12345678910>>...251