From patchwork Mon Jul 27 21:47:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 500865 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 469BE1402BA for ; Tue, 28 Jul 2015 07:51:02 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b=lEGk6+Rp; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4C53E4BBA5; Mon, 27 Jul 2015 23:50:51 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hmplCzjGmVkg; Mon, 27 Jul 2015 23:50:51 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1040A4BD4F; Mon, 27 Jul 2015 23:49:59 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 09E374BBA0 for ; Mon, 27 Jul 2015 23:49:03 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QfskQ4UfwBKn for ; Mon, 27 Jul 2015 23:49:02 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-ig0-f170.google.com (mail-ig0-f170.google.com [209.85.213.170]) by theia.denx.de (Postfix) with ESMTPS id 6D24C4BB3F for ; Mon, 27 Jul 2015 23:48:53 +0200 (CEST) Received: by igk11 with SMTP id 11so81273375igk.1 for ; Mon, 27 Jul 2015 14:48:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=IzqttcztvMA5qqPi4PtvET1VITnxAaqs4f1aGyzpysM=; b=lEGk6+RpFNVkXfLkr4vspnYEOS3A8N9vmrh1IXhc9b+xW+f1Y+rY1oKnKoy3GNHUZh ai+6pXtEqfYojBnCQDC51H27GG78PHZfLVq/m0kJk9S3YwzrTnAnkW2JPiOshJpQ1AoS RfZRX2ohaeDJRVBdjEssMVtzgrYh2d+acsXgtlFQKFXtRWUmeV5clxY5/J66UhtXIZuM RwksEsmv6XAEYJYsj+KKIJRsYh9y2Btlky6hdtkJmYDCUMyD7Rw1vIa7mlb2abohq6xD VgYbRbek7er/R9DP6aIVIxUXO8inC6IPFP8f1WCpvWFCBqj6TGcZj/u+aebBhAARgkIk 1kVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=IzqttcztvMA5qqPi4PtvET1VITnxAaqs4f1aGyzpysM=; b=BW1Uz5tJwkkeDJKY95iFrBBn5CnwtIEz79MRuPj2k9gyki62krhffwWVBWzBaSDboy DpsHXTXd4lVINK7ZySt7Yy/vwrg4g10lNEkL2VwgHnH+bJxOgm6AkEHCsnqVfE2wRvYD zjgZ8HWC0nXQvUqJdtJTHAG1Yyvb6cpZ2Bw0wBaBWuOh6Rvvl8TN0xZeY61WlgiA+Thm HpvXnaCkBGiTncIxMef38uD/uCARgZlxc4tFfFQzMtqizClLo43f7H15zikoDR9GbX6T xWZi3l6jeuhzuubLg0wGFi9ecGuN2SJDN4/CbhtnfnUyAtTFI+6z+QHYJwh9ewtZ/xw3 OA8A== X-Gm-Message-State: ALoCoQlHwkB2rCTaHxi+Tl6MbspyeGIN+tbsHNqu9yRyFfP1ormb0O7FOe459GUoWXPxATZ2Jm5u X-Received: by 10.107.8.212 with SMTP id h81mr47589338ioi.125.1438033732806; Mon, 27 Jul 2015 14:48:52 -0700 (PDT) Received: from kaki.bld.corp.google.com ([2620:0:1005:1100:8837:c6fd:8093:9f6c]) by smtp.gmail.com with ESMTPSA id j20sm6948864igt.5.2015.07.27.14.48.49 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Jul 2015 14:48:49 -0700 (PDT) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id D43902218C1; Mon, 27 Jul 2015 15:48:46 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Mon, 27 Jul 2015 15:47:28 -0600 Message-Id: <1438033652-30435-13-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.5.0.rc2.392.g76e840b In-Reply-To: <1438033652-30435-1-git-send-email-sjg@chromium.org> References: <1438033652-30435-1-git-send-email-sjg@chromium.org> Cc: Graeme Russ , Tom Rini Subject: [U-Boot] [PATCH 12/15] x86: Split out fsp_init_phase_pci() code into a new function X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" This code may be useful for boards that use driver model for PCI. Note: It would be better to have driver model automatically call this function somehow. However for now it is probably safer to have it under board control. Signed-off-by: Simon Glass --- arch/x86/include/asm/fsp/fsp_support.h | 7 +++++++ arch/x86/lib/fsp/fsp_common.c | 11 ++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/arch/x86/include/asm/fsp/fsp_support.h b/arch/x86/include/asm/fsp/fsp_support.h index c6c7dc0..7317dda 100644 --- a/arch/x86/include/asm/fsp/fsp_support.h +++ b/arch/x86/include/asm/fsp/fsp_support.h @@ -207,4 +207,11 @@ void *fsp_get_bootloader_tmp_mem(const void *hob_list, u32 *len); */ void update_fsp_upd(struct upd_region *fsp_upd); +/** + * fsp_init_phase_pci() - Tell the FSP that we have completed PCI init + * + * @return 0 if OK, -EPERM if the FSP gave an error. + */ +int fsp_init_phase_pci(void); + #endif diff --git a/arch/x86/lib/fsp/fsp_common.c b/arch/x86/lib/fsp/fsp_common.c index c585710..6f72c6d 100644 --- a/arch/x86/lib/fsp/fsp_common.c +++ b/arch/x86/lib/fsp/fsp_common.c @@ -19,19 +19,24 @@ int print_cpuinfo(void) return default_print_cpuinfo(); } -int board_pci_post_scan(struct pci_controller *hose) +int fsp_init_phase_pci(void) { u32 status; /* call into FspNotify */ debug("Calling into FSP (notify phase INIT_PHASE_PCI): "); status = fsp_notify(NULL, INIT_PHASE_PCI); - if (status != FSP_SUCCESS) + if (status) debug("fail, error code %x\n", status); else debug("OK\n"); - return 0; + return status ? -EPERM : 0; +} + +int board_pci_post_scan(struct pci_controller *hose) +{ + return fsp_init_phase_pci(); } void board_final_cleanup(void)