From patchwork Tue Jan 24 14:16:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 719157 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3v79h05nB7z9sCM for ; Wed, 25 Jan 2017 01:35:12 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D106D4AA12; Tue, 24 Jan 2017 15:35:09 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Aa5sydkB5Gzc; Tue, 24 Jan 2017 15:35:09 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C8D654A068; Tue, 24 Jan 2017 15:35:08 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 612E74A08A for ; Tue, 24 Jan 2017 15:16:34 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ppdP54jQkajY for ; Tue, 24 Jan 2017 15:16:34 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by theia.denx.de (Postfix) with ESMTPS id A95434A07B for ; Tue, 24 Jan 2017 15:16:29 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 24 Jan 2017 06:16:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.33,278,1477983600"; d="scan'208"; a="1117126500" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga002.fm.intel.com with ESMTP; 24 Jan 2017 06:16:23 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 13B34B5; Tue, 24 Jan 2017 16:16:21 +0200 (EET) From: Andy Shevchenko To: Bin Meng , Simon Glass , Stefan Roese , u-boot@lists.denx.de Date: Tue, 24 Jan 2017 17:16:21 +0300 Message-Id: <20170124141621.4689-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.11.0 X-Mailman-Approved-At: Tue, 24 Jan 2017 15:35:06 +0100 Cc: Andy Shevchenko Subject: [U-Boot] [PATCH v2] x86: make LOAD_FROM_32_BIT visible for platforms X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 --- - 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 #include -/* - * 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