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 DACF1C77B73 for ; Wed, 19 Apr 2023 04:12:09 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E5AFF8627B; Wed, 19 Apr 2023 06:05:23 +0200 (CEST) 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="gAL13XPE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E5F2986238; Wed, 19 Apr 2023 06:04:27 +0200 (CEST) Received: from mail-il1-x12a.google.com (mail-il1-x12a.google.com [IPv6:2607:f8b0:4864:20::12a]) (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 169CB86239 for ; Wed, 19 Apr 2023 06:04:18 +0200 (CEST) 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-x12a.google.com with SMTP id e9e14a558f8ab-32ad8ca1e69so23874865ab.3 for ; Tue, 18 Apr 2023 21:04:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1681877051; x=1684469051; 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=lg+n//RMDKNfbo4W1e+kZ+yyhi9MhlRXdsqiuyW0u0E=; b=gAL13XPEVRm8jjnA2dcTnuitdwBwFXSUK/1Xfiz5KaiwZ/wi9mZtrU0ZjQFoLBB5re zHF/WKVw3M5QhMNPLhxy6CRZm3rAJvZNbjH2Hdq4EB77QSjPEE84v11LR0Jtph1Cpu6K YiRYK32Bal2cbCzkiZ8iEdtsv2MSsSsjpxg9Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681877051; x=1684469051; 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=lg+n//RMDKNfbo4W1e+kZ+yyhi9MhlRXdsqiuyW0u0E=; b=bDPGiaSUNYVUpTxrAjb5VdoEOJ1vK9HY9DBREYH/3kBmBPmeAgpUKLNmx2ysw+Y3ph yMP/2Syuk/JDCrt08hzGdIi03nx1Mc/DjAChn0YgBw/58IC0K+2m88hUHZjZnkQo0g4q gymzi/FFXJ5+OONbDEO9TccW3Ly7dfIkSPvdyUD8pkgDBLav99qn/TPm7ZOZhsNrZ0Pb 9vEt+xR4GiWbjyJaH0RYwStcjxJ9oBTrpm9GyCojm4LExS7XiC9CPLyNzny6Usvmxwp2 kMucA20gq2VkhTjk3dIO5Jy04KURaiUnEvPdZ81W4dqX8Y012mYqyLPIWVo1ayRMWvct OMDQ== X-Gm-Message-State: AAQBX9dK0wbpRmgVvElaQ0ovQYjyetrMgBz/KmOwcGzyzVSPMjokqxSj 2gZTM4OG8EfCZmTQ+w4C239DL4DZMiDP518hh5M= X-Google-Smtp-Source: AKy350a63wVkDFcrdNhE+IF2rTPxc8SLs35GrYNrmTgZTKDnsdbO1n9Jg3SG/w1+6NUGjlr0pwkNeQ== X-Received: by 2002:a92:d803:0:b0:326:413e:b0ff with SMTP id y3-20020a92d803000000b00326413eb0ffmr14843934ilm.10.1681877050961; Tue, 18 Apr 2023 21:04:10 -0700 (PDT) Received: from sjg1.lan (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id i4-20020a05663815c400b0040f91082a4fsm3261982jat.75.2023.04.18.21.04.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Apr 2023 21:04:10 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Bin Meng , Simon Glass Subject: [PATCH v2 38/42] x86: Make sure that the LPC is active before SDRAM init Date: Wed, 19 Apr 2023 16:03:10 +1200 Message-ID: <20230419040314.160352-7-sjg@chromium.org> X-Mailer: git-send-email 2.40.0.634.g4ca3ef3211-goog In-Reply-To: <20230419040314.160352-1-sjg@chromium.org> References: <20230419040314.160352-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 Some boards need to access GPIOs to determine which SDRAM is fitted to the board, for example chromebook_link. Probe this device (if it exists) to make sure that this works as expected. Signed-off-by: Simon Glass --- Changes in v2: - Add new patch to make sure that the LPC is active before SDRAM init arch/x86/lib/spl.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/x86/lib/spl.c b/arch/x86/lib/spl.c index 683454dacac4..08846686858e 100644 --- a/arch/x86/lib/spl.c +++ b/arch/x86/lib/spl.c @@ -65,6 +65,8 @@ static int set_max_freq(void) static int x86_spl_init(void) { + struct udevice *dev; + #ifndef CONFIG_TPL /* * TODO(sjg@chromium.org): We use this area of RAM for the stack @@ -109,6 +111,13 @@ static int x86_spl_init(void) return ret; } #endif + /* probe the LPC so we get the GPIO_BASE set up correctly */ + ret = uclass_first_device_err(UCLASS_LPC, &dev); + if (ret && ret != -ENODEV) { + log_debug("lpc probe failed\n"); + return ret; + } + ret = dram_init(); if (ret) { log_debug("dram_init() failed (err=%d)\n", ret); -- 2.40.0.634.g4ca3ef3211-goog