Skip to contentSkip to conversation

x86: Remove unused real mode code

PATCH New Simon Glass 2 participants 4 messages Feb 15, 2013 x86

lore
Share & tools
lore
#0 lore raw

PATCH v3 5/5 x86: Remove unused real mode code

This code is pretty old and we want to support only 32-bit systems now.

---
Changes in v3:
- Punt the real mode flag altogether

Changes in v2:
- Keep the real mode-to-protected code

 README                          |   5 -
 arch/x86/include/asm/realmode.h |  36 ---
 arch/x86/lib/Makefile           |  10 -
 arch/x86/lib/bios.S             | 569 ----------------------------------------
 arch/x86/lib/bios.h             |   3 -
 arch/x86/lib/bios_pci.S         | 447 -------------------------------
 arch/x86/lib/bios_setup.c       | 179 -------------
 arch/x86/lib/realmode.c         |  93 -------
 arch/x86/lib/realmode_switch.S  | 232 ----------------
 arch/x86/lib/video.c            |   6 -
 arch/x86/lib/video_bios.c       | 196 --------------
 arch/x86/lib/zimage.c           |  23 --
 12 files changed, 1799 deletions(-)
 delete mode 100644 arch/x86/include/asm/realmode.h
 delete mode 100644 arch/x86/lib/bios.S
 delete mode 100644 arch/x86/lib/bios_pci.S
 delete mode 100644 arch/x86/lib/bios_setup.c
 delete mode 100644 arch/x86/lib/realmode.c
 delete mode 100644 arch/x86/lib/realmode_switch.S
 delete mode 100644 arch/x86/lib/video_bios.c
README +0 -5
index 6106e0d..d8cb394 100644
@@ -3820,11 +3820,6 @@ Low Level (hardware related) configuration options:
 		If defined, the x86 reset vector code is included. This is not
 		needed when U-Boot is running from Coreboot.
 
-- CONFIG_X86_NO_REAL_MODE
-		If defined, x86 real mode code is omitted. This assumes a
-		32-bit environment where such code is not needed. You will
-		need to do this when U-Boot is running from Coreboot.
-
 
 Freescale QE/FMAN Firmware Support:
 -----------------------------------
arch/x86/include/asm/realmode.h deleted +0 -36
deleted file mode 100644
index 0f12a89..0000000
@@ -1,36 +0,0 @@
-/*
- * (C) Copyright 2002
- * Daniel Engstr?m, Omicron Ceti AB, daniel at omicron.se
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * 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; either version 2 of
- * the License, or (at your option) any later version.
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#ifndef __ASM_REALMODE_H_
-#define __ASM_REALMODE_H_
-#include <asm/ptrace.h>
-
-extern ulong __realmode_start;
-extern ulong __realmode_size;
-extern char realmode_enter;
-
-int bios_setup(void);
-int enter_realmode(u16 seg, u16 off, struct pt_regs *in, struct pt_regs *out);
-int enter_realmode_int(u8 lvl, struct pt_regs *in, struct pt_regs *out);
-
-#endif
arch/x86/lib/Makefile +0 -10
index 0a52cc8..9b24dc5 100644
@@ -25,16 +25,6 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(ARCH).o
 
-ifeq ($(CONFIG_X86_NO_REAL_MODE),)
-SOBJS-$(CONFIG_SYS_PC_BIOS)	+= bios.o
-SOBJS-$(CONFIG_SYS_PCI_BIOS)	+= bios_pci.o
-COBJS-y	+= realmode.o
-SOBJS-y	+= realmode_switch.o
-
-COBJS-$(CONFIG_SYS_PC_BIOS)	+= bios_setup.o
-COBJS-$(CONFIG_VIDEO_VGA)	+= video_bios.o
-endif
-
 COBJS-y	+= board.o
 COBJS-y	+= bootm.o
 COBJS-y	+= cmd_boot.o
arch/x86/lib/bios.S deleted +0 -569

569 lines not on this page · raw message

arch/x86/lib/bios.h +0 -3
index a220983..96509b0 100644
@@ -145,9 +145,6 @@ extern void *rm_int1e;
 extern void *rm_int1f;
 extern void *rm_def_int;
 
-extern void *realmode_reset;
-extern void *realmode_pci_bios_call_entry;
-
 #define RELOC_16_LONG(seg, off) (*(u32 *)(seg << 4 | (u32)&off))
 #define RELOC_16_WORD(seg, off) (*(u16 *)(seg << 4 | (u32)&off))
 #define RELOC_16_BYTE(seg, off) (*(u8 *)(seg << 4 | (u32)&off))
arch/x86/lib/bios_pci.S deleted +0 -447

447 lines not on this page · raw message

arch/x86/lib/bios_setup.c deleted +0 -179

179 lines not on this page · raw message

arch/x86/lib/realmode.c deleted +0 -93

93 lines not on this page · raw message

arch/x86/lib/realmode_switch.S deleted +0 -232

232 lines not on this page · raw message

arch/x86/lib/video.c +0 -6
index 20e2416..81824f3 100644
@@ -26,7 +26,6 @@
 #include <stdio_dev.h>
 #include <i8042.h>
 #include <asm/ptrace.h>
-#include <asm/realmode.h>
 #include <asm/io.h>
 #include <asm/pci.h>
 
@@ -222,10 +221,5 @@ int video_init(void)
 
 int drv_video_init(void)
 {
-#ifndef CONFIG_X86_NO_REAL_MODE
-	if (video_bios_init())
-		return 1;
-#endif
-
 	return video_init();
 }
arch/x86/lib/video_bios.c deleted +0 -196

196 lines not on this page · raw message

arch/x86/lib/zimage.c +0 -23
index 46af391..4e9e1f7 100644
@@ -33,7 +33,6 @@
 #include <asm/io.h>
 #include <asm/ptrace.h>
 #include <asm/zimage.h>
-#include <asm/realmode.h>
 #include <asm/byteorder.h>
 #include <asm/bootparam.h>
 #ifdef CONFIG_SYS_COREBOOT
@@ -175,16 +174,9 @@ struct boot_params *load_zimage(char *image, unsigned long kernel_size,
 	else
 		*load_address = (void *)ZIMAGE_LOAD_ADDR;
 
-#if (defined CONFIG_ZBOOT_32 || defined CONFIG_X86_NO_REAL_MODE)
 	printf("Building boot_params at 0x%8.8lx\n", (ulong)setup_base);
 	memset(setup_base, 0, sizeof(*setup_base));
 	setup_base->hdr = params->hdr;
-#else
-	/* load setup */
-	printf("Moving Real-Mode Code to 0x%8.8lx (%d bytes)\n",
-	       (ulong)setup_base, setup_size);
-	memmove(setup_base, image, setup_size);
-#endif
 
 	if (bootproto >= 0x0204)
 		kernel_size = hdr->syssize * 16;
