You-Cheng Syu has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31844
Change subject: google/kukui: Enable EC_GOOGLE_CHROMEEC_AP_WATCHDOG_FLAG
......................................................................
google/kukui: Enable EC_GOOGLE_CHROMEEC_AP_WATCHDOG_FLAG
Kukui AP doesn't remember if the last AP reset was due to AP watchdog.
We need to enable EC_GOOGLE_CHROMEEC_AP_WATCHDOG_FLAG so that it will
query the reset reason from EC during watchdog initialization.
Besides, we should set BOOTBLOCK_EN_L before mtk_wdt_init so that we can
communicate with EC at the time.
BUG=b:109900671,b:118654976
BRANCH=none
TEST=1. run 'mosys eventlog clear; stop daisydog; echo > /dev/watchdog'
2. wait for watchdog reset
3. see 'WDT: Last reset was hardware watchdog' in AP console
4. check 'mosys eventlog list | grep watchdog'
Change-Id: I053cc7664bbaf0d3fcae26ba9481a0ad700dca90
Signed-off-by: You-Cheng Syu <youcheng(a)google.com>
---
M src/mainboard/google/kukui/Kconfig
M src/mainboard/google/kukui/early_init.c
2 files changed, 3 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/44/31844/1
diff --git a/src/mainboard/google/kukui/Kconfig b/src/mainboard/google/kukui/Kconfig
index 9f477e5..4d4feac 100644
--- a/src/mainboard/google/kukui/Kconfig
+++ b/src/mainboard/google/kukui/Kconfig
@@ -33,6 +33,7 @@
select FATAL_ASSERTS
select SPI_FLASH_INCLUDE_ALL_DRIVERS
select EC_GOOGLE_CHROMEEC
+ select EC_GOOGLE_CHROMEEC_AP_WATCHDOG_FLAG
select EC_GOOGLE_CHROMEEC_BOARDID
select EC_GOOGLE_CHROMEEC_SPI
select MAINBOARD_HAS_SPI_TPM_CR50 if VBOOT
diff --git a/src/mainboard/google/kukui/early_init.c b/src/mainboard/google/kukui/early_init.c
index a16a335..9495af3 100644
--- a/src/mainboard/google/kukui/early_init.c
+++ b/src/mainboard/google/kukui/early_init.c
@@ -25,11 +25,11 @@
void mainboard_early_init(void)
{
- mt8183_early_init();
-
/* Turn on real eMMC and allow communication to EC. */
gpio_output(BOOTBLOCK_EN_L, 1);
+ mt8183_early_init();
+
setup_chromeos_gpios();
/* Declare we are in S0 */
--
To view, visit https://review.coreboot.org/c/coreboot/+/31844
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I053cc7664bbaf0d3fcae26ba9481a0ad700dca90
Gerrit-Change-Number: 31844
Gerrit-PatchSet: 1
Gerrit-Owner: You-Cheng Syu <youcheng(a)google.com>
Gerrit-MessageType: newchange
Jacob Garber has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/32291
Change subject: nb/via/vx900: Use 64 bits to prevent overflow
......................................................................
nb/via/vx900: Use 64 bits to prevent overflow
The bit operations are currently done using 32 bit math.
Cast the first argument to 64 bits to prevent possible
overflow.
Found-by: Coverity Scan, CID 1229665, 1229666
Signed-off-by: Jacob Garber <jgarber1(a)ualberta.ca>
Change-Id: Idd180f31e8cff797a6499b12bc685daa993aae05
---
M src/northbridge/via/vx900/northbridge.c
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/91/32291/1
diff --git a/src/northbridge/via/vx900/northbridge.c b/src/northbridge/via/vx900/northbridge.c
index d865f38..dcb7fd5 100644
--- a/src/northbridge/via/vx900/northbridge.c
+++ b/src/northbridge/via/vx900/northbridge.c
@@ -266,8 +266,8 @@
* to be always mapped to the top of 1M, but this can be overcome with
* some smart positive/subtractive resource decoding */
ram_resource(dev, idx++, 768, (tolmk - 768));
- uma_memory_size = fbufk << 10;
- uma_memory_base = tolmk << 10;
+ uma_memory_size = (uint64_t)fbufk << 10;
+ uma_memory_base = (uint64_t)tolmk << 10;
//uma_resource(dev, idx++, uma_memory_base>>10, uma_memory_size>>10);
--
To view, visit https://review.coreboot.org/c/coreboot/+/32291
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Idd180f31e8cff797a6499b12bc685daa993aae05
Gerrit-Change-Number: 32291
Gerrit-PatchSet: 1
Gerrit-Owner: Jacob Garber <jgarber1(a)ualberta.ca>
Gerrit-MessageType: newchange
Kane Chen has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/32246
Change subject: mb/google/octopus: Disable WLAN prior the entry of S5
......................................................................
mb/google/octopus: Disable WLAN prior the entry of S5
ODM reported issues that some systems can't be shutdown to S5 very
occasionally.
ODM found issue is gone if they remove the WLAN card.
So, this change to disable WLAN before system enters S5.
This change is validated by ODM and it does help issue.
BUG=b:129377927
Change-Id: Ib8e81022b8c9b63bc75e5cc14121233222da7595
Signed-off-by: Kane Chen <kane.chen(a)intel.com>
---
M src/mainboard/google/octopus/variants/baseboard/gpio.c
1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/46/32246/1
diff --git a/src/mainboard/google/octopus/variants/baseboard/gpio.c b/src/mainboard/google/octopus/variants/baseboard/gpio.c
index 5326118..3305c02 100644
--- a/src/mainboard/google/octopus/variants/baseboard/gpio.c
+++ b/src/mainboard/google/octopus/variants/baseboard/gpio.c
@@ -341,6 +341,8 @@
static const struct pad_config sleep_s5_gpio_table[] = {
/* BT_DISABLE_L */
PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_109, 0, DEEP, NONE, Tx0RxDCRx1, SAME),
+ /* WLAN_DISABLE_L */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_116, 0, DEEP, NONE, Tx0RxDCRx1, SAME),
};
const struct pad_config *__weak
--
To view, visit https://review.coreboot.org/c/coreboot/+/32246
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ib8e81022b8c9b63bc75e5cc14121233222da7595
Gerrit-Change-Number: 32246
Gerrit-PatchSet: 1
Gerrit-Owner: Kane Chen <kane.chen(a)intel.com>
Gerrit-MessageType: newchange
Martin Roth has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/32415
Change subject: soc/amd/picasso: Add code to support Romstage in RAM
......................................................................
soc/amd/picasso: Add code to support Romstage in RAM
AMD's Picasso SOC brings up memory before releasing the X86 processor,
and jumps directly to Romstage. This adds the platform support for that.
TEST=None
BUG=b:130804851
Signed-off-by: Martin Roth <martinroth(a)chromium.org>
Change-Id: I5ac62f6f3edb0c903fdc880fa655727ad2bc86bb
---
M src/soc/amd/picasso/Kconfig
A src/soc/amd/picasso/include/soc/romstage.ld
A src/soc/amd/picasso/reset_vector.S
3 files changed, 187 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/15/32415/1
diff --git a/src/soc/amd/picasso/Kconfig b/src/soc/amd/picasso/Kconfig
index 129dedf..3d30b46b 100644
--- a/src/soc/amd/picasso/Kconfig
+++ b/src/soc/amd/picasso/Kconfig
@@ -26,6 +26,7 @@
select ARCH_VERSTAGE_X86_32
select ARCH_ROMSTAGE_X86_32
select ARCH_RAMSTAGE_X86_32
+ select ROMSTAGE_IN_RAM
select X86_AMD_FIXED_MTRRS
select ACPI_AMD_HARDWARE_SLEEP_VALUES
select COLLECT_TIMESTAMPS_NO_TSC
diff --git a/src/soc/amd/picasso/include/soc/romstage.ld b/src/soc/amd/picasso/include/soc/romstage.ld
new file mode 100644
index 0000000..4be3340
--- /dev/null
+++ b/src/soc/amd/picasso/include/soc/romstage.ld
@@ -0,0 +1,29 @@
+/*
+ * 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.
+ */
+
+#if ENV_ROMSTAGE && CONFIG(ROMSTAGE_IN_RAM)
+SECTIONS {
+ _JMP_IN_RAM = CONFIG_ROMSTAGE_ADDR + CONFIG_ROMSTAGE_MAX_SIZE - 0x1000;
+ . = _JMP_IN_RAM;
+ .resetram . : { *(.resetram) }
+ _RST_IN_RAM = CONFIG_ROMSTAGE_ADDR + CONFIG_ROMSTAGE_MAX_SIZE - 0x10;
+ . = _RST_IN_RAM;
+ .reset . : {
+ *(.reset);
+ . = 15;
+ BYTE(0x00);
+ }
+}
+#endif
diff --git a/src/soc/amd/picasso/reset_vector.S b/src/soc/amd/picasso/reset_vector.S
new file mode 100644
index 0000000..6a3bbfa
--- /dev/null
+++ b/src/soc/amd/picasso/reset_vector.S
@@ -0,0 +1,157 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2000, Ron Minnich rminnich(a)lanl.gov
+ * Advanced Computing Lab, LANL
+ * Copyright (C) 2019 Advanced Micro Devices, 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 <cpu/x86/cr.h>
+#include <cpu/x86/post_code.h>
+#include <arch/rom_segs.h>
+
+/* The resetram section keeps this code within reach of the first jmp to
+ * _start16bit. This functionality is contained within bootblock on most
+ * other systems, however this file is part of romstage which isn't subject
+ * to the same size limitations.
+ */
+.section ".resetram", "ax", %progbits
+
+.align 4096
+.code16
+.globl _start16bit
+.type _start16bit, @function
+
+_start16bit:
+ cli
+ /* Save the BIST result */
+ movl %eax, %ebp
+
+ post_code(POST_RESET_VECTOR_CORRECT)
+
+ /* IMMEDIATELY invalidate the translation lookaside buffer (TLB) before
+ * executing any further code. Even though paging is disabled we
+ * could still get false address translations due to the TLB if we
+ * didn't invalidate it. Thanks to kmliu(a)sis.com.tw for this TLB fix.
+ */
+
+ xorl %eax, %eax
+ movl %eax, %cr3 /* Invalidate TLB*/
+
+ /*
+ * Load an IDT with NULL limit to prevent the 16bit IDT being used
+ * in protected mode before c_start.S sets up a 32bit IDT when entering
+ * RAM stage. In practise: CPU will shutdown on any exception.
+ * See IA32 manual Vol 3A 19.26 Interrupts.
+ */
+ movl $nullidt_amd, %ebx
+ lidt %cs:(%bx)
+
+ movl $fseg_gdt, %ebx
+ lgdtl %cs:(%bx)
+
+ movl %cr0, %eax
+ andl $0x7FFAFFD1, %eax /* PG,AM,WP,NE,TS,EM,MP = 0 */
+ orl $0x60000001, %eax /* CD, NW, PE = 1 */
+ movl %eax, %cr0
+
+ /* Until now, the processor was executing in DRAM however the CS
+ * register's base and limit looked more like what you see after a
+ * traditional x86 reset. The value in CS has been 0xf000. Now that
+ * the GDT is loaded with flat descriptors, try to jump to
+ * 0x8:$__protected_start at its physical address in DRAM.
+ */
+ ljmpl $ROM_CODE_SEG, $__protected_start
+
+.align 4
+.globl nullidt_amd
+nullidt_amd:
+ .word 0 /* limit */
+ .long 0
+ .word 0
+
+ .align 4
+
+gdt:
+fseg_gdt:
+ .word gdt_end - gdt -1
+ .long gdt
+ .word 0
+
+ /* selgdt 0x08, flat code segment */
+ .word 0xffff, 0x0000
+ .byte 0x00, 0x9b, 0xcf, 0x00 /* G=1 and 0x0f, So we get 4Gbytes
+ for limit */
+
+ /* selgdt 0x10,flat data segment */
+ .word 0xffff, 0x0000
+ .byte 0x00, 0x93, 0xcf, 0x00
+
+ /* selgdt 0x18, flat code segment (64-bit) */
+ .word 0xffff, 0x0000
+ .byte 0x00, 0x9b, 0xaf, 0x00
+gdt_end:
+
+.code32
+.align 4
+
+__protected_start:
+ post_code(POST_ENTER_PROTECTED_MODE)
+
+ movw $ROM_DATA_SEG, %ax
+ movw %ax, %ds
+ movw %ax, %es
+ movw %ax, %ss
+ movw %ax, %fs
+ movw %ax, %gs
+
+#if CONFIG(SSE)
+enable_sse:
+ mov %cr4, %eax
+ or $CR4_OSFXSR, %ax
+ mov %eax, %cr4
+#endif /* CONFIG(SSE) */
+
+ cld
+ xor %eax, %eax
+ movl $(_car_region_end), %ecx
+ movl $(_car_region_start), %edi
+ sub %edi, %ecx
+ rep stosl
+
+ mov $_car_stack_end, %esp
+
+ /* Store BIST and an early timestamp at the top of the stack. See
+ * structure in soc/romstage.h for layout.
+ */
+ rdtsc /* timestamp */
+ push %edx
+ push %eax
+ push %ebp /* BIST */
+
+ and $0xfffffff0, %esp
+ sub $8, %esp
+
+ jmp _romstage_in_ram_continue
+
+.section ".reset", "ax", %progbits
+.code16
+.globl _start
+_start:
+ .byte 0xe9
+ .int _start16bit - ( . + 2 )
+ /* Note: The above jump is hand coded to work around bugs in binutils.
+ * 5 byte are used for a 3 byte instruction. This works because x86
+ * is little endian and allows us to use supported 32bit relocations
+ * instead of the weird 16 bit relocations that binutils does not
+ * handle consistently between versions because they are used so rarely.
+ */
--
To view, visit https://review.coreboot.org/c/coreboot/+/32415
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I5ac62f6f3edb0c903fdc880fa655727ad2bc86bb
Gerrit-Change-Number: 32415
Gerrit-PatchSet: 1
Gerrit-Owner: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-MessageType: newchange