Skip to contentSkip to conversation

x86: Remove x86 specific GD flags as they are not referenced at all

PATCH New Stefan Roese 4 participants 9 messages Aug 16, 2019 – Aug 18, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 x86: Remove x86 specific GD flags as they are not referenced at all

This patch removes the x86 architecture specific GD flags (GD_FLG_COLD_BOOT & GD_FLG_WARM_BOOT), as they are not used. Only GD_FLG_COLD_BOOT is referenced in coreboot.c but assigned in start16.S. But the coreboot target does not use start16.S at all and boots directly from the 32-bit start code.

Cc Bin Meng <[email protected]>
Cc Simon Glass <[email protected]>
Cc Tom Rini <[email protected]>
Cc Simon Goldschmidt <[email protected]>
---
 arch/x86/cpu/coreboot/coreboot.c   | 3 ---
 arch/x86/cpu/start.S               | 9 +--------
 arch/x86/cpu/start16.S             | 3 ---
 arch/x86/include/asm/global_data.h | 6 ------
 4 files changed, 1 insertion(+), 20 deletions(-)
arch/x86/cpu/coreboot/coreboot.c +0 -3
index 4c6ed0bfb2..9686f8ed5b 100644
@@ -73,9 +73,6 @@ static void board_final_cleanup(void)
 
 int last_stage_init(void)
 {
-	if (gd->flags & GD_FLG_COLD_BOOT)
-		timestamp_add_to_bootstage();
-
 	/* start usb so that usb keyboard can be used as input device */
 	if (CONFIG_IS_ENABLED(USB_KEYBOARD))
 		usb_init();
arch/x86/cpu/start.S +1 -8
index 71cd70f9cd..3c9bdf2a9d 100644
@@ -40,9 +40,6 @@ _x86boot_start:
 	movl	%eax, %cr0
 	wbinvd
 
-	/* Tell 32-bit code it is being entered from an in-RAM copy */
-	movl	$GD_FLG_WARM_BOOT, %ebx
-
 	/*
 	 * Zero the BIST (Built-In Self Test) value since we don't have it.
 	 * It must be 0 or the previous loader would have reported an error.
@@ -55,11 +52,7 @@ _x86boot_start:
 	.align	4
 	.long	0x12345678
 _start:
-	/*
-	 * This is the 32-bit cold-reset entry point, coming from start16.
-	 * Set %ebx to GD_FLG_COLD_BOOT to indicate this.
-	 */
-	movl	$GD_FLG_COLD_BOOT, %ebx
+	/* This is the 32-bit cold-reset entry point, coming from start16 */
 
 	/* Save BIST */
 	movl	%eax, %ebp
arch/x86/cpu/start16.S +0 -3
index dd659278ff..474efe4df5 100644
@@ -23,9 +23,6 @@ start16:
 	/* Save BIST */
 	movl	%eax, %ecx
 
-	/* Set the Cold Boot / Hard Reset flag */
-	movl	$GD_FLG_COLD_BOOT, %ebx
-
 	xorl	%eax, %eax
 	movl	%eax, %cr3	/* Invalidate TLB */
 
arch/x86/include/asm/global_data.h +0 -6
index 797397e697..17a4d34491 100644
@@ -137,10 +137,4 @@ static inline __attribute__((no_instrument_function)) gd_t *get_fs_gd_ptr(void)
 
 #endif
 
-/*
- * Our private Global Data Flags
- */
-#define GD_FLG_COLD_BOOT	0x10000	/* Cold Boot */
-#define GD_FLG_WARM_BOOT	0x20000	/* Warm Boot */
-
 #endif /* __ASM_GBL_DATA_H */
Signature · 1 line
2.22.1
#1 lore raw

PATCH 2/2 global_data: Remove comment of reserved arch-specific GD flags

With the removal of the x86 specific GD flags, there are no arch- specific GD flags any more. Let's remove the comment about reserving the upper 16 bits for arch-specific flags in the common header. This gives us more flexibility with the usage of the GD flags.

As a matter of fact, we are already using more than 16 bits for common GD flags (with the addition of GD_FLG_WDT_READY).

Cc Bin Meng <[email protected]>
Cc Simon Glass <[email protected]>
Cc Tom Rini <[email protected]>
Cc Simon Goldschmidt <[email protected]>
---
 include/asm-generic/global_data.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/asm-generic/global_data.h +1 -1
index 5372d5d8cd..7587ba2ee5 100644
@@ -150,7 +150,7 @@ typedef struct global_data {
 #endif
 
 /*
- * Global Data Flags - the top 16 bits are reserved for arch-specific flags
+ * Global Data Flags
  */
 #define GD_FLG_RELOC		0x00001	/* Code was relocated to RAM	   */
 #define GD_FLG_DEVINIT		0x00002	/* Devices have been initialized   */
Signature · 1 line
2.22.1
#2 lore raw

PATCH 2/2 global_data: Remove comment of reserved arch-specific GD flags

Quoted 9 lines · Stefan Roese

With the removal of the x86 specific GD flags, there are no arch- specific GD flags any more. Let's remove the comment about reserving the upper 16 bits for arch-specific flags in the common header. This gives us more flexibility with the usage of the GD flags.

As a matter of fact, we are already using more than 16 bits for common GD flags (with the addition of GD_FLG_WDT_READY).

Quoted 9 lines
Cc Bin Meng <[email protected]>
Cc Simon Glass <[email protected]>
Cc Tom Rini <[email protected]>
Cc Simon Goldschmidt <[email protected]>
---
 include/asm-generic/global_data.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
#3 lore raw

PATCH 2/2 global_data: Remove comment of reserved arch-specific GD flags

In reply to Stefan Roese

Stefan Roese <[email protected]> schrieb am Fr., 16. Aug. 2019, 14:45:

Quoted 5 lines

With the removal of the x86 specific GD flags, there are no arch- specific GD flags any more. Let's remove the comment about reserving the upper 16 bits for arch-specific flags in the common header. This gives us more flexibility with the usage of the GD flags.

Quoted 9 lines

As a matter of fact, we are already using more than 16 bits for common GD flags (with the addition of GD_FLG_WDT_READY).

Cc Bin Meng <[email protected]>
Cc Simon Glass <[email protected]>
Cc Tom Rini <[email protected]>
Cc Simon Goldschmidt <[email protected]>

---

Quoted 24 lines
 include/asm-generic/global_data.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/asm-generic/global_data.h +0 -1
index 5372d5d8cd..7587ba2ee5 100644
@@ -150,7 +150,7 @@ typedef struct global_data {
 #endif
 
 /*
- * Global Data Flags - the top 16 bits are reserved for arch-specific

flags
+ * Global Data Flags
*/
#define GD_FLG_RELOC 0x00001 /* Code was relocated to RAM
*/
#define GD_FLG_DEVINIT 0x00002 /* Devices have been initialized
*/
--
2.22.1

#4 lore raw

PATCH 2/2 global_data: Remove comment of reserved arch-specific GD flags

Quoted 13 lines · Simon Goldschmidt

Stefan Roese <[email protected]> schrieb am Fr., 16. Aug. 2019, 14:45:

Quoted 9 lines

With the removal of the x86 specific GD flags, there are no arch- specific GD flags any more. Let's remove the comment about reserving the upper 16 bits for arch-specific flags in the common header. This gives us more flexibility with the usage of the GD flags.

As a matter of fact, we are already using more than 16 bits for common GD flags (with the addition of GD_FLG_WDT_READY).

Quoted 8 lines
Quoted 5 lines
Cc Bin Meng <[email protected]>
Cc Simon Glass <[email protected]>
Cc Tom Rini <[email protected]>
Cc Simon Goldschmidt <[email protected]>
#5 lore raw

PATCH 2/2 global_data: Remove comment of reserved arch-specific GD flags

Quoted 23 lines · Simon Glass
Quoted 20 lines · Simon Goldschmidt

Stefan Roese <[email protected]> schrieb am Fr., 16. Aug. 2019, 14:45:

Quoted 14 lines

With the removal of the x86 specific GD flags, there are no arch- specific GD flags any more. Let's remove the comment about reserving the upper 16 bits for arch-specific flags in the common header. This gives us more flexibility with the usage of the GD flags.

As a matter of fact, we are already using more than 16 bits for common GD flags (with the addition of GD_FLG_WDT_READY).

Cc Bin Meng <[email protected]>
Cc Simon Glass <[email protected]>
Cc Tom Rini <[email protected]>
Cc Simon Goldschmidt <[email protected]>
Quoted 3 lines
Quoted 1 line

applied to u-boot-x86, thanks!

#6 lore raw

PATCH 1/2 x86: Remove x86 specific GD flags as they are not referenced at all

In reply to Stefan Roese
Quoted 12 lines · Stefan Roese

This patch removes the x86 architecture specific GD flags (GD_FLG_COLD_BOOT & GD_FLG_WARM_BOOT), as they are not used. Only GD_FLG_COLD_BOOT is referenced in coreboot.c but assigned in start16.S. But the coreboot target does not use start16.S at all and boots directly from the 32-bit start code.

Cc Bin Meng <[email protected]>
Cc Simon Glass <[email protected]>
Cc Tom Rini <[email protected]>
Cc Simon Goldschmidt <[email protected]>
Quoted 7 lines
---
 arch/x86/cpu/coreboot/coreboot.c   | 3 ---
 arch/x86/cpu/start.S               | 9 +--------
 arch/x86/cpu/start16.S             | 3 ---
 arch/x86/include/asm/global_data.h | 6 ------
 4 files changed, 1 insertion(+), 20 deletions(-)

Tested with U-Boot as coreboot payload, and on Intel MinnowMax

#7 lore raw

PATCH 1/2 x86: Remove x86 specific GD flags as they are not referenced at all

In reply to Stefan Roese

Stefan Roese <[email protected]> schrieb am Fr., 16. Aug. 2019, 14:45:

Quoted 6 lines

This patch removes the x86 architecture specific GD flags (GD_FLG_COLD_BOOT & GD_FLG_WARM_BOOT), as they are not used. Only GD_FLG_COLD_BOOT is referenced in coreboot.c but assigned in start16.S. But the coreboot target does not use start16.S at all and boots directly from the 32-bit start code.

Quoted 6 lines
Cc Bin Meng <[email protected]>
Cc Simon Glass <[email protected]>
Cc Tom Rini <[email protected]>
Cc Simon Goldschmidt <[email protected]>

---

Quoted 85 lines
 arch/x86/cpu/coreboot/coreboot.c   | 3 ---
 arch/x86/cpu/start.S               | 9 +--------
 arch/x86/cpu/start16.S             | 3 ---
 arch/x86/include/asm/global_data.h | 6 ------
 4 files changed, 1 insertion(+), 20 deletions(-)
arch/x86/cpu/coreboot/coreboot.c +0 -3
index 4c6ed0bfb2..9686f8ed5b 100644
@@ -73,9 +73,6 @@ static void board_final_cleanup(void)
 
 int last_stage_init(void)
 {
-       if (gd->flags & GD_FLG_COLD_BOOT)
-               timestamp_add_to_bootstage();
-
        /* start usb so that usb keyboard can be used as input device */
        if (CONFIG_IS_ENABLED(USB_KEYBOARD))
                usb_init();
arch/x86/cpu/start.S +0 -3
index 71cd70f9cd..3c9bdf2a9d 100644
@@ -40,9 +40,6 @@ _x86boot_start:
        movl    %eax, %cr0
        wbinvd
 
-       /* Tell 32-bit code it is being entered from an in-RAM copy */
-       movl    $GD_FLG_WARM_BOOT, %ebx
-
        /*
         * Zero the BIST (Built-In Self Test) value since we don't have it.
         * It must be 0 or the previous loader would have reported an

error.

arch/x86/cpu/start.S +1 -5
@@ -55,11 +52,7 @@ _x86boot_start:
        .align  4
        .long   0x12345678
 _start:
-       /*
-        * This is the 32-bit cold-reset entry point, coming from start16.
-        * Set %ebx to GD_FLG_COLD_BOOT to indicate this.
-        */
-       movl    $GD_FLG_COLD_BOOT, %ebx
+       /* This is the 32-bit cold-reset entry point, coming from start16
 */
 
        /* Save BIST */

movl %eax, %ebp

arch/x86/cpu/start16.S +0 -3
index dd659278ff..474efe4df5 100644
@@ -23,9 +23,6 @@ start16:
        /* Save BIST */
        movl    %eax, %ecx
 
-       /* Set the Cold Boot / Hard Reset flag */
-       movl    $GD_FLG_COLD_BOOT, %ebx
-
        xorl    %eax, %eax
        movl    %eax, %cr3      /* Invalidate TLB */
 
arch/x86/include/asm/global_data.h +0 -6
index 797397e697..17a4d34491 100644
@@ -137,10 +137,4 @@ static inline __attribute__((no_instrument_function))
 gd_t *get_fs_gd_ptr(void)
 
 #endif
 
-/*
- * Our private Global Data Flags
- */
-#define GD_FLG_COLD_BOOT       0x10000 /* Cold Boot */
-#define GD_FLG_WARM_BOOT       0x20000 /* Warm Boot */
-

#endif /* __ASM_GBL_DATA_H */
--
2.22.1

#8 lore raw

PATCH 1/2 x86: Remove x86 specific GD flags as they are not referenced at all

Quoted 11 lines · Simon Goldschmidt

Stefan Roese <[email protected]> schrieb am Fr., 16. Aug. 2019, 14:45:

Quoted 7 lines

This patch removes the x86 architecture specific GD flags (GD_FLG_COLD_BOOT & GD_FLG_WARM_BOOT), as they are not used. Only GD_FLG_COLD_BOOT is referenced in coreboot.c but assigned in start16.S. But the coreboot target does not use start16.S at all and boots directly from the 32-bit start code.

Quoted 8 lines
Quoted 5 lines
Cc Bin Meng <[email protected]>
Cc Simon Glass <[email protected]>
Cc Tom Rini <[email protected]>
Cc Simon Goldschmidt <[email protected]>

applied to u-boot-x86, thanks!