diff --git a/MAINTAINERS b/MAINTAINERS index 9096c64d8d099b3e738a664587673186efcfc07b..2f98a4ba2c3fa692a5c2f968e912173a6321c79f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8824,8 +8824,7 @@ S: Supported Q: http://patchwork.ozlabs.org/project/linux-mtd/list/ C: irc://irc.oftc.net/mtd T: git git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git cfi/next -F: Documentation/devicetree/bindings/mtd/cypress,hyperflash.txt -F: Documentation/devicetree/bindings/mtd/ti,am654-hbmc.txt +F: Documentation/devicetree/bindings/mtd/ti,am654-hbmc.yaml F: drivers/mtd/hyperbus/ F: include/linux/mtd/hyperbus.h @@ -15804,6 +15803,14 @@ S: Maintained F: Documentation/devicetree/bindings/regulator/vqmmc-ipq4019-regulator.yaml F: drivers/regulator/vqmmc-ipq4019-regulator.c +QUALCOMM NAND CONTROLLER DRIVER +M: Manivannan Sadhasivam +L: linux-mtd@lists.infradead.org +L: linux-arm-msm@vger.kernel.org +S: Maintained +F: Documentation/devicetree/bindings/mtd/qcom,nandc.yaml +F: drivers/mtd/nand/raw/qcom_nandc.c + QUALCOMM RMNET DRIVER M: Subash Abhinov Kasiviswanathan M: Sean Tranchetti @@ -17903,6 +17910,7 @@ W: http://www.linux-mtd.infradead.org/ Q: http://patchwork.ozlabs.org/project/linux-mtd/list/ C: irc://irc.oftc.net/mtd T: git git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git spi-nor/next +F: Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml F: drivers/mtd/spi-nor/ F: include/linux/mtd/spi-nor.h diff --git a/drivers/mtd/chips/Kconfig b/drivers/mtd/chips/Kconfig index aef14990e5f7cfc6c0e115f66a6047e03e4edf9a..19726ebd973d0bbde3d118688401baedc1169f76 100644 --- a/drivers/mtd/chips/Kconfig +++ b/drivers/mtd/chips/Kconfig @@ -55,12 +55,14 @@ choice LITTLE_ENDIAN_BYTE, if the bytes are reversed. config MTD_CFI_NOSWAP + depends on !ARCH_IXP4XX || CPU_BIG_ENDIAN bool "NO" config MTD_CFI_BE_BYTE_SWAP bool "BIG_ENDIAN_BYTE" config MTD_CFI_LE_BYTE_SWAP + depends on !ARCH_IXP4XX bool "LITTLE_ENDIAN_BYTE" endchoice diff --git a/drivers/mtd/devices/block2mtd.c b/drivers/mtd/devices/block2mtd.c index c08721b11642be1fbee5fed6601884106dbd3953..40d7211485da24af0f59834e2d8add3967315cf7 100644 --- a/drivers/mtd/devices/block2mtd.c +++ b/drivers/mtd/devices/block2mtd.c @@ -31,6 +31,9 @@ #include #include +/* Maximum number of comma-separated items in the 'block2mtd=' parameter */ +#define BLOCK2MTD_PARAM_MAX_COUNT 3 + /* Info for the block device */ struct block2mtd_dev { struct list_head list; @@ -214,7 +217,7 @@ static void block2mtd_free_device(struct block2mtd_dev *dev) static struct block2mtd_dev *add_device(char *devname, int erase_size, - int timeout) + char *label, int timeout) { #ifndef MODULE int i; @@ -278,7 +281,10 @@ static struct block2mtd_dev *add_device(char *devname, int erase_size, /* Setup the MTD structure */ /* make the name contain the block device in */ - name = kasprintf(GFP_KERNEL, "block2mtd: %s", devname); + if (!label) + name = kasprintf(GFP_KERNEL, "block2mtd: %s", devname); + else + name = kstrdup(label, GFP_KERNEL); if (!name) goto err_destroy_mutex; @@ -305,7 +311,7 @@ static struct block2mtd_dev *add_device(char *devname, int erase_size, list_add(&dev->list, &blkmtd_device_list); pr_info("mtd%d: [%s] erase_size = %dKiB [%d]\n", dev->mtd.index, - dev->mtd.name + strlen("block2mtd: "), + label ? label : dev->mtd.name + strlen("block2mtd: "), dev->mtd.erasesize >> 10, dev->mtd.erasesize); return dev; @@ -381,8 +387,9 @@ static int block2mtd_setup2(const char *val) /* 80 for device, 12 for erase size, 80 for name, 8 for timeout */ char buf[80 + 12 + 80 + 8]; char *str = buf; - char *token[2]; + char *token[BLOCK2MTD_PARAM_MAX_COUNT]; char *name; + char *label = NULL; size_t erase_size = PAGE_SIZE; unsigned long timeout = MTD_DEFAULT_TIMEOUT; int i, ret; @@ -395,7 +402,7 @@ static int block2mtd_setup2(const char *val) strcpy(str, val); kill_final_newline(str); - for (i = 0; i < 2; i++) + for (i = 0; i < BLOCK2MTD_PARAM_MAX_COUNT; i++) token[i] = strsep(&str, ","); if (str) { @@ -414,7 +421,8 @@ static int block2mtd_setup2(const char *val) return 0; } - if (token[1]) { + /* Optional argument when custom label is used */ + if (token[1] && strlen(token[1])) { ret = parse_num(&erase_size, token[1]); if (ret) { pr_err("illegal erase size\n"); @@ -422,7 +430,12 @@ static int block2mtd_setup2(const char *val) } } - add_device(name, erase_size, timeout); + if (token[2]) { + label = token[2]; + pr_info("Using custom MTD label '%s' for dev %s\n", label, name); + } + + add_device(name, erase_size, label, timeout); return 0; } @@ -456,7 +469,7 @@ static int block2mtd_setup(const char *val, const struct kernel_param *kp) module_param_call(block2mtd, block2mtd_setup, NULL, NULL, 0200); -MODULE_PARM_DESC(block2mtd, "Device to use. \"block2mtd=[,]\""); +MODULE_PARM_DESC(block2mtd, "Device to use. \"block2mtd=[,[][,