From patchwork Sun Oct 14 03:52:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 983651 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="LSSLf+g7"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 42Xnmy0w76z9s7W for ; Sun, 14 Oct 2018 14:56:18 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id C66A2C21DFF; Sun, 14 Oct 2018 03:51:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 6542EC21BE5; Sun, 14 Oct 2018 03:48:24 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id BBF77C21DFF; Sun, 14 Oct 2018 03:47:36 +0000 (UTC) Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by lists.denx.de (Postfix) with ESMTPS id 7B242C21E34 for ; Sun, 14 Oct 2018 03:47:32 +0000 (UTC) Received: by mail-pl1-f196.google.com with SMTP id q19-v6so4597558pll.5 for ; Sat, 13 Oct 2018 20:47:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=DaUsRoal/5NxLZouZXt3RH8hMmK/R9s4N66SvoBQRXo=; b=LSSLf+g7lEcUXed6o0FHZdg2rJNIv/M8xkAkA/wEZ7HdbMsMZoV8Vj4qECFW8akgQw N3gwmAotyOtzFmg2b2GGRFQvtCEFXooVKjxWOPdzg1lr/UykiUCIuSSWDPnffJpDqu2j 4miSNE+Mi9muS96gsohnyWJ2mjxzsTAsvLVs8jIxfbthZjdNvNuYYamg757B79QdAigc Wn/NsoPGeE2yRn6YJA4LnmJSKFxYC+LxXaZls/S9lasHrfyeT7Po0yd6uD2CmYECvU+Y mIWyO7vP0xmeR+rsl/DQ3+K8Mr2kqTWJieIcoSVcAIZCZdle0oC7O3QRFqQfPKRde5yR bztg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=DaUsRoal/5NxLZouZXt3RH8hMmK/R9s4N66SvoBQRXo=; b=J97b+Q6w2ta+qOGghBrqAjd1A2wOqS8VhghmoSL4FmB4bk4KTxH0yhRzKJMR+1JtWm VzEpfTNFD0w9s3L2QgYg7c0MkLq7au4xCfwhKzAhmg19OXJOyzTBsyjLMtxBpOWSwzKN 71SBmlx6JeFZjvwOkGvhfUZbPswYLNdHgc0dX8ezAzd/Finqrjnhw0P5Ug539rrflCH0 InS+GyQQKVjfIEky0DH+7tLvYUrQXEZT6EUoZJ0+cwPr+w+47fJDRrseFErtNlNVFaSt 3wa2jM1pqKV1SesGEff3S+zEs1r4mGBy3UWppDOf86RbGbCCoQ5WK/ulKmkN/aBIe2Wa YomA== X-Gm-Message-State: ABuFfohPWq/tfg/xyyS9ArdnEg+AkSFFV5oTT1Q1bgIbKaYxPK8A8Mkg 8ye69Q9dMhMIV/hoRPY7QxrZwdTf X-Google-Smtp-Source: ACcGV62CAy4yiy7jT5maSFrxr5u0xQVZz6romOooTrAJyxZMedswRRXQS0I3RNudVLwAIxdV351dmw== X-Received: by 2002:a17:902:4381:: with SMTP id j1-v6mr11697132pld.59.1539488851123; Sat, 13 Oct 2018 20:47:31 -0700 (PDT) Received: from ala-d2121-lx1.wrs.com (unknown-156-139.windriver.com. [147.11.156.139]) by smtp.gmail.com with ESMTPSA id u184-v6sm8286099pgd.27.2018.10.13.20.47.30 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 13 Oct 2018 20:47:30 -0700 (PDT) From: Bin Meng To: Simon Glass , Heinrich Schuchardt , U-Boot Mailing List Date: Sat, 13 Oct 2018 20:52:09 -0700 Message-Id: <1539489134-9847-10-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1539489134-9847-1-git-send-email-bmeng.cn@gmail.com> References: <1539489134-9847-1-git-send-email-bmeng.cn@gmail.com> Subject: [U-Boot] [PATCH v2 09/14] x86: Fix the mystery of printch() during 64-bit boot X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" At present in arch_setup_gd() it calls printch(' ') at the end which has been a mystery for a long time as without such call the 64-bit U-Boot just does not boot at all. In fact this is due to the bug that board_init_f() was called with boot_flags not being set. Hence whatever value being there in the rdi register becomes the boot_flags if without such magic call. With a printch(' ') call the rdi register is initialized as 0x20 and this value seems to be sane enough for the whole boot process. Signed-off-by: Bin Meng Reviewed-by: Heinrich Schuchardt --- Changes in v2: None arch/x86/cpu/start64.S | 1 + arch/x86/cpu/x86_64/cpu.c | 18 ------------------ 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/arch/x86/cpu/start64.S b/arch/x86/cpu/start64.S index a473fd1..a78a331 100644 --- a/arch/x86/cpu/start64.S +++ b/arch/x86/cpu/start64.S @@ -20,6 +20,7 @@ _start: call board_init_f_init_reserve + xor %rdi, %rdi call board_init_f call board_init_f_r diff --git a/arch/x86/cpu/x86_64/cpu.c b/arch/x86/cpu/x86_64/cpu.c index ef5e812..6c063e8 100644 --- a/arch/x86/cpu/x86_64/cpu.c +++ b/arch/x86/cpu/x86_64/cpu.c @@ -19,24 +19,6 @@ struct global_data *global_data_ptr = (struct global_data *)~0; void arch_setup_gd(gd_t *new_gd) { global_data_ptr = new_gd; - - /* - * TODO(sjg@chromium.org): For some reason U-Boot does not boot - * without this line. It fails to start up U-Boot proper and instead - * restarts SPL. Need to figure out why: - * - * U-Boot SPL 2017.01 - * - * U-Boot SPL 2017.01 - * CPU: Intel(R) Core(TM) i5-3427U CPU @ 1.80GHz - * Trying to boot from SPIJumping to 64-bit U-Boot: Note many - * features are missing - * - * U-Boot SPL 2017.01 - */ -#ifdef CONFIG_DEBUG_UART - printch(' '); -#endif } int cpu_has_64bit(void)