Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17106
-gerrit
commit 91dd662405d12839a027d037bf2e47b76bc1cb9e
Author: Lin Huang <hl(a)rock-chips.com>
Date: Sun Oct 16 13:24:08 2016 -0700
rockchip/rk3399: sdram: reset system if switch index1 fail
we will switch index1 when we finish ddr initialization,
and will check some status in this setp, we will reset
the system if we don't get the right status during 100ms,
we also will reset system if training error happen in index1.
BUG=chrome-os-partner:57988
BRANCH=None
TEST=reset in coreboot, and never happen it again
Change-Id: Icb4270369102ff7a4ce91b0677e04b4eb10f1204
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
Original-Commit-Id: ca250d0628ea3b6b39d5131246eaba68637c5140
Original-Change-Id: Id6e8936d90e54b733ac327f8476d744b45639232
Original-Signed-off-by: Lin Huang <hl(a)rock-chips.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/399681
Original-Reviewed-by: Julius Werner <jwerner(a)chromium.org>
---
src/soc/rockchip/rk3399/sdram.c | 27 +++++++++++++++++++++------
1 file changed, 21 insertions(+), 6 deletions(-)
diff --git a/src/soc/rockchip/rk3399/sdram.c b/src/soc/rockchip/rk3399/sdram.c
index 945c0bc..9ff1294 100644
--- a/src/soc/rockchip/rk3399/sdram.c
+++ b/src/soc/rockchip/rk3399/sdram.c
@@ -936,23 +936,38 @@ static void switch_to_phy_index1(const struct rk3399_sdram_params *sdram_params)
{
u32 channel;
u32 *denali_phy;
+ struct stopwatch sw;
u32 ch_count = sdram_params->num_channels;
+ stopwatch_init_msecs_expire(&sw, 100);
write32(&rk3399_ddr_cic->cic_ctrl0,
RK_CLRSETBITS(0x03 << 4 | 1 << 2 | 1,
1 << 4 | 1 << 2 | 1));
- while (!(read32(&rk3399_ddr_cic->cic_status0) & (1 << 2)))
- ;
+ while (!(read32(&rk3399_ddr_cic->cic_status0) & (1 << 2))) {
+ if (stopwatch_expired(&sw)) {
+ printk(BIOS_ERR,
+ "index1 frequency change overtime, reset\n");
+ hard_reset();
+ }
+ }
+ stopwatch_init_msecs_expire(&sw, 100);
write32(&rk3399_ddr_cic->cic_ctrl0, RK_CLRSETBITS(1 << 1, 1 << 1));
- while (!(read32(&rk3399_ddr_cic->cic_status0) & (1 << 0)))
- ;
+ while (!(read32(&rk3399_ddr_cic->cic_status0) & (1 << 0))) {
+ if (stopwatch_expired(&sw)) {
+ printk(BIOS_ERR,
+ "index1 frequency done overtime, reset\n");
+ hard_reset();
+ }
+ }
for (channel = 0; channel < ch_count; channel++) {
denali_phy = rk3399_ddr_publ[channel]->denali_phy;
clrsetbits_le32(&denali_phy[896], (0x3 << 8) | 1, 1 << 8);
- if (data_training(channel, sdram_params, PI_FULL_TARINING))
- printk(BIOS_DEBUG, "training failed\n");
+ if (data_training(channel, sdram_params, PI_FULL_TARINING)) {
+ printk(BIOS_ERR, "index1 training failed, reset\n");
+ hard_reset();
+ }
}
}
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17102
-gerrit
commit dde55ce74b7ae1558ee1e4da385d615fb12d24d0
Author: Patrick Georgi <pgeorgi(a)chromium.org>
Date: Mon Oct 24 11:58:07 2016 +0200
util/scripts: add copyright notices
Change-Id: Ia40543e5585845e5e6c178a620052c6a25927a5c
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
---
util/scripts/cross-repo-cherrypick | 2 ++
util/scripts/dts-to-fmd.sh | 11 +++++++++++
util/scripts/gerrit-rebase | 13 +++++++++++++
3 files changed, 26 insertions(+)
diff --git a/util/scripts/cross-repo-cherrypick b/util/scripts/cross-repo-cherrypick
index 4b098c1..9247cc2 100755
--- a/util/scripts/cross-repo-cherrypick
+++ b/util/scripts/cross-repo-cherrypick
@@ -2,6 +2,8 @@
# rebase.sh - rebase helper script
#
+# Copyright 2015 Google Inc.
+#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
diff --git a/util/scripts/dts-to-fmd.sh b/util/scripts/dts-to-fmd.sh
index f1262fc..5068a99 100755
--- a/util/scripts/dts-to-fmd.sh
+++ b/util/scripts/dts-to-fmd.sh
@@ -1,4 +1,15 @@
#!/bin/bash
+#
+# Copyright 2015 Google Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
# converts a depthcharge fmap.dts into an fmaptool compatible .fmd format
# requires fdt utilities (dtc, fdtget)
#
diff --git a/util/scripts/gerrit-rebase b/util/scripts/gerrit-rebase
index 002c499..8f59e7f 100755
--- a/util/scripts/gerrit-rebase
+++ b/util/scripts/gerrit-rebase
@@ -1,5 +1,18 @@
#!/bin/bash
+
+# Copyright 2016 Google Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
# $0 from-branch to-branch
+#
# applies all commits that from-branch has over to-branch,
# based on a common ancestor and gerrit meta-data
from=$1
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17101
-gerrit
commit cab0cee19fb751a3dc27cba82c75b0b7a0af065b
Author: Patrick Georgi <pgeorgi(a)chromium.org>
Date: Mon Oct 24 11:54:45 2016 +0200
Rename and move util/gitconfig/rebase.sh
It has nothing to do with git configuration, but is one of our
convenience scripts. It also has nothing to do with rebases (except that
it can be comfortably used through git rebase --exec)
Change-Id: Icc60c4de486a0027fe2230e93b441e62ba022193
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
---
util/gitconfig/rebase.sh | 47 --------------------------------------
util/scripts/cross-repo-cherrypick | 47 ++++++++++++++++++++++++++++++++++++++
2 files changed, 47 insertions(+), 47 deletions(-)
diff --git a/util/gitconfig/rebase.sh b/util/gitconfig/rebase.sh
deleted file mode 100755
index 4b098c1..0000000
--- a/util/gitconfig/rebase.sh
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/sh
-
-# rebase.sh - rebase helper script
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-
-# Adapt to your remote branch:
-BRANCH="cros/chromeos-2016.05"
-
-# When pulling in patches from another tree from a gerrit repository,
-# do the following at the end of a larger cherry-pick series:
-# git remote add ...
-# git checkout -b upstreaming
-# git cherry-pick ...
-# git rebase -i --exec util/gitconfig/rebase.sh master
-# Alternatively, you can run util/gitconfig/rebase.sh after every
-# individual cherry-pick.
-
-commit_message() {
- git log -n 1 | grep "^ " | cut -c5-
-}
-
-CHID=$( commit_message | grep -i "^Change-Id: I" )
-CID=$( git log -n1 --grep "^$CHID$" --pretty=%H $BRANCH )
-GUID="$(git config user.name) <$(git config user.email)>"
-
-# TBD: Don't add Original- to empty lines, and possibly make script more
-# solid for commits with an unexpected order of meta data lines.
-
-commit_message | tac | awk '/^$/ {
- if (end==0)
- print "Original-Commit-Id: '"$CID"'\nSigned-off-by: '"$GUID"'";
- end=1
- }; {
- if (end==0)
- print "Original-" $0;
- else
- print $0;
- }' | tac | git commit --amend -F -
diff --git a/util/scripts/cross-repo-cherrypick b/util/scripts/cross-repo-cherrypick
new file mode 100755
index 0000000..4b098c1
--- /dev/null
+++ b/util/scripts/cross-repo-cherrypick
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+# rebase.sh - rebase helper script
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+
+# Adapt to your remote branch:
+BRANCH="cros/chromeos-2016.05"
+
+# When pulling in patches from another tree from a gerrit repository,
+# do the following at the end of a larger cherry-pick series:
+# git remote add ...
+# git checkout -b upstreaming
+# git cherry-pick ...
+# git rebase -i --exec util/gitconfig/rebase.sh master
+# Alternatively, you can run util/gitconfig/rebase.sh after every
+# individual cherry-pick.
+
+commit_message() {
+ git log -n 1 | grep "^ " | cut -c5-
+}
+
+CHID=$( commit_message | grep -i "^Change-Id: I" )
+CID=$( git log -n1 --grep "^$CHID$" --pretty=%H $BRANCH )
+GUID="$(git config user.name) <$(git config user.email)>"
+
+# TBD: Don't add Original- to empty lines, and possibly make script more
+# solid for commits with an unexpected order of meta data lines.
+
+commit_message | tac | awk '/^$/ {
+ if (end==0)
+ print "Original-Commit-Id: '"$CID"'\nSigned-off-by: '"$GUID"'";
+ end=1
+ }; {
+ if (end==0)
+ print "Original-" $0;
+ else
+ print $0;
+ }' | tac | git commit --amend -F -
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17100
-gerrit
commit ce00d58e1df9751a6bdcdef04efbc71ab468684d
Author: Patrick Georgi <pgeorgi(a)chromium.org>
Date: Mon Oct 24 11:53:56 2016 +0200
Drop convert-all-depthcharge-fmap.dts.sh script
The relevant data is gone in Chrome OS depthcharge's master branch, and
so the script outlived its usefulness.
Change-Id: I04f3f168e23d4bc7c31692263a8eec3f97ee50de
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
---
util/scripts/convert-all-depthcharge-fmap.dts.sh | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/util/scripts/convert-all-depthcharge-fmap.dts.sh b/util/scripts/convert-all-depthcharge-fmap.dts.sh
deleted file mode 100755
index 4c4b2d2..0000000
--- a/util/scripts/convert-all-depthcharge-fmap.dts.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-CROS_ROOT=~/cros
-for i in auron bolt chell cosmos cyan daisy falco foster glados jecht lars link nyan nyan_big nyan_blaze oak panther peach_pit peppy purin rambi rush rush_ryu samus slippy smaug storm urara veyron_{brain,danger,emile,mickey,rialto,romy,speedy}; do
- util/scripts/dts-to-fmd.sh ${CROS_ROOT}/src/platform/depthcharge/board/$i/fmap.dts > src/mainboard/google/$i/chromeos.fmd
-done
-for i in kunimitsu sklrvp strago; do
- util/scripts/dts-to-fmd.sh ${CROS_ROOT}/src/platform/depthcharge/board/$i/fmap.dts > src/mainboard/intel/$i/chromeos.fmd
-done
-util/scripts/dts-to-fmd.sh ${CROS_ROOT}/src/platform/depthcharge/board/bayleybay/fmap.dts > src/mainboard/intel/bayleybay_fsp/chromeos.fmd
-util/scripts/dts-to-fmd.sh ${CROS_ROOT}/src/platform/depthcharge/board/veyron_minnie/fmap.dts > src/mainboard/google/veyron/chromeos.fmd
Furquan Shaikh (furquan(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17091
-gerrit
commit 25181ff988e052abec5c91a0caf8f3b0f1c4d18b
Author: Furquan Shaikh <furquan(a)chromium.org>
Date: Fri Oct 21 16:40:17 2016 -0700
arch/x86/acpigen_dsm: Add support for DSM types
Currently, the only supported DSM type is I2C
HID(3CDFF6F7-4267-4555-AD05-B30A3D8938DE). This provides the required
callbacks for generating ACPI AML codes for different function
identifiers for I2C HID.
BUG=chrome-os-partner:57846
Change-Id: Ia403e11f7ce4824956e3c879547ec927478db7b1
Signed-off-by: Furquan Shaikh <furquan(a)chromium.org>
---
src/arch/x86/Makefile.inc | 1 +
src/arch/x86/acpigen_dsm.c | 65 +++++++++++++++++++++++++++++++++
src/arch/x86/include/arch/acpigen_dsm.h | 27 ++++++++++++++
3 files changed, 93 insertions(+)
diff --git a/src/arch/x86/Makefile.inc b/src/arch/x86/Makefile.inc
index 782ca63..c4bb1cc 100644
--- a/src/arch/x86/Makefile.inc
+++ b/src/arch/x86/Makefile.inc
@@ -313,6 +313,7 @@ ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_32)$(CONFIG_ARCH_RAMSTAGE_X86_64),y)
ramstage-$(CONFIG_HAVE_ACPI_TABLES) += acpi.c
ramstage-$(CONFIG_HAVE_ACPI_TABLES) += acpigen.c
+ramstage-$(CONFIG_HAVE_ACPI_TABLES) += acpigen_dsm.c
ramstage-$(CONFIG_HAVE_ACPI_TABLES) += acpi_device.c
ramstage-$(CONFIG_HAVE_ACPI_RESUME) += acpi_s3.c
ramstage-y += boot.c
diff --git a/src/arch/x86/acpigen_dsm.c b/src/arch/x86/acpigen_dsm.c
new file mode 100644
index 0000000..c6d614a
--- /dev/null
+++ b/src/arch/x86/acpigen_dsm.c
@@ -0,0 +1,65 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2016 Google Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <arch/acpigen.h>
+#include <arch/acpigen_dsm.h>
+#include <stdlib.h>
+
+/* ------------------- I2C HID DSM ---------------------------- */
+
+#define ACPI_DSM_I2C_HID_UUID "3CDFF6F7-4267-4555-AD05-B30A3D8938DE"
+
+static void i2c_hid_func0_cb(void *arg)
+{
+ /* ToInteger (Arg1, Local2) */
+ acpigen_write_to_integer(ARG1_OP, LOCAL2_OP);
+ /* If (LEqual (Local2, 0x0)) */
+ acpigen_write_if_lequal(LOCAL2_OP, 0x0);
+ /* Return (Buffer (One) { 0x1f }) */
+ acpigen_write_return_singleton_buffer(0x1f);
+ acpigen_pop_len(); /* Pop : If */
+ /* Else */
+ acpigen_write_else();
+ /* If (LEqual (Local2, 0x1)) */
+ acpigen_write_if_lequal(LOCAL2_OP, 0x1);
+ /* Return (Buffer (One) { 0x3f }) */
+ acpigen_write_return_singleton_buffer(0x3f);
+ acpigen_pop_len(); /* Pop : If */
+ /* Else */
+ acpigen_write_else();
+ /* Return (Buffer (One) { 0x0 }) */
+ acpigen_write_return_singleton_buffer(0x0);
+ acpigen_pop_len(); /* Pop : Else */
+ acpigen_pop_len(); /* Pop : Else */
+}
+
+static void i2c_hid_func1_cb(void *arg)
+{
+ struct dsm_i2c_hid_config *config = arg;
+ acpigen_write_return_byte(config->hid_desc_reg_offset);
+}
+
+static void (*i2c_hid_callbacks[2])(void *) = {
+ i2c_hid_func0_cb,
+ i2c_hid_func1_cb,
+};
+
+void acpigen_write_dsm_i2c_hid(struct dsm_i2c_hid_config *config)
+{
+ acpigen_write_dsm(ACPI_DSM_I2C_HID_UUID, i2c_hid_callbacks,
+ ARRAY_SIZE(i2c_hid_callbacks), config);
+}
+
+/* ------------------- End: I2C HID DSM ------------------------- */
diff --git a/src/arch/x86/include/arch/acpigen_dsm.h b/src/arch/x86/include/arch/acpigen_dsm.h
new file mode 100644
index 0000000..2d8bb48
--- /dev/null
+++ b/src/arch/x86/include/arch/acpigen_dsm.h
@@ -0,0 +1,27 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2016 Google Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __ARCH_ACPIGEN_DSM_H__
+#define __ARCH_ACPIGEN_DSM_H__
+
+#include <stdint.h>
+
+struct dsm_i2c_hid_config {
+ uint8_t hid_desc_reg_offset;
+};
+
+void acpigen_write_dsm_i2c_hid(struct dsm_i2c_hid_config *config);
+
+#endif /* __ARCH_ACPIGEN_DSM_H__ */