Author: stefanct
Date: Sat Jun 11 20:16:50 2011
New Revision: 1332
URL: http://flashrom.org/trac/flashrom/changeset/1332
Log:
enable_flash_ich: warn if SMM BIOS Write Protection is detected in BIOS_CNTL
Signed-off-by: Stefan Tauner <stefan.tauner(a)student.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006(a)gmx.net>
Modified:
trunk/chipset_enable.c
Modified: trunk/chipset_enable.c
==============================================================================
--- trunk/chipset_enable.c Sat Jun 11 14:21:37 2011 (r1331)
+++ trunk/chipset_enable.c Sat Jun 11 20:16:50 2011 (r1332)
@@ -264,8 +264,17 @@
(old & (1 << 0)) ? "en" : "dis");
msg_pdbg("BIOS_CNTL is 0x%x\n", old);
- new = old | 1;
+ /*
+ * Quote from the 6 Series datasheet (Document Number: 324645-004):
+ * "Bit 5: SMM BIOS Write Protect Disable (SMM_BWP)
+ * 1 = BIOS region SMM protection is enabled.
+ * The BIOS Region is not writable unless all processors are in SMM."
+ * In earlier chipsets this bit is reserved. */
+ if (old & (1 << 5)) {
+ msg_pinfo("WARNING: BIOS region SMM protection is enabled!\n");
+ }
+ new = old | 1;
if (new == old)
return 0;
One additional comment...
Am 08.06.2011 04:55 schrieb Stefan Tauner:
> - introduce offset macros and use them to (re)define the existing mask macros
> - add comments
> - rename SSFS_CDS to SSFS_FDONE (abbr. used in datasheet not in SSFS but HSFS)
> - use those for refactoring and magic number elemination.
> - following patch uses them for pretty printing
>
> --- a/ichspi.c
> +++ b/ichspi.c
> @@ -709,8 +721,8 @@ static int ich9_run_opcode(OPCODE op, uint32_t offset,
> temp32 = REGREAD32(ICH9_REG_SSFS);
> /* Keep reserved bits only */
> temp32 &= SSFS_RESERVED_MASK | SSFC_RESERVED_MASK;
> - /* clear error status registers */
> - temp32 |= (SSFS_CDS + SSFS_FCERR);
> + /* Clear cycle done and cycle error status registers */
> + temp32 |= (SSFS_FDONE + SSFS_FCERR);
>
Please use | instead of + here.
> REGWRITE32(ICH9_REG_SSFS, temp32);
>
> /* Use 20 MHz */
>
Regards,
Carl-Daniel
--
http://www.hailfinger.org/