Skip to content

Commit 7b3480f

Browse files
committed
Merge tag 'for-linus-3.3' of git://git.infradead.org/mtd-2.6
MTD pull for 3.3 * tag 'for-linus-3.3' of git://git.infradead.org/mtd-2.6: (113 commits) mtd: Fix dependency for MTD_DOC200x mtd: do not use mtd->block_markbad directly logfs: do not use 'mtd->block_isbad' directly mtd: introduce mtd_can_have_bb helper mtd: do not use mtd->suspend and mtd->resume directly mtd: do not use mtd->lock, unlock and is_locked directly mtd: do not use mtd->sync directly mtd: harmonize mtd_writev usage mtd: do not use mtd->lock_user_prot_reg directly mtd: mtd->write_user_prot_reg directly mtd: do not use mtd->read_*_prot_reg directly mtd: do not use mtd->get_*_prot_info directly mtd: do not use mtd->read_oob directly mtd: mtdoops: do not use mtd->panic_write directly romfs: do not use mtd->get_unmapped_area directly mtd: do not use mtd->get_unmapped_area directly mtd: do use mtd->point directly mtd: introduce mtd_has_oob helper mtd: mtdcore: export symbols cleanup mtd: clean-up the default_mtd_writev function ... Fix up trivial edit/remove conflict in drivers/staging/spectra/lld_mtd.c
2 parents 1c81065 + b60ef99 commit 7b3480f

File tree

114 files changed

+2764
-1795
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+2764
-1795
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
What: /sys/devices/platform/docg3/f[0-3]_dps[01]_is_keylocked
2+
Date: November 2011
3+
KernelVersion: 3.3
4+
Contact: Robert Jarzmik <[email protected]>
5+
Description:
6+
Show whether the floor (0 to 4), protection area (0 or 1) is
7+
keylocked. Each docg3 chip (or floor) has 2 protection areas,
8+
which can cover any part of it, block aligned, called DPS.
9+
The protection has information embedded whether it blocks reads,
10+
writes or both.
11+
The result is:
12+
0 -> the DPS is not keylocked
13+
1 -> the DPS is keylocked
14+
Users: None identified so far.
15+
16+
What: /sys/devices/platform/docg3/f[0-3]_dps[01]_protection_key
17+
Date: November 2011
18+
KernelVersion: 3.3
19+
Contact: Robert Jarzmik <[email protected]>
20+
Description:
21+
Enter the protection key for the floor (0 to 4), protection area
22+
(0 or 1). Each docg3 chip (or floor) has 2 protection areas,
23+
which can cover any part of it, block aligned, called DPS.
24+
The protection has information embedded whether it blocks reads,
25+
writes or both.
26+
The protection key is a string of 8 bytes (value 0-255).
27+
Entering the correct value toggle the lock, and can be observed
28+
through f[0-3]_dps[01]_is_keylocked.
29+
Possible values are:
30+
- 8 bytes
31+
Typical values are:
32+
- "00000000"
33+
- "12345678"
34+
Users: None identified so far.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
GPIO assisted NAND flash
2+
3+
The GPIO assisted NAND flash uses a memory mapped interface to
4+
read/write the NAND commands and data and GPIO pins for the control
5+
signals.
6+
7+
Required properties:
8+
- compatible : "gpio-control-nand"
9+
- reg : should specify localbus chip select and size used for the chip. The
10+
resource describes the data bus connected to the NAND flash and all accesses
11+
are made in native endianness.
12+
- #address-cells, #size-cells : Must be present if the device has sub-nodes
13+
representing partitions.
14+
- gpios : specifies the gpio pins to control the NAND device. nwp is an
15+
optional gpio and may be set to 0 if not present.
16+
17+
Optional properties:
18+
- bank-width : Width (in bytes) of the device. If not present, the width
19+
defaults to 1 byte.
20+
- chip-delay : chip dependent delay for transferring data from array to
21+
read registers (tR). If not present then a default of 20us is used.
22+
- gpio-control-nand,io-sync-reg : A 64-bit physical address for a read
23+
location used to guard against bus reordering with regards to accesses to
24+
the GPIO's and the NAND flash data bus. If present, then after changing
25+
GPIO state and before and after command byte writes, this register will be
26+
read to ensure that the GPIO accesses have completed.
27+
28+
Examples:
29+
30+
gpio-nand@1,0 {
31+
compatible = "gpio-control-nand";
32+
reg = <1 0x0000 0x2>;
33+
#address-cells = <1>;
34+
#size-cells = <1>;
35+
gpios = <&banka 1 0 /* rdy */
36+
&banka 2 0 /* nce */
37+
&banka 3 0 /* ale */
38+
&banka 4 0 /* cle */
39+
0 /* nwp */>;
40+
41+
partition@0 {
42+
...
43+
};
44+
};

arch/arm/mach-davinci/board-da850-evm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ static void da850_evm_m25p80_notify_add(struct mtd_info *mtd)
127127
size_t retlen;
128128

129129
if (!strcmp(mtd->name, "MAC-Address")) {
130-
mtd->read(mtd, 0, ETH_ALEN, &retlen, mac_addr);
130+
mtd_read(mtd, 0, ETH_ALEN, &retlen, mac_addr);
131131
if (retlen == ETH_ALEN)
132132
pr_info("Read MAC addr from SPI Flash: %pM\n",
133133
mac_addr);

arch/cris/arch-v32/drivers/axisflashmap.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -404,17 +404,16 @@ static int __init init_axis_flash(void)
404404
*/
405405
int blockstat;
406406
do {
407-
blockstat = main_mtd->block_isbad(main_mtd,
408-
ptable_sector);
407+
blockstat = mtd_block_isbad(main_mtd, ptable_sector);
409408
if (blockstat < 0)
410409
ptable_sector = 0; /* read error */
411410
else if (blockstat)
412411
ptable_sector += main_mtd->erasesize;
413412
} while (blockstat && ptable_sector);
414413
#endif
415414
if (ptable_sector) {
416-
main_mtd->read(main_mtd, ptable_sector, PAGESIZE,
417-
&len, page);
415+
mtd_read(main_mtd, ptable_sector, PAGESIZE, &len,
416+
page);
418417
ptable_head = &((struct partitiontable *) page)->head;
419418
}
420419

arch/mips/bcm63xx/boards/board_bcm963xx.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -834,10 +834,13 @@ static struct mtd_partition mtd_partitions[] = {
834834
}
835835
};
836836

837+
static const char *bcm63xx_part_types[] = { "bcm63xxpart", NULL };
838+
837839
static struct physmap_flash_data flash_data = {
838840
.width = 2,
839841
.nr_parts = ARRAY_SIZE(mtd_partitions),
840842
.parts = mtd_partitions,
843+
.part_probe_types = bcm63xx_part_types,
841844
};
842845

843846
static struct resource mtd_resources[] = {

arch/mips/include/asm/mach-bcm63xx/bcm963xx_tag.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#define TAGINFO1_LEN 30 /* Length of vendor information field1 in tag */
1717
#define FLASHLAYOUTVER_LEN 4 /* Length of Flash Layout Version String tag */
1818
#define TAGINFO2_LEN 16 /* Length of vendor information field2 in tag */
19-
#define CRC_LEN 4 /* Length of CRC in bytes */
2019
#define ALTTAGINFO_LEN 54 /* Alternate length for vendor information; Pirelli */
2120

2221
#define NUM_PIRELLI 2
@@ -77,19 +76,19 @@ struct bcm_tag {
7776
/* 192-195: Version flash layout */
7877
char flash_layout_ver[FLASHLAYOUTVER_LEN];
7978
/* 196-199: kernel+rootfs CRC32 */
80-
char fskernel_crc[CRC_LEN];
79+
__u32 fskernel_crc;
8180
/* 200-215: Unused except on Alice Gate where is is information */
8281
char information2[TAGINFO2_LEN];
8382
/* 216-219: CRC32 of image less imagetag (kernel for Alice Gate) */
84-
char image_crc[CRC_LEN];
83+
__u32 image_crc;
8584
/* 220-223: CRC32 of rootfs partition */
86-
char rootfs_crc[CRC_LEN];
85+
__u32 rootfs_crc;
8786
/* 224-227: CRC32 of kernel partition */
88-
char kernel_crc[CRC_LEN];
87+
__u32 kernel_crc;
8988
/* 228-235: Unused at present */
9089
char reserved1[8];
9190
/* 236-239: CRC32 of header excluding last 20 bytes */
92-
char header_crc[CRC_LEN];
91+
__u32 header_crc;
9392
/* 240-255: Unused at present */
9493
char reserved2[16];
9594
};

drivers/mtd/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,14 @@ config MTD_AR7_PARTS
140140
---help---
141141
TI AR7 partitioning support
142142

143+
config MTD_BCM63XX_PARTS
144+
tristate "BCM63XX CFE partitioning support"
145+
depends on BCM63XX
146+
select CRC32
147+
help
148+
This provides partions parsing for BCM63xx devices with CFE
149+
bootloaders.
150+
143151
comment "User Modules And Translation Layers"
144152

145153
config MTD_CHAR

drivers/mtd/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ obj-$(CONFIG_MTD_REDBOOT_PARTS) += redboot.o
1111
obj-$(CONFIG_MTD_CMDLINE_PARTS) += cmdlinepart.o
1212
obj-$(CONFIG_MTD_AFS_PARTS) += afs.o
1313
obj-$(CONFIG_MTD_AR7_PARTS) += ar7part.o
14+
obj-$(CONFIG_MTD_BCM63XX_PARTS) += bcm63xxpart.o
1415

1516
# 'Users' - code which presents functionality to userspace.
1617
obj-$(CONFIG_MTD_CHAR) += mtdchar.o

drivers/mtd/afs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ afs_read_footer(struct mtd_info *mtd, u_int *img_start, u_int *iis_start,
7575
size_t sz;
7676
int ret;
7777

78-
ret = mtd->read(mtd, ptr, sizeof(fs), &sz, (u_char *) &fs);
78+
ret = mtd_read(mtd, ptr, sizeof(fs), &sz, (u_char *)&fs);
7979
if (ret >= 0 && sz != sizeof(fs))
8080
ret = -EINVAL;
8181

@@ -132,7 +132,7 @@ afs_read_iis(struct mtd_info *mtd, struct image_info_struct *iis, u_int ptr)
132132
int ret, i;
133133

134134
memset(iis, 0, sizeof(*iis));
135-
ret = mtd->read(mtd, ptr, sizeof(*iis), &sz, (u_char *) iis);
135+
ret = mtd_read(mtd, ptr, sizeof(*iis), &sz, (u_char *)iis);
136136
if (ret < 0)
137137
goto failed;
138138

drivers/mtd/ar7part.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ static int create_mtd_partitions(struct mtd_info *master,
7373

7474
do { /* Try 10 blocks starting from master->erasesize */
7575
offset = pre_size;
76-
master->read(master, offset,
77-
sizeof(header), &len, (uint8_t *)&header);
76+
mtd_read(master, offset, sizeof(header), &len,
77+
(uint8_t *)&header);
7878
if (!strncmp((char *)&header, "TIENV0.8", 8))
7979
ar7_parts[1].offset = pre_size;
8080
if (header.checksum == LOADER_MAGIC1)
@@ -95,16 +95,16 @@ static int create_mtd_partitions(struct mtd_info *master,
9595
case LOADER_MAGIC1:
9696
while (header.length) {
9797
offset += sizeof(header) + header.length;
98-
master->read(master, offset, sizeof(header),
99-
&len, (uint8_t *)&header);
98+
mtd_read(master, offset, sizeof(header), &len,
99+
(uint8_t *)&header);
100100
}
101101
root_offset = offset + sizeof(header) + 4;
102102
break;
103103
case LOADER_MAGIC2:
104104
while (header.length) {
105105
offset += sizeof(header) + header.length;
106-
master->read(master, offset, sizeof(header),
107-
&len, (uint8_t *)&header);
106+
mtd_read(master, offset, sizeof(header), &len,
107+
(uint8_t *)&header);
108108
}
109109
root_offset = offset + sizeof(header) + 4 + 0xff;
110110
root_offset &= ~(uint32_t)0xff;
@@ -114,8 +114,7 @@ static int create_mtd_partitions(struct mtd_info *master,
114114
break;
115115
}
116116

117-
master->read(master, root_offset,
118-
sizeof(header), &len, (u8 *)&header);
117+
mtd_read(master, root_offset, sizeof(header), &len, (u8 *)&header);
119118
if (header.checksum != SQUASHFS_MAGIC) {
120119
root_offset += master->erasesize - 1;
121120
root_offset &= ~(master->erasesize - 1);

0 commit comments

Comments
 (0)