From patchwork Sun Jan 17 22:03:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 569329 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 247CF14076E for ; Mon, 18 Jan 2016 09:04:06 +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=S7d9RXjD; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 00DCDA74C6; Sun, 17 Jan 2016 23:04:00 +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 9rH9E_sPPCku; Sun, 17 Jan 2016 23:03:59 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 76BACA7766; Sun, 17 Jan 2016 23:03:56 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 81DCE4BFB9 for ; Sun, 17 Jan 2016 23:03:45 +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 O-QowA607XHz for ; Sun, 17 Jan 2016 23:03:45 +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-f47.google.com (mail-oi0-f47.google.com [209.85.218.47]) by theia.denx.de (Postfix) with ESMTPS id 171804BFB6 for ; Sun, 17 Jan 2016 23:03:41 +0100 (CET) Received: by mail-oi0-f47.google.com with SMTP id o124so155684386oia.3 for ; Sun, 17 Jan 2016 14:03:41 -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=X62yP1ce7OcC465Rbs0SH29P+w1cnSBigWhsc+cQuvI=; b=S7d9RXjDrofV/M2iCba44rTBE/w2nD5/eIcA9ZWwI1YXaGJ/CmAXqmtcqOotdUhU+r AoUyplCTnGba/n6kJxvqd0OlSIaloz34NjFkxCt3BQPIei/EhCzuHrUbRmYEmIXKhegv HX4fs/L6hzCuHZOz120k9hSaw/giU3WWzeKrZpKSUVcZRAmPrzSrr2U5s3Z8fZkpeoUD +3vTFFPdFNgZIPIe4aFyVGZtPYglokghz6isrSsOCEVX8o58L/HNDuGqsW8s98qH8Y2T cSaMBtb6/EuaJHAlHAzOSPLE+gS7IOS5RSZg7ruP9arQXDD1fOIEcVe2Bw1T97tVyUVW KcxA== 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=X62yP1ce7OcC465Rbs0SH29P+w1cnSBigWhsc+cQuvI=; b=KBD3SKHGLjvqFSVwbKxGMVVQXbDW4Ig7yAjGmOxT+kpJO+GGQJYrQJGcPmwWydnkEi pjtxGRmC7xtPYu1N7Z7tZa4Qqg8PyhLNFN1BzdW0oZW/p8EjxmVX5HjuAAxFlOv+TWxw uD3sgviAKKsLPBxjG882eC+nqbH97RxDtwcefJehuZqlaWdtW1wc10xWmqu79qW0o+8K OEh0zqRvDjCWAK2ZbyT4oVorPqstfU2sRiOh/PsuVBHXb4UjaLIZlLuh6x9ySiK1cLeP glwvQ1RNynpkBQ8YEz0z1r2J3yIaR3jfT1JwhpJLuU7QrMgaHx+yZJG8ub1nFa0M3dZ+ 6mjw== X-Gm-Message-State: AG10YOQZliOuhsqa/QMcTcFUQ90LBQtZWU/OFFXOCpXfwX4YPbfn+TLm1rxco9H7q97dG2CE X-Received: by 10.202.193.131 with SMTP id r125mr2315597oif.30.1453068220523; Sun, 17 Jan 2016 14:03:40 -0800 (PST) Received: from kaki.bld.corp.google.com ([172.29.216.32]) by smtp.gmail.com with ESMTPSA id m2sm11585686oia.7.2016.01.17.14.03.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 Jan 2016 14:03:39 -0800 (PST) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 8DA972208DE; Sun, 17 Jan 2016 15:03:37 -0700 (MST) From: Simon Glass To: U-Boot Mailing List Date: Sun, 17 Jan 2016 15:03:29 -0700 Message-Id: <1453068212-8922-4-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.6.0.rc2.230.g3dd15c0 In-Reply-To: <1453068212-8922-1-git-send-email-sjg@chromium.org> References: <1453068212-8922-1-git-send-email-sjg@chromium.org> Subject: [U-Boot] [PATCH 3/6] dm: x86: Add a common PIRQ init 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" Most x86 interrupt drivers will want to use the standard PIRQ routing and table setup. Put this code in a common function so it can be used by those drivers that want it. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- arch/x86/cpu/irq.c | 7 ++++++- arch/x86/include/asm/irq.h | 7 +++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/arch/x86/cpu/irq.c b/arch/x86/cpu/irq.c index 8f59b23..e2feba7 100644 --- a/arch/x86/cpu/irq.c +++ b/arch/x86/cpu/irq.c @@ -231,7 +231,7 @@ static int create_pirq_routing_table(void) return 0; } -int irq_router_probe(struct udevice *dev) +int irq_router_common_init(struct udevice *dev) { int ret; @@ -249,6 +249,11 @@ int irq_router_probe(struct udevice *dev) return 0; } +int irq_router_probe(struct udevice *dev) +{ + return irq_router_common_init(dev); +} + u32 write_pirq_routing_table(u32 addr) { if (!pirq_routing_table) diff --git a/arch/x86/include/asm/irq.h b/arch/x86/include/asm/irq.h index 74da66e..46e1c31 100644 --- a/arch/x86/include/asm/irq.h +++ b/arch/x86/include/asm/irq.h @@ -65,4 +65,11 @@ struct pirq_routing { */ void cpu_irq_init(void); +/** + * irq_router_common_init() - Perform common x86 interrupt init + * + * This creates the PIRQ routing table and routes the IRQs + */ +int irq_router_common_init(struct udevice *dev); + #endif /* _ARCH_IRQ_H_ */