All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] x86: make LOAD_FROM_32_BIT visible for platforms
Date: Tue, 24 Jan 2017 17:16:21 +0300	[thread overview]
Message-ID: <20170124141621.4689-1-andriy.shevchenko@linux.intel.com> (raw)

This option useful not only for development, but for the platforms where
U-Boot is run from custom ROM bootloader. For example, Intel Edison is
that board.

Make this option visible that platforms can select it if needed.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
- fix logic bug for non-Edison platforms
- move comment to Kconfig as option description
 arch/x86/Kconfig     |  9 +++++++++
 arch/x86/cpu/start.S | 12 ++----------
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 0884af22a7..1da1a2199c 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -109,6 +109,15 @@ config SYS_X86_START16
 	depends on X86_RESET_VECTOR
 	default 0xfffff800
 
+config X86_LOAD_FROM_32_BIT
+	bool "Boot from a 32-bit program"
+	default n
+	help
+	  Define this to boot U-Boot from a 32-bit program which sets
+	  the GDT differently. This can be used to boot directly from
+	  any stage of coreboot, for example, bypassing the normal
+	  payload-loading feature.
+
 config BOARD_ROMSIZE_KB_512
 	bool
 config BOARD_ROMSIZE_KB_1024
diff --git a/arch/x86/cpu/start.S b/arch/x86/cpu/start.S
index a5cba1cf2a..8de55a0af1 100644
--- a/arch/x86/cpu/start.S
+++ b/arch/x86/cpu/start.S
@@ -18,14 +18,6 @@
 #include <generated/generic-asm-offsets.h>
 #include <generated/asm-offsets.h>
 
-/*
- * Define this to boot U-Boot from a 32-bit program which sets the GDT
- * differently. This can be used to boot directly from any stage of coreboot,
- * for example, bypassing the normal payload-loading feature.
- * This is only useful for development.
- */
-#undef LOAD_FROM_32_BIT
-
 .section .text
 .code32
 .globl _start
@@ -76,7 +68,7 @@ _start:
 	/* Save table pointer */
 	movl	%ecx, %esi
 
-#ifdef LOAD_FROM_32_BIT
+#ifdef CONFIG_X86_LOAD_FROM_32_BIT
 	lgdt	gdt_ptr2
 #endif
 
@@ -233,7 +225,7 @@ multiboot_header:
 	/* entry addr */
 	.long	CONFIG_SYS_TEXT_BASE
 
-#ifdef LOAD_FROM_32_BIT
+#ifdef CONFIG_X86_LOAD_FROM_32_BIT
 	/*
 	 * The following Global Descriptor Table is just enough to get us into
 	 * 'Flat Protected Mode' - It will be discarded as soon as the final
-- 
2.11.0

             reply	other threads:[~2017-01-24 14:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-24 14:16 Andy Shevchenko [this message]
2017-02-04  5:55 ` [U-Boot] [PATCH v2] x86: make LOAD_FROM_32_BIT visible for platforms Bin Meng

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=20170124141621.4689-1-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --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.