From patchwork Sat Jan 16 21:53:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1427617 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=R+RgUb2J; 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 4DJBhc1xdKz9s24 for ; Sun, 17 Jan 2021 08:56:32 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 69480829C6; Sat, 16 Jan 2021 22:54:13 +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="R+RgUb2J"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1FE65829B1; Sat, 16 Jan 2021 22:54:08 +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-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) (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 AA22B829C6 for ; Sat, 16 Jan 2021 22:54: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=sjg@chromium.org Received: by mail-io1-xd36.google.com with SMTP id q2so23736306iow.13 for ; Sat, 16 Jan 2021 13:54:04 -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=5FabnQh8mHFRjdFUWID+J00GJs0ZJeTUokY4j/4PmdQ=; b=R+RgUb2Jj9EDjtfuVgDfef2IWSLM8VugTj5XyXVKc08CnK26ogt1Gkw+X17q3m9TOU SAY2jV/SXJ/Xr6vQyI8vHsyuNFMkMjjLJmmuVvb6ApnGYKe0GOrHhonMGlS0rNUAVPjf w5W5NsmXEDCdETzSJJarMzZnUOuA7NTvXmfvA= 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=5FabnQh8mHFRjdFUWID+J00GJs0ZJeTUokY4j/4PmdQ=; b=lRG6EYJ6Upz1g4WPP1zMEE3pJXFL6xaSS+71xvpnQ4Ubj8iKtgtvbPThtF0KAo/pEs xpAEFJqTZGJ1ZbzNpGoET00X1L1T1Vpoc1EdHgln6dsKU8MHW4GgAjqbBWe5jC4Ucm4s RBIrUFL8Ud2eYgpxGE1OfoTXtTcx9geFfxlWTRlJUFjWYlZaCOZ097IwVdluAaz/v6WG PECsJNRu1dx7hgJZppEReCwGd2X9ZRLPydKDXwsFfk75xFKOKNkJcxudQCNZfKBZZynJ 7/3rRgphwNLEO8/yeZE2r0T+WlxTZx6/SVdBYBUL+IUmULKsh38TXafyHCXDr9D5SVhM 9LUQ== X-Gm-Message-State: AOAM530mWXZ0kMNEGmuG0nga8sFoMgvJTzUbocp3qrDQmd/VXDhLJSBl cN4M8J2Dn++bQJ5iV+9a+IBpAvM5qGYb7bfP X-Google-Smtp-Source: ABdhPJxVfHngjrgHO0F/ehUy4VlIiv6wJe0G1c6t8wNew9uaZ0/HDXU14SJp+aXtqQxxyMkzx6xhtg== X-Received: by 2002:a6b:d20d:: with SMTP id q13mr12826551iob.71.1610834043400; Sat, 16 Jan 2021 13:54:03 -0800 (PST) Received: from localhost.localdomain (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id a17sm7428746ilc.77.2021.01.16.13.54.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Jan 2021 13:54:02 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Heinrich Schuchardt , Bernhard Messerklinger , Wolfgang Wallner , Walter Lozano , Simon Glass , Bin Meng Subject: [PATCH 01/12] x86: acpi_gpe: Update driver name to match devicetree Date: Sat, 16 Jan 2021 14:53:48 -0700 Message-Id: <20210116145343.1.I87d41cd95212f8a8f7c601b00cd64d5192a73f8e@changeid> X-Mailer: git-send-email 2.30.0.284.gd98b1dd5eaa7-goog In-Reply-To: <20210116215359.1220766-1-sjg@chromium.org> References: <20210116215359.1220766-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 --- 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 Sat Jan 16 21:53:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1427619 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=NveE35w3; 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 4DJBhp6wJwz9sWT for ; Sun, 17 Jan 2021 08:56:42 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 28753829FE; Sat, 16 Jan 2021 22:54:16 +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="NveE35w3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8AE21829DD; Sat, 16 Jan 2021 22:54:10 +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-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) (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 EA5F7829BC for ; Sat, 16 Jan 2021 22:54: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=sjg@chromium.org Received: by mail-io1-xd31.google.com with SMTP id e22so1712729iog.6 for ; Sat, 16 Jan 2021 13:54:05 -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=ksFsUbr2VUuYdi+U0bG0gU0feQCuyXMMlznTM1DNvr8=; b=NveE35w3GiMJRsJXqmjJPiFk48c34a4e+C6nc/RlkU541147LCBmEOIYXhyRp8YcgD l6hiIGGcyzKUhvmG9aB8dZGJyekn5QyegLfEdyaJd5TuQxvgpO8gZJFVHkDSvWHMdKKw wIbPnqIoOXtzHqEGdHX9bmHvd9311g8U+c+8c= 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=ksFsUbr2VUuYdi+U0bG0gU0feQCuyXMMlznTM1DNvr8=; b=N4q/S7J9HvxutW5UwOZlY3VNwXs69P4L6zD9bnilnvjFVkSnuSC5ZySgIiIkzelpGO HLIkSVX+u7vhvJKQ6UrBT3I3moSnoiYk7BAPiyYfq/AItopc6exVZMv76WD6+YwP8V9f PK6G2eTGhZKICmkeLdfxoJu0xh3DWe3JSOCnEubEhS+Z59WtkvOM17pIS3IHXH/UPt0I yZGowvZO8ohEu8khzBqDm7Q4nunAQ/7qjSqVOsqzhNgGjcKLiN4pG46OOtm65fm45n5/ HAwdxsYd+MfZahMNsp/S6SEpnUfIJO6+C7Cq64+kfuXqStzgr3xKaClsuRGRmVxostDg PBDg== X-Gm-Message-State: AOAM530Fm6fjB1X/B4tUwdjF1FIb8jKyvO8k/5sZ4GKbyUOZQJNExREX UA1ztdetTkv3Lt0CUnCGVTYM/2zokydyRyEg X-Google-Smtp-Source: ABdhPJw/KnOsiOsaojngZV1RmWcqrcJfkZlHP6EpQXocK3d2lE5KQFMSugERWYakKAej/7JmQsHUnQ== X-Received: by 2002:a92:ca82:: with SMTP id t2mr588898ilo.20.1610834044579; Sat, 16 Jan 2021 13:54:04 -0800 (PST) Received: from localhost.localdomain (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id a17sm7428746ilc.77.2021.01.16.13.54.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Jan 2021 13:54:04 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Heinrich Schuchardt , Bernhard Messerklinger , Wolfgang Wallner , Walter Lozano , Simon Glass , Bin Meng , Daniel Schwierzeck , Dario Binacchi , Faiz Abbas , Harald Seiler , Heiko Stuebner , Masahiro Yamada , Michael Walle , Otavio Salvador , Samuel Holland , Stefan Roese , Ye Li Subject: [PATCH 02/12] x86: spl: Add a function to find the text base Date: Sat, 16 Jan 2021 14:53:49 -0700 Message-Id: <20210116145343.2.Ida9f8cf3e7473c0f9493dd616e7481a022f3a85a@changeid> X-Mailer: git-send-email 2.30.0.284.gd98b1dd5eaa7-goog In-Reply-To: <20210116215359.1220766-1-sjg@chromium.org> References: <20210116215359.1220766-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 --- 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 Sat Jan 16 21:53:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1427620 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=BGnauuYK; 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 4DJBj02GMrz9sWF for ; Sun, 17 Jan 2021 08:56:52 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C14DF829DA; Sat, 16 Jan 2021 22:54:19 +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="BGnauuYK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B09A0829DC; Sat, 16 Jan 2021 22:54:10 +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-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) (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 2B96982991 for ; Sat, 16 Jan 2021 22:54: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=sjg@chromium.org Received: by mail-io1-xd2a.google.com with SMTP id b19so22883538ioa.9 for ; Sat, 16 Jan 2021 13:54:07 -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=aHBMG0UndvfRqwM5sDg4hfqfw3Aojx4qqNBXNMfSo6g=; b=BGnauuYKP2cDHjE1a2wK2vHrdtM1neboGHZTkV8vVVn+W67ZF2LtGzxwnDXLywB4TY iusOUxRQrkTNST81hX4mnlM+KgnjPPzBIhzA/hUKeKqgdJlzu8LM7iqMpwlL1Y1riFDu aaANIDd5lfQZW6fWRdrcjEKLnUKMileuwus8g= 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=aHBMG0UndvfRqwM5sDg4hfqfw3Aojx4qqNBXNMfSo6g=; b=gaSAYjUNUROfVtXqyM65dq76hekskAA8mNKJrejNykzJ/iHKTDqUDnexSemCva1ZDf ABnPQpMIkAFdQCyl1hSZzJindDBMe6xkWx49QpQRJ4V1a9p42BpYa4mUG0JF/zy1/Xmw VgpFYs7lLDyIdU7X/TSc7AYn5TUYskvsYGvj477zRLkLxHNMIy+mM3AP/oilMsR1k4nr wxtSG9xu62c+i2gMCieh5C7qrptg92GfkeOcSeRf2rOVxJMR9WbayKAPaVVbb7fCxWNP BR/LwT5p+XvKiE8oswDMd3ZQOFWOPlUP8tWjmozyelrxDC/tlJtLOlamPQMupDEDw2XF gEZQ== X-Gm-Message-State: AOAM531eGRxfi1o1DdOYgipdSsYNOPN3WPriWkLlOq+POIVItimI5YZU MYgIshkG/0zByZ2O3r9V1mTf1XhEGublq+qX X-Google-Smtp-Source: ABdhPJz35AvS8uKoAN7I/y+9Ek308VHGOBsLQMER4CeT7i271wsInSvmznGH2AcpymexkYQKb3nYgw== X-Received: by 2002:a5d:938f:: with SMTP id c15mr12678083iol.72.1610834045692; Sat, 16 Jan 2021 13:54:05 -0800 (PST) Received: from localhost.localdomain (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id a17sm7428746ilc.77.2021.01.16.13.54.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Jan 2021 13:54:05 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Heinrich Schuchardt , Bernhard Messerklinger , Wolfgang Wallner , Walter Lozano , Simon Glass , Bin Meng Subject: [PATCH 03/12] x86: apl: Enhance debugging in the SPL loader Date: Sat, 16 Jan 2021 14:53:50 -0700 Message-Id: <20210116145343.3.Ia4625fafac91469274141729a0040ded17b0db3c@changeid> X-Mailer: git-send-email 2.30.0.284.gd98b1dd5eaa7-goog In-Reply-To: <20210116215359.1220766-1-sjg@chromium.org> References: <20210116215359.1220766-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 --- 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 Sat Jan 16 21:53:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1427621 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=ahEO9t0O; 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 4DJBj94M9Sz9s24 for ; Sun, 17 Jan 2021 08:57:01 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B5E3182A08; Sat, 16 Jan 2021 22:54:21 +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="ahEO9t0O"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4EAEC829DD; Sat, 16 Jan 2021 22:54:11 +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-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) (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 0B638829B9 for ; Sat, 16 Jan 2021 22:54:08 +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-io1-xd31.google.com with SMTP id p72so633266iod.12 for ; Sat, 16 Jan 2021 13:54:07 -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=HQrpfEsun5ot2F6AoNBiuuH6QCd71YsE0XSmjDEXy1w=; b=ahEO9t0OcZ8Hru2KkaAoNbZtoFHgR1HvKW0u+AisZjcjPTzJJq7ZB7mSK3gyJHI5h3 +zJc+MO/LH5XNfuZOkW2OItQRYVk3b9Uxa/YwJ7njmOmHSqtIkAdcOx7i+v+s0X2sMCo X+Ao1u6Grw2YjKd0a+X8P3xZ+rqpih0WnQnLg= 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=HQrpfEsun5ot2F6AoNBiuuH6QCd71YsE0XSmjDEXy1w=; b=ph/uA7HY2jtpwOXV8JRkNRJkVW32VeMuVx3rtZCXGItdIrojPg82obEW7SSHmFoFSH 1BRJLBnMs81ZUKhD03F9PVbOVvsAtSwujNJFoxZx5mjZnq/zzZsrlAdJo+aKk9xlFs+r NbbzoK94uyYqGN0cUsFBb/lbS4XHhVkGB2hUiSZE1k1xU1xppWqtkcTynl6RmflVb9a+ VTGmA1euwQUqVHbCD//A+75QJkS1s7dqMY7uuAvIvLVZgpmmNuWLT6lf/BYkWzsqII11 aYW/JH9v+1lA8q5W493DC9KxhBP716YvGHSmqWYM5MZ5Pv3pkfRxIapU8Bkj6LqyV34l LuJA== X-Gm-Message-State: AOAM5309KUv4y7lloG8cwarOH1X3ERTr6Q2CqA2kgwur70e0NhLtgrxs ETGRadN8rstpFjlUbXKwhcZg3WVdGe7YHZHd X-Google-Smtp-Source: ABdhPJyr/gsXMkv8lma7rOhXPjlurBwcrw3LsjUQ8PqmqJ9qo96et2BdwUlMHGT7NiEOOIqA9h8xpQ== X-Received: by 2002:a6b:cc07:: with SMTP id c7mr486024iog.122.1610834046614; Sat, 16 Jan 2021 13:54:06 -0800 (PST) Received: from localhost.localdomain (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id a17sm7428746ilc.77.2021.01.16.13.54.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Jan 2021 13:54:06 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Heinrich Schuchardt , Bernhard Messerklinger , Wolfgang Wallner , Walter Lozano , Simon Glass , Bin Meng Subject: [PATCH 04/12] x86: Make sure the SPL image ends on a suitable boundary Date: Sat, 16 Jan 2021 14:53:51 -0700 Message-Id: <20210116145343.4.I66e525bc185416fb67c5ff72d9fadde9d60f7ae4@changeid> X-Mailer: git-send-email 2.30.0.284.gd98b1dd5eaa7-goog In-Reply-To: <20210116215359.1220766-1-sjg@chromium.org> References: <20210116215359.1220766-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 --- arch/x86/cpu/u-boot-spl.lds | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/cpu/u-boot-spl.lds b/arch/x86/cpu/u-boot-spl.lds index e6c22895b35..e0c70b076b8 100644 --- a/arch/x86/cpu/u-boot-spl.lds +++ b/arch/x86/cpu/u-boot-spl.lds @@ -43,6 +43,7 @@ SECTIONS __binman_sym_start = .; KEEP(*(SORT(.binman_sym*))); __binman_sym_end = .; + . = ALIGN(32); } _image_binary_end = .; From patchwork Sat Jan 16 21:53:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1427623 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=Z0IbSOzO; 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 4DJBjL6KZtz9s24 for ; Sun, 17 Jan 2021 08:57:10 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AA22182A15; Sat, 16 Jan 2021 22:54:23 +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="Z0IbSOzO"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4567A829DC; Sat, 16 Jan 2021 22:54:13 +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-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) (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 ED4A4829C6 for ; Sat, 16 Jan 2021 22:54:08 +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-io1-xd34.google.com with SMTP id q1so25374242ion.8 for ; Sat, 16 Jan 2021 13:54:08 -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=X2n6sglZoDoAbNygKU/4fcq2x++GYhj3JW76w2+rzHQ=; b=Z0IbSOzO2MIZirvexpqFbqrK/B+Cklwt7LnM+jUwuMS0CuVLRtOYO8AbNDGpOsiC1U DA7nPCfrFwrw8q6aNuKc3Bgib/9DS6rt1g9ryrsA0Y4RZIKcCl6CuB0JgcsvmpoOoDe3 ABOFbPMDHfY/t6SSZROKITQFQBjvZwzIhW8C8= 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=X2n6sglZoDoAbNygKU/4fcq2x++GYhj3JW76w2+rzHQ=; b=qcpg9ztsW6U7lHNS0v4TyEQo0lKCMfyQNLoEqsGeJ5UP/b4gm9XnYMpaRLzWzfaGjR ATkZYP2qK9Ed1W2TA97KoFCCVSsYoIBnqFAsxeA1HMzs9556+d9GiIJF6p3/qLfnXP6P jY4/kLvDeyXudeY26TdauMpUioBeU0xroPrJkdINY04L5uZoziwLoXLj5BQF9ACMdIYO gSMKF6t61qqfSe44XrIatwQOj5LFzgvm2ElKI5JJ5fyXQlh+AXEFSO+jiNwhoMMcm3QL 87cKLvsD2aQBTAtJe9yRR+CHp0FYRqjkLAYpCHKpGDP0FcdG0HwUc++m+mXhx79F5LWn KxMg== X-Gm-Message-State: AOAM533if/MsmC9jDQxI8MXoHYRnxXU8xZd9y6TRWjMkopqLWu7qT+OP wbh3JeRvBAzBMJP0LwQQj8yFmvsU6rSIpkB5 X-Google-Smtp-Source: ABdhPJzk9J7CFiTb+Z9I6bWXjcrDA9jrweeAPpChfQxhTZJh788ezGXUbDIOM9KV2F2311pMDBV/Jw== X-Received: by 2002:a5d:980d:: with SMTP id a13mr1373311iol.168.1610834047590; Sat, 16 Jan 2021 13:54:07 -0800 (PST) Received: from localhost.localdomain (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id a17sm7428746ilc.77.2021.01.16.13.54.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Jan 2021 13:54:07 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Heinrich Schuchardt , Bernhard Messerklinger , Wolfgang Wallner , Walter Lozano , Simon Glass , Bin Meng Subject: [PATCH 05/12] x86: spl: Make moving BSS conditional Date: Sat, 16 Jan 2021 14:53:52 -0700 Message-Id: <20210116145343.5.I5a89c49db44a423cb318aa9d88b31e7df36bca98@changeid> X-Mailer: git-send-email 2.30.0.284.gd98b1dd5eaa7-goog In-Reply-To: <20210116215359.1220766-1-sjg@chromium.org> References: <20210116215359.1220766-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 --- 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 e0c70b076b8..03a8c7e496c 100644 --- a/arch/x86/cpu/u-boot-spl.lds +++ b/arch/x86/cpu/u-boot-spl.lds @@ -48,7 +48,9 @@ SECTIONS _image_binary_end = .; +#if CONFIG_IS_ENABLED(SEPARATE_BSS) . = 0x120000; +#endif .bss (OVERLAY) : { __bss_start = .; *(.bss*) From patchwork Sat Jan 16 21:53:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1427624 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=GBotaAPk; 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 4DJBjW5CLLz9s24 for ; Sun, 17 Jan 2021 08:57:19 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 40CD182A1E; Sat, 16 Jan 2021 22:54:29 +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="GBotaAPk"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E3954829EE; Sat, 16 Jan 2021 22:54:13 +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-io1-xd2e.google.com (mail-io1-xd2e.google.com [IPv6:2607:f8b0:4864:20::d2e]) (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 E33BD829DA for ; Sat, 16 Jan 2021 22:54:09 +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-io1-xd2e.google.com with SMTP id y19so25413056iov.2 for ; Sat, 16 Jan 2021 13:54:09 -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=GwhyvhM6rxPGe2ky7sRdwwaU1UpmRidaA8MPUvF42Kc=; b=GBotaAPk5KI4IZ6fJ6Rm/LnGedoozyH3vZGxS58bNNGWQoYUQ61ge75p1usowobNBR Oscn8EGsK9N28W+bknjrtmjFRRMyqeS7nKTgMUlTKLiTFZcDR3279y/5iNtStWkItKFT 2tGzAB0xW0Yi3QgIKixTBu7XgZjkbxCSxLHM0= 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=GwhyvhM6rxPGe2ky7sRdwwaU1UpmRidaA8MPUvF42Kc=; b=N70jQZ8hAjWHXZFUXg/fHhzkRj2ub5398HBq+iYlDpqTawfbZk9uVpw2gmtFNwIxvZ hMdNFAFdPFWkl7RN0qg/B3FXyuvXyy0TwSoN7gfPboIczD7WMOGtAgV67zYZ3BZvLC9x qgEZDuV+WIEKchBKPVFjeenYyPCpyW3aRv//yWOc/AECKPDCOPpNkvt2SPGQrcXUyRHF 9HtbB1W5kDvaSl9pgQgIS0u5oduzV9VU1GKZjZ7sjKsQ7tYvFcJIF22W9mZJICBCc/VA u5jr+8qtoX9BRnYngp6NguMnygA2+/lTa6Y6yjePaJQUP7UCmcjSkeXUKG6p/swqNUyx ySQg== X-Gm-Message-State: AOAM531Hl9DPcGdSs55OuuSs8Es1VJjZsQwRYG+3YaC20A7/NJXE0NvV Jn+LLoGrBd7WQhN78Pl7RFhhAn2a5AEDICvG X-Google-Smtp-Source: ABdhPJwOQ2gjhFcSwEa/LezhfJcewDRDAZ9wHOmuBybb4wvfzIOcj7Sec3BBTDxwxcDaAd+1qDvOcQ== X-Received: by 2002:a6b:c894:: with SMTP id y142mr71990iof.86.1610834048581; Sat, 16 Jan 2021 13:54:08 -0800 (PST) Received: from localhost.localdomain (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id a17sm7428746ilc.77.2021.01.16.13.54.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Jan 2021 13:54:08 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Heinrich Schuchardt , Bernhard Messerklinger , Wolfgang Wallner , Walter Lozano , Simon Glass , Bin Meng , Wolfgang Wallner Subject: [PATCH 06/12] x86: Update Chromium OS GNVS names Date: Sat, 16 Jan 2021 14:53:53 -0700 Message-Id: <20210116145343.6.I6899fb8e644a4342546ee0bfbdd521488635e1ca@changeid> X-Mailer: git-send-email 2.30.0.284.gd98b1dd5eaa7-goog In-Reply-To: <20210116215359.1220766-1-sjg@chromium.org> References: <20210116215359.1220766-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-Voltatile 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 --- 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 Sat Jan 16 21:53:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1427625 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=ExqcOC7u; 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 4DJBjh1yS2z9s24 for ; Sun, 17 Jan 2021 08:57:28 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7CCDE82A22; Sat, 16 Jan 2021 22:54:31 +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="ExqcOC7u"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3EBF0829F7; Sat, 16 Jan 2021 22:54:14 +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-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) (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 EE808829BC for ; Sat, 16 Jan 2021 22:54:10 +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-io1-xd33.google.com with SMTP id d13so22166933ioy.4 for ; Sat, 16 Jan 2021 13:54:10 -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=oEd6HN76/orW2flSh8m+LF98CbUrrM5vG2wHlC73TYA=; b=ExqcOC7uTk646EFyY8IrXT93jAroqlvhk2jbyFcax75tUDmz/vjW4es/3Xoe/E/BAQ /VPkup5NV8bIf/ApdnxjeLMIkWEVySs+OVFazI5ReM5jtOgm8cKGx17I+8nG8PgPPC61 TYqARszhTJb/KnSh7FGisefW5+ZGoLVI/JDTE= 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=oEd6HN76/orW2flSh8m+LF98CbUrrM5vG2wHlC73TYA=; b=fHCOoYbyBJFgkj54nPct0DAYFVx49ijJUIgxxryaXDRcUfp9qlC/WG1OjbqW7UHBD9 5iz/XHoHTThDUVzBGTRmaajCW2aaYYCtoVh8fs8BfSOsrri0AZeJtmEkYFpstCg5TZEN NuhawtL5Ke6YJ25p+6ycv/o4tpqtbGH27hkUa6OmAtpnpXEnbZbJcqNrnxhyp+C9rhlX rUy9Q+fJZZtYNPeZb13ZldzV518+AYw/KLST/WYvK5FON6ZLM449W7hl+HhRYBllRzxZ fEyH0I99sZWe8MF/zYLzhnCCxm7Gx7wgcZNupL/qYpG2Wm1J776OrsMTM8/shxJGCopH khww== X-Gm-Message-State: AOAM531OcloSsi/JtzFyFQhN6jjue1dRj4rYF6naB+nA8sTsElPKR6nX NZbrRifEZ9JUXye7nkmkIajCsVK1jU4ehHmp X-Google-Smtp-Source: ABdhPJz3HZQvBHGyIyYSz3qlkDq16qcRHDeycUk8Tj+Z5GF+TV/TI8/bD+g25gQuXc2Vfsl4EfxW1g== X-Received: by 2002:a5d:96c5:: with SMTP id r5mr12590070iol.62.1610834049563; Sat, 16 Jan 2021 13:54:09 -0800 (PST) Received: from localhost.localdomain (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id a17sm7428746ilc.77.2021.01.16.13.54.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Jan 2021 13:54:09 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Heinrich Schuchardt , Bernhard Messerklinger , Wolfgang Wallner , Walter Lozano , Simon Glass , Bin Meng , Igor Opaniuk Subject: [PATCH 07/12] x86: zimage: Allow dumping the image from outside the module Date: Sat, 16 Jan 2021 14:53:54 -0700 Message-Id: <20210116145343.7.I4cbe2bb13efa1af25d22b7d3ada88be0dc01b9a6@changeid> X-Mailer: git-send-email 2.30.0.284.gd98b1dd5eaa7-goog In-Reply-To: <20210116215359.1220766-1-sjg@chromium.org> References: <20210116215359.1220766-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 --- 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 Sat Jan 16 21:53:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1427626 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=GxUBzSsp; 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 4DJBjs0cHqz9s24 for ; Sun, 17 Jan 2021 08:57:37 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 443CF82A28; Sat, 16 Jan 2021 22:54:33 +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="GxUBzSsp"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1333E829EE; Sat, 16 Jan 2021 22:54:15 +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-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) (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 DE19F829D7 for ; Sat, 16 Jan 2021 22:54:11 +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-io1-xd2f.google.com with SMTP id e22so25379430iom.5 for ; Sat, 16 Jan 2021 13:54:11 -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=uVmhS67mIDt8HpO/AHaBg1BQSOATh+AP5p8BI0gOUU4=; b=GxUBzSsp8s8e4ifU0UfXKse17Iv9PQ8iiOrKE69DaKXEO+ki0uPRVvzpSYkhNY9Jfp jaq42orTVzeKpGARRRP7PoRKypUzillS8FxBpBzm813MO5AXXe7jIT/9SdI0wSwh/Spi LKGSgJ5n/+NKbUjg6FzpWD/Tn58V2XZOZ3Hy4= 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=uVmhS67mIDt8HpO/AHaBg1BQSOATh+AP5p8BI0gOUU4=; b=ow7cgDN954m09bd+akzw8mU44vTndyBbCYRD5rwr6oTjaNywN/+THH0HKJxMNoAKZt fcHAcEEDbxL+/A1zzH4jNc6X+zP1/10o0jBICs9lE1chy9LdAy6FUhYr+kfFnFCM76Ut VmuCyRyNV46S3IqjDvXlrkY1/8IcHt31sfNm+P/meFrqAzcvViWZ9CL1Fhw1J6pzTrlZ 94o+OFgqXFpd/1I+wIYRQXZCC2JTM4paA6RtXDlFJmjkXCod2KOoqinAyEZEDDvMqT50 4N4IifKfJM7jkpcxH0I08PyCSqW0TT0iOjMH11ufEzQf7s9Crz1Xae2lnnYBMx2XqXvm uK8A== X-Gm-Message-State: AOAM5322GLfTxV/XZbFPZxfW8/pmpz4wejJ7Va+lDV/AbDCDQtWkmiQS l/qbGJTt0+MhQ5LFQ0guGzMnoyiP1klh2a1H X-Google-Smtp-Source: ABdhPJwna6pZmgIOlJLl7uPoqHBUY2DYUacNSA5H/d4Fi3ZokMvvHIFiNlT6jGtgvMUCs/qou3+M5Q== X-Received: by 2002:a6b:cd02:: with SMTP id d2mr12900010iog.4.1610834050545; Sat, 16 Jan 2021 13:54:10 -0800 (PST) Received: from localhost.localdomain (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id a17sm7428746ilc.77.2021.01.16.13.54.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Jan 2021 13:54:10 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Heinrich Schuchardt , Bernhard Messerklinger , Wolfgang Wallner , Walter Lozano , Simon Glass , Bin Meng , Igor Opaniuk Subject: [PATCH 08/12] x86: zimage: Improve command-line debug handling Date: Sat, 16 Jan 2021 14:53:55 -0700 Message-Id: <20210116145343.8.I5c2b2cfb6dab027e5331a06e3c55b5e1d57720ce@changeid> X-Mailer: git-send-email 2.30.0.284.gd98b1dd5eaa7-goog In-Reply-To: <20210116215359.1220766-1-sjg@chromium.org> References: <20210116215359.1220766-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 --- 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 Sat Jan 16 21:53:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1427627 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=dEU5X3M6; 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 4DJBk31F55z9sWL for ; Sun, 17 Jan 2021 08:57:46 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 396CF82A36; Sat, 16 Jan 2021 22:54:35 +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="dEU5X3M6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 78587829E0; Sat, 16 Jan 2021 22:54:17 +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-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) (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 D12E6829AC for ; Sat, 16 Jan 2021 22:54:12 +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-io1-xd30.google.com with SMTP id e22so25379477iom.5 for ; Sat, 16 Jan 2021 13:54:12 -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=OMVjqsyTQiwxh8K27U4Ns3KKTQqDgAWsevftXq2NE0s=; b=dEU5X3M65frOjTNFesBxNTfwx4KIq5gYM1Exv5VcwaegDSJgS//wLCPi1g/RLMdW8v bODAi8kglonFQvFGDQW5qbs3f8OnmBjjbj7/KZGpwaxa7QlQC0ykXnTLEdMkNNDlzQIG v3W4+60cG/7XrtYjNZLhc1s7wuUegXtvvcQlA= 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=OMVjqsyTQiwxh8K27U4Ns3KKTQqDgAWsevftXq2NE0s=; b=FCtuemfL4QPkSNYD1MXiryIMISe1YbqHqtF+zK8dL3CspP1NKeP26oldq5qOvj+KEj +ryraXRJwbMT82XH9f2xhnoe7v8S3WJDLMGFbSOcKmnkj9gbLM/zycIeJwx0Kbr2Rf6f i1ligLW0PwUHJ1UYQ28HZIxlvnfj3dAw+g73c6A58WoJrGncJXHkXVh0GOBvJVHnTqZy 8rFNZRjk0kkdV+XpzEJsX+3rDkzqd5vBug7xjpBFDF8UorArvH4e61fAeNZaGBR6ZL4q SdYoiL07a9Lir3nD7nSqb9yy9BE71DmWvJtPudCrVirDR9OQwAk76CC1RljFbe+fMRN1 svBg== X-Gm-Message-State: AOAM531yUw2TCCdPGc/SxwJ3DO0wE9jfgMJZwTAuYNimoCn67BcdwNS7 +4+2nSbeJhpFBTqf/yaILKTwDR7WJOZ6q2PM X-Google-Smtp-Source: ABdhPJwAl1q6FJvf/gU4E+MpzQZxIOmPjk24z8jCin8uH6GHLgIOMB2dccEi4iEt6bVoN5CHtpl2+A== X-Received: by 2002:a5d:939a:: with SMTP id c26mr13163647iol.63.1610834051497; Sat, 16 Jan 2021 13:54:11 -0800 (PST) Received: from localhost.localdomain (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id a17sm7428746ilc.77.2021.01.16.13.54.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Jan 2021 13:54:11 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Heinrich Schuchardt , Bernhard Messerklinger , Wolfgang Wallner , Walter Lozano , Simon Glass , Bin Meng Subject: [PATCH 09/12] x86: spl: Clear BSS unconditionally Date: Sat, 16 Jan 2021 14:53:56 -0700 Message-Id: <20210116145343.9.I4b95684e6aab3bd37291a7c679f621e9f8676a4c@changeid> X-Mailer: git-send-email 2.30.0.284.gd98b1dd5eaa7-goog In-Reply-To: <20210116215359.1220766-1-sjg@chromium.org> References: <20210116215359.1220766-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 --- 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 Sat Jan 16 21:53:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1427628 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=UgxFwSD8; 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 4DJBkC6ZGwz9s24 for ; Sun, 17 Jan 2021 08:57:55 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BF75682A3F; Sat, 16 Jan 2021 22:54:37 +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="UgxFwSD8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E9E6E829F2; Sat, 16 Jan 2021 22:54:17 +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-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) (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 EC2B6829DA for ; Sat, 16 Jan 2021 22:54:13 +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-io1-xd33.google.com with SMTP id y19so25413209iov.2 for ; Sat, 16 Jan 2021 13:54:13 -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=hYAnI7fgzVc8uXtmj/o5v7KQ0NrrQocaUU54Dmm7hw8=; b=UgxFwSD8unaqdDBHncSGOZKNE09gwtIsR0jzZq0uEQDAphwFfnIEhPeJzGlHRWmzh8 JOMqxo954LcFnpzJVzHsxcdYgjT1Mpwv4Rih4O2+AKi9997DT7vbsJ6MNvDtpKTUVA44 dQT9pMLAcBPxFQiBl9TRWEnpzVD2l4KKmjOl4= 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=hYAnI7fgzVc8uXtmj/o5v7KQ0NrrQocaUU54Dmm7hw8=; b=jOXwITqU/t7V8zaP9bxSS/CsOtQhdmlsNsqHGybyheQwU4nlMfQCBjgSxJoZy4dvSM OdRNyJLjcKVYHdPWh3v4TQ0PTwfwRUYTopcB4XK2O2kaWUbarQhfeuMXiYOst++VhJiL BNWj3irthwP9VjE/Ul3/Ez/YigsPYfU5QDiiAGhNpgTfKtJxRT2ko0kIY9hcN1pLh1rq 3sYwOGsec4cWljECIaNVJ/U5/5YNUF5TJ5KzbwjgXViNTbq8C9gaq/2dFO1m5bJ96ZTM /TadHfBXs7vtiiBt64PvaNGpsB0fX5n86eK+zW2elC2Zjpl3zrexDKHuU4vBZoQLoVGq +wIw== X-Gm-Message-State: AOAM5309k08wjsuKw8mr4udCAgtG3wpsFL7tE8aiFWl4gPsqzMpxhp5N wQhJ2wyLfh8E5SRVRQNIfCPpizWQfVJ0jJqt X-Google-Smtp-Source: ABdhPJyT46b1ZYVPs1dvCJVNH3AsROHQv1Bsq5Gg7Cbuxa3fm5dfDnlIXn1PcoKIAQbWHDJlBpsP2w== X-Received: by 2002:a05:6602:27a2:: with SMTP id i2mr8606305ios.198.1610834052563; Sat, 16 Jan 2021 13:54:12 -0800 (PST) Received: from localhost.localdomain (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id a17sm7428746ilc.77.2021.01.16.13.54.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Jan 2021 13:54:12 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Heinrich Schuchardt , Bernhard Messerklinger , Wolfgang Wallner , Walter Lozano , Simon Glass , Bin Meng Subject: [PATCH 10/12] x86: tpl: Show next stage being booted Date: Sat, 16 Jan 2021 14:53:57 -0700 Message-Id: <20210116145343.10.I4fc555abb2742270d29545815240dee426b378e5@changeid> X-Mailer: git-send-email 2.30.0.284.gd98b1dd5eaa7-goog In-Reply-To: <20210116215359.1220766-1-sjg@chromium.org> References: <20210116215359.1220766-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 --- 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 Sat Jan 16 21:53:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1427630 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=Kdr/UNQ1; 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 4DJBkN3YPxz9sWF for ; Sun, 17 Jan 2021 08:58:04 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 989A382A44; Sat, 16 Jan 2021 22:54:40 +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="Kdr/UNQ1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 839FC829DA; Sat, 16 Jan 2021 22:54:18 +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-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) (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 E87EA829EA for ; Sat, 16 Jan 2021 22:54: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=sjg@chromium.org Received: by mail-io1-xd36.google.com with SMTP id y19so25413247iov.2 for ; Sat, 16 Jan 2021 13:54:14 -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=Jax8sTSoFpNbxXOcwx7BB3NUe7UngS2AbkTLlLajKv4=; b=Kdr/UNQ1vez5qllEtB92Hiia8gR6L8GoEFO2m9GiGXYILjCPkJqw4VBu+UnIFcPOeJ 4TKYCvrXkF6dr0XicVS+mC5dw66UCoCShSF8TcqqHRU9XkqGoZnlZN987ezRXpByjnP1 GgUxXTiDFbK9N+Xl/9CUeakcrW4SBZI/bPZ1M= 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=Jax8sTSoFpNbxXOcwx7BB3NUe7UngS2AbkTLlLajKv4=; b=X9/jssULZw8OJ+6vva9nVaXdEbowSqfzLFaQxRpFxO/KWeTOu6AOoa4tDwCRLFlM1k YLXrKDLTC27ZvXsUZXhRQkew2cADdRw50zTP5zU4U7URNlHemMXKpvgjpDYZ6JM4LIYN 4qmh9dd8mTJwlKpJgh0GHo/DHjNJH/1wSWYxcaeYtzQsnz8yuIoMalLJOIqhpl4Oaa0r Y53ho2Mxu0KRBpc8kWspl+OygfAA154cyFzpjSwLGu6bQS6Ta5IbDxeCU3BdePz+oauY egC313OH2zWa/zOzr/f8rQhOixlu8l7qAxWloDwHaUcTrgAk7DKRO5GDMqRWtykXJHyj dvmQ== X-Gm-Message-State: AOAM531FHejcTITU3L/RkE85umLAEJjujyboCL9w38nxJcA43EqwhMJo G3nlRUgx8UAsK+hL6cj54/LxyCT4CCPFyGqF X-Google-Smtp-Source: ABdhPJzcGkyvrpXszGK34sjwSpZGwb4l4vlExtZVZW6erMWBebX9/GIRw/7mRNIXhhUHeWKSnGX71w== X-Received: by 2002:a5e:de41:: with SMTP id e1mr3700604ioq.135.1610834053557; Sat, 16 Jan 2021 13:54:13 -0800 (PST) Received: from localhost.localdomain (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id a17sm7428746ilc.77.2021.01.16.13.54.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Jan 2021 13:54:13 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Heinrich Schuchardt , Bernhard Messerklinger , Wolfgang Wallner , Walter Lozano , Simon Glass , Bin Meng Subject: [PATCH 11/12] sysinfo: Allow showing model info from sysinfo Date: Sat, 16 Jan 2021 14:53:58 -0700 Message-Id: <20210116145343.11.I93d883230fabc88c1e9fd95d72d497069b2c60e9@changeid> X-Mailer: git-send-email 2.30.0.284.gd98b1dd5eaa7-goog In-Reply-To: <20210116215359.1220766-1-sjg@chromium.org> References: <20210116215359.1220766-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 --- 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 Sat Jan 16 21:53:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1427631 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=S/p5GRyd; 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 4DJBkY2RSzz9s24 for ; Sun, 17 Jan 2021 08:58:13 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B430B82A4C; Sat, 16 Jan 2021 22:54: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=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="S/p5GRyd"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C88E0829F9; Sat, 16 Jan 2021 22:54:21 +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-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) (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 0873C829EE for ; Sat, 16 Jan 2021 22:54:16 +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-io1-xd34.google.com with SMTP id w18so25433609iot.0 for ; Sat, 16 Jan 2021 13:54:15 -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=F0ndj3NrTPPWEUw8YMg/kvmEY6z4CDC138COCQOou4U=; b=S/p5GRydeqauegBNUZD0eXCaLyzX8AO0pMUa4ezvEh5VFoRmFLOV13KsBhTFuiFtR2 7innFOtFxHWCzSDlhx5OWpmqZ1DiXA2JQdY8r2a5fYKkI1lKlqX3Caqzh1pnkMAn355C XuajTQhjHS6/+/BiO28neXCG3Qf3iYg5TMeoo= 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=F0ndj3NrTPPWEUw8YMg/kvmEY6z4CDC138COCQOou4U=; b=TCNgAZtDdQg+TDEkqiUa1zcPu/V16W3yD6DHVFXzGLc78vKruBo5B56i/h99RT6Tlw AqE6MaI9UA/8mVx5cLY0BFLqyVE9IsPkNJ/2HWC77IlZQQDtWIpkqgsQXNOxa1EQmwNq Y55e3x8LzL9GsPGO6/JgI7QEa19+TsSbWJ5UCFGdiTO/XBHOkFzcxOAli0Lnuz30hso8 M1Y6i2P3p3xYhsWlLFcXUaIM6IA4UMX8mEk5VhB8RYSjt6TGqj42dH2XN4A/pL42X/5m tQXX4qdVr3xobDBEfZzpG5LXxvgLa53Y8I2zVGwQNanXb3K4cU1U2Iq9lVw8nFOD6ao/ xdmA== X-Gm-Message-State: AOAM532XeYD4whqz3QecRrDlcQGtgAkBILzG/o4jwgEfDw0Q4P92FMtL /T7uw4exQzn+LZDx1LWirQ1AfAsJ+nlMERcD X-Google-Smtp-Source: ABdhPJw3VZpi8epCI2xwKHdLtRJ1GZ8uAC0/A8+7Mt7Rge2ENGVoO9sxK1eGIbUrQVNHOKloPwdC7Q== X-Received: by 2002:a02:8791:: with SMTP id t17mr15394370jai.28.1610834054544; Sat, 16 Jan 2021 13:54:14 -0800 (PST) Received: from localhost.localdomain (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id a17sm7428746ilc.77.2021.01.16.13.54.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Jan 2021 13:54:14 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Heinrich Schuchardt , Bernhard Messerklinger , Wolfgang Wallner , Walter Lozano , Simon Glass , Bin Meng Subject: [PATCH 12/12] x86: coral: Show memory config and SKU ID on startup Date: Sat, 16 Jan 2021 14:53:59 -0700 Message-Id: <20210116215359.1220766-2-sjg@chromium.org> X-Mailer: git-send-email 2.30.0.284.gd98b1dd5eaa7-goog In-Reply-To: <20210116215359.1220766-1-sjg@chromium.org> References: <20210116215359.1220766-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 --- 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..f4e408bb751 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..df1a1795bbd --- /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>; + */ + };