summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeith Hui <buurin@gmail.com>2020-05-12 21:43:58 -0400
committerAngel Pons <th3fanbus@gmail.com>2020-05-19 18:12:29 +0000
commitc7e9a6e15153684672bbadd1fc6baed8247ba0f6 (patch)
treef7951869cb64ce7a2c727e2995d92fccb8eb80cc
parentcc71eb59ccc23799ee009246ab2191121c8b0050 (diff)
downloadflashrom-c7e9a6e15153684672bbadd1fc6baed8247ba0f6.tar.gz
flashrom-c7e9a6e15153684672bbadd1fc6baed8247ba0f6.tar.bz2
flashrom-c7e9a6e15153684672bbadd1fc6baed8247ba0f6.zip
Add board enable for ASUS P3B-F
With this change flashrom can detect, enable and flash on this board both under vendor BIOS and coreboot. Change-Id: I395ff50fbcda8ecdaa26033f0d99b2b0eb42f7ff Signed-off-by: Keith Hui <buurin@gmail.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/41354 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
-rw-r--r--board_enable.c47
-rw-r--r--print.c2
2 files changed, 48 insertions, 1 deletions
diff --git a/board_enable.c b/board_enable.c
index a5980eb3c..9cf01031a 100644
--- a/board_enable.c
+++ b/board_enable.c
@@ -875,6 +875,52 @@ static int board_msi_kt4v(void)
/*
* Suited for:
+ * - ASUS P3B-F
+ *
+ * We are talking to a proprietary device on SMBus: the AS99127F which does
+ * much more than the Winbond W83781D it tries to be compatible with.
+ */
+static int board_asus_p3b_f(void)
+{
+ /*
+ * Find where the SMBus host is. ASUS sets it to 0xE800; coreboot sets it to 0x0F00.
+ */
+ struct pci_dev *dev;
+ uint16_t smbba;
+ uint8_t b;
+
+ dev = pci_dev_find(0x8086, 0x7113); /* Intel PIIX4, PM/SMBus function. */
+ if (!dev) {
+ msg_perr("\nERROR: Intel PIIX4 PM not found.\n");
+ return -1;
+ }
+
+ smbba = pci_read_word(dev, 0x90) & 0xfff0;
+
+ OUTB(0xFF, smbba); /* Clear previous SMBus status. */
+ OUTB(0x48 << 1, smbba + 4);
+ OUTB(0x80, smbba + 3);
+ OUTB(0x80, smbba + 5);
+ OUTB(0x48, smbba + 2);
+
+ /* Wait until SMBus transaction is complete. */
+ b = 0x1;
+ while (b & 0x01) {
+ b = INB(0x80);
+ b = INB(smbba);
+ }
+
+ /* Write failed if any status is set. */
+ if (b & 0x1e) {
+ msg_perr("Failed to write to device.\n");
+ return -1;
+ }
+
+ return 0;
+}
+
+/*
+ * Suited for:
* - ASUS P5A
*
* This is rather nasty code, but there's no way to do this cleanly.
@@ -2354,6 +2400,7 @@ const struct board_match board_matches[] = {
{0x8086, 0x24cc, 0, 0, 0x8086, 0x24c3, 0x1043, 0x1869, "^M6Ne$", NULL, NULL, P3, "ASUS", "M6Ne", 0, NT, intel_ich_gpio43_raise},
{0x8086, 0x7180, 0, 0, 0x8086, 0x7110, 0, 0, "^OPLX-M$", NULL, NULL, P3, "ASUS", "OPLX-M", 0, NT, intel_piix4_gpo18_lower},
{0x8086, 0x7190, 0, 0, 0x8086, 0x7110, 0, 0, "^P2B-N$", NULL, NULL, P3, "ASUS", "P2B-N", 0, OK, intel_piix4_gpo18_lower},
+ {0x8086, 0x7190, 0x1043, 0x8024, 0x8086, 0x7110, 0, 0, "P3B-F", "asus", "p3b-f", P3, "ASUS", "P3B-F", 0, OK, board_asus_p3b_f},
{0x8086, 0x1A30, 0x1043, 0x8025, 0x8086, 0x244B, 0x104D, 0x80F0, NULL, NULL, NULL, P3, "ASUS", "P4B266-LM", 0, OK, intel_ich_gpio21_raise},
{0x8086, 0x1a30, 0x1043, 0x8070, 0x8086, 0x244b, 0x1043, 0x8028, NULL, NULL, NULL, P3, "ASUS", "P4B266", 0, OK, intel_ich_gpio22_raise},
{0x8086, 0x1A30, 0x1043, 0x8088, 0x8086, 0x24C3, 0x1043, 0x8089, NULL, NULL, NULL, P3, "ASUS", "P4B533-E", 0, NT, intel_ich_gpio22_raise},
diff --git a/print.c b/print.c
index 6a7ff5dfd..feca45ecd 100644
--- a/print.c
+++ b/print.c
@@ -667,7 +667,7 @@ const struct board_info boards_known[] = {
B("ASUS", "P2B-N", OK, NULL, NULL),
B("ASUS", "P2E-M", OK, NULL, NULL),
B("ASUS", "P2L97-S", OK, NULL, NULL),
- B("ASUS", "P3B-F", BAD, NULL, "No public report found. Owned by Uwe Hermann <uwe@hermann-uwe.de>. May work now."),
+ B("ASUS", "P3B-F", OK, NULL, "Owned by Uwe Hermann <uwe@hermann-uwe.de>."),
B("ASUS", "P4B266", OK, NULL, NULL),
B("ASUS", "P4B266-LM", OK, "http://esupport.sony.com/US/perl/swu-list.pl?mdl=PCVRX650", NULL),
B("ASUS", "P4B533-E", OK, NULL, NULL),