Skip to contentSkip to conversation

x86: Use fsp command with FSP1

PATCH New Simon Glass 2 participants 30 messages Sep 25, 2019 – Oct 11, 2019 x86

lore
Share & tools
lore
#0 lore raw

PATCH 101/126 x86: Use fsp command with FSP1

The current 'fsp' command only works with FSP1. Update it to avoid trying to build it with FSP2.

---

 cmd/x86/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
cmd/x86/Makefile +1 -1
index 144b1cf5abe..c50ddccef57 100644
@@ -3,4 +3,4 @@
 obj-y += mtrr.o
 obj-$(CONFIG_CMD_EXCEPTION) += exception.o
 obj-$(CONFIG_USE_HOB) += hob.o
-obj-$(CONFIG_HAVE_FSP) += fsp.o
+obj-$(CONFIG_FSP_VERSION1) += fsp.o
Signature · 1 line
2.23.0.444.g18eeb5a265-goog
#1 lore raw

PATCH 102/126 x86: Update .dtsi file for FSP2

Include the IFWI section and the FSP-M binary. The FSP-T binary is not currently used, as CAR is set up manually.

Also drop the FSP binary as this relates only to FSP1.

---

 arch/x86/dts/u-boot.dtsi | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)
arch/x86/dts/u-boot.dtsi +28 -1
index 35129d0510b..189be2196cb 100644
@@ -104,12 +104,39 @@
 		offset = <CONFIG_X86_MRC_ADDR>;
 	};
 #endif
-#ifdef CONFIG_HAVE_FSP
+#ifdef CONFIG_FSP_VERSION1
 	intel-fsp {
 		filename = CONFIG_FSP_FILE;
 		offset = <CONFIG_FSP_ADDR>;
 	};
 #endif
+#ifdef CONFIG_FSP_VERSION2
+	intel-descriptor {
+		filename = CONFIG_FLASH_DESCRIPTOR_FILE;
+	};
+	intel-ifwi {
+		filename = CONFIG_IFWI_INPUT_FILE;
+		convert-fit;
+
+		section {
+			size = <0x8000>;
+			ifwi-replace;
+			ifwi-subpart = "IBBP";
+			ifwi-entry = "IBBL";
+			u-boot-tpl {
+			};
+			x86-start16-tpl {
+				offset = <0x7800>;
+			};
+			x86-reset16-tpl {
+				offset = <0x7ff0>;
+			};
+		};
+	};
+	intel-fsp-m {
+		filename = CONFIG_FSP_FILE_M;
+	};
+#endif
 #ifdef CONFIG_HAVE_CMC
 	intel-cmc {
 		filename = CONFIG_CMC_FILE;
Signature · 1 line
2.23.0.444.g18eeb5a265-goog
#2 lore raw

PATCH 102/126 x86: Update .dtsi file for FSP2

Hi Simon,

Quoted 23 lines · Simon Glass

Include the IFWI section and the FSP-M binary. The FSP-T binary is not currently used, as CAR is set up manually.

Also drop the FSP binary as this relates only to FSP1.

---

 arch/x86/dts/u-boot.dtsi | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)
arch/x86/dts/u-boot.dtsi +1 -1
index 35129d0510b..189be2196cb 100644
@@ -104,12 +104,39 @@
                offset = <CONFIG_X86_MRC_ADDR>;
        };
 #endif
-#ifdef CONFIG_HAVE_FSP
+#ifdef CONFIG_FSP_VERSION1
        intel-fsp {

arch/x86/dts/u-boot.dtsi line 118

Quoted 10 lines
arch/x86/dts/u-boot.dtsi +6 -0
                filename = CONFIG_FSP_FILE;
                offset = <CONFIG_FSP_ADDR>;
        };
 #endif
+#ifdef CONFIG_FSP_VERSION2
+       intel-descriptor {
+               filename = CONFIG_FLASH_DESCRIPTOR_FILE;
+       };
+       intel-ifwi {
+               filename = CONFIG_IFWI_INPUT_FILE;

nits: can we rename this to CONFIG_IFWI_FILE? for consistency

Quoted 10 lines
arch/x86/dts/u-boot.dtsi +10 -0
+               convert-fit;
+
+               section {
+                       size = <0x8000>;
+                       ifwi-replace;
+                       ifwi-subpart = "IBBP";
+                       ifwi-entry = "IBBL";
+                       u-boot-tpl {
+                       };
+                       x86-start16-tpl {

arch/x86/dts/u-boot.dtsi line 138

Quoted 10 lines
arch/x86/dts/u-boot.dtsi +10 -0
+                               offset = <0x7800>;
+                       };
+                       x86-reset16-tpl {
+                               offset = <0x7ff0>;
+                       };
+               };
+       };
+       intel-fsp-m {
+               filename = CONFIG_FSP_FILE_M;
+       };

What about FSP-S?

arch/x86/dts/u-boot.dtsi

Quoted 5 lines
arch/x86/dts/u-boot.dtsi +1 -1
+#endif
 #ifdef CONFIG_HAVE_CMC
        intel-cmc {
                filename = CONFIG_CMC_FILE;
--

Regards,
Bin

#3 lore raw

PATCH 103/126 x86: Add an option to control the position of U-Boot

In reply to Simon Glass

The existing work-around for positioning U-Boot in the ROM when it actually runs from RAM still exists and there is not obvious way to change this.

Add a proper Kconfig option to handle this case. This also adds a new bool property to indicate whether CONFIG_SYS_TEXT_BASE exists.

---

 Kconfig                                |  9 ++++++---
 arch/x86/Kconfig                       |  5 +++++
 arch/x86/dts/u-boot.dtsi               | 18 +++---------------
 configs/chromebook_samus_tpl_defconfig |  1 +
 4 files changed, 15 insertions(+), 18 deletions(-)
Kconfig +6 -3
index 1f0904f7045..f772d4fbe9f 100644
@@ -529,9 +529,14 @@ config SYS_EXTRA_OPTIONS
 	  configuration to Kconfig. Since this option will be removed sometime,
 	  new boards should not use this option.
 
-config SYS_TEXT_BASE
+config HAS_SYS_TEXT_BASE
+	bool
 	depends on !NIOS2 && !XTENSA
 	depends on !EFI_APP
+	default y
+
+config SYS_TEXT_BASE
+	depends on HAS_SYS_TEXT_BASE
 	default 0x80800000 if ARCH_OMAP2PLUS || ARCH_K3
 	default 0x4a000000 if ARCH_SUNXI && !MACH_SUN9I && !MACH_SUN8I_V3S
 	default 0x2a000000 if ARCH_SUNXI && MACH_SUN9I
@@ -540,8 +545,6 @@ config SYS_TEXT_BASE
 	help
 	  The address in memory that U-Boot will be running from, initially.
 
-
-
 config SYS_CLK_FREQ
 	depends on ARC || ARCH_SUNXI || MPC83xx
 	int "CPU clock frequency"
arch/x86/Kconfig +5 -0
index fce3c1d92a3..02c116caeb7 100644
@@ -891,4 +891,9 @@ config CACHE_QOS_SIZE_PER_BIT
 	depends on INTEL_CAR_CQOS
 	default 0x20000 # 128 KB
 
+config X86_OFFSET_U_BOOT
+	hex "Offset of U-Boot in ROM image"
+	depends on HAS_SYS_TEXT_BASE
+	default SYS_TEXT_BASE
+
 endmenu
arch/x86/dts/u-boot.dtsi +3 -15
index 189be2196cb..f33f276b90d 100644
@@ -54,7 +54,7 @@
 	u-boot-spl-dtb {
 	};
 	u-boot {
-		offset = <CONFIG_SYS_TEXT_BASE>;
+		offset = <CONFIG_X86_OFFSET_U_BOOT>;
 	};
 #elif defined(CONFIG_SPL)
 	u-boot-spl-with-ucode-ptr {
@@ -64,23 +64,11 @@
 		type = "u-boot-dtb-with-ucode";
 	};
 	u-boot {
-		/*
-		 * TODO(sjg at chromium.org):
-		 * Normally we use CONFIG_SYS_TEXT_BASE as the flash offset. But
-		 * for boards with textbase in SDRAM we cannot do this. Just use
-		 * an assumed-valid value (1MB before the end of flash) here so
-		 * that we can actually build an image for coreboot, etc.
-		 * We need a better solution, perhaps a separate Kconfig.
-		 */
-#if CONFIG_SYS_TEXT_BASE == 0x1110000
-		offset = <0xfff00000>;
-#else
-		offset = <CONFIG_SYS_TEXT_BASE>;
-#endif
+		offset = <CONFIG_X86_OFFSET_U_BOOT>;
 	};
 #else
 	u-boot-with-ucode-ptr {
-		offset = <CONFIG_SYS_TEXT_BASE>;
+		offset = <CONFIG_X86_OFFSET_U_BOOT>;
 	};
 #endif
 #ifdef CONFIG_HAVE_MICROCODE
configs/chromebook_samus_tpl_defconfig +1 -0
index 28f23cfe125..c7f125eaa40 100644
@@ -13,6 +13,7 @@ CONFIG_HAVE_REFCODE=y
 CONFIG_SMP=y
 CONFIG_HAVE_VGA_BIOS=y
 CONFIG_SPL_TEXT_BASE=0xffe70000
+CONFIG_X86_OFFSET_U_BOOT=0xfff00000
 CONFIG_BOOTSTAGE=y
 CONFIG_BOOTSTAGE_REPORT=y
 CONFIG_SHOW_BOOT_PROGRESS=y
Signature · 1 line
2.23.0.444.g18eeb5a265-goog
#4 lore raw

PATCH 104/126 x86: Add an option to control the position of SPL

In reply to Simon Glass

For apollolake SPL is run from CAR (cache-as-RAM) which is in a different location from where SPL must be placed in ROM. In other words, although SPL runs before SDRAM is set up, it is not execute-in-place (XIP).

Add a Kconfig option for the ROM position.

---

 arch/x86/Kconfig         | 5 +++++
 arch/x86/dts/u-boot.dtsi | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)
