From patchwork Mon Sep 26 03:34:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 674921 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 3sj8zK73Ppz9s65 for ; Mon, 26 Sep 2016 13:46:53 +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=VDIK+VEh; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 72524B3B16; Mon, 26 Sep 2016 05:41:12 +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 BBm6NvSKo3yP; Mon, 26 Sep 2016 05:41:12 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2F124A7812; Mon, 26 Sep 2016 05:37:28 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 125ABB3848 for ; Mon, 26 Sep 2016 05:35:59 +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 jjxj6T_Thj7F for ; Mon, 26 Sep 2016 05:35:58 +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-it0-f47.google.com (mail-it0-f47.google.com [209.85.214.47]) by theia.denx.de (Postfix) with ESMTPS id 69AE5B3898 for ; Mon, 26 Sep 2016 05:35:30 +0200 (CEST) Received: by mail-it0-f47.google.com with SMTP id n143so64086241ita.1 for ; Sun, 25 Sep 2016 20:35:30 -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=QZ3tN05ZtK61aR89EVoM4D2wziv3Tk7mMqZK83YYog4=; b=VDIK+VEhq5TmCG+9N//ya+x9eniicH+21Wp3QLAAR2SAtZntdlPWx5tKLawFB3uQsM Wz6Nz+euYOrWEsFnBndbyHT2hVKgGfIFjcMisGsqoDg9SXxpr30n+9qpu2jgsYn2F+fG L5tRFt61vNxbbMnadgHk+qMW/bF1ePbfPL79ZBTKUT269spbKXQHBFjFeGo32BqYWeIb 5ubInYc7hurd+jSYD6KKvBbjtvWKw7bpNXIYLMk5Nqc3OMNr2fa48UCRsGqxfCooHkgc QqdhWba9XtddLRz9DUA6LgAGeSP05HZ8kM4C/PKnXemIGQHhJdikMs4GAeibpE67dRNb 1xiQ== 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=QZ3tN05ZtK61aR89EVoM4D2wziv3Tk7mMqZK83YYog4=; b=MjyuebNyIaKmiyj16Eyhx/saQF8zvtcz7xrUPnvjbqzQjZ2CIMPCDwgV2o+ZiKfID5 vqycpWt6aPWSPqGF2CuvrR7rD0UT5x9O0DexRivf9X47tYHjhUkauwVjjiJnR/ztwAL6 Opekf3kGwjODX/qA62PTSwxVefltNOfSJWcz2lsLu9yweC3WavWQaG0uU3dDZgtTEMOl J2HAUY89Okq64iB9tRGe+tVtPE9k6VR1hT+7WIU9jeXKrkp58AXfwBRoMXBIKuBVbj5A YCudM9DKCiKefC8NFiN+9xZ4QfM2jksSxHfXF2pExIUGT0XZLPCmil38R9G3b5by9mCu K+Bg== X-Gm-Message-State: AA6/9Rnfe6/ikM3+mECcX+xLAxu+94dRD3x7Zv5fhEzd8Bxz/ycatYjT0F8F8mLIcwOsJJsT X-Received: by 10.36.139.4 with SMTP id g4mr15083738ite.97.1474860929063; Sun, 25 Sep 2016 20:35:29 -0700 (PDT) Received: from kaki.bld.corp.google.com ([2620:0:1005:12:61b7:f33c:9010:eb01]) by smtp.gmail.com with ESMTPSA id v7sm3143304ita.9.2016.09.25.20.35.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Sep 2016 20:35:25 -0700 (PDT) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id E9F352233BD; Sun, 25 Sep 2016 21:35:22 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Sun, 25 Sep 2016 21:34:16 -0600 Message-Id: <1474860866-16406-74-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 In-Reply-To: <1474860866-16406-1-git-send-email-sjg@chromium.org> References: <1474860866-16406-1-git-send-email-sjg@chromium.org> Subject: [U-Boot] [PATCH 73/82] x86: Change irq_already_routed to a local variable 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 avoids using BSS before SDRAM is set up in SPL. Signed-off-by: Simon Glass --- arch/x86/lib/pirq_routing.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/x86/lib/pirq_routing.c b/arch/x86/lib/pirq_routing.c index c98526d..5df3cab 100644 --- a/arch/x86/lib/pirq_routing.c +++ b/arch/x86/lib/pirq_routing.c @@ -11,9 +11,8 @@ #include #include -static bool irq_already_routed[16]; - -static u8 pirq_get_next_free_irq(struct udevice *dev, u8 *pirq, u16 bitmap) +static u8 pirq_get_next_free_irq(struct udevice *dev, u8 *pirq, u16 bitmap, + bool irq_already_routed[]) { int i, link; u8 irq = 0; @@ -55,9 +54,11 @@ void pirq_route_irqs(struct udevice *dev, struct irq_info *irq, int num) { unsigned char irq_slot[MAX_INTX_ENTRIES]; unsigned char pirq[CONFIG_MAX_PIRQ_LINKS]; + bool irq_already_routed[16]; int i, intx; memset(pirq, 0, CONFIG_MAX_PIRQ_LINKS); + memset(irq_already_routed, '\0', sizeof(irq_already_routed)); /* Set PCI IRQs */ for (i = 0; i < num; i++) { @@ -83,7 +84,8 @@ void pirq_route_irqs(struct udevice *dev, struct irq_info *irq, int num) /* yet not routed */ if (!pirq[link]) { - irq = pirq_get_next_free_irq(dev, pirq, bitmap); + irq = pirq_get_next_free_irq(dev, pirq, bitmap, + irq_already_routed); pirq[link] = irq; } else { irq = pirq[link];