Hello Patrick Rudolph,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/32856
to review the following change.
Change subject: endian.h: Add be32dec/be32enc family of functions
......................................................................
endian.h: Add be32dec/be32enc family of functions
Libpayload has a family of functions that can "encode" or "decode" an
endian-specific integer onto a byte stream pointer. These allow writing
more pretty code than a raw be32_to_cpu/cpu_to_be32 with pointer casts
in many (de-)serialization scenarios, so let's add them to coreboot as
well.
Change-Id: I049c5665484da12b3cf977a529310b0bde177d2d
Signed-off-by: Julius Werner <jwerner(a)chromium.org>
---
M src/include/endian.h
1 file changed, 24 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/56/32856/1
diff --git a/src/include/endian.h b/src/include/endian.h
index 08636f3..4bd30f1 100644
--- a/src/include/endian.h
+++ b/src/include/endian.h
@@ -84,6 +84,30 @@
#define clrbits_8(addr, clear) clrsetbits_8(addr, clear, 0)
#define setbits_8(addr, set) setbits_8(addr, 0, set)
+/* be16dec/be32dec/be64dec/le16dec/le32dec/le64dec family of functions. */
+#define DEFINE_ENDIAN_DEC(endian, width) \
+ static inline uint##width##_t endian##width##dec(const void *p) { \
+ return endian##width##_to_cpu(*(uint##width##_t *)p); \
+ }
+DEFINE_ENDIAN_DEC(be, 16)
+DEFINE_ENDIAN_DEC(be, 32)
+DEFINE_ENDIAN_DEC(be, 64)
+DEFINE_ENDIAN_DEC(le, 16)
+DEFINE_ENDIAN_DEC(le, 32)
+DEFINE_ENDIAN_DEC(le, 64)
+
+/* be16enc/be32enc/be64enc/le16enc/le32enc/le64enc family of functions. */
+#define DEFINE_ENDIAN_ENC(endian, width) \
+ static inline void endian##width##enc(void *p, uint##width##_t u) { \
+ *(uint##width##_t *)p = cpu_to_##endian##width(u); \
+ }
+DEFINE_ENDIAN_ENC(be, 16)
+DEFINE_ENDIAN_ENC(be, 32)
+DEFINE_ENDIAN_ENC(be, 64)
+DEFINE_ENDIAN_ENC(le, 16)
+DEFINE_ENDIAN_ENC(le, 32)
+DEFINE_ENDIAN_ENC(le, 64)
+
#ifndef __ROMCC__
/*
* Portable (API) endian support that can be used in code that is shared
--
To view, visit https://review.coreboot.org/c/coreboot/+/32856
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I049c5665484da12b3cf977a529310b0bde177d2d
Gerrit-Change-Number: 32856
Gerrit-PatchSet: 1
Gerrit-Owner: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Patrick Rudolph <patrick.rudolph(a)9elements.com>
Gerrit-MessageType: newchange
Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/32890
Change subject: mb/asus/p8h61-m_pro: Small fixes
......................................................................
mb/asus/p8h61-m_pro: Small fixes
* Add VBT
* Configure OnBoard NIC
* Add documentation
Change-Id: Iad739b4e1dacb41f5f63247150951df7013bbf0c
Signed-off-by: Patrick Rudolph <patrick.rudolph(a)9elements.com>
---
A Documentation/mainboard/asus/p8h61-m_pro.jpg
A Documentation/mainboard/asus/p8h61-m_pro.md
M Documentation/mainboard/index.md
M src/mainboard/asus/p8h61-m_pro/Kconfig
M src/mainboard/asus/p8h61-m_pro/devicetree.cb
5 files changed, 113 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/32890/1
diff --git a/Documentation/mainboard/asus/p8h61-m_pro.jpg b/Documentation/mainboard/asus/p8h61-m_pro.jpg
new file mode 100644
index 0000000..5023966
--- /dev/null
+++ b/Documentation/mainboard/asus/p8h61-m_pro.jpg
Binary files differ
diff --git a/Documentation/mainboard/asus/p8h61-m_pro.md b/Documentation/mainboard/asus/p8h61-m_pro.md
new file mode 100644
index 0000000..cc53af6
--- /dev/null
+++ b/Documentation/mainboard/asus/p8h61-m_pro.md
@@ -0,0 +1,102 @@
+# ASUS P8H61-M Pro
+
+This page describes how to run coreboot on the [ASUS P8H61-M Pro].
+
+## Flashing coreboot
+
+```eval_rst
++---------------------+------------+
+| Type | Value |
++=====================+============+
+| Socketed flash | yes |
++---------------------+------------+
+| Model | W25Q32BV |
++---------------------+------------+
+| Size | 4 MiB |
++---------------------+------------+
+| Package | DIP-8 |
++---------------------+------------+
+| Write protection | no |
++---------------------+------------+
+| Dual BIOS feature | no |
++---------------------+------------+
+| Internal flashing | yes |
++---------------------+------------+
+```
+
+The flash IC is located right next to one of the SATA ports:
+
+
+### Internal programming
+
+The main SPI flash can be accessed using [flashrom]. By default, only
+the BIOS region of the flash is writable. If you wish to change any
+other region (Management Engine or flash descriptor), then an external
+programmer is required.
+
+The following command may be used to flash coreboot:
+
+```
+$ sudo flashrom --noverify-all --ifd -i bios -p internal -w coreboot.rom
+```
+
+The use of `--noverify-all` is required since the Management Engine
+region is not readable even by the host.
+
+## Known issues
+
+- There is no automatic, OS-independent fan control. This is because
+ the super I/O hardware monitor can only obtain valid CPU temperature
+ readings from the PECI agent, whose complete initialisation is not
+ publicly documented. The `coretemp` driver can still be used for
+ accurate CPU temperature readings.
+
+- me_cleaner breaks LPC bus and attached components!
+
+## Untested
+
+- PCIe graphics
+- parallel port
+- PS/2 keyboard
+- EHCI debug
+- S/PDIF audio
+
+## Working
+
+- USB
+- Gigabit Ethernet
+- Integrated graphics
+- SATA
+- Serial port
+- hardware monitor (see [Known issues](#known-issues) for caveats)
+- front panel audio
+- Native raminit (2 x 2GB, DDR3-1333)
+- Native graphics init (libgfxinit)
+- Wake-on-LAN
+- TPM on TPM-header
+
+## Technology
+
+```eval_rst
++------------------+--------------------------------------------------+
+| Northbridge | :doc:`../../northbridge/intel/sandybridge/index` |
++------------------+--------------------------------------------------+
+| Southbridge | bd82x6x |
++------------------+--------------------------------------------------+
+| CPU | model_206ax |
++------------------+--------------------------------------------------+
+| Super I/O | Nuvoton NCT6776 |
++------------------+--------------------------------------------------+
+| EC | None |
++------------------+--------------------------------------------------+
+| Coprocessor | Intel Management Engine |
++------------------+--------------------------------------------------+
+```
+
+## Extra resources
+
+- [Flash chip datasheet][W25Q32BV]
+
+[ASUS P8H61-M Pro]: https://www.asus.com/Motherboards/P8H61M_Pro/
+[W25Q32BV]: https://www.winbond.com/resource-files/w25q32bv_revi_100413_wo_automotive.p…
+[flashrom]: https://flashrom.org/Flashrom
diff --git a/Documentation/mainboard/index.md b/Documentation/mainboard/index.md
index 9af5c80..20578729 100644
--- a/Documentation/mainboard/index.md
+++ b/Documentation/mainboard/index.md
@@ -6,6 +6,7 @@
- [F2A85-M](asus/f2a85-m.md)
- [P8H61-M LX](asus/p8h61-m_lx.md)
+- [P8H61-M Pro](asus/p8h61-m_pro.md)
## ASRock
diff --git a/src/mainboard/asus/p8h61-m_pro/Kconfig b/src/mainboard/asus/p8h61-m_pro/Kconfig
index 14f841e..e8a6f64 100644
--- a/src/mainboard/asus/p8h61-m_pro/Kconfig
+++ b/src/mainboard/asus/p8h61-m_pro/Kconfig
@@ -31,6 +31,9 @@
select HAVE_CMOS_DEFAULT
select DRIVERS_ASMEDIA_ASPM_BLACKLIST
select MAINBOARD_HAS_LPC_TPM
+ select REALTEK_8168_RESET
+ select RT8168_SET_LED_MODE
+ select INTEL_GMA_HAVE_VBT
config MAINBOARD_DIR
string
diff --git a/src/mainboard/asus/p8h61-m_pro/devicetree.cb b/src/mainboard/asus/p8h61-m_pro/devicetree.cb
index f853452..d3f1795 100644
--- a/src/mainboard/asus/p8h61-m_pro/devicetree.cb
+++ b/src/mainboard/asus/p8h61-m_pro/devicetree.cb
@@ -49,7 +49,13 @@
device pci 1b.0 on end # High Definition Audio Audio controller
device pci 1c.0 on end # PCIe x1 Port (PCIEX1_1)
device pci 1c.1 on end # PCIe x1 Port (PCIEX1_2)
- device pci 1c.2 on end # Realtek RTL8111E Ethernet Controller
+ device pci 1c.2 on # Realtek RTL8111E Ethernet Controller
+ chip drivers/net
+ register "customized_leds" = "0x00f6"
+ register "wake" = "9"
+ device pci 00.0 on end
+ end
+ end
device pci 1c.3 on end # ASMedia ASM1042 USB3 Controller
device pci 1c.4 on end # PCIe x1 Port, x16 size (PCIEX16_2)
device pci 1c.5 on end # ASMedia ASM1062 SATA Controller
--
To view, visit https://review.coreboot.org/c/coreboot/+/32890
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Iad739b4e1dacb41f5f63247150951df7013bbf0c
Gerrit-Change-Number: 32890
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <patrick.rudolph(a)9elements.com>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Patrick Rudolph <patrick.rudolph(a)9elements.com>
Gerrit-MessageType: newchange
Duncan Laurie has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/32775 )
Change subject: post_code: add post code for video initialization failure
......................................................................
post_code: add post code for video initialization failure
Add a new post code POST_VIDEO_FAILURE used when the Intel FSP silicon
initialization returns an error when graphics was also initialized.
BUG=b:124401932
BRANCH=sarien
TEST=build coreboot for sarien and arcada platforms
Change-Id: Ibc7f7defbed34038f445949010a37c8e368aae20
Signed-off-by: Keith Short <keithshort(a)chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/32775
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Patrick Rudolph <siro(a)das-labor.org>
---
M Documentation/POSTCODES
M src/drivers/intel/fsp2_0/silicon_init.c
M src/include/console/post_codes.h
3 files changed, 21 insertions(+), 1 deletion(-)
Approvals:
build bot (Jenkins): Verified
Patrick Rudolph: Looks good to me, approved
diff --git a/Documentation/POSTCODES b/Documentation/POSTCODES
index a9d392a..0e67dd1 100644
--- a/Documentation/POSTCODES
+++ b/Documentation/POSTCODES
@@ -21,6 +21,7 @@
0xe2 Vendor binary (e.g. FSP) generated a fatal error
0xe3 RAM could not be initialized
0xe4 Critical hardware component could not initialize
+0xe5 Video subsystem failed to initialize
0xf8 Entry into elf boot
0xf3 Jumping to payload
diff --git a/src/drivers/intel/fsp2_0/silicon_init.c b/src/drivers/intel/fsp2_0/silicon_init.c
index b0a697d..e9c29db 100644
--- a/src/drivers/intel/fsp2_0/silicon_init.c
+++ b/src/drivers/intel/fsp2_0/silicon_init.c
@@ -18,6 +18,7 @@
#include <fsp/api.h>
#include <fsp/util.h>
#include <program_loading.h>
+#include <soc/intel/common/vbt.h>
#include <stage_cache.h>
#include <string.h>
#include <timestamp.h>
@@ -29,6 +30,7 @@
FSPS_UPD *upd, *supd;
fsp_silicon_init_fn silicon_init;
uint32_t status;
+ uint8_t postcode;
supd = (FSPS_UPD *) (hdr->cfg_region_offset + hdr->image_base);
@@ -59,8 +61,18 @@
/* Handle any errors returned by FspSiliconInit */
fsp_handle_reset(status);
if (status != FSP_SUCCESS) {
+ if (vbt_get()) {
+ /* Attempted to initialize graphics. Assume failure
+ * is related to a video failure.
+ */
+ postcode = POST_VIDEO_FAILURE;
+ } else {
+ /* Other silicon initialization failed */
+ postcode = POST_HW_INIT_FAILURE;
+ }
printk(BIOS_SPEW, "FspSiliconInit returned 0x%08x\n", status);
- die("FspSiliconINit returned an error!\n");
+ die_with_post_code(postcode,
+ "FspSiliconINit returned an error!\n");
}
}
diff --git a/src/include/console/post_codes.h b/src/include/console/post_codes.h
index ae277d8..c1917ad 100644
--- a/src/include/console/post_codes.h
+++ b/src/include/console/post_codes.h
@@ -356,6 +356,13 @@
#define POST_HW_INIT_FAILURE 0xe4
/**
+ * \brief Video failure
+ *
+ * Video subsystem failed to initialize.
+ */
+#define POST_VIDEO_FAILURE 0xe5
+
+/**
* \brief TPM failure
*
* An error with the TPM, either unexepcted state or communications failure.
--
To view, visit https://review.coreboot.org/c/coreboot/+/32775
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ibc7f7defbed34038f445949010a37c8e368aae20
Gerrit-Change-Number: 32775
Gerrit-PatchSet: 14
Gerrit-Owner: Keith Short <keithshort(a)chromium.org>
Gerrit-Reviewer: Duncan Laurie <dlaurie(a)chromium.org>
Gerrit-Reviewer: Jett Rink <jettrink(a)chromium.org>
Gerrit-Reviewer: Keith Short <keithshort(a)chromium.org>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-MessageType: merged