arch/x86/Kconfig +5 -0
index 02c116caeb7..9d01801ff13 100644
@@ -896,4 +896,9 @@ config X86_OFFSET_U_BOOT
 	depends on HAS_SYS_TEXT_BASE
 	default SYS_TEXT_BASE
 
+config X86_OFFSET_SPL
+	hex "Offset of SPL in ROM image"
+	depends on X86
+	default SPL_TEXT_BASE
+
 endmenu
arch/x86/dts/u-boot.dtsi +2 -2
index f33f276b90d..8fc5146f26c 100644
@@ -49,7 +49,7 @@
 	u-boot-tpl-dtb {
 	};
 	u-boot-spl {
-		offset = <CONFIG_SPL_TEXT_BASE>;
+		offset = <CONFIG_X86_OFFSET_SPL>;
 	};
 	u-boot-spl-dtb {
 	};
@@ -58,7 +58,7 @@
 	};
 #elif defined(CONFIG_SPL)
 	u-boot-spl-with-ucode-ptr {
-		offset = <CONFIG_SPL_TEXT_BASE>;
+		offset = <CONFIG_X86_OFFSET_SPL>;
 	};
 	u-boot-dtb-with-ucode2 {
 		type = "u-boot-dtb-with-ucode";
Signature · 1 line
2.23.0.444.g18eeb5a265-goog
#5 lore raw

PATCH 105/126 x86: Reduce resetvec size

In reply to Simon Glass

At present this produces a 16-byte file. It is intended to start 16 bytes before the end of ROM and pads with zeroes to readh the end.

But binman sometimes wants to add an image-header at the very end of ROM. Furthermore binman automatically pads the data if it is finishes early.

Drop the padding in resetvec and let binman handle it.

---

 arch/x86/cpu/resetvec.S | 3 ---
 1 file changed, 3 deletions(-)
arch/x86/cpu/resetvec.S +0 -3
index a52225d5ee9..cf972738b31 100644
@@ -16,6 +16,3 @@ reset_vector:
 	cli
 	cld
 	jmp start16
-
-	.org 0xf
-	nop
Signature · 1 line
2.23.0.444.g18eeb5a265-goog
#6 lore raw

PATCH 105/126 x86: Reduce resetvec size

Quoted 7 lines · Simon Glass

At present this produces a 16-byte file. It is intended to start 16 bytes before the end of ROM and pads with zeroes to readh the end.

But binman sometimes wants to add an image-header at the very end of ROM. Furthermore binman automatically pads the data if it is finishes early.

Quoted 8 lines

Drop the padding in resetvec and let binman handle it.

---

 arch/x86/cpu/resetvec.S | 3 ---
 1 file changed, 3 deletions(-)
#7 lore raw

PATCH 105/126 x86: Reduce resetvec size

Quoted 11 lines · Bin Meng
Quoted 9 lines · Simon Glass

At present this produces a 16-byte file. It is intended to start 16 bytes before the end of ROM and pads with zeroes to readh the end.

But binman sometimes wants to add an image-header at the very end of ROM. Furthermore binman automatically pads the data if it is finishes early.

Drop the padding in resetvec and let binman handle it.

Quoted 8 lines
Quoted 6 lines

---

 arch/x86/cpu/resetvec.S | 3 ---
 1 file changed, 3 deletions(-)

applied to u-boot-x86, thanks!

#8 lore raw

PATCH 106/126 x86: Add an fdtmap and image-header

In reply to Simon Glass

Add these entries to the ROM so that we can list the contents of an image with 'binman ls'. The image-header is not essential but does speed up access.

---

 arch/x86/dts/u-boot.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/x86/dts/u-boot.dtsi +5 -0
index 8fc5146f26c..f2fb4c2abaa 100644
@@ -125,6 +125,8 @@
 		filename = CONFIG_FSP_FILE_M;
 	};
 #endif
+	fdtmap {
+	};
 #ifdef CONFIG_HAVE_CMC
 	intel-cmc {
 		filename = CONFIG_CMC_FILE;
@@ -170,5 +172,8 @@
 		offset = <CONFIG_RESET_VEC_LOC>;
 	};
 #endif
+	image-header {
+		location = "end";
+	};
 };
 #endif
Signature · 1 line
2.23.0.444.g18eeb5a265-goog
#9 lore raw

PATCH 107/126 x86: Don't repeat microcode in U-Boot if not needed

In reply to Simon Glass

At present if SPL sets up the microcode then it is still included in U-Boot as well. This is wasteful as microcode is large. Adjust the logic in the image to prevent this.

---

 arch/x86/dts/u-boot.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)
arch/x86/dts/u-boot.dtsi +7 -0
index f2fb4c2abaa..d9a4ca1184e 100644
@@ -67,9 +67,16 @@
 		offset = <CONFIG_X86_OFFSET_U_BOOT>;
 	};
 #else
+# ifdef CONFIG_SPL
+	u-boot {
+		offset = <CONFIG_SYS_TEXT_BASE>;
+	};
+# else
+	/* If there is no SPL then we need to put microcode in U-Boot */
 	u-boot-with-ucode-ptr {
 		offset = <CONFIG_X86_OFFSET_U_BOOT>;
 	};
