Aamir Bohra has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/39581 )
Change subject: src/soc/intel/tigerlake: Update SD card ACPI device
......................................................................
src/soc/intel/tigerlake: Update SD card ACPI device
1. Add _DSM method
2. Add support to turn on/off the power enable
signal in _PS0/_PS3 methods.
Signed-off-by: Aamir Bohra <aamir.bohra(a)intel.com>
Change-Id: I4f944caa535bdc946eef1e0f518fe3ee344187b9
---
M src/soc/intel/tigerlake/acpi/scs.asl
M src/soc/intel/tigerlake/include/soc/gpio_soc_defs_jsl.h
2 files changed, 72 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/81/39581/1
diff --git a/src/soc/intel/tigerlake/acpi/scs.asl b/src/soc/intel/tigerlake/acpi/scs.asl
index a9ff93c..6b391a8 100644
--- a/src/soc/intel/tigerlake/acpi/scs.asl
+++ b/src/soc/intel/tigerlake/acpi/scs.asl
@@ -1,7 +1,7 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2019 Intel Corporation.
+ * Copyright (C) 2020 Intel Corporation.
*
* 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
@@ -84,6 +84,7 @@
Name (_ADR, 0x00140005)
Name (_DDN, "SD Controller")
Name (TEMP, 0)
+ Name (DSUU, ToUUID("f6c13ea5-65cd-461f-ab7a-29f7e8d5bd61"))
OperationRegion (SDPC, PCI_Config, 0x00, 0x100)
Field (SDPC, WordAcc, NoLock, Preserve)
@@ -95,6 +96,63 @@
PGEN, 1, /* PG_ENABLE */
}
+ /* _DSM x86 Device Specific Method
+ * Arg0: UUID Unique function identifier
+ * Arg1: Integer Revision Level
+ * Arg2: Integer Function Index (0 = Return Supported Functions)
+ * Arg3: Package Parameters
+ */
+ Method (_DSM, 4)
+ {
+ If (LEqual (Arg0, DSUU)) {
+ /* Check the revision */
+ If (LGreaterEqual (Arg1, Zero)) {
+ /*
+ * Function Index 0 the return value is a buffer containing
+ * one bit for each function index, starting with zero.
+ * Bit 0 - Indicates whether there is support for any functions other than function 0.
+ * Bit 1 - Indicates support to clear power control register
+ * Bit 2 - Indicates support to set power control register
+ * Bit 3 - Indicates support to set 1.8V signalling
+ * Bit 4 - Indicates support to set 3.3V signalling
+ * Bit 5 - Indicates support for HS200 mode
+ * Bit 6 - Indicates support for HS400 mode
+ * Bit 9 - Indicates eMMC I/O Driver Strength
+ */
+ /*
+ * For SD we have to support functions to
+ * set 1.8V signalling and 3.3V signalling [BIT4, BIT3]
+ */
+ If (LEqual (Arg2, Zero)) {
+ Return (Buffer () { 0x19 })
+ }
+ /*
+ * Function Index 3: Set 1.8v signalling.
+ * We put a sleep of 100ms in this method to
+ * work around a known issue with detecting
+ * UHS SD card on PCH. This is to compensate
+ * for the SD VR slowness.
+ */
+ If (LEqual (Arg2, 3)) {
+ Sleep (100)
+ Return(Buffer () { 0x00 })
+ }
+ /*
+ * Function Index 4: Set 3.3v signalling.
+ * We put a sleep of 100ms in this method to
+ * work around a known issue with detecting
+ * UHS SD card on PCH. This is to compensate
+ * for the SD VR slowness.
+ */
+ If (LEqual (Arg2, 4)) {
+ Sleep (100)
+ Return(Buffer () { 0x00 })
+ }
+ }
+ }
+ Return(Buffer() { 0x0 })
+ }
+
Method(_INI)
{
/* Clear register 0x1C20/0x4820 */
@@ -111,6 +169,9 @@
/* Set Power State to D0 */
And (PMCR, 0xFFFC, PMCR)
Store (PMCR, TEMP)
+
+ /* Change pad mode to Native */
+ GPMO(SD_PWR_EN_PIN, 0x1)
}
Method (_PS3, 0, Serialized)
@@ -120,6 +181,15 @@
/* Set Power State to D3 */
Or (PMCR, 0x0003, PMCR)
Store (PMCR, TEMP)
+
+ /* Change pad mode to GPIO control */
+ GPMO(SD_PWR_EN_PIN, 0x0)
+
+ /* Enable Tx Buffer */
+ GTXE(SD_PWR_EN_PIN, 0x1)
+
+ /* Drive TX to zero */
+ CTXS(SD_PWR_EN_PIN)
}
Device (CARD)
diff --git a/src/soc/intel/tigerlake/include/soc/gpio_soc_defs_jsl.h b/src/soc/intel/tigerlake/include/soc/gpio_soc_defs_jsl.h
index ce7d0d8..05e5696 100644
--- a/src/soc/intel/tigerlake/include/soc/gpio_soc_defs_jsl.h
+++ b/src/soc/intel/tigerlake/include/soc/gpio_soc_defs_jsl.h
@@ -37,7 +37,7 @@
#define GPIO_NUM_GROUPS 11
#define GPIO_MAX_NUM_PER_GROUP 24
-
+#define SD_PWR_EN_PIN GPP_H1
/*
* GPIOs are ordered monotonically increasing to match ACPI/OS driver.
*/
--
To view, visit https://review.coreboot.org/c/coreboot/+/39581
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I4f944caa535bdc946eef1e0f518fe3ee344187b9
Gerrit-Change-Number: 39581
Gerrit-PatchSet: 1
Gerrit-Owner: Aamir Bohra <aamir.bohra(a)intel.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-MessageType: newchange
Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/39187 )
Change subject: mb/emulation/qemu-armv7: Fix board
......................................................................
mb/emulation/qemu-armv7: Fix board
Fix multiple issues allowing to boot until "Payload not loaded":
* The FMAP_CACHE was placed in memory mapped flash
- Place the FMAP_CACHE in DRAM.
* The FMAP_CACHE was overlapping the BOOTBLOCK, which has a default size
of 128KiB.
- Increase the bootblock size in memlayout to 128KiB to match the FMAP.
* The heap in bootblock wasn't usable.
- Move the bootblock to DRAM and add custom relocation code.
* A FIT payload couldn't be compiled in as the POSTRAM_CBFS_CACHE was
missing.
- Add the POSTRAM_CBFS_CACHE to memlayout.
* The coreboot log is spammed with missing timestamp table error messages
- Add TIMESTAMP table to memlayout.
Tested on QEMU armv7 vexpress.
Change-Id: Ib9357a5c059ca179826c5a7e7616a5c688ec2e95
Signed-off-by: Patrick Rudolph <siro(a)das-labor.org>
---
M src/mainboard/emulation/qemu-armv7/Kconfig
M src/mainboard/emulation/qemu-armv7/Makefile.inc
A src/mainboard/emulation/qemu-armv7/bootblock_asm.S
M src/mainboard/emulation/qemu-armv7/memlayout.ld
4 files changed, 117 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/87/39187/1
diff --git a/src/mainboard/emulation/qemu-armv7/Kconfig b/src/mainboard/emulation/qemu-armv7/Kconfig
index 181f9a4..8c7551f 100644
--- a/src/mainboard/emulation/qemu-armv7/Kconfig
+++ b/src/mainboard/emulation/qemu-armv7/Kconfig
@@ -36,6 +36,7 @@
select BOOT_DEVICE_NOT_SPI_FLASH
select MISSING_BOARD_RESET
select NO_MONOTONIC_TIMER
+ select BOOTBLOCK_CUSTOM
config MAINBOARD_DIR
string
diff --git a/src/mainboard/emulation/qemu-armv7/Makefile.inc b/src/mainboard/emulation/qemu-armv7/Makefile.inc
index c62915b..8b350af 100644
--- a/src/mainboard/emulation/qemu-armv7/Makefile.inc
+++ b/src/mainboard/emulation/qemu-armv7/Makefile.inc
@@ -12,6 +12,8 @@
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
+bootblock-y += bootblock_asm.S
+
romstage-y += romstage.c
romstage-y += cbmem.c
diff --git a/src/mainboard/emulation/qemu-armv7/bootblock_asm.S b/src/mainboard/emulation/qemu-armv7/bootblock_asm.S
new file mode 100644
index 0000000..d2c8b75
--- /dev/null
+++ b/src/mainboard/emulation/qemu-armv7/bootblock_asm.S
@@ -0,0 +1,106 @@
+/*
+ * Early initialization code for ARM architecture.
+ *
+ * This file is based off of the OMAP3530/ARM Cortex start.S file from Das
+ * U-Boot, which itself got the file from armboot.
+ *
+ * Copyright (c) 2004 Texas Instruments <r-woodruff2(a)ti.com>
+ * Copyright (c) 2001 Marius Gröger <mag(a)sysgo.de>
+ * Copyright (c) 2002 Alex Züpke <azu(a)sysgo.de>
+ * Copyright (c) 2002 Gary Jennejohn <garyj(a)denx.de>
+ * Copyright (c) 2003 Richard Woodruff <r-woodruff2(a)ti.com>
+ * Copyright (c) 2003 Kshitij <kshitij(a)ti.com>
+ * Copyright (c) 2006-2008 Syed Mohammed Khasim <x0khasim(a)ti.com>
+ * Copyright (c) 2013 The Chromium OS Authors
+ *
+ * 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>
+.arm
+
+ENTRY(_start)
+ /*
+ * Set the CPU to System mode with IRQ and FIQ disabled. Prefetch/Data
+ * aborts may happen early and crash before the abort handlers are
+ * installed, but at least the problem will show up near the code that
+ * causes it.
+ */
+ msr cpsr_cxf, #0xdf
+
+ /*
+ * From Cortex-A Series Programmer's Guide:
+ * Only CPU 0 performs initialization. Other CPUs go into WFI
+ * to do this, first work out which CPU this is
+ * this code typically is run before any other initialization step
+ */
+ mrc p15, 0, r1, c0, c0, 5 @ Read Multiprocessor Affinity Register
+ and r1, r1, #0x3 @ Extract CPU ID bits
+ cmp r1, #0
+ bne wait_for_interrupt @ If this is not core0, wait
+
+ ldr r0, =_bootblock
+ ldr r1, =_ebootblock
+ adr r2, _start
+
+ cmp r0, r2
+ beq relocated
+
+relocate_program:
+ ldmia r2!, {r9-r10}
+ stmia r0!, {r9-r10}
+ cmp r0, r1
+ bne relocate_program
+
+ /* Jump to it... */
+ ldr r0, =_bootblock
+ adr r1, _start
+ add lr, r0, r1
+ mov pc, lr
+
+relocated:
+ /*
+ * Initialize the stack to a known value. This is used to check for
+ * stack overflow later in the boot process.
+ */
+ ldr r0, =_stack
+ ldr r1, =_estack
+ ldr r2, =0xdeadbeef
+init_stack_loop:
+ str r2, [r0]
+ add r0, #4
+ cmp r0, r1
+ bne init_stack_loop
+
+/* Set stackpointer in internal RAM to call bootblock main() */
+call_bootblock:
+ ldr sp, =_estack /* Set up stack pointer */
+ ldr r0,=0x00000000
+ /*
+ * The current design of cpu_info places the
+ * struct at the top of the stack. The number of
+ * words pushed must be at least as large as that
+ * struct.
+ */
+ push {r0-r2}
+ bic sp, sp, #7 /* 8-byte alignment for ABI compliance */
+ /*
+ * Use "bl" instead of "b" even though we do not intend to return.
+ * "bl" gets compiled to "blx" if we're transitioning from ARM to
+ * Thumb. However, "b" will not and GCC may attempt to create a
+ * wrapper which is currently broken.
+ */
+ bl main
+
+wait_for_interrupt:
+ wfi
+ mov pc, lr @ back to my caller
+ENDPROC(_start)
diff --git a/src/mainboard/emulation/qemu-armv7/memlayout.ld b/src/mainboard/emulation/qemu-armv7/memlayout.ld
index 2b33cb3..3fa2234 100644
--- a/src/mainboard/emulation/qemu-armv7/memlayout.ld
+++ b/src/mainboard/emulation/qemu-armv7/memlayout.ld
@@ -41,14 +41,16 @@
{
/* TODO: does this thing emulate SRAM? */
- BOOTBLOCK(0x00000, 64K)
- FMAP_CACHE(0x10000, 2K)
+ REGION(flash, 0, CONFIG_ROM_SIZE, 4K)
DRAM_START(0x60000000)
STACK(0x60000000, 64K)
- ROMSTAGE(0x60010000, 128K)
- RAMSTAGE(0x60030000, 16M)
-
+ BOOTBLOCK(0x60010000, 128K)
+ FMAP_CACHE(0x60030000, 4K)
+ TIMESTAMP(0x60031000, 1K)
/* TODO: Implement MMU support and move TTB to a better location. */
- TTB(0x61030000, 16K)
+ TTB(0x60034000, 16K)
+ ROMSTAGE(0x60038000, 128K)
+ RAMSTAGE(0x60060000, 16M)
+ POSTRAM_CBFS_CACHE(0x61060000, 8M)
}
--
To view, visit https://review.coreboot.org/c/coreboot/+/39187
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ib9357a5c059ca179826c5a7e7616a5c688ec2e95
Gerrit-Change-Number: 39187
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-MessageType: newchange
Angel Pons has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/42630 )
Change subject: sb/intel/lynxpoint/me_9.x.c: Constify string array
......................................................................
sb/intel/lynxpoint/me_9.x.c: Constify string array
Jenkins complains about `const char *` and says it should instead be
changed to `const char *const`. So, change it so that Jenkins is happy.
Tested with BUILD_TIMELESS=1, Asrock B85M Pro4 does not change.
Change-Id: Iecd5fecdefdc2effd0114706648747460d0a4a72
Signed-off-by: Angel Pons <th3fanbus(a)gmail.com>
---
M src/southbridge/intel/lynxpoint/me_9.x.c
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/30/42630/1
diff --git a/src/southbridge/intel/lynxpoint/me_9.x.c b/src/southbridge/intel/lynxpoint/me_9.x.c
index b2d6f5e..d182e31 100644
--- a/src/southbridge/intel/lynxpoint/me_9.x.c
+++ b/src/southbridge/intel/lynxpoint/me_9.x.c
@@ -32,7 +32,7 @@
#endif
/* Path that the BIOS should take based on ME state */
-static const char *me_bios_path_values[] __unused = {
+static const char *const me_bios_path_values[] __unused = {
[ME_NORMAL_BIOS_PATH] = "Normal",
[ME_S3WAKE_BIOS_PATH] = "S3 Wake",
[ME_ERROR_BIOS_PATH] = "Error",
--
To view, visit https://review.coreboot.org/c/coreboot/+/42630
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Iecd5fecdefdc2effd0114706648747460d0a4a72
Gerrit-Change-Number: 42630
Gerrit-PatchSet: 1
Gerrit-Owner: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-MessageType: newchange