Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10900
-gerrit
commit 2479813deeab5919b167f2595ed964a8a4637f78
Author: Furquan Shaikh <furquan(a)google.com>
Date: Fri Jul 10 17:36:49 2015 -0700
smaug: Set LDO2 voltage to 1.8V
LDO2 regulator is used as an always-on reference for the droop alert
circuit. Set output voltage to match kernel settings.
CQ-DEPEND=CL:284649
BUG=chrome-os-partner:42305
BRANCH=None
TEST=Compiles successfully and boots to kernel prompt
Change-Id: I5ef4e266d8ec278dadffa846af8dc49b6d18c37e
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
Original-Commit-Id: 611465f6248cba0ddce0083b431cb7ee17bc4b4c
Original-Change-Id: I58cc473452b871392d813387707a0b8288e46561
Original-Signed-off-by: Furquan Shaikh <furquan(a)google.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/284879
Original-Tested-by: Furquan Shaikh <furquan(a)chromium.org>
Original-Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
Original-Commit-Queue: Furquan Shaikh <furquan(a)chromium.org>
Original-Trybot-Ready: Furquan Shaikh <furquan(a)chromium.org>
---
src/mainboard/google/smaug/pmic.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/mainboard/google/smaug/pmic.c b/src/mainboard/google/smaug/pmic.c
index 73aa0de..b10e67b 100644
--- a/src/mainboard/google/smaug/pmic.c
+++ b/src/mainboard/google/smaug/pmic.c
@@ -95,6 +95,13 @@ void pmic_init(unsigned bus)
pmic_write_reg_77620(bus, MAX77620_CNFG2SD_REG, 0x04, 1);
pmic_write_reg_77620(bus, MAX77620_SD1_REG, 0x2a, 1);
+ /*
+ * MAX77620: Set LDO2 output to 1.8V. LDO2 is used as always-on
+ * reference for the droop alert circuit. Match this setting with what
+ * the kernel expects.
+ */
+ pmic_write_reg_77620(bus, MAX77620_CNFG1_L2_REG, 0x14, 1);
+
/* MAX77621: Set VOUT_REG to 1.0V - CPU VREG */
pmic_write_reg_77621(bus, MAX77621_VOUT_REG, 0xBF, 1);
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10899
-gerrit
commit b845fe9ddcaa9e2557ddd2cfe1b831c878155b2a
Author: Furquan Shaikh <furquan(a)google.com>
Date: Fri Jul 10 15:29:13 2015 -0700
t210: Apply A57 hardware issue workaround during cpu startup
Define custom stage_entry to apply workaround for A57 hardware issue
for power on reset. It is observed that BTB contains stale data after
power on reset. This could lead to unexpected branching and crashes at
random intervals during the boot flow. Thus, invalidate the BTB
immediately after power on reset.
BUG=chrome-os-partner:41877
BRANCH=None
TEST=Compiles successfully and reboot test does not crash in firmware
for 10K iterations.
Change-Id: Ifbc9667bc5556112374f35733192b67b64a345d2
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
Original-Commit-Id: bc7c2fec3c6b29e291235669ba9f22ff611064a7
Original-Change-Id: I1f5714074afdfee64b88cea8a394936ca848634b
Original-Signed-off-by: Furquan Shaikh <furquan(a)google.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/284869
Original-Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
Original-Trybot-Ready: Furquan Shaikh <furquan(a)chromium.org>
Original-Tested-by: Furquan Shaikh <furquan(a)chromium.org>
Original-Commit-Queue: Furquan Shaikh <furquan(a)chromium.org>
---
src/soc/nvidia/tegra210/Makefile.inc | 3 +-
src/soc/nvidia/tegra210/reset_handler.S | 75 --------------------------
src/soc/nvidia/tegra210/stage_entry.S | 95 +++++++++++++++++++++++++++++++++
3 files changed, 97 insertions(+), 76 deletions(-)
diff --git a/src/soc/nvidia/tegra210/Makefile.inc b/src/soc/nvidia/tegra210/Makefile.inc
index 3b2dc7c..8d7e1fc 100644
--- a/src/soc/nvidia/tegra210/Makefile.inc
+++ b/src/soc/nvidia/tegra210/Makefile.inc
@@ -101,13 +101,14 @@ ramstage-$(CONFIG_DRIVERS_UART) += uart.c
ramstage-y += ../tegra/usb.c
ramstage-$(CONFIG_ARM64_USE_SECURE_MONITOR) += secmon.c
ramstage-$(CONFIG_HAVE_MTC) += mtc.c
+ramstage-y += stage_entry.S
secmon-y += cpu.c
secmon-y += cpu_lib.S
secmon-y += flow_ctrl.c
secmon-y += power.c
secmon-y += psci.c
-secmon-y += reset_handler.S
+secmon-y += stage_entry.S
secmon-y += uart.c
secmon-y += gic.c
diff --git a/src/soc/nvidia/tegra210/reset_handler.S b/src/soc/nvidia/tegra210/reset_handler.S
deleted file mode 100644
index 53622b1..0000000
--- a/src/soc/nvidia/tegra210/reset_handler.S
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2015, NVIDIA CORPORATION. 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.
- */
-
-#include <arch/asm.h>
-
-#define CPUACTLR_EL1 s3_1_c15_c2_0
-
-CPU_RESET_ENTRY(tegra210_reset_handler)
- /*
- * Invalidate BTB along with I$ to remove any stale entries
- * from the branch predictor array.
- */
- mrs x0, CPUACTLR_EL1
- orr x0, x0, #1
- msr CPUACTLR_EL1, x0 /* invalidate BTB and I$ together */
- dsb sy
- isb
- ic iallu /* invalidate */
- dsb sy
- isb
-
- bic x0, x0, #1
- msr CPUACTLR_EL1, x0 /* restore original CPUACTLR_EL1 */
- dsb sy
- isb
-
- .rept 7
- nop /* wait */
- .endr
-
- /*
- * Extract OSLK bit and check if it is '1'. This bit remains '0'
- * for A53. If '1', turn off regional clock gating and request
- * warm reset.
- */
- mrs x0, oslsr_el1
- and x0, x0, #2 /* extract oslk bit */
- mrs x1, mpidr_el1
- bics xzr, x0, x1, lsr #7 /* 0 if slow cluster */
- b.eq __restore_oslock
- mov x0, xzr
- msr oslar_el1, x0 /* os lock stays 0 across warm reset */
- mov x3, #3
- movz x4, #0x8000, lsl #48
- msr CPUACTLR_EL1, x4 /* turn off RCG */
- isb
- msr rmr_el3, x3 /* request warm reset */
- isb
- dsb sy
- wfi
-
- /*
- * These nops are here so that speculative execution won't harm us
- * before we are done warm reset.
- */
- .rept 65
- nop
- .endr
-
-__restore_oslock:
- mov x0, #1
- msr oslar_el1, x0
-
- b arm64_cpu_startup_resume
-ENDPROC(tegra210_reset_handler)
diff --git a/src/soc/nvidia/tegra210/stage_entry.S b/src/soc/nvidia/tegra210/stage_entry.S
new file mode 100644
index 0000000..ee0265f
--- /dev/null
+++ b/src/soc/nvidia/tegra210/stage_entry.S
@@ -0,0 +1,95 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved.
+ * 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.
+ *
+ * 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 <arch/asm.h>
+#include <cpu/cortex_a57.h>
+
+/*
+ * It is observed that BTB contains stale data after power on reset. This could
+ * lead to unexpected branching and crashes at random intervals during the boot
+ * flow. Thus, invalidate the BTB immediately after power on reset.
+ */
+.macro t210_a57_fixup
+ /*
+ * Invalidate BTB along with I$ to remove any stale entries
+ * from the branch predictor array.
+ */
+ mrs x0, CPUACTLR_EL1
+ orr x0, x0, #BTB_INVALIDATE
+ msr CPUACTLR_EL1, x0 /* invalidate BTB and I$ together */
+ dsb sy
+ isb
+ ic iallu /* invalidate */
+ dsb sy
+ isb
+
+ bic x0, x0, #BTB_INVALIDATE
+ msr CPUACTLR_EL1, x0 /* restore original CPUACTLR_EL1 */
+ dsb sy
+ isb
+
+ .rept 7
+ nop /* wait */
+ .endr
+
+ /*
+ * Extract OSLK bit and check if it is '1'. This bit remains '0'
+ * for A53. If '1', turn off regional clock gating and request
+ * warm reset.
+ */
+ mrs x0, oslsr_el1
+ and x0, x0, #2 /* extract oslk bit */
+ mrs x1, mpidr_el1
+ bics xzr, x0, x1, lsr #7 /* 0 if slow cluster */
+ b.eq 1000f
+ mov x0, xzr
+ msr oslar_el1, x0 /* os lock stays 0 across warm reset */
+ mov x3, #3
+ movz x4, #0x8000, lsl #48
+ msr CPUACTLR_EL1, x4 /* turn off RCG */
+ isb
+ msr rmr_el3, x3 /* request warm reset */
+ isb
+ dsb sy
+ wfi
+
+ /*
+ * These nops are here so that speculative execution won't harm us
+ * before we are done warm reset.
+ */
+ .rept 65
+ nop
+ .endr
+
+1000:
+ /* Restore os lock */
+ mov x0, #1
+ msr oslar_el1, x0
+.endm
+
+ENTRY(stage_entry)
+ t210_a57_fixup
+ b arm64_cpu_startup
+ENDPROC(stage_entry)
+
+ENTRY(tegra210_reset_handler)
+ t210_a57_fixup
+ b arm64_cpu_startup_resume
+ENDPROC(tegra210_reset_handler)
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10898
-gerrit
commit b509965c6f5bdc2eb5a5f790ec93d46ff187f070
Author: Furquan Shaikh <furquan(a)google.com>
Date: Fri Jul 10 15:27:02 2015 -0700
arm64/a57: Move cortex_a57.h under include directory
BUG=chrome-os-partner:41877
BRANCH=None
TEST=Compiles successfully
Change-Id: I8a94176a3faacb25ae5e9eaeaac4011ddf5af6a1
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
Original-Commit-Id: 802cba6f28a4e683256e8ce9fb6395acecdc9397
Original-Change-Id: I3a5983d4a40466bc0aa8ab3bd8430ab6cdd093cc
Original-Signed-off-by: Furquan Shaikh <furquan(a)google.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/284868
Original-Reviewed-by: Yen Lin <yelin(a)nvidia.com>
Original-Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
Original-Trybot-Ready: Furquan Shaikh <furquan(a)chromium.org>
Original-Tested-by: Furquan Shaikh <furquan(a)chromium.org>
Original-Commit-Queue: Furquan Shaikh <furquan(a)chromium.org>
---
src/arch/arm64/cpu/cortex_a57.S | 2 +-
src/arch/arm64/cpu/cortex_a57.h | 32 ------------------------------
src/arch/arm64/include/cpu/cortex_a57.h | 35 +++++++++++++++++++++++++++++++++
3 files changed, 36 insertions(+), 33 deletions(-)
diff --git a/src/arch/arm64/cpu/cortex_a57.S b/src/arch/arm64/cpu/cortex_a57.S
index ce8534b..4535d2b 100644
--- a/src/arch/arm64/cpu/cortex_a57.S
+++ b/src/arch/arm64/cpu/cortex_a57.S
@@ -19,7 +19,7 @@
#include <arch/asm.h>
#include <arch/cache_helpers.h>
-#include "cortex_a57.h"
+#include <cpu/cortex_a57.h>
ENTRY(arm64_cpu_early_setup)
mrs x0, CPUECTLR_EL1
diff --git a/src/arch/arm64/cpu/cortex_a57.h b/src/arch/arm64/cpu/cortex_a57.h
deleted file mode 100644
index 5bd6160..0000000
--- a/src/arch/arm64/cpu/cortex_a57.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * 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.
- *
- * 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.
- */
-
-#ifndef __ARCH_ARM64_CORTEX_A57_H__
-#define __ARCH_ARM64_CORTEX_A57_H__
-
-#define CPUECTLR_EL1 S3_1_c15_c2_1
-#define SMPEN_SHIFT 6
-
-/* Cortex MIDR[15:4] PN */
-#define CORTEX_A53_PN 0xd03
-
-/* Double lock control bit */
-#define OSDLR_DBL_LOCK_BIT 1
-
-#endif /* __ARCH_ARM64_CORTEX_A57_H__ */
diff --git a/src/arch/arm64/include/cpu/cortex_a57.h b/src/arch/arm64/include/cpu/cortex_a57.h
new file mode 100644
index 0000000..113a6ff
--- /dev/null
+++ b/src/arch/arm64/include/cpu/cortex_a57.h
@@ -0,0 +1,35 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * 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.
+ *
+ * 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.
+ */
+
+#ifndef __ARCH_ARM64_CORTEX_A57_H__
+#define __ARCH_ARM64_CORTEX_A57_H__
+
+#define CPUACTLR_EL1 s3_1_c15_c2_0
+#define BTB_INVALIDATE (1 << 0)
+
+#define CPUECTLR_EL1 S3_1_c15_c2_1
+#define SMPEN_SHIFT 6
+
+/* Cortex MIDR[15:4] PN */
+#define CORTEX_A53_PN 0xd03
+
+/* Double lock control bit */
+#define OSDLR_DBL_LOCK_BIT 1
+
+#endif /* __ARCH_ARM64_CORTEX_A57_H__ */
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10897
-gerrit
commit 7c9eba16a7da49de650905e43a81c4f761086b7a
Author: Furquan Shaikh <furquan(a)google.com>
Date: Fri Jul 10 15:25:26 2015 -0700
arm64: Define stage_entry as weak symbol
This allows SoCs/CPUs to have custom stage_entry in order to apply any
fixups that need to run before standard cpu reset procedure.
BUG=chrome-os-partner:41877
BRANCH=None
TEST=Compiles successfully
Change-Id: Iaae7636349140664b19e81b0082017b63b13f45b
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
Original-Commit-Id: 498d04b0e9a3394943f03cad603c30ae8b3805d4
Original-Change-Id: I9a005502d4cfcb76017dcae3a655efc0c8814a93
Original-Signed-off-by: Furquan Shaikh <furquan(a)google.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/284867
Original-Trybot-Ready: Furquan Shaikh <furquan(a)chromium.org>
Original-Tested-by: Furquan Shaikh <furquan(a)chromium.org>
Original-Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
Original-Commit-Queue: Furquan Shaikh <furquan(a)chromium.org>
---
src/arch/arm64/include/arch/asm.h | 4 ++++
src/arch/arm64/stage_entry.S | 8 +++++++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/arch/arm64/include/arch/asm.h b/src/arch/arm64/include/arch/asm.h
index 0dc2974..851f3f9 100644
--- a/src/arch/arm64/include/arch/asm.h
+++ b/src/arch/arm64/include/arch/asm.h
@@ -41,4 +41,8 @@
*/
#define CPU_RESET_ENTRY(name) ENTRY_WITH_ALIGN(name, 6)
+#define ENTRY_WEAK(name) \
+ ENTRY(name) \
+ .weak name \
+
#endif /* __ARM_ARM64_ASM_H */
diff --git a/src/arch/arm64/stage_entry.S b/src/arch/arm64/stage_entry.S
index 5ff2c4e..4e15dbb 100644
--- a/src/arch/arm64/stage_entry.S
+++ b/src/arch/arm64/stage_entry.S
@@ -228,6 +228,12 @@ CPU_RESET_ENTRY(arm64_cpu_startup_resume)
b arm64_c_environment
ENDPROC(arm64_cpu_startup_resume)
-ENTRY(stage_entry)
+/*
+ * stage_entry is defined as a weak symbol to allow SoCs/CPUs to define a custom
+ * entry point to perform any fixups that need to be done immediately after
+ * power on reset. In case SoC/CPU does not need any custom-defined entrypoint,
+ * this weak symbol can be used to jump directly to arm64_cpu_startup.
+ */
+ENTRY_WEAK(stage_entry)
b arm64_cpu_startup
ENDPROC(stage_entry)
the following patch was just integrated into master:
commit 6df355da879797899eb6337eb21868163c1ee07d
Author: Julius Werner <jwerner(a)chromium.org>
Date: Thu Jul 9 15:47:07 2015 -0700
libpayload: Fix arithmetic precedence in div_round_up()
Well, this is just embarrassing...
BRANCH=None
BUG=None
TEST=None
Change-Id: I7c443d2100b6861d736320ac14c1bd9965937a66
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
Original-Commit-Id: 455e3784882ea1b76bcf8e17724869e37d9c629d
Original-Change-Id: Ia33e98aeaa8e78e3e3d2c7547e673a623ea86ce2
Original-Signed-off-by: Julius Werner <jwerner(a)chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/284596
Original-Reviewed-by: Duncan Laurie <dlaurie(a)chromium.org>
Reviewed-on: http://review.coreboot.org/10879
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi(a)google.com>
Reviewed-by: Martin Roth <gaumless(a)gmail.com>
See http://review.coreboot.org/10879 for details.
-gerrit
the following patch was just integrated into master:
commit 3ae5044b7330ea4af0214b7db29749eed17f2e66
Author: Furquan Shaikh <furquan(a)google.com>
Date: Tue Jul 7 21:35:56 2015 -0700
t210: Add TZDRAM_BASE param to BL31_MAKEARGS
1. Make TTB_SIZE Kconfig option
2. Add Kconfig option for maximum secure component size
3. Add check in Makefile to ensure that Trustzone area is big enough
to hold TTB and secure components
4. Calculate TZDRAM_BASE depending upon TTB_SIZE and TZ_CARVEOUT_SIZE
BUG=chrome-os-partner:42319
BRANCH=None
Change-Id: I9ceb46ceedc931826657e5a0f6fc2b1886526bf8
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
Original-Commit-Id: a425d4978a467b157ea5d71e600242ebf427b5bb
Original-Change-Id: I152a38830773d85aafab49c92cef945b7c4eb62c
Original-Signed-off-by: Furquan Shaikh <furquan(a)google.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/284074
Original-Reviewed-by: Varun Wadekar <vwadekar(a)nvidia.com>
Original-Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
Original-Reviewed-by: Tom Warren <twarren(a)nvidia.com>
Original-Commit-Queue: Furquan Shaikh <furquan(a)chromium.org>
Original-Trybot-Ready: Furquan Shaikh <furquan(a)chromium.org>
Original-Tested-by: Furquan Shaikh <furquan(a)chromium.org>
Reviewed-on: http://review.coreboot.org/10878
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
See http://review.coreboot.org/10878 for details.
-gerrit
the following patch was just integrated into master:
commit ccc55fdc6fae37a085e9f1a8a19a539728907ca1
Author: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Date: Mon Jun 29 16:44:12 2015 -0700
coreinfo: fix compilation
- extra rule for config.h creation
- include kconfig.h from libpayload
- libpayload symbols are conflicting with gcc builtins (e.g. log2)
- ALIGN() is already defined in libpayload these days
- move libpayload build directory under build/
Change-Id: I2aefdde26853253d58f6cf6e186e784871c1cb5b
Signed-off-by: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Reviewed-on: http://review.coreboot.org/10717
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi(a)google.com>
See http://review.coreboot.org/10717 for details.
-gerrit