• Home
  • Raw
  • Download

Lines Matching full:nor

29 #include <linux/mtd/spi-nor.h>
134 struct spi_nor nor; member
203 static void stm32_qspi_set_framemode(struct spi_nor *nor, in stm32_qspi_set_framemode() argument
211 switch (nor->read_proto) { in stm32_qspi_set_framemode()
351 static int stm32_qspi_read_reg(struct spi_nor *nor, in stm32_qspi_read_reg() argument
354 struct stm32_qspi_flash *flash = nor->priv; in stm32_qspi_read_reg()
367 stm32_qspi_set_framemode(nor, &cmd, false); in stm32_qspi_read_reg()
372 static int stm32_qspi_write_reg(struct spi_nor *nor, u8 opcode, in stm32_qspi_write_reg() argument
375 struct stm32_qspi_flash *flash = nor->priv; in stm32_qspi_write_reg()
388 stm32_qspi_set_framemode(nor, &cmd, false); in stm32_qspi_write_reg()
393 static ssize_t stm32_qspi_read(struct spi_nor *nor, loff_t from, size_t len, in stm32_qspi_read() argument
396 struct stm32_qspi_flash *flash = nor->priv; in stm32_qspi_read()
402 nor->read_opcode, buf, (u32)from, len); in stm32_qspi_read()
405 cmd.opcode = nor->read_opcode; in stm32_qspi_read()
406 cmd.addr_width = nor->addr_width; in stm32_qspi_read()
409 cmd.dummy = nor->read_dummy; in stm32_qspi_read()
414 stm32_qspi_set_framemode(nor, &cmd, true); in stm32_qspi_read()
420 static ssize_t stm32_qspi_write(struct spi_nor *nor, loff_t to, size_t len, in stm32_qspi_write() argument
423 struct stm32_qspi_flash *flash = nor->priv; in stm32_qspi_write()
429 nor->program_opcode, buf, (u32)to, len); in stm32_qspi_write()
432 cmd.opcode = nor->program_opcode; in stm32_qspi_write()
433 cmd.addr_width = nor->addr_width; in stm32_qspi_write()
440 stm32_qspi_set_framemode(nor, &cmd, false); in stm32_qspi_write()
446 static int stm32_qspi_erase(struct spi_nor *nor, loff_t offs) in stm32_qspi_erase() argument
448 struct stm32_qspi_flash *flash = nor->priv; in stm32_qspi_erase()
452 dev_dbg(dev, "erase(%#.2x):offs:%#x\n", nor->erase_opcode, (u32)offs); in stm32_qspi_erase()
455 cmd.opcode = nor->erase_opcode; in stm32_qspi_erase()
456 cmd.addr_width = nor->addr_width; in stm32_qspi_erase()
460 stm32_qspi_set_framemode(nor, &cmd, false); in stm32_qspi_erase()
486 static int stm32_qspi_prep(struct spi_nor *nor, enum spi_nor_ops ops) in stm32_qspi_prep() argument
488 struct stm32_qspi_flash *flash = nor->priv; in stm32_qspi_prep()
495 static void stm32_qspi_unprep(struct spi_nor *nor, enum spi_nor_ops ops) in stm32_qspi_unprep() argument
497 struct stm32_qspi_flash *flash = nor->priv; in stm32_qspi_unprep()
541 flash->nor.dev = qspi->dev; in stm32_qspi_flash_setup()
542 spi_nor_set_flash_node(&flash->nor, np); in stm32_qspi_flash_setup()
543 flash->nor.priv = flash; in stm32_qspi_flash_setup()
544 mtd = &flash->nor.mtd; in stm32_qspi_flash_setup()
546 flash->nor.read = stm32_qspi_read; in stm32_qspi_flash_setup()
547 flash->nor.write = stm32_qspi_write; in stm32_qspi_flash_setup()
548 flash->nor.erase = stm32_qspi_erase; in stm32_qspi_flash_setup()
549 flash->nor.read_reg = stm32_qspi_read_reg; in stm32_qspi_flash_setup()
550 flash->nor.write_reg = stm32_qspi_write_reg; in stm32_qspi_flash_setup()
551 flash->nor.prepare = stm32_qspi_prep; in stm32_qspi_flash_setup()
552 flash->nor.unprepare = stm32_qspi_unprep; in stm32_qspi_flash_setup()
561 * which define the size of nor flash. in stm32_qspi_flash_setup()
562 * if fsize is NULL, the controller can't sent spi-nor command. in stm32_qspi_flash_setup()
563 * set a temporary value just to discover the nor flash with in stm32_qspi_flash_setup()
568 ret = spi_nor_scan(&flash->nor, NULL, &hwcaps); in stm32_qspi_flash_setup()
603 mtd_device_unregister(&qspi->flash[i].nor.mtd); in stm32_qspi_mtd_free()