-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'spi-nor/for-5.7' into mtd/next
SPI NOR core changes: - move all the manufacturer specific quirks/code out of the core, to make the core logic more readable and thus ease maintenance. - move the SFDP logic out of the core, it provides a better separation between the SFDP parsing and core logic. - trim what is exposed in spi-nor.h. The SPI NOR controllers drivers must not be able to use structures that are meant just for the SPI NOR core. - use the spi-mem direct mapping API to let advanced controllers optimize the read/write operations when they support direct mapping. - add generic formula for the Status Register block protection handling. It fixes some long standing locking limitations and eases the addition of the 4bit block protection support. - add block protection support for flashes with 4 block protection bits in the Status Register. SPI NOR controller drivers changes: - the mtk-quadspi driver is replaced by the new spi-mem spi-mtk-nor driver. Merge tag 'mtk-mtd-spi-move' into spi-nor/next to avoid conflicts.
- Loading branch information
Showing
41 changed files
with
7,126 additions
and
6,373 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,20 @@ | ||
# SPDX-License-Identifier: GPL-2.0 | ||
|
||
spi-nor-objs := core.o sfdp.o | ||
spi-nor-objs += atmel.o | ||
spi-nor-objs += catalyst.o | ||
spi-nor-objs += eon.o | ||
spi-nor-objs += esmt.o | ||
spi-nor-objs += everspin.o | ||
spi-nor-objs += fujitsu.o | ||
spi-nor-objs += gigadevice.o | ||
spi-nor-objs += intel.o | ||
spi-nor-objs += issi.o | ||
spi-nor-objs += macronix.o | ||
spi-nor-objs += micron-st.o | ||
spi-nor-objs += spansion.o | ||
spi-nor-objs += sst.o | ||
spi-nor-objs += winbond.o | ||
spi-nor-objs += xilinx.o | ||
spi-nor-objs += xmc.o | ||
obj-$(CONFIG_MTD_SPI_NOR) += spi-nor.o | ||
obj-$(CONFIG_SPI_ASPEED_SMC) += aspeed-smc.o | ||
obj-$(CONFIG_SPI_CADENCE_QUADSPI) += cadence-quadspi.o | ||
obj-$(CONFIG_SPI_HISI_SFC) += hisi-sfc.o | ||
obj-$(CONFIG_SPI_MTK_QUADSPI) += mtk-quadspi.o | ||
obj-$(CONFIG_SPI_NXP_SPIFI) += nxp-spifi.o | ||
obj-$(CONFIG_SPI_INTEL_SPI) += intel-spi.o | ||
obj-$(CONFIG_SPI_INTEL_SPI_PCI) += intel-spi-pci.o | ||
obj-$(CONFIG_SPI_INTEL_SPI_PLATFORM) += intel-spi-platform.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
/* | ||
* Copyright (C) 2005, Intec Automation Inc. | ||
* Copyright (C) 2014, Freescale Semiconductor, Inc. | ||
*/ | ||
|
||
#include <linux/mtd/spi-nor.h> | ||
|
||
#include "core.h" | ||
|
||
static const struct flash_info atmel_parts[] = { | ||
/* Atmel -- some are (confusingly) marketed as "DataFlash" */ | ||
{ "at25fs010", INFO(0x1f6601, 0, 32 * 1024, 4, SECT_4K) }, | ||
{ "at25fs040", INFO(0x1f6604, 0, 64 * 1024, 8, SECT_4K) }, | ||
|
||
{ "at25df041a", INFO(0x1f4401, 0, 64 * 1024, 8, SECT_4K) }, | ||
{ "at25df321", INFO(0x1f4700, 0, 64 * 1024, 64, SECT_4K) }, | ||
{ "at25df321a", INFO(0x1f4701, 0, 64 * 1024, 64, SECT_4K) }, | ||
{ "at25df641", INFO(0x1f4800, 0, 64 * 1024, 128, SECT_4K) }, | ||
|
||
{ "at25sl321", INFO(0x1f4216, 0, 64 * 1024, 64, | ||
SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, | ||
|
||
{ "at26f004", INFO(0x1f0400, 0, 64 * 1024, 8, SECT_4K) }, | ||
{ "at26df081a", INFO(0x1f4501, 0, 64 * 1024, 16, SECT_4K) }, | ||
{ "at26df161a", INFO(0x1f4601, 0, 64 * 1024, 32, SECT_4K) }, | ||
{ "at26df321", INFO(0x1f4700, 0, 64 * 1024, 64, SECT_4K) }, | ||
|
||
{ "at45db081d", INFO(0x1f2500, 0, 64 * 1024, 16, SECT_4K) }, | ||
}; | ||
|
||
static void atmel_default_init(struct spi_nor *nor) | ||
{ | ||
nor->flags |= SNOR_F_HAS_LOCK; | ||
} | ||
|
||
static const struct spi_nor_fixups atmel_fixups = { | ||
.default_init = atmel_default_init, | ||
}; | ||
|
||
const struct spi_nor_manufacturer spi_nor_atmel = { | ||
.name = "atmel", | ||
.parts = atmel_parts, | ||
.nparts = ARRAY_SIZE(atmel_parts), | ||
.fixups = &atmel_fixups, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
/* | ||
* Copyright (C) 2005, Intec Automation Inc. | ||
* Copyright (C) 2014, Freescale Semiconductor, Inc. | ||
*/ | ||
|
||
#include <linux/mtd/spi-nor.h> | ||
|
||
#include "core.h" | ||
|
||
static const struct flash_info catalyst_parts[] = { | ||
/* Catalyst / On Semiconductor -- non-JEDEC */ | ||
{ "cat25c11", CAT25_INFO(16, 8, 16, 1, | ||
SPI_NOR_NO_ERASE | SPI_NOR_NO_FR) }, | ||
{ "cat25c03", CAT25_INFO(32, 8, 16, 2, | ||
SPI_NOR_NO_ERASE | SPI_NOR_NO_FR) }, | ||
{ "cat25c09", CAT25_INFO(128, 8, 32, 2, | ||
SPI_NOR_NO_ERASE | SPI_NOR_NO_FR) }, | ||
{ "cat25c17", CAT25_INFO(256, 8, 32, 2, | ||
SPI_NOR_NO_ERASE | SPI_NOR_NO_FR) }, | ||
{ "cat25128", CAT25_INFO(2048, 8, 64, 2, | ||
SPI_NOR_NO_ERASE | SPI_NOR_NO_FR) }, | ||
}; | ||
|
||
const struct spi_nor_manufacturer spi_nor_catalyst = { | ||
.name = "catalyst", | ||
.parts = catalyst_parts, | ||
.nparts = ARRAY_SIZE(catalyst_parts), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# SPDX-License-Identifier: GPL-2.0-only | ||
config SPI_ASPEED_SMC | ||
tristate "Aspeed flash controllers in SPI mode" | ||
depends on ARCH_ASPEED || COMPILE_TEST | ||
depends on HAS_IOMEM && OF | ||
help | ||
This enables support for the Firmware Memory controller (FMC) | ||
in the Aspeed AST2500/AST2400 SoCs when attached to SPI NOR chips, | ||
and support for the SPI flash memory controller (SPI) for | ||
the host firmware. The implementation only supports SPI NOR. | ||
|
||
config SPI_CADENCE_QUADSPI | ||
tristate "Cadence Quad SPI controller" | ||
depends on OF && (ARM || ARM64 || COMPILE_TEST) | ||
help | ||
Enable support for the Cadence Quad SPI Flash controller. | ||
|
||
Cadence QSPI is a specialized controller for connecting an SPI | ||
Flash over 1/2/4-bit wide bus. Enable this option if you have a | ||
device with a Cadence QSPI controller and want to access the | ||
Flash as an MTD device. | ||
|
||
config SPI_HISI_SFC | ||
tristate "Hisilicon FMC SPI-NOR Flash Controller(SFC)" | ||
depends on ARCH_HISI || COMPILE_TEST | ||
depends on HAS_IOMEM | ||
help | ||
This enables support for HiSilicon FMC SPI-NOR flash controller. | ||
|
||
config SPI_NXP_SPIFI | ||
tristate "NXP SPI Flash Interface (SPIFI)" | ||
depends on OF && (ARCH_LPC18XX || COMPILE_TEST) | ||
depends on HAS_IOMEM | ||
help | ||
Enable support for the NXP LPC SPI Flash Interface controller. | ||
|
||
SPIFI is a specialized controller for connecting serial SPI | ||
Flash. Enable this option if you have a device with a SPIFI | ||
controller and want to access the Flash as a mtd device. | ||
|
||
config SPI_INTEL_SPI | ||
tristate | ||
|
||
config SPI_INTEL_SPI_PCI | ||
tristate "Intel PCH/PCU SPI flash PCI driver (DANGEROUS)" | ||
depends on X86 && PCI | ||
select SPI_INTEL_SPI | ||
help | ||
This enables PCI support for the Intel PCH/PCU SPI controller in | ||
master mode. This controller is present in modern Intel hardware | ||
and is used to hold BIOS and other persistent settings. Using | ||
this driver it is possible to upgrade BIOS directly from Linux. | ||
|
||
Say N here unless you know what you are doing. Overwriting the | ||
SPI flash may render the system unbootable. | ||
|
||
To compile this driver as a module, choose M here: the module | ||
will be called intel-spi-pci. | ||
|
||
config SPI_INTEL_SPI_PLATFORM | ||
tristate "Intel PCH/PCU SPI flash platform driver (DANGEROUS)" | ||
depends on X86 | ||
select SPI_INTEL_SPI | ||
help | ||
This enables platform support for the Intel PCH/PCU SPI | ||
controller in master mode. This controller is present in modern | ||
Intel hardware and is used to hold BIOS and other persistent | ||
settings. Using this driver it is possible to upgrade BIOS | ||
directly from Linux. | ||
|
||
Say N here unless you know what you are doing. Overwriting the | ||
SPI flash may render the system unbootable. | ||
|
||
To compile this driver as a module, choose M here: the module | ||
will be called intel-spi-platform. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# SPDX-License-Identifier: GPL-2.0 | ||
obj-$(CONFIG_SPI_ASPEED_SMC) += aspeed-smc.o | ||
obj-$(CONFIG_SPI_CADENCE_QUADSPI) += cadence-quadspi.o | ||
obj-$(CONFIG_SPI_HISI_SFC) += hisi-sfc.o | ||
obj-$(CONFIG_SPI_NXP_SPIFI) += nxp-spifi.o | ||
obj-$(CONFIG_SPI_INTEL_SPI) += intel-spi.o | ||
obj-$(CONFIG_SPI_INTEL_SPI_PCI) += intel-spi-pci.o | ||
obj-$(CONFIG_SPI_INTEL_SPI_PLATFORM) += intel-spi-platform.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.