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 C23A0C77B73 for ; Thu, 4 May 2023 23:08:12 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1D526861C2; Fri, 5 May 2023 00:59:42 +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="bdrB3AVb"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5D220860BC; Fri, 5 May 2023 00:59:20 +0200 (CEST) Received: from mail-io1-xd35.google.com (mail-io1-xd35.google.com [IPv6:2607:f8b0:4864:20::d35]) (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 99B8685FEC for ; Fri, 5 May 2023 00:59:16 +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-io1-xd35.google.com with SMTP id ca18e2360f4ac-7696975338aso26607639f.1 for ; Thu, 04 May 2023 15:59:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1683241155; x=1685833155; 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=XeJE0tkbx0lLcybM/q5bATCY/P2UxRHVoMQ93guVKTo=; b=bdrB3AVbSizaB4yFOjBDb3KT615jHuq9jej3/LbOAajGNdVdZ8NwdDssNPtimKAvy5 XJ7INQ31Zqpm854G7AGAHc4ADugFhPZZytpnx7BeU6/wfVJyPy4qV61tSERtp88tyD8Q 4ktNRD9VdSQtowMgtSRgTe51TInqSz2wmaaKM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683241155; x=1685833155; 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=XeJE0tkbx0lLcybM/q5bATCY/P2UxRHVoMQ93guVKTo=; b=VTCuzzBIXGINzkh+TL1hP8nP5J7GI+WVY8iZOlWyBFBjBzIN+JQkX5mFga3gno3iOn gdle2frWA1+xijwcQECeAiKC4YE7KJpx5sA7/CGgZsQkluwLBJSwE6NYyvlDIOi/YjFx zBWFnLUsiTFxElPsQPAFEJu9YZRiKwOfz0AuS/PZYG3bokLqgX0IsL235acQmZ/NHqqj mSjWGfrVOsvQHSQGzpcz0hLxhK8fCD810LdPBOVC2HZXcG4UGKe5Jgz3h2BvflqTxh8Y VhJU/Upy6M2rDBBg5A5b5SLmhf2JXf0l5amgpa5rAT9GeeeSDjmtqqEVaJpzswfC2q6g pECQ== X-Gm-Message-State: AC+VfDwZW0YeMlS7umn72JrPebHiIcivJBwkjha4x2zrOJw4o0QdVu6j zK3sSAg/WC28OI+8gUouy/FAj9G2//W0UIiyyYw= X-Google-Smtp-Source: ACHHUZ5R2JPTiRq0HwroIZPkVsl+YbAWPRz3eDCmhjFi8uHvBesWyesALotOGdKgyhQoru2wywxdEA== X-Received: by 2002:a6b:ee19:0:b0:753:2cc5:c8b7 with SMTP id i25-20020a6bee19000000b007532cc5c8b7mr274943ioh.3.1683241155241; Thu, 04 May 2023 15:59:15 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:b5a:9fa0:3da:54ec]) by smtp.gmail.com with ESMTPSA id e11-20020a5ede0b000000b007608af6dfb4sm39506iok.31.2023.05.04.15.59.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 15:59:14 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Nikhil M Jain , Bin Meng , Simon Glass Subject: [PATCH v3 39/43] x86: Make sure that the LPC is active before SDRAM init Date: Thu, 4 May 2023 16:58:25 -0600 Message-ID: <20230504225829.2537050-8-sjg@chromium.org> X-Mailer: git-send-email 2.40.1.521.gf1e218fcd8-goog In-Reply-To: <20230504225829.2537050-1-sjg@chromium.org> References: <20230504225829.2537050-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 6886587f647..fb7dac68d7a 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.1.521.gf1e218fcd8-goog