From patchwork Sun Jan 24 17:06:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1430935 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=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=JGsNyA1q; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DNzty1j9Yz9sVv for ; Mon, 25 Jan 2021 04:07:05 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 89EA58279C; Sun, 24 Jan 2021 18:06:47 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="JGsNyA1q"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C44ED82777; Sun, 24 Jan 2021 18:06:43 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0C73B8276D for ; Sun, 24 Jan 2021 18:06:41 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-pj1-x102b.google.com with SMTP id p15so6867142pjv.3 for ; Sun, 24 Jan 2021 09:06:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qTbL41PnnUggtlgm7zCdLGTxetJSRxIugMhNmuHWC40=; b=JGsNyA1q0AImKHvq4uKP+lAzuIqfvl+Yv6le2iDCpquFtDhDKTdSadv9L4K86LnBns dhnonjf1b2TWx+MPDvOQj5l/DT5khQZwMhbpBr7Bqz6A4mRgBxWfg/HvksMP4JO47+zp KQJ6VQVwOSIfmhFNXQSVRsXHDKZrSHAq3ydwg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qTbL41PnnUggtlgm7zCdLGTxetJSRxIugMhNmuHWC40=; b=JP5T8LaEJBgHLIJtXKHyTTk1Lc+f7E6Krh2b77taF38n8kIgwVVmeaJsRCsCplcx7z ZUhLKc7JOpK9BiWrm2iA8DoBtE/Ut7el/XcK6TfjupbJjHR7MkEa+XEe8lFDdSX5pBjk TiOlAlL6NKkJEmOD9UGX/x0KlmJp+frGFTGyGdO9Zwhssi2Reg8M97Z8xC778jTCcHdJ HkKMMVZ62MJFO+chxrKOKnC3ocE9Mqm6HmSNB2uZ0Z34zJME6CPAwNyzHYk/l+u/qDOO iHEwsbP6+O2jyTd5XmeNdJ0O7P64rX6lBuk5o5Khen8YyJTYuduqeoKiXLR+LKiiFFpp eXRg== X-Gm-Message-State: AOAM533ocRxxv5mndMVE1kPl3QwyHNAcCnqJMVtUboOdV2i4Gd+/rs6a RP93SEV7XqPQ6d5ORjY/IZLgQaKcWjZOrUqB X-Google-Smtp-Source: ABdhPJzIjSd49yrKEX+MhHmNQxLZiZSuxh8yQHem28L6eEHEdRmADF4vKXu1Ws44X+4uzoxRgNFpvw== X-Received: by 2002:a17:90a:b90c:: with SMTP id p12mr17337814pjr.136.1611507999426; Sun, 24 Jan 2021 09:06:39 -0800 (PST) Received: from sjg1.home ([2600:6c4c:507f:f8e5:0:ec6e:a61e:6ad]) by smtp.gmail.com with ESMTPSA id jx15sm15559193pjb.17.2021.01.24.09.06.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Jan 2021 09:06:38 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Andy Shevchenko , Simon Glass Subject: [PATCH v2 01/12] x86: acpi_gpe: Update driver name to match devicetree Date: Sun, 24 Jan 2021 10:06:02 -0700 Message-Id: <20210124100608.v2.1.I87d41cd95212f8a8f7c601b00cd64d5192a73f8e@changeid> X-Mailer: git-send-email 2.30.0.280.ga3ce27912f-goog In-Reply-To: <20210124170613.3434824-1-sjg@chromium.org> References: <20210124170613.3434824-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Use a driver name in line with the compatible string so that of-platdata can use this driver. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v1) arch/x86/cpu/acpi_gpe.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/x86/cpu/acpi_gpe.c b/arch/x86/cpu/acpi_gpe.c index 83128c33c2c..da01e71335f 100644 --- a/arch/x86/cpu/acpi_gpe.c +++ b/arch/x86/cpu/acpi_gpe.c @@ -4,6 +4,8 @@ * Written by Simon Glass */ +#define LOG_CATEGORY UCLASS_IRQ + #include #include #include @@ -102,8 +104,8 @@ static const struct udevice_id acpi_gpe_ids[] = { { } }; -U_BOOT_DRIVER(acpi_gpe_drv) = { - .name = "acpi_gpe", +U_BOOT_DRIVER(intel_acpi_gpe) = { + .name = "intel_acpi_gpe", .id = UCLASS_IRQ, .of_match = acpi_gpe_ids, .ops = &acpi_gpe_ops, From patchwork Sun Jan 24 17:06:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1430936 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=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=hn7RgNrs; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DNzv95R8lz9sVn for ; Mon, 25 Jan 2021 04:07:17 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DB2F78277D; Sun, 24 Jan 2021 18:06:48 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="hn7RgNrs"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5DE2B8278B; Sun, 24 Jan 2021 18:06:45 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id AD5AE82775 for ; Sun, 24 Jan 2021 18:06:42 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-pj1-x1034.google.com with SMTP id g15so7046063pjd.2 for ; Sun, 24 Jan 2021 09:06:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=og1QoNWXh4Wowvz2IuxdY+aKZjyenRY6iDNd5rQJ7bY=; b=hn7RgNrsUkbD+dxHGaDh4ZsbdCgeca7Zw55NDBAbhPqDmxPnopo7e3o56gKzSiM/9Q tj7DVjxxQjD/BrUq1BDqaFJWQOBRUsZkbO5CZz3YJuY3VeeM1SytwSd07hMPT0sMuWlr 8mNrgW9B0nAmT9iq9r8K90HnUz3/5JqVNwjGU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=og1QoNWXh4Wowvz2IuxdY+aKZjyenRY6iDNd5rQJ7bY=; b=sAci16mOlGKmPXlSPHfQZC6PgSrfTT47jLSZAuJnPTe5DAohGShQ43ja7O3ots46Nv d6ZN66VeflLuNWCf4Dp0xFrOt548wNM8cMhbWAvp7lcl5Z1PhbvTXMSz1Lkta25P71rO bD9DBsOshZAujGveq8DXh3RPFp7s9bF+AHA4bGz5OfPTemv/cA6RyAO0HNxQfIdu6kHl 7l4p/IsBqyVJxHVq/bzaQ0xUL23vV/fENZuv4kWoNYkphjF8kQoFTpUPMKayIoKvTm/N sVNkitjYubS/Ma7kdHdibMUb8/pJ741iWbTWbT1hvubL86FfRAwirrvfYxxngSm2CDVK IrGg== X-Gm-Message-State: AOAM5333OuO001BlBpMmdl2+t6Ag5wwBy2fCt1vk1Dfn6UuxoPy+GFw+ RnLpYXjm4NR1nIQA0EKwuYzUHjcJf6+lgij2 X-Google-Smtp-Source: ABdhPJzL6ba+TGjlE74I/NnCJdT5iC3JEt8guc+PsDTeBVezjw4GVAv/X2SbShc0uGXZFASbT0WUpw== X-Received: by 2002:a17:902:14f:b029:de:c703:3045 with SMTP id 73-20020a170902014fb02900dec7033045mr15874594plb.14.1611508001000; Sun, 24 Jan 2021 09:06:41 -0800 (PST) Received: from sjg1.home ([2600:6c4c:507f:f8e5:0:ec6e:a61e:6ad]) by smtp.gmail.com with ESMTPSA id jx15sm15559193pjb.17.2021.01.24.09.06.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Jan 2021 09:06:40 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Andy Shevchenko , Simon Glass Subject: [PATCH v2 02/12] x86: spl: Add a function to find the text base Date: Sun, 24 Jan 2021 10:06:03 -0700 Message-Id: <20210124100608.v2.2.Ida9f8cf3e7473c0f9493dd616e7481a022f3a85a@changeid> X-Mailer: git-send-email 2.30.0.280.ga3ce27912f-goog In-Reply-To: <20210124170613.3434824-1-sjg@chromium.org> References: <20210124170613.3434824-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean It is useful to know the TEXT_BASE value for the image being loaded in TPL/SPL. Add a new spl_get_image_text_base() function to handle this. Make use of this in the x86 SPL handler, instead of having the logic there. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v1) common/spl/spl.c | 6 ++++++ include/spl.h | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/common/spl/spl.c b/common/spl/spl.c index d375dcbb2ed..12b00e2a407 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -144,6 +144,12 @@ ulong spl_get_image_size(void) binman_sym(ulong, u_boot_any, size); } +ulong spl_get_image_text_base(void) +{ + return spl_phase() == PHASE_TPL ? CONFIG_SPL_TEXT_BASE : + CONFIG_SYS_TEXT_BASE; +} + /* * Weak default function for board specific cleanup/preparation before * Linux boot. Some boards/platforms might not need it, so just provide diff --git a/include/spl.h b/include/spl.h index faffeb519ac..e172500b5f8 100644 --- a/include/spl.h +++ b/include/spl.h @@ -254,6 +254,16 @@ ulong spl_get_image_pos(void); */ ulong spl_get_image_size(void); +/** + * spl_get_image_text_base() - get the text base of the next phase + * + * This returns the address that the next stage is linked to run at, i.e. + * CONFIG_SPL_TEXT_BASE or CONFIG_SYS_TEXT_BASE + * + * @return text-base address + */ +ulong spl_get_image_text_base(void); + /** * spl_load_simple_fit_skip_processing() - Hook to allow skipping the FIT * image processing during spl_load_simple_fit(). From patchwork Sun Jan 24 17:06:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1430937 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=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=V51nWgQJ; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DNzvP3p45z9sVv for ; Mon, 25 Jan 2021 04:07:29 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DC36D827C3; Sun, 24 Jan 2021 18:06:52 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="V51nWgQJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2679F827A6; Sun, 24 Jan 2021 18:06:47 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 5A002826B6 for ; Sun, 24 Jan 2021 18:06:44 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-pj1-x102d.google.com with SMTP id lw17so8154903pjb.0 for ; Sun, 24 Jan 2021 09:06:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tHJvfw1gTmtzljv90JgAlWEqsJiQ/l9bFmgHtB5Jetk=; b=V51nWgQJsCh01I5/+Wp/CwpdCsSG87wXkocZ0twNrDTCc0KZgh+Lgxm68QxJOlJVZG wz2L4mJdRphPc2LOH0nPX6EVFPYaq4wa051OH52mW8UxbuAuZmLk68HZFwZ9kJIM65kN XJt24WhnUZy9G+IVXVSsIVAzHe9zWrs1J/l6I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tHJvfw1gTmtzljv90JgAlWEqsJiQ/l9bFmgHtB5Jetk=; b=XszmSATZw5YCG38v2ibR1Flfyo1WmnMcqKpekhcm2yjkQJBnWd9tTjFQ4zXtiIfdaT 8u8bz3zAAA7gZUUob7Kihx9OiMh93yif0Qte7cjrY9TrfNKtVmNiCV3koTORR0yQBut+ pGiE6kHU0d5hmsmRBiYsnm6XXsKa9jiq54njspau8IrI1lV3AULzsWG6Jr5GptQcEW2I NELzYrQMsfdbGA56uFCWl2Bmqh9krO4DI5aTqRCEzsE0natS/1rSQA0XFVvmPiyN1N5s 9evaAAvtta7XEXjhwCcXMnst0rFl0ssOhnEWCCP+tqOQCLhIxVHKaL7f9D7AqYAPsEe3 RfXQ== X-Gm-Message-State: AOAM532NEF9er1Rqvig/TQpdO1kS4ECOGU4imen5G7p1l9aFffMjdYJM 6nSXbni0VzmI7iDeBmjcSRhts7lpUZVdx78n X-Google-Smtp-Source: ABdhPJztWGWK8Kw9QIzeCsI4oGMCifa1X/xu3gxVhv0yD6FCwQ28a4x0PMjnq1UoKtvIgkQKQvjiuQ== X-Received: by 2002:a17:903:248e:b029:de:b329:ffaa with SMTP id p14-20020a170903248eb02900deb329ffaamr15325624plw.71.1611508002670; Sun, 24 Jan 2021 09:06:42 -0800 (PST) Received: from sjg1.home ([2600:6c4c:507f:f8e5:0:ec6e:a61e:6ad]) by smtp.gmail.com with ESMTPSA id jx15sm15559193pjb.17.2021.01.24.09.06.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Jan 2021 09:06:42 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Andy Shevchenko , Simon Glass Subject: [PATCH v2 03/12] x86: apl: Enhance debugging in the SPL loader Date: Sun, 24 Jan 2021 10:06:04 -0700 Message-Id: <20210124100608.v2.3.Ia4625fafac91469274141729a0040ded17b0db3c@changeid> X-Mailer: git-send-email 2.30.0.280.ga3ce27912f-goog In-Reply-To: <20210124170613.3434824-1-sjg@chromium.org> References: <20210124170613.3434824-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Move to log_debug() and make use of the new SPL function to find the text base. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v1) arch/x86/cpu/apollolake/spl.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/arch/x86/cpu/apollolake/spl.c b/arch/x86/cpu/apollolake/spl.c index 8991d5e648e..f2d25734c60 100644 --- a/arch/x86/cpu/apollolake/spl.c +++ b/arch/x86/cpu/apollolake/spl.c @@ -3,6 +3,8 @@ * Copyright 2019 Google LLC */ +#define LOG_CATEGORY LOGC_BOOT + #include #include #include @@ -33,12 +35,11 @@ static int rom_load_image(struct spl_image_info *spl_image, int ret; spl_image->size = CONFIG_SYS_MONITOR_LEN; /* We don't know SPL size */ - spl_image->entry_point = spl_phase() == PHASE_TPL ? - CONFIG_SPL_TEXT_BASE : CONFIG_SYS_TEXT_BASE; + spl_image->entry_point = spl_get_image_text_base(); spl_image->load_addr = spl_image->entry_point; spl_image->os = IH_OS_U_BOOT; spl_image->name = "U-Boot"; - debug("Reading from mapped SPI %lx, size %lx", spl_pos, spl_size); + log_debug("Reading from mapped SPI %lx, size %lx\n", spl_pos, spl_size); if (CONFIG_IS_ENABLED(SPI_FLASH_SUPPORT)) { ret = uclass_find_first_device(UCLASS_SPI_FLASH, &dev); @@ -56,7 +57,8 @@ static int rom_load_image(struct spl_image_info *spl_image, return ret; } spl_pos += map_base & ~0xff000000; - debug(", base %lx, pos %lx\n", map_base, spl_pos); + log_debug(", base %lx, pos %lx, load %lx\n", map_base, spl_pos, + spl_image->load_addr); bootstage_start(BOOTSTAGE_ID_ACCUM_MMAP_SPI, "mmap_spi"); memcpy((void *)spl_image->load_addr, (void *)spl_pos, spl_size); cpu_flush_l1d_to_l2(); @@ -121,7 +123,7 @@ static int spl_fast_spi_load_image(struct spl_image_info *spl_image, spl_image->os = IH_OS_U_BOOT; spl_image->name = "U-Boot"; spl_pos &= ~0xff000000; - debug("Reading from flash %lx, size %lx\n", spl_pos, spl_size); + log_debug("Reading from flash %lx, size %lx\n", spl_pos, spl_size); ret = spi_flash_read_dm(dev, spl_pos, spl_size, (void *)spl_image->load_addr); cpu_flush_l1d_to_l2(); From patchwork Sun Jan 24 17:06:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1430938 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=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=DZeV5SHa; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DNzvf1Jjvz9sVn for ; Mon, 25 Jan 2021 04:07:42 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C9A35827FD; Sun, 24 Jan 2021 18:06:53 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="DZeV5SHa"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CAF5782775; Sun, 24 Jan 2021 18:06:48 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id DE09B8278B for ; Sun, 24 Jan 2021 18:06:45 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-pl1-x62d.google.com with SMTP id q2so3372139plk.4 for ; Sun, 24 Jan 2021 09:06:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=axTD+aDX6ba5T7vy3n24XYTAlxVy9PsZeACtbQ4hd1g=; b=DZeV5SHaRIJqgFpncrIP6FJ2Bmx85mFDJtjzqFktd+53PKSnMn1JCFhx/s54EzyCH7 mzcOV8YMwHCz7dkMvE1fZq03TSBDCgrJ+jT/hXmwJ6Lw+glWGaPju8i0LcYZakIYJhYw l+oUc0SMmk2SjN+3W28+Nh0N9rieaZYi/tH7I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=axTD+aDX6ba5T7vy3n24XYTAlxVy9PsZeACtbQ4hd1g=; b=hlUY8JQb5zVgmh59bVCI/+mITzvExhyFLUtceqSBKbMOQaxJ3NC7dZ5OF38uiSYljU kfWnDALQxaP/F3FQkt6zM/CkFOMvW//uSBLXsZbRWVqx5Hvwitr9MWL54ztJC76e8rdB kNLFijZWbMp3nZipJvkKB0s/XreiX00cvrim1ANl0Lh9R+v5waXvfC31oNi+/MHQpACf oq7MFUi/wF0Uwq9AjxEVgjNWqkfifHKuD0tE7KMZ0K6tS76bhqJf4gaI+CA6bHGCsc90 nUKZDjBHX8YtK3RTRbCbqoHvaMYrsfIhKDuYYuWSKvuAqW0zkYjqJb2f1rl5dPoSR+nY LJjA== X-Gm-Message-State: AOAM531oQ7Lfz3E4OVhML2jsWmQyQMUqebpPAe9ERjuNnlqy+5Esp0Xy o8NBfEOU4PevZlp7dM/3pntECC3G4uJiXaPm X-Google-Smtp-Source: ABdhPJye03lRYRmf0PY+6vP6SSZ7yHaQxQ0t4QzanRyP/t3koL6lTpYrogFUH5BXvPOgozvDLFez7g== X-Received: by 2002:a17:90a:e297:: with SMTP id d23mr17140193pjz.42.1611508004317; Sun, 24 Jan 2021 09:06:44 -0800 (PST) Received: from sjg1.home ([2600:6c4c:507f:f8e5:0:ec6e:a61e:6ad]) by smtp.gmail.com with ESMTPSA id jx15sm15559193pjb.17.2021.01.24.09.06.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Jan 2021 09:06:43 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Andy Shevchenko , Simon Glass Subject: [PATCH v2 04/12] x86: Make sure the SPL image ends on a suitable boundary Date: Sun, 24 Jan 2021 10:06:05 -0700 Message-Id: <20210124100608.v2.4.I66e525bc185416fb67c5ff72d9fadde9d60f7ae4@changeid> X-Mailer: git-send-email 2.30.0.280.ga3ce27912f-goog In-Reply-To: <20210124170613.3434824-1-sjg@chromium.org> References: <20210124170613.3434824-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean The part of U-Boot that actually ends up in u-boot-nodtb.bin is not built with any particular alignment. It ends at the start of the BSS section. The BSS section selects its own alignment, which may larger. This means that there can be a gap of a few bytes between the image ending and BSS starting. Since u-boot.bin is build by joining u-boot-nodtb.bin and u-boot.dtb (with perhaps some padding for BSS), the expected result is not obtained. U-Boot uses the end of BSS to find the devicetree, so this means that it cannot be found. Add 32-byte alignment of BSS so that the image size is correct and appending the devicetree will place it at the end of BSS. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- Example SPL output without this patch: Sections: Idx Name Size VMA LMA File off Algn 0 .text 000142a1 fef40000 fef40000 00001000 2**4 CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE 1 .u_boot_list 000014a4 fef542a8 fef542a8 000152a8 2**3 CONTENTS, ALLOC, LOAD, RELOC, DATA 2 .rodata 0000599c fef55760 fef55760 00016760 2**5 CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA 3 .data 00000970 fef5b100 fef5b100 0001c100 2**5 CONTENTS, ALLOC, LOAD, RELOC, DATA 4 .binman_sym_table 00000020 fef5ba70 fef5ba70 0001ca70 2**2 CONTENTS, ALLOC, LOAD, DATA 5 .bss 00000060 fef5baa0 fef5baa0 00000000 2**5 ALLOC You can see that .bss is aligned to 2**5 (32 bytes). This is because of the mallinfo struct in dlmalloc.c: 17 .bss.current_mallinfo 00000028 00000000 00000000 000004c0 2**5 ALLOC In this case the size of u-boot-spl-nodtb.bin is 0x1ba90. This matches up with the _image_binary_end symbol: fef5ba90 g .binman_sym_table 00000000 _image_binary_end But BSS starts 16 bytes later, at 0xfef5baa0, due to the 32-byte alignment. So we must align _image_binary_end to a 32-byte boundary. This forces the binary size to be 0x1baa0, i.e. ending at the start of bss, as expected. Note that gcc reports __BIGGEST_ALIGNMENT__ of 16 on this build, even though it generates an object file with a member that requests 32-byte alignment. The current_mallinfo struct is 40 bytes in size. Increasing the struct to 68 bytes (i.e. just above a 64-byte boundary) does not cause the alignment to go above 32 bytes. So it seems that 32 bytes is the maximum alignment at present. Changes in v2: - Add comment to .lds file - Add more notes to the commit arch/x86/cpu/u-boot-spl.lds | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/x86/cpu/u-boot-spl.lds b/arch/x86/cpu/u-boot-spl.lds index e6c22895b35..ead4f380e74 100644 --- a/arch/x86/cpu/u-boot-spl.lds +++ b/arch/x86/cpu/u-boot-spl.lds @@ -43,6 +43,16 @@ SECTIONS __binman_sym_start = .; KEEP(*(SORT(.binman_sym*))); __binman_sym_end = .; + + /* + * Force 32-byte alignment so that it lines up with the start of + * bss, which may have up to 32-byte alignment. This ensures + * that the end of the .bin file matches up with + * _image_binary_end or __bss_end - see board_fdt_blob_setup(). + * The alignment of BSS depends on what is in it, so can range + * from 4 to 32 bytes. + */ + . = ALIGN(32); } _image_binary_end = .; From patchwork Sun Jan 24 17:06:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1430939 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=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=AtxZr7MH; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DNzvw6KHDz9sCD for ; Mon, 25 Jan 2021 04:07:56 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 033408280F; Sun, 24 Jan 2021 18:06:55 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="AtxZr7MH"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9F207827C7; Sun, 24 Jan 2021 18:06:50 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id CF3E6827B7 for ; Sun, 24 Jan 2021 18:06:47 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-pf1-x430.google.com with SMTP id o20so7040417pfu.0 for ; Sun, 24 Jan 2021 09:06:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ol3rNq1AmsljSRESOstmwX0x6nL81yZoQYDc5wp006Q=; b=AtxZr7MHV2DWFE6iTMaobB3Xt4OccDILnlxSF+lEBXoINi+T8dI0Fvx7bfXwTrxnUg rKA22hFDG7UvmTKuav/rTQgDXV4WkykpSWGjX0fsf6PgfiSnV5twnMDsYUDfnBZbiazE kiTWdvQ+hnyzA/Ft/8RGoSRvtLORWxaXMTv1o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ol3rNq1AmsljSRESOstmwX0x6nL81yZoQYDc5wp006Q=; b=ZbeQ9Zj4odPbvCCqXgvqX8dW4Z4vCouynwYi0ycg8Rx5QXSNO88pq5LGnA29hWNdak KCxslUAFLG5l7wpSkiuo8dXL+SEJXVae2/UAt0ElcGXIMacaV2o6z14IELWr5MExldv1 m08/BwsEzWV0xzeeWnCHNb+sKzlFCFjPztPJXNlyrdGVfVupyUr7gTA/30W8QSvF1qlp MHcqX1sdObyzsqUXgB3u319R1NI+hN3019JvzwHl8ouDKrUNn7idg8+oVfLAnNqq6Jtt p+/MPp1FsIIbV22o9bRXunCT+CxWbsJ4nFL2iQYjCiReqkds/JSwW1z93gDCX7CCm1eO j2HQ== X-Gm-Message-State: AOAM533d0lvncVwXOIug17ZvbkHz6NFanPCI5vTVPmILbZLPkTr3CL6L 4sFdwZK+ZGGj/9YzI6Gtn/T0RreGltWB+j+0 X-Google-Smtp-Source: ABdhPJwQr+RM6bfsX1noH+Bk2WErd5kwwcybY2kdZBtE7WK67ltY3k2O9pikJJyxPSCiDo4WREOr4w== X-Received: by 2002:a63:605:: with SMTP id 5mr14190256pgg.144.1611508005968; Sun, 24 Jan 2021 09:06:45 -0800 (PST) Received: from sjg1.home ([2600:6c4c:507f:f8e5:0:ec6e:a61e:6ad]) by smtp.gmail.com with ESMTPSA id jx15sm15559193pjb.17.2021.01.24.09.06.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Jan 2021 09:06:45 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Andy Shevchenko , Simon Glass Subject: [PATCH v2 05/12] x86: spl: Make moving BSS conditional Date: Sun, 24 Jan 2021 10:06:06 -0700 Message-Id: <20210124100608.v2.5.I5a89c49db44a423cb318aa9d88b31e7df36bca98@changeid> X-Mailer: git-send-email 2.30.0.280.ga3ce27912f-goog In-Reply-To: <20210124170613.3434824-1-sjg@chromium.org> References: <20210124170613.3434824-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean At present BSS is always placed in SDRAM. If a separate BSS is not in use this means that BSS doesn't work as expected. Make the setting conditional on the SEPARATE_BSS option. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v1) arch/x86/cpu/u-boot-spl.lds | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/cpu/u-boot-spl.lds b/arch/x86/cpu/u-boot-spl.lds index ead4f380e74..b82e53ab124 100644 --- a/arch/x86/cpu/u-boot-spl.lds +++ b/arch/x86/cpu/u-boot-spl.lds @@ -57,7 +57,9 @@ SECTIONS _image_binary_end = .; +#if CONFIG_IS_ENABLED(SEPARATE_BSS) . = 0x120000; +#endif .bss (OVERLAY) : { __bss_start = .; *(.bss*) From patchwork Sun Jan 24 17:06:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1430940 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=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=PMn4o6cD; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DNzwC0ghJz9sVn for ; Mon, 25 Jan 2021 04:08:11 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1406E82822; Sun, 24 Jan 2021 18:06:56 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="PMn4o6cD"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0FD34827C7; Sun, 24 Jan 2021 18:06:52 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 69CDD8274E for ; Sun, 24 Jan 2021 18:06:49 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-pj1-x1034.google.com with SMTP id l18so898597pji.3 for ; Sun, 24 Jan 2021 09:06:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ADD6r65TqhGRODKIOl3nl/l+ZV4ZNDpLeNu0U1ycDko=; b=PMn4o6cD0vhSNXFgHUI7KhZqSPji0KthB6NWvdgNV7xUw83m+ewPlcjYWJr2ykae5q rkDR10Me1untdt/EF1OyBbtAbhla1fOvwdCc8Zk/VJTnXrXcsvGW9jiXcQPrDvbayzRC +Q+AVhCPCAweQqolvhYXs/usWJcEC5Hl7oir4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ADD6r65TqhGRODKIOl3nl/l+ZV4ZNDpLeNu0U1ycDko=; b=BWqvcq76EcIkbn+NZGZVVoTtsnB2SVH+w1SkM8/qWKmKR4jEixdYOBJM74fOZ0e47L 0SD+84/ZZu4Ymwxbrkp9wzR8l1zJHLRSzrh4HI77wAYVkx14eE2RTDzkVYTZxavhiVAx BmizvR5+A+xHaH81hEW1gFMCprDT8WnsJqUAXn6GjzidVgTz+xEaLRKxXfsG5sgbfOzH bwf4LA7FpDbhIBTNbRgyHX1p1HGLiFrYIX2fp6BmxvR0ND2JJY4Y7u51vXahGjaRVj4r tPH4rldKClZP6pc6+io3wDhUjxYusrqBRM5H6UYivlxzj5X+XReZHfWnpyR2YPw4P7AI 6V3w== X-Gm-Message-State: AOAM533kyOjg45Qcr+B6n+lYr6JbmJqMgRkrsNbKl5pRMbUvRmk0LGlB DoOAh0Kx69ImhtYRV2OuJQDdFA7UYH/au+NM X-Google-Smtp-Source: ABdhPJxwOFFv+VYwN8aZ2zfq5wFmj7MFl/+laDf4ulNYSgMa6c+E05bojhiuEkGBpWKdZ0adyvl6aw== X-Received: by 2002:a17:90b:11d8:: with SMTP id gv24mr17378419pjb.232.1611508007727; Sun, 24 Jan 2021 09:06:47 -0800 (PST) Received: from sjg1.home ([2600:6c4c:507f:f8e5:0:ec6e:a61e:6ad]) by smtp.gmail.com with ESMTPSA id jx15sm15559193pjb.17.2021.01.24.09.06.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Jan 2021 09:06:47 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Andy Shevchenko , Simon Glass Subject: [PATCH v2 06/12] x86: Update Chromium OS GNVS names Date: Sun, 24 Jan 2021 10:06:07 -0700 Message-Id: <20210124100608.v2.6.I6899fb8e644a4342546ee0bfbdd521488635e1ca@changeid> X-Mailer: git-send-email 2.30.0.280.ga3ce27912f-goog In-Reply-To: <20210124170613.3434824-1-sjg@chromium.org> References: <20210124170613.3434824-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean The Global Non-Volatile Storage struct has some fields with particular meanings. Rename these to make things easier to follow. Also add a few more boot flags. GNVS should not be confused with GNVQ (Going Nowhere Very Quickly). Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v1) arch/x86/include/asm/intel_gnvs.h | 34 +++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/arch/x86/include/asm/intel_gnvs.h b/arch/x86/include/asm/intel_gnvs.h index 7f9f101371c..69a20812e5e 100644 --- a/arch/x86/include/asm/intel_gnvs.h +++ b/arch/x86/include/asm/intel_gnvs.h @@ -9,6 +9,7 @@ #ifndef _INTEL_GNVS_H_ #define _INTEL_GNVS_H_ +#include /* * The chromeos_acpi portion of ACPI GNVS is assumed to live from offset * 0x100 - 0x1000. When defining acpi_global_nvs, use check_member @@ -18,6 +19,11 @@ */ #define GNVS_CHROMEOS_ACPI_OFFSET 0x100 +enum { + BOOT_REASON_OTHER = 0, + BOOT_REASON_S3DIAG = 9 +}; + enum { CHSW_RECOVERY_X86 = BIT(1), CHSW_RECOVERY_EC = BIT(2), @@ -25,6 +31,22 @@ enum { CHSW_FIRMWARE_WP = BIT(9), }; +enum { + RECOVERY_REASON_NONE = 0, + RECOVERY_REASON_ME = 1 +}; + +enum { + ACTIVE_ECFW_RO = 0, + ACTIVE_ECFW_RW = 1 +}; + +enum { + BINF_RECOVERY = 0, + BINF_RW_A = 1, + BINF_RW_B = 2 +}; + enum { FIRMWARE_TYPE_AUTO_DETECT = -1, FIRMWARE_TYPE_RECOVERY = 0, @@ -40,14 +62,14 @@ struct __packed chromeos_acpi_gnvs { u32 active_main_fw; /* 04 (0=recovery, 1=A, 2=B) */ u32 activeec_fw; /* 08 (0=RO, 1=RW) */ u16 switches; /* 0c CHSW */ - u8 vbt4[256]; /* 0e HWID */ - u8 vbt5[64]; /* 10e FWID */ - u8 vbt6[64]; /* 14e FRID - 275 */ + u8 hwid[256]; /* 0e HWID */ + u8 fwid[64]; /* 10e FWID */ + u8 frid[64]; /* 14e FRID - 275 */ u32 main_fw_type; /* 18e (2 = developer mode) */ - u32 vbt8; /* 192 recovery reason */ - u32 vbt9; /* 196 fmap base address */ + u32 recovery_reason; /* 192 recovery reason */ + u32 fmap_base; /* 196 fmap base address */ u8 vdat[3072]; /* 19a VDAT space filled by verified boot */ - u32 vbt10; /* d9a smbios bios version */ + u32 fwid_ptr; /* d9a smbios bios version */ u32 mehh[8]; /* d9e management engine hash */ u32 ramoops_base; /* dbe ramoops base address */ u32 ramoops_len; /* dc2 ramoops length */ From patchwork Sun Jan 24 17:06:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1430941 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=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=PY+HuV21; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DNzwR5qZzz9sWX for ; Mon, 25 Jan 2021 04:08:23 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E92C482800; Sun, 24 Jan 2021 18:07:02 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="PY+HuV21"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CF55B827F8; Sun, 24 Jan 2021 18:06:53 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 24317827B7 for ; Sun, 24 Jan 2021 18:06:51 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-pf1-x429.google.com with SMTP id y205so7017551pfc.5 for ; Sun, 24 Jan 2021 09:06:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nKe5nrx8sOh4ZICMlT7fEqUw01kn/Qpzq3HUbkh3Jpc=; b=PY+HuV21SKjdFNhEahMOMHg2l28YwfOPkZPpaWQQXiTqoELEFjqj1QekUN/JymKQr2 cVq5T03S7Pfij2ONH6ycB+1rO+iMczFHzJAnzd6SllHojiHqL8TVtYdey5ICS3Wpa5gE wNUkWKtrgUWw3h3NbI38mrvXZRPyJLu77AWs4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nKe5nrx8sOh4ZICMlT7fEqUw01kn/Qpzq3HUbkh3Jpc=; b=jnEcuAwj7L3lgaioLnKquLkWCITcCwo8zsOeNcfOfBKEi7cWDf/R3lMPIKrpVn+MPs b2uLOns1bqDbWCaVHl/Ay9kMXE3QCeISd2ZZZgGL/G8xhY8toktNSWzKN51LOgV/4+2H mmgx/nl8juONwurNizCajLFN8QfslhwaSH5iz0FNpPukFPTyhZNw+EykSVjxR7IQZKIR +i67F+tl7D/fbtgMjDphkcfy0VNCa9CobW0VspySz2PBoIQ8JX72JES0mn3IM/RwKI2W xiU6OUpGhKGGZ3gyKV/gTeI+L3yO/lXP/kNUv+eEdK4h/V4rgCXcFCZnopfd5LKkM+PT yd2A== X-Gm-Message-State: AOAM531xmXaIU/TQn5NQx6fM3sXFd4U8s1ZYDZDwfHG/VuUp6XWaRsDO WRcS6VXBUto/l7JHzyMRjag9hBrmVigOql17 X-Google-Smtp-Source: ABdhPJywxYbksj2c0b0WQP9cRWpKagjOZX3GGNmMROgE+xuenrGHcrYwQbv9mpy2duCbKTdXKLX4eQ== X-Received: by 2002:a63:4b5c:: with SMTP id k28mr1025661pgl.294.1611508009433; Sun, 24 Jan 2021 09:06:49 -0800 (PST) Received: from sjg1.home ([2600:6c4c:507f:f8e5:0:ec6e:a61e:6ad]) by smtp.gmail.com with ESMTPSA id jx15sm15559193pjb.17.2021.01.24.09.06.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Jan 2021 09:06:48 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Andy Shevchenko , Simon Glass Subject: [PATCH v2 07/12] x86: zimage: Allow dumping the image from outside the module Date: Sun, 24 Jan 2021 10:06:08 -0700 Message-Id: <20210124100608.v2.7.I4cbe2bb13efa1af25d22b7d3ada88be0dc01b9a6@changeid> X-Mailer: git-send-email 2.30.0.280.ga3ce27912f-goog In-Reply-To: <20210124170613.3434824-1-sjg@chromium.org> References: <20210124170613.3434824-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean At present it is possible to dump an image within the zimage command, but it is also useful to be able to dump it from elsewhere, for example in a loader that has special handling for the different zimage stages. Export this feature as a new function. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v1) arch/x86/include/asm/zimage.h | 10 ++++++++++ arch/x86/lib/zimage.c | 23 +++++++++++++++-------- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/arch/x86/include/asm/zimage.h b/arch/x86/include/asm/zimage.h index 64c0e6e857b..6679767d16b 100644 --- a/arch/x86/include/asm/zimage.h +++ b/arch/x86/include/asm/zimage.h @@ -62,6 +62,16 @@ struct boot_params *load_zimage(char *image, unsigned long kernel_size, int setup_zimage(struct boot_params *setup_base, char *cmd_line, int auto_boot, ulong initrd_addr, ulong initrd_size, ulong cmdline_force); +/** + * zimage_dump() - Dump the metadata of a zimage + * + * This shows all available information in a zimage that has been loaded. + * + * @base_ptr: Pointer to the boot parameters, typically at address + * DEFAULT_SETUP_BASE + */ +void zimage_dump(struct boot_params *base_ptr); + void setup_video(struct screen_info *screen_info); void setup_efi_info(struct efi_info *efi_info); diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c index 708025b2071..3e9ee12400f 100644 --- a/arch/x86/lib/zimage.c +++ b/arch/x86/lib/zimage.c @@ -600,19 +600,12 @@ static void show_loader(struct setup_header *hdr) printf("\n"); } -int do_zboot_dump(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) +void zimage_dump(struct boot_params *base_ptr) { - struct boot_params *base_ptr = state.base_ptr; struct setup_header *hdr; const char *version; int i; - if (argc > 1) - base_ptr = (void *)simple_strtoul(argv[1], NULL, 16); - if (!base_ptr) { - printf("No zboot setup_base\n"); - return CMD_RET_FAILURE; - } printf("Setup located at %p:\n\n", base_ptr); print_num64("ACPI RSDP addr", base_ptr->acpi_rsdp_addr); @@ -688,6 +681,20 @@ int do_zboot_dump(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) print_num("Handover offset", hdr->handover_offset); if (get_boot_protocol(hdr, false) >= 0x215) print_num("Kernel info offset", hdr->kernel_info_offset); +} + +static int do_zboot_dump(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) +{ + struct boot_params *base_ptr = state.base_ptr; + + if (argc > 1) + base_ptr = (void *)simple_strtoul(argv[1], NULL, 16); + if (!base_ptr) { + printf("No zboot setup_base\n"); + return CMD_RET_FAILURE; + } + zimage_dump(base_ptr); return 0; } From patchwork Sun Jan 24 17:06:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1430942 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=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=gv8OyaJ4; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DNzwf5yZnz9sCq for ; Mon, 25 Jan 2021 04:08:34 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 756AA82808; Sun, 24 Jan 2021 18:07:04 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="gv8OyaJ4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5F4D982820; Sun, 24 Jan 2021 18:06:55 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B812282748 for ; Sun, 24 Jan 2021 18:06:52 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-pj1-x102e.google.com with SMTP id gx1so1329963pjb.1 for ; Sun, 24 Jan 2021 09:06:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NTHySBFIN/nHW/WO25P3cmu0K3dfVddFXrBcpsZ9Tx8=; b=gv8OyaJ4y06IshheV8r1PFQrVEA2LNsLw+25JknNF1NeBC9hadGuO+z/OFyhl+wO/S VvS49DdSt59fX396wHP/X8CogeknSepHD9HMh9xxqaAWg4eKKu6TrcN0kzsVeqbfilef p7jWjqlhCkaL3p0Mexjsl4uD4feRXedBfUjnk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NTHySBFIN/nHW/WO25P3cmu0K3dfVddFXrBcpsZ9Tx8=; b=M8qhmsh7bDsBaAEwN1k91kwDyG1bjQWvEflzmy/kPthAYwZfR7dk2B+SOnu7hVmO5n pMgQ5gPvUTmON9QLfgtGjMy1ZN1dHPsFaPItiZm7Sjk3NZNMU9FfNlxDXyc5KW/FWwd+ R/J3c3B9AjVZlWcyRzGyQK13U4wjAw52ZdGejNaKIeHCfNtLdwy/E3mYrrqXj7mx+2ys UM3m+tV9XQZIEBA4MVXkNk9w65Rb874H2Ycfr3/vluczgEwz1idhPrHNIUY3yxrVjUiM pn8ZGX+SSO4tWPKyUti0CpHGhJ6TPVcTreCVkWWTI4y9Jj25nF3/H5y6ZKawILtmIZgR 6tnA== X-Gm-Message-State: AOAM532Lxm167Dew75T6U8rYkorHVI/zwkoRn7zwDsjH7RuHUpq880O6 g/VOQgCVWpEYj5veiF4XvisTleEPJNU5E219 X-Google-Smtp-Source: ABdhPJzJPYzWgZC+52hQIrVEloUTpZFj45LnVBXMeVXVcVpoFWUkFc8rMre9ymcLDf3ERX6NnmvlYQ== X-Received: by 2002:a17:902:d64e:b029:df:e5b1:b7f7 with SMTP id y14-20020a170902d64eb02900dfe5b1b7f7mr2078801plh.10.1611508011133; Sun, 24 Jan 2021 09:06:51 -0800 (PST) Received: from sjg1.home ([2600:6c4c:507f:f8e5:0:ec6e:a61e:6ad]) by smtp.gmail.com with ESMTPSA id jx15sm15559193pjb.17.2021.01.24.09.06.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Jan 2021 09:06:50 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Andy Shevchenko , Simon Glass Subject: [PATCH v2 08/12] x86: zimage: Improve command-line debug handling Date: Sun, 24 Jan 2021 10:06:09 -0700 Message-Id: <20210124100608.v2.8.I5c2b2cfb6dab027e5331a06e3c55b5e1d57720ce@changeid> X-Mailer: git-send-email 2.30.0.280.ga3ce27912f-goog In-Reply-To: <20210124170613.3434824-1-sjg@chromium.org> References: <20210124170613.3434824-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean At present if the command line is very long it is truncated by the printf() statement, which works within a limited buffer. Use puts() instead. Also show better debugging with the command-line setup fails. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v1) arch/x86/lib/zimage.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c index 3e9ee12400f..602788e016d 100644 --- a/arch/x86/lib/zimage.c +++ b/arch/x86/lib/zimage.c @@ -109,8 +109,11 @@ static void build_command_line(char *command_line, int auto_boot) if (env_command_line) strcat(command_line, env_command_line); - - printf("Kernel command line: \"%s\"\n", command_line); +#ifdef DEBUG + printf("Kernel command line:"); + puts(command_line); + printf("\n"); +#endif } static int kernel_magic_ok(struct setup_header *hdr) @@ -354,7 +357,8 @@ int setup_zimage(struct boot_params *setup_base, char *cmd_line, int auto_boot, build_command_line(cmd_line, auto_boot); ret = bootm_process_cmdline(cmd_line, max_size, BOOTM_CL_ALL); if (ret) { - printf("Cmdline setup failed (err=%d)\n", ret); + printf("Cmdline setup failed (max_size=%x, bootproto=%x, err=%d)\n", + max_size, bootproto, ret); return ret; } printf("Kernel command line: \""); From patchwork Sun Jan 24 17:06:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1430943 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=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=jaNEdumz; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DNzwt4kpGz9sCq for ; Mon, 25 Jan 2021 04:08:46 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8A81F82845; Sun, 24 Jan 2021 18:07:05 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="jaNEdumz"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D111C8283B; Sun, 24 Jan 2021 18:06:57 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7CCEB827F8 for ; Sun, 24 Jan 2021 18:06:54 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-pl1-x631.google.com with SMTP id x18so6149380pln.6 for ; Sun, 24 Jan 2021 09:06:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fv+mbCBxafk+2ZJjCmnsVWgM61n16aw2vQX2YIAMwXI=; b=jaNEdumz0C4cYxdTg91VaOBz6a32MFWkigLV301iksMUovDMdrCjURLXltaV23XDZL BDziL+Prh0rOEVzoxFezNQU+VQ7MlW9kPsBjQFO/dkA6vQMrNTs6w5rQ0W8N9so+Tn5v ZhIMzlnZi2jdpFj/dN4RNgbiz8R2DQG4vXHoo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fv+mbCBxafk+2ZJjCmnsVWgM61n16aw2vQX2YIAMwXI=; b=oaG9CudXoKGaRbSyZU+e4LKSXO88TiXP4doUJ/bdfg+Z2L4GLRvoOPmuw7gCSMWfdi cnZ832JDcH5mvaoSvY5ZgZnsgQLOdZuETLLGLrRdsbVD8Dqp23BRplCYL6ozzuBzVFy1 sMXNbRXFCGZSrYfphB67YeqPlNkAgsF4rWRQxwGy6CuLUOueDN6Q5WTLZ3K458OeQQU+ o1SBICF4udByf/rgTDBERIP3RdHqCSxQuUih4QO0TjfpyZqe3b2hII0jdkfh0bqe2nPQ UfrXnbVa5aUOqcNjJm1lI3rek6ON+HXzIS/LETho5IJJ1sAiOxmXA7459bvFWVhdy3lP Ty7Q== X-Gm-Message-State: AOAM531O5XqvOmAhQdBcRaeqnaHRNkXurukoijU9/7+NiR6GddwJp9X8 MnVjXW5M3hbCOZTqQf6lmnLbvvja5MZANGCA X-Google-Smtp-Source: ABdhPJxsHUShpaBGZnmXRcQB7a84VW1eOmBLSGc12I/AtScWmPSxSypaMugSiqMXVuUfsWRTwzI33g== X-Received: by 2002:a17:902:9683:b029:de:b0ba:dc86 with SMTP id n3-20020a1709029683b02900deb0badc86mr15832323plp.9.1611508012873; Sun, 24 Jan 2021 09:06:52 -0800 (PST) Received: from sjg1.home ([2600:6c4c:507f:f8e5:0:ec6e:a61e:6ad]) by smtp.gmail.com with ESMTPSA id jx15sm15559193pjb.17.2021.01.24.09.06.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Jan 2021 09:06:52 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Andy Shevchenko , Simon Glass Subject: [PATCH v2 09/12] x86: spl: Clear BSS unconditionally Date: Sun, 24 Jan 2021 10:06:10 -0700 Message-Id: <20210124100608.v2.9.I4b95684e6aab3bd37291a7c679f621e9f8676a4c@changeid> X-Mailer: git-send-email 2.30.0.280.ga3ce27912f-goog In-Reply-To: <20210124170613.3434824-1-sjg@chromium.org> References: <20210124170613.3434824-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean This should be done even if not using TPL, since BSS may be in use or boards that only use SPL. Fix it. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v1) 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 cf22fa2d7b5..6699de49c63 100644 --- a/arch/x86/lib/spl.c +++ b/arch/x86/lib/spl.c @@ -115,8 +115,8 @@ static int x86_spl_init(void) } #ifndef CONFIG_SYS_COREBOOT -# ifndef CONFIG_TPL memset(&__bss_start, 0, (ulong)&__bss_end - (ulong)&__bss_start); +# ifndef CONFIG_TPL /* TODO(sjg@chromium.org): Consider calling cpu_init_r() here */ ret = interrupt_init(); From patchwork Sun Jan 24 17:06:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1430944 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=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=HLLPB8BP; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DNzx45htTz9sCq for ; Mon, 25 Jan 2021 04:08:56 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 82B7A8286B; Sun, 24 Jan 2021 18:07:06 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="HLLPB8BP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BC26F82799; Sun, 24 Jan 2021 18:06:58 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 221EA82826 for ; Sun, 24 Jan 2021 18:06:56 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-pf1-x431.google.com with SMTP id m6so7014310pfm.6 for ; Sun, 24 Jan 2021 09:06:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hHaRB9YvmaMhrm7hoqQK4CflOaSSS0qu8hGsbtwJe5k=; b=HLLPB8BPTTUEDChxn1IRhqRoZoaLKTm6ycBq5rRvdKdTCQ0iLI0/bv6mIJx7irOUm6 SLwVsICWUL3GCeWCr0h9cfZpT87rh/0ck3/tbZrbjazL7IlwIPrh7Mel/VkTfNezNnU7 9IWetcbNGX+C8pJ5FblEkXnH//GnJrDDrarN0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hHaRB9YvmaMhrm7hoqQK4CflOaSSS0qu8hGsbtwJe5k=; b=SjpEi2peP5pnOoc7W1FMi1e6aJSg6bLleg9pk1UsQH+L2s5eXO22VbdSvVaSR1t+Dp JpuEvYQAg1vJ4xSKZheu3hANG+iDeECT+uqspWyuq05nw/lRHeAdYGgu21pYVXmG+5U8 09r4LffkASSqP7ceZEGBILIfnoquXI1sFZe9KajX+2LDZ5uBmozt+EYhOnsmTqM1ygpK qceNl/w1rSX4jgmQgZFKsBIkPtTpKbhWkXbXQyy2/BZ1Y9+ZB41C5QeYIFy+jK05tU73 +eEq/sJwwFYKcQyJJXe4z2gOosnYVO+NCK4eARwrDPKOA0lAqeEan/mcN5HFXIfgT3ne ivlw== X-Gm-Message-State: AOAM530cyYezOUB3spHdppDitzMwREttnjWowd1uNbkVMk7nVGL73L6e DFLMchyC9780fOsIgz8oMy6iQNTKFeG9PGHL X-Google-Smtp-Source: ABdhPJyrmRmTSkWKnCmavjONAcLWPQpmKK/MQYTt0QeXzTKR+LTi1CQqliLxZVU/1SrFfIXAdswFBg== X-Received: by 2002:a65:5ac1:: with SMTP id d1mr412723pgt.447.1611508014505; Sun, 24 Jan 2021 09:06:54 -0800 (PST) Received: from sjg1.home ([2600:6c4c:507f:f8e5:0:ec6e:a61e:6ad]) by smtp.gmail.com with ESMTPSA id jx15sm15559193pjb.17.2021.01.24.09.06.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Jan 2021 09:06:54 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Andy Shevchenko , Simon Glass Subject: [PATCH v2 10/12] x86: tpl: Show next stage being booted Date: Sun, 24 Jan 2021 10:06:11 -0700 Message-Id: <20210124100608.v2.10.I4fc555abb2742270d29545815240dee426b378e5@changeid> X-Mailer: git-send-email 2.30.0.280.ga3ce27912f-goog In-Reply-To: <20210124170613.3434824-1-sjg@chromium.org> References: <20210124170613.3434824-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Enhance the debugging to show the next stage being booted as well as a dump of the start of the image. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v1) arch/x86/lib/tpl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/x86/lib/tpl.c b/arch/x86/lib/tpl.c index 04ff32277fd..c84a0c9bc7d 100644 --- a/arch/x86/lib/tpl.c +++ b/arch/x86/lib/tpl.c @@ -111,7 +111,12 @@ int spl_spi_load_image(void) void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image) { - debug("Jumping to U-Boot SPL at %lx\n", (ulong)spl_image->entry_point); + debug("Jumping to %s at %lx\n", spl_phase_name(spl_next_phase()), + (ulong)spl_image->entry_point); +#ifdef DEBUG + print_buffer(spl_image->entry_point, (void *)spl_image->entry_point, 1, + 0x20, 0); +#endif jump_to_spl(spl_image->entry_point); hang(); } From patchwork Sun Jan 24 17:06:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1430945 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=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=bKnZYV1U; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DNzxG5Xkrz9sCq for ; Mon, 25 Jan 2021 04:09:06 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 58F338287F; Sun, 24 Jan 2021 18:07:07 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="bKnZYV1U"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 58DCE827DA; Sun, 24 Jan 2021 18:07:00 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id AE1DD82805 for ; Sun, 24 Jan 2021 18:06:57 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-pj1-x102b.google.com with SMTP id md11so6881360pjb.0 for ; Sun, 24 Jan 2021 09:06:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CJXlcb+QITV9gpHqEoMlXN76bdrq4KLuN0MXZ0F2kTc=; b=bKnZYV1URo0jxjX6bubXar6w87TkVxy0jdLhiaKouc+ndF2kPw2B0OhsdxpVLHqCOg om5yODuIH5N8ZD2H3uWZpVvSuL/MLOjbQYv/0pfXhJyioOGOtkSwZCjMBn5zW3qq10sT 9baH6fCaTj1SriMxLkQc8GYwTF1eYOudrXGKU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CJXlcb+QITV9gpHqEoMlXN76bdrq4KLuN0MXZ0F2kTc=; b=iBiQv5P/LjicPun1LtWRhYeOuh9XauM7IIpkRaIEt8BMkOxdlpHqFKAFJJ644dqwei 9RiC0Zu1sJHACX72yi4PMxtueN036Bi8xmmQkzIbzgF/kZUq+HdznyxUWV6W3WXjcA5o /dx7+CR2C725dfoEr+1ZdjyegOC6b4TAxLva7qM2MEqsBc7zf0REKKXrqtpi7VeOJ8RB iQQUiIAS0DQwtakyQK5isoHOygdOqCDT0xFoQK6vzLKYaf/tbFR0f7NGeVRh0eWRToBc 5YF3rByfWpJQuyaZ201cAkQ+K+sSMwmXuvfcXdHmiFQ23EABP69Dd1moOUVPIrHIXqfL WyEQ== X-Gm-Message-State: AOAM533afJcpkNde2y4U6m8DzsanIysAvk0iRTldC5IBmro41j8ZLldR 9rHO5M9DwN0bKROn9CXcPrv3KJCoUC1tHHi4 X-Google-Smtp-Source: ABdhPJxYgXLcZ4+Yk9rT9/3VuwditEyG4nCsKnr/MogIB2PGsaoiXK+zrcFm6aRQA5LhI/hoH54GaQ== X-Received: by 2002:a17:90a:5b:: with SMTP id 27mr3508966pjb.207.1611508016121; Sun, 24 Jan 2021 09:06:56 -0800 (PST) Received: from sjg1.home ([2600:6c4c:507f:f8e5:0:ec6e:a61e:6ad]) by smtp.gmail.com with ESMTPSA id jx15sm15559193pjb.17.2021.01.24.09.06.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Jan 2021 09:06:55 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Andy Shevchenko , Simon Glass Subject: [PATCH v2 11/12] sysinfo: Allow showing model info from sysinfo Date: Sun, 24 Jan 2021 10:06:12 -0700 Message-Id: <20210124100608.v2.11.I93d883230fabc88c1e9fd95d72d497069b2c60e9@changeid> X-Mailer: git-send-email 2.30.0.280.ga3ce27912f-goog In-Reply-To: <20210124170613.3434824-1-sjg@chromium.org> References: <20210124170613.3434824-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Some boards may want to show the SKU ID or other information obtained at runtime. Allow this to come from sysinfo. The board can then provide a sysinfo driver to provide it. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v1) common/board_info.c | 37 +++++++++++++++++++++++++++++-------- include/sysinfo.h | 4 ++++ 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/common/board_info.c b/common/board_info.c index a6db087f960..20a2dea1f35 100644 --- a/common/board_info.c +++ b/common/board_info.c @@ -1,30 +1,51 @@ // SPDX-License-Identifier: GPL-2.0+ #include +#include #include +#include #include #include +DECLARE_GLOBAL_DATA_PTR; + int __weak checkboard(void) { return 0; } /* - * If the root node of the DTB has a "model" property, show it. + * Check sysinfo for board information. Failing that if the root node of the DTB + * has a "model" property, show it. + * * Then call checkboard(). */ int __weak show_board_info(void) { -#ifdef CONFIG_OF_CONTROL - DECLARE_GLOBAL_DATA_PTR; - const char *model; + if (IS_ENABLED(CONFIG_OF_CONTROL)) { + struct udevice *dev; + const char *model; + char str[80]; + int ret = -ENOSYS; + + if (IS_ENABLED(CONFIG_SYSINFO)) { + /* This might provide more detail */ + ret = uclass_first_device_err(UCLASS_SYSINFO, &dev); + if (!ret) + ret = sysinfo_get_str(dev, + SYSINFO_ID_BOARD_MODEL, + sizeof(str), str); + } - model = fdt_getprop(gd->fdt_blob, 0, "model", NULL); + /* Fail back to the main 'model' if available */ + if (ret) + model = fdt_getprop(gd->fdt_blob, 0, "model", NULL); + else + model = str; - if (model) - printf("Model: %s\n", model); -#endif + if (model) + printf("Model: %s\n", model); + } return checkboard(); } diff --git a/include/sysinfo.h b/include/sysinfo.h index 743f3554659..f4ffb1a3503 100644 --- a/include/sysinfo.h +++ b/include/sysinfo.h @@ -35,9 +35,13 @@ enum sysinfo_id { SYSINFO_ID_NONE, + /* For SMBIOS tables */ SYSINFO_ID_SMBIOS_SYSTEM_VERSION, SYSINFO_ID_SMBIOS_BASEBOARD_VERSION, + /* For show_board_info() */ + SYSINFO_ID_BOARD_MODEL, + /* First value available for downstream/board used */ SYSINFO_ID_USER = 0x1000, }; From patchwork Sun Jan 24 17:06:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1430946 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=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=SOFjxTj7; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DNzxS5Qykz9sCq for ; Mon, 25 Jan 2021 04:09:16 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 437F2827A6; Sun, 24 Jan 2021 18:07:14 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="SOFjxTj7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 249CB827DA; Sun, 24 Jan 2021 18:07:03 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8282382748 for ; Sun, 24 Jan 2021 18:06:59 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-pf1-x433.google.com with SMTP id q20so7004878pfu.8 for ; Sun, 24 Jan 2021 09:06:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+gUl/IhzYeg9r1T+fBXS+wIkEyNtEvxAEAKPdEqi7ZQ=; b=SOFjxTj7D73j1W81d+u3xXTmTmq4GfEiWJmxxvVSnO3Y7yTGoQgT8D9utl7gHgl4s+ o78X4Xhxrq+VG/T0Xkc9lYscG1L8oBAPKs20ghqVVInSKnl3LfooWGd9nNglUJ+yy+gO t98oJSdvZTRceeuw2BvUkl2ZTIgMtnJwaphWw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+gUl/IhzYeg9r1T+fBXS+wIkEyNtEvxAEAKPdEqi7ZQ=; b=mlH/AZv8bOb+ujXcAsx9DSxP+vwxssIVdzO6n8AmTdIAWUJwMLHAtHzmgMX+ngiXHk fOZTheXFDfcTdxDO0l087z77G61l8OP/GJAUHuGWppTYza6vROkZ8hvoQhdEuMzUvoCA iNzEilm77R490JpdSZqME98W1mvX6f7GPKsbLvUbmj1njV6CBOtTgdgtA761VuHzBVtE Kr34fM/XZg4lozzfj6/FWYCmfJGx4CnQPSgI3JDhZaWTR+H8rJq0ONKbuno0tAPTMwLV s8KEtulgdNdIUZG7DOM/WEoP2qvlXS34OIdp7/aLSPgpohiMPRzDaKjwk+l/r8A8/Wh/ pYKA== X-Gm-Message-State: AOAM5330c05NyjDPRGIKid52CdJbDGRxSOYmrEG3/eq5qvBwS/GePNnW mTXEIh4It46WrF9A6zKWtFig7nIX//ynCOOU X-Google-Smtp-Source: ABdhPJz+FO/03NoUYmuPu5EBDD8oTZxjNrMDbj4lYj0W43nc5odVsSB7KjYmV7/4caMZOxDRemioew== X-Received: by 2002:a63:f34f:: with SMTP id t15mr4887667pgj.239.1611508017730; Sun, 24 Jan 2021 09:06:57 -0800 (PST) Received: from sjg1.home ([2600:6c4c:507f:f8e5:0:ec6e:a61e:6ad]) by smtp.gmail.com with ESMTPSA id jx15sm15559193pjb.17.2021.01.24.09.06.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Jan 2021 09:06:57 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Andy Shevchenko , Simon Glass Subject: [PATCH v2 12/12] x86: coral: Show memory config and SKU ID on startup Date: Sun, 24 Jan 2021 10:06:13 -0700 Message-Id: <20210124170613.3434824-2-sjg@chromium.org> X-Mailer: git-send-email 2.30.0.280.ga3ce27912f-goog In-Reply-To: <20210124170613.3434824-1-sjg@chromium.org> References: <20210124170613.3434824-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Provide the model information through sysinfo so that it shows up on boot. For memconfig 4 pins are provided, for 16 combinations. For SKU ID there are two options: - two pins provided in a ternary arrangement, for 9 combinations. - reading from the EC Add a binding doc and drop the unused #defines as well. Example: U-Boot 2021.01-rc5 CPU: Intel(R) Celeron(R) CPU N3450 @ 1.10GHz DRAM: 3.9 GiB MMC: sdmmc@1b,0: 1, emmc@1c,0: 2 Video: 1024x768x32 @ b0000000 Model: Google Coral (memconfig 5, SKU 3) Signed-off-by: Simon Glass Acked-by: Bin Meng --- Changes in v2: - Fix two missing asterisks in comments arch/x86/dts/chromebook_coral.dts | 11 ++ board/google/chromebook_coral/coral.c | 139 +++++++++++++++++- board/google/chromebook_coral/variant_gpio.h | 6 - .../sysinfo/google,coral.txt | 37 +++++ 4 files changed, 179 insertions(+), 14 deletions(-) create mode 100644 doc/device-tree-bindings/sysinfo/google,coral.txt diff --git a/arch/x86/dts/chromebook_coral.dts b/arch/x86/dts/chromebook_coral.dts index bfbdd517d1f..8ed7c02db91 100644 --- a/arch/x86/dts/chromebook_coral.dts +++ b/arch/x86/dts/chromebook_coral.dts @@ -54,6 +54,17 @@ recovery-gpios = <&gpio_nw (-1) GPIO_ACTIVE_LOW>; write-protect-gpios = <&gpio_nw GPIO_75 GPIO_ACTIVE_HIGH>; phase-enforce-gpios = <&gpio_n GPIO_10 GPIO_ACTIVE_HIGH>; + memconfig-gpios = <&gpio_nw GPIO_101 GPIO_ACTIVE_HIGH + &gpio_nw GPIO_102 GPIO_ACTIVE_HIGH + &gpio_n GPIO_38 GPIO_ACTIVE_HIGH + &gpio_n GPIO_45 GPIO_ACTIVE_HIGH>; + + /* + * This is used for reef only: + * + * skuconfig-gpios = <&gpio_nw GPIO_16 GPIO_ACTIVE_HIGH + * &gpio_nw GPIO_17 GPIO_ACTIVE_HIGH>; + */ smbios { /* Type 1 table */ system { diff --git a/board/google/chromebook_coral/coral.c b/board/google/chromebook_coral/coral.c index f9fb3f163f0..77a6cca4497 100644 --- a/board/google/chromebook_coral/coral.c +++ b/board/google/chromebook_coral/coral.c @@ -3,9 +3,12 @@ * Copyright 2019 Google LLC */ +#define LOG_CATEGORY UCLASS_SYSINFO + #include #include #include +#include #include #include #include @@ -15,6 +18,7 @@ #include #include #include +#include #include "variant_gpio.h" struct cros_gpio_info { @@ -29,10 +33,125 @@ int arch_misc_init(void) return 0; } -/* This function is needed if CONFIG_CMDLINE is not enabled */ -int board_run_command(const char *cmdline) +static int get_memconfig(struct udevice *dev) { - printf("No command line\n"); + struct gpio_desc gpios[4]; + int cfg; + int ret; + + ret = gpio_request_list_by_name(dev, "memconfig-gpios", gpios, + ARRAY_SIZE(gpios), + GPIOD_IS_IN | GPIOD_PULL_UP); + if (ret < 0) { + log_debug("Cannot get GPIO list '%s' (%d)\n", dev->name, ret); + return ret; + } + + /* Give the lines time to settle */ + udelay(10); + + ret = dm_gpio_get_values_as_int(gpios, ARRAY_SIZE(gpios)); + if (ret < 0) + return log_msg_ret("get", ret); + cfg = ret; + + ret = gpio_free_list(dev, gpios, ARRAY_SIZE(gpios)); + if (ret) + return log_msg_ret("free", ret); + + return cfg; +} + +/** + * get_skuconfig() - Get the SKU number either from pins or the EC + * + * Two options are supported: + * skuconfig-gpios - two pins in the device tree (tried first) + * EC - reading from the EC (backup) + * + * @dev: sysinfo device to use + * @return SKU ID, or -ve error if not found + */ +static int get_skuconfig(struct udevice *dev) +{ + struct gpio_desc gpios[2]; + int cfg; + int ret; + + ret = gpio_request_list_by_name(dev, "skuconfig-gpios", gpios, + ARRAY_SIZE(gpios), + GPIOD_IS_IN); + if (ret != ARRAY_SIZE(gpios)) { + struct udevice *cros_ec; + + log_debug("Cannot get GPIO list '%s' (%d)\n", dev->name, ret); + + /* Try the EC */ + ret = uclass_first_device_err(UCLASS_CROS_EC, &cros_ec); + if (ret < 0) { + log_err("Cannot find EC for SKU details\n"); + return log_msg_ret("sku", ret); + } + ret = cros_ec_get_sku_id(cros_ec); + if (ret < 0) { + log_err("Cannot read SKU details\n"); + return log_msg_ret("sku", ret); + } + + return ret; + } + + ret = dm_gpio_get_values_as_int_base3(gpios, ARRAY_SIZE(gpios)); + if (ret < 0) + return log_msg_ret("get", ret); + cfg = ret; + + ret = gpio_free_list(dev, gpios, ARRAY_SIZE(gpios)); + if (ret) + return log_msg_ret("free", ret); + + return cfg; +} + +static int coral_get_str(struct udevice *dev, int id, size_t size, char *val) +{ + int ret; + + if (IS_ENABLED(CONFIG_SPL_BUILD)) + return -ENOSYS; + + switch (id) { + case SYSINFO_ID_SMBIOS_SYSTEM_VERSION: + case SYSINFO_ID_SMBIOS_BASEBOARD_VERSION: { + ret = get_skuconfig(dev); + + if (ret < 0) + return ret; + if (size < 15) + return -ENOSPC; + sprintf(val, "rev%d", ret); + break; + } + case SYSINFO_ID_BOARD_MODEL: { + int mem_config, sku_config; + const char *model; + + ret = get_memconfig(dev); + if (ret < 0) + log_warning("Unable to read memconfig (err=%d)\n", ret); + mem_config = ret; + ret = get_skuconfig(dev); + if (ret < 0) + log_warning("Unable to read skuconfig (err=%d)\n", ret); + sku_config = ret; + model = fdt_getprop(gd->fdt_blob, 0, "model", NULL); + snprintf(val, size, "%s (memconfig %d, SKU %d)", model, + mem_config, sku_config); + break; + } + default: + return -ENOENT; + } return 0; } @@ -45,12 +164,15 @@ int chromeos_get_gpio(const struct udevice *dev, const char *prop, int ret; ret = gpio_request_by_name((struct udevice *)dev, prop, 0, &desc, 0); - if (ret == -ENOTBLK) + if (ret == -ENOTBLK) { info->gpio_num = CROS_GPIO_VIRTUAL; - else if (ret) + log_debug("GPIO '%s' is virtual\n", prop); + } else if (ret) { return log_msg_ret("gpio", ret); - else + } else { info->gpio_num = desc.offset; + dm_gpio_free((struct udevice *)dev, &desc); + } info->linux_name = dev_read_string(desc.dev, "linux-name"); if (!info->linux_name) return log_msg_ret("linux-name", -ENOENT); @@ -81,11 +203,11 @@ static int chromeos_acpi_gpio_generate(const struct udevice *dev, ret = chromeos_get_gpio(dev, "write-protect-gpios", CROS_GPIO_WP, &info[1]); if (ret) - return log_msg_ret("rec", ret); + return log_msg_ret("wp", ret); ret = chromeos_get_gpio(dev, "phase-enforce-gpios", CROS_GPIO_PE, &info[2]); if (ret) - return log_msg_ret("rec", ret); + return log_msg_ret("phase", ret); acpigen_write_scope(ctx, "\\"); acpigen_write_name(ctx, "OIPG"); acpigen_write_package(ctx, count); @@ -145,6 +267,7 @@ struct acpi_ops coral_acpi_ops = { }; struct sysinfo_ops coral_sysinfo_ops = { + .get_str = coral_get_str, }; #if !CONFIG_IS_ENABLED(OF_PLATDATA) diff --git a/board/google/chromebook_coral/variant_gpio.h b/board/google/chromebook_coral/variant_gpio.h index f516d88be5c..403e2419a71 100644 --- a/board/google/chromebook_coral/variant_gpio.h +++ b/board/google/chromebook_coral/variant_gpio.h @@ -34,12 +34,6 @@ /* Determine if board is in final shipping mode. */ #define GPIO_SHIP_MODE GPIO_10 -/* Memory SKU GPIOs. */ -#define MEM_CONFIG3 GPIO_45 -#define MEM_CONFIG2 GPIO_38 -#define MEM_CONFIG1 GPIO_102 -#define MEM_CONFIG0 GPIO_101 - /* DMIC_CONFIG_PIN: High for 1-DMIC and low for 4-DMIC's */ #define DMIC_CONFIG_PIN GPIO_17 diff --git a/doc/device-tree-bindings/sysinfo/google,coral.txt b/doc/device-tree-bindings/sysinfo/google,coral.txt new file mode 100644 index 00000000000..d8a1a79687e --- /dev/null +++ b/doc/device-tree-bindings/sysinfo/google,coral.txt @@ -0,0 +1,37 @@ +Google Coral sysinfo information +================================ + +This binding allows information about the board to be described. It includes +the SMBIOS binding as well. + +Required properties: + + - compatible: "google,coral" + - recovery-gpios: GPIO to use for recovery button (-1 if none) + - wite-protect-gpios: GPIO to use for write-protect screw + - phase-enforce-gpios: GPIO to indicate the board is in final ship mode + - memconfig-gpios: 4 GPIOs to use to read memory config (as base2 int) + +Optional properties: + - skuconfig-gpios: 2 GPIOs to use to read SKU ID. If not present, the + Chromium OS EC SKU_ID is used instead + +Example: + +board: board { + compatible = "google,coral"; + recovery-gpios = <&gpio_nw (-1) GPIO_ACTIVE_LOW>; + write-protect-gpios = <&gpio_nw GPIO_75 GPIO_ACTIVE_HIGH>; + phase-enforce-gpios = <&gpio_n GPIO_10 GPIO_ACTIVE_HIGH>; + memconfig-gpios = <&gpio_nw GPIO_101 GPIO_ACTIVE_HIGH + &gpio_nw GPIO_102 GPIO_ACTIVE_HIGH + &gpio_n GPIO_38 GPIO_ACTIVE_HIGH + &gpio_n GPIO_45 GPIO_ACTIVE_HIGH>; + + /* + * This is used for reef only: + * + * skuconfig-gpios = <&gpio_nw GPIO_16 GPIO_ACTIVE_HIGH + * &gpio_nw GPIO_17 GPIO_ACTIVE_HIGH>; + */ + };