From patchwork Tue Sep 22 18:45:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1369215 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; dmarc=pass (p=none dis=none) header.from=chromium.org 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=Phj+d8he; 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 4Bwr9H1Nl7z9sTS for ; Wed, 23 Sep 2020 04:55:31 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CDDDB826A0; Tue, 22 Sep 2020 20:48:59 +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="Phj+d8he"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id ACBB58260A; Tue, 22 Sep 2020 20:47:23 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oi1-x241.google.com (mail-oi1-x241.google.com [IPv6:2607:f8b0:4864:20::241]) (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 D514A825D1 for ; Tue, 22 Sep 2020 20:47:07 +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-oi1-x241.google.com with SMTP id 185so22139181oie.11 for ; Tue, 22 Sep 2020 11:47:07 -0700 (PDT) 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=VDwkSPIMp4DXTNVDkW3XogC1WKU6szlY+Ni7NEsepFI=; b=Phj+d8hefw8NEbnGOsRjS55ZwxzJpiVsnjrvYHof76d54rMYNbzBowgYxajfB06jnN EsjnjkBXNlZHdGrLMaspNLiJ3dfNFCEauJEkboWzox1pwg806NRc099HA+A3xi9yt70/ 5Y1gWO76+dJsvxRmY6jFWYsS9mWtrynv1RRb8= 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=VDwkSPIMp4DXTNVDkW3XogC1WKU6szlY+Ni7NEsepFI=; b=kIm7NcEJ0t9ZA4ombfFgMR+91Qfk//HAvaZJwuwHE42/vbuagirrXith2KCwQOmODf uKRqO00b+Seh029AayqQLjx8YCxE/cu6Dm6rd9pzS6nNbMV6YRZWAM/4/4TQZZSQUkDp DdcniDQlJr6jilaBFZE+0VU9bSCkztzekZtUSpctB/JoxW3+bp3NqUNrptkvPpRogCA1 /qQ2tGXR7vwTmcTLTq1c9JDDaKly5H1hgZ7MlNoOYioxJkHeHM/0hOXw27CefuawW6Pd y+xExIRjAM4Kt6FnTGhD+ZZZDSWKYHkQSpt2Brbq2YCBzNfER33lR6Gd7eRzi5Mx68Rp Ys/A== X-Gm-Message-State: AOAM532pzPyaaorEReUOUkxtHCa114mzw57jqRRaJ3HZG0/fVT2c1FHC sKYDU74JYmW/aap5BK5+qF50YY8W2ISIvi+M X-Google-Smtp-Source: ABdhPJwQTbC1mAoNZb3cWPTVBfisWYdCw0ExARzv4GYafas1Ep8rvDvMda6XNFNHWiRbKmyaFkR5PQ== X-Received: by 2002:aca:b143:: with SMTP id a64mr3369338oif.149.1600800426559; Tue, 22 Sep 2020 11:47:06 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id q24sm7622663oij.19.2020.09.22.11.47.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Sep 2020 11:47:06 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Wolfgang Wallner , Bin Meng , Bernhard Messerklinger , Simon Glass Subject: [PATCH v4 43/59] x86: Notify the FSP of the 'end firmware' event Date: Tue, 22 Sep 2020 12:45:28 -0600 Message-Id: <20200922124521.v4.43.Ia7eec1e1c8296f88a09208428f654efffa8f4d4c@changeid> X-Mailer: git-send-email 2.28.0.681.g6f77f65b4e-goog In-Reply-To: <20200922184544.2920969-1-sjg@chromium.org> References: <20200922184544.2920969-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 Send this notification when U-Boot is about to boot into Linux, as requested by the FSP. Currently this causes a crash with the APL FSP, so leave it disabled for now. Signed-off-by: Simon Glass --- (no changes since v1) arch/x86/cpu/cpu.c | 15 +++++++++++++++ arch/x86/lib/fsp/fsp_common.c | 16 ++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c index 69c14189d1f..f8692753963 100644 --- a/arch/x86/cpu/cpu.c +++ b/arch/x86/cpu/cpu.c @@ -189,6 +189,14 @@ __weak void board_final_init(void) { } +/* + * Implement a weak default function for boards that need to do some final + * processing before booting the OS. + */ +__weak void board_final_cleanup(void) +{ +} + int last_stage_init(void) { struct acpi_fadt __maybe_unused *fadt; @@ -218,6 +226,13 @@ int last_stage_init(void) } } + /* + * TODO(sjg@chromium.org): Move this to bootm_announce_and_cleanup() + * once APL FSP-S at 0x200000 does not overlap with the bzimage at + * 0x100000. + */ + board_final_cleanup(); + return 0; } #endif diff --git a/arch/x86/lib/fsp/fsp_common.c b/arch/x86/lib/fsp/fsp_common.c index ea529547254..4061fa244c4 100644 --- a/arch/x86/lib/fsp/fsp_common.c +++ b/arch/x86/lib/fsp/fsp_common.c @@ -60,6 +60,22 @@ void board_final_init(void) debug("OK\n"); } +void board_final_cleanup(void) +{ + u32 status; + + /* TODO(sjg@chromium.org): This causes Linux to crash */ + return; + + /* call into FspNotify */ + debug("Calling into FSP (notify phase INIT_PHASE_END_FIRMWARE): "); + status = fsp_notify(NULL, INIT_PHASE_END_FIRMWARE); + if (status) + debug("fail, error code %x\n", status); + else + debug("OK\n"); +} + int fsp_save_s3_stack(void) { struct udevice *dev;