Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mtd: spinand: Add support for setting a bus interface

Create a bus interface enumeration, currently only containing the
one we support: SSDR, for single SDR, so any operation whose command is
sent over a single data line in SDR mode, ie. any operation matching
1S-XX-XX.

The main spinand_device structure gets a new parameter to store this
enumeration, for now unused. Of course it is set to SSDR during the SSDR
templates initialization to further clarify the state we are in at the
moment.

This member is subject to be used to know in which bus configuration we
and be updated by the core when we switch to faster mode(s).

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

+11
+1
drivers/mtd/nand/spi/core.c
··· 1407 1407 tmpl->page_read = (struct spi_mem_op)SPINAND_PAGE_READ_1S_1S_0_OP(0); 1408 1408 tmpl->prog_exec = (struct spi_mem_op)SPINAND_PROG_EXEC_1S_1S_0_OP(0); 1409 1409 spinand->op_templates = &spinand->ssdr_op_templates; 1410 + spinand->bus_iface = SSDR; 1410 1411 } 1411 1412 1412 1413 static int spinand_support_vendor_ops(struct spinand_device *spinand,
+10
include/linux/mtd/spinand.h
··· 483 483 }; 484 484 485 485 /** 486 + * enum spinand_bus_interface - SPI NAND bus interface types 487 + * @SSDR: Bus configuration supporting all 1S-XX-XX operations, including dual and quad 488 + */ 489 + enum spinand_bus_interface { 490 + SSDR, 491 + }; 492 + 493 + /** 486 494 * struct spinand_info - Structure used to describe SPI NAND chips 487 495 * @model: model name 488 496 * @devid: device ID ··· 652 644 * @flags: NAND flags 653 645 * @ssdr_op_templates: Templates for all single SDR SPI mem operations 654 646 * @op_templates: Templates for all SPI mem operations 647 + * @bus_iface: Current bus interface 655 648 * @select_target: select a specific target/die. Usually called before sending 656 649 * a command addressing a page or an eraseblock embedded in 657 650 * this die. Only required if your chip exposes several dies ··· 688 679 689 680 struct spinand_mem_ops ssdr_op_templates; 690 681 struct spinand_mem_ops *op_templates; 682 + enum spinand_bus_interface bus_iface; 691 683 692 684 struct spinand_dirmap *dirmaps; 693 685