[flashrom] [commit] r1287 - trunk
repository service
svn at flashrom.org
Fri Apr 15 01:43:20 CEST 2011
Author: mkarcher
Date: Fri Apr 15 01:43:19 2011
New Revision: 1287
URL: http://flashrom.org/trac/flashrom/changeset/1287
Log:
Remove erase_chip_stm50flw0x0x
As the comment indicates, that function is not a chip erase function
at all, but a function calling a block eraser in a loop. So it adds
no extra value to what we already have in the block_eraser
infrastructure.
Furthermore, that function assumes a uniform sector size layout, but
is referenced from flash chip with non-uniform sector size layout, which
is just wrong.
Signed-off-by: Michael Karcher <flashrom at mkarcher.dialup.fu-berlin.de>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>
Modified:
trunk/chipdrivers.h
trunk/flashchips.c
trunk/stm50flw0x0x.c
Modified: trunk/chipdrivers.h
==============================================================================
--- trunk/chipdrivers.h Fri Apr 15 01:14:27 2011 (r1286)
+++ trunk/chipdrivers.h Fri Apr 15 01:43:19 2011 (r1287)
@@ -128,7 +128,6 @@
/* stm50flw0x0x.c */
int erase_sector_stm50flw0x0x(struct flashchip *flash, unsigned int block, unsigned int blocksize);
-int erase_chip_stm50flw0x0x(struct flashchip *flash, unsigned int addr, unsigned int blocklen);
int unlock_stm50flw0x0x(struct flashchip *flash);
#endif /* !__CHIPDRIVERS_H__ */
Modified: trunk/flashchips.c
==============================================================================
--- trunk/flashchips.c Fri Apr 15 01:14:27 2011 (r1286)
+++ trunk/flashchips.c Fri Apr 15 01:43:19 2011 (r1287)
@@ -6852,9 +6852,6 @@
}, {
.eraseblocks = { {64 * 1024, 8}, },
.block_erase = erase_block_82802ab,
- }, {
- .eraseblocks = { {512 * 1024, 1} },
- .block_erase = erase_chip_stm50flw0x0x,
}
},
.unlock = unlock_stm50flw0x0x,
@@ -6887,9 +6884,6 @@
}, {
.eraseblocks = { {64 * 1024, 8}, },
.block_erase = erase_block_82802ab,
- }, {
- .eraseblocks = { {512 * 1024, 1} },
- .block_erase = erase_chip_stm50flw0x0x,
}
},
.unlock = unlock_stm50flw0x0x,
@@ -6922,9 +6916,6 @@
}, {
.eraseblocks = { {64 * 1024, 16}, },
.block_erase = erase_block_82802ab,
- }, {
- .eraseblocks = { {1024 * 1024, 1} },
- .block_erase = erase_chip_stm50flw0x0x,
}
},
.unlock = unlock_stm50flw0x0x,
@@ -6957,9 +6948,6 @@
}, {
.eraseblocks = { {64 * 1024, 16}, },
.block_erase = erase_block_82802ab,
- }, {
- .eraseblocks = { {1024 * 1024, 1} },
- .block_erase = erase_chip_stm50flw0x0x,
}
},
.unlock = unlock_stm50flw0x0x,
@@ -6989,9 +6977,6 @@
{16 * 1024, 1},
},
.block_erase = erase_block_82802ab,
- }, {
- .eraseblocks = { {256 * 1024, 1} },
- .block_erase = erase_chip_stm50flw0x0x,
}
},
.unlock = unlock_stm50flw0x0x,
@@ -7016,9 +7001,6 @@
{
.eraseblocks = { {64 * 1024, 32}, },
.block_erase = erase_block_82802ab,
- }, {
- .eraseblocks = { {2 * 1024 * 1024, 1} },
- .block_erase = erase_chip_stm50flw0x0x,
}
},
.unlock = unlock_stm50flw0x0x,
@@ -7043,9 +7025,6 @@
{
.eraseblocks = { {64 * 1024, 8}, },
.block_erase = erase_block_82802ab,
- }, {
- .eraseblocks = { {512 * 1024, 1} },
- .block_erase = erase_chip_stm50flw0x0x,
}
},
.unlock = unlock_stm50flw0x0x,
@@ -7070,9 +7049,6 @@
{
.eraseblocks = { {64 * 1024, 16}, },
.block_erase = erase_block_82802ab,
- }, {
- .eraseblocks = { {1024 * 1024, 1} },
- .block_erase = erase_chip_stm50flw0x0x,
}
},
.unlock = unlock_stm50flw0x0x,
@@ -7103,9 +7079,6 @@
{16 * 1024, 1},
},
.block_erase = erase_block_82802ab,
- }, {
- .eraseblocks = { {2 * 1024 * 1024, 1} },
- .block_erase = erase_chip_stm50flw0x0x,
}
},
.unlock = unlock_stm50flw0x0x,
Modified: trunk/stm50flw0x0x.c
==============================================================================
--- trunk/stm50flw0x0x.c Fri Apr 15 01:14:27 2011 (r1286)
+++ trunk/stm50flw0x0x.c Fri Apr 15 01:43:19 2011 (r1287)
@@ -114,30 +114,3 @@
return 0;
}
-
-/* FIXME: This function is not a real chip erase function. */
-int erase_chip_stm50flw0x0x(struct flashchip *flash, unsigned int addr, unsigned int blocklen)
-{
- int i;
- int total_size = flash->total_size * 1024;
- int page_size = flash->page_size;
-
- if ((addr != 0) || (blocklen != flash->total_size * 1024)) {
- msg_cerr("%s called with incorrect arguments\n",
- __func__);
- return -1;
- }
-
- for (i = 0; i < total_size / page_size; i++) {
- //if (unlock_block_stm50flw0x0x(flash, i * page_size)) {
- // msg_cerr("UNLOCK FAILED!\n");
- // return -1;
- //}
- if (erase_block_82802ab(flash, i * page_size, page_size)) {
- msg_cerr("ERASE FAILED!\n");
- return -1;
- }
- }
-
- return 0;
-}
More information about the flashrom
mailing list