Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2D448C6FD19 for ; Mon, 13 Mar 2023 03:13:52 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 173788611D; Mon, 13 Mar 2023 04:12: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=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="XGx6DXI/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D8C27859B4; Mon, 13 Mar 2023 04:11:38 +0100 (CET) Received: from mail-il1-x12c.google.com (mail-il1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) (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 923F585C45 for ; Mon, 13 Mar 2023 04:11: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=sjg@chromium.org Received: by mail-il1-x12c.google.com with SMTP id r4so337317ilt.8 for ; Sun, 12 Mar 2023 20:11:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1678677089; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CYTZiMBafjzoXmqrL5A38iOAe+FXGAs56IJ9PsIcYGI=; b=XGx6DXI/OmvEdzphPOIDKfputRvMDZQ5i1deTOqAISZzmsreEkRtCuwcGSVG4C2fUX wfsCJ8wGsJIMgQRcDEN+1/G8FeY0OC61Ojaz152bhGQAkWVR0KTl0dZQafOeLQoWDNV6 IBc3VfY4WvclaUtyeMIHzjOEjZqGeR8mesf+Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678677089; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CYTZiMBafjzoXmqrL5A38iOAe+FXGAs56IJ9PsIcYGI=; b=mlESBuaQuhAwt5beyTYLqnCjKItf6tJ/cC+Xqc/O3DguvYT3yse/sT5ssiHtfGhxkE k0UtSEanZKBDS/+gruG3qhoWszvYLMX5RdqlkSW5Es+PR9WnE1xbyQqxyrmmcSCBTFyN P4aH6sRoxnmT6DJOg7vI8WNWS4brzPk6UJ5Vv5Ii0D751teiS8rJOz6GN6fWlRpwM1Qn fBkK+EltrjjSp8dYT3jfhnR+r4GXwXhTmAyNxiCLLvh1aw7yYG2De4Cj9DPI695dbdjn V3x8pRKA/9Ith2QjxiXUhvzaHEmHN42/vByJz2NY+zJhmpvT9vEsl7kq7TAILlGNQwCr wOLg== X-Gm-Message-State: AO0yUKXrY4FRLO58AQqGQJ2jUNFhfvZ3rOJW9lnIvDhwqJ2PFfzd0IRa vnNjJvzfoQK009ED40rR0HFhnq+cXK9ZDrdF5VY= X-Google-Smtp-Source: AK7set8F/a2dAmRfs6NmpwRKjHXiyW4JkBfZGagbnsTe2uBLOJTzHPHA36eUjUilCwClMZum1M9GHA== X-Received: by 2002:a05:6e02:20ec:b0:323:7a4:808a with SMTP id q12-20020a056e0220ec00b0032307a4808amr1784625ilv.11.1678677089753; Sun, 12 Mar 2023 20:11:29 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id b7-20020a02a587000000b003c4f902cca5sm2089409jam.172.2023.03.12.20.11.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Mar 2023 20:11:29 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass Subject: [PATCH 04/13] x86: ivybridge: Ensure LPC is available for GPIO base Date: Sun, 12 Mar 2023 21:11:01 -0600 Message-Id: <20230313031111.725395-5-sjg@chromium.org> X-Mailer: git-send-email 2.40.0.rc1.284.g88254d51c5-goog In-Reply-To: <20230313031111.725395-1-sjg@chromium.org> References: <20230313031111.725395-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.8 at phobos.denx.de X-Virus-Status: Clean The bd82x6x_get_gpio_base() does not work if the LPC is not set up. Probe it early to avoid this problem. In chromebook_link64 this propblem shows up as an inability to read the GPIO straps for the memory type. Signed-off-by: Simon Glass --- arch/x86/cpu/ivybridge/bd82x6x.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/arch/x86/cpu/ivybridge/bd82x6x.c b/arch/x86/cpu/ivybridge/bd82x6x.c index 89312a863499..417290f559e9 100644 --- a/arch/x86/cpu/ivybridge/bd82x6x.c +++ b/arch/x86/cpu/ivybridge/bd82x6x.c @@ -31,7 +31,6 @@ DECLARE_GLOBAL_DATA_PTR; #define RCBA_AUDIO_CONFIG_HDA BIT(31) #define RCBA_AUDIO_CONFIG_MASK 0xfe -#ifndef CONFIG_HAVE_FSP static int pch_revision_id = -1; static int pch_type = -1; @@ -162,15 +161,19 @@ void pch_iobp_update(struct udevice *dev, u32 address, u32 andvalue, static int bd82x6x_probe(struct udevice *dev) { - if (!(gd->flags & GD_FLG_RELOC)) - return 0; + /* make sure the LPC is inited since it provides the gpio base */ + uclass_first_device(UCLASS_LPC, &dev); + + if (!IS_ENABLED(CONFIG_HAVE_FSP)) { + if (!(gd->flags & GD_FLG_RELOC)) + return 0; - /* Cause the SATA device to do its init */ - uclass_first_device(UCLASS_AHCI, &dev); + /* Cause the SATA device to do its init */ + uclass_first_device(UCLASS_AHCI, &dev); + } return 0; } -#endif /* CONFIG_HAVE_FSP */ static int bd82x6x_pch_get_spi_base(struct udevice *dev, ulong *sbasep) { @@ -269,8 +272,6 @@ U_BOOT_DRIVER(bd82x6x_drv) = { .name = "bd82x6x", .id = UCLASS_PCH, .of_match = bd82x6x_ids, -#ifndef CONFIG_HAVE_FSP .probe = bd82x6x_probe, -#endif .ops = &bd82x6x_pch_ops, }; -- 2.40.0.rc1.284.g88254d51c5-goog