Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33549
Change subject: [RFC]sb/intel/bd82x6x/lpc: Setup default LPC decode ranges
......................................................................
[RFC]sb/intel/bd82x6x/lpc: Setup default LPC decode ranges
Most mainboards do nothing but setting up a similar decode range so
move it to a common place. All IO ports below 0x1000 are allocated to
the LPC device by default so this should not be an issue.
Lynxpoint does this too.
TODO remove most mainboard specific setups.
Change-Id: Ifeb5a862e56f415aa847d0118a33a31537ab8037
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M src/southbridge/intel/bd82x6x/early_pch.c
1 file changed, 12 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/49/33549/1
diff --git a/src/southbridge/intel/bd82x6x/early_pch.c b/src/southbridge/intel/bd82x6x/early_pch.c
index 0082c91..ef3ee77 100644
--- a/src/southbridge/intel/bd82x6x/early_pch.c
+++ b/src/southbridge/intel/bd82x6x/early_pch.c
@@ -258,8 +258,16 @@
write_pmbase16(TCO1_CNT, 1 << 11); /* halt timer */
}
-static void pch_enable_lpc_gen_decode(void)
+static void pch_enable_lpc_decode(void)
{
+ /* Set COM1/COM2 decode range */
+ pci_write_config16(PCH_LPC_DEV, LPC_IO_DEC, 0x0010);
+
+ /* Enable SuperIO + MC + COM1 + PS/2 Keyboard/Mouse */
+ u16 lpc_config = CNF1_LPC_EN | CNF2_LPC_EN | COMA_LPC_EN
+ | KBC_LPC_EN | MC_LPC_EN;
+ pci_write_config16(PCH_LPC_DEV, LPC_EN, lpc_config);
+
const struct device *dev = pcidev_on_root(0x1f, 0);
const struct southbridge_intel_bd82x6x_config *config = NULL;
@@ -279,9 +287,10 @@
void early_pch_init(void)
{
- pch_enable_lpc();
- pch_enable_lpc_gen_decode();
+ pch_enable_lpc_decode();
+
+ pch_enable_lpc();
pch_enable_bars();
--
To view, visit https://review.coreboot.org/c/coreboot/+/33549
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ifeb5a862e56f415aa847d0118a33a31537ab8037
Gerrit-Change-Number: 33549
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-MessageType: newchange
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/32969
Change subject: soc/intel/baytrail: Use cpu/intel/car/romstage.c entry point
......................................................................
soc/intel/baytrail: Use cpu/intel/car/romstage.c entry point
This moves some boilerplate like setting up timestamps and entering
postcar to a common location.
Change-Id: I256b4149163245697fe1c2d4406bd6229a45b556
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M src/soc/intel/baytrail/romstage/Makefile.inc
M src/soc/intel/baytrail/romstage/romstage.c
2 files changed, 4 insertions(+), 22 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/69/32969/1
diff --git a/src/soc/intel/baytrail/romstage/Makefile.inc b/src/soc/intel/baytrail/romstage/Makefile.inc
index f1a3463..8f009bd 100644
--- a/src/soc/intel/baytrail/romstage/Makefile.inc
+++ b/src/soc/intel/baytrail/romstage/Makefile.inc
@@ -1,5 +1,6 @@
cpu_incs-y += $(src)/cpu/intel/car/non-evict/cache_as_ram.S
cpu_incs-y += $(obj)/fmap_config.h
+romstage-y += ../../../../cpu/intel/car/romstage.c
romstage-y += romstage.c
romstage-y += raminit.c
romstage-$(CONFIG_ENABLE_BUILTIN_COM1) += uart.c
diff --git a/src/soc/intel/baytrail/romstage/romstage.c b/src/soc/intel/baytrail/romstage/romstage.c
index cc3bcd9..2a530b4 100644
--- a/src/soc/intel/baytrail/romstage/romstage.c
+++ b/src/soc/intel/baytrail/romstage/romstage.c
@@ -21,6 +21,7 @@
#include <bootblock_common.h>
#include <console/console.h>
#include <cbmem.h>
+#include <cpu/intel/romstage.h>
#include <cpu/x86/mtrr.h>
#if CONFIG(EC_GOOGLE_CHROMEEC)
#include <ec/google/chromeec/ec.h>
@@ -49,8 +50,6 @@
* Because we can't use global variables the stack is used for allocations --
* thus the need to call back and forth. */
-static void platform_enter_postcar(void);
-
static void program_base_addresses(void)
{
uint32_t reg;
@@ -166,18 +165,12 @@
}
/* Entry from cache-as-ram.inc. */
-static void romstage_main(uint64_t tsc, uint32_t bist)
+void mainboard_romstage_entry(unsigned long bist)
{
struct mrc_params mrc_params;
struct chipset_power_state *ps;
int prev_sleep_state;
- /* Save initial timestamp from bootblock. */
- timestamp_init(tsc);
-
- /* Save romstage begin */
- timestamp_add_now(TS_START_ROMSTAGE);
-
program_base_addresses();
tco_disable();
@@ -215,25 +208,13 @@
timestamp_add_now(TS_AFTER_INITRAM);
romstage_handoff_init(prev_sleep_state == ACPI_S3);
-
- platform_enter_postcar();
-
- /* We don't return here */
-}
-
-/* This wrapper enables easy transition towards C_ENVIRONMENT_BOOTBLOCK,
- * keeping changes in cache_as_ram.S easy to manage.
- */
-asmlinkage void bootblock_c_entry_bist(uint64_t base_timestamp, uint32_t bist)
-{
- romstage_main(base_timestamp, bist);
}
#define ROMSTAGE_RAM_STACK_SIZE 0x5000
/* setup_stack_and_mtrrs() determines the stack to use after
* cache-as-ram is torn down as well as the MTRR settings to use. */
-static void platform_enter_postcar(void)
+void platform_enter_postcar(void)
{
struct postcar_frame pcf;
uintptr_t top_of_ram;
--
To view, visit https://review.coreboot.org/c/coreboot/+/32969
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I256b4149163245697fe1c2d4406bd6229a45b556
Gerrit-Change-Number: 32969
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
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