Andrey Petrov has uploaded this change for review. ( https://review.coreboot.org/20063
Change subject: soc/intel/cannonlake: Add UART initialization
......................................................................
soc/intel/cannonlake: Add UART initialization
Cannonlake has built-in UART driver as part of LPSS block. However port
mapped decoders are in use as well.
Change-Id: I9f209bf29c1748c5beea31bc6b31cb07a1e14195
Signed-off-by: Andrey Petrov <andrey.petrov(a)intel.com>
---
A src/soc/intel/cannonlake/uart.c
1 file changed, 61 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/63/20063/1
diff --git a/src/soc/intel/cannonlake/uart.c b/src/soc/intel/cannonlake/uart.c
new file mode 100644
index 0000000..8e33d77
--- /dev/null
+++ b/src/soc/intel/cannonlake/uart.c
@@ -0,0 +1,61 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2015 Google Inc.
+ * Copyright (C) 2017 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
+ * 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 <console/uart.h>
+#include <device/pci_def.h>
+#include <intelblocks/gpio.h>
+#include <intelblocks/lpss.h>
+#include <intelblocks/pcr.h>
+#include <intelblocks/uart.h>
+#include <soc/bootblock.h>
+#include <soc/pci_devs.h>
+#include <soc/pcr_ids.h>
+#include <soc/iomap.h>
+
+/* Serial IO UART controller legacy mode */
+#define PCR_SERIAL_IO_GPPRVRW7 0x618
+#define PCR_SIO_PCH_LEGACY_UART0 (1 << 0)
+#define PCR_SIO_PCH_LEGACY_UART1 (1 << 1)
+#define PCR_SIO_PCH_LEGACY_UART2 (1 << 2)
+
+/* Clock divider parameters for 115200 baud rate */
+#define CLK_M_VAL 0x30
+#define CLK_N_VAL 0xc35
+
+/* UART2 pad configuration. Support RXD and TXD for now. */
+static const struct pad_config uart2_pads[] = {
+/* UART2_RXD */ PAD_CFG_NF(GPP_C20, NONE, DEEP, NF1),
+/* UART2_TXD */ PAD_CFG_NF(GPP_C21, NONE, DEEP, NF1),
+};
+
+void pch_uart_init(void)
+{
+ uintptr_t base = uart_platform_base(CONFIG_UART_FOR_CONSOLE);
+
+ uart_common_init(PCH_DEV_UART2, base, CLK_M_VAL, CLK_N_VAL);
+
+ /* Put UART2 in byte access mode for 16550 compatibility */
+ pcr_write32(PID_SERIALIO, PCR_SERIAL_IO_GPPRVRW7,
+ PCR_SIO_PCH_LEGACY_UART2);
+ gpio_configure_pads(uart2_pads, ARRAY_SIZE(uart2_pads));
+}
+
+uintptr_t uart_platform_base(int idx)
+{
+ /* Same base address for all debug port usage. In reality UART2
+ * is currently only supported. */
+ return UART_DEBUG_BASE_ADDRESS;
+}
--
To view, visit https://review.coreboot.org/20063
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9f209bf29c1748c5beea31bc6b31cb07a1e14195
Gerrit-Change-Number: 20063
Gerrit-PatchSet: 1
Gerrit-Owner: Andrey Petrov <andrey.petrov(a)intel.com>
Andrey Petrov has uploaded this change for review. ( https://review.coreboot.org/20062
Change subject: soc/intel/cannonlake: Add utility to calculate TSC frequency
......................................................................
soc/intel/cannonlake: Add utility to calculate TSC frequency
Change-Id: I76f7a102c8b13c402c5b3354f932cf75e001132e
Signed-off-by: Andrey Petrov <andrey.petrov(a)intel.com>
---
A src/soc/intel/cannonlake/tsc_freq.c
1 file changed, 28 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/62/20062/1
diff --git a/src/soc/intel/cannonlake/tsc_freq.c b/src/soc/intel/cannonlake/tsc_freq.c
new file mode 100644
index 0000000..f8f91e6
--- /dev/null
+++ b/src/soc/intel/cannonlake/tsc_freq.c
@@ -0,0 +1,28 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2014 Google Inc.
+ * Copyright (C) 2017 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
+ * 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/msr.h>
+#include <cpu/x86/tsc.h>
+#include <soc/cpu.h>
+#include <soc/msr.h>
+
+unsigned long tsc_freq_mhz(void)
+{
+ msr_t platform_info;
+
+ platform_info = rdmsr(MSR_PLATFORM_INFO);
+ return CPU_BCLK * ((platform_info.lo >> 8) & 0xff);
+}
--
To view, visit https://review.coreboot.org/20062
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I76f7a102c8b13c402c5b3354f932cf75e001132e
Gerrit-Change-Number: 20062
Gerrit-PatchSet: 1
Gerrit-Owner: Andrey Petrov <andrey.petrov(a)intel.com>
Hello Lijian Zhao,
I'd like you to do a code review. Please visit
https://review.coreboot.org/20061
to review the following change.
Change subject: soc/intel/cannonlake: Add initial dummy directory
......................................................................
soc/intel/cannonlake: Add initial dummy directory
Add CannonLake SoC broilerplate directory with:
* SoC directory
* Base Kconfig
* Dummy cbmem.c
Change-Id: Ie28d8b56a1d1afcf1214ef734a08be6efcc8a931
Signed-off-by: Lijian Zhao <lijian.zhao(a)intel.com>
---
A src/soc/intel/cannonlake/Kconfig
A src/soc/intel/cannonlake/Makefile.inc
A src/soc/intel/cannonlake/cbmem.c
3 files changed, 95 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/61/20061/1
diff --git a/src/soc/intel/cannonlake/Kconfig b/src/soc/intel/cannonlake/Kconfig
new file mode 100644
index 0000000..1e0dbdc
--- /dev/null
+++ b/src/soc/intel/cannonlake/Kconfig
@@ -0,0 +1,69 @@
+config SOC_INTEL_CANNONLAKE
+ bool
+ help
+ Intel Cannonlake support
+
+if SOC_INTEL_CANNONLAKE
+
+config CPU_SPECIFIC_OPTIONS
+ def_bool y
+ select ARCH_BOOTBLOCK_X86_32
+ select ARCH_VERSTAGE_X86_32
+ select ARCH_RAMSTAGE_X86_32
+ select ARCH_ROMSTAGE_X86_32
+ select HAVE_MONOTONIC_TIMER
+ select TSC_CONSTANT_RATE
+ select TSC_MONOTONIC_TIMER
+ select UDELAY_TSC
+ select REG_SCRIPT
+ select C_ENVIRONMENT_BOOTBLOCK
+ select HAVE_HARD_RESET
+ select HAVE_INTEL_FIRMWARE
+ select INTEL_CAR_NEM_ENHANCED
+ select PLATFORM_USES_FSP2_0
+ select SOC_INTEL_COMMON
+ select SOC_INTEL_COMMON_BLOCK_SA
+ select SOC_INTEL_COMMON_BLOCK
+ select SOC_INTEL_COMMON_BLOCK_CAR
+ select SOC_INTEL_COMMON_RESET
+ select SOC_INTEL_COMMON_BLOCK_LPSS
+ select SOC_INTEL_COMMON_BLOCK_UART
+ select SOC_INTEL_COMMON_BLOCK_FAST_SPI
+ select SOC_INTEL_COMMON_BLOCK_PCR
+ select SOC_INTEL_COMMON_BLOCK_SMBUS
+ select SOC_INTEL_COMMON_BLOCK_RTC
+ select SOC_INTEL_COMMON_BLOCK_CSE
+
+config UART_DEBUG
+ bool "Enable UART debug port."
+ default y
+ select CONSOLE_SERIAL
+ select BOOTBLOCK_CONSOLE
+ select DRIVERS_UART
+ select DRIVERS_UART_8250IO
+
+config DCACHE_RAM_BASE
+ hex "Base address of cache-as-RAM"
+ default 0xfef00000
+
+config DCACHE_RAM_SIZE
+ hex "Length in bytes of cache-as-RAM"
+ default 0x40000
+ help
+ The size of the cache-as-ram region required during bootblock
+ and/or romstage.
+
+config DCACHE_BSP_STACK_SIZE
+ hex
+ default 0x4000
+ help
+ The amount of anticipated stack usage in CAR by bootblock and
+ other stages.
+
+config PCR_BASE_ADDRESS
+ hex
+ default 0xfd000000
+ help
+ This option allows you to select MMIO Base Address of sideband bus.
+
+endif
diff --git a/src/soc/intel/cannonlake/Makefile.inc b/src/soc/intel/cannonlake/Makefile.inc
new file mode 100644
index 0000000..4651a23
--- /dev/null
+++ b/src/soc/intel/cannonlake/Makefile.inc
@@ -0,0 +1,7 @@
+ifeq ($(CONFIG_SOC_INTEL_CANNONLAKE),y)
+
+romstage-y += cbmem.c
+
+ramstage-y += cbmem.c
+
+endif
diff --git a/src/soc/intel/cannonlake/cbmem.c b/src/soc/intel/cannonlake/cbmem.c
new file mode 100644
index 0000000..21a1d03
--- /dev/null
+++ b/src/soc/intel/cannonlake/cbmem.c
@@ -0,0 +1,19 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * 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 <cbmem.h>
+
+void *cbmem_top(void)
+{
+ return (void *) NULL;
+}
--
To view, visit https://review.coreboot.org/20061
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie28d8b56a1d1afcf1214ef734a08be6efcc8a931
Gerrit-Change-Number: 20061
Gerrit-PatchSet: 1
Gerrit-Owner: Andrey Petrov <andrey.petrov(a)intel.com>
Gerrit-Reviewer: Lijian Zhao <lijian.zhao(a)intel.com>
Matt DeVillier has uploaded this change for review. ( https://review.coreboot.org/20060
Change subject: soc/braswell: fix ACPI table by recollecting TOLM
......................................................................
soc/braswell: fix ACPI table by recollecting TOLM
cherry-pick from Chromium, commit 8fbe1e7
On Braswell and Baytrail devices, by userland 'perf top',
observed demanding clocks on __vdso_clock_gettime() since
chromeos_3.18 kernel; besides, evaluated massive calling of
clock_gettime() cost, up to 700 ns in average.
It turns out that Linux kernel of map_vdso() first call of
remap_pfn_range() does not fall into reserve_pfn_range()
due to size parameter, instead it relies on lookup_memtype()
and potentially be failed to be identified as eligible RAM
resource because the function of pat_pagerange_is_ram() actually
walks through root's sibling.
Meanwhile, on current BSW (and BYT) firmware implementation
makes System RAM resources located on child leaf, combining all
of these factors makes the kernel treat the vvar page of vdso
as a uncached-minus one leading slow access in result.
This patch recollects TOLM accessing; as Aaron recalled some
core_msr_script turns off access to TOLM register, he suggests
to store tolm to avoid getting back a zero while setting acpi
nvs space.
Original-Change-Id: Iad4ffa542b22073cb087100a95169e2d2a52efcd
Original-Signed-off-by: Harry Pan <harry.pan(a)intel.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/368585
Original-Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
Change-Id: Idc9765ec5c0920dc98baeb9267a89bec5cadd5a0
Signed-off-by: Matt DeVillier <matt.devillier(a)gmail.com>
---
M src/soc/intel/braswell/northcluster.c
1 file changed, 9 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/60/20060/1
diff --git a/src/soc/intel/braswell/northcluster.c b/src/soc/intel/braswell/northcluster.c
index 404a8f1..dc72a46 100644
--- a/src/soc/intel/braswell/northcluster.c
+++ b/src/soc/intel/braswell/northcluster.c
@@ -29,6 +29,7 @@
#include <soc/ramstage.h>
#include <soc/smm.h>
#include <vendorcode/google/chromeos/chromeos.h>
+#include <stddef.h>
/*
* Host Memory Map:
@@ -70,7 +71,14 @@
uint32_t nc_read_top_of_low_memory(void)
{
- return iosf_bunit_read(BUNIT_BMBOUND) & ~((1 << 27) - 1);
+ MAYBE_STATIC uint32_t tolm = 0;
+
+ if (tolm)
+ return tolm;
+
+ tolm = iosf_bunit_read(BUNIT_BMBOUND) & ~((1 << 27) - 1);
+
+ return tolm;
}
static void nc_read_resources(device_t dev)
--
To view, visit https://review.coreboot.org/20060
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idc9765ec5c0920dc98baeb9267a89bec5cadd5a0
Gerrit-Change-Number: 20060
Gerrit-PatchSet: 1
Gerrit-Owner: Matt DeVillier <matt.devillier(a)gmail.com>
Gerrit-Reviewer: Harry Pan <harry.pan(a)intel.com>