mtd: spi-nor: use SNOR_MFR_* instead of CFI_MFR_*
No functional change, just cosmetic. Signed-off-by: Brian Norris <computersforpeace@gmail.com>
This commit is contained in:
parent
db4745edb2
commit
f0d2448e9a
1 changed files with 11 additions and 12 deletions
|
@ -18,7 +18,6 @@
|
||||||
#include <linux/math64.h>
|
#include <linux/math64.h>
|
||||||
#include <linux/sizes.h>
|
#include <linux/sizes.h>
|
||||||
|
|
||||||
#include <linux/mtd/cfi.h>
|
|
||||||
#include <linux/mtd/mtd.h>
|
#include <linux/mtd/mtd.h>
|
||||||
#include <linux/of_platform.h>
|
#include <linux/of_platform.h>
|
||||||
#include <linux/spi/flash.h>
|
#include <linux/spi/flash.h>
|
||||||
|
@ -191,11 +190,11 @@ static inline int set_4byte(struct spi_nor *nor, const struct flash_info *info,
|
||||||
u8 cmd;
|
u8 cmd;
|
||||||
|
|
||||||
switch (JEDEC_MFR(info)) {
|
switch (JEDEC_MFR(info)) {
|
||||||
case CFI_MFR_ST: /* Micron, actually */
|
case SNOR_MFR_MICRON:
|
||||||
/* Some Micron need WREN command; all will accept it */
|
/* Some Micron need WREN command; all will accept it */
|
||||||
need_wren = true;
|
need_wren = true;
|
||||||
case CFI_MFR_MACRONIX:
|
case SNOR_MFR_MACRONIX:
|
||||||
case 0xEF /* winbond */:
|
case SNOR_MFR_WINBOND:
|
||||||
if (need_wren)
|
if (need_wren)
|
||||||
write_enable(nor);
|
write_enable(nor);
|
||||||
|
|
||||||
|
@ -998,14 +997,14 @@ static int set_quad_mode(struct spi_nor *nor, const struct flash_info *info)
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
switch (JEDEC_MFR(info)) {
|
switch (JEDEC_MFR(info)) {
|
||||||
case CFI_MFR_MACRONIX:
|
case SNOR_MFR_MACRONIX:
|
||||||
status = macronix_quad_enable(nor);
|
status = macronix_quad_enable(nor);
|
||||||
if (status) {
|
if (status) {
|
||||||
dev_err(nor->dev, "Macronix quad-read not enabled\n");
|
dev_err(nor->dev, "Macronix quad-read not enabled\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
case CFI_MFR_ST:
|
case SNOR_MFR_MICRON:
|
||||||
status = micron_quad_enable(nor);
|
status = micron_quad_enable(nor);
|
||||||
if (status) {
|
if (status) {
|
||||||
dev_err(nor->dev, "Micron quad-read not enabled\n");
|
dev_err(nor->dev, "Micron quad-read not enabled\n");
|
||||||
|
@ -1085,9 +1084,9 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode)
|
||||||
* up with the software protection bits set
|
* up with the software protection bits set
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (JEDEC_MFR(info) == CFI_MFR_ATMEL ||
|
if (JEDEC_MFR(info) == SNOR_MFR_ATMEL ||
|
||||||
JEDEC_MFR(info) == CFI_MFR_INTEL ||
|
JEDEC_MFR(info) == SNOR_MFR_INTEL ||
|
||||||
JEDEC_MFR(info) == CFI_MFR_SST) {
|
JEDEC_MFR(info) == SNOR_MFR_SST) {
|
||||||
write_enable(nor);
|
write_enable(nor);
|
||||||
write_sr(nor, 0);
|
write_sr(nor, 0);
|
||||||
}
|
}
|
||||||
|
@ -1102,8 +1101,8 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode)
|
||||||
mtd->_erase = spi_nor_erase;
|
mtd->_erase = spi_nor_erase;
|
||||||
mtd->_read = spi_nor_read;
|
mtd->_read = spi_nor_read;
|
||||||
|
|
||||||
/* nor protection support for STmicro chips */
|
/* NOR protection support for STmicro/Micron chips */
|
||||||
if (JEDEC_MFR(info) == CFI_MFR_ST) {
|
if (JEDEC_MFR(info) == SNOR_MFR_MICRON) {
|
||||||
nor->flash_lock = stm_lock;
|
nor->flash_lock = stm_lock;
|
||||||
nor->flash_unlock = stm_unlock;
|
nor->flash_unlock = stm_unlock;
|
||||||
}
|
}
|
||||||
|
@ -1197,7 +1196,7 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode)
|
||||||
else if (mtd->size > 0x1000000) {
|
else if (mtd->size > 0x1000000) {
|
||||||
/* enable 4-byte addressing if the device exceeds 16MiB */
|
/* enable 4-byte addressing if the device exceeds 16MiB */
|
||||||
nor->addr_width = 4;
|
nor->addr_width = 4;
|
||||||
if (JEDEC_MFR(info) == CFI_MFR_AMD) {
|
if (JEDEC_MFR(info) == SNOR_MFR_SPANSION) {
|
||||||
/* Dedicated 4-byte command set */
|
/* Dedicated 4-byte command set */
|
||||||
switch (nor->flash_read) {
|
switch (nor->flash_read) {
|
||||||
case SPI_NOR_QUAD:
|
case SPI_NOR_QUAD:
|
||||||
|
|
Loading…
Add table
Reference in a new issue