mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-24 13:44:26 -04:00
Common MTD:
* Add Kconfig option for keeping both the 'master' and 'partition' MTDs
registered as devices. This would really make a better default if we could
do it over, as it allows a lot more flexibility in (1) determining the flash
topology of the system from user-space and (2) adding temporary partitions
at runtime (ioctl(BLKPG)). Unfortunately, this would possibly cause
user-space breakage, as it will cause renumbering of the /dev/mtdX devices.
We'll see if we can change this in the future, as there have already been a
few people looking for this feature, and I know others have just been
working around our current limitations instead of fixing them this way.
* Along with the previous change, add some additional information to sysfs, so
user-space can read the offset of each partition within its master device
SPI NOR:
* add new device tree compatible binding to represent the mostly-compatible
class of SPI NOR flash which can be detected by their extended JEDEC ID
bytes, cutting down the duplication of our ID tables
* misc. new IDs
Various other miscellaneous fixes and changes
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQIcBAABAgAGBQJVN9ypAAoJEFySrpd9RFgtaUQQAKmlCVMrxAKtF6U5jpzf07hA
7ZrcMdUTSwS++dBIAgDl6JSuSGT5KRLrS1FOp60p+VAjbD9VFcRLUUQxahXW1tAh
Dr8a3Akwd+lgIp77bZhWBY35dXmjIJ1GSzo7jdbJMDwAeDd3gBeSFTDoePsrCt6K
0/NPOsQzCFDDr1lwuQh1LzkLLQfVAC3ImNCBm5smvyEfhxXqzC02HOLf8Z9VMGnY
OxM9i0T6Ik3xeaaP/vH91sApmdn598gP5DB5cNr61YrZeVZmEoI4EWlOmagcYVC2
Tef9Ng4YmHGXo65k7XcKRykAVWECYAGr4HKCDZ8tsbvpfdbQMS5wHEgxMsAdvb01
aChcBNxf4w/Mh49fzjZppTlPN25FERRMnXt7CkUqQkqet9uDkD/5RNPl65ermeC7
EKx2MoxnpXrfZ0EkSxqrfdzP0oQx0AqAkbCyLIN42Vbxl7ckFMN3WAPQ2NR2Aaoh
SUiKwwaFFiK+C9qEytj0s+cmKPzsTzeQVYgp9NX64EfVQumqpsfbu6XIPV+FGy2i
DvHvmTEvm4SpqMPSnhkmZ6DFSjuzvQdqzKtDyZmRppxHKgWUsXYdftGPMG0+ZbaG
t4zysWfJG897TMVYLKY9pGqvouMuAVJ4kX1+iZbJc8dr4bwIzXIYuEGPLVv58gUO
KjjlYk91/jFNmBW5anxC
=aIsV
-----END PGP SIGNATURE-----
Merge tag 'for-linus-20150422' of git://git.infradead.org/linux-mtd
Pull MTD updates from Brian Norris:
"Common MTD:
- Add Kconfig option for keeping both the 'master' and 'partition'
MTDs registered as devices. This would really make a better
default if we could do it over, as it allows a lot more flexibility
in (1) determining the flash topology of the system from user-space
and (2) adding temporary partitions at runtime (ioctl(BLKPG)).
Unfortunately, this would possibly cause user-space breakage, as it
will cause renumbering of the /dev/mtdX devices. We'll see if we
can change this in the future, as there have already been a few
people looking for this feature, and I know others have just been
working around our current limitations instead of fixing them this
way.
- Along with the previous change, add some additional information to
sysfs, so user-space can read the offset of each partition within
its master device
SPI NOR:
- add new device tree compatible binding to represent the
mostly-compatible class of SPI NOR flash which can be detected by
their extended JEDEC ID bytes, cutting down the duplication of our
ID tables
- misc. new IDs
Various other miscellaneous fixes and changes"
* tag 'for-linus-20150422' of git://git.infradead.org/linux-mtd: (53 commits)
mtd: spi-nor: Add support for Macronix mx25u6435f serial flash
mtd: spi-nor: Add support for Winbond w25q64dw serial flash
mtd: spi-nor: add support for the Winbond W25X05 flash
mtd: spi-nor: support en25s64 device
mtd: m25p80: bind to "nor-jedec" ID, for auto-detection
Documentation: devicetree: m25p80: add "nor-jedec" binding
mtd: Make MTD tests cancelable
mtd: mtd_oobtest: Fix bitflip_limit usage in test case 3
mtd: docg3: remove invalid __exit annotations
mtd: fsl_ifc_nand: use msecs_to_jiffies for time conversion
mtd: atmel_nand: don't map the ROM table if no pmecc table offset in DT
mtd: atmel_nand: add a definition for the oob reserved bytes
mtd: part: Remove partition overlap checks
mtd: part: Add sysfs variable for offset of partition
mtd: part: Create the master device node when partitioned
mtd: ts5500_flash: Fix typo in MODULE_DESCRIPTION in ts5500_flash.c
mtd: denali: Disable sub-page writes in Denali NAND driver
mtd: pxa3xx_nand: cleanup wait_for_completion handling
mtd: nand: gpmi: Check for scan_bbt() error
mtd: nand: gpmi: fixup return type of wait_for_completion_timeout
...
This commit is contained in:
commit
a62d016cec
42 changed files with 642 additions and 320 deletions
|
|
@ -77,7 +77,7 @@
|
|||
/* ensure we never evaluate anything shorted than an unsigned long
|
||||
* to zero, and ensure we'll never miss the end of an comparison (bjd) */
|
||||
|
||||
#define map_calc_words(map) ((map_bankwidth(map) + (sizeof(unsigned long)-1))/ sizeof(unsigned long))
|
||||
#define map_calc_words(map) ((map_bankwidth(map) + (sizeof(unsigned long)-1)) / sizeof(unsigned long))
|
||||
|
||||
#ifdef CONFIG_MTD_MAP_BANK_WIDTH_8
|
||||
# ifdef map_bankwidth
|
||||
|
|
@ -181,7 +181,7 @@ static inline int map_bankwidth_supported(int w)
|
|||
}
|
||||
}
|
||||
|
||||
#define MAX_MAP_LONGS ( ((MAX_MAP_BANKWIDTH*8) + BITS_PER_LONG - 1) / BITS_PER_LONG )
|
||||
#define MAX_MAP_LONGS (((MAX_MAP_BANKWIDTH * 8) + BITS_PER_LONG - 1) / BITS_PER_LONG)
|
||||
|
||||
typedef union {
|
||||
unsigned long x[MAX_MAP_LONGS];
|
||||
|
|
@ -264,20 +264,22 @@ void unregister_mtd_chip_driver(struct mtd_chip_driver *);
|
|||
struct mtd_info *do_map_probe(const char *name, struct map_info *map);
|
||||
void map_destroy(struct mtd_info *mtd);
|
||||
|
||||
#define ENABLE_VPP(map) do { if(map->set_vpp) map->set_vpp(map, 1); } while(0)
|
||||
#define DISABLE_VPP(map) do { if(map->set_vpp) map->set_vpp(map, 0); } while(0)
|
||||
#define ENABLE_VPP(map) do { if (map->set_vpp) map->set_vpp(map, 1); } while (0)
|
||||
#define DISABLE_VPP(map) do { if (map->set_vpp) map->set_vpp(map, 0); } while (0)
|
||||
|
||||
#define INVALIDATE_CACHED_RANGE(map, from, size) \
|
||||
do { if(map->inval_cache) map->inval_cache(map, from, size); } while(0)
|
||||
do { if (map->inval_cache) map->inval_cache(map, from, size); } while (0)
|
||||
|
||||
|
||||
static inline int map_word_equal(struct map_info *map, map_word val1, map_word val2)
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<map_words(map); i++) {
|
||||
|
||||
for (i = 0; i < map_words(map); i++) {
|
||||
if (val1.x[i] != val2.x[i])
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
@ -286,9 +288,9 @@ static inline map_word map_word_and(struct map_info *map, map_word val1, map_wor
|
|||
map_word r;
|
||||
int i;
|
||||
|
||||
for (i=0; i<map_words(map); i++) {
|
||||
for (i = 0; i < map_words(map); i++)
|
||||
r.x[i] = val1.x[i] & val2.x[i];
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
|
|
@ -297,9 +299,9 @@ static inline map_word map_word_clr(struct map_info *map, map_word val1, map_wor
|
|||
map_word r;
|
||||
int i;
|
||||
|
||||
for (i=0; i<map_words(map); i++) {
|
||||
for (i = 0; i < map_words(map); i++)
|
||||
r.x[i] = val1.x[i] & ~val2.x[i];
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
|
|
@ -308,22 +310,33 @@ static inline map_word map_word_or(struct map_info *map, map_word val1, map_word
|
|||
map_word r;
|
||||
int i;
|
||||
|
||||
for (i=0; i<map_words(map); i++) {
|
||||
for (i = 0; i < map_words(map); i++)
|
||||
r.x[i] = val1.x[i] | val2.x[i];
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
#define map_word_andequal(m, a, b, z) map_word_equal(m, z, map_word_and(m, a, b))
|
||||
static inline int map_word_andequal(struct map_info *map, map_word val1, map_word val2, map_word val3)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < map_words(map); i++) {
|
||||
if ((val1.x[i] & val2.x[i]) != val3.x[i])
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static inline int map_word_bitsset(struct map_info *map, map_word val1, map_word val2)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i=0; i<map_words(map); i++) {
|
||||
for (i = 0; i < map_words(map); i++) {
|
||||
if (val1.x[i] & val2.x[i])
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -355,14 +368,16 @@ static inline map_word map_word_load_partial(struct map_info *map, map_word orig
|
|||
|
||||
if (map_bankwidth_is_large(map)) {
|
||||
char *dest = (char *)&orig;
|
||||
|
||||
memcpy(dest+start, buf, len);
|
||||
} else {
|
||||
for (i=start; i < start+len; i++) {
|
||||
for (i = start; i < start+len; i++) {
|
||||
int bitpos;
|
||||
|
||||
#ifdef __LITTLE_ENDIAN
|
||||
bitpos = i*8;
|
||||
bitpos = i * 8;
|
||||
#else /* __BIG_ENDIAN */
|
||||
bitpos = (map_bankwidth(map)-1-i)*8;
|
||||
bitpos = (map_bankwidth(map) - 1 - i) * 8;
|
||||
#endif
|
||||
orig.x[0] &= ~(0xff << bitpos);
|
||||
orig.x[0] |= (unsigned long)buf[i-start] << bitpos;
|
||||
|
|
@ -384,9 +399,10 @@ static inline map_word map_word_ff(struct map_info *map)
|
|||
|
||||
if (map_bankwidth(map) < MAP_FF_LIMIT) {
|
||||
int bw = 8 * map_bankwidth(map);
|
||||
|
||||
r.x[0] = (1UL << bw) - 1;
|
||||
} else {
|
||||
for (i=0; i<map_words(map); i++)
|
||||
for (i = 0; i < map_words(map); i++)
|
||||
r.x[i] = ~0UL;
|
||||
}
|
||||
return r;
|
||||
|
|
@ -407,7 +423,7 @@ static inline map_word inline_map_read(struct map_info *map, unsigned long ofs)
|
|||
r.x[0] = __raw_readq(map->virt + ofs);
|
||||
#endif
|
||||
else if (map_bankwidth_is_large(map))
|
||||
memcpy_fromio(r.x, map->virt+ofs, map->bankwidth);
|
||||
memcpy_fromio(r.x, map->virt + ofs, map->bankwidth);
|
||||
else
|
||||
BUG();
|
||||
|
||||
|
|
|
|||
|
|
@ -155,6 +155,8 @@ enum spi_nor_option_flags {
|
|||
* @write: [DRIVER-SPECIFIC] write data to the SPI NOR
|
||||
* @erase: [DRIVER-SPECIFIC] erase a sector of the SPI NOR
|
||||
* at the offset @offs
|
||||
* @lock: [FLASH-SPECIFIC] lock a region of the SPI NOR
|
||||
* @unlock: [FLASH-SPECIFIC] unlock a region of the SPI NOR
|
||||
* @priv: the private data
|
||||
*/
|
||||
struct spi_nor {
|
||||
|
|
@ -189,6 +191,9 @@ struct spi_nor {
|
|||
size_t len, size_t *retlen, const u_char *write_buf);
|
||||
int (*erase)(struct spi_nor *nor, loff_t offs);
|
||||
|
||||
int (*flash_lock)(struct spi_nor *nor, loff_t ofs, uint64_t len);
|
||||
int (*flash_unlock)(struct spi_nor *nor, loff_t ofs, uint64_t len);
|
||||
|
||||
void *priv;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue