From 02e66ae01ae7bb9ae0dbab2903a2080f575151e1 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Wed, 20 Nov 2024 15:44:35 +0000 Subject: U-Boot x86: Avoid clearing the VESA display This is a patch from Simon Glass. U-Boot clears the display when it starts up, but was asking the VESA driver to do the same, needlessly; this patch avoids the latter. A further patch is also included, which provides a better message when jumping into long mode on the SPL (64-bit) target, dumping it on the serial console instead of using printf. Signed-off-by: Leah Rowe --- .../0002-x86-Avoid-clearing-the-VESA-display.patch | 34 ++++++++++++++++++++++ .../0003-x86-Avoid-clearing-the-VESA-display.patch | 29 ++++++++++++++++++ .../0002-x86-Avoid-clearing-the-VESA-display.patch | 34 ++++++++++++++++++++++ .../0003-x86-Avoid-clearing-the-VESA-display.patch | 29 ++++++++++++++++++ 4 files changed, 126 insertions(+) create mode 100644 config/u-boot/x86/patches/0002-x86-Avoid-clearing-the-VESA-display.patch create mode 100644 config/u-boot/x86/patches/0003-x86-Avoid-clearing-the-VESA-display.patch create mode 100644 config/u-boot/x86_64/patches/0002-x86-Avoid-clearing-the-VESA-display.patch create mode 100644 config/u-boot/x86_64/patches/0003-x86-Avoid-clearing-the-VESA-display.patch (limited to 'config') diff --git a/config/u-boot/x86/patches/0002-x86-Avoid-clearing-the-VESA-display.patch b/config/u-boot/x86/patches/0002-x86-Avoid-clearing-the-VESA-display.patch new file mode 100644 index 00000000..7fb75772 --- /dev/null +++ b/config/u-boot/x86/patches/0002-x86-Avoid-clearing-the-VESA-display.patch @@ -0,0 +1,34 @@ +From a6b9e69a21970951252419b5b5fa9c04fabbf1a4 Mon Sep 17 00:00:00 2001 +From: Simon Glass +Date: Tue, 12 Nov 2024 06:59:02 -0700 +Subject: [PATCH 1/2] x86: Avoid clearing the VESA display + +U-Boot clears the display when it starts up, so there is no need to ask +the VESA driver to do this. Fix this and add a comment explaining the +flags. + +Signed-off-by: Simon Glass +--- + arch/x86/lib/bios.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/arch/x86/lib/bios.c b/arch/x86/lib/bios.c +index 03f7360032..374f4f20b8 100644 +--- a/arch/x86/lib/bios.c ++++ b/arch/x86/lib/bios.c +@@ -228,7 +228,11 @@ static void vbe_set_graphics(int vesa_mode, struct vesa_state *mode_info) + { + unsigned char *framebuffer; + +- mode_info->video_mode = (1 << 14) | vesa_mode; ++ /* ++ * bit 14 is linear-framebuffer mode ++ * bit 15 means don't clear the display ++ */ ++ mode_info->video_mode = (1 << 14) | (1 << 15) | vesa_mode; + vbe_get_mode_info(mode_info); + + framebuffer = (unsigned char *)(ulong)mode_info->vesa.phys_base_ptr; +-- +2.39.5 + diff --git a/config/u-boot/x86/patches/0003-x86-Avoid-clearing-the-VESA-display.patch b/config/u-boot/x86/patches/0003-x86-Avoid-clearing-the-VESA-display.patch new file mode 100644 index 00000000..bb33d6fd --- /dev/null +++ b/config/u-boot/x86/patches/0003-x86-Avoid-clearing-the-VESA-display.patch @@ -0,0 +1,29 @@ +From d098961a91c8f410f50ae31e60300c0ef1f67075 Mon Sep 17 00:00:00 2001 +From: Simon Glass +Date: Tue, 12 Nov 2024 06:59:06 -0700 +Subject: [PATCH 2/2] x86: Drop the message about features missing in 64-bit + +This functions normally and has done for a while, so drop this scary +message. + +Signed-off-by: Simon Glass +--- + arch/x86/lib/spl.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/x86/lib/spl.c b/arch/x86/lib/spl.c +index f761fbc8bc..656f59ede0 100644 +--- a/arch/x86/lib/spl.c ++++ b/arch/x86/lib/spl.c +@@ -283,7 +283,7 @@ void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image) + { + int ret; + +- printf("Jumping to 64-bit U-Boot: Note many features are missing\n"); ++ log_debug("Jumping to 64-bit U-Boot\n"); + ret = cpu_jump_to_64bit_uboot(spl_image->entry_point); + debug("ret=%d\n", ret); + hang(); +-- +2.39.5 + diff --git a/config/u-boot/x86_64/patches/0002-x86-Avoid-clearing-the-VESA-display.patch b/config/u-boot/x86_64/patches/0002-x86-Avoid-clearing-the-VESA-display.patch new file mode 100644 index 00000000..7fb75772 --- /dev/null +++ b/config/u-boot/x86_64/patches/0002-x86-Avoid-clearing-the-VESA-display.patch @@ -0,0 +1,34 @@ +From a6b9e69a21970951252419b5b5fa9c04fabbf1a4 Mon Sep 17 00:00:00 2001 +From: Simon Glass +Date: Tue, 12 Nov 2024 06:59:02 -0700 +Subject: [PATCH 1/2] x86: Avoid clearing the VESA display + +U-Boot clears the display when it starts up, so there is no need to ask +the VESA driver to do this. Fix this and add a comment explaining the +flags. + +Signed-off-by: Simon Glass +--- + arch/x86/lib/bios.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/arch/x86/lib/bios.c b/arch/x86/lib/bios.c +index 03f7360032..374f4f20b8 100644 +--- a/arch/x86/lib/bios.c ++++ b/arch/x86/lib/bios.c +@@ -228,7 +228,11 @@ static void vbe_set_graphics(int vesa_mode, struct vesa_state *mode_info) + { + unsigned char *framebuffer; + +- mode_info->video_mode = (1 << 14) | vesa_mode; ++ /* ++ * bit 14 is linear-framebuffer mode ++ * bit 15 means don't clear the display ++ */ ++ mode_info->video_mode = (1 << 14) | (1 << 15) | vesa_mode; + vbe_get_mode_info(mode_info); + + framebuffer = (unsigned char *)(ulong)mode_info->vesa.phys_base_ptr; +-- +2.39.5 + diff --git a/config/u-boot/x86_64/patches/0003-x86-Avoid-clearing-the-VESA-display.patch b/config/u-boot/x86_64/patches/0003-x86-Avoid-clearing-the-VESA-display.patch new file mode 100644 index 00000000..bb33d6fd --- /dev/null +++ b/config/u-boot/x86_64/patches/0003-x86-Avoid-clearing-the-VESA-display.patch @@ -0,0 +1,29 @@ +From d098961a91c8f410f50ae31e60300c0ef1f67075 Mon Sep 17 00:00:00 2001 +From: Simon Glass +Date: Tue, 12 Nov 2024 06:59:06 -0700 +Subject: [PATCH 2/2] x86: Drop the message about features missing in 64-bit + +This functions normally and has done for a while, so drop this scary +message. + +Signed-off-by: Simon Glass +--- + arch/x86/lib/spl.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/x86/lib/spl.c b/arch/x86/lib/spl.c +index f761fbc8bc..656f59ede0 100644 +--- a/arch/x86/lib/spl.c ++++ b/arch/x86/lib/spl.c +@@ -283,7 +283,7 @@ void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image) + { + int ret; + +- printf("Jumping to 64-bit U-Boot: Note many features are missing\n"); ++ log_debug("Jumping to 64-bit U-Boot\n"); + ret = cpu_jump_to_64bit_uboot(spl_image->entry_point); + debug("ret=%d\n", ret); + hang(); +-- +2.39.5 + -- cgit v1.2.1