From patchwork Mon Oct 21 03:38:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1180201 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=none (no SPF record) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="B6XQ+8bJ"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46xMvl2jqfz9sPL for ; Mon, 21 Oct 2019 14:44:35 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id F2817C21E16; Mon, 21 Oct 2019 03:42:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 9CB52C21C2C; Mon, 21 Oct 2019 03:42:48 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 2E0D2C21DA1; Mon, 21 Oct 2019 03:40:21 +0000 (UTC) Received: from mail-il1-f194.google.com (mail-il1-f194.google.com [209.85.166.194]) by lists.denx.de (Postfix) with ESMTPS id 6B3C7C21DD4 for ; Mon, 21 Oct 2019 03:40:21 +0000 (UTC) Received: by mail-il1-f194.google.com with SMTP id i12so172727ils.6 for ; Sun, 20 Oct 2019 20:40:21 -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=Jkn0i/hThihX+c7o12n8ZT4sn7F87AQFyCIKY7m/qp0=; b=B6XQ+8bJTo4dCA8MRweJtX3Eafoc5KjgLfzcKdPqV26lycRMS+h5BJaD4026JQdro7 DsRQTl16R/L7zaIJzABHQKsvnwIpESp7H7PM9wTpGSxTshKzkn54fYfUPSM7G8vucr9P 6fpEE6chzi6O8CJafvxXeZ1Os7irev2jMGT/M= 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=Jkn0i/hThihX+c7o12n8ZT4sn7F87AQFyCIKY7m/qp0=; b=OXqQekZB8qiqrhCzpz6tFzEQLz/0MDGbH9zO3ubs1j+aIU/UMRD/VBZ05layj00hz5 vmq9PBt9J4WG6nMxqC0Jof/Y5C3GPUB8AxhXjq6WjvkTrcZLTTa1OHlMd91L9upN9MSn IxOcU4PZvvYXomhWJyznKHUXlFRbhs/hdURSOHwX26wEmhExWMLlduI3Jdu9x5nDTj9Z /qZuXgZs+k8BGyokrf78+Y8y3iSqRECo0/8lkZKXOvA51DWOggPm7kEwdn8RFiWERkBp 7VplGb2kMSN8jlg4Idcc0VdDdcuH+DGjp31qWlC8s45R/zWVzxqXeK8eKB/Cz04KSkQh zUOQ== X-Gm-Message-State: APjAAAU6AJSzp7IG2+fl+PkU/HIe81ZIzJH8lhWOe99kFFPUXs5r+GZC IkrZfyZVhpX2VAoZx9X0I0MYTyyUXX/3Sw== X-Google-Smtp-Source: APXvYqxZ6eHUZSD9ZCx3+cwrlB8PgHnx0cy45awMA4eEYpGY3f6au4v4wPdEWIr94wAMgfKB8rHaFQ== X-Received: by 2002:a92:580d:: with SMTP id m13mr704702ilb.117.1571629220208; Sun, 20 Oct 2019 20:40:20 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id x14sm1947028ion.67.2019.10.20.20.40.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Oct 2019 20:40:19 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sun, 20 Oct 2019 21:38:14 -0600 Message-Id: <20191021033913.220758-49-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.866.gb869b98d4c-goog In-Reply-To: <20191021033913.220758-22-sjg@chromium.org> References: <20191021033913.220758-22-sjg@chromium.org> MIME-Version: 1.0 Cc: Vagrant Cascadian Subject: [U-Boot] [PATCH v3 049/108] x86: Move fsp_prepare_mrc_cache() to fsp1 directory X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" This function needs to be different for FSP2, so move the existing function into the fsp1 directory. Since it is only called from one file, drop it from the header file. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- Changes in v3: None Changes in v2: None arch/x86/include/asm/fsp/fsp_support.h | 7 ------- arch/x86/lib/fsp/fsp_common.c | 20 -------------------- arch/x86/lib/fsp1/fsp_common.c | 20 ++++++++++++++++++++ 3 files changed, 20 insertions(+), 27 deletions(-) diff --git a/arch/x86/include/asm/fsp/fsp_support.h b/arch/x86/include/asm/fsp/fsp_support.h index 4ac27d26f55..29e511415cd 100644 --- a/arch/x86/include/asm/fsp/fsp_support.h +++ b/arch/x86/include/asm/fsp/fsp_support.h @@ -143,13 +143,6 @@ int fsp_init_phase_pci(void); */ int fsp_scan_for_ram_size(void); -/** - * fsp_prepare_mrc_cache() - Find the DRAM training data from the MRC cache - * - * @return pointer to data, or NULL if no cache or no data found in the cache - */ -void *fsp_prepare_mrc_cache(void); - /** * fsp_notify() - FSP notification wrapper function * diff --git a/arch/x86/lib/fsp/fsp_common.c b/arch/x86/lib/fsp/fsp_common.c index c1c30ce0eb6..6b7a614e929 100644 --- a/arch/x86/lib/fsp/fsp_common.c +++ b/arch/x86/lib/fsp/fsp_common.c @@ -57,26 +57,6 @@ void board_final_cleanup(void) debug("OK\n"); } -void *fsp_prepare_mrc_cache(void) -{ - struct mrc_data_container *cache; - struct mrc_region entry; - int ret; - - ret = mrccache_get_region(MRC_TYPE_NORMAL, NULL, &entry); - if (ret) - return NULL; - - cache = mrccache_find_current(&entry); - if (!cache) - return NULL; - - debug("%s: mrc cache at %p, size %x checksum %04x\n", __func__, - cache->data, cache->data_size, cache->checksum); - - return cache->data; -} - #ifdef CONFIG_HAVE_ACPI_RESUME int fsp_save_s3_stack(void) { diff --git a/arch/x86/lib/fsp1/fsp_common.c b/arch/x86/lib/fsp1/fsp_common.c index e8066d8de39..ec9c218778d 100644 --- a/arch/x86/lib/fsp1/fsp_common.c +++ b/arch/x86/lib/fsp1/fsp_common.c @@ -18,6 +18,26 @@ DECLARE_GLOBAL_DATA_PTR; +static void *fsp_prepare_mrc_cache(void) +{ + struct mrc_data_container *cache; + struct mrc_region entry; + int ret; + + ret = mrccache_get_region(MRC_TYPE_NORMAL, NULL, &entry); + if (ret) + return NULL; + + cache = mrccache_find_current(&entry); + if (!cache) + return NULL; + + debug("%s: mrc cache at %p, size %x checksum %04x\n", __func__, + cache->data, cache->data_size, cache->checksum); + + return cache->data; +} + int arch_fsp_init(void) { void *nvs;