+# endif
 #endif
 #ifdef CONFIG_HAVE_MICROCODE
 	u-boot-dtb-with-ucode {
Signature · 1 line
2.23.0.444.g18eeb5a265-goog
#10 lore raw

PATCH 108/126 x86: apollolake: Add basic IO addresses

In reply to Simon Glass

Add some fixed IO and mmap addresses for use in the device tree and with some early-init code.

---

 arch/x86/include/asm/arch-apollolake/iomap.h | 28 ++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 arch/x86/include/asm/arch-apollolake/iomap.h
arch/x86/include/asm/arch-apollolake/iomap.h new file +28 -0
new file mode 100644
index 00000000000..200c76a8eef
@@ -0,0 +1,28 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2017 Intel Corporation.
+ * Take from coreboot project file of the same name
+ */
+
+#ifndef __ARCH_IOMAP_H
+#define __ARCH_IOMAP_H
+
+#define TCO_BASE_ADDRESS	(ACPI_BASE_ADDRESS + 0x60)
+#define TCO_BASE_SIZE		0x20
+
+#define R_ACPI_PM1_TMR			0x8
+
+/* Put p2sb at 0xd0000000 in TPL */
+#define IOMAP_P2SB_BAR		0xd0000000
+
+#define IOMAP_SPI_BASE		0xfe010000
+/*
+ * Use UART2. To use UART1 you need to set '2' to '1', change device tree serial
+ * node name and 'reg' property, and update CONFIG_DEBUG_UART_BASE.
+ */
+#define PCH_DEV_UART		PCI_BDF(0, 0x18, 2)
+
+#define PCH_DEV_LPC		PCI_BDF(0, 0x1f, 0)
+#define PCH_DEV_SPI		PCI_BDF(0, 0x0d, 2)
+
+#endif
Signature · 1 line
2.23.0.444.g18eeb5a265-goog
#11 lore raw

PATCH 109/126 x86: apollolake: Add PMC driver

In reply to Simon Glass

Add a driver for the apollolake SoC. It supports the basic operations and can use device tree or of-platdata.

---

 arch/x86/cpu/apollolake/Makefile           |   5 +
 arch/x86/cpu/apollolake/pmc.c              | 216 +++++++++++++++++++++
 arch/x86/include/asm/arch-apollolake/pm.h  |  19 ++
 drivers/power/power_mgr/power-mgr-uclass.c |  51 +++++
 4 files changed, 291 insertions(+)
 create mode 100644 arch/x86/cpu/apollolake/Makefile
 create mode 100644 arch/x86/cpu/apollolake/pmc.c
 create mode 100644 arch/x86/include/asm/arch-apollolake/pm.h
arch/x86/cpu/apollolake/Makefile new file +5 -0
new file mode 100644
index 00000000000..5d98a5a6db2
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright (c) 2016 Google, Inc
+
+obj-y += pmc.o
arch/x86/cpu/apollolake/pmc.c new file +216 -0

216 lines not on this page · raw message

arch/x86/include/asm/arch-apollolake/pm.h new file +19 -0
new file mode 100644
index 00000000000..8226ee775e1
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2015-2016 Intel Corp.
+ * (Written by Lance Zhao <[email protected]> for Intel Corp.)
+ */
+
+#ifndef __ASM_ARCH_PM_H
+#define __ASM_ARCH_PM_H
+
+#define  PMC_GPE_SW_31_0	0
+#define  PMC_GPE_SW_63_32	1
+#define  PMC_GPE_NW_31_0	3
+#define  PMC_GPE_NW_63_32	4
+#define  PMC_GPE_NW_95_64	5
+#define  PMC_GPE_N_31_0		6
+#define  PMC_GPE_N_63_32	7
+#define  PMC_GPE_W_31_0		9
+
+#endif
drivers/power/power_mgr/power-mgr-uclass.c +51 -0

57 lines not on this page · raw message

Signature · 1 line
2.23.0.444.g18eeb5a265-goog
#12 lore raw

PATCH 110/126 x86: apollolake: Add UART driver

In reply to Simon Glass

Add a driver for the apollolake UART. It uses the standard ns16550 device but also sets up the input clock with LPSS and supports configuration via of-platdata.

---

 arch/x86/cpu/apollolake/Makefile            |   1 +
 arch/x86/cpu/apollolake/uart.c              | 157 ++++++++++++++++++++
 arch/x86/include/asm/arch-apollolake/uart.h |  17 +++
 3 files changed, 175 insertions(+)
 create mode 100644 arch/x86/cpu/apollolake/uart.c
 create mode 100644 arch/x86/include/asm/arch-apollolake/uart.h
arch/x86/cpu/apollolake/Makefile +1 -0
index 5d98a5a6db2..af7c4396619 100644
@@ -3,3 +3,4 @@
 # Copyright (c) 2016 Google, Inc
 
 obj-y += pmc.o
+obj-y += uart.o
arch/x86/cpu/apollolake/uart.c new file +157 -0

157 lines not on this page · raw message

arch/x86/include/asm/arch-apollolake/uart.h new file +17 -0
new file mode 100644
index 00000000000..521316d0a93
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright 2019 Google LLC
+ */
+
+#ifndef __ASM_ARCH_UART_H
+#define __ASM_ARCH_UART_H
+
+/**
+ * apl_uart_init() - Set up the APL UART device and clock
+ *
+ * The UART won't actually work unless the GPIO settings are correct and the
+ * signals actually exit the SoC. See init_for_uart() for that.
+ */
+int apl_uart_init(pci_dev_t bdf, ulong base);
+
+#endif
Signature · 1 line
2.23.0.444.g18eeb5a265-goog
#13 lore raw

PATCH 111/126 x86: apollolake: Add GPIO driver

In reply to Simon Glass

Add a driver for the apollolake GPIOs. It also handles pinctrl since this is not very well separated on x86.

---

 arch/x86/cpu/apollolake/Makefile              |   1 +
 arch/x86/cpu/apollolake/gpio.c                | 742 ++++++++++++++++++
 arch/x86/include/asm/arch-apollolake/gpio.h   | 156 ++++
 .../include/asm/arch-apollolake/gpio_apl.h    | 491 ++++++++++++
 .../include/asm/arch-apollolake/gpio_defs.h   | 398 ++++++++++
 5 files changed, 1788 insertions(+)
 create mode 100644 arch/x86/cpu/apollolake/gpio.c
 create mode 100644 arch/x86/include/asm/arch-apollolake/gpio.h
 create mode 100644 arch/x86/include/asm/arch-apollolake/gpio_apl.h
 create mode 100644 arch/x86/include/asm/arch-apollolake/gpio_defs.h
arch/x86/cpu/apollolake/Makefile +1 -0
index af7c4396619..f985018228a 100644
@@ -2,5 +2,6 @@
 #
 # Copyright (c) 2016 Google, Inc
 
+obj-y += gpio.o
 obj-y += pmc.o
 obj-y += uart.o
arch/x86/cpu/apollolake/gpio.c new file +742 -0

742 lines not on this page · raw message

arch/x86/include/asm/arch-apollolake/gpio.h new file +156 -0

156 lines not on this page · raw message

arch/x86/include/asm/arch-apollolake/gpio_apl.h new file +491 -0

491 lines not on this page · raw message

arch/x86/include/asm/arch-apollolake/gpio_defs.h new file +398 -0

398 lines not on this page · raw message

Signature · 1 line
2.23.0.444.g18eeb5a265-goog
#14 lore raw

PATCH 112/126 x86: apollolake: Add defintions for the Intel Fast SPI interface

In reply to Simon Glass

Provide definitions for using this device on apollolake. They should perhaps be moved into a more generic place.

---

 .../include/asm/arch-apollolake/fast_spi.h    | 176 ++++++++++++++++++
 1 file changed, 176 insertions(+)
 create mode 100644 arch/x86/include/asm/arch-apollolake/fast_spi.h
arch/x86/include/asm/arch-apollolake/fast_spi.h new file +176 -0
new file mode 100644
index 00000000000..ebae1f87ebf
@@ -0,0 +1,176 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * This file is part of the coreboot project.
+ *
+ * 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.
+ */
+
+#ifndef SOC_INTEL_COMMON_BLOCK_FAST_SPI_DEF_H
+#define SOC_INTEL_COMMON_BLOCK_FAST_SPI_DEF_H
+
+/* PCI configuration registers */
+
+#define SPIDVID_OFFSET			0x0
+#define SPIBAR_BIOS_CONTROL		0xdc
+
+/* Bit definitions for BIOS_CONTROL */
+#define SPIBAR_BIOS_CONTROL_WPD			BIT(0)
+#define SPIBAR_BIOS_CONTROL_LOCK_ENABLE		BIT(1)
+#define SPIBAR_BIOS_CONTROL_CACHE_DISABLE	BIT(2)
+#define SPIBAR_BIOS_CONTROL_PREFETCH_ENABLE	BIT(3)
+#define SPIBAR_BIOS_CONTROL_EISS		BIT(5)
+#define SPIBAR_BIOS_CONTROL_BILD		BIT(7)
+
+/* Register offsets from the MMIO region base (PCI_BASE_ADDRESS_0) */
+struct fast_spi_regs {
+	u32 bfp;
+	u32 hsfsts_ctl;
+	u32 faddr;
+	u32 dlock;
+
+	u32 fdata[0x10];
+
+	u8 spare[0x84 - 0x50];
+	u32 fpr[8];
+	u16 preop;
+	u16 optype;
+	u32 opmenu_lower;
+	u32 opmenu_upper;
+
+	u32 space2;
+	u32 fdoc;
+	u32 fdod;
+	u32 spare3[4];
+	u32 ptinx;
+	u32 ptdata;
+};
+check_member(fast_spi_regs, ptdata, 0xd0);
+
+/* Bit definitions for BFPREG (0x00) register */
+#define SPIBAR_BFPREG_PRB_MASK		0x7fff
+#define SPIBAR_BFPREG_PRL_SHIFT		16
+#define SPIBAR_BFPREG_PRL_MASK		(0x7fff << SPIBAR_BFPREG_PRL_SHIFT)
+#define SPIBAR_BFPREG_SBRS		BIT(31)
+
+/* Bit definitions for HSFSTS_CTL (0x04) register */
+#define SPIBAR_HSFSTS_FDBC_MASK	(0x3f << 24)
+#define SPIBAR_HSFSTS_FDBC(n)		(((n) << 24) & SPIBAR_HSFSTS_FDBC_MASK)
+#define SPIBAR_HSFSTS_WET		BIT(21)
+#define SPIBAR_HSFSTS_FCYCLE_MASK	(0xf << 17)
+#define SPIBAR_HSFSTS_FCYCLE(cyc)	(((cyc) << 17) \
+					& SPIBAR_HSFSTS_FCYCLE_MASK)
+/* Supported flash cycle types */
+#define SPIBAR_HSFSTS_CYCLE_READ	SPIBAR_HSFSTS_FCYCLE(0)
+#define SPIBAR_HSFSTS_CYCLE_WRITE	SPIBAR_HSFSTS_FCYCLE(2)
+#define SPIBAR_HSFSTS_CYCLE_4K_ERASE	SPIBAR_HSFSTS_FCYCLE(3)
+#define SPIBAR_HSFSTS_CYCLE_64K_ERASE	SPIBAR_HSFSTS_FCYCLE(4)
+#define SPIBAR_HSFSTS_CYCLE_RD_STATUS	SPIBAR_HSFSTS_FCYCLE(8)
+
+#define SPIBAR_HSFSTS_FGO		BIT(16)
+#define SPIBAR_HSFSTS_FLOCKDN		BIT(15)
+#define SPIBAR_HSFSTS_FDV		BIT(14)
+#define SPIBAR_HSFSTS_FDOPSS		BIT(13)
+#define SPIBAR_HSFSTS_WRSDIS		BIT(11)
+#define SPIBAR_HSFSTS_SAF_CE		BIT(8)
+#define SPIBAR_HSFSTS_SAF_ACTIVE	BIT(7)
+#define SPIBAR_HSFSTS_SAF_LE		BIT(6)
+#define SPIBAR_HSFSTS_SCIP		BIT(5)
+#define SPIBAR_HSFSTS_SAF_DLE		BIT(4)
+#define SPIBAR_HSFSTS_SAF_ERROR		BIT(3)
+#define SPIBAR_HSFSTS_AEL		BIT(2)
+#define SPIBAR_HSFSTS_FCERR		BIT(1)
+#define SPIBAR_HSFSTS_FDONE		BIT(0)
+#define SPIBAR_HSFSTS_W1C_BITS		0xff
+
+#define WPSR_MASK_SRP0_BIT 0x80
+
+/* Bit definitions for FADDR (0x08) register */
+#define SPIBAR_FADDR_MASK		0x7FFFFFF
+
+/* Bit definitions for DLOCK (0x0C) register */
+#define SPIBAR_DLOCK_PR0LOCKDN		BIT(8)
+#define SPIBAR_DLOCK_PR1LOCKDN		BIT(9)
+#define SPIBAR_DLOCK_PR2LOCKDN		BIT(10)
+#define SPIBAR_DLOCK_PR3LOCKDN		BIT(11)
+#define SPIBAR_DLOCK_PR4LOCKDN		BIT(12)
+
+/* Maximum bytes of data that can fit in FDATAn (0x10) registers */
+#define SPIBAR_FDATA_FIFO_SIZE		0x40
+
+/* Bit definitions for FDOC (0xB4) register */
+#define SPIBAR_FDOC_COMPONENT		BIT(12)
+#define SPIBAR_FDOC_FDSI_1		BIT(2)
+
+/* Flash Descriptor Component Section - Component 0 Density Bit Settings */
+#define FLCOMP_C0DEN_MASK		0xF
+#define FLCOMP_C0DEN_8MB		4
+#define FLCOMP_C0DEN_16MB		5
+#define FLCOMP_C0DEN_32MB		6
+
+/* Bit definitions for FPRn (0x84 + (4 * n)) registers */
+#define SPIBAR_FPR_WPE			BIT(31) /* Flash Write protected */
+#define SPIBAR_FPR_MAX			5
+
+/* Programmable values for OPMENU_LOWER(0xA8) & OPMENU_UPPER(0xAC) register */
+#define SPI_OPMENU_0			0x01 /* WRSR: Write Status Register */
+#define SPI_OPTYPE_0			0x01 /* Write, no address */
+#define SPI_OPMENU_1			0x02 /* BYPR: Byte Program */
+#define SPI_OPTYPE_1			0x03 /* Write, address required */
+#define SPI_OPMENU_2			0x03 /* READ: Read Data */
+#define SPI_OPTYPE_2			0x02 /* Read, address required */
+#define SPI_OPMENU_3			0x05 /* RDSR: Read Status Register */
+#define SPI_OPTYPE_3			0x00 /* Read, no address */
+#define SPI_OPMENU_4			0x20 /* SE20: Sector Erase 0x20 */
+#define SPI_OPTYPE_4			0x03 /* Write, address required */
+#define SPI_OPMENU_5			0x9f /* RDID: Read ID */
+#define SPI_OPTYPE_5			0x00 /* Read, no address */
+#define SPI_OPMENU_6			0xd8 /* BED8: Block Erase 0xd8 */
+#define SPI_OPTYPE_6			0x03 /* Write, address required */
+#define SPI_OPMENU_7			0x0b /* FAST: Fast Read */
+#define SPI_OPTYPE_7			0x02 /* Read, address required */
+#define SPI_OPMENU_UPPER ((SPI_OPMENU_7 << 24) | (SPI_OPMENU_6 << 16) | \
+			  (SPI_OPMENU_5 << 8) | SPI_OPMENU_4)
+#define SPI_OPMENU_LOWER ((SPI_OPMENU_3 << 24) | (SPI_OPMENU_2 << 16) | \
+			  (SPI_OPMENU_1 << 8) | SPI_OPMENU_0)
+#define SPI_OPTYPE ((SPI_OPTYPE_7 << 14) | (SPI_OPTYPE_6 << 12) | \
+		    (SPI_OPTYPE_5 << 10) | (SPI_OPTYPE_4 << 8)  | \
+		    (SPI_OPTYPE_3 << 6) | (SPI_OPTYPE_2 << 4)   | \
+		    (SPI_OPTYPE_1 << 2) | (SPI_OPTYPE_0))
+#define SPI_OPPREFIX ((0x50 << 8) | 0x06) /* EWSR and WREN */
+
+/* Bit definitions for PTINX (0xCC) register */
+#define SPIBAR_PTINX_COMP_0		(0 << 14)
+#define SPIBAR_PTINX_COMP_1		(1 << 14)
+#define SPIBAR_PTINX_HORD_SFDP		(0 << 12)
+#define SPIBAR_PTINX_HORD_PARAM		(1 << 12)
+#define SPIBAR_PTINX_HORD_JEDEC		(2 << 12)
+#define SPIBAR_PTINX_IDX_MASK		0xffc
+
+/* Register Offsets of BIOS Flash Program Registers */
+#define SPIBAR_RESET_LOCK               0xF0
+#define SPIBAR_RESET_CTRL               0xF4
+#define SPIBAR_RESET_DATA               0xF8
+
+/* Programmable values of Bit0 (SSL) of Set STRAP MSG LOCK (0xF0) Register */
+#define SPIBAR_RESET_LOCK_DISABLE	0 /* Set_Strap Lock(SSL) Bit 0 = 0 */
+#define SPIBAR_RESET_LOCK_ENABLE	1 /* Set_Strap Lock(SSL) Bit 0 = 1 */
+
+/* Programmable values of Bit0(SSMS) of Set STRAP MSG Control (0xF4) Register*/
+#define SPIBAR_RESET_CTRL_SSMC		1 /* Set_Strap Mux Select(SSMS) Bit=1*/
+
+#define SPIBAR_HWSEQ_XFER_TIMEOUT_MS	5000 /* max 5s*/
+
+ulong fast_spi_get_bios_region(struct fast_spi_regs *regs, size_t *bios_size);
+
+int fast_spi_get_bios_mmap(ulong *map_basep, size_t *map_sizep, uint *offsetp);
+
+#endif	/* SOC_INTEL_COMMON_BLOCK_FAST_SPI_DEF_H */
Signature · 1 line
2.23.0.444.g18eeb5a265-goog
#15 lore raw

PATCH 113/126 x86: apollolake: Add systemagent driver

In reply to Simon Glass

This driver handles communication with the systemagent which needs to be told when U-Boot has completed its init.

---

 arch/x86/cpu/apollolake/Makefile              |  2 ++
 arch/x86/cpu/apollolake/systemagent.c         | 19 ++++++++++++
 .../include/asm/arch-apollolake/systemagent.h | 31 +++++++++++++++++++
 3 files changed, 52 insertions(+)
 create mode 100644 arch/x86/cpu/apollolake/systemagent.c
 create mode 100644 arch/x86/include/asm/arch-apollolake/systemagent.h
arch/x86/cpu/apollolake/Makefile +2 -0
index f985018228a..5d5fc0b5949 100644
@@ -2,6 +2,8 @@
 #
 # Copyright (c) 2016 Google, Inc
 
+obj-$(CONFIG_SPL_BUILD) += systemagent.o
+
 obj-y += gpio.o
 obj-y += pmc.o
 obj-y += uart.o
arch/x86/cpu/apollolake/systemagent.c new file +19 -0
new file mode 100644
index 00000000000..3a41b329c3d
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2017 Intel Corporation.
+ * Take from coreboot project file of the same name
+ */
+
+#include <common.h>
+#include <asm/intel_regs.h>
+#include <asm/io.h>
+#include <asm/arch/systemagent.h>
+
+void enable_bios_reset_cpl(void)
+{
+	/*
+	 * Set bits 0+1 of BIOS_RESET_CPL to indicate to the CPU
+	 * that BIOS has initialised memory and power management
+	 */
+	setbits_8(MCHBAR_REG(BIOS_RESET_CPL), 3);
+}
arch/x86/include/asm/arch-apollolake/systemagent.h new file +31 -0
new file mode 100644
index 00000000000..5983e4e6302
@@ -0,0 +1,31 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2017 Intel Corporation.
+ * Take from coreboot project file of the same name
+ */
+
+#ifndef __ARCH_SYSTEMAGENT_H
+#define __ARCH_SYSTEMAGENT_H
+
+/* Device 0:0.0 PCI configuration space */
+#define MCHBAR		0x48
+
+/* RAPL Package Power Limit register under MCHBAR */
+#define PUNIT_THERMAL_DEVICE_IRQ		0x700C
+#define PUINT_THERMAL_DEVICE_IRQ_VEC_NUMBER	0x18
+#define PUINT_THERMAL_DEVICE_IRQ_LOCK		0x80000000
+#define BIOS_RESET_CPL		0x7078
+#define   PCODE_INIT_DONE	BIT(8)
+#define MCHBAR_RAPL_PPL		0x70A8
+#define CORE_DISABLE_MASK	0x7168
+#define CAPID0_A		0xE4
+#define   VTD_DISABLE		BIT(23)
+#define DEFVTBAR		0x6c80
+#define GFXVTBAR		0x6c88
+#define   VTBAR_ENABLED		0x01
+#define VTBAR_MASK		0xfffffff000ull
+#define VTBAR_SIZE		0x1000
+
+void enable_bios_reset_cpl(void);
+
+#endif
Signature · 1 line
2.23.0.444.g18eeb5a265-goog
#16 lore raw

PATCH 114/126 x86: apollolake: Add hostbridge driver

In reply to Simon Glass

This driver models the hostbridge as a northbridge. It simply sets up the graphics BAR. It supports of-platdata.

---

 arch/x86/cpu/apollolake/Makefile     |   1 +
 arch/x86/cpu/apollolake/hostbridge.c | 127 +++++++++++++++++++++++++++
 2 files changed, 128 insertions(+)
 create mode 100644 arch/x86/cpu/apollolake/hostbridge.c
arch/x86/cpu/apollolake/Makefile +1 -0
index 5d5fc0b5949..13113fadc79 100644
@@ -5,5 +5,6 @@
 obj-$(CONFIG_SPL_BUILD) += systemagent.o
 
 obj-y += gpio.o
+obj-y += hostbridge.o
 obj-y += pmc.o
 obj-y += uart.o
arch/x86/cpu/apollolake/hostbridge.c new file +127 -0

127 lines not on this page · raw message

Signature · 1 line
2.23.0.444.g18eeb5a265-goog
#17 lore raw

PATCH 115/126 x86: apollolake: Add ITSS driver

In reply to Simon Glass

This driver models some sort of interrupt thingy but there are so many abreviations that I cannot find out what it stands for. Possibly something to do with interrupts.

---

 arch/x86/cpu/apollolake/Makefile            |   1 +
 arch/x86/cpu/apollolake/itss.c              | 129 ++++++++++++++++++++
 arch/x86/include/asm/arch-apollolake/itss.h |  43 +++++++
 3 files changed, 173 insertions(+)
 create mode 100644 arch/x86/cpu/apollolake/itss.c
 create mode 100644 arch/x86/include/asm/arch-apollolake/itss.h
arch/x86/cpu/apollolake/Makefile +1 -0
index 13113fadc79..5b7b6489bb0 100644
@@ -6,5 +6,6 @@ obj-$(CONFIG_SPL_BUILD) += systemagent.o
 
 obj-y += gpio.o
 obj-y += hostbridge.o
+obj-y += itss.o
 obj-y += pmc.o
 obj-y += uart.o
arch/x86/cpu/apollolake/itss.c new file +129 -0

129 lines not on this page · raw message

arch/x86/include/asm/arch-apollolake/itss.h new file +43 -0

43 lines not on this page · raw message

Signature · 1 line
2.23.0.444.g18eeb5a265-goog
#18 lore raw

PATCH 116/126 x86: apollolake: Add LPC driver

In reply to Simon Glass

This driver the LPC and provides a few functions to set up LPC features. These should probably use ioctls() or perhaps, better, have specific uclass methods.

---

 arch/x86/cpu/apollolake/Makefile           |   1 +
 arch/x86/cpu/apollolake/lpc.c              | 155 +++++++++++++++++++++
 arch/x86/include/asm/arch-apollolake/lpc.h |  61 ++++++++
 3 files changed, 217 insertions(+)
 create mode 100644 arch/x86/cpu/apollolake/lpc.c
 create mode 100644 arch/x86/include/asm/arch-apollolake/lpc.h
arch/x86/cpu/apollolake/Makefile +1 -0
index 5b7b6489bb0..2bee6b6eb0d 100644
@@ -7,5 +7,6 @@ obj-$(CONFIG_SPL_BUILD) += systemagent.o
 obj-y += gpio.o
 obj-y += hostbridge.o
 obj-y += itss.o
+obj-y += lpc.o
 obj-y += pmc.o
 obj-y += uart.o
arch/x86/cpu/apollolake/lpc.c new file +155 -0

155 lines not on this page · raw message

arch/x86/include/asm/arch-apollolake/lpc.h new file +61 -0

61 lines not on this page · raw message

Signature · 1 line
2.23.0.444.g18eeb5a265-goog
#19 lore raw

PATCH 117/126 x86: apollolake: Add PCH driver

In reply to Simon Glass

Add a driver for the apollolake Platform Controller Hub. It does not have any functionality and is just a placeholder for now.

---

 arch/x86/cpu/apollolake/Makefile           |  1 +
 arch/x86/cpu/apollolake/pch.c              | 29 ++++++++++++++++++++++
 arch/x86/include/asm/arch-apollolake/pch.h |  9 +++++++
 3 files changed, 39 insertions(+)
 create mode 100644 arch/x86/cpu/apollolake/pch.c
 create mode 100644 arch/x86/include/asm/arch-apollolake/pch.h
arch/x86/cpu/apollolake/Makefile +1 -0
index 2bee6b6eb0d..2760c88c153 100644
@@ -8,5 +8,6 @@ obj-y += gpio.o
 obj-y += hostbridge.o
 obj-y += itss.o
 obj-y += lpc.o
+obj-y += pch.o
 obj-y += pmc.o
 obj-y += uart.o
arch/x86/cpu/apollolake/pch.c new file +29 -0
new file mode 100644
index 00000000000..a51198f3d83
@@ -0,0 +1,29 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright 2019 Google LLC
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <pch.h>
+
+static int apl_pch_probe(struct udevice *dev)
+{
+	return 0;
+}
+
+static const struct pch_ops apl_pch_ops = {
+};
+
+static const struct udevice_id apl_pch_ids[] = {
+	{ .compatible = "intel,apl-pch" },
+	{ }
+};
+
+U_BOOT_DRIVER(apl_pch) = {
+	.name		= "apl_pch",
+	.id		= UCLASS_PCH,
+	.of_match	= apl_pch_ids,
+	.probe		= apl_pch_probe,
+	.ops		= &apl_pch_ops,
+};
arch/x86/include/asm/arch-apollolake/pch.h new file +9 -0
new file mode 100644
index 00000000000..7f19903a3fe
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright 2019 Google LLC
+ */
+
+#ifndef __ASM_ARCH_PCH_H
+#define __ASM_ARCH_PCH_H
+
+#endif /* __ASM_ARCH_PCH_H */
Signature · 1 line
2.23.0.444.g18eeb5a265-goog
#20 lore raw

PATCH 118/126 x86: apollolake: Add PUNIT driver

In reply to Simon Glass

Add a driver for the apollolake power unit. It is modelled as a syscon driver since it only needs to be probed.

---

 arch/x86/cpu/apollolake/Makefile |   3 +
 arch/x86/cpu/apollolake/punit.c  | 121 +++++++++++++++++++++++++++++++
 2 files changed, 124 insertions(+)
 create mode 100644 arch/x86/cpu/apollolake/punit.c
arch/x86/cpu/apollolake/Makefile +3 -0
index 2760c88c153..42ba6ce9957 100644
@@ -3,6 +3,9 @@
 # Copyright (c) 2016 Google, Inc
 
 obj-$(CONFIG_SPL_BUILD) += systemagent.o
+ifndef CONFIG_TPL_BUILD
+obj-y += punit.o
+endif
 
 obj-y += gpio.o
 obj-y += hostbridge.o
arch/x86/cpu/apollolake/punit.c new file +121 -0

121 lines not on this page · raw message

Signature · 1 line
2.23.0.444.g18eeb5a265-goog
#21 lore raw

PATCH 119/126 x86: apollolake: Add SPL loaders

In reply to Simon Glass

Add loaders for SPL and TPL so that the next stage can be loaded from memory-mapped SPI or, failing that, the Fast SPI driver.

---

 arch/x86/cpu/apollolake/Makefile |   2 +
 arch/x86/cpu/apollolake/spl.c    | 122 +++++++++++++++++++++++++++++++
 2 files changed, 124 insertions(+)
 create mode 100644 arch/x86/cpu/apollolake/spl.c
arch/x86/cpu/apollolake/Makefile +2 -0
index 42ba6ce9957..ba7e93c2f66 100644
@@ -2,7 +2,9 @@
 #
 # Copyright (c) 2016 Google, Inc
 
+obj-$(CONFIG_SPL_BUILD) += spl.o
 obj-$(CONFIG_SPL_BUILD) += systemagent.o
+
 ifndef CONFIG_TPL_BUILD
 obj-y += punit.o
 endif
arch/x86/cpu/apollolake/spl.c new file +122 -0

122 lines not on this page · raw message

Signature · 1 line
2.23.0.444.g18eeb5a265-goog
#22 lore raw

PATCH 120/126 x86: apollolake: Add a CPU driver

In reply to Simon Glass

Add a bare-bones CPU driver so that CPUs can be probed.

---

 arch/x86/cpu/apollolake/Makefile           |  1 +
 arch/x86/cpu/apollolake/cpu.c              | 51 ++++++++++++++++++++++
 arch/x86/include/asm/arch-apollolake/cpu.h | 21 +++++++++
 3 files changed, 73 insertions(+)
 create mode 100644 arch/x86/cpu/apollolake/cpu.c
 create mode 100644 arch/x86/include/asm/arch-apollolake/cpu.h
arch/x86/cpu/apollolake/Makefile +1 -0
index ba7e93c2f66..c0b79ae2861 100644
@@ -6,6 +6,7 @@ obj-$(CONFIG_SPL_BUILD) += spl.o
 obj-$(CONFIG_SPL_BUILD) += systemagent.o
 
 ifndef CONFIG_TPL_BUILD
+obj-y += cpu.o
 obj-y += punit.o
 endif
 
arch/x86/cpu/apollolake/cpu.c new file +51 -0

51 lines not on this page · raw message

arch/x86/include/asm/arch-apollolake/cpu.h new file +21 -0
new file mode 100644
index 00000000000..2c5f9138ead
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright 2019 Google LLC
+ */
+
+#ifndef __ASM_ARCH_CPU_H
+#define __ASM_ARCH_CPU_H
+
+/* Common Timer Copy (CTC) frequency - 19.2MHz */
+#define CTC_FREQ		19200000
+
+/* Set to true to use the fast SPI driver to boot, instead of mapped SPI */
+#define BOOT_FROM_FAST_SPI_FLASH	false
+
+/*
+ * We need to read well past the end of the region in order for execution from
+ * the loaded data to work. It is not clear why.
+ */
+#define SAFETY_MARGIN	0x4000
+
+#endif /* __ASM_ARCH_CPU_H */
Signature · 1 line
2.23.0.444.g18eeb5a265-goog
#23 lore raw

PATCH 121/126 x86: apollolake: Add SPL/TPL init

In reply to Simon Glass

Add code to init the system both in TPL and SPL. Each phase has its own procedure.

---

 arch/x86/cpu/apollolake/Makefile  |   1 +
 arch/x86/cpu/apollolake/cpu_spl.c | 272 ++++++++++++++++++++++++++++++
 2 files changed, 273 insertions(+)
 create mode 100644 arch/x86/cpu/apollolake/cpu_spl.c
arch/x86/cpu/apollolake/Makefile +1 -0
index c0b79ae2861..f6b8caafd33 100644
@@ -2,6 +2,7 @@
 #
 # Copyright (c) 2016 Google, Inc
 
+obj-$(CONFIG_SPL_BUILD) += cpu_spl.o
 obj-$(CONFIG_SPL_BUILD) += spl.o
 obj-$(CONFIG_SPL_BUILD) += systemagent.o
 
arch/x86/cpu/apollolake/cpu_spl.c new file +272 -0

272 lines not on this page · raw message

Signature · 1 line
2.23.0.444.g18eeb5a265-goog
#24 lore raw

PATCH 122/126 x86: apollolake: Add P2SB driver

In reply to Simon Glass

Adds a driver for the apollolake Primary-to-sideband bus. This supports various child devices. It supposed both device tree and of-platdata.

---

 arch/x86/cpu/apollolake/Makefile |   1 +
 arch/x86/cpu/apollolake/p2sb.c   | 167 +++++++++++++++++++++++++++++++
 2 files changed, 168 insertions(+)
 create mode 100644 arch/x86/cpu/apollolake/p2sb.c
arch/x86/cpu/apollolake/Makefile +1 -0
index f6b8caafd33..973f552cc7f 100644
@@ -15,6 +15,7 @@ obj-y += gpio.o
 obj-y += hostbridge.o
 obj-y += itss.o
 obj-y += lpc.o
+obj-y += p2sb.o
 obj-y += pch.o
 obj-y += pmc.o
 obj-y += uart.o
arch/x86/cpu/apollolake/p2sb.c new file +167 -0

167 lines not on this page · raw message

Signature · 1 line
2.23.0.444.g18eeb5a265-goog
#25 lore raw

PATCH 123/126 x86: apollolake: Add Kconfig and Makefile

In reply to Simon Glass

Add basic plumbing to allow apollolake support to be used.

---

 arch/x86/Kconfig                |  1 +
 arch/x86/cpu/Makefile           |  1 +
 arch/x86/cpu/apollolake/Kconfig | 68 +++++++++++++++++++++++++++++++++
 3 files changed, 70 insertions(+)
 create mode 100644 arch/x86/cpu/apollolake/Kconfig
arch/x86/Kconfig +1 -0
index 9d01801ff13..e0e1f617ffd 100644
@@ -106,6 +106,7 @@ source "board/google/Kconfig"
 source "board/intel/Kconfig"
 
 # platform-specific options below
+source "arch/x86/cpu/apollolake/Kconfig"
 source "arch/x86/cpu/baytrail/Kconfig"
 source "arch/x86/cpu/braswell/Kconfig"
 source "arch/x86/cpu/broadwell/Kconfig"
arch/x86/cpu/Makefile +1 -0
index b6a010ea320..4c151f8c94d 100644
@@ -41,6 +41,7 @@ extra-y += call32.o
 endif
 
 obj-y += intel_common/
+obj-$(CONFIG_INTEL_APOLLOLAKE) += apollolake/
 obj-$(CONFIG_INTEL_BAYTRAIL) += baytrail/
 obj-$(CONFIG_INTEL_BRASWELL) += braswell/
 obj-$(CONFIG_INTEL_BROADWELL) += broadwell/
arch/x86/cpu/apollolake/Kconfig new file +68 -0

68 lines not on this page · raw message

Signature · 1 line
2.23.0.444.g18eeb5a265-goog
#26 lore raw

PATCH 124/126 x86: apollolake: Add FSP structures

In reply to Simon Glass

These are mostly specific to a particular SoC. Add the definitions for apollolake.

---

 .../asm/arch-apollolake/fsp/fsp_configs.h     |  13 ++
 .../asm/arch-apollolake/fsp/fsp_m_upd.h       | 127 ++++++++++++++++++
 .../include/asm/arch-apollolake/fsp/fsp_vpd.h |  11 ++
 3 files changed, 151 insertions(+)
 create mode 100644 arch/x86/include/asm/arch-apollolake/fsp/fsp_configs.h
 create mode 100644 arch/x86/include/asm/arch-apollolake/fsp/fsp_m_upd.h
 create mode 100644 arch/x86/include/asm/arch-apollolake/fsp/fsp_vpd.h
arch/x86/include/asm/arch-apollolake/fsp/fsp_configs.h new file +13 -0
new file mode 100644
index 00000000000..46e54e39994
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: Intel */
+/*
+ * Copyright 2019 Google LLC
+ */
+
+#ifndef __FSP_CONFIGS_H__
+#define __FSP_CONFIGS_H__
+
+#define FSPT_UPD_SIGNATURE	0x545F4450554C5041	/* 'APLUPD_T' */
+#define FSPM_UPD_SIGNATURE	0x4D5F4450554C5041	/* 'APLUPD_M' */
+#define FSPS_UPD_SIGNATURE	0x535F4450554C5041	/* 'APLUPD_S' */
+
+#endif
arch/x86/include/asm/arch-apollolake/fsp/fsp_m_upd.h new file +127 -0

127 lines not on this page · raw message

arch/x86/include/asm/arch-apollolake/fsp/fsp_vpd.h new file +11 -0
new file mode 100644
index 00000000000..b14f28b2364
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: Intel */
+/*
+ * Copyright 2019 Google LLC
+ */
+
+#ifndef __FSP_VPD_H
+#define __FSP_VPD_H
+
+/* Nothing to declare here for FSP2 */
+
+#endif
Signature · 1 line
2.23.0.444.g18eeb5a265-goog
#27 lore raw

PATCH 125/126 x86: Add chromebook_coral

In reply to Simon Glass

Add support for coral which is a range of apollolake-based Chromebook released in 2017. This also includes reef released in 2016, since it is based on the same SoC.

---

 arch/x86/dts/Makefile                     |   1 +
 arch/x86/dts/chromebook_coral.dts         | 298 ++++++++++++++++++++++
 board/google/Kconfig                      |  15 ++
 board/google/chromebook_coral/Kconfig     |  43 ++++
 board/google/chromebook_coral/MAINTAINERS |   6 +
 board/google/chromebook_coral/Makefile    |   5 +
 board/google/chromebook_coral/coral.c     |  18 ++
 configs/chromebook_coral_defconfig        |  95 +++++++
 doc/board/google/chromebook_coral.rst     |  25 ++
 include/configs/chromebook_coral.h        |  29 +++
 10 files changed, 535 insertions(+)
 create mode 100644 arch/x86/dts/chromebook_coral.dts
 create mode 100644 board/google/chromebook_coral/Kconfig
 create mode 100644 board/google/chromebook_coral/MAINTAINERS
 create mode 100644 board/google/chromebook_coral/Makefile
 create mode 100644 board/google/chromebook_coral/coral.c
 create mode 100644 configs/chromebook_coral_defconfig
 create mode 100644 doc/board/google/chromebook_coral.rst
 create mode 100644 include/configs/chromebook_coral.h
arch/x86/dts/Makefile +1 -0
index d4bdf62be6d..be209aaaf8f 100644
@@ -2,6 +2,7 @@
 
 dtb-y += bayleybay.dtb \
 	cherryhill.dtb \
+	chromebook_coral.dtb \
 	chromebook_link.dtb \
 	chromebox_panther.dtb \
 	chromebook_samus.dtb \
arch/x86/dts/chromebook_coral.dts new file +298 -0

298 lines not on this page · raw message

board/google/Kconfig +15 -0
index 679a0f10239..1d67fda0676 100644
@@ -60,8 +60,23 @@ config TARGET_CHROMEBOOK_SAMUS_TPL
 	  between different A/B versions of SPL/U-Boot, to allow upgrading of
 	  almost all U-Boot code in the field.
 
+config TARGET_CHROMEBOOK_CORAL
+	bool "Chromebook coral"
+	help
+	  This is a range of Intel-based laptops released in 2018. They use an
+	  Intel Apollolake CPU. The design supports WiFi, 4GB to 16GB of
+	  LPDDR4 1600MHz SDRAM, PCIe WiFi and Bluetooth, eMMC (typically 32GB),
+	  up two cameras (front-facing 720p and another 5MP option), USB SD
+	  reader, microphone and speakers. It also includes two USB 3 Type A and
+	  two Type C ports. The latter are used as power input and can also
+	  charge external devices as well as a 4K external display. There is a
+	  Chrome OS EC connected on LPC, a Cr50 secure chip from Google and
+	  various display options. OEMs products include Acer Chromebook 11
+	  (e.g. C732, CB11, CP311) and Lenovo Chromebook (100e, 300e, 500e).
+
 endchoice
 
+source "board/google/chromebook_coral/Kconfig"
 source "board/google/chromebook_link/Kconfig"
 source "board/google/chromebox_panther/Kconfig"
 source "board/google/chromebook_samus/Kconfig"
board/google/chromebook_coral/Kconfig new file +43 -0

43 lines not on this page · raw message

board/google/chromebook_coral/MAINTAINERS new file +6 -0
new file mode 100644
index 00000000000..904227e2e21
@@ -0,0 +1,6 @@
+CHROMEBOOK_CORAL_BOARD
+M:	Simon Glass <[email protected]>
+S:	Maintained
+F:	board/google/chromebook_coral/
+F:	include/configs/chromebook_coral.h
+F:	configs/chromebook_coral_defconfig
board/google/chromebook_coral/Makefile new file +5 -0
new file mode 100644
index 00000000000..6a27ce3da1b
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright 2019 Google LLC
+
+obj-y	+= coral.o
board/google/chromebook_coral/coral.c new file +18 -0
new file mode 100644
index 00000000000..dfe0fa484a1
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2019 Google LLC
+ */
+
+#include <common.h>
+
+int arch_misc_init(void)
+{
+	return 0;
+}
+
+int board_run_command(const char *cmdline)
+{
+	printf("No command line\n");
+
+	return 0;
+}
configs/chromebook_coral_defconfig new file +95 -0

95 lines not on this page · raw message

doc/board/google/chromebook_coral.rst new file +25 -0
new file mode 100644
index 00000000000..bf384b5e942
@@ -0,0 +1,25 @@
+.. SPDX-License-Identifier: GPL-2.0+
+.. sectionauthor:: Simon Glass <[email protected]>
+
+Chromebook Coral
+================
+
+Here are some random notes, to be expanded.
+
+Hob size returned from FSP is about 53KB.
+
+Partial ROM map
+
+fef07000	TPL/SPL Stack top
+fef10000
+fef16000 2a000	FSP M default stack
+fef40000	SPL
+fef71000 59000	FSP M
+fefca000
+
+Partial memory map
+
+CONFIG_BLOBLIST_ADDR=0x100000
+
+
+[1] Intel PDF https://www.coreboot.org/images/2/23/Apollolake_SoC.pdf
include/configs/chromebook_coral.h new file +29 -0
new file mode 100644
index 00000000000..5e447362ada
@@ -0,0 +1,29 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2019 Google LLC
+ */
+
+/*
+ * board/config.h - configuration options, board-specific
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#include <configs/x86-common.h>
+#include <configs/x86-chromebook.h>
+
+#undef CONFIG_STD_DEVICES_SETTINGS
+#define CONFIG_STD_DEVICES_SETTINGS     "stdin=usbkbd,i8042-kbd,serial\0" \
+					"stdout=vidconsole,serial\0" \
+					"stderr=vidconsole,serial\0"
+
+#define CONFIG_ENV_SECT_SIZE		0x1000
+#define CONFIG_ENV_OFFSET		0x003f8000
+
+#define CONFIG_TPL_TEXT_BASE		0xffff8000
+
+#define CONFIG_SYS_NS16550_MEM32
+#undef CONFIG_SYS_NS16550_PORT_MAPPED
+
+#endif	/* __CONFIG_H */
Signature · 1 line
2.23.0.444.g18eeb5a265-goog
#28 lore raw

PATCH 126/126 RFC: x86: coral: Add binary MRC data

In reply to Simon Glass

Add some pre-computed binary MRC data so that memory init does not take nearly 30 seconds to run on the first boot.

At present every time U-Boot is flashed, coral takes nearly 30 seconds to boot the first time. Add an initial MRC cache to speed this up. This is somewhat dangerous since the data is taken from just one board, so your mileage may vary.

This patch should not be applied.

---

 arch/x86/dts/u-boot.dtsi                       |  11 +++++++++++
 board/google/chromebook_coral/rw-mrc-cache     | Bin 0 -> 65536 bytes
 board/google/chromebook_coral/rw-var-mrc-cache | Bin 0 -> 4096 bytes
 3 files changed, 11 insertions(+)
 create mode 100644 board/google/chromebook_coral/rw-mrc-cache
 create mode 100644 board/google/chromebook_coral/rw-var-mrc-cache
arch/x86/dts/u-boot.dtsi +11 -0
index d9a4ca1184e..bf623ba0a57 100644
@@ -134,6 +134,17 @@
 #endif
 	fdtmap {
 	};
+	rw-mrc-cache {
+		type = "blob";
+		offset = <0xff3e0000>;
+		size = <0x10000>;
+		filename = "board/google/chromebook_coral/rw-mrc-cache";
+	};
+	rw-var-mrc-cache {
+		type = "blob";
+		size = <0x1000>;
+		filename = "board/google/chromebook_coral/rw-var-mrc-cache";
+	};
 #ifdef CONFIG_HAVE_CMC
 	intel-cmc {
 		filename = CONFIG_CMC_FILE;
board/google/chromebook_coral/rw-mrc-cache new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..931f7e251c46e03640d46756d5cb2915ec7efef4
GIT binary patch

z1x}O?VW0=#7*r0xq1RqHbD$Cummc7N)JjP3{_&2owY;0ncu}1A|D at NM-Fffr?9bhu zeY2b0Q)iE#xU;6z=~vadoI88^M6zEkDb;x8u&T+DSNn|?{~l2)FZxtksd-Ubx$G!) zRdiYOq^PY_#L=s^agt9fb!M+p87a%6wo=gIDOwS2qE49z0?UspwNDPPQ&OUCD?i&h z4*1<3ShiifYwI}RH*Wn=F{SRw@tKek_3f9%MWvt%3;oirM~B4isHg;5*Ik@*vz~B z2c$%On1r!GKMsrHl<F5JjLop^+pLq}P#G=z1TgI={cNPE=jy7IP+Q4}BNU_Q2qUWP z<{$NoM>S at xq#g}yxil7srl;>2K6#E3pjh#GGOD&UTRgnmFcCMH{VTv_myQBrEa;N zrnC%%t4^<4hEb|2o?f*K^g-Oxk!~cgiwVf3Y9#q!RdPWk8golqWY;AJL{50cEp6je z#L=s^ahCUrr(Co=A;D@=+R6iQOv!nEzi0>Nd&*=HaHnBxcY56N!Ov}XWWX<~d@!p1 z{2|BYpEyS4f-^f77oFaG@ZiA#e4!VS3my~2=^1&}FbQKLNvSfre^?MtJM8>ykb4^S zJFS{_lzukS6p7>|O3_v1d&4A*jrjEjbXce`>r6gq$}m3vn at wc-U_?C}i$l}1FXNUE zme=&^oe#@<-nsipD%HC2lc%d&tC~Epw>7sxYi}+%(opEl1yQ#Y=7W~t=(ei~)MW3x zYP+-ZGHMmwT=1oRwozm{O7g&KZZ7zSl(r)2TO|45i;@p&xfpp_%G?MSB at d-PX}QjH zM603{64(lXsPe%twzAOx+o<xdaqG|Ta%}!3nTvmV{x3C+~>?QMVK1de4aB6ozt zgt0+FicTPoUve781~H(pMZPyo!q^P+vss56up)|_&@UehV<YZ8kFHAHR!km<lJ^G( zC^8=$05Y)HOMkplu4_(lizb>Z6$60|K}Swu*nMtwi9-dCwR5v?GD-BT$n~d)2ll zCy)b5KKO!^=TWzm3vMoWQOZkWkPqf@;Ujufht6ewo;R8OWYqkE{c1ElnEm+(xj+T zQRRcTBf|cDL~+KgKXJLxyf4S+lTsGP;-YhYzMlso7d(tdEUg5N$h#!Sg5bhfqY= z&aB^GL>#|7E{qNCQNkZ3^3Y)t#%7qG%{t_IMyGuOn0AzYHqx{z+H*_PZ3WlxCKp6~ zTZQ)rgYl2s{lTx_fA1qzBD9lzVTq?)3@&g_dcNYGq=r at 0j5Ds%m;($u#E&rfCP3v z0nDf4q9rR at 5XCc9SVoC;D2<xuv0!HuZN?An#?ScX+;)^u*m$=kixd(d0TLhq64){U zj3wT&1!EDnehi>nHh7i&O5f at FCo!}b!KcbW1WeMWwaYV*qiNPTNDx?0TLhq60jkF zu>@lc#ubxCVV%jV%s7S#Wz?Y<w_t0=B8*K~k9F{cElM-CVcD#M4Q$Q!q)H(H5+DH* zAb~9tz&K)ZCe*#lX1yuRm}JHlty6#U$cxc3hS_J)|+LFcV?YbDIDwB(S>(EXt!c z3%;)g=<jP78x^~!<z;$-k4Bx*2lRP;Ch##wd4Z;=-^jpUUsfJ%g!jT4c%S8A@_y^ zCY^v*c+*?|-|c0g<qXz854tD1IC|zvQYGa5c(4dO3mS8lBtQZrKmsH{0wh2JBtQZr zKmsH{0=t#Kl2Y+>A(zi&Q^hGK5t9jnc)QV>?aXzX)%r|nx?HIxrxI~_iC8R$>s~G zbg@*QsaDF<wYheuDW=_GI+ZQtbD4Z0n=WQ at sicZ0Vve4YAniuC*(%Rerc2dYJuE}~ zq2Fd2HdeHDHNI51BkXOQAgfyyM+S{u0K<-+QCwkY3W4^lO3BQV--^1^adId(5vp zmz^u38<ANf0TP&G0-T(m<X at lrP68xA0wh2JBtQZrKmsH{0wh2JJCDGU%!7xWe2+U* ziKI-@H{aF)@-9wovGJk+Pxgp>k(8kF%@@WO6LpdOe&izmTJ}d^h~+ZmRb5{tI-Wh zXS0d<?R!h#E}opnQ}YMcU!3XxGljA7_ugok*U#za^~u1=G at jh8Ak_yROXg*O{V5Y zJm25pI9RS64?0!I61%be?#s836KB at kN^pg011!)36KB@kN^ox5iU|oHtLtZ#Ma! z&7{(~V!lwGnJ(4p)k?S1YPM$^b6Uq_PFMfm9{sCZ?yHWFoHSy6sM5w$-f5WAk= zJ}g&G&W9xxq20Vp%rB_m&tiqK3Dc!>k20^Uk{v|uj!ONF3-*f#k(L=^B0{_zHS&4 zooysQ0y~WWC+BzCFUJ0o011!)36KB at kN^pg011!)36Q{K6IhbTdGqA^W|Qw5M5W z1gEq-JRgranQS_hD-q7rI|y=H=&RTb*{Z+c0*Um193Sue0(#;X%=h@}VWUM}Zc6 zrD;Q=dTr3CH%|tCH?zFaQGQv4SZ!o>tEKCYrbCug4zCy{Xi{6cQi-5+DH*AOR8} z0TLhq5+DH*AOR8}0TLhq5+DH*AOR8}0TLhq5+DH*AOR8}0TLhq5+DH*AOR8}0TLhq z5+DH*AOR8}0TLhq5+DH*AOR8}0TLhq5+DH*AOR8}0TLhq5+DH*AOR8}0TLhq5*Skg F{{cmnsVo2h

literal 0
HcmV?d00001

board/google/chromebook_coral/rw-var-mrc-cache new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..73183cdd778ba152dfc5f6f516f879454dbf2faf
GIT binary patch
Signature · 1 line
2.23.0.444.g18eeb5a265-goog
#29 lore raw

PATCH 101/126 x86: Use fsp command with FSP1

In reply to Simon Glass

Hi Simon,

Quoted 15 lines · Simon Glass

The current 'fsp' command only works with FSP1. Update it to avoid trying to build it with FSP2.

---

 cmd/x86/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
cmd/x86/Makefile +0 -0
index 144b1cf5abe..c50ddccef57 100644

cmd/x86/Makefile line 6

Quoted 5 lines
cmd/x86/Makefile +1 -1
@@ -3,4 +3,4 @@
 obj-y += mtrr.o
 obj-$(CONFIG_CMD_EXCEPTION) += exception.o
 obj-$(CONFIG_USE_HOB) += hob.o
-obj-$(CONFIG_HAVE_FSP) += fsp.o
+obj-$(CONFIG_FSP_VERSION1) += fsp.o

Instead of making this command FSP1 only, can we update the codes to support FSP2? It only need output some basic information for the FSP2 file headers.

Quoted 1 line

--

Regards,
Bin