Angel Pons has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34464 )
Change subject: src/soc/intel/byatrail: Add minimal SMBus support
......................................................................
src/soc/intel/byatrail: Add minimal SMBus support
Change-Id: I6b7bdbc94cfbc9fbd8eda92ca924c74638388bfb
Signed-off-by: Angel Pons <th3fanbus(a)gmail.com>
---
M src/soc/intel/baytrail/Kconfig
M src/soc/intel/baytrail/Makefile.inc
A src/soc/intel/baytrail/smbus.c
3 files changed, 33 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/64/34464/1
diff --git a/src/soc/intel/baytrail/Kconfig b/src/soc/intel/baytrail/Kconfig
index 4b816a2..f5a1d81 100644
--- a/src/soc/intel/baytrail/Kconfig
+++ b/src/soc/intel/baytrail/Kconfig
@@ -40,6 +40,7 @@
select POSTCAR_CONSOLE
select CPU_INTEL_COMMON
select CPU_HAS_L2_ENABLE_MSR
+ select SOUTHBRIDGE_INTEL_COMMON_SMBUS
config VBOOT
select VBOOT_MUST_REQUEST_DISPLAY
diff --git a/src/soc/intel/baytrail/Makefile.inc b/src/soc/intel/baytrail/Makefile.inc
index 3ad6a8f..55af6e6 100644
--- a/src/soc/intel/baytrail/Makefile.inc
+++ b/src/soc/intel/baytrail/Makefile.inc
@@ -12,6 +12,7 @@
romstage-y += iosf.c
romstage-y += memmap.c
romstage-y += pmutil.c
+romstage-y += smbus.c
romstage-y += spi.c
romstage-y += stage_cache.c
romstage-y += tsc_freq.c
@@ -42,6 +43,7 @@
ramstage-y += sata.c
ramstage-y += scc.c
ramstage-y += sd.c
+ramstage-y += smbus.c
ramstage-y += smm.c
ramstage-y += southcluster.c
ramstage-y += spi.c
diff --git a/src/soc/intel/baytrail/smbus.c b/src/soc/intel/baytrail/smbus.c
new file mode 100644
index 0000000..91dd173
--- /dev/null
+++ b/src/soc/intel/baytrail/smbus.c
@@ -0,0 +1,30 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2017 Intel Corporation.
+ * Copyright (C) 2019 3mdeb
+ * Copyright (C) 2019 Eltan B.V.
+ *
+ * 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 <device/early_smbus.h>
+#include <soc/iomap.h>
+#include <southbridge/intel/common/smbus.h>
+
+u8 smbus_read_byte(u32 smbus_dev, u8 addr, u8 offset)
+{
+ return do_smbus_read_byte(SMBUS_BASE_ADDRESS, addr, offset);
+}
+
+u8 smbus_write_byte(u32 smbus_dev, u8 addr, u8 offset, u8 value)
+{
+ return do_smbus_write_byte(SMBUS_BASE_ADDRESS, addr, offset, value);
+}
--
To view, visit https://review.coreboot.org/c/coreboot/+/34464
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I6b7bdbc94cfbc9fbd8eda92ca924c74638388bfb
Gerrit-Change-Number: 34464
Gerrit-PatchSet: 1
Gerrit-Owner: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-MessageType: newchange
Martin Roth has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33641
Change subject: Kconfig: Display a warning if the board is updated incorrectly
......................................................................
Kconfig: Display a warning if the board is updated incorrectly
Even though we have a comment to run make distclean before switching
mainboards, people still ignore this and end up with confusing results.
To try to fix this, save the mainboard directory in a Kconfig symbol
that will not get updated when the mainboard gets changed. This allows
us to compare it to the actual mainboard directory which will be updated
when the platform changes and put up an obnoxious warning in the
mainboard directory. Add another warning in the main menu, because
the initial warning is probably going to be ignored. The main menu
points to some documentation on how to fix the problem.
Note that this will only catch issues going forward, and won't catch
any already saved config that has a problem.
Signed-off-by: Martin Roth <martinroth(a)chromium.org>
Change-Id: I2a1ccb62c7678f264015c87b9004be6a106f804a
---
A Documentation/getting_started/fix_dot_config.md
M src/Kconfig
M src/mainboard/Kconfig
3 files changed, 78 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/41/33641/1
diff --git a/Documentation/getting_started/fix_dot_config.md b/Documentation/getting_started/fix_dot_config.md
new file mode 100644
index 0000000..17d89d0
--- /dev/null
+++ b/Documentation/getting_started/fix_dot_config.md
@@ -0,0 +1,50 @@
+# How to repair your .config file
+
+## Overview
+Many people rely on a saved .config file for building their
+platform. This is reasonable, but can create unanticipated
+problems.
+
+## TLDR
+* Backup your .config: "cp .config .config_bak"
+* Create the defconfig file: "make savedefconfig"
+* Edit defconfig & delete unknown config lines: "vi defconfig"
+* To just get rid of the warning about a bad .config, remove
+* the CONFIG_MAINBOARD_CHECK line.
+* The SMBIOS lines are probably incorrect as well. The ROM size
+* is very suspect. Check the correct default for your platform.
+* Save the defconfig
+* Generate a new full config:
+* "make -B defconfig KBUILD_DEFCONFIG=defconfig"
+
+## defconfig or "Mini config"
+Instead of saving a "full" config, people should use a defconfig.
+This is just the changes from a default coreboot configuration
+file. It's significantly smaller, and when a new configuration option
+gets added, it just takes the default value for that option when
+expanded into a full .config.
+
+### Generating the defconfig file
+To create the defconfig file, run "make savedefconfig". By default
+this will generate the file in the root coreboot directory and call
+it "defconfig". If there was already a file named "defconfig", this
+will overwrite that file.
+
+### Contents of the defconfig file
+As the defconfig file contains just the differences between the
+platform and the default choices for the platform. For the current
+default platform, the defconfig can actually be an empty file.
+
+Typically the defconfig will contain at least 2 lines - a
+CONFIG_VENDOR_ line and a CONFIG_BOARD_ line. Again though, if you
+are building the default board for any particular vendor, that line
+may not be present.
+
+All additional lines in a defconfig file are options that the user
+has specifically chosen to update in their config.
+
+### Generating a .config from a defconfig
+To expand the defconfig so that can be used, run:
+ DFILE=defconfig; make -B defconfig KBUILD_DEFCONFIG=$DFILE
+
+You can point DFILE to any saved defconfig.
diff --git a/src/Kconfig b/src/Kconfig
index 72d826f..8eae329 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -16,6 +16,15 @@
mainmenu "coreboot configuration"
+if MAINBOARD_CHECK != MAINBOARD_DIR
+comment "***********************************************************************"
+comment "WARNING: Your config is using defaults from a different mainboard "
+comment "than you currently have set. We'd recommend that you delete your "
+comment ".config file and start over, but if you want to try to repair the "
+comment "file, see Documentation/getting_started/fix_dot_config.md "
+comment "***********************************************************************"
+endif
+
menu "General setup"
config COREBOOT_BUILD
@@ -1062,6 +1071,14 @@
mainboard code supports this. On supported Intel platforms this works
by changing the settings in the descriptor.bin file.
+config MAINBOARD_CHECK
+ string "Mainboard dir - Do not change manually"
+ default MAINBOARD_DIR
+ help
+ Check the platform. If this symbol doesn't match the currently
+ selected mainboard directory, give the user warnings that they're
+ probably doing something wrong.
+
endmenu
diff --git a/src/mainboard/Kconfig b/src/mainboard/Kconfig
index c88d317..d9216a9 100644
--- a/src/mainboard/Kconfig
+++ b/src/mainboard/Kconfig
@@ -1,5 +1,16 @@
comment "Important: Run 'make distclean' before switching boards"
+if MAINBOARD_CHECK != MAINBOARD_DIR
+comment "***********************************************************************"
+comment "WARNING: Your config is using defaults from a different mainboard "
+comment "than you currently have set. We'd recommend that you delete your "
+comment ".config file and start over. "
+comment "* *"
+comment "If you ignore this warning and build anyway, you will almost certainly "
+comment "get a bad rom with undefined results. "
+comment "***********************************************************************"
+endif
+
choice
prompt "Mainboard vendor"
default VENDOR_EMULATION
--
To view, visit https://review.coreboot.org/c/coreboot/+/33641
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I2a1ccb62c7678f264015c87b9004be6a106f804a
Gerrit-Change-Number: 33641
Gerrit-PatchSet: 1
Gerrit-Owner: Martin Roth <martinroth(a)google.com>
Gerrit-MessageType: newchange
Martin Roth has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33380
Change subject: Console: Allow console UART to be enabled without serial console
......................................................................
Console: Allow console UART to be enabled without serial console
Currently, when we disable serial console, the serial console uart
remains uninitialized. This patch allows coreboot to still set up
the UART, even if we're not sending the console to it.
BUG=b:74392237
TEST=Verify UART still works, even with coreboot console disabled
Signed-off-by: Martin Roth <martinroth(a)chromium.org>
Change-Id: Ic0942634ab8a9fcafdc1ea099721c127202e9f9a
---
M src/console/Kconfig
M src/drivers/uart/Kconfig
M src/include/console/uart.h
3 files changed, 28 insertions(+), 8 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/80/33380/1
diff --git a/src/console/Kconfig b/src/console/Kconfig
index 61ba667..da769d3 100644
--- a/src/console/Kconfig
+++ b/src/console/Kconfig
@@ -33,6 +33,7 @@
bool "Serial port console output"
default y
depends on DRIVERS_UART
+ select ENABLE_UART
help
Send coreboot debug output to a serial port.
@@ -47,7 +48,7 @@
specific UART has to be used (e.g. when the platform code
performs dangerous configurations).
-if CONSOLE_SERIAL
+if ENABLE_UART
comment "I/O mapped, 8250-compatible"
depends on DRIVERS_UART_8250IO
@@ -79,13 +80,13 @@
Map the COM port number to the respective I/O port.
comment "Serial port base address = 0x3f8"
-depends on UART_FOR_CONSOLE = 0
+depends on UART_FOR_CONSOLE = 0 && DRIVERS_UART_8250IO
comment "Serial port base address = 0x2f8"
-depends on UART_FOR_CONSOLE = 1
+depends on UART_FOR_CONSOLE = 1 && DRIVERS_UART_8250IO
comment "Serial port base address = 0x3e8"
-depends on UART_FOR_CONSOLE = 2
+depends on UART_FOR_CONSOLE = 2 && DRIVERS_UART_8250IO
comment "Serial port base address = 0x2e8"
-depends on UART_FOR_CONSOLE = 3
+depends on UART_FOR_CONSOLE = 3 && DRIVERS_UART_8250IO
config UART_OVERRIDE_BAUDRATE
boolean
@@ -156,7 +157,7 @@
default 3
depends on DRIVERS_UART_8250IO || DRIVERS_UART_8250MEM
-endif # CONSOLE_SERIAL
+endif # ENABLE_UART
config SPKMODEM
bool "spkmodem (console on speaker) console output"
diff --git a/src/drivers/uart/Kconfig b/src/drivers/uart/Kconfig
index 1f23a19..9b242fd 100644
--- a/src/drivers/uart/Kconfig
+++ b/src/drivers/uart/Kconfig
@@ -1,6 +1,21 @@
config DRIVERS_UART
bool
+config ENABLE_UART
+ def_bool n
+
+config ENABLE_UART_WITHOUT_CONSOLE
+ bool "Always configure primary UART"
+ depends on DRIVERS_UART
+ select ENABLE_UART
+ help
+ The primary UART has previously only been set up when the serial console
+ is enabled.
+ Selecting this choice will configure the console UART even if the serial
+ console is disabled.
+
+ Select the UART in the console menu
+
config DRIVERS_UART_8250IO
# FIXME: Shouldn't have a prompt, should default to n, and
# should be selected by boards that have it instead.
diff --git a/src/include/console/uart.h b/src/include/console/uart.h
index aed67c2..6bd88ae 100644
--- a/src/include/console/uart.h
+++ b/src/include/console/uart.h
@@ -67,11 +67,16 @@
(ENV_BOOTBLOCK || ENV_ROMSTAGE || ENV_RAMSTAGE || ENV_VERSTAGE || \
ENV_POSTCAR || (ENV_SMM && CONFIG(DEBUG_SMI))))
-#if __CONSOLE_SERIAL_ENABLE__
+#if CONFIG(ENABLE_UART)
static inline void __uart_init(void)
{
uart_init(CONFIG_UART_FOR_CONSOLE);
}
+#else
+static inline void __uart_init(void) {}
+#endif
+
+#if __CONSOLE_SERIAL_ENABLE__
static inline void __uart_tx_byte(u8 data)
{
uart_tx_byte(CONFIG_UART_FOR_CONSOLE, data);
@@ -81,7 +86,6 @@
uart_tx_flush(CONFIG_UART_FOR_CONSOLE);
}
#else
-static inline void __uart_init(void) {}
static inline void __uart_tx_byte(u8 data) {}
static inline void __uart_tx_flush(void) {}
#endif
--
To view, visit https://review.coreboot.org/c/coreboot/+/33380
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ic0942634ab8a9fcafdc1ea099721c127202e9f9a
Gerrit-Change-Number: 33380
Gerrit-PatchSet: 1
Gerrit-Owner: Martin Roth <martinroth(a)google.com>
Gerrit-MessageType: newchange
Martin Roth has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/32414
Change subject: arch/x86: Add option for running Romstage out of RAM
......................................................................
arch/x86: Add option for running Romstage out of RAM
AMD's Picasso SOC brings up memory before releasing the X86 processor,
and jumps directly to Romstage. Add a global config option to handle
that.
TEST=None
BUG=b:130804851
Signed-off-by: Martin Roth <martinroth(a)chromium.org>
Change-Id: I678b1f74546ea30abcc655a0daed795d6cfa0034
---
M src/Kconfig
M src/arch/x86/assembly_entry.S
M src/arch/x86/memlayout.ld
3 files changed, 25 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/14/32414/1
diff --git a/src/Kconfig b/src/Kconfig
index 62b3818..bfa0b51 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -146,6 +146,16 @@
time spent decompressing. Doesn't work for XIP stages (assume all
ARCH_X86 for now) for obvious reasons.
+config ROMSTAGE_IN_RAM
+ bool
+ depends on ARCH_X86
+ help
+ Some newer x86 processors come alive with memory enabled, and the
+ reset vector's physical address falling within DRAM. Select this
+ item to build romstage to execute in DRAM instead of XIP. Because
+ this is not a standard, the soc/ or cpu/ code must handle the reset
+ natively before jumping into the standard romstage code.
+
config COMPRESS_BOOTBLOCK
bool
help
diff --git a/src/arch/x86/assembly_entry.S b/src/arch/x86/assembly_entry.S
index 4ead9ea..01c0865 100644
--- a/src/arch/x86/assembly_entry.S
+++ b/src/arch/x86/assembly_entry.S
@@ -26,6 +26,16 @@
* variables that are stage specific.
*/
.section ".text._start", "ax", @progbits
+#if ENV_ROMSTAGE && IS_ENABLED(CONFIG_ROMSTAGE_IN_RAM)
+/*
+ * Systems that run romstage in DRAM, i.e. where romstage is the first
+ * executed code, are responsible for getting the processor into protected
+ * mode, setting the stack pointer, and jumping to this location.
+ */
+.global _romstage_in_ram_continue
+_romstage_in_ram_continue:
+
+#else
.global _start
_start:
@@ -34,6 +44,7 @@
/* reset stack pointer to CAR stack */
mov $_car_stack_end, %esp
+#endif
/* clear CAR_GLOBAL area as it is not shared */
cld
diff --git a/src/arch/x86/memlayout.ld b/src/arch/x86/memlayout.ld
index cc72552..da63b05 100644
--- a/src/arch/x86/memlayout.ld
+++ b/src/arch/x86/memlayout.ld
@@ -57,6 +57,10 @@
#endif
}
+#if ENV_ROMSTAGE && CONFIG(ROMSTAGE_IN_RAM)
+#include <soc/romstage.ld>
+#endif
+
#if ENV_BOOTBLOCK
/* Bootblock specific scripts which provide more SECTION directives. */
#include <cpu/x86/16bit/entry16.ld>
--
To view, visit https://review.coreboot.org/c/coreboot/+/32414
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I678b1f74546ea30abcc655a0daed795d6cfa0034
Gerrit-Change-Number: 32414
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