@@ -241,10 +233,8 @@ int setup_zimage(struct boot_params *setup_base, char *cmd_line, int auto_boot,
 	struct setup_header *hdr = &setup_base->hdr;
 	int bootproto = get_boot_protocol(hdr);
 
-#if (defined CONFIG_ZBOOT_32 || defined CONFIG_X86_NO_REAL_MODE)
 	setup_base->e820_entries = install_e820_map(
 		ARRAY_SIZE(setup_base->e820_map), setup_base->e820_map);
-#endif
 
 	if (bootproto == 0x0100) {
 		setup_base->screen_info.cl_magic = COMMAND_LINE_MAGIC;
@@ -300,7 +290,6 @@ void boot_zimage(void *setup_base, void *load_address)
 #ifdef CONFIG_SYS_COREBOOT
 	timestamp_add_now(TS_U_BOOT_START_KERNEL);
 #endif
-#if defined CONFIG_ZBOOT_32
 	/*
 	 * Set %ebx, %ebp, and %edi to 0, %esi to point to the boot_params
 	 * structure, and then jump to the kernel. We assume that %cs is
@@ -317,18 +306,6 @@ void boot_zimage(void *setup_base, void *load_address)
 	   "b"(0), "D"(0)
 	:  "%ebp"
 	);
-#else
-	struct pt_regs regs;
-
-	memset(&regs, 0, sizeof(struct pt_regs));
-	regs.xds = (u32)setup_base >> 4;
-	regs.xes = regs.xds;
-	regs.xss = regs.xds;
-	regs.esp = 0x9000;
-	regs.eflags = 0;
-	enter_realmode(((u32)setup_base + SETUP_START_OFFSET) >> 4, 0,
-		       &regs, &regs);
-#endif
 }
 
 void setup_pcat_compatibility(void)
Signature · 1 line
1.8.1
#1 lore raw

PATCH v3 5/5 x86: Remove unused real mode code

Hi Simon,

Quoted 22 lines · Simon Glass

This code is pretty old and we want to support only 32-bit systems now.

---
Changes in v3:
- Punt the real mode flag altogether

Changes in v2:
- Keep the real mode-to-protected code

 README                          |   5 -
 arch/x86/include/asm/realmode.h |  36 ---
 arch/x86/lib/Makefile           |  10 -
 arch/x86/lib/bios.S             | 569 ----------------------------------------
 arch/x86/lib/bios.h             |   3 -
 arch/x86/lib/bios_pci.S         | 447 -------------------------------
 arch/x86/lib/bios_setup.c       | 179 -------------
 arch/x86/lib/realmode.c         |  93 -------
 arch/x86/lib/realmode_switch.S  | 232 ----------------
 arch/x86/lib/video.c            |   6 -
 arch/x86/lib/video_bios.c       | 196 --------------
 arch/x86/lib/zimage.c           |  23 --
Quoted 9 lines
 12 files changed, 1799 deletions(-)
 delete mode 100644 arch/x86/include/asm/realmode.h
 delete mode 100644 arch/x86/lib/bios.S
 delete mode 100644 arch/x86/lib/bios_pci.S
 delete mode 100644 arch/x86/lib/bios_setup.c
 delete mode 100644 arch/x86/lib/realmode.c
 delete mode 100644 arch/x86/lib/realmode_switch.S
 delete mode 100644 arch/x86/lib/video_bios.c

Regards,

Graeme

#2 lore raw

PATCH v3 5/5 x86: Remove unused real mode code

Hi Graeme,

Quoted 35 lines · Graeme Russ

Hi Simon,

Quoted 22 lines · Simon Glass

This code is pretty old and we want to support only 32-bit systems now.

---
Changes in v3:
- Punt the real mode flag altogether

Changes in v2:
- Keep the real mode-to-protected code

 README                          |   5 -
 arch/x86/include/asm/realmode.h |  36 ---
 arch/x86/lib/Makefile           |  10 -
 arch/x86/lib/bios.S             | 569 ----------------------------------------
 arch/x86/lib/bios.h             |   3 -
 arch/x86/lib/bios_pci.S         | 447 -------------------------------
 arch/x86/lib/bios_setup.c       | 179 -------------
 arch/x86/lib/realmode.c         |  93 -------
 arch/x86/lib/realmode_switch.S  | 232 ----------------
 arch/x86/lib/video.c            |   6 -
 arch/x86/lib/video_bios.c       | 196 --------------
 arch/x86/lib/zimage.c           |  23 --
Quoted 9 lines
 12 files changed, 1799 deletions(-)
 delete mode 100644 arch/x86/include/asm/realmode.h
 delete mode 100644 arch/x86/lib/bios.S
 delete mode 100644 arch/x86/lib/bios_pci.S
 delete mode 100644 arch/x86/lib/bios_setup.c
 delete mode 100644 arch/x86/lib/realmode.c
 delete mode 100644 arch/x86/lib/realmode_switch.S
 delete mode 100644 arch/x86/lib/video_bios.c
Quoted 1 line

OK ta, I am going to send a pull request with this stuff first, since it will remove the need for a few of the other patches.

Regards,
Simon

Quoted 4 lines

Regards,

Graeme

author Applied
#3 lore raw

PATCH v3 5/5 x86: Remove unused real mode code

In reply to Graeme Russ
Quoted 35 lines · Graeme Russ

Hi Simon,

Quoted 22 lines · Simon Glass

This code is pretty old and we want to support only 32-bit systems now.

---
Changes in v3:
- Punt the real mode flag altogether

Changes in v2:
- Keep the real mode-to-protected code

 README                          |   5 -
 arch/x86/include/asm/realmode.h |  36 ---
 arch/x86/lib/Makefile           |  10 -
 arch/x86/lib/bios.S             | 569 ----------------------------------------
 arch/x86/lib/bios.h             |   3 -
 arch/x86/lib/bios_pci.S         | 447 -------------------------------
 arch/x86/lib/bios_setup.c       | 179 -------------
 arch/x86/lib/realmode.c         |  93 -------
 arch/x86/lib/realmode_switch.S  | 232 ----------------
 arch/x86/lib/video.c            |   6 -
 arch/x86/lib/video_bios.c       | 196 --------------
 arch/x86/lib/zimage.c           |  23 --
Quoted 9 lines
 12 files changed, 1799 deletions(-)
 delete mode 100644 arch/x86/include/asm/realmode.h
 delete mode 100644 arch/x86/lib/bios.S
 delete mode 100644 arch/x86/lib/bios_pci.S
 delete mode 100644 arch/x86/lib/bios_setup.c
 delete mode 100644 arch/x86/lib/realmode.c
 delete mode 100644 arch/x86/lib/realmode_switch.S
 delete mode 100644 arch/x86/lib/video_bios.c
Quoted 2 lines

Applied to x86/master.

Quoted 3 lines

Regards,

Graeme