All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [PATCH v6 052/102] x86: Add support for newer CAR schemes
Date: Fri,  6 Dec 2019 21:42:25 -0700	[thread overview]
Message-ID: <20191206213936.v6.52.Ibeea8fe70533e9257b72be6f9f7347beb745a9aa@changeid> (raw)
In-Reply-To: <20191207044315.51770-1-sjg@chromium.org>

Newer Intel SoCs have different ways of setting up cache-as-ram (CAR).
Add support for these along with suitable configuration options.

To make the code cleaner, adjust a few definitions in processor.h so that
they can be used from assembler.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
---

Changes in v6: None
Changes in v5: None
Changes in v4:
- Adjust
- Fix up license header
- Fix various code-style problems
- Use CONFIG_INTEL_CAR_CQOS to control car2.S inclusion
- Use car_init_ret to return
- Use post_code() calls consistent with car.S

Changes in v3:
- Drop dead code
- Drop unneeded Kconfig file
- Use a macro for is-power-of-two

Changes in v2: None

 arch/x86/Kconfig                        |  16 +
 arch/x86/cpu/intel_common/Makefile      |   8 +
 arch/x86/cpu/intel_common/car2.S        | 448 ++++++++++++++++++++++++
 arch/x86/cpu/intel_common/car2_uninit.S |  87 +++++
 arch/x86/include/asm/processor.h        |  12 +-
 5 files changed, 564 insertions(+), 7 deletions(-)
 create mode 100644 arch/x86/cpu/intel_common/car2.S
 create mode 100644 arch/x86/cpu/intel_common/car2_uninit.S

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index bcce1114ce..44f7f0ab03 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -879,4 +879,20 @@ config HIGH_TABLE_SIZE
 	  Increse it if the default size does not fit the board's needs.
 	  This is most likely due to a large ACPI DSDT table is used.
 
+config INTEL_CAR_CQOS
+	bool "Support Intel Cache Quality of Service"
+	help
+	  Cache Quality of Service allows more fine-grained control of cache
+	  usage. As result, it is possible to set up a portion of L2 cache for
+	  CAR and use the remainder for actual caching.
+
+#
+# Each bit in QOS mask controls this many bytes. This is calculated as:
+# (CACHE_WAYS / CACHE_BITS_PER_MASK) * CACHE_LINE_SIZE * CACHE_SETS
+#
+config CACHE_QOS_SIZE_PER_BIT
+	hex
+	depends on INTEL_CAR_CQOS
+	default 0x20000 # 128 KB
+
 endmenu
diff --git a/arch/x86/cpu/intel_common/Makefile b/arch/x86/cpu/intel_common/Makefile
index dfbc29f047..09212cee04 100644
--- a/arch/x86/cpu/intel_common/Makefile
+++ b/arch/x86/cpu/intel_common/Makefile
@@ -8,6 +8,14 @@ obj-$(CONFIG_$(SPL_TPL_)X86_32BIT_INIT) += me_status.o
 obj-$(CONFIG_$(SPL_TPL_)X86_32BIT_INIT) += report_platform.o
 obj-$(CONFIG_$(SPL_TPL_)X86_32BIT_INIT) += mrc.o
 endif
+
+ifdef CONFIG_INTEL_CAR_CQOS
+obj-$(CONFIG_TPL_BUILD) += car2.o
+ifndef CONFIG_SPL_BUILD
+obj-y += car2_uninit.o
+endif
+endif
+
 obj-y += cpu.o
 obj-y += fast_spi.o
 obj-y += lpc.o
diff --git a/arch/x86/cpu/intel_common/car2.S b/arch/x86/cpu/intel_common/car2.S
new file mode 100644
index 0000000000..086f987477
--- /dev/null
+++ b/arch/x86/cpu/intel_common/car2.S
@@ -0,0 +1,448 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * This file was modified from the coreboot version.
+ *
+ * Copyright (C) 2015-2016 Intel Corp.
+ */
+
+#include <config.h>
+#include <asm/msr-index.h>
+#include <asm/mtrr.h>
+#include <asm/post.h>
+#include <asm/processor.h>
+#include <asm/processor-flags.h>
+
+#define KiB 1024
+
+#define IS_POWER_OF_2(x)	(!((x) & ((x) - 1)))
+
+.global car_init
+car_init:
+	post_code(POST_CAR_START)
+
+	/*
+	 * Use the MTRR default type MSR as a proxy for detecting INIT#.
+	 * Reset the system if any known bits are set in that MSR. That is
+	 * an indication of the CPU not being properly reset.
+	 */
+check_for_clean_reset:
+	mov	$MTRR_DEF_TYPE_MSR, %ecx
+	rdmsr
+	and	$(MTRR_DEF_TYPE_EN | MTRR_DEF_TYPE_FIX_EN), %eax
+	cmp	$0, %eax
+	jz	no_reset
+	/* perform warm reset */
+	movw	$IO_PORT_RESET, %dx
+	movb	$(SYS_RST | RST_CPU), %al
+	outb	%al, %dx
+
+no_reset:
+	post_code(POST_CAR_SIPI)
+
+	/* Clear/disable fixed MTRRs */
+	mov	$fixed_mtrr_list_size, %ebx
+	xor	%eax, %eax
+	xor	%edx, %edx
+
+clear_fixed_mtrr:
+	add	$-2, %ebx
+	movzwl	fixed_mtrr_list(%ebx), %ecx
+	wrmsr
+	jnz	clear_fixed_mtrr
+
+	post_code(POST_CAR_MTRR)
+
+	/* Figure put how many MTRRs we have, and clear them out */
+	mov	$MTRR_CAP_MSR, %ecx
+	rdmsr
+	movzb	%al, %ebx		/* Number of variable MTRRs */
+	mov	$MTRR_PHYS_BASE_MSR(0), %ecx
+	xor	%eax, %eax
+	xor	%edx, %edx
+
+clear_var_mtrr:
+	wrmsr
+	inc	%ecx
+	wrmsr
+	inc	%ecx
+	dec	%ebx
+	jnz	clear_var_mtrr
+
+	post_code(POST_CAR_UNCACHEABLE)
+
+	/* Configure default memory type to uncacheable (UC) */
+	mov	$MTRR_DEF_TYPE_MSR, %ecx
+	rdmsr
+	/* Clear enable bits and set default type to UC */
+	and	$~(MTRR_DEF_TYPE_MASK | MTRR_DEF_TYPE_EN | \
+		 MTRR_DEF_TYPE_FIX_EN), %eax
+	wrmsr
+
+	/*
+	 * Configure MTRR_PHYS_MASK_HIGH for proper addressing above 4GB
+	 * based on the physical address size supported for this processor
+	 * This is based on read from CPUID EAX = 080000008h, EAX bits [7:0]
+	 *
+	 * Examples:
+	 *  MTRR_PHYS_MASK_HIGH = 00000000Fh  For 36 bit addressing
+	 *  MTRR_PHYS_MASK_HIGH = 0000000FFh  For 40 bit addressing
+	 */
+
+	movl	$0x80000008, %eax 	/* Address sizes leaf */
+	cpuid
+	sub	$32, %al
+	movzx	%al, %eax
+	xorl	%esi, %esi
+	bts	%eax, %esi
+	dec	%esi			/* esi <- MTRR_PHYS_MASK_HIGH */
+
+	post_code(POST_CAR_BASE_ADDRESS)
+
+#if IS_POWER_OF_2(CONFIG_DCACHE_RAM_SIZE)
+	/* Configure CAR region as write-back (WB) */
+	mov	$MTRR_PHYS_BASE_MSR(0), %ecx
+	mov	$CONFIG_DCACHE_RAM_BASE, %eax
+	or	$MTRR_TYPE_WRBACK, %eax
+	xor	%edx,%edx
+	wrmsr
+
+	/* Configure the MTRR mask for the size region */
+	mov	$MTRR_PHYS_MASK(0), %ecx
+	mov	$CONFIG_DCACHE_RAM_SIZE, %eax	/* size mask */
+	dec	%eax
+	not	%eax
+	or	$MTRR_PHYS_MASK_VALID, %eax
+	movl	%esi, %edx	/* edx <- MTRR_PHYS_MASK_HIGH */
+	wrmsr
+#elif (CONFIG_DCACHE_RAM_SIZE == 768 * KiB) /* 768 KiB */
+	/* Configure CAR region as write-back (WB) */
+	mov	$MTRR_PHYS_BASE_MSR(0), %ecx
+	mov	$CONFIG_DCACHE_RAM_BASE, %eax
+	or	$MTRR_TYPE_WRBACK, %eax
+	xor	%edx,%edx
+	wrmsr
+
+	mov	$MTRR_PHYS_MASK_MSR(0), %ecx
+	mov	$(512 * KiB), %eax	/* size mask */
+	dec	%eax
+	not	%eax
+	or	$MTRR_PHYS_MASK_VALID, %eax
+	movl	%esi, %edx	/* edx <- MTRR_PHYS_MASK_HIGH */
+	wrmsr
+
+	mov	$MTRR_PHYS_BASE_MSR(1), %ecx
+	mov	$(CONFIG_DCACHE_RAM_BASE + 512 * KiB), %eax
+	or	$MTRR_TYPE_WRBACK, %eax
+	xor	%edx,%edx
+	wrmsr
+
+	mov	$MTRR_PHYS_MASK_MSR(1), %ecx
+	mov	$(256 * KiB), %eax	/* size mask */
+	dec	%eax
+	not	%eax
+	or	$MTRR_PHYS_MASK_VALID, %eax
+	movl	%esi, %edx	/* edx <- MTRR_PHYS_MASK_HIGH */
+	wrmsr
+#else
+#error "DCACHE_RAM_SIZE is not a power of 2 and setup code is missing"
+#endif
+	post_code(POST_CAR_FILL)
+
+	/* Enable variable MTRRs */
+	mov	$MTRR_DEF_TYPE_MSR, %ecx
+	rdmsr
+	or	$MTRR_DEF_TYPE_EN, %eax
+	wrmsr
+
+	/* Enable caching */
+	mov	%cr0, %eax
+	and	$~(X86_CR0_CD | X86_CR0_NW), %eax
+	invd
+	mov	%eax, %cr0
+
+#if IS_ENABLED(CONFIG_INTEL_CAR_NEM)
+	jmp	car_nem
+#elif IS_ENABLED(CONFIG_INTEL_CAR_CQOS)
+	jmp	car_cqos
+#elif IS_ENABLED(CONFIG_INTEL_CAR_NEM_ENHANCED)
+	jmp	car_nem_enhanced
+#else
+#error "No CAR mechanism selected:
+#endif
+	jmp	car_init_ret
+
+fixed_mtrr_list:
+	.word	MTRR_FIX_64K_00000_MSR
+	.word	MTRR_FIX_16K_80000_MSR
+	.word	MTRR_FIX_16K_A0000_MSR
+	.word	MTRR_FIX_4K_C0000_MSR
+	.word	MTRR_FIX_4K_C8000_MSR
+	.word	MTRR_FIX_4K_D0000_MSR
+	.word	MTRR_FIX_4K_D8000_MSR
+	.word	MTRR_FIX_4K_E0000_MSR
+	.word	MTRR_FIX_4K_E8000_MSR
+	.word	MTRR_FIX_4K_F0000_MSR
+	.word	MTRR_FIX_4K_F8000_MSR
+fixed_mtrr_list_size = . - fixed_mtrr_list
+
+#if IS_ENABLED(CONFIG_INTEL_CAR_NEM)
+.global car_nem
+car_nem:
+	/* Disable cache eviction (setup stage) */
+	mov	$MSR_EVICT_CTL, %ecx
+	rdmsr
+	or	$0x1, %eax
+	wrmsr
+
+	post_code(0x26)
+
+	/* Clear the cache memory region. This will also fill up the cache */
+	movl	$CONFIG_DCACHE_RAM_BASE, %edi
+	movl	$CONFIG_DCACHE_RAM_SIZE, %ecx
+	shr	$0x02, %ecx
+	xor	%eax, %eax
+	cld
+	rep	stosl
+
+	post_code(0x27)
+
+	/* Disable cache eviction (run stage) */
+	mov	$MSR_EVICT_CTL, %ecx
+	rdmsr
+	or	$0x2, %eax
+	wrmsr
+
+	post_code(0x28)
+
+	jmp	car_init_ret
+
+#elif IS_ENABLED(CONFIG_INTEL_CAR_CQOS)
+.global car_cqos
+car_cqos:
+	/*
+	 * Create CBM_LEN_MASK based on CBM_LEN
+	 * Get CPUID.(EAX=10H, ECX=2H):EAX.CBM_LEN[bits 4:0]
+	 */
+	mov	$0x10, %eax
+	mov	$0x2,  %ecx
+	cpuid
+	and	$0x1f, %eax
+	add	$1, %al
+
+	mov	$1, %ebx
+	mov	%al, %cl
+	shl	%cl, %ebx
+	sub	$1, %ebx
+
+	/* Store the CBM_LEN_MASK in mm3 for later use */
+	movd	%ebx, %mm3
+
+	/*
+	 * Disable both L1 and L2 prefetcher. For yet-to-understood reason,
+	 * prefetchers slow down filling cache with rep stos in CQOS mode.
+	 */
+	mov	$MSR_PREFETCH_CTL, %ecx
+	rdmsr
+	or	$(PREFETCH_L1_DISABLE | PREFETCH_L2_DISABLE), %eax
+	wrmsr
+
+#if (CONFIG_DCACHE_RAM_SIZE == CONFIG_L2_CACHE_SIZE)
+/*
+ * If CAR size is set to full L2 size, mask is calculated as all-zeros.
+ * This is not supported by the CPU/uCode.
+ */
+#error "CQOS CAR may not use whole L2 cache area"
+#endif
+
+	/* Calculate how many bits to be used for CAR */
+	xor	%edx, %edx
+	mov	$CONFIG_DCACHE_RAM_SIZE, %eax	/* dividend */
+	mov	$CONFIG_CACHE_QOS_SIZE_PER_BIT, %ecx	/* divisor */
+	div	%ecx		/* result is in eax */
+	mov	%eax, %ecx	/* save to ecx */
+	mov	$1, %ebx
+	shl	%cl, %ebx
+	sub	$1, %ebx	/* resulting mask is is in ebx */
+
+	/* Set this mask for initial cache fill */
+	mov	$MSR_L2_QOS_MASK(0), %ecx
+	rdmsr
+	mov	%ebx, %eax
+	wrmsr
+
+	/* Set CLOS selector to 0 */
+	mov	$MSR_IA32_PQR_ASSOC, %ecx
+	rdmsr
+	and	$~MSR_IA32_PQR_ASSOC_MASK, %edx	/* select mask 0 */
+	wrmsr
+
+	/* We will need to block CAR region from evicts */
+	mov	$MSR_L2_QOS_MASK(1), %ecx
+	rdmsr
+	/* Invert bits that are to be used for cache */
+	mov	%ebx, %eax
+	xor	$~0, %eax			/* invert 32 bits */
+
+	/*
+	 * Use CBM_LEN_MASK stored in mm3 to set bits based on Capacity Bit
+	 * Mask Length.
+	 */
+	movd	%mm3, %ebx
+	and	%ebx, %eax
+	wrmsr
+
+	post_code(0x26)
+
+	/* Clear the cache memory region. This will also fill up the cache */
+	movl	$CONFIG_DCACHE_RAM_BASE, %edi
+	movl	$CONFIG_DCACHE_RAM_SIZE, %ecx
+	shr	$0x02, %ecx
+	xor	%eax, %eax
+	cld
+	rep	stosl
+
+	post_code(0x27)
+
+	/* Cache is populated. Use mask 1 that will block evicts */
+	mov	$MSR_IA32_PQR_ASSOC, %ecx
+	rdmsr
+	and	$~MSR_IA32_PQR_ASSOC_MASK, %edx	/* clear index bits first */
+	or	$1, %edx			/* select mask 1 */
+	wrmsr
+
+	/* Enable prefetchers */
+	mov	$MSR_PREFETCH_CTL, %ecx
+	rdmsr
+	and	$~(PREFETCH_L1_DISABLE | PREFETCH_L2_DISABLE), %eax
+	wrmsr
+
+	post_code(0x28)
+
+	jmp	car_init_ret
+
+#elif IS_ENABLED(CONFIG_INTEL_CAR_NEM_ENHANCED)
+.global car_nem_enhanced
+car_nem_enhanced:
+	/* Disable cache eviction (setup stage) */
+	mov	$MSR_EVICT_CTL, %ecx
+	rdmsr
+	or	$0x1, %eax
+	wrmsr
+	post_code(0x26)
+
+	/* Create n-way set associativity of cache */
+	xorl	%edi, %edi
+find_llc_subleaf:
+	movl	%edi, %ecx
+	movl	$0x04, %eax
+	cpuid
+	inc	%edi
+	and	$0xe0, %al	/* EAX[7:5] = Cache Level */
+	cmp	$0x60, %al	/* Check to see if it is LLC */
+	jnz	find_llc_subleaf
+
+	/*
+	 * Set MSR 0xC91 IA32_L3_MASK_! = 0xE/0xFE/0xFFE/0xFFFE
+	 * for 4/8/16 way of LLC
+	*/
+	shr	$22, %ebx
+	inc	%ebx
+	/* Calculate n-way associativity of LLC */
+	mov	%bl, %cl
+
+	/*
+	 * Maximizing RO cacheability while locking in the CAR to a
+	 * single way since that particular way won't be victim candidate
+	 * for evictions.
+	 * This has been done after programing LLC_WAY_MASK_1 MSR
+	 * with desired LLC way as mentioned below.
+	 *
+	 * Hence create Code and Data Size as per request
+	 * Code Size (RO) : Up to 16M
+	 * Data Size (RW) : Up to 256K
+	 */
+	movl	$0x01, %eax
+	/*
+	 * LLC Ways -> LLC_WAY_MASK_1:
+	 *  4: 0x000E
+	 *  8: 0x00FE
+	 * 12: 0x0FFE
+	 * 16: 0xFFFE
+	 *
+	 * These MSRs contain one bit per each way of LLC
+	 * - If this bit is '0' - the way is protected from eviction
+	 * - If this bit is '1' - the way is not protected from eviction
+	 */
+	shl	%cl, %eax
+	subl	$0x02, %eax
+	movl	$MSR_IA32_L3_MASK_1, %ecx
+	xorl	%edx, %edx
+	wrmsr
+	/*
+	 * Set MSR 0xC92 IA32_L3_MASK_2 = 0x1
+	 *
+	 * For SKL SOC, data size remains 256K consistently.
+	 * Hence, creating 1-way associative cache for Data
+	*/
+	mov	$MSR_IA32_L3_MASK_2, %ecx
+	mov	$0x01, %eax
+	xorl	%edx, %edx
+	wrmsr
+	/*
+	 * Set MSR_IA32_PQR_ASSOC = 0x02
+	 *
+	 * Possible values:
+	 * 0: Default value, no way mask should be applied
+	 * 1: Apply way mask 1 to LLC
+	 * 2: Apply way mask 2 to LLC
+	 * 3: Shouldn't be use in NEM Mode
+	 */
+	movl	$MSR_IA32_PQR_ASSOC, %ecx
+	movl	$0x02, %eax
+	xorl	%edx, %edx
+	wrmsr
+
+	movl	$CONFIG_DCACHE_RAM_BASE, %edi
+	movl	$CONFIG_DCACHE_RAM_SIZE, %ecx
+	shr	$0x02, %ecx
+	xor	%eax, %eax
+	cld
+	rep	stosl
+	/*
+	 * Set MSR_IA32_PQR_ASSOC = 0x01
+	 * At this stage we apply LLC_WAY_MASK_1 to the cache.
+	 * i.e. way 0 is protected from eviction.
+	*/
+	movl	$MSR_IA32_PQR_ASSOC, %ecx
+	movl	$0x01, %eax
+	xorl	%edx, %edx
+	wrmsr
+
+	post_code(0x27)
+	/*
+	 * Enable No-Eviction Mode Run State by setting
+	 * NO_EVICT_MODE MSR 2E0h bit [1] = '1'.
+	 */
+
+	movl	$MSR_EVICT_CTL, %ecx
+	rdmsr
+	orl	$0x02, %eax
+	wrmsr
+
+	post_code(0x28)
+
+	jmp	car_init_ret
+#endif
+
+#if CONFIG_IS_ENABLED(X86_16BIT_INIT)
+_dt_ucode_base_size:
+	/* These next two fields are filled in by binman */
+.globl ucode_base
+ucode_base:	/* Declared in microcode.h */
+	.long	0			/* microcode base */
+.globl ucode_size
+ucode_size:	/* Declared in microcode.h */
+	.long	0			/* microcode size */
+	.long	CONFIG_SYS_MONITOR_BASE	/* code region base */
+	.long	CONFIG_SYS_MONITOR_LEN	/* code region size */
+#endif
diff --git a/arch/x86/cpu/intel_common/car2_uninit.S b/arch/x86/cpu/intel_common/car2_uninit.S
new file mode 100644
index 0000000000..aba3a5381e
--- /dev/null
+++ b/arch/x86/cpu/intel_common/car2_uninit.S
@@ -0,0 +1,87 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright 2017 Intel Corp.
+ * Copyright 2019 Google LLC
+ * Taken from coreboot file exit_car.S
+ */
+
+#include <config.h>
+#include <asm/msr-index.h>
+#include <asm/mtrr.h>
+
+.text
+.global car_uninit
+car_uninit:
+
+	/*
+	 * Retrieve return address from stack as it will get trashed below if
+	 * execution is utilizing the cache-as-ram stack.
+	 */
+	pop	%ebx
+
+	/* Disable MTRRs */
+	mov	$(MTRR_DEF_TYPE_MSR), %ecx
+	rdmsr
+	and	$(~(MTRR_DEF_TYPE_EN | MTRR_DEF_TYPE_FIX_EN)), %eax
+	wrmsr
+
+#ifdef CONFIG_INTEL_CAR_NEM
+.global car_nem_teardown
+car_nem_teardown:
+
+	/* invalidate cache contents */
+	invd
+
+	/* Knock down bit 1 then bit 0 of NEM control not combining steps */
+	mov	$(MSR_EVICT_CTL), %ecx
+	rdmsr
+	and	$(~(1 << 1)), %eax
+	wrmsr
+	and	$(~(1 << 0)), %eax
+	wrmsr
+
+#elif IS_ENABLED(CONFIG_INTEL_CAR_CQOS)
+.global car_cqos_teardown
+car_cqos_teardown:
+
+	/* Go back to all-evicting mode, set both masks to all-1s */
+	mov	$MSR_L2_QOS_MASK(0), %ecx
+	rdmsr
+	mov	$~0, %al
+	wrmsr
+
+	mov	$MSR_L2_QOS_MASK(1), %ecx
+	rdmsr
+	mov	$~0, %al
+	wrmsr
+
+	/* Reset CLOS selector to 0 */
+	mov	$MSR_IA32_PQR_ASSOC, %ecx
+	rdmsr
+	and	$~MSR_IA32_PQR_ASSOC_MASK, %edx
+	wrmsr
+
+#elif IS_ENABLED(CONFIG_INTEL_CAR_NEM_ENHANCED)
+.global car_nem_enhanced_teardown
+car_nem_enhanced_teardown:
+
+	/* invalidate cache contents */
+	invd
+
+	/* Knock down bit 1 then bit 0 of NEM control not combining steps */
+	mov	$(MSR_EVICT_CTL), %ecx
+	rdmsr
+	and	$(~(1 << 1)), %eax
+	wrmsr
+	and	$(~(1 << 0)), %eax
+	wrmsr
+
+	/* Reset CLOS selector to 0 */
+	mov	$IA32_PQR_ASSOC, %ecx
+	rdmsr
+	and	$~IA32_PQR_ASSOC_MASK, %edx
+	wrmsr
+#endif
+
+	/* Return to caller */
+	jmp	*%ebx
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index f1d9977bcb..d7b6836786 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -25,8 +25,6 @@
 /* Length of the public header on Intel microcode blobs */
 #define UCODE_HEADER_LEN	0x30
 
-#ifndef __ASSEMBLY__
-
 /*
  * This register is documented in (for example) the Intel Atom Processor E3800
  * Product Family Datasheet in "PCU - Power Management Controller (PMC)".
@@ -37,11 +35,11 @@
  */
 #define IO_PORT_RESET		0xcf9
 
-enum {
-	SYS_RST		= 1 << 1,	/* 0 for soft reset, 1 for hard reset */
-	RST_CPU		= 1 << 2,	/* initiate reset */
-	FULL_RST	= 1 << 3,	/* full power cycle */
-};
+#define SYS_RST		(1 << 1)	/* 0 for soft reset, 1 for hard reset */
+#define RST_CPU		(1 << 2)	/* initiate reset */
+#define FULL_RST	(1 << 3)	/* full power cycle */
+
+#ifndef __ASSEMBLY__
 
 static inline __attribute__((always_inline)) void cpu_hlt(void)
 {
-- 
2.24.0.393.g34dc348eaf-goog

  parent reply	other threads:[~2019-12-07  4:42 UTC|newest]

Thread overview: 235+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-07  4:41 [PATCH v6 000/102] x86: Add initial support for apollolake Simon Glass
2019-12-07  4:41 ` [PATCH v6 001/102] binman: Add a library to access binman entries Simon Glass
2019-12-08  1:08   ` Bin Meng
2020-01-07 17:32     ` Stephen Warren
2020-01-07 17:57       ` Stephen Warren
2020-01-08  2:14         ` Simon Glass
2020-01-22 15:49   ` [BUG] " Frank Wunderlich
2020-01-24 18:15     ` Frank Wunderlich
2020-02-11 23:03       ` Simon Glass
2020-02-12 11:50         ` Frank Wunderlich
2020-02-12 17:14           ` Simon Glass
2020-02-12 18:02             ` Frank Wunderlich
2020-02-13 17:40               ` Simon Glass
2020-02-13 17:51                 ` Aw: " Frank Wunderlich
2020-02-17  3:55                   ` Simon Glass
2020-02-17  7:04                     ` Frank Wunderlich
2019-12-07  4:41 ` [PATCH v6 002/102] dm: gpio: Allow control of GPIO uclass in SPL Simon Glass
2019-12-08  1:08   ` Bin Meng
2019-12-07  4:41 ` [PATCH v6 003/102] dm: core: Fix offset_to_ofnode() with invalid offset Simon Glass
2019-12-08  1:08   ` Bin Meng
2019-12-07  4:41 ` [PATCH v6 004/102] dm: pci: Allow delaying auto-config until after relocation Simon Glass
2019-12-08  1:08   ` Bin Meng
2019-12-07  4:41 ` [PATCH v6 005/102] dm: pci: Move pci_get_devfn() into a common file Simon Glass
2019-12-08  1:08   ` Bin Meng
2019-12-07  4:41 ` [PATCH v6 006/102] net: Move the checksum functions to lib/ Simon Glass
2019-12-08  1:10   ` Bin Meng
2019-12-08  1:12     ` Bin Meng
2019-12-07  4:41 ` [PATCH v6 007/102] i2c: designware: Tidy up PCI support Simon Glass
2019-12-08  1:52   ` Bin Meng
2019-12-08  1:59     ` Bin Meng
2019-12-07  4:41 ` [PATCH v6 008/102] i2c: designware: Avoid using static data Simon Glass
2019-12-08  1:54   ` Bin Meng
2019-12-08  1:59     ` Bin Meng
2019-12-07  4:41 ` [PATCH v6 009/102] i2c: designware: Support use in SPL Simon Glass
2019-12-08  1:59   ` Bin Meng
2019-12-07  4:41 ` [PATCH v6 010/102] x86: spi: Add helper functions for Intel Fast SPI Simon Glass
2019-12-08  1:59   ` Bin Meng
2019-12-07  4:41 ` [PATCH v6 011/102] fdt: Show the preprocessed .dts file on error Simon Glass
2019-12-08  2:02   ` Bin Meng
2019-12-07  4:41 ` [PATCH v6 012/102] dm: pinctrl: Allow enabling full pinctrl in SPL/TPL Simon Glass
2019-12-08  2:04   ` Bin Meng
2019-12-08  2:08     ` Bin Meng
2019-12-07  4:41 ` [PATCH v6 013/102] board_r: Move early-timer init later Simon Glass
2019-12-08  2:06   ` Bin Meng
2019-12-08  2:08     ` Bin Meng
2019-12-07  4:41 ` [PATCH v6 014/102] RFC: sandbox: net: Suppress the MAC-address warnings Simon Glass
2019-12-07  4:41 ` [PATCH v6 015/102] Revert "RFC: sandbox: net: Suppress the MAC-address warnings" Simon Glass
2019-12-07  4:41 ` [PATCH v6 016/102] x86: timer: use a timer base of 0 Simon Glass
2019-12-08  2:41   ` Bin Meng
2019-12-07  4:41 ` [PATCH v6 017/102] x86: timer: Reduce timer code size in TPL on Intel CPUs Simon Glass
2019-12-08  2:41   ` Bin Meng
2019-12-07  4:41 ` [PATCH v6 018/102] x86: Drop unnecessary cpu code for TPL Simon Glass
2019-12-08  2:42   ` Bin Meng
2019-12-07  4:41 ` [PATCH v6 019/102] x86: Drop unnecessary interrupt " Simon Glass
2019-12-08  2:42   ` Bin Meng
2019-12-07  4:41 ` [PATCH v6 020/102] x86: power: Add an ACPI PMC uclass Simon Glass
2019-12-08  2:42   ` Bin Meng
2019-12-07  4:41 ` [PATCH v6 021/102] x86: sandbox: Add a PMC emulator and test Simon Glass
2019-12-08  2:53   ` Bin Meng
2019-12-07  4:41 ` [PATCH v6 022/102] pci: Add support for p2sb uclass Simon Glass
2019-12-08  2:53   ` Bin Meng
2019-12-07  4:41 ` [PATCH v6 023/102] sandbox: Disable mmio by default in tests Simon Glass
2019-12-08  2:53   ` Bin Meng
2019-12-07  4:41 ` [PATCH v6 024/102] sandbox: Add PCI driver and test for p2sb Simon Glass
2019-12-08  2:53   ` Bin Meng
2019-12-07  4:41 ` [PATCH v6 025/102] x86: Move UCLASS_IRQ into a separate file Simon Glass
2019-12-08  2:53   ` Bin Meng
2019-12-07  4:41 ` [PATCH v6 026/102] sandbox: Add a test for IRQ Simon Glass
2019-12-08  2:53   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 027/102] x86: Define the SPL image start Simon Glass
2019-12-08  2:53   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 028/102] x86: Reduce mrccache record alignment size Simon Glass
2019-12-08  2:53   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 029/102] x86: Correct mrccache find_next_mrc_cache() calculation Simon Glass
2019-12-08  2:53   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 030/102] x86: Adjust mrccache_get_region() to use livetree Simon Glass
2019-12-08  2:53   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 031/102] x86: Adjust mrccache_get_region() to support get_mmap() Simon Glass
2019-12-08  3:02   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 032/102] x86: Add a new global_data member for the cache record Simon Glass
2019-12-08  3:02   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 033/102] x86: Tidy up error handling in mrccache_save() Simon Glass
2019-12-08  3:02   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 034/102] x86: Update mrccache to support multiple caches Simon Glass
2019-12-08  3:02   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 035/102] x86: Add mrccache support for a 'variable' cache Simon Glass
2019-12-08  3:02   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 036/102] x86: Don't export mrccache_update() Simon Glass
2019-12-08  3:02   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 037/102] x86: Move fsp_prepare_mrc_cache() to fsp1 directory Simon Glass
2019-12-08  3:02   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 038/102] x86: Set the DRAM banks to reflect real location Simon Glass
2019-12-08  3:02   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 039/102] x86: Set up the MTRR for SDRAM Simon Glass
2019-12-08  3:02   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 040/102] x86: Don't imply libfdt or SPI flash in TPL Simon Glass
2019-12-08  3:02   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 041/102] x86: Allow removal of standard PCH drivers Simon Glass
2019-12-08  3:20   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 042/102] x86: Allow interrupt to happen once Simon Glass
2019-12-08  3:20   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 043/102] x86: fsp: Make graphics support common to FSP1/2 Simon Glass
2019-12-08  3:20   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 044/102] x86: fsp: Correct wrong header inlude in fsp_support.c Simon Glass
2019-12-08  3:20   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 045/102] x86: fsp: Add FSP2 base support Simon Glass
2019-12-08  3:11   ` Bin Meng
2019-12-08  3:20     ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 046/102] x86: fsp: Set up an MTRR for the graphics frame buffer Simon Glass
2019-12-08  3:20   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 047/102] x86: fsp: Add a new arch_fsp_init_r() hook Simon Glass
2019-12-08  3:20   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 048/102] x86: fsp: Allow remembering the location of FSP-S Simon Glass
2019-12-08  3:20   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 049/102] x86: fsp: Make the notify API call common Simon Glass
2019-12-08  3:20   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 050/102] x86: Don't include the BIOS emulator in TPL Simon Glass
2019-12-08  3:30   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 051/102] x86: Add an option to include a FIT Simon Glass
2019-12-08  3:30   ` Bin Meng
2019-12-07  4:42 ` Simon Glass [this message]
2019-12-08  3:30   ` [PATCH v6 052/102] x86: Add support for newer CAR schemes Bin Meng
2019-12-07  4:42 ` [PATCH v6 053/102] x86: Disable microcode section for FSP2 Simon Glass
2019-12-08  3:31   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 054/102] x86: Update the fsp command " Simon Glass
2019-12-08  3:31   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 055/102] x86: Update .dtsi file " Simon Glass
2019-12-08  3:31   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 056/102] x86: Add an option to control the position of U-Boot Simon Glass
2019-12-08  3:31   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 057/102] x86: Add an option to control the position of SPL Simon Glass
2019-12-08  3:31   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 058/102] x86: Add an fdtmap and image-header Simon Glass
2019-12-08  3:31   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 059/102] x86: Don't repeat microcode in U-Boot if not needed Simon Glass
2019-12-08  3:31   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 060/102] x86: Separate out U-Boot and device tree in ROM image Simon Glass
2019-12-08  3:35   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 061/102] x86: Make MSR_PKG_POWER_SKU common Simon Glass
2019-12-08  3:36   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 062/102] spi: Correct operations check in dm_spi_xfer() Simon Glass
2019-12-08  3:36   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 063/102] x86: spi: Don't enable SPI_FLASH_BAR by default Simon Glass
2019-12-08  3:37   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 064/102] spi: ich: Move init function just above probe() Simon Glass
2019-12-08  3:37   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 065/102] spi: ich: Move the protection/lockdown code into a function Simon Glass
2019-12-08  3:38   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 066/102] spi: ich: Convert to livetree Simon Glass
2019-12-08  3:38   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 067/102] spi: ich: Fix header order Simon Glass
2019-12-08  3:39   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 068/102] spi: ich: Various small tidy-ups Simon Glass
2019-12-08  3:39   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 069/102] spi: ich: Add mmio_base to struct ich_spi_platdata Simon Glass
2019-12-08  3:40   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 070/102] dm: doc: Add a note about of-platdata and header files Simon Glass
2019-12-08  3:43   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 071/102] spi: ich: Correct max-size bug in ich_spi_adjust_size() Simon Glass
2019-12-08  3:56   ` Bin Meng
2019-12-08  4:24     ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 072/102] spi: ich: Support of-platdata for fast-spi Simon Glass
2019-12-08  4:24   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 073/102] spi: ich: Support hardware sequencing Simon Glass
2019-12-08  4:25   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 074/102] spi: ich: Add support for get_mmap() method Simon Glass
2019-12-08  4:26   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 075/102] spi: ich: Add TPL support Simon Glass
2019-12-08  3:58   ` Bin Meng
2019-12-08  4:26     ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 076/102] spi: ich: Add Apollo Lake support Simon Glass
2019-12-08  4:27   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 077/102] mtd: spi: Export spi_flash_std_probe() Simon Glass
2019-12-08  4:28   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 078/102] x86: Enable pinctrl in SPL and TPL Simon Glass
2019-12-08  3:58   ` Bin Meng
2019-12-08  4:28     ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 079/102] x86: Add low-power subsystem (lpss) support Simon Glass
2019-12-08  3:59   ` Bin Meng
2019-12-08  4:29     ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 080/102] x86: Add a generic Intel pinctrl driver Simon Glass
2019-12-08  7:59   ` Bin Meng
2019-12-08  8:19     ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 081/102] x86: Add a generic Intel GPIO driver Simon Glass
2019-12-08  8:01   ` Bin Meng
2019-12-08  8:19     ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 082/102] x86: Move qemu CPU fixup function into its own file Simon Glass
2019-12-08  8:03   ` Bin Meng
2019-12-08  8:19     ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 083/102] x86: apl: Add basic IO addresses Simon Glass
2019-12-08  8:20   ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 084/102] x86: apl: Add PMC driver Simon Glass
2019-12-08  8:04   ` Bin Meng
2019-12-08  8:21     ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 085/102] x86: apl: Add UART driver Simon Glass
2019-12-08  8:07   ` Bin Meng
2019-12-08  8:21     ` Bin Meng
2019-12-07  4:42 ` [PATCH v6 086/102] x86: apl: Add pinctrl driver Simon Glass
2019-12-08  8:10   ` Bin Meng
2019-12-07  4:43 ` [PATCH v6 087/102] i2c: designware: Add Apollo Lake support Simon Glass
2019-12-07  4:43 ` [PATCH v6 088/102] x86: apl: Add systemagent driver Simon Glass
2019-12-08  8:13   ` Bin Meng
2019-12-07  4:43 ` [PATCH v6 089/102] x86: apl: Add hostbridge driver Simon Glass
2019-12-08  8:14   ` Bin Meng
2019-12-07  4:43 ` [PATCH v6 090/102] x86: apl: Add ITSS driver Simon Glass
2019-12-07  4:43 ` [PATCH v6 091/102] x86: apl: Add LPC driver Simon Glass
2019-12-08  8:24   ` Bin Meng
2019-12-07  4:43 ` [PATCH v6 092/102] x86: apl: Add PCH driver Simon Glass
2019-12-07  4:43 ` [PATCH v6 093/102] x86: apl: Add PUNIT driver Simon Glass
2019-12-08  8:26   ` Bin Meng
2019-12-07  4:43 ` [PATCH v6 094/102] spl: Add methods to find the position/size of next phase Simon Glass
2019-12-08  8:27   ` Bin Meng
2019-12-07  4:43 ` [PATCH v6 095/102] x86: apl: Add SPL loaders Simon Glass
2019-12-08  8:31   ` Bin Meng
2019-12-07  4:43 ` [PATCH v6 096/102] x86: apl: Add a CPU driver Simon Glass
2019-12-08  8:33   ` Bin Meng
2019-12-07  4:43 ` [PATCH v6 097/102] x86: apl: Add SPL/TPL init Simon Glass
2019-12-08  8:36   ` Bin Meng
2019-12-07  4:43 ` [PATCH v6 098/102] x86: apl: Add P2SB driver Simon Glass
2019-12-08  8:39   ` Bin Meng
2019-12-09  0:32     ` Simon Glass
2019-12-07  4:43 ` [PATCH v6 099/102] x86: apl: Add Kconfig and Makefile Simon Glass
2019-12-08  8:41   ` Bin Meng
2019-12-07  4:43 ` [PATCH v6 100/102] x86: apl: Add FSP structures Simon Glass
2019-12-08  8:42   ` Bin Meng
2019-12-07  4:43 ` [PATCH v6 101/102] x86: apl: Add FSP support Simon Glass
2019-12-08  8:45   ` Bin Meng
2019-12-07  4:43 ` [PATCH v6 102/102] x86: Add chromebook_coral Simon Glass
2019-12-08  8:48   ` Bin Meng
2019-12-08  8:56 ` [PATCH v6 000/102] x86: Add initial support for apollolake Bin Meng
2019-12-08 13:23   ` Tom Rini
2019-12-08 23:54     ` Simon Glass
2019-12-09  0:45       ` Tom Rini
2019-12-13  8:49 ` [PATCH v6 081/102] x86: Add a generic Intel GPIO driver Wolfgang Wallner
2020-01-30  2:16   ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191206213936.v6.52.Ibeea8fe70533e9257b72be6f9f7347beb745a9aa@changeid \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.