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 30820EB64DA for ; Mon, 19 Jun 2023 12:10:55 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5C587865EA; Mon, 19 Jun 2023 14:08:02 +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="FGwxG9bN"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 34A3D86093; Mon, 19 Jun 2023 14:03:50 +0200 (CEST) Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9CF6D86342 for ; Mon, 19 Jun 2023 14:02:26 +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-wr1-x429.google.com with SMTP id ffacd0b85a97d-3111547c8f9so3970871f8f.1 for ; Mon, 19 Jun 2023 05:02:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1687176146; x=1689768146; 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=Bte5sNmJ8S+Rfq0Zv0eLJwu7pOkAHf4JfigaEaJPWr8=; b=FGwxG9bNRvxLPkMdw/l4p1VDhsJns2IGg4gb24zhcEcTx0N85ij9rVWL9VYlH7EctP ZQxg/l6aqxz/XM0O47bmlycFnT6nVOaX14PhZB3HzhEL+UmBPTo4Rjzze6/42DzmP3ni T3o08u2AWEB3cMhp6wRntSdRCWbCZriI5znG0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687176146; x=1689768146; 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=Bte5sNmJ8S+Rfq0Zv0eLJwu7pOkAHf4JfigaEaJPWr8=; b=draMWwcBT1n92RVYI+lAvVnEnksLMvPK1E/d74a2bH88TPwPpHiE2kV56cSIC+NU3+ Jer5p/xO2YNsY4EOXiytYWVACF7kCMoBGlJ/iZ3XVnMepgdPz0lKjg90SXCql8pQ8KBt +GcNCS2aISRMUM5lIKjE57x9YwhZ9dO+Z5FakmISzl/sqxCPgQCZtAaecZt53NLUIcxo H405ABTGBC4O99BDTMF+TY0ygx55hCo5x14UATYDsldgepGkGl3jeAySzD1qpkhaL0UG HvXD8IziFnZOatoBu2B3CG+ItpJGmYxxdJEJKU4gwaUmAa3JHBcKAj/kM5gYtyINcxJi EBKg== X-Gm-Message-State: AC+VfDyWYwZPDimDpN8DNNZmWUgudxu0eI6muO1Rpz1gG85JqDgCt9WV 8ESyIjsRys8Mmm+gbjID9ltvUgrdb+5//dmkW6A= X-Google-Smtp-Source: ACHHUZ6V3Pz4+KyZWReIN9tAN3AZ4pqCeAF6xR7oBVQS4atDo95JnsawpjKFkkLRWkxP4tTI1GFCAA== X-Received: by 2002:adf:e708:0:b0:311:91c:ddfc with SMTP id c8-20020adfe708000000b00311091cddfcmr8483679wrm.10.1687176145893; Mon, 19 Jun 2023 05:02:25 -0700 (PDT) Received: from sjg1.roam.corp.google.com (79-67-123-132.dynamic.dsl.as9105.com. [79.67.123.132]) by smtp.gmail.com with ESMTPSA id k6-20020adff5c6000000b0031122bd3c82sm8886794wrp.17.2023.06.19.05.02.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jun 2023 05:02:25 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Bin Meng , Nikhil M Jain , Simon Glass Subject: [PATCH v4 39/45] x86: Make sure that the LPC is active before SDRAM init Date: Mon, 19 Jun 2023 12:59:54 +0100 Message-ID: <20230619120011.1587499-9-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.162.gfafddb0af9-goog In-Reply-To: <20230619120011.1587499-1-sjg@chromium.org> References: <20230619120011.1587499-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 --- (no changes since v2) 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 6886587f647f..fb7dac68d7aa 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.41.0.162.gfafddb0af9-goog