Lines Matching refs:nor
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
191 struct nxp_spifi *spifi = nor->priv; in nxp_spifi_write()
205 SPIFI_CMD_OPCODE(nor->program_opcode) | in nxp_spifi_write()
206 SPIFI_CMD_FRAMEFORM(spifi->nor.addr_nbytes + 1); in nxp_spifi_write()
219 static int nxp_spifi_erase(struct spi_nor *nor, loff_t offs) in nxp_spifi_erase() argument
221 struct nxp_spifi *spifi = nor->priv; in nxp_spifi_erase()
232 SPIFI_CMD_OPCODE(nor->erase_opcode) | in nxp_spifi_erase()
233 SPIFI_CMD_FRAMEFORM(spifi->nor.addr_nbytes + 1); in nxp_spifi_erase()
241 switch (spifi->nor.read_proto) { in nxp_spifi_setup_memory_cmd()
255 if (spifi->nor.addr_nbytes < 1 || spifi->nor.addr_nbytes > 4) in nxp_spifi_setup_memory_cmd()
258 spifi->mcmd |= SPIFI_CMD_OPCODE(spifi->nor.read_opcode) | in nxp_spifi_setup_memory_cmd()
259 SPIFI_CMD_INTLEN(spifi->nor.read_dummy / 8) | in nxp_spifi_setup_memory_cmd()
260 SPIFI_CMD_FRAMEFORM(spifi->nor.addr_nbytes + 1); in nxp_spifi_setup_memory_cmd()
265 static void nxp_spifi_dummy_id_read(struct spi_nor *nor) in nxp_spifi_dummy_id_read() argument
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()
344 spi_nor_set_flash_node(&spifi->nor, np); in nxp_spifi_setup_flash()
345 spifi->nor.priv = spifi; in nxp_spifi_setup_flash()
346 spifi->nor.controller_ops = &nxp_spifi_controller_ops; in nxp_spifi_setup_flash()
357 nxp_spifi_dummy_id_read(&spifi->nor); in nxp_spifi_setup_flash()
359 ret = spi_nor_scan(&spifi->nor, NULL, &hwcaps); in nxp_spifi_setup_flash()
371 ret = mtd_device_register(&spifi->nor.mtd, NULL, 0); in nxp_spifi_setup_flash()
458 mtd_device_unregister(&spifi->nor.mtd); in nxp_spifi_remove()