From patchwork Sun Jan 17 23:11:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 569358 X-Patchwork-Delegate: bmeng.cn@gmail.com 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 C2F56140662 for ; Mon, 18 Jan 2016 10:18:49 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b=AyxZT/FK; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 18918A784F; Mon, 18 Jan 2016 00:14:41 +0100 (CET) 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 ciIECdL50yFr; Mon, 18 Jan 2016 00:14:41 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4590FB384B; Mon, 18 Jan 2016 00:13:22 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AA534A77FB for ; Mon, 18 Jan 2016 00:12:42 +0100 (CET) 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 I6tV8nBexHcT for ; Mon, 18 Jan 2016 00:12:42 +0100 (CET) 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-oi0-f45.google.com (mail-oi0-f45.google.com [209.85.218.45]) by theia.denx.de (Postfix) with ESMTPS id 12732A7809 for ; Mon, 18 Jan 2016 00:12:38 +0100 (CET) Received: by mail-oi0-f45.google.com with SMTP id o124so156172772oia.3 for ; Sun, 17 Jan 2016 15:12:38 -0800 (PST) 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=XE+H11FVpMgaS9mZnZIvQB+ZtlmCbsQUMkS4AtqlrHc=; b=AyxZT/FKJVeyfcU28bE6vyEDvLDigRL5CaINbX8W01iceKaX/zPEiSN30yUH3Ql5bw esylxd059X73/5puSX0e/exM03J1B0dkVAzdqUW42d4+gSuMmlHnvYc1GteQMgdyhJap AhydkfPFcVPMKIe8uX4N+GpcaWiLRysF2f/WR3ev971iawx06Wla1h4Cfk8/hOjrsqxk YcFAjebxt4ykEkoGNkeMY+oU1g8hQkz48KR1SB+OLt0MqZNPZDYCEZM0/GNpKRxmzGbA CYBFHyiUUakjmkhfpucF160m38KCEGUPr+Gvue4mogL6xb/9J/43+PWnI04+6NkbZuMR 1ZsQ== 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=XE+H11FVpMgaS9mZnZIvQB+ZtlmCbsQUMkS4AtqlrHc=; b=VYrAM+ktNSsu8zcoh28ZNFR0irj/v08g0VkZRaPZ+yFu2GoQwfuZTX8fi717kDr/4p nUY/whRAneRJbsWwTLbRR4if9WzWvDI28qU/EdugVgiwIYnzVmoEaBH8Cqnk0rNAQynD 4/48HuzNj36WYm8t2i0m2TAyuAaWCCeiRTCfPNXsbPrwRytVzsrvIEFEBFHntAoXFsMz TAmhQ96u27oahs9wRCSsKqfwMOtpZtmLA1Km2wAdpGyCx9kCZy21lKXv4eKrmM3+dLB6 m7o0jCP1r5oUS6bNBKxKODoQEGnpw4nh8O/Qlx4gC3H8vRyUqknucNylnXC7b6L6pXkv zTcQ== X-Gm-Message-State: ALoCoQklrS4le+hqFXiKrvmXWTt6/imG4z4t6RmJ8SA8rgcgR6bxcfNp/NxD+R5GEqjw3a3XrwNHpeoJAP+RjF+56vZ39jt2/Q== X-Received: by 10.202.226.141 with SMTP id z135mr15908190oig.21.1453072356837; Sun, 17 Jan 2016 15:12:36 -0800 (PST) Received: from kaki.bld.corp.google.com ([2620:0:1005:1100:d10c:1639:34ee:6c38]) by smtp.gmail.com with ESMTPSA id w143sm11731103oiw.16.2016.01.17.15.12.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 Jan 2016 15:12:36 -0800 (PST) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id E05E12220D3; Sun, 17 Jan 2016 16:12:29 -0700 (MST) From: Simon Glass To: U-Boot Mailing List Date: Sun, 17 Jan 2016 16:11:40 -0700 Message-Id: <1453072320-24298-36-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.6.0.rc2.230.g3dd15c0 In-Reply-To: <1453072320-24298-1-git-send-email-sjg@chromium.org> References: <1453072320-24298-1-git-send-email-sjg@chromium.org> Subject: [U-Boot] [PATCH v2 35/55] x86: ivybridge: Move LPC init into the LPC probe() method 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" Drop the lpc_init_extra() function and just use the post-relocation LPC probe() instead. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- Changes in v2: - Update to use LPC probe() method instead of init() arch/x86/cpu/ivybridge/bd82x6x.c | 4 ---- arch/x86/cpu/ivybridge/lpc.c | 17 +++++++++-------- arch/x86/include/asm/arch-ivybridge/pch.h | 2 -- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/arch/x86/cpu/ivybridge/bd82x6x.c b/arch/x86/cpu/ivybridge/bd82x6x.c index 9e7e30a..5cb4152 100644 --- a/arch/x86/cpu/ivybridge/bd82x6x.c +++ b/arch/x86/cpu/ivybridge/bd82x6x.c @@ -21,16 +21,12 @@ static int bd82x6x_probe(struct udevice *dev) { const void *blob = gd->fdt_blob; - struct pci_controller *hose; int gma_node; int ret; if (!(gd->flags & GD_FLG_RELOC)) return 0; - hose = pci_bus_to_hose(0); - lpc_init_extra(hose, PCH_LPC_DEV); - /* Cause the SATA device to do its init */ uclass_first_device(UCLASS_DISK, &dev); diff --git a/arch/x86/cpu/ivybridge/lpc.c b/arch/x86/cpu/ivybridge/lpc.c index 44c4825..79224d9 100644 --- a/arch/x86/cpu/ivybridge/lpc.c +++ b/arch/x86/cpu/ivybridge/lpc.c @@ -538,7 +538,7 @@ static int lpc_early_init(struct udevice *dev) return 0; } -int lpc_init_extra(struct pci_controller *hose, pci_dev_t dev) +static int lpc_init_extra(struct pci_controller *hose, pci_dev_t dev) { const void *blob = gd->fdt_blob; int node; @@ -626,16 +626,17 @@ static int bd82x6x_lpc_probe(struct udevice *dev) { int ret; - if (gd->flags & GD_FLG_RELOC) - return 0; + if (!(gd->flags & GD_FLG_RELOC)) { + ret = lpc_early_init(dev); + if (ret) { + debug("%s: lpc_early_init() failed\n", __func__); + return ret; + } - ret = lpc_early_init(dev); - if (ret) { - debug("%s: lpc_early_init() failed\n", __func__); - return ret; + return bd82x6x_lpc_early_init(dev); } - return bd82x6x_lpc_early_init(dev); + return lpc_init_extra(pci_bus_to_hose(0), PCH_LPC_DEV); } static const struct udevice_id bd82x6x_lpc_ids[] = { diff --git a/arch/x86/include/asm/arch-ivybridge/pch.h b/arch/x86/include/asm/arch-ivybridge/pch.h index 682a557..629a144 100644 --- a/arch/x86/include/asm/arch-ivybridge/pch.h +++ b/arch/x86/include/asm/arch-ivybridge/pch.h @@ -470,6 +470,4 @@ void pch_iobp_update(u32 address, u32 andvalue, u32 orvalue); #define DMISCI_STS (1 << 9) #define TCO2_STS 0x66 -int lpc_init_extra(struct pci_controller *hose, pci_dev_t dev); - #endif