From 1e6ebee667da47fd3a87839a239a7574c66f5659 Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Tue, 15 Aug 2017 22:38:31 -0700 Subject: x86: fsp: Configure SPI opcode registers before SPI is locked down Some Intel FSP (like Braswell) does SPI lock-down during the call to fsp_notify(INIT_PHASE_BOOT). But before SPI lock-down is done, it's bootloader's responsibility to configure the SPI controller's opcode registers properly otherwise SPI controller driver doesn't know how to communicate with the SPI flash device. This introduces a Kconfig option CONFIG_FSP_LOCKDOWN_SPI for such FSPs. When it is on, U-Boot will configure the SPI opcode registers before the lock-down. Signed-off-by: Bin Meng Reviewed-by: Stefan Roese --- arch/x86/Kconfig | 9 +++++++++ arch/x86/lib/fsp/fsp_common.c | 24 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+) (limited to 'arch') diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index c26710b484c..53730829571 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -401,6 +401,15 @@ config FSP_BROKEN_HOB do not overwrite the important boot service data which is used by FSP, otherwise the subsequent call to fsp_notify() will fail. +config FSP_LOCKDOWN_SPI + bool + depends on HAVE_FSP + help + Some Intel FSP (like Braswell) does SPI lock-down during the call + to fsp_notify(INIT_PHASE_BOOT). This option should be turned on + for such FSP and U-Boot will configure the SPI opcode registers + before the lock-down. + config ENABLE_MRC_CACHE bool "Enable MRC cache" depends on !EFI && !SYS_COREBOOT diff --git a/arch/x86/lib/fsp/fsp_common.c b/arch/x86/lib/fsp/fsp_common.c index 3397bb83eaf..1714d13228e 100644 --- a/arch/x86/lib/fsp/fsp_common.c +++ b/arch/x86/lib/fsp/fsp_common.c @@ -19,6 +19,8 @@ DECLARE_GLOBAL_DATA_PTR; +extern void ich_spi_config_opcode(struct udevice *dev); + int checkcpu(void) { return 0; @@ -49,6 +51,28 @@ void board_final_cleanup(void) { u32 status; +#ifdef CONFIG_FSP_LOCKDOWN_SPI + struct udevice *dev; + + /* + * Some Intel FSP (like Braswell) does SPI lock-down during the call + * to fsp_notify(INIT_PHASE_BOOT). But before SPI lock-down is done, + * it's bootloader's responsibility to configure the SPI controller's + * opcode registers properly otherwise SPI controller driver doesn't + * know how to communicate with the SPI flash device. + * + * Note we cannot do such configuration elsewhere (eg: during the SPI + * controller driver's probe() routine), because: + * + * 1). U-Boot SPI controller driver does not set the lock-down bit + * 2). Any SPI transfer will corrupt the contents of these registers + * + * Hence we have to do it right here before SPI lock-down bit is set. + */ + if (!uclass_first_device_err(UCLASS_SPI, &dev)) + ich_spi_config_opcode(dev); +#endif + /* call into FspNotify */ debug("Calling into FSP (notify phase INIT_PHASE_BOOT): "); status = fsp_notify(NULL, INIT_PHASE_BOOT); -- cgit v1.3.1 From c11b17c6bf6c4bf2aa0f9a6f5de2c527e398ad63 Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Wed, 16 Aug 2017 05:46:49 -0700 Subject: x86: kconfig: Imply CMD_PCI Let's imply the 'pci' command to access the de facto interconnect bus in an x86 system. Signed-off-by: Bin Meng Reviewed-by: Stefan Roese --- arch/Kconfig | 1 + configs/bayleybay_defconfig | 1 - configs/chromebook_link64_defconfig | 1 - configs/chromebook_link_defconfig | 1 - configs/chromebook_samus_defconfig | 1 - configs/chromebox_panther_defconfig | 1 - configs/conga-qeval20-qa3-e3845-internal-uart_defconfig | 1 - configs/conga-qeval20-qa3-e3845_defconfig | 1 - configs/coreboot-x86_defconfig | 1 - configs/cougarcanyon2_defconfig | 1 - configs/crownbay_defconfig | 1 - configs/dfi-bt700-q7x-151_defconfig | 1 - configs/edison_defconfig | 1 + configs/efi-x86_defconfig | 1 - configs/galileo_defconfig | 1 - configs/minnowmax_defconfig | 1 - configs/qemu-x86_64_defconfig | 1 - configs/qemu-x86_defconfig | 1 - configs/qemu-x86_efi_payload32_defconfig | 1 - configs/qemu-x86_efi_payload64_defconfig | 1 - configs/som-db5800-som-6867_defconfig | 1 - configs/theadorable-x86-dfi-bt700_defconfig | 1 - 22 files changed, 2 insertions(+), 20 deletions(-) (limited to 'arch') diff --git a/arch/Kconfig b/arch/Kconfig index 78532f56ca8..3fc3c5739ab 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -112,6 +112,7 @@ config X86 imply CMD_GETTIME imply CMD_IO imply CMD_IRQ + imply CMD_PCI imply CMD_SF_TEST imply CMD_ZBOOT diff --git a/configs/bayleybay_defconfig b/configs/bayleybay_defconfig index b17113f6b3b..58a593186cd 100644 --- a/configs/bayleybay_defconfig +++ b/configs/bayleybay_defconfig @@ -23,7 +23,6 @@ CONFIG_CMD_CPU=y CONFIG_CMD_GPIO=y CONFIG_CMD_MMC=y CONFIG_CMD_PART=y -CONFIG_CMD_PCI=y CONFIG_CMD_SF=y CONFIG_CMD_SPI=y CONFIG_CMD_USB=y diff --git a/configs/chromebook_link64_defconfig b/configs/chromebook_link64_defconfig index f058e560ef3..da247152a83 100644 --- a/configs/chromebook_link64_defconfig +++ b/configs/chromebook_link64_defconfig @@ -35,7 +35,6 @@ CONFIG_CMD_CPU=y # CONFIG_CMD_IMLS is not set # CONFIG_CMD_FLASH is not set CONFIG_CMD_GPIO=y -CONFIG_CMD_PCI=y CONFIG_CMD_SF=y CONFIG_CMD_SPI=y CONFIG_CMD_USB=y diff --git a/configs/chromebook_link_defconfig b/configs/chromebook_link_defconfig index 7fcddba50c8..aaabb22251b 100644 --- a/configs/chromebook_link_defconfig +++ b/configs/chromebook_link_defconfig @@ -19,7 +19,6 @@ CONFIG_CMD_CPU=y # CONFIG_CMD_FLASH is not set CONFIG_CMD_GPIO=y CONFIG_CMD_PART=y -CONFIG_CMD_PCI=y CONFIG_CMD_SF=y CONFIG_CMD_SPI=y CONFIG_CMD_USB=y diff --git a/configs/chromebook_samus_defconfig b/configs/chromebook_samus_defconfig index 2c294bd8e12..8df2c4c5c1f 100644 --- a/configs/chromebook_samus_defconfig +++ b/configs/chromebook_samus_defconfig @@ -19,7 +19,6 @@ CONFIG_CMD_CPU=y # CONFIG_CMD_FLASH is not set CONFIG_CMD_GPIO=y CONFIG_CMD_PART=y -CONFIG_CMD_PCI=y CONFIG_CMD_SF=y CONFIG_CMD_SPI=y CONFIG_CMD_USB=y diff --git a/configs/chromebox_panther_defconfig b/configs/chromebox_panther_defconfig index a81a9cce82f..2eb30bda6f1 100644 --- a/configs/chromebox_panther_defconfig +++ b/configs/chromebox_panther_defconfig @@ -15,7 +15,6 @@ CONFIG_HUSH_PARSER=y # CONFIG_CMD_FLASH is not set CONFIG_CMD_GPIO=y CONFIG_CMD_PART=y -CONFIG_CMD_PCI=y CONFIG_CMD_SF=y CONFIG_CMD_SPI=y CONFIG_CMD_USB=y diff --git a/configs/conga-qeval20-qa3-e3845-internal-uart_defconfig b/configs/conga-qeval20-qa3-e3845-internal-uart_defconfig index 89ba0b6b9c0..9575c538ca5 100644 --- a/configs/conga-qeval20-qa3-e3845-internal-uart_defconfig +++ b/configs/conga-qeval20-qa3-e3845-internal-uart_defconfig @@ -25,7 +25,6 @@ CONFIG_CMD_GPIO=y CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y CONFIG_CMD_PART=y -CONFIG_CMD_PCI=y CONFIG_CMD_SF=y CONFIG_CMD_SPI=y CONFIG_CMD_USB=y diff --git a/configs/conga-qeval20-qa3-e3845_defconfig b/configs/conga-qeval20-qa3-e3845_defconfig index 0edacb81bed..b12be650d88 100644 --- a/configs/conga-qeval20-qa3-e3845_defconfig +++ b/configs/conga-qeval20-qa3-e3845_defconfig @@ -25,7 +25,6 @@ CONFIG_CMD_GPIO=y CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y CONFIG_CMD_PART=y -CONFIG_CMD_PCI=y CONFIG_CMD_SF=y CONFIG_CMD_SPI=y CONFIG_CMD_USB=y diff --git a/configs/coreboot-x86_defconfig b/configs/coreboot-x86_defconfig index badfbfbbbbe..9f3bc3f874a 100644 --- a/configs/coreboot-x86_defconfig +++ b/configs/coreboot-x86_defconfig @@ -12,7 +12,6 @@ CONFIG_HUSH_PARSER=y # CONFIG_CMD_FLASH is not set CONFIG_CMD_IDE=y CONFIG_CMD_PART=y -CONFIG_CMD_PCI=y CONFIG_CMD_SF=y CONFIG_CMD_SPI=y CONFIG_CMD_USB=y diff --git a/configs/cougarcanyon2_defconfig b/configs/cougarcanyon2_defconfig index f7eca76bfe6..2d8ebaeb212 100644 --- a/configs/cougarcanyon2_defconfig +++ b/configs/cougarcanyon2_defconfig @@ -11,7 +11,6 @@ CONFIG_HUSH_PARSER=y # CONFIG_CMD_FLASH is not set CONFIG_CMD_GPIO=y CONFIG_CMD_PART=y -CONFIG_CMD_PCI=y CONFIG_CMD_SF=y CONFIG_CMD_SPI=y CONFIG_CMD_USB=y diff --git a/configs/crownbay_defconfig b/configs/crownbay_defconfig index 93f96b03be6..a46dd666963 100644 --- a/configs/crownbay_defconfig +++ b/configs/crownbay_defconfig @@ -18,7 +18,6 @@ CONFIG_CMD_CPU=y CONFIG_CMD_GPIO=y CONFIG_CMD_MMC=y CONFIG_CMD_PART=y -CONFIG_CMD_PCI=y CONFIG_CMD_SF=y CONFIG_CMD_SPI=y CONFIG_CMD_USB=y diff --git a/configs/dfi-bt700-q7x-151_defconfig b/configs/dfi-bt700-q7x-151_defconfig index 6dcc2fe7c61..2aaac6e9052 100644 --- a/configs/dfi-bt700-q7x-151_defconfig +++ b/configs/dfi-bt700-q7x-151_defconfig @@ -23,7 +23,6 @@ CONFIG_CMD_CPU=y CONFIG_CMD_GPIO=y CONFIG_CMD_MMC=y CONFIG_CMD_PART=y -CONFIG_CMD_PCI=y CONFIG_CMD_SF=y CONFIG_CMD_SPI=y CONFIG_CMD_USB=y diff --git a/configs/edison_defconfig b/configs/edison_defconfig index 0aa7a45a915..d099c0b0dcd 100644 --- a/configs/edison_defconfig +++ b/configs/edison_defconfig @@ -16,6 +16,7 @@ CONFIG_CMD_DFU=y CONFIG_CMD_GPT=y CONFIG_CMD_MMC=y CONFIG_CMD_PART=y +# CONFIG_CMD_PCI is not set # CONFIG_CMD_NFS is not set CONFIG_CMD_TIMER=y CONFIG_CMD_HASH=y diff --git a/configs/efi-x86_defconfig b/configs/efi-x86_defconfig index 218b838dd5e..f397bfd0d95 100644 --- a/configs/efi-x86_defconfig +++ b/configs/efi-x86_defconfig @@ -13,7 +13,6 @@ CONFIG_HUSH_PARSER=y # CONFIG_CMD_IMLS is not set CONFIG_CMD_GPIO=y CONFIG_CMD_PART=y -CONFIG_CMD_PCI=y CONFIG_CMD_SF=y # CONFIG_CMD_SF_TEST is not set CONFIG_CMD_SPI=y diff --git a/configs/galileo_defconfig b/configs/galileo_defconfig index 6ad7f1bcb98..514e3c5220b 100644 --- a/configs/galileo_defconfig +++ b/configs/galileo_defconfig @@ -18,7 +18,6 @@ CONFIG_CMD_CPU=y CONFIG_CMD_GPIO=y CONFIG_CMD_MMC=y CONFIG_CMD_PART=y -CONFIG_CMD_PCI=y CONFIG_CMD_SF=y CONFIG_CMD_SPI=y CONFIG_CMD_USB=y diff --git a/configs/minnowmax_defconfig b/configs/minnowmax_defconfig index ad97ad07b33..7b237abfca6 100644 --- a/configs/minnowmax_defconfig +++ b/configs/minnowmax_defconfig @@ -25,7 +25,6 @@ CONFIG_CMD_CPU=y CONFIG_CMD_GPIO=y CONFIG_CMD_MMC=y CONFIG_CMD_PART=y -CONFIG_CMD_PCI=y CONFIG_CMD_SF=y CONFIG_CMD_SPI=y CONFIG_CMD_USB=y diff --git a/configs/qemu-x86_64_defconfig b/configs/qemu-x86_64_defconfig index 3f7bbe42f43..67e9a45fbcc 100644 --- a/configs/qemu-x86_64_defconfig +++ b/configs/qemu-x86_64_defconfig @@ -34,7 +34,6 @@ CONFIG_CMD_CPU=y # CONFIG_CMD_IMLS is not set # CONFIG_CMD_FLASH is not set CONFIG_CMD_IDE=y -CONFIG_CMD_PCI=y CONFIG_CMD_SF=y CONFIG_CMD_SPI=y CONFIG_CMD_USB=y diff --git a/configs/qemu-x86_defconfig b/configs/qemu-x86_defconfig index aba7f1ebb73..7ce97ff0913 100644 --- a/configs/qemu-x86_defconfig +++ b/configs/qemu-x86_defconfig @@ -17,7 +17,6 @@ CONFIG_CMD_CPU=y # CONFIG_CMD_FLASH is not set CONFIG_CMD_IDE=y CONFIG_CMD_PART=y -CONFIG_CMD_PCI=y CONFIG_CMD_SF=y CONFIG_CMD_SPI=y CONFIG_CMD_USB=y diff --git a/configs/qemu-x86_efi_payload32_defconfig b/configs/qemu-x86_efi_payload32_defconfig index 5c0f129b4af..11a4a9e8323 100644 --- a/configs/qemu-x86_efi_payload32_defconfig +++ b/configs/qemu-x86_efi_payload32_defconfig @@ -14,7 +14,6 @@ CONFIG_CMD_CPU=y # CONFIG_CMD_FLASH is not set CONFIG_CMD_IDE=y CONFIG_CMD_PART=y -CONFIG_CMD_PCI=y CONFIG_CMD_SF=y CONFIG_CMD_SPI=y CONFIG_CMD_USB=y diff --git a/configs/qemu-x86_efi_payload64_defconfig b/configs/qemu-x86_efi_payload64_defconfig index 8a2e2433a83..d123de20110 100644 --- a/configs/qemu-x86_efi_payload64_defconfig +++ b/configs/qemu-x86_efi_payload64_defconfig @@ -15,7 +15,6 @@ CONFIG_CMD_CPU=y # CONFIG_CMD_FLASH is not set CONFIG_CMD_IDE=y CONFIG_CMD_PART=y -CONFIG_CMD_PCI=y CONFIG_CMD_SF=y CONFIG_CMD_SPI=y CONFIG_CMD_USB=y diff --git a/configs/som-db5800-som-6867_defconfig b/configs/som-db5800-som-6867_defconfig index fdb83e1f309..4489ddf5fb2 100644 --- a/configs/som-db5800-som-6867_defconfig +++ b/configs/som-db5800-som-6867_defconfig @@ -22,7 +22,6 @@ CONFIG_CMD_CPU=y # CONFIG_CMD_FLASH is not set CONFIG_CMD_GPIO=y CONFIG_CMD_PART=y -CONFIG_CMD_PCI=y CONFIG_CMD_SF=y CONFIG_CMD_SPI=y CONFIG_CMD_USB=y diff --git a/configs/theadorable-x86-dfi-bt700_defconfig b/configs/theadorable-x86-dfi-bt700_defconfig index 8ccb957047b..45cd74d7b8a 100644 --- a/configs/theadorable-x86-dfi-bt700_defconfig +++ b/configs/theadorable-x86-dfi-bt700_defconfig @@ -22,7 +22,6 @@ CONFIG_CMD_CPU=y CONFIG_CMD_GPIO=y CONFIG_CMD_MMC=y CONFIG_CMD_PART=y -CONFIG_CMD_PCI=y CONFIG_CMD_SF=y CONFIG_CMD_SPI=y CONFIG_CMD_USB=y -- cgit v1.3.1 From 2ddb1a177ada3b9edd327fe7e74e4891e462a6f0 Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Thu, 17 Aug 2017 01:10:42 -0700 Subject: x86: Convert CPU_INTEL_TURBO_NOT_PACKAGE_SCOPED to Kconfig This converts CPU_INTEL_TURBO_NOT_PACKAGE_SCOPED to a Kconfig option. Signed-off-by: Bin Meng --- arch/x86/Kconfig | 7 +++++++ arch/x86/cpu/turbo.c | 2 +- scripts/config_whitelist.txt | 1 - 3 files changed, 8 insertions(+), 2 deletions(-) (limited to 'arch') diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 53730829571..277c3babf37 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -529,6 +529,13 @@ config AP_STACK_SIZE the memory used by this initialisation process. Typically 4KB is enough space. +config CPU_INTEL_TURBO_NOT_PACKAGE_SCOPED + bool + help + This option indicates that the turbo mode setting is not package + scoped. i.e. turbo_enable() needs to be called on not just the + bootstrap processor (BSP). + config HAVE_VGA_BIOS bool "Add a VGA BIOS image" help diff --git a/arch/x86/cpu/turbo.c b/arch/x86/cpu/turbo.c index bbd255efc0a..c0bff75c4f1 100644 --- a/arch/x86/cpu/turbo.c +++ b/arch/x86/cpu/turbo.c @@ -14,7 +14,7 @@ DECLARE_GLOBAL_DATA_PTR; -#if CONFIG_CPU_INTEL_TURBO_NOT_PACKAGE_SCOPED +#ifdef CONFIG_CPU_INTEL_TURBO_NOT_PACKAGE_SCOPED static inline int get_global_turbo_state(void) { return TURBO_UNKNOWN; diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 0a751e4a91c..d8710958a39 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -338,7 +338,6 @@ CONFIG_CPU_HAS_PREFETCH CONFIG_CPU_HAS_SMARTMIPS CONFIG_CPU_HAS_SR_RB CONFIG_CPU_HAS_WB -CONFIG_CPU_INTEL_TURBO_NOT_PACKAGE_SCOPED CONFIG_CPU_LITTLE_ENDIAN CONFIG_CPU_MICROMIPS CONFIG_CPU_MIPSR2 -- cgit v1.3.1 From 81c727d86c959e1f5f2d234d21aa59e98b9ed835 Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Thu, 17 Aug 2017 01:10:43 -0700 Subject: x86: baytrail: Fix turbo enable CPU_INTEL_TURBO_NOT_PACKAGE_SCOPED must be turned on for Baytrail. Signed-off-by: Bin Meng --- arch/x86/cpu/baytrail/Kconfig | 1 + 1 file changed, 1 insertion(+) (limited to 'arch') diff --git a/arch/x86/cpu/baytrail/Kconfig b/arch/x86/cpu/baytrail/Kconfig index 75dbbc27f12..1d876b19275 100644 --- a/arch/x86/cpu/baytrail/Kconfig +++ b/arch/x86/cpu/baytrail/Kconfig @@ -8,6 +8,7 @@ config INTEL_BAYTRAIL bool select HAVE_FSP if !EFI select ARCH_MISC_INIT if !EFI + select CPU_INTEL_TURBO_NOT_PACKAGE_SCOPED imply HAVE_INTEL_ME if !EFI imply ENABLE_MRC_CACHE imply AHCI_PCI -- cgit v1.3.1 From 438505fe696b176cbf56cd34db870e04027d3531 Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Sun, 20 Aug 2017 04:33:46 -0700 Subject: x86: tangier: kconfig: Guard tangier-specific options These options should not be exposed to other platforms. Signed-off-by: Bin Meng Acked-by: Andy Shevchenko --- arch/x86/cpu/tangier/Kconfig | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'arch') diff --git a/arch/x86/cpu/tangier/Kconfig b/arch/x86/cpu/tangier/Kconfig index 86a334047c0..2469b1e7c7a 100644 --- a/arch/x86/cpu/tangier/Kconfig +++ b/arch/x86/cpu/tangier/Kconfig @@ -16,6 +16,8 @@ config INTEL_TANGIER imply USB imply USB_DWC3 +if INTEL_TANGIER + config SYS_CAR_ADDR hex default 0x19200000 @@ -30,3 +32,5 @@ config SYS_CAR_SIZE config SYS_USB_OTG_BASE hex default 0xf9100000 + +endif -- cgit v1.3.1