Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16702
-gerrit
commit c6910fcb5ed6715d6b5eb0227eebd639e0f3d7d6
Author: Julius Werner <jwerner(a)chromium.org>
Date: Thu Aug 25 22:37:38 2016 -0700
rockchip/rk3399: Remove CONFIG_ARM64_A53_ERRATUM_843419
As far as I know, the Cortex-A53 cores in RK3399 are of a newer revision
that is not affected by ARM erratum 843419. If it was, the workaround
would also need to be enabled in libpayload and Chrome OS userspace,
which it currently isn't. I assume this was just incorrectly copied over
from another SoC and we can safely remove it.
BRANCH=None
BUG=chrome-os-partner:56700
TEST=Booted Kevin.
Change-Id: I5b1534c954a6d985499b481738723cabbdc07253
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
Original-Commit-Id: 4891cc866583532ee3dcb1a5ad5b81670eb0743d
Original-Change-Id: Iadb57428f8727ce0e563204723644e2c79e3007c
Original-Signed-off-by: Julius Werner <jwerner(a)chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/376363
Original-Commit-Queue: Douglas Anderson <dianders(a)chromium.org>
Original-Reviewed-by: Douglas Anderson <dianders(a)chromium.org>
---
src/soc/rockchip/rk3399/Kconfig | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/soc/rockchip/rk3399/Kconfig b/src/soc/rockchip/rk3399/Kconfig
index 1eaa870..b4017c8 100644
--- a/src/soc/rockchip/rk3399/Kconfig
+++ b/src/soc/rockchip/rk3399/Kconfig
@@ -5,7 +5,6 @@ config SOC_ROCKCHIP_RK3399
select ARCH_RAMSTAGE_ARMV8_64
select ARCH_ROMSTAGE_ARMV8_64
select ARCH_VERSTAGE_ARMV8_64
- select ARM64_A53_ERRATUM_843419
select ARM64_USE_ARM_TRUSTED_FIRMWARE
select BOOTBLOCK_CONSOLE
select DRIVERS_UART_8250MEM_32
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16701
-gerrit
commit d56777a29a2c6f6096a74ff98943b71fe3bf1d42
Author: Simon Glass <sjg(a)chromium.org>
Date: Sat Aug 27 15:03:02 2016 -0600
spi: Add a way to show SPI transfer speed for reads
SPI read speed directly impacts boot time and we do quite a lot of
reading.
Add a way to easily find out the speed of SPI flash reads within
coreboot.
Write speed is less important since there are very few writes and they
are small.
BUG=chrome-os-partner:56556
BRANCH=none
TEST=run on gru with SPI_SPEED_DEBUG set to 1. See the output messages:
read SPI 627d4 7d73: 18455 us, 1740 KB/s, 13.920 Mbps
Change-Id: Id3814bd2b7bd045cdfcc67eb1fabc861bf9ed3b2
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
Original-Commit-Id: 82cb93f6be47efce3b0a3843bab89d2381baef89
Original-Change-Id: Iec66f5b8e3ad62f14d836a538dc7801e4ca669e7
Original-Signed-off-by: Simon Glass <sjg(a)chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/376944
Original-Commit-Ready: Julius Werner <jwerner(a)chromium.org>
Original-Tested-by: Simon Glass <sjg(a)google.com>
Original-Reviewed-by: Julius Werner <jwerner(a)chromium.org>
---
src/drivers/spi/cbfs_spi.c | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/src/drivers/spi/cbfs_spi.c b/src/drivers/spi/cbfs_spi.c
index 1895b9d..e76a665 100644
--- a/src/drivers/spi/cbfs_spi.c
+++ b/src/drivers/spi/cbfs_spi.c
@@ -23,14 +23,44 @@
#include <spi_flash.h>
#include <symbols.h>
#include <cbmem.h>
+#include <timer.h>
static struct spi_flash *spi_flash_info;
+/*
+ * Set this to 1 to debug SPI speed, 0 to disable it
+ * The format is:
+ *
+ * read SPI 62854 7db7: 10416 us, 3089 KB/s, 24.712 Mbps
+ *
+ * The important number is the last one. It should roughyly match your SPI
+ * clock. If it doesn't, your driver might need a little tuning.
+ */
+#define SPI_SPEED_DEBUG 0
+
static ssize_t spi_readat(const struct region_device *rd, void *b,
size_t offset, size_t size)
{
+ struct stopwatch sw;
+ bool show = SPI_SPEED_DEBUG && size >= 4*KiB;
+
+ if (show)
+ stopwatch_init(&sw);
if (spi_flash_info->read(spi_flash_info, offset, size, b))
return -1;
+ if (show) {
+ long usecs;
+
+ usecs = stopwatch_duration_usecs(&sw);
+ u64 speed; /* KiB/s */
+ int bps; /* Bits per second */
+
+ speed = (u64)size * 1000 / usecs;
+ bps = speed * 8;
+
+ printk(BIOS_DEBUG, "read SPI %#zx %#zx: %ld us, %lld KB/s, %d.%03d Mbps\n",
+ offset, size, usecs, speed, bps / 1000, bps % 1000);
+ }
return size;
}
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16700
-gerrit
commit 455e4f4b068970b0512191d62a054fab5031b666
Author: Douglas Anderson <dianders(a)chromium.org>
Date: Tue Sep 6 13:51:03 2016 -0700
google/gru: Init the PWM pinmux after setting up the PWM
If we setup the PWM _after_ the pinmux then there's a period of time
when we're driving the PWM incorrectly. Let's setup the regulator and
_then_ configure the pinmux.
This fixes no known bugs, but it is more correct and probably makes the
signals look better at bootup.
BRANCH=None
BUG=None
TEST=scope
Change-Id: I311c0eded873b65e0489373e87b88bcdd8e4b806
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
Original-Commit-Id: fcf4d0ba29d82cce779c0b25ead36de4a95d97a1
Original-Change-Id: I5124f48d04a18c07bbd2d54bc08ee001c9c7e8d1
Original-Signed-off-by: Douglas Anderson <dianders(a)chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/381592
Original-Reviewed-by: Simon Glass <sjg(a)google.com>
Original-Reviewed-by: Julius Werner <jwerner(a)chromium.org>
---
src/mainboard/google/gru/pwm_regulator.c | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/src/mainboard/google/gru/pwm_regulator.c b/src/mainboard/google/gru/pwm_regulator.c
index d0cdf43..d6d2eec 100644
--- a/src/mainboard/google/gru/pwm_regulator.c
+++ b/src/mainboard/google/gru/pwm_regulator.c
@@ -44,21 +44,6 @@ void pwm_regulator_configure(enum pwm_regulator pwm, int millivolt)
int duty_ns, voltage_max, voltage_min;
int voltage = millivolt * 10; /* for higer calculation accuracy */
- switch (pwm) {
- case PWM_REGULATOR_GPU:
- write32(&rk3399_grf->iomux_pwm_0, IOMUX_PWM_0);
- break;
- case PWM_REGULATOR_BIG:
- write32(&rk3399_grf->iomux_pwm_1, IOMUX_PWM_1);
- break;
- case PWM_REGULATOR_LIT:
- write32(&rk3399_pmugrf->iomux_pwm_2, IOMUX_PWM_2);
- break;
- case PWM_REGULATOR_CENTERLOG:
- write32(&rk3399_pmugrf->iomux_pwm_3a, IOMUX_PWM_3_A);
- break;
- }
-
voltage_min = PWM_DESIGN_VOLTAGE_MIN;
voltage_max = PWM_DESIGN_VOLTAGE_MAX;
if (!(IS_ENABLED(CONFIG_BOARD_GOOGLE_KEVIN) && board_id() < 6) &&
@@ -80,4 +65,19 @@ void pwm_regulator_configure(enum pwm_regulator pwm, int millivolt)
/ (voltage_max - voltage_min);
pwm_init(pwm, PWM_PERIOD, duty_ns);
+
+ switch (pwm) {
+ case PWM_REGULATOR_GPU:
+ write32(&rk3399_grf->iomux_pwm_0, IOMUX_PWM_0);
+ break;
+ case PWM_REGULATOR_BIG:
+ write32(&rk3399_grf->iomux_pwm_1, IOMUX_PWM_1);
+ break;
+ case PWM_REGULATOR_LIT:
+ write32(&rk3399_pmugrf->iomux_pwm_2, IOMUX_PWM_2);
+ break;
+ case PWM_REGULATOR_CENTERLOG:
+ write32(&rk3399_pmugrf->iomux_pwm_3a, IOMUX_PWM_3_A);
+ break;
+ }
}
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16696
-gerrit
commit 791a110f76c836b2111609f4f9861fb0da9f851a
Author: li feng <li1.feng(a)intel.com>
Date: Thu Apr 21 17:33:32 2016 -0700
mainboard/intel/amenia: Enable software sync in coreboot
Software sync in depthcharge should be enabled as well.
BUG=none
BRANCH=none
TEST=On Amenia TR1.2, observed software sync after boot up, and
checked with console command sysinfo.
Change-Id: I7bd9a4934bec8e4fafbcdeb4c69313d83522063b
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
Original-Commit-Id: 2ef1dd668e6b7c7f9739b13d525ea2d2bb7ae7a1
Original-Change-Id: Ia807ca8881747ec80adfaa48ef832835784159bf
Original-Signed-off-by: li feng <li1.feng(a)intel.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/355221
Original-Commit-Ready: David Hendricks <dhendrix(a)chromium.org>
Original-Tested-by: David Hendricks <dhendrix(a)chromium.org>
Original-Reviewed-by: David Hendricks <dhendrix(a)chromium.org>
---
src/mainboard/intel/amenia/Kconfig | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/mainboard/intel/amenia/Kconfig b/src/mainboard/intel/amenia/Kconfig
index 5d50d7b..455d136 100644
--- a/src/mainboard/intel/amenia/Kconfig
+++ b/src/mainboard/intel/amenia/Kconfig
@@ -17,6 +17,9 @@ config BOARD_SPECIFIC_OPTIONS
config CHROMEOS
select LID_SWITCH
+config CHROMEOS
+ select EC_SOFTWARE_SYNC
+
config MAINBOARD_DIR
string
default intel/amenia
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16695
-gerrit
commit af1bb41fb0e2f018d9a27b8990377dd86e6503a4
Author: Patrick Georgi <pgeorgi(a)chromium.org>
Date: Thu Sep 22 12:46:45 2016 +0200
util/scripts: add gerrit-rebase script
gerrit-rebase is a gerrit-context aware rebase script. Given a source
and a target branch (that need to have a common ancestor), it prepares
a rebase todo list that applies all commits from source that aren't
already found on target.
It matches commits using Reviewed-on lines in the commit message that
are added by gerrit when submitting commits using the "cherry-pick"
strategy.
This has been shown to be the best preserved meta data to work from in
existing data (Change-Id was mangled in all kinds of ways).
Change-Id: I9618c1b66ebc1fb7ed006efbc1665fb08386e1a5
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
---
util/scripts/gerrit-rebase | 61 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 61 insertions(+)
diff --git a/util/scripts/gerrit-rebase b/util/scripts/gerrit-rebase
new file mode 100755
index 0000000..002c499
--- /dev/null
+++ b/util/scripts/gerrit-rebase
@@ -0,0 +1,61 @@
+#!/bin/bash
+# $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
+to=$2
+
+# match string: this is the git commit line that is used to
+# identify commits that were already copied over.
+#
+# Must not contain spaces except for leading and trailing.
+#
+# The first pick was Change-Id, but it was lost too often,
+# so go for Reviewed-on instead. It's also unique because it
+# contains the gerrit instance's host name and the change's number
+# on that system.
+match_string='^ [-A-Za-z]*[Rr]eviewed-on: '
+
+# fetch common ancestor
+common_base=$(git merge-base ${from} ${to} 2>/dev/null)
+
+if [ -z "${common_base}" ]; then
+ echo \"${from}\" or \"${to}\" is not a valid branch name.
+ exit 1
+fi
+
+# collect matches that are present on the target side
+to_matches="$(git log ${common_base}..${to} | \
+ grep "${match_string}" | \
+ cut -d: -f2-)"
+
+# start rebase process, but fail immediately by enforcing an invalid todo
+GIT_SEQUENCE_EDITOR="echo foo >" \
+ git rebase -i --onto ${to} ${from} ${to} 2>/dev/null
+
+# write new rebase todo
+# the appended "commit" line triggers handling of the last log entry
+commit=""
+(git log --reverse ${common_base}..${from} | \
+ grep -E "(^commit [0-9a-f]{40}\$|${match_string})"; \
+ echo "commit") | \
+while read key value; do
+ if [ "${key}" = "commit" ]; then
+ if [ -n "${commit}" ]; then
+ git log -n 1 --pretty="pick %h %s" ${commit}
+ fi
+ commit="${value}"
+ else
+ # if value was already found on the "to" side, skip this
+ # commit
+ if [[ ${to_matches} == *"${value}"* ]]; then
+ commit=""
+ fi
+ fi
+done | GIT_SEQUENCE_EDITOR="cat >" git rebase --edit-todo
+
+# allow user to edit todo
+git rebase --edit-todo
+
+# start processing todo to mimick git rebase -i behavior
+git rebase --continue
Duncan Laurie (dlaurie(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16693
-gerrit
commit ece9a07e4fe0917c9a5f56eaf86f4abbd03c61bc
Author: Duncan Laurie <dlaurie(a)chromium.org>
Date: Wed Sep 21 18:30:44 2016 -0700
soc/intel/apollolake: Initialize processor count in GNVS
Initialize the PCNT variable in GNVS so it is available to ACPI code
that expects to know the number of CPUs.
Change-Id: I7a6e003ac94218061bf98e8883ed2c62d856af8d
Signed-off-by: Duncan Laurie <dlaurie(a)chromium.org>
---
src/soc/intel/apollolake/acpi.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/soc/intel/apollolake/acpi.c b/src/soc/intel/apollolake/acpi.c
index 5718d7e..ba22aee 100644
--- a/src/soc/intel/apollolake/acpi.c
+++ b/src/soc/intel/apollolake/acpi.c
@@ -168,6 +168,9 @@ static void acpi_create_gnvs(struct global_nvs_t *gnvs)
/* Set unknown wake source */
gnvs->pm1i = ~0ULL;
+ /* CPU core count */
+ gnvs->pcnt = dev_count_cpu();
+
if (!dev || !dev->chip_info) {
printk(BIOS_ERR, "BUG! Could not find SOC devicetree config\n");
return;
hakim giydan (hgiydan(a)marvell.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16692
-gerrit
commit 2f29d61103a1c6fcbbc3e2308135a0d182be8aaf
Author: Hakim Giydan <hgiydan(a)marvell.com>
Date: Wed Sep 21 15:50:39 2016 -0700
libpayload: mvmap2315: Introduce timer driver
Testing: booted successfully.
Change-Id: I4a50c9fb7aec929ea29a3cf2eec3e424e3629c92
Signed-off-by: Hakim Giydan <hgiydan(a)marvell.com>
---
payloads/libpayload/drivers/Makefile.inc | 1 +
payloads/libpayload/drivers/timer/Kconfig | 13 ++++++++
payloads/libpayload/drivers/timer/mvmap2315.c | 44 +++++++++++++++++++++++++++
3 files changed, 58 insertions(+)
diff --git a/payloads/libpayload/drivers/Makefile.inc b/payloads/libpayload/drivers/Makefile.inc
index 75f08f2..899c5d2 100644
--- a/payloads/libpayload/drivers/Makefile.inc
+++ b/payloads/libpayload/drivers/Makefile.inc
@@ -57,6 +57,7 @@ libc-$(CONFIG_LP_TIMER_BG4CD) += timer/bg4cd.c
libc-$(CONFIG_LP_TIMER_IMG_PISTACHIO) += timer/img_pistachio.c
libc-$(CONFIG_LP_TIMER_CYGNUS) += timer/cygnus.c
libc-$(CONFIG_LP_TIMER_ARMADA38X) += timer/armada38x.c
+libc-$(CONFIG_LP_TIMER_MVMAP2315) += timer/mvmap2315.c
# Video console drivers
libc-$(CONFIG_LP_VIDEO_CONSOLE) += video/video.c
diff --git a/payloads/libpayload/drivers/timer/Kconfig b/payloads/libpayload/drivers/timer/Kconfig
index 0b981b0..b3ab6ec 100644
--- a/payloads/libpayload/drivers/timer/Kconfig
+++ b/payloads/libpayload/drivers/timer/Kconfig
@@ -61,6 +61,9 @@ config TIMER_IMG_PISTACHIO
config TIMER_MTK
bool "Timer for MediaTek MT8173"
+config TIMER_MVMAP2315
+ bool "Timer for Marvell MVMAP2315"
+
endchoice
config TIMER_MCT_HZ
@@ -108,6 +111,16 @@ config ARMADA38X_TIMER_REG
default 0xF1020314
depends on TIMER_ARMADA38X
+config MVMAP2315_TIMER_FREQ
+ int "Hardware timer frequency"
+ depends on TIMER_MVMAP2315
+ default 1000000
+
+config MVMAP2315_TIMER_REG
+ hex "Timer register address"
+ depends on TIMER_MVMAP2315
+ default 0xE1020004
+
config IPROC_PERIPH_GLB_TIM_REG_BASE
hex "Cygnus timer base address"
depends on TIMER_CYGNUS
diff --git a/payloads/libpayload/drivers/timer/mvmap2315.c b/payloads/libpayload/drivers/timer/mvmap2315.c
new file mode 100644
index 0000000..5b1f813
--- /dev/null
+++ b/payloads/libpayload/drivers/timer/mvmap2315.c
@@ -0,0 +1,44 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2016 Marvell Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <assert.h>
+#include <libpayload.h>
+
+static u32 *reg = (void *)CONFIG_LP_MVMAP2315_TIMER_REG;
+
+uint64_t timer_hz(void)
+{
+ return CONFIG_LP_MVMAP2315_TIMER_FREQ;
+}
+
+uint64_t timer_raw_value(void)
+{
+ /* invert count to change from down to up count */
+ return ~readl(reg);
+}