Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/9197
-gerrit
commit e599c3357e3267129af6280750b2370dfb140518
Author: Kane Chen <kane.chen(a)intel.com>
Date: Tue Sep 9 15:53:09 2014 -0700
broadwell: Update PCIe configuration to follow BWG
According to BIOS spec 8.14
B0:D28:F0[5:4] should be set to 11
BRANCH=none
BUG=chrome-os-partner:28234
TEST=build ok, boot to Auron and Samus
make sure register is set and PCIE is working
Change-Id: I4a7e990993c230dfc1ba83ea75f56757c2c18e46
Signed-off-by: Stefan Reinauer <reinauer(a)chromium.org>
Original-Commit-Id: 82826e3c44c26252697677ec08b95a8f174bc360
Original-Change-Id: I7c37245053ceae460dac0f18363f585244db72f8
Original-Signed-off-by: Kane Chen <kane.chen(a)intel.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/217414
Original-Reviewed-by: Duncan Laurie <dlaurie(a)chromium.org>
---
src/soc/intel/broadwell/pcie.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/soc/intel/broadwell/pcie.c b/src/soc/intel/broadwell/pcie.c
index bd1c55a..f63f6d5 100644
--- a/src/soc/intel/broadwell/pcie.c
+++ b/src/soc/intel/broadwell/pcie.c
@@ -113,6 +113,7 @@ static void root_port_init_config(device_t dev)
rpc.pin_ownership = pci_read_config32(dev, 0x410);
root_port_config_update_gbe_port();
+ pcie_update_cfg8(dev, 0xe2, ~(3 << 4), (3 << 4));
if (dev->chip_info != NULL) {
config_t *config = dev->chip_info;
rpc.coalesce = config->pcie_port_coalesce;
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/9205
-gerrit
commit 5d4ee0828ab98845e0e9e44faf25925d53d93900
Author: Duncan Laurie <dlaurie(a)chromium.org>
Date: Thu Sep 18 12:56:04 2014 -0700
samus: Ensure PD controller is in RO mode for recovery
In order to not break FAFT, and to have a quicker recovery
mode boot, reboot the PD controller into RO image in romstage.
This is done before the EC since rebooting the EC into RO will
also reboot the host.
BUG=chrome-os-partner:30079
BRANCH=none
TEST=boot samus EVT into recovery with 'dut-control power_state:rec'
and ensure that the PD controller is rebooted to RO in romstage.
Change-Id: Ieb51717c17fdcbda7aa63b6a9404959e8736c08f
Signed-off-by: Stefan Reinauer <reinauer(a)chromium.org>
Original-Commit-Id: 19237f6a338fa1c593867d8dfda1edcd376878af
Original-Change-Id: I633f51afc382a7faab825c15618c0bc7566c4395
Original-Signed-off-by: Duncan Laurie <dlaurie(a)chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/218904
Original-Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/mainboard/google/samus/romstage.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/mainboard/google/samus/romstage.c b/src/mainboard/google/samus/romstage.c
index 44d712e..ca43b81 100644
--- a/src/mainboard/google/samus/romstage.c
+++ b/src/mainboard/google/samus/romstage.c
@@ -43,7 +43,8 @@ void mainboard_romstage_entry(struct romstage_params *rp)
printk(BIOS_INFO, "MLB: board version %d\n",
google_chromeec_get_board_version());
- /* Ensure the EC is in the right mode for recovery */
+ /* Ensure the EC and PD are in the right mode for recovery */
+ google_chromeec_early_pd_init();
google_chromeec_early_init();
/* Initialize GPIOs */
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/9221
-gerrit
commit 146a4b9014228f045764b03f15c616e1a020ee4b
Author: Ryan Lin <ryan.lin(a)intel.com>
Date: Wed Oct 1 15:53:39 2014 -0700
Broadwell: Reg_Script: add END tag to array "smbus_init_script"
Need END tag, "REG_SCRIPT_END", to indicate the end of smbus_init_script.
BUG=chromium:416651
TEST=test on Auron.
Change-Id: Ieeaf6c705aa673acc9bb2635e103c4148bc8742f
Signed-off-by: Stefan Reinauer <reinauer(a)chromium.org>
Original-Commit-Id: 172c5fc259a2f6d09daccb1fe53fe0aa7c5601e1
Original-Change-Id: I1f5624f4c6ce7f0e8ceb8971aaa595d99e9ff82e
Original-Signed-off-by: Ryan Lin <ryan.lin(a)intel.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/220934
Original-Reviewed-by: Duncan Laurie <dlaurie(a)chromium.org>
Original-Reviewed-by: Kenji Chen <kenji.chen(a)intel.com>
---
src/soc/intel/broadwell/romstage/smbus.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/soc/intel/broadwell/romstage/smbus.c b/src/soc/intel/broadwell/romstage/smbus.c
index 2bc1492..8b3cde3 100644
--- a/src/soc/intel/broadwell/romstage/smbus.c
+++ b/src/soc/intel/broadwell/romstage/smbus.c
@@ -39,6 +39,8 @@ static const struct reg_script smbus_init_script[] = {
REG_IO_WRITE8(SMBUS_BASE_ADDRESS + SMBHSTCTL, 0),
/* Clear errors */
REG_IO_WRITE8(SMBUS_BASE_ADDRESS + SMBHSTSTAT, 0xff),
+ /* Indicate the end of this array by REG_SCRIPT_END */
+ REG_SCRIPT_END,
};
void enable_smbus(void)
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/9207
-gerrit
commit b03e15944a22326e363402548d3092415c300fc0
Author: Vadim Bendebury <vbendeb(a)chromium.org>
Date: Mon Sep 22 18:48:41 2014 -0700
vpd: retrieve mac addresses and pass them to bootloader
Chrome OS devices firmware usually includes an area called VPD (Vital
Product Data). VPD is a blob of a certain structure, in particular
containing freely defined variable size fields. A field is a tuple of
the field name and field contents.
MAC addresses of the interfaces are stored in VPD as well. Field names
are in the form of 'ethernet_macN', where N is the zero based
interface number.
This patch retrieves the MAC address(es) from the VPD and populates
them in the coreboot table so that they become available to the
bootloader.
BUG=chrome-os-partner:32152, chromium:417117
TEST=with this and other patches in place the storm device tree shows
up with MAC addresses properly initialized.
Change-Id: I955207b3a644cde100cc4b48e51a2ab9a3cb1ba0
Signed-off-by: Stefan Reinauer <reinauer(a)chromium.org>
Original-Commit-Id: 1972b9e97b57cc8503c5e4dc496706970ed2ffbe
Original-Change-Id: I12c0d15ca84f60e4824e1056c9be2e81a7ad8e73
Original-Signed-off-by: Vadim Bendebury <vbendeb(a)chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/219443
Original-Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/include/boot/coreboot_tables.h | 13 +++++++
src/lib/coreboot_table.c | 74 ++++++++++++++++++++++++++++++++++++++
2 files changed, 87 insertions(+)
diff --git a/src/include/boot/coreboot_tables.h b/src/include/boot/coreboot_tables.h
index 46c1df5..0efb8fd 100644
--- a/src/include/boot/coreboot_tables.h
+++ b/src/include/boot/coreboot_tables.h
@@ -263,6 +263,19 @@ struct lb_board_id {
uint32_t board_id;
};
+#define LB_TAG_MAC_ADDRS 0x0026
+struct mac_address {
+ uint8_t mac_addr[6];
+ uint8_t pad[2]; /* Pad it to 8 bytes to keep it simple. */
+};
+
+struct lb_macs {
+ uint32_t tag;
+ uint32_t size;
+ uint32_t count;
+ struct mac_address mac_addrs[0];
+};
+
/* The following structures are for the cmos definitions table */
#define LB_TAG_CMOS_OPTION_TABLE 200
/* cmos header record */
diff --git a/src/lib/coreboot_table.c b/src/lib/coreboot_table.c
index d6d84cd..a8b5edf 100644
--- a/src/lib/coreboot_table.c
+++ b/src/lib/coreboot_table.c
@@ -38,6 +38,7 @@
#endif
#include <vendorcode/google/chromeos/chromeos.h>
#include <vendorcode/google/chromeos/gnvs.h>
+#include <vendorcode/google/chromeos/cros_vpd.h>
#endif
#if CONFIG_ARCH_X86
#include <cpu/x86/mtrr.h>
@@ -157,9 +158,79 @@ void fill_lb_gpio(struct lb_gpio *gpio, int num,
}
#if CONFIG_CHROMEOS
+static void lb_macs(struct lb_header *header)
+{
+ /*
+ * In case there is one or more MAC addresses stored in the VPD, the
+ * key is "ethernet_mac{0..9}", up to 10 values.
+ */
+ static const char mac_addr_key_base[] = "ethernet_mac0";
+ char mac_addr_key[sizeof(mac_addr_key_base)];
+ char mac_addr_str[13]; /* 12 symbols and the trailing zero. */
+ int count;
+ struct lb_macs *macs = NULL;
+ const int index_of_index = sizeof(mac_addr_key) - 2;
+
+ /*
+ * MAC addresses are stored in the VPD as strings of hex numbers,
+ * which need to be converted into binary for storing in the coreboot
+ * table.
+ */
+ strcpy(mac_addr_key, mac_addr_key_base);
+ count = 0;
+ do {
+ int i;
+
+ if (!cros_vpd_gets(mac_addr_key, mac_addr_str,
+ sizeof(mac_addr_str)))
+ break; /* No more MAC addresses in VPD */
+
+ if (!macs) {
+ macs = (struct lb_macs *)lb_new_record(header);
+ macs->tag = LB_TAG_MAC_ADDRS;
+ }
+
+ /* MAC address in symbolic form is in mac_addr_str. */
+ for (i = 0; i < sizeof(macs->mac_addrs[0].mac_addr); i++) {
+ int j;
+ uint8_t n = 0;
+
+ for (j = 0; j < 2; j++) {
+ char c = mac_addr_str[i * 2 + j];
+
+ if (isxdigit(c)) {
+ if (isdigit(c))
+ c -= '0';
+ else
+ c = tolower(c) - 'a' + 10;
+ } else {
+ printk(BIOS_ERR,
+ "%s: non hexadecimal symbol "
+ "%#2.2x in the VPD field %s\n",
+ __func__, (uint8_t)c,
+ mac_addr_key);
+ c = 0;
+ }
+ n <<= 4;
+ n |= c;
+ }
+ macs->mac_addrs[count].mac_addr[i] = n;
+ }
+ count++;
+ mac_addr_key[index_of_index] = '0' + count;
+ } while (count < 10);
+
+ if (!count)
+ return; /* No MAC addresses in the VPD. */
+
+ macs->count = count;
+ macs->size = sizeof(*macs) + count * sizeof(struct mac_address);
+}
+
static void lb_gpios(struct lb_header *header)
{
struct lb_gpios *gpios;
+
gpios = (struct lb_gpios *)lb_new_record(header);
gpios->tag = LB_TAG_GPIO;
gpios->size = sizeof(*gpios);
@@ -446,6 +517,9 @@ unsigned long write_coreboot_table(
/* pass along the vboot_handoff address. */
lb_vboot_handoff(head);
+
+ /* Retrieve mac addresses from VPD, if any. */
+ lb_macs(head);
#endif
/* Add board ID if available */
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/9222
-gerrit
commit fa0564886926c367123d15927c3d1e1d6ecb2400
Author: Julius Werner <jwerner(a)chromium.org>
Date: Tue Sep 23 20:53:20 2014 -0700
arm: Prevent compilation of old, experimental SMP support
The ARM SMP feature was added a long time ago and has never really been
used by anyone since. We are still always compiling cpu_info() even
though we don't use it, and it makes some dangerous assumptions about
stack alignment that are not guaranteed anywhere.
I'm planning to change the way the stack boundaries are defined. Rather
than trying to work that into this unsafe, unused and hard to test
feature, I think we should just seal it off with police tape and make
sure that if anyone ever tries to use it again (which currently seems
unlikely), they get forced to do their due diligence on making sure it
works as intended.
BUG=None
TEST=Compiled Veyron_Pinky.
Change-Id: Id25545cab88f29200c7672ef02c7804f0ac26399
Signed-off-by: Stefan Reinauer <reinauer(a)chromium.org>
Original-Commit-Id: 5b517fc46b030a6e50ef2f5e4d4a449b98ce16c6
Original-Change-Id: I8a60bd30e8b27a22bb3da68ca84daea99424dee9
Original-Signed-off-by: Julius Werner <jwerner(a)chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/219680
Original-Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
Original-Reviewed-by: David Hendricks <dhendrix(a)chromium.org>
---
src/arch/arm/Makefile.inc | 2 +-
src/arch/arm/cpu.c | 5 +++++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/arch/arm/Makefile.inc b/src/arch/arm/Makefile.inc
index 25f764c..e739d0b 100644
--- a/src/arch/arm/Makefile.inc
+++ b/src/arch/arm/Makefile.inc
@@ -117,7 +117,7 @@ ifeq ($(CONFIG_ARCH_RAMSTAGE_ARM),y)
ramstage-y += stages.c
ramstage-y += div0.c
-ramstage-y += cpu.c
+ramstage-$(CONFIG_COOP_MULTITASKING) += cpu.c
ramstage-y += eabi_compat.c
ramstage-y += boot.c
ramstage-y += tables.c
diff --git a/src/arch/arm/cpu.c b/src/arch/arm/cpu.c
index f90c759..e02fed3 100644
--- a/src/arch/arm/cpu.c
+++ b/src/arch/arm/cpu.c
@@ -34,6 +34,11 @@
*/
struct cpu_info *cpu_info(void)
{
+#error "This is BROKEN! ARM stacks are currently not guaranteed to be " \
+ "STACK_SIZE-aligned in any way. If you ever plan to revive this " \
+ "feature, make sure you add the proper assertions " \
+ "(and maybe consider revising the whole thing to work closer to what " \
+ "arm64 is doing now)."
uintptr_t addr = ALIGN((uintptr_t)__builtin_frame_address(0),
CONFIG_STACK_SIZE);
addr -= sizeof(struct cpu_info);
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/9200
-gerrit
commit 0277cc16e506ba9d93871444a7e7ae796f225529
Author: Kein Yuan <kein.yuan(a)intel.com>
Date: Fri Jun 27 09:12:57 2014 -0700
baytrail: Change USB3 PLL VCO and iCLK PLL current on BYT-M/D CPU
Intel will be making slight changes to USB3 PLL VCO and iCLK PLL current
on C0 stepping of BYT-M/D C0 stepping in order to meet the high demands
for these processors.
Pre-conversion materials are compatible with USB PLL VCO current increase.
Post-conversion materials ARE REQUIRED to be run with increased USB3 PLL
VCO current.
BUG=chrome-os-partner:31199
TEST=Boot Rambi, then read USHPHY_CDN_PLL_CONTROL and verify register
has new value.
Signed-off-by: Stefan Reinauer <reinauer(a)chromium.org>
Original-Commit-Id: bc01a3df80f5bd7fd86047c8bbf1584d19363e3b
Original-Change-Id: Ie9c3d0afd54ea7ced2c76ebb948de95be0828fa0
Original-Signed-off-by: Kein Yuan <kein.yuan(a)intel.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/211337
Original-Commit-Queue: Shawn Nematbakhsh <shawnn(a)chromium.org>
Original-Tested-by: Shawn Nematbakhsh <shawnn(a)chromium.org>
Original-Reviewed-by: Duncan Laurie <dlaurie(a)chromium.org>
Original-(cherry picked from commit df20eca47ca0ff33baf5d554ef11dd2b35706a5d)
Original-Reviewed-on: https://chromium-review.googlesource.com/205970
Original-Reviewed-by: Shawn Nematbakhsh <shawnn(a)chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/217772
Original-Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
Original-Commit-Queue: Kenji Chen <kenji.chen(a)intel.com>
Original-Tested-by: Kenji Chen <kenji.chen(a)intel.com>
Change-Id: I1c825992a2b4dfac86f77cde567d2471ca4c19e6
---
src/soc/intel/baytrail/xhci.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/soc/intel/baytrail/xhci.c b/src/soc/intel/baytrail/xhci.c
index 19339e4..21a0c5f 100644
--- a/src/soc/intel/baytrail/xhci.c
+++ b/src/soc/intel/baytrail/xhci.c
@@ -27,6 +27,8 @@
#include <baytrail/iomap.h>
#include <baytrail/iosf.h>
+#include <baytrail/lpc.h>
+#include <baytrail/pattrs.h>
#include <baytrail/pci_devs.h>
#include <baytrail/pmc.h>
#include <baytrail/ramstage.h>
@@ -227,6 +229,13 @@ static void xhci_init(device_t dev)
else
reg_script_run_on_dev(dev, xhci_init_boot_script);
+ /* C0 steppings change iCLK/USB PLL VCO settings from 5 to 7 */
+ if (pattrs_get()->stepping == STEP_C0) {
+ uint32_t reg = iosf_ushphy_read(USHPHY_CDN_PLL_CONTROL);
+ reg |= 0x00700000;
+ iosf_ushphy_write(USHPHY_CDN_PLL_CONTROL, reg);
+ }
+
/* Finalize Initialization */
reg_script_run_on_dev(dev, xhci_hc_init);