[flashrom] [PATCH] Print lock status for Winbond W39*

Michael Karcher flashrom at mkarcher.dialup.fu-berlin.de
Sun Dec 5 00:06:43 CET 2010


Am Samstag, den 04.12.2010, 05:25 +0100 schrieb Carl-Daniel Hailfinger:
> +static int printlock_w39_wblwp(uint8_t lock)
as discussed on IRC: typo in function name.

> +int printlock_w39v040a(struct flashchip *flash)
> +{
> +	uint8_t lock;
> +	int ret = 0;
> +
> +	/* The W39V040A datasheet contradicts itself on the lock register
> +	 * location: 0x00002 and 0x7fff2 are both mentioned. Pick the one
> +	 * which is similar to the other chips of the same family.
> +	 */
Yes, that sounds sane.
> +	lock = w39_idmode_readb(flash, 0x7fff2);
> +	msg_cdbg("Lockout bits:\n");
> +
> +	ret = printlock_w39_wblwp(lock);
> +	ret |= printlock_w39_bootblock_64k16k(lock);
> +
> +	return ret;
> +}

> +int printlock_w39v040b(struct flashchip *flash)
> +{
> +	return printlock_w39_common(flash, 0x7fff2);
> +}

> +int printlock_w39v040c(struct flashchip *flash)
> +{
> +	return printlock_w39_common(flash, 0xfff2);
> +}
I would guess this is a typo in the datasheet, and should be 0x7fff2
too, OTOH, that datasheet uses that address consistently and that
address was also used in the old code. Still it should be tested on real
hardware, and left the way you have it now.

> +/* Unused because W39V040B and W39V040FB can not be distinguished from each
> + * other based on ID.
> + */
That comment is not true anymore.

> +/* Unused because W39V040C and W39V040FC can not be distinguished from each
> + * other based on ID.
> + */
Dito.

> +int unlock_w39v080fa(struct flashchip *flash)
> +{
> +	if (unlock_w39_fwh(flash))
> +		return -1;
> +	/* The soft bootblock locks may have been deactivated by the unlock
> +	 * above, so check them last.
> +	 */
> +	if (printlock_w39_common(flash, 0xffff2))
> +		return -1;
> +
> +	return 0;
> +}
I don't understand the comment in here: The w39v080fa does not have the
software boot block lock feature if I skimmed over the datasheet
correctly, and the software boot block lock other chips have is
permanent and can not be cleared.

Acked-by: Michael Karcher <flashrom at mkarcher.dialup.fu-berlin.de>

Regards,
  Michael Karcher





More information about the flashrom mailing list