Marc Jones (marc.jones(a)se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/7993
-gerrit
commit e97debec2a6574e0bd6b6b8356747c84a5c07711
Author: Vadim Bendebury <vbendeb(a)chromium.org>
Date: Thu May 1 15:24:32 2014 -0700
ipq8084: provide monotonic us timer
This service is required by various coreboot code modules. It looks
like the 8064 SOC does not provide anything better than a 32 KHz free
running counter (it is used in u-boot for us timer as well). Let's use
this for now.
BUG=chrome-os-partner:27784
TEST=manual
. with the rest of the patches applied AP148 boots all the way to
trying to start the payload.
Original-Change-Id: I98b91ce179f7388d59c769a59caf49ca7640e047
Original-Signed-off-by: Vadim Bendebury <vbendeb(a)chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/197896
(cherry picked from commit d526830f9d9618e4ca3460165d7b9ecc8ab268cf)
Signed-off-by: Marc Jones <marc.jones(a)se-eng.com>
Change-Id: Id37ed21193db67ceee11a795713c34ef26383380
---
src/soc/qualcomm/ipq806x/timer.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/soc/qualcomm/ipq806x/timer.c b/src/soc/qualcomm/ipq806x/timer.c
index 0d44e4a..676c7f5 100644
--- a/src/soc/qualcomm/ipq806x/timer.c
+++ b/src/soc/qualcomm/ipq806x/timer.c
@@ -76,6 +76,11 @@ void udelay(unsigned usec)
} while (runcount < val);
}
+void timer_monotonic_get(struct mono_time *mt)
+{
+ mono_time_set_usecs(mt, (readl(GPT_COUNT_VAL) * 1000) / GPT_FREQ_KHZ);
+}
+
#if 0
/*
Marc Jones (marc.jones(a)se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/7875
-gerrit
commit cc0f10446f58a75c3fc81de0128d01956e9e9b18
Author: Vadim Bendebury <vbendeb(a)chromium.org>
Date: Wed Apr 23 14:26:01 2014 -0700
ipq8064/storm: UART enable and various fixes
The original patch from chromium was a bit of a mishmash.
Between that, rebasing and using the coreboot.org UART infrastructure,
the patch has changed a bit from the original. It seems reasonable to
keep these changes together.
- build in the ipq UART and turn on bootblock console
- sets LPAE and ROM header address
- adds cpd.c to storm
The original commit:
ipq8064: make UART driver work in bootblock
This patch it the last one in the chain adapting the ipq9064 UART
driver for use in coreboot. A new config option
(CONSOLE_SERIAL_IPQ806X) is being introduced to control inclusion of
the driver.
The previously introduced uart_wrapper.c is now included in the build
to provide the console driver structure used by ramstage.
Necessary configuration options are added to allow use of UART in the
bootblock.
BUG=chrome-os-partner:27784
TEST=with this change the coreboot image on AP148 prints a banner on
start up:
coreboot-4.0 Wed Apr 23 16:24:51 PDT 2014 starting...
Original-Change-Id: I129ee30ba17a5061b30cfee56c135df31eba98b5
Original-Signed-off-by: Vadim Bendebury <vbendeb(a)chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/196663
(cherry picked from commit 42ca8994361327c24e7a611505b21534dd231f30)
Signed-off-by: Marc Jones <marc.jones(a)se-eng.com>
Change-Id: I1175e74ed639cdc27a1a677fba65de2dd2b13a91
---
src/mainboard/google/storm/Kconfig | 1 +
src/mainboard/google/storm/Makefile.inc | 3 +++
src/soc/qualcomm/ipq806x/Kconfig | 11 +++++++----
src/soc/qualcomm/ipq806x/Makefile.inc | 3 +++
4 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/src/mainboard/google/storm/Kconfig b/src/mainboard/google/storm/Kconfig
index 59c0bb6..a2bf740 100644
--- a/src/mainboard/google/storm/Kconfig
+++ b/src/mainboard/google/storm/Kconfig
@@ -23,6 +23,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
def_bool y
select SOC_QC_IPQ806X
select BOARD_ROMSIZE_KB_4096
+ select MAINBOARD_HAS_BOOTBLOCK_INIT
config MAINBOARD_DIR
string
diff --git a/src/mainboard/google/storm/Makefile.inc b/src/mainboard/google/storm/Makefile.inc
index e0f5501..17f9676 100644
--- a/src/mainboard/google/storm/Makefile.inc
+++ b/src/mainboard/google/storm/Makefile.inc
@@ -17,6 +17,9 @@
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
+bootblock-y += cdp.c
+
romstage-y += romstage.c
ramstage-y += mainboard.c
+ramstage-y += cdp.c
diff --git a/src/soc/qualcomm/ipq806x/Kconfig b/src/soc/qualcomm/ipq806x/Kconfig
index 0fb780c..92ef3a1 100644
--- a/src/soc/qualcomm/ipq806x/Kconfig
+++ b/src/soc/qualcomm/ipq806x/Kconfig
@@ -1,9 +1,12 @@
config SOC_QC_IPQ806X
+ bool
+ default n
select ARCH_BOOTBLOCK_ARMV4
select ARCH_ROMSTAGE_ARMV7
select ARCH_RAMSTAGE_ARMV7
- bool
- default n
+ select ARM_LPAE
+ select BOOTBLOCK_CONSOLE
+ select HAVE_UART_SPECIAL
if SOC_QC_IPQ806X
@@ -13,11 +16,11 @@ config BOOTBLOCK_ROM_OFFSET
config CBFS_HEADER_ROM_OFFSET
hex "offset of master CBFS header in ROM"
- default 0x221000
+ default 0x224000
config CBFS_ROM_OFFSET
hex "offset of CBFS data in ROM"
- default 0x221080
+ default 0x224080
config MBN_ENCAPSULATION
depends on USE_BLOBS
diff --git a/src/soc/qualcomm/ipq806x/Makefile.inc b/src/soc/qualcomm/ipq806x/Makefile.inc
index dfbbf3d..639b9d9 100644
--- a/src/soc/qualcomm/ipq806x/Makefile.inc
+++ b/src/soc/qualcomm/ipq806x/Makefile.inc
@@ -22,16 +22,19 @@ bootblock-y += cbfs.c
bootblock-y += clock.c
bootblock-y += gpio.c
bootblock-y += timer.c
+bootblock-$(CONFIG_DRIVERS_UART) += uart.c
romstage-y += cbfs.c
romstage-y += clock.c
romstage-y += gpio.c
romstage-y += timer.c
+romstage-$(CONFIG_DRIVERS_UART) += uart.c
ramstage-y += cbfs.c
ramstage-y += clock.c
ramstage-y += gpio.c
ramstage-y += timer.c
+ramstage-$(CONFIG_DRIVERS_UART) += uart.c
ifeq ($(CONFIG_USE_BLOBS),y)
Marc Jones (marc.jones(a)se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/7992
-gerrit
commit 8e8f573592078528a2bfe9872cebf52d5205acbe
Author: Julius Werner <jwerner(a)chromium.org>
Date: Wed May 14 14:53:18 2014 -0700
arm: Fix stored PC value when handling exceptions
ARM processors save the PC value in the Link Register when they handle
and exception, but they store it with an added offset (depending on the
exception type). In order to make crashes easier to read and correctly
support more complicated handlers in libpayload, this patch adjusts the
saved PC value on exception entry to correct for that offset.
(Note: The value that we now store is what ARM calls the "preferred
return address". For most exceptions this is the faulting instruction,
but for software interrupts (SWI) it is the instruction after that. This
is the way most programs like GDB expect the stored PC address to work,
so let's leave it at that.)
Numbers taken from the Architecture Reference Manual at the end of
section B1.8.3.
BRANCH=none
BUG=chrome-os-partner:18390
TEST=Provoked a data abort and an undefined instruction in both coreboot
and depthcharge, confirmed that the PC address was spot on.
Original-Change-Id: Ia958a7edfcd4aa5e04c20148140a6148586935ba
Original-Signed-off-by: Julius Werner <jwerner(a)chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/199844
Original-Reviewed-by: Stefan Reinauer <reinauer(a)chromium.org>
Original-Reviewed-by: Vincent Palatin <vpalatin(a)chromium.org>
(cherry picked from commit 4a914d36bb181d090f75b1414158846d40dc9bac)
Signed-off-by: Marc Jones <marc.jones(a)se-eng.com>
Change-Id: Ib63ca973d5f037a879b4d4d258a4983160b67dd6
---
payloads/libpayload/arch/arm/exception_asm.S | 19 +++++++++++++++++++
src/arch/arm/armv7/exception.c | 5 +++++
2 files changed, 24 insertions(+)
diff --git a/payloads/libpayload/arch/arm/exception_asm.S b/payloads/libpayload/arch/arm/exception_asm.S
index 974d172..7b722cb 100644
--- a/payloads/libpayload/arch/arm/exception_asm.S
+++ b/payloads/libpayload/arch/arm/exception_asm.S
@@ -45,25 +45,44 @@ exception_table:
1:
mov sp, $0
b exception_common
+
+/* Undefined Instruction (CAREFUL: the PC offset is specific to thumb mode!) */
2:
+ sub lr, lr, $2
mov sp, $1
b exception_common
+
+/* Software Interrupt (no PC offset necessary) */
3:
mov sp, $2
b exception_common
+
+/* Prefetch Abort */
4:
+ sub lr, lr, $4
mov sp, $3
b exception_common
+
+/* Data Abort */
5:
+ sub lr, lr, $8
mov sp, $4
b exception_common
+
+/* (not used) */
6:
mov sp, $5
b exception_common
+
+/* Interrupt */
7:
+ sub lr, lr, $4
mov sp, $6
b exception_common
+
+/* Fast Interrupt */
8:
+ sub lr, lr, $4
mov sp, $7
b exception_common
diff --git a/src/arch/arm/armv7/exception.c b/src/arch/arm/armv7/exception.c
index b02e5c1..eedd47d 100644
--- a/src/arch/arm/armv7/exception.c
+++ b/src/arch/arm/armv7/exception.c
@@ -81,6 +81,7 @@ static void print_regs(uint32_t *regs)
void exception_undefined_instruction(uint32_t *regs)
{
printk(BIOS_ERR, "exception _undefined_instruction\n");
+ regs[15] -= 2; /* CAREFUL: specific to thumb mode (otherwise 4)! */
print_regs(regs);
dump_stack(regs[13], 512);
die("exception");
@@ -97,6 +98,7 @@ void exception_software_interrupt(uint32_t *regs)
void exception_prefetch_abort(uint32_t *regs)
{
printk(BIOS_ERR, "exception _prefetch_abort\n");
+ regs[15] -= 4;
print_regs(regs);
dump_stack(regs[13], 512);
die("exception");
@@ -105,6 +107,7 @@ void exception_prefetch_abort(uint32_t *regs)
void exception_data_abort(uint32_t *regs)
{
printk(BIOS_ERR, "exception _data_abort\n");
+ regs[15] -= 8;
print_regs(regs);
dump_stack(regs[13], 512);
die("exception");
@@ -121,6 +124,7 @@ void exception_not_used(uint32_t *regs)
void exception_irq(uint32_t *regs)
{
printk(BIOS_ERR, "exception _irq\n");
+ regs[15] -= 4;
print_regs(regs);
dump_stack(regs[13], 512);
die("exception");
@@ -129,6 +133,7 @@ void exception_irq(uint32_t *regs)
void exception_fiq(uint32_t *regs)
{
printk(BIOS_ERR, "exception _fiq\n");
+ regs[15] -= 4;
print_regs(regs);
dump_stack(regs[13], 512);
die("exception");
Marc Jones (marc.jones(a)se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/7991
-gerrit
commit 63cb0de241f9b7a88a2e4612bf3bd874cf0e9c96
Author: David Hendricks <dhendrix(a)chromium.org>
Date: Tue May 13 20:28:49 2014 -0700
elog: Add function to log boot reason in ChromeOS case
This adds a generic helper function for adding boot reason in the
ChromeOS case. If vboot is enabled, it will use information passed
in via the vboot handoff table in cbmem to determine mode and
reason in the case of recovery.
BUG=chromium:373467
BRANCH=nyan
TEST=built along with follow-up CL and booted on Big under various
modes, verified entry was added to eventlog with "mosys eventlog list"
Signed-off-by: David Hendricks <dhendrix(a)chromium.org>
Original-Change-Id: I50a7aa6d55eb46413fe9929e732d6eb18c758d4b
Original-Reviewed-on: https://chromium-review.googlesource.com/199690
Original-Reviewed-by: Duncan Laurie <dlaurie(a)chromium.org>
Original-Commit-Queue: David Hendricks <dhendrix(a)chromium.org>
Original-Tested-by: David Hendricks <dhendrix(a)chromium.org>
(cherry picked from commit 961c0bd1dd5512b1c2feb2ed4391bf507900eb7a)
Signed-off-by: Marc Jones <marc.jones(a)se-eng.com>
Change-Id: I6ae4e2a891966d2d1de7d37dcc551383e94e4d75
---
src/vendorcode/google/chromeos/Makefile.inc | 2 +-
src/vendorcode/google/chromeos/chromeos.h | 4 +++
src/vendorcode/google/chromeos/elog.c | 55 +++++++++++++++++++++++++++++
3 files changed, 60 insertions(+), 1 deletion(-)
diff --git a/src/vendorcode/google/chromeos/Makefile.inc b/src/vendorcode/google/chromeos/Makefile.inc
index 678c4ee..e17f50c 100644
--- a/src/vendorcode/google/chromeos/Makefile.inc
+++ b/src/vendorcode/google/chromeos/Makefile.inc
@@ -22,7 +22,7 @@ ramstage-$(CONFIG_ARCH_RAMSTAGE_X86_32) += vbnv_cmos.c
romstage-$(CONFIG_ARCH_ROMSTAGE_ARMV7) += vbnv_ec.c
ramstage-$(CONFIG_ARCH_RAMSTAGE_ARMV7) += vbnv_ec.c
romstage-$(CONFIG_ARCH_ROMSTAGE_X86_32) += vboot.c
-
+ramstage-$(CONFIG_ELOG) += elog.c
ramstage-y += gnvs.c
romstage-y += fmap.c
ramstage-y += fmap.c
diff --git a/src/vendorcode/google/chromeos/chromeos.h b/src/vendorcode/google/chromeos/chromeos.h
index 9b2537d..a2ecac8 100644
--- a/src/vendorcode/google/chromeos/chromeos.h
+++ b/src/vendorcode/google/chromeos/chromeos.h
@@ -34,8 +34,12 @@ void save_vbnv(const uint8_t *vbnv_copy);
#if CONFIG_CHROMEOS
/* functions implemented in vboot.c */
void init_chromeos(int bootmode);
+
+/* functions implemented in elog.c */
+void elog_add_boot_reason(void);
#else
static inline void init_chromeos(int bootmode) { }
+static inline void elog_add_boot_reason(void) { return; }
#endif /* CONFIG_CHROMEOS */
struct romstage_handoff;
diff --git a/src/vendorcode/google/chromeos/elog.c b/src/vendorcode/google/chromeos/elog.c
new file mode 100644
index 0000000..8bf9efc
--- /dev/null
+++ b/src/vendorcode/google/chromeos/elog.c
@@ -0,0 +1,55 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2014 The ChromiumOS Authors. All rights reserved.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA
+ */
+
+#include <cbmem.h>
+#include <console/console.h>
+#include <elog.h>
+#include <vendorcode/google/chromeos/chromeos.h>
+#if CONFIG_VBOOT_VERIFY_FIRMWARE
+#include "vboot_handoff.h"
+#include <vboot_struct.h>
+#endif
+
+void elog_add_boot_reason(void)
+{
+ if (developer_mode_enabled()) {
+ elog_add_event(ELOG_TYPE_CROS_DEVELOPER_MODE);
+ printk(BIOS_DEBUG, "%s: Logged dev mode boot\n", __func__);
+ } else if (recovery_mode_enabled()) {
+ u8 reason = 0;
+#if CONFIG_VBOOT_VERIFY_FIRMWARE
+ struct vboot_handoff *vbho = cbmem_find(CBMEM_ID_VBOOT_HANDOFF);
+
+ reason = get_recovery_mode_from_vbnv();
+ if (vbho && !reason) {
+ VbSharedDataHeader *sd = (VbSharedDataHeader *)
+ vbho->shared_data;
+ reason = sd->recovery_reason;
+ }
+#endif
+
+ elog_add_event_byte(ELOG_TYPE_CROS_RECOVERY_MODE,
+ reason ? reason : ELOG_CROS_RECOVERY_MODE_BUTTON);
+ printk(BIOS_DEBUG, "%s: Logged recovery mode boot, "
+ "reason: 0x%02x\n", __func__, reason);
+ } else {
+ printk(BIOS_DEBUG, "%s: Normal mode boot, nothing "
+ "interesting to log\n", __func__);
+ }
+}
the following patch was just integrated into master:
commit d816a0251ece04f87ca9c5d4fa916583c7fee86d
Author: Kane Chen <kane.chen(a)intel.com>
Date: Tue May 20 13:06:40 2014 +0800
baytrail: add more gpio init macros
GPIO init marcos are not enough to initialize different gpio attributes
BUG=none
TEST=emerge-rambi coreboot works well
Original-Change-Id: I193fa7b3e22632cacb555e726e3dd3991f4f4faa
Original-Signed-off-by: Kane Chen <kane.chen(a)intel.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/200531
Original-Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
(cherry picked from commit 5e0fcbcd7cefcfccb5b565003336d197bb29e4cc)
Signed-off-by: Marc Jones <marc.jones(a)se-eng.com>
Change-Id: I6bf4db9397733a003dfdedc6eb63b82127917851
Reviewed-on: http://review.coreboot.org/7953
Tested-by: build bot (Jenkins)
Reviewed-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
See http://review.coreboot.org/7953 for details.
-gerrit
the following patch was just integrated into master:
commit a859aa3df5c56f7d0d2d0969c4de601b93e4c101
Author: Ken Chang <kenc(a)nvidia.com>
Date: Thu May 22 10:54:16 2014 +0800
nyan*: Set GEN2 I2C pads to open-drain mode
The VDDIO to GEN2 I2C SCL/SDA pins is 1.8V and the external
pull-up voltage is 3.3V (the external 3.3V > I/O 1.8V) thus
the pinmux E_OD bit of these two pins needs to be set to
ensure GEN2 I2C pads work fine on 3.3V.
BRANCH=nyan
BUG=none
TEST=observed voltage drop from 3.3V to 2.36V on gen2 i2c
on blaze w/o this change. the waveform looks good on both
scl/sda pins w/ this change.
Original-Change-Id: I1b97f0c9c7580d1e532c3bdf7ac8690241ee7ee3
Original-Signed-off-by: Ken Chang <kenc(a)nvidia.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/200996
Original-Reviewed-by: Julius Werner <jwerner(a)chromium.org>
(cherry picked from commit 2db39166ec525e56a19746f38a867305a2687365)
Signed-off-by: Marc Jones <marc.jones(a)se-eng.com>
Change-Id: I0c84eade89311baf0a6f180cb5cc9e2145f6b7ea
Reviewed-on: http://review.coreboot.org/7952
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
Reviewed-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
See http://review.coreboot.org/7952 for details.
-gerrit
the following patch was just integrated into master:
commit 9e208bc357b9357c05ad05fe4482ffaeb0047312
Author: Vadim Bendebury <vbendeb(a)chromium.org>
Date: Tue May 13 15:43:58 2014 -0700
Print segment clean up information only when required.
Eliminate duplicated printout and if needed, print only changed
information.
BUG=none
TEST=verified that the 'New segment dstaddr...' message is not
duplicated anymore
Original-Change-Id: Ia13593394fccbb225f2bd9ab2b9228bac29d50fb
Original-Signed-off-by: Vadim Bendebury <vbendeb(a)chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/199672
Original-Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
(cherry picked from commit aadf018821ebfa63d6ac9d2429ae1fb483dd6cb3)
Signed-off-by: Marc Jones <marc.jones(a)se-eng.com>
Change-Id: I7544bddc4026191395cfe3b8ac66256ec223391e
Reviewed-on: http://review.coreboot.org/7937
Reviewed-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Tested-by: build bot (Jenkins)
See http://review.coreboot.org/7937 for details.
-gerrit
the following patch was just integrated into master:
commit 0dadb767a0e6399b0b24becd838b452d2f12beb2
Author: Shawn Nematbakhsh <shawnn(a)chromium.org>
Date: Fri May 16 15:40:21 2014 -0700
rambi: Add _PRW for LID0 ACPI Device
The kernel will not track wakeup events for devices unless they have
a defined _PRW. There is no EC output of the lid signal coming to
a GPIO and instead it pulses PCH_WAKE#.
BUG=chrome-os-partner:27631
TEST=Manual on Rambi.
- Run lidclose + lidopen on EC console, verify that wakeup_count
increments.
- Run lidclose + lidopen in rapid succession, verify that suspend
request is aborted.
BRANCH=Rambi.
Original-Change-Id: I8d4c58a7bb37d7e474ec094fe96e46e1bfd980de
Original-Signed-off-by: Shawn Nematbakhsh <shawnn(a)chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/200289
Original-Reviewed-by: Duncan Laurie <dlaurie(a)chromium.org>
(cherry picked from commit 08c6b42f1ed1af7fff6217e6b71469edd7ff4b2e)
Signed-off-by: Marc Jones <marc.jones(a)se-eng.com>
Change-Id: Iee813ed6f39cd3d5e0a2bdd395c740f82a1cf01a
Reviewed-on: http://review.coreboot.org/7945
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
Reviewed-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
See http://review.coreboot.org/7945 for details.
-gerrit