Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c29aa153 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'for-linus-20140405' of git://git.infradead.org/linux-mtd

Pull MTD updates from Brian Norris:
 - A few SPI NOR ID definitions
 - Kill the NAND "max pagesize" restriction
 - Fix some x16 bus-width NAND support
 - Add NAND JEDEC parameter page support
 - DT bindings for NAND ECC
 - GPMI NAND updates (subpage reads)
 - More OMAP NAND refactoring
 - New STMicro SPI NOR driver (now in 40 patches!)
 - A few other random bugfixes

* tag 'for-linus-20140405' of git://git.infradead.org/linux-mtd: (120 commits)
  Fix index regression in nand_read_subpage
  mtd: diskonchip: mem resource name is not optional
  mtd: nand: fix mention to CONFIG_MTD_NAND_ECC_BCH
  mtd: nand: fix GET/SET_FEATURES address on 16-bit devices
  mtd: omap2: Use devm_ioremap_resource()
  mtd: denali_dt: Use devm_ioremap_resource()
  mtd: devices: elm: update DRIVER_NAME as "omap-elm"
  mtd: devices: elm: configure parallel channels based on ecc_steps
  mtd: devices: elm: clean elm_load_syndrome
  mtd: devices: elm: check for hardware engine's design constraints
  mtd: st_spi_fsm: Succinctly reorganise .remove()
  mtd: st_spi_fsm: Allow loop to run at least once before giving up CPU
  mtd: st_spi_fsm: Correct vendor name spelling issue - missing "M"
  mtd: st_spi_fsm: Avoid duplicating MTD core code
  mtd: st_spi_fsm: Remove useless consts from function arguments
  mtd: st_spi_fsm: Convert ST SPI FSM (NOR) Flash driver to new DT partitions
  mtd: st_spi_fsm: Move runtime configurable msg sequences into device's struct
  mtd: st_spi_fsm: Supply the W25Qxxx chip specific configuration call-back
  mtd: st_spi_fsm: Supply the S25FLxxx chip specific configuration call-back
  mtd: st_spi_fsm: Supply the MX25xxx chip specific configuration call-back
  ...
parents 2b3a8fd7 4a4163ca
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -5,3 +5,17 @@
  "soft_bch".
- nand-bus-width : 8 or 16 bus width if not present 8
- nand-on-flash-bbt: boolean to enable on flash bbt option if not present false

- nand-ecc-strength: integer representing the number of bits to correct
		     per ECC step.

- nand-ecc-step-size: integer representing the number of data bytes
		      that are covered by a single ECC step.

The ECC strength and ECC step size properties define the correction capability
of a controller. Together, they say a controller can correct "{strength} bit
errors per {size} bytes".

The interpretation of these parameters is implementation-defined, so not all
implementations must support all possible combinations. However, implementations
are encouraged to further specify the value(s) they support.
+26 −0
Original line number Diff line number Diff line
* ST-Microelectronics SPI FSM Serial (NOR) Flash Controller

Required properties:
  - compatible : Should be "st,spi-fsm"
  - reg        : Contains register's location and length.
  - reg-names  : Should contain the reg names "spi-fsm"
  - interrupts : The interrupt number
  - pinctrl-0  : Standard Pinctrl phandle (see: pinctrl/pinctrl-bindings.txt)

Optional properties:
  - st,syscfg          : Phandle to boot-device system configuration registers
  - st,boot-device-reg : Address of the aforementioned boot-device register(s)
  - st,boot-device-spi : Expected boot-device value if booted via this device

Example:
	spifsm: spifsm@fe902000{
	        compatible         = "st,spi-fsm";
	        reg                =  <0xfe902000 0x1000>;
	        reg-names          = "spi-fsm";
	        pinctrl-0          = <&pinctrl_fsm>;
		st,syscfg	   = <&syscfg_rear>;
	        st,boot-device-reg = <0x958>;
	        st,boot-device-spi = <0x1a>;
		status = "okay";
	};
+1 −1
Original line number Diff line number Diff line
@@ -150,7 +150,7 @@ config MTD_BCM63XX_PARTS

config MTD_BCM47XX_PARTS
	tristate "BCM47XX partitioning support"
	depends on BCM47XX
	depends on BCM47XX || ARCH_BCM_5301X
	help
	  This provides partitions parser for devices based on BCM47xx
	  boards.
+8 −3
Original line number Diff line number Diff line
@@ -14,7 +14,6 @@
#include <linux/slab.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <bcm47xx_nvram.h>

/* 10 parts were found on sflash on Netgear WNDR4500 */
#define BCM47XXPART_MAX_PARTS		12
@@ -30,6 +29,7 @@
#define BOARD_DATA_MAGIC2		0xBD0D0BBD
#define CFE_MAGIC			0x43464531	/* 1EFC */
#define FACTORY_MAGIC			0x59544346	/* FCTY */
#define NVRAM_HEADER			0x48534C46	/* FLSH */
#define POT_MAGIC1			0x54544f50	/* POTT */
#define POT_MAGIC2			0x504f		/* OP */
#define ML_MAGIC1			0x39685a42
@@ -91,7 +91,7 @@ static int bcm47xxpart_parse(struct mtd_info *master,
		if (offset >= 0x2000000)
			break;

		if (curr_part > BCM47XXPART_MAX_PARTS) {
		if (curr_part >= BCM47XXPART_MAX_PARTS) {
			pr_warn("Reached maximum number of partitions, scanning stopped!\n");
			break;
		}
@@ -147,6 +147,11 @@ static int bcm47xxpart_parse(struct mtd_info *master,

		/* TRX */
		if (buf[0x000 / 4] == TRX_MAGIC) {
			if (BCM47XXPART_MAX_PARTS - curr_part < 4) {
				pr_warn("Not enough partitions left to register trx, scanning stopped!\n");
				break;
			}

			trx = (struct trx_header *)buf;

			trx_part = curr_part;
@@ -212,7 +217,7 @@ static int bcm47xxpart_parse(struct mtd_info *master,

	/* Look for NVRAM at the end of the last block. */
	for (i = 0; i < ARRAY_SIZE(possible_nvram_sizes); i++) {
		if (curr_part > BCM47XXPART_MAX_PARTS) {
		if (curr_part >= BCM47XXPART_MAX_PARTS) {
			pr_warn("Reached maximum number of partitions, scanning stopped!\n");
			break;
		}
+15 −25
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/init.h>
#include <asm/io.h>
#include <asm/byteorder.h>

@@ -69,10 +68,10 @@ static int cfi_intelext_read_fact_prot_reg (struct mtd_info *, loff_t, size_t, s
static int cfi_intelext_read_user_prot_reg (struct mtd_info *, loff_t, size_t, size_t *, u_char *);
static int cfi_intelext_write_user_prot_reg (struct mtd_info *, loff_t, size_t, size_t *, u_char *);
static int cfi_intelext_lock_user_prot_reg (struct mtd_info *, loff_t, size_t);
static int cfi_intelext_get_fact_prot_info (struct mtd_info *,
					    struct otp_info *, size_t);
static int cfi_intelext_get_user_prot_info (struct mtd_info *,
					    struct otp_info *, size_t);
static int cfi_intelext_get_fact_prot_info(struct mtd_info *, size_t,
					   size_t *, struct otp_info *);
static int cfi_intelext_get_user_prot_info(struct mtd_info *, size_t,
					   size_t *, struct otp_info *);
#endif
static int cfi_intelext_suspend (struct mtd_info *);
static void cfi_intelext_resume (struct mtd_info *);
@@ -435,10 +434,8 @@ struct mtd_info *cfi_cmdset_0001(struct map_info *map, int primary)
	int i;

	mtd = kzalloc(sizeof(*mtd), GFP_KERNEL);
	if (!mtd) {
		printk(KERN_ERR "Failed to allocate memory for MTD device\n");
	if (!mtd)
		return NULL;
	}
	mtd->priv = map;
	mtd->type = MTD_NORFLASH;

@@ -564,10 +561,8 @@ static struct mtd_info *cfi_intelext_setup(struct mtd_info *mtd)
	mtd->numeraseregions = cfi->cfiq->NumEraseRegions * cfi->numchips;
	mtd->eraseregions = kmalloc(sizeof(struct mtd_erase_region_info)
			* mtd->numeraseregions, GFP_KERNEL);
	if (!mtd->eraseregions) {
		printk(KERN_ERR "Failed to allocate memory for MTD erase region info\n");
	if (!mtd->eraseregions)
		goto setup_err;
	}

	for (i=0; i<cfi->cfiq->NumEraseRegions; i++) {
		unsigned long ernum, ersize;
@@ -2399,24 +2394,19 @@ static int cfi_intelext_lock_user_prot_reg(struct mtd_info *mtd,
				     NULL, do_otp_lock, 1);
}

static int cfi_intelext_get_fact_prot_info(struct mtd_info *mtd,
					   struct otp_info *buf, size_t len)
{
	size_t retlen;
	int ret;
static int cfi_intelext_get_fact_prot_info(struct mtd_info *mtd, size_t len,
					   size_t *retlen, struct otp_info *buf)

	ret = cfi_intelext_otp_walk(mtd, 0, len, &retlen, (u_char *)buf, NULL, 0);
	return ret ? : retlen;
{
	return cfi_intelext_otp_walk(mtd, 0, len, retlen, (u_char *)buf,
				     NULL, 0);
}

static int cfi_intelext_get_user_prot_info(struct mtd_info *mtd,
					   struct otp_info *buf, size_t len)
static int cfi_intelext_get_user_prot_info(struct mtd_info *mtd, size_t len,
					   size_t *retlen, struct otp_info *buf)
{
	size_t retlen;
	int ret;

	ret = cfi_intelext_otp_walk(mtd, 0, len, &retlen, (u_char *)buf, NULL, 1);
	return ret ? : retlen;
	return cfi_intelext_otp_walk(mtd, 0, len, retlen, (u_char *)buf,
				     NULL, 1);
}

#endif
Loading