* Michael Karcher <flashrom(a)mkarcher.dialup.fu-berlin.de> [110330 19:00]:
> Reported by: wickberg(a)student.chalmers.se
>
> flashrom -V: http://paste.flashrom.org/view.php?id=452
> lspci: http://paste.flashrom.org/view.php?id=453
>
> (note that the flashrom dump is with a foreign chip. That
> board is originally equipped with an PMC Pm49FL004.
>
> Signed-off-by: Michael Karcher <flashrom(a)mkarcher.dialup.fu-berlin.de>
Acked-by: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Hi!
I have tried to flash my BIOS without success. BIOS flash reading is ok, but
writing does'nt work. Here is the commands output:
$ flashrom -Vw 75i65G_3.30
flashrom v0.9.2-r1028 on Linux 2.6.35-28-generic (x86_64), built with libpci
3.0.0, GCC 4.4.4, little endian
flashrom is free software, get the source code at http://www.flashrom.org
Calibrating delay loop... OS timer resolution is 1 usecs, 2071M loops per
second, 10 myus = 9 us, 100 myus = 90 us, 1000 myus = 898 us, 10000 myus =
8978 us, 4 myus = 3
us, OK.
Initializing internal programmer
No coreboot table found.
DMI string system-manufacturer: "To Be Filled By O.E.M."
DMI string system-product-name: "To Be Filled By O.E.M."
DMI string system-version: "To Be Filled By O.E.M."
DMI string baseboard-manufacturer: " "
DMI string baseboard-product-name: "775i65G."
DMI string baseboard-version: " "
DMI string chassis-type: "Desktop"
Found chipset "Intel ICH5/ICH5R", enabling flash write... chipset PCI ID is
8086:24d0,
BIOS Lock Enable: disabled, BIOS Write Enable: enabled, BIOS_CNTL is 0x1
OK.
This chipset supports the following protocols: Non-SPI.
Found chip "Winbond W39V040B" (512 KB, LPC) at physical address 0xfff80000.
Flash image seems to be a legacy BIOS. Disabling checks.
Writing flash chip... Erasing flash chip... Looking at blockwise erase
function 0... trying... 0x000000-0x00ffff, 0x010000-0x01ffff,
Looking at blockwise erase function 1... trying... 0x000000-0x07ffff,
Looking at blockwise erase function 2... not defined. Looking for another
erase function.
Looking at blockwise erase function 3... not defined. Looking for another
erase function.
Looking at blockwise erase function 4... not defined. Looking for another
erase function.
ERASE FAILED at 0x00013948! Expected=0xff, Read=0x44, failed byte count from
0x00010000-0x0001ffff: 0xc5f5
ERASE FAILED!
ERASE FAILED at 0x00013948! Expected=0xff, Read=0x44, failed byte count from
0x00000000-0x0007ffff: 0x5cf57
ERASE FAILED!
FAILED!
ERASE FAILED!
FAILED!
Your flash chip is in an unknown state.
Get help on IRC at irc.freenode.net (channel #flashrom) or
mail flashrom(a)flashrom.org!
-------------------------------------------------------------------------------
DO NOT REBOOT OR POWEROFF!
I have checked the BIOS content and compared with backup - they are
identical, so I have reboot the PC without any problems.
Am 15.03.2011 16:29 schrieb Stefan Tauner:
> Signed-off-by: Stefan Tauner<stefan.tauner(a)student.tuwien.ac.at>
> ---
> chipdrivers.h | 3 +--
> flashchips.c | 6 ++++--
> spi25.c | 10 +---------
> 3 files changed, 6 insertions(+), 13 deletions(-)
>
> diff --git a/chipdrivers.h b/chipdrivers.h
> index c01ab7a..dc46fe1 100644
> --- a/chipdrivers.h
> +++ b/chipdrivers.h
> @@ -45,13 +45,12 @@ int spi_chip_read(struct flashchip *flash, uint8_t *buf, int start, int len);
> uint8_t spi_read_status_register(void);
> int spi_prettyprint_status_register_at25df(struct flashchip *flash);
> int spi_prettyprint_status_register_at25df_sec(struct flashchip *flash);
> -int spi_prettyprint_status_register_at25f(struct flashchip *flash);
> +int spi_prettyprint_status_register_at25f512b(struct flashchip *flash);
> int spi_prettyprint_status_register_at25fs010(struct flashchip *flash);
> int spi_prettyprint_status_register_at25fs040(struct flashchip *flash);
> int spi_disable_blockprotect(struct flashchip *flash);
> int spi_disable_blockprotect_at25df(struct flashchip *flash);
> int spi_disable_blockprotect_at25df_sec(struct flashchip *flash);
> -int spi_disable_blockprotect_at25f(struct flashchip *flash);
> int spi_disable_blockprotect_at25fs010(struct flashchip *flash);
> int spi_disable_blockprotect_at25fs040(struct flashchip *flash);
> int spi_byte_program(int addr, uint8_t databyte);
> diff --git a/flashchips.c b/flashchips.c
> index 753a094..29a4da0 100644
> --- a/flashchips.c
> +++ b/flashchips.c
> @@ -1612,8 +1612,10 @@ struct flashchip flashchips[] = {
> .block_erase = spi_block_erase_c7,
> }
> },
> - .printlock = spi_prettyprint_status_register_at25f,
> - .unlock = spi_disable_blockprotect_at25f,
> + .printlock = spi_prettyprint_status_register_at25f512b,
> + /* spi_disable_blockprotect_at25df is not really the right way to do
> + * this, but the side effects of said function work here as well. */
>
For disabling block protection of SPI chips we have quite a few
functions where the side effects work just fine, but the comments inside
the function are not correct. Not sure if we have to list this in a
comment here or rather at the top of this unlock function because it is
used for multiple chips.
I see you just wanted to avoid the existing wrapper function and that
sort of makes sense... I'm undecided here.
> + .unlock = spi_disable_blockprotect_at25df,
> .write = spi_chip_write_256,
> .read = spi_chip_read,
> },
> diff --git a/spi25.c b/spi25.c
> index c774032..5d73411 100644
> --- a/spi25.c
> +++ b/spi25.c
> @@ -394,7 +394,7 @@ int spi_prettyprint_status_register_at25df_sec(struct flashchip *flash)
> return spi_prettyprint_status_register_at25df(flash);
> }
>
> -int spi_prettyprint_status_register_at25f(struct flashchip *flash)
> +int spi_prettyprint_status_register_at25f512b(struct flashchip *flash)
>
_at25f was originally intended as generic version usable by more AT25*
chips. I have a conflicting patch for this region, will repost it so we
can discuss how to merge them.
> {
> uint8_t status;
>
> @@ -1123,14 +1123,6 @@ int spi_disable_blockprotect_at25df_sec(struct flashchip *flash)
> return spi_disable_blockprotect_at25df(flash);
> }
>
> -int spi_disable_blockprotect_at25f(struct flashchip *flash)
> -{
> - /* spi_disable_blockprotect_at25df is not really the right way to do
> - * this, but the side effects of said function work here as well.
> - */
> - return spi_disable_blockprotect_at25df(flash);
> -}
> -
> int spi_disable_blockprotect_at25fs010(struct flashchip *flash)
> {
> uint8_t status;
>
--
http://www.hailfinger.org/
Am 15.03.2011 16:29 schrieb Stefan Tauner:
> Signed-off-by: Stefan Tauner<stefan.tauner(a)student.tuwien.ac.at>
>
Thanks for your patch!
> --- a/flash.h
> +++ b/flash.h
> @@ -107,7 +107,9 @@ struct flashchip {
> uint32_t manufacture_id;
> uint32_t model_id;
>
> + /* Total chip size in kilobytes */
>
You can't know that, but we have a pending patch which changes this to
bytes. OTOH, until that patch is applied, your patch makes sense.
> int total_size;
> + /* Page chip size in bytes */
>
page_size will be renamed to max_write_size or something like that.
Until then, a comment like yours makes sense. Please change it to "Chip
page size...".
> int page_size;
> int feature_bits;
>
> @@ -125,7 +127,10 @@ struct flashchip {
> /*
> * Erase blocks and associated erase function. Any chip erase function
> * is stored as chip-sized virtual block together with said function.
> - */
> + * The first one that fits will be chosen, there is currently no way to
> + * influence that behaviour. For testing just comment out the others elements or
>
s/others/other/
80 column limit please.
> + * set the function pointer to NULL.
> + */
>
Missing blank before *.
> struct block_eraser {
> struct eraseblock{
> unsigned int size; /* Eraseblock size */
> --- a/spi25.c
> +++ b/spi25.c
> @@ -314,13 +314,14 @@ uint8_t spi_read_status_register(void)
> /* Prettyprint the status register. Common definitions. */
> static void spi_prettyprint_status_register_welwip(uint8_t status)
> {
> - msg_cdbg("Chip status register: Write Enable Latch (WEL) is "
> + msg_cdbg("Chip status register: Write Enable Latch (WEL/WEN) is "
> "%sset\n", (status& (1<< 1)) ? "" : "not ");
> - msg_cdbg("Chip status register: Write In Progress (WIP/BUSY) is "
> + msg_cdbg("Chip status register: Write In Progress (WIP/BUSY/nRDY) is "
> "%sset\n", (status& (1<< 0)) ? "" : "not ");
> }
>
> -/* Prettyprint the status register. Common definitions. */
> +/* Prettyprint the status register. Common definitions.
> + TODO: parameterize number of protected blocks. */
>
Some chips do not use _common at all, and it may be a good idea to
create a separate function for parameter printing. Hmmm... can you drop
this change for now?
That said, I should repost my detailed locking patch which allows
printing of locking areas as well.
> static void spi_prettyprint_status_register_common(uint8_t status)
> {
> msg_cdbg("Chip status register: Bit 5 / Block Protect 3 (BP3) is "
>
Rest looks OK and will be committed immediately once I have a fixed up
version.
Regards,
Carl-Daniel
--
http://www.hailfinger.org/
Am 15.03.2011 16:29 schrieb Stefan Tauner:
> Signed-off-by: Stefan Tauner<stefan.tauner(a)student.tuwien.ac.at>
>
Looks good at a first glance, I'll compare it with my own old patch
later today.
Regards,
Carl-Daniel
--
http://www.hailfinger.org/