From patchwork Sun Jun 17 12:57:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 930503 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 (mailfrom) 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=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ajhMasBg"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 417vMM32stz9s4n for ; Sun, 17 Jun 2018 22:54:55 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 262DDC21E15; Sun, 17 Jun 2018 12:53:56 +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=FREEMAIL_FROM, 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 8F359C21E07; Sun, 17 Jun 2018 12:53:15 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 13FDDC21E12; Sun, 17 Jun 2018 12:53:09 +0000 (UTC) Received: from mail-pf0-f194.google.com (mail-pf0-f194.google.com [209.85.192.194]) by lists.denx.de (Postfix) with ESMTPS id 67C8CC21DA1 for ; Sun, 17 Jun 2018 12:53:05 +0000 (UTC) Received: by mail-pf0-f194.google.com with SMTP id y8-v6so6885859pfm.10 for ; Sun, 17 Jun 2018 05:53:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=F3d3K6oZSN+vH5CMC6StuSK4nNV5il2Gx7QAXeAvuPM=; b=ajhMasBgYYc4PXFIOLGslG1YrBhueGjGFX5Msj5NmOueOA2htiYzIYO4BpHU7EsEn9 9Gk+LHPNBClM3+doUeCAa5YaNC6+T3sDzmSxWpdZblaOKj/li7DmX3CYfAN9JOL2ppNY /b/gevUxvEYJ8AgY6JclCE6CMs0zFD4/WMKxAexPEqc3Lru+riMF+6Du9QLi4BKaG+BZ MWb+p4Z9wCa0D2yKNs5QIXY5gZ2tZqahWX1gBgdSBYC+OSboprZYM61kOu8yYJOu8AbR hkBEanOTzTFDp9Um/7GIfSesmSihZdnaJzyFIEXjOzgRtfVpwd0SQz1FpyCR+Lrf2voi AXvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=F3d3K6oZSN+vH5CMC6StuSK4nNV5il2Gx7QAXeAvuPM=; b=Tl1T7iqBVrAYqv/2zCn7J60bDpUPq72AHIPO5SES7khg3V9iITONiTRyT1KSmWSjCM z4XN+Y1o+WsNWGORyFnD00oU/U7tT2ugyMzCRtKWbNSvnN6hBaVb07z/wUtSauS/m8Er bx0Bc9Jg9dmfVQFsv4n8CMDnQ/VrPdHvT3+5Ptc0f5/TeIYsSaHlomRmfszBFW5A/mhE o6v8F85wMysEmYD9L82+GmBNK2el6PLNiQt71lUMxQK1iG9wccBP6zF/XGmTvE+EX1VY If/Ry1UCKUmS222rdE+X0tJdqcWUdKK6ZlkT+VaLQjPdsSyz8KUdywkr6uiBUHf309zZ u0hA== X-Gm-Message-State: APt69E0yHyNY51Uotp2lGk8p3br9PLeButGY4GRy1xSvBrHBBOwvdcSS HaMhRLO9IawzQ4nnPgJZ3LaFCA== X-Google-Smtp-Source: ADUXVKINYsnjfG9g/76oaKmRIJEFSmxvu/1pcP79VGGqPWlWv4L+jiDK+AbSTRdCaKeacOqWH7kQdA== X-Received: by 2002:a62:e208:: with SMTP id a8-v6mr9527217pfi.6.1529239984074; Sun, 17 Jun 2018 05:53:04 -0700 (PDT) Received: from ala-d2121-lx1.wrs.com (unknown-156-139.windriver.com. [147.11.156.139]) by smtp.gmail.com with ESMTPSA id o77-v6sm22880941pfj.0.2018.06.17.05.53.02 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 17 Jun 2018 05:53:03 -0700 (PDT) From: Bin Meng To: Simon Glass , U-Boot Mailing List Date: Sun, 17 Jun 2018 05:57:52 -0700 Message-Id: <1529240273-32045-4-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1529240273-32045-1-git-send-email-bmeng.cn@gmail.com> References: <1529240273-32045-1-git-send-email-bmeng.cn@gmail.com> Subject: [U-Boot] [PATCH 4/5] x86: efi-x86_payload: Enumerate PCI bus during early boot 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: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The generic efi payload currently does not enumerate the PCI bus, which means peripherals on the PCI bus are not discovered by their drivers. This uses board_early_init_r() to do the PCI enumeration. Signed-off-by: Bin Meng Reviewed-by: Simon Glass --- board/efi/efi-x86_payload/Kconfig | 1 + board/efi/efi-x86_payload/Makefile | 2 +- board/efi/efi-x86_payload/payload.c | 18 ++++++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 board/efi/efi-x86_payload/payload.c diff --git a/board/efi/efi-x86_payload/Kconfig b/board/efi/efi-x86_payload/Kconfig index b6e57b9..08dd0c2 100644 --- a/board/efi/efi-x86_payload/Kconfig +++ b/board/efi/efi-x86_payload/Kconfig @@ -17,6 +17,7 @@ config SYS_TEXT_BASE config BOARD_SPECIFIC_OPTIONS # dummy def_bool y + select BOARD_EARLY_INIT_R imply SYS_NS16550 imply SCSI imply SCSI_AHCI diff --git a/board/efi/efi-x86_payload/Makefile b/board/efi/efi-x86_payload/Makefile index 6982340..00ef695 100644 --- a/board/efi/efi-x86_payload/Makefile +++ b/board/efi/efi-x86_payload/Makefile @@ -2,4 +2,4 @@ # # Copyright (C) 2018, Bin Meng -obj-y += start.o +obj-y += start.o payload.o diff --git a/board/efi/efi-x86_payload/payload.c b/board/efi/efi-x86_payload/payload.c new file mode 100644 index 0000000..4eeb49a --- /dev/null +++ b/board/efi/efi-x86_payload/payload.c @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2018, Bin Meng + */ + +#include +#include + +int board_early_init_r(void) +{ + /* + * Make sure PCI bus is enumerated so that peripherals on the PCI bus + * can be discovered by their drivers + */ + pci_init(); + + return 0